@nopeek/agent-bridge 0.7.19 → 0.7.20

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/bot.js CHANGED
@@ -613,7 +613,16 @@ export class BotRunner {
613
613
  }
614
614
  };
615
615
  const published = new TurnPublisher({
616
- stream: () => ch.stream(),
616
+ stream: async () => {
617
+ const s = await ch.stream();
618
+ return {
619
+ append: (chunk) => s.append(chunk),
620
+ replace: (full) => s.replace(full),
621
+ done: (final) => s.done(final),
622
+ fail: (text) => s.fail(text),
623
+ cancel: () => ch.recall(s.messageId),
624
+ };
625
+ },
617
626
  send: async (body) => {
618
627
  await ch.send({ text: body });
619
628
  },
@@ -15,6 +15,8 @@ export interface StreamHandle {
15
15
  replace(full: string): void;
16
16
  done(finalText?: string): Promise<unknown>;
17
17
  fail(text: string): Promise<void>;
18
+ /** Drop the placeholder bubble (NoPeek stream() starts as "…"). */
19
+ cancel(): Promise<void>;
18
20
  }
19
21
  export interface TurnSink {
20
22
  stream(): Promise<StreamHandle>;
@@ -445,7 +445,13 @@ export class TurnPublisher {
445
445
  s.append(extra);
446
446
  const parts = splitBubbles(final, this.maxBubbleChars);
447
447
  if (!parts.length) {
448
- await s.done("…").catch(() => { });
448
+ const keep = stripDumps(final).trim();
449
+ if (keep && isHumanBriefing(keep)) {
450
+ await s.done(keep).catch(() => { });
451
+ this.published += keep;
452
+ return;
453
+ }
454
+ await s.cancel().catch(() => { });
449
455
  return;
450
456
  }
451
457
  const first = parts[0];
@@ -523,7 +529,11 @@ export class TurnPublisher {
523
529
  this.progress = null;
524
530
  const text = this.progressLines.join("\n");
525
531
  this.progressLines = [];
526
- if (s && text)
532
+ if (!s)
533
+ return;
534
+ if (text)
527
535
  await s.done(text).catch(() => { });
536
+ else
537
+ await s.cancel().catch(() => { });
528
538
  }
529
539
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nopeek/agent-bridge",
3
- "version": "0.7.19",
3
+ "version": "0.7.20",
4
4
  "description": "Run your own agents as E2EE NoPeek bots. Pairs with one-time codes (multiple accounts per computer), runs every bot each account owns, and pipes messages to any command or webhook.",
5
5
  "type": "module",
6
6
  "license": "MIT",