@pellux/goodvibes-sdk 0.33.31 → 0.33.32

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.33.31"
6
+ "version": "0.33.32"
7
7
  },
8
8
  "auth": {
9
9
  "modes": [
@@ -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;AAqBvD,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;AAI3B;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,8BAA8B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,oBAAoB,CA8HvG;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,YAAY,GAAG,2BAA2B,CAiJ5F;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,QA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7C,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
- return hasExtensionOnlyKnowledgeMarker([
150
+ const text = [
151
151
  source.id,
152
152
  source.connectorId,
153
153
  source.sourceType,
@@ -159,7 +159,8 @@ 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) || hasExtensionOnlyKnowledgeMarker(text);
163
164
  }
164
165
  function isDefaultExtensionContaminatedNode(node, lookup) {
165
166
  if (getKnowledgeSpaceId(node) !== DEFAULT_KNOWLEDGE_SPACE_ID)
@@ -172,14 +173,16 @@ function isDefaultExtensionContaminatedNode(node, lookup) {
172
173
  return true;
173
174
  if (nodeReferencesExtensionObject(node, lookup))
174
175
  return true;
175
- return hasExtensionOnlyKnowledgeMarker([
176
+ const text = [
176
177
  node.id,
177
178
  node.kind,
179
+ node.slug,
178
180
  node.title,
179
181
  node.summary,
180
182
  node.aliases.join(' '),
181
183
  metadataSearchText(node.metadata),
182
- ].join(' '));
184
+ ].join(' ');
185
+ return hasLegacyDefaultAgentWikiMarker(text) || hasExtensionOnlyKnowledgeMarker(text);
183
186
  }
184
187
  function nodeReferencesExtensionObject(node, lookup) {
185
188
  for (const nodeId of uniqueStrings([
@@ -208,14 +211,15 @@ function isDefaultExtensionContaminatedIssue(issue, lookup) {
208
211
  if (node && isDefaultExtensionContaminatedNode(node, lookup))
209
212
  return true;
210
213
  }
211
- return hasExtensionOnlyKnowledgeMarker([
214
+ const text = [
212
215
  issue.id,
213
216
  issue.code,
214
217
  issue.message,
215
218
  issue.sourceId,
216
219
  issue.nodeId,
217
220
  metadataSearchText(issue.metadata),
218
- ].join(' '));
221
+ ].join(' ');
222
+ return hasLegacyDefaultAgentWikiMarker(text) || hasExtensionOnlyKnowledgeMarker(text);
219
223
  }
220
224
  function isDefaultAnswerGapNode(node) {
221
225
  return node.kind === 'knowledge_gap'
@@ -353,3 +357,14 @@ function hasExtensionOnlyKnowledgeMarker(value) {
353
357
  || /\bha_(?:device|entity|area|integration|device_passport|room)\b/.test(lower)
354
358
  || /\bhomeassistant:/.test(lower);
355
359
  }
360
+ function hasLegacyDefaultAgentWikiMarker(value) {
361
+ const lower = value.toLowerCase();
362
+ const mentionsGoodVibesAgent = /\bgoodvibes\s+agents?\b/.test(lower)
363
+ || /\bgoodvibes[-_]?agents?\b/.test(lower);
364
+ if (!mentionsGoodVibesAgent)
365
+ return false;
366
+ return /\bdefault[-_]?specification\b/.test(lower)
367
+ || /\byaml\s+frontmatter\b/.test(lower)
368
+ || /\bfrontmatter\b/.test(lower)
369
+ || /\bgoodvibes:\/\/wiki\/default\b/.test(lower);
370
+ }
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
- let version = '0.33.31';
3
+ let version = '0.33.32';
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.31",
3
+ "version": "0.33.32",
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.31",
457
- "@pellux/goodvibes-daemon-sdk": "0.33.31",
458
- "@pellux/goodvibes-errors": "0.33.31",
459
- "@pellux/goodvibes-operator-sdk": "0.33.31",
460
- "@pellux/goodvibes-peer-sdk": "0.33.31",
461
- "@pellux/goodvibes-transport-core": "0.33.31",
462
- "@pellux/goodvibes-transport-http": "0.33.31",
463
- "@pellux/goodvibes-transport-realtime": "0.33.31"
456
+ "@pellux/goodvibes-contracts": "0.33.32",
457
+ "@pellux/goodvibes-daemon-sdk": "0.33.32",
458
+ "@pellux/goodvibes-errors": "0.33.32",
459
+ "@pellux/goodvibes-operator-sdk": "0.33.32",
460
+ "@pellux/goodvibes-peer-sdk": "0.33.32",
461
+ "@pellux/goodvibes-transport-core": "0.33.32",
462
+ "@pellux/goodvibes-transport-http": "0.33.32",
463
+ "@pellux/goodvibes-transport-realtime": "0.33.32"
464
464
  },
465
465
  "optionalDependencies": {
466
466
  "@agentclientprotocol/sdk": "^0.21.0",