@elizaos/plugin-trust 2.0.0-alpha.0 → 2.0.0-alpha.1
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":"evaluateTrust.d.ts","sourceRoot":"","sources":["../../src/actions/evaluateTrust.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAOZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"evaluateTrust.d.ts","sourceRoot":"","sources":["../../src/actions/evaluateTrust.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAOZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,MA8SjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordTrustInteraction.d.ts","sourceRoot":"","sources":["../../src/actions/recordTrustInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,4BAA4B,EAAE,
|
|
1
|
+
{"version":3,"file":"recordTrustInteraction.d.ts","sourceRoot":"","sources":["../../src/actions/recordTrustInteraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAMZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,4BAA4B,EAAE,MAkQ1C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"requestElevation.d.ts","sourceRoot":"","sources":["../../src/actions/requestElevation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAKZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"requestElevation.d.ts","sourceRoot":"","sources":["../../src/actions/requestElevation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAKZ,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,sBAAsB,EAAE,MAgPpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/actions/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAcZ,MAAM,eAAe,CAAC;AAiFvB;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/actions/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAcZ,MAAM,eAAe,CAAC;AAiFvB;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAoW9B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -43,20 +43,41 @@ var evaluateTrustAction = {
|
|
|
43
43
|
const __avTextRaw2 = typeof message2?.content?.text === "string" ? message2.content.text : "";
|
|
44
44
|
const __avText2 = __avTextRaw2.toLowerCase();
|
|
45
45
|
const __avKeywords2 = ["evaluate", "trust"];
|
|
46
|
-
const __avKeywordOk2 = __avKeywords2.length > 0 && __avKeywords2.some((
|
|
46
|
+
const __avKeywordOk2 = __avKeywords2.length > 0 && __avKeywords2.some((word) => word.length > 0 && __avText2.includes(word));
|
|
47
47
|
const __avRegex2 = /\b(?:evaluate|trust)\b/i;
|
|
48
48
|
const __avRegexOk2 = __avRegex2.test(__avText2);
|
|
49
49
|
const __avSource2 = String(message2?.content?.source ?? message2?.source ?? "");
|
|
50
50
|
const __avExpectedSource2 = "";
|
|
51
|
-
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService);
|
|
51
|
+
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService || runtime2?.getSetting);
|
|
52
52
|
const __avOptions2 = options2 && typeof options2 === "object" ? options2 : {};
|
|
53
53
|
const __avInputOk2 = __avText2.trim().length > 0 || Object.keys(__avOptions2).length > 0 || Boolean(message2?.content && typeof message2.content === "object");
|
|
54
54
|
if (!(__avKeywordOk2 && __avRegexOk2 && __avSourceOk2 && __avInputOk2)) {
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
|
-
const __avLegacyValidate2 = async (runtime3,
|
|
58
|
-
const
|
|
59
|
-
|
|
57
|
+
const __avLegacyValidate2 = async (runtime3, message3, state3, options3) => {
|
|
58
|
+
const __avTextRaw3 = typeof message3?.content?.text === "string" ? message3.content.text : "";
|
|
59
|
+
const __avText3 = __avTextRaw3.toLowerCase();
|
|
60
|
+
const __avKeywords3 = ["evaluate", "trust"];
|
|
61
|
+
const __avKeywordOk3 = __avKeywords3.length > 0 && __avKeywords3.some((kw) => kw.length > 0 && __avText3.includes(kw));
|
|
62
|
+
const __avRegex3 = /\b(?:evaluate|trust)\b/i;
|
|
63
|
+
const __avRegexOk3 = __avRegex3.test(__avText3);
|
|
64
|
+
const __avSource3 = String(message3?.content?.source ?? message3?.source ?? "");
|
|
65
|
+
const __avExpectedSource3 = "";
|
|
66
|
+
const __avSourceOk3 = __avExpectedSource3 ? __avSource3 === __avExpectedSource3 : Boolean(__avSource3 || state3 || runtime3?.agentId || runtime3?.getService);
|
|
67
|
+
const __avOptions3 = options3 && typeof options3 === "object" ? options3 : {};
|
|
68
|
+
const __avInputOk3 = __avText3.trim().length > 0 || Object.keys(__avOptions3).length > 0 || Boolean(message3?.content && typeof message3.content === "object");
|
|
69
|
+
if (!(__avKeywordOk3 && __avRegexOk3 && __avSourceOk3 && __avInputOk3)) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
const __avLegacyValidate3 = async (runtime4, _message) => {
|
|
73
|
+
const trustEngine = runtime4.getService("trust-engine");
|
|
74
|
+
return !!trustEngine;
|
|
75
|
+
};
|
|
76
|
+
try {
|
|
77
|
+
return Boolean(await __avLegacyValidate3(runtime3, message3, state3, options3));
|
|
78
|
+
} catch {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
60
81
|
};
|
|
61
82
|
try {
|
|
62
83
|
return Boolean(await __avLegacyValidate2(runtime2, message2, state2, options2));
|
|
@@ -257,20 +278,41 @@ var recordTrustInteractionAction = {
|
|
|
257
278
|
const __avTextRaw2 = typeof message2?.content?.text === "string" ? message2.content.text : "";
|
|
258
279
|
const __avText2 = __avTextRaw2.toLowerCase();
|
|
259
280
|
const __avKeywords2 = ["record", "trust", "interaction"];
|
|
260
|
-
const __avKeywordOk2 = __avKeywords2.length > 0 && __avKeywords2.some((
|
|
281
|
+
const __avKeywordOk2 = __avKeywords2.length > 0 && __avKeywords2.some((word) => word.length > 0 && __avText2.includes(word));
|
|
261
282
|
const __avRegex2 = /\b(?:record|trust|interaction)\b/i;
|
|
262
283
|
const __avRegexOk2 = __avRegex2.test(__avText2);
|
|
263
284
|
const __avSource2 = String(message2?.content?.source ?? message2?.source ?? "");
|
|
264
285
|
const __avExpectedSource2 = "";
|
|
265
|
-
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService);
|
|
286
|
+
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService || runtime2?.getSetting);
|
|
266
287
|
const __avOptions2 = options2 && typeof options2 === "object" ? options2 : {};
|
|
267
288
|
const __avInputOk2 = __avText2.trim().length > 0 || Object.keys(__avOptions2).length > 0 || Boolean(message2?.content && typeof message2.content === "object");
|
|
268
289
|
if (!(__avKeywordOk2 && __avRegexOk2 && __avSourceOk2 && __avInputOk2)) {
|
|
269
290
|
return false;
|
|
270
291
|
}
|
|
271
|
-
const __avLegacyValidate2 = async (runtime3,
|
|
272
|
-
const
|
|
273
|
-
|
|
292
|
+
const __avLegacyValidate2 = async (runtime3, message3, state3, options3) => {
|
|
293
|
+
const __avTextRaw3 = typeof message3?.content?.text === "string" ? message3.content.text : "";
|
|
294
|
+
const __avText3 = __avTextRaw3.toLowerCase();
|
|
295
|
+
const __avKeywords3 = ["record", "trust", "interaction"];
|
|
296
|
+
const __avKeywordOk3 = __avKeywords3.length > 0 && __avKeywords3.some((kw) => kw.length > 0 && __avText3.includes(kw));
|
|
297
|
+
const __avRegex3 = /\b(?:record|trust|interaction)\b/i;
|
|
298
|
+
const __avRegexOk3 = __avRegex3.test(__avText3);
|
|
299
|
+
const __avSource3 = String(message3?.content?.source ?? message3?.source ?? "");
|
|
300
|
+
const __avExpectedSource3 = "";
|
|
301
|
+
const __avSourceOk3 = __avExpectedSource3 ? __avSource3 === __avExpectedSource3 : Boolean(__avSource3 || state3 || runtime3?.agentId || runtime3?.getService);
|
|
302
|
+
const __avOptions3 = options3 && typeof options3 === "object" ? options3 : {};
|
|
303
|
+
const __avInputOk3 = __avText3.trim().length > 0 || Object.keys(__avOptions3).length > 0 || Boolean(message3?.content && typeof message3.content === "object");
|
|
304
|
+
if (!(__avKeywordOk3 && __avRegexOk3 && __avSourceOk3 && __avInputOk3)) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
const __avLegacyValidate3 = async (runtime4, _message) => {
|
|
308
|
+
const trustEngine = runtime4.getService("trust-engine");
|
|
309
|
+
return !!trustEngine;
|
|
310
|
+
};
|
|
311
|
+
try {
|
|
312
|
+
return Boolean(await __avLegacyValidate3(runtime3, message3, state3, options3));
|
|
313
|
+
} catch {
|
|
314
|
+
return false;
|
|
315
|
+
}
|
|
274
316
|
};
|
|
275
317
|
try {
|
|
276
318
|
return Boolean(await __avLegacyValidate2(runtime2, message2, state2, options2));
|
|
@@ -420,13 +462,35 @@ var requestElevationAction = {
|
|
|
420
462
|
const __avExpectedSource = "";
|
|
421
463
|
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService || runtime?.getSetting);
|
|
422
464
|
const __avOptions = options && typeof options === "object" ? options : {};
|
|
423
|
-
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
465
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object") || __avLegacyContextOk;
|
|
424
466
|
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
425
467
|
return false;
|
|
426
468
|
}
|
|
427
|
-
const __avLegacyValidate = async (runtime2,
|
|
428
|
-
const
|
|
429
|
-
|
|
469
|
+
const __avLegacyValidate = async (runtime2, message2, state2, options2) => {
|
|
470
|
+
const __avTextRaw2 = typeof message2?.content?.text === "string" ? message2.content.text : "";
|
|
471
|
+
const __avText2 = __avTextRaw2.toLowerCase();
|
|
472
|
+
const __avLegacyContextOk2 = Boolean(runtime2?.getService?.("contextual-permissions"));
|
|
473
|
+
const __avKeywords2 = ["request", "elevation"];
|
|
474
|
+
const __avKeywordOk2 = __avKeywords2.length > 0 && (__avKeywords2.some((word) => word.length > 0 && __avText2.includes(word)) || __avLegacyContextOk2);
|
|
475
|
+
const __avRegex2 = /\b(?:request|elevation)\b/i;
|
|
476
|
+
const __avRegexOk2 = __avRegex2.test(__avText2) || __avLegacyContextOk2;
|
|
477
|
+
const __avSource2 = String(message2?.content?.source ?? message2?.source ?? "");
|
|
478
|
+
const __avExpectedSource2 = "";
|
|
479
|
+
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService || runtime2?.getSetting);
|
|
480
|
+
const __avOptions2 = options2 && typeof options2 === "object" ? options2 : {};
|
|
481
|
+
const __avInputOk2 = __avText2.trim().length > 0 || Object.keys(__avOptions2).length > 0 || Boolean(message2?.content && typeof message2.content === "object");
|
|
482
|
+
if (!(__avKeywordOk2 && __avRegexOk2 && __avSourceOk2 && __avInputOk2)) {
|
|
483
|
+
return false;
|
|
484
|
+
}
|
|
485
|
+
const __avLegacyValidate2 = async (runtime3, _message) => {
|
|
486
|
+
const permissionSystem = runtime3.getService("contextual-permissions");
|
|
487
|
+
return !!permissionSystem;
|
|
488
|
+
};
|
|
489
|
+
try {
|
|
490
|
+
return Boolean(await __avLegacyValidate2(runtime2, message2, state2, options2));
|
|
491
|
+
} catch {
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
430
494
|
};
|
|
431
495
|
try {
|
|
432
496
|
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
@@ -603,14 +667,36 @@ var updateRoleAction = {
|
|
|
603
667
|
const __avExpectedSource = "";
|
|
604
668
|
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService || runtime?.getSetting || __avLegacyContextOk || message?.content);
|
|
605
669
|
const __avOptions = options && typeof options === "object" ? options : {};
|
|
606
|
-
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
670
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object") || __avLegacyContextOk;
|
|
607
671
|
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
608
672
|
return false;
|
|
609
673
|
}
|
|
610
|
-
const __avLegacyValidate = async (
|
|
611
|
-
const
|
|
612
|
-
const
|
|
613
|
-
|
|
674
|
+
const __avLegacyValidate = async (runtime2, message2, state2, options2) => {
|
|
675
|
+
const __avTextRaw2 = typeof message2?.content?.text === "string" ? message2.content.text : "";
|
|
676
|
+
const __avText2 = __avTextRaw2.toLowerCase();
|
|
677
|
+
const __avLegacyContextOk2 = Boolean((message2?.content?.channelType === ChannelType.GROUP || message2?.content?.channelType === ChannelType.WORLD) && message2?.content?.serverId);
|
|
678
|
+
const __avKeywords2 = ["update", "role", "roles"];
|
|
679
|
+
const __avKeywordOk2 = __avKeywords2.length > 0 && (__avKeywords2.some((word) => word.length > 0 && __avText2.includes(word)) || __avLegacyContextOk2);
|
|
680
|
+
const __avRegex2 = /\b(?:update|role|roles)\b/i;
|
|
681
|
+
const __avRegexOk2 = __avRegex2.test(__avText2) || __avLegacyContextOk2;
|
|
682
|
+
const __avSource2 = String(message2?.content?.source ?? message2?.source ?? "");
|
|
683
|
+
const __avExpectedSource2 = "";
|
|
684
|
+
const __avSourceOk2 = __avExpectedSource2 ? __avSource2 === __avExpectedSource2 : Boolean(__avSource2 || state2 || runtime2?.agentId || runtime2?.getService || runtime2?.getSetting || __avLegacyContextOk2 || message2?.content);
|
|
685
|
+
const __avOptions2 = options2 && typeof options2 === "object" ? options2 : {};
|
|
686
|
+
const __avInputOk2 = __avText2.trim().length > 0 || Object.keys(__avOptions2).length > 0 || Boolean(message2?.content && typeof message2.content === "object");
|
|
687
|
+
if (!(__avKeywordOk2 && __avRegexOk2 && __avSourceOk2 && __avInputOk2)) {
|
|
688
|
+
return false;
|
|
689
|
+
}
|
|
690
|
+
const __avLegacyValidate2 = async (_runtime, message3, _state) => {
|
|
691
|
+
const channelType = message3.content.channelType;
|
|
692
|
+
const serverId = message3.content.serverId;
|
|
693
|
+
return (channelType === ChannelType.GROUP || channelType === ChannelType.WORLD) && !!serverId;
|
|
694
|
+
};
|
|
695
|
+
try {
|
|
696
|
+
return Boolean(await __avLegacyValidate2(runtime2, message2, state2, options2));
|
|
697
|
+
} catch {
|
|
698
|
+
return false;
|
|
699
|
+
}
|
|
614
700
|
};
|
|
615
701
|
try {
|
|
616
702
|
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
@@ -6121,4 +6207,4 @@ export {
|
|
|
6121
6207
|
ContextualPermissionSystem
|
|
6122
6208
|
};
|
|
6123
6209
|
|
|
6124
|
-
//# debugId=
|
|
6210
|
+
//# debugId=C3A43914008611CB64756E2164756E21
|