|
72 | 72 |
|
73 | 73 | ;; merges client-info capabilities and client protocol-version |
74 | 74 | (swap! db* assoc-in [:servers server-id] params) |
75 | | - {:protocol-version "2024-11-05" |
| 75 | + {:protocolVersion "2024-11-05" |
76 | 76 | :capabilities {:prompts {:listChanged true} |
77 | 77 | :tools {:listChanged true} |
78 | 78 | :resources {:listChanged true}} |
79 | | - :server-info {:name "docker-mcp-server" |
| 79 | + :serverInfo {:name "docker-mcp-server" |
80 | 80 | :version "0.0.1"}}) |
81 | 81 |
|
82 | 82 | (defmethod lsp.server/receive-notification "notifications/initialized" [_ {:keys [db* server server-id]} _] |
|
207 | 207 |
|
208 | 208 | (defmethod lsp.server/receive-request "resources/subscribe" [_ _ params] |
209 | 209 | (logger/info "resources/subscribe" params) |
210 | | - {:resource-templates []}) |
| 210 | + {:resourceTemplates []}) |
211 | 211 |
|
212 | 212 | ;; ----------------- |
213 | 213 | ;; MCP Tools |
|
343 | 343 | (apply log-wrapper-fn log-args) |
344 | 344 | (recur)))) |
345 | 345 |
|
| 346 | +(defn ^:private monitor-audit-logs [audit-ch] |
| 347 | + (async/go-loop [] |
| 348 | + (when-let [log-args (async/<! audit-ch)] |
| 349 | + (apply log-wrapper-fn log-args) |
| 350 | + (recur)))) |
| 351 | + |
346 | 352 | (defn initialize-prompts [opts] |
347 | 353 | ;; initialize mcp cache |
348 | 354 | (client/initialize-cache) |
|
366 | 372 | (let [timbre-logger (logger/->TimbreLogger) |
367 | 373 | log-path (logger/setup timbre-logger) |
368 | 374 | db* db/db* |
369 | | - log-ch (async/chan (async/sliding-buffer 20))] |
| 375 | + log-ch (async/chan (async/sliding-buffer 20)) |
| 376 | + audit-ch (async/chan)] |
370 | 377 | ;; add option map and log-path to the db |
371 | 378 | (swap! db* merge {:log-path log-path} (dissoc opts :in)) |
372 | 379 | ;; initialize shutdown hook |
|
381 | 388 | jsonrpc.prompt-change-events/markdown-tool-updated) |
382 | 389 | ;; monitor our log channel (used by all chan servers) |
383 | 390 | (monitor-server-logs log-ch) |
| 391 | + (monitor-audit-logs audit-ch) |
384 | 392 | ;; this won't do anything if nrepl is not present |
385 | 393 | (nrepl/setup-nrepl) |
386 | 394 | ;; common server opts |
387 | 395 | (merge |
388 | 396 | {;:keyword-function identity |
389 | 397 | :log-ch log-ch |
| 398 | + :audit-ch audit-ch |
390 | 399 | :trace-ch log-ch |
391 | 400 | :trace-level trace-level |
392 | 401 | :keyword-function keyword |
|
0 commit comments