File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 2323 {:contents [{:type :text
2424 :error true
2525 :content " Access denied - path outside workspace root, call list_allowed_dirs first" }]}
26- ((get-in f.tools.filesystem/definitions [" list_directory" :handler ])
27- {" path" (h/file-path " /foo/qux" )}
28- {:workspace-folders [{:uri (h/file-uri " file:///foo/bar/baz" ) :name " baz" }]}))))
26+ (with-redefs [fs/canonicalize (constantly (h/file-path " /foo/qux" ))]
27+ ((get-in f.tools.filesystem/definitions [" list_directory" :handler ])
28+ {" path" (h/file-path " /foo/qux" )}
29+ {:workspace-folders [{:uri (h/file-uri " file:///foo/bar/baz" ) :name " baz" }]})))))
2930 (testing " allowed dir"
3031 (is (match?
3132 {:contents [{:type :text
3738 (with-redefs [fs/starts-with? (constantly true )
3839 fs/list-dir (constantly [(fs/path (h/file-path " /foo/bar/baz/some.clj" ))
3940 (fs/path (h/file-path " /foo/bar/baz/qux" ))])
40- fs/directory? (fn [path] (not (string/ends-with? (str path) " .clj" )))]
41+ fs/directory? (fn [path] (not (string/ends-with? (str path) " .clj" )))
42+ fs/canonicalize (constantly (h/file-path " /foo/bar/baz" ))]
4143 ((get-in f.tools.filesystem/definitions [" list_directory" :handler ])
4244 {" path" (h/file-path " /foo/bar/baz" )}
4345 {:workspace-folders [{:uri (h/file-uri " file:///foo/bar/baz" ) :name " baz" }]}))))))
Original file line number Diff line number Diff line change 2525 :description string?
2626 :parameters some?
2727 :source :built-in }])
28- (f.tools/all-tools {} {:built-in-tools {:filesystem {:enabled true }}}))))
28+ (f.tools/all-tools {} {:builtInTools {:filesystem {:enabled true }}}))))
2929 (testing " Do not include disabled built-in tools"
3030 (is (match?
3131 (m/embeds [(m/mismatch {:name " list_directory" })])
32- (f.tools/all-tools {} {:built-in-tools {:filesystem {:enabled false }}})))))
32+ (f.tools/all-tools {} {:builtInTools {:filesystem {:enabled false }}})))))
You can’t perform that action at this time.
0 commit comments