nomoreide 0.1.54 → 0.1.56
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/core/agent-sessions.d.ts +45 -0
- package/dist/core/agent-sessions.js +103 -0
- package/dist/core/agent-sessions.js.map +1 -0
- package/dist/core/config-store.d.ts +7 -0
- package/dist/core/config-store.js +29 -0
- package/dist/core/config-store.js.map +1 -1
- package/dist/core/git-manager.d.ts +15 -0
- package/dist/core/git-manager.js +43 -0
- package/dist/core/git-manager.js.map +1 -1
- package/dist/core/github-manager.d.ts +58 -0
- package/dist/core/github-manager.js +51 -0
- package/dist/core/github-manager.js.map +1 -1
- package/dist/core/snapshot-manager.d.ts +62 -0
- package/dist/core/snapshot-manager.js +219 -0
- package/dist/core/snapshot-manager.js.map +1 -0
- package/dist/core/tool-call-store.d.ts +2 -0
- package/dist/core/tool-call-store.js.map +1 -1
- package/dist/core/types.d.ts +5 -0
- package/dist/mcp/server.js +6 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/context.d.ts +6 -1
- package/dist/mcp/tools/context.js +8 -1
- package/dist/mcp/tools/context.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +3 -1
- package/dist/mcp/tools/index.js +5 -2
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/snapshots.d.ts +8 -0
- package/dist/mcp/tools/snapshots.js +37 -0
- package/dist/mcp/tools/snapshots.js.map +1 -0
- package/dist/web/client/assets/{code-editor-dsjVJ-4Z.js → code-editor-BnSokx6t.js} +1 -1
- package/dist/web/client/assets/index-B0Tno-0X.js +215 -0
- package/dist/web/client/assets/index-CBZqXKDN.css +1 -0
- package/dist/web/client/index.html +2 -2
- package/dist/web/routes/context.d.ts +2 -0
- package/dist/web/routes/context.js.map +1 -1
- package/dist/web/routes/git-routes.js +106 -10
- package/dist/web/routes/git-routes.js.map +1 -1
- package/dist/web/routes/github-routes.js +212 -3
- 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/shell-routes.js +1 -0
- package/dist/web/routes/shell-routes.js.map +1 -1
- package/dist/web/routes/snapshot-routes.d.ts +8 -0
- package/dist/web/routes/snapshot-routes.js +194 -0
- package/dist/web/routes/snapshot-routes.js.map +1 -0
- package/dist/web/server.js +3 -0
- package/dist/web/server.js.map +1 -1
- package/package.json +1 -1
- package/dist/web/client/assets/index-CpAg7ECo.js +0 -215
- package/dist/web/client/assets/index-D4fn2UZ8.css +0 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export interface Snapshot {
|
|
2
|
+
sha: string;
|
|
3
|
+
ref: string;
|
|
4
|
+
label: string;
|
|
5
|
+
createdAt: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SnapshotChange {
|
|
8
|
+
/** A (added since snapshot), M (modified), D (deleted since snapshot). */
|
|
9
|
+
status: string;
|
|
10
|
+
path: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RestoreResult {
|
|
13
|
+
/** Safety snapshot taken automatically before the restore. */
|
|
14
|
+
preRestore: Snapshot;
|
|
15
|
+
/** Files whose content was restored or re-created from the snapshot. */
|
|
16
|
+
restoredFiles: number;
|
|
17
|
+
/** Files created after the snapshot that the restore removed. */
|
|
18
|
+
deletedPaths: string[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Working-tree checkpoints under `refs/nomoreide/snapshots/*`, kept
|
|
22
|
+
* deliberately separate from the read-safe {@link GitManager} (like
|
|
23
|
+
* {@link GitActions}). Snapshots are commit objects in a private ref
|
|
24
|
+
* namespace: they never move HEAD, branches, or the user's index — the tree
|
|
25
|
+
* is built through a temporary `GIT_INDEX_FILE` so staged state survives.
|
|
26
|
+
*
|
|
27
|
+
* `restore` is the one destructive operation and it is made reversible by
|
|
28
|
+
* always taking a `pre-restore` snapshot first; it also refuses shas that are
|
|
29
|
+
* not in the snapshot namespace, so the API can never check out arbitrary
|
|
30
|
+
* commits.
|
|
31
|
+
*/
|
|
32
|
+
export declare class SnapshotManager {
|
|
33
|
+
private readonly cwd;
|
|
34
|
+
constructor(cwd?: string);
|
|
35
|
+
snapshot(label: string): Promise<Snapshot>;
|
|
36
|
+
/** Newest first (ref names start with the creation epoch-millis). */
|
|
37
|
+
list(): Promise<Snapshot[]>;
|
|
38
|
+
/** Diff a snapshot against the current working tree (incl. untracked files). */
|
|
39
|
+
changedFiles(sha: string): Promise<SnapshotChange[]>;
|
|
40
|
+
diff(sha: string, path?: string): Promise<string>;
|
|
41
|
+
restore(sha: string): Promise<RestoreResult>;
|
|
42
|
+
/** Permanently drop a single snapshot ref (the commit object is left to gc). */
|
|
43
|
+
delete(sha: string): Promise<void>;
|
|
44
|
+
/**
|
|
45
|
+
* Relabel a snapshot. Commit objects are immutable, so this rewrites the
|
|
46
|
+
* commit message onto a new object (preserving tree, parent, and original
|
|
47
|
+
* dates) and repoints the same ref at it; the ref name is left as-is.
|
|
48
|
+
*/
|
|
49
|
+
rename(sha: string, label: string): Promise<Snapshot>;
|
|
50
|
+
/** Drop snapshots beyond the newest `keep`; returns how many were removed. */
|
|
51
|
+
prune(keep?: number): Promise<number>;
|
|
52
|
+
/** Resolve a sha to its snapshot, refusing anything outside the namespace. */
|
|
53
|
+
private find;
|
|
54
|
+
/**
|
|
55
|
+
* Write the current working tree (tracked + untracked, `.gitignore`
|
|
56
|
+
* respected) as a tree object via a throwaway index file.
|
|
57
|
+
*/
|
|
58
|
+
private captureTree;
|
|
59
|
+
private headSha;
|
|
60
|
+
private removeWorktreeFile;
|
|
61
|
+
private git;
|
|
62
|
+
}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join, resolve, sep } from "node:path";
|
|
6
|
+
import { promisify } from "node:util";
|
|
7
|
+
const execFileAsync = promisify(execFile);
|
|
8
|
+
const SNAPSHOT_REF_PREFIX = "refs/nomoreide/snapshots/";
|
|
9
|
+
/** Snapshots are anonymous safety commits; never attributed to the user. */
|
|
10
|
+
const SNAPSHOT_IDENTITY = {
|
|
11
|
+
GIT_AUTHOR_NAME: "nomoreide",
|
|
12
|
+
GIT_AUTHOR_EMAIL: "nomoreide@localhost",
|
|
13
|
+
GIT_COMMITTER_NAME: "nomoreide",
|
|
14
|
+
GIT_COMMITTER_EMAIL: "nomoreide@localhost",
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Working-tree checkpoints under `refs/nomoreide/snapshots/*`, kept
|
|
18
|
+
* deliberately separate from the read-safe {@link GitManager} (like
|
|
19
|
+
* {@link GitActions}). Snapshots are commit objects in a private ref
|
|
20
|
+
* namespace: they never move HEAD, branches, or the user's index — the tree
|
|
21
|
+
* is built through a temporary `GIT_INDEX_FILE` so staged state survives.
|
|
22
|
+
*
|
|
23
|
+
* `restore` is the one destructive operation and it is made reversible by
|
|
24
|
+
* always taking a `pre-restore` snapshot first; it also refuses shas that are
|
|
25
|
+
* not in the snapshot namespace, so the API can never check out arbitrary
|
|
26
|
+
* commits.
|
|
27
|
+
*/
|
|
28
|
+
export class SnapshotManager {
|
|
29
|
+
cwd;
|
|
30
|
+
constructor(cwd = process.cwd()) {
|
|
31
|
+
this.cwd = cwd;
|
|
32
|
+
}
|
|
33
|
+
async snapshot(label) {
|
|
34
|
+
const cleaned = label.trim() || "snapshot";
|
|
35
|
+
const tree = await this.captureTree();
|
|
36
|
+
const head = await this.headSha();
|
|
37
|
+
const commitArgs = ["commit-tree", tree, "-m", cleaned];
|
|
38
|
+
if (head)
|
|
39
|
+
commitArgs.push("-p", head);
|
|
40
|
+
const sha = (await this.git(commitArgs, SNAPSHOT_IDENTITY)).trim();
|
|
41
|
+
const ref = `${SNAPSHOT_REF_PREFIX}${Date.now()}-${slugify(cleaned)}`;
|
|
42
|
+
await this.git(["update-ref", ref, sha]);
|
|
43
|
+
return { sha, ref, label: cleaned, createdAt: new Date().toISOString() };
|
|
44
|
+
}
|
|
45
|
+
/** Newest first (ref names start with the creation epoch-millis). */
|
|
46
|
+
async list() {
|
|
47
|
+
const output = await this.git([
|
|
48
|
+
"for-each-ref",
|
|
49
|
+
"--sort=-refname",
|
|
50
|
+
"--format=%(refname)%09%(objectname)%09%(creatordate:iso-strict)%09%(subject)",
|
|
51
|
+
SNAPSHOT_REF_PREFIX.replace(/\/$/, ""),
|
|
52
|
+
]);
|
|
53
|
+
return output
|
|
54
|
+
.split("\n")
|
|
55
|
+
.filter((line) => line.trim() !== "")
|
|
56
|
+
.map((line) => {
|
|
57
|
+
const [ref, sha, createdAt, ...subject] = line.split("\t");
|
|
58
|
+
return { ref, sha, createdAt, label: subject.join("\t") };
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Diff a snapshot against the current working tree (incl. untracked files). */
|
|
62
|
+
async changedFiles(sha) {
|
|
63
|
+
const tree = await this.captureTree();
|
|
64
|
+
const output = await this.git([
|
|
65
|
+
"diff",
|
|
66
|
+
"--no-renames",
|
|
67
|
+
"--name-status",
|
|
68
|
+
sha,
|
|
69
|
+
tree,
|
|
70
|
+
]);
|
|
71
|
+
return output
|
|
72
|
+
.split("\n")
|
|
73
|
+
.filter((line) => line.trim() !== "")
|
|
74
|
+
.map((line) => {
|
|
75
|
+
const [status, ...path] = line.split("\t");
|
|
76
|
+
return { status, path: path.join("\t") };
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
async diff(sha, path) {
|
|
80
|
+
const tree = await this.captureTree();
|
|
81
|
+
const args = ["diff", "--no-renames", sha, tree];
|
|
82
|
+
if (path)
|
|
83
|
+
args.push("--", path);
|
|
84
|
+
return this.git(args);
|
|
85
|
+
}
|
|
86
|
+
async restore(sha) {
|
|
87
|
+
const target = await this.find(sha);
|
|
88
|
+
const preRestore = await this.snapshot(`pre-restore (${target.label})`);
|
|
89
|
+
// Everything that differs between the snapshot and the just-captured
|
|
90
|
+
// current state. Additions must be deleted by hand: `git restore` only
|
|
91
|
+
// writes files that exist in the source tree, it never removes extras.
|
|
92
|
+
const changes = await this.git([
|
|
93
|
+
"diff",
|
|
94
|
+
"--no-renames",
|
|
95
|
+
"--name-status",
|
|
96
|
+
sha,
|
|
97
|
+
preRestore.sha,
|
|
98
|
+
]);
|
|
99
|
+
const deletedPaths = [];
|
|
100
|
+
let restoredFiles = 0;
|
|
101
|
+
for (const line of changes.split("\n")) {
|
|
102
|
+
if (line.trim() === "")
|
|
103
|
+
continue;
|
|
104
|
+
const [status, ...rest] = line.split("\t");
|
|
105
|
+
const path = rest.join("\t");
|
|
106
|
+
if (status === "A") {
|
|
107
|
+
await this.removeWorktreeFile(path);
|
|
108
|
+
deletedPaths.push(path);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
restoredFiles += 1;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (restoredFiles > 0) {
|
|
115
|
+
// --worktree only: the user's index stays untouched, mirroring snapshot().
|
|
116
|
+
await this.git(["restore", "--source", sha, "--worktree", "--", ":/"]);
|
|
117
|
+
}
|
|
118
|
+
return { preRestore, restoredFiles, deletedPaths };
|
|
119
|
+
}
|
|
120
|
+
/** Permanently drop a single snapshot ref (the commit object is left to gc). */
|
|
121
|
+
async delete(sha) {
|
|
122
|
+
const target = await this.find(sha);
|
|
123
|
+
// Compare-and-swap on the old value so we never delete a moved ref.
|
|
124
|
+
await this.git(["update-ref", "-d", target.ref, sha]);
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Relabel a snapshot. Commit objects are immutable, so this rewrites the
|
|
128
|
+
* commit message onto a new object (preserving tree, parent, and original
|
|
129
|
+
* dates) and repoints the same ref at it; the ref name is left as-is.
|
|
130
|
+
*/
|
|
131
|
+
async rename(sha, label) {
|
|
132
|
+
const target = await this.find(sha);
|
|
133
|
+
const cleaned = label.trim() || "snapshot";
|
|
134
|
+
const tree = (await this.git(["rev-parse", `${sha}^{tree}`])).trim();
|
|
135
|
+
const parents = (await this.git(["rev-list", "--parents", "-n", "1", sha]))
|
|
136
|
+
.trim()
|
|
137
|
+
.split(/\s+/)
|
|
138
|
+
.slice(1);
|
|
139
|
+
const authorDate = (await this.git(["show", "-s", "--format=%aI", sha])).trim();
|
|
140
|
+
const committerDate = (await this.git(["show", "-s", "--format=%cI", sha])).trim();
|
|
141
|
+
const commitArgs = ["commit-tree", tree, "-m", cleaned];
|
|
142
|
+
for (const parent of parents)
|
|
143
|
+
commitArgs.push("-p", parent);
|
|
144
|
+
const newSha = (await this.git(commitArgs, {
|
|
145
|
+
...SNAPSHOT_IDENTITY,
|
|
146
|
+
GIT_AUTHOR_DATE: authorDate,
|
|
147
|
+
GIT_COMMITTER_DATE: committerDate,
|
|
148
|
+
})).trim();
|
|
149
|
+
// CAS the ref from the old object to the relabeled one.
|
|
150
|
+
await this.git(["update-ref", target.ref, newSha, sha]);
|
|
151
|
+
return { sha: newSha, ref: target.ref, label: cleaned, createdAt: target.createdAt };
|
|
152
|
+
}
|
|
153
|
+
/** Drop snapshots beyond the newest `keep`; returns how many were removed. */
|
|
154
|
+
async prune(keep = 50) {
|
|
155
|
+
const snapshots = await this.list();
|
|
156
|
+
const stale = snapshots.slice(Math.max(0, keep));
|
|
157
|
+
for (const snapshot of stale) {
|
|
158
|
+
await this.git(["update-ref", "-d", snapshot.ref]);
|
|
159
|
+
}
|
|
160
|
+
return stale.length;
|
|
161
|
+
}
|
|
162
|
+
/** Resolve a sha to its snapshot, refusing anything outside the namespace. */
|
|
163
|
+
async find(sha) {
|
|
164
|
+
const target = (await this.list()).find((snapshot) => snapshot.sha === sha);
|
|
165
|
+
if (!target) {
|
|
166
|
+
throw new Error(`Not a nomoreide snapshot: ${sha}`);
|
|
167
|
+
}
|
|
168
|
+
return target;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Write the current working tree (tracked + untracked, `.gitignore`
|
|
172
|
+
* respected) as a tree object via a throwaway index file.
|
|
173
|
+
*/
|
|
174
|
+
async captureTree() {
|
|
175
|
+
const indexFile = join(tmpdir(), `nomoreide-index-${randomUUID()}`);
|
|
176
|
+
const env = { GIT_INDEX_FILE: indexFile };
|
|
177
|
+
try {
|
|
178
|
+
const head = await this.headSha();
|
|
179
|
+
await this.git(["read-tree", ...(head ? [head] : ["--empty"])], env);
|
|
180
|
+
await this.git(["add", "-A"], env);
|
|
181
|
+
return (await this.git(["write-tree"], env)).trim();
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
await rm(indexFile, { force: true });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
async headSha() {
|
|
188
|
+
try {
|
|
189
|
+
return (await this.git(["rev-parse", "--verify", "HEAD"])).trim();
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return null; // repository without commits yet
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
async removeWorktreeFile(path) {
|
|
196
|
+
const absolute = resolve(this.cwd, path);
|
|
197
|
+
if (!absolute.startsWith(resolve(this.cwd) + sep)) {
|
|
198
|
+
throw new Error(`Refusing to delete outside the repository: ${path}`);
|
|
199
|
+
}
|
|
200
|
+
await rm(absolute, { force: true });
|
|
201
|
+
}
|
|
202
|
+
async git(args, env) {
|
|
203
|
+
const { stdout } = await execFileAsync("git", args, {
|
|
204
|
+
cwd: this.cwd,
|
|
205
|
+
maxBuffer: 256 * 1024 * 1024,
|
|
206
|
+
env: env ? { ...process.env, ...env } : process.env,
|
|
207
|
+
});
|
|
208
|
+
return stdout;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
function slugify(label) {
|
|
212
|
+
const slug = label
|
|
213
|
+
.toLowerCase()
|
|
214
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
215
|
+
.replace(/^-+|-+$/g, "")
|
|
216
|
+
.slice(0, 40);
|
|
217
|
+
return slug || "snapshot";
|
|
218
|
+
}
|
|
219
|
+
//# sour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,CACf,IAAc,EACd,GAA4B;QAE5B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE;YAClD,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,SAAS,EAAE,GAAG,GAAG,IAAI,GAAG,IAAI;YAC5B,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG;SACpD,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAED,SAAS,OAAO,CAAC,KAAa;IAC5B,MAAM,IAAI,GAAG,KAAK;SACf,WAAW,EAAE;SACb,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAChB,OAAO,IAAI,IAAI,UAAU,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-call-store.js","sourceRoot":"","sources":["../../src/core/tool-call-store.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-call-store.js","sourceRoot":"","sources":["../../src/core/tool-call-store.ts"],"names":[],"mappings":"AAcA,MAAM,OAAO,aAAa;IAKK;IAJZ,OAAO,GAAqB,EAAE,CAAC;IAC/B,SAAS,GAAG,IAAI,GAAG,EAAY,CAAC;IACzC,MAAM,GAAG,CAAC,CAAC;IAEnB,YAA6B,WAAW,GAAG;QAAd,aAAQ,GAAR,QAAQ,CAAM;IAAG,CAAC;IAE/C,MAAM,CAAC,KAAiC;QACtC,MAAM,MAAM,GAAmB,EAAE,EAAE,EAAE,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC;QAC/D,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC1B,IA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AAS,CAAC;QAC5B,IAAI,IAAI,CAAC,MAAM,IAAI,iBAAiB;YAAE,OAAO,IAAI,CAAC;QAClD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,GAAG,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -106,6 +106,11 @@ export interface NoMoreIdeConfig {
|
|
|
106
106
|
bundles: BundleDefinition[];
|
|
107
107
|
gitRepositories: GitRepositoryDefinition[];
|
|
108
108
|
selectedGitRepository?: string;
|
|
109
|
+
/**
|
|
110
|
+
* Ordered repo names pinned to the multi-repo board. Undefined means the
|
|
111
|
+
* board shows every registered repo; an empty array means explicitly cleared.
|
|
112
|
+
*/
|
|
113
|
+
gitBoardRepositories?: string[];
|
|
109
114
|
databases: DatabaseConnection[];
|
|
110
115
|
logSources: LogSourceDefinition[];
|
|
111
116
|
githubTokens: GitHubToken[];
|
package/dist/mcp/server.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { dirname, resolve } from "node:path";
|
|
2
2
|
import { FastMCP } from "fastmcp";
|
|
3
|
+
import { AgentSessionStore, createAgentSessionTracker, } from "../core/agent-sessions.js";
|
|
3
4
|
import { ConfigStore, defaultGlobalConfigPath } from "../core/config-store.js";
|
|
4
5
|
import { DbPeek } from "../core/db-peek.js";
|
|
5
6
|
import { ErrorInbox } from "../core/error-inbox.js";
|
|
@@ -32,6 +33,10 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
32
33
|
const errorInbox = new ErrorInbox({ logStore, configStore });
|
|
33
34
|
const dbPeek = new DbPeek({ configStore });
|
|
34
35
|
const toolCallStore = new ToolCallStore();
|
|
36
|
+
const agentSessions = createAgentSessionTracker({
|
|
37
|
+
store: new AgentSessionStore(resolve(dirname(resolve(logDir)), "agent-sessions.json")),
|
|
38
|
+
configStore,
|
|
39
|
+
});
|
|
35
40
|
const uiLifecycle = options.uiLifecycle ??
|
|
36
41
|
createUiLifecycleManager({
|
|
37
42
|
configPath,
|
|
@@ -53,6 +58,7 @@ export function createNoMoreIdeMcpServer(options = {}) {
|
|
|
53
58
|
timelineStore,
|
|
54
59
|
uiLifecycle,
|
|
55
60
|
toolCallStore,
|
|
61
|
+
agentSessions,
|
|
56
62
|
});
|
|
57
63
|
return {
|
|
58
64
|
server,
|
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,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,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,EACL,0BAA0B,EAC1B,eAAe,GAChB,MAAM,6BAA6B,CAAC;AACrC,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,MAAM,UAAU,wBAAwB,CACtC,UAA2C,EAAE;IAE7C,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,uBAAuB,EAAE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AC;QACxB,OAA8B,CAAC,OAAO,CAAC,uBAAuB,EAAE,CAAC;IACpE,CAAC;IACD,IAAI,GAAG,CAAC,iBAAiB,KAAK,GAAG,EAAE,CAAC;QAClC,IAAI,CAAC;YACH,MAAM,WAAW,CAAC,aAAa,EAAE,CAAC;QACpC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,oCACE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,IAAI,CACL,CAAC;QACJ,CAAC;IACH,CAAC;IACD,MAAM,MAAM,CAAC,KAAK,CAAC,EAAE,aAAa,EAAE,OAAO,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FastMCP } from "fastmcp";
|
|
2
|
+
import type { AgentSessionTracker } from "../../core/agent-sessions.js";
|
|
2
3
|
import type { ConfigStore } from "../../core/config-store.js";
|
|
3
4
|
import type { DbPeek } from "../../core/db-peek.js";
|
|
4
5
|
import type { ErrorInbox } from "../../core/error-inbox.js";
|
|
@@ -29,5 +30,9 @@ export declare function stringify(value: unknown): string;
|
|
|
29
30
|
* Wrap a FastMCP server so every `addTool` execute is timed and recorded in
|
|
30
31
|
* the tool-call store. The aggregator wraps once, then hands the same wrapped
|
|
31
32
|
* server to each domain's `registerXTools`.
|
|
33
|
+
*
|
|
34
|
+
* When a session tracker is supplied, every execute first runs
|
|
35
|
+
* `beforeToolCall()` — which auto-snapshots the working tree at the start of
|
|
36
|
+
* a new agent session — and the resulting sessionId tags each record.
|
|
32
37
|
*/
|
|
33
|
-
export declare function wrapServerForRecording(server: FastMCP, store: ToolCallStore): FastMCP;
|
|
38
|
+
export declare function wrapServerForRecording(server: FastMCP, store: ToolCallStore, sessions?: AgentSessionTracker): FastMCP;
|
|
@@ -15,14 +15,19 @@ export function stringify(value) {
|
|
|
15
15
|
* Wrap a FastMCP server so every `addTool` execute is timed and recorded in
|
|
16
16
|
* the tool-call store. The aggregator wraps once, then hands the same wrapped
|
|
17
17
|
* server to each domain's `registerXTools`.
|
|
18
|
+
*
|
|
19
|
+
* When a session tracker is supplied, every execute first runs
|
|
20
|
+
* `beforeToolCall()` — which auto-snapshots the working tree at the start of
|
|
21
|
+
* a new agent session — and the resulting sessionId tags each record.
|
|
18
22
|
*/
|
|
19
|
-
export function wrapServerForRecording(server, store) {
|
|
23
|
+
export function wrapServerForRecording(server, store, sessions) {
|
|
20
24
|
const originalAdd = server.addTool.bind(server);
|
|
21
25
|
const wrapped = (definition) => {
|
|
22
26
|
const originalExecute = definition.execute;
|
|
23
27
|
const recordingDefinition = {
|
|
24
28
|
...definition,
|
|
25
29
|
execute: async (args, context) => {
|
|
30
|
+
const sessionId = sessions ? await sessions.beforeToolCall() : undefined;
|
|
26
31
|
const start = Date.now();
|
|
27
32
|
const startedAt = new Date(start).toISOString();
|
|
28
33
|
try {
|
|
@@ -32,6 +37,7 @@ export function wrapServerForRecording(server, store) {
|
|
|
32
37
|
startedAt,
|
|
33
38
|
durationMs: Date.now() - start,
|
|
34
39
|
status: "ok",
|
|
40
|
+
sessionId,
|
|
35
41
|
args: previewArgs(args),
|
|
36
42
|
});
|
|
37
43
|
return result;
|
|
@@ -42,6 +48,7 @@ export function wrapServerForRecording(server, store) {
|
|
|
42
48
|
startedAt,
|
|
43
49
|
durationMs: Date.now() - start,
|
|
44
50
|
status: "error",
|
|
51
|
+
sessionId,
|
|
45
52
|
args: previewArgs(args),
|
|
46
53
|
error: error instanceof Error ? error.message : String(error),
|
|
47
54
|
});
|
|
@@ -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":"AAKA,OAAO,EAAE,UAAU,E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ACtC,KAAK,CAAC,MAAM,CAAC;wBACX,IAAI,EAAE,UAAU,CAAC,IAAI;wBACrB,SAAS;wBACT,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK;wBAC9B,MAAM,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"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FastMCP } from "fastmcp";
|
|
2
|
+
import type { AgentSessionTracker } from "../../core/agent-sessions.js";
|
|
2
3
|
import type { ToolCallStore } from "../../core/tool-call-store.js";
|
|
3
4
|
import { type ToolContext } from "./context.js";
|
|
4
5
|
/**
|
|
@@ -9,10 +10,11 @@ import { type ToolContext } from "./context.js";
|
|
|
9
10
|
* a new domain module and register it below. This aggregator never grows a
|
|
10
11
|
* per-tool branch.
|
|
11
12
|
*/
|
|
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_onboard_repo", "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", "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", "nomoreide_list_errors", "nomoreide_error_prompt", "nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample", "nomoreide_db_query", "nomoreide_docs", "nomoreide_open_ui", "nomoreide_close_ui"];
|
|
13
|
+
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_onboard_repo", "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", "nomoreide_snapshots_list", "nomoreide_snapshot_create", "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", "nomoreide_list_errors", "nomoreide_error_prompt", "nomoreide_list_databases", "nomoreide_db_tables", "nomoreide_db_sample", "nomoreide_db_query", "nomoreide_docs", "nomoreide_open_ui", "nomoreide_close_ui"];
|
|
13
14
|
interface RegisterNoMoreIdeToolsOptions extends ToolContext {
|
|
14
15
|
server: FastMCP;
|
|
15
16
|
toolCallStore?: ToolCallStore;
|
|
17
|
+
agentSessions?: AgentSessionTracker;
|
|
16
18
|
}
|
|
17
19
|
export declare function registerNoMoreIdeTools(options: RegisterNoMoreIdeToolsOptions): void;
|
|
18
20
|
export type { ToolContext } from "./context.js";
|
package/dist/mcp/tools/index.js
CHANGED
|
@@ -7,6 +7,7 @@ import { GIT_TOOL_NAMES, registerGitTools } from "./git.js";
|
|
|
7
7
|
import { GITHUB_TOOL_NAMES, registerGithubTools } from "./github.js";
|
|
8
8
|
import { ONBOARD_TOOL_NAMES, registerOnboardTools } from "./onboard.js";
|
|
9
9
|
import { registerServiceTools, SERVICE_TOOL_NAMES } from "./services.js";
|
|
10
|
+
import { registerSnapshotTools, SNAPSHOT_TOOL_NAMES } from "./snapshots.js";
|
|
10
11
|
/**
|
|
11
12
|
* Every tool name NoMoreIDE exposes, in registration order. Each domain owns
|
|
12
13
|
* its own slice; this aggregates them — mirroring the web route registry.
|
|
@@ -19,6 +20,7 @@ export const NOMOREIDE_TOOL_NAMES = [
|
|
|
19
20
|
...SERVICE_TOOL_NAMES,
|
|
20
21
|
...ONBOARD_TOOL_NAMES,
|
|
21
22
|
...GIT_TOOL_NAMES,
|
|
23
|
+
...SNAPSHOT_TOOL_NAMES,
|
|
22
24
|
...GITHUB_TOOL_NAMES,
|
|
23
25
|
...ERROR_TOOL_NAMES,
|
|
24
26
|
...DATABASE_TOOL_NAMES,
|
|
@@ -26,13 +28,14 @@ export const NOMOREIDE_TOOL_NAMES = [
|
|
|
26
28
|
...AGENT_TOOL_NAMES,
|
|
27
29
|
];
|
|
28
30
|
export function registerNoMoreIdeTools(options) {
|
|
29
|
-
const { server: rawServer, toolCallStore, ...ctx } = options;
|
|
31
|
+
const { server: rawServer, toolCallStore, agentSessions, ...ctx } = options;
|
|
30
32
|
const server = toolCallStore
|
|
31
|
-
? wrapServerForRecording(rawServer, toolCallStore)
|
|
33
|
+
? wrapServerForRecording(rawServer, toolCallStore, agentSessions)
|
|
32
34
|
: rawServer;
|
|
33
35
|
registerServiceTools(server, ctx);
|
|
34
36
|
registerOnboardTools(server, ctx);
|
|
35
37
|
registerGitTools(server, ctx);
|
|
38
|
+
registerSnapshotTools(server, ctx);
|
|
36
39
|
registerGithubTools(server, ctx);
|
|
37
40
|
registerErrorTools(server, ctx);
|
|
38
41
|
registerDatabaseTools(server, ctx);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/mcp/tools/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAoB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,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EAAE,GAAG,CAAC,CAAC;IACjC,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChC,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,kBAAkB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { FastMCP } from "fastmcp";
|
|
2
|
+
import { type ToolContext } from "./context.js";
|
|
3
|
+
export declare const SNAPSHOT_TOOL_NAMES: readonly ["nomoreide_snapshots_list", "nomoreide_snapshot_create"];
|
|
4
|
+
/**
|
|
5
|
+
* Read/create only — restore is destructive and stays human-only (web UI
|
|
6
|
+
* with confirmation), mirroring the DbWrite boundary.
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerSnapshotTools(server: FastMCP, _ctx: ToolContext): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { SnapshotManager } from "../../core/snapshot-manager.js";
|
|
3
|
+
import { stringify } from "./context.js";
|
|
4
|
+
export const SNAPSHOT_TOOL_NAMES = [
|
|
5
|
+
"nomoreide_snapshots_list",
|
|
6
|
+
"nomoreide_snapshot_create",
|
|
7
|
+
];
|
|
8
|
+
const snapshotCwdSchema = z.object({
|
|
9
|
+
cwd: z.string().min(1).optional().describe("Git repository directory."),
|
|
10
|
+
});
|
|
11
|
+
const snapshotCreateSchema = snapshotCwdSchema.extend({
|
|
12
|
+
label: z.string().min(1).describe("Human-readable snapshot label."),
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Read/create only — restore is destructive and stays human-only (web UI
|
|
16
|
+
* with confirmation), mirroring the DbWrite boundary.
|
|
17
|
+
*/
|
|
18
|
+
export function registerSnapshotTools(server, _ctx) {
|
|
19
|
+
server.addTool({
|
|
20
|
+
name: "nomoreide_snapshots_list",
|
|
21
|
+
description: "List nomoreide working-tree snapshots (refs/nomoreide/snapshots) for a repository.",
|
|
22
|
+
parameters: snapshotCwdSchema,
|
|
23
|
+
execute: async ({ cwd }) => stringify(await new SnapshotManager(cwd ?? process.cwd()).list()),
|
|
24
|
+
});
|
|
25
|
+
server.addTool({
|
|
26
|
+
name: "nomoreide_snapshot_create",
|
|
27
|
+
description: "Checkpoint the current working tree as a nomoreide snapshot (never moves HEAD, branches, or the index).",
|
|
28
|
+
parameters: snapshotCreateSchema,
|
|
29
|
+
execute: async ({ cwd, label }) => {
|
|
30
|
+
const manager = new SnapshotManager(cwd ?? process.cwd());
|
|
31
|
+
const snapshot = await manager.snapshot(label);
|
|
32
|
+
await manager.prune();
|
|
33
|
+
return stringify(snapshot);
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=snapshots.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snapshots.js","sourceRoot":"","sources":["../../../src/mcp/tools/snapshots.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,SAAS,EAAoB,MAAM,cAAc,CAAC;AAE3D,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,0BAA0B;IAC1B,2BAA2B;CACnB,CAAC;AAEX,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,2BAA2B,CAAC;CACxE,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gCAAgC,CAAC;CACpE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