@elizaos/plugin-bootstrap 1.5.8-alpha.16 → 1.5.8-alpha.18
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/index.js +101 -49
- package/dist/index.js.map +5 -5
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -16,51 +16,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
16
16
|
};
|
|
17
17
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
18
18
|
|
|
19
|
-
// ../../node_modules/dedent/dist/dedent.js
|
|
20
|
-
var require_dedent = __commonJS((exports, module) => {
|
|
21
|
-
function dedent(strings) {
|
|
22
|
-
var raw = undefined;
|
|
23
|
-
if (typeof strings === "string") {
|
|
24
|
-
raw = [strings];
|
|
25
|
-
} else {
|
|
26
|
-
raw = strings.raw;
|
|
27
|
-
}
|
|
28
|
-
var result = "";
|
|
29
|
-
for (var i = 0;i < raw.length; i++) {
|
|
30
|
-
result += raw[i].replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`");
|
|
31
|
-
if (i < (arguments.length <= 1 ? 0 : arguments.length - 1)) {
|
|
32
|
-
result += arguments.length <= i + 1 ? undefined : arguments[i + 1];
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var lines = result.split(`
|
|
36
|
-
`);
|
|
37
|
-
var mindent = null;
|
|
38
|
-
lines.forEach(function(l) {
|
|
39
|
-
var m = l.match(/^(\s+)\S+/);
|
|
40
|
-
if (m) {
|
|
41
|
-
var indent = m[1].length;
|
|
42
|
-
if (!mindent) {
|
|
43
|
-
mindent = indent;
|
|
44
|
-
} else {
|
|
45
|
-
mindent = Math.min(mindent, indent);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
if (mindent !== null) {
|
|
50
|
-
result = lines.map(function(l) {
|
|
51
|
-
return l[0] === " " ? l.slice(mindent) : l;
|
|
52
|
-
}).join(`
|
|
53
|
-
`);
|
|
54
|
-
}
|
|
55
|
-
result = result.trim();
|
|
56
|
-
return result.replace(/\\n/g, `
|
|
57
|
-
`);
|
|
58
|
-
}
|
|
59
|
-
if (typeof module !== "undefined") {
|
|
60
|
-
module.exports = dedent;
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
19
|
// ../../node_modules/unique-names-generator/dist/index.js
|
|
65
20
|
var require_dist = __commonJS((exports) => {
|
|
66
21
|
var a = (a2) => {
|
|
@@ -2711,7 +2666,6 @@ var sendMessageAction = {
|
|
|
2711
2666
|
]
|
|
2712
2667
|
};
|
|
2713
2668
|
// src/actions/settings.ts
|
|
2714
|
-
var import_dedent = __toESM(require_dedent(), 1);
|
|
2715
2669
|
import {
|
|
2716
2670
|
ChannelType as ChannelType2,
|
|
2717
2671
|
composePrompt as composePrompt3,
|
|
@@ -2722,6 +2676,104 @@ import {
|
|
|
2722
2676
|
ModelType as ModelType8,
|
|
2723
2677
|
parseKeyValueXml as parseKeyValueXml6
|
|
2724
2678
|
} from "@elizaos/core";
|
|
2679
|
+
|
|
2680
|
+
// ../../node_modules/dedent/dist/dedent.mjs
|
|
2681
|
+
function ownKeys(object, enumerableOnly) {
|
|
2682
|
+
var keys = Object.keys(object);
|
|
2683
|
+
if (Object.getOwnPropertySymbols) {
|
|
2684
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2685
|
+
enumerableOnly && (symbols = symbols.filter(function(sym) {
|
|
2686
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2687
|
+
})), keys.push.apply(keys, symbols);
|
|
2688
|
+
}
|
|
2689
|
+
return keys;
|
|
2690
|
+
}
|
|
2691
|
+
function _objectSpread(target) {
|
|
2692
|
+
for (var i = 1;i < arguments.length; i++) {
|
|
2693
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
2694
|
+
i % 2 ? ownKeys(Object(source), true).forEach(function(key) {
|
|
2695
|
+
_defineProperty(target, key, source[key]);
|
|
2696
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) {
|
|
2697
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2698
|
+
});
|
|
2699
|
+
}
|
|
2700
|
+
return target;
|
|
2701
|
+
}
|
|
2702
|
+
function _defineProperty(obj, key, value) {
|
|
2703
|
+
key = _toPropertyKey(key);
|
|
2704
|
+
if (key in obj) {
|
|
2705
|
+
Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
|
|
2706
|
+
} else {
|
|
2707
|
+
obj[key] = value;
|
|
2708
|
+
}
|
|
2709
|
+
return obj;
|
|
2710
|
+
}
|
|
2711
|
+
function _toPropertyKey(arg) {
|
|
2712
|
+
var key = _toPrimitive(arg, "string");
|
|
2713
|
+
return typeof key === "symbol" ? key : String(key);
|
|
2714
|
+
}
|
|
2715
|
+
function _toPrimitive(input, hint) {
|
|
2716
|
+
if (typeof input !== "object" || input === null)
|
|
2717
|
+
return input;
|
|
2718
|
+
var prim = input[Symbol.toPrimitive];
|
|
2719
|
+
if (prim !== undefined) {
|
|
2720
|
+
var res = prim.call(input, hint || "default");
|
|
2721
|
+
if (typeof res !== "object")
|
|
2722
|
+
return res;
|
|
2723
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2724
|
+
}
|
|
2725
|
+
return (hint === "string" ? String : Number)(input);
|
|
2726
|
+
}
|
|
2727
|
+
var dedent = createDedent({});
|
|
2728
|
+
var dedent_default = dedent;
|
|
2729
|
+
function createDedent(options) {
|
|
2730
|
+
dedent2.withOptions = (newOptions) => createDedent(_objectSpread(_objectSpread({}, options), newOptions));
|
|
2731
|
+
return dedent2;
|
|
2732
|
+
function dedent2(strings, ...values) {
|
|
2733
|
+
const raw = typeof strings === "string" ? [strings] : strings.raw;
|
|
2734
|
+
const {
|
|
2735
|
+
escapeSpecialCharacters = Array.isArray(strings)
|
|
2736
|
+
} = options;
|
|
2737
|
+
let result = "";
|
|
2738
|
+
for (let i = 0;i < raw.length; i++) {
|
|
2739
|
+
let next = raw[i];
|
|
2740
|
+
if (escapeSpecialCharacters) {
|
|
2741
|
+
next = next.replace(/\\\n[ \t]*/g, "").replace(/\\`/g, "`").replace(/\\\$/g, "$").replace(/\\\{/g, "{");
|
|
2742
|
+
}
|
|
2743
|
+
result += next;
|
|
2744
|
+
if (i < values.length) {
|
|
2745
|
+
result += values[i];
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
const lines = result.split(`
|
|
2749
|
+
`);
|
|
2750
|
+
let mindent = null;
|
|
2751
|
+
for (const l of lines) {
|
|
2752
|
+
const m = l.match(/^(\s+)\S+/);
|
|
2753
|
+
if (m) {
|
|
2754
|
+
const indent = m[1].length;
|
|
2755
|
+
if (!mindent) {
|
|
2756
|
+
mindent = indent;
|
|
2757
|
+
} else {
|
|
2758
|
+
mindent = Math.min(mindent, indent);
|
|
2759
|
+
}
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
if (mindent !== null) {
|
|
2763
|
+
const m = mindent;
|
|
2764
|
+
result = lines.map((l) => l[0] === " " || l[0] === "\t" ? l.slice(m) : l).join(`
|
|
2765
|
+
`);
|
|
2766
|
+
}
|
|
2767
|
+
result = result.trim();
|
|
2768
|
+
if (escapeSpecialCharacters) {
|
|
2769
|
+
result = result.replace(/\\n/g, `
|
|
2770
|
+
`);
|
|
2771
|
+
}
|
|
2772
|
+
return result;
|
|
2773
|
+
}
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
// src/actions/settings.ts
|
|
2725
2777
|
var messageCompletionFooter = `
|
|
2726
2778
|
# Instructions: Write the next message for {{agentName}}. Include the appropriate action from the list: {{actionNames}}
|
|
2727
2779
|
|
|
@@ -2890,7 +2942,7 @@ async function extractSettingValues(runtime, _message, state, worldSettings) {
|
|
|
2890
2942
|
return `${key}: ${setting.description} ${requiredStr}`;
|
|
2891
2943
|
}).join(`
|
|
2892
2944
|
`);
|
|
2893
|
-
const basePrompt =
|
|
2945
|
+
const basePrompt = dedent_default`
|
|
2894
2946
|
I need to extract settings values from the user's message.
|
|
2895
2947
|
|
|
2896
2948
|
Available settings:
|
|
@@ -7707,7 +7759,7 @@ async function runMultiStepCore({ runtime, message, state, callback }) {
|
|
|
7707
7759
|
let responseContent = null;
|
|
7708
7760
|
if (summary?.text) {
|
|
7709
7761
|
responseContent = {
|
|
7710
|
-
actions: ["
|
|
7762
|
+
actions: ["MULTI_STEP_SUMMARY"],
|
|
7711
7763
|
text: summary.text,
|
|
7712
7764
|
thought: summary.thought || "Final user-facing message after task completion.",
|
|
7713
7765
|
simple: true
|
|
@@ -8256,5 +8308,5 @@ export {
|
|
|
8256
8308
|
actionStateProvider
|
|
8257
8309
|
};
|
|
8258
8310
|
|
|
8259
|
-
//# debugId=
|
|
8311
|
+
//# debugId=A7E051FE7674FD3B64756E2164756E21
|
|
8260
8312
|
//# sourceMappingURL=index.js.map
|