wayfind 2.0.33 → 2.0.35
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.
- package/bin/content-store.js +31 -1
- package/bin/team-context.js +9 -9
- package/doctor.sh +46 -0
- package/package.json +1 -1
package/bin/content-store.js
CHANGED
|
@@ -569,8 +569,38 @@ function searchText(query, options = {}) {
|
|
|
569
569
|
...(entry.tags || []),
|
|
570
570
|
].filter(Boolean).join(' ').toLowerCase().replace(/[-_]/g, ' ');
|
|
571
571
|
|
|
572
|
+
// For signal entries, read content directly from the signal file
|
|
573
|
+
if (entry.source === 'signal') {
|
|
574
|
+
const signalsDir = options.signalsDir || DEFAULT_SIGNALS_DIR;
|
|
575
|
+
if (signalsDir) {
|
|
576
|
+
// Signal files live at signalsDir/<channel>/<date>.md or signalsDir/<channel>/<owner>/<repo>/<date>.md
|
|
577
|
+
// The repo field tells us the path: "signals/<channel>" or "<owner>/<repo>"
|
|
578
|
+
const repo = entry.repo || '';
|
|
579
|
+
const candidates = [];
|
|
580
|
+
if (repo.startsWith('signals/')) {
|
|
581
|
+
const channel = repo.replace('signals/', '');
|
|
582
|
+
candidates.push(path.join(signalsDir, channel, `${entry.date}.md`));
|
|
583
|
+
candidates.push(path.join(signalsDir, channel, `${entry.date}-summary.md`));
|
|
584
|
+
} else if (repo.includes('/')) {
|
|
585
|
+
// owner/repo format — find which channel it's under
|
|
586
|
+
for (const channel of ['github', 'intercom', 'notion']) {
|
|
587
|
+
candidates.push(path.join(signalsDir, channel, repo, `${entry.date}.md`));
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
for (const fp of candidates) {
|
|
591
|
+
try {
|
|
592
|
+
const content = fs.readFileSync(fp, 'utf8').toLowerCase();
|
|
593
|
+
searchable += ' ' + content.replace(/[-_]/g, ' ');
|
|
594
|
+
break;
|
|
595
|
+
} catch {
|
|
596
|
+
// Try next candidate
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
|
|
572
602
|
// Also include the full journal entry content if available
|
|
573
|
-
const journalContent = getJournalContent(entry.date, entry.user);
|
|
603
|
+
const journalContent = entry.source !== 'signal' ? getJournalContent(entry.date, entry.user) : null;
|
|
574
604
|
if (journalContent) {
|
|
575
605
|
// Find this entry's section in the journal file.
|
|
576
606
|
// Try exact match first, then normalize hyphens/spaces for fuzzy match.
|
package/bin/team-context.js
CHANGED
|
@@ -4322,17 +4322,17 @@ function ensureContainerConfig() {
|
|
|
4322
4322
|
changed = true;
|
|
4323
4323
|
}
|
|
4324
4324
|
|
|
4325
|
-
//
|
|
4326
|
-
//
|
|
4325
|
+
// Override container-specific paths in digest config — the mounted connectors.json
|
|
4326
|
+
// may have host paths that don't exist inside the container
|
|
4327
4327
|
if (config.digest) {
|
|
4328
|
-
const
|
|
4328
|
+
const containerPaths = {
|
|
4329
4329
|
store_path: process.env.TEAM_CONTEXT_STORE_PATH || contentStore.DEFAULT_STORE_PATH,
|
|
4330
4330
|
journal_dir: process.env.TEAM_CONTEXT_JOURNALS_DIR || '/data/journals',
|
|
4331
4331
|
signals_dir: process.env.TEAM_CONTEXT_SIGNALS_DIR || contentStore.DEFAULT_SIGNALS_DIR,
|
|
4332
4332
|
team_context_dir: process.env.TEAM_CONTEXT_TEAM_CONTEXT_DIR || '',
|
|
4333
4333
|
};
|
|
4334
|
-
for (const [key, val] of Object.entries(
|
|
4335
|
-
if (
|
|
4334
|
+
for (const [key, val] of Object.entries(containerPaths)) {
|
|
4335
|
+
if (config.digest[key] !== val) {
|
|
4336
4336
|
config.digest[key] = val;
|
|
4337
4337
|
changed = true;
|
|
4338
4338
|
}
|
|
@@ -4356,14 +4356,14 @@ function ensureContainerConfig() {
|
|
|
4356
4356
|
changed = true;
|
|
4357
4357
|
}
|
|
4358
4358
|
|
|
4359
|
-
//
|
|
4359
|
+
// Override container-specific paths in bot config (same reason as digest above)
|
|
4360
4360
|
if (config.slack_bot) {
|
|
4361
|
-
const
|
|
4361
|
+
const botPaths = {
|
|
4362
4362
|
store_path: process.env.TEAM_CONTEXT_STORE_PATH || contentStore.DEFAULT_STORE_PATH,
|
|
4363
4363
|
journal_dir: process.env.TEAM_CONTEXT_JOURNALS_DIR || '/data/journals',
|
|
4364
4364
|
};
|
|
4365
|
-
for (const [key, val] of Object.entries(
|
|
4366
|
-
if (
|
|
4365
|
+
for (const [key, val] of Object.entries(botPaths)) {
|
|
4366
|
+
if (config.slack_bot[key] !== val) {
|
|
4367
4367
|
config.slack_bot[key] = val;
|
|
4368
4368
|
changed = true;
|
|
4369
4369
|
}
|
package/doctor.sh
CHANGED
|
@@ -466,6 +466,52 @@ check_storage_backend() {
|
|
|
466
466
|
else
|
|
467
467
|
[ "$VERBOSE" = true ] && info "No connectors.json — signal freshness check skipped"
|
|
468
468
|
fi
|
|
469
|
+
|
|
470
|
+
# ── 4. Embedding coverage ───────────────────────────────────────────────
|
|
471
|
+
local EMBED_RESULT
|
|
472
|
+
EMBED_RESULT=$(node -e "
|
|
473
|
+
try {
|
|
474
|
+
const storage = require('$SCRIPT_DIR/bin/storage/index.js');
|
|
475
|
+
const storePath = '$WAYFIND_DIR/content-store';
|
|
476
|
+
const backend = storage.getBackend(storePath);
|
|
477
|
+
const idx = backend.loadIndex();
|
|
478
|
+
if (!idx || !idx.entries) { console.log('SKIP'); process.exit(0); }
|
|
479
|
+
let total = 0, embedded = 0;
|
|
480
|
+
for (const e of Object.values(idx.entries)) { total++; if (e.hasEmbedding) embedded++; }
|
|
481
|
+
if (total === 0) { console.log('SKIP'); process.exit(0); }
|
|
482
|
+
const pct = Math.round(100 * embedded / total);
|
|
483
|
+
const hasKey = !!(process.env.OPENAI_API_KEY || process.env.AZURE_OPENAI_EMBEDDING_ENDPOINT);
|
|
484
|
+
console.log(pct + ':' + embedded + ':' + total + ':' + hasKey);
|
|
485
|
+
} catch (e) {
|
|
486
|
+
console.log('SKIP:' + e.message.split('\n')[0]);
|
|
487
|
+
}
|
|
488
|
+
" 2>/dev/null) || EMBED_RESULT="SKIP"
|
|
489
|
+
|
|
490
|
+
if [[ "$EMBED_RESULT" != SKIP* ]]; then
|
|
491
|
+
IFS=':' read -r PCT EMBEDDED TOTAL HAS_KEY <<< "$EMBED_RESULT"
|
|
492
|
+
if [ "$PCT" -ge 90 ]; then
|
|
493
|
+
ok "Embeddings: $EMBEDDED/$TOTAL entries ($PCT%)"
|
|
494
|
+
elif [ "$PCT" -ge 50 ]; then
|
|
495
|
+
warn "Embeddings: only $EMBEDDED/$TOTAL entries ($PCT%) — search quality degraded"
|
|
496
|
+
info "Run: wayfind reindex (with OPENAI_API_KEY or AZURE_OPENAI_EMBEDDING_* set)"
|
|
497
|
+
ISSUES=$((ISSUES + 1))
|
|
498
|
+
elif [ "$PCT" -gt 0 ]; then
|
|
499
|
+
err "Embeddings: $EMBEDDED/$TOTAL entries ($PCT%) — semantic search mostly broken"
|
|
500
|
+
info "Run: wayfind reindex (with OPENAI_API_KEY or AZURE_OPENAI_EMBEDDING_* set)"
|
|
501
|
+
ISSUES=$((ISSUES + 1))
|
|
502
|
+
else
|
|
503
|
+
if [ "$HAS_KEY" = "true" ]; then
|
|
504
|
+
err "Embeddings: 0/$TOTAL entries — embedding API key is set but no embeddings generated"
|
|
505
|
+
info "Run: wayfind reindex to generate embeddings"
|
|
506
|
+
ISSUES=$((ISSUES + 1))
|
|
507
|
+
else
|
|
508
|
+
warn "Embeddings: 0/$TOTAL entries — no embedding API key configured"
|
|
509
|
+
info "Set OPENAI_API_KEY or AZURE_OPENAI_EMBEDDING_* then run: wayfind reindex"
|
|
510
|
+
ISSUES=$((ISSUES + 1))
|
|
511
|
+
fi
|
|
512
|
+
fi
|
|
513
|
+
fi
|
|
514
|
+
|
|
469
515
|
set -e # Restore errexit
|
|
470
516
|
}
|
|
471
517
|
|
package/package.json
CHANGED