Refactor MCP tree server: dispatch table, caching, validation, subprocess cleanup
Break up the 1735-line handle_tool match into 45 individual handler functions with hashtable-based dispatch. Add mtime-based file parse caching (AST + CST), consolidated run_command helper replacing 9 bare open_process_in patterns, require_file/require_dir input validation, and pagination (limit/offset) for sx_find_across, sx_comp_list, sx_comp_usage. Also includes pending VM changes: rest-arity support, hyperscript parser, compiler/transpiler updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
;; _hyperscript playground API handler
|
||||
;; Compiles hyperscript source and returns the AST + SX output as HTML
|
||||
|
||||
(defhandler
|
||||
hs-compile
|
||||
@@ -14,7 +13,7 @@
|
||||
(~tw :tokens "text-sm text-gray-400 italic")
|
||||
"Enter some hyperscript and click Compile.")
|
||||
(let
|
||||
((ast (hs-compile source)) (sx (hs-to-sx-from-source source)))
|
||||
((compiled (hs-to-sx-from-source source)))
|
||||
(div
|
||||
(~tw :tokens "space-y-4")
|
||||
(div
|
||||
@@ -25,7 +24,7 @@
|
||||
(pre
|
||||
(~tw
|
||||
:tokens "bg-gray-900 text-green-400 p-4 rounded-lg text-sm overflow-x-auto whitespace-pre-wrap font-mono")
|
||||
(sx-serialize sx)))
|
||||
(sx-serialize compiled)))
|
||||
(div
|
||||
(h4
|
||||
(~tw
|
||||
@@ -34,4 +33,4 @@
|
||||
(pre
|
||||
(~tw
|
||||
:tokens "bg-gray-900 text-amber-400 p-4 rounded-lg text-sm overflow-x-auto whitespace-pre-wrap font-mono")
|
||||
(sx-serialize ast)))))))
|
||||
(sx-serialize (hs-compile source))))))))
|
||||
Reference in New Issue
Block a user