ccx-relay 1.5.0 → 1.5.1
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/package.json +1 -1
- package/src/gemini.js +5 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "ccx-relay",
|
|
4
|
-
"version": "1.5.
|
|
4
|
+
"version": "1.5.1",
|
|
5
5
|
"description": "Transparent PTY wrapper for Claude Code (or any CLI) that lets you refine your prompt with Gemini AI before submitting it, without leaving your terminal session.",
|
|
6
6
|
"main": "bin/ccx.js",
|
|
7
7
|
"bin": {
|
package/src/gemini.js
CHANGED
|
@@ -23,12 +23,16 @@ export async function enhance(text, config) {
|
|
|
23
23
|
try {
|
|
24
24
|
timeoutId = setTimeout(() => controller.abort(), timeoutSeconds * 1000);
|
|
25
25
|
|
|
26
|
+
const authHeaders = geminiApiKey.startsWith('AQ.')
|
|
27
|
+
? { 'Authorization': `Bearer ${geminiApiKey}` }
|
|
28
|
+
: { 'x-goog-api-key': geminiApiKey };
|
|
29
|
+
|
|
26
30
|
const response = await fetch(url, {
|
|
27
31
|
method: 'POST',
|
|
28
32
|
signal: controller.signal,
|
|
29
33
|
headers: {
|
|
30
34
|
'Content-Type': 'application/json',
|
|
31
|
-
|
|
35
|
+
...authHeaders,
|
|
32
36
|
},
|
|
33
37
|
body: JSON.stringify({
|
|
34
38
|
contents: [{ parts: [{ text: PROMPT_PREFIX + text }] }],
|