@code-yeongyu/senpi-ai 2026.8.13 → 2026.8.16
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 +2 -0
- package/dist/api/anthropic-messages.d.ts.map +1 -1
- package/dist/api/anthropic-messages.js +40 -14
- package/dist/api/anthropic-messages.js.map +1 -1
- package/dist/api/bedrock-converse-stream.d.ts.map +1 -1
- package/dist/api/bedrock-converse-stream.js +16 -4
- package/dist/api/bedrock-converse-stream.js.map +1 -1
- package/dist/api/cloudflare-gateway-binding.d.ts +69 -0
- package/dist/api/cloudflare-gateway-binding.d.ts.map +1 -0
- package/dist/api/cloudflare-gateway-binding.js +159 -0
- package/dist/api/cloudflare-gateway-binding.js.map +1 -0
- package/dist/api/constrained-sampling.d.ts +3 -0
- package/dist/api/constrained-sampling.d.ts.map +1 -1
- package/dist/api/constrained-sampling.js +125 -5
- package/dist/api/constrained-sampling.js.map +1 -1
- package/dist/api/google-generative-ai.js +7 -3
- package/dist/api/google-generative-ai.js.map +1 -1
- package/dist/api/google-shared.d.ts +1 -1
- package/dist/api/google-shared.d.ts.map +1 -1
- package/dist/api/google-shared.js +13 -9
- package/dist/api/google-shared.js.map +1 -1
- package/dist/api/google-vertex.js +7 -3
- package/dist/api/google-vertex.js.map +1 -1
- package/dist/api/mistral-conversations.d.ts +1 -1
- package/dist/api/mistral-conversations.d.ts.map +1 -1
- package/dist/api/mistral-conversations.js +208 -42
- package/dist/api/mistral-conversations.js.map +1 -1
- package/dist/api/openai-codex-responses.d.ts.map +1 -1
- package/dist/api/openai-codex-responses.js +13 -4
- package/dist/api/openai-codex-responses.js.map +1 -1
- package/dist/api/openai-completions.d.ts.map +1 -1
- package/dist/api/openai-completions.js +10 -7
- package/dist/api/openai-completions.js.map +1 -1
- package/dist/api/openai-responses-shared.d.ts +1 -0
- package/dist/api/openai-responses-shared.d.ts.map +1 -1
- package/dist/api/openai-responses-shared.js +31 -7
- package/dist/api/openai-responses-shared.js.map +1 -1
- package/dist/api/openai-responses.d.ts.map +1 -1
- package/dist/api/openai-responses.js +8 -1
- package/dist/api/openai-responses.js.map +1 -1
- package/dist/auth/oauth/cursor.d.ts +16 -0
- package/dist/auth/oauth/cursor.d.ts.map +1 -0
- package/dist/auth/oauth/cursor.js +234 -0
- package/dist/auth/oauth/cursor.js.map +1 -0
- package/dist/auth/oauth/github-copilot.d.ts.map +1 -1
- package/dist/auth/oauth/github-copilot.js +6 -3
- package/dist/auth/oauth/github-copilot.js.map +1 -1
- package/dist/auth/oauth/load.d.ts +2 -0
- package/dist/auth/oauth/load.d.ts.map +1 -1
- package/dist/auth/oauth/load.js +5 -0
- package/dist/auth/oauth/load.js.map +1 -1
- package/dist/auth/resolve.js +44 -9
- package/dist/auth/resolve.js.map +1 -1
- package/dist/auth/types.d.ts +2 -0
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/auth/types.js.map +1 -1
- package/dist/bun-oauth.d.ts.map +1 -1
- package/dist/bun-oauth.js +2 -0
- package/dist/bun-oauth.js.map +1 -1
- package/dist/image-models.generated.d.ts +15 -0
- package/dist/image-models.generated.d.ts.map +1 -1
- package/dist/image-models.generated.js +15 -0
- package/dist/image-models.generated.js.map +1 -1
- package/dist/providers/all.d.ts.map +1 -1
- package/dist/providers/all.js +2 -0
- package/dist/providers/all.js.map +1 -1
- package/dist/providers/cursor.d.ts +15 -0
- package/dist/providers/cursor.d.ts.map +1 -0
- package/dist/providers/cursor.js +32 -0
- package/dist/providers/cursor.js.map +1 -0
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/alibaba-token-plan.json +1 -1
- package/dist/providers/data/baseten.json +1 -1
- package/dist/providers/data/cloudflare-ai-gateway.json +1 -1
- package/dist/providers/data/cloudflare-workers-ai.json +1 -1
- package/dist/providers/data/deepseek.json +1 -1
- package/dist/providers/data/fireworks.json +1 -1
- package/dist/providers/data/github-copilot.json +1 -1
- package/dist/providers/data/google-vertex.json +1 -1
- package/dist/providers/data/google.json +1 -1
- package/dist/providers/data/huggingface.json +1 -1
- package/dist/providers/data/kimi-coding.json +1 -1
- package/dist/providers/data/nvidia.json +1 -1
- package/dist/providers/data/openai-codex.json +1 -1
- package/dist/providers/data/openai.json +1 -1
- package/dist/providers/data/opencode-go.json +1 -1
- package/dist/providers/data/opencode.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/qwen-token-plan-cn.json +1 -1
- package/dist/providers/data/qwen-token-plan.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/providers/data/zai-coding-cn.json +1 -1
- package/dist/providers/data/zai.json +1 -1
- package/dist/types.d.ts +14 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/overflow.d.ts.map +1 -1
- package/dist/utils/overflow.js +2 -0
- package/dist/utils/overflow.js.map +1 -1
- package/dist/utils/pi-user-agent.d.ts +2 -0
- package/dist/utils/pi-user-agent.d.ts.map +1 -0
- package/dist/utils/pi-user-agent.js +12 -0
- package/dist/utils/pi-user-agent.js.map +1 -0
- package/dist/utils/prompt-cache-ttl.d.ts.map +1 -1
- package/dist/utils/prompt-cache-ttl.js +3 -2
- package/dist/utils/prompt-cache-ttl.js.map +1 -1
- package/dist/utils/retry.d.ts.map +1 -1
- package/dist/utils/retry.js +1 -0
- package/dist/utils/retry.js.map +1 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +34 -0
- package/dist/utils/validation.js.map +1 -1
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ import { retryProviderStreamRequest } from "../utils/provider-retry.js";
|
|
|
11
11
|
import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
|
|
12
12
|
import { isForcedToolChoiceUnsupportedError, omitToolChoiceParam } from "../utils/tool-choice-fallback.js";
|
|
13
13
|
import { normalizeToolParametersForMoonshot, normalizeToolParametersForOpenAICompat, } from "../utils/tool-schema-compat.js";
|
|
14
|
-
import { appendGrammarToolInputJsonDelta, createGrammarToolInputProperties, getGrammarToolInput, resolveGrammarConstrainedSampling, resolveJsonSchemaStrictSampling, } from "./constrained-sampling.js";
|
|
14
|
+
import { appendGrammarToolInputJsonDelta, createGrammarToolInputProperties, getGrammarToolInput, getJsonSchemaToolParameters, resolveGrammarConstrainedSampling, resolveJsonSchemaStrictSampling, } from "./constrained-sampling.js";
|
|
15
15
|
import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "./github-copilot-headers.js";
|
|
16
16
|
import { resolveOpenAIClientAuth } from "./openai-client-auth.js";
|
|
17
17
|
import { clampOpenAIPromptCacheKey } from "./openai-prompt-cache.js";
|
|
@@ -68,7 +68,7 @@ function getThinkingLevelMap(model, compat) {
|
|
|
68
68
|
const isKimiK3 = id === "k3" || id.startsWith("k3-") || /(?:^|[/:-])kimi-k3(?:$|[/.:_-])/.test(id);
|
|
69
69
|
const isDeepSeek = id.includes("deepseek");
|
|
70
70
|
const isMiMo = /\bmimo\b/.test(id);
|
|
71
|
-
const
|
|
71
|
+
const isGlm5x = /(?:^|[/:-])glm-5\.[23](?:$|[/.:_-])/.test(id);
|
|
72
72
|
if (model.provider === "ollama") {
|
|
73
73
|
return OLLAMA_THINKING_LEVEL_MAP;
|
|
74
74
|
}
|
|
@@ -84,7 +84,7 @@ function getThinkingLevelMap(model, compat) {
|
|
|
84
84
|
if (isDeepSeek) {
|
|
85
85
|
return DEEPSEEK_THINKING_LEVEL_MAP;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
87
|
+
if (isGlm5x) {
|
|
88
88
|
if (compat.thinkingFormat === "zai") {
|
|
89
89
|
return DEEPSEEK_THINKING_LEVEL_MAP;
|
|
90
90
|
}
|
|
@@ -756,8 +756,10 @@ function buildParams(model, context, options, compat = getCompat(model), cacheRe
|
|
|
756
756
|
params.tool_choice = options.toolChoice;
|
|
757
757
|
}
|
|
758
758
|
if (compat.thinkingFormat === "zai" && model.reasoning) {
|
|
759
|
+
const isGlm53 = /(?:^|[/:-])glm-5\.3(?:$|[/.:_-])/.test(model.id.toLowerCase());
|
|
759
760
|
const zaiParams = params;
|
|
760
|
-
zaiParams.thinking =
|
|
761
|
+
zaiParams.thinking =
|
|
762
|
+
options?.reasoningEffort || isGlm53 ? { type: "enabled", clear_thinking: false } : { type: "disabled" };
|
|
761
763
|
if (options?.reasoningEffort && compat.supportsReasoningEffort) {
|
|
762
764
|
const effort = resolveReasoningEffort(thinkingLevelMap, options.reasoningEffort);
|
|
763
765
|
if (effort !== undefined) {
|
|
@@ -1307,10 +1309,11 @@ function convertTools(tools, compat) {
|
|
|
1307
1309
|
if (tool.freeform) {
|
|
1308
1310
|
throw new Error("Freeform tools cannot be sent to OpenAI Chat Completions; use Responses API");
|
|
1309
1311
|
}
|
|
1310
|
-
const normalizedParameters = compat.toolSchemaFlavor === "moonshot-mfjs"
|
|
1311
|
-
? normalizeToolParametersForMoonshot(tool.parameters)
|
|
1312
|
-
: normalizeToolParametersForOpenAICompat(tool.parameters);
|
|
1313
1312
|
const strict = resolveJsonSchemaStrictSampling(tool, compat.supportsStrictMode !== false);
|
|
1313
|
+
const schemaParameters = getJsonSchemaToolParameters(tool, strict);
|
|
1314
|
+
const normalizedParameters = compat.toolSchemaFlavor === "moonshot-mfjs"
|
|
1315
|
+
? normalizeToolParametersForMoonshot(schemaParameters)
|
|
1316
|
+
: normalizeToolParametersForOpenAICompat(schemaParameters);
|
|
1314
1317
|
return {
|
|
1315
1318
|
type: "function",
|
|
1316
1319
|
function: {
|