tarasglek / chatcraft.org

Developer-oriented ChatGPT clone
https://chatcraft.org/
MIT License
155 stars 35 forks source link

Allow one to "remix" import command #410

Open tarasglek opened 9 months ago

tarasglek commented 9 months ago

I think the cool part of chatcraft is that it's a choose-your-own-adventure chat-dev environment. Currently the way we implement import doesn't quite match the cool dev ux elsewhere.

I find our import command finds sometimes and I have no recourse. I think if we redo it via valtown, we could get a link to the failing val and an option to fork and change it.

"Import command failed, feel free to fork it and fix it via /set import " where command could be a link to a val.town func.

I really like how val.town matches our lightweight/interactive code-dev values.

humphd commented 9 months ago

The import stuff is fairly tightly bound to what happens in CloudFlare; I'm not sure how you properly fork that into val.town. However, why don't we add a /valtown ... or /exec command which can be very val.town specific, and do what you want.

tarasglek commented 9 months ago

It's a client-side change

tarasglek commented 8 months ago

Here is my wip scraper: https://www.val.town/v/taras/scrape

Here is my complete idea:

  1. Now just pasting a url in, will handle it via some default handler or one we specify..should host it on valtown to make it easy to fork
  2. Allow to replace /import with /set default-url-handler https://www.val.town/v/taras/scrape
  3. Change the handler to use POST arguments so we can support multiple arguments and able to pass secrets in
  4. Now I can make a custom handler that can handle private github repos by uploading encrypted github token in valtown secrets...then passing decryption key via one of the args.
  5. Now I can scrape random private sql repos, github etc with valtown and minimal exposure to having secrets stolen
tarasglek commented 8 months ago

Alternatively..perhaps we can just do this with a completion endpoint and do all this magic on serverside..eg, intercept urls, etc