@prestyj/ai 5.12.0 → 5.13.0

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 CHANGED
@@ -42,7 +42,7 @@ Tool parameters are Zod schemas. Converted to JSON Schema at the provider bounda
42
42
  |---|---|---|
43
43
  | `anthropic` | Claude Opus 5, Sonnet 5, Haiku 4.5 | Extended thinking, prompt caching, server-side compaction |
44
44
  | `openai` | GPT-4.1, o3, o4-mini | Supports OAuth (codex endpoint) and API keys |
45
- | `glm` | GLM-5.1, GLM-4.7 | Z.AI platform, OpenAI-compatible |
45
+ | `glm` | GLM-5.3 | Z.AI platform, OpenAI-compatible |
46
46
  | `moonshot` | Kimi K3, Kimi K2.7 Code | Moonshot platform, OpenAI-compatible |
47
47
 
48
48
  ---
package/dist/index.cjs CHANGED
@@ -53,6 +53,7 @@ __export(index_exports, {
53
53
  redactText: () => redactText,
54
54
  redactValue: () => redactValue,
55
55
  registerPalsuProvider: () => registerPalsuProvider,
56
+ resolveToolSchema: () => resolveToolSchema,
56
57
  sanitizeMessagesForWire: () => sanitizeMessagesForWire,
57
58
  setProviderDiagnostic: () => setProviderDiagnostic,
58
59
  sliceHead: () => sliceHead,
@@ -1171,6 +1172,9 @@ function toLocalReasoningEffort(level) {
1171
1172
  if (level === "max" || level === "ultra" || level === "xhigh") return "max";
1172
1173
  return level;
1173
1174
  }
1175
+ function toGlmReasoningEffort(level) {
1176
+ return level === "ultra" ? "max" : level;
1177
+ }
1174
1178
  function toOpenAIReasoningEffort(level, model) {
1175
1179
  const effort = level === "max" || level === "ultra" ? "xhigh" : level;
1176
1180
  if (model.startsWith("fugu") && (effort === "low" || effort === "medium")) {
@@ -2040,6 +2044,11 @@ async function* runStream2(options) {
2040
2044
  if (usesThinkingParam) {
2041
2045
  if (options.thinking) {
2042
2046
  params.thinking = { type: "enabled" };
2047
+ if (options.provider === "glm") {
2048
+ params.reasoning_effort = toGlmReasoningEffort(
2049
+ options.thinking
2050
+ );
2051
+ }
2043
2052
  } else {
2044
2053
  params.thinking = { type: "disabled" };
2045
2054
  }
@@ -4229,6 +4238,7 @@ function registerPalsuProvider(config) {
4229
4238
  redactText,
4230
4239
  redactValue,
4231
4240
  registerPalsuProvider,
4241
+ resolveToolSchema,
4232
4242
  sanitizeMessagesForWire,
4233
4243
  setProviderDiagnostic,
4234
4244
  sliceHead,