From a254001da862f3cf0eeed8f7e9f5c661a26eaf0b Mon Sep 17 00:00:00 2001 From: Aditya Gupta Date: Thu, 25 Jun 2026 21:48:28 +0530 Subject: [PATCH] feat(plugins): decouple runtime cache and add dynamic auto-generation --- .agents/AGENTS.md | 5 +++++ lib/plugin_cache.sh | 13 ------------- lib/routes.sh | 4 ++++ 3 files changed, 9 insertions(+), 13 deletions(-) create mode 100644 .agents/AGENTS.md delete mode 100644 lib/plugin_cache.sh diff --git a/.agents/AGENTS.md b/.agents/AGENTS.md new file mode 100644 index 0000000..b01ddf9 --- /dev/null +++ b/.agents/AGENTS.md @@ -0,0 +1,5 @@ +# Bootstrap Project Rules + +## Repository Cleanliness & Runtime Separation +- **No Repository Clutter**: Do not commit, track, or create runtime configuration, cache, or temporary files in the repository root. +- **Dynamic Initialization**: All runtime-generated files (such as `plugin_sources.txt`, `lib/plugin_cache.sh`, or local plugin downloads) must reside strictly under the user's active `$BOOTSTRAP_DIR` (e.g., `~/.config/bootstrap`). The CLI must auto-generate or initialize these files dynamically at runtime if they are missing, ensuring a zero-configuration out-of-the-box experience. diff --git a/lib/plugin_cache.sh b/lib/plugin_cache.sh deleted file mode 100644 index 0864550..0000000 --- a/lib/plugin_cache.sh +++ /dev/null @@ -1,13 +0,0 @@ -# Auto-generated plugin cache. Do not edit manually. -declare -g -A PLUGIN_URLS -declare -g -A PLUGIN_VERSIONS -declare -g -A PLUGIN_BOOTSTRAP_VERSIONS -PLUGIN_VERSIONS["weather"]="1.0.0" -PLUGIN_URLS["weather"]="https://git.adityagupta.dev/sortedcord/bootstrap/raw/branch/master/official_plugins/weather.sh" -PLUGIN_BOOTSTRAP_VERSIONS["weather"]="2.1.0" -PLUGIN_VERSIONS["sysinfo"]="1.0.0" -PLUGIN_URLS["sysinfo"]="https://git.adityagupta.dev/sortedcord/bootstrap/raw/branch/master/official_plugins/sysinfo.sh" -PLUGIN_BOOTSTRAP_VERSIONS["sysinfo"]="2.1.0" -PLUGIN_VERSIONS["todo"]="1.0.0" -PLUGIN_URLS["todo"]="https://git.adityagupta.dev/sortedcord/bootstrap/raw/branch/master/official_plugins/todo.sh" -PLUGIN_BOOTSTRAP_VERSIONS["todo"]="2.1.0" diff --git a/lib/routes.sh b/lib/routes.sh index 5e97ff1..d41cf80 100755 --- a/lib/routes.sh +++ b/lib/routes.sh @@ -38,6 +38,10 @@ fi # Source plugin system if [ -f "$BOOTSTRAP_DIR/lib/plugins.sh" ]; then . "$BOOTSTRAP_DIR/lib/plugins.sh" + if [ ! -f "$BOOTSTRAP_DIR/lib/plugin_cache.sh" ]; then + # Silently auto-generate cache if missing so official plugins are ready instantly + update_plugin_cache >/dev/null 2>&1 || true + fi if [ -f "$BOOTSTRAP_DIR/lib/plugin_cache.sh" ]; then . "$BOOTSTRAP_DIR/lib/plugin_cache.sh" fi