cascade-ai 0.12.8 → 0.12.10

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.cjs CHANGED
@@ -101,7 +101,7 @@ var __export = (target, all) => {
101
101
  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;
102
102
  var init_constants = __esm({
103
103
  "src/constants.ts"() {
104
- CASCADE_VERSION = "0.12.8";
104
+ CASCADE_VERSION = "0.12.10";
105
105
  CASCADE_CONFIG_FILE = ".cascade/config.json";
106
106
  CASCADE_DB_FILE = ".cascade/memory.db";
107
107
  CASCADE_DASHBOARD_SECRET_FILE = ".cascade/dashboard-secret";
@@ -502,6 +502,12 @@ var anthropic_exports = {};
502
502
  __export(anthropic_exports, {
503
503
  AnthropicProvider: () => AnthropicProvider
504
504
  });
505
+ function anthropicThinkingParam(modelId, maxTokens) {
506
+ if (!/claude-(opus|sonnet)-4/i.test(modelId)) return {};
507
+ const budget = Math.min(8e3, maxTokens - 1024);
508
+ if (budget < 1024) return {};
509
+ return { thinking: { type: "enabled", budget_tokens: budget } };
510
+ }
505
511
  var AnthropicProvider;
506
512
  var init_anthropic = __esm({
507
513
  "src/providers/anthropic.ts"() {
@@ -536,13 +542,18 @@ var init_anthropic = __esm({
536
542
  let fullContent = "";
537
543
  let inputTokens = 0;
538
544
  let outputTokens = 0;
545
+ const maxTokens = options.maxTokens ?? this.model.maxOutputTokens;
546
+ const thinkParam = anthropicThinkingParam(this.model.id, maxTokens);
547
+ const useThinking = !!thinkParam.thinking;
539
548
  const stream = this.client.messages.stream({
540
549
  model: this.model.id,
541
- max_tokens: options.maxTokens ?? this.model.maxOutputTokens,
542
- temperature: options.temperature ?? 0.7,
550
+ max_tokens: maxTokens,
551
+ // Extended thinking requires temperature = 1; otherwise honor the request.
552
+ temperature: useThinking ? 1 : options.temperature ?? 0.7,
543
553
  system: options.systemPrompt,
544
554
  messages,
545
- tools: tools?.length ? tools : void 0
555
+ tools: tools?.length ? tools : void 0,
556
+ ...thinkParam
546
557
  }, { signal: options.signal });
547
558
  let isThinking = false;
548
559
  for await (const event of stream) {