jkomoros / code-sprouts

A simple framework to build bots using LLMs and simple state management
Apache License 2.0
3 stars 0 forks source link

Rationalize nested fetchers #21

Closed jkomoros closed 10 months ago

jkomoros commented 10 months ago

Rationalize concept of OverlayFetcher, BrowserFetcher, NodeFetcher, etc.

Currently BrowserFetcher has a localWriteablePath that it traps out to LocalFilesystem.

Instead, create a FilesystemFetcher, (and in other cases, you might have e.g. a FirebaseFetcher).

Fetcher grows a validPath() which errors if it's a prefix this fetcher doesn't know how to deal with.

And then add a MetaFetcher, that takes a default fetcher, and then can registerHandler(pathPrefix, subFetcher) that will be called out to when it matches.

Fetcher.listSprouts() doesn't take paths, it just is supposed to list any sprouts it knows of. And the MetaFetcher calls sub ones.

Related to #19

jkomoros commented 10 months ago

Finished as of aa4638b