wayfind 2.0.66 → 2.0.68
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
CHANGED
|
@@ -156,8 +156,11 @@ function isRepoExcluded(repo) {
|
|
|
156
156
|
if (!repo) return (INCLUDE_REPOS.length > 0); // exclude null repo only when allowlist active
|
|
157
157
|
const lower = repo.toLowerCase();
|
|
158
158
|
|
|
159
|
-
// Allowlist takes priority — if set, only matching repos pass
|
|
159
|
+
// Allowlist takes priority — if set, only matching repos pass.
|
|
160
|
+
// Unqualified repo names (no '/') are always allowed — they're team member journals
|
|
161
|
+
// written without an org prefix and are almost certainly internal team work.
|
|
160
162
|
if (INCLUDE_REPOS.length > 0) {
|
|
163
|
+
if (!lower.includes('/')) return false; // unqualified names pass through
|
|
161
164
|
return !INCLUDE_REPOS.some(pattern => {
|
|
162
165
|
if (pattern.endsWith('/*')) {
|
|
163
166
|
// org/* wildcard — match org prefix
|
package/bin/slack-bot.js
CHANGED
|
@@ -554,6 +554,47 @@ function stripTemporalWords(query) {
|
|
|
554
554
|
.join(' ');
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
+
/**
|
|
558
|
+
* Detect a person's name in a query and resolve it to an author slug.
|
|
559
|
+
* Looks in members/ profiles for a name match. Falls back to naive first-name match.
|
|
560
|
+
* Returns lowercase slug or null.
|
|
561
|
+
*/
|
|
562
|
+
function resolveAuthorFromQuery(query, config) {
|
|
563
|
+
const membersDir = resolveMembersDir(config);
|
|
564
|
+
const knownAuthors = [];
|
|
565
|
+
|
|
566
|
+
if (membersDir) {
|
|
567
|
+
try {
|
|
568
|
+
const files = fs.readdirSync(membersDir).filter(f => f.endsWith('.json'));
|
|
569
|
+
for (const file of files) {
|
|
570
|
+
try {
|
|
571
|
+
const m = JSON.parse(fs.readFileSync(path.join(membersDir, file), 'utf8'));
|
|
572
|
+
const slug = file.replace('.json', '').toLowerCase();
|
|
573
|
+
const name = (m.name || '').toLowerCase();
|
|
574
|
+
const firstName = name.split(/\s+/)[0];
|
|
575
|
+
knownAuthors.push({ slug, name, firstName });
|
|
576
|
+
} catch {}
|
|
577
|
+
}
|
|
578
|
+
} catch {}
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
const q = query.toLowerCase();
|
|
582
|
+
// Check for person-directed query patterns
|
|
583
|
+
const personMatch = q.match(/\b(?:did|has|have|from|by|about|for)\s+([a-z]+)\b/i);
|
|
584
|
+
if (!personMatch) return null;
|
|
585
|
+
const candidate = personMatch[1].toLowerCase();
|
|
586
|
+
|
|
587
|
+
// Match against known members
|
|
588
|
+
for (const a of knownAuthors) {
|
|
589
|
+
if (a.slug === candidate || a.firstName === candidate || a.name === candidate) {
|
|
590
|
+
return a.slug;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
// If no members dir, just use the extracted name as a slug
|
|
595
|
+
return candidate.length > 2 ? candidate : null;
|
|
596
|
+
}
|
|
597
|
+
|
|
557
598
|
async function searchDecisionTrail(query, config) {
|
|
558
599
|
const searchOpts = {
|
|
559
600
|
limit: MAX_SEARCH_RESULTS,
|
|
@@ -568,6 +609,10 @@ async function searchDecisionTrail(query, config) {
|
|
|
568
609
|
searchOpts.repos = config._repoFilter;
|
|
569
610
|
}
|
|
570
611
|
|
|
612
|
+
// If query is about a specific person, filter to their entries
|
|
613
|
+
const authorFilter = resolveAuthorFromQuery(query, config);
|
|
614
|
+
if (authorFilter) searchOpts.user = authorFilter;
|
|
615
|
+
|
|
571
616
|
// Resolve temporal references to date filters
|
|
572
617
|
const dateFilters = resolveDateFilters(query);
|
|
573
618
|
if (dateFilters.since) searchOpts.since = dateFilters.since;
|
package/package.json
CHANGED