hermes-git 0.3.5 → 0.3.7

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 (3) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +40 -10
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -334,7 +334,7 @@ If `HERMES_PROVIDER` is not set, Hermes auto-detects by using whichever key it f
334
334
  |----------|-------|-----------|
335
335
  | Anthropic | claude-sonnet-4-6 | [console.anthropic.com](https://console.anthropic.com/) |
336
336
  | OpenAI | gpt-4o | [platform.openai.com/api-keys](https://platform.openai.com/api-keys) |
337
- | Google | gemini-2.0-flash | [aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) |
337
+ | Google | gemini-2.5-flash | [aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) |
338
338
 
339
339
  ---
340
340
 
package/dist/index.js CHANGED
@@ -34494,16 +34494,26 @@ async function makeOpenAIProvider(apiKey) {
34494
34494
  async function makeGeminiProvider(apiKey) {
34495
34495
  const { GoogleGenerativeAI: GoogleGenerativeAI2 } = await Promise.resolve().then(() => (init_dist(), exports_dist));
34496
34496
  const client = new GoogleGenerativeAI2(apiKey);
34497
- const genModel = client.getGenerativeModel({ model: "gemini-2.0-flash" });
34497
+ const genModel = client.getGenerativeModel({ model: "gemini-2.5-flash" });
34498
34498
  return {
34499
34499
  name: "Gemini",
34500
- model: "gemini-2.0-flash",
34500
+ model: "gemini-2.5-flash",
34501
34501
  async complete(prompt) {
34502
- const result = await genModel.generateContent(prompt);
34503
- const text = result.response.text();
34504
- if (!text)
34505
- throw new Error("Empty response from Gemini");
34506
- return text.trim();
34502
+ try {
34503
+ const result = await genModel.generateContent(prompt);
34504
+ const text = result.response.text();
34505
+ if (!text)
34506
+ throw new Error("Empty response from Gemini");
34507
+ return text.trim();
34508
+ } catch (err) {
34509
+ const msg = err?.message ?? "";
34510
+ if (msg.includes("429") || msg.includes("Too Many Requests") || msg.includes("quota")) {
34511
+ const retryMatch = msg.match(/retry in ([\d.]+)s/i);
34512
+ const retryIn = retryMatch ? `${Math.ceil(parseFloat(retryMatch[1]))}s` : null;
34513
+ throw new GeminiQuotaError(retryIn);
34514
+ }
34515
+ throw err;
34516
+ }
34507
34517
  }
34508
34518
  };
34509
34519
  }
@@ -34548,6 +34558,25 @@ async function getProvider() {
34548
34558
  throw new NoProviderError;
34549
34559
  }
34550
34560
 
34561
+ class GeminiQuotaError extends Error {
34562
+ constructor(retryIn) {
34563
+ const lines = [
34564
+ "",
34565
+ source_default.red("❌ Gemini quota exceeded"),
34566
+ "",
34567
+ retryIn ? source_default.white(` Per-minute limit hit. You could retry in ${source_default.bold(retryIn)}.`) : source_default.white(" Your free-tier daily quota is exhausted."),
34568
+ "",
34569
+ source_default.bold(" Options:"),
34570
+ ` ${source_default.cyan("1.")} Enable billing at ${source_default.dim("https://aistudio.google.com/app/billing")}`,
34571
+ ` ${source_default.cyan("2.")} Switch provider: ${source_default.dim("hermes config set provider anthropic")}`,
34572
+ ` ${source_default.cyan("3.")} Switch provider: ${source_default.dim("hermes config set provider openai")}`,
34573
+ ""
34574
+ ];
34575
+ super(lines.join(`
34576
+ `));
34577
+ }
34578
+ }
34579
+
34551
34580
  class MissingKeyError extends Error {
34552
34581
  constructor(provider) {
34553
34582
  const configs = {
@@ -38755,9 +38784,10 @@ function buildInstallCommand(pm) {
38755
38784
  }
38756
38785
 
38757
38786
  // src/commands/commit.ts
38758
- import { exec as exec6 } from "child_process";
38787
+ import { exec as exec6, execFile } from "child_process";
38759
38788
  import { promisify as promisify6 } from "util";
38760
38789
  var execAsync6 = promisify6(exec6);
38790
+ var execFileAsync = promisify6(execFile);
38761
38791
  async function getStagedFiles2() {
38762
38792
  try {
38763
38793
  const { stdout } = await execAsync6("git diff --cached --name-status");
@@ -39055,7 +39085,7 @@ function commitCommand(program2) {
39055
39085
 
39056
39086
  ${finalBody}` : finalMessage;
39057
39087
  displayStep(`git commit -m "${finalMessage}"${finalBody ? " (with body)" : ""}`);
39058
- await execAsync6(`git commit -m ${JSON.stringify(fullMessage)}`);
39088
+ await execFileAsync("git", ["commit", "-m", fullMessage]);
39059
39089
  displaySuccess("Committed!");
39060
39090
  const { stdout: hash } = await execAsync6("git rev-parse --short HEAD");
39061
39091
  console.log(source_default.dim(` ${hash.trim()} ${finalMessage}
@@ -39252,7 +39282,7 @@ function printWorkflows() {
39252
39282
 
39253
39283
  // src/index.ts
39254
39284
  var program2 = new Command;
39255
- var CURRENT_VERSION = "0.3.5";
39285
+ var CURRENT_VERSION = "0.3.6";
39256
39286
  program2.name("hermes").description("Intent-driven Git, guided by AI").version(CURRENT_VERSION).action(() => {
39257
39287
  printBanner(CURRENT_VERSION);
39258
39288
  printWorkflows();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hermes-git",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "description": "Intent-driven Git, guided by AI. Turn natural language into safe, explainable Git operations.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",