@agentvault/agentvault 0.19.68 → 0.19.69

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":"openclaw-entry.d.ts","sourceRoot":"","sources":["../src/openclaw-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,qBAAqB,CAAC;AA4D7B,gFAAgF;AAChF,eAAO,IAAI,oBAAoB,SAAQ,CAAC;AA+CxC,uEAAuE;AACvE,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9C;AAED;;;;;GAKG;AACH,iBAAS,yBAAyB,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,OAAO,GACvB,OAAO,CAgBT;AAED,sFAAsF;AACtF,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiBR;AA0qCD,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;;;;;kBAQrD,iBAAiB;;AAJjC,wBA+WE"}
1
+ {"version":3,"file":"openclaw-entry.d.ts","sourceRoot":"","sources":["../src/openclaw-entry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH,OAAO,KAAK,EACV,iBAAiB,EASlB,MAAM,qBAAqB,CAAC;AA4D7B,gFAAgF;AAChF,eAAO,IAAI,oBAAoB,SAAQ,CAAC;AA+CxC,uEAAuE;AACvE,iBAAS,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAS9C;AAED;;;;;GAKG;AACH,iBAAS,yBAAyB,CAChC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,cAAc,CAAC,EAAE,OAAO,GACvB,OAAO,CAgBT;AAED,sFAAsF;AACtF,iBAAS,cAAc,CACrB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,GAChB,MAAM,CAiBR;AAouCD,OAAO,EAAE,cAAc,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC;;;;;kBAQrD,iBAAiB;;AAJjC,wBA+WE"}
@@ -49281,6 +49281,40 @@ function _stripMentions(text, agentName, accountId) {
49281
49281
  return full;
49282
49282
  }).replace(/^\s+/, "").trim();
49283
49283
  }
49284
+ var _cachedSkillInstructions = null;
49285
+ var _skillCacheExpiry = 0;
49286
+ async function _fetchSkillInstructions(apiUrl, jwt, hubId) {
49287
+ if (_cachedSkillInstructions !== null && Date.now() < _skillCacheExpiry) {
49288
+ return _cachedSkillInstructions;
49289
+ }
49290
+ try {
49291
+ const headers = {};
49292
+ if (jwt) headers["Authorization"] = `Bearer ${jwt}`;
49293
+ const res = await fetch(`${apiUrl}/api/v1/hub/identities/${hubId}/config`, { headers });
49294
+ if (!res.ok) return "";
49295
+ const data = await res.json();
49296
+ const capabilities = data.capabilities || [];
49297
+ const skills = capabilities.filter((c2) => c2.skill_content);
49298
+ if (skills.length === 0) {
49299
+ _cachedSkillInstructions = "";
49300
+ _skillCacheExpiry = Date.now() + 3e5;
49301
+ return "";
49302
+ }
49303
+ const lines = ["## Your Skills (from AgentVault Hub)", ""];
49304
+ for (const skill of skills) {
49305
+ lines.push(`### ${skill.capability_name}`);
49306
+ if (skill.description) lines.push(skill.description);
49307
+ if (skill.skill_content) lines.push(`
49308
+ ${skill.skill_content}`);
49309
+ lines.push("");
49310
+ }
49311
+ _cachedSkillInstructions = lines.join("\n");
49312
+ _skillCacheExpiry = Date.now() + 3e5;
49313
+ return _cachedSkillInstructions;
49314
+ } catch {
49315
+ return "";
49316
+ }
49317
+ }
49284
49318
  async function _recallMemories(apiUrl, apiKey, hubId, query, limit = 5) {
49285
49319
  try {
49286
49320
  const params = new URLSearchParams({ q: query, limit: String(limit) });
@@ -49635,6 +49669,14 @@ async function handleInbound(params) {
49635
49669
  if (memoryContext) {
49636
49670
  plaintext = memoryContext + "\n---\n\n" + plaintext;
49637
49671
  }
49672
+ const skillInstructions = await _fetchSkillInstructions(
49673
+ channel.config.apiUrl,
49674
+ channel.config.apiKey,
49675
+ channel.config.hubId || ""
49676
+ );
49677
+ if (skillInstructions) {
49678
+ plaintext = skillInstructions + "\n---\n\n" + plaintext;
49679
+ }
49638
49680
  }
49639
49681
  let contextBody = plaintext;
49640
49682
  if (isRoomMessage && metadata.roomId && channel.getRoomHistory) {