@elizaos/plugin-bootstrap 1.5.13-alpha.3 → 1.5.13-alpha.4
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/imageGeneration.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -50
- package/dist/index.js.map +5 -5
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imageGeneration.d.ts","sourceRoot":"","sources":["../../src/actions/imageGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAYZ,MAAM,eAAe,CAAC;AAuBvB;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"imageGeneration.d.ts","sourceRoot":"","sources":["../../src/actions/imageGeneration.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,MAAM,EAYZ,MAAM,eAAe,CAAC;AAuBvB;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EA6M3B,MAAM,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAaL,KAAK,aAAa,EAIlB,KAAK,KAAK,EAMV,KAAK,MAAM,EAKX,KAAK,IAAI,EAUV,MAAM,eAAe,CAAC;AAUvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AAErC;;;;;GAKG;AACH,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAyBF;;GAEG;AA0CH;;;;;GAKG;AACH;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,WAAW,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAsB/E;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACtC,WAAW,EAAE,KAAK,EAAE,EACpB,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,KAAK,EAAE,CAAC,CAyHlB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,aAAa,EACtB,IAAI,CAAC,EAAE,IAAI,EACX,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAyCT;AAmmDD,eAAO,MAAM,eAAe,EAAE,MAyC7B,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -237,7 +237,7 @@ var generateImageAction = {
|
|
|
237
237
|
{
|
|
238
238
|
id: attachmentId,
|
|
239
239
|
url: imageUrl,
|
|
240
|
-
title:
|
|
240
|
+
title: fileName,
|
|
241
241
|
contentType: ContentType.IMAGE
|
|
242
242
|
}
|
|
243
243
|
],
|
|
@@ -245,13 +245,7 @@ var generateImageAction = {
|
|
|
245
245
|
actions: ["GENERATE_IMAGE"],
|
|
246
246
|
text: imagePrompt
|
|
247
247
|
};
|
|
248
|
-
|
|
249
|
-
id: attachmentId,
|
|
250
|
-
attachment: imageUrl,
|
|
251
|
-
name: fileName,
|
|
252
|
-
contentType: ContentType.IMAGE
|
|
253
|
-
};
|
|
254
|
-
await callback(responseContent, [imageFile]);
|
|
248
|
+
await callback(responseContent);
|
|
255
249
|
return {
|
|
256
250
|
text: "Generated image",
|
|
257
251
|
values: {
|
|
@@ -1800,8 +1794,8 @@ var replyAction = {
|
|
|
1800
1794
|
return true;
|
|
1801
1795
|
},
|
|
1802
1796
|
handler: async (runtime, message, state, _options, callback, responses) => {
|
|
1803
|
-
const
|
|
1804
|
-
const previousResults =
|
|
1797
|
+
const actionContext = _options?.actionContext;
|
|
1798
|
+
const previousResults = actionContext?.previousResults || [];
|
|
1805
1799
|
if (previousResults.length > 0) {
|
|
1806
1800
|
logger5.debug(`[REPLY] Found ${previousResults.length} previous action results`);
|
|
1807
1801
|
}
|
|
@@ -7441,12 +7435,17 @@ ${response}`);
|
|
|
7441
7435
|
if (responseContent.providers && responseContent.providers.length > 0) {
|
|
7442
7436
|
runtime.logger.debug({ providers: responseContent.providers }, "[Bootstrap] Simple response used providers");
|
|
7443
7437
|
}
|
|
7444
|
-
|
|
7438
|
+
if (callback) {
|
|
7439
|
+
await callback(responseContent);
|
|
7440
|
+
}
|
|
7445
7441
|
} else if (mode === "actions") {
|
|
7446
|
-
await runtime.processActions(message, responseMessages, state, async (content
|
|
7447
|
-
runtime.logger.debug({ content
|
|
7442
|
+
await runtime.processActions(message, responseMessages, state, async (content) => {
|
|
7443
|
+
runtime.logger.debug({ content }, "action callback");
|
|
7448
7444
|
responseContent.actionCallbacks = content;
|
|
7449
|
-
|
|
7445
|
+
if (callback) {
|
|
7446
|
+
return callback(content);
|
|
7447
|
+
}
|
|
7448
|
+
return [];
|
|
7450
7449
|
});
|
|
7451
7450
|
}
|
|
7452
7451
|
}
|
|
@@ -7492,7 +7491,9 @@ ${response}`);
|
|
|
7492
7491
|
simple: true,
|
|
7493
7492
|
inReplyTo: createUniqueUuid3(runtime, message.id)
|
|
7494
7493
|
};
|
|
7495
|
-
|
|
7494
|
+
if (callback) {
|
|
7495
|
+
await callback(ignoreContent);
|
|
7496
|
+
}
|
|
7496
7497
|
const ignoreMemory = {
|
|
7497
7498
|
id: asUUID2(v4_default()),
|
|
7498
7499
|
entityId: runtime.agentId,
|
|
@@ -7502,9 +7503,7 @@ ${response}`);
|
|
|
7502
7503
|
createdAt: Date.now()
|
|
7503
7504
|
};
|
|
7504
7505
|
await runtime.createMemory(ignoreMemory, "messages");
|
|
7505
|
-
runtime.logger.debug("[Bootstrap] Saved ignore response to memory", {
|
|
7506
|
-
memoryId: ignoreMemory.id
|
|
7507
|
-
});
|
|
7506
|
+
runtime.logger.debug("[Bootstrap] Saved ignore response to memory", `memoryId: ${ignoreMemory.id}`);
|
|
7508
7507
|
}
|
|
7509
7508
|
agentResponses.delete(message.roomId);
|
|
7510
7509
|
if (agentResponses.size === 0) {
|
|
@@ -7515,13 +7514,16 @@ ${response}`);
|
|
|
7515
7514
|
if (responseContent) {
|
|
7516
7515
|
responseContent.evalCallbacks = content;
|
|
7517
7516
|
}
|
|
7518
|
-
|
|
7517
|
+
if (callback) {
|
|
7518
|
+
return callback(content);
|
|
7519
|
+
}
|
|
7520
|
+
return [];
|
|
7519
7521
|
}, responseMessages);
|
|
7520
7522
|
let entityName = "noname";
|
|
7521
7523
|
if (message.metadata && "entityName" in message.metadata) {
|
|
7522
7524
|
entityName = message.metadata.entityName;
|
|
7523
7525
|
}
|
|
7524
|
-
const isDM = message.content?.channelType
|
|
7526
|
+
const isDM = message.content?.channelType === ChannelType9.DM;
|
|
7525
7527
|
let roomName = entityName;
|
|
7526
7528
|
if (!isDM) {
|
|
7527
7529
|
const roomDatas = await runtime.getRoomsByIds([message.roomId]);
|
|
@@ -7692,10 +7694,12 @@ async function runMultiStepCore({ runtime, message, state, callback }) {
|
|
|
7692
7694
|
const { thought, providers: providers2 = [], action, isFinish } = parsedStep;
|
|
7693
7695
|
if (isFinish === "true" || isFinish === true) {
|
|
7694
7696
|
runtime.logger.info(`[MultiStep] Task marked as complete at iteration ${iterationCount}`);
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7697
|
+
if (callback) {
|
|
7698
|
+
await callback({
|
|
7699
|
+
text: "",
|
|
7700
|
+
thought: thought ?? ""
|
|
7701
|
+
});
|
|
7702
|
+
}
|
|
7699
7703
|
break;
|
|
7700
7704
|
}
|
|
7701
7705
|
if ((!providers2 || providers2.length === 0) && !action) {
|
|
@@ -7731,11 +7735,13 @@ async function runMultiStepCore({ runtime, message, state, callback }) {
|
|
|
7731
7735
|
text: success ? providerResult.text : undefined,
|
|
7732
7736
|
error: success ? undefined : providerResult?.error
|
|
7733
7737
|
});
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7738
|
+
if (callback) {
|
|
7739
|
+
await callback({
|
|
7740
|
+
text: `\uD83D\uDD0E Provider executed: ${providerName}`,
|
|
7741
|
+
actions: [providerName],
|
|
7742
|
+
thought: thought ?? ""
|
|
7743
|
+
});
|
|
7744
|
+
}
|
|
7739
7745
|
}
|
|
7740
7746
|
if (action) {
|
|
7741
7747
|
const actionContent = {
|
|
@@ -8116,12 +8122,7 @@ var events = {
|
|
|
8116
8122
|
payload.runtime.logger.error("No callback provided for message");
|
|
8117
8123
|
return;
|
|
8118
8124
|
}
|
|
8119
|
-
await messageReceivedHandler(
|
|
8120
|
-
runtime: payload.runtime,
|
|
8121
|
-
message: payload.message,
|
|
8122
|
-
callback: payload.callback,
|
|
8123
|
-
onComplete: payload.onComplete
|
|
8124
|
-
});
|
|
8125
|
+
await messageReceivedHandler(payload);
|
|
8125
8126
|
}
|
|
8126
8127
|
],
|
|
8127
8128
|
[EventType2.VOICE_MESSAGE_RECEIVED]: [
|
|
@@ -8130,20 +8131,12 @@ var events = {
|
|
|
8130
8131
|
payload.runtime.logger.error("No callback provided for voice message");
|
|
8131
8132
|
return;
|
|
8132
8133
|
}
|
|
8133
|
-
await messageReceivedHandler(
|
|
8134
|
-
runtime: payload.runtime,
|
|
8135
|
-
message: payload.message,
|
|
8136
|
-
callback: payload.callback,
|
|
8137
|
-
onComplete: payload.onComplete
|
|
8138
|
-
});
|
|
8134
|
+
await messageReceivedHandler(payload);
|
|
8139
8135
|
}
|
|
8140
8136
|
],
|
|
8141
8137
|
[EventType2.REACTION_RECEIVED]: [
|
|
8142
8138
|
async (payload) => {
|
|
8143
|
-
await reactionReceivedHandler(
|
|
8144
|
-
runtime: payload.runtime,
|
|
8145
|
-
message: payload.message
|
|
8146
|
-
});
|
|
8139
|
+
await reactionReceivedHandler(payload);
|
|
8147
8140
|
}
|
|
8148
8141
|
],
|
|
8149
8142
|
[EventType2.POST_GENERATED]: [
|
|
@@ -8158,10 +8151,7 @@ var events = {
|
|
|
8158
8151
|
],
|
|
8159
8152
|
[EventType2.MESSAGE_DELETED]: [
|
|
8160
8153
|
async (payload) => {
|
|
8161
|
-
await messageDeletedHandler(
|
|
8162
|
-
runtime: payload.runtime,
|
|
8163
|
-
message: payload.message
|
|
8164
|
-
});
|
|
8154
|
+
await messageDeletedHandler(payload);
|
|
8165
8155
|
}
|
|
8166
8156
|
],
|
|
8167
8157
|
[EventType2.CHANNEL_CLEARED]: [
|
|
@@ -8438,5 +8428,5 @@ export {
|
|
|
8438
8428
|
actionStateProvider
|
|
8439
8429
|
};
|
|
8440
8430
|
|
|
8441
|
-
//# debugId=
|
|
8431
|
+
//# debugId=0B130525A243124D64756E2164756E21
|
|
8442
8432
|
//# sourceMappingURL=index.js.map
|