@pellux/goodvibes-sdk 0.28.19 → 0.28.20
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/dist/_internal/contracts/artifacts/operator-contract.json +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.d.ts +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.js +1 -1
- package/dist/_internal/contracts/generated/operator-contract.js +1 -1
- package/dist/_internal/platform/knowledge/home-graph/rendering.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/home-graph/rendering.js +53 -8
- package/dist/_internal/platform/knowledge/semantic/fact-quality.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/fact-quality.js +4 -0
- package/dist/_internal/platform/knowledge/semantic/service.d.ts +1 -0
- package/dist/_internal/platform/knowledge/semantic/service.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/service.js +22 -0
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Synced from packages/contracts/src/generated/foundation-metadata.ts
|
|
2
2
|
export const FOUNDATION_METADATA = {
|
|
3
3
|
"productId": "goodvibes",
|
|
4
|
-
"productVersion": "0.28.
|
|
4
|
+
"productVersion": "0.28.20",
|
|
5
5
|
"operatorMethodCount": 265,
|
|
6
6
|
"operatorEventCount": 30,
|
|
7
7
|
"peerEndpointCount": 6
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rendering.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/home-graph/rendering.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EAEpB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,aAAa,CAAC;AAIrB,OAAO,KAAK,EAA6B,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMnG,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,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AAK,EAAE,oBAAoB,EAAE,OAAO,GAAE;IACrE,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC,GAAG,MAAM,CAkBd;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,GAAE,iBAAsB,GAAG,kBAAkB,CAcnH;AA6VD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,oBAAoB,EAAE,EACvC,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,EAC5B,OAAO,EAAE,SAAS,qBAAqB,EAAE,GACxC,oBAAoB,EAAE,CAUxB"}
|
|
@@ -287,9 +287,9 @@ function renderSourceList(title, sources) {
|
|
|
287
287
|
].join('\n');
|
|
288
288
|
}
|
|
289
289
|
function renderSemanticFacts(title, facts) {
|
|
290
|
-
const entries = facts
|
|
290
|
+
const entries = dedupePageFacts(facts
|
|
291
291
|
.filter(isUsefulHomeGraphPageFact)
|
|
292
|
-
.sort((left, right) => semanticFactSortKey(left).localeCompare(semanticFactSortKey(right)) || left.title.localeCompare(right.title))
|
|
292
|
+
.sort((left, right) => semanticFactSortKey(left).localeCompare(semanticFactSortKey(right)) || left.title.localeCompare(right.title)))
|
|
293
293
|
.slice(0, 80);
|
|
294
294
|
if (entries.length === 0)
|
|
295
295
|
return '';
|
|
@@ -304,16 +304,61 @@ function renderSemanticFacts(title, facts) {
|
|
|
304
304
|
...[...groups.entries()].flatMap(([kind, group]) => [
|
|
305
305
|
`### ${titleCase(kind)}`,
|
|
306
306
|
'',
|
|
307
|
-
...group.slice(0, 24).map((
|
|
308
|
-
const value = readString(fact.metadata.value);
|
|
309
|
-
const evidence = readString(fact.metadata.evidence);
|
|
310
|
-
const detail = fact.summary ?? evidence;
|
|
311
|
-
return `- ${fact.title}${value ? `: ${value}` : ''}${detail ? ` - ${detail}` : ''}`;
|
|
312
|
-
}),
|
|
307
|
+
...group.slice(0, 24).map(renderPageFactLine).filter(Boolean),
|
|
313
308
|
'',
|
|
314
309
|
]),
|
|
315
310
|
].join('\n');
|
|
316
311
|
}
|
|
312
|
+
function dedupePageFacts(facts) {
|
|
313
|
+
const seen = new Set();
|
|
314
|
+
const result = [];
|
|
315
|
+
for (const fact of facts) {
|
|
316
|
+
const key = normalizePageFactText(renderPageFactLine(fact));
|
|
317
|
+
if (!key || seen.has(key))
|
|
318
|
+
continue;
|
|
319
|
+
seen.add(key);
|
|
320
|
+
result.push(fact);
|
|
321
|
+
}
|
|
322
|
+
return result;
|
|
323
|
+
}
|
|
324
|
+
function renderPageFactLine(fact) {
|
|
325
|
+
const value = cleanPageFactDetail(readString(fact.metadata.value));
|
|
326
|
+
const summary = cleanPageFactDetail(fact.summary);
|
|
327
|
+
const evidence = cleanPageFactDetail(readString(fact.metadata.evidence));
|
|
328
|
+
const detail = selectPageFactDetail(fact.title, value, summary, evidence);
|
|
329
|
+
const line = `- ${fact.title}${value ? `: ${value}` : ''}${detail ? ` - ${detail}` : ''}`;
|
|
330
|
+
return isLowValueFeatureOrSpecText(line) ? '' : line;
|
|
331
|
+
}
|
|
332
|
+
function selectPageFactDetail(title, value, summary, evidence) {
|
|
333
|
+
for (const detail of [summary, evidence]) {
|
|
334
|
+
if (!detail)
|
|
335
|
+
continue;
|
|
336
|
+
const normalized = normalizePageFactText(detail);
|
|
337
|
+
if (!normalized)
|
|
338
|
+
continue;
|
|
339
|
+
if (value && normalized === normalizePageFactText(value))
|
|
340
|
+
continue;
|
|
341
|
+
if (normalized === normalizePageFactText(title))
|
|
342
|
+
continue;
|
|
343
|
+
if (value && normalized === normalizePageFactText(`${title}: ${value}.`))
|
|
344
|
+
continue;
|
|
345
|
+
if (value && detail.toLowerCase().trim().startsWith(`${title.toLowerCase()}:`))
|
|
346
|
+
continue;
|
|
347
|
+
return detail;
|
|
348
|
+
}
|
|
349
|
+
return undefined;
|
|
350
|
+
}
|
|
351
|
+
function cleanPageFactDetail(value) {
|
|
352
|
+
if (!value)
|
|
353
|
+
return undefined;
|
|
354
|
+
const trimmed = value.trim();
|
|
355
|
+
if (!trimmed || isLowValueFeatureOrSpecText(trimmed))
|
|
356
|
+
return undefined;
|
|
357
|
+
return trimmed;
|
|
358
|
+
}
|
|
359
|
+
function normalizePageFactText(value) {
|
|
360
|
+
return value.toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim();
|
|
361
|
+
}
|
|
317
362
|
function semanticFactsLinkedToSources(sources, nodes, edges) {
|
|
318
363
|
const sourceIds = new Set(sources.map((source) => source.id));
|
|
319
364
|
const factIds = new Set(edges.filter((edge) => (edgeIsActive(edge)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fact-quality.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/semantic/fact-quality.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAcvD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAK/E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAQlE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"fact-quality.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/semantic/fact-quality.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAcvD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAK/E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAQlE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAqIjE;AAsBD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAiB5E"}
|
|
@@ -50,6 +50,7 @@ export function isLowValueFeatureOrSpecText(text) {
|
|
|
50
50
|
return true;
|
|
51
51
|
}
|
|
52
52
|
if (/^\s*\d+\s*(yes|no)\b/.test(lower)
|
|
53
|
+
|| /^\s*0?\d+\s*x\s+(?:ethernet|audio|features?|os|webos|ports?)\b/.test(lower)
|
|
53
54
|
|| /^\s*\d+\s*m\s*\(/.test(lower)
|
|
54
55
|
|| /^\s*\d+(hdmi|usb|audio|ports?|features?|smart)\b/.test(lower)
|
|
55
56
|
|| /^\s*0\s+ports\b/.test(lower)
|
|
@@ -88,6 +89,9 @@ export function isLowValueFeatureOrSpecText(text) {
|
|
|
88
89
|
if (/\b(compare sonic characteristics|listening modes?|listening room|auditioning speakers|speakers side-by-side|same amount of power|money-back guarantee|advisors have listened|best choice for your system|speakercompare listening kit|headphones? brand model)\b/.test(lower)) {
|
|
89
90
|
return true;
|
|
90
91
|
}
|
|
92
|
+
if (/\b(more direct comparison|direct comparison|compare products?|product comparison)\b/.test(lower)) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
91
95
|
if (/\b(prices? & features?|smart tv prices?|latest price|view latest|check .* specifications.*price|current page|loading\.?)\b/.test(lower)) {
|
|
92
96
|
return true;
|
|
93
97
|
}
|
|
@@ -53,5 +53,6 @@ export declare class KnowledgeSemanticService {
|
|
|
53
53
|
selfImprove(input?: KnowledgeSemanticSelfImproveInput): Promise<KnowledgeSemanticSelfImproveResult>;
|
|
54
54
|
private runSelfImproveUnlocked;
|
|
55
55
|
private taskIdsForGaps;
|
|
56
|
+
private waitForActiveAnswerGapRepairs;
|
|
56
57
|
}
|
|
57
58
|
//# sourceMappingURL=service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/semantic/service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAKzD,OAAO,KAAK,EACV,4BAA4B,EAC5B,6BAA6B,EAC7B,iCAAiC,EACjC,4BAA4B,EAC5B,oBAAoB,EACpB,iCAAiC,EACjC,kCAAkC,EACnC,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,+BAA+B;IAC9C,QAAQ,CAAC,GAAG,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,WAAW,CAAC,EAAE,4BAA4B,GAAG,IAAI,CAAC;IAC3D,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CACzC;AAED,qBAAa,wBAAwB;IAKjC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,OAAO;IALjB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAqB;IACtD,OAAO,CAAC,wBAAwB,CAA4D;gBAGzE,KAAK,EAAE,cAAc,EAC9B,OAAO,GAAE,+BAAoC;IAGvD,cAAc,CAAC,WAAW,EAAE,4BAA4B,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;IAO5E,YAAY,CAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE;QAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;QAAC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAO,GAC3E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C;YAe/F,sBAAsB;IAiCpC,OAAO,CAAC,cAAc;YAQR,6BAA6B;CAgB5C"}
|
|
@@ -120,6 +120,14 @@ export class KnowledgeSemanticService {
|
|
|
120
120
|
if (answer.answer.gaps.length === 0 || answerHasUsableEvidence(answer))
|
|
121
121
|
return answer;
|
|
122
122
|
}
|
|
123
|
+
if (repaired.skippedGaps > 0 || repaired.queuedTasks > 0) {
|
|
124
|
+
const waited = await this.waitForActiveAnswerGapRepairs(repairSpaceId, answer.answer.gaps.map((gap) => gap.id), Math.min(15_000, foregroundBudgetMs));
|
|
125
|
+
if (waited) {
|
|
126
|
+
answer = withRefinementTaskIds(await answerKnowledgeQuery({ store: this.store, llm: this.options.llm }, input), foregroundTaskIds);
|
|
127
|
+
if (answer.answer.gaps.length === 0 || answerHasUsableEvidence(answer))
|
|
128
|
+
return answer;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
123
131
|
}
|
|
124
132
|
const refinement = await this.selfImprove({
|
|
125
133
|
knowledgeSpaceId: repairSpaceId,
|
|
@@ -230,6 +238,20 @@ export class KnowledgeSemanticService {
|
|
|
230
238
|
.filter((task) => task.gapId && wanted.has(task.gapId))
|
|
231
239
|
.map((task) => task.id);
|
|
232
240
|
}
|
|
241
|
+
async waitForActiveAnswerGapRepairs(spaceId, gapIds, maxWaitMs) {
|
|
242
|
+
if (gapIds.length === 0 || maxWaitMs <= 0)
|
|
243
|
+
return false;
|
|
244
|
+
const keys = gapIds.map((gapId) => `${spaceId}:${gapId}`);
|
|
245
|
+
const startedAt = Date.now();
|
|
246
|
+
while (Date.now() - startedAt < maxWaitMs) {
|
|
247
|
+
const active = keys.some((key) => this.activeGapRepairs.has(key));
|
|
248
|
+
if (!active)
|
|
249
|
+
return true;
|
|
250
|
+
await yieldToEventLoop();
|
|
251
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
252
|
+
}
|
|
253
|
+
return false;
|
|
254
|
+
}
|
|
233
255
|
}
|
|
234
256
|
function answerRepairSpaceId(answer) {
|
|
235
257
|
for (const gap of answer.answer.gaps) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.28.
|
|
3
|
+
let version = '0.28.20';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|