From 0a56e6af9b1c4823c4dc62714c42713f65563f5b Mon Sep 17 00:00:00 2001 From: Mike Thicke Date: Tue, 10 Feb 2026 12:19:44 -0500 Subject: [PATCH] Gitignore test vault chat files and update dev scripts Co-Authored-By: Claude Opus 4.6 --- .gitignore | 3 +++ scripts/open-test-vault.sh | 27 ++++++++++++++++++++- test-vault/.obsidian/community-plugins.json | 4 ++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index d2a6afc..1202615 100644 --- a/.gitignore +++ b/.gitignore @@ -135,5 +135,8 @@ dist .yarn/install-state.gz .pnp.* +# Test vault chat files +test-vault/coi/chat_*.md + #macos .DS_Store diff --git a/scripts/open-test-vault.sh b/scripts/open-test-vault.sh index 0830e33..63d5b26 100755 --- a/scripts/open-test-vault.sh +++ b/scripts/open-test-vault.sh @@ -5,6 +5,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" PROJECT_DIR="$(dirname "$SCRIPT_DIR")" VAULT_DIR="$PROJECT_DIR/test-vault" PLUGIN_DIR="$VAULT_DIR/.obsidian/plugins/co-intelligence" +OBSIDIAN_CONFIG="$HOME/Library/Application Support/obsidian/obsidian.json" # Create plugin directory and symlinks mkdir -p "$PLUGIN_DIR" @@ -16,8 +17,32 @@ ln -sf "$PROJECT_DIR/manifest.json" "$PLUGIN_DIR/manifest.json" echo "Building plugin..." npm --prefix "$PROJECT_DIR" run build +# Register the vault with Obsidian if not already registered +if [ -f "$OBSIDIAN_CONFIG" ]; then + if ! python3 -c " +import json, sys +with open('$OBSIDIAN_CONFIG') as f: + config = json.load(f) +sys.exit(0 if any(v.get('path') == '$VAULT_DIR' for v in config.get('vaults', {}).values()) else 1) +"; then + echo "Registering test vault with Obsidian..." + python3 -c " +import json, hashlib, time +config_path = '$OBSIDIAN_CONFIG' +vault_path = '$VAULT_DIR' +with open(config_path) as f: + config = json.load(f) +vault_id = hashlib.md5(vault_path.encode()).hexdigest()[:16] +config.setdefault('vaults', {})[vault_id] = {'path': vault_path, 'ts': int(time.time() * 1000)} +with open(config_path, 'w') as f: + json.dump(config, f) +" + fi +fi + # Open the test vault in Obsidian echo "Opening test vault in Obsidian..." -open "obsidian://open?path=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$VAULT_DIR'))")" +ENCODED_PATH=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$VAULT_DIR'))") +open "obsidian://open?path=$ENCODED_PATH" echo "Done. If this is the first time, enable the plugin in Settings > Community plugins." diff --git a/test-vault/.obsidian/community-plugins.json b/test-vault/.obsidian/community-plugins.json index 77287c3..7f98b19 100644 --- a/test-vault/.obsidian/community-plugins.json +++ b/test-vault/.obsidian/community-plugins.json @@ -1 +1,3 @@ -["co-intelligence"] +[ + "co-intelligence" +] \ No newline at end of file