nomoreide 0.1.45 → 0.1.47
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/git.js +4 -1
- package/dist/cli/git.js.map +1 -1
- package/dist/core/agent-runtime.d.ts +15 -0
- package/dist/core/agent-runtime.js +39 -3
- package/dist/core/agent-runtime.js.map +1 -1
- package/dist/core/config-store.d.ts +4 -0
- package/dist/core/config-store.js +20 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/git-actions.d.ts +30 -0
- package/dist/core/git-actions.js +58 -0
- package/dist/core/git-actions.js.map +1 -0
- package/dist/core/git-manager.d.ts +12 -0
- package/dist/core/git-manager.js +34 -1
- package/dist/core/git-manager.js.map +1 -1
- package/dist/core/github-manager.d.ts +35 -0
- package/dist/core/github-manager.js +20 -0
- package/dist/core/github-manager.js.map +1 -1
- package/dist/core/repo-onboard.d.ts +2 -2
- package/dist/core/types.d.ts +3 -0
- package/dist/core/workflows.d.ts +204 -0
- package/dist/core/workflows.js +146 -0
- package/dist/core/workflows.js.map +1 -0
- package/dist/mcp/tools/context.d.ts +3 -0
- package/dist/mcp/tools/context.js +5 -0
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/git.d.ts +1 -1
- package/dist/mcp/tools/git.js +10 -1
- package/dist/mcp/tools/git.js.map +1 -1
- package/dist/mcp/tools/github.d.ts +1 -1
- package/dist/mcp/tools/github.js +15 -0
- package/dist/mcp/tools/github.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +1 -1
- package/dist/web/agent-info.d.ts +12 -0
- package/dist/web/agent-info.js +101 -2
- package/dist/web/agent-info.js.map +1 -1
- package/dist/web/client/assets/{code-editor-B5xQq21I.js → code-editor-DOyUkvuQ.js} +1 -1
- package/dist/web/client/assets/index-BpLowAcO.js +204 -0
- package/dist/web/client/assets/index-Df0RBiTt.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/agent-chat-routes.js +3 -0
- package/dist/web/routes/agent-chat-routes.js.map +1 -1
- package/dist/web/routes/git-routes.js +60 -0
- package/dist/web/routes/git-routes.js.map +1 -1
- package/dist/web/routes/github-routes.js +42 -2
- package/dist/web/routes/github-routes.js.map +1 -1
- package/dist/web/routes/index.js +2 -0
- package/dist/web/routes/index.js.map +1 -1
- package/dist/web/routes/workflow-routes.d.ts +8 -0
- package/dist/web/routes/workflow-routes.js +45 -0
- package/dist/web/routes/workflow-routes.js.map +1 -0
- package/package.json +1 -1
- package/dist/web/client/assets/index-D6O1I2RP.css +0 -1
- package/dist/web/client/assets/index-DApri4U3.js +0 -197
|
@@ -48,6 +48,22 @@ export class GitHubManager {
|
|
|
48
48
|
const data = await this.request(`/repos/${this.owner}/${this.repo}/pulls`, { method: "POST", body: opts });
|
|
49
49
|
return normalizePR(data);
|
|
50
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Merge a pull request via the GitHub API. Defaults to a squash merge — the
|
|
53
|
+
* common "Squash & merge" button behavior. GitHub rejects the call (405) if
|
|
54
|
+
* the PR isn't mergeable (conflicts, failing required checks, branch
|
|
55
|
+
* protection), and that message is surfaced to the caller.
|
|
56
|
+
*/
|
|
57
|
+
async mergePR(number, opts = {}) {
|
|
58
|
+
return this.request(`/repos/${this.owner}/${this.repo}/pulls/${number}/merge`, {
|
|
59
|
+
method: "PUT",
|
|
60
|
+
body: {
|
|
61
|
+
merge_method: opts.method ?? "squash",
|
|
62
|
+
...(opts.commitTitle ? { commit_title: opts.commitTitle } : {}),
|
|
63
|
+
...(opts.commitMessage ? { commit_message: opts.commitMessage } : {}),
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
}
|
|
51
67
|
async listIssues(state = "open", page = 1) {
|
|
52
68
|
const data = await this.request(`/repos/${this.owner}/${this.repo}/issues?state=${state}&per_page=30&page=${page}`);
|
|
53
69
|
// Filter out PRs (issues endpoint includes them)
|
|
@@ -89,6 +105,10 @@ export class GitHubManager {
|
|
|
89
105
|
const data = await this.request(`/repos/${this.owner}/${this.repo}/actions/runs?${params}`);
|
|
90
106
|
return data.workflow_runs;
|
|
91
107
|
}
|
|
108
|
+
async listWorkflowRunJobs(runId) {
|
|
109
|
+
const data = await this.request(`/repos/${this.owner}/${this.repo}/actions/runs/${runId}/jobs?per_page=100`);
|
|
110
|
+
return data.jobs;
|
|
111
|
+
}
|
|
92
112
|
async request(path, opts) {
|
|
93
113
|
const url = path.startsWith("http") ? path : `${this.baseUrl}${path}`;
|
|
94
114
|
const headers = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-manager.js","sourceRoot":"","sources":["../../src/core/github-manager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-manager.js","sourceRoot":"","sources":["../../src/core/github-manager.ts"],"names":[],"mappings":"AA0FA,MAAM,OAAO,cAAe,SAAQ,KAAK;IAGrB;IACA;IAHlB,YACE,OAAe,EACC,MAAc,EACd,IAAY;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHC,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QAG5B,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,aAAa;IAEL;IACA;IACA;IACA;IAJnB,YACmB,KAAa,EACb,KAAa,EACb,IAAY,EACZ,UAAU,wBAAwB;QAHlC,UAAK,GAAL,KAAK,CAAQ;QACb,UAAK,GAAL,KAAK,CAAQ;QACb,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAA2B;IAClD,CAAC;IAEJ,MAAM,CAAC,cAAc,CAAC,SAAiB;QACrC,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,EAAE,CAAC;QACjC,sCAAsC;QACtC,MAAM,UAAU,GAAG,yEAAyE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC3G,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,EAAE,KAAK,EAAE,UAAU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213
|
confidence: z.ZodEnum<["high", "medium", "low"]>;
|
|
214
214
|
reason: z.ZodString;
|
|
215
215
|
}, "strip", z.ZodTypeAny, {
|
|
216
|
-
name: string;
|
|
217
216
|
kind: "local" | "docker-compose";
|
|
217
|
+
name: string;
|
|
218
218
|
cwd: string;
|
|
219
219
|
confidence: "high" | "medium" | "low";
|
|
220
220
|
reason: string;
|
|
@@ -226,8 +226,8 @@ export declare const proposedServiceSchema: z.ZodObject<{
|
|
|
226
226
|
composeService?: string | undefined;
|
|
227
227
|
installCommand?: string | undefined;
|
|
228
228
|
}, {
|
|
229
|
-
name: string;
|
|
230
229
|
kind: "local" | "docker-compose";
|
|
230
|
+
name: string;
|
|
231
231
|
cwd: string;
|
|
232
232
|
confidence: "high" | "medium" | "low";
|
|
233
233
|
reason: string;
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ProcessTreeSummary } from "./process-tree.js";
|
|
2
2
|
import type { PortBindingStatus } from "./port-utils.js";
|
|
3
|
+
import type { Workflow } from "./workflows.js";
|
|
3
4
|
export type ServiceKind = "local" | "docker-compose" | "ssh";
|
|
4
5
|
export interface ServiceDefinition {
|
|
5
6
|
name: string;
|
|
@@ -103,6 +104,8 @@ export interface NoMoreIdeConfig {
|
|
|
103
104
|
databases: DatabaseConnection[];
|
|
104
105
|
logSources: LogSourceDefinition[];
|
|
105
106
|
githubTokens: GitHubToken[];
|
|
107
|
+
/** User-saved git/GitHub workflows (forks/edits of the built-in templates). */
|
|
108
|
+
workflows: Workflow[];
|
|
106
109
|
}
|
|
107
110
|
export type ServiceState = "stopped" | "starting" | "running" | "exited";
|
|
108
111
|
export interface ServiceStatus {
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* User-owned git/GitHub workflows — the AI-native answer to fixed IDE buttons.
|
|
4
|
+
*
|
|
5
|
+
* A workflow is an ordered list of steps the runner walks one at a time. A step
|
|
6
|
+
* is one of three kinds:
|
|
7
|
+
*
|
|
8
|
+
* - **action** — deterministic, no inputs needed (e.g. `push`). Runs via the
|
|
9
|
+
* REST API and its result tells us pass/fail. Predictable, no tokens spent.
|
|
10
|
+
* - **agent** — a scoped natural-language task handed to the dock agent, which
|
|
11
|
+
* does the fuzzy work (review a diff, group commits, draft + file a PR/issue)
|
|
12
|
+
* using its own git/GitHub tools. Optionally `verify`-d against real git state.
|
|
13
|
+
* - **gate** — a hard stop that waits for the human (Approve / Skip / Stop).
|
|
14
|
+
*
|
|
15
|
+
* The runner itself lives client-side (agent steps execute through the dock
|
|
16
|
+
* conversation); this module owns the *shape* and the built-in templates, and is
|
|
17
|
+
* persisted through {@link ConfigStore} so a user can fork/edit them later.
|
|
18
|
+
*/
|
|
19
|
+
export declare const workflowStepSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
20
|
+
kind: z.ZodLiteral<"action">;
|
|
21
|
+
id: z.ZodString;
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
/**
|
|
24
|
+
* Deterministic op with no inputs — runs straight through the REST API with
|
|
25
|
+
* zero agent tokens. `commit` stages everything and commits with a generated
|
|
26
|
+
* message (no diff reading, no quality analysis); `push` pushes the branch.
|
|
27
|
+
*/
|
|
28
|
+
op: z.ZodEnum<["push", "commit"]>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
kind: "action";
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
op: "push" | "commit";
|
|
34
|
+
}, {
|
|
35
|
+
kind: "action";
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
op: "push" | "commit";
|
|
39
|
+
}>, z.ZodObject<{
|
|
40
|
+
kind: z.ZodLiteral<"agent">;
|
|
41
|
+
id: z.ZodString;
|
|
42
|
+
title: z.ZodString;
|
|
43
|
+
/** The instruction handed to the dock agent. */
|
|
44
|
+
prompt: z.ZodString;
|
|
45
|
+
/**
|
|
46
|
+
* Real-state check run after the agent's turn before advancing:
|
|
47
|
+
* - `committed` — the working tree is clean (changes were committed).
|
|
48
|
+
* - `pushed` — the branch is no longer ahead of its upstream.
|
|
49
|
+
*/
|
|
50
|
+
verify: z.ZodOptional<z.ZodEnum<["committed", "pushed"]>>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
kind: "agent";
|
|
53
|
+
id: string;
|
|
54
|
+
title: string;
|
|
55
|
+
prompt: string;
|
|
56
|
+
verify?: "committed" | "pushed" | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
kind: "agent";
|
|
59
|
+
id: string;
|
|
60
|
+
title: string;
|
|
61
|
+
prompt: string;
|
|
62
|
+
verify?: "committed" | "pushed" | undefined;
|
|
63
|
+
}>, z.ZodObject<{
|
|
64
|
+
kind: z.ZodLiteral<"gate">;
|
|
65
|
+
id: z.ZodString;
|
|
66
|
+
title: z.ZodString;
|
|
67
|
+
/** Shown at the pause so the user knows what they're approving. */
|
|
68
|
+
message: z.ZodString;
|
|
69
|
+
}, "strip", z.ZodTypeAny, {
|
|
70
|
+
kind: "gate";
|
|
71
|
+
message: string;
|
|
72
|
+
id: string;
|
|
73
|
+
title: string;
|
|
74
|
+
}, {
|
|
75
|
+
kind: "gate";
|
|
76
|
+
message: string;
|
|
77
|
+
id: string;
|
|
78
|
+
title: string;
|
|
79
|
+
}>]>;
|
|
80
|
+
export declare const workflowSchema: z.ZodObject<{
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
description: z.ZodOptional<z.ZodString>;
|
|
84
|
+
/** True for the shipped templates; false/absent for user-saved workflows. */
|
|
85
|
+
builtin: z.ZodOptional<z.ZodBoolean>;
|
|
86
|
+
steps: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
|
|
87
|
+
kind: z.ZodLiteral<"action">;
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
title: z.ZodString;
|
|
90
|
+
/**
|
|
91
|
+
* Deterministic op with no inputs — runs straight through the REST API with
|
|
92
|
+
* zero agent tokens. `commit` stages everything and commits with a generated
|
|
93
|
+
* message (no diff reading, no quality analysis); `push` pushes the branch.
|
|
94
|
+
*/
|
|
95
|
+
op: z.ZodEnum<["push", "commit"]>;
|
|
96
|
+
}, "strip", z.ZodTypeAny, {
|
|
97
|
+
kind: "action";
|
|
98
|
+
id: string;
|
|
99
|
+
title: string;
|
|
100
|
+
op: "push" | "commit";
|
|
101
|
+
}, {
|
|
102
|
+
kind: "action";
|
|
103
|
+
id: string;
|
|
104
|
+
title: string;
|
|
105
|
+
op: "push" | "commit";
|
|
106
|
+
}>, z.ZodObject<{
|
|
107
|
+
kind: z.ZodLiteral<"agent">;
|
|
108
|
+
id: z.ZodString;
|
|
109
|
+
title: z.ZodString;
|
|
110
|
+
/** The instruction handed to the dock agent. */
|
|
111
|
+
prompt: z.ZodString;
|
|
112
|
+
/**
|
|
113
|
+
* Real-state check run after the agent's turn before advancing:
|
|
114
|
+
* - `committed` — the working tree is clean (changes were committed).
|
|
115
|
+
* - `pushed` — the branch is no longer ahead of its upstream.
|
|
116
|
+
*/
|
|
117
|
+
verify: z.ZodOptional<z.ZodEnum<["committed", "pushed"]>>;
|
|
118
|
+
}, "strip", z.ZodTypeAny, {
|
|
119
|
+
kind: "agent";
|
|
120
|
+
id: string;
|
|
121
|
+
title: string;
|
|
122
|
+
prompt: string;
|
|
123
|
+
verify?: "committed" | "pushed" | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
kind: "agent";
|
|
126
|
+
id: string;
|
|
127
|
+
title: string;
|
|
128
|
+
prompt: string;
|
|
129
|
+
verify?: "committed" | "pushed" | undefined;
|
|
130
|
+
}>, z.ZodObject<{
|
|
131
|
+
kind: z.ZodLiteral<"gate">;
|
|
132
|
+
id: z.ZodString;
|
|
133
|
+
title: z.ZodString;
|
|
134
|
+
/** Shown at the pause so the user knows what they're approving. */
|
|
135
|
+
message: z.ZodString;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
kind: "gate";
|
|
138
|
+
message: string;
|
|
139
|
+
id: string;
|
|
140
|
+
title: string;
|
|
141
|
+
}, {
|
|
142
|
+
kind: "gate";
|
|
143
|
+
message: string;
|
|
144
|
+
id: string;
|
|
145
|
+
title: string;
|
|
146
|
+
}>]>, "many">;
|
|
147
|
+
}, "strip", z.ZodTypeAny, {
|
|
148
|
+
id: string;
|
|
149
|
+
name: string;
|
|
150
|
+
steps: ({
|
|
151
|
+
kind: "action";
|
|
152
|
+
id: string;
|
|
153
|
+
title: string;
|
|
154
|
+
op: "push" | "commit";
|
|
155
|
+
} | {
|
|
156
|
+
kind: "agent";
|
|
157
|
+
id: string;
|
|
158
|
+
title: string;
|
|
159
|
+
prompt: string;
|
|
160
|
+
verify?: "committed" | "pushed" | undefined;
|
|
161
|
+
} | {
|
|
162
|
+
kind: "gate";
|
|
163
|
+
message: string;
|
|
164
|
+
id: string;
|
|
165
|
+
title: string;
|
|
166
|
+
})[];
|
|
167
|
+
description?: string | undefined;
|
|
168
|
+
builtin?: boolean | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
id: string;
|
|
171
|
+
name: string;
|
|
172
|
+
steps: ({
|
|
173
|
+
kind: "action";
|
|
174
|
+
id: string;
|
|
175
|
+
title: string;
|
|
176
|
+
op: "push" | "commit";
|
|
177
|
+
} | {
|
|
178
|
+
kind: "agent";
|
|
179
|
+
id: string;
|
|
180
|
+
title: string;
|
|
181
|
+
prompt: string;
|
|
182
|
+
verify?: "committed" | "pushed" | undefined;
|
|
183
|
+
} | {
|
|
184
|
+
kind: "gate";
|
|
185
|
+
message: string;
|
|
186
|
+
id: string;
|
|
187
|
+
title: string;
|
|
188
|
+
})[];
|
|
189
|
+
description?: string | undefined;
|
|
190
|
+
builtin?: boolean | undefined;
|
|
191
|
+
}>;
|
|
192
|
+
export type WorkflowStep = z.infer<typeof workflowStepSchema>;
|
|
193
|
+
export type Workflow = z.infer<typeof workflowSchema>;
|
|
194
|
+
/**
|
|
195
|
+
* The Phase-1 starter set. These are plain data (not hardcoded UI), so the same
|
|
196
|
+
* structure a user authors later can be forked from one of these.
|
|
197
|
+
*/
|
|
198
|
+
export declare const BUILTIN_WORKFLOWS: Workflow[];
|
|
199
|
+
/**
|
|
200
|
+
* Merge the built-in templates with the user's saved workflows. A stored
|
|
201
|
+
* workflow whose id matches a built-in *replaces* it (that's a fork/edit);
|
|
202
|
+
* everything else is appended. Built-ins come first.
|
|
203
|
+
*/
|
|
204
|
+
export declare function listWorkflows(stored: Workflow[]): Workflow[];
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* User-owned git/GitHub workflows — the AI-native answer to fixed IDE buttons.
|
|
4
|
+
*
|
|
5
|
+
* A workflow is an ordered list of steps the runner walks one at a time. A step
|
|
6
|
+
* is one of three kinds:
|
|
7
|
+
*
|
|
8
|
+
* - **action** — deterministic, no inputs needed (e.g. `push`). Runs via the
|
|
9
|
+
* REST API and its result tells us pass/fail. Predictable, no tokens spent.
|
|
10
|
+
* - **agent** — a scoped natural-language task handed to the dock agent, which
|
|
11
|
+
* does the fuzzy work (review a diff, group commits, draft + file a PR/issue)
|
|
12
|
+
* using its own git/GitHub tools. Optionally `verify`-d against real git state.
|
|
13
|
+
* - **gate** — a hard stop that waits for the human (Approve / Skip / Stop).
|
|
14
|
+
*
|
|
15
|
+
* The runner itself lives client-side (agent steps execute through the dock
|
|
16
|
+
* conversation); this module owns the *shape* and the built-in templates, and is
|
|
17
|
+
* persisted through {@link ConfigStore} so a user can fork/edit them later.
|
|
18
|
+
*/
|
|
19
|
+
export const workflowStepSchema = z.discriminatedUnion("kind", [
|
|
20
|
+
z.object({
|
|
21
|
+
kind: z.literal("action"),
|
|
22
|
+
id: z.string().min(1),
|
|
23
|
+
title: z.string().min(1),
|
|
24
|
+
/**
|
|
25
|
+
* Deterministic op with no inputs — runs straight through the REST API with
|
|
26
|
+
* zero agent tokens. `commit` stages everything and commits with a generated
|
|
27
|
+
* message (no diff reading, no quality analysis); `push` pushes the branch.
|
|
28
|
+
*/
|
|
29
|
+
op: z.enum(["push", "commit"]),
|
|
30
|
+
}),
|
|
31
|
+
z.object({
|
|
32
|
+
kind: z.literal("agent"),
|
|
33
|
+
id: z.string().min(1),
|
|
34
|
+
title: z.string().min(1),
|
|
35
|
+
/** The instruction handed to the dock agent. */
|
|
36
|
+
prompt: z.string().min(1),
|
|
37
|
+
/**
|
|
38
|
+
* Real-state check run after the agent's turn before advancing:
|
|
39
|
+
* - `committed` — the working tree is clean (changes were committed).
|
|
40
|
+
* - `pushed` — the branch is no longer ahead of its upstream.
|
|
41
|
+
*/
|
|
42
|
+
verify: z.enum(["committed", "pushed"]).optional(),
|
|
43
|
+
}),
|
|
44
|
+
z.object({
|
|
45
|
+
kind: z.literal("gate"),
|
|
46
|
+
id: z.string().min(1),
|
|
47
|
+
title: z.string().min(1),
|
|
48
|
+
/** Shown at the pause so the user knows what they're approving. */
|
|
49
|
+
message: z.string().min(1),
|
|
50
|
+
}),
|
|
51
|
+
]);
|
|
52
|
+
export const workflowSchema = z.object({
|
|
53
|
+
id: z.string().min(1),
|
|
54
|
+
name: z.string().min(1),
|
|
55
|
+
description: z.string().optional(),
|
|
56
|
+
/** True for the shipped templates; false/absent for user-saved workflows. */
|
|
57
|
+
builtin: z.boolean().optional(),
|
|
58
|
+
steps: z.array(workflowStepSchema).min(1),
|
|
59
|
+
});
|
|
60
|
+
/**
|
|
61
|
+
* One lightweight AI pass that writes a real commit message and commits — the
|
|
62
|
+
* balance the user wanted: a thought-through message like the `commit-push`
|
|
63
|
+
* skill, but a single pass (no review report, no splitting into many commits).
|
|
64
|
+
* Shared by the commit-bearing templates.
|
|
65
|
+
*/
|
|
66
|
+
const COMMIT_STEP = {
|
|
67
|
+
kind: "agent",
|
|
68
|
+
id: "commit",
|
|
69
|
+
title: "Commit all changes",
|
|
70
|
+
prompt: "Stage my changes and make ONE commit, in a single pass. Steps: stage the changed files with `nomoreide_git_stage` (skip anything that looks like a secret, e.g. `.env`); glance at the staged diff once with `nomoreide_git_staged_diff`; then commit with `nomoreide_git_commit` using a conventional-commit message — a `<type>: concise title` line (feat/fix/refactor/chore/docs/test) plus a few short bullets of what changed. One commit only: do NOT split into multiple commits and do NOT write a separate review or analysis. Reply with just the commit message you used.",
|
|
71
|
+
verify: "committed",
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* The Phase-1 starter set. These are plain data (not hardcoded UI), so the same
|
|
75
|
+
* structure a user authors later can be forked from one of these.
|
|
76
|
+
*/
|
|
77
|
+
export const BUILTIN_WORKFLOWS = [
|
|
78
|
+
{
|
|
79
|
+
id: "commit-push",
|
|
80
|
+
name: "Commit & push",
|
|
81
|
+
description: "One quick AI pass writes a good commit message and commits, then pushes. No heavy review or multi-commit splitting.",
|
|
82
|
+
builtin: true,
|
|
83
|
+
steps: [
|
|
84
|
+
COMMIT_STEP,
|
|
85
|
+
{ kind: "gate", id: "gate-push", title: "Approve push", message: "Push to the remote?" },
|
|
86
|
+
{ kind: "action", id: "push", title: "Push", op: "push" },
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "ship-it",
|
|
91
|
+
name: "Ship it",
|
|
92
|
+
description: "Commit (one AI pass), push, then a quick AI turn each to open and squash-merge the PR.",
|
|
93
|
+
builtin: true,
|
|
94
|
+
steps: [
|
|
95
|
+
COMMIT_STEP,
|
|
96
|
+
{ kind: "gate", id: "gate-push", title: "Approve push", message: "Push and open a PR?" },
|
|
97
|
+
{ kind: "action", id: "push", title: "Push", op: "push" },
|
|
98
|
+
{
|
|
99
|
+
kind: "agent",
|
|
100
|
+
id: "open-pr",
|
|
101
|
+
title: "Open a PR",
|
|
102
|
+
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.",
|
|
103
|
+
},
|
|
104
|
+
{ kind: "gate", id: "gate-merge", title: "Approve merge", message: "Squash-merge the pull request?" },
|
|
105
|
+
{
|
|
106
|
+
kind: "agent",
|
|
107
|
+
id: "merge",
|
|
108
|
+
title: "Squash-merge",
|
|
109
|
+
prompt: "Squash-merge the PR you just opened with the `nomoreide_github_merge_pr` tool. Don't analyze anything — just merge. Reply with one line.",
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: "file-issue",
|
|
115
|
+
name: "File an issue from these changes",
|
|
116
|
+
description: "One quick AI turn drafts a short issue from your file list, then files it on approval.",
|
|
117
|
+
builtin: true,
|
|
118
|
+
steps: [
|
|
119
|
+
{
|
|
120
|
+
kind: "agent",
|
|
121
|
+
id: "draft",
|
|
122
|
+
title: "Draft a short issue",
|
|
123
|
+
prompt: "Draft a SHORT GitHub issue (a title + a 2–3 line body) from the list of changed files only — call `nomoreide_git_status` for the file list. Do NOT read file diffs or analyze the changes. Show me the draft; don't file it.",
|
|
124
|
+
},
|
|
125
|
+
{ kind: "gate", id: "gate-file", title: "Approve filing", message: "File this issue on GitHub?" },
|
|
126
|
+
{
|
|
127
|
+
kind: "agent",
|
|
128
|
+
id: "create",
|
|
129
|
+
title: "File the issue",
|
|
130
|
+
prompt: "Create the GitHub issue you just drafted using the `nomoreide_github_create_issue` tool. Reply with just the issue number and URL.",
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
/**
|
|
136
|
+
* Merge the built-in templates with the user's saved workflows. A stored
|
|
137
|
+
* workflow whose id matches a built-in *replaces* it (that's a fork/edit);
|
|
138
|
+
* everything else is appended. Built-ins come first.
|
|
139
|
+
*/
|
|
140
|
+
export function listWorkflows(stored) {
|
|
141
|
+
const overrides = new Map(stored.map((workflow) => [workflow.id, workflow]));
|
|
142
|
+
const merged = BUILTIN_WORKFLOWS.map((builtin) => overrides.get(builtin.id) ?? builtin);
|
|
143
|
+
const extras = stored.filter((workflow) => !BUILTIN_WORKFLOWS.some((b) => b.id === workflow.id));
|
|
144
|
+
return [...merged, ...extras];
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=workflows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workflows.js","sourceRoot":"","sources":["../../src/core/workflows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC7D,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;QACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB;;;;WAIG;QACH,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;KAC/B,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QACxB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACxB,gDAAgD;QAChD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACzB;;;;WAIG;QACH,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE;KACnD,CAAC;IACF,CAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,CAAC,CAA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AAM,EACJ,oIAAoI;aACvI;SACF;KACF;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,MAAkB;IAC9C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,OAAO,CAAC,CAAC;IACxF,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;IACjG,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import type { FastMCP } from "fastmcp";
|
|
|
2
2
|
import type { ConfigStore } from "../../core/config-store.js";
|
|
3
3
|
import type { DbPeek } from "../../core/db-peek.js";
|
|
4
4
|
import type { ErrorInbox } from "../../core/error-inbox.js";
|
|
5
|
+
import { GitActions } from "../../core/git-actions.js";
|
|
5
6
|
import { GitManager } from "../../core/git-manager.js";
|
|
6
7
|
import type { LogStore } from "../../core/log-store.js";
|
|
7
8
|
import type { ProcessManager } from "../../core/process-manager.js";
|
|
@@ -21,6 +22,8 @@ export interface ToolContext {
|
|
|
21
22
|
/** Each domain registers its tools onto the (optionally recording) server. */
|
|
22
23
|
export type RegisterTools = (server: FastMCP, ctx: ToolContext) => void;
|
|
23
24
|
export declare function git(cwd?: string): GitManager;
|
|
25
|
+
/** Write-capable Git ops (push) — kept distinct from the read-safe {@link git}. */
|
|
26
|
+
export declare function gitActions(cwd?: string): GitActions;
|
|
24
27
|
export declare function stringify(value: unknown): string;
|
|
25
28
|
/**
|
|
26
29
|
* Wrap a FastMCP server so every `addTool` execute is timed and recorded in
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { GitActions } from "../../core/git-actions.js";
|
|
1
2
|
import { GitManager } from "../../core/git-manager.js";
|
|
2
3
|
import { previewArgs } from "../../core/tool-call-store.js";
|
|
3
4
|
export function git(cwd) {
|
|
4
5
|
return new GitManager(cwd ?? process.cwd());
|
|
5
6
|
}
|
|
7
|
+
/** Write-capable Git ops (push) — kept distinct from the read-safe {@link git}. */
|
|
8
|
+
export function gitActions(cwd) {
|
|
9
|
+
return new GitActions(cwd ?? process.cwd());
|
|
10
|
+
}
|
|
6
11
|
export function stringify(value) {
|
|
7
12
|
return JSON.stringify(value, null, 2);
|
|
8
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../src/mcp/tools/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,WAAW,EAAsB,MAAM,+BAA+B,CAAC;AAiBhF,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,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
|
|
2
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"];
|
|
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_push", "nomoreide_git_register_repository", "nomoreide_git_select_repository"];
|
|
4
4
|
export declare function registerGitTools(server: FastMCP, ctx: ToolContext): void;
|
package/dist/mcp/tools/git.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { git, stringify } from "./context.js";
|
|
2
|
+
import { git, gitActions, stringify } from "./context.js";
|
|
3
3
|
export const GIT_TOOL_NAMES = [
|
|
4
4
|
"nomoreide_git_status",
|
|
5
5
|
"nomoreide_git_branches",
|
|
@@ -12,6 +12,7 @@ export const GIT_TOOL_NAMES = [
|
|
|
12
12
|
"nomoreide_git_stage",
|
|
13
13
|
"nomoreide_git_unstage",
|
|
14
14
|
"nomoreide_git_commit",
|
|
15
|
+
"nomoreide_git_push",
|
|
15
16
|
"nomoreide_git_register_repository",
|
|
16
17
|
"nomoreide_git_select_repository",
|
|
17
18
|
];
|
|
@@ -99,6 +100,14 @@ export function registerGitTools(server, ctx) {
|
|
|
99
100
|
}),
|
|
100
101
|
execute: async ({ cwd, message }) => await git(cwd).commit(message),
|
|
101
102
|
});
|
|
103
|
+
server.addTool({
|
|
104
|
+
name: "nomoreide_git_push",
|
|
105
|
+
description: "Push the current branch to its remote (sets upstream on first push). Write op — does not force-push.",
|
|
106
|
+
parameters: gitCwdSchema.extend({
|
|
107
|
+
remote: z.string().min(1).optional().describe("Remote name (default origin)."),
|
|
108
|
+
}),
|
|
109
|
+
execute: async ({ cwd, remote }) => stringify(await gitActions(cwd).push({ remote })),
|
|
110
|
+
});
|
|
102
111
|
server.addTool({
|
|
103
112
|
name: "nomoreide_git_register_repository",
|
|
104
113
|
description: "Register a named Git repository folder for NoMoreIDE.",
|
|
@@ -1 +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;
|
|
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,UAAU,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAE5E,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,oBAAoB;IACpB,mCAAmC;IACnC,iCAAiC;CACzB,CAAC;AAEX,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACxE,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,YAAY,CAAC,MAAM,CAAC;IACxC,IAAI,EAAE,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CAAC,MAAM,WAAW,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;KACzD,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { FastMCP } from "fastmcp";
|
|
2
2
|
import { type ToolContext } from "./context.js";
|
|
3
|
-
export declare const GITHUB_TOOL_NAMES: readonly ["nomoreide_github_set_token", "nomoreide_github_list_prs", "nomoreide_github_get_pr", "nomoreide_github_get_pr_diff", "nomoreide_github_create_pr", "nomoreide_github_list_issues", "nomoreide_github_get_issue", "nomoreide_github_list_issue_comments", "nomoreide_github_add_issue_comment", "nomoreide_github_create_issue", "nomoreide_github_get_commit_ci", "nomoreide_github_list_workflow_runs"];
|
|
3
|
+
export declare const GITHUB_TOOL_NAMES: readonly ["nomoreide_github_set_token", "nomoreide_github_list_prs", "nomoreide_github_get_pr", "nomoreide_github_get_pr_diff", "nomoreide_github_create_pr", "nomoreide_github_merge_pr", "nomoreide_github_list_issues", "nomoreide_github_get_issue", "nomoreide_github_list_issue_comments", "nomoreide_github_add_issue_comment", "nomoreide_github_create_issue", "nomoreide_github_get_commit_ci", "nomoreide_github_list_workflow_runs"];
|
|
4
4
|
export declare function registerGithubTools(server: FastMCP, ctx: ToolContext): void;
|
package/dist/mcp/tools/github.js
CHANGED
|
@@ -8,6 +8,7 @@ export const GITHUB_TOOL_NAMES = [
|
|
|
8
8
|
"nomoreide_github_get_pr",
|
|
9
9
|
"nomoreide_github_get_pr_diff",
|
|
10
10
|
"nomoreide_github_create_pr",
|
|
11
|
+
"nomoreide_github_merge_pr",
|
|
11
12
|
"nomoreide_github_list_issues",
|
|
12
13
|
"nomoreide_github_get_issue",
|
|
13
14
|
"nomoreide_github_list_issue_comments",
|
|
@@ -104,6 +105,20 @@ export function registerGithubTools(server, ctx) {
|
|
|
104
105
|
return `Created PR #${pr.number}: ${pr.html_url}`;
|
|
105
106
|
},
|
|
106
107
|
});
|
|
108
|
+
server.addTool({
|
|
109
|
+
name: "nomoreide_github_merge_pr",
|
|
110
|
+
description: "Merge a pull request (squash by default). Fails if GitHub reports the PR is not mergeable (conflicts, failing required checks, branch protection).",
|
|
111
|
+
parameters: cwdSchema.extend({
|
|
112
|
+
number: z.number().int().positive().describe("Pull request number."),
|
|
113
|
+
method: z.enum(["merge", "squash", "rebase"]).default("squash").describe("Merge method."),
|
|
114
|
+
commitTitle: z.string().optional().describe("Override the merge commit title."),
|
|
115
|
+
commitMessage: z.string().optional().describe("Override the merge commit body."),
|
|
116
|
+
}),
|
|
117
|
+
execute: async ({ cwd, number, method, commitTitle, commitMessage }) => {
|
|
118
|
+
const { manager } = await buildManager(ctx, cwd);
|
|
119
|
+
return stringify(await manager.mergePR(number, { method, commitTitle, commitMessage }));
|
|
120
|
+
},
|
|
121
|
+
});
|
|
107
122
|
server.addTool({
|
|
108
123
|
name: "nomoreide_github_list_issues",
|
|
109
124
|
description: "List issues for the active GitHub repository.",
|