@polka-codes/cli-shared 0.7.23 → 0.7.24
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 +6 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -31093,11 +31093,10 @@ class AgentBase {
|
|
|
31093
31093
|
ai;
|
|
31094
31094
|
config;
|
|
31095
31095
|
handlers;
|
|
31096
|
-
#messages;
|
|
31096
|
+
#messages = [];
|
|
31097
31097
|
#originalTask;
|
|
31098
|
-
constructor(name2, ai, config
|
|
31098
|
+
constructor(name2, ai, config) {
|
|
31099
31099
|
this.ai = ai;
|
|
31100
|
-
this.#messages = messages;
|
|
31101
31100
|
if (config.agents && config.agents.length > 0) {
|
|
31102
31101
|
const agents = agentsPrompt(config.agents, name2);
|
|
31103
31102
|
config.systemPrompt += `
|
|
@@ -31114,7 +31113,7 @@ ${agents}`;
|
|
|
31114
31113
|
return this.#messages;
|
|
31115
31114
|
}
|
|
31116
31115
|
setMessages(messages) {
|
|
31117
|
-
this.#messages = messages;
|
|
31116
|
+
this.#messages = [...messages];
|
|
31118
31117
|
}
|
|
31119
31118
|
async#callback(event) {
|
|
31120
31119
|
await this.config.callback?.(event);
|
|
@@ -31124,19 +31123,13 @@ ${agents}`;
|
|
|
31124
31123
|
this.#callback({ kind: "StartTask" /* StartTask */, agent: this, systemPrompt: this.config.systemPrompt });
|
|
31125
31124
|
return await this.#processLoop(prompt);
|
|
31126
31125
|
}
|
|
31127
|
-
async step(
|
|
31128
|
-
if (messages) {
|
|
31129
|
-
this.#messages = messages;
|
|
31130
|
-
}
|
|
31126
|
+
async step(prompt) {
|
|
31131
31127
|
if (this.#messages.length === 0) {
|
|
31132
31128
|
this.#callback({ kind: "StartTask" /* StartTask */, agent: this, systemPrompt: this.config.systemPrompt });
|
|
31133
31129
|
}
|
|
31134
|
-
return await this.#request(
|
|
31130
|
+
return await this.#request(prompt);
|
|
31135
31131
|
}
|
|
31136
|
-
async handleStepResponse(response
|
|
31137
|
-
if (messages) {
|
|
31138
|
-
this.#messages = messages;
|
|
31139
|
-
}
|
|
31132
|
+
async handleStepResponse(response) {
|
|
31140
31133
|
return this.#handleResponse(response);
|
|
31141
31134
|
}
|
|
31142
31135
|
async#processLoop(userMessage) {
|