nomoreide 0.1.53 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/core/agent-sessions.d.ts +45 -0
  2. package/dist/core/agent-sessions.js +103 -0
  3. package/dist/core/agent-sessions.js.map +1 -0
  4. package/dist/core/snapshot-manager.d.ts +52 -0
  5. package/dist/core/snapshot-manager.js +182 -0
  6. package/dist/core/snapshot-manager.js.map +1 -0
  7. package/dist/core/tool-call-store.d.ts +2 -0
  8. package/dist/core/tool-call-store.js.map +1 -1
  9. package/dist/core/workflows.d.ts +22 -0
  10. package/dist/core/workflows.js +19 -1
  11. package/dist/core/workflows.js.map +1 -1
  12. package/dist/mcp/server.js +6 -0
  13. package/dist/mcp/server.js.map +1 -1
  14. package/dist/mcp/tools/context.d.ts +6 -1
  15. package/dist/mcp/tools/context.js +8 -1
  16. package/dist/mcp/tools/context.js.map +1 -1
  17. package/dist/mcp/tools/index.d.ts +3 -1
  18. package/dist/mcp/tools/index.js +5 -2
  19. package/dist/mcp/tools/index.js.map +1 -1
  20. package/dist/mcp/tools/snapshots.d.ts +8 -0
  21. package/dist/mcp/tools/snapshots.js +37 -0
  22. package/dist/mcp/tools/snapshots.js.map +1 -0
  23. package/dist/web/client/assets/{code-editor-CFwgiwCM.js → code-editor-CLZ4YEu4.js} +1 -1
  24. package/dist/web/client/assets/index-CD3YkYz8.css +1 -0
  25. package/dist/web/client/assets/{index-DixOCrTR.js → index-siG6R1Rg.js} +140 -140
  26. package/dist/web/client/index.html +2 -2
  27. package/dist/web/routes/context.d.ts +2 -0
  28. package/dist/web/routes/context.js.map +1 -1
  29. package/dist/web/routes/index.js +2 -0
  30. package/dist/web/routes/index.js.map +1 -1
  31. package/dist/web/routes/snapshot-routes.d.ts +8 -0
  32. package/dist/web/routes/snapshot-routes.js +164 -0
  33. package/dist/web/routes/snapshot-routes.js.map +1 -0
  34. package/dist/web/server.js +3 -0
  35. package/dist/web/server.js.map +1 -1
  36. package/package.json +1 -1
  37. package/dist/web/client/assets/index-D2WEod6o.css +0 -1
@@ -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":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,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,O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,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";
@@ -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":"AAEA,OAAO,EAAE,sBAAsB,EAAoB,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEzE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,GAAG,kBAAkB;IACrB,GAAG,kBAAkB;IACrB,GAAG,cAAc;IACjB,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,mBAAmB;IACtB,GAAG,cAAc;IACjB,GAAG,gBAAgB;CACX,CAAC;AAOX,MAAM,UAAU,sBAAsB,CACpC,OAAsC;IAEtC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAC7D,MAAM,MAAM,GAAG,aAAa;QAC1B,CAAC,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,CAAC;QAClD,CAAC,CAAC,SAAS,CAAC;IAEd,oBAAo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Ac;IACjB,GAAG,mBAAmB;IACtB,GAAG,iBAAiB;IACpB,GAAG,gBAAgB;IACnB,GAAG,mBAAmB;IACtB,GAAG,cAAc;IACjB,GAAG,gBAAgB;CACX,CAAC;AAQX,MAAM,UAAU,sBAAsB,CACpC,OAAsC;IAEtC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,GAAG,EAAE,GAAG,OAAO,CAAC;IAC5E,MAAM,MAAM,GAAG,aAAa;QAC1B,CAAC,CAAC,sBAAsB,CAAC,SAAS,EAAE,aAAa,EAAE,aAAa,CAAC;QACjE,CAAC,CAAC,SAAS,CAAC;IAEd,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,oBAAoB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAClC,gBAAgB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,qBAAqB,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,mBAAmB,CAAC,MAAM,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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