Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sphere engine code execution #382

Conversation

threefjefff
Copy link
Contributor

What now?

Here's a very dirty prototype for code-block execution in Sphere Engine.
(Like, genuinely, clean coders turn back now)

The plan here is to change the menus while in a CodeView context to include a button that fires of code execution, then spit that output to the console to prove a round-trip possible.

Under the hood (and flying directly in the face of CORS, convention, and the heavens themselves) we use some local proxying to send our code block to Sphere Grid, who attempts to compile it directly as C# code, and yells at you if it breaks.
There's some horrendously long waiting here, because the options are to poll (which goes against the quick part) or recieve webhooks (which goes against the dirty part). Instead, we just wait for long enough that we're probably going to get a result from Sphere Engine.

The results are pushed straight to console.

What next?

  • Move everything in that run-code to be part of a registered plugin. This needs to interact with the Menu plugin (and I'm of the opinion that the menu plugin can be more statefully driven, which will enable us to be a bit more dynamic with the menus when in certain contexts
  • Register processors of the code execution as part of the options for both MD and richtext modes. Essentially, do the actuall calling bit outside the editor.
  • Have some markdown processing to ensure that 1) you're in a code block and 2) that code block isn't the parent one that all the markdown in punted into.
  • We should be communicating with a Stack server such that it handles code excution and feedback to the front end.
  • We could probably leverage websockets for slicker communication of those results rather than polling

omit token, even if it is a rotating dev one
@threefjefff threefjefff deleted the jsmb/PoC/spheregrid-code-execution branch February 24, 2025 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant