nomoreide 0.1.3 → 0.1.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/dist/cli/commands.js +3 -123
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/errors.d.ts +2 -0
- package/dist/cli/errors.js +3 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/flags.d.ts +1 -0
- package/dist/cli/flags.js +19 -0
- package/dist/cli/flags.js.map +1 -0
- package/dist/cli/git.d.ts +2 -0
- package/dist/cli/git.js +106 -0
- package/dist/cli/git.js.map +1 -0
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.js +8 -220
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools.d.ts +15 -0
- package/dist/mcp/tools.js +225 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/web/client/assets/{index-C4XXZmaJ.js → index-BoxCtr55.js} +7 -7
- package/dist/web/client/assets/index-DjemXvIv.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/dashboard.d.ts +36 -0
- package/dist/web/dashboard.js +119 -0
- package/dist/web/dashboard.js.map +1 -0
- package/dist/web/directories.d.ts +9 -0
- package/dist/web/directories.js +21 -0
- package/dist/web/directories.js.map +1 -0
- package/dist/web/http-utils.d.ts +8 -0
- package/dist/web/http-utils.js +43 -0
- package/dist/web/http-utils.js.map +1 -0
- package/dist/web/server.js +5 -243
- package/dist/web/server.js.map +1 -1
- package/dist/web/static-assets.d.ts +3 -0
- package/dist/web/static-assets.js +64 -0
- package/dist/web/static-assets.js.map +1 -0
- package/package.json +1 -1
- package/dist/web/client/assets/index-NzUlF8mN.css +0 -1
package/dist/cli/commands.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import { ConfigStore, ConfigValidationError } from "../core/config-store.js";
|
|
3
|
-
import { GitManager } from "../core/git-manager.js";
|
|
4
3
|
import { LogStore } from "../core/log-store.js";
|
|
5
4
|
import { ProcessManager } from "../core/process-manager.js";
|
|
5
|
+
import { UsageError } from "./errors.js";
|
|
6
|
+
import { parseFlags } from "./flags.js";
|
|
7
|
+
import { runGitCli } from "./git.js";
|
|
6
8
|
export async function runCli(args, options = {}) {
|
|
7
9
|
const stdout = options.stdout ?? ((line) => console.log(line));
|
|
8
10
|
const stderr = options.stderr ?? ((line) => console.error(line));
|
|
@@ -95,126 +97,4 @@ export async function runCli(args, options = {}) {
|
|
|
95
97
|
return error instanceof UsageError || error instanceof ConfigValidationError ? 1 : 2;
|
|
96
98
|
}
|
|
97
99
|
}
|
|
98
|
-
class UsageError extends Error {
|
|
99
|
-
}
|
|
100
|
-
async function runGitCli(subcommand, args, stdout, configStore) {
|
|
101
|
-
const flags = parseFlags(args);
|
|
102
|
-
const cwd = flags.cwd ?? process.cwd();
|
|
103
|
-
const positional = args.filter((arg, index) => {
|
|
104
|
-
if (!arg.startsWith("--")) {
|
|
105
|
-
const previous = args[index - 1];
|
|
106
|
-
return !(previous?.startsWith("--") && !previous.includes("="));
|
|
107
|
-
}
|
|
108
|
-
return false;
|
|
109
|
-
});
|
|
110
|
-
const git = new GitManager(cwd);
|
|
111
|
-
if (subcommand === "status") {
|
|
112
|
-
const status = await git.status();
|
|
113
|
-
stdout(`Branch\t${status.branch || "(detached)"}`);
|
|
114
|
-
for (const file of status.files) {
|
|
115
|
-
stdout(`${file.index}${file.workingTree}\t${file.path}`);
|
|
116
|
-
}
|
|
117
|
-
return 0;
|
|
118
|
-
}
|
|
119
|
-
if (subcommand === "add-repo") {
|
|
120
|
-
const name = positional[0];
|
|
121
|
-
if (!name) {
|
|
122
|
-
throw new UsageError("repository name is required");
|
|
123
|
-
}
|
|
124
|
-
if (!flags.path) {
|
|
125
|
-
throw new UsageError("--path is required");
|
|
126
|
-
}
|
|
127
|
-
await configStore.registerGitRepository({ name, path: flags.path });
|
|
128
|
-
stdout(`Registered Git repository ${name}`);
|
|
129
|
-
return 0;
|
|
130
|
-
}
|
|
131
|
-
if (subcommand === "select-repo") {
|
|
132
|
-
const name = positional[0];
|
|
133
|
-
if (!name) {
|
|
134
|
-
throw new UsageError("repository name is required");
|
|
135
|
-
}
|
|
136
|
-
await configStore.selectGitRepository(name);
|
|
137
|
-
stdout(`Selected Git repository ${name}`);
|
|
138
|
-
return 0;
|
|
139
|
-
}
|
|
140
|
-
if (subcommand === "diff") {
|
|
141
|
-
stdout(await git.diff(positional[0]));
|
|
142
|
-
return 0;
|
|
143
|
-
}
|
|
144
|
-
if (subcommand === "staged-diff") {
|
|
145
|
-
stdout(await git.stagedDiff(positional[0]));
|
|
146
|
-
return 0;
|
|
147
|
-
}
|
|
148
|
-
if (subcommand === "log") {
|
|
149
|
-
for (const entry of await git.log(flags.limit ? Number(flags.limit) : 10)) {
|
|
150
|
-
stdout(`${entry.hash.slice(0, 8)}\t${entry.subject}`);
|
|
151
|
-
}
|
|
152
|
-
return 0;
|
|
153
|
-
}
|
|
154
|
-
if (subcommand === "branch") {
|
|
155
|
-
for (const branch of await git.branches()) {
|
|
156
|
-
const marker = branch.current ? "*" : " ";
|
|
157
|
-
const scope = branch.remote ? "remote" : "local";
|
|
158
|
-
stdout(`${marker}\t${branch.name}\t${scope}\t${branch.upstream ?? "-"}`);
|
|
159
|
-
}
|
|
160
|
-
return 0;
|
|
161
|
-
}
|
|
162
|
-
if (subcommand === "switch") {
|
|
163
|
-
const name = positional[0];
|
|
164
|
-
if (!name) {
|
|
165
|
-
throw new UsageError("branch name is required");
|
|
166
|
-
}
|
|
167
|
-
stdout(await git.switchBranch(name));
|
|
168
|
-
return 0;
|
|
169
|
-
}
|
|
170
|
-
if (subcommand === "create-branch") {
|
|
171
|
-
const name = positional[0];
|
|
172
|
-
if (!name) {
|
|
173
|
-
throw new UsageError("branch name is required");
|
|
174
|
-
}
|
|
175
|
-
stdout(await git.createBranch(name));
|
|
176
|
-
return 0;
|
|
177
|
-
}
|
|
178
|
-
if (subcommand === "fetch") {
|
|
179
|
-
stdout(await git.fetch());
|
|
180
|
-
return 0;
|
|
181
|
-
}
|
|
182
|
-
if (subcommand === "stage") {
|
|
183
|
-
await git.stage(positional);
|
|
184
|
-
stdout(`Staged ${positional.join(", ")}`);
|
|
185
|
-
return 0;
|
|
186
|
-
}
|
|
187
|
-
if (subcommand === "unstage") {
|
|
188
|
-
await git.unstage(positional);
|
|
189
|
-
stdout(`Unstaged ${positional.join(", ")}`);
|
|
190
|
-
return 0;
|
|
191
|
-
}
|
|
192
|
-
if (subcommand === "commit") {
|
|
193
|
-
const message = flags.message;
|
|
194
|
-
if (!message) {
|
|
195
|
-
throw new UsageError("--message is required");
|
|
196
|
-
}
|
|
197
|
-
stdout(await git.commit(message));
|
|
198
|
-
return 0;
|
|
199
|
-
}
|
|
200
|
-
throw new UsageError("Usage: nomoreide git [status|branch|switch|create-branch|fetch|diff|staged-diff|log|stage|unstage|commit]");
|
|
201
|
-
}
|
|
202
|
-
function parseFlags(args) {
|
|
203
|
-
const flags = {};
|
|
204
|
-
for (let index = 0; index < args.length; index += 1) {
|
|
205
|
-
const arg = args[index];
|
|
206
|
-
if (!arg?.startsWith("--")) {
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
const [key, inlineValue] = arg.slice(2).split("=", 2);
|
|
210
|
-
flags[toCamelCase(key)] = inlineValue ?? args[index + 1];
|
|
211
|
-
if (!inlineValue) {
|
|
212
|
-
index += 1;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
return flags;
|
|
216
|
-
}
|
|
217
|
-
function toCamelCase(input) {
|
|
218
|
-
return input.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
219
|
-
}
|
|
220
100
|
//# sourceMappingURL=commands.js.map
|
package/dist/cli/commands.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../src/cli/commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,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ACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC/D,OAAO,KAAK,YAAY,UAAU,IAAI,KAAK,YAAY,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACvF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/cli/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseFlags(args: string[]): Record<string, string | undefined>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export function parseFlags(args) {
|
|
2
|
+
const flags = {};
|
|
3
|
+
for (let index = 0; index < args.length; index += 1) {
|
|
4
|
+
const arg = args[index];
|
|
5
|
+
if (!arg?.startsWith("--")) {
|
|
6
|
+
continue;
|
|
7
|
+
}
|
|
8
|
+
const [key, inlineValue] = arg.slice(2).split("=", 2);
|
|
9
|
+
flags[toCamelCase(key)] = inlineValue ?? args[index + 1];
|
|
10
|
+
if (!inlineValue) {
|
|
11
|
+
index += 1;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return flags;
|
|
15
|
+
}
|
|
16
|
+
function toCamelCase(input) {
|
|
17
|
+
return input.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../../src/cli/flags.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,UAAU,CAAC,IAAc;IACvC,MAAM,KAAK,GAAuC,EAAE,CAAC;IAErD,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAExB,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,SAAS;QACX,CAAC;QAED,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;QACtD,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,WAAW,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,KAAK,IAAI,CAAC,CAAC;QACb,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,WAAW,CAAC,KAAa;IAChC,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAc,EAAE,EAAE,CAC3D,MAAM,CAAC,WAAW,EAAE,CACrB,CAAC;AACJ,CAAC"}
|
package/dist/cli/git.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { GitManager } from "../core/git-manager.js";
|
|
2
|
+
import { UsageError } from "./errors.js";
|
|
3
|
+
import { parseFlags } from "./flags.js";
|
|
4
|
+
export async function runGitCli(subcommand, args, stdout, configStore) {
|
|
5
|
+
const flags = parseFlags(args);
|
|
6
|
+
const cwd = flags.cwd ?? process.cwd();
|
|
7
|
+
const positional = args.filter((arg, index) => {
|
|
8
|
+
if (!arg.startsWith("--")) {
|
|
9
|
+
const previous = args[index - 1];
|
|
10
|
+
return !(previous?.startsWith("--") && !previous.includes("="));
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
});
|
|
14
|
+
const git = new GitManager(cwd);
|
|
15
|
+
if (subcommand === "status") {
|
|
16
|
+
const status = await git.status();
|
|
17
|
+
stdout(`Branch\t${status.branch || "(detached)"}`);
|
|
18
|
+
for (const file of status.files) {
|
|
19
|
+
stdout(`${file.index}${file.workingTree}\t${file.path}`);
|
|
20
|
+
}
|
|
21
|
+
return 0;
|
|
22
|
+
}
|
|
23
|
+
if (subcommand === "add-repo") {
|
|
24
|
+
const name = positional[0];
|
|
25
|
+
if (!name) {
|
|
26
|
+
throw new UsageError("repository name is required");
|
|
27
|
+
}
|
|
28
|
+
if (!flags.path) {
|
|
29
|
+
throw new UsageError("--path is required");
|
|
30
|
+
}
|
|
31
|
+
await configStore.registerGitRepository({ name, path: flags.path });
|
|
32
|
+
stdout(`Registered Git repository ${name}`);
|
|
33
|
+
return 0;
|
|
34
|
+
}
|
|
35
|
+
if (subcommand === "select-repo") {
|
|
36
|
+
const name = positional[0];
|
|
37
|
+
if (!name) {
|
|
38
|
+
throw new UsageError("repository name is required");
|
|
39
|
+
}
|
|
40
|
+
await configStore.selectGitRepository(name);
|
|
41
|
+
stdout(`Selected Git repository ${name}`);
|
|
42
|
+
return 0;
|
|
43
|
+
}
|
|
44
|
+
if (subcommand === "diff") {
|
|
45
|
+
stdout(await git.diff(positional[0]));
|
|
46
|
+
return 0;
|
|
47
|
+
}
|
|
48
|
+
if (subcommand === "staged-diff") {
|
|
49
|
+
stdout(await git.stagedDiff(positional[0]));
|
|
50
|
+
return 0;
|
|
51
|
+
}
|
|
52
|
+
if (subcommand === "log") {
|
|
53
|
+
for (const entry of await git.log(flags.limit ? Number(flags.limit) : 10)) {
|
|
54
|
+
stdout(`${entry.hash.slice(0, 8)}\t${entry.subject}`);
|
|
55
|
+
}
|
|
56
|
+
return 0;
|
|
57
|
+
}
|
|
58
|
+
if (subcommand === "branch") {
|
|
59
|
+
for (const branch of await git.branches()) {
|
|
60
|
+
const marker = branch.current ? "*" : " ";
|
|
61
|
+
const scope = branch.remote ? "remote" : "local";
|
|
62
|
+
stdout(`${marker}\t${branch.name}\t${scope}\t${branch.upstream ?? "-"}`);
|
|
63
|
+
}
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
if (subcommand === "switch") {
|
|
67
|
+
const name = positional[0];
|
|
68
|
+
if (!name) {
|
|
69
|
+
throw new UsageError("branch name is required");
|
|
70
|
+
}
|
|
71
|
+
stdout(await git.switchBranch(name));
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
if (subcommand === "create-branch") {
|
|
75
|
+
const name = positional[0];
|
|
76
|
+
if (!name) {
|
|
77
|
+
throw new UsageError("branch name is required");
|
|
78
|
+
}
|
|
79
|
+
stdout(await git.createBranch(name));
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
if (subcommand === "fetch") {
|
|
83
|
+
stdout(await git.fetch());
|
|
84
|
+
return 0;
|
|
85
|
+
}
|
|
86
|
+
if (subcommand === "stage") {
|
|
87
|
+
await git.stage(positional);
|
|
88
|
+
stdout(`Staged ${positional.join(", ")}`);
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
if (subcommand === "unstage") {
|
|
92
|
+
await git.unstage(positional);
|
|
93
|
+
stdout(`Unstaged ${positional.join(", ")}`);
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
if (subcommand === "commit") {
|
|
97
|
+
const message = flags.message;
|
|
98
|
+
if (!message) {
|
|
99
|
+
throw new UsageError("--message is required");
|
|
100
|
+
}
|
|
101
|
+
stdout(await git.commit(message));
|
|
102
|
+
return 0;
|
|
103
|
+
}
|
|
104
|
+
throw new UsageError("Usage: nomoreide git [status|branch|switch|create-branch|fetch|diff|staged-diff|log|stage|unstage|commit]");
|
|
105
|
+
}
|
|
106
|
+
//# sourceMappingURL=git.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/cli/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,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,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QACrC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QAC1B,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,UAAU,KAAK,OAAO,EAAE,CAAC;QAC3B,MAAM,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAC5B,MAAM,CAAC,UAAU,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1C,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,MAAM,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9B,MAAM,CAAC,YAAY,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,UAAU,KAAK,QAAQ,EAAE,CAAC;QAC5B,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,UAAU,CAAC,uBAAuB,CAAC,CAAC;QAChD,CAAC;QACD,MAAM,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAClC,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,IAAI,UAAU,CAClB,2GAA2G,CAC5G,CAAC;AACJ,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { ConfigStore } from "../core/config-store.js";
|
|
|
3
3
|
import { LogStore } from "../core/log-store.js";
|
|
4
4
|
import { ProcessManager } from "../core/process-manager.js";
|
|
5
5
|
import { type UiLifecycleManager } from "../web/ui-lifecycle.js";
|
|
6
|
-
|
|
6
|
+
import { NOMOREIDE_TOOL_NAMES } from "./tools.js";
|
|
7
|
+
export { NOMOREIDE_TOOL_NAMES } from "./tools.js";
|
|
7
8
|
interface CreateNoMoreIdeMcpServerOptions {
|
|
8
9
|
configPath?: string;
|
|
9
10
|
logDir?: string;
|
|
@@ -24,4 +25,3 @@ interface StartNoMoreIdeMcpServerOptions {
|
|
|
24
25
|
}
|
|
25
26
|
export declare function createNoMoreIdeMcpServer(options?: CreateNoMoreIdeMcpServerOptions): NoMoreIdeMcpServer;
|
|
26
27
|
export declare function startNoMoreIdeMcpServer(options?: StartNoMoreIdeMcpServerOptions): Promise<void>;
|
|
27
|
-
export {};
|
package/dist/mcp/server.js
CHANGED
|
@@ -1,56 +1,11 @@
|
|
|
1
1
|
import { resolve } from "node:path";
|
|
2
2
|
import { FastMCP } from "fastmcp";
|
|
3
|
-
import { z } from "zod";
|
|
4
3
|
import { ConfigStore } from "../core/config-store.js";
|
|
5
|
-
import { GitManager } from "../core/git-manager.js";
|
|
6
4
|
import { LogStore } from "../core/log-store.js";
|
|
7
5
|
import { ProcessManager } from "../core/process-manager.js";
|
|
8
6
|
import { createUiLifecycleManager, } from "../web/ui-lifecycle.js";
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"nomoreide_register_service",
|
|
12
|
-
"nomoreide_start_service",
|
|
13
|
-
"nomoreide_stop_service",
|
|
14
|
-
"nomoreide_restart_service",
|
|
15
|
-
"nomoreide_read_logs",
|
|
16
|
-
"nomoreide_register_bundle",
|
|
17
|
-
"nomoreide_start_bundle",
|
|
18
|
-
"nomoreide_stop_bundle",
|
|
19
|
-
"nomoreide_status",
|
|
20
|
-
"nomoreide_git_status",
|
|
21
|
-
"nomoreide_git_branches",
|
|
22
|
-
"nomoreide_git_switch_branch",
|
|
23
|
-
"nomoreide_git_create_branch",
|
|
24
|
-
"nomoreide_git_fetch",
|
|
25
|
-
"nomoreide_git_diff",
|
|
26
|
-
"nomoreide_git_staged_diff",
|
|
27
|
-
"nomoreide_git_log",
|
|
28
|
-
"nomoreide_git_stage",
|
|
29
|
-
"nomoreide_git_unstage",
|
|
30
|
-
"nomoreide_git_commit",
|
|
31
|
-
"nomoreide_git_register_repository",
|
|
32
|
-
"nomoreide_git_select_repository",
|
|
33
|
-
"nomoreide_open_ui",
|
|
34
|
-
"nomoreide_close_ui",
|
|
35
|
-
];
|
|
36
|
-
const serviceNameSchema = z.object({
|
|
37
|
-
name: z.string().min(1).describe("Registered service name."),
|
|
38
|
-
});
|
|
39
|
-
const bundleNameSchema = z.object({
|
|
40
|
-
name: z.string().min(1).describe("Registered bundle name."),
|
|
41
|
-
});
|
|
42
|
-
const gitCwdSchema = z.object({
|
|
43
|
-
cwd: z.string().min(1).optional().describe("Git repository directory."),
|
|
44
|
-
});
|
|
45
|
-
const gitPathSchema = gitCwdSchema.extend({
|
|
46
|
-
path: z.string().min(1).optional().describe("Optional file path."),
|
|
47
|
-
});
|
|
48
|
-
const gitBranchSchema = gitCwdSchema.extend({
|
|
49
|
-
name: z.string().min(1).describe("Branch name."),
|
|
50
|
-
});
|
|
51
|
-
const gitPathsSchema = gitCwdSchema.extend({
|
|
52
|
-
paths: z.array(z.string().min(1)).min(1),
|
|
53
|
-
});
|
|
7
|
+
import { NOMOREIDE_TOOL_NAMES, registerNoMoreIdeTools, } from "./tools.js";
|
|
8
|
+
export { NOMOREIDE_TOOL_NAMES } from "./tools.js";
|
|
54
9
|
export function createNoMoreIdeMcpServer(options = {}) {
|
|
55
10
|
const configPath = options.configPath ?? resolve(process.cwd(), "nomoreide.config.json");
|
|
56
11
|
const logDir = options.logDir ?? resolve(process.cwd(), ".nomoreide/logs");
|
|
@@ -69,173 +24,12 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
69
24
|
name: "NoMoreIDE MCP",
|
|
70
25
|
version: "0.1.0",
|
|
71
26
|
});
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
name: "nomoreide_register_service",
|
|
79
|
-
description: "Register or replace a local development service.",
|
|
80
|
-
parameters: z.object({
|
|
81
|
-
name: z.string().min(1),
|
|
82
|
-
command: z.string().min(1),
|
|
83
|
-
cwd: z.string().min(1),
|
|
84
|
-
port: z.number().int().positive().max(65535).optional(),
|
|
85
|
-
env: z.record(z.string()).optional(),
|
|
86
|
-
description: z.string().optional(),
|
|
87
|
-
}),
|
|
88
|
-
execute: async (args) => stringify(await configStore.registerService(args)),
|
|
89
|
-
});
|
|
90
|
-
server.addTool({
|
|
91
|
-
name: "nomoreide_start_service",
|
|
92
|
-
description: "Start a registered service.",
|
|
93
|
-
parameters: serviceNameSchema,
|
|
94
|
-
execute: async ({ name }) => stringify(await manager.startService(name)),
|
|
95
|
-
});
|
|
96
|
-
server.addTool({
|
|
97
|
-
name: "nomoreide_stop_service",
|
|
98
|
-
description: "Stop a running NoMoreIDE service.",
|
|
99
|
-
parameters: serviceNameSchema,
|
|
100
|
-
execute: async ({ name }) => stringify(await manager.stopService(name)),
|
|
101
|
-
});
|
|
102
|
-
server.addTool({
|
|
103
|
-
name: "nomoreide_restart_service",
|
|
104
|
-
description: "Restart a registered service.",
|
|
105
|
-
parameters: serviceNameSchema,
|
|
106
|
-
execute: async ({ name }) => stringify(await manager.restartService(name)),
|
|
107
|
-
});
|
|
108
|
-
server.addTool({
|
|
109
|
-
name: "nomoreide_read_logs",
|
|
110
|
-
description: "Read recent in-memory logs for a registered service.",
|
|
111
|
-
parameters: z.object({
|
|
112
|
-
name: z.string().min(1),
|
|
113
|
-
limit: z.number().int().positive().max(1000).optional(),
|
|
114
|
-
}),
|
|
115
|
-
execute: async ({ name, limit }) => stringify(logStore.read(name, limit)),
|
|
116
|
-
});
|
|
117
|
-
server.addTool({
|
|
118
|
-
name: "nomoreide_register_bundle",
|
|
119
|
-
description: "Register or replace a bundle of services.",
|
|
120
|
-
parameters: z.object({
|
|
121
|
-
name: z.string().min(1),
|
|
122
|
-
services: z.array(z.string().min(1)).min(1),
|
|
123
|
-
}),
|
|
124
|
-
execute: async (args) => stringify(await configStore.registerBundle(args)),
|
|
125
|
-
});
|
|
126
|
-
server.addTool({
|
|
127
|
-
name: "nomoreide_start_bundle",
|
|
128
|
-
description: "Start every service in a registered bundle.",
|
|
129
|
-
parameters: bundleNameSchema,
|
|
130
|
-
execute: async ({ name }) => stringify(await manager.startBundle(name)),
|
|
131
|
-
});
|
|
132
|
-
server.addTool({
|
|
133
|
-
name: "nomoreide_stop_bundle",
|
|
134
|
-
description: "Stop every service in a registered bundle.",
|
|
135
|
-
parameters: bundleNameSchema,
|
|
136
|
-
execute: async ({ name }) => stringify(await manager.stopBundle(name)),
|
|
137
|
-
});
|
|
138
|
-
server.addTool({
|
|
139
|
-
name: "nomoreide_status",
|
|
140
|
-
description: "Show current NoMoreIDE runtime status.",
|
|
141
|
-
execute: async () => stringify(manager.status()),
|
|
142
|
-
});
|
|
143
|
-
server.addTool({
|
|
144
|
-
name: "nomoreide_git_status",
|
|
145
|
-
description: "Show safe Git branch and porcelain status for a repository.",
|
|
146
|
-
parameters: gitCwdSchema,
|
|
147
|
-
execute: async ({ cwd }) => stringify(await git(cwd).status()),
|
|
148
|
-
});
|
|
149
|
-
server.addTool({
|
|
150
|
-
name: "nomoreide_git_diff",
|
|
151
|
-
description: "Show unstaged Git diff for a repository or file.",
|
|
152
|
-
parameters: gitPathSchema,
|
|
153
|
-
execute: async ({ cwd, path }) => await git(cwd).diff(path),
|
|
154
|
-
});
|
|
155
|
-
server.addTool({
|
|
156
|
-
name: "nomoreide_git_branches",
|
|
157
|
-
description: "List local and remote Git branches for a repository.",
|
|
158
|
-
parameters: gitCwdSchema,
|
|
159
|
-
execute: async ({ cwd }) => stringify(await git(cwd).branches()),
|
|
160
|
-
});
|
|
161
|
-
server.addTool({
|
|
162
|
-
name: "nomoreide_git_switch_branch",
|
|
163
|
-
description: "Switch to a local branch, or track a remote branch.",
|
|
164
|
-
parameters: gitBranchSchema,
|
|
165
|
-
execute: async ({ cwd, name }) => await git(cwd).switchBranch(name),
|
|
166
|
-
});
|
|
167
|
-
server.addTool({
|
|
168
|
-
name: "nomoreide_git_create_branch",
|
|
169
|
-
description: "Create and switch to a new Git branch.",
|
|
170
|
-
parameters: gitBranchSchema,
|
|
171
|
-
execute: async ({ cwd, name }) => await git(cwd).createBranch(name),
|
|
172
|
-
});
|
|
173
|
-
server.addTool({
|
|
174
|
-
name: "nomoreide_git_fetch",
|
|
175
|
-
description: "Fetch and prune remote Git refs for a repository.",
|
|
176
|
-
parameters: gitCwdSchema,
|
|
177
|
-
execute: async ({ cwd }) => await git(cwd).fetch(),
|
|
178
|
-
});
|
|
179
|
-
server.addTool({
|
|
180
|
-
name: "nomoreide_git_staged_diff",
|
|
181
|
-
description: "Show staged Git diff for a repository or file.",
|
|
182
|
-
parameters: gitPathSchema,
|
|
183
|
-
execute: async ({ cwd, path }) => await git(cwd).stagedDiff(path),
|
|
184
|
-
});
|
|
185
|
-
server.addTool({
|
|
186
|
-
name: "nomoreide_git_log",
|
|
187
|
-
description: "Show recent Git commits.",
|
|
188
|
-
parameters: gitCwdSchema.extend({
|
|
189
|
-
limit: z.number().int().positive().max(50).optional(),
|
|
190
|
-
}),
|
|
191
|
-
execute: async ({ cwd, limit }) => stringify(await git(cwd).log(limit)),
|
|
192
|
-
});
|
|
193
|
-
server.addTool({
|
|
194
|
-
name: "nomoreide_git_stage",
|
|
195
|
-
description: "Stage explicit file paths.",
|
|
196
|
-
parameters: gitPathsSchema,
|
|
197
|
-
execute: async ({ cwd, paths }) => stringify(await git(cwd).stage(paths)),
|
|
198
|
-
});
|
|
199
|
-
server.addTool({
|
|
200
|
-
name: "nomoreide_git_unstage",
|
|
201
|
-
description: "Unstage explicit file paths.",
|
|
202
|
-
parameters: gitPathsSchema,
|
|
203
|
-
execute: async ({ cwd, paths }) => stringify(await git(cwd).unstage(paths)),
|
|
204
|
-
});
|
|
205
|
-
server.addTool({
|
|
206
|
-
name: "nomoreide_git_commit",
|
|
207
|
-
description: "Create a Git commit from currently staged changes.",
|
|
208
|
-
parameters: gitCwdSchema.extend({
|
|
209
|
-
message: z.string().min(1),
|
|
210
|
-
}),
|
|
211
|
-
execute: async ({ cwd, message }) => await git(cwd).commit(message),
|
|
212
|
-
});
|
|
213
|
-
server.addTool({
|
|
214
|
-
name: "nomoreide_git_register_repository",
|
|
215
|
-
description: "Register a named Git repository folder for NoMoreIDE.",
|
|
216
|
-
parameters: z.object({
|
|
217
|
-
name: z.string().min(1),
|
|
218
|
-
path: z.string().min(1),
|
|
219
|
-
}),
|
|
220
|
-
execute: async (args) => stringify(await configStore.registerGitRepository(args)),
|
|
221
|
-
});
|
|
222
|
-
server.addTool({
|
|
223
|
-
name: "nomoreide_git_select_repository",
|
|
224
|
-
description: "Select the registered Git repository shown by NoMoreIDE.",
|
|
225
|
-
parameters: z.object({
|
|
226
|
-
name: z.string().min(1),
|
|
227
|
-
}),
|
|
228
|
-
execute: async ({ name }) => stringify(await configStore.selectGitRepository(name)),
|
|
229
|
-
});
|
|
230
|
-
server.addTool({
|
|
231
|
-
name: "nomoreide_open_ui",
|
|
232
|
-
description: "Open or reuse the singleton NoMoreIDE web UI.",
|
|
233
|
-
execute: async () => stringify(await uiLifecycle.ensureStarted()),
|
|
234
|
-
});
|
|
235
|
-
server.addTool({
|
|
236
|
-
name: "nomoreide_close_ui",
|
|
237
|
-
description: "Close the NoMoreIDE web UI owned by this MCP process.",
|
|
238
|
-
execute: async () => stringify(await uiLifecycle.close()),
|
|
27
|
+
registerNoMoreIdeTools({
|
|
28
|
+
server,
|
|
29
|
+
configStore,
|
|
30
|
+
logStore,
|
|
31
|
+
manager,
|
|
32
|
+
uiLifecycle,
|
|
239
33
|
});
|
|
240
34
|
return {
|
|
241
35
|
server,
|
|
@@ -246,9 +40,6 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
246
40
|
toolNames: NOMOREIDE_TOOL_NAMES,
|
|
247
41
|
};
|
|
248
42
|
}
|
|
249
|
-
function git(cwd) {
|
|
250
|
-
return new GitManager(cwd ?? process.cwd());
|
|
251
|
-
}
|
|
252
43
|
export async function startNoMoreIdeMcpServer(options = {}) {
|
|
253
44
|
const env = options.env ?? process.env;
|
|
254
45
|
const { server, uiLifecycle } = options.createServer?.() ?? createNoMoreIdeMcpServer();
|
|
@@ -262,7 +53,4 @@ export async function startNoMoreIdeMcpServer(options = {}) {
|
|
|
262
53
|
}
|
|
263
54
|
await server.start({ transportType: "stdio" });
|
|
264
55
|
}
|
|
265
|
-
function stringify(value) {
|
|
266
|
-
return JSON.stringify(value, null, 2);
|
|
267
|
-
}
|
|
268
56
|
//# sourceMappingURL=server.js.map
|
package/dist/mcp/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAuBlD,MAAM,UAAU,wBAAwB,CACtC,UAA2C,EAAE;IAE7C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AAC,aAAa,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oCACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FastMCP } from "fastmcp";
|
|
2
|
+
import { ConfigStore } from "../core/config-store.js";
|
|
3
|
+
import { LogStore } from "../core/log-store.js";
|
|
4
|
+
import { ProcessManager } from "../core/process-manager.js";
|
|
5
|
+
import type { UiLifecycleManager } from "../web/ui-lifecycle.js";
|
|
6
|
+
export declare const NOMOREIDE_TOOL_NAMES: readonly ["nomoreide_list_services", "nomoreide_register_service", "nomoreide_start_service", "nomoreide_stop_service", "nomoreide_restart_service", "nomoreide_read_logs", "nomoreide_register_bundle", "nomoreide_start_bundle", "nomoreide_stop_bundle", "nomoreide_status", "nomoreide_git_status", "nomoreide_git_branches", "nomoreide_git_switch_branch", "nomoreide_git_create_branch", "nomoreide_git_fetch", "nomoreide_git_diff", "nomoreide_git_staged_diff", "nomoreide_git_log", "nomoreide_git_stage", "nomoreide_git_unstage", "nomoreide_git_commit", "nomoreide_git_register_repository", "nomoreide_git_select_repository", "nomoreide_open_ui", "nomoreide_close_ui"];
|
|
7
|
+
interface RegisterNoMoreIdeToolsOptions {
|
|
8
|
+
server: FastMCP;
|
|
9
|
+
configStore: ConfigStore;
|
|
10
|
+
logStore: LogStore;
|
|
11
|
+
manager: ProcessManager;
|
|
12
|
+
uiLifecycle: UiLifecycleManager;
|
|
13
|
+
}
|
|
14
|
+
export declare function registerNoMoreIdeTools(options: RegisterNoMoreIdeToolsOptions): void;
|
|
15
|
+
export {};
|