nomoreide 0.1.73 → 0.1.74
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.d.ts +3 -1
- package/dist/cli/commands.js +13 -14
- package/dist/cli/commands.js.map +1 -1
- package/dist/cli/daemon.d.ts +15 -0
- package/dist/cli/daemon.js +139 -0
- package/dist/cli/daemon.js.map +1 -0
- package/dist/core/agent-env-actions.d.ts +4 -4
- package/dist/core/agent-profiles/registry-config.d.ts +1 -1
- package/dist/core/agent-profiles/registry-config.js +4 -1
- package/dist/core/agent-profiles/registry-config.js.map +1 -1
- package/dist/core/agent-terminal.d.ts +6 -0
- package/dist/core/agent-terminal.js +16 -0
- package/dist/core/agent-terminal.js.map +1 -0
- package/dist/core/app-version.d.ts +2 -0
- package/dist/core/app-version.js +16 -0
- package/dist/core/app-version.js.map +1 -0
- package/dist/core/config-store.js +1 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/daemon-client.d.ts +66 -0
- package/dist/core/daemon-client.js +121 -0
- package/dist/core/daemon-client.js.map +1 -0
- package/dist/core/daemon-lifecycle.d.ts +59 -0
- package/dist/core/daemon-lifecycle.js +147 -0
- package/dist/core/daemon-lifecycle.js.map +1 -0
- package/dist/core/db-peek.d.ts +4 -0
- package/dist/core/db-peek.js +2 -0
- package/dist/core/db-peek.js.map +1 -1
- package/dist/core/repo-onboard.d.ts +8 -8
- package/dist/core/service-health.js +6 -1
- package/dist/core/service-health.js.map +1 -1
- package/dist/core/service-registry.d.ts +5 -3
- package/dist/core/service-registry.js +8 -5
- package/dist/core/service-registry.js.map +1 -1
- package/dist/core/terminal-manager.d.ts +3 -0
- package/dist/core/terminal-manager.js +2 -0
- package/dist/core/terminal-manager.js.map +1 -1
- package/dist/core/terminal-session.d.ts +7 -0
- package/dist/core/terminal-session.js +6 -0
- package/dist/core/terminal-session.js.map +1 -1
- package/dist/core/types.d.ts +6 -0
- package/dist/core/workflows.d.ts +7 -19
- package/dist/core/workflows.js +9 -21
- package/dist/core/workflows.js.map +1 -1
- package/dist/index.js +10 -4
- package/dist/index.js.map +1 -1
- package/dist/mcp/server.d.ts +11 -7
- package/dist/mcp/server.js +15 -34
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/agent.js +15 -5
- package/dist/mcp/tools/agent.js.map +1 -1
- package/dist/mcp/tools/context.d.ts +6 -8
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/database.js +13 -17
- package/dist/mcp/tools/database.js.map +1 -1
- package/dist/mcp/tools/services.d.ts +5 -0
- package/dist/mcp/tools/services.js +31 -21
- package/dist/mcp/tools/services.js.map +1 -1
- package/dist/tui/app.d.ts +4 -2
- package/dist/tui/app.js +19 -16
- package/dist/tui/app.js.map +1 -1
- package/dist/web/client/assets/{code-editor-DetFymBD.js → code-editor-GK07_DNL.js} +1 -1
- package/dist/web/client/assets/index-C8kH2Crm.css +1 -0
- package/dist/web/client/assets/index-D7ZrdlUm.js +219 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/agent-chat-routes.d.ts +1 -1
- package/dist/web/routes/agent-chat-routes.js +3 -4
- package/dist/web/routes/agent-chat-routes.js.map +1 -1
- package/dist/web/routes/context.d.ts +6 -0
- package/dist/web/routes/context.js.map +1 -1
- package/dist/web/routes/dashboard-routes.js +27 -1
- package/dist/web/routes/dashboard-routes.js.map +1 -1
- package/dist/web/routes/database-routes.js +3 -0
- package/dist/web/routes/database-routes.js.map +1 -1
- package/dist/web/routes/shell-routes.js +1 -0
- package/dist/web/routes/shell-routes.js.map +1 -1
- package/dist/web/routes/terminal-routes.js +33 -0
- package/dist/web/routes/terminal-routes.js.map +1 -1
- package/dist/web/routes/workflow-routes.d.ts +2 -2
- package/dist/web/routes/workflow-routes.js +2 -2
- package/dist/web/server.d.ts +2 -0
- package/dist/web/server.js +2 -1
- package/dist/web/server.js.map +1 -1
- package/package.json +2 -1
- package/dist/web/client/assets/index-ZEkxfpgl.js +0 -222
- package/dist/web/client/assets/index-n7aEcfkd.css +0 -1
- package/dist/web/ui-lifecycle.d.ts +0 -30
- package/dist/web/ui-lifecycle.js +0 -129
- package/dist/web/ui-lifecycle.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { InteractiveAgentProvider } from "./agent-terminal.js";
|
|
1
2
|
export type TerminalState = "idle" | "running" | "exited" | "error";
|
|
2
3
|
export interface TerminalSize {
|
|
3
4
|
cols: number;
|
|
@@ -13,6 +14,8 @@ export interface TerminalSnapshot extends TerminalSize {
|
|
|
13
14
|
shell: string;
|
|
14
15
|
/** Human label for the tab (e.g. a service name); absent for plain shells. */
|
|
15
16
|
label?: string;
|
|
17
|
+
kind?: "shell" | "service" | "agent";
|
|
18
|
+
provider?: InteractiveAgentProvider;
|
|
16
19
|
exit?: TerminalExit;
|
|
17
20
|
error?: string;
|
|
18
21
|
}
|
|
@@ -44,6 +47,8 @@ export interface TerminalSessionOptions {
|
|
|
44
47
|
/** Args for the spawned program. Empty → a plain interactive shell. */
|
|
45
48
|
args?: string[];
|
|
46
49
|
label?: string;
|
|
50
|
+
kind?: "shell" | "service" | "agent";
|
|
51
|
+
provider?: InteractiveAgentProvider;
|
|
47
52
|
}
|
|
48
53
|
type Listener<T> = (value: T) => void;
|
|
49
54
|
export interface TerminalSessionLike {
|
|
@@ -68,6 +73,8 @@ export declare class TerminalSession implements TerminalSessionLike {
|
|
|
68
73
|
private readonly shell;
|
|
69
74
|
private readonly args;
|
|
70
75
|
private readonly label;
|
|
76
|
+
private readonly kind;
|
|
77
|
+
private readonly provider;
|
|
71
78
|
private cols;
|
|
72
79
|
private rows;
|
|
73
80
|
private exit;
|
|
@@ -7,6 +7,8 @@ export class TerminalSession {
|
|
|
7
7
|
shell;
|
|
8
8
|
args;
|
|
9
9
|
label;
|
|
10
|
+
kind;
|
|
11
|
+
provider;
|
|
10
12
|
cols = 80;
|
|
11
13
|
rows = 24;
|
|
12
14
|
exit;
|
|
@@ -23,6 +25,8 @@ export class TerminalSession {
|
|
|
23
25
|
this.shell = options.shell ?? defaultShell();
|
|
24
26
|
this.args = options.args ?? [];
|
|
25
27
|
this.label = options.label;
|
|
28
|
+
this.kind = options.kind;
|
|
29
|
+
this.provider = options.provider;
|
|
26
30
|
}
|
|
27
31
|
snapshot() {
|
|
28
32
|
return {
|
|
@@ -30,7 +34,9 @@ export class TerminalSession {
|
|
|
30
34
|
cwd: this.cwd,
|
|
31
35
|
error: this.error,
|
|
32
36
|
exit: this.exit,
|
|
37
|
+
kind: this.kind,
|
|
33
38
|
label: this.label,
|
|
39
|
+
provider: this.provider,
|
|
34
40
|
rows: this.rows,
|
|
35
41
|
shell: this.shell,
|
|
36
42
|
state: this.state,
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"terminal-session.js","sourceRoot":"","sources":["../../src/core/terminal-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AA0E/C,MAAM,OAAO,eAAe;IACT,OAAO,CAAa;IACpB,GAAG,CAAS;IACZ,GAAG,CAAoB;IACvB,KAAK,CAAS;IACd,IAAI,CAAW;IACf,KAAK,CAAqB;IAC1B,IAAI,CAA4C;IAChD,QAAQ,CAAuC;IACxD,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,WA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AAC,cAAc;YAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACjE,CAAC;IAEO,uBAAuB;QAC7B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,OAAO,EAAE,CAAC;QACpD,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,cAAc;IAClB,KAAK,CACH,IAAY,EACZ,IAAc,EACd,OAMC;QAED,MAAM,OAAO,GAAG,OAAO,CAAC,UAAU,CAA8B,CAAC;QACjE,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;CACF;AAED,SAAS,YAAY;IACnB,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC;IAChD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,SAAS,CAAC;IAC1E,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;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"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -45,6 +45,12 @@ export interface DatabaseConnection {
|
|
|
45
45
|
* connection's SQL console. Default/absent = read-only (locked).
|
|
46
46
|
*/
|
|
47
47
|
writeUnlocked?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Directory that ties this connection to a project (a repo root, or the
|
|
50
|
+
* cwd of the service whose .env it was detected in). Absent = shared /
|
|
51
|
+
* unclassified — such connections stay visible in every project scope.
|
|
52
|
+
*/
|
|
53
|
+
projectPath?: string;
|
|
48
54
|
}
|
|
49
55
|
export type LogSourceKind = "file" | "ssh" | "command";
|
|
50
56
|
/**
|
package/dist/core/workflows.d.ts
CHANGED
|
@@ -7,13 +7,13 @@ import { z } from "zod";
|
|
|
7
7
|
*
|
|
8
8
|
* - **action** — deterministic, no inputs needed (e.g. `push`). Runs via the
|
|
9
9
|
* REST API and its result tells us pass/fail. Predictable, no tokens spent.
|
|
10
|
-
* - **agent** — a scoped natural-language task
|
|
10
|
+
* - **agent** — a scoped natural-language task run in a fresh headless agent
|
|
11
|
+
* session, which
|
|
11
12
|
* does the fuzzy work (review a diff, group commits, draft + file a PR/issue)
|
|
12
13
|
* using its own git/GitHub tools. Optionally `verify`-d against real git state.
|
|
13
14
|
* - **gate** — a hard stop that waits for the human (Approve / Skip / Stop).
|
|
14
15
|
*
|
|
15
|
-
* The runner itself lives client-side
|
|
16
|
-
* conversation); this module owns the *shape* and the built-in templates, and is
|
|
16
|
+
* The runner itself lives client-side; this module owns the *shape* and the built-in templates, and is
|
|
17
17
|
* persisted through {@link ConfigStore} so a user can fork/edit them later.
|
|
18
18
|
*/
|
|
19
19
|
export declare const workflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
@@ -43,7 +43,7 @@ export declare const workflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
43
43
|
kind: z.ZodLiteral<"agent">;
|
|
44
44
|
id: z.ZodString;
|
|
45
45
|
title: z.ZodString;
|
|
46
|
-
/** The instruction handed to
|
|
46
|
+
/** The instruction handed to a fresh headless agent session. */
|
|
47
47
|
prompt: z.ZodString;
|
|
48
48
|
/** Optional user-selected capabilities the runner adds as prompt guidance. */
|
|
49
49
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
@@ -62,13 +62,7 @@ export declare const workflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodO
|
|
|
62
62
|
plugins?: string[] | undefined;
|
|
63
63
|
hooks?: string[] | undefined;
|
|
64
64
|
}>>;
|
|
65
|
-
/**
|
|
66
|
-
* Run this step in a fresh, one-shot agent session instead of resuming the
|
|
67
|
-
* dock conversation. Much cheaper — the model isn't re-fed every earlier
|
|
68
|
-
* step's transcript and tool output — but the step gets no shared memory, so
|
|
69
|
-
* only set it on self-contained steps (e.g. drafting a commit message, not
|
|
70
|
-
* "merge the PR you just opened").
|
|
71
|
-
*/
|
|
65
|
+
/** @deprecated Retained only so older saved workflows still parse; ignored by the runner. */
|
|
72
66
|
isolated: z.ZodOptional<z.ZodBoolean>;
|
|
73
67
|
/**
|
|
74
68
|
* Real-state check run after the agent's turn before advancing:
|
|
@@ -152,7 +146,7 @@ export declare const workflowSchema: z.ZodObject<{
|
|
|
152
146
|
kind: z.ZodLiteral<"agent">;
|
|
153
147
|
id: z.ZodString;
|
|
154
148
|
title: z.ZodString;
|
|
155
|
-
/** The instruction handed to
|
|
149
|
+
/** The instruction handed to a fresh headless agent session. */
|
|
156
150
|
prompt: z.ZodString;
|
|
157
151
|
/** Optional user-selected capabilities the runner adds as prompt guidance. */
|
|
158
152
|
capabilities: z.ZodOptional<z.ZodObject<{
|
|
@@ -171,13 +165,7 @@ export declare const workflowSchema: z.ZodObject<{
|
|
|
171
165
|
plugins?: string[] | undefined;
|
|
172
166
|
hooks?: string[] | undefined;
|
|
173
167
|
}>>;
|
|
174
|
-
/**
|
|
175
|
-
* Run this step in a fresh, one-shot agent session instead of resuming the
|
|
176
|
-
* dock conversation. Much cheaper — the model isn't re-fed every earlier
|
|
177
|
-
* step's transcript and tool output — but the step gets no shared memory, so
|
|
178
|
-
* only set it on self-contained steps (e.g. drafting a commit message, not
|
|
179
|
-
* "merge the PR you just opened").
|
|
180
|
-
*/
|
|
168
|
+
/** @deprecated Retained only so older saved workflows still parse; ignored by the runner. */
|
|
181
169
|
isolated: z.ZodOptional<z.ZodBoolean>;
|
|
182
170
|
/**
|
|
183
171
|
* Real-state check run after the agent's turn before advancing:
|
package/dist/core/workflows.js
CHANGED
|
@@ -13,13 +13,13 @@ const workflowCapabilitiesSchema = z.object({
|
|
|
13
13
|
*
|
|
14
14
|
* - **action** — deterministic, no inputs needed (e.g. `push`). Runs via the
|
|
15
15
|
* REST API and its result tells us pass/fail. Predictable, no tokens spent.
|
|
16
|
-
* - **agent** — a scoped natural-language task
|
|
16
|
+
* - **agent** — a scoped natural-language task run in a fresh headless agent
|
|
17
|
+
* session, which
|
|
17
18
|
* does the fuzzy work (review a diff, group commits, draft + file a PR/issue)
|
|
18
19
|
* using its own git/GitHub tools. Optionally `verify`-d against real git state.
|
|
19
20
|
* - **gate** — a hard stop that waits for the human (Approve / Skip / Stop).
|
|
20
21
|
*
|
|
21
|
-
* The runner itself lives client-side
|
|
22
|
-
* conversation); this module owns the *shape* and the built-in templates, and is
|
|
22
|
+
* The runner itself lives client-side; this module owns the *shape* and the built-in templates, and is
|
|
23
23
|
* persisted through {@link ConfigStore} so a user can fork/edit them later.
|
|
24
24
|
*/
|
|
25
25
|
export const workflowStepSchema = z.discriminatedUnion("kind", [
|
|
@@ -41,17 +41,11 @@ export const workflowStepSchema = z.discriminatedUnion("kind", [
|
|
|
41
41
|
kind: z.literal("agent"),
|
|
42
42
|
id: z.string().min(1),
|
|
43
43
|
title: z.string().min(1),
|
|
44
|
-
/** The instruction handed to
|
|
44
|
+
/** The instruction handed to a fresh headless agent session. */
|
|
45
45
|
prompt: z.string().min(1),
|
|
46
46
|
/** Optional user-selected capabilities the runner adds as prompt guidance. */
|
|
47
47
|
capabilities: workflowCapabilitiesSchema.optional(),
|
|
48
|
-
/**
|
|
49
|
-
* Run this step in a fresh, one-shot agent session instead of resuming the
|
|
50
|
-
* dock conversation. Much cheaper — the model isn't re-fed every earlier
|
|
51
|
-
* step's transcript and tool output — but the step gets no shared memory, so
|
|
52
|
-
* only set it on self-contained steps (e.g. drafting a commit message, not
|
|
53
|
-
* "merge the PR you just opened").
|
|
54
|
-
*/
|
|
48
|
+
/** @deprecated Retained only so older saved workflows still parse; ignored by the runner. */
|
|
55
49
|
isolated: z.boolean().optional(),
|
|
56
50
|
/**
|
|
57
51
|
* Real-state check run after the agent's turn before advancing:
|
|
@@ -90,10 +84,8 @@ const COMMIT_MESSAGE_STEP = {
|
|
|
90
84
|
kind: "agent",
|
|
91
85
|
id: "commit-message",
|
|
92
86
|
title: "Generate commit message",
|
|
93
|
-
//
|
|
94
|
-
//
|
|
95
|
-
// session, so run it isolated to avoid re-feeding the dock transcript.
|
|
96
|
-
isolated: true,
|
|
87
|
+
// It stages, reads its own staged diff, and replies with just the message
|
|
88
|
+
// consumed by the deterministic commit action.
|
|
97
89
|
prompt: "Stage my changes with `nomoreide_git_stage` (skip anything that looks like a secret, e.g. `.env`), inspect the staged diff once with `nomoreide_git_staged_diff`, then write one conventional-commit message — a `<type>: concise title` line (feat/fix/refactor/chore/docs/test) plus a few short bullets of what changed. Do NOT commit. Reply with ONLY the commit message you recommend.",
|
|
98
90
|
};
|
|
99
91
|
const COMMIT_ACTION_STEP = {
|
|
@@ -148,9 +140,7 @@ export const BUILTIN_WORKFLOWS = [
|
|
|
148
140
|
kind: "agent",
|
|
149
141
|
id: "open-pr",
|
|
150
142
|
title: "Open a PR",
|
|
151
|
-
//
|
|
152
|
-
// session — run it isolated. The merge step below finds the PR itself.
|
|
153
|
-
isolated: true,
|
|
143
|
+
// Gathers its own commit list. The merge step below finds the PR itself.
|
|
154
144
|
prompt: "Open a PR for the current branch into `main` using the `nomoreide_github_create_pr` tool. Title = the latest commit subject; for the body, list the commits via `nomoreide_git_log`. Do NOT read file diffs. Reply with just the PR number and URL.",
|
|
155
145
|
},
|
|
156
146
|
{ kind: "gate", id: "gate-merge", title: "Approve merge", message: "Squash-merge the pull request?" },
|
|
@@ -158,9 +148,7 @@ export const BUILTIN_WORKFLOWS = [
|
|
|
158
148
|
kind: "agent",
|
|
159
149
|
id: "merge",
|
|
160
150
|
title: "Squash-merge",
|
|
161
|
-
// Finds the PR by branch
|
|
162
|
-
// session, so it can run isolated too.
|
|
163
|
-
isolated: true,
|
|
151
|
+
// Finds the PR by branch instead of relying on output from the open-pr step.
|
|
164
152
|
prompt: "Squash-merge the open pull request for the current branch. First call `nomoreide_git_status` for the branch name, then `nomoreide_github_list_prs` to find its open PR, then merge it with `nomoreide_github_merge_pr`. Don't analyze anything else — just find it and merge. Reply with one line.",
|
|
165
153
|
},
|
|
166
154
|
CHECKOUT_DEFAULT_AND_PULL_STEP,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/core/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,0BAA0B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjD,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC9C,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CA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,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { startNoMoreIdeMcpServer } from "./mcp/server.js";
|
|
3
3
|
import { createTuiApp } from "./tui/app.js";
|
|
4
|
-
import {
|
|
4
|
+
import { ensureDaemon } from "./core/daemon-lifecycle.js";
|
|
5
5
|
import { runCli } from "./cli/commands.js";
|
|
6
|
+
import { runDaemonCli } from "./cli/daemon.js";
|
|
6
7
|
const command = process.argv[2] ?? "mcp";
|
|
7
8
|
if (command === "mcp" || (command === "start" && process.argv.length <= 3)) {
|
|
8
9
|
await startNoMoreIdeMcpServer();
|
|
@@ -10,11 +11,16 @@ if (command === "mcp" || (command === "start" && process.argv.length <= 3)) {
|
|
|
10
11
|
else if (command === "tui") {
|
|
11
12
|
await createTuiApp().start();
|
|
12
13
|
}
|
|
14
|
+
else if (command === "daemon") {
|
|
15
|
+
process.exitCode = await runDaemonCli(process.argv.slice(3));
|
|
16
|
+
}
|
|
13
17
|
else if (command === "web") {
|
|
14
18
|
const portArg = process.argv.find((arg) => arg.startsWith("--port="));
|
|
15
19
|
const port = portArg ? Number(portArg.slice("--port=".length)) : undefined;
|
|
16
|
-
const
|
|
17
|
-
|
|
20
|
+
const result = await ensureDaemon({ port });
|
|
21
|
+
if (result.versionWarning)
|
|
22
|
+
console.error(result.versionWarning);
|
|
23
|
+
console.error(`NoMoreIDE web UI: ${result.url}`);
|
|
18
24
|
}
|
|
19
25
|
else if ([
|
|
20
26
|
"add",
|
|
@@ -31,7 +37,7 @@ else if ([
|
|
|
31
37
|
process.exitCode = await runCli(process.argv.slice(2));
|
|
32
38
|
}
|
|
33
39
|
else {
|
|
34
|
-
console.error("Usage: nomoreide [mcp|setup|tui|web|git|agents|profile|list|logs|start|stop|restart|add]");
|
|
40
|
+
console.error("Usage: nomoreide [mcp|setup|tui|web|daemon|git|agents|profile|list|logs|start|stop|restart|add]");
|
|
35
41
|
process.exitCode = 1;
|
|
36
42
|
}
|
|
37
43
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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;AAC5C,OAAO,EAAE,
|
|
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;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC;AAEzC,IAAI,OAAO,KAAK,KAAK,IAAI,CAAC,OAAO,KAAK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC;IAC3E,MAAM,uBAAuB,EAAE,CAAC;AAClC,CAAC;KAAM,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;IAC7B,MAAM,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC;AAC/B,CAAC;KAAM,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;IAChC,OAAO,CAAC,QAAQ,GAAG,MAAM,YAAY,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC;KAAM,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;IAC7B,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC;IACtE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3E,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAC5C,IAAI,MAAM,CAAC,cAAc;QAAE,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,CAAC,qBAAqB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;AACnD,CAAC;KAAM,IACL;IACE,KAAK;IACL,QAAQ;IACR,KAAK;IACL,MAAM;IACN,MAAM;IACN,SAAS;IACT,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;CACV,CAAC,QAAQ,CAAC,OAAO,CAAC,EACnB,CAAC;IACD,OAAO,CAAC,QAAQ,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACzD,CAAC;KAAM,CAAC;IACN,OAAO,CAAC,KAAK,CACX,iGAAiG,CAClG,CAAC;IACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -1,31 +1,35 @@
|
|
|
1
1
|
import { FastMCP } from "fastmcp";
|
|
2
2
|
import { ConfigStore } from "../core/config-store.js";
|
|
3
|
+
import { type DaemonConnection } from "../core/daemon-client.js";
|
|
3
4
|
import { ErrorInbox } from "../core/error-inbox.js";
|
|
4
5
|
import { LogStore } from "../core/log-store.js";
|
|
5
|
-
import { ProcessManager } from "../core/process-manager.js";
|
|
6
6
|
import { ToolCallStore } from "../core/tool-call-store.js";
|
|
7
|
-
import { type UiLifecycleManager } from "../web/ui-lifecycle.js";
|
|
8
7
|
import { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
|
|
9
8
|
export { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
|
|
10
9
|
interface CreateNoMoreIdeMcpServerOptions {
|
|
11
10
|
configPath?: string;
|
|
12
11
|
logDir?: string;
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
/** Injectable daemon handle for tests; defaults to the global daemon. */
|
|
13
|
+
daemon?: DaemonConnection;
|
|
14
|
+
daemonPort?: number;
|
|
15
15
|
}
|
|
16
16
|
export interface NoMoreIdeMcpServer {
|
|
17
17
|
server: FastMCP;
|
|
18
18
|
configStore: ConfigStore;
|
|
19
|
+
daemon: DaemonConnection;
|
|
19
20
|
errorInbox: ErrorInbox;
|
|
20
21
|
logStore: LogStore;
|
|
21
|
-
manager: ProcessManager;
|
|
22
|
-
uiLifecycle: UiLifecycleManager;
|
|
23
22
|
toolCallStore: ToolCallStore;
|
|
24
23
|
toolNames: typeof NOMOREIDE_TOOL_NAMES;
|
|
25
24
|
}
|
|
26
25
|
interface StartNoMoreIdeMcpServerOptions {
|
|
27
26
|
env?: NodeJS.ProcessEnv;
|
|
28
|
-
createServer?: () => Pick<NoMoreIdeMcpServer, "server" | "
|
|
27
|
+
createServer?: () => Pick<NoMoreIdeMcpServer, "server" | "daemon">;
|
|
29
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* The MCP process is a thin client: service operations go to the shared
|
|
31
|
+
* daemon over HTTP; config, git, db, and agent tooling stay local because
|
|
32
|
+
* they work on global config and files rather than running processes.
|
|
33
|
+
*/
|
|
30
34
|
export declare function createNoMoreIdeMcpServer(options?: CreateNoMoreIdeMcpServerOptions): NoMoreIdeMcpServer;
|
|
31
35
|
export declare function startNoMoreIdeMcpServer(options?: StartNoMoreIdeMcpServerOptions): Promise<void>;
|
package/dist/mcp/server.js
CHANGED
|
@@ -2,34 +2,26 @@ import { dirname, resolve } from "node:path";
|
|
|
2
2
|
import { FastMCP } from "fastmcp";
|
|
3
3
|
import { AgentSessionStore, createAgentSessionTracker, } from "../core/agent-sessions.js";
|
|
4
4
|
import { ConfigStore, defaultGlobalConfigPath } from "../core/config-store.js";
|
|
5
|
+
import { createDaemonConnection, } from "../core/daemon-client.js";
|
|
5
6
|
import { DbPeek } from "../core/db-peek.js";
|
|
6
7
|
import { ErrorInbox } from "../core/error-inbox.js";
|
|
7
8
|
import { LogStore } from "../core/log-store.js";
|
|
8
|
-
import { ProcessManager } from "../core/process-manager.js";
|
|
9
|
-
import { defaultRuntimeRegistryPath, ServiceRegistry, } from "../core/service-registry.js";
|
|
10
|
-
import { TimelineStore } from "../core/timeline-store.js";
|
|
11
9
|
import { ToolCallStore } from "../core/tool-call-store.js";
|
|
12
|
-
import { createUiLifecycleManager, } from "../web/ui-lifecycle.js";
|
|
13
10
|
import { NOMOREIDE_TOOL_NAMES, registerNoMoreIdeTools, } from "./tools/index.js";
|
|
14
11
|
export { NOMOREIDE_TOOL_NAMES } from "./tools/index.js";
|
|
12
|
+
/**
|
|
13
|
+
* The MCP process is a thin client: service operations go to the shared
|
|
14
|
+
* daemon over HTTP; config, git, db, and agent tooling stay local because
|
|
15
|
+
* they work on global config and files rather than running processes.
|
|
16
|
+
*/
|
|
15
17
|
export function createNoMoreIdeMcpServer(options = {}) {
|
|
16
18
|
const configPath = options.configPath ?? defaultGlobalConfigPath();
|
|
17
19
|
const logDir = options.logDir ?? resolve(process.cwd(), ".nomoreide/logs");
|
|
18
20
|
const configStore = new ConfigStore(configPath);
|
|
19
|
-
const timelineStore = new TimelineStore({
|
|
20
|
-
baseDir: dirname(resolve(logDir)),
|
|
21
|
-
});
|
|
22
21
|
const logStore = new LogStore({
|
|
23
22
|
baseDir: logDir,
|
|
24
|
-
timelineStore,
|
|
25
|
-
});
|
|
26
|
-
const registry = new ServiceRegistry(defaultRuntimeRegistryPath(logDir));
|
|
27
|
-
const manager = new ProcessManager({
|
|
28
|
-
configStore,
|
|
29
|
-
logStore,
|
|
30
|
-
timelineStore,
|
|
31
|
-
registry,
|
|
32
23
|
});
|
|
24
|
+
const daemon = options.daemon ?? createDaemonConnection({ port: options.daemonPort });
|
|
33
25
|
const errorInbox = new ErrorInbox({ logStore, configStore });
|
|
34
26
|
const dbPeek = new DbPeek({ configStore });
|
|
35
27
|
const toolCallStore = new ToolCallStore();
|
|
@@ -37,13 +29,6 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
37
29
|
store: new AgentSessionStore(resolve(dirname(resolve(logDir)), "agent-sessions.json")),
|
|
38
30
|
configStore,
|
|
39
31
|
});
|
|
40
|
-
const uiLifecycle = options.uiLifecycle ??
|
|
41
|
-
createUiLifecycleManager({
|
|
42
|
-
configPath,
|
|
43
|
-
logDir,
|
|
44
|
-
port: options.uiPort,
|
|
45
|
-
toolCallStore,
|
|
46
|
-
});
|
|
47
32
|
const server = new FastMCP({
|
|
48
33
|
name: "NoMoreIDE MCP",
|
|
49
34
|
version: "0.1.0",
|
|
@@ -51,22 +36,18 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
51
36
|
registerNoMoreIdeTools({
|
|
52
37
|
server,
|
|
53
38
|
configStore,
|
|
39
|
+
daemon,
|
|
54
40
|
dbPeek,
|
|
55
41
|
errorInbox,
|
|
56
|
-
logStore,
|
|
57
|
-
manager,
|
|
58
|
-
timelineStore,
|
|
59
|
-
uiLifecycle,
|
|
60
42
|
toolCallStore,
|
|
61
43
|
agentSessions,
|
|
62
44
|
});
|
|
63
45
|
return {
|
|
64
46
|
server,
|
|
65
47
|
configStore,
|
|
48
|
+
daemon,
|
|
66
49
|
errorInbox,
|
|
67
50
|
logStore,
|
|
68
|
-
manager,
|
|
69
|
-
uiLifecycle,
|
|
70
51
|
toolCallStore,
|
|
71
52
|
toolNames: NOMOREIDE_TOOL_NAMES,
|
|
72
53
|
};
|
|
@@ -74,16 +55,16 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
74
55
|
export async function startNoMoreIdeMcpServer(options = {}) {
|
|
75
56
|
const env = options.env ?? process.env;
|
|
76
57
|
const created = options.createServer?.() ?? createNoMoreIdeMcpServer();
|
|
77
|
-
const { server,
|
|
78
|
-
if ("manager" in created) {
|
|
79
|
-
created.manager.installShutdownHandlers();
|
|
80
|
-
}
|
|
58
|
+
const { server, daemon } = created;
|
|
81
59
|
if (env.NOMOREIDE_AUTO_UI !== "0") {
|
|
82
60
|
try {
|
|
83
|
-
await
|
|
61
|
+
const result = await daemon.ensure();
|
|
62
|
+
if (result.versionWarning) {
|
|
63
|
+
process.stderr.write(`nomoreide: ${result.versionWarning}\n`);
|
|
64
|
+
}
|
|
84
65
|
}
|
|
85
66
|
catch (error) {
|
|
86
|
-
process.stderr.write(`nomoreide:
|
|
67
|
+
process.stderr.write(`nomoreide: daemon auto-start failed: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
87
68
|
}
|
|
88
69
|
}
|
|
89
70
|
await server.start({ transportType: "stdio" });
|
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,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EACL,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,
|
|
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,EACL,iBAAiB,EAC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,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/mcp/tools/agent.js
CHANGED
|
@@ -4,16 +4,26 @@ export const AGENT_TOOL_NAMES = [
|
|
|
4
4
|
"nomoreide_close_ui",
|
|
5
5
|
];
|
|
6
6
|
export function registerAgentTools(server, ctx) {
|
|
7
|
-
const {
|
|
7
|
+
const { daemon } = ctx;
|
|
8
8
|
server.addTool({
|
|
9
9
|
name: "nomoreide_open_ui",
|
|
10
|
-
description: "Open or reuse the
|
|
11
|
-
execute: async () => stringify(await
|
|
10
|
+
description: "Open (or reuse) the machine-global NoMoreIDE daemon and return its web UI URL.",
|
|
11
|
+
execute: async () => stringify(await daemon.ensure()),
|
|
12
12
|
});
|
|
13
13
|
server.addTool({
|
|
14
14
|
name: "nomoreide_close_ui",
|
|
15
|
-
description: "
|
|
16
|
-
execute: async () =>
|
|
15
|
+
description: "Shut down the NoMoreIDE daemon. WARNING: this stops every service it manages, for all sessions on this machine.",
|
|
16
|
+
execute: async () => {
|
|
17
|
+
const client = await daemon.existing();
|
|
18
|
+
if (!client) {
|
|
19
|
+
return stringify({ status: "not_running" });
|
|
20
|
+
}
|
|
21
|
+
await client.shutdown();
|
|
22
|
+
return stringify({
|
|
23
|
+
status: "stopping",
|
|
24
|
+
note: "Daemon is stopping all managed services and exiting.",
|
|
25
|
+
});
|
|
26
|
+
},
|
|
17
27
|
});
|
|
18
28
|
}
|
|
19
29
|
//# sourceMappingURL=agent.js.map
|
|
@@ -1 +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,
|
|
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,MAAM,EAAE,GAAG,GAAG,CAAC;IAEvB,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,gFAAgF;QAClF,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,MAAM,EAAE,CAAC;KACtD,CAAC,CAAC;IAEH,MAAM,CAAC,OAAO,CAAC;QACb,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,iHAAiH;QACnH,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,OAAO,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC;YAC9C,CAAC;YACD,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC;YACxB,OAAO,SAAS,CAAC;gBACf,MAAM,EAAE,UAAU;gBAClB,IAAI,EAAE,sDAAsD;aAC7D,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
import type { FastMCP } from "fastmcp";
|
|
2
2
|
import type { AgentSessionTracker } from "../../core/agent-sessions.js";
|
|
3
3
|
import type { ConfigStore } from "../../core/config-store.js";
|
|
4
|
+
import type { DaemonConnection } from "../../core/daemon-client.js";
|
|
4
5
|
import type { DbPeek } from "../../core/db-peek.js";
|
|
5
6
|
import type { ErrorInbox } from "../../core/error-inbox.js";
|
|
6
7
|
import { GitActions } from "../../core/git-actions.js";
|
|
7
8
|
import { GitManager } from "../../core/git-manager.js";
|
|
8
|
-
import type { LogStore } from "../../core/log-store.js";
|
|
9
|
-
import type { ProcessManager } from "../../core/process-manager.js";
|
|
10
|
-
import type { TimelineStore } from "../../core/timeline-store.js";
|
|
11
9
|
import { type ToolCallStore } from "../../core/tool-call-store.js";
|
|
12
|
-
import type { UiLifecycleManager } from "../../web/ui-lifecycle.js";
|
|
13
10
|
/** Shared stateful services every tool group receives. */
|
|
14
11
|
export interface ToolContext {
|
|
15
12
|
configStore: ConfigStore;
|
|
13
|
+
/**
|
|
14
|
+
* Handle to the machine-global daemon that owns all spawned services.
|
|
15
|
+
* Service tools go through it over HTTP; config/git/db tools stay local.
|
|
16
|
+
*/
|
|
17
|
+
daemon: DaemonConnection;
|
|
16
18
|
dbPeek: DbPeek;
|
|
17
19
|
errorInbox: ErrorInbox;
|
|
18
|
-
logStore: LogStore;
|
|
19
|
-
manager: ProcessManager;
|
|
20
|
-
timelineStore: TimelineStore;
|
|
21
|
-
uiLifecycle: UiLifecycleManager;
|
|
22
20
|
}
|
|
23
21
|
/** Each domain registers its tools onto the (optionally recording) server. */
|
|
24
22
|
export type RegisterTools = (server: FastMCP, ctx: ToolContext) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/tools/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/tools/context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAsB,MAAM,+BAA+B,CAAC;AAiBhF,MAAM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AAM,EAAE,IAAI;wBACZ,SAAS;wBACT,IAAI,EAAE,WAAW,CAAC,IAAI,CAAC;qBACxB,CAAC,CAAC;oBACH,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,SAAS;wBACT,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"}
|
|
@@ -3,28 +3,24 @@ import { isReadStatement } from "../../core/db/driver.js";
|
|
|
3
3
|
import { stringify } from "./context.js";
|
|
4
4
|
/**
|
|
5
5
|
* Returned to the agent when a write hits the read-only query path. This is the
|
|
6
|
-
* contextual teach for the
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* parses that block into an "Open in SQL console" button (see the web client's
|
|
10
|
-
* `chat/message-options.tsx`); the write still goes through the human-only
|
|
11
|
-
* console with its unlock + affected-rows preview.
|
|
6
|
+
* contextual teach for the raw-terminal workflow. It costs nothing until the
|
|
7
|
+
* agent actually tries to change data and keeps execution in the human-only,
|
|
8
|
+
* locked SQL console with its affected-rows preview.
|
|
12
9
|
*/
|
|
13
10
|
function writeStagingGuidance(connection) {
|
|
14
11
|
return [
|
|
15
12
|
"This connection is read-only, so that statement was NOT executed.",
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
"`sql-write` followed by the connection name:",
|
|
13
|
+
"Provide the exact SQL statement for the user to review in a standard SQL",
|
|
14
|
+
`fenced block, and identify the target connection as \`${connection}\`:`,
|
|
19
15
|
"",
|
|
20
|
-
"```sql
|
|
16
|
+
"```sql",
|
|
21
17
|
"UPDATE … SET … WHERE …;",
|
|
22
18
|
"```",
|
|
23
19
|
"",
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
20
|
+
"Direct the user to stage and run it through NoMoreIDE's locked SQL console,",
|
|
21
|
+
"where they explicitly unlock writes and review an affected-rows preview",
|
|
22
|
+
"before committing. Emit exactly one statement, and always scope",
|
|
23
|
+
"UPDATE/DELETE with a WHERE clause.",
|
|
28
24
|
].join("\n");
|
|
29
25
|
}
|
|
30
26
|
export const DATABASE_TOOL_NAMES = [
|
|
@@ -94,9 +90,9 @@ export function registerDatabaseTools(server, ctx) {
|
|
|
94
90
|
name: "nomoreide_db_query",
|
|
95
91
|
description: "Run a read-only SQL query against a registered connection and return the rows. " +
|
|
96
92
|
"Read-only at the transaction level — INSERT/UPDATE/DELETE/DDL are rejected. To " +
|
|
97
|
-
"make a change, don't run it here
|
|
98
|
-
"
|
|
99
|
-
"
|
|
93
|
+
"make a change, don't run it here. Provide the exact SQL statement for review, " +
|
|
94
|
+
"identify the connection, and direct the user to stage and run it through " +
|
|
95
|
+
"NoMoreIDE's locked SQL console with its affected-rows preview.",
|
|
100
96
|
parameters: querySchema,
|
|
101
97
|
execute: async ({ connection, sql, limit }) => {
|
|
102
98
|
try {
|