@friendlyrobot/discord-pi-agent 0.19.2 → 0.19.3
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.
|
@@ -3,5 +3,5 @@ import type { ImageContent } from "@earendil-works/pi-ai";
|
|
|
3
3
|
type CollectReplyOptions = {
|
|
4
4
|
images?: ImageContent[];
|
|
5
5
|
};
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function runAgentTurn(session: AgentSession, prompt: string, options?: CollectReplyOptions): Promise<string>;
|
|
7
7
|
export {};
|
package/dist/index.js
CHANGED
|
@@ -302,9 +302,9 @@ async function formatWithPrettier(text) {
|
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
// src/
|
|
306
|
-
var logger4 = createModuleLogger("
|
|
307
|
-
async function
|
|
305
|
+
// src/agent-turn-runner.ts
|
|
306
|
+
var logger4 = createModuleLogger("agent-turn-runner");
|
|
307
|
+
async function runAgentTurn(session, prompt, options = {}) {
|
|
308
308
|
let streamedText = "";
|
|
309
309
|
let eventCount = 0;
|
|
310
310
|
let toolCount = 0;
|
|
@@ -454,7 +454,7 @@ class AgentService {
|
|
|
454
454
|
async prompt(text) {
|
|
455
455
|
const session = this.requireSession();
|
|
456
456
|
const transformedPrompt = await this.config.promptTransform(text);
|
|
457
|
-
return
|
|
457
|
+
return runAgentTurn(session, transformedPrompt);
|
|
458
458
|
}
|
|
459
459
|
async compact() {
|
|
460
460
|
const session = this.requireSession();
|
|
@@ -1552,7 +1552,7 @@ ${attachment.content}`;
|
|
|
1552
1552
|
}
|
|
1553
1553
|
const wrappedContent = buildDiscordPromptContent(message, scope, promptContent, config);
|
|
1554
1554
|
const transformedPrompt = await config.promptTransform(wrappedContent);
|
|
1555
|
-
return
|
|
1555
|
+
return runAgentTurn(session, transformedPrompt, {
|
|
1556
1556
|
images: promptImages
|
|
1557
1557
|
});
|
|
1558
1558
|
});
|