mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 22:25:01 +00:00
fix: create blocks on new page
Also tweak list* tools description so they expand for more cases e.g. property types for listProperties
This commit is contained in:
@@ -202,13 +202,13 @@
|
||||
:config #js {:title "List Tags"
|
||||
:description "List all tags in a graph"
|
||||
:inputSchema
|
||||
#js {:expand (-> (z/boolean) .optional (.describe "Provide additional detail on each tag"))}}}
|
||||
#js {:expand (-> (z/boolean) .optional (.describe "Provide additional detail on each tag e.g. their parents (extends) and tag properties"))}}}
|
||||
:listProperties
|
||||
{:fn api-list-properties
|
||||
:config #js {:title "List Properties"
|
||||
:description "List all properties in a graph"
|
||||
:inputSchema
|
||||
#js {:expand (-> (z/boolean) .optional (.describe "Provide additional detail on each property"))}}}})
|
||||
#js {:expand (-> (z/boolean) .optional (.describe "Provide additional detail on each property e.g. property type, cardinality"))}}}})
|
||||
|
||||
(defn call-api-tool [tool-fn api-fn args]
|
||||
(tool-fn (partial api-tool api-fn) args))
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
(date-time-util/safe-journal-title-formatters nil))]
|
||||
{:build/journal journal-day}
|
||||
{:block/title (get-in op [:data :title])})}
|
||||
(some-> (:id op) (get blocks-by-page))
|
||||
(some->> (:id op) (get blocks-by-page))
|
||||
(assoc :blocks
|
||||
(mapv #(hash-map :block/title (get-in % [:data :title]))
|
||||
(get blocks-by-page (:id op))))))
|
||||
@@ -358,7 +358,7 @@
|
||||
(assoc-in % [:data :title]
|
||||
(or (get-in % [:data :name]) (get-in % [:data :title])))
|
||||
%)))
|
||||
_ (prn :ops operations)
|
||||
;; _ (prn :ops operations)
|
||||
_ (when-let [errors (m/explain Upsert-nodes-operations-schema operations)]
|
||||
(throw (ex-info (str "Tool arguments are invalid:\n" (me/humanize errors))
|
||||
{:errors errors})))
|
||||
@@ -374,7 +374,7 @@
|
||||
(assoc :classes classes)
|
||||
(seq properties)
|
||||
(assoc :properties properties))]
|
||||
(prn :import-edn import-edn)
|
||||
(prn :debug-import-edn import-edn)
|
||||
(validate-import-edn import-edn)
|
||||
import-edn))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user