hermes-git 0.3.5 → 0.3.6
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/README.md +1 -1
- package/dist/index.js +37 -8
- 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.
|
|
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.
|
|
34497
|
+
const genModel = client.getGenerativeModel({ model: "gemini-2.5-flash" });
|
|
34498
34498
|
return {
|
|
34499
34499
|
name: "Gemini",
|
|
34500
|
-
model: "gemini-2.
|
|
34500
|
+
model: "gemini-2.5-flash",
|
|
34501
34501
|
async complete(prompt) {
|
|
34502
|
-
|
|
34503
|
-
|
|
34504
|
-
|
|
34505
|
-
|
|
34506
|
-
|
|
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 = {
|
|
@@ -39252,7 +39281,7 @@ function printWorkflows() {
|
|
|
39252
39281
|
|
|
39253
39282
|
// src/index.ts
|
|
39254
39283
|
var program2 = new Command;
|
|
39255
|
-
var CURRENT_VERSION = "0.3.
|
|
39284
|
+
var CURRENT_VERSION = "0.3.6";
|
|
39256
39285
|
program2.name("hermes").description("Intent-driven Git, guided by AI").version(CURRENT_VERSION).action(() => {
|
|
39257
39286
|
printBanner(CURRENT_VERSION);
|
|
39258
39287
|
printWorkflows();
|