@elizaos/plugin-minecraft 2.0.0-alpha.4 → 2.0.0-alpha.6
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/actions/attack.d.ts.map +1 -1
- package/dist/actions/chat.d.ts.map +1 -1
- package/dist/actions/connect.d.ts.map +1 -1
- package/dist/actions/control.d.ts.map +1 -1
- package/dist/actions/dig.d.ts.map +1 -1
- package/dist/actions/disconnect.d.ts.map +1 -1
- package/dist/actions/goto.d.ts.map +1 -1
- package/dist/actions/look.d.ts.map +1 -1
- package/dist/actions/place.d.ts.map +1 -1
- package/dist/actions/scan.d.ts.map +1 -1
- package/dist/actions/stop.d.ts.map +1 -1
- package/dist/actions/waypoints.d.ts.map +1 -1
- package/dist/index.js +362 -44
- package/dist/index.js.map +17 -17
- package/dist/providers/vision.d.ts.map +1 -1
- package/dist/providers/waypoints.d.ts.map +1 -1
- package/dist/providers/world-state.d.ts.map +1 -1
- package/package.json +42 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attack.d.ts","sourceRoot":"","sources":["../../src/actions/attack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAUvB,eAAO,MAAM,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"attack.d.ts","sourceRoot":"","sources":["../../src/actions/attack.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAUvB,eAAO,MAAM,qBAAqB,EAAE,MAwEnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/actions/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../src/actions/chat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,MA8EjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/actions/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAgCvB,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../../src/actions/connect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAgCvB,eAAO,MAAM,sBAAsB,EAAE,MAiFpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/actions/control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAmCvB,eAAO,MAAM,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"control.d.ts","sourceRoot":"","sources":["../../src/actions/control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAmCvB,eAAO,MAAM,sBAAsB,EAAE,MA8EpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dig.d.ts","sourceRoot":"","sources":["../../src/actions/dig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,kBAAkB,EAAE,MA+
|
|
1
|
+
{"version":3,"file":"dig.d.ts","sourceRoot":"","sources":["../../src/actions/dig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,kBAAkB,EAAE,MA+EhC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"disconnect.d.ts","sourceRoot":"","sources":["../../src/actions/disconnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,yBAAyB,EAAE,
|
|
1
|
+
{"version":3,"file":"disconnect.d.ts","sourceRoot":"","sources":["../../src/actions/disconnect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,yBAAyB,EAAE,MA6EvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"goto.d.ts","sourceRoot":"","sources":["../../src/actions/goto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"goto.d.ts","sourceRoot":"","sources":["../../src/actions/goto.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,mBAAmB,EAAE,MA0EjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"look.d.ts","sourceRoot":"","sources":["../../src/actions/look.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAwBvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"look.d.ts","sourceRoot":"","sources":["../../src/actions/look.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAwBvB,eAAO,MAAM,mBAAmB,EAAE,MAwEjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../src/actions/place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAwCvB,eAAO,MAAM,oBAAoB,EAAE,MA+
|
|
1
|
+
{"version":3,"file":"place.d.ts","sourceRoot":"","sources":["../../src/actions/place.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAwCvB,eAAO,MAAM,oBAAoB,EAAE,MA+ElC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/actions/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AA4CvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../../src/actions/scan.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AA4CvB,eAAO,MAAM,mBAAmB,EAAE,MAiFjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../src/actions/stop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"stop.d.ts","sourceRoot":"","sources":["../../src/actions/stop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AAGvB,eAAO,MAAM,mBAAmB,EAAE,MAkEjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"waypoints.d.ts","sourceRoot":"","sources":["../../src/actions/waypoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,0BAA0B,EAAE,
|
|
1
|
+
{"version":3,"file":"waypoints.d.ts","sourceRoot":"","sources":["../../src/actions/waypoints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,MAAM,EAQP,MAAM,eAAe,CAAC;AASvB,eAAO,MAAM,0BAA0B,EAAE,MAsFxC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,MA+D3C,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAqEzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,MAgFzC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -255,7 +255,7 @@ var require_fallback = __commonJS((exports, module) => {
|
|
|
255
255
|
|
|
256
256
|
// ../../../node_modules/.bun/bufferutil@4.1.0/node_modules/bufferutil/index.js
|
|
257
257
|
var require_bufferutil = __commonJS((exports, module) => {
|
|
258
|
-
var __dirname = "/Users/shawwalters/eliza-
|
|
258
|
+
var __dirname = "/Users/shawwalters/eliza-workspace/milady/node_modules/.bun/bufferutil@4.1.0/node_modules/bufferutil";
|
|
259
259
|
try {
|
|
260
260
|
module.exports = require_node_gyp_build2()(__dirname);
|
|
261
261
|
} catch (e) {
|
|
@@ -671,7 +671,7 @@ var require_fallback2 = __commonJS((exports, module) => {
|
|
|
671
671
|
|
|
672
672
|
// ../../../node_modules/.bun/utf-8-validate@5.0.10/node_modules/utf-8-validate/index.js
|
|
673
673
|
var require_utf_8_validate = __commonJS((exports, module) => {
|
|
674
|
-
var __dirname = "/Users/shawwalters/eliza-
|
|
674
|
+
var __dirname = "/Users/shawwalters/eliza-workspace/milady/node_modules/.bun/utf-8-validate@5.0.10/node_modules/utf-8-validate";
|
|
675
675
|
try {
|
|
676
676
|
module.exports = require_node_gyp_build2()(__dirname);
|
|
677
677
|
} catch (e) {
|
|
@@ -3514,9 +3514,30 @@ var minecraftAttackAction = {
|
|
|
3514
3514
|
name: "MC_ATTACK",
|
|
3515
3515
|
similes: ["MINECRAFT_ATTACK", "HIT_ENTITY"],
|
|
3516
3516
|
description: "Attack an entity by numeric entityId (from MC_WORLD_STATE.nearbyEntities).",
|
|
3517
|
-
validate: async (runtime, message) => {
|
|
3518
|
-
const
|
|
3519
|
-
|
|
3517
|
+
validate: async (runtime, message, state, options) => {
|
|
3518
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3519
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3520
|
+
const __avKeywords = ["attack"];
|
|
3521
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3522
|
+
const __avRegex = /\b(?:attack)\b/i;
|
|
3523
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3524
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3525
|
+
const __avExpectedSource = "";
|
|
3526
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3527
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3528
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3529
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3530
|
+
return false;
|
|
3531
|
+
}
|
|
3532
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
3533
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3534
|
+
return Boolean(service) && parseEntityId(message2.content.text ?? "") !== null;
|
|
3535
|
+
};
|
|
3536
|
+
try {
|
|
3537
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3538
|
+
} catch {
|
|
3539
|
+
return false;
|
|
3540
|
+
}
|
|
3520
3541
|
},
|
|
3521
3542
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3522
3543
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3551,9 +3572,30 @@ var minecraftChatAction = {
|
|
|
3551
3572
|
name: "MC_CHAT",
|
|
3552
3573
|
similes: ["MINECRAFT_CHAT", "SAY_IN_MINECRAFT", "CHAT"],
|
|
3553
3574
|
description: "Send a chat message in Minecraft as the bot",
|
|
3554
|
-
validate: async (runtime, message) => {
|
|
3555
|
-
const
|
|
3556
|
-
|
|
3575
|
+
validate: async (runtime, message, state, options) => {
|
|
3576
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3577
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3578
|
+
const __avKeywords = ["chat"];
|
|
3579
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3580
|
+
const __avRegex = /\b(?:chat)\b/i;
|
|
3581
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3582
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3583
|
+
const __avExpectedSource = "";
|
|
3584
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3585
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3586
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3587
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3588
|
+
return false;
|
|
3589
|
+
}
|
|
3590
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
3591
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3592
|
+
return Boolean(service) && (message2.content.text ?? "").trim().length > 0;
|
|
3593
|
+
};
|
|
3594
|
+
try {
|
|
3595
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3596
|
+
} catch {
|
|
3597
|
+
return false;
|
|
3598
|
+
}
|
|
3557
3599
|
},
|
|
3558
3600
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3559
3601
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3624,9 +3666,30 @@ var minecraftConnectAction = {
|
|
|
3624
3666
|
name: "MC_CONNECT",
|
|
3625
3667
|
similes: ["MINECRAFT_CONNECT", "JOIN_SERVER", "CONNECT_TO_MINECRAFT"],
|
|
3626
3668
|
description: "Connect the Mineflayer bot to a Minecraft server",
|
|
3627
|
-
validate: async (runtime) => {
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3669
|
+
validate: async (runtime, message, state, options) => {
|
|
3670
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3671
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3672
|
+
const __avKeywords = ["connect"];
|
|
3673
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3674
|
+
const __avRegex = /\b(?:connect)\b/i;
|
|
3675
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3676
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3677
|
+
const __avExpectedSource = "";
|
|
3678
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3679
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3680
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3681
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3682
|
+
return false;
|
|
3683
|
+
}
|
|
3684
|
+
const __avLegacyValidate = async (runtime2) => {
|
|
3685
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3686
|
+
return Boolean(service);
|
|
3687
|
+
};
|
|
3688
|
+
try {
|
|
3689
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3690
|
+
} catch {
|
|
3691
|
+
return false;
|
|
3692
|
+
}
|
|
3630
3693
|
},
|
|
3631
3694
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3632
3695
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3696,9 +3759,30 @@ var minecraftControlAction = {
|
|
|
3696
3759
|
name: "MC_CONTROL",
|
|
3697
3760
|
similes: ["MINECRAFT_CONTROL", "SET_CONTROL_STATE"],
|
|
3698
3761
|
description: "Set a control state (e.g. forward/back/left/right/jump/sprint/sneak). Provide JSON {control,state,durationMs?} or 'forward true 1000'.",
|
|
3699
|
-
validate: async (runtime, message) => {
|
|
3700
|
-
const
|
|
3701
|
-
|
|
3762
|
+
validate: async (runtime, message, state, options) => {
|
|
3763
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3764
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3765
|
+
const __avKeywords = ["control"];
|
|
3766
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3767
|
+
const __avRegex = /\b(?:control)\b/i;
|
|
3768
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3769
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3770
|
+
const __avExpectedSource = "";
|
|
3771
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3772
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3773
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3774
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3775
|
+
return false;
|
|
3776
|
+
}
|
|
3777
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
3778
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3779
|
+
return Boolean(service) && Boolean(parseControl(message2.content.text ?? ""));
|
|
3780
|
+
};
|
|
3781
|
+
try {
|
|
3782
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3783
|
+
} catch {
|
|
3784
|
+
return false;
|
|
3785
|
+
}
|
|
3702
3786
|
},
|
|
3703
3787
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3704
3788
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3760,9 +3844,30 @@ var minecraftDigAction = {
|
|
|
3760
3844
|
name: "MC_DIG",
|
|
3761
3845
|
similes: ["MINECRAFT_DIG", "MINE_BLOCK", "BREAK_BLOCK"],
|
|
3762
3846
|
description: `Dig/break the block at (x y z). Provide coordinates like '10 64 -20' or JSON {"x":10,"y":64,"z":-20}.`,
|
|
3763
|
-
validate: async (runtime, message) => {
|
|
3764
|
-
const
|
|
3765
|
-
|
|
3847
|
+
validate: async (runtime, message, state, options) => {
|
|
3848
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3849
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3850
|
+
const __avKeywords = ["dig"];
|
|
3851
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3852
|
+
const __avRegex = /\b(?:dig)\b/i;
|
|
3853
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3854
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3855
|
+
const __avExpectedSource = "";
|
|
3856
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3857
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3858
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3859
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3860
|
+
return false;
|
|
3861
|
+
}
|
|
3862
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
3863
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3864
|
+
return Boolean(service) && Boolean(extractVec3(message2.content.text ?? ""));
|
|
3865
|
+
};
|
|
3866
|
+
try {
|
|
3867
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3868
|
+
} catch {
|
|
3869
|
+
return false;
|
|
3870
|
+
}
|
|
3766
3871
|
},
|
|
3767
3872
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3768
3873
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3802,9 +3907,30 @@ var minecraftDisconnectAction = {
|
|
|
3802
3907
|
name: "MC_DISCONNECT",
|
|
3803
3908
|
similes: ["MINECRAFT_DISCONNECT", "LEAVE_SERVER", "QUIT_MINECRAFT"],
|
|
3804
3909
|
description: "Disconnect the Mineflayer bot from the Minecraft server",
|
|
3805
|
-
validate: async (runtime) => {
|
|
3806
|
-
const
|
|
3807
|
-
|
|
3910
|
+
validate: async (runtime, message, state, options) => {
|
|
3911
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3912
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3913
|
+
const __avKeywords = ["disconnect"];
|
|
3914
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3915
|
+
const __avRegex = /\b(?:disconnect)\b/i;
|
|
3916
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3917
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3918
|
+
const __avExpectedSource = "";
|
|
3919
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3920
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3921
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3922
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3923
|
+
return false;
|
|
3924
|
+
}
|
|
3925
|
+
const __avLegacyValidate = async (runtime2) => {
|
|
3926
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3927
|
+
return Boolean(service?.getCurrentSession());
|
|
3928
|
+
};
|
|
3929
|
+
try {
|
|
3930
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3931
|
+
} catch {
|
|
3932
|
+
return false;
|
|
3933
|
+
}
|
|
3808
3934
|
},
|
|
3809
3935
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3810
3936
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3845,9 +3971,30 @@ var minecraftGotoAction = {
|
|
|
3845
3971
|
name: "MC_GOTO",
|
|
3846
3972
|
similes: ["MINECRAFT_GOTO", "WALK_TO", "MOVE_TO_COORDS"],
|
|
3847
3973
|
description: `Pathfind to a target (x y z). Provide coordinates like '10 64 -20' or JSON {"x":10,"y":64,"z":-20}.`,
|
|
3848
|
-
validate: async (runtime, message) => {
|
|
3849
|
-
const
|
|
3850
|
-
|
|
3974
|
+
validate: async (runtime, message, state, options) => {
|
|
3975
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
3976
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
3977
|
+
const __avKeywords = ["goto"];
|
|
3978
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
3979
|
+
const __avRegex = /\b(?:goto)\b/i;
|
|
3980
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
3981
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
3982
|
+
const __avExpectedSource = "";
|
|
3983
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
3984
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
3985
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
3986
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
3987
|
+
return false;
|
|
3988
|
+
}
|
|
3989
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
3990
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
3991
|
+
return Boolean(service) && Boolean(extractVec3(message2.content.text ?? ""));
|
|
3992
|
+
};
|
|
3993
|
+
try {
|
|
3994
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
3995
|
+
} catch {
|
|
3996
|
+
return false;
|
|
3997
|
+
}
|
|
3851
3998
|
},
|
|
3852
3999
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3853
4000
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3903,9 +4050,30 @@ var minecraftLookAction = {
|
|
|
3903
4050
|
name: "MC_LOOK",
|
|
3904
4051
|
similes: ["MINECRAFT_LOOK", "TURN_HEAD"],
|
|
3905
4052
|
description: "Look to yaw/pitch (radians). Provide 'yaw pitch' or JSON {yaw,pitch}.",
|
|
3906
|
-
validate: async (runtime, message) => {
|
|
3907
|
-
const
|
|
3908
|
-
|
|
4053
|
+
validate: async (runtime, message, state, options) => {
|
|
4054
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4055
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4056
|
+
const __avKeywords = ["look"];
|
|
4057
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4058
|
+
const __avRegex = /\b(?:look)\b/i;
|
|
4059
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4060
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4061
|
+
const __avExpectedSource = "";
|
|
4062
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4063
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4064
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4065
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4066
|
+
return false;
|
|
4067
|
+
}
|
|
4068
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
4069
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
4070
|
+
return Boolean(service) && Boolean(parseLook(message2.content.text ?? ""));
|
|
4071
|
+
};
|
|
4072
|
+
try {
|
|
4073
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4074
|
+
} catch {
|
|
4075
|
+
return false;
|
|
4076
|
+
}
|
|
3909
4077
|
},
|
|
3910
4078
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3911
4079
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -3969,9 +4137,30 @@ var minecraftPlaceAction = {
|
|
|
3969
4137
|
name: "MC_PLACE",
|
|
3970
4138
|
similes: ["MINECRAFT_PLACE", "PLACE_BLOCK"],
|
|
3971
4139
|
description: "Place the currently-held block onto a reference block face. Provide 'x y z face' (face=up/down/north/south/east/west) or JSON {x,y,z,face}.",
|
|
3972
|
-
validate: async (runtime, message) => {
|
|
3973
|
-
const
|
|
3974
|
-
|
|
4140
|
+
validate: async (runtime, message, state, options) => {
|
|
4141
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4142
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4143
|
+
const __avKeywords = ["place"];
|
|
4144
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4145
|
+
const __avRegex = /\b(?:place)\b/i;
|
|
4146
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4147
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4148
|
+
const __avExpectedSource = "";
|
|
4149
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4150
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4151
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4152
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4153
|
+
return false;
|
|
4154
|
+
}
|
|
4155
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
4156
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
4157
|
+
return Boolean(service) && Boolean(parsePlace(message2.content.text ?? ""));
|
|
4158
|
+
};
|
|
4159
|
+
try {
|
|
4160
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4161
|
+
} catch {
|
|
4162
|
+
return false;
|
|
4163
|
+
}
|
|
3975
4164
|
},
|
|
3976
4165
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
3977
4166
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -4038,9 +4227,30 @@ var minecraftScanAction = {
|
|
|
4038
4227
|
name: "MC_SCAN",
|
|
4039
4228
|
similes: ["MINECRAFT_SCAN", "FIND_BLOCKS", "SCAN_BLOCKS"],
|
|
4040
4229
|
description: 'Scan nearby blocks. Optional JSON input: {"blocks":["oak_log"],"radius":16,"maxResults":32}. If omitted, scans for any non-air blocks.',
|
|
4041
|
-
validate: async (runtime) => {
|
|
4042
|
-
const
|
|
4043
|
-
|
|
4230
|
+
validate: async (runtime, message, state, options) => {
|
|
4231
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4232
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4233
|
+
const __avKeywords = ["scan"];
|
|
4234
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4235
|
+
const __avRegex = /\b(?:scan)\b/i;
|
|
4236
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4237
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4238
|
+
const __avExpectedSource = "";
|
|
4239
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4240
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4241
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4242
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4243
|
+
return false;
|
|
4244
|
+
}
|
|
4245
|
+
const __avLegacyValidate = async (runtime2) => {
|
|
4246
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
4247
|
+
return Boolean(service);
|
|
4248
|
+
};
|
|
4249
|
+
try {
|
|
4250
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4251
|
+
} catch {
|
|
4252
|
+
return false;
|
|
4253
|
+
}
|
|
4044
4254
|
},
|
|
4045
4255
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4046
4256
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -4083,9 +4293,30 @@ var minecraftStopAction = {
|
|
|
4083
4293
|
name: "MC_STOP",
|
|
4084
4294
|
similes: ["MINECRAFT_STOP", "STOP_PATHFINDER", "STOP_MOVING"],
|
|
4085
4295
|
description: "Stop pathfinding / movement goals.",
|
|
4086
|
-
validate: async (runtime) => {
|
|
4087
|
-
const
|
|
4088
|
-
|
|
4296
|
+
validate: async (runtime, message, state, options) => {
|
|
4297
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4298
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4299
|
+
const __avKeywords = ["stop"];
|
|
4300
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4301
|
+
const __avRegex = /\b(?:stop)\b/i;
|
|
4302
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4303
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4304
|
+
const __avExpectedSource = "";
|
|
4305
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4306
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4307
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4308
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4309
|
+
return false;
|
|
4310
|
+
}
|
|
4311
|
+
const __avLegacyValidate = async (runtime2) => {
|
|
4312
|
+
const service = runtime2.getService(MINECRAFT_SERVICE_TYPE);
|
|
4313
|
+
return Boolean(service);
|
|
4314
|
+
};
|
|
4315
|
+
try {
|
|
4316
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4317
|
+
} catch {
|
|
4318
|
+
return false;
|
|
4319
|
+
}
|
|
4089
4320
|
},
|
|
4090
4321
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4091
4322
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
@@ -4282,8 +4513,29 @@ var minecraftWaypointSetAction = {
|
|
|
4282
4513
|
name: "MC_WAYPOINT_SET",
|
|
4283
4514
|
similes: ["MINECRAFT_WAYPOINT_SET", "SET_WAYPOINT", "SAVE_WAYPOINT"],
|
|
4284
4515
|
description: "Save the bot's current position as a named waypoint (message text is the name).",
|
|
4285
|
-
validate: async (runtime, message) => {
|
|
4286
|
-
|
|
4516
|
+
validate: async (runtime, message, state, options) => {
|
|
4517
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4518
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4519
|
+
const __avKeywords = ["waypoint", "set"];
|
|
4520
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4521
|
+
const __avRegex = /\b(?:waypoint|set)\b/i;
|
|
4522
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4523
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4524
|
+
const __avExpectedSource = "";
|
|
4525
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4526
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4527
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4528
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4529
|
+
return false;
|
|
4530
|
+
}
|
|
4531
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
4532
|
+
return Boolean(runtime2.getService(WAYPOINTS_SERVICE_TYPE)) && Boolean(parseName(message2.content.text ?? ""));
|
|
4533
|
+
};
|
|
4534
|
+
try {
|
|
4535
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4536
|
+
} catch {
|
|
4537
|
+
return false;
|
|
4538
|
+
}
|
|
4287
4539
|
},
|
|
4288
4540
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4289
4541
|
const waypoints = runtime.getService(WAYPOINTS_SERVICE_TYPE);
|
|
@@ -4327,8 +4579,29 @@ var minecraftWaypointDeleteAction = {
|
|
|
4327
4579
|
name: "MC_WAYPOINT_DELETE",
|
|
4328
4580
|
similes: ["MINECRAFT_WAYPOINT_DELETE", "DELETE_WAYPOINT", "REMOVE_WAYPOINT"],
|
|
4329
4581
|
description: "Delete a named waypoint (message text is the name).",
|
|
4330
|
-
validate: async (runtime, message) => {
|
|
4331
|
-
|
|
4582
|
+
validate: async (runtime, message, state, options) => {
|
|
4583
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4584
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4585
|
+
const __avKeywords = ["waypoint", "delete"];
|
|
4586
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4587
|
+
const __avRegex = /\b(?:waypoint|delete)\b/i;
|
|
4588
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4589
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4590
|
+
const __avExpectedSource = "";
|
|
4591
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4592
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4593
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4594
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4595
|
+
return false;
|
|
4596
|
+
}
|
|
4597
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
4598
|
+
return Boolean(runtime2.getService(WAYPOINTS_SERVICE_TYPE)) && Boolean(parseName(message2.content.text ?? ""));
|
|
4599
|
+
};
|
|
4600
|
+
try {
|
|
4601
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4602
|
+
} catch {
|
|
4603
|
+
return false;
|
|
4604
|
+
}
|
|
4332
4605
|
},
|
|
4333
4606
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4334
4607
|
const waypoints = runtime.getService(WAYPOINTS_SERVICE_TYPE);
|
|
@@ -4351,8 +4624,29 @@ var minecraftWaypointListAction = {
|
|
|
4351
4624
|
name: "MC_WAYPOINT_LIST",
|
|
4352
4625
|
similes: ["MINECRAFT_WAYPOINT_LIST", "LIST_WAYPOINTS", "SHOW_WAYPOINTS"],
|
|
4353
4626
|
description: "List saved waypoints.",
|
|
4354
|
-
validate: async (runtime) => {
|
|
4355
|
-
|
|
4627
|
+
validate: async (runtime, message, state, options) => {
|
|
4628
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4629
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4630
|
+
const __avKeywords = ["waypoint", "list"];
|
|
4631
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4632
|
+
const __avRegex = /\b(?:waypoint|list)\b/i;
|
|
4633
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4634
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4635
|
+
const __avExpectedSource = "";
|
|
4636
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4637
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4638
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4639
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4640
|
+
return false;
|
|
4641
|
+
}
|
|
4642
|
+
const __avLegacyValidate = async (runtime2) => {
|
|
4643
|
+
return Boolean(runtime2.getService(WAYPOINTS_SERVICE_TYPE));
|
|
4644
|
+
};
|
|
4645
|
+
try {
|
|
4646
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4647
|
+
} catch {
|
|
4648
|
+
return false;
|
|
4649
|
+
}
|
|
4356
4650
|
},
|
|
4357
4651
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4358
4652
|
const waypoints = runtime.getService(WAYPOINTS_SERVICE_TYPE);
|
|
@@ -4387,8 +4681,29 @@ var minecraftWaypointGotoAction = {
|
|
|
4387
4681
|
name: "MC_WAYPOINT_GOTO",
|
|
4388
4682
|
similes: ["MINECRAFT_WAYPOINT_GOTO", "GOTO_WAYPOINT", "NAVIGATE_WAYPOINT"],
|
|
4389
4683
|
description: "Pathfind to a named waypoint (message text is the name).",
|
|
4390
|
-
validate: async (runtime, message) => {
|
|
4391
|
-
|
|
4684
|
+
validate: async (runtime, message, state, options) => {
|
|
4685
|
+
const __avTextRaw = typeof message?.content?.text === "string" ? message.content.text : "";
|
|
4686
|
+
const __avText = __avTextRaw.toLowerCase();
|
|
4687
|
+
const __avKeywords = ["waypoint", "goto"];
|
|
4688
|
+
const __avKeywordOk = __avKeywords.length > 0 && __avKeywords.some((kw) => kw.length > 0 && __avText.includes(kw));
|
|
4689
|
+
const __avRegex = /\b(?:waypoint|goto)\b/i;
|
|
4690
|
+
const __avRegexOk = __avRegex.test(__avText);
|
|
4691
|
+
const __avSource = String(message?.content?.source ?? message?.source ?? "");
|
|
4692
|
+
const __avExpectedSource = "";
|
|
4693
|
+
const __avSourceOk = __avExpectedSource ? __avSource === __avExpectedSource : Boolean(__avSource || state || runtime?.agentId || runtime?.getService);
|
|
4694
|
+
const __avOptions = options && typeof options === "object" ? options : {};
|
|
4695
|
+
const __avInputOk = __avText.trim().length > 0 || Object.keys(__avOptions).length > 0 || Boolean(message?.content && typeof message.content === "object");
|
|
4696
|
+
if (!(__avKeywordOk && __avRegexOk && __avSourceOk && __avInputOk)) {
|
|
4697
|
+
return false;
|
|
4698
|
+
}
|
|
4699
|
+
const __avLegacyValidate = async (runtime2, message2) => {
|
|
4700
|
+
return Boolean(runtime2.getService(WAYPOINTS_SERVICE_TYPE)) && Boolean(runtime2.getService(MINECRAFT_SERVICE_TYPE)) && Boolean(parseName(message2.content.text ?? ""));
|
|
4701
|
+
};
|
|
4702
|
+
try {
|
|
4703
|
+
return Boolean(await __avLegacyValidate(runtime, message, state, options));
|
|
4704
|
+
} catch {
|
|
4705
|
+
return false;
|
|
4706
|
+
}
|
|
4392
4707
|
},
|
|
4393
4708
|
handler: async (runtime, message, _state, _options, callback) => {
|
|
4394
4709
|
const waypoints = runtime.getService(WAYPOINTS_SERVICE_TYPE);
|
|
@@ -4425,6 +4740,7 @@ var minecraftWaypointGotoAction = {
|
|
|
4425
4740
|
var minecraftVisionProvider = {
|
|
4426
4741
|
name: "MC_VISION",
|
|
4427
4742
|
description: "Semantic environment context: biome, what I'm looking at, key nearby blocks (logs/ores), nearby entities",
|
|
4743
|
+
dynamic: true,
|
|
4428
4744
|
get: async (runtime, _message, _state) => {
|
|
4429
4745
|
const mc = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
4430
4746
|
if (!mc) {
|
|
@@ -4495,6 +4811,7 @@ NearbyBlocksFound: ${blocks.length}`,
|
|
|
4495
4811
|
var minecraftWaypointsProvider = {
|
|
4496
4812
|
name: "MC_WAYPOINTS",
|
|
4497
4813
|
description: "Saved Minecraft waypoints (names and coordinates)",
|
|
4814
|
+
dynamic: true,
|
|
4498
4815
|
get: async (runtime, _message, _state) => {
|
|
4499
4816
|
const service = runtime.getService(WAYPOINTS_SERVICE_TYPE);
|
|
4500
4817
|
if (!service) {
|
|
@@ -4528,6 +4845,7 @@ import { logger as logger4 } from "@elizaos/core";
|
|
|
4528
4845
|
var minecraftWorldStateProvider = {
|
|
4529
4846
|
name: "MC_WORLD_STATE",
|
|
4530
4847
|
description: "Minecraft world state: position, health, inventory, nearby entities",
|
|
4848
|
+
dynamic: true,
|
|
4531
4849
|
get: async (runtime, _message, _state) => {
|
|
4532
4850
|
const service = runtime.getService(MINECRAFT_SERVICE_TYPE);
|
|
4533
4851
|
if (!service) {
|
|
@@ -4657,4 +4975,4 @@ export {
|
|
|
4657
4975
|
MINECRAFT_SERVICE_TYPE
|
|
4658
4976
|
};
|
|
4659
4977
|
|
|
4660
|
-
//# debugId=
|
|
4978
|
+
//# debugId=ED8964D2CEB375D564756E2164756E21
|