|
95 | 95 | :entrypoint "/app/result/bin/docker-lsp"
|
96 | 96 | :command ["project-facts"
|
97 | 97 | "--vs-machine-id" "none"
|
98 |
| - "--workspace" "/docker"]}]))) |
| 98 | + "--workspace" "/project"]}]))) |
99 | 99 |
|
100 | 100 | (defn collect-functions [dir]
|
101 | 101 | (->>
|
|
268 | 268 | :validate [#(#{"darwin" "linux" "windows"} (string/lower-case %)) "valid platforms are Darwin|Linux|Windows"]]
|
269 | 269 | [nil "--prompts-dir DIR_PATH" "path to local prompts directory"
|
270 | 270 | :id :prompts-dir
|
| 271 | + :validate [#(fs/exists? (fs/file %)) "prompts dir does not a valid directory"] |
271 | 272 | :parse-fn #(fs/file %)]
|
272 | 273 | [nil "--prompts REF" "git ref to remote prompts directory"
|
273 | 274 | :id :prompts-dir
|
|
292 | 293 | [nil "--debug" "add debug logging"]
|
293 | 294 | [nil "--help" "print option summary"]])
|
294 | 295 |
|
295 |
| -(def output-handler (fn [x] (jsonrpc/notify :message {:content (json/generate-string x)}))) |
| 296 | +(def output-handler (fn [x] |
| 297 | + (jsonrpc/notify :message {:content (json/generate-string (if (= "error" (:done x)) |
| 298 | + (update x :messages last) |
| 299 | + (select-keys x [:done])))}))) |
296 | 300 | (defn output-prompts [coll]
|
297 | 301 | (->> coll
|
298 | 302 | (mapcat (fn [{:keys [role content]}]
|
|
356 | 360 | "run" (fn []
|
357 | 361 | (with-volume
|
358 | 362 | (fn [thread-id]
|
359 |
| - (select-keys |
360 |
| - (async/<!! ((comp conversation-loop (validate ::run-args)) |
361 |
| - (-> opts |
362 |
| - (assoc :thread-id thread-id) |
363 |
| - ((fn [opts] (apply merge-deprecated opts (rest args))))))) |
| 363 | + (async/<!! ((comp conversation-loop (validate ::run-args)) |
| 364 | + (-> opts |
| 365 | + (assoc :thread-id thread-id) |
| 366 | + ((fn [opts] (apply merge-deprecated opts (rest args)))))))) |
364 | 367 |
|
365 |
| - [:done])) |
366 | 368 | opts))
|
367 | 369 | (fn []
|
368 | 370 | ((comp get-prompts (validate ::run-args)) (apply merge-deprecated opts args)))))
|
|
0 commit comments