Skip to content

Commit 877da91

Browse files
authored
Merge pull request #20 from mkreyman/fix/token-limit-enforcement
Fix token limit enforcement in context_get to prevent MCP protocol errors
2 parents d42ba7a + da0be05 commit 877da91

File tree

19 files changed

+1680
-1231
lines changed

19 files changed

+1680
-1231
lines changed

.claude/settings.local.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@
3131
],
3232
"deny": []
3333
}
34-
}
34+
}

.github/workflows/ci.yml

Lines changed: 71 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master, main, develop ]
5+
branches: [master, main, develop]
66
pull_request:
7-
branches: [ master, main ]
7+
branches: [master, main]
88

99
jobs:
1010
test:
@@ -15,84 +15,84 @@ jobs:
1515
node-version: [18.x, 20.x]
1616

1717
steps:
18-
- uses: actions/checkout@v3
19-
20-
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v3
22-
with:
23-
node-version: ${{ matrix.node-version }}
24-
cache: 'npm'
25-
26-
- name: Install dependencies
27-
run: npm ci
28-
29-
- name: Configure Git for tests
30-
run: |
31-
git config --global user.email "[email protected]"
32-
git config --global user.name "GitHub CI"
33-
34-
- name: Build project
35-
run: npm run build
36-
37-
- name: Run linter
38-
run: npm run lint
39-
40-
- name: Run tests
41-
run: npm test
42-
43-
- name: Upload coverage reports
44-
uses: codecov/codecov-action@v3
45-
with:
46-
file: ./coverage/lcov.info
47-
flags: unittests
48-
name: codecov-umbrella
49-
if: matrix.node-version == '20.x'
18+
- uses: actions/checkout@v3
19+
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v3
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
cache: 'npm'
25+
26+
- name: Install dependencies
27+
run: npm ci
28+
29+
- name: Configure Git for tests
30+
run: |
31+
git config --global user.email "[email protected]"
32+
git config --global user.name "GitHub CI"
33+
34+
- name: Build project
35+
run: npm run build
36+
37+
- name: Run linter
38+
run: npm run lint
39+
40+
- name: Run tests
41+
run: npm test
42+
43+
- name: Upload coverage reports
44+
uses: codecov/codecov-action@v3
45+
with:
46+
file: ./coverage/lcov.info
47+
flags: unittests
48+
name: codecov-umbrella
49+
if: matrix.node-version == '20.x'
5050

5151
build:
5252
runs-on: ubuntu-latest
5353
needs: test
5454

5555
steps:
56-
- uses: actions/checkout@v3
57-
58-
- name: Use Node.js
59-
uses: actions/setup-node@v3
60-
with:
61-
node-version: '20.x'
62-
cache: 'npm'
63-
64-
- name: Install dependencies
65-
run: npm ci
66-
67-
- name: Build
68-
run: npm run build
69-
70-
- name: Check TypeScript
71-
run: npm run type-check
56+
- uses: actions/checkout@v3
57+
58+
- name: Use Node.js
59+
uses: actions/setup-node@v3
60+
with:
61+
node-version: '20.x'
62+
cache: 'npm'
63+
64+
- name: Install dependencies
65+
run: npm ci
66+
67+
- name: Build
68+
run: npm run build
69+
70+
- name: Check TypeScript
71+
run: npm run type-check
7272

7373
publish:
7474
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && github.event_name == 'push'
7575
runs-on: ubuntu-latest
7676
needs: build
77-
77+
7878
steps:
79-
- uses: actions/checkout@v3
80-
81-
- name: Use Node.js
82-
uses: actions/setup-node@v3
83-
with:
84-
node-version: '20.x'
85-
cache: 'npm'
86-
registry-url: 'https://registry.npmjs.org'
87-
88-
- name: Install dependencies
89-
run: npm ci
90-
91-
- name: Build
92-
run: npm run build
93-
94-
- name: Publish to npm
95-
run: npm publish --access public
96-
env:
97-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
98-
continue-on-error: true
79+
- uses: actions/checkout@v3
80+
81+
- name: Use Node.js
82+
uses: actions/setup-node@v3
83+
with:
84+
node-version: '20.x'
85+
cache: 'npm'
86+
registry-url: 'https://registry.npmjs.org'
87+
88+
- name: Install dependencies
89+
run: npm ci
90+
91+
- name: Build
92+
run: npm run build
93+
94+
- name: Publish to npm
95+
run: npm publish --access public
96+
env:
97+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
98+
continue-on-error: true

.github/workflows/claude-code-review.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ jobs:
1717
# github.event.pull_request.user.login == 'external-contributor' ||
1818
# github.event.pull_request.user.login == 'new-developer' ||
1919
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20-
20+
2121
runs-on: ubuntu-latest
2222
permissions:
2323
contents: read
2424
pull-requests: read
2525
issues: read
2626
id-token: write
27-
27+
2828
steps:
2929
- name: Checkout repository
3030
uses: actions/checkout@v4
@@ -36,10 +36,10 @@ jobs:
3636
uses: anthropics/claude-code-action@beta
3737
with:
3838
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
39-
39+
4040
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
4141
# model: "claude-opus-4-20250514"
42-
42+
4343
# Direct prompt for automated review (no @claude mention needed)
4444
direct_prompt: |
4545
Please review this pull request and provide feedback on:
@@ -48,28 +48,27 @@ jobs:
4848
- Performance considerations
4949
- Security concerns
5050
- Test coverage
51-
51+
5252
Be constructive and helpful in your feedback.
53-
53+
5454
# Optional: Customize review based on file types
5555
# direct_prompt: |
5656
# Review this PR focusing on:
5757
# - For TypeScript files: Type safety and proper interface usage
5858
# - For API endpoints: Security, input validation, and error handling
5959
# - For React components: Performance, accessibility, and best practices
6060
# - For tests: Coverage, edge cases, and test quality
61-
61+
6262
# Optional: Different prompts for different authors
6363
# direct_prompt: |
64-
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
64+
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
6565
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
6666
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
67-
67+
6868
# Optional: Add specific tools for running tests or linting
6969
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
70-
70+
7171
# Optional: Skip review for certain conditions
7272
# if: |
7373
# !contains(github.event.pull_request.title, '[skip-review]') &&
7474
# !contains(github.event.pull_request.title, '[WIP]')
75-

.github/workflows/claude.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,26 +34,25 @@ jobs:
3434
uses: anthropics/claude-code-action@beta
3535
with:
3636
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37-
37+
3838
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
3939
# model: "claude-opus-4-20250514"
40-
40+
4141
# Optional: Customize the trigger phrase (default: @claude)
4242
# trigger_phrase: "/claude"
43-
43+
4444
# Optional: Trigger when specific user is assigned to an issue
4545
# assignee_trigger: "claude-bot"
46-
46+
4747
# Optional: Allow Claude to run specific commands
4848
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
49-
49+
5050
# Optional: Add custom instructions for Claude to customize its behavior for your project
5151
# custom_instructions: |
5252
# Follow our coding standards
5353
# Ensure all new code has tests
5454
# Use TypeScript for new files
55-
55+
5656
# Optional: Custom environment variables for Claude
5757
# claude_env: |
5858
# NODE_ENV: test
59-

.prettierrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
"useTabs": false,
88
"arrowParens": "avoid",
99
"endOfLine": "lf"
10-
}
10+
}

0 commit comments

Comments
 (0)