@polka-codes/cli 0.7.15 → 0.7.16

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 +11 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -24629,7 +24629,7 @@ var {
24629
24629
  Help
24630
24630
  } = import__.default;
24631
24631
  // package.json
24632
- var version = "0.7.15";
24632
+ var version = "0.7.16";
24633
24633
 
24634
24634
  // ../core/src/AiService/AiServiceBase.ts
24635
24635
  class AiServiceBase {
@@ -34744,11 +34744,11 @@ ${agents}`;
34744
34744
  }
34745
34745
  const response = await this.#request(nextRequest);
34746
34746
  const resp = await this.#handleResponse(response);
34747
- if ("exit" in resp) {
34748
- this.#callback({ kind: "EndTask" /* EndTask */, agent: this, exitReason: resp.exit });
34749
- return resp.exit;
34747
+ if (resp.type === "exit") {
34748
+ this.#callback({ kind: "EndTask" /* EndTask */, agent: this, exitReason: resp.reason });
34749
+ return resp.reason;
34750
34750
  }
34751
- nextRequest = resp.replay;
34751
+ nextRequest = resp.message;
34752
34752
  }
34753
34753
  }
34754
34754
  async continueTask(userMessage) {
@@ -34821,7 +34821,7 @@ ${agents}`;
34821
34821
  if (toolReponses.length > 0) {
34822
34822
  break outer;
34823
34823
  }
34824
- return { exit: toolResp };
34824
+ return { type: "exit", reason: toolResp };
34825
34825
  case "Invalid" /* Invalid */:
34826
34826
  await this.#callback({ kind: "ToolInvalid" /* ToolInvalid */, agent: this, tool: content.name });
34827
34827
  toolReponses.push({ tool: content.name, response: toolResp.message });
@@ -34832,7 +34832,7 @@ ${agents}`;
34832
34832
  break outer;
34833
34833
  case "Interrupted" /* Interrupted */:
34834
34834
  await this.#callback({ kind: "ToolInterrupted" /* ToolInterrupted */, agent: this, tool: content.name });
34835
- return { exit: toolResp };
34835
+ return { type: "exit", reason: toolResp };
34836
34836
  case "HandOver" /* HandOver */:
34837
34837
  if (toolReponses.length > 0) {
34838
34838
  break outer;
@@ -34846,7 +34846,7 @@ ${agents}`;
34846
34846
  context: toolResp.context,
34847
34847
  files: toolResp.files
34848
34848
  });
34849
- return { exit: toolResp };
34849
+ return { type: "exit", reason: toolResp };
34850
34850
  case "Delegate" /* Delegate */:
34851
34851
  if (toolReponses.length > 0) {
34852
34852
  continue;
@@ -34860,19 +34860,19 @@ ${agents}`;
34860
34860
  context: toolResp.context,
34861
34861
  files: toolResp.files
34862
34862
  });
34863
- return { exit: toolResp };
34863
+ return { type: "exit", reason: toolResp };
34864
34864
  }
34865
34865
  break;
34866
34866
  }
34867
34867
  }
34868
34868
  }
34869
34869
  if (toolReponses.length === 0) {
34870
- return { replay: responsePrompts.requireUseTool };
34870
+ return { type: "reply", message: responsePrompts.requireUseTool };
34871
34871
  }
34872
34872
  const finalResp = toolReponses.map(({ tool, response: response2 }) => responsePrompts.toolResults(tool, response2)).join(`
34873
34873
 
34874
34874
  `);
34875
- return { replay: finalResp };
34875
+ return { type: "reply", message: finalResp };
34876
34876
  }
34877
34877
  async#invokeTool(name2, args2) {
34878
34878
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polka-codes/cli",
3
- "version": "0.7.15",
3
+ "version": "0.7.16",
4
4
  "license": "AGPL-3.0",
5
5
  "author": "github@polka.codes",
6
6
  "type": "module",