@jeffreycao/copilot-api 2.6.1 → 2.6.2
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/auth-BC-jyQLy.js +2 -0
- package/dist/{auth-WqY8_EZT.js → auth-CX8Xj23U.js} +3 -3
- package/dist/{auth-WqY8_EZT.js.map → auth-CX8Xj23U.js.map} +1 -1
- package/dist/{config-DTZzVvur.js → config-q6afpNQS.js} +4 -1
- package/dist/{config-DTZzVvur.js.map → config-q6afpNQS.js.map} +1 -1
- package/dist/{debug-DIQi6mF1.js → debug-w29LRIS0.js} +2 -2
- package/dist/{debug-DIQi6mF1.js.map → debug-w29LRIS0.js.map} +1 -1
- package/dist/main.js +3 -3
- package/dist/{models-DAMOou_f.js → models-CKZ52xkF.js} +2 -2
- package/dist/{models-DAMOou_f.js.map → models-CKZ52xkF.js.map} +1 -1
- package/dist/{server-BfbNbfYw.js → server-hiibWOJw.js} +10 -5
- package/dist/server-hiibWOJw.js.map +1 -0
- package/dist/{start-tVcNsIV-.js → start-DMR9e_uF.js} +6 -6
- package/dist/{start-tVcNsIV-.js.map → start-DMR9e_uF.js.map} +1 -1
- package/dist/{token-CGvXQOSn.js → token-Br2vDo-U.js} +2 -2
- package/dist/{token-CGvXQOSn.js.map → token-Br2vDo-U.js.map} +1 -1
- package/package.json +1 -1
- package/dist/auth-vYMQMBSa.js +0 -2
- package/dist/server-BfbNbfYw.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { A as isResponsesApiWebSocketEnabled, C as getClaudeTokenMultiplier, D as isAlphaSearchCodexPriorityEnabled, E as getUpstreamTransportConfig, O as isMessagesApiEnabled, P as PATHS, S as getClaudeAutoModel, T as getMessageApiWebSearchModel, _ as resolveMappedModel, b as getAlphaSearchModel, d as getModelResponsesApiCompactThreshold$1, f as getReasoningEffortForModel, g as isGpt56OrAbove, h as isContextManagementEnabledForResponses, i as listEnabledProviders, k as isResponsesApiWebSearchEnabled, l as getExtraPromptForModel, m as isContextManagementEnabledForMessages, n as getRawProviderConfig, o as resolveEffectiveProviderType, p as getSmallModel, s as resolveProviderAuthType, t as getProviderConfig, u as getModelMappings, v as setModelMappings, x as getAnthropicApiKey } from "./config-
|
|
2
|
-
import { $ as forwardError, B as forwardCodexResponses, C as copilotWebSocketHeaders, E as prepareMessageProxyHeaders, G as createResponsesHttpEventStream, H as requestContext, J as isTerminalResponsesStreamChunk, K as createResponsesSafeStream, M as compactTextOnlyGuard, N as createAuthMiddleware, O as compactAutoContinuePromptStarts, P as getConfiguredAdminApiKeys, Q as HTTPError, R as CODEX_API_BASE_URL, T as prepareInteractionHeaders, U as resolveTraceId$1, V as generateTraceId, W as fetchUpstreamWithLifecycle, X as createWebSocketUrl, Y as createPooledWebSocketStream, Z as state, b as copilotBaseUrl, d as getUUID, f as isAsyncIterable, g as getCopilotUsage, h as parseUserIdMetadata, j as compactSystemPromptStarts, k as compactMessageSections, l as generateRequestIdFromPayload, m as isResponsesStream, o as setupCodexToken, p as isNullish, q as encodePoolKeyPart, u as getRootSessionId, w as prepareForCompact, x as copilotHeaders, z as buildCodexRequestHeaders } from "./token-
|
|
1
|
+
import { A as isResponsesApiWebSocketEnabled, C as getClaudeTokenMultiplier, D as isAlphaSearchCodexPriorityEnabled, E as getUpstreamTransportConfig, O as isMessagesApiEnabled, P as PATHS, S as getClaudeAutoModel, T as getMessageApiWebSearchModel, _ as resolveMappedModel, b as getAlphaSearchModel, d as getModelResponsesApiCompactThreshold$1, f as getReasoningEffortForModel, g as isGpt56OrAbove, h as isContextManagementEnabledForResponses, i as listEnabledProviders, k as isResponsesApiWebSearchEnabled, l as getExtraPromptForModel, m as isContextManagementEnabledForMessages, n as getRawProviderConfig, o as resolveEffectiveProviderType, p as getSmallModel, s as resolveProviderAuthType, t as getProviderConfig, u as getModelMappings, v as setModelMappings, x as getAnthropicApiKey } from "./config-q6afpNQS.js";
|
|
2
|
+
import { $ as forwardError, B as forwardCodexResponses, C as copilotWebSocketHeaders, E as prepareMessageProxyHeaders, G as createResponsesHttpEventStream, H as requestContext, J as isTerminalResponsesStreamChunk, K as createResponsesSafeStream, M as compactTextOnlyGuard, N as createAuthMiddleware, O as compactAutoContinuePromptStarts, P as getConfiguredAdminApiKeys, Q as HTTPError, R as CODEX_API_BASE_URL, T as prepareInteractionHeaders, U as resolveTraceId$1, V as generateTraceId, W as fetchUpstreamWithLifecycle, X as createWebSocketUrl, Y as createPooledWebSocketStream, Z as state, b as copilotBaseUrl, d as getUUID, f as isAsyncIterable, g as getCopilotUsage, h as parseUserIdMetadata, j as compactSystemPromptStarts, k as compactMessageSections, l as generateRequestIdFromPayload, m as isResponsesStream, o as setupCodexToken, p as isNullish, q as encodePoolKeyPart, u as getRootSessionId, w as prepareForCompact, x as copilotHeaders, z as buildCodexRequestHeaders } from "./token-Br2vDo-U.js";
|
|
3
3
|
import { a as isDeferredToolName, c as parseMcpToolSearchSentinel, d as shouldEnableResponsesToolSearch, i as isBridgeToolSearchName, l as resolveBridgeToolSearchName, o as listDeferredToolNames, r as formatToolSearchBridgeArguments, s as normalizeToolSearchBridgeArguments, t as BRIDGE_TOOL_SEARCH_NAME, u as selectDeferredToolsByNames } from "./tool-search-BgFcDbNQ.js";
|
|
4
|
-
import { i as toClientModelId, r as normalizeSdkModelId, t as findEndpointModel } from "./models-
|
|
4
|
+
import { i as toClientModelId, r as normalizeSdkModelId, t as findEndpointModel } from "./models-CKZ52xkF.js";
|
|
5
5
|
import consola from "consola";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
import fs, { createWriteStream, readFileSync, rmSync } from "node:fs";
|
|
@@ -2019,6 +2019,7 @@ function normalizeResponsesUsage(usage) {
|
|
|
2019
2019
|
return {
|
|
2020
2020
|
...cacheWriteTokens > 0 && { cache_creation_input_tokens: cacheWriteTokens },
|
|
2021
2021
|
cache_read_input_tokens: cachedTokens,
|
|
2022
|
+
cost: normalizeOptionalCost(usage?.cost),
|
|
2022
2023
|
input_tokens: Math.max(0, inputTokens - cachedTokens - cacheWriteTokens),
|
|
2023
2024
|
output_tokens: normalizeToken(usage?.output_tokens),
|
|
2024
2025
|
total_tokens: normalizeOptionalToken(usage?.total_tokens)
|
|
@@ -11011,7 +11012,7 @@ function createProviderCodexCandidate(providerConfig, modelId, remoteModel, mode
|
|
|
11011
11012
|
const builtinReasoningEfforts = normalizeReasoningEfforts(builtinModelConfig?.reasoningEfforts);
|
|
11012
11013
|
const reasoningEfforts = configuredReasoningEfforts.length > 0 ? configuredReasoningEfforts : remoteReasoningEfforts.length > 0 ? remoteReasoningEfforts : builtinReasoningEfforts;
|
|
11013
11014
|
const configuredModalities = normalizeInputModalities(modelConfig?.inputModalities);
|
|
11014
|
-
const remoteModalities = normalizeInputModalities(remoteModel?.input_modalities ?? remoteModel?.modalities);
|
|
11015
|
+
const remoteModalities = normalizeInputModalities(remoteModel?.input_modalities ?? remoteModel?.modalities ?? getRecordField(remoteModel, "architecture")?.input_modalities);
|
|
11015
11016
|
const builtinModalities = normalizeInputModalities(builtinModelConfig?.inputModalities);
|
|
11016
11017
|
const displayName = getStringField(remoteModel ?? {}, "display_name") ?? getStringField(remoteModel ?? {}, "name") ?? modelId;
|
|
11017
11018
|
const adapterName = describeProviderAdapter(effectiveType);
|
|
@@ -11067,6 +11068,10 @@ function selectDefaultReasoningEffort(efforts, configured) {
|
|
|
11067
11068
|
function positiveNumber(value, fallback) {
|
|
11068
11069
|
return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.floor(value) : fallback;
|
|
11069
11070
|
}
|
|
11071
|
+
function getRecordField(model, field) {
|
|
11072
|
+
const value = model?.[field];
|
|
11073
|
+
return isRecord(value) ? value : void 0;
|
|
11074
|
+
}
|
|
11070
11075
|
function getFirstPositiveNumber(model, fields) {
|
|
11071
11076
|
if (!model) return void 0;
|
|
11072
11077
|
for (const field of fields) {
|
|
@@ -12686,4 +12691,4 @@ createServer();
|
|
|
12686
12691
|
//#endregion
|
|
12687
12692
|
export { createServer };
|
|
12688
12693
|
|
|
12689
|
-
//# sourceMappingURL=server-
|
|
12694
|
+
//# sourceMappingURL=server-hiibWOJw.js.map
|