cider

Ian Eslick 2024-12-10T04:58:44.324349Z

I have been toying with running an LLM agent workflow in a Clojure JVM as part of a more integrated and customized co-pilot style experience such as being able to validate generated code, but leveraging the connection with Emacs via Cider to get editing context, access to files (what file am I editing, etc.) , and the ability to patch/create files driven from the Clojure side. Is there a cider middleware pattern you are aware of that enables that sort of interaction or do interactions need to be driven entirely from the Emacs side in a query-response style of communications flow?

oyakushev 2024-12-10T08:00:23.267399Z

https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/format.clj rewrites code. That is probably the most source code manipulation that CIDER does.

Ian Eslick 2024-12-10T14:47:17.199299Z

Thank you. That looks like it’s still falling into the command-response pattern where emacs is requesting a manipulation that cider middleware satisfies? Is there a mechanism for an asynchronous clojure task to push data to a handler in Emacs that would then say create a file/buffer and insert the generated code? I’ll also dig into the nrepl details to see how this might work; but hoped someone here could point at a worked example. Thanks!

oyakushev 2024-12-10T15:33:53.014349Z

nRepl is request-response by design, but responses are asynchronous and can be numerous. Nothing stops you from sending an initial message (request) from the client and then infinitely receive server-driven responses for that message and react to them. You can look how interactive eval is implemented in CIDER, it sends an expression to evaluate and then watches for out and err messages until a done message is received with the value. It's pretty much the same what you need.

Giu 2024-12-10T11:05:56.514539Z

Hi all. My comp crashed and today I Will receive my new laptop. I Will not install Linux at the moment, and would like to know if cider support in Windows it's ok

Gent Krasniqi 2024-12-11T12:09:21.916729Z

Haven't run into any issues myself on my corporate laptop for more than a month now. I don't use WSL, just the clojure tooling available in scoop. You can check out that scoop repository in the babashka github readme if you want to go that way, as I'm on a phone right now. Windows isn't all that bad on this front anymore, I have to say.

Giu 2024-12-11T12:10:21.686519Z

Thanks. Now I have a vscode environment with WSL to be able to work, and later will revisit this, thanks