visus-mcp 0.6.1 → 0.6.2

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 (111) hide show
  1. package/.claude/settings.local.json +28 -1
  2. package/.mcpregistry_github_token +1 -1
  3. package/.mcpregistry_registry_token +1 -1
  4. package/CLAUDE.md +197 -0
  5. package/TROUBLESHOOT-COGNITO-AUTH-20260324-2029.md +415 -0
  6. package/TROUBLESHOOT-COGNITO-JWT-20260324.md +592 -0
  7. package/dist/browser/playwright-renderer.d.ts.map +1 -1
  8. package/dist/browser/playwright-renderer.js +71 -51
  9. package/dist/browser/playwright-renderer.js.map +1 -1
  10. package/dist/index.js +0 -0
  11. package/infrastructure/stack.ts +1 -0
  12. package/lambda-deploy/index.js +81512 -0
  13. package/lambda-deploy/index.js.map +7 -0
  14. package/lambda-package/browser/__mocks__/playwright-renderer.d.ts +25 -0
  15. package/lambda-package/browser/__mocks__/playwright-renderer.d.ts.map +1 -0
  16. package/lambda-package/browser/__mocks__/playwright-renderer.js +119 -0
  17. package/lambda-package/browser/__mocks__/playwright-renderer.js.map +1 -0
  18. package/lambda-package/browser/playwright-renderer.d.ts +40 -0
  19. package/lambda-package/browser/playwright-renderer.d.ts.map +1 -0
  20. package/lambda-package/browser/playwright-renderer.js +214 -0
  21. package/lambda-package/browser/playwright-renderer.js.map +1 -0
  22. package/lambda-package/browser/reader.d.ts +31 -0
  23. package/lambda-package/browser/reader.d.ts.map +1 -0
  24. package/lambda-package/browser/reader.js +98 -0
  25. package/lambda-package/browser/reader.js.map +1 -0
  26. package/lambda-package/index.d.ts +18 -0
  27. package/lambda-package/index.d.ts.map +1 -0
  28. package/lambda-package/index.js +238 -0
  29. package/lambda-package/index.js.map +1 -0
  30. package/lambda-package/lambda-handler.d.ts +28 -0
  31. package/lambda-package/lambda-handler.d.ts.map +1 -0
  32. package/lambda-package/lambda-handler.js +257 -0
  33. package/lambda-package/lambda-handler.js.map +1 -0
  34. package/lambda-package/package-lock.json +7435 -0
  35. package/lambda-package/package.json +74 -0
  36. package/lambda-package/runtime.d.ts +50 -0
  37. package/lambda-package/runtime.d.ts.map +1 -0
  38. package/lambda-package/runtime.js +86 -0
  39. package/lambda-package/runtime.js.map +1 -0
  40. package/lambda-package/sanitizer/elicit-runner.d.ts +48 -0
  41. package/lambda-package/sanitizer/elicit-runner.d.ts.map +1 -0
  42. package/lambda-package/sanitizer/elicit-runner.js +100 -0
  43. package/lambda-package/sanitizer/elicit-runner.js.map +1 -0
  44. package/lambda-package/sanitizer/framework-mapper.d.ts +24 -0
  45. package/lambda-package/sanitizer/framework-mapper.d.ts.map +1 -0
  46. package/lambda-package/sanitizer/framework-mapper.js +342 -0
  47. package/lambda-package/sanitizer/framework-mapper.js.map +1 -0
  48. package/lambda-package/sanitizer/hitl-gate.d.ts +69 -0
  49. package/lambda-package/sanitizer/hitl-gate.d.ts.map +1 -0
  50. package/lambda-package/sanitizer/hitl-gate.js +101 -0
  51. package/lambda-package/sanitizer/hitl-gate.js.map +1 -0
  52. package/lambda-package/sanitizer/index.d.ts +63 -0
  53. package/lambda-package/sanitizer/index.d.ts.map +1 -0
  54. package/lambda-package/sanitizer/index.js +105 -0
  55. package/lambda-package/sanitizer/index.js.map +1 -0
  56. package/lambda-package/sanitizer/injection-detector.d.ts +34 -0
  57. package/lambda-package/sanitizer/injection-detector.d.ts.map +1 -0
  58. package/lambda-package/sanitizer/injection-detector.js +89 -0
  59. package/lambda-package/sanitizer/injection-detector.js.map +1 -0
  60. package/lambda-package/sanitizer/patterns.d.ts +30 -0
  61. package/lambda-package/sanitizer/patterns.d.ts.map +1 -0
  62. package/lambda-package/sanitizer/patterns.js +372 -0
  63. package/lambda-package/sanitizer/patterns.js.map +1 -0
  64. package/lambda-package/sanitizer/pii-allowlist.d.ts +49 -0
  65. package/lambda-package/sanitizer/pii-allowlist.d.ts.map +1 -0
  66. package/lambda-package/sanitizer/pii-allowlist.js +231 -0
  67. package/lambda-package/sanitizer/pii-allowlist.js.map +1 -0
  68. package/lambda-package/sanitizer/pii-redactor.d.ts +41 -0
  69. package/lambda-package/sanitizer/pii-redactor.d.ts.map +1 -0
  70. package/lambda-package/sanitizer/pii-redactor.js +213 -0
  71. package/lambda-package/sanitizer/pii-redactor.js.map +1 -0
  72. package/lambda-package/sanitizer/severity-classifier.d.ts +33 -0
  73. package/lambda-package/sanitizer/severity-classifier.d.ts.map +1 -0
  74. package/lambda-package/sanitizer/severity-classifier.js +113 -0
  75. package/lambda-package/sanitizer/severity-classifier.js.map +1 -0
  76. package/lambda-package/sanitizer/threat-reporter.d.ts +66 -0
  77. package/lambda-package/sanitizer/threat-reporter.d.ts.map +1 -0
  78. package/lambda-package/sanitizer/threat-reporter.js +163 -0
  79. package/lambda-package/sanitizer/threat-reporter.js.map +1 -0
  80. package/lambda-package/tools/fetch-structured.d.ts +51 -0
  81. package/lambda-package/tools/fetch-structured.d.ts.map +1 -0
  82. package/lambda-package/tools/fetch-structured.js +237 -0
  83. package/lambda-package/tools/fetch-structured.js.map +1 -0
  84. package/lambda-package/tools/fetch.d.ts +49 -0
  85. package/lambda-package/tools/fetch.d.ts.map +1 -0
  86. package/lambda-package/tools/fetch.js +131 -0
  87. package/lambda-package/tools/fetch.js.map +1 -0
  88. package/lambda-package/tools/read.d.ts +51 -0
  89. package/lambda-package/tools/read.d.ts.map +1 -0
  90. package/lambda-package/tools/read.js +127 -0
  91. package/lambda-package/tools/read.js.map +1 -0
  92. package/lambda-package/tools/search.d.ts +45 -0
  93. package/lambda-package/tools/search.d.ts.map +1 -0
  94. package/lambda-package/tools/search.js +220 -0
  95. package/lambda-package/tools/search.js.map +1 -0
  96. package/lambda-package/types.d.ts +167 -0
  97. package/lambda-package/types.d.ts.map +1 -0
  98. package/lambda-package/types.js +16 -0
  99. package/lambda-package/types.js.map +1 -0
  100. package/lambda-package/utils/format-converter.d.ts +39 -0
  101. package/lambda-package/utils/format-converter.d.ts.map +1 -0
  102. package/lambda-package/utils/format-converter.js +191 -0
  103. package/lambda-package/utils/format-converter.js.map +1 -0
  104. package/lambda-package/utils/truncate.d.ts +26 -0
  105. package/lambda-package/utils/truncate.d.ts.map +1 -0
  106. package/lambda-package/utils/truncate.js +54 -0
  107. package/lambda-package/utils/truncate.js.map +1 -0
  108. package/lambda.zip +0 -0
  109. package/package.json +3 -2
  110. package/server.json +3 -3
  111. package/src/browser/playwright-renderer.ts +74 -51
@@ -28,7 +28,34 @@
28
28
  "Bash(git remote:*)",
29
29
  "Bash(brew install:*)",
30
30
  "Bash(mcp-publisher:*)",
31
- "Bash(npm version:*)"
31
+ "Bash(npm version:*)",
32
+ "Bash(aws lambda get-function:*)",
33
+ "Bash(pkill:*)",
34
+ "Bash(docker info:*)",
35
+ "Bash(npx esbuild:*)",
36
+ "Bash(./node_modules/.bin/esbuild:*)",
37
+ "Bash(node_modules/.bin/esbuild:*)",
38
+ "Bash(zip:*)",
39
+ "Bash(aws lambda update-function-code:*)",
40
+ "Bash(aws lambda get-function-configuration:*)",
41
+ "Bash(aws sts get-caller-identity:*)",
42
+ "Bash(aws cognito-idp list-users:*)",
43
+ "Bash(aws cognito-idp admin-create-user:*)",
44
+ "Bash(aws cognito-idp admin-set-user-password:*)",
45
+ "Bash(aws cognito-idp initiate-auth:*)",
46
+ "Bash(TOKEN=\"eyJraWQiOiJ1eGNRZmJWbWx4WFBaSzdwYisxck5mcmxaaXBHZE5Wekw0WWFmMis5c25ZPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI3NDA4OTRjOC01MDYxLTcwOGMtMzkwYy1mMmIxMmRkOGY4MDciLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfOFVLQU9EQWZxIiwiY29nbml0bzp1c2VybmFtZSI6Ijc0MDg5NGM4LTUwNjEtNzA4Yy0zOTBjLWYyYjEyZGQ4ZjgwNyIsIm9yaWdpbl9qdGkiOiJmM2Y2ZjRhNi1lYWE2LTQ1NGMtYjFhMC0xYzY3MzgyNzYyOGMiLCJhdWQiOiIzam9yMTNhdXJjNThybHY4bDZjYW5iN29ldSIsImV2ZW50X2lkIjoiNWYzMWU5YjAtZmIxOS00NWE2LTkxNzEtNWYxYjQyZjcwZjdiIiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE3NzQzNTE4MzcsImV4cCI6MTc3NDM1NTQzNywiaWF0IjoxNzc0MzUxODM3LCJqdGkiOiI5ZmYwMzlhMi1hOGVkLTQ3ZWQtYjNiZS1jM2Q1NmU1MGEwM2MiLCJlbWFpbCI6InRlc3QtdXNlckBsYXRlb3MuYWkifQ.XxRcRpHWHNht0aVJMr2MJbDVS1fGBH0YchOjaxaYYBJFbptSRf_J_GT2q1EJLAFm9Ey1FlJvQF_oBpOKRd37DiYwbJZxltmAtlF-7hfiNQwfHnZ6T7oFERQx353RyZL3DHrHE2s6BbDFkJb69xwjuzn4ijMVrsZ_ny3qxHC02Fr37oumwbP_cfey3wjjjmONedUQwX6o0ajUK_Aafk20O-tWFDDUDk1Ua_TdPct0wOztYHcGhxE1Yo_g_mykwKLtI-ZSWiBaGj-GTGidgQ_RCJPKrQPK73xQAePvJMkB6SKlJg5tfnvnB1S_Hnsyg1bR3laZg1M-bP_3eTRAl6le5g\")",
47
+ "Bash(aws apigateway:*)",
48
+ "Bash(aws logs describe-log-groups:*)",
49
+ "Bash(python3:*)",
50
+ "Bash(echo:*)",
51
+ "Bash(ID_TOKEN=\"eyJraWQiOiJ1eGNRZmJWbWx4WFBaSzdwYisxck5mcmxaaXBHZE5Wekw0WWFmMis5c25ZPSIsImFsZyI6IlJTMjU2In0.eyJzdWIiOiI3NDA4OTRjOC01MDYxLTcwOGMtMzkwYy1mMmIxMmRkOGY4MDciLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiaXNzIjoiaHR0cHM6XC9cL2NvZ25pdG8taWRwLnVzLWVhc3QtMS5hbWF6b25hd3MuY29tXC91cy1lYXN0LTFfOFVLQU9EQWZxIiwiY29nbml0bzp1c2VybmFtZSI6Ijc0MDg5NGM4LTUwNjEtNzA4Yy0zOTBjLWYyYjEyZGQ4ZjgwNyIsIm9yaWdpbl9qdGkiOiIyMTY0OTkyMy1lMDcwLTRjMWQtYjFmYy1jZjZlODM2Y2E1OTIiLCJhdWQiOiIzam9yMTNhdXJjNThybHY4bDZjYW5iN29ldSIsImV2ZW50X2lkIjoiM2MxNzIwZjgtMTljMS00Y2MxLWI2MDctYWI5NzlmOTIzZGU1IiwidG9rZW5fdXNlIjoiaWQiLCJhdXRoX3RpbWUiOjE3NzQzNTIyNjMsImV4cCI6MTc3NDM1NTg2MywiaWF0IjoxNzc0MzUyMjYzLCJqdGkiOiIyY2Y3MWMwYi1hNzkwLTQzMjItYjQzZC1jZDRjNzIxZjdjZmIiLCJlbWFpbCI6InRlc3QtdXNlckBsYXRlb3MuYWkifQ.ljsffJWON0SykNe00nf1P1X0gtOLd4ccR4EmhRVFucOFulyEpB5Uyjbt3npuTah6liU2ZBTSWjKkdS0olRGFlLipzUMqDPqzINwwjkOMVQK5bf0l3f31FfdeQ_lKiYHKXbEDWJH8TRIvVy3OSl8I5UALn2swXyaWnLOO2mM6gcfYTr7Gt0JhfDohhKnvbr6kbGfCXu8kvp-uPGD4bKc7blmqwwKjaKQ49BukfhF_aC6fuiqsVydbYTO_fWbxTWITD39ULszaNbrGSBr0Q8ljWHC-t3qB9xlbXGOA3wbY13OaIc4P1kvzvQn6atP1FzZ5TSUb-DuDrS2lkGI-jnWjEA\")",
52
+ "Bash(/tmp/token.txt)",
53
+ "Bash(chmod:*)",
54
+ "Bash(/tmp/test-auth.sh)",
55
+ "Bash(/tmp/test-google.sh:*)",
56
+ "Bash(git reset:*)",
57
+ "Bash(npx visus-mcp:*)",
58
+ "WebSearch"
32
59
  ],
33
60
  "deny": [],
34
61
  "ask": []
@@ -1 +1 @@
1
- ghu_YakoP6o2Kn2rIrjQolVJxC2crdmA7C11nxMd
1
+ ghu_9xbQ1SXXZ8bh3BmoTNB21qUfmu31cJ0ly3mc
@@ -1 +1 @@
1
- {"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzQzMDcyNjYsIm5iZiI6MTc3NDMwNjk2NiwiaWF0IjoxNzc0MzA2OTY2LCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6Imxlb2Nob25nIiwicGVybWlzc2lvbnMiOlt7ImFjdGlvbiI6InB1Ymxpc2giLCJyZXNvdXJjZSI6ImlvLmdpdGh1Yi5sZW9jaG9uZy8qIn1dfQ.j8RP6e7qqEN3AcQjIzS1WwdIXedtvIL_0a2-8FeZP179JXXr1sWp6YAIT7KZYNCudsGaFhhbuMHkKuRuLjDdDQ","expires_at":1774307266}
1
+ {"token":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJtY3AtcmVnaXN0cnkiLCJleHAiOjE3NzQzMDc2MzIsIm5iZiI6MTc3NDMwNzMzMiwiaWF0IjoxNzc0MzA3MzMyLCJhdXRoX21ldGhvZCI6ImdpdGh1Yi1hdCIsImF1dGhfbWV0aG9kX3N1YiI6Imxlb2Nob25nIiwicGVybWlzc2lvbnMiOlt7ImFjdGlvbiI6InB1Ymxpc2giLCJyZXNvdXJjZSI6ImlvLmdpdGh1Yi5sZW9jaG9uZy8qIn0seyJhY3Rpb24iOiJwdWJsaXNoIiwicmVzb3VyY2UiOiJpby5naXRodWIudmlzdXMtbWNwLyoifV19.qXNypXv1OF_l3ob4Kju46rvn-vs4s5x3JIU2ZH7jJiaBV5gy0sX60NJSKM9ybJvcXggnW9_Mp1L-JeZDPVd5BQ","expires_at":1774307632}
package/CLAUDE.md CHANGED
@@ -71,6 +71,9 @@ npm publish --dry-run # Validate package before publishing
71
71
  npx visus-mcp # Start MCP server
72
72
  ```
73
73
 
74
+ **IMPORTANT: On every npm release, keep `server.json` version in sync with `package.json` version.**
75
+ The MCP registry requires that the version field in `server.json` matches the published npm package version.
76
+
74
77
  ## Coding Standards (Lateos Conventions)
75
78
 
76
79
  - **TypeScript strict mode** - No `any` types allowed
@@ -103,6 +106,8 @@ All tests must pass before Phase 1 is complete.
103
106
  - 43 injection payloads (one per pattern category)
104
107
  - 10 clean pages/content samples (should produce no detections)
105
108
 
109
+ ---
110
+
106
111
  ## Standard Troubleshooting Protocol
107
112
 
108
113
  Whenever you encounter an error, blocked deployment, or multi-step recovery task, you MUST generate a structured troubleshooting log automatically. This is not optional — it applies to every build, fix, and diagnostic task in this project.
@@ -118,6 +123,62 @@ Save to project root. Examples:
118
123
  - `TROUBLESHOOT-LAMBDA-20260314-0900.md`
119
124
  - `TROUBLESHOOT-SLIM-20260314-0629.md`
120
125
 
126
+ ### Log Structure
127
+
128
+ Every troubleshooting log MUST follow this three-phase structure:
129
+
130
+ #### Phase 1: Investigation (read-only)
131
+ No changes to code or infrastructure. Gather facts, reproduce the error, read logs.
132
+ Only advance to Phase 2 after root cause is confirmed or a clear hypothesis is formed.
133
+
134
+ #### Phase 2: Fix Plan
135
+ Write out the proposed fix and alternatives considered. Do NOT execute yet.
136
+ If root cause shifts during Phase 2, return to Phase 1.
137
+
138
+ #### Phase 3: Execution
139
+ Implement the fix. Log every action. Update the SUMMARY at the end.
140
+
141
+ ---
142
+
143
+ ### Stop Conditions (mandatory — check before every action)
144
+
145
+ If any of the following are true, **STOP immediately**, log the blocker, and wait for user input:
146
+
147
+ | Condition | Action |
148
+ |-----------|--------|
149
+ | Deployment or build hangs >10 minutes | Kill process, document, ask user for direction |
150
+ | Same error appears >2 times in a row | Stop retrying, propose alternative approach |
151
+ | Root cause shifts away from original task | Re-confirm scope with user before continuing |
152
+ | A tool or service is unavailable (Docker, AWS, etc.) | Document and present options — do not loop |
153
+ | Success criteria cannot be verified | Stop and ask user how to validate |
154
+
155
+ ---
156
+
157
+ ### Environment Pre-flight
158
+
159
+ Run this checklist before ANY deployment or infrastructure task. Log each result.
160
+
161
+ ```bash
162
+ # AWS credentials
163
+ aws sts get-caller-identity
164
+
165
+ # Docker health (required for CDK bundling)
166
+ docker info
167
+
168
+ # Disk space (ENOSPC will cause silent failures)
169
+ df -h /
170
+
171
+ # CDK version
172
+ npx cdk --version
173
+
174
+ # Node/npm
175
+ node --version && npm --version
176
+ ```
177
+
178
+ If Docker is unavailable or disk space is low, use the manual Lambda deploy path (see Lambda Deployment below) rather than attempting CDK.
179
+
180
+ ---
181
+
121
182
  ### Entry Format (append after EVERY action)
122
183
 
123
184
  ```markdown
@@ -130,6 +191,24 @@ Save to project root. Examples:
130
191
  **Status:** ✅ Success / ❌ Failed / ⚠️ Partial
131
192
  ```
132
193
 
194
+ ### Ruled Out (maintain throughout session)
195
+
196
+ Append to this section whenever a suspected cause is eliminated. Prevents re-investigation.
197
+
198
+ ```markdown
199
+ ## Ruled Out
200
+ - ❌ <Component>: <one-line reason> — confirmed <date/time>
201
+ ```
202
+
203
+ Example:
204
+ ```markdown
205
+ ## Ruled Out
206
+ - ❌ Cognito JWT: Auth correctly returns 401 on unauthenticated requests — not the issue
207
+ - ❌ API Gateway routing: Routes confirmed correct in stack outputs — not the issue
208
+ ```
209
+
210
+ ---
211
+
133
212
  ### Rules
134
213
 
135
214
  1. **Log BEFORE executing, not after** — write Goal and Reasoning first
@@ -137,6 +216,25 @@ Save to project root. Examples:
137
216
  3. **On failure:** log the full error, state your revised reasoning, attempt one alternative, log that too
138
217
  4. **Do not summarize or clean up errors** — paste raw output verbatim
139
218
  5. **End every log with a SUMMARY section:** root cause, resolution, lessons learned, and open issues
219
+ 6. **Populate "Ruled Out" in real time** — do not re-investigate eliminated causes
220
+ 7. **Complete Phase 1 fully before making any changes** — no exceptions
221
+
222
+ ---
223
+
224
+ ### CLAUDE.md Updates Required
225
+
226
+ At the end of every troubleshooting session, before closing, check whether any findings should be promoted to this file. Add a section to the troubleshoot doc:
227
+
228
+ ```markdown
229
+ ## CLAUDE.md Updates Required
230
+ - [ ] <Finding that should become a permanent convention>
231
+ - [ ] <New known error to add to the registry>
232
+ - [ ] <New deployment step or warning>
233
+ ```
234
+
235
+ Then apply those updates to CLAUDE.md as the final step of the session.
236
+
237
+ ---
140
238
 
141
239
  ### Purpose
142
240
 
@@ -152,6 +250,8 @@ Goal: Restore MCP handler Lambda with proper dependency packaging
152
250
 
153
251
  ---
154
252
 
253
+ ## Phase 1: Investigation
254
+
155
255
  ## [06:02:18] Step 1 - Locate MCP Handler Source
156
256
 
157
257
  **Goal:** Find the mcp_handler.py source file in the project
@@ -163,14 +263,109 @@ Goal: Restore MCP handler Lambda with proper dependency packaging
163
263
 
164
264
  ---
165
265
 
266
+ ## Ruled Out
267
+ - ❌ IAM permissions: Lambda execution role has correct policies — not the issue
268
+
269
+ ---
270
+
271
+ ## Phase 2: Fix Plan
272
+ ...
273
+
274
+ ## Phase 3: Execution
275
+ ...
276
+
277
+ ---
278
+
166
279
  # RECOVERY SUMMARY
167
280
 
168
281
  Final Status: ✅ RESTORED
169
282
  Root Cause: Lambda package missing runtime dependencies
170
283
  Resolution: Installed aws_lambda_powertools + aws_xray_sdk
171
284
  Lessons Learned: Always verify dependencies in Lambda packages
285
+
286
+ ## CLAUDE.md Updates Required
287
+ - [ ] Add aws_lambda_powertools to standard Lambda dependency checklist
288
+ ```
289
+
290
+ ---
291
+
292
+ ## Known Errors Registry
293
+
294
+ When a root cause is confirmed, add it here. Future sessions check this list first before investigating.
295
+
296
+ | Error | Root Cause | Fix | Date Confirmed |
297
+ |-------|-----------|-----|----------------|
298
+ | `ERR_MODULE_NOT_FOUND: @modelcontextprotocol/sdk` in Lambda | `index.js` (MCP stdio server) included in Lambda bundle via `package.json` `"main"` field; SDK not bundled | Add `@modelcontextprotocol/sdk` to `externalModules` in `infrastructure/stack.ts` | 2026-03-24 |
299
+ | CDK `docker buildx` hangs indefinitely | Docker resource contention or disk pressure on Apple Silicon Mac | Use manual Lambda deploy script (see below); fix Docker separately | 2026-03-24 |
300
+ | `ENOSPC` on Claude Code startup | Mac disk full; `~/.claude/debug/` write fails | Free disk space; `rm -rf ~/.claude/debug/`; restart | 2026-03-24 |
301
+ | 401 Unauthorized after `cdk deploy` | CDK does NOT automatically redeploy API Gateway stages when Lambda code or authorizer config changes | After every `cdk deploy`, run: `aws apigateway create-deployment --rest-api-id <api-id> --stage-name <stage>` | 2026-03-24 |
302
+ | `unable to get local issuer certificate` in Lambda | undici HTTP client in AWS Lambda Node.js 20 runtime lacks proper CA certificate configuration | Replace undici with Node.js native `fetch()` API (available in Node 18+) which has proper CA handling in Lambda | 2026-03-24 |
303
+
304
+ ---
305
+
306
+ ## Lambda Deployment
307
+
308
+ ### Bundling Conventions
309
+
310
+ **CRITICAL: Always use `--format=cjs` for Lambda bundles.**
311
+ AWS SDK v3 uses dynamic `require()` internally. ESM output from esbuild will fail at Lambda runtime with `ERR_REQUIRE_ESM` or similar. CommonJS is the correct format for all Lambda deployments.
312
+
313
+ **Always externalize these packages:**
314
+ - `playwright-core` — added via Lambda layer
315
+ - `@sparticuz/chromium` — added via Lambda layer
316
+ - `@modelcontextprotocol/sdk` — only needed for stdio mode, not Lambda
317
+
318
+ **Entry point must always be `src/lambda-handler.ts`, NOT `src/index.ts`.**
319
+ `index.ts` is the MCP stdio server and imports packages that must not be in the Lambda bundle.
320
+
321
+ ### Manual Deploy Script (use when CDK/Docker is unavailable)
322
+
323
+ ```bash
324
+ #!/bin/bash
325
+ # scripts/deploy-lambda.sh
326
+ # Use this when CDK Docker bundling is blocked
327
+
328
+ set -e
329
+
330
+ echo "Building Lambda bundle..."
331
+ npm run build
332
+
333
+ npx esbuild src/lambda-handler.ts \
334
+ --bundle \
335
+ --platform=node \
336
+ --target=node20 \
337
+ --format=cjs \
338
+ --outfile=dist/lambda-bundle.js \
339
+ --external:playwright-core \
340
+ --external:@sparticuz/chromium \
341
+ --external:@modelcontextprotocol/sdk \
342
+ --sourcemap
343
+
344
+ echo "Zipping..."
345
+ cd dist && zip -r ../lambda.zip lambda-bundle.js lambda-bundle.js.map && cd ..
346
+
347
+ echo "Getting function name..."
348
+ FUNCTION_NAME=$(aws cloudformation describe-stacks \
349
+ --stack-name VisusStack-dev \
350
+ --query "Stacks[0].Outputs[?OutputKey=='LambdaFunctionName'].OutputValue" \
351
+ --output text)
352
+
353
+ echo "Deploying to Lambda: $FUNCTION_NAME"
354
+ aws lambda update-function-code \
355
+ --function-name "$FUNCTION_NAME" \
356
+ --zip-file fileb://lambda.zip
357
+
358
+ echo "Waiting for update..."
359
+ aws lambda wait function-updated --function-name "$FUNCTION_NAME"
360
+
361
+ echo "Testing health endpoint..."
362
+ curl -s https://3lsush2fx0.execute-api.us-east-1.amazonaws.com/dev/health | jq .
363
+
364
+ echo "Done. Check CloudWatch for ERR_MODULE_NOT_FOUND — should be gone."
172
365
  ```
173
366
 
367
+ After using manual deploy, run a full `cdk deploy` when Docker is restored to keep CloudFormation state in sync with live infrastructure.
368
+
174
369
  ---
175
370
 
176
371
  ## CRITICAL: Security Rules — Never Violate These
@@ -240,6 +435,8 @@ lateos-visus/
240
435
  │ ├── browser/
241
436
  │ │ └── playwright-renderer.ts # Headless Chromium page fetcher
242
437
  │ └── types.ts # Shared TypeScript interfaces
438
+ ├── scripts/
439
+ │ └── deploy-lambda.sh # Manual Lambda deploy (bypasses CDK/Docker)
243
440
  └── tests/
244
441
  ├── sanitizer.test.ts
245
442
  ├── fetch-tool.test.ts