@pellux/goodvibes-sdk 0.27.7 → 0.27.9

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.
@@ -3,7 +3,7 @@
3
3
  "product": {
4
4
  "id": "goodvibes",
5
5
  "surface": "operator",
6
- "version": "0.27.7"
6
+ "version": "0.27.9"
7
7
  },
8
8
  "auth": {
9
9
  "modes": [
@@ -1,6 +1,6 @@
1
1
  export declare const FOUNDATION_METADATA: {
2
2
  readonly productId: "goodvibes";
3
- readonly productVersion: "0.27.7";
3
+ readonly productVersion: "0.27.9";
4
4
  readonly operatorMethodCount: 256;
5
5
  readonly operatorEventCount: 30;
6
6
  readonly peerEndpointCount: 6;
@@ -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.27.7",
4
+ "productVersion": "0.27.9",
5
5
  "operatorMethodCount": 256,
6
6
  "operatorEventCount": 30,
7
7
  "peerEndpointCount": 6
@@ -3,7 +3,7 @@ export const OPERATOR_CONTRACT = {
3
3
  "product": {
4
4
  "id": "goodvibes",
5
5
  "surface": "operator",
6
- "version": "0.27.7"
6
+ "version": "0.27.9"
7
7
  },
8
8
  "auth": {
9
9
  "modes": [
@@ -3,10 +3,6 @@ export async function answerHomeGraphQuery(input) {
3
3
  const sources = input.results.flatMap((result) => result.source ? [result.source] : []);
4
4
  const linkedObjects = collectLinkedObjects(input.results, input.state);
5
5
  if (input.semanticService) {
6
- void input.semanticService.enrichSources(uniqueSources(sources), {
7
- knowledgeSpaceId: input.spaceId,
8
- limit: Math.min(3, Math.max(1, sources.length)),
9
- }).catch(() => { });
10
6
  const answer = await input.semanticService.answer({
11
7
  query: input.query.query,
12
8
  knowledgeSpaceId: input.spaceId,
@@ -21,6 +17,10 @@ export async function answerHomeGraphQuery(input) {
21
17
  linkedObjects,
22
18
  noMatchMessage: `No Home Graph knowledge matched "${input.query.query}".`,
23
19
  });
20
+ void input.semanticService.enrichSources(uniqueSources(sources), {
21
+ knowledgeSpaceId: input.spaceId,
22
+ limit: Math.min(3, Math.max(1, sources.length)),
23
+ }).catch(() => { });
24
24
  return {
25
25
  ok: true,
26
26
  spaceId: input.spaceId,
@@ -172,6 +172,7 @@ async function synthesizeAnswer(llm, query, mode, evidence) {
172
172
  'You answer questions from a GoodVibes self-improving knowledge wiki.',
173
173
  'Use only the supplied evidence. Synthesize the answer for the user intent rather than dumping snippets.',
174
174
  'If evidence is insufficient, say what is missing. Prefer concrete features, specs, procedures, and relationships.',
175
+ 'For feature or specification questions, ignore manual boilerplate about accessories, cable recommendations, button maps, batteries, cleaning, servicing, safety, and future product changes unless the user asks about those topics.',
175
176
  'Return only JSON with answer, confidence, usedSourceIds, usedNodeIds, and optional gaps.',
176
177
  ].join(' '),
177
178
  prompt: JSON.stringify({
@@ -357,6 +358,7 @@ function selectEvidenceExcerpt(query, text, facts) {
357
358
  const factLines = facts
358
359
  .map(renderFactForPrompt)
359
360
  .filter((line) => scoreSemanticText(line, tokens) > 0)
361
+ .filter((line) => !featureIntent || !isLowValueFeatureOrSpecText(line))
360
362
  .slice(0, 12);
361
363
  const windows = evidenceWindows(text, tokens)
362
364
  .filter((line) => !featureIntent || !isLowValueFeatureOrSpecText(line))
@@ -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,CAmBjE;AAED,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAa5E"}
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,CAyCjE;AAWD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAa5E"}
@@ -29,13 +29,36 @@ export function semanticFactText(fact) {
29
29
  export function isLowValueFeatureOrSpecText(text) {
30
30
  const lower = text.toLowerCase();
31
31
  const magicRemoteDetail = /\bmagic remote\b/.test(lower) || /\bbluetooth\b/.test(lower);
32
- if (/\b(items? supplied|supplied items?|included accessories|optional extras?|sold separately|separate purchase|accessories may vary|contents? of (this )?manual|may be changed|without prior notice|available menus? and options?|certified cable|unapproved items?)\b/.test(lower)) {
32
+ if (isTruncatedManualFragment(lower))
33
+ return true;
34
+ if (/\b(items? supplied|supplied items?|included accessories|optional extras?|sold separately|separate purchase|accessories may vary|contents? of (this )?manual|may be changed|may change|subject to change|without prior notice|available menus? and options?|certified cable|unapproved items?)\b/.test(lower)) {
35
+ return true;
36
+ }
37
+ if (/\b(new features? may be added|features? may be added|specifications? may change|product upgrades?|due to product upgrades?)\b/.test(lower)) {
38
+ return true;
39
+ }
40
+ if (/\b(recommended hdmi cable types?|hdmi cable types?|ultra high speed hdmi cables?|usb extension cable|extension cable|physically fit)\b/.test(lower)) {
41
+ return true;
42
+ }
43
+ if (/\b(button|buttons|remote control)\b/.test(lower) && /[\u25b2\u25bc\u25c4\u25ba]|[▲▼◄►]|\\u25/.test(text)) {
33
44
  return true;
34
45
  }
35
46
  if (!magicRemoteDetail && /\b(may vary|depending (upon|on) (the )?model|depending on country|depending on region)\b/.test(lower)) {
36
47
  return true;
37
48
  }
38
- if (/\b(fasten|screws?|stand|tip over|overturn|fall over|transporting|move the tv|moving the tv|oils?|lubricants?|cleaning cloth|power cord|electric shock|fire hazard|near water|ventilation|antenna grounding)\b/.test(lower)) {
49
+ if (/\b(fasten|screws?|stand|tip over|overturn|fall over|transporting|move the tv|moving the tv|oils?|lubricants?|cleaning cloth|dry cloth|power cord|electric shock|fire hazard|near water|ventilation|antenna grounding|qualified personnel|qualified service personnel|service personnel|customer service|servicing|repair is required|refer all servicing)\b/.test(lower)) {
50
+ return true;
51
+ }
52
+ if (/\b(infrared light|remote control sensor|point (the )?(magic )?remote|aim (the )?(magic )?remote)\b/.test(lower)) {
53
+ return true;
54
+ }
55
+ if (/\bif (the )?device (doesn'?t|does not) support\b/.test(lower) && /\bmay not work properly\b/.test(lower)) {
56
+ return true;
57
+ }
58
+ if (/\bchange\b/.test(lower) && /\bsetting to off\b/.test(lower)) {
59
+ return true;
60
+ }
61
+ if (/\bbatter(y|ies)\b/.test(lower) && /\b(remote|magic remote|button)\b/.test(lower)) {
39
62
  return true;
40
63
  }
41
64
  if (/\b(bezel|less than \d+(?:\.\d+)?\s*(mm|cm|inches?)|does not fit|will not fit|fit your tv'?s usb port|usb port may not fit)\b/.test(lower)) {
@@ -46,6 +69,16 @@ export function isLowValueFeatureOrSpecText(text) {
46
69
  }
47
70
  return false;
48
71
  }
72
+ function isTruncatedManualFragment(value) {
73
+ const trimmed = value.trim();
74
+ if (trimmed.length === 0)
75
+ return false;
76
+ const openParens = trimmed.match(/\(/g)?.length ?? 0;
77
+ const closeParens = trimmed.match(/\)/g)?.length ?? 0;
78
+ if (openParens > closeParens && /[\w\d]$/.test(trimmed))
79
+ return true;
80
+ return false;
81
+ }
49
82
  export function hasConcreteFeatureSignal(text) {
50
83
  return /\b(hdmi|usb|hdr|hdr10|dolby|vision|earc|arc|bluetooth|wi-?fi|ethernet|voice|remote|game|filmmaker|airplay|chromecast|resolution|4k|8k|refresh|ports?|speakers?|audio|display|screen|apps?|streaming|matter|energy monitoring|scheduling|sensor|battery|z-?wave|zigbee|thread|motion|temperature|humidity|camera|recording|lock|garage|local control|api|automation)\b/.test(text.toLowerCase());
51
84
  }
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '0.27.7';
3
+ let version = '0.27.9';
4
4
  try {
5
5
  const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
6
6
  version = pkg.version ?? version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pellux/goodvibes-sdk",
3
- "version": "0.27.7",
3
+ "version": "0.27.9",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/mgd34msu/goodvibes-sdk.git"