Skip to content

Commit 3f7ac1e

Browse files
committed
Add tests
1 parent 508e6e5 commit 3f7ac1e

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

test/eca/features/tools_test.clj

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
:parameters {"type" "object"
1616
:properties {"code" {:type "string"}}}
1717
:origin :mcp}])
18-
(f.tools/all-tools {:mcp-clients {:clojureMCP
18+
(f.tools/all-tools "agent"
19+
{:mcp-clients {:clojureMCP
1920
{:tools [{:name "eval"
2021
:description "eval code"
2122
:parameters {"type" "object"
@@ -27,11 +28,21 @@
2728
:description string?
2829
:parameters some?
2930
:origin :native}])
30-
(f.tools/all-tools {} {:nativeTools {:filesystem {:enabled true}}}))))
31+
(f.tools/all-tools "agent" {} {:nativeTools {:filesystem {:enabled true}}}))))
3132
(testing "Do not include disabled native tools"
3233
(is (match?
3334
(m/embeds [(m/mismatch {:name "eca_directory_tree"})])
34-
(f.tools/all-tools {} {:nativeTools {:filesystem {:enabled false}}}))))
35+
(f.tools/all-tools "agent" {} {:nativeTools {:filesystem {:enabled false}}}))))
36+
(testing "Do not include edit tool if plan behavior"
37+
(is (match?
38+
(m/embeds [{:name "eca_plan_edit_file"}
39+
(m/mismatch {:name "eca_edit_file"})])
40+
(f.tools/all-tools "plan" {} {:nativeTools {:filesystem {:enabled true}}}))))
41+
(testing "Do not include plan edit tool if agent behavior"
42+
(is (match?
43+
(m/embeds [(m/mismatch {:name "eca_plan_edit_file"})
44+
{:name "eca_edit_file"}])
45+
(f.tools/all-tools "agent" {} {:nativeTools {:filesystem {:enabled true}}}))))
3546
(testing "Replace special vars description"
3647
(is (match?
3748
(m/embeds [{:name "eca_directory_tree"
@@ -40,5 +51,5 @@
4051
:origin :native}])
4152
(with-redefs [f.tools.filesystem/definitions {"eca_directory_tree" {:description "Only in $workspaceRoots"
4253
:parameters {}}}]
43-
(f.tools/all-tools {:workspace-folders [{:name "foo" :uri (h/file-uri "file:///path/to/project/foo")}]}
54+
(f.tools/all-tools "agent" {:workspace-folders [{:name "foo" :uri (h/file-uri "file:///path/to/project/foo")}]}
4455
{:nativeTools {:filesystem {:enabled true}}}))))))

0 commit comments

Comments
 (0)