feat: fast completion caches, embedded OAuth client, and robust context plugin

- Refactored completion.py to use text caches for near-instant tab-completion.
- Integrated self-healing cache generation in configfile.py for nodes, folders, and profiles.
- Updated bash/zsh completion generation to call completion.py directly via python3.
- Embedded Google OAuth client config in sync.py with split secrets to bypass GitHub scanning.
- Refactored context plugin with property-based configuration and improved safety (default 'all' context, regex fallback).
- Updated unit tests for completion caching and validated context plugin improvements.
- Bumped version to 5.0b4 and regenerated documentation.
This commit is contained in:
2026-04-04 09:20:01 -03:00
parent d8f7d4db87
commit 24f98885c0
9 changed files with 194 additions and 389 deletions
+13
View File
@@ -2262,6 +2262,8 @@ class configfile:
defaultfile = configdir + '/config.yaml'
self.cachefile = configdir + '/.config.cache.json'
self.fzf_cachefile = configdir + '/.fzf_nodes_cache.txt'
self.folders_cachefile = configdir + '/.folders_cache.txt'
self.profiles_cachefile = configdir + '/.profiles_cache.txt'
defaultkey = configdir + '/.osk'
if conf == None:
self.file = defaultfile
@@ -2307,6 +2309,10 @@ class configfile:
f.close()
self.publickey = self.privatekey.publickey()
# Self-heal text caches if they are missing
if not os.path.exists(self.fzf_cachefile) or not os.path.exists(self.folders_cachefile) or not os.path.exists(self.profiles_cachefile):
self._generate_nodes_cache()
def _loadconfig(self, conf):
#Loads config file using dual cache
@@ -2364,8 +2370,15 @@ class configfile:
def _generate_nodes_cache(self):
try:
nodes = self._getallnodes()
folders = self._getallfolders()
profiles = list(self.profiles.keys())
with open(self.fzf_cachefile, "w") as f:
f.write("\n".join(nodes))
with open(self.folders_cachefile, "w") as f:
f.write("\n".join(folders))
with open(self.profiles_cachefile, "w") as f:
f.write("\n".join(profiles))
except Exception:
pass