jan icon indicating copy to clipboard operation
jan copied to clipboard

epic: Better files & links

Open 0xSage opened this issue 5 months ago • 8 comments

Motivation

  • Users (esp Windows) have discrete preferences for how to store/share assets
  • e.g. model binaries, model configs, in the future, assistant tar.gzs
  • Placing app files in home directory messes up ppl's dev envs #1358

Community request

  • #1358

Specs

Users can change default Jan app data location

  • Give users control over how their own fs is used
  • Good UX around error handling, interrupted migrations

Users can restore to a clean build

  • If users mess up the /jan folder structure, it should be recoverable

Users can thoroughly delete Jan & purge data

  • No dangling files.
  • No running various sh scripts to clean up data.

Open Questions

  1. Where, what, and why are we currently storing data?

MacOS

~/jan : janroot ~/Library/Application Support/jan : Cookie, session for electron app (chromium) ~/Library/Caches/jan-updater, ~/Library/Caches/jan.ai.app, ~/Library/Caches/jan.ai.app.ShipIt : Cache

Window

C:\User\%USERPROFILE%\jan : janroot C:\Users\%USERPROFILE%\AppData\Local\Programs\jan : app installed folder, will be remove if we uninstall app C:\Users\%USERPROFILE%\AppData\Roaming\jan : cache folder for jan app C:\Users\%USERPROFILE%\AppData\Local\electron : cache folder generated by electron - chromium related

Linux:

~/jan: janroot ~/.config/jan: Cache ~/.npm/_cacache: Folder cache generated on linux when call a function getTempCache in typescript

  1. Where should this data go?
  • User data & Jan specific assets, e.g. the model/assistant/thread.jsons
  • User data & shared assets, e.g. model binaries, RAG files (which could be shared across other apps)
  • Application assets, e.g. cache, logs, and other app data

3. What should the reset & deletion behavior be for these files?

  • How does it vary across Systems? Mac, Windows, Linux.

Tasklist

Design

  • [x] #1010
  • [x] #1052

Implementation

  • [ ] #1435
  • [x] #1618
  • [x] #1619
  • [ ] #1621
  • [ ] #1620

Not in Scope

  • Letting users change Jan specific subfolder paths for /models, /assistants, rag attachments, that contain the jsons
  • Exclude files, block Jan from accessing certain paths
  • A full Obsidian vault inspired UX: https://help.obsidian.md/Files+and+folders/Manage+vaults
  • Everything else. Let's scope this tightly pls.

Appendix

I'm inspired by Obsidian's philosophy of letting users manage how their filesystem is used. Sidenote (nonurgent): We should strive to evolve our SDK/fs wrapper towards this level of user ownership and flexibility.

image

0xSage avatar Jan 10 '24 05:01 0xSage