@pellux/goodvibes-sdk 0.33.15 → 0.33.16
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-records.d.ts","sourceRoot":"","sources":["../../../src/platform/knowledge/scope-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,SAAS,CAAC;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,mBAAmB,EAAE,GAAG,SAAS,CAAC;CAC7D;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,qBAAqB,EAC7B,KAAK,GAAE,wBAA6B,GACnC,OAAO,CAET;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,mBAAmB,EACzB,KAAK,GAAE,wBAA6B,EACpC,MAAM,GAAE,oBAAyB,GAChC,OAAO,
|
|
1
|
+
{"version":3,"file":"scope-records.d.ts","sourceRoot":"","sources":["../../../src/platform/knowledge/scope-records.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,wBAAwB,EAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,qBAAqB,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,MAAM,KAAK,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;IACxF,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,qBAAqB,CAAC,GAAG,SAAS,CAAC;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,mBAAmB,CAAC,GAAG,SAAS,CAAC;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,mBAAmB,EAAE,GAAG,SAAS,CAAC;CAC7D;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,qBAAqB,EAC7B,KAAK,GAAE,wBAA6B,GACnC,OAAO,CAET;AAED,wBAAgB,yBAAyB,CACvC,IAAI,EAAE,mBAAmB,EACzB,KAAK,GAAE,wBAA6B,EACpC,MAAM,GAAE,oBAAyB,GAChC,OAAO,CAYT;AAED,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,oBAAoB,EAC3B,KAAK,GAAE,wBAA6B,EACpC,MAAM,GAAE,oBAAyB,GAChC,OAAO,CAWT"}
|
|
@@ -8,7 +8,9 @@ export function knowledgeNodeMatchesScope(node, scope = {}, lookup = {}) {
|
|
|
8
8
|
return true;
|
|
9
9
|
const relatedSpaces = relatedNodeSpaceIds(node, lookup);
|
|
10
10
|
const ownSpace = getKnowledgeSpaceId(node);
|
|
11
|
-
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID
|
|
11
|
+
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID
|
|
12
|
+
&& relatedSpaces.length === 0
|
|
13
|
+
&& (isUngroundedSemanticAnswerGapNode(node) || isUngroundedCatalogDerivedNode(node)))
|
|
12
14
|
return false;
|
|
13
15
|
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID) {
|
|
14
16
|
return ownSpace === scopedSpaceId && (relatedSpaces.length === 0 || relatedSpaces.every((spaceId) => spaceId === scopedSpaceId));
|
|
@@ -21,7 +23,8 @@ export function knowledgeIssueMatchesScope(issue, scope = {}, lookup = {}) {
|
|
|
21
23
|
return true;
|
|
22
24
|
const relatedSpaces = relatedIssueSpaceIds(issue, lookup);
|
|
23
25
|
const ownSpace = getKnowledgeSpaceId(issue);
|
|
24
|
-
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID
|
|
26
|
+
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID
|
|
27
|
+
&& (isUngroundedSemanticAnswerGapIssue(issue, lookup) || isIssueLinkedOnlyToUngroundedAnswerGap(issue, lookup)))
|
|
25
28
|
return false;
|
|
26
29
|
if (scopedSpaceId === DEFAULT_KNOWLEDGE_SPACE_ID) {
|
|
27
30
|
return ownSpace === scopedSpaceId && (relatedSpaces.length === 0 || relatedSpaces.every((spaceId) => spaceId === scopedSpaceId));
|
|
@@ -132,18 +135,51 @@ function isUngroundedSemanticAnswerGapNode(node) {
|
|
|
132
135
|
...readStringArray(node.metadata.subjectIds),
|
|
133
136
|
]).length === 0;
|
|
134
137
|
}
|
|
135
|
-
function isUngroundedSemanticAnswerGapIssue(issue) {
|
|
138
|
+
function isUngroundedSemanticAnswerGapIssue(issue, lookup) {
|
|
136
139
|
return issue.code === 'knowledge.answer_gap'
|
|
137
140
|
&& (issue.metadata.semantic === true || readString(issue.metadata.semantic) === 'true')
|
|
138
141
|
&& uniqueStrings([
|
|
139
142
|
issue.sourceId,
|
|
140
|
-
issue.nodeId,
|
|
141
143
|
readString(issue.metadata.sourceId),
|
|
142
|
-
readString(issue.metadata.nodeId),
|
|
143
144
|
...readStringArray(issue.metadata.sourceIds),
|
|
144
145
|
...readStringArray(issue.metadata.linkedObjectIds),
|
|
145
146
|
...readStringArray(issue.metadata.subjectIds),
|
|
146
|
-
]).length === 0
|
|
147
|
+
]).length === 0
|
|
148
|
+
&& issueNodeIds(issue).every((nodeId) => {
|
|
149
|
+
const node = lookupNode(lookup, nodeId);
|
|
150
|
+
return node ? isUngroundedSemanticAnswerGapNode(node) : true;
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
function isIssueLinkedOnlyToUngroundedAnswerGap(issue, lookup) {
|
|
154
|
+
if (issue.code !== 'knowledge.answer_gap')
|
|
155
|
+
return false;
|
|
156
|
+
const nodeIds = issueNodeIds(issue);
|
|
157
|
+
return nodeIds.length > 0 && nodeIds.every((nodeId) => {
|
|
158
|
+
const node = lookupNode(lookup, nodeId);
|
|
159
|
+
return Boolean(node && isUngroundedSemanticAnswerGapNode(node));
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
function issueNodeIds(issue) {
|
|
163
|
+
return uniqueStrings([
|
|
164
|
+
issue.nodeId,
|
|
165
|
+
readString(issue.metadata.nodeId),
|
|
166
|
+
]);
|
|
167
|
+
}
|
|
168
|
+
function isUngroundedCatalogDerivedNode(node) {
|
|
169
|
+
if (node.sourceId || readString(node.metadata.sourceId) || readStringArray(node.metadata.sourceIds).length > 0)
|
|
170
|
+
return false;
|
|
171
|
+
if (readString(node.metadata.linkedObjectIds) || readStringArray(node.metadata.linkedObjectIds).length > 0)
|
|
172
|
+
return false;
|
|
173
|
+
if (readString(node.metadata.subjectIds) || readStringArray(node.metadata.subjectIds).length > 0)
|
|
174
|
+
return false;
|
|
175
|
+
if (node.kind === 'domain')
|
|
176
|
+
return Boolean(readString(node.metadata.hostname));
|
|
177
|
+
if (node.kind === 'bookmark_folder')
|
|
178
|
+
return Boolean(readString(node.metadata.folderPath));
|
|
179
|
+
if (node.kind !== 'topic')
|
|
180
|
+
return false;
|
|
181
|
+
const tag = readString(node.metadata.tag);
|
|
182
|
+
return Boolean(tag && readOnlyMetadataKeys(node.metadata).every((key) => key === 'tag'));
|
|
147
183
|
}
|
|
148
184
|
function lookupSource(lookup, id) {
|
|
149
185
|
if (!id)
|
|
@@ -168,3 +204,6 @@ function readStringArray(value) {
|
|
|
168
204
|
function uniqueStrings(values) {
|
|
169
205
|
return [...new Set(values.filter((entry) => Boolean(entry && entry.trim().length > 0)))];
|
|
170
206
|
}
|
|
207
|
+
function readOnlyMetadataKeys(metadata) {
|
|
208
|
+
return Object.keys(metadata).filter((key) => !['knowledgeSpaceId', 'namespace'].includes(key));
|
|
209
|
+
}
|
package/dist/platform/version.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.33.
|
|
3
|
+
let version = '0.33.16';
|
|
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.33.
|
|
3
|
+
"version": "0.33.16",
|
|
4
4
|
"description": "TypeScript SDK for building GoodVibes operator, peer, web, mobile, and daemon-connected apps with typed contracts, auth, realtime events, and transport layers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"goodvibes",
|
|
@@ -449,14 +449,14 @@
|
|
|
449
449
|
"sideEffects": false,
|
|
450
450
|
"type": "module",
|
|
451
451
|
"dependencies": {
|
|
452
|
-
"@pellux/goodvibes-contracts": "0.33.
|
|
453
|
-
"@pellux/goodvibes-daemon-sdk": "0.33.
|
|
454
|
-
"@pellux/goodvibes-errors": "0.33.
|
|
455
|
-
"@pellux/goodvibes-operator-sdk": "0.33.
|
|
456
|
-
"@pellux/goodvibes-peer-sdk": "0.33.
|
|
457
|
-
"@pellux/goodvibes-transport-core": "0.33.
|
|
458
|
-
"@pellux/goodvibes-transport-http": "0.33.
|
|
459
|
-
"@pellux/goodvibes-transport-realtime": "0.33.
|
|
452
|
+
"@pellux/goodvibes-contracts": "0.33.16",
|
|
453
|
+
"@pellux/goodvibes-daemon-sdk": "0.33.16",
|
|
454
|
+
"@pellux/goodvibes-errors": "0.33.16",
|
|
455
|
+
"@pellux/goodvibes-operator-sdk": "0.33.16",
|
|
456
|
+
"@pellux/goodvibes-peer-sdk": "0.33.16",
|
|
457
|
+
"@pellux/goodvibes-transport-core": "0.33.16",
|
|
458
|
+
"@pellux/goodvibes-transport-http": "0.33.16",
|
|
459
|
+
"@pellux/goodvibes-transport-realtime": "0.33.16"
|
|
460
460
|
},
|
|
461
461
|
"optionalDependencies": {
|
|
462
462
|
"@agentclientprotocol/sdk": "^0.21.0",
|