@polka-codes/cli 0.9.26 → 0.9.27
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 +15 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -58572,7 +58572,7 @@ var {
|
|
|
58572
58572
|
Help
|
|
58573
58573
|
} = import__.default;
|
|
58574
58574
|
// package.json
|
|
58575
|
-
var version = "0.9.
|
|
58575
|
+
var version = "0.9.27";
|
|
58576
58576
|
|
|
58577
58577
|
// src/commands/chat.ts
|
|
58578
58578
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
@@ -72288,8 +72288,8 @@ class UsageMeter {
|
|
|
72288
72288
|
this.#calls = 0;
|
|
72289
72289
|
}
|
|
72290
72290
|
isLimitExceeded() {
|
|
72291
|
-
const messageCount = this.#maxMessages
|
|
72292
|
-
const cost = this.#maxCost
|
|
72291
|
+
const messageCount = this.#maxMessages > 0 && this.#calls >= this.#maxMessages;
|
|
72292
|
+
const cost = this.#maxCost > 0 && this.#totals.cost >= this.#maxCost;
|
|
72293
72293
|
return {
|
|
72294
72294
|
messageCount,
|
|
72295
72295
|
maxMessages: this.#maxMessages,
|
|
@@ -114873,8 +114873,8 @@ class Runner {
|
|
|
114873
114873
|
constructor(options) {
|
|
114874
114874
|
this.#options = options;
|
|
114875
114875
|
this.usageMeter = new UsageMeter(import_lodash5.merge(prices_default, options.config.prices ?? {}), {
|
|
114876
|
-
maxMessages: options.
|
|
114877
|
-
maxCost: options.
|
|
114876
|
+
maxMessages: options.maxMessageCount ?? 0,
|
|
114877
|
+
maxCost: options.budget ?? 0
|
|
114878
114878
|
});
|
|
114879
114879
|
let rules2 = options.config.rules;
|
|
114880
114880
|
if (typeof rules2 === "string") {
|
|
@@ -116330,8 +116330,16 @@ ${commitMessage}`);
|
|
|
116330
116330
|
process.exit(1);
|
|
116331
116331
|
}
|
|
116332
116332
|
} catch (error82) {
|
|
116333
|
-
|
|
116334
|
-
|
|
116333
|
+
if (error82.constructor.name === "ExitPromptError") {
|
|
116334
|
+
spinner.stop();
|
|
116335
|
+
console.log(`
|
|
116336
|
+
Commit cancelled by user.`);
|
|
116337
|
+
process.exit(0);
|
|
116338
|
+
} else {
|
|
116339
|
+
spinner.fail("An unexpected error occurred.");
|
|
116340
|
+
console.error("Error:", error82);
|
|
116341
|
+
process.exit(1);
|
|
116342
|
+
}
|
|
116335
116343
|
}
|
|
116336
116344
|
});
|
|
116337
116345
|
|