nomoreide 0.1.26 → 0.1.28

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.
Files changed (69) hide show
  1. package/dist/core/config-store.d.ts +6 -1
  2. package/dist/core/config-store.js +108 -0
  3. package/dist/core/config-store.js.map +1 -1
  4. package/dist/core/db/driver.d.ts +43 -0
  5. package/dist/core/db/driver.js +41 -0
  6. package/dist/core/db/driver.js.map +1 -0
  7. package/dist/core/db/mysql-driver.d.ts +19 -0
  8. package/dist/core/db/mysql-driver.js +95 -0
  9. package/dist/core/db/mysql-driver.js.map +1 -0
  10. package/dist/core/db/postgres-driver.d.ts +19 -0
  11. package/dist/core/db/postgres-driver.js +109 -0
  12. package/dist/core/db/postgres-driver.js.map +1 -0
  13. package/dist/core/db/sqlite-driver.d.ts +17 -0
  14. package/dist/core/db/sqlite-driver.js +68 -0
  15. package/dist/core/db/sqlite-driver.js.map +1 -0
  16. package/dist/core/db-peek.d.ts +49 -0
  17. package/dist/core/db-peek.js +150 -0
  18. package/dist/core/db-peek.js.map +1 -0
  19. package/dist/core/log-sources.d.ts +21 -0
  20. package/dist/core/log-sources.js +219 -0
  21. package/dist/core/log-sources.js.map +1 -0
  22. package/dist/core/service-log-source.d.ts +9 -0
  23. package/dist/core/service-log-source.js +49 -0
  24. package/dist/core/service-log-source.js.map +1 -0
  25. package/dist/core/terminal-manager.d.ts +40 -0
  26. package/dist/core/terminal-manager.js +64 -0
  27. package/dist/core/terminal-manager.js.map +1 -0
  28. package/dist/core/terminal-session.d.ts +91 -0
  29. package/dist/core/terminal-session.js +159 -0
  30. package/dist/core/terminal-session.js.map +1 -0
  31. package/dist/core/types.d.ts +71 -0
  32. package/dist/mcp/server.js +3 -0
  33. package/dist/mcp/server.js.map +1 -1
  34. package/dist/mcp/tools/context.d.ts +2 -0
  35. package/dist/mcp/tools/context.js.map +1 -1
  36. package/dist/mcp/tools/database.d.ts +8 -0
  37. package/dist/mcp/tools/database.js +52 -0
  38. package/dist/mcp/tools/database.js.map +1 -0
  39. package/dist/mcp/tools/index.d.ts +1 -1
  40. package/dist/mcp/tools/index.js +3 -0
  41. package/dist/mcp/tools/index.js.map +1 -1
  42. package/dist/web/client/assets/index-0aS5yzpo.js +40 -0
  43. package/dist/web/client/assets/index-DIpnQDCK.css +1 -0
  44. package/dist/web/client/index.html +2 -2
  45. package/dist/web/routes/context.d.ts +4 -0
  46. package/dist/web/routes/context.js.map +1 -1
  47. package/dist/web/routes/database-routes.d.ts +3 -0
  48. package/dist/web/routes/database-routes.js +78 -0
  49. package/dist/web/routes/database-routes.js.map +1 -0
  50. package/dist/web/routes/git-routes.js +9 -1
  51. package/dist/web/routes/git-routes.js.map +1 -1
  52. package/dist/web/routes/index.js +6 -0
  53. package/dist/web/routes/index.js.map +1 -1
  54. package/dist/web/routes/log-sources-routes.d.ts +6 -0
  55. package/dist/web/routes/log-sources-routes.js +102 -0
  56. package/dist/web/routes/log-sources-routes.js.map +1 -0
  57. package/dist/web/routes/service-routes.js +24 -2
  58. package/dist/web/routes/service-routes.js.map +1 -1
  59. package/dist/web/routes/shell-routes.js +8 -1
  60. package/dist/web/routes/shell-routes.js.map +1 -1
  61. package/dist/web/routes/terminal-routes.d.ts +7 -0
  62. package/dist/web/routes/terminal-routes.js +25 -0
  63. package/dist/web/routes/terminal-routes.js.map +1 -0
  64. package/dist/web/server.d.ts +2 -0
  65. package/dist/web/server.js +107 -0
  66. package/dist/web/server.js.map +1 -1
  67. package/package.json +13 -2
  68. package/dist/web/client/assets/index-CgtUFH5U.css +0 -1
  69. package/dist/web/client/assets/index-DQdQ7efQ.js +0 -24
@@ -0,0 +1,91 @@
1
+ export type TerminalState = "idle" | "running" | "exited" | "error";
2
+ export interface TerminalSize {
3
+ cols: number;
4
+ rows: number;
5
+ }
6
+ export interface TerminalExit {
7
+ exitCode?: number;
8
+ signal?: number | string;
9
+ }
10
+ export interface TerminalSnapshot extends TerminalSize {
11
+ cwd: string;
12
+ state: TerminalState;
13
+ shell: string;
14
+ exit?: TerminalExit;
15
+ error?: string;
16
+ }
17
+ export interface PtyProcess {
18
+ write(data: string): void;
19
+ resize(cols: number, rows: number): void;
20
+ kill(signal?: string): void;
21
+ onData(callback: (data: string) => void): {
22
+ dispose(): void;
23
+ };
24
+ onExit(callback: (exit: TerminalExit) => void): {
25
+ dispose(): void;
26
+ };
27
+ }
28
+ export interface PtyAdapter {
29
+ spawn(file: string, args: string[], options: {
30
+ cwd: string;
31
+ env: NodeJS.ProcessEnv;
32
+ cols: number;
33
+ rows: number;
34
+ name: string;
35
+ }): PtyProcess;
36
+ }
37
+ export interface TerminalSessionOptions {
38
+ adapter?: PtyAdapter;
39
+ cwd: string;
40
+ env?: NodeJS.ProcessEnv;
41
+ shell?: string;
42
+ }
43
+ type Listener<T> = (value: T) => void;
44
+ export interface TerminalSessionLike {
45
+ dispose(): void;
46
+ onOutput(listener: Listener<string>): {
47
+ dispose(): void;
48
+ };
49
+ onState(listener: Listener<TerminalSnapshot>): {
50
+ dispose(): void;
51
+ };
52
+ resize(cols: number, rows: number): TerminalSnapshot;
53
+ restart(size?: Partial<TerminalSize>): TerminalSnapshot;
54
+ snapshot(): TerminalSnapshot;
55
+ start(size?: Partial<TerminalSize>): TerminalSnapshot;
56
+ stop(signal?: string): TerminalSnapshot;
57
+ write(data: string): void;
58
+ }
59
+ export declare class TerminalSession implements TerminalSessionLike {
60
+ private readonly adapter;
61
+ private readonly cwd;
62
+ private readonly env;
63
+ private readonly shell;
64
+ private cols;
65
+ private rows;
66
+ private exit;
67
+ private error;
68
+ private outputListeners;
69
+ private stateListeners;
70
+ private process;
71
+ private state;
72
+ private disposables;
73
+ constructor(options: TerminalSessionOptions);
74
+ snapshot(): TerminalSnapshot;
75
+ onOutput(listener: Listener<string>): {
76
+ dispose(): void;
77
+ };
78
+ onState(listener: Listener<TerminalSnapshot>): {
79
+ dispose(): void;
80
+ };
81
+ start(size?: Partial<TerminalSize>): TerminalSnapshot;
82
+ restart(size?: Partial<TerminalSize>): TerminalSnapshot;
83
+ stop(signal?: string): TerminalSnapshot;
84
+ write(data: string): void;
85
+ resize(cols: number, rows: number): TerminalSnapshot;
86
+ dispose(): void;
87
+ private emitOutput;
88
+ private emitState;
89
+ private disposeProcessListeners;
90
+ }
91
+ export {};
@@ -0,0 +1,159 @@
1
+ import { createRequire } from "node:module";
2
+ const require = createRequire(import.meta.url);
3
+ export class TerminalSession {
4
+ adapter;
5
+ cwd;
6
+ env;
7
+ shell;
8
+ cols = 80;
9
+ rows = 24;
10
+ exit;
11
+ error;
12
+ outputListeners = new Set();
13
+ stateListeners = new Set();
14
+ process;
15
+ state = "idle";
16
+ disposables = [];
17
+ constructor(options) {
18
+ this.adapter = options.adapter ?? new NodePtyAdapter();
19
+ this.cwd = options.cwd;
20
+ this.env = options.env ?? process.env;
21
+ this.shell = options.shell ?? defaultShell();
22
+ }
23
+ snapshot() {
24
+ return {
25
+ cols: this.cols,
26
+ cwd: this.cwd,
27
+ error: this.error,
28
+ exit: this.exit,
29
+ rows: this.rows,
30
+ shell: this.shell,
31
+ state: this.state,
32
+ };
33
+ }
34
+ onOutput(listener) {
35
+ this.outputListeners.add(listener);
36
+ return {
37
+ dispose: () => {
38
+ this.outputListeners.delete(listener);
39
+ },
40
+ };
41
+ }
42
+ onState(listener) {
43
+ this.stateListeners.add(listener);
44
+ return {
45
+ dispose: () => {
46
+ this.stateListeners.delete(listener);
47
+ },
48
+ };
49
+ }
50
+ start(size = {}) {
51
+ if (this.process && this.state === "running") {
52
+ if (size.cols && size.rows)
53
+ this.resize(size.cols, size.rows);
54
+ return this.snapshot();
55
+ }
56
+ this.cols = normalizeDimension(size.cols, this.cols);
57
+ this.rows = normalizeDimension(size.rows, this.rows);
58
+ this.exit = undefined;
59
+ this.error = undefined;
60
+ try {
61
+ const child = this.adapter.spawn(this.shell, [], {
62
+ cols: this.cols,
63
+ cwd: this.cwd,
64
+ env: this.env,
65
+ name: "xterm-256color",
66
+ rows: this.rows,
67
+ });
68
+ this.process = child;
69
+ this.state = "running";
70
+ this.disposables = [
71
+ child.onData((data) => this.emitOutput(data)),
72
+ child.onExit((exit) => {
73
+ this.exit = exit;
74
+ this.process = undefined;
75
+ this.state = "exited";
76
+ this.disposeProcessListeners();
77
+ this.emitState();
78
+ }),
79
+ ];
80
+ }
81
+ catch (caught) {
82
+ this.process = undefined;
83
+ this.error = caught instanceof Error ? caught.message : String(caught);
84
+ this.state = "error";
85
+ }
86
+ this.emitState();
87
+ return this.snapshot();
88
+ }
89
+ restart(size = {}) {
90
+ this.stop("SIGHUP");
91
+ return this.start(size);
92
+ }
93
+ stop(signal = "SIGHUP") {
94
+ const child = this.process;
95
+ this.process = undefined;
96
+ if (child) {
97
+ child.kill(signal);
98
+ }
99
+ this.disposeProcessListeners();
100
+ if (this.state === "running") {
101
+ this.state = "exited";
102
+ this.exit = { signal };
103
+ }
104
+ this.emitState();
105
+ return this.snapshot();
106
+ }
107
+ write(data) {
108
+ if (!this.process || this.state !== "running")
109
+ return;
110
+ this.process.write(data);
111
+ }
112
+ resize(cols, rows) {
113
+ this.cols = normalizeDimension(cols, this.cols);
114
+ this.rows = normalizeDimension(rows, this.rows);
115
+ if (this.process && this.state === "running") {
116
+ this.process.resize(this.cols, this.rows);
117
+ }
118
+ this.emitState();
119
+ return this.snapshot();
120
+ }
121
+ dispose() {
122
+ this.stop("SIGHUP");
123
+ this.outputListeners.clear();
124
+ this.stateListeners.clear();
125
+ }
126
+ emitOutput(data) {
127
+ for (const listener of this.outputListeners)
128
+ listener(data);
129
+ }
130
+ emitState() {
131
+ const snapshot = this.snapshot();
132
+ for (const listener of this.stateListeners)
133
+ listener(snapshot);
134
+ }
135
+ disposeProcessListeners() {
136
+ for (const item of this.disposables)
137
+ item.dispose();
138
+ this.disposables = [];
139
+ }
140
+ }
141
+ class NodePtyAdapter {
142
+ spawn(file, args, options) {
143
+ const nodePty = require("node-pty");
144
+ return nodePty.spawn(file, args, options);
145
+ }
146
+ }
147
+ function defaultShell() {
148
+ if (process.env.SHELL)
149
+ return process.env.SHELL;
150
+ if (process.platform === "win32")
151
+ return process.env.COMSPEC ?? "cmd.exe";
152
+ return process.platform === "darwin" ? "/bin/zsh" : "/bin/sh";
153
+ }
154
+ function normalizeDimension(value, fallback) {
155
+ if (typeof value !== "number" || !Number.isFinite(value))
156
+ return fallback;
157
+ return Math.max(1, Math.floor(value));
158
+ }
159
+ //# sourceMappingURL=terminal-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-session.js","sourceRoot":"","sources":["../../src/core/terminal-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAiE/C,MAAM,OAAO,eAAe;IACT,OAAO,CAAa;IACpB,GAAG,CAAS;IACZ,GAAG,CAAoB;IACvB,KAAK,CAAS;IACvB,IAAI,GAAG,EAAE,CAAC;IACV,IAAI,GAAG,EAAE,CAAC;IACV,IAAI,CAA2B;IAC/B,KAAK,CAAqB;IAC1B,eAAe,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC9C,cAAc,GAAG,IAAI,GAAG,EAA8B,CAAC;IACvD,OAAO,CAAyB;IAChC,KAAK,GAAkB,MAAM,CAAC;IAC9B,WAAW,GAA+B,EAAE,CAAC;IAErD,YAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,cAAc,EAAE,CAAC;QACvD,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;QACvB,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;QACtC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,EAAE,CAAC;IAC/C,CAAC;IAED,QAAQ;QACN,OAAO;YACL,IAAI,EAAE,IAAI,CA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AC;AAChE,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAyB,EAAE,QAAgB;IACrE,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -23,12 +23,81 @@ export interface GitRepositoryDefinition {
23
23
  name: string;
24
24
  path: string;
25
25
  }
26
+ export type DatabaseEngine = "postgres" | "mysql" | "sqlite";
27
+ /**
28
+ * A read-only database connection for DB Peek. For `postgres`/`mysql`, `url` is
29
+ * the connection string (stored like a secret, masked in API responses). For
30
+ * `sqlite`, `url` is an absolute path to the `.db` file.
31
+ */
32
+ export interface DatabaseConnection {
33
+ name: string;
34
+ engine: DatabaseEngine;
35
+ url: string;
36
+ }
37
+ export type LogSourceKind = "file" | "ssh" | "command";
38
+ /**
39
+ * Structured log backend. When set, the source builds its own query (time
40
+ * range, text filter, level) instead of a fixed `tail`, pushing the work down
41
+ * to the host. Runs over ssh when `host` is set, otherwise locally.
42
+ */
43
+ export type LogDriver = "journald" | "docker";
44
+ /**
45
+ * A named, on-demand log reader (e.g. "UAT", "PROD") that is *not* tied to a
46
+ * managed process. `file` tails a local path, `ssh` tails a path on a remote
47
+ * host via the local ssh binary + ~/.ssh/config, and `command` runs an
48
+ * arbitrary command (journalctl, kubectl logs, …) and treats its output as log.
49
+ *
50
+ * Setting `driver` upgrades the source to a query backend: `journald` filters
51
+ * server-side via journalctl flags, `docker` via `docker logs` windowing.
52
+ */
53
+ export interface LogSourceDefinition {
54
+ name: string;
55
+ kind: LogSourceKind;
56
+ /** Absolute path for `file`; remote path for `ssh`. */
57
+ path?: string;
58
+ /** SSH host/alias for `ssh`, and for any `driver` source run remotely. */
59
+ host?: string;
60
+ /** Command line for `command`. */
61
+ command?: string;
62
+ /** Optional working directory for `command`. */
63
+ cwd?: string;
64
+ /** Query backend. When set, `since`/`until`/`grep`/`level` are honored. */
65
+ driver?: LogDriver;
66
+ /** systemd unit for `driver: "journald"`. */
67
+ unit?: string;
68
+ /** container name/id for `driver: "docker"`. */
69
+ container?: string;
70
+ }
71
+ /**
72
+ * Read-time query for a log source. Honored fully by `journald` (server-side
73
+ * journalctl flags) and partially by `docker` (time window server-side, text +
74
+ * level filtered client-side); for plain file/ssh/command sources `grep`/`level`
75
+ * are applied client-side and `since`/`until`/`cursor` are ignored.
76
+ */
77
+ export interface LogQuery {
78
+ /** Start of time window, e.g. "today", "1 hour ago", "2026-05-24 00:00". */
79
+ since?: string;
80
+ /** End of time window. */
81
+ until?: string;
82
+ /** Case-insensitive text/regex filter. */
83
+ grep?: string;
84
+ /** Minimum severity to include. */
85
+ level?: "warn" | "error";
86
+ /** Max lines (tail). */
87
+ lines?: number;
88
+ /** journald cursor to page *newer* than (`--after-cursor`). */
89
+ cursor?: string;
90
+ /** journald cursor to page *older* than — returns the `lines` entries before it. */
91
+ before?: string;
92
+ }
26
93
  export interface NoMoreIdeConfig {
27
94
  version: 1;
28
95
  services: ServiceDefinition[];
29
96
  bundles: BundleDefinition[];
30
97
  gitRepositories: GitRepositoryDefinition[];
31
98
  selectedGitRepository?: string;
99
+ databases: DatabaseConnection[];
100
+ logSources: LogSourceDefinition[];
32
101
  }
33
102
  export type ServiceState = "stopped" | "starting" | "running" | "exited";
34
103
  export interface ServiceStatus {
@@ -57,6 +126,8 @@ export interface LogEntry {
57
126
  stream: LogStream;
58
127
  text: string;
59
128
  timestamp: string;
129
+ /** journald `__CURSOR` for sources that support it; enables "load older" paging. */
130
+ cursor?: string;
60
131
  }
61
132
  export type ServiceHealthStatus = "unknown" | "healthy" | "warning" | "unhealthy";
62
133
  export interface HealthCheckResult {
@@ -1,6 +1,7 @@
1
1
  import { dirname, resolve } from "node:path";
2
2
  import { FastMCP } from "fastmcp";
3
3
  import { ConfigStore, defaultGlobalConfigPath } from "../core/config-store.js";
4
+ import { DbPeek } from "../core/db-peek.js";
4
5
  import { ErrorInbox } from "../core/error-inbox.js";
5
6
  import { LogStore } from "../core/log-store.js";
6
7
  import { ProcessManager } from "../core/process-manager.js";
@@ -22,6 +23,7 @@ export function createNoMoreIdeMcpServer(options = {}) {
22
23
  });
23
24
  const manager = new ProcessManager({ configStore, logStore, timelineStore });
24
25
  const errorInbox = new ErrorInbox({ logStore, configStore });
26
+ const dbPeek = new DbPeek({ configStore });
25
27
  const toolCallStore = new ToolCallStore();
26
28
  const uiLifecycle = options.uiLifecycle ??
27
29
  createUiLifecycleManager({
@@ -37,6 +39,7 @@ export function createNoMoreIdeMcpServer(options = {}) {
37
39
  registerNoMoreIdeTools({
38
40
  server,
39
41
  configStore,
42
+ dbPeek,
40
43
  errorInbox,
41
44
  logStore,
42
45
  manager,
@@ -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/E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EACL,wBAAwB,GAEzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAyBxD,M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
@@ -1,5 +1,6 @@
1
1
  import type { FastMCP } from "fastmcp";
2
2
  import type { ConfigStore } from "../../core/config-store.js";
3
+ import type { DbPeek } from "../../core/db-peek.js";
3
4
  import type { ErrorInbox } from "../../core/error-inbox.js";
4
5
  import { GitManager } from "../../core/git-manager.js";
5
6
  import type { LogStore } from "../../core/log-store.js";
@@ -10,6 +11,7 @@ import type { UiLifecycleManager } from "../../web/ui-lifecycle.js";
10
11
  /** Shared stateful services every tool group receives. */
11
12
  export interface ToolContext {
12
13
  configStore: ConfigStore;
14
+ dbPeek: DbPeek;
13
15
  errorInbox: ErrorInbox;
14
16
  logStore: LogStore;
15
17
  manager: ProcessManager;
@@ -1 +1 @@
1
- {"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/tools/context.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,WAAW,EAAsB,MAAM,+BAA+B,CAAC;AAgBhF,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,eAAe,GAAG,UAAU,CAAC,OAAO,CAAC;QAC3C,MAAM,mBAAmB,GAAG;YAC1B,GAAG,UAAU;YACb,OAAO,EAAE,KAAK,EAAE,IAAa,EAAE,OAAgB,EAAE,EAAE;gBACjD,MAAM,KAAK,G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OAAO,MAA4C,CAAC;gBACtD,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,KAAK,CAAC,MAAM,CAAC;wBACX,IAAI,EAAE,UAAU,CAAC,IAAI;wBACrB,SAAS;wBACT,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;wBAC9B,MAAM,EAAE,OAAO;wBACf,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;wBACvB,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;qBAC9D,CAAC,CAAC;oBACH,MAAM,KAAK,CAAC;gBACd,CAAC;YACH,CAAC;SACmC,CAAC;QACvC,OAAO,WAAW,CAAC,mBAAmB,CAAC,CAAC;IAC1C,CAAC,CAAC;IACF,OAAO,IAAI,KAAK,CAAC,MAAM,EAAE;QACvB,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ;YACxB,IAAI,IAAI,KAAK,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,8 @@
1
+ import type { FastMCP } from "fastmcp";
2
+ import { type ToolContext } from "./context.js";
3
+ export declare const DATABASE_TOOL_NAMES: readonly ["nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample"];
4
+ /**
5
+ * DB Peek tools: read-only browsing of the user's registered database
6
+ * connections. Scoped to connections in ConfigStore — no arbitrary SQL.
7
+ */
8
+ export declare function registerDatabaseTools(server: FastMCP, ctx: ToolContext): void;
@@ -0,0 +1,52 @@
1
+ import { z } from "zod";
2
+ import { stringify } from "./context.js";
3
+ export const DATABASE_TOOL_NAMES = [
4
+ "nomoreide_list_databases",
5
+ "nomoreide_db_tables",
6
+ "nomoreide_db_sample",
7
+ ];
8
+ const connectionSchema = z.object({
9
+ connection: z
10
+ .string()
11
+ .min(1)
12
+ .describe("Connection name from nomoreide_list_databases."),
13
+ });
14
+ const sampleSchema = connectionSchema.extend({
15
+ table: z
16
+ .string()
17
+ .min(1)
18
+ .describe("Qualified table name from nomoreide_db_tables (e.g. public.users)."),
19
+ limit: z
20
+ .number()
21
+ .int()
22
+ .positive()
23
+ .max(1000)
24
+ .optional()
25
+ .describe("Max rows to sample (default 100)."),
26
+ });
27
+ /**
28
+ * DB Peek tools: read-only browsing of the user's registered database
29
+ * connections. Scoped to connections in ConfigStore — no arbitrary SQL.
30
+ */
31
+ export function registerDatabaseTools(server, ctx) {
32
+ const { dbPeek } = ctx;
33
+ server.addTool({
34
+ name: "nomoreide_list_databases",
35
+ description: "List registered read-only database connections (Postgres / MySQL / SQLite). Passwords are masked.",
36
+ parameters: z.object({}),
37
+ execute: async () => stringify(await dbPeek.listConnections()),
38
+ });
39
+ server.addTool({
40
+ name: "nomoreide_db_tables",
41
+ description: "List the tables and views in a registered database connection.",
42
+ parameters: connectionSchema,
43
+ execute: async ({ connection }) => stringify(await dbPeek.listTables(connection)),
44
+ });
45
+ server.addTool({
46
+ name: "nomoreide_db_sample",
47
+ description: "Sample rows from a table (read-only) with its column schema — the 'explain this data to the agent' payload.",
48
+ parameters: sampleSchema,
49
+ execute: async ({ connection, table, limit }) => stringify(await dbPeek.sampleRows(connection, table, limit ?? 100)),
50
+ });
51
+ }
52
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../../../src/mcp/tools/database.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,0BAA0B;IAC1B,qBAAqB;IACrB,qBAAqB;CACb,CAAC;AAEX,MAAM,gBAAgB,GAA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,UAAU,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,CAC9C,SAAS,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,IAAI,GAAG,CAAC,CAAC;KACtE,CAAC,CAAC;AACL,CAAC"}
@@ -9,7 +9,7 @@ import { type ToolContext } from "./context.js";
9
9
  * a new domain module and register it below. This aggregator never grows a
10
10
  * per-tool branch.
11
11
  */
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_list_errors", "nomoreide_error_prompt", "nomoreide_open_ui", "nomoreide_close_ui"];
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_list_errors", "nomoreide_error_prompt", "nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample", "nomoreide_open_ui", "nomoreide_close_ui"];
13
13
  interface RegisterNoMoreIdeToolsOptions extends ToolContext {
14
14
  server: FastMCP;
15
15
  toolCallStore?: ToolCallStore;
@@ -1,5 +1,6 @@
1
1
  import { wrapServerForRecording } from "./context.js";
2
2
  import { AGENT_TOOL_NAMES, registerAgentTools } from "./agent.js";
3
+ import { DATABASE_TOOL_NAMES, registerDatabaseTools } from "./database.js";
3
4
  import { ERROR_TOOL_NAMES, registerErrorTools } from "./errors.js";
4
5
  import { GIT_TOOL_NAMES, registerGitTools } from "./git.js";
5
6
  import { registerServiceTools, SERVICE_TOOL_NAMES } from "./services.js";
@@ -15,6 +16,7 @@ export const NOMOREIDE_TOOL_NAMES = [
15
16
  ...SERVICE_TOOL_NAMES,
16
17
  ...GIT_TOOL_NAMES,
17
18
  ...ERROR_TOOL_NAMES,
19
+ ...DATABASE_TOOL_NAMES,
18
20
  ...AGENT_TOOL_NAMES,
19
21
  ];
20
22
  export function registerNoMoreIdeTools(options) {
@@ -25,6 +27,7 @@ export function registerNoMoreIdeTools(options) {
25
27
  registerServiceTools(server, ctx);
26
28
  registerGitTools(server, ctx);
27
29
  registerErrorTools(server, ctx);
30
+ registerDatabaseTools(server, ctx);
28
31
  registerAgentTools(server, ctx);
29
32
  }
30
33
  //# sourceMappingURL=index.js.map
@@ -1 +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,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,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