@owloops/browserbird 1.6.1 → 1.7.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.
Files changed (2) hide show
  1. package/dist/index.mjs +26 -8
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -192,8 +192,8 @@ function unknownSubcommand(subcommand, command, validCommands) {
192
192
  /** @fileoverview ASCII banner displayed on daemon startup and in help text. */
193
193
  const pkg = createRequire(import.meta.url)("../package.json");
194
194
  const buildInfo = [];
195
- buildInfo.push(`commit: ${"ef1bf69c128bbeb16790f862e5173f259610511e".substring(0, 7)}`);
196
- buildInfo.push(`built: 2026-03-19T14:43:58+04:00`);
195
+ buildInfo.push(`commit: ${"ca88ac1b9f08761de2aaafc530e9a590794a626c".substring(0, 7)}`);
196
+ buildInfo.push(`built: 2026-03-19T23:49:23+04:00`);
197
197
  const buildString = buildInfo.length > 0 ? ` (${buildInfo.join(", ")})` : "";
198
198
  const VERSION = `browserbird ${pkg.version}${buildString}`;
199
199
  const BIRD = [
@@ -4071,12 +4071,17 @@ function createHandler(client, getConfig, signal, getTeamId, getChannelNameToId)
4071
4071
  let timedOutMs = 0;
4072
4072
  const activeTasks = /* @__PURE__ */ new Map();
4073
4073
  let toolCount = 0;
4074
+ let toolErrors = 0;
4075
+ let toolSuccesses = 0;
4074
4076
  function isStreamExpired(err) {
4075
4077
  const msg = err instanceof Error ? err.message : String(err);
4076
4078
  return msg.includes("not_in_streaming_state") || msg.includes("streaming");
4077
4079
  }
4078
4080
  async function safeAppend(content) {
4079
- if (streamDead) return;
4081
+ if (streamDead) {
4082
+ if (content.markdown_text) await client.postMessage(channelId, threadTs, content.markdown_text).catch(() => {});
4083
+ return;
4084
+ }
4080
4085
  try {
4081
4086
  await streamer.append(content);
4082
4087
  } catch (err) {
@@ -4087,7 +4092,10 @@ function createHandler(client, getConfig, signal, getTeamId, getChannelNameToId)
4087
4092
  }
4088
4093
  }
4089
4094
  async function safeStop(opts) {
4090
- if (streamDead) return;
4095
+ if (streamDead) {
4096
+ if (opts?.blocks) await client.postMessage(channelId, threadTs, "", { blocks: opts.blocks }).catch(() => {});
4097
+ return;
4098
+ }
4091
4099
  try {
4092
4100
  await streamer.stop(opts);
4093
4101
  } catch (err) {
@@ -4144,13 +4152,23 @@ function createHandler(client, getConfig, signal, getTeamId, getChannelNameToId)
4144
4152
  if (toolName) {
4145
4153
  activeTasks.delete(event.toolCallId);
4146
4154
  const title = toolTaskTitle(toolName);
4147
- await safeAppend({ chunks: [{
4155
+ if (event.isError) toolErrors++;
4156
+ else toolSuccesses++;
4157
+ const chunks = [{
4148
4158
  type: "task_update",
4149
4159
  id: event.toolCallId,
4150
4160
  title,
4151
4161
  status: event.isError ? "error" : "complete",
4152
4162
  ...event.output ? { output: event.output } : {}
4153
- }] });
4163
+ }];
4164
+ if (activeTasks.size === 0) {
4165
+ const label = toolErrors === 0 ? `Completed (${toolCount} ${toolCount === 1 ? "step" : "steps"})` : `${toolSuccesses} passed, ${toolErrors} failed`;
4166
+ chunks.push({
4167
+ type: "plan_update",
4168
+ title: label
4169
+ });
4170
+ }
4171
+ await safeAppend({ chunks });
4154
4172
  }
4155
4173
  break;
4156
4174
  }
@@ -4190,9 +4208,9 @@ function createHandler(client, getConfig, signal, getTeamId, getChannelNameToId)
4190
4208
  await safeAppend({ chunks: staleChunks });
4191
4209
  activeTasks.clear();
4192
4210
  }
4193
- if (toolCount > 0) await safeAppend({ chunks: [{
4211
+ if (toolCount > 0 && (hasError || activeTasks.size > 0)) await safeAppend({ chunks: [{
4194
4212
  type: "plan_update",
4195
- title: hasError ? "Finished with errors" : `Completed (${toolCount} ${toolCount === 1 ? "step" : "steps"})`
4213
+ title: hasError ? "Finished with errors" : `Interrupted (${toolCount} ${toolCount === 1 ? "step" : "steps"})`
4196
4214
  }] });
4197
4215
  if (timedOut) {
4198
4216
  await safeStop({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owloops/browserbird",
3
- "version": "1.6.1",
3
+ "version": "1.7.0",
4
4
  "description": "AI agent orchestrator with a real browser, a cron scheduler, and a web dashboard",
5
5
  "type": "module",
6
6
  "bin": {