Skip to content

Commit 59ae3e0

Browse files
committed
Merge branch 'main' into lamemind/main - resolved conflicts in src/filesystem/index.ts
2 parents 3c23c03 + 46d0b1f commit 59ae3e0

16 files changed

Lines changed: 1559 additions & 498 deletions

File tree

.github/workflows/claude.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Claude Code
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
actions: read
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
with:
31+
fetch-depth: 1
32+
33+
- name: Run Claude Code
34+
id: claude
35+
uses: anthropics/claude-code-action@beta
36+
with:
37+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
38+
39+
# Allow Claude to read CI results on PRs
40+
additional_permissions: |
41+
actions: read
42+
43+
# Trigger when assigned to an issue
44+
assignee_trigger: "claude"
45+
46+
# Allow Claude to run bash
47+
# This should be safe given the repo is already public
48+
allowed_tools: "Bash"
49+
50+
custom_instructions: |
51+
If posting a comment to GitHub, give a concise summary of the comment at the top and put all the details in a <details> block.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Anthropic, PBC
3+
Copyright (c) 2025 Anthropic, PBC
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 155 additions & 47 deletions
Large diffs are not rendered by default.

package-lock.json

Lines changed: 5 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/everything/everything.ts

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -169,16 +169,6 @@ export const createServer = () => {
169169
let subsUpdateInterval: NodeJS.Timeout | undefined;
170170
let stdErrUpdateInterval: NodeJS.Timeout | undefined;
171171

172-
// Set up update interval for subscribed resources
173-
subsUpdateInterval = setInterval(() => {
174-
for (const uri of subscriptions) {
175-
server.notification({
176-
method: "notifications/resources/updated",
177-
params: { uri },
178-
});
179-
}
180-
}, 10000);
181-
182172
let logLevel: LoggingLevel = "debug";
183173
let logsUpdateInterval: NodeJS.Timeout | undefined;
184174
const messages = [
@@ -198,15 +188,30 @@ export const createServer = () => {
198188
return messageLevel < currentLevel;
199189
};
200190

201-
// Set up update interval for random log messages
202-
logsUpdateInterval = setInterval(() => {
203-
let message = {
204-
method: "notifications/message",
205-
params: messages[Math.floor(Math.random() * messages.length)],
206-
};
207-
if (!isMessageIgnored(message.params.level as LoggingLevel))
208-
server.notification(message);
209-
}, 20000);
191+
// Function to start notification intervals when a client connects
192+
const startNotificationIntervals = () => {
193+
if (!subsUpdateInterval) {
194+
subsUpdateInterval = setInterval(() => {
195+
for (const uri of subscriptions) {
196+
server.notification({
197+
method: "notifications/resources/updated",
198+
params: { uri },
199+
});
200+
}
201+
}, 10000);
202+
}
203+
204+
if (!logsUpdateInterval) {
205+
logsUpdateInterval = setInterval(() => {
206+
let message = {
207+
method: "notifications/message",
208+
params: messages[Math.floor(Math.random() * messages.length)],
209+
};
210+
if (!isMessageIgnored(message.params.level as LoggingLevel))
211+
server.notification(message);
212+
}, 20000);
213+
}
214+
};
210215

211216

212217

@@ -874,7 +879,7 @@ export const createServer = () => {
874879
if (stdErrUpdateInterval) clearInterval(stdErrUpdateInterval);
875880
};
876881

877-
return { server, cleanup };
882+
return { server, cleanup, startNotificationIntervals };
878883
};
879884

880885
const MCP_TINY_IMAGE =

src/everything/sse.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const transports: Map<string, SSEServerTransport> = new Map<string, SSEServerTra
1010

1111
app.get("/sse", async (req, res) => {
1212
let transport: SSEServerTransport;
13-
const { server, cleanup } = createServer();
13+
const { server, cleanup, startNotificationIntervals } = createServer();
1414

1515
if (req?.query?.sessionId) {
1616
const sessionId = (req?.query?.sessionId as string);
@@ -25,6 +25,9 @@ app.get("/sse", async (req, res) => {
2525
await server.connect(transport);
2626
console.error("Client Connected: ", transport.sessionId);
2727

28+
// Start notification intervals after client connects
29+
startNotificationIntervals();
30+
2831
// Handle close of connection
2932
server.onclose = async () => {
3033
console.error("Client Disconnected: ", transport.sessionId);

src/filesystem/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ The server's directory access control follows this flow:
6464

6565
## API
6666

67-
### Resources
68-
69-
- `file://system`: File system operations interface
70-
7167
### Tools
7268

7369
- **read_text_file**
@@ -77,6 +73,7 @@ The server's directory access control follows this flow:
7773
- `head` (number, optional): First N lines
7874
- `tail` (number, optional): Last N lines
7975
- Always treats the file as UTF-8 text regardless of extension
76+
- Cannot specify both `head` and `tail` simultaneously
8077

8178
- **read_media_file**
8279
- Read an image or audio file
@@ -123,6 +120,23 @@ The server's directory access control follows this flow:
123120
- List directory contents with [FILE] or [DIR] prefixes
124121
- Input: `path` (string)
125122

123+
- **list_directory_with_sizes**
124+
- List directory contents with [FILE] or [DIR] prefixes, including file sizes
125+
- Inputs:
126+
- `path` (string): Directory path to list
127+
- `sortBy` (string, optional): Sort entries by "name" or "size" (default: "name")
128+
- Returns detailed listing with file sizes and summary statistics
129+
- Shows total files, directories, and combined size
130+
131+
- **directory_tree**
132+
- Get a recursive tree view of files and directories as a JSON structure
133+
- Input: `path` (string): Starting directory path
134+
- Returns JSON structure with:
135+
- `name`: File/directory name
136+
- `type`: "file" or "directory"
137+
- `children`: Array of child entries (for directories only)
138+
- Output is formatted with 2-space indentation for readability
139+
126140
- **move_file**
127141
- Move or rename files and directories
128142
- Inputs:

0 commit comments

Comments
 (0)