File tree Expand file tree Collapse file tree 6 files changed +15
-11
lines changed
Expand file tree Collapse file tree 6 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 33## Unreleased
44
55- Add support for global rules.
6+ - Fix origin field of tool calls.
67
78## 0.3.1
89
Original file line number Diff line number Diff line change 195195 :request-id request-id
196196 :role :assistant
197197 :content {:type :toolCallRun
198+ :origin (:origin (first (filter #(= name (:name %)) all-tools)))
198199 :name name
199200 :arguments arguments
200201 :id id
Original file line number Diff line number Diff line change 5656(defn ^:private system-rules []
5757 [{:name " ECA System"
5858 :type :system
59- :content (str " You are an expert AI coding tool called ECA (Editor Code Assistant)."
60- " Your behavior is to '<behavior>'."
61- " The chat is markdown mode." )}])
59+ :content (str " You are an expert AI coding tool called ECA (Editor Code Assistant). "
60+ " Your behavior is to '<behavior>'. "
61+ " The chat is markdown mode. "
62+ " When responding code blocks, pay attention to use valid markdown languages following Github markdown." )}])
6263
6364(defn all [config roots variables]
6465 (mapv (fn [rule]
Original file line number Diff line number Diff line change 3939 (vals (native-definitions db config))))
4040 mcp-tools (f.mcp/all-tools db)]
4141 (concat
42- (mapv #(assoc % :source :native ) native-tools)
43- (mapv #(assoc % :source :mcp ) mcp-tools))))
42+ (mapv #(assoc % :origin :native ) native-tools)
43+ (mapv #(assoc % :origin :mcp ) mcp-tools))))
4444
4545(defn call-tool! [^String name ^Map arguments db config]
4646 (logger/info logger-tag (format " Calling tool '%s' with args '%s'" name arguments))
Original file line number Diff line number Diff line change 1313 (testing " system rule replacement"
1414 (let [rules (f.rules/all {} [] vars)
1515 sys-rule (first (filter #(= :system (:type %)) rules))]
16- (is (= (str " You are an expert AI coding tool called ECA (Editor Code Assistant)."
17- " Your behavior is to 'MY-BEHAVIOR'."
18- " The chat is markdown mode." )
16+ (is (= (str " You are an expert AI coding tool called ECA (Editor Code Assistant). "
17+ " Your behavior is to 'MY-BEHAVIOR'. "
18+ " The chat is markdown mode. "
19+ " When responding code blocks, pay attention to use valid markdown languages following Github markdown." )
1920 (:content sys-rule)))))
2021
2122 (testing " absolute config rule"
Original file line number Diff line number Diff line change 1414 :description " eval code"
1515 :parameters {" type" " object"
1616 :properties {" code" {:type " string" }}}
17- :source :mcp }])
17+ :origin :mcp }])
1818 (f.tools/all-tools {:mcp-clients {:clojureMCP
1919 {:tools [{:name " eval"
2020 :description " eval code"
2626 (m/embeds [{:name " eca_list_directory"
2727 :description string?
2828 :parameters some?
29- :source :native }])
29+ :origin :native }])
3030 (f.tools/all-tools {} {:nativeTools {:filesystem {:enabled true }}}))))
3131 (testing " Do not include disabled native tools"
3232 (is (match?
3737 (m/embeds [{:name " eca_list_directory"
3838 :description (format " Only in %s" (h/file-path " /path/to/project/foo" ))
3939 :parameters some?
40- :source :native }])
40+ :origin :native }])
4141 (with-redefs [f.tools.filesystem/definitions {" eca_list_directory" {:description " Only in $workspaceRoots"
4242 :parameters {}}}]
4343 (f.tools/all-tools {:workspace-folders [{:name " foo" :uri (h/file-uri " file:///path/to/project/foo" )}]}
You can’t perform that action at this time.
0 commit comments