@polka-codes/cli 0.7.23 → 0.8.0
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 +7 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -24604,7 +24604,7 @@ var {
|
|
|
24604
24604
|
Help
|
|
24605
24605
|
} = import__.default;
|
|
24606
24606
|
// package.json
|
|
24607
|
-
var version = "0.
|
|
24607
|
+
var version = "0.8.0";
|
|
24608
24608
|
|
|
24609
24609
|
// ../core/src/AiService/AiServiceBase.ts
|
|
24610
24610
|
class AiServiceBase {
|
|
@@ -35183,11 +35183,10 @@ class AgentBase {
|
|
|
35183
35183
|
ai;
|
|
35184
35184
|
config;
|
|
35185
35185
|
handlers;
|
|
35186
|
-
#messages;
|
|
35186
|
+
#messages = [];
|
|
35187
35187
|
#originalTask;
|
|
35188
|
-
constructor(name2, ai, config
|
|
35188
|
+
constructor(name2, ai, config) {
|
|
35189
35189
|
this.ai = ai;
|
|
35190
|
-
this.#messages = messages;
|
|
35191
35190
|
if (config.agents && config.agents.length > 0) {
|
|
35192
35191
|
const agents = agentsPrompt(config.agents, name2);
|
|
35193
35192
|
config.systemPrompt += `
|
|
@@ -35204,7 +35203,7 @@ ${agents}`;
|
|
|
35204
35203
|
return this.#messages;
|
|
35205
35204
|
}
|
|
35206
35205
|
setMessages(messages) {
|
|
35207
|
-
this.#messages = messages;
|
|
35206
|
+
this.#messages = [...messages];
|
|
35208
35207
|
}
|
|
35209
35208
|
async#callback(event) {
|
|
35210
35209
|
await this.config.callback?.(event);
|
|
@@ -35214,19 +35213,13 @@ ${agents}`;
|
|
|
35214
35213
|
this.#callback({ kind: "StartTask" /* StartTask */, agent: this, systemPrompt: this.config.systemPrompt });
|
|
35215
35214
|
return await this.#processLoop(prompt);
|
|
35216
35215
|
}
|
|
35217
|
-
async step(
|
|
35218
|
-
if (messages) {
|
|
35219
|
-
this.#messages = messages;
|
|
35220
|
-
}
|
|
35216
|
+
async step(prompt) {
|
|
35221
35217
|
if (this.#messages.length === 0) {
|
|
35222
35218
|
this.#callback({ kind: "StartTask" /* StartTask */, agent: this, systemPrompt: this.config.systemPrompt });
|
|
35223
35219
|
}
|
|
35224
|
-
return await this.#request(
|
|
35220
|
+
return await this.#request(prompt);
|
|
35225
35221
|
}
|
|
35226
|
-
async handleStepResponse(response
|
|
35227
|
-
if (messages) {
|
|
35228
|
-
this.#messages = messages;
|
|
35229
|
-
}
|
|
35222
|
+
async handleStepResponse(response) {
|
|
35230
35223
|
return this.#handleResponse(response);
|
|
35231
35224
|
}
|
|
35232
35225
|
async#processLoop(userMessage) {
|