Commit cf883ae
committed
fix: add edge runtime compatibility for Cloudflare Workers
Make the SDK compatible with edge runtimes (Cloudflare Workers, Vercel Edge,
Deno Deploy) by gracefully handling missing Node.js APIs:
- Lazy-load fs module for context_line extraction in exceptions.ts
- Guard process.once signal handlers in eventQueue.ts
- Lazy-load fs/os/path modules in logging.ts with console fallback
- Guard process.cwd() calls which may not exist in edge environments
- Update mcpcat-api dependency to 0.1.6
Add comprehensive test suite for edge runtime compatibility scenarios.1 parent ac96b3c commit cf883ae
File tree
6 files changed
+474
-34
lines changed- src
- modules
- tests
6 files changed
+474
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
195 | 204 | | |
196 | 205 | | |
197 | 206 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
3 | 19 | | |
4 | 20 | | |
5 | 21 | | |
| |||
120 | 136 | | |
121 | 137 | | |
122 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
123 | 145 | | |
124 | | - | |
| 146 | + | |
125 | 147 | | |
126 | 148 | | |
127 | 149 | | |
| |||
635 | 657 | | |
636 | 658 | | |
637 | 659 | | |
638 | | - | |
639 | | - | |
640 | | - | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
641 | 672 | | |
642 | 673 | | |
643 | 674 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
11 | 36 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 37 | | |
16 | 38 | | |
17 | 39 | | |
18 | | - | |
19 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
20 | 48 | | |
21 | 49 | | |
22 | 50 | | |
23 | | - | |
24 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
25 | 55 | | |
26 | 56 | | |
27 | | - | |
28 | | - | |
| 57 | + | |
| 58 | + | |
29 | 59 | | |
30 | | - | |
| 60 | + | |
31 | 61 | | |
32 | 62 | | |
33 | 63 | | |
| |||
0 commit comments