@pellux/goodvibes-sdk 0.33.31 → 0.33.33
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/contracts/artifacts/operator-contract.json +1 -1
- package/dist/platform/daemon/facade-composition.d.ts.map +1 -1
- package/dist/platform/daemon/facade-composition.js +47 -3
- package/dist/platform/knowledge/scope-records.js +37 -6
- package/dist/platform/version.js +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"facade-composition.d.ts","sourceRoot":"","sources":["../../../src/platform/daemon/facade-composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AA6BvD,OAAO,KAAK,EAAE,oBAAoB,EAA0B,MAAM,wCAAwC,CAAC;AAG3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAuB,MAAM,YAAY,CAAC;AAKpE,YAAY,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,GACvC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EACzB,sCAAsC,EACvC,MAAM,mBAAmB,CAAC;AAiD3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA8HvG;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,2BAA2B,CAkJ5F;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,GAC9C,yBAAyB,CA4K3B;AAED,wBAAgB,kCAAkC,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,aAAa,EAAE,OAAO,2BAA2B,EAAE,mBAAmB,CAAC;IAChF,QAAQ,CAAC,aAAa,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,yBAAyB,EAAE,WAAW,GAAG,QAAQ,CAAC;IACzK,QAAQ,CAAC,4BAA4B,EAAE,CAAC,OAAO,EAAE,OAAO,yBAAyB,EAAE,sBAAsB,GAAG,SAAS,EAAE,KAAK,EAAE;QAC5H,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACxC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC9C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACzC,KAAK,IAAI,CAAC;CACZ,GAAG,IAAI,CAoBP"}
|
|
@@ -6,7 +6,7 @@ import { setTelemetryIncludeRawPrompts } from '../runtime/telemetry/redaction-co
|
|
|
6
6
|
import { BuiltinChannelRuntime, ChannelReplyPipeline, ChannelProviderRuntimeManager, } from '../channels/index.js';
|
|
7
7
|
import { ControlPlaneGateway } from '../control-plane/index.js';
|
|
8
8
|
import { buildSharedSessionAgentSpawnRoutingInput } from '../control-plane/session-intents.js';
|
|
9
|
-
import { KnowledgeGraphqlService } from '../knowledge/index.js';
|
|
9
|
+
import { GOODVIBES_AGENT_KNOWLEDGE_DB_FILE, KnowledgeGraphqlService, KnowledgeSemanticService, KnowledgeService, KnowledgeStore, createProviderBackedKnowledgeSemanticLlm, createWebKnowledgeGapRepairer, } from '../knowledge/index.js';
|
|
10
10
|
import { DaemonControlPlaneHelper } from './control-plane.js';
|
|
11
11
|
import { DaemonSurfaceDeliveryHelper } from './surface-delivery.js';
|
|
12
12
|
import { DaemonSurfaceActionHelper } from './surface-actions.js';
|
|
@@ -19,6 +19,49 @@ import { CATALOG_PROVIDER_NAME_ALIASES } from '../providers/builtin-registry.js'
|
|
|
19
19
|
import { createRuntimeServices } from '../runtime/services.js';
|
|
20
20
|
import { PlatformServiceManager } from './service-manager.js';
|
|
21
21
|
import { PermissionManager, createPermissionConfigReader } from '../permissions/manager.js';
|
|
22
|
+
function hasKnowledgeService(value) {
|
|
23
|
+
if (!value || typeof value !== 'object')
|
|
24
|
+
return false;
|
|
25
|
+
const candidate = value;
|
|
26
|
+
return typeof candidate.getStatus === 'function'
|
|
27
|
+
&& typeof candidate.ask === 'function'
|
|
28
|
+
&& typeof candidate.searchScoped === 'function';
|
|
29
|
+
}
|
|
30
|
+
function ensureAgentKnowledgeService(runtimeServices) {
|
|
31
|
+
const mutableRuntime = runtimeServices;
|
|
32
|
+
if (hasKnowledgeService(mutableRuntime.agentKnowledgeService)) {
|
|
33
|
+
return runtimeServices;
|
|
34
|
+
}
|
|
35
|
+
const store = new KnowledgeStore({
|
|
36
|
+
configManager: runtimeServices.configManager,
|
|
37
|
+
dbFileName: GOODVIBES_AGENT_KNOWLEDGE_DB_FILE,
|
|
38
|
+
});
|
|
39
|
+
const semanticLlm = createProviderBackedKnowledgeSemanticLlm(runtimeServices.providerRegistry, {
|
|
40
|
+
timeoutMs: 20_000,
|
|
41
|
+
maxConcurrent: 1,
|
|
42
|
+
});
|
|
43
|
+
const semanticService = new KnowledgeSemanticService(store, {
|
|
44
|
+
llm: semanticLlm,
|
|
45
|
+
maxLlmSourcesPerReindex: 3,
|
|
46
|
+
});
|
|
47
|
+
const service = new KnowledgeService(store, runtimeServices.artifactStore, undefined, {
|
|
48
|
+
memoryRegistry: runtimeServices.memoryRegistry,
|
|
49
|
+
runtimeBus: runtimeServices.runtimeBus,
|
|
50
|
+
semanticService,
|
|
51
|
+
});
|
|
52
|
+
semanticService.setGapRepairer(createWebKnowledgeGapRepairer({
|
|
53
|
+
searchService: runtimeServices.webSearchService,
|
|
54
|
+
ingestService: service,
|
|
55
|
+
}));
|
|
56
|
+
service.attachRuntimeBus(runtimeServices.runtimeBus);
|
|
57
|
+
Object.defineProperty(mutableRuntime, 'agentKnowledgeService', {
|
|
58
|
+
value: service,
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
});
|
|
63
|
+
return mutableRuntime;
|
|
64
|
+
}
|
|
22
65
|
/**
|
|
23
66
|
* Creates the CompanionLLMProvider adapter that bridges the daemon's
|
|
24
67
|
* ProviderRegistry (chat-based) to the queue-driven async-generator interface
|
|
@@ -181,7 +224,7 @@ export function resolveDaemonFacadeRuntime(config) {
|
|
|
181
224
|
}
|
|
182
225
|
const resolvedConfigManager = configManager ?? config.runtimeServices.configManager;
|
|
183
226
|
const ownedRuntimeBus = config.runtimeServices?.runtimeBus ?? config.runtimeBus ?? new RuntimeEventBus();
|
|
184
|
-
const runtimeServices = config.runtimeServices ?? createRuntimeServices({
|
|
227
|
+
const runtimeServices = ensureAgentKnowledgeService(config.runtimeServices ?? createRuntimeServices({
|
|
185
228
|
configManager: resolvedConfigManager,
|
|
186
229
|
runtimeBus: ownedRuntimeBus,
|
|
187
230
|
runtimeStore: createRuntimeStore(),
|
|
@@ -189,7 +232,7 @@ export function resolveDaemonFacadeRuntime(config) {
|
|
|
189
232
|
getConversationTitle: () => 'goodvibes daemon',
|
|
190
233
|
workingDir: ownedWorkingDir,
|
|
191
234
|
homeDirectory: ownedHomeDirectory,
|
|
192
|
-
});
|
|
235
|
+
}));
|
|
193
236
|
const runtimeBus = runtimeServices.runtimeBus;
|
|
194
237
|
const runtimeStore = runtimeServices.runtimeStore;
|
|
195
238
|
const controlPlaneGateway = new ControlPlaneGateway({
|
|
@@ -203,6 +246,7 @@ export function resolveDaemonFacadeRuntime(config) {
|
|
|
203
246
|
},
|
|
204
247
|
});
|
|
205
248
|
runtimeServices.knowledgeService.attachRuntimeBus(runtimeBus);
|
|
249
|
+
runtimeServices.agentKnowledgeService.attachRuntimeBus(runtimeBus);
|
|
206
250
|
runtimeServices.sessionBroker.attachRuntimeBus(runtimeBus, (agentId) => {
|
|
207
251
|
for (const s of runtimeServices.sessionBroker.listSessions(1000)) {
|
|
208
252
|
if (s.activeAgentId === agentId)
|
|
@@ -147,7 +147,7 @@ function isUngroundedSemanticAnswerGapNode(node) {
|
|
|
147
147
|
function isDefaultExtensionContaminatedSource(source) {
|
|
148
148
|
if (getKnowledgeSpaceId(source) !== DEFAULT_KNOWLEDGE_SPACE_ID)
|
|
149
149
|
return false;
|
|
150
|
-
|
|
150
|
+
const text = [
|
|
151
151
|
source.id,
|
|
152
152
|
source.connectorId,
|
|
153
153
|
source.sourceType,
|
|
@@ -159,7 +159,10 @@ function isDefaultExtensionContaminatedSource(source) {
|
|
|
159
159
|
source.url,
|
|
160
160
|
source.tags.join(' '),
|
|
161
161
|
metadataSearchText(source.metadata),
|
|
162
|
-
].join(' ')
|
|
162
|
+
].join(' ');
|
|
163
|
+
return hasLegacyDefaultAgentWikiMarker(text)
|
|
164
|
+
|| hasDefaultGoodVibesProductNavigationMarker(text)
|
|
165
|
+
|| hasExtensionOnlyKnowledgeMarker(text);
|
|
163
166
|
}
|
|
164
167
|
function isDefaultExtensionContaminatedNode(node, lookup) {
|
|
165
168
|
if (getKnowledgeSpaceId(node) !== DEFAULT_KNOWLEDGE_SPACE_ID)
|
|
@@ -172,14 +175,18 @@ function isDefaultExtensionContaminatedNode(node, lookup) {
|
|
|
172
175
|
return true;
|
|
173
176
|
if (nodeReferencesExtensionObject(node, lookup))
|
|
174
177
|
return true;
|
|
175
|
-
|
|
178
|
+
const text = [
|
|
176
179
|
node.id,
|
|
177
180
|
node.kind,
|
|
181
|
+
node.slug,
|
|
178
182
|
node.title,
|
|
179
183
|
node.summary,
|
|
180
184
|
node.aliases.join(' '),
|
|
181
185
|
metadataSearchText(node.metadata),
|
|
182
|
-
].join(' ')
|
|
186
|
+
].join(' ');
|
|
187
|
+
return hasLegacyDefaultAgentWikiMarker(text)
|
|
188
|
+
|| hasDefaultGoodVibesProductNavigationMarker(text)
|
|
189
|
+
|| hasExtensionOnlyKnowledgeMarker(text);
|
|
183
190
|
}
|
|
184
191
|
function nodeReferencesExtensionObject(node, lookup) {
|
|
185
192
|
for (const nodeId of uniqueStrings([
|
|
@@ -208,14 +215,17 @@ function isDefaultExtensionContaminatedIssue(issue, lookup) {
|
|
|
208
215
|
if (node && isDefaultExtensionContaminatedNode(node, lookup))
|
|
209
216
|
return true;
|
|
210
217
|
}
|
|
211
|
-
|
|
218
|
+
const text = [
|
|
212
219
|
issue.id,
|
|
213
220
|
issue.code,
|
|
214
221
|
issue.message,
|
|
215
222
|
issue.sourceId,
|
|
216
223
|
issue.nodeId,
|
|
217
224
|
metadataSearchText(issue.metadata),
|
|
218
|
-
].join(' ')
|
|
225
|
+
].join(' ');
|
|
226
|
+
return hasLegacyDefaultAgentWikiMarker(text)
|
|
227
|
+
|| hasDefaultGoodVibesProductNavigationMarker(text)
|
|
228
|
+
|| hasExtensionOnlyKnowledgeMarker(text);
|
|
219
229
|
}
|
|
220
230
|
function isDefaultAnswerGapNode(node) {
|
|
221
231
|
return node.kind === 'knowledge_gap'
|
|
@@ -353,3 +363,24 @@ function hasExtensionOnlyKnowledgeMarker(value) {
|
|
|
353
363
|
|| /\bha_(?:device|entity|area|integration|device_passport|room)\b/.test(lower)
|
|
354
364
|
|| /\bhomeassistant:/.test(lower);
|
|
355
365
|
}
|
|
366
|
+
function hasLegacyDefaultAgentWikiMarker(value) {
|
|
367
|
+
const lower = value.toLowerCase();
|
|
368
|
+
const mentionsGoodVibesAgent = /\bgoodvibes\s+agents?\b/.test(lower)
|
|
369
|
+
|| /\bgoodvibes[-_]?agents?\b/.test(lower);
|
|
370
|
+
if (!mentionsGoodVibesAgent)
|
|
371
|
+
return false;
|
|
372
|
+
return /\bdefault[-_]?specification\b/.test(lower)
|
|
373
|
+
|| /\byaml\s+frontmatter\b/.test(lower)
|
|
374
|
+
|| /\bfrontmatter\b/.test(lower)
|
|
375
|
+
|| /\bgoodvibes:\/\/wiki\/default\b/.test(lower);
|
|
376
|
+
}
|
|
377
|
+
function hasDefaultGoodVibesProductNavigationMarker(value) {
|
|
378
|
+
const lower = value.toLowerCase();
|
|
379
|
+
const isGoodVibesRepo = /\bgithub\.com\/mgd34msu\/goodvibes[-_][a-z0-9._-]+\b/.test(lower)
|
|
380
|
+
|| /\bmgd34msu\/goodvibes[-_][a-z0-9._-]+\b/.test(lower);
|
|
381
|
+
if (!isGoodVibesRepo)
|
|
382
|
+
return false;
|
|
383
|
+
return /\bnavigation\s+menu\b/.test(lower)
|
|
384
|
+
|| /\bskip\s+to\s+content\b/.test(lower)
|
|
385
|
+
|| /\bgithub\s+navigation\b/.test(lower);
|
|
386
|
+
}
|
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.33';
|
|
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.33",
|
|
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",
|
|
@@ -453,14 +453,14 @@
|
|
|
453
453
|
"sideEffects": false,
|
|
454
454
|
"type": "module",
|
|
455
455
|
"dependencies": {
|
|
456
|
-
"@pellux/goodvibes-contracts": "0.33.
|
|
457
|
-
"@pellux/goodvibes-daemon-sdk": "0.33.
|
|
458
|
-
"@pellux/goodvibes-errors": "0.33.
|
|
459
|
-
"@pellux/goodvibes-operator-sdk": "0.33.
|
|
460
|
-
"@pellux/goodvibes-peer-sdk": "0.33.
|
|
461
|
-
"@pellux/goodvibes-transport-core": "0.33.
|
|
462
|
-
"@pellux/goodvibes-transport-http": "0.33.
|
|
463
|
-
"@pellux/goodvibes-transport-realtime": "0.33.
|
|
456
|
+
"@pellux/goodvibes-contracts": "0.33.33",
|
|
457
|
+
"@pellux/goodvibes-daemon-sdk": "0.33.33",
|
|
458
|
+
"@pellux/goodvibes-errors": "0.33.33",
|
|
459
|
+
"@pellux/goodvibes-operator-sdk": "0.33.33",
|
|
460
|
+
"@pellux/goodvibes-peer-sdk": "0.33.33",
|
|
461
|
+
"@pellux/goodvibes-transport-core": "0.33.33",
|
|
462
|
+
"@pellux/goodvibes-transport-http": "0.33.33",
|
|
463
|
+
"@pellux/goodvibes-transport-realtime": "0.33.33"
|
|
464
464
|
},
|
|
465
465
|
"optionalDependencies": {
|
|
466
466
|
"@agentclientprotocol/sdk": "^0.21.0",
|