@dianshuv/copilot-api 0.7.4 → 0.7.5
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/main.mjs +5 -5
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -1213,7 +1213,7 @@ const patchClaude = defineCommand({
|
|
|
1213
1213
|
|
|
1214
1214
|
//#endregion
|
|
1215
1215
|
//#region package.json
|
|
1216
|
-
var version = "0.7.
|
|
1216
|
+
var version = "0.7.5";
|
|
1217
1217
|
|
|
1218
1218
|
//#endregion
|
|
1219
1219
|
//#region src/lib/adaptive-rate-limiter.ts
|
|
@@ -7495,12 +7495,12 @@ function translateChunkToAnthropicEvents(chunk, state, toolNameMapping) {
|
|
|
7495
7495
|
}
|
|
7496
7496
|
return events;
|
|
7497
7497
|
}
|
|
7498
|
-
function translateErrorToAnthropicErrorEvent() {
|
|
7498
|
+
function translateErrorToAnthropicErrorEvent(error) {
|
|
7499
7499
|
return {
|
|
7500
7500
|
type: "error",
|
|
7501
7501
|
error: {
|
|
7502
7502
|
type: "api_error",
|
|
7503
|
-
message: "An unexpected error occurred during streaming."
|
|
7503
|
+
message: error ? formatError(error) : "An unexpected error occurred during streaming."
|
|
7504
7504
|
}
|
|
7505
7505
|
};
|
|
7506
7506
|
}
|
|
@@ -7665,7 +7665,7 @@ async function handleDirectAnthropicStreamingResponse(opts) {
|
|
|
7665
7665
|
error
|
|
7666
7666
|
});
|
|
7667
7667
|
failTracking(ctx.trackingId, error);
|
|
7668
|
-
const errorEvent = translateErrorToAnthropicErrorEvent();
|
|
7668
|
+
const errorEvent = translateErrorToAnthropicErrorEvent(error);
|
|
7669
7669
|
await stream.writeSSE({
|
|
7670
7670
|
event: errorEvent.type,
|
|
7671
7671
|
data: JSON.stringify(errorEvent)
|
|
@@ -7851,7 +7851,7 @@ async function handleStreamingResponse(opts) {
|
|
|
7851
7851
|
error
|
|
7852
7852
|
});
|
|
7853
7853
|
failTracking(ctx.trackingId, error);
|
|
7854
|
-
const errorEvent = translateErrorToAnthropicErrorEvent();
|
|
7854
|
+
const errorEvent = translateErrorToAnthropicErrorEvent(error);
|
|
7855
7855
|
await stream.writeSSE({
|
|
7856
7856
|
event: errorEvent.type,
|
|
7857
7857
|
data: JSON.stringify(errorEvent)
|