nomoreide 0.1.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 +217 -0
- package/dist/cli/commands.d.ts +7 -0
- package/dist/cli/commands.js +192 -0
- package/dist/cli/commands.js.map +1 -0
- package/dist/core/config-store.d.ts +11 -0
- package/dist/core/config-store.js +101 -0
- package/dist/core/config-store.js.map +1 -0
- package/dist/core/git-manager.d.ts +25 -0
- package/dist/core/git-manager.js +83 -0
- package/dist/core/git-manager.js.map +1 -0
- package/dist/core/log-store.d.ts +14 -0
- package/dist/core/log-store.js +32 -0
- package/dist/core/log-store.js.map +1 -0
- package/dist/core/port-utils.d.ts +6 -0
- package/dist/core/port-utils.js +23 -0
- package/dist/core/port-utils.js.map +1 -0
- package/dist/core/process-manager.d.ts +29 -0
- package/dist/core/process-manager.js +172 -0
- package/dist/core/process-manager.js.map +1 -0
- package/dist/core/types.d.ts +44 -0
- package/dist/core/types.js +2 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/server.d.ts +19 -0
- package/dist/mcp/server.js +206 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/tui/app.d.ts +20 -0
- package/dist/tui/app.js +135 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/web/client/assets/index-CvX1Rx-e.css +1 -0
- package/dist/web/client/assets/index-Dy5kcoI8.js +11 -0
- package/dist/web/client/index.html +13 -0
- package/dist/web/server.d.ts +15 -0
- package/dist/web/server.js +321 -0
- package/dist/web/server.js.map +1 -0
- package/package.json +52 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { appendFile, mkdir } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
export class LogStore {
|
|
4
|
+
entriesByService = new Map();
|
|
5
|
+
baseDir;
|
|
6
|
+
maxLinesPerService;
|
|
7
|
+
constructor(options = {}) {
|
|
8
|
+
this.baseDir = options.baseDir ?? ".nomoreide/logs";
|
|
9
|
+
this.maxLinesPerService = options.maxLinesPerService ?? 500;
|
|
10
|
+
}
|
|
11
|
+
async append(service, stream, text) {
|
|
12
|
+
const entry = {
|
|
13
|
+
service,
|
|
14
|
+
stream,
|
|
15
|
+
text,
|
|
16
|
+
timestamp: new Date().toISOString(),
|
|
17
|
+
};
|
|
18
|
+
const entries = this.entriesByService.get(service) ?? [];
|
|
19
|
+
entries.push(entry);
|
|
20
|
+
this.entriesByService.set(service, entries.slice(-this.maxLinesPerService));
|
|
21
|
+
await mkdir(this.baseDir, { recursive: true });
|
|
22
|
+
await appendFile(join(this.baseDir, `${safeFileName(service)}.log`), `${JSON.stringify(entry)}\n`);
|
|
23
|
+
return entry;
|
|
24
|
+
}
|
|
25
|
+
read(service, limit = this.maxLinesPerService) {
|
|
26
|
+
return (this.entriesByService.get(service) ?? []).slice(-limit);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function safeFileName(input) {
|
|
30
|
+
return input.replace(/[^a-zA-Z0-9._-]/g, "_");
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=log-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"log-store.js","sourceRoot":"","sources":["../../src/core/log-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAQjC,MAAM,OAAO,QAAQ;IACF,gBAAgB,GAAG,IAAI,GAAG,EAAsB,CAAC;IACjD,OAAO,CAAS;IAChB,kBAAkB,CAAS;IAE5C,YAAY,UAA2B,EAAE;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,iBAAiB,CAAC;QACpD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,GAAG,CAAC;IAC9D,CAAC;IAED,KAAK,CAAC,MAAM,CACV,OAAe,EACf,MAAiB,EACjB,IAAY;QAEZ,MAAM,KAAK,GAAa;YACtB,OAAO;YACP,MAAM;YACN,IAAI;YACJ,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;SACpC,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACzD,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,IAAI,CAAC,gBAAgB,CAAC,GAAG,CACvB,OAAO,EACP,OAAO,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CACxC,CAAC;QAEF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC/C,MAAM,UAAU,CACd,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC,EAClD,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAC7B,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,KAAK,GAAG,IAAI,CAAC,kBAAkB;QACnD,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC;IAClE,CAAC;CACF;AAED,SAAS,YAAY,CAAC,KAAa;IACjC,OAAO,KAAK,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import net from "node:net";
|
|
2
|
+
export async function isPortAvailable(port, host = "127.0.0.1") {
|
|
3
|
+
return new Promise((resolve, reject) => {
|
|
4
|
+
const server = net.createServer();
|
|
5
|
+
server.once("error", (error) => {
|
|
6
|
+
if (error.code === "EADDRINUSE" || error.code === "EACCES") {
|
|
7
|
+
resolve(false);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
reject(error);
|
|
11
|
+
});
|
|
12
|
+
server.listen(port, host, () => {
|
|
13
|
+
server.close(() => resolve(true));
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
export async function getPortStatus(port) {
|
|
18
|
+
return {
|
|
19
|
+
port,
|
|
20
|
+
available: await isPortAvailable(port),
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=port-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"port-utils.js","sourceRoot":"","sources":["../../src/core/port-utils.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,UAAU,CAAC;AAO3B,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,IAAI,GAAG,WAAW;IAElB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,MAAM,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC;QAElC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,KAA4B,EAAE,EAAE;YACpD,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBAC3D,OAAO,CAAC,KAAK,CAAC,CAAC;gBACf,OAAO;YACT,CAAC;YAED,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE;YAC7B,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAY;IAC9C,OAAO;QACL,IAAI;QACJ,SAAS,EAAE,MAAM,eAAe,CAAC,IAAI,CAAC;KACvC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ConfigStore } from "./config-store.js";
|
|
2
|
+
import type { LogStore } from "./log-store.js";
|
|
3
|
+
import type { ServiceStatus } from "./types.js";
|
|
4
|
+
interface ProcessManagerOptions {
|
|
5
|
+
configStore: ConfigStore;
|
|
6
|
+
logStore: LogStore;
|
|
7
|
+
stopTimeoutMs?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface NoMoreIdeStatus {
|
|
10
|
+
services: Record<string, ServiceStatus>;
|
|
11
|
+
}
|
|
12
|
+
export declare class ProcessManager {
|
|
13
|
+
private readonly runtimes;
|
|
14
|
+
private readonly configStore;
|
|
15
|
+
private readonly logStore;
|
|
16
|
+
private readonly stopTimeoutMs;
|
|
17
|
+
constructor(options: ProcessManagerOptions);
|
|
18
|
+
startService(name: string): Promise<ServiceStatus>;
|
|
19
|
+
stopService(name: string): Promise<ServiceStatus>;
|
|
20
|
+
restartService(name: string): Promise<ServiceStatus>;
|
|
21
|
+
startBundle(name: string): Promise<ServiceStatus[]>;
|
|
22
|
+
stopBundle(name: string): Promise<ServiceStatus[]>;
|
|
23
|
+
stopAll(): Promise<void>;
|
|
24
|
+
status(): NoMoreIdeStatus;
|
|
25
|
+
private getService;
|
|
26
|
+
private getBundle;
|
|
27
|
+
private captureStream;
|
|
28
|
+
}
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { isPortAvailable } from "./port-utils.js";
|
|
3
|
+
export class ProcessManager {
|
|
4
|
+
runtimes = new Map();
|
|
5
|
+
configStore;
|
|
6
|
+
logStore;
|
|
7
|
+
stopTimeoutMs;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
this.configStore = options.configStore;
|
|
10
|
+
this.logStore = options.logStore;
|
|
11
|
+
this.stopTimeoutMs = options.stopTimeoutMs ?? 3000;
|
|
12
|
+
}
|
|
13
|
+
async startService(name) {
|
|
14
|
+
const service = await this.getService(name);
|
|
15
|
+
const existing = this.runtimes.get(name);
|
|
16
|
+
if (existing?.status.state === "running") {
|
|
17
|
+
return { ...existing.status };
|
|
18
|
+
}
|
|
19
|
+
if (service.port && !(await isPortAvailable(service.port))) {
|
|
20
|
+
throw new Error(`Port ${service.port} is already in use for ${name}.`);
|
|
21
|
+
}
|
|
22
|
+
const child = spawn(service.command, {
|
|
23
|
+
cwd: service.cwd,
|
|
24
|
+
env: { ...process.env, ...service.env },
|
|
25
|
+
shell: true,
|
|
26
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
27
|
+
});
|
|
28
|
+
const runtime = {
|
|
29
|
+
child,
|
|
30
|
+
stopping: false,
|
|
31
|
+
status: {
|
|
32
|
+
name,
|
|
33
|
+
state: "running",
|
|
34
|
+
pid: child.pid,
|
|
35
|
+
startedAt: new Date().toISOString(),
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
this.runtimes.set(name, runtime);
|
|
39
|
+
this.captureStream(name, "stdout", child.stdout);
|
|
40
|
+
this.captureStream(name, "stderr", child.stderr);
|
|
41
|
+
child.once("exit", (exitCode, signal) => {
|
|
42
|
+
runtime.status = {
|
|
43
|
+
...runtime.status,
|
|
44
|
+
state: runtime.stopping ? "stopped" : "exited",
|
|
45
|
+
exitedAt: new Date().toISOString(),
|
|
46
|
+
exitCode,
|
|
47
|
+
signal,
|
|
48
|
+
};
|
|
49
|
+
runtime.child = undefined;
|
|
50
|
+
});
|
|
51
|
+
child.once("error", (error) => {
|
|
52
|
+
runtime.status = {
|
|
53
|
+
...runtime.status,
|
|
54
|
+
state: "exited",
|
|
55
|
+
exitedAt: new Date().toISOString(),
|
|
56
|
+
exitCode: 1,
|
|
57
|
+
signal: null,
|
|
58
|
+
};
|
|
59
|
+
void this.logStore.append(name, "stderr", error.message);
|
|
60
|
+
});
|
|
61
|
+
return { ...runtime.status };
|
|
62
|
+
}
|
|
63
|
+
async stopService(name) {
|
|
64
|
+
const runtime = this.runtimes.get(name);
|
|
65
|
+
if (!runtime?.child || runtime.status.state !== "running") {
|
|
66
|
+
const stopped = { name, state: "stopped" };
|
|
67
|
+
this.runtimes.set(name, { status: stopped, stopping: false });
|
|
68
|
+
return stopped;
|
|
69
|
+
}
|
|
70
|
+
runtime.stopping = true;
|
|
71
|
+
await stopChild(runtime.child, this.stopTimeoutMs);
|
|
72
|
+
const stopped = {
|
|
73
|
+
...runtime.status,
|
|
74
|
+
state: "stopped",
|
|
75
|
+
exitedAt: runtime.status.exitedAt ?? new Date().toISOString(),
|
|
76
|
+
};
|
|
77
|
+
runtime.status = stopped;
|
|
78
|
+
runtime.child = undefined;
|
|
79
|
+
return { ...stopped };
|
|
80
|
+
}
|
|
81
|
+
async restartService(name) {
|
|
82
|
+
await this.stopService(name);
|
|
83
|
+
return this.startService(name);
|
|
84
|
+
}
|
|
85
|
+
async startBundle(name) {
|
|
86
|
+
const bundle = await this.getBundle(name);
|
|
87
|
+
const statuses = [];
|
|
88
|
+
for (const serviceName of bundle.services) {
|
|
89
|
+
statuses.push(await this.startService(serviceName));
|
|
90
|
+
}
|
|
91
|
+
return statuses;
|
|
92
|
+
}
|
|
93
|
+
async stopBundle(name) {
|
|
94
|
+
const bundle = await this.getBundle(name);
|
|
95
|
+
const statuses = [];
|
|
96
|
+
for (const serviceName of bundle.services.slice().reverse()) {
|
|
97
|
+
statuses.push(await this.stopService(serviceName));
|
|
98
|
+
}
|
|
99
|
+
return statuses;
|
|
100
|
+
}
|
|
101
|
+
async stopAll() {
|
|
102
|
+
await Promise.all([...this.runtimes.keys()].map((name) => this.stopService(name)));
|
|
103
|
+
}
|
|
104
|
+
status() {
|
|
105
|
+
return {
|
|
106
|
+
services: Object.fromEntries([...this.runtimes.entries()].map(([name, runtime]) => [
|
|
107
|
+
name,
|
|
108
|
+
{ ...runtime.status },
|
|
109
|
+
])),
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
async getService(name) {
|
|
113
|
+
const config = await this.configStore.load();
|
|
114
|
+
const service = config.services.find((item) => item.name === name);
|
|
115
|
+
if (!service) {
|
|
116
|
+
throw new Error(`Service "${name}" is not registered.`);
|
|
117
|
+
}
|
|
118
|
+
return service;
|
|
119
|
+
}
|
|
120
|
+
async getBundle(name) {
|
|
121
|
+
const config = await this.configStore.load();
|
|
122
|
+
const bundle = config.bundles.find((item) => item.name === name);
|
|
123
|
+
if (!bundle) {
|
|
124
|
+
throw new Error(`Bundle "${name}" is not registered.`);
|
|
125
|
+
}
|
|
126
|
+
return bundle;
|
|
127
|
+
}
|
|
128
|
+
captureStream(service, stream, readable) {
|
|
129
|
+
if (!readable) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
let buffer = "";
|
|
133
|
+
readable.on("data", (chunk) => {
|
|
134
|
+
buffer += chunk.toString();
|
|
135
|
+
const lines = buffer.split(/\r?\n/);
|
|
136
|
+
buffer = lines.pop() ?? "";
|
|
137
|
+
for (const line of lines) {
|
|
138
|
+
if (line.length > 0) {
|
|
139
|
+
void this.logStore.append(service, stream, line);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
readable.on("end", () => {
|
|
144
|
+
if (buffer.length > 0) {
|
|
145
|
+
void this.logStore.append(service, stream, buffer);
|
|
146
|
+
buffer = "";
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
async function stopChild(child, timeoutMs) {
|
|
152
|
+
if (child.exitCode !== null || child.signalCode !== null) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
await new Promise((resolve) => {
|
|
156
|
+
let resolved = false;
|
|
157
|
+
const finish = () => {
|
|
158
|
+
if (!resolved) {
|
|
159
|
+
resolved = true;
|
|
160
|
+
clearTimeout(timer);
|
|
161
|
+
resolve();
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
const timer = setTimeout(() => {
|
|
165
|
+
child.kill("SIGKILL");
|
|
166
|
+
finish();
|
|
167
|
+
}, timeoutMs);
|
|
168
|
+
child.once("exit", finish);
|
|
169
|
+
child.kill("SIGTERM");
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=process-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-manager.js","sourceRoot":"","sources":["../../src/core/process-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAG9D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAuBlD,MAAM,OAAO,cAAc;IACR,QAAQ,GAAG,IAAI,GAAG,EAA0B,CAAC;IAC7C,WAAW,CAAc;IACzB,QAAQ,CAAW;IACnB,aAAa,CAAS;IAEvC,YAAY,OAA8B;QACxC,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;QACvC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC;IACrD,CAAC;IAED,KAAK,CAAC,YAAY,CAAC,IAAY;QAC7B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAEzC,IAAI,QAAQ,EAAE,MAAM,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YACzC,OAAO,EAAE,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;QAChC,CAAC;QAED,IAAI,OAAO,CAAC,IAAI,IAAI,CAAC,CAAC,MAAM,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC3D,MAAM,IAAI,KAAK,C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G,EAAE;YAC5B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACtB,MAAM,EAAE,CAAC;QACX,CAAC,EAAE,SAAS,CAAC,CAAC;QAEd,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface ServiceDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
command: string;
|
|
4
|
+
cwd: string;
|
|
5
|
+
port?: number;
|
|
6
|
+
env?: Record<string, string>;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface BundleDefinition {
|
|
10
|
+
name: string;
|
|
11
|
+
services: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface GitRepositoryDefinition {
|
|
14
|
+
name: string;
|
|
15
|
+
path: string;
|
|
16
|
+
}
|
|
17
|
+
export interface NoMoreIdeConfig {
|
|
18
|
+
version: 1;
|
|
19
|
+
services: ServiceDefinition[];
|
|
20
|
+
bundles: BundleDefinition[];
|
|
21
|
+
gitRepositories: GitRepositoryDefinition[];
|
|
22
|
+
selectedGitRepository?: string;
|
|
23
|
+
}
|
|
24
|
+
export type ServiceState = "stopped" | "starting" | "running" | "exited";
|
|
25
|
+
export interface ServiceStatus {
|
|
26
|
+
name: string;
|
|
27
|
+
state: ServiceState;
|
|
28
|
+
pid?: number;
|
|
29
|
+
startedAt?: string;
|
|
30
|
+
exitedAt?: string;
|
|
31
|
+
exitCode?: number | null;
|
|
32
|
+
signal?: NodeJS.Signals | null;
|
|
33
|
+
}
|
|
34
|
+
export type LogStream = "stdout" | "stderr";
|
|
35
|
+
export interface LogEntry {
|
|
36
|
+
service: string;
|
|
37
|
+
stream: LogStream;
|
|
38
|
+
text: string;
|
|
39
|
+
timestamp: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ToolResult {
|
|
42
|
+
ok: boolean;
|
|
43
|
+
message: string;
|
|
44
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { startNoMoreIdeMcpServer } from "./mcp/server.js";
|
|
3
|
+
import { createTuiApp } from "./tui/app.js";
|
|
4
|
+
import { createWebServer } from "./web/server.js";
|
|
5
|
+
import { runCli } from "./cli/commands.js";
|
|
6
|
+
const command = process.argv[2] ?? "mcp";
|
|
7
|
+
if (command === "mcp" || command === "start") {
|
|
8
|
+
await startNoMoreIdeMcpServer();
|
|
9
|
+
}
|
|
10
|
+
else if (command === "tui") {
|
|
11
|
+
await createTuiApp().start();
|
|
12
|
+
}
|
|
13
|
+
else if (command === "web") {
|
|
14
|
+
const portArg = process.argv.find((arg) => arg.startsWith("--port="));
|
|
15
|
+
const port = portArg ? Number(portArg.slice("--port=".length)) : undefined;
|
|
16
|
+
const server = await createWebServer({ port }).start();
|
|
17
|
+
console.error(`NoMoreIDE web UI: ${server.url}`);
|
|
18
|
+
}
|
|
19
|
+
else if (["add", "list", "logs", "start", "stop", "restart"].includes(command)) {
|
|
20
|
+
process.exitCode = await runCli(process.argv.slice(2));
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
console.error("Usage: nomoreide [mcp|tui|web|list|logs|start|stop|restart|add]");
|
|
24
|
+
process.exitCode = 1;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;A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QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { 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
|
+
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_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"];
|
|
6
|
+
interface CreateNoMoreIdeMcpServerOptions {
|
|
7
|
+
configPath?: string;
|
|
8
|
+
logDir?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NoMoreIdeMcpServer {
|
|
11
|
+
server: FastMCP;
|
|
12
|
+
configStore: ConfigStore;
|
|
13
|
+
logStore: LogStore;
|
|
14
|
+
manager: ProcessManager;
|
|
15
|
+
toolNames: typeof NOMOREIDE_TOOL_NAMES;
|
|
16
|
+
}
|
|
17
|
+
export declare function createNoMoreIdeMcpServer(options?: CreateNoMoreIdeMcpServerOptions): NoMoreIdeMcpServer;
|
|
18
|
+
export declare function startNoMoreIdeMcpServer(): Promise<void>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { FastMCP } from "fastmcp";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { ConfigStore } from "../core/config-store.js";
|
|
5
|
+
import { GitManager } from "../core/git-manager.js";
|
|
6
|
+
import { LogStore } from "../core/log-store.js";
|
|
7
|
+
import { ProcessManager } from "../core/process-manager.js";
|
|
8
|
+
export const NOMOREIDE_TOOL_NAMES = [
|
|
9
|
+
"nomoreide_list_services",
|
|
10
|
+
"nomoreide_register_service",
|
|
11
|
+
"nomoreide_start_service",
|
|
12
|
+
"nomoreide_stop_service",
|
|
13
|
+
"nomoreide_restart_service",
|
|
14
|
+
"nomoreide_read_logs",
|
|
15
|
+
"nomoreide_register_bundle",
|
|
16
|
+
"nomoreide_start_bundle",
|
|
17
|
+
"nomoreide_stop_bundle",
|
|
18
|
+
"nomoreide_status",
|
|
19
|
+
"nomoreide_git_status",
|
|
20
|
+
"nomoreide_git_diff",
|
|
21
|
+
"nomoreide_git_staged_diff",
|
|
22
|
+
"nomoreide_git_log",
|
|
23
|
+
"nomoreide_git_stage",
|
|
24
|
+
"nomoreide_git_unstage",
|
|
25
|
+
"nomoreide_git_commit",
|
|
26
|
+
"nomoreide_git_register_repository",
|
|
27
|
+
"nomoreide_git_select_repository",
|
|
28
|
+
];
|
|
29
|
+
const serviceNameSchema = z.object({
|
|
30
|
+
name: z.string().min(1).describe("Registered service name."),
|
|
31
|
+
});
|
|
32
|
+
const bundleNameSchema = z.object({
|
|
33
|
+
name: z.string().min(1).describe("Registered bundle name."),
|
|
34
|
+
});
|
|
35
|
+
const gitCwdSchema = z.object({
|
|
36
|
+
cwd: z.string().min(1).optional().describe("Git repository directory."),
|
|
37
|
+
});
|
|
38
|
+
const gitPathSchema = gitCwdSchema.extend({
|
|
39
|
+
path: z.string().min(1).optional().describe("Optional file path."),
|
|
40
|
+
});
|
|
41
|
+
const gitPathsSchema = gitCwdSchema.extend({
|
|
42
|
+
paths: z.array(z.string().min(1)).min(1),
|
|
43
|
+
});
|
|
44
|
+
export function createNoMoreIdeMcpServer(options = {}) {
|
|
45
|
+
const configStore = new ConfigStore(options.configPath ?? resolve(process.cwd(), "nomoreide.config.json"));
|
|
46
|
+
const logStore = new LogStore({
|
|
47
|
+
baseDir: options.logDir ?? resolve(process.cwd(), ".nomoreide/logs"),
|
|
48
|
+
});
|
|
49
|
+
const manager = new ProcessManager({ configStore, logStore });
|
|
50
|
+
const server = new FastMCP({
|
|
51
|
+
name: "NoMoreIDE MCP",
|
|
52
|
+
version: "0.1.0",
|
|
53
|
+
});
|
|
54
|
+
server.addTool({
|
|
55
|
+
name: "nomoreide_list_services",
|
|
56
|
+
description: "List registered NoMoreIDE services and bundles.",
|
|
57
|
+
execute: async () => stringify(await configStore.load()),
|
|
58
|
+
});
|
|
59
|
+
server.addTool({
|
|
60
|
+
name: "nomoreide_register_service",
|
|
61
|
+
description: "Register or replace a local development service.",
|
|
62
|
+
parameters: z.object({
|
|
63
|
+
name: z.string().min(1),
|
|
64
|
+
command: z.string().min(1),
|
|
65
|
+
cwd: z.string().min(1),
|
|
66
|
+
port: z.number().int().positive().max(65535).optional(),
|
|
67
|
+
env: z.record(z.string()).optional(),
|
|
68
|
+
description: z.string().optional(),
|
|
69
|
+
}),
|
|
70
|
+
execute: async (args) => stringify(await configStore.registerService(args)),
|
|
71
|
+
});
|
|
72
|
+
server.addTool({
|
|
73
|
+
name: "nomoreide_start_service",
|
|
74
|
+
description: "Start a registered service.",
|
|
75
|
+
parameters: serviceNameSchema,
|
|
76
|
+
execute: async ({ name }) => stringify(await manager.startService(name)),
|
|
77
|
+
});
|
|
78
|
+
server.addTool({
|
|
79
|
+
name: "nomoreide_stop_service",
|
|
80
|
+
description: "Stop a running NoMoreIDE service.",
|
|
81
|
+
parameters: serviceNameSchema,
|
|
82
|
+
execute: async ({ name }) => stringify(await manager.stopService(name)),
|
|
83
|
+
});
|
|
84
|
+
server.addTool({
|
|
85
|
+
name: "nomoreide_restart_service",
|
|
86
|
+
description: "Restart a registered service.",
|
|
87
|
+
parameters: serviceNameSchema,
|
|
88
|
+
execute: async ({ name }) => stringify(await manager.restartService(name)),
|
|
89
|
+
});
|
|
90
|
+
server.addTool({
|
|
91
|
+
name: "nomoreide_read_logs",
|
|
92
|
+
description: "Read recent in-memory logs for a registered service.",
|
|
93
|
+
parameters: z.object({
|
|
94
|
+
name: z.string().min(1),
|
|
95
|
+
limit: z.number().int().positive().max(1000).optional(),
|
|
96
|
+
}),
|
|
97
|
+
execute: async ({ name, limit }) => stringify(logStore.read(name, limit)),
|
|
98
|
+
});
|
|
99
|
+
server.addTool({
|
|
100
|
+
name: "nomoreide_register_bundle",
|
|
101
|
+
description: "Register or replace a bundle of services.",
|
|
102
|
+
parameters: z.object({
|
|
103
|
+
name: z.string().min(1),
|
|
104
|
+
services: z.array(z.string().min(1)).min(1),
|
|
105
|
+
}),
|
|
106
|
+
execute: async (args) => stringify(await configStore.registerBundle(args)),
|
|
107
|
+
});
|
|
108
|
+
server.addTool({
|
|
109
|
+
name: "nomoreide_start_bundle",
|
|
110
|
+
description: "Start every service in a registered bundle.",
|
|
111
|
+
parameters: bundleNameSchema,
|
|
112
|
+
execute: async ({ name }) => stringify(await manager.startBundle(name)),
|
|
113
|
+
});
|
|
114
|
+
server.addTool({
|
|
115
|
+
name: "nomoreide_stop_bundle",
|
|
116
|
+
description: "Stop every service in a registered bundle.",
|
|
117
|
+
parameters: bundleNameSchema,
|
|
118
|
+
execute: async ({ name }) => stringify(await manager.stopBundle(name)),
|
|
119
|
+
});
|
|
120
|
+
server.addTool({
|
|
121
|
+
name: "nomoreide_status",
|
|
122
|
+
description: "Show current NoMoreIDE runtime status.",
|
|
123
|
+
execute: async () => stringify(manager.status()),
|
|
124
|
+
});
|
|
125
|
+
server.addTool({
|
|
126
|
+
name: "nomoreide_git_status",
|
|
127
|
+
description: "Show safe Git branch and porcelain status for a repository.",
|
|
128
|
+
parameters: gitCwdSchema,
|
|
129
|
+
execute: async ({ cwd }) => stringify(await git(cwd).status()),
|
|
130
|
+
});
|
|
131
|
+
server.addTool({
|
|
132
|
+
name: "nomoreide_git_diff",
|
|
133
|
+
description: "Show unstaged Git diff for a repository or file.",
|
|
134
|
+
parameters: gitPathSchema,
|
|
135
|
+
execute: async ({ cwd, path }) => await git(cwd).diff(path),
|
|
136
|
+
});
|
|
137
|
+
server.addTool({
|
|
138
|
+
name: "nomoreide_git_staged_diff",
|
|
139
|
+
description: "Show staged Git diff for a repository or file.",
|
|
140
|
+
parameters: gitPathSchema,
|
|
141
|
+
execute: async ({ cwd, path }) => await git(cwd).stagedDiff(path),
|
|
142
|
+
});
|
|
143
|
+
server.addTool({
|
|
144
|
+
name: "nomoreide_git_log",
|
|
145
|
+
description: "Show recent Git commits.",
|
|
146
|
+
parameters: gitCwdSchema.extend({
|
|
147
|
+
limit: z.number().int().positive().max(50).optional(),
|
|
148
|
+
}),
|
|
149
|
+
execute: async ({ cwd, limit }) => stringify(await git(cwd).log(limit)),
|
|
150
|
+
});
|
|
151
|
+
server.addTool({
|
|
152
|
+
name: "nomoreide_git_stage",
|
|
153
|
+
description: "Stage explicit file paths.",
|
|
154
|
+
parameters: gitPathsSchema,
|
|
155
|
+
execute: async ({ cwd, paths }) => stringify(await git(cwd).stage(paths)),
|
|
156
|
+
});
|
|
157
|
+
server.addTool({
|
|
158
|
+
name: "nomoreide_git_unstage",
|
|
159
|
+
description: "Unstage explicit file paths.",
|
|
160
|
+
parameters: gitPathsSchema,
|
|
161
|
+
execute: async ({ cwd, paths }) => stringify(await git(cwd).unstage(paths)),
|
|
162
|
+
});
|
|
163
|
+
server.addTool({
|
|
164
|
+
name: "nomoreide_git_commit",
|
|
165
|
+
description: "Create a Git commit from currently staged changes.",
|
|
166
|
+
parameters: gitCwdSchema.extend({
|
|
167
|
+
message: z.string().min(1),
|
|
168
|
+
}),
|
|
169
|
+
execute: async ({ cwd, message }) => await git(cwd).commit(message),
|
|
170
|
+
});
|
|
171
|
+
server.addTool({
|
|
172
|
+
name: "nomoreide_git_register_repository",
|
|
173
|
+
description: "Register a named Git repository folder for NoMoreIDE.",
|
|
174
|
+
parameters: z.object({
|
|
175
|
+
name: z.string().min(1),
|
|
176
|
+
path: z.string().min(1),
|
|
177
|
+
}),
|
|
178
|
+
execute: async (args) => stringify(await configStore.registerGitRepository(args)),
|
|
179
|
+
});
|
|
180
|
+
server.addTool({
|
|
181
|
+
name: "nomoreide_git_select_repository",
|
|
182
|
+
description: "Select the registered Git repository shown by NoMoreIDE.",
|
|
183
|
+
parameters: z.object({
|
|
184
|
+
name: z.string().min(1),
|
|
185
|
+
}),
|
|
186
|
+
execute: async ({ name }) => stringify(await configStore.selectGitRepository(name)),
|
|
187
|
+
});
|
|
188
|
+
return {
|
|
189
|
+
server,
|
|
190
|
+
configStore,
|
|
191
|
+
logStore,
|
|
192
|
+
manager,
|
|
193
|
+
toolNames: NOMOREIDE_TOOL_NAMES,
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
function git(cwd) {
|
|
197
|
+
return new GitManager(cwd ?? process.cwd());
|
|
198
|
+
}
|
|
199
|
+
export async function startNoMoreIdeMcpServer() {
|
|
200
|
+
const { server } = createNoMoreIdeMcpServer();
|
|
201
|
+
await server.start({ transportType: "stdio" });
|
|
202
|
+
}
|
|
203
|
+
function stringify(value) {
|
|
204
|
+
return JSON.stringify(value, null, 2);
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +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,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,yBAAyB;IACzB,4BAA4B;IAC5B,yBAAyB;IACzB,wBAAwB;IACxB,2BAA2B;IAC3B,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|
|
2
|
+
import type { NoMoreIdeConfig, LogEntry } from "../core/types.js";
|
|
3
|
+
export type TuiMode = "services" | "bundles" | "logs";
|
|
4
|
+
export interface TuiScreenState {
|
|
5
|
+
mode: TuiMode;
|
|
6
|
+
selectedIndex: number;
|
|
7
|
+
selectedService?: string;
|
|
8
|
+
config: NoMoreIdeConfig;
|
|
9
|
+
runtime: NoMoreIdeStatus;
|
|
10
|
+
logs: LogEntry[];
|
|
11
|
+
}
|
|
12
|
+
export interface TuiAppOptions {
|
|
13
|
+
configPath?: string;
|
|
14
|
+
logDir?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface TuiApp {
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
export declare function createTuiApp(options?: TuiAppOptions): TuiApp;
|
|
20
|
+
export declare function renderTuiScreen(state: TuiScreenState): string;
|