cascade-ai 0.12.8 → 0.12.9

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/cli.js CHANGED
@@ -54,7 +54,7 @@ var __export = (target, all) => {
54
54
  var CASCADE_VERSION, CASCADE_CONFIG_FILE, CASCADE_DB_FILE, CASCADE_DASHBOARD_SECRET_FILE, GLOBAL_CONFIG_DIR, GLOBAL_DB_FILE, GLOBAL_KEYSTORE_FILE, GLOBAL_RUNTIME_DB_FILE, DEFAULT_DASHBOARD_PORT, DEFAULT_CONTEXT_LIMIT, DEFAULT_AUTO_SUMMARIZE_AT, MODELS, T1_MODEL_PRIORITY, T2_MODEL_PRIORITY, T3_MODEL_PRIORITY, VISION_MODEL_PRIORITY, COMPLEXITY_T2_COUNT, THEME_NAMES, DEFAULT_THEME, OLLAMA_BASE_URL, LM_STUDIO_BASE_URL, AZURE_BASE_URL_TEMPLATE, TOOL_NAMES, DEFAULT_APPROVAL_REQUIRED;
55
55
  var init_constants = __esm({
56
56
  "src/constants.ts"() {
57
- CASCADE_VERSION = "0.12.8";
57
+ CASCADE_VERSION = "0.12.9";
58
58
  CASCADE_CONFIG_FILE = ".cascade/config.json";
59
59
  CASCADE_DB_FILE = ".cascade/memory.db";
60
60
  CASCADE_DASHBOARD_SECRET_FILE = ".cascade/dashboard-secret";
@@ -455,6 +455,12 @@ var anthropic_exports = {};
455
455
  __export(anthropic_exports, {
456
456
  AnthropicProvider: () => AnthropicProvider
457
457
  });
458
+ function anthropicThinkingParam(modelId, maxTokens) {
459
+ if (!/claude-(opus|sonnet)-4/i.test(modelId)) return {};
460
+ const budget = Math.min(8e3, maxTokens - 1024);
461
+ if (budget < 1024) return {};
462
+ return { thinking: { type: "enabled", budget_tokens: budget } };
463
+ }
458
464
  var AnthropicProvider;
459
465
  var init_anthropic = __esm({
460
466
  "src/providers/anthropic.ts"() {
@@ -489,13 +495,18 @@ var init_anthropic = __esm({
489
495
  let fullContent = "";
490
496
  let inputTokens = 0;
491
497
  let outputTokens = 0;
498
+ const maxTokens = options.maxTokens ?? this.model.maxOutputTokens;
499
+ const thinkParam = anthropicThinkingParam(this.model.id, maxTokens);
500
+ const useThinking = !!thinkParam.thinking;
492
501
  const stream = this.client.messages.stream({
493
502
  model: this.model.id,
494
- max_tokens: options.maxTokens ?? this.model.maxOutputTokens,
495
- temperature: options.temperature ?? 0.7,
503
+ max_tokens: maxTokens,
504
+ // Extended thinking requires temperature = 1; otherwise honor the request.
505
+ temperature: useThinking ? 1 : options.temperature ?? 0.7,
496
506
  system: options.systemPrompt,
497
507
  messages,
498
- tools: tools?.length ? tools : void 0
508
+ tools: tools?.length ? tools : void 0,
509
+ ...thinkParam
499
510
  }, { signal: options.signal });
500
511
  let isThinking = false;
501
512
  for await (const event of stream) {