nomoreide 0.1.22 → 0.1.23

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.
@@ -4,8 +4,8 @@ import { LogStore } from "../core/log-store.js";
4
4
  import { ProcessManager } from "../core/process-manager.js";
5
5
  import { ToolCallStore } from "../core/tool-call-store.js";
6
6
  import { type UiLifecycleManager } from "../web/ui-lifecycle.js";
7
- import { NOMOREIDE_TOOL_NAMES } from "./tools.js";
8
- export { NOMOREIDE_TOOL_NAMES } from "./tools.js";
7
+ import { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
8
+ export { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
9
9
  interface CreateNoMoreIdeMcpServerOptions {
10
10
  configPath?: string;
11
11
  logDir?: string;
@@ -6,8 +6,8 @@ import { ProcessManager } from "../core/process-manager.js";
6
6
  import { TimelineStore } from "../core/timeline-store.js";
7
7
  import { ToolCallStore } from "../core/tool-call-store.js";
8
8
  import { createUiLifecycleManager, } from "../web/ui-lifecycle.js";
9
- import { NOMOREIDE_TOOL_NAMES, registerNoMoreIdeTools, } from "./tools.js";
10
- export { NOMOREIDE_TOOL_NAMES } from "./tools.js";
9
+ import { NOMOREIDE_TOOL_NAMES, registerNoMoreIdeTools, } from "./tools/index.js";
10
+ export { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
11
11
  export function createNoMoreIdeMcpServer(options = {}) {
12
12
  const configPath = options.configPath ?? defaultGlobalConfigPath();
13
13
  const logDir = options.logDir ?? resolve(process.cwd(), ".nomoreide/logs");
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC/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
+ import type { FastMCP } from "fastmcp";
2
+ import { type ToolContext } from "./context.js";
3
+ export declare const AGENT_TOOL_NAMES: readonly ["nomoreide_open_ui", "nomoreide_close_ui"];
4
+ export declare function registerAgentTools(server: FastMCP, ctx: ToolContext): void;
@@ -0,0 +1,19 @@
1
+ import { stringify } from "./context.js";
2
+ export const AGENT_TOOL_NAMES = [
3
+ "nomoreide_open_ui",
4
+ "nomoreide_close_ui",
5
+ ];
6
+ export function registerAgentTools(server, ctx) {
7
+ const { uiLifecycle } = ctx;
8
+ server.addTool({
9
+ name: "nomoreide_open_ui",
10
+ description: "Open or reuse the singleton NoMoreIDE web UI.",
11
+ execute: async () => stringify(await uiLifecycle.ensureStarted()),
12
+ });
13
+ server.addTool({
14
+ name: "nomoreide_close_ui",
15
+ description: "Close the NoMoreIDE web UI owned by this MCP process.",
16
+ execute: async () => stringify(await uiLifecycle.close()),
17
+ });
18
+ }
19
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/mcp/tools/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,mBAAmB;IACnB,oBAAoB;CACZ,CAAC;AAEX,MAAM,UAAU,kBAAkB,CAAC,MAAe,EAAE,GAAgB;IAClE,MAAM,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC;IAE5B,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,mBAAmB;QACzB,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,WAAW,CAAC,aAAa,EAAE,CAAC;KAClE,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,uDAAuD;QACpE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;KAC1D,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,26 @@
1
+ import type { FastMCP } from "fastmcp";
2
+ import type { ConfigStore } from "../../core/config-store.js";
3
+ import { GitManager } from "../../core/git-manager.js";
4
+ import type { LogStore } from "../../core/log-store.js";
5
+ import type { ProcessManager } from "../../core/process-manager.js";
6
+ import type { TimelineStore } from "../../core/timeline-store.js";
7
+ import { type ToolCallStore } from "../../core/tool-call-store.js";
8
+ import type { UiLifecycleManager } from "../../web/ui-lifecycle.js";
9
+ /** Shared stateful services every tool group receives. */
10
+ export interface ToolContext {
11
+ configStore: ConfigStore;
12
+ logStore: LogStore;
13
+ manager: ProcessManager;
14
+ timelineStore: TimelineStore;
15
+ uiLifecycle: UiLifecycleManager;
16
+ }
17
+ /** Each domain registers its tools onto the (optionally recording) server. */
18
+ export type RegisterTools = (server: FastMCP, ctx: ToolContext) => void;
19
+ export declare function git(cwd?: string): GitManager;
20
+ export declare function stringify(value: unknown): string;
21
+ /**
22
+ * Wrap a FastMCP server so every `addTool` execute is timed and recorded in
23
+ * the tool-call store. The aggregator wraps once, then hands the same wrapped
24
+ * server to each domain's `registerXTools`.
25
+ */
26
+ export declare function wrapServerForRecording(server: FastMCP, store: ToolCallStore): FastMCP;
@@ -0,0 +1,57 @@
1
+ import { GitManager } from "../../core/git-manager.js";
2
+ import { previewArgs } from "../../core/tool-call-store.js";
3
+ export function git(cwd) {
4
+ return new GitManager(cwd ?? process.cwd());
5
+ }
6
+ export function stringify(value) {
7
+ return JSON.stringify(value, null, 2);
8
+ }
9
+ /**
10
+ * Wrap a FastMCP server so every `addTool` execute is timed and recorded in
11
+ * the tool-call store. The aggregator wraps once, then hands the same wrapped
12
+ * server to each domain's `registerXTools`.
13
+ */
14
+ export function wrapServerForRecording(server, store) {
15
+ const originalAdd = server.addTool.bind(server);
16
+ const wrapped = (definition) => {
17
+ const originalExecute = definition.execute;
18
+ const recordingDefinition = {
19
+ ...definition,
20
+ execute: async (args, context) => {
21
+ const start = Date.now();
22
+ const startedAt = new Date(start).toISOString();
23
+ try {
24
+ const result = await originalExecute(args, context);
25
+ store.record({
26
+ tool: definition.name,
27
+ startedAt,
28
+ durationMs: Date.now() - start,
29
+ status: "ok",
30
+ args: previewArgs(args),
31
+ });
32
+ return result;
33
+ }
34
+ catch (error) {
35
+ store.record({
36
+ tool: definition.name,
37
+ startedAt,
38
+ durationMs: Date.now() - start,
39
+ status: "error",
40
+ args: previewArgs(args),
41
+ error: error instanceof Error ? error.message : String(error),
42
+ });
43
+ throw error;
44
+ }
45
+ },
46
+ };
47
+ return originalAdd(recordingDefinition);
48
+ };
49
+ return new Proxy(server, {
50
+ get(target, prop, receiver) {
51
+ if (prop === "addTool")
52
+ return wrapped;
53
+ return Reflect.get(target, prop, receiver);
54
+ },
55
+ });
56
+ }
57
+ //# sourceMappingURL=context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/tools/context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,WAAW,EAAsB,MAAM,+BAA+B,CAAC;AAehF,MAAM,UAAU,GAAG,CAAC,GAAY;IAC9B,OAAO,IAAI,UAAU,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACxC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CACpC,MAAe,EACf,KAAoB;IAEpB,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChD,MAAM,OAAO,GAAG,CAAC,UAA6C,EAAE,EAAE;QAChE,MAAM,eAA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K,SAAS;gBAAE,OAAO,OAAO,CAAC;YACvC,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC7C,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastMCP } from "fastmcp";
2
+ import { type ToolContext } from "./context.js";
3
+ export declare const GIT_TOOL_NAMES: readonly ["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"];
4
+ export declare function registerGitTools(server: FastMCP, ctx: ToolContext): void;
@@ -0,0 +1,120 @@
1
+ import { z } from "zod";
2
+ import { git, stringify } from "./context.js";
3
+ export const GIT_TOOL_NAMES = [
4
+ "nomoreide_git_status",
5
+ "nomoreide_git_branches",
6
+ "nomoreide_git_switch_branch",
7
+ "nomoreide_git_create_branch",
8
+ "nomoreide_git_fetch",
9
+ "nomoreide_git_diff",
10
+ "nomoreide_git_staged_diff",
11
+ "nomoreide_git_log",
12
+ "nomoreide_git_stage",
13
+ "nomoreide_git_unstage",
14
+ "nomoreide_git_commit",
15
+ "nomoreide_git_register_repository",
16
+ "nomoreide_git_select_repository",
17
+ ];
18
+ const gitCwdSchema = z.object({
19
+ cwd: z.string().min(1).optional().describe("Git repository directory."),
20
+ });
21
+ const gitPathSchema = gitCwdSchema.extend({
22
+ path: z.string().min(1).optional().describe("Optional file path."),
23
+ });
24
+ const gitBranchSchema = gitCwdSchema.extend({
25
+ name: z.string().min(1).describe("Branch name."),
26
+ });
27
+ const gitPathsSchema = gitCwdSchema.extend({
28
+ paths: z.array(z.string().min(1)).min(1),
29
+ });
30
+ export function registerGitTools(server, ctx) {
31
+ const { configStore } = ctx;
32
+ server.addTool({
33
+ name: "nomoreide_git_status",
34
+ description: "Show safe Git branch and porcelain status for a repository.",
35
+ parameters: gitCwdSchema,
36
+ execute: async ({ cwd }) => stringify(await git(cwd).status()),
37
+ });
38
+ server.addTool({
39
+ name: "nomoreide_git_diff",
40
+ description: "Show unstaged Git diff for a repository or file.",
41
+ parameters: gitPathSchema,
42
+ execute: async ({ cwd, path }) => await git(cwd).diff(path),
43
+ });
44
+ server.addTool({
45
+ name: "nomoreide_git_branches",
46
+ description: "List local and remote Git branches for a repository.",
47
+ parameters: gitCwdSchema,
48
+ execute: async ({ cwd }) => stringify(await git(cwd).branches()),
49
+ });
50
+ server.addTool({
51
+ name: "nomoreide_git_switch_branch",
52
+ description: "Switch to a local branch, or track a remote branch.",
53
+ parameters: gitBranchSchema,
54
+ execute: async ({ cwd, name }) => await git(cwd).switchBranch(name),
55
+ });
56
+ server.addTool({
57
+ name: "nomoreide_git_create_branch",
58
+ description: "Create and switch to a new Git branch.",
59
+ parameters: gitBranchSchema,
60
+ execute: async ({ cwd, name }) => await git(cwd).createBranch(name),
61
+ });
62
+ server.addTool({
63
+ name: "nomoreide_git_fetch",
64
+ description: "Fetch and prune remote Git refs for a repository.",
65
+ parameters: gitCwdSchema,
66
+ execute: async ({ cwd }) => await git(cwd).fetch(),
67
+ });
68
+ server.addTool({
69
+ name: "nomoreide_git_staged_diff",
70
+ description: "Show staged Git diff for a repository or file.",
71
+ parameters: gitPathSchema,
72
+ execute: async ({ cwd, path }) => await git(cwd).stagedDiff(path),
73
+ });
74
+ server.addTool({
75
+ name: "nomoreide_git_log",
76
+ description: "Show recent Git commits.",
77
+ parameters: gitCwdSchema.extend({
78
+ limit: z.number().int().positive().max(50).optional(),
79
+ }),
80
+ execute: async ({ cwd, limit }) => stringify(await git(cwd).log(limit)),
81
+ });
82
+ server.addTool({
83
+ name: "nomoreide_git_stage",
84
+ description: "Stage explicit file paths.",
85
+ parameters: gitPathsSchema,
86
+ execute: async ({ cwd, paths }) => stringify(await git(cwd).stage(paths)),
87
+ });
88
+ server.addTool({
89
+ name: "nomoreide_git_unstage",
90
+ description: "Unstage explicit file paths.",
91
+ parameters: gitPathsSchema,
92
+ execute: async ({ cwd, paths }) => stringify(await git(cwd).unstage(paths)),
93
+ });
94
+ server.addTool({
95
+ name: "nomoreide_git_commit",
96
+ description: "Create a Git commit from currently staged changes.",
97
+ parameters: gitCwdSchema.extend({
98
+ message: z.string().min(1),
99
+ }),
100
+ execute: async ({ cwd, message }) => await git(cwd).commit(message),
101
+ });
102
+ server.addTool({
103
+ name: "nomoreide_git_register_repository",
104
+ description: "Register a named Git repository folder for NoMoreIDE.",
105
+ parameters: z.object({
106
+ name: z.string().min(1),
107
+ path: z.string().min(1),
108
+ }),
109
+ execute: async (args) => stringify(await configStore.registerGitRepository(args)),
110
+ });
111
+ server.addTool({
112
+ name: "nomoreide_git_select_repository",
113
+ description: "Select the registered Git repository shown by NoMoreIDE.",
114
+ parameters: z.object({
115
+ name: z.string().min(1),
116
+ }),
117
+ execute: async ({ name }) => stringify(await configStore.selectGitRepository(name)),
118
+ });
119
+ }
120
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../../../src/mcp/tools/git.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAEhE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,sBAAsB;IACtB,wBAAwB;IACxB,6BAA6B;IAC7B,6BAA6B;IAC7B,qBAAqB;IACrB,oBAAoB;IACpB,2BAA2B;IAC3B,mBAAmB;IACnB,qBAAqB;IACrB,uBAAuB;IACvB,sBAAsB;IACtB,mCAAmC;IACnC,iCAAiC;CACzB,CAAC;AAEX,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,C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B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SAC3B,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC;KACpE,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,mCAAmC;QACzC,WAAW,EAAE,uDAAuD;QACpE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;YACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SACxB,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,WAAW,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;KAClF,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,iCAAiC;QACvC,WAAW,EAAE,0DAA0D;QACvE,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC;YACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;SACxB,CAAC;QACF,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAC1B,SAAS,CAAC,MAAM,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;KACzD,CAAC,CAAC;AACL,CAAC"}
@@ -1,19 +1,18 @@
1
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 { TimelineStore } from "../core/timeline-store.js";
6
- import { type ToolCallStore } from "../core/tool-call-store.js";
7
- import type { UiLifecycleManager } from "../web/ui-lifecycle.js";
2
+ import type { ToolCallStore } from "../../core/tool-call-store.js";
3
+ import { type ToolContext } from "./context.js";
4
+ /**
5
+ * Every tool name NoMoreIDE exposes, in registration order. Each domain owns
6
+ * its own slice; this aggregates them — mirroring the web route registry.
7
+ *
8
+ * To add a tool: add it to its domain's `registerXTools` and name list, or add
9
+ * a new domain module and register it below. This aggregator never grows a
10
+ * per-tool branch.
11
+ */
8
12
  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_service_context", "nomoreide_service_health", "nomoreide_timeline", "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"];
9
- interface RegisterNoMoreIdeToolsOptions {
13
+ interface RegisterNoMoreIdeToolsOptions extends ToolContext {
10
14
  server: FastMCP;
11
- configStore: ConfigStore;
12
- logStore: LogStore;
13
- manager: ProcessManager;
14
- timelineStore: TimelineStore;
15
- uiLifecycle: UiLifecycleManager;
16
15
  toolCallStore?: ToolCallStore;
17
16
  }
18
17
  export declare function registerNoMoreIdeTools(options: RegisterNoMoreIdeToolsOptions): void;
19
- export {};
18
+ export type { ToolContext } from "./context.js";
@@ -0,0 +1,27 @@
1
+ import { wrapServerForRecording } from "./context.js";
2
+ import { AGENT_TOOL_NAMES, registerAgentTools } from "./agent.js";
3
+ import { GIT_TOOL_NAMES, registerGitTools } from "./git.js";
4
+ import { registerServiceTools, SERVICE_TOOL_NAMES } from "./services.js";
5
+ /**
6
+ * Every tool name NoMoreIDE exposes, in registration order. Each domain owns
7
+ * its own slice; this aggregates them — mirroring the web route registry.
8
+ *
9
+ * To add a tool: add it to its domain's `registerXTools` and name list, or add
10
+ * a new domain module and register it below. This aggregator never grows a
11
+ * per-tool branch.
12
+ */
13
+ export const NOMOREIDE_TOOL_NAMES = [
14
+ ...SERVICE_TOOL_NAMES,
15
+ ...GIT_TOOL_NAMES,
16
+ ...AGENT_TOOL_NAMES,
17
+ ];
18
+ export function registerNoMoreIdeTools(options) {
19
+ const { server: rawServer, toolCallStore, ...ctx } = options;
20
+ const server = toolCallStore
21
+ ? wrapServerForRecording(rawServer, toolCallStore)
22
+ : rawServer;
23
+ registerServiceTools(server, ctx);
24
+ registerGitTools(server, ctx);
25
+ registerAgentTools(server, ctx);
26
+ }
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAoB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,kBAAkB;IACrB,GAAG,cAAc;IACjB,GAAG,gBAAgB;CACX,CAAC;AAOX,MAAM,UAAU,sBAAsB,CACpC,OAAsC;IAEtC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAC7D,MAAM,MAAM,GAAG,aAAa;QAC1B,CAAC,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC;QAClD,CAAC,CAAC,SAAS,CAAC;IAEd,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FastMCP } from "fastmcp";
2
+ import { type ToolContext } from "./context.js";
3
+ export declare const SERVICE_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_service_context", "nomoreide_service_health", "nomoreide_timeline"];
4
+ export declare function registerServiceTools(server: FastMCP, ctx: ToolContext): void;
@@ -0,0 +1,177 @@
1
+ import { z } from "zod";
2
+ import { buildServiceAgentContext } from "../../core/agent-context.js";
3
+ import { computeServiceHealth } from "../../core/service-health.js";
4
+ import { stringify } from "./context.js";
5
+ export const SERVICE_TOOL_NAMES = [
6
+ "nomoreide_list_services",
7
+ "nomoreide_register_service",
8
+ "nomoreide_start_service",
9
+ "nomoreide_stop_service",
10
+ "nomoreide_restart_service",
11
+ "nomoreide_read_logs",
12
+ "nomoreide_register_bundle",
13
+ "nomoreide_start_bundle",
14
+ "nomoreide_stop_bundle",
15
+ "nomoreide_status",
16
+ "nomoreide_service_context",
17
+ "nomoreide_service_health",
18
+ "nomoreide_timeline",
19
+ ];
20
+ const serviceNameSchema = z.object({
21
+ name: z.string().min(1).describe("Registered service name."),
22
+ });
23
+ const bundleNameSchema = z.object({
24
+ name: z.string().min(1).describe("Registered bundle name."),
25
+ });
26
+ export function registerServiceTools(server, ctx) {
27
+ const { configStore, logStore, manager, timelineStore } = ctx;
28
+ server.addTool({
29
+ name: "nomoreide_list_services",
30
+ description: "List registered NoMoreIDE services and bundles.",
31
+ execute: async () => stringify(await configStore.load()),
32
+ });
33
+ server.addTool({
34
+ name: "nomoreide_register_service",
35
+ description: "Register or replace a development service (local, docker-compose, or ssh). For ssh, NoMoreIDE relies on the user's ~/.ssh/config and ssh-agent and never stores key material; pass a Host alias as `host`.",
36
+ parameters: z.object({
37
+ name: z.string().min(1),
38
+ kind: z.enum(["local", "docker-compose", "ssh"]).optional(),
39
+ command: z.string().min(1).optional(),
40
+ cwd: z.string().min(1).optional(),
41
+ port: z.number().int().positive().max(65535).optional(),
42
+ env: z.record(z.string()).optional(),
43
+ description: z.string().optional(),
44
+ composeFile: z.string().min(1).optional(),
45
+ composeService: z.string().min(1).optional(),
46
+ host: z.string().min(1).optional(),
47
+ }),
48
+ execute: async (args) => stringify(await configStore.registerService(args)),
49
+ });
50
+ server.addTool({
51
+ name: "nomoreide_start_service",
52
+ description: "Start a registered service.",
53
+ parameters: serviceNameSchema,
54
+ execute: async ({ name }) => stringify(await manager.startService(name)),
55
+ });
56
+ server.addTool({
57
+ name: "nomoreide_stop_service",
58
+ description: "Stop a running NoMoreIDE service.",
59
+ parameters: serviceNameSchema,
60
+ execute: async ({ name }) => stringify(await manager.stopService(name)),
61
+ });
62
+ server.addTool({
63
+ name: "nomoreide_restart_service",
64
+ description: "Restart a registered service.",
65
+ parameters: serviceNameSchema,
66
+ execute: async ({ name }) => stringify(await manager.restartService(name)),
67
+ });
68
+ server.addTool({
69
+ name: "nomoreide_read_logs",
70
+ description: "Read recent in-memory logs for a registered service.",
71
+ parameters: z.object({
72
+ name: z.string().min(1),
73
+ limit: z.number().int().positive().max(1000).optional(),
74
+ }),
75
+ execute: async ({ name, limit }) => stringify(logStore.read(name, limit)),
76
+ });
77
+ server.addTool({
78
+ name: "nomoreide_register_bundle",
79
+ description: "Register or replace a bundle of services.",
80
+ parameters: z.object({
81
+ name: z.string().min(1),
82
+ services: z.array(z.string().min(1)).min(1),
83
+ }),
84
+ execute: async (args) => stringify(await configStore.registerBundle(args)),
85
+ });
86
+ server.addTool({
87
+ name: "nomoreide_start_bundle",
88
+ description: "Start every service in a registered bundle.",
89
+ parameters: bundleNameSchema,
90
+ execute: async ({ name }) => stringify(await manager.startBundle(name)),
91
+ });
92
+ server.addTool({
93
+ name: "nomoreide_stop_bundle",
94
+ description: "Stop every service in a registered bundle.",
95
+ parameters: bundleNameSchema,
96
+ execute: async ({ name }) => stringify(await manager.stopBundle(name)),
97
+ });
98
+ server.addTool({
99
+ name: "nomoreide_status",
100
+ description: "Show current NoMoreIDE runtime status.",
101
+ execute: async () => stringify(manager.status()),
102
+ });
103
+ server.addTool({
104
+ name: "nomoreide_service_context",
105
+ description: "Build a copy-paste agent context packet (service definition, runtime status, health summary, recent logs and timeline) for a registered service.",
106
+ parameters: serviceNameSchema,
107
+ execute: async ({ name }) => {
108
+ const config = await configStore.load();
109
+ const definition = config.services.find((service) => service.name === name);
110
+ if (!definition) {
111
+ throw new Error(`Service "${name}" is not registered.`);
112
+ }
113
+ const runtime = await manager.statusWithResources();
114
+ const status = runtime.services[name];
115
+ const logs = logStore.read(name, 80);
116
+ const timeline = timelineStore
117
+ .read(200)
118
+ .filter((event) => event.service === name);
119
+ const health = computeServiceHealth({
120
+ service: definition,
121
+ status,
122
+ logs,
123
+ ports: [],
124
+ timeline,
125
+ });
126
+ return buildServiceAgentContext({
127
+ service: definition,
128
+ status,
129
+ healthSummary: health.summary,
130
+ recentLogs: logs,
131
+ timeline,
132
+ });
133
+ },
134
+ });
135
+ server.addTool({
136
+ name: "nomoreide_service_health",
137
+ description: "Return computed health summaries for one service or all registered services.",
138
+ parameters: z.object({
139
+ service: z.string().min(1).optional(),
140
+ }),
141
+ execute: async ({ service }) => {
142
+ const config = await configStore.load();
143
+ const runtime = await manager.statusWithResources();
144
+ const timeline = timelineStore.read(200);
145
+ const definitions = service
146
+ ? config.services.filter((item) => item.name === service)
147
+ : config.services;
148
+ if (service && definitions.length === 0) {
149
+ throw new Error(`Service "${service}" is not registered.`);
150
+ }
151
+ const health = definitions.map((definition) => computeServiceHealth({
152
+ service: definition,
153
+ status: runtime.services[definition.name],
154
+ logs: logStore.read(definition.name, 80),
155
+ ports: [],
156
+ timeline: timeline.filter((event) => event.service === definition.name),
157
+ }));
158
+ return stringify(service ? health[0] : health);
159
+ },
160
+ });
161
+ server.addTool({
162
+ name: "nomoreide_timeline",
163
+ description: "Return recent NoMoreIDE debug timeline events, optionally filtered by service.",
164
+ parameters: z.object({
165
+ service: z.string().min(1).optional(),
166
+ limit: z.number().int().positive().max(200).default(80),
167
+ }),
168
+ execute: async ({ service, limit }) => {
169
+ const events = timelineStore.read(200);
170
+ const filtered = service
171
+ ? events.filter((event) => event.service === service)
172
+ : events;
173
+ return stringify(filtered.slice(-limit));
174
+ },
175
+ });
176
+ }
177
+ //# sourceMappingURL=services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"services.js","sourceRoot":"","sources":["../../../src/mcp/tools/services.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,yBAAyB;IACzB,4BAA4B;IAC5B,yBAAyB;IACzB,wBAAwB;IACxB,2BAA2B;IAC3B,qBAAqB;IACrB,2BAA2B;IAC3B,wBAAwB;IACxB,uBAAuB;IACvB,kBAAkB;IAClB,2BAA2B;IAC3B,0BAA0B;IAC1B,oBAAoB;CACZ,CAAC;AAEX,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,0BAA0B,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAA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