@bunny-agent/runner-cli 0.9.37-beta.4 → 0.9.38-beta.1

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 +28 -32
  2. package/package.json +4 -4
package/dist/bundle.mjs CHANGED
@@ -2117,14 +2117,23 @@ var PiAISDKStreamConverter = class {
2117
2117
  const raw = event.result?.details?.usage?.raw;
2118
2118
  if (raw != null)
2119
2119
  accumulateToolUsage(this.toolUsageTally, raw);
2120
- chunks.push(sseData({
2121
- type: "tool-output-available",
2122
- toolCallId: event.toolCallId,
2123
- output,
2124
- isError: event.isError,
2125
- dynamic: true,
2126
- providerExecuted: true
2127
- }));
2120
+ if (event.isError) {
2121
+ chunks.push(sseData({
2122
+ type: "tool-output-error",
2123
+ toolCallId: event.toolCallId,
2124
+ errorText: output,
2125
+ dynamic: true,
2126
+ providerExecuted: true
2127
+ }));
2128
+ } else {
2129
+ chunks.push(sseData({
2130
+ type: "tool-output-available",
2131
+ toolCallId: event.toolCallId,
2132
+ output,
2133
+ dynamic: true,
2134
+ providerExecuted: true
2135
+ }));
2136
+ }
2128
2137
  return chunks;
2129
2138
  }
2130
2139
  if (event.type === "agent_end") {
@@ -5220,6 +5229,15 @@ var Type = type_exports2;
5220
5229
 
5221
5230
  // ../../packages/runner-pi/dist/tool-refs.js
5222
5231
  var LOG_PREFIX2 = "[bunny-agent:pi-tool-ref]";
5232
+ var PiToolRefError = class extends Error {
5233
+ constructor(message, opts) {
5234
+ super(message);
5235
+ this.name = "PiToolRefError";
5236
+ this.toolName = opts.toolName;
5237
+ this.status = opts.status;
5238
+ this.body = opts.body;
5239
+ }
5240
+ };
5223
5241
  function buildToolDefinitionsFromRefs(tools) {
5224
5242
  return tools.map((spec) => buildOne(spec));
5225
5243
  }
@@ -5236,10 +5254,10 @@ function buildOne(spec) {
5236
5254
  response = await executeToolRef(spec, params, signal);
5237
5255
  } catch (error) {
5238
5256
  const message = error instanceof Error ? error.message : String(error);
5239
- return transportErrorResult(spec.name, message);
5257
+ throw new PiToolRefError(`${LOG_PREFIX2} tool "${spec.name}" transport error: ${message}`, { toolName: spec.name });
5240
5258
  }
5241
5259
  if (response.status < 200 || response.status >= 300) {
5242
- return statusErrorResult(spec.name, response.status, response.body);
5260
+ throw new PiToolRefError(`${LOG_PREFIX2} tool "${spec.name}" failed (status ${response.status}): ${response.body}`, { toolName: spec.name, status: response.status, body: response.body });
5243
5261
  }
5244
5262
  return okResult(response.body);
5245
5263
  }
@@ -5285,28 +5303,6 @@ function okResult(text) {
5285
5303
  details: void 0
5286
5304
  };
5287
5305
  }
5288
- function statusErrorResult(toolName, status, body) {
5289
- return {
5290
- content: [
5291
- {
5292
- type: "text",
5293
- text: `${LOG_PREFIX2} tool "${toolName}" failed (status ${status}): ${body}`
5294
- }
5295
- ],
5296
- details: void 0
5297
- };
5298
- }
5299
- function transportErrorResult(toolName, message) {
5300
- return {
5301
- content: [
5302
- {
5303
- type: "text",
5304
- text: `${LOG_PREFIX2} tool "${toolName}" transport error: ${message}`
5305
- }
5306
- ],
5307
- details: void 0
5308
- };
5309
- }
5310
5306
  function serializeResult(result) {
5311
5307
  if (typeof result === "string")
5312
5308
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bunny-agent/runner-cli",
3
- "version": "0.9.37-beta.4",
3
+ "version": "0.9.38-beta.1",
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": {
@@ -53,12 +53,12 @@
53
53
  "esbuild": "^0.27.2",
54
54
  "typescript": "^5.3.0",
55
55
  "vitest": "^1.6.1",
56
- "@bunny-agent/runner-claude": "0.6.2",
57
56
  "@bunny-agent/runner-harness": "0.1.1-beta.0",
57
+ "@bunny-agent/runner-claude": "0.6.2",
58
58
  "@bunny-agent/runner-codex": "0.6.2",
59
+ "@bunny-agent/runner-opencode": "0.6.2",
59
60
  "@bunny-agent/runner-gemini": "0.6.2",
60
- "@bunny-agent/runner-pi": "0.6.4-beta.0",
61
- "@bunny-agent/runner-opencode": "0.6.2"
61
+ "@bunny-agent/runner-pi": "0.6.4-beta.0"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "tsc && pnpm bundle",