@elizaos/plugin-knowledge 2.0.0-alpha.6 → 2.0.0-alpha.8

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.
@@ -169,27 +169,32 @@ import { Buffer as Buffer2 } from "node:buffer";
169
169
  import { createHash as createHash2 } from "node:crypto";
170
170
  import * as mammoth from "mammoth";
171
171
  import { extractText } from "unpdf";
172
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/native.js
173
+ import { randomUUID } from "node:crypto";
174
+ var native_default = { randomUUID };
172
175
 
173
- // node_modules/uuid/dist-node/regex.js
176
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/rng.js
177
+ import { randomFillSync } from "node:crypto";
178
+ var rnds8Pool = new Uint8Array(256);
179
+ var poolPtr = rnds8Pool.length;
180
+ function rng() {
181
+ if (poolPtr > rnds8Pool.length - 16) {
182
+ randomFillSync(rnds8Pool);
183
+ poolPtr = 0;
184
+ }
185
+ return rnds8Pool.slice(poolPtr, poolPtr += 16);
186
+ }
187
+
188
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/regex.js
174
189
  var regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
175
190
 
176
- // node_modules/uuid/dist-node/validate.js
191
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/validate.js
177
192
  function validate(uuid) {
178
193
  return typeof uuid === "string" && regex_default.test(uuid);
179
194
  }
180
195
  var validate_default = validate;
181
196
 
182
- // node_modules/uuid/dist-node/parse.js
183
- function parse(uuid) {
184
- if (!validate_default(uuid)) {
185
- throw TypeError("Invalid UUID");
186
- }
187
- let v;
188
- return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
189
- }
190
- var parse_default = parse;
191
-
192
- // node_modules/uuid/dist-node/stringify.js
197
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/stringify.js
193
198
  var byteToHex = [];
194
199
  for (let i = 0;i < 256; ++i) {
195
200
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -198,59 +203,7 @@ function unsafeStringify(arr, offset = 0) {
198
203
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
199
204
  }
200
205
 
201
- // node_modules/uuid/dist-node/rng.js
202
- import { randomFillSync } from "node:crypto";
203
- var rnds8Pool = new Uint8Array(256);
204
- var poolPtr = rnds8Pool.length;
205
- function rng() {
206
- if (poolPtr > rnds8Pool.length - 16) {
207
- randomFillSync(rnds8Pool);
208
- poolPtr = 0;
209
- }
210
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
211
- }
212
-
213
- // node_modules/uuid/dist-node/v35.js
214
- function stringToBytes(str) {
215
- str = unescape(encodeURIComponent(str));
216
- const bytes = new Uint8Array(str.length);
217
- for (let i = 0;i < str.length; ++i) {
218
- bytes[i] = str.charCodeAt(i);
219
- }
220
- return bytes;
221
- }
222
- var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
223
- var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
224
- function v35(version, hash, value, namespace, buf, offset) {
225
- const valueBytes = typeof value === "string" ? stringToBytes(value) : value;
226
- const namespaceBytes = typeof namespace === "string" ? parse_default(namespace) : namespace;
227
- if (typeof namespace === "string") {
228
- namespace = parse_default(namespace);
229
- }
230
- if (namespace?.length !== 16) {
231
- throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
232
- }
233
- let bytes = new Uint8Array(16 + valueBytes.length);
234
- bytes.set(namespaceBytes);
235
- bytes.set(valueBytes, namespaceBytes.length);
236
- bytes = hash(bytes);
237
- bytes[6] = bytes[6] & 15 | version;
238
- bytes[8] = bytes[8] & 63 | 128;
239
- if (buf) {
240
- offset = offset || 0;
241
- for (let i = 0;i < 16; ++i) {
242
- buf[offset + i] = bytes[i];
243
- }
244
- return buf;
245
- }
246
- return unsafeStringify(bytes);
247
- }
248
-
249
- // node_modules/uuid/dist-node/native.js
250
- import { randomUUID } from "node:crypto";
251
- var native_default = { randomUUID };
252
-
253
- // node_modules/uuid/dist-node/v4.js
206
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v4.js
254
207
  function _v4(options, buf, offset) {
255
208
  options = options || {};
256
209
  const rnds = options.random ?? options.rng?.() ?? rng();
@@ -278,7 +231,7 @@ function v4(options, buf, offset) {
278
231
  return _v4(options, buf, offset);
279
232
  }
280
233
  var v4_default = v4;
281
- // node_modules/uuid/dist-node/sha1.js
234
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/sha1.js
282
235
  import { createHash } from "node:crypto";
283
236
  function sha1(bytes) {
284
237
  if (Array.isArray(bytes)) {
@@ -290,7 +243,53 @@ function sha1(bytes) {
290
243
  }
291
244
  var sha1_default = sha1;
292
245
 
293
- // node_modules/uuid/dist-node/v5.js
246
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/parse.js
247
+ function parse(uuid) {
248
+ if (!validate_default(uuid)) {
249
+ throw TypeError("Invalid UUID");
250
+ }
251
+ let v;
252
+ return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
253
+ }
254
+ var parse_default = parse;
255
+
256
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v35.js
257
+ function stringToBytes(str) {
258
+ str = unescape(encodeURIComponent(str));
259
+ const bytes = new Uint8Array(str.length);
260
+ for (let i = 0;i < str.length; ++i) {
261
+ bytes[i] = str.charCodeAt(i);
262
+ }
263
+ return bytes;
264
+ }
265
+ var DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
266
+ var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
267
+ function v35(version, hash, value, namespace, buf, offset) {
268
+ const valueBytes = typeof value === "string" ? stringToBytes(value) : value;
269
+ const namespaceBytes = typeof namespace === "string" ? parse_default(namespace) : namespace;
270
+ if (typeof namespace === "string") {
271
+ namespace = parse_default(namespace);
272
+ }
273
+ if (namespace?.length !== 16) {
274
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
275
+ }
276
+ let bytes = new Uint8Array(16 + valueBytes.length);
277
+ bytes.set(namespaceBytes);
278
+ bytes.set(valueBytes, namespaceBytes.length);
279
+ bytes = hash(bytes);
280
+ bytes[6] = bytes[6] & 15 | version;
281
+ bytes[8] = bytes[8] & 63 | 128;
282
+ if (buf) {
283
+ offset = offset || 0;
284
+ for (let i = 0;i < 16; ++i) {
285
+ buf[offset + i] = bytes[i];
286
+ }
287
+ return buf;
288
+ }
289
+ return unsafeStringify(bytes);
290
+ }
291
+
292
+ // ../../../node_modules/.bun/uuid@13.0.0/node_modules/uuid/dist-node/v5.js
294
293
  function v5(value, namespace, buf, offset) {
295
294
  return v35(80, sha1_default, value, namespace, buf, offset);
296
295
  }
@@ -1990,7 +1989,7 @@ class KnowledgeService extends Service {
1990
1989
  logger4.info(`Text model: ${validatedConfig.TEXT_MODEL}`);
1991
1990
  } else {
1992
1991
  const usingPluginOpenAI = !process.env.EMBEDDING_PROVIDER;
1993
- logger4.warn("Basic Embedding mode - documents will not be enriched with context");
1992
+ logger4.info("Basic Embedding mode - documents will not be enriched with context");
1994
1993
  logger4.info("To enable contextual enrichment: Set CTX_KNOWLEDGE_ENABLED=true and configure TEXT_PROVIDER/TEXT_MODEL");
1995
1994
  if (usingPluginOpenAI) {
1996
1995
  logger4.info("Using plugin-openai configuration for embeddings");
@@ -2468,8 +2467,7 @@ var processKnowledgeAction = {
2468
2467
  const __avText = __avTextRaw.toLowerCase();
2469
2468
  const __avKeywords = ["process", "knowledge"];
2470
2469
  const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
2471
- const __avRegex = /\b(?:process|knowledge)\b/i;
2472
- const __avRegexOk = __avRegex.test(__avText);
2470
+ const __avRegexOk = /\b(?:process|knowledge)\b/i.test(__avText);
2473
2471
  const __avSource = String(message?.content?.source ?? message?.source ?? "");
2474
2472
  const __avExpectedSource = "";
2475
2473
  const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
@@ -2628,8 +2626,7 @@ var searchKnowledgeAction = {
2628
2626
  const __avText = __avTextRaw.toLowerCase();
2629
2627
  const __avKeywords = ["search", "knowledge"];
2630
2628
  const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
2631
- const __avRegex = /\b(?:search|knowledge)\b/i;
2632
- const __avRegexOk = __avRegex.test(__avText);
2629
+ const __avRegexOk = /\b(?:search|knowledge)\b/i.test(__avText);
2633
2630
  const __avSource = String(message?.content?.source ?? message?.source ?? "");
2634
2631
  const __avExpectedSource = "";
2635
2632
  const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
@@ -3720,5 +3717,5 @@ export {
3720
3717
  KnowledgeService
3721
3718
  };
3722
3719
 
3723
- //# debugId=1DCA5A9B7889074E64756E2164756E21
3720
+ //# debugId=40399672E222E6EF64756E2164756E21
3724
3721
  //# sourceMappingURL=index.node.js.map