@polka-codes/core 0.4.3 → 0.4.5

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.
Files changed (2) hide show
  1. package/dist/index.js +615 -129
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2877,6 +2877,7 @@ class AiServiceBase {
2877
2877
  totalCost: 0
2878
2878
  };
2879
2879
  let resp = "";
2880
+ let reasoning = "";
2880
2881
  for await (const chunk of stream) {
2881
2882
  switch (chunk.type) {
2882
2883
  case "usage":
@@ -2889,10 +2890,13 @@ class AiServiceBase {
2889
2890
  case "text":
2890
2891
  resp += chunk.text;
2891
2892
  break;
2893
+ case "reasoning":
2894
+ reasoning += chunk.text;
2892
2895
  }
2893
2896
  }
2894
2897
  return {
2895
2898
  response: resp,
2899
+ reasoning,
2896
2900
  usage
2897
2901
  };
2898
2902
  }
@@ -7884,6 +7888,12 @@ class DeepSeekService extends AiServiceBase {
7884
7888
  });
7885
7889
  for await (const chunk of stream) {
7886
7890
  const delta = chunk.choices[0]?.delta;
7891
+ if (delta?.reasoning_content) {
7892
+ yield {
7893
+ type: "reasoning",
7894
+ text: delta.reasoning_content
7895
+ };
7896
+ }
7887
7897
  if (delta?.content) {
7888
7898
  yield {
7889
7899
  type: "text",
@@ -7941,17 +7951,169 @@ class OllamaService extends AiServiceBase {
7941
7951
  }
7942
7952
  }
7943
7953
 
7954
+ // src/AiService/OpenRouterService.ts
7955
+ class OpenRouterService extends AiServiceBase {
7956
+ #client;
7957
+ #apiKey;
7958
+ model;
7959
+ constructor(options) {
7960
+ super();
7961
+ if (!options.model) {
7962
+ throw new Error("OpenRouter requires a model");
7963
+ }
7964
+ if (!options.apiKey) {
7965
+ throw new Error("OpenRouter requires an API key");
7966
+ }
7967
+ this.#apiKey = options.apiKey;
7968
+ this.#client = new openai_default({
7969
+ baseURL: "https://openrouter.ai/api/v1",
7970
+ apiKey: options.apiKey,
7971
+ defaultHeaders: {
7972
+ "HTTP-Referer": "https://polka.codes",
7973
+ "X-Title": "Polka Codes"
7974
+ }
7975
+ });
7976
+ this.model = {
7977
+ id: options.model,
7978
+ info: {}
7979
+ };
7980
+ }
7981
+ async* send(systemPrompt, messages) {
7982
+ const openAiMessages = [
7983
+ { role: "system", content: systemPrompt },
7984
+ ...convertToOpenAiMessages(messages)
7985
+ ];
7986
+ switch (this.model.id) {
7987
+ case "anthropic/claude-3.5-sonnet":
7988
+ case "anthropic/claude-3.5-sonnet:beta":
7989
+ case "anthropic/claude-3.5-sonnet-20240620":
7990
+ case "anthropic/claude-3.5-sonnet-20240620:beta":
7991
+ case "anthropic/claude-3-5-haiku":
7992
+ case "anthropic/claude-3-5-haiku:beta":
7993
+ case "anthropic/claude-3-5-haiku-20241022":
7994
+ case "anthropic/claude-3-5-haiku-20241022:beta":
7995
+ case "anthropic/claude-3-haiku":
7996
+ case "anthropic/claude-3-haiku:beta":
7997
+ case "anthropic/claude-3-opus":
7998
+ case "anthropic/claude-3-opus:beta": {
7999
+ openAiMessages[0] = {
8000
+ role: "system",
8001
+ content: [
8002
+ {
8003
+ type: "text",
8004
+ text: systemPrompt,
8005
+ cache_control: { type: "ephemeral" }
8006
+ }
8007
+ ]
8008
+ };
8009
+ const lastTwoUserMessages = openAiMessages.filter((msg) => msg.role === "user").slice(-2);
8010
+ for (const msg of lastTwoUserMessages) {
8011
+ if (typeof msg.content === "string") {
8012
+ msg.content = [{ type: "text", text: msg.content }];
8013
+ }
8014
+ if (Array.isArray(msg.content)) {
8015
+ let lastTextPart = msg.content.filter((part) => part.type === "text").pop();
8016
+ if (!lastTextPart) {
8017
+ lastTextPart = { type: "text", text: "..." };
8018
+ msg.content.push(lastTextPart);
8019
+ }
8020
+ lastTextPart.cache_control = { type: "ephemeral" };
8021
+ }
8022
+ }
8023
+ break;
8024
+ }
8025
+ default:
8026
+ break;
8027
+ }
8028
+ let maxTokens;
8029
+ switch (this.model.id) {
8030
+ case "anthropic/claude-3.5-sonnet":
8031
+ case "anthropic/claude-3.5-sonnet:beta":
8032
+ case "anthropic/claude-3.5-sonnet-20240620":
8033
+ case "anthropic/claude-3.5-sonnet-20240620:beta":
8034
+ case "anthropic/claude-3-5-haiku":
8035
+ case "anthropic/claude-3-5-haiku:beta":
8036
+ case "anthropic/claude-3-5-haiku-20241022":
8037
+ case "anthropic/claude-3-5-haiku-20241022:beta":
8038
+ maxTokens = 8192;
8039
+ break;
8040
+ }
8041
+ let shouldApplyMiddleOutTransform = !this.model.info.supportsPromptCache;
8042
+ if (this.model.id === "deepseek/deepseek-chat") {
8043
+ shouldApplyMiddleOutTransform = true;
8044
+ }
8045
+ const stream = await this.#client.chat.completions.create({
8046
+ model: this.model.id,
8047
+ max_completion_tokens: maxTokens,
8048
+ messages: openAiMessages,
8049
+ temperature: 0,
8050
+ stream: true,
8051
+ transforms: shouldApplyMiddleOutTransform ? ["middle-out"] : undefined,
8052
+ include_reasoning: true
8053
+ });
8054
+ let genId;
8055
+ for await (const chunk of stream) {
8056
+ if ("error" in chunk) {
8057
+ const error = chunk.error;
8058
+ console.error(`OpenRouter API Error: ${error?.code} - ${error?.message}`);
8059
+ throw new Error(`OpenRouter API Error ${error?.code}: ${error?.message}`);
8060
+ }
8061
+ if (!genId && chunk.id) {
8062
+ genId = chunk.id;
8063
+ }
8064
+ const delta = chunk.choices[0]?.delta;
8065
+ if (delta?.reasoning) {
8066
+ yield {
8067
+ type: "reasoning",
8068
+ text: delta.reasoning
8069
+ };
8070
+ }
8071
+ if (delta?.content) {
8072
+ yield {
8073
+ type: "text",
8074
+ text: delta.content
8075
+ };
8076
+ }
8077
+ }
8078
+ await new Promise((resolve) => setTimeout(resolve, 1000));
8079
+ const controller = new AbortController;
8080
+ const timeout = setTimeout(() => controller.abort(), 5000);
8081
+ try {
8082
+ const response = await fetch(`https://openrouter.ai/api/v1/generation?id=${genId}`, {
8083
+ headers: {
8084
+ Authorization: `Bearer ${this.#apiKey}`
8085
+ },
8086
+ signal: controller.signal
8087
+ });
8088
+ const responseBody = await response.json();
8089
+ const generation = responseBody.data;
8090
+ yield {
8091
+ type: "usage",
8092
+ inputTokens: generation?.native_tokens_prompt || 0,
8093
+ outputTokens: generation?.native_tokens_completion || 0,
8094
+ totalCost: generation?.total_cost || 0
8095
+ };
8096
+ } catch (error) {
8097
+ console.error("Error fetching OpenRouter generation details:", error);
8098
+ } finally {
8099
+ clearTimeout(timeout);
8100
+ }
8101
+ }
8102
+ }
8103
+
7944
8104
  // src/AiService/index.ts
7945
8105
  var AiServiceProvider;
7946
8106
  ((AiServiceProvider2) => {
7947
8107
  AiServiceProvider2["Anthropic"] = "anthropic";
7948
8108
  AiServiceProvider2["Ollama"] = "ollama";
7949
8109
  AiServiceProvider2["DeepSeek"] = "deepseek";
8110
+ AiServiceProvider2["OpenRouter"] = "openrouter";
7950
8111
  })(AiServiceProvider ||= {});
7951
8112
  var defaultModels = {
7952
8113
  ["anthropic" /* Anthropic */]: "claude-3-5-sonnet-20241022",
7953
8114
  ["ollama" /* Ollama */]: "maryasov/qwen2.5-coder-cline:7b",
7954
- ["deepseek" /* DeepSeek */]: "deepseek-chat"
8115
+ ["deepseek" /* DeepSeek */]: "deepseek-chat",
8116
+ ["openrouter" /* OpenRouter */]: "anthropic/claude-3.5-sonnet"
7955
8117
  };
7956
8118
  var createService = (provider, options) => {
7957
8119
  switch (provider) {
@@ -7961,9 +8123,20 @@ var createService = (provider, options) => {
7961
8123
  return new OllamaService(options);
7962
8124
  case "deepseek" /* DeepSeek */:
7963
8125
  return new DeepSeekService(options);
8126
+ case "openrouter" /* OpenRouter */:
8127
+ return new OpenRouterService(options);
7964
8128
  }
7965
8129
  };
7966
8130
  // src/tool.ts
8131
+ var ToolResponseType;
8132
+ ((ToolResponseType2) => {
8133
+ ToolResponseType2["Reply"] = "Reply";
8134
+ ToolResponseType2["Exit"] = "Exit";
8135
+ ToolResponseType2["Invalid"] = "Invalid";
8136
+ ToolResponseType2["Error"] = "Error";
8137
+ ToolResponseType2["Interrupted"] = "Interrupted";
8138
+ ToolResponseType2["HandOver"] = "HandOver";
8139
+ })(ToolResponseType ||= {});
7967
8140
  var getAvailableTools = (provider, allTools) => {
7968
8141
  return allTools.filter((tool) => tool.isAvailable(provider));
7969
8142
  };
@@ -8116,6 +8289,95 @@ By adhering to these guidelines:
8116
8289
  - You confirm each step’s results before proceeding.
8117
8290
  - You provide only the necessary information in user-facing replies to prevent re-interpretation as new commands.`;
8118
8291
  };
8292
+ var agentsPrompt = (agents, name) => `
8293
+ ====
8294
+
8295
+ AVAILABLE AGENTS
8296
+
8297
+ The following agents are available for task handover:
8298
+ ${agents.map((agent) => `
8299
+ - **${agent.name}**
8300
+ - Responsibilities:
8301
+ ${agent.responsibilities.map((resp) => ` - ${resp}`).join(`
8302
+ `)}`).join(`
8303
+ `)}
8304
+
8305
+ - **Current Agent Role**
8306
+ You are currently acting as **${name}**. If you identify the task is beyond your current scope, use the handover tool to transition to the other agent. Include sufficient context so the new agent can seamlessly continue the work.
8307
+ `;
8308
+ var capabilities = (toolNamePrefix) => `
8309
+ ====
8310
+
8311
+ CAPABILITIES
8312
+
8313
+ - You have access to a range of tools to aid you in your work. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
8314
+ - When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in environment_details. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further.
8315
+ - You can use ${toolNamePrefix}search_files to perform regex searches across files in a specified directory, outputting context-rich results that include surrounding lines. This is particularly useful for understanding code patterns, finding specific implementations, or identifying areas that need refactoring.
8316
+ - You can use the ${toolNamePrefix}list_code_definition_names tool to get an overview of source code definitions for all files at the top level of a specified directory. This can be particularly useful when you need to understand the broader context and relationships between certain parts of the code. You may need to call this tool multiple times to understand various parts of the codebase related to the task.
8317
+ \t- For example, when asked to make edits or improvements you might analyze the file structure in the initial environment_details to get an overview of the project, then use ${toolNamePrefix}list_code_definition_names to get further insight using source code definitions for files located in relevant directories, then ${toolNamePrefix}read_file to examine the contents of relevant files, analyze the code and suggest improvements or make necessary edits, then use the ${toolNamePrefix}replace_in_file tool to implement changes. If you refactored code that could affect other parts of the codebase, you could use ${toolNamePrefix}search_files to ensure you update other files as needed.
8318
+ - You can use the ${toolNamePrefix}execute_command tool to run commands on the user's computer whenever you feel it can help accomplish the user's task. When you need to execute a CLI command, you must provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, since they are more flexible and easier to run. Interactive and long-running commands are allowed, since the commands are run in the user's VSCode terminal. The user may keep commands running in the background and you will be kept updated on their status along the way. Each command you execute is run in a new terminal instance.`;
8319
+ var systemInformation = (info) => `
8320
+ ====
8321
+
8322
+ SYSTEM INFORMATION
8323
+
8324
+ Operating System: ${info.os}`;
8325
+ var interactiveMode = (interactive) => {
8326
+ if (interactive) {
8327
+ return `
8328
+ ====
8329
+
8330
+ INTERACTIVE MODE
8331
+
8332
+ You are in interactive mode. This means you may ask user questions to gather additional information to complete the task.
8333
+ `;
8334
+ }
8335
+ return `
8336
+ ====
8337
+
8338
+ NON-INTERACTIVE MODE
8339
+
8340
+ You are in non-interactive mode. This means you will not be able to ask user questions to gather additional information to complete the task. You should try to use available tools to accomplish the task. If unable to precede further, you may try to end the task and provide a reason.
8341
+ `;
8342
+ };
8343
+ var customInstructions = (customInstructions2) => {
8344
+ const joined = customInstructions2.join(`
8345
+ `);
8346
+ if (joined.trim() === "") {
8347
+ return "";
8348
+ }
8349
+ return `
8350
+ ====
8351
+
8352
+ USER'S CUSTOM INSTRUCTIONS
8353
+
8354
+ The following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
8355
+
8356
+ ${joined}`;
8357
+ };
8358
+ var customScripts = (commands) => {
8359
+ const joined = Object.entries(commands).map(([name, command]) => {
8360
+ if (typeof command === "string") {
8361
+ return `- ${name}
8362
+ - Command: \`${command}\``;
8363
+ }
8364
+ return `- ${name}
8365
+ - Command: \`${command.command}\`
8366
+ - Description: ${command.description}`;
8367
+ }).join(`
8368
+ `);
8369
+ if (joined.trim() === "") {
8370
+ return "";
8371
+ }
8372
+ return `
8373
+ ====
8374
+
8375
+ USER'S CUSTOM COMMANDS
8376
+
8377
+ The following additional commands are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
8378
+
8379
+ ${joined}`;
8380
+ };
8119
8381
  var responsePrompts = {
8120
8382
  errorInvokeTool: (tool, error) => `An error occurred while invoking the tool "${tool}": ${error}`,
8121
8383
  requireUseTool: "Error: You must use a tool before proceeding",
@@ -8128,20 +8390,34 @@ ${result}
8128
8390
  };
8129
8391
 
8130
8392
  // src/Agent/AgentBase.ts
8131
- var ExitReason;
8132
- ((ExitReason2) => {
8133
- ExitReason2["Completed"] = "Completed";
8134
- ExitReason2["MaxIterations"] = "MaxIterations";
8135
- ExitReason2["WaitForUserInput"] = "WaitForUserInput";
8136
- ExitReason2["Interrupted"] = "Interrupted";
8137
- })(ExitReason ||= {});
8393
+ var TaskEventKind;
8394
+ ((TaskEventKind2) => {
8395
+ TaskEventKind2["StartRequest"] = "StartRequest";
8396
+ TaskEventKind2["EndRequest"] = "EndRequest";
8397
+ TaskEventKind2["Usage"] = "Usage";
8398
+ TaskEventKind2["Text"] = "Text";
8399
+ TaskEventKind2["Reasoning"] = "Reasoning";
8400
+ TaskEventKind2["ToolUse"] = "ToolUse";
8401
+ TaskEventKind2["ToolReply"] = "ToolReply";
8402
+ TaskEventKind2["ToolInvalid"] = "ToolInvalid";
8403
+ TaskEventKind2["ToolError"] = "ToolError";
8404
+ TaskEventKind2["ToolInterrupted"] = "ToolInterrupted";
8405
+ TaskEventKind2["ToolHandOver"] = "ToolHandOver";
8406
+ TaskEventKind2["MaxIterationsReached"] = "MaxIterationsReached";
8407
+ TaskEventKind2["EndTask"] = "EndTask";
8408
+ })(TaskEventKind ||= {});
8138
8409
 
8139
8410
  class AgentBase {
8140
8411
  ai;
8141
8412
  config;
8142
8413
  handlers;
8143
- constructor(ai, config) {
8414
+ constructor(name, ai, config) {
8144
8415
  this.ai = ai;
8416
+ if (config.agents && Object.keys(config.agents).length > 0) {
8417
+ const agents = agentsPrompt(config.agents, name);
8418
+ config.systemPrompt += `
8419
+ ${agents}`;
8420
+ }
8145
8421
  this.config = config;
8146
8422
  const handlers = {};
8147
8423
  for (const tool of config.tools) {
@@ -8156,6 +8432,9 @@ class AgentBase {
8156
8432
  callback = () => {
8157
8433
  }
8158
8434
  }) {
8435
+ if (maxIterations < 1) {
8436
+ throw new Error("Max iterations must be greater than 0");
8437
+ }
8159
8438
  const taskInfo = {
8160
8439
  options: {
8161
8440
  maxIterations
@@ -8178,24 +8457,26 @@ class AgentBase {
8178
8457
  let nextRequest = userMessage;
8179
8458
  while (nextRequest) {
8180
8459
  if (taskInfo.messages.length > taskInfo.options.maxIterations * 2) {
8181
- callback({ kind: "max_iterations_reached", info: taskInfo });
8182
- return ["MaxIterations" /* MaxIterations */, taskInfo];
8460
+ callback({ kind: "MaxIterationsReached" /* MaxIterationsReached */, info: taskInfo });
8461
+ return ["MaxIterations", taskInfo];
8183
8462
  }
8184
8463
  const response = await this.#request(taskInfo, nextRequest, callback);
8185
8464
  const [newMessage, exitReason] = await this.#handleResponse(taskInfo, response, callback);
8186
8465
  if (exitReason) {
8466
+ callback({ kind: "EndTask" /* EndTask */, info: taskInfo });
8187
8467
  return [exitReason, taskInfo];
8188
8468
  }
8189
8469
  nextRequest = newMessage;
8190
8470
  }
8191
- callback({ kind: "end_task", info: taskInfo });
8192
- return ["Completed" /* Completed */, taskInfo];
8471
+ callback({ kind: "EndTask" /* EndTask */, info: taskInfo });
8472
+ return [{ type: "Exit" /* Exit */, message: "Task completed successfully" }, taskInfo];
8193
8473
  }
8194
- async continueTask(userMessage, taskInfo, callback) {
8474
+ async continueTask(userMessage, taskInfo, callback = () => {
8475
+ }) {
8195
8476
  return await this.#processLoop(userMessage, taskInfo, callback);
8196
8477
  }
8197
8478
  async#request(info, userMessage, callback) {
8198
- await callback({ kind: "start_request", info, userMessage });
8479
+ await callback({ kind: "StartRequest" /* StartRequest */, info, userMessage });
8199
8480
  info.messages.push({
8200
8481
  role: "user",
8201
8482
  content: userMessage
@@ -8210,11 +8491,14 @@ class AgentBase {
8210
8491
  info.cacheWriteTokens = chunk.cacheWriteTokens ?? 0;
8211
8492
  info.cacheReadTokens = chunk.cacheReadTokens ?? 0;
8212
8493
  info.totalCost = chunk.totalCost;
8213
- await callback({ kind: "usage", info });
8494
+ await callback({ kind: "Usage" /* Usage */, info });
8214
8495
  break;
8215
8496
  case "text":
8216
8497
  currentAssistantMessage += chunk.text;
8217
- await callback({ kind: "text", info, newText: chunk.text });
8498
+ await callback({ kind: "Text" /* Text */, info, newText: chunk.text });
8499
+ break;
8500
+ case "reasoning":
8501
+ await callback({ kind: "Reasoning" /* Reasoning */, info, newText: chunk.text });
8218
8502
  break;
8219
8503
  }
8220
8504
  }
@@ -8226,41 +8510,53 @@ class AgentBase {
8226
8510
  content: currentAssistantMessage
8227
8511
  });
8228
8512
  const ret = parseAssistantMessage(currentAssistantMessage, this.config.tools, this.config.toolNamePrefix);
8229
- await callback({ kind: "end_request", info });
8513
+ await callback({ kind: "EndRequest" /* EndRequest */, info });
8230
8514
  return ret;
8231
8515
  }
8232
8516
  async#handleResponse(info, response, callback) {
8233
8517
  const toolReponses = [];
8234
- for (const content of response) {
8235
- switch (content.type) {
8236
- case "text":
8237
- break;
8238
- case "tool_use": {
8239
- await callback({ kind: "tool_use", info, tool: content.name });
8240
- const toolResp = await this.#invokeTool(content.name, content.params);
8241
- switch (toolResp.type) {
8242
- case "Reply" /* Reply */:
8243
- await callback({ kind: "tool_reply", info, tool: content.name });
8244
- toolReponses.push({ tool: content.name, response: toolResp.message });
8245
- break;
8246
- case "Exit" /* Exit */:
8247
- return [undefined, "Completed" /* Completed */];
8248
- case "Invalid" /* Invalid */:
8249
- await callback({ kind: "tool_invalid", info, tool: content.name });
8250
- toolReponses.push({ tool: content.name, response: toolResp.message });
8251
- break;
8252
- case "Error" /* Error */:
8253
- await callback({ kind: "tool_error", info, tool: content.name });
8254
- toolReponses.push({ tool: content.name, response: toolResp.message });
8255
- break;
8256
- case "Interrupted" /* Interrupted */:
8257
- await callback({ kind: "tool_interrupted", info, tool: content.name });
8258
- return [undefined, "Interrupted" /* Interrupted */];
8518
+ outer:
8519
+ for (const content of response) {
8520
+ switch (content.type) {
8521
+ case "text":
8522
+ break;
8523
+ case "tool_use": {
8524
+ await callback({ kind: "ToolUse" /* ToolUse */, info, tool: content.name });
8525
+ const toolResp = await this.#invokeTool(content.name, content.params);
8526
+ switch (toolResp.type) {
8527
+ case "Reply" /* Reply */:
8528
+ await callback({ kind: "ToolReply" /* ToolReply */, info, tool: content.name });
8529
+ toolReponses.push({ tool: content.name, response: toolResp.message });
8530
+ break;
8531
+ case "Exit" /* Exit */:
8532
+ return [undefined, toolResp];
8533
+ case "Invalid" /* Invalid */:
8534
+ await callback({ kind: "ToolInvalid" /* ToolInvalid */, info, tool: content.name });
8535
+ toolReponses.push({ tool: content.name, response: toolResp.message });
8536
+ break outer;
8537
+ case "Error" /* Error */:
8538
+ await callback({ kind: "ToolError" /* ToolError */, info, tool: content.name });
8539
+ toolReponses.push({ tool: content.name, response: toolResp.message });
8540
+ break outer;
8541
+ case "Interrupted" /* Interrupted */:
8542
+ await callback({ kind: "ToolInterrupted" /* ToolInterrupted */, info, tool: content.name });
8543
+ return [undefined, toolResp];
8544
+ case "HandOver" /* HandOver */:
8545
+ await callback({
8546
+ kind: "ToolHandOver" /* ToolHandOver */,
8547
+ info,
8548
+ tool: content.name,
8549
+ agentName: toolResp.agentName,
8550
+ task: toolResp.task,
8551
+ context: toolResp.context,
8552
+ files: toolResp.files
8553
+ });
8554
+ return [undefined, toolResp];
8555
+ }
8556
+ break;
8259
8557
  }
8260
- break;
8261
8558
  }
8262
8559
  }
8263
- }
8264
8560
  if (toolReponses.length === 0 && !this.config.interactive) {
8265
8561
  return [responsePrompts.requireUseTool, undefined];
8266
8562
  }
@@ -8328,6 +8624,7 @@ __export(exports_allTools, {
8328
8624
  readFile: () => readFile_default,
8329
8625
  listFiles: () => listFiles_default,
8330
8626
  listCodeDefinitionNames: () => listCodeDefinitionNames_default,
8627
+ handOver: () => handOver_default,
8331
8628
  executeCommand: () => executeCommand_default,
8332
8629
  attemptCompletion: () => attemptCompletion_default,
8333
8630
  askFollowupQuestion: () => askFollowupQuestion_default
@@ -8391,24 +8688,27 @@ ${search}`);
8391
8688
  // src/tools/utils/getArg.ts
8392
8689
  var getString = (args, name, defaultValue) => {
8393
8690
  const ret = args[name] ?? defaultValue;
8394
- if (!ret) {
8691
+ if (ret === undefined) {
8395
8692
  throw new Error(`Missing required argument: ${name}`);
8396
8693
  }
8397
8694
  return ret;
8398
8695
  };
8399
8696
  var getStringArray = (args, name, defaultValue) => {
8400
8697
  const ret = args[name];
8401
- if (!ret) {
8698
+ if (ret === undefined) {
8402
8699
  if (defaultValue === undefined) {
8403
8700
  throw new Error(`Missing required argument: ${name}`);
8404
8701
  }
8405
8702
  return defaultValue;
8406
8703
  }
8704
+ if (ret === "") {
8705
+ return [];
8706
+ }
8407
8707
  return ret.split(",");
8408
8708
  };
8409
8709
  var getBoolean = (args, name, defaultValue) => {
8410
8710
  const ret = args[name];
8411
- if (!ret) {
8711
+ if (ret === undefined) {
8412
8712
  if (defaultValue === undefined) {
8413
8713
  throw new Error(`Missing required argument: ${name}`);
8414
8714
  }
@@ -8425,7 +8725,7 @@ var getBoolean = (args, name, defaultValue) => {
8425
8725
  };
8426
8726
  var getInt = (args, name, defaultValue) => {
8427
8727
  const ret = args[name];
8428
- if (!ret) {
8728
+ if (ret === undefined) {
8429
8729
  if (defaultValue === undefined) {
8430
8730
  throw new Error(`Missing required argument: ${name}`);
8431
8731
  }
@@ -9047,6 +9347,81 @@ var writeToFile_default = {
9047
9347
  handler: handler9,
9048
9348
  isAvailable: isAvailable9
9049
9349
  };
9350
+ // src/tools/handOver.ts
9351
+ var toolInfo10 = {
9352
+ name: "hand_over",
9353
+ description: "Hand over the current task to another agent to complete",
9354
+ parameters: [
9355
+ {
9356
+ name: "agent_name",
9357
+ description: "The name of the agent to hand over the task to",
9358
+ required: true,
9359
+ usageValue: "Name of the target agent"
9360
+ },
9361
+ {
9362
+ name: "task",
9363
+ description: "The task to be completed by the target agent",
9364
+ required: true,
9365
+ usageValue: "Task description"
9366
+ },
9367
+ {
9368
+ name: "context",
9369
+ description: "The context information for the task",
9370
+ required: true,
9371
+ usageValue: "Context information"
9372
+ },
9373
+ {
9374
+ name: "files",
9375
+ description: "The files relevant to the task",
9376
+ required: true,
9377
+ usageValue: "Relevant files"
9378
+ }
9379
+ ],
9380
+ examples: [
9381
+ {
9382
+ description: "Hand over a coding task to the coder agent",
9383
+ parameters: [
9384
+ {
9385
+ name: "agent_name",
9386
+ value: "Coder"
9387
+ },
9388
+ {
9389
+ name: "task",
9390
+ value: "Implement the login feature"
9391
+ },
9392
+ {
9393
+ name: "context",
9394
+ value: "We need a secure login system with email and password"
9395
+ },
9396
+ {
9397
+ name: "files",
9398
+ value: "src/auth/login.ts,src/auth/types.ts"
9399
+ }
9400
+ ]
9401
+ }
9402
+ ]
9403
+ };
9404
+ var handler10 = async (_provider, args) => {
9405
+ const agentName = getString(args, "agent_name");
9406
+ const task = getString(args, "task");
9407
+ const context = getString(args, "context", undefined);
9408
+ const files = getStringArray(args, "files", []);
9409
+ return {
9410
+ type: "HandOver" /* HandOver */,
9411
+ agentName,
9412
+ task,
9413
+ context,
9414
+ files
9415
+ };
9416
+ };
9417
+ var isAvailable10 = (_provider) => {
9418
+ return true;
9419
+ };
9420
+ var handOver_default = {
9421
+ ...toolInfo10,
9422
+ handler: handler10,
9423
+ isAvailable: isAvailable10
9424
+ };
9050
9425
  // src/Agent/CoderAgent/prompts.ts
9051
9426
  var basePrompt = "You are a highly skilled software engineer with extensive knowledge in many programming languages, frameworks, design patterns, and best practices.";
9052
9427
  var editingFilesPrompt = (toolNamePrefix) => `
@@ -9110,17 +9485,6 @@ You have access to two tools for working with files: **${toolNamePrefix}write_to
9110
9485
  4. Once the file has been edited with either ${toolNamePrefix}write_to_file or ${toolNamePrefix}replace_in_file, the system will provide you with the final state of the modified file. Use this updated content as the reference point for any subsequent SEARCH/REPLACE operations, since it reflects any auto-formatting or user-applied changes.
9111
9486
 
9112
9487
  By thoughtfully selecting between ${toolNamePrefix}write_to_file and ${toolNamePrefix}replace_in_file, you can make your file editing process smoother, safer, and more efficient.`;
9113
- var capabilities = (toolNamePrefix) => `
9114
- ====
9115
-
9116
- CAPABILITIES
9117
-
9118
- - You have access to a range of tools to aid you in your work. These tools help you effectively accomplish a wide range of tasks, such as writing code, making edits or improvements to existing files, understanding the current state of a project, performing system operations, and much more.
9119
- - When the user initially gives you a task, a recursive list of all filepaths in the current working directory will be included in environment_details. This provides an overview of the project's file structure, offering key insights into the project from directory/file names (how developers conceptualize and organize their code) and file extensions (the language used). This can also guide decision-making on which files to explore further.
9120
- - You can use ${toolNamePrefix}search_files to perform regex searches across files in a specified directory, outputting context-rich results that include surrounding lines. This is particularly useful for understanding code patterns, finding specific implementations, or identifying areas that need refactoring.
9121
- - You can use the ${toolNamePrefix}list_code_definition_names tool to get an overview of source code definitions for all files at the top level of a specified directory. This can be particularly useful when you need to understand the broader context and relationships between certain parts of the code. You may need to call this tool multiple times to understand various parts of the codebase related to the task.
9122
- \t- For example, when asked to make edits or improvements you might analyze the file structure in the initial environment_details to get an overview of the project, then use ${toolNamePrefix}list_code_definition_names to get further insight using source code definitions for files located in relevant directories, then ${toolNamePrefix}read_file to examine the contents of relevant files, analyze the code and suggest improvements or make necessary edits, then use the ${toolNamePrefix}replace_in_file tool to implement changes. If you refactored code that could affect other parts of the codebase, you could use ${toolNamePrefix}search_files to ensure you update other files as needed.
9123
- - You can use the ${toolNamePrefix}execute_command tool to run commands on the user's computer whenever you feel it can help accomplish the user's task. When you need to execute a CLI command, you must provide a clear explanation of what the command does. Prefer to execute complex CLI commands over creating executable scripts, since they are more flexible and easier to run. Interactive and long-running commands are allowed, since the commands are run in the user's VSCode terminal. The user may keep commands running in the background and you will be kept updated on their status along the way. Each command you execute is run in a new terminal instance.`;
9124
9488
  var rules = (toolNamePrefix) => `
9125
9489
  ====
9126
9490
 
@@ -9135,7 +9499,9 @@ RULES
9135
9499
  - When creating a new project (such as an app, website, or any software project), organize all new files within a dedicated project directory unless the user specifies otherwise. Use appropriate file paths when creating files, as the ${toolNamePrefix}write_to_file tool will automatically create any necessary directories. Structure the project logically, adhering to best practices for the specific type of project being created. Unless otherwise specified, new projects should be easily run without additional setup, for example most projects can be built in HTML, CSS, and JavaScript - which you can open in a browser.
9136
9500
  - Be sure to consider the type of project (e.g. Python, JavaScript, web application) when determining the appropriate structure and files to include. Also consider what files may be most relevant to accomplishing the task, for example looking at a project's manifest file would help you understand the project's dependencies, which you could incorporate into any code you write.
9137
9501
  - When making changes to code, always consider the context in which the code is being used. Ensure that your changes are compatible with the existing codebase and that they follow the project's coding standards and best practices.
9502
+ - **Adhere to any established coding style, linting rules, or naming conventions if they are known or can be inferred from the existing codebase, to maintain consistency.**
9138
9503
  - When you want to modify a file, use the ${toolNamePrefix}replace_in_file or ${toolNamePrefix}write_to_file tool directly with the desired changes. You do not need to display the changes before using the tool.
9504
+ - **Do not guess or hallucinate file content that has not been explicitly provided or read. Always read an existing file with \`${toolNamePrefix}read_file\` (or rely on content the user directly provided) before modifying it, unless you are creating a brand-new file.**
9139
9505
  - Do not ask for more information than necessary. Use the tools provided to accomplish the user's request efficiently and effectively. When you've completed your task, you must use the ${toolNamePrefix}attempt_completion tool to present the result to the user.
9140
9506
  - The user may provide a file's contents directly in their message, in which case you shouldn't use the ${toolNamePrefix}read_file tool to get the file contents again since you already have it.
9141
9507
  - Your goal is to try to accomplish the user's task, NOT engage in a back and forth conversation.
@@ -9157,68 +9523,6 @@ You accomplish a given task iteratively, breaking it down into clear steps and w
9157
9523
  3. Remember, you have extensive capabilities with access to a wide range of tools that can be used in powerful and clever ways as necessary to accomplish each goal. Before calling a tool, do some analysis within <thinking></thinking> tags. First, analyze the file structure provided in environment_details to gain context and insights for proceeding effectively. Then, think about which of the provided tools is the most relevant tool to accomplish the user's task. Next, go through each of the required parameters of the relevant tool and determine if the user has directly provided or given enough information to infer a value. When deciding if the parameter can be inferred, carefully consider all the context to see if it supports a specific value. If all of the required parameters are present or can be reasonably inferred, close the thinking tag and proceed with the tool use.
9158
9524
  4. Once you've completed the user's task, you must use the ${toolNamePrefix}attempt_completion tool to present the result of the task to the user.
9159
9525
  5. The user may provide feedback, which you can use to make improvements and try again. But DO NOT continue in pointless back and forth conversations, i.e. don't end your responses with questions or offers for further assistance.`;
9160
- var systemInformation = (info) => `
9161
- ====
9162
-
9163
- SYSTEM INFORMATION
9164
-
9165
- Operating System: ${info.os}`;
9166
- var customInstructions = (customInstructions2) => {
9167
- const joined = customInstructions2.join(`
9168
- `);
9169
- if (joined.trim() === "") {
9170
- return "";
9171
- }
9172
- return `
9173
- ====
9174
-
9175
- USER'S CUSTOM INSTRUCTIONS
9176
-
9177
- The following additional instructions are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
9178
-
9179
- ${joined}`;
9180
- };
9181
- var customScripts = (commands) => {
9182
- const joined = Object.entries(commands).map(([name, command]) => {
9183
- if (typeof command === "string") {
9184
- return `- ${name}
9185
- - Command: \`${command}\``;
9186
- }
9187
- return `- ${name}
9188
- - Command: \`${command.command}\`
9189
- - Description: ${command.description}`;
9190
- }).join(`
9191
- `);
9192
- if (joined.trim() === "") {
9193
- return "";
9194
- }
9195
- return `
9196
- ====
9197
-
9198
- USER'S CUSTOM COMMANDS
9199
-
9200
- The following additional commands are provided by the user, and should be followed to the best of your ability without interfering with the TOOL USE guidelines.
9201
-
9202
- ${joined}`;
9203
- };
9204
- var interactiveMode = (interactive) => {
9205
- if (interactive) {
9206
- return `
9207
- ====
9208
-
9209
- INTERACTIVE MODE
9210
-
9211
- You are in interactive mode. This means you may ask user questions to gather additional information to complete the task.
9212
- `;
9213
- }
9214
- return `
9215
- ====
9216
-
9217
- NON-INTERACTIVE MODE
9218
-
9219
- You are in non-interactive mode. This means you will not be able to ask user questions to gather additional information to complete the task. You should try to use available tools to accomplish the task. If unable to precede further, you may try to end the task and provide a reason.
9220
- `;
9221
- };
9222
9526
  var fullSystemPrompt = (info, tools, toolNamePrefix, instructions, scripts, interactive) => `
9223
9527
  ${basePrompt}
9224
9528
  ${toolUsePrompt(tools, toolNamePrefix)}
@@ -9241,13 +9545,167 @@ class CoderAgent extends AgentBase {
9241
9545
  const systemPrompt = fullSystemPrompt({
9242
9546
  os: options.os
9243
9547
  }, tools, toolNamePrefix, options.customInstructions ?? [], options.scripts ?? {}, options.interactive);
9244
- super(options.ai, {
9548
+ super(coderAgentInfo.name, options.ai, {
9549
+ systemPrompt,
9550
+ tools,
9551
+ toolNamePrefix,
9552
+ provider: options.provider,
9553
+ interactive: options.interactive,
9554
+ agents: options.agents
9555
+ });
9556
+ }
9557
+ }
9558
+ var coderAgentInfo = {
9559
+ name: "Coder",
9560
+ responsibilities: [
9561
+ "Editing and refactoring existing code.",
9562
+ "Creating new features or modules.",
9563
+ "Running tests and analyzing test results.",
9564
+ "Maintaining coding standards, lint rules, and general code quality."
9565
+ ]
9566
+ };
9567
+ // src/Agent/ArchitectAgent/prompts.ts
9568
+ var fullSystemPrompt2 = (info, tools, toolNamePrefix, instructions, scripts, interactive) => `
9569
+ # Architect Agent
9570
+
9571
+ ## Role
9572
+ You are the **Architect** agent, responsible for:
9573
+ 1. **Task Analysis** – Understand requirements.
9574
+ 2. **File Identification** – Find and select relevant files.
9575
+ 3. **File Reading** – Use the provided tools to gather information from these files.
9576
+ 4. **Implementation Plan** – Draft a concise plan detailing steps, resources, and dependencies.
9577
+ 5. **Review & Improve** – Evaluate and refine the plan.
9578
+ 6. **Handover** – Provide the final plan, context, and files to the **Coder** agent.
9579
+
9580
+ > **Note**: The **Architect** agent must not make any direct modifications. Your role is limited to creating the implementation plan and handing it over to the **Coder** agent, who will perform any actual changes.
9581
+
9582
+ ## Rules
9583
+ 1. **Consistency**: Maintain alignment with the user’s instructions and the system’s objectives at all times.
9584
+ 2. **Relevance**: Only read and use files directly related to the task. Avoid unnecessary or tangential information.
9585
+ 3. **Conciseness**: Keep all communications and plans succinct, avoiding superfluous or repetitive details.
9586
+ 4. **Accuracy**: Ensure the information you gather and any conclusions you draw are correct and verifiable.
9587
+ 5. **Clarity**: Present the final plan and any supporting details in a structured and easily understandable format.
9588
+ 6. **Minimal Queries**: Ask clarifying questions only when essential, and avoid repeated questioning that does not add value.
9589
+
9590
+ ## Steps
9591
+ 1. **Analyze Task**
9592
+ - Gather and understand the user’s requirements.
9593
+ - Note any potential constraints or objectives that may influence the plan.
9594
+
9595
+ 2. **Identify Relevant Files**
9596
+ - Determine which files or documents are necessary.
9597
+ - Justify why these files are relevant.
9598
+
9599
+ 3. **Read Files via Tools**
9600
+ - Utilize the provided tools to access and extract information from the identified files.
9601
+ - Summarize key insights or data for the solution.
9602
+
9603
+ 4. **Create Implementation Plan**
9604
+ - Outline tasks, define milestones, and detail resources or dependencies.
9605
+ - Provide clear, concise instructions for each step.
9606
+
9607
+ 5. **Review & Improve**
9608
+ - Check the plan for consistency, clarity, and feasibility.
9609
+ - Make adjustments or refinements to ensure accuracy and efficiency.
9610
+
9611
+ 6. **Handover**
9612
+ - Deliver the final implementation plan, context, and relevant files to the **Coder** agent.
9613
+ - Provide any additional instructions or clarifications needed for successful implementation.
9614
+ ${toolUsePrompt(tools, toolNamePrefix)}
9615
+ ${capabilities(toolNamePrefix)}
9616
+ ${systemInformation(info)}
9617
+ ${customInstructions(instructions)}
9618
+ ${customScripts(scripts)}
9619
+ ${interactiveMode(interactive)}
9620
+ `;
9621
+
9622
+ // src/Agent/ArchitectAgent/index.ts
9623
+ class ArchitectAgent extends AgentBase {
9624
+ constructor(options) {
9625
+ const agentTools = [
9626
+ ...options.additionalTools ?? [],
9627
+ askFollowupQuestion_default,
9628
+ attemptCompletion_default,
9629
+ handOver_default,
9630
+ listCodeDefinitionNames_default,
9631
+ listFiles_default,
9632
+ readFile_default,
9633
+ searchFiles_default
9634
+ ];
9635
+ const tools = getAvailableTools(options.provider, agentTools);
9636
+ const toolNamePrefix = "tool_";
9637
+ const systemPrompt = fullSystemPrompt2({
9638
+ os: options.os
9639
+ }, tools, toolNamePrefix, options.customInstructions ?? [], options.scripts ?? {}, options.interactive);
9640
+ super(architectAgentInfo.name, options.ai, {
9245
9641
  systemPrompt,
9246
9642
  tools,
9247
9643
  toolNamePrefix,
9248
9644
  provider: options.provider,
9249
- interactive: options.interactive
9645
+ interactive: options.interactive,
9646
+ agents: options.agents
9647
+ });
9648
+ }
9649
+ }
9650
+ var architectAgentInfo = {
9651
+ name: "Architect",
9652
+ responsibilities: [
9653
+ "Analyzing the user’s overall task and requirements.",
9654
+ "Creating plans and making higher-level decisions about system structure and design.",
9655
+ "Reviewing and analyzing existing code or components for maintainability and scalability.",
9656
+ "Laying out the roadmap for implementation."
9657
+ ]
9658
+ };
9659
+ // src/Agent/MultiAgent.ts
9660
+ class MultiAgent {
9661
+ #config;
9662
+ #activeAgent = null;
9663
+ constructor(config) {
9664
+ this.#config = config;
9665
+ }
9666
+ get model() {
9667
+ return this.#activeAgent?.model;
9668
+ }
9669
+ async#startTask(agentName, task, context, maxIterations, callback) {
9670
+ this.#activeAgent = await this.#config.createAgent(agentName);
9671
+ const [exitReason, info] = await this.#activeAgent.startTask({
9672
+ task,
9673
+ context,
9674
+ maxIterations,
9675
+ callback
9250
9676
  });
9677
+ if (typeof exitReason === "string") {
9678
+ return [exitReason, info];
9679
+ }
9680
+ if (exitReason.type === "HandOver") {
9681
+ const remainIteration = maxIterations - Math.floor(info.messages.length / 2);
9682
+ if (remainIteration < 1) {
9683
+ return ["MaxIterations", info];
9684
+ }
9685
+ const context2 = await this.#config.getContext(agentName, exitReason.context, exitReason.files);
9686
+ const [exitReason2, info2] = await this.#startTask(exitReason.agentName, exitReason.task, context2, remainIteration, callback);
9687
+ info2.inputTokens += info.inputTokens;
9688
+ info2.outputTokens += info.outputTokens;
9689
+ info2.cacheWriteTokens += info.cacheWriteTokens;
9690
+ info2.cacheReadTokens += info.cacheReadTokens;
9691
+ info2.totalCost = (info.totalCost ?? 0) + (info2.totalCost ?? 0);
9692
+ return [exitReason2, info2];
9693
+ }
9694
+ return [exitReason, info];
9695
+ }
9696
+ async startTask(options) {
9697
+ if (this.#activeAgent) {
9698
+ throw new Error("An active agent already exists");
9699
+ }
9700
+ const maxIterations = options.maxIterations ?? 50;
9701
+ return this.#startTask(options.agentName, options.task, options.context, maxIterations, options.callback);
9702
+ }
9703
+ async continueTask(userMessage, taskInfo, callback = () => {
9704
+ }) {
9705
+ if (!this.#activeAgent) {
9706
+ throw new Error("No active agent");
9707
+ }
9708
+ return this.#activeAgent.continueTask(userMessage, taskInfo, callback);
9251
9709
  }
9252
9710
  }
9253
9711
  // src/AiTool/generateGitCommitMessage.ts
@@ -9312,6 +9770,8 @@ ${output}`);
9312
9770
 
9313
9771
  // src/AiTool/generateGithubPullRequestDetails.ts
9314
9772
  var prompt2 = `
9773
+ # Generate Github Pull Request Details
9774
+
9315
9775
  You are given:
9316
9776
  - A branch name in <tool_input_branch_name>.
9317
9777
  - An optional context message in <tool_input_context> (which may or may not be present).
@@ -9324,10 +9784,30 @@ Your task:
9324
9784
  3. Produce a single GitHub Pull Request title.
9325
9785
  4. Produce a Pull Request description that explains the changes.
9326
9786
 
9787
+ Use the following template for the Pull Request description:
9788
+
9789
+ ---
9790
+ **Context (if provided)**:
9791
+ - Acknowledge any guiding concerns or instructions.
9792
+
9793
+ **Summary of Changes**:
9794
+ - Provide a concise list or overview of what changed.
9795
+
9796
+ **Highlights of Changed Code**:
9797
+ - Mention only the specific sections or functionalities updated, without showing full surrounding context.
9798
+
9799
+ **Additional Information (if needed)**:
9800
+ - Testing steps (if applicable).
9801
+ - Any notes or caveats.
9802
+
9803
+ ---
9804
+
9327
9805
  Output format:
9328
9806
  <tool_output>
9329
9807
  <tool_output_pr_title>YOUR PR TITLE HERE</tool_output_pr_title>
9330
- <tool_output_pr_description>YOUR PR DESCRIPTION HERE</tool_output_pr_description>
9808
+ <tool_output_pr_description>
9809
+ YOUR PR DESCRIPTION HERE
9810
+ </tool_output_pr_description>
9331
9811
  </tool_output>
9332
9812
 
9333
9813
  Below is an **example** of the input and output:
@@ -9349,7 +9829,7 @@ diff --git a/order_service.py b/order_service.py
9349
9829
  - if is_valid_order(order):
9350
9830
  - process_order(order)
9351
9831
  + validate_and_process(order)
9352
- </tool_input_commit_diff>
9832
+ </tool_input_commit_diff>
9353
9833
  </tool_input>
9354
9834
 
9355
9835
  Example Output:
@@ -9363,8 +9843,7 @@ to use the new validate_and_process method for improved maintainability.
9363
9843
 
9364
9844
  ---
9365
9845
 
9366
- Use the above format whenever you receive \`<tool_input>\` that may include a branch name, an optional context, aggregated commit messages in a single tag, and a combined diff in a single tag. Provide your final output strictly in \`<tool_output>\` with \`<tool_output_pr_title>\` and \`<tool_output_pr_description>\`.
9367
- Only highlight the changed code and avoid including the context around the changes in the description.
9846
+ Use the above format whenever you receive <tool_input> that may include a branch name, an optional context, aggregated commit messages in a single tag, and a combined diff in a single tag. Provide your final output strictly in <tool_output> with <tool_output_pr_title> and <tool_output_pr_description>. Only highlight the changed code and avoid including the context around the changes in the description.
9368
9847
  `;
9369
9848
  var generateGithubPullRequestDetails_default = {
9370
9849
  name: "generateGithubPullRequestDetails",
@@ -9425,6 +9904,8 @@ export {
9425
9904
  makeTool,
9426
9905
  listFiles_default as listFiles,
9427
9906
  listCodeDefinitionNames_default as listCodeDefinitionNames,
9907
+ handOver_default as handOver,
9908
+ getAvailableTools,
9428
9909
  generateGithubPullRequestDetails,
9429
9910
  generateGitCommitMessage,
9430
9911
  executeTool,
@@ -9433,14 +9914,19 @@ export {
9433
9914
  deepSeekModels,
9434
9915
  deepSeekDefaultModelId,
9435
9916
  createService,
9917
+ coderAgentInfo,
9436
9918
  attemptCompletion_default as attemptCompletion,
9437
9919
  askFollowupQuestion_default as askFollowupQuestion,
9920
+ architectAgentInfo,
9438
9921
  anthropicModels,
9439
9922
  anthropicDefaultModelId,
9440
9923
  exports_allTools as allTools,
9924
+ ToolResponseType,
9925
+ TaskEventKind,
9926
+ MultiAgent,
9441
9927
  MockProvider,
9442
- ExitReason,
9443
9928
  CoderAgent,
9929
+ ArchitectAgent,
9444
9930
  AiServiceProvider,
9445
9931
  AgentBase
9446
9932
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/core",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "license": "AGPL-3.0",
5
5
  "type": "module",
6
6
  "exports": {