@kenkaiiii/gg-ai 4.3.168 → 4.3.170
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.cjs +4 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -189,6 +189,12 @@ interface StreamOptions {
|
|
|
189
189
|
* stalls — broken SSE connections (transient CDN / proxy issues) often
|
|
190
190
|
* recover when the same request is issued over a plain HTTP request/response. */
|
|
191
191
|
streaming?: boolean;
|
|
192
|
+
/** Override the User-Agent sent with OAuth-authenticated Anthropic requests.
|
|
193
|
+
* Anthropic's OAuth edge rejects requests whose claude-cli version lags too
|
|
194
|
+
* far behind the real Claude Code release; callers that track the live
|
|
195
|
+
* version should pass it here. Ignored for non-Anthropic providers and for
|
|
196
|
+
* Anthropic requests using a regular API key. */
|
|
197
|
+
userAgent?: string;
|
|
192
198
|
}
|
|
193
199
|
|
|
194
200
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -189,6 +189,12 @@ interface StreamOptions {
|
|
|
189
189
|
* stalls — broken SSE connections (transient CDN / proxy issues) often
|
|
190
190
|
* recover when the same request is issued over a plain HTTP request/response. */
|
|
191
191
|
streaming?: boolean;
|
|
192
|
+
/** Override the User-Agent sent with OAuth-authenticated Anthropic requests.
|
|
193
|
+
* Anthropic's OAuth edge rejects requests whose claude-cli version lags too
|
|
194
|
+
* far behind the real Claude Code release; callers that track the live
|
|
195
|
+
* version should pass it here. Ignored for non-Anthropic providers and for
|
|
196
|
+
* Anthropic requests using a regular API key. */
|
|
197
|
+
userAgent?: string;
|
|
192
198
|
}
|
|
193
199
|
|
|
194
200
|
/**
|
package/dist/index.js
CHANGED
|
@@ -734,7 +734,10 @@ function createClient(options) {
|
|
|
734
734
|
maxRetries: 2,
|
|
735
735
|
...isOAuth ? {
|
|
736
736
|
defaultHeaders: {
|
|
737
|
-
|
|
737
|
+
// Anthropic's OAuth edge validates the claude-cli version. Callers
|
|
738
|
+
// (ggcoder) resolve the live version at runtime; the literal here
|
|
739
|
+
// is the offline fallback for direct gg-ai consumers.
|
|
740
|
+
"user-agent": options.userAgent ?? "claude-cli/2.1.75 (external, cli)",
|
|
738
741
|
"x-app": "cli"
|
|
739
742
|
}
|
|
740
743
|
} : {}
|