@polka-codes/core 0.7.21 → 0.7.23

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.
@@ -9,6 +9,7 @@ declare abstract class AgentBase {
9
9
  protected readonly handlers: Record<string, FullToolInfo>;
10
10
  constructor(name: string, ai: AiServiceBase, config: AgentBaseConfig, messages?: MessageParam[]);
11
11
  get messages(): Readonly<MessageParam[]>;
12
+ setMessages(messages: MessageParam[]): void;
12
13
  start(prompt: string): Promise<ExitReason>;
13
14
  step(promp: string, messages?: MessageParam[]): Promise<AssistantMessageContent[]>;
14
15
  handleStepResponse(response: AssistantMessageContent[], messages?: MessageParam[]): Promise<{
@@ -2141,6 +2142,7 @@ export { TaskEventCallback as TaskEventCallback_alias_2 }
2141
2142
  */
2142
2143
  declare interface TaskEventEndRequest extends TaskEventBase {
2143
2144
  kind: TaskEventKind.EndRequest;
2145
+ message: string;
2144
2146
  }
2145
2147
  export { TaskEventEndRequest }
2146
2148
  export { TaskEventEndRequest as TaskEventEndRequest_alias_1 }
package/dist/index.js CHANGED
@@ -2231,6 +2231,9 @@ ${agents}`;
2231
2231
  get messages() {
2232
2232
  return this.#messages;
2233
2233
  }
2234
+ setMessages(messages) {
2235
+ this.#messages = messages;
2236
+ }
2234
2237
  async #callback(event) {
2235
2238
  await this.config.callback?.(event);
2236
2239
  }
@@ -2318,7 +2321,7 @@ ${agents}`;
2318
2321
  content: currentAssistantMessage
2319
2322
  });
2320
2323
  const ret = parseAssistantMessage(currentAssistantMessage, this.config.tools, this.config.toolNamePrefix);
2321
- await this.#callback({ kind: "EndRequest" /* EndRequest */, agent: this });
2324
+ await this.#callback({ kind: "EndRequest" /* EndRequest */, agent: this, message: currentAssistantMessage });
2322
2325
  return ret;
2323
2326
  }
2324
2327
  async #handleResponse(response) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/core",
3
- "version": "0.7.21",
3
+ "version": "0.7.23",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",