wayfind 2.0.40 → 2.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/doctor.sh +37 -6
  2. package/package.json +1 -1
  3. package/setup.sh +0 -42
package/doctor.sh CHANGED
@@ -363,16 +363,45 @@ check_storage_backend() {
363
363
  info "TEAM_CONTEXT_STORAGE_BACKEND=$TEAM_CONTEXT_STORAGE_BACKEND (env override)"
364
364
  fi
365
365
 
366
- local WAYFIND_DIR="${WAYFIND_DIR:-$HOME/.claude/team-context}"
367
366
  local SCRIPT_DIR
368
367
  SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
369
368
 
369
+ # Resolve the team-scoped store path (respects .claude/wayfind.json + context.json default)
370
+ local RESOLVED_STORE ACTIVE_TEAM_ID
371
+ RESOLVED_STORE=$(node -e "
372
+ try {
373
+ const cs = require('$SCRIPT_DIR/bin/content-store.js');
374
+ console.log(cs.resolveStorePath());
375
+ } catch (e) {
376
+ console.log('SKIP:' + e.message.split('\n')[0]);
377
+ }
378
+ " 2>/dev/null) || RESOLVED_STORE="SKIP:content-store not available"
379
+ ACTIVE_TEAM_ID=$(node -e "
380
+ try {
381
+ const cs = require('$SCRIPT_DIR/bin/content-store.js');
382
+ // resolveStorePath triggers team ID resolution; extract from path
383
+ const p = cs.resolveStorePath();
384
+ const m = p && p.match(/teams\/([^/]+)\/content-store/);
385
+ console.log(m ? m[1] : 'default');
386
+ } catch (e) {
387
+ console.log('unknown');
388
+ }
389
+ " 2>/dev/null) || ACTIVE_TEAM_ID="unknown"
390
+
391
+ if [[ "$RESOLVED_STORE" != SKIP:* ]]; then
392
+ ok "Active team: $ACTIVE_TEAM_ID"
393
+ info "Store path: $RESOLVED_STORE"
394
+ fi
395
+
396
+ local WAYFIND_DIR="${WAYFIND_DIR:-$HOME/.claude/team-context}"
397
+
370
398
  # ── 1. Which backend is active ───────────────────────────────────────────
371
399
  local BACKEND_RESULT=""
372
400
  BACKEND_RESULT=$(node -e "
373
401
  try {
402
+ const cs = require('$SCRIPT_DIR/bin/content-store.js');
374
403
  const storage = require('$SCRIPT_DIR/bin/storage/index.js');
375
- const storePath = '$WAYFIND_DIR';
404
+ const storePath = cs.resolveStorePath();
376
405
  storage.getBackend(storePath);
377
406
  const info = storage.getBackendInfo(storePath);
378
407
  if (!info) { console.log('NONE'); process.exit(0); }
@@ -402,9 +431,10 @@ check_storage_backend() {
402
431
 
403
432
  # ── 2. Fallback detection ────────────────────────────────────────────
404
433
  if [ "$IS_FALLBACK" = "true" ]; then
405
- warn "JSON backend is a fallback better-sqlite3 was expected but failed to load"
406
- info "Run: npm install -g better-sqlite3 (or reinstall wayfind)"
407
- ISSUES=$((ISSUES + 1))
434
+ # JSON fallback is expected when better-sqlite3 isn't available (optional dep).
435
+ # Warn only don't increment ISSUES. Use `wayfind doctor --container` in Docker.
436
+ warn "JSON backend (better-sqlite3 unavailable — optional)"
437
+ info "To enable SQLite: npm install -g better-sqlite3 (or rebuild container image)"
408
438
  elif [ "$BACKEND_TYPE" = "json" ]; then
409
439
  # Not a runtime fallback — check if sqlite3 is available but unused
410
440
  if node -e "require('better-sqlite3')" 2>/dev/null; then
@@ -471,8 +501,9 @@ check_storage_backend() {
471
501
  local EMBED_RESULT
472
502
  EMBED_RESULT=$(node -e "
473
503
  try {
504
+ const cs = require('$SCRIPT_DIR/bin/content-store.js');
474
505
  const storage = require('$SCRIPT_DIR/bin/storage/index.js');
475
- const storePath = '$WAYFIND_DIR/content-store';
506
+ const storePath = cs.resolveStorePath();
476
507
  const backend = storage.getBackend(storePath);
477
508
  const idx = backend.loadIndex();
478
509
  if (!idx || !idx.entries) { console.log('SKIP'); process.exit(0); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wayfind",
3
- "version": "2.0.40",
3
+ "version": "2.0.43",
4
4
  "description": "Team decision trail for AI-assisted development. The connective tissue between product, engineering, and strategy.",
5
5
  "bin": {
6
6
  "wayfind": "./bin/team-context.js",
package/setup.sh CHANGED
@@ -441,48 +441,6 @@ PYEOF
441
441
  fi
442
442
  fi
443
443
 
444
- # Status line script
445
- STATUSLINE_DEST="$HOME/.claude/team-context/statusline.sh"
446
- if [ ! -f "$STATUSLINE_DEST" ] || [ "$UPDATE" = true ]; then
447
- run cp "$SCRIPT_DIR/templates/statusline.sh" "$STATUSLINE_DEST"
448
- run chmod +x "$STATUSLINE_DEST"
449
- log "Installed status line: $STATUSLINE_DEST"
450
- else
451
- info "Status line already exists: $STATUSLINE_DEST — skipped"
452
- fi
453
-
454
- # Merge statusLine config into settings.json
455
- if [ -f "$SETTINGS" ] && ! grep -q "statusLine" "$SETTINGS" 2>/dev/null; then
456
- if [ "$DRY_RUN" = false ]; then
457
- TMP_SL="$(mktemp)"
458
- if python3 - "$SETTINGS" "$STATUSLINE_DEST" "$TMP_SL" <<'PYEOF' 2>/dev/null; then
459
- import json, sys
460
- settings_path, sl_cmd, out_path = sys.argv[1], sys.argv[2], sys.argv[3]
461
- try:
462
- with open(settings_path) as f:
463
- settings = json.load(f)
464
- except (json.JSONDecodeError, IOError):
465
- sys.exit(1)
466
- if "statusLine" not in settings:
467
- settings["statusLine"] = {"type": "command", "command": sl_cmd, "padding": 2}
468
- with open(out_path, "w") as f:
469
- json.dump(settings, f, indent=2)
470
- f.write("\n")
471
- PYEOF
472
- mv "$TMP_SL" "$SETTINGS"
473
- log "Added statusLine config to $SETTINGS"
474
- else
475
- rm -f "$TMP_SL"
476
- warn "Could not add statusLine to $SETTINGS (malformed JSON or python3 unavailable)"
477
- fi
478
- else
479
- info "[dry-run] Would add statusLine to $SETTINGS"
480
- fi
481
- else
482
- if [ -f "$SETTINGS" ]; then
483
- info "statusLine already configured in settings.json — skipped"
484
- fi
485
- fi
486
444
  ;;
487
445
 
488
446
  cursor)