@towry/mcp 0.1.7 → 0.3.0
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/README.md +13 -126
- package/dist/checkpoints.d.ts +17 -0
- package/dist/checkpoints.d.ts.map +1 -0
- package/dist/checkpoints.js +358 -0
- package/dist/checkpoints.js.map +1 -0
- package/dist/checkpoints.test.d.ts +2 -0
- package/dist/checkpoints.test.d.ts.map +1 -0
- package/dist/checkpoints.test.js +277 -0
- package/dist/checkpoints.test.js.map +1 -0
- package/dist/checkpoints.validation.test.d.ts +2 -0
- package/dist/checkpoints.validation.test.d.ts.map +1 -0
- package/dist/checkpoints.validation.test.js +28 -0
- package/dist/checkpoints.validation.test.js.map +1 -0
- package/dist/index.d.ts +3 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -557
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/tmux.d.ts +0 -128
- package/dist/tmux.d.ts.map +0 -1
- package/dist/tmux.js +0 -797
- package/dist/tmux.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @towry/mcp
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server for
|
|
3
|
+
MCP (Model Context Protocol) server for fast semantic codebase search.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -10,20 +10,12 @@ pnpm add @towry/mcp
|
|
|
10
10
|
npm install @towry/mcp
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
## Environment Variables
|
|
14
|
-
|
|
15
|
-
| Variable | Description | Default |
|
|
16
|
-
|----------|-------------|---------|
|
|
17
|
-
| `KG_API_URL` | Knowledge Graph API base URL | `http://localhost:8361` |
|
|
18
|
-
| `KG_API_KEY` | API authentication key | `kg-dev-api-key` |
|
|
19
|
-
| `KG_API_TOKEN` | Alternative to KG_API_KEY | - |
|
|
20
|
-
|
|
21
13
|
## Usage
|
|
22
14
|
|
|
23
15
|
### As a CLI
|
|
24
16
|
|
|
25
17
|
```bash
|
|
26
|
-
|
|
18
|
+
pnpm dlx @towry/mcp
|
|
27
19
|
```
|
|
28
20
|
|
|
29
21
|
### With Claude Desktop
|
|
@@ -33,13 +25,9 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
33
25
|
```json
|
|
34
26
|
{
|
|
35
27
|
"mcpServers": {
|
|
36
|
-
"towry-mcp
|
|
28
|
+
"towry-mcp": {
|
|
37
29
|
"command": "npx",
|
|
38
|
-
"args": ["@towry/mcp"]
|
|
39
|
-
"env": {
|
|
40
|
-
"KG_API_URL": "http://localhost:8361",
|
|
41
|
-
"KG_API_KEY": "your-api-key"
|
|
42
|
-
}
|
|
30
|
+
"args": ["@towry/mcp"]
|
|
43
31
|
}
|
|
44
32
|
}
|
|
45
33
|
}
|
|
@@ -47,116 +35,15 @@ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_
|
|
|
47
35
|
|
|
48
36
|
## Available Tools
|
|
49
37
|
|
|
50
|
-
### `
|
|
51
|
-
|
|
52
|
-
Create or update a document in the knowledge graph.
|
|
53
|
-
|
|
54
|
-
**Parameters:**
|
|
55
|
-
- `title` (string, required): Document title
|
|
56
|
-
- `body` (string, required): Document content
|
|
57
|
-
- `doc_type` (enum, required): `note` | `doc` | `task` | `plan` | `agent_session`
|
|
58
|
-
- `id` (string, optional): UUID to update existing doc
|
|
59
|
-
- `project_repo` (string, optional): Project repo (owner/repo)
|
|
60
|
-
- `tags` (string[], optional): Tags for categorization
|
|
61
|
-
- `status` (enum, optional): `pending` | `in_progress` | `done` | `blocked` (for tasks)
|
|
62
|
-
- `parent_id` (string, optional): Parent document ID for hierarchy
|
|
63
|
-
|
|
64
|
-
### `kg_get_doc`
|
|
65
|
-
|
|
66
|
-
Get full document by ID.
|
|
67
|
-
|
|
68
|
-
**Parameters:**
|
|
69
|
-
- `id` (string, required): Document UUID
|
|
70
|
-
|
|
71
|
-
### `kg_delete_doc`
|
|
72
|
-
|
|
73
|
-
Delete a document from the knowledge graph.
|
|
74
|
-
|
|
75
|
-
**Parameters:**
|
|
76
|
-
- `id` (string, required): Document UUID to delete
|
|
77
|
-
|
|
78
|
-
### `kg_search`
|
|
79
|
-
|
|
80
|
-
Search documents with filters.
|
|
81
|
-
|
|
82
|
-
**Parameters:**
|
|
83
|
-
- `q` (string, optional): Search query
|
|
84
|
-
- `doc_type` (enum, optional): Filter by document type
|
|
85
|
-
- `project_repo` (string, optional): Filter by project repo
|
|
86
|
-
- `status` (enum, optional): Filter by task status
|
|
87
|
-
- `tag` (string, optional): Filter by tag
|
|
88
|
-
- `limit` (number, optional): Max results (1-100, default: 20)
|
|
89
|
-
- `offset` (number, optional): Pagination offset (default: 0)
|
|
90
|
-
|
|
91
|
-
### `kg_semantic_search`
|
|
92
|
-
|
|
93
|
-
Semantic search using embeddings.
|
|
94
|
-
|
|
95
|
-
**Parameters:**
|
|
96
|
-
- `q` (string, required): Search query
|
|
97
|
-
- `embedding_keywords` (string[], optional): Keywords for embedding search
|
|
98
|
-
- `doc_type` (enum, optional): Filter by document type
|
|
99
|
-
- `project_repo` (string, optional): Filter by project repo
|
|
100
|
-
- `tag` (string, optional): Filter by tag
|
|
101
|
-
- `limit` (number, optional): Max results (1-20, default: 5)
|
|
102
|
-
|
|
103
|
-
### `kg_status`
|
|
104
|
-
|
|
105
|
-
Get document statistics: total count, breakdown by type and repo.
|
|
106
|
-
|
|
107
|
-
**Parameters:** None
|
|
108
|
-
|
|
109
|
-
## Document Types
|
|
110
|
-
|
|
111
|
-
| Type | Use Case |
|
|
112
|
-
|------|----------|
|
|
113
|
-
| `note` | Session-specific learnings, debugging discoveries (ephemeral) |
|
|
114
|
-
| `doc` | Curated reference docs meant to be maintained (stable) |
|
|
115
|
-
| `task` | Actionable items with status tracking |
|
|
116
|
-
| `plan` | Multi-step roadmaps with phases |
|
|
117
|
-
| `agent_session` | Chat session logs |
|
|
118
|
-
|
|
119
|
-
## Tmux Tools
|
|
120
|
-
|
|
121
|
-
### `tmux_list_panes`
|
|
122
|
-
|
|
123
|
-
List all tmux panes.
|
|
124
|
-
|
|
125
|
-
**Parameters:** None
|
|
126
|
-
|
|
127
|
-
### `tmux_send`
|
|
128
|
-
|
|
129
|
-
Send keys to a tmux pane.
|
|
130
|
-
|
|
131
|
-
**Parameters:**
|
|
132
|
-
- `pane` (string, optional): Target pane ID. Defaults to `PI_MASTER_PANE` env if set
|
|
133
|
-
- `keys` (string, required): Keys to send
|
|
134
|
-
- `enter` (boolean, optional): Send Enter after (default: true)
|
|
135
|
-
|
|
136
|
-
### `tmux_kill_pane`
|
|
137
|
-
|
|
138
|
-
Kill a tmux pane by ID.
|
|
139
|
-
|
|
140
|
-
**Parameters:**
|
|
141
|
-
- `pane` (string, required): Pane ID in `%N` format (e.g., `%886`)
|
|
142
|
-
|
|
143
|
-
### `tmux_capture`
|
|
144
|
-
|
|
145
|
-
Capture the content of a tmux pane.
|
|
146
|
-
|
|
147
|
-
**Parameters:**
|
|
148
|
-
- `pane` (string, required): Target pane ID to capture
|
|
149
|
-
- `lines` (number, optional): Number of lines to capture from end (default: 10)
|
|
150
|
-
- `filter` (string, optional): Grep pattern (case-insensitive, extended regex)
|
|
151
|
-
|
|
152
|
-
### `tmux_run`
|
|
38
|
+
### `grep_fast`
|
|
153
39
|
|
|
154
|
-
|
|
40
|
+
Fast semantic codebase search. It first narrows files by `keywords` and `filePatterns`, then runs `sgrep` on the filtered set.
|
|
155
41
|
|
|
156
42
|
**Parameters:**
|
|
157
|
-
- `
|
|
158
|
-
- `
|
|
159
|
-
- `
|
|
43
|
+
- `cwd` (string, required): Working directory to search in
|
|
44
|
+
- `keywords` (string[], required): Specific grep patterns such as `"login|signin"`
|
|
45
|
+
- `filePatterns` (string[], required): Specific filename globs such as `"*auth*"`
|
|
46
|
+
- `semanticQuery` (string, required): Natural-language query for semantic search
|
|
160
47
|
|
|
161
48
|
## Development
|
|
162
49
|
|
|
@@ -187,8 +74,8 @@ The [MCP Inspector](https://modelcontextprotocol.io/docs/tools/inspector) is a b
|
|
|
187
74
|
# Using the package script (recommended)
|
|
188
75
|
pnpm inspect
|
|
189
76
|
|
|
190
|
-
# Or manually
|
|
191
|
-
pnpm dlx @modelcontextprotocol/inspector
|
|
77
|
+
# Or manually
|
|
78
|
+
pnpm dlx @modelcontextprotocol/inspector node dist/index.js
|
|
192
79
|
|
|
193
80
|
# Debug in watch mode (rebuild first, then run inspector)
|
|
194
81
|
pnpm build && npx @modelcontextprotocol/inspector node dist/index.js
|
|
@@ -226,7 +113,7 @@ pnpm dlx @modelcontextprotocol/inspector --cli node dist/index.js
|
|
|
226
113
|
- **Check tool schemas**: Use the Tools tab to verify parameter types and descriptions
|
|
227
114
|
- **Test edge cases**: Try empty inputs, invalid types, missing required fields
|
|
228
115
|
- **Monitor errors**: Watch the Notifications pane for server-side errors
|
|
229
|
-
- **Verify
|
|
116
|
+
- **Verify search flow**: Test `grep_fast` with a small repository and focused keywords first
|
|
230
117
|
|
|
231
118
|
## License
|
|
232
119
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoints - Branch-scoped task recording for agent context continuity
|
|
3
|
+
*
|
|
4
|
+
* Provides tools for recording and retrieving task checkpoints:
|
|
5
|
+
* - record_checkpoint: Append a task summary to branch-scoped JSONL
|
|
6
|
+
* - list_checkpoints: Query checkpoints by time, branch, or keywords
|
|
7
|
+
*
|
|
8
|
+
* Storage: `<repo-root>/.agents/checkpoints/<sanitized-branch>.jsonl`
|
|
9
|
+
*
|
|
10
|
+
* Keywords: checkpoint, task-history, agent-memory, context-continuity
|
|
11
|
+
*/
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
14
|
+
export declare function countSentences(text: string): number;
|
|
15
|
+
export declare const SummarySchema: z.ZodString;
|
|
16
|
+
export declare function registerCheckpointTools(server: McpServer): void;
|
|
17
|
+
//# sourceMappingURL=checkpoints.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoints.d.ts","sourceRoot":"","sources":["../src/checkpoints.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMzE,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED,eAAO,MAAM,aAAa,aAM0B,CAAC;AA6KrD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAoM/D"}
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Checkpoints - Branch-scoped task recording for agent context continuity
|
|
3
|
+
*
|
|
4
|
+
* Provides tools for recording and retrieving task checkpoints:
|
|
5
|
+
* - record_checkpoint: Append a task summary to branch-scoped JSONL
|
|
6
|
+
* - list_checkpoints: Query checkpoints by time, branch, or keywords
|
|
7
|
+
*
|
|
8
|
+
* Storage: `<repo-root>/.agents/checkpoints/<sanitized-branch>.jsonl`
|
|
9
|
+
*
|
|
10
|
+
* Keywords: checkpoint, task-history, agent-memory, context-continuity
|
|
11
|
+
*/
|
|
12
|
+
import * as fs from "node:fs";
|
|
13
|
+
import * as path from "node:path";
|
|
14
|
+
import { execSync } from "node:child_process";
|
|
15
|
+
import { z } from "zod";
|
|
16
|
+
// ============================================================================
|
|
17
|
+
// Types
|
|
18
|
+
// ============================================================================
|
|
19
|
+
export function countSentences(text) {
|
|
20
|
+
const trimmed = text.trim();
|
|
21
|
+
if (!trimmed)
|
|
22
|
+
return 0;
|
|
23
|
+
const matches = trimmed.match(/[^.!?]+[.!?]+/g);
|
|
24
|
+
if (!matches)
|
|
25
|
+
return 1;
|
|
26
|
+
return matches.length;
|
|
27
|
+
}
|
|
28
|
+
export const SummarySchema = z
|
|
29
|
+
.string()
|
|
30
|
+
.refine((value) => {
|
|
31
|
+
const sentenceCount = countSentences(value);
|
|
32
|
+
return sentenceCount >= 2 && sentenceCount <= 4;
|
|
33
|
+
}, "Summary must contain 2-4 sentences.")
|
|
34
|
+
.describe("What was accomplished (2-4 sentences)");
|
|
35
|
+
const ReferenceSchema = z.object({
|
|
36
|
+
kind: z
|
|
37
|
+
.enum(["file", "doc", "url", "issue", "pr"])
|
|
38
|
+
.describe("Reference type"),
|
|
39
|
+
title: z.string().describe("Human-readable title"),
|
|
40
|
+
ref: z.string().describe("Path, URL, or identifier"),
|
|
41
|
+
});
|
|
42
|
+
const CheckpointSchema = z.object({
|
|
43
|
+
timestamp: z.string().describe("ISO 8601 timestamp"),
|
|
44
|
+
branch: z.string().describe("Git branch name or 'default'"),
|
|
45
|
+
task: z.string().describe("Short task description"),
|
|
46
|
+
summary: SummarySchema,
|
|
47
|
+
files: z.array(z.string()).optional().describe("Modified files"),
|
|
48
|
+
references: z
|
|
49
|
+
.array(ReferenceSchema)
|
|
50
|
+
.optional()
|
|
51
|
+
.describe("Referenced docs/files/URLs"),
|
|
52
|
+
tags: z.array(z.string()).optional().describe("Categorization tags"),
|
|
53
|
+
sessionId: z.string().optional().describe("Optional session identifier"),
|
|
54
|
+
note: z.string().optional().describe("Optional follow-up note"),
|
|
55
|
+
// Reserved for future git hook integration
|
|
56
|
+
commit: z
|
|
57
|
+
.object({
|
|
58
|
+
hash: z.string(),
|
|
59
|
+
message: z.string(),
|
|
60
|
+
})
|
|
61
|
+
.optional()
|
|
62
|
+
.describe("Git commit info (populated by hooks)"),
|
|
63
|
+
});
|
|
64
|
+
// ============================================================================
|
|
65
|
+
// Time Utilities
|
|
66
|
+
// ============================================================================
|
|
67
|
+
const RELATIVE_TIME_ALIASES = {
|
|
68
|
+
today: () => {
|
|
69
|
+
const d = new Date();
|
|
70
|
+
d.setHours(0, 0, 0, 0);
|
|
71
|
+
return d;
|
|
72
|
+
},
|
|
73
|
+
yesterday: () => {
|
|
74
|
+
const d = new Date();
|
|
75
|
+
d.setDate(d.getDate() - 1);
|
|
76
|
+
d.setHours(0, 0, 0, 0);
|
|
77
|
+
return d;
|
|
78
|
+
},
|
|
79
|
+
last_1h: () => new Date(Date.now() - 60 * 60 * 1000),
|
|
80
|
+
last_24h: () => new Date(Date.now() - 24 * 60 * 60 * 1000),
|
|
81
|
+
last_7d: () => new Date(Date.now() - 7 * 24 * 60 * 60 * 1000),
|
|
82
|
+
last_30d: () => new Date(Date.now() - 30 * 24 * 60 * 60 * 1000),
|
|
83
|
+
};
|
|
84
|
+
function parseRelativeTime(alias) {
|
|
85
|
+
const fn = RELATIVE_TIME_ALIASES[alias.toLowerCase()];
|
|
86
|
+
return fn ? fn() : null;
|
|
87
|
+
}
|
|
88
|
+
// ============================================================================
|
|
89
|
+
// Git Utilities
|
|
90
|
+
// ============================================================================
|
|
91
|
+
function getCurrentBranch(cwd) {
|
|
92
|
+
try {
|
|
93
|
+
const branch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
94
|
+
cwd,
|
|
95
|
+
encoding: "utf-8",
|
|
96
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
97
|
+
}).trim();
|
|
98
|
+
return branch || "default";
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
return "default";
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
function getGitRoot(cwd) {
|
|
105
|
+
try {
|
|
106
|
+
return execSync("git rev-parse --show-toplevel", {
|
|
107
|
+
cwd,
|
|
108
|
+
encoding: "utf-8",
|
|
109
|
+
stdio: ["pipe", "pipe", "pipe"],
|
|
110
|
+
}).trim();
|
|
111
|
+
}
|
|
112
|
+
catch {
|
|
113
|
+
return cwd;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function sanitizeBranchName(branch) {
|
|
117
|
+
// Replace slashes and special chars with underscores for safe filenames
|
|
118
|
+
return branch.replace(/[/\\:*?"<>|]/g, "_").replace(/_+/g, "_");
|
|
119
|
+
}
|
|
120
|
+
// ============================================================================
|
|
121
|
+
// Storage
|
|
122
|
+
// ============================================================================
|
|
123
|
+
function getCheckpointsDir(repoRoot) {
|
|
124
|
+
const dir = path.join(repoRoot, ".agents", "checkpoints");
|
|
125
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
126
|
+
return dir;
|
|
127
|
+
}
|
|
128
|
+
function getCheckpointFilePath(repoRoot, branch) {
|
|
129
|
+
const dir = getCheckpointsDir(repoRoot);
|
|
130
|
+
const safeName = sanitizeBranchName(branch);
|
|
131
|
+
return path.join(dir, `${safeName}.jsonl`);
|
|
132
|
+
}
|
|
133
|
+
function appendCheckpoint(repoRoot, branch, checkpoint) {
|
|
134
|
+
const filePath = getCheckpointFilePath(repoRoot, branch);
|
|
135
|
+
const line = JSON.stringify(checkpoint);
|
|
136
|
+
fs.appendFileSync(filePath, line + "\n", "utf-8");
|
|
137
|
+
return filePath;
|
|
138
|
+
}
|
|
139
|
+
function readCheckpoints(filePath) {
|
|
140
|
+
if (!fs.existsSync(filePath)) {
|
|
141
|
+
return [];
|
|
142
|
+
}
|
|
143
|
+
const content = fs.readFileSync(filePath, "utf-8");
|
|
144
|
+
const lines = content.trim().split("\n").filter(Boolean);
|
|
145
|
+
return lines.map((line) => JSON.parse(line));
|
|
146
|
+
}
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// Filtering
|
|
149
|
+
// ============================================================================
|
|
150
|
+
function filterByTime(checkpoints, since, until) {
|
|
151
|
+
return checkpoints.filter((cp) => {
|
|
152
|
+
const ts = new Date(cp.timestamp);
|
|
153
|
+
if (since && ts < since)
|
|
154
|
+
return false;
|
|
155
|
+
if (until && ts > until)
|
|
156
|
+
return false;
|
|
157
|
+
return true;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
function filterByQuery(checkpoints, query) {
|
|
161
|
+
const q = query.toLowerCase();
|
|
162
|
+
return checkpoints.filter((cp) => {
|
|
163
|
+
// Search in task, summary, tags
|
|
164
|
+
if (cp.task.toLowerCase().includes(q))
|
|
165
|
+
return true;
|
|
166
|
+
if (cp.summary.toLowerCase().includes(q))
|
|
167
|
+
return true;
|
|
168
|
+
if (cp.tags?.some((t) => t.toLowerCase().includes(q)))
|
|
169
|
+
return true;
|
|
170
|
+
// Search in references
|
|
171
|
+
if (cp.references?.some((r) => r.title.toLowerCase().includes(q) || r.ref.toLowerCase().includes(q))) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
return false;
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
// ============================================================================
|
|
178
|
+
// MCP Tool Registration
|
|
179
|
+
// ============================================================================
|
|
180
|
+
export function registerCheckpointTools(server) {
|
|
181
|
+
// Tool: record_checkpoint
|
|
182
|
+
server.registerTool("record_checkpoint", {
|
|
183
|
+
description: `Record a task checkpoint to a branch-scoped JSONL file.
|
|
184
|
+
|
|
185
|
+
Call this at the end of a task session to leave context for future sessions.
|
|
186
|
+
|
|
187
|
+
Parameters:
|
|
188
|
+
- task: Short task description (e.g., "implement login form")
|
|
189
|
+
- summary: What was accomplished (2-4 sentences)
|
|
190
|
+
- references: Optional array of {kind, title, ref} for docs/files/URLs consulted
|
|
191
|
+
- files: Optional array of modified file paths
|
|
192
|
+
- tags: Optional array of categorization tags
|
|
193
|
+
- note: Optional follow-up note`,
|
|
194
|
+
inputSchema: {
|
|
195
|
+
task: z.string().describe("Short task description"),
|
|
196
|
+
summary: SummarySchema,
|
|
197
|
+
references: z
|
|
198
|
+
.array(ReferenceSchema)
|
|
199
|
+
.optional()
|
|
200
|
+
.describe("Referenced docs/files/URLs"),
|
|
201
|
+
files: z.array(z.string()).optional().describe("Modified files"),
|
|
202
|
+
tags: z.array(z.string()).optional().describe("Categorization tags"),
|
|
203
|
+
sessionId: z.string().optional().describe("Session identifier"),
|
|
204
|
+
note: z.string().optional().describe("Follow-up note"),
|
|
205
|
+
timestamp: z
|
|
206
|
+
.string()
|
|
207
|
+
.optional()
|
|
208
|
+
.describe("Override timestamp (ISO 8601)"),
|
|
209
|
+
},
|
|
210
|
+
}, async (params) => {
|
|
211
|
+
const cwd = process.cwd();
|
|
212
|
+
const branch = getCurrentBranch(cwd);
|
|
213
|
+
const timestamp = params.timestamp ?? new Date().toISOString();
|
|
214
|
+
const checkpoint = {
|
|
215
|
+
timestamp,
|
|
216
|
+
branch,
|
|
217
|
+
task: params.task,
|
|
218
|
+
summary: params.summary,
|
|
219
|
+
files: params.files,
|
|
220
|
+
references: params.references,
|
|
221
|
+
tags: params.tags,
|
|
222
|
+
sessionId: params.sessionId,
|
|
223
|
+
note: params.note,
|
|
224
|
+
};
|
|
225
|
+
try {
|
|
226
|
+
const filePath = appendCheckpoint(cwd, branch, checkpoint);
|
|
227
|
+
return {
|
|
228
|
+
content: [
|
|
229
|
+
{
|
|
230
|
+
type: "text",
|
|
231
|
+
text: `Checkpoint recorded.\n- Branch: ${branch}\n- File: ${filePath}\n- Timestamp: ${timestamp}`,
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
238
|
+
return {
|
|
239
|
+
content: [
|
|
240
|
+
{ type: "text", text: `Failed to record checkpoint: ${msg}` },
|
|
241
|
+
],
|
|
242
|
+
isError: true,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
// Tool: list_checkpoints
|
|
247
|
+
server.registerTool("list_checkpoints", {
|
|
248
|
+
description: `List checkpoints from branch-scoped JSONL files.
|
|
249
|
+
|
|
250
|
+
Supports time filtering via ISO dates or natural aliases:
|
|
251
|
+
- relativeTime: "today", "yesterday", "last_1h", "last_24h", "last_7d", "last_30d"
|
|
252
|
+
- since/until: ISO 8601 dates for precise range
|
|
253
|
+
|
|
254
|
+
Query searches in task, summary, tags, and reference titles/refs.
|
|
255
|
+
|
|
256
|
+
Parameters:
|
|
257
|
+
- cwd: Repository root directory (optional; defaults to current git root)
|
|
258
|
+
- branch: Target branch (defaults to current branch)
|
|
259
|
+
- query: Optional keyword filter
|
|
260
|
+
- since/until: ISO 8601 time range, recommend to use relativeTime.
|
|
261
|
+
- relativeTime: Natural time alias
|
|
262
|
+
- limit: Max results (default 5)`,
|
|
263
|
+
inputSchema: {
|
|
264
|
+
cwd: z
|
|
265
|
+
.string()
|
|
266
|
+
.optional()
|
|
267
|
+
.describe("Repository root directory (default: current git root)"),
|
|
268
|
+
branch: z
|
|
269
|
+
.string()
|
|
270
|
+
.optional()
|
|
271
|
+
.describe("Target branch (default: current)"),
|
|
272
|
+
query: z.string().optional().describe("Keyword filter"),
|
|
273
|
+
since: z.string().optional().describe("Start time (ISO 8601)"),
|
|
274
|
+
until: z.string().optional().describe("End time (ISO 8601)"),
|
|
275
|
+
relativeTime: z
|
|
276
|
+
.enum([
|
|
277
|
+
"today",
|
|
278
|
+
"yesterday",
|
|
279
|
+
"last_1h",
|
|
280
|
+
"last_24h",
|
|
281
|
+
"last_7d",
|
|
282
|
+
"last_30d",
|
|
283
|
+
])
|
|
284
|
+
.optional()
|
|
285
|
+
.describe("Recommend: Natural time alias"),
|
|
286
|
+
limit: z
|
|
287
|
+
.number()
|
|
288
|
+
.min(1)
|
|
289
|
+
.max(100)
|
|
290
|
+
.optional()
|
|
291
|
+
.describe("Max results (default 5)"),
|
|
292
|
+
},
|
|
293
|
+
}, async (params) => {
|
|
294
|
+
const cwd = params.cwd ?? getGitRoot(process.cwd());
|
|
295
|
+
const branch = params.branch ?? getCurrentBranch(cwd);
|
|
296
|
+
const filePath = getCheckpointFilePath(cwd, branch);
|
|
297
|
+
let checkpoints = readCheckpoints(filePath);
|
|
298
|
+
// Time filtering
|
|
299
|
+
let since;
|
|
300
|
+
let until;
|
|
301
|
+
if (params.relativeTime) {
|
|
302
|
+
since = parseRelativeTime(params.relativeTime) ?? undefined;
|
|
303
|
+
}
|
|
304
|
+
if (params.since) {
|
|
305
|
+
since = new Date(params.since);
|
|
306
|
+
}
|
|
307
|
+
if (params.until) {
|
|
308
|
+
until = new Date(params.until);
|
|
309
|
+
}
|
|
310
|
+
if (since || until) {
|
|
311
|
+
checkpoints = filterByTime(checkpoints, since, until);
|
|
312
|
+
}
|
|
313
|
+
// Query filtering
|
|
314
|
+
if (params.query) {
|
|
315
|
+
checkpoints = filterByQuery(checkpoints, params.query);
|
|
316
|
+
}
|
|
317
|
+
// Limit and sort (newest first)
|
|
318
|
+
const limit = params.limit ?? 10;
|
|
319
|
+
checkpoints = checkpoints.reverse().slice(0, limit);
|
|
320
|
+
if (checkpoints.length === 0) {
|
|
321
|
+
return {
|
|
322
|
+
content: [
|
|
323
|
+
{
|
|
324
|
+
type: "text",
|
|
325
|
+
text: `No checkpoints found for branch "${branch}".`,
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
// Format output
|
|
331
|
+
const lines = [`## Checkpoints (${branch})\n`];
|
|
332
|
+
for (const cp of checkpoints) {
|
|
333
|
+
lines.push(`### ${cp.timestamp}`);
|
|
334
|
+
lines.push(`**Task**: ${cp.task}`);
|
|
335
|
+
lines.push(`**Summary**: ${cp.summary}`);
|
|
336
|
+
if (cp.files?.length) {
|
|
337
|
+
lines.push(`**Files**: ${cp.files.join(", ")}`);
|
|
338
|
+
}
|
|
339
|
+
if (cp.references?.length) {
|
|
340
|
+
lines.push(`**References**:`);
|
|
341
|
+
for (const ref of cp.references) {
|
|
342
|
+
lines.push(` - [${ref.kind}] ${ref.title}: ${ref.ref}`);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (cp.tags?.length) {
|
|
346
|
+
lines.push(`**Tags**: ${cp.tags.join(", ")}`);
|
|
347
|
+
}
|
|
348
|
+
if (cp.note) {
|
|
349
|
+
lines.push(`**Note**: ${cp.note}`);
|
|
350
|
+
}
|
|
351
|
+
lines.push("");
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
content: [{ type: "text", text: lines.join("\n") }],
|
|
355
|
+
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