@bunny-agent/runner-cli 0.9.61-beta.1 → 0.9.61

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.
Files changed (2) hide show
  1. package/dist/bundle.mjs +25 -73
  2. package/package.json +6 -6
package/dist/bundle.mjs CHANGED
@@ -24485,16 +24485,22 @@ function serializeResult2(result) {
24485
24485
 
24486
24486
  // ../../packages/runner-pi/dist/pi-runner.js
24487
24487
  var LOG_PREFIX2 = "[bunny-agent:pi]";
24488
- var LLM_THOUGHT_SIGNATURE_SEPARATOR = "__thought__";
24489
24488
  var DEFAULT_DYNAMIC_MODEL_PROFILE = {
24490
24489
  contextWindow: 128e3,
24491
- maxTokens: 8192
24490
+ maxTokens: 8192,
24491
+ thinkingLevelMap: { off: null, xhigh: "xhigh" }
24492
24492
  };
24493
24493
  var DYNAMIC_MODEL_PROFILES = {
24494
24494
  "gemini-3.7-flash": {
24495
24495
  contextWindow: 1048576,
24496
24496
  maxTokens: 65536,
24497
- reasoning: true
24497
+ reasoning: true,
24498
+ thinkingLevelMap: {
24499
+ off: null,
24500
+ minimal: null,
24501
+ xhigh: null,
24502
+ max: null
24503
+ }
24498
24504
  }
24499
24505
  };
24500
24506
  function resolveDynamicModelProfile(modelName, effort) {
@@ -24502,9 +24508,20 @@ function resolveDynamicModelProfile(modelName, effort) {
24502
24508
  return {
24503
24509
  contextWindow: profile?.contextWindow ?? DEFAULT_DYNAMIC_MODEL_PROFILE.contextWindow,
24504
24510
  maxTokens: profile?.maxTokens ?? DEFAULT_DYNAMIC_MODEL_PROFILE.maxTokens,
24505
- reasoning: profile?.reasoning ?? Boolean(effort && effort !== "off")
24511
+ reasoning: profile?.reasoning ?? Boolean(effort && effort !== "off"),
24512
+ thinkingLevelMap: {
24513
+ ...profile?.thinkingLevelMap ?? DEFAULT_DYNAMIC_MODEL_PROFILE.thinkingLevelMap
24514
+ }
24506
24515
  };
24507
24516
  }
24517
+ function resolveInitialThinkingLevel(effort, previousModel, currentModel) {
24518
+ if (effort)
24519
+ return effort;
24520
+ if (previousModel && (previousModel.provider !== currentModel.provider || previousModel.modelId !== currentModel.id)) {
24521
+ return "medium";
24522
+ }
24523
+ return void 0;
24524
+ }
24508
24525
  async function disposePiSession(session) {
24509
24526
  try {
24510
24527
  if (session.hasExtensionHandlers("session_shutdown")) {
@@ -24530,72 +24547,6 @@ function normalizeAllowedTools(allowedTools) {
24530
24547
  ...new Set(allowedTools.map((toolName) => toolName === LEGACY_ASK_USER_QUESTION_TOOL_NAME ? ASK_USER_QUESTION_TOOL_NAME : toolName))
24531
24548
  ];
24532
24549
  }
24533
- function shouldStripLLMThoughtSignaturesForModel(model) {
24534
- const id = (model.id ?? "").toLowerCase();
24535
- return !id.includes("gemini");
24536
- }
24537
- function stripLLMThoughtSignatureFromId(id) {
24538
- const separatorIndex = id.indexOf(LLM_THOUGHT_SIGNATURE_SEPARATOR);
24539
- if (separatorIndex === -1)
24540
- return id;
24541
- return id.slice(0, separatorIndex);
24542
- }
24543
- function stripLLMThoughtSignaturesFromSessionManager(sessionManager, model) {
24544
- if (!shouldStripLLMThoughtSignaturesForModel(model))
24545
- return;
24546
- const manager = sessionManager;
24547
- const entries = manager.getEntries?.();
24548
- if (Array.isArray(entries)) {
24549
- for (const entry of entries) {
24550
- if (entry == null || typeof entry !== "object")
24551
- continue;
24552
- const message = entry.message;
24553
- if (entry.type === "message") {
24554
- stripLLMThoughtSignaturesFromMessage(message);
24555
- }
24556
- }
24557
- return;
24558
- }
24559
- const context = sessionManager.buildSessionContext?.();
24560
- const messages = context?.messages;
24561
- if (!Array.isArray(messages))
24562
- return;
24563
- for (const message of messages) {
24564
- stripLLMThoughtSignaturesFromMessage(message);
24565
- }
24566
- }
24567
- function stripLLMThoughtSignaturesFromMessage(message) {
24568
- if (message == null || typeof message !== "object")
24569
- return;
24570
- const msg = message;
24571
- if (typeof msg.toolCallId === "string") {
24572
- msg.toolCallId = stripLLMThoughtSignatureFromId(msg.toolCallId);
24573
- }
24574
- if (typeof msg.tool_call_id === "string") {
24575
- msg.tool_call_id = stripLLMThoughtSignatureFromId(msg.tool_call_id);
24576
- }
24577
- if (!Array.isArray(msg.content))
24578
- return;
24579
- for (const block of msg.content) {
24580
- if (block == null || typeof block !== "object")
24581
- continue;
24582
- const contentBlock = block;
24583
- if (contentBlock.type !== "toolCall")
24584
- continue;
24585
- if (typeof contentBlock.id === "string") {
24586
- contentBlock.id = stripLLMThoughtSignatureFromId(contentBlock.id);
24587
- }
24588
- if (typeof contentBlock.toolCallId === "string") {
24589
- contentBlock.toolCallId = stripLLMThoughtSignatureFromId(contentBlock.toolCallId);
24590
- }
24591
- if (typeof contentBlock.tool_call_id === "string") {
24592
- contentBlock.tool_call_id = stripLLMThoughtSignatureFromId(contentBlock.tool_call_id);
24593
- }
24594
- if (typeof contentBlock.call_id === "string") {
24595
- contentBlock.call_id = stripLLMThoughtSignatureFromId(contentBlock.call_id);
24596
- }
24597
- }
24598
- }
24599
24550
  function parseModelSpec(model) {
24600
24551
  const trimmed = model.trim();
24601
24552
  const separator = trimmed.indexOf(":");
@@ -24704,7 +24655,7 @@ function createPiRunner(options = {}) {
24704
24655
  id: modelName,
24705
24656
  name: modelName,
24706
24657
  reasoning: profile.reasoning,
24707
- thinkingLevelMap: { off: null, xhigh: "xhigh" },
24658
+ thinkingLevelMap: profile.thinkingLevelMap,
24708
24659
  input: ["text", "image"],
24709
24660
  cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
24710
24661
  contextWindow: profile.contextWindow,
@@ -24750,7 +24701,6 @@ function createPiRunner(options = {}) {
24750
24701
  }
24751
24702
  return SessionManager2.create(cwd);
24752
24703
  })();
24753
- stripLLMThoughtSignaturesFromSessionManager(sessionManager, model);
24754
24704
  const resourceLoader = options.skillPaths || options.systemPrompt || mcpExtension ? new BunnyAgentResourceLoader({
24755
24705
  cwd,
24756
24706
  skillPaths: options.skillPaths,
@@ -24800,13 +24750,15 @@ function createPiRunner(options = {}) {
24800
24750
  }
24801
24751
  const gatedTools = gateToolsForApproval(regularTools, bypassApproval, approvalGate);
24802
24752
  const askUserQuestionEnabled = allowedTools === void 0 || allowedTools.includes(ASK_USER_QUESTION_TOOL_NAME);
24753
+ const previousModel = sessionManager.buildSessionContext?.().model;
24754
+ const thinkingLevel = resolveInitialThinkingLevel(options.effort, previousModel, model);
24803
24755
  const { session } = await createAgentSession({
24804
24756
  cwd,
24805
24757
  model,
24806
24758
  sessionManager,
24807
24759
  modelRuntime,
24808
24760
  resourceLoader,
24809
- thinkingLevel: options.effort ? options.effort : void 0,
24761
+ thinkingLevel,
24810
24762
  tools: allowedTools,
24811
24763
  customTools: [
24812
24764
  ...gatedTools,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunny-agent/runner-cli",
3
- "version": "0.9.61-beta.1",
3
+ "version": "0.9.61",
4
4
  "description": "BunnyAgent Runner CLI - Like gemini-cli or claude-code, runs in your local terminal with AI SDK UI streaming",
5
5
  "type": "module",
6
6
  "bin": {
@@ -59,16 +59,16 @@
59
59
  "esbuild": "^0.27.2",
60
60
  "typescript": "^5.3.0",
61
61
  "vitest": "^1.6.1",
62
+ "@bunny-agent/apply-patch": "0.1.0",
63
+ "@bunny-agent/runner-claude": "0.6.2",
62
64
  "@bunny-agent/runner-codex": "0.6.2",
63
- "@bunny-agent/manager": "0.9.61-beta.1",
64
65
  "@bunny-agent/runner-gemini": "0.6.2",
66
+ "@bunny-agent/runner-copilot": "0.1.0",
65
67
  "@bunny-agent/runner-harness": "0.1.1-beta.0",
68
+ "@bunny-agent/manager": "0.9.61",
66
69
  "@bunny-agent/runner-pi": "0.6.4-beta.0",
67
- "@bunny-agent/runner-opencode": "0.6.2",
68
- "@bunny-agent/runner-copilot": "0.1.0",
69
- "@bunny-agent/runner-claude": "0.6.2",
70
70
  "@bunny-agent/server-acp": "0.1.0",
71
- "@bunny-agent/apply-patch": "0.1.0"
71
+ "@bunny-agent/runner-opencode": "0.6.2"
72
72
  },
73
73
  "scripts": {
74
74
  "build": "tsc && pnpm bundle",