@halcyonlabs/app 0.47.0-halcyon.25 → 0.47.0-halcyon.26

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.
@@ -1,9 +1,13 @@
1
1
  Third-party notices for @halcyonlabs/app
2
2
 
3
3
  This package is built from a fork of bb (https://github.com/get-bb/bb). bb's code is
4
- used under the MIT License, whose notice follows. The package as a whole, including
5
- the Orbit, Agent Inbox and Library plugins in server/dist/builtin-plugins/, is under
6
- the terms in LICENSE.
4
+ used under the MIT License, whose notice follows. The Notify Feed plugin in
5
+ server/dist/builtin-plugins/notify-feed/ is based on Notify Feed
6
+ (https://github.com/Sargares22/bb-plugin-notify-feed), used under the MIT License,
7
+ whose notice follows bb's; that plugin's folder carries the notice too (dist/LICENSE).
8
+ The package as a whole, including the Orbit, Agent Inbox, Library and Notify Feed
9
+ plugins in server/dist/builtin-plugins/, is under the terms in LICENSE; the code these
10
+ notices cover stays available under them, as LICENSE section 6 says.
7
11
 
8
12
  Other open-source components bundled in this package keep their own licenses, as
9
13
  their notices in the bundled files say.
@@ -33,3 +37,29 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33
37
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34
38
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
35
39
  SOFTWARE.
40
+
41
+ -------------------------------------------------------------------------------
42
+ Notify Feed (https://github.com/Sargares22/bb-plugin-notify-feed)
43
+ -------------------------------------------------------------------------------
44
+
45
+ MIT License
46
+
47
+ Copyright (c) 2026 Sargares22
48
+
49
+ Permission is hereby granted, free of charge, to any person obtaining a copy
50
+ of this software and associated documentation files (the "Software"), to deal
51
+ in the Software without restriction, including without limitation the rights
52
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
53
+ copies of the Software, and to permit persons to whom the Software is
54
+ furnished to do so, subject to the following conditions:
55
+
56
+ The above copyright notice and this permission notice shall be included in all
57
+ copies or substantial portions of the Software.
58
+
59
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
60
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
61
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
62
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
63
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
64
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
65
+ SOFTWARE.
package/dist/index.d.ts CHANGED
@@ -7432,8 +7432,8 @@ declare const hostDaemonCommandRegistry: {
7432
7432
  skillFilePath: z$1.ZodString;
7433
7433
  }, z$1.core.$strict>], "kind">>;
7434
7434
  instructionMode: z$1.ZodEnum<{
7435
- append: "append";
7436
7435
  replace: "replace";
7436
+ append: "append";
7437
7437
  }>;
7438
7438
  type: z$1.ZodLiteral<"thread.rewind.prepare">;
7439
7439
  leaseId: z$1.ZodString;
@@ -7581,8 +7581,8 @@ declare const hostDaemonCommandRegistry: {
7581
7581
  skillFilePath: z$1.ZodString;
7582
7582
  }, z$1.core.$strict>], "kind">>;
7583
7583
  instructionMode: z$1.ZodEnum<{
7584
- append: "append";
7585
7584
  replace: "replace";
7585
+ append: "append";
7586
7586
  }>;
7587
7587
  type: z$1.ZodLiteral<"thread.start">;
7588
7588
  requestId: z$1.ZodString;
@@ -8045,8 +8045,8 @@ declare const hostDaemonCommandRegistry: {
8045
8045
  envPassthrough: z$1.ZodArray<z$1.ZodString>;
8046
8046
  }, z$1.core.$strict>;
8047
8047
  instructionMode: z$1.ZodEnum<{
8048
- append: "append";
8049
8048
  replace: "replace";
8049
+ append: "append";
8050
8050
  }>;
8051
8051
  projectId: z$1.ZodString;
8052
8052
  providerId: z$1.ZodString;
@@ -8261,8 +8261,8 @@ declare const hostDaemonCommandRegistry: {
8261
8261
  envPassthrough: z$1.ZodArray<z$1.ZodString>;
8262
8262
  }, z$1.core.$strict>;
8263
8263
  instructionMode: z$1.ZodEnum<{
8264
- append: "append";
8265
8264
  replace: "replace";
8265
+ append: "append";
8266
8266
  }>;
8267
8267
  projectId: z$1.ZodString;
8268
8268
  providerId: z$1.ZodString;
@@ -9168,9 +9168,9 @@ declare const hostDaemonCommandRegistry: {
9168
9168
  base64: "base64";
9169
9169
  utf8: "utf8";
9170
9170
  }>;
9171
- mimeType: z$1.ZodOptional<z$1.ZodString>;
9172
- sizeBytes: z$1.ZodNumber;
9173
9171
  sha256: z$1.ZodString;
9172
+ sizeBytes: z$1.ZodNumber;
9173
+ mimeType: z$1.ZodOptional<z$1.ZodString>;
9174
9174
  modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;
9175
9175
  notModified: z$1.ZodLiteral<true>;
9176
9176
  }, z$1.core.$strip>]>, "onlineRpc", true>;
@@ -9435,10 +9435,10 @@ declare const hostDaemonCommandRegistry: {
9435
9435
  health: z$1.ZodObject<{
9436
9436
  status: z$1.ZodEnum<{
9437
9437
  unknown: "unknown";
9438
+ ready: "ready";
9438
9439
  not_installed: "not_installed";
9439
9440
  unauthenticated: "unauthenticated";
9440
9441
  expired: "expired";
9441
- ready: "ready";
9442
9442
  unsupported_version: "unsupported_version";
9443
9443
  }>;
9444
9444
  statusMessage: z$1.ZodNullable<z$1.ZodString>;
@@ -9486,9 +9486,9 @@ declare const hostDaemonCommandRegistry: {
9486
9486
  executablePath: z$1.ZodNullable<z$1.ZodString>;
9487
9487
  installed: z$1.ZodBoolean;
9488
9488
  installSource: z$1.ZodEnum<{
9489
- external: "external";
9490
9489
  notInstalled: "notInstalled";
9491
9490
  npmGlobal: "npmGlobal";
9491
+ external: "external";
9492
9492
  }>;
9493
9493
  currentVersion: z$1.ZodNullable<z$1.ZodString>;
9494
9494
  latestVersion: z$1.ZodNullable<z$1.ZodString>;
@@ -9934,8 +9934,8 @@ declare const hostDaemonCommandRegistry: {
9934
9934
  message: z$1.ZodNullable<z$1.ZodString>;
9935
9935
  state: z$1.ZodNullable<z$1.ZodEnum<{
9936
9936
  pending: "pending";
9937
- ready: "ready";
9938
9937
  activating: "activating";
9938
+ ready: "ready";
9939
9939
  }>>;
9940
9940
  }, z$1.core.$strict>, "onlineRpc", true>;
9941
9941
  "server_move.prepare": HostDaemonCommandDescriptor<"server_move.prepare", z$1.ZodObject<{
@@ -10037,9 +10037,9 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodString, z$1.
10037
10037
  executablePath: z$1.ZodNullable<z$1.ZodString>;
10038
10038
  installed: z$1.ZodBoolean;
10039
10039
  installSource: z$1.ZodEnum<{
10040
- external: "external";
10041
10040
  notInstalled: "notInstalled";
10042
10041
  npmGlobal: "npmGlobal";
10042
+ external: "external";
10043
10043
  }>;
10044
10044
  currentVersion: z$1.ZodNullable<z$1.ZodString>;
10045
10045
  latestVersion: z$1.ZodNullable<z$1.ZodString>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halcyonlabs/app",
3
- "version": "0.47.0-halcyon.25",
3
+ "version": "0.47.0-halcyon.26",
4
4
  "description": "bb app launcher for npx",
5
5
  "keywords": [
6
6
  "bb",
@@ -127,6 +127,7 @@
127
127
  "keep-awake",
128
128
  "library",
129
129
  "navigation",
130
+ "notify-feed",
130
131
  "orbit",
131
132
  "pdf-preview",
132
133
  "provider-acp",
@@ -912,6 +913,26 @@
912
913
  "category": "file-viewers-and-editors",
913
914
  "screenshots": []
914
915
  },
916
+ {
917
+ "id": "notify-feed",
918
+ "displayName": "Notify Feed",
919
+ "description": "Keep your conversation from drowning in child-thread reports when a thread delegates work. Background messages and completion notices move to a Notifications tab beside the feed.",
920
+ "icon": {
921
+ "url": "./notify-feed/icon.svg"
922
+ },
923
+ "tags": [],
924
+ "author": {
925
+ "name": "BB"
926
+ },
927
+ "source": {
928
+ "bundled": {
929
+ "plugin": "notify-feed"
930
+ }
931
+ },
932
+ "category": "notifications",
933
+ "screenshots": [],
934
+ "overview": "## What you get\n\nWhen a root thread assigns tasks to child threads, the conversation fills with handoffs and completion reports. Notify Feed hides those rows from the main chat and moves them into a Notifications panel on the right. The conversation keeps only your messages and direct agent replies. Agents continue to receive all background traffic normally.\n\n- Messages sent by child threads, BB system notices (completed, failed, interrupted, needs attention, batch digests), and external tool messages starting with `[notify:Name]` leave the main feed.\n- A button in the thread header shows total notifications or the count of new entries since you last opened the tab.\n- Cards are grouped by day with filters for All, Done, Attention, and Info / replies. Clicking a card expands its full text.\n- A thread message and its completion notice within 60 seconds combine into a single card.\n- A switch changes the tab to a list of sending threads with status indicators. Open a thread to read the complete conversation in time order.\n- Reply directly to child threads from the panel without switching conversations.\n- An optional toggle sends a note to the root agent when you reply to a child thread.\n\n## Configuration\n\nSettings are available under Settings -> Plugins -> Notify Feed, or via `bb plugin config notify-feed set <key> <value>`:\n\n- `language` (`en`): interface language (`en` or `ru`). Russian translates system notices in the tab.\n- `marker` (`\"\"`): reply prefix such as `[bg]`. When set, the plugin instructs agents to prefix short background replies with this marker, moving them to the tab. Empty leaves agent prompts untouched.\n- `hide` (`true`): hides notification rows in the main feed. Set to `false` to restore the stock feed while keeping the tab active.\n- `threads` (`[]`): JSON array of thread IDs where the plugin runs. Empty enables the plugin everywhere.\n\n## How it works\n\nThe plugin runs entirely on your local machine using BB's internal APIs. It requires no external network access, cloud accounts, or third-party servers.\n\nThe server caches thread metadata locally, checks whether child threads are archived, and tracks the last viewed timestamp per thread. When replying to a child thread, the plugin verifies whether the message arrived before alerting you to an error, avoiding accidental duplicate turns.\n\n## Limitations\n\n- Hiding feed rows and showing the thread header button rely on BB experimental slots (`experimental_appOverlay` and `experimental_threadHeaderAction`). If these slots are absent, the Notifications tab remains accessible from the right panel menu.\n- Feed polling runs every 8 seconds. New messages take up to 8 seconds to hide.\n- If two consecutive polls fail, the plugin temporarily unhides rows to prevent stale filtering.\n- Messages sent from the tab have a 20,000 character limit.\n- Sending a note to the host agent starts that agent's turn, as BB cannot deliver messages without starting a turn.\n- In the tab composer, pressing Enter submits the message.\n- At most 20 history pages are read per thread.\n"
935
+ },
915
936
  {
916
937
  "id": "environment-modal-sandbox",
917
938
  "displayName": "Modal Sandbox [Experimental]",
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sargares22
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-animation-delay:0s;--tw-animation-direction:normal;--tw-animation-duration:initial;--tw-animation-fill-mode:none;--tw-animation-iteration-count:1;--tw-enter-blur:0;--tw-enter-opacity:1;--tw-enter-rotate:0;--tw-enter-scale:1;--tw-enter-translate-x:0;--tw-enter-translate-y:0;--tw-exit-blur:0;--tw-exit-opacity:1;--tw-exit-rotate:0;--tw-exit-scale:1;--tw-exit-translate-x:0;--tw-exit-translate-y:0;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial}}}@layer theme;@layer utilities{:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .invisible,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).invisible{visibility:hidden}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .visible,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).visible{visibility:visible}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .fixed,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).fixed{position:fixed}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .hidden,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).hidden{display:none}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .shrink,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).shrink{flex-shrink:1}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .filter,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .\[notify\:CI\],:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).\[notify\:CI\]{notify:CI}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .\[notify\:Name\],:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).\[notify\:Name\]{notify:Name}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .\[notify\:You\],:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).\[notify\:You\]{notify:You}:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])) .running,:where([data-bb-plugin=notify-feed],[data-bb-plugin-root]:not([data-bb-plugin])).running{animation-play-state:running}}@property --tw-animation-delay{syntax:"*";inherits:false;initial-value:0s}@property --tw-animation-direction{syntax:"*";inherits:false;initial-value:normal}@property --tw-animation-duration{syntax:"*";inherits:false}@property --tw-animation-fill-mode{syntax:"*";inherits:false;initial-value:none}@property --tw-animation-iteration-count{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-enter-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-enter-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-blur{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-opacity{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-rotate{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-scale{syntax:"*";inherits:false;initial-value:1}@property --tw-exit-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-exit-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}.nf-trigger{box-sizing:border-box;border:1px solid var(--border);block-size:28px;color:var(--foreground);font:inherit;white-space:nowrap;cursor:pointer;background:0 0;border-radius:6px;padding:0 8px;font-size:12px}.nf-panel{min-inline-size:0;color:var(--foreground);overflow-wrap:break-word;font-size:13px;container-type:inline-size}.nf-panel :is(button,[role=button],textarea,input):focus-visible,.nf-trigger:focus-visible{outline-offset:2px;outline:2px solid}.nf-top{border-block-end:1px solid var(--border-seam);flex-wrap:wrap;align-items:start;gap:8px 12px;padding-block-end:14px;display:flex}.nf-top nav b,.nf-day small,.nf-reply-tag,.nf-expand,.nf-count{color:var(--subtle-foreground);font-variant-numeric:tabular-nums;font-weight:400}.nf-top nav{flex-wrap:wrap;gap:6px;min-inline-size:0;display:flex}.nf-top button{border:1px solid var(--border);background:var(--surface-raised);color:var(--foreground);font:inherit;white-space:nowrap;cursor:pointer;padding:3px 10px;font-size:12px;line-height:18px}.nf-top nav button{border-radius:999px}.nf-top button[aria-pressed=true]{border-color:var(--surface-selected-border);background:var(--surface-selected);font-weight:500}.nf-views{margin-inline-start:auto;display:flex}.nf-views button:first-child{border-start-start-radius:6px;border-end-start-radius:6px}.nf-views button:last-child{border-start-end-radius:6px;border-end-end-radius:6px;margin-inline-start:-1px}.nf-views button[aria-pressed=true]{position:relative}.nf-day{margin-block-start:18px}.nf-day h2{color:var(--muted-foreground);align-items:center;gap:8px;margin:0;margin-block-end:10px;padding-inline-start:30px;font-size:12px;font-weight:600;display:flex;position:relative}.nf-day h2:before{background:var(--border);content:"";border-radius:50%;block-size:9px;inline-size:9px;position:absolute;inset-inline-start:6px}.nf-day h2:after{background:var(--border-seam);content:"";flex:1;block-size:1px}.nf-day small{font-size:11px}.nf-stream{flex-direction:column;gap:10px;padding-inline-start:30px;display:flex;position:relative}.nf-stream:before{background:var(--border-seam);content:"";inline-size:1px;position:absolute;inset-block:0;inset-inline-start:10px}.nf-card{border:1px solid var(--border-seam);background:var(--surface-raised);border-radius:8px;min-inline-size:0;position:relative}.nf-card,.nf-trow,.nf-msg{--nf-tone:var(--muted-foreground)}.nf-card[data-open]{border-color:var(--surface-selected-border);background:var(--surface-recessed)}.nf-ok{--nf-tone:var(--success)}.nf-warn{--nf-tone:var(--warning)}.nf-bad{--nf-tone:var(--destructive-text)}.nf-marker{border:1.5px solid var(--nf-tone);background:var(--sidebar);block-size:21px;inline-size:21px;color:var(--nf-tone);border-radius:50%;place-items:center;display:grid;position:absolute;inset-block-start:9px;inset-inline-start:-31px}.nf-marker svg{fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;block-size:12px;inline-size:12px}.nf-sum{cursor:pointer;border-radius:7px;padding:9px 12px}.nf-head{flex-wrap:wrap;align-items:center;gap:2px 8px;min-inline-size:0;line-height:20px;display:flex}.nf-head time,.nf-kind,.nf-reply-tag,.nf-expand{white-space:nowrap;flex:none}.nf-new{background:var(--foreground);border-radius:50%;flex:none;block-size:6px;inline-size:6px;margin-inline-end:-2px}.nf-head time{font-variant-numeric:tabular-nums;font-size:12px;font-weight:500}.nf-kind{background:color-mix(in oklch,var(--nf-tone) 12%,transparent);color:var(--nf-tone);border-radius:3px;padding:0 5px;font-size:11px;font-weight:600;line-height:16px}.nf-source{box-sizing:border-box;border:1px solid var(--border);background:var(--background);min-inline-size:0;max-inline-size:max-content;color:var(--muted-foreground);font:inherit;text-align:start;text-overflow:ellipsis;white-space:nowrap;border-radius:12px;flex:14ch;padding:1px 7px;font-size:12px;line-height:18px;display:block;overflow:hidden}.nf-source *{white-space:nowrap;display:inline}.nf-source:empty:before{content:attr(title)}button.nf-source{cursor:pointer}.nf-tail{flex:none;align-items:center;gap:8px;margin-inline-start:auto;display:flex}.nf-reply-tag{background:var(--surface-recessed);border-radius:3px;padding:1px 5px;font-size:11px}.nf-expand{font-size:11px}.nf-expand:after{content:"›";margin-inline-start:3px;display:inline-block}.nf-card[data-open] .nf-expand:after{transform:rotate(90deg)}.nf-snippet{max-block-size:54px;color:var(--muted-foreground);-webkit-line-clamp:3;-webkit-box-orient:vertical;margin-block-start:5px;font-size:12px;line-height:18px;display:-webkit-box;overflow:hidden}.nf-probe{opacity:0;pointer-events:none;block-size:1px;position:absolute;inset-inline:0;overflow:clip}.nf-body{border-block-start:1px solid var(--border-seam);min-inline-size:0;padding:8px 14px 14px}.nf-body pre,.nf-msg pre{white-space:pre-wrap;max-inline-size:100%}.nf-body table,.nf-body :has(>table),.nf-msg table,.nf-msg :has(>table){table-layout:fixed;inline-size:100%}.nf-reply{border:1px solid var(--border);background:var(--background);border-radius:6px;margin-block-start:12px;padding:8px 12px}.nf-reply>b{color:var(--muted-foreground);margin-block-end:5px;font-size:11px;font-weight:600;display:block}.nf-empty{color:var(--muted-foreground);margin-block-start:14px;font-size:13px}.nf-threads{flex-direction:column;gap:8px;margin-block-start:14px;display:flex}.nf-trow{border:1px solid var(--border-seam);background:var(--surface-raised);cursor:pointer;border-radius:8px;align-items:center;gap:10px;min-inline-size:0;padding:10px 12px;display:flex;position:relative}.nf-dot{background:var(--nf-tone);border-radius:50%;flex:none;block-size:9px;inline-size:9px}.nf-trow-main{flex:1 1 0;min-inline-size:0}.nf-trow-main>b{-webkit-line-clamp:2;-webkit-box-orient:vertical;font-weight:600;line-height:20px;display:-webkit-box;overflow:hidden}.nf-trow-last{min-inline-size:0;color:var(--subtle-foreground);flex-wrap:wrap;align-items:baseline;gap:0 6px;font-size:12px;line-height:18px;display:flex}.nf-trow-last>time,.nf-trow-last>span{white-space:nowrap;font-variant-numeric:tabular-nums;flex:none}.nf-trow-last>span{color:var(--nf-tone)}.nf-trow-last .nf-snippet{text-overflow:ellipsis;white-space:nowrap;flex:16ch;max-block-size:none;min-inline-size:0;margin:0;display:block}.nf-count{flex:none;font-size:12px}.nf-chat{flex-direction:column;block-size:100%;display:flex}.nf-bar{border-block-end:1px solid var(--border-seam);flex:none;align-items:center;gap:10px;padding-block-end:10px;display:flex}.nf-bar button{border:1px solid var(--border);background:var(--surface-raised);color:var(--foreground);font:inherit;white-space:nowrap;cursor:pointer;border-radius:6px;flex:none;padding:3px 10px;font-size:12px;line-height:18px;position:relative}.nf-bar button:after{content:"";position:absolute;inset:min(0px,50% - 22px)}.nf-bar b{flex:1 1 0;min-inline-size:0;font-weight:600}.nf-scroll{overscroll-behavior:contain;scrollbar-gutter:stable;flex-direction:column-reverse;flex:auto;min-block-size:0;display:flex;overflow-y:auto}.nf-talk{flex-direction:column;gap:9px;margin-block-end:auto;padding-block:12px;display:flex}.nf-msg{box-sizing:border-box;border:1px solid var(--border-seam);background:var(--surface-raised);border-radius:10px;align-self:flex-start;min-inline-size:0;max-inline-size:88%;padding:8px 11px}.nf-msg[data-who=agent],.nf-msg[data-who=you]{border-color:var(--border);background:var(--background);align-self:flex-end}.nf-msg[data-who=you]{border-color:color-mix(in oklch,var(--success) 40%,var(--border));background:color-mix(in oklch,var(--success) 12%,var(--background))}.nf-msg[data-who=you] p{white-space:pre-line}.nf-msg[data-who=state]{border-color:color-mix(in oklch,var(--nf-tone) 45%,transparent);align-self:stretch;max-inline-size:100%}.nf-msg-head{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0 10px;margin-block-end:3px;font-size:11px;line-height:16px;display:flex}.nf-msg-head b{color:var(--muted-foreground);font-weight:600}.nf-msg[data-who=state] .nf-msg-head b{color:var(--nf-tone)}.nf-msg-head time{color:var(--subtle-foreground);font-variant-numeric:tabular-nums;white-space:nowrap}.nf-foot{border-block-start:1px solid var(--border-seam);flex:none;padding-block-start:10px}.nf-send{flex-wrap:wrap;align-items:end;gap:8px;display:flex}.nf-send textarea{box-sizing:border-box;border:1px solid var(--border);background:var(--background);min-block-size:max(40px,2lh);max-block-size:12lh;min-inline-size:50%;color:var(--foreground);font:inherit;resize:none;field-sizing:content;border-radius:8px;flex:999 1 0;padding:9px 11px;line-height:20px}.nf-send textarea[aria-invalid]{border-color:var(--destructive-text)}.nf-send button{background:var(--foreground);min-block-size:40px;color:var(--background);font:inherit;white-space:nowrap;cursor:pointer;border:0;border-radius:8px;flex:1 0 auto;padding-inline:14px;font-weight:600}.nf-send button:focus-visible{outline-color:var(--foreground)}.nf-send button:disabled{opacity:.5;cursor:default}.nf-error{color:var(--destructive-text);margin:0;margin-block-start:6px;font-size:12px;line-height:18px}.nf-note{cursor:pointer;align-items:center;gap:8px;min-block-size:40px;inline-size:fit-content;max-inline-size:100%;font-size:12px;display:flex}.nf-note input{block-size:1.25em;inline-size:1.25em;accent-color:var(--foreground);flex:none;margin:0}.nf-hint{color:var(--subtle-foreground);margin:0;font-size:12px;line-height:18px}.nf-scroll+.nf-hint{flex:none;padding-block:8px}.nf-top button:active,.nf-bar button:active,.nf-send button:enabled:active,.nf-trigger:active{transform:scale(.97)}.nf-sum:active,.nf-trow:active{background:var(--state-hover)}button.nf-source:active{color:var(--foreground)}@media (hover:hover) and (pointer:fine){.nf-trigger:hover,.nf-top button:not([aria-pressed=true]):hover,.nf-bar button:hover,.nf-sum:hover,.nf-trow:hover{background:var(--state-hover)}.nf-trow:hover{border-color:var(--surface-selected-border)}button.nf-source:hover{color:var(--foreground)}}@media (pointer:coarse){.nf-top button,.nf-bar button{min-block-size:40px}.nf-send textarea{font-size:16px}}@media (prefers-reduced-motion:no-preference){.nf-trigger,.nf-top button,.nf-bar button,.nf-send button{transition:transform .16s ease-out}}
@@ -0,0 +1,7 @@
1
+ var K=globalThis.__bbPluginRuntime;if(K==null||K.pluginSdkApp==null)throw new Error('Cannot load "@get-bb/plugin-sdk/app": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var A=K.pluginSdkApp,Qe="default"in A?A.default:A,{Markdown:z,ThreadChat:We,ThreadTitle:de,UrlLink:Je,definePluginApp:pe,experimental_BranchPicker:Ze,experimental_ComposerRoot:et,experimental_DetailRow:tt,experimental_Diff:nt,experimental_FailedVoiceRecordings:rt,experimental_FileLink:it,experimental_Icon:ot,experimental_ImageLightbox:at,experimental_InfoList:st,experimental_InfoListRow:lt,experimental_InfoSection:dt,experimental_NewThreadComposer:pt,experimental_PermissionModePicker:ct,experimental_PluginIcon:ut,experimental_PluginRpcCallError:ft,experimental_PromptMentionIcon:mt,experimental_ProviderIcon:gt,experimental_ProviderModelPicker:bt,experimental_ShortcutHint:ht,experimental_SidebarNavigationIcon:xt,experimental_SourceCode:vt,experimental_THREAD_ACTION_GROUPS:wt,experimental_THREAD_CONTEXT_SEGMENT_GROUPS:yt,experimental_THREAD_INFO_ROW_GROUPS:kt,experimental_THREAD_INFO_SECTION_GROUPS:St,experimental_ThreadActionsContextMenu:Tt,experimental_ThreadActionsMenu:_t,experimental_ThreadStatusGlyph:Nt,experimental_ThreadTitleText:zt,experimental_VoiceInputButton:Ct,experimental_VoiceInputTextarea:Rt,experimental_VoiceRecordingBar:Mt,experimental_copyToClipboard:Lt,experimental_describePromptMention:It,experimental_promptMentionClipboardAttributes:Et,experimental_readPromptMentionClipboard:Dt,experimental_saveFile:$t,experimental_useAppPanel:Pt,experimental_useArchiveEnvironmentThreads:Ft,experimental_useBranches:Ot,experimental_useCheckoutState:At,experimental_useCodeTheme:Bt,experimental_useComposerCommandSearch:Ht,experimental_useComposerContributions:Ut,experimental_useComposerMentionSearch:Gt,experimental_useComposerRenderer:Vt,experimental_useExperiment:jt,experimental_useFixedTabTarget:Xt,experimental_usePluginId:Yt,experimental_useProviders:Kt,experimental_useQuestionFormHost:qt,experimental_useRpcKeyedQuery:Qt,experimental_useRpcMutation:Wt,experimental_useRpcQuery:Jt,experimental_useRpcRefresh:Zt,experimental_useSidebar:en,experimental_useSidebarNavigation:tn,experimental_useSidebarNavigationSplit:nn,experimental_useSidebarThreadActions:rn,experimental_useSidebarThreadSplit:on,experimental_useSidebarThreads:an,experimental_useThreadActionRegistrations:sn,experimental_useThreadActions:ln,experimental_useThreadTitleDisplayText:dn,useBbContext:ce,useBbNavigate:B,useComposer:pn,useComposerView:cn,useComposers:un,useEnvironmentProviders:fn,useRealtime:mn,useRealtimeConnectionState:gn,useRpc:ue,useSdk:fe,useSettings:bn,useSidebarSplitLayout:hn,useSidebarThreadDraft:xn,useSidebarThreadDraftIds:vn,useSidebarThreadRowStatus:wn,useSidebarThreadRowStatuses:yn,useSidebarThreadShortcut:kn,experimental_useSidebarThreadPullRequest:Sn}=A;var q=globalThis.__bbPluginRuntime;if(q==null||q.react==null)throw new Error('Cannot load "react": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var H=q.react,_n="default"in H?H.default:H,{Activity:Nn,Children:zn,Component:Cn,Fragment:Rn,Profiler:Mn,PureComponent:Ln,StrictMode:In,Suspense:En,act:Dn,cache:$n,cacheSignal:Pn,captureOwnerStack:Fn,cloneElement:On,createContext:me,createElement:An,createRef:Bn,forwardRef:Hn,isValidElement:Un,lazy:Gn,memo:Vn,startTransition:jn,unstable_useCacheRefresh:Xn,use:Yn,useActionState:Kn,useCallback:ge,useContext:be,useDebugValue:qn,useDeferredValue:Qn,useEffect:C,useEffectEvent:Wn,useId:Jn,useImperativeHandle:Zn,useInsertionEffect:er,useLayoutEffect:tr,useMemo:Q,useOptimistic:nr,useReducer:rr,useRef:$,useState:v,useSyncExternalStore:W,useTransition:ir,version:or}=H;var J=e=>[...new Map(e.map(t=>[t.id,t])).values()].map((t,n)=>({message:t,index:n})).sort((t,n)=>t.message.time-n.message.time||t.index-n.index).slice(-300).map(({message:t})=>t),R={en:{locale:"en-US",title:"Notifications",button:e=>`Notifications: ${e}`,fresh:e=>`${e} new`,kinds:{done:"Done",failed:"Failed",interrupted:"Interrupted",attention:"Needs reply",digest:"Digest",message:"Message",reply:"Agent reply",system:"System"},filters:{all:"All",done:"Done",attention:"Attention",info:"Info / replies"},filtersLabel:"Notification filters",today:"Today",yesterday:"Yesterday",isNew:"New",hasReply:"Has an agent reply",replyTag:"\u21A9 +reply",more:"More",less:"Less",threadMessage:"Thread message",agentReply:"Agent reply",empty:"No notifications.",emptyFilter:"No entries of this kind.",system:"System",agent:"Agent",views:{time:"By time",threads:"By thread"},viewsLabel:"View",entries:e=>`Entries: ${e}`,emptyThreads:"No threads in this state.",back:"Threads",thread:"Thread",you:"You",outFailed:"The agent's own messages to this thread could not be read, so some may be missing here.",replyLabel:"Message to the thread",replyPlaceholder:"Write to this thread\u2026",send:"Send",sending:"Sending\u2026",sendFailed:e=>`Not sent: ${e}. Your text is kept, try again.`,tooLong:(e,t)=>`The message is ${e.toLocaleString("en-US")} characters long; the limit is ${t.toLocaleString("en-US")}. Shorten it to send.`,maybeSent:"It may have been sent: the connection dropped before BB answered. Check the conversation before you send it again.",noteUnknown:"The message was sent. The note to the agent may not have been: the connection dropped before BB answered.",noteLabel:"Tell the agent",noteHint:"The agent gets a note in its Notifications tab. The note starts its turn.",noteFailed:e=>`The message was sent, but the note to the agent was not: ${e}.`,noteText:(e,t)=>`wrote to thread ${e}: ${t}`,closed:{archived:"This thread is archived, so you cannot write to it from here.",gone:"This thread is unavailable: it was deleted or cannot be read. You cannot write to it.",none:"These entries have no sending thread, so there is nobody to reply to."},instruction:e=>`Start a short housekeeping reply to a message from another thread or from the system with ${e}; a result meant for the user goes without the marker.`,systemTexts:[[/^\s*failed\.?(?=\s|$)/i,"Failed."],[/^\s*was interrupted because\s+/i,"Interrupted: "],[/^\s*was interrupted\.?(?=\s|$)/i,"Interrupted."]],bareCompleted:"Completed."},ru:{locale:"ru-RU",title:"\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F",button:e=>`\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F: ${e}`,fresh:e=>`${e} ${e%10===1&&e%100!==11?"\u043D\u043E\u0432\u043E\u0435":"\u043D\u043E\u0432\u044B\u0445"}`,kinds:{done:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B",failed:"\u0423\u043F\u0430\u043B",interrupted:"\u041F\u0440\u0435\u0440\u0432\u0430\u043D",attention:"\u041D\u0443\u0436\u0435\u043D \u043E\u0442\u0432\u0435\u0442",digest:"\u0421\u0432\u043E\u0434\u043A\u0430",message:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",reply:"\u041E\u0442\u0432\u0435\u0442 \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",system:"\u0421\u0438\u0441\u0442\u0435\u043C\u0430"},filters:{all:"\u0412\u0441\u0435",done:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B",attention:"\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435",info:"\u0418\u043D\u0444\u043E / \u043E\u0442\u0432\u0435\u0442\u044B"},filtersLabel:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439",today:"\u0421\u0435\u0433\u043E\u0434\u043D\u044F",yesterday:"\u0412\u0447\u0435\u0440\u0430",isNew:"\u041D\u043E\u0432\u043E\u0435",hasReply:"\u0421 \u043E\u0442\u0432\u0435\u0442\u043E\u043C \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",replyTag:"\u21A9 +\u043E\u0442\u0432\u0435\u0442",more:"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435",less:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",threadMessage:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0442\u0440\u0435\u0434\u0430",agentReply:"\u041E\u0442\u0432\u0435\u0442 \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",empty:"\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u043D\u0435\u0442.",emptyFilter:"\u041D\u0435\u0442 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u044D\u0442\u043E\u0433\u043E \u0432\u0438\u0434\u0430.",system:"\u0421\u0438\u0441\u0442\u0435\u043C\u0430",agent:"\u0412\u0435\u0434\u0443\u0449\u0438\u0439",views:{time:"\u041F\u043E \u0432\u0440\u0435\u043C\u0435\u043D\u0438",threads:"\u041F\u043E \u0442\u0440\u0435\u0434\u0430\u043C"},viewsLabel:"\u0412\u0438\u0434",entries:e=>`\u0417\u0430\u043F\u0438\u0441\u0435\u0439: ${e}`,emptyThreads:"\u041D\u0435\u0442 \u0442\u0440\u0435\u0434\u043E\u0432 \u0441 \u0442\u0430\u043A\u0438\u043C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u043C.",back:"\u0422\u0440\u0435\u0434\u044B",thread:"\u0422\u0440\u0435\u0434",you:"\u0412\u044B",outFailed:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E \u044D\u0442\u043E\u043C\u0443 \u0442\u0440\u0435\u0434\u0443 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0437\u0434\u0435\u0441\u044C \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435 \u0432\u0441\u0435.",replyLabel:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0442\u0440\u0435\u0434\u0443",replyPlaceholder:"\u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u044D\u0442\u043E\u043C\u0443 \u0442\u0440\u0435\u0434\u0443\u2026",send:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",sending:"\u041E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u2026",sendFailed:e=>`\u041D\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E: ${e}. \u0422\u0435\u043A\u0441\u0442 \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.`,tooLong:(e,t)=>`\u0412 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0438 ${e.toLocaleString("ru-RU")} \u0437\u043D\u0430\u043A\u043E\u0432, \u043F\u0440\u0435\u0434\u0435\u043B \u2014 ${t.toLocaleString("ru-RU")}. \u0421\u043E\u043A\u0440\u0430\u0442\u0438\u0442\u0435 \u0435\u0433\u043E, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C.`,maybeSent:"\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E: \u0441\u0432\u044F\u0437\u044C \u043E\u0431\u043E\u0440\u0432\u0430\u043B\u0430\u0441\u044C \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u0442\u0432\u0435\u0442\u0430 BB. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u0435\u0440\u0435\u043F\u0438\u0441\u043A\u0443, \u043F\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043C \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0442\u044C.",noteUnknown:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E. \u0417\u0430\u043C\u0435\u0442\u043A\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435 \u0443\u0448\u043B\u0430: \u0441\u0432\u044F\u0437\u044C \u043E\u0431\u043E\u0440\u0432\u0430\u043B\u0430\u0441\u044C \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u0442\u0432\u0435\u0442\u0430 BB.",noteLabel:"\u0421\u043E\u043E\u0431\u0449\u0438\u0442\u044C \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443",noteHint:"\u0412\u0435\u0434\u0443\u0449\u0438\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0437\u0430\u043C\u0435\u0442\u043A\u0443 \u0432\u043E \u0432\u043A\u043B\u0430\u0434\u043A\u0443 \xAB\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F\xBB. \u0417\u0430\u043C\u0435\u0442\u043A\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0435\u0433\u043E \u0445\u043E\u0434.",noteFailed:e=>`\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E, \u043D\u043E \u0437\u0430\u043C\u0435\u0442\u043A\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443 \u043D\u0435 \u0443\u0448\u043B\u0430: ${e}.`,noteText:(e,t)=>`\u043D\u0430\u043F\u0438\u0441\u0430\u043B \u0442\u0440\u0435\u0434\u0443 ${e}: ${t}`,closed:{archived:"\u0422\u0440\u0435\u0434 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435, \u043D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0435\u043C\u0443 \u043E\u0442\u0441\u044E\u0434\u0430 \u043D\u0435\u043B\u044C\u0437\u044F.",gone:"\u0422\u0440\u0435\u0434 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D: \u043E\u043D \u0443\u0434\u0430\u043B\u0451\u043D \u0438\u043B\u0438 \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F. \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0435\u043C\u0443 \u043D\u0435\u043B\u044C\u0437\u044F.",none:"\u0423 \u044D\u0442\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u043D\u0435\u0442 \u0442\u0440\u0435\u0434\u0430-\u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u0435\u043B\u044F, \u043E\u0442\u0432\u0435\u0447\u0430\u0442\u044C \u043D\u0435\u043A\u043E\u043C\u0443."},instruction:e=>`\u041A\u043E\u0440\u043E\u0442\u043A\u0438\u0439 \u0441\u043B\u0443\u0436\u0435\u0431\u043D\u044B\u0439 \u043E\u0442\u0432\u0435\u0442 \u043D\u0430 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0434\u0440\u0443\u0433\u043E\u0433\u043E \u0442\u0440\u0435\u0434\u0430 \u0438\u043B\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043D\u0430\u0447\u0438\u043D\u0430\u0439 \u0441 ${e}; \u0438\u0442\u043E\u0433 \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u2014 \u0431\u0435\u0437 \u043C\u0435\u0442\u043A\u0438.`,systemTexts:[[/^\s*failed\.?(?=\s|$)/i,"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0441\u044F \u0441 \u043E\u0448\u0438\u0431\u043A\u043E\u0439."],[/was interrupted because its host daemon restarted\./gi,"\u041F\u0440\u0435\u0440\u0432\u0430\u043D: \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u043B\u0430\u0441\u044C \u0441\u043B\u0443\u0436\u0431\u0430 BB \u043D\u0430 \u043C\u0430\u0448\u0438\u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044F."],[/Child thread updates:/g,"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0438 \u0445\u043E\u0434:"],[/\bcompleted\./gi,"\u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043B."],[/\bfailed\./gi,"\u0443\u043F\u0430\u043B."],[/\bwas interrupted\b/gi,"\u043F\u0440\u0435\u0440\u0432\u0430\u043D"],[/Review the thread before deciding next steps\./g,"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0442\u0440\u0435\u0434 \u043F\u0435\u0440\u0435\u0434 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u0448\u0430\u0433\u043E\u043C."]],bareCompleted:""}};var Z=globalThis.__bbPluginRuntime;if(Z==null||Z.jsxRuntime==null)throw new Error('Cannot load "react/jsx-runtime": this bundle must be loaded by the BB app, which provides the shared plugin runtime (globalThis.__bbPluginRuntime).');var U=Z.jsxRuntime,pr="default"in U?U.default:U,{Fragment:P,jsx:i,jsxs:c}=U;var ve="en",we=()=>R[ve].title,Me=8e3,Le=2,ye={hideIds:[],items:[]},Ie=me(null);function X(){let e=ue().call;return be(Ie)??e}var M=new Map,ee=new Map;function Ee(e,t,n){let o=M.get(e);if(!o){let r={data:{...ye,...ee.get(e)},listeners:new Set,timer:0,fails:0},s=()=>{t("feed",{threadId:e}).then(l=>{M.get(e)===r&&(ve=l.lang,r.fails=0,r.data=l,ee.set(e,{hideIds:l.hideIds,hide:l.hide}),r.listeners.forEach(p=>p()))}).catch(()=>{M.get(e)!==r||++r.fails!==Le||(ee.delete(e),r.data={...r.data,stale:!0},r.listeners.forEach(l=>l()))})};s(),r.timer=window.setInterval(s,Me),M.set(e,r),o=r}let d=o;return d.listeners.add(n),()=>{d.listeners.delete(n),!(d.listeners.size||M.get(e)!==d)&&(window.clearInterval(d.timer),M.delete(e))}}function re(e){let t=X(),n=ge(o=>e?Ee(e,t,o):()=>{},[t,e]);return W(n,()=>(e?M.get(e)?.data:null)??ye)}function De(e){let t=s=>`[data-timeline-row-id=${JSON.stringify(s)}]`,n=s=>`[data-timeline-virtual-spacer]>${t(s)}`,o=e.map(s=>`:not([data-timeline-virtual-spacer])>${t(s)}`).join(`,
2
+ `),d=e.map(n).join(`,
3
+ `),r=e.map(s=>`${n(s)}>*`).join(`,
4
+ `);return`${o}{display:none!important}
5
+ ${d}{height:1px!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;overflow:hidden!important}
6
+ ${r}{display:none!important}`}function ke({threadId:e}){let{hideIds:t,hide:n,stale:o}=re(e);return n&&!o&&t.length>0?i("style",{children:De(t)}):null}var j=new Map,te=new Set,$e=e=>(te.add(e),()=>{te.delete(e)}),ne=e=>Math.max(e.time,e.replyAt??e.time,...e.parts.map(t=>t.time??e.time));function Se(e){let{items:t,seenAt:n,lang:o}=re(e),d=W($e,()=>(e?j.get(e):void 0)??0);if(!e||!t.length||!o)return null;let r=R[o],s=Math.max(n??1/0,d),l=t.filter(p=>ne(p)>s).length;return{title:r.title,label:r.button(l?r.fresh(l):t.length),fresh:l}}var Pe=e=>{if(!e)return n=>n;let t=new RegExp(`(^|\\n)[ \\t]*${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}[ \\t]*`,"g");return n=>n.replace(t,"$1")},V=e=>e.kind==="done"?"done":["interrupted","failed","attention"].includes(e.kind)?"attention":"info",ie=e=>e==="done"?"ok":e==="failed"?"bad":e==="interrupted"||e==="attention"?"warn":"plain",Fe={ok:"m7 12.5 3.5 3.5L17 9",warn:"M12 6v8m0 3.5v.5",bad:"m7.5 7.5 9 9m0-9-9 9",plain:"M12 11.5v1"},Oe={message:"M6 7h12v8h-6l-3 3v-3H6z",notify:"M6 7h12v8h-6l-3 3v-3H6z",digest:"M7 8h10M7 12h10M7 16h6",reply:"m10 8-4 4 4 4M6 12h8a4 4 0 0 1 4 4v1"},Ae=["all","done","attention","info"],Be=(e,t)=>{let n=new Date,o=e.toLocaleDateString(t.locale,{day:"numeric",month:"long"});return e.toDateString()===n.toDateString()?`${t.today}, ${o}`:(n.setDate(n.getDate()-1),e.toDateString()===n.toDateString()?`${t.yesterday}, ${o}`:o)};function Te({text:e}){let t=$(null),n=$(null),[o,d]=v(null),[r,s]=v(!1);return C(()=>{let l=t.current;if(!l||o!==null)return;let p=l.parentElement;for(;p&&!/auto|scroll/.test(getComputedStyle(p).overflowY);)p=p.parentElement;let x=new IntersectionObserver(h=>{h.some(u=>u.isIntersecting)&&s(!0)},{root:p,rootMargin:"600px 0px"});return x.observe(l),()=>x.disconnect()},[o]),C(()=>{let l=n.current;if(!l)return;let p=0,x=()=>{window.clearTimeout(p),p=window.setTimeout(()=>{let u=l.innerText.replace(/\s+/g," ").trim();u&&d(u)},120)};x();let h=new MutationObserver(x);return h.observe(l,{childList:!0,subtree:!0,characterData:!0}),()=>{h.disconnect(),window.clearTimeout(p)}},[r]),c(P,{children:[i("div",{className:"nf-snippet",ref:t,"data-plain":o!==null||void 0,children:o??e.replace(/\s+/g," ").trim()}),r&&o===null&&i("div",{className:"nf-probe","aria-hidden":"true",inert:!0,ref:n,children:i(z,{content:e})})]})}function He({item:e,fresh:t,t:n,textOf:o}){let{toThread:d}=B(),[r,s]=v(!1),l=ie(e.kind),p=e.kind==="notify"?e.sender:oe(e.kind,n),x=new Date(e.time),h=o(e.text),u=o(e.reply),w=e.senderThreadId;return c("article",{className:`nf-card nf-${l}`,"data-open":r||void 0,children:[i("span",{className:"nf-marker","aria-hidden":"true",children:i("svg",{viewBox:"0 0 24 24",children:i("path",{d:Oe[e.kind]??Fe[l]})})}),c("div",{className:"nf-sum",role:"button",tabIndex:0,"aria-expanded":r,onClick:()=>s(!r),onKeyDown:b=>{b.target===b.currentTarget&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),s(!r))},children:[c("div",{className:"nf-head",children:[t&&i("i",{className:"nf-new",role:"img","aria-label":n.isNew,title:n.isNew}),i("time",{dateTime:x.toISOString(),title:x.toLocaleString(n.locale,{dateStyle:"long",timeStyle:"short"}),children:x.toLocaleTimeString(n.locale,{hour:"2-digit",minute:"2-digit"})}),i("b",{className:"nf-kind",children:p}),w?i("button",{type:"button",className:"nf-source",title:e.senderTitle||e.sender,onClick:b=>{b.stopPropagation(),d(w)},children:i(de,{threadId:w})}):i("span",{className:"nf-source",title:e.sender}),c("span",{className:"nf-tail",children:[(u||e.parts.some(b=>b.kind==="reply"))&&i("span",{className:"nf-reply-tag",title:n.hasReply,children:n.replyTag}),i("span",{className:"nf-expand",children:r?n.less:n.more})]})]}),!r&&i(Te,{text:h},h)]}),r&&c("div",{className:"nf-body",children:[i(z,{content:h}),e.parts.map((b,y)=>b.kind==="message"?c("div",{className:"nf-reply nf-message",children:[i("b",{children:n.threadMessage}),i(z,{content:o(b.text)})]},y):c("div",{className:"nf-reply",children:[i("b",{children:n.agentReply}),i(z,{content:o(b.text)})]},y)),u&&c("div",{className:"nf-reply",children:[i("b",{children:n.agentReply}),i(z,{content:u})]})]})]})}var Ue=e=>{let t=new Map;for(let n of e){let o=n.senderThreadId??`name:${n.sender}`,d=t.get(o);d?d.items.push(n):t.set(o,{key:o,threadId:n.senderThreadId??null,name:n.senderTitle||n.sender,items:[n]})}return[...t.values()]},_e=(e,t,n)=>{let o=[];for(let r of[...e.items].reverse())r.parts.forEach((s,l)=>o.push({id:`${r.id}:${l}`,time:s.time??r.time,who:s.kind==="message"?"thread":"agent",text:s.text})),o.push({id:r.id,time:r.time,who:r.kind==="message"||r.kind==="notify"?"thread":r.kind==="reply"?"agent":"state",kind:r.kind,text:r.text}),r.reply&&o.push({id:`${r.id}:reply`,time:r.replyAt??r.time,who:"agent",text:r.reply});let d=new Set(o.map(r=>r.id));for(let r of t)d.has(r.id)||o.push({...r,who:"agent"});for(let r of n)r.to===e.threadId&&o.push({id:r.id,time:r.time,who:"you",text:r.text});return o.map((r,s)=>({entry:r,index:s})).sort((r,s)=>r.entry.time-s.entry.time||r.index-s.index).map(({entry:r})=>r)},oe=(e,t)=>t.kinds[e]??e.charAt(0).toUpperCase()+e.slice(1),Ne=(e,t)=>{let n=e.toLocaleTimeString(t.locale,{hour:"2-digit",minute:"2-digit"});return e.toDateString()===new Date().toDateString()?n:`${e.toLocaleDateString(t.locale,{day:"numeric",month:"short"})} ${n}`},he=e=>{let t=e;return t?.name==="BbHttpError"&&typeof t.status=="number"&&typeof t.body=="object"&&t.body!==null},Ge=1500,xe=e=>(e instanceof Error?e.message:String(e)).replace(/[.\s]+$/,"").slice(0,200);function Ve({group:e,count:t,t:n,textOf:o,onOpen:d}){let r=e.items[0],s=new Date(r.time),l=o(r.text);return c("div",{className:`nf-trow nf-${ie(r.kind)}`,role:"button",tabIndex:0,onClick:d,onKeyDown:p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),d())},children:[i("i",{className:"nf-dot","aria-hidden":"true"}),c("div",{className:"nf-trow-main",children:[i("b",{title:e.name,children:e.name}),c("div",{className:"nf-trow-last",children:[i("time",{dateTime:s.toISOString(),children:Ne(s,n)}),r.kind!=="notify"&&i("span",{children:oe(r.kind,n)}),i(Te,{text:l},l)]})]}),i("span",{className:"nf-count",title:n.entries(t),children:t})]})}function je({threadId:e,peerId:t,title:n,t:o,onSent:d}){let r=fe(),s=X(),[l,p]=v(""),[x,h]=v(!1),[u,w]=v(!1),[b,y]=v(""),f=l.trim().length,k=f>2e4?o.tooLong(f,2e4):b,L=async()=>{let g=l.trim();if(!g||u||g.length>2e4)return;w(!0),y("");let F=(_,N)=>r.threads.send({threadId:_,mode:"auto",input:[{type:"text",text:N,mentions:[]}]}),E=Date.now(),S=null;if(await F(t,g).catch(_=>{S=_??new Error("unknown")}),S&&!he(S)){if(await new Promise(N=>setTimeout(N,Ge)),!await s("delivered",{threadId:e,peerId:t,text:g,since:E}).then(N=>N.found).catch(()=>!1)){y(o.maybeSent),w(!1);return}S=null}if(S){y(o.sendFailed(xe(S))),w(!1);return}d({id:`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`,to:t,text:g,time:Date.now()}),p(""),x&&await F(e,`[notify:You]
7
+ ${o.noteText(n,g)}`).catch(_=>y(he(_)?o.noteFailed(xe(_)):o.noteUnknown)),w(!1)};return c("form",{className:"nf-form",onSubmit:g=>{g.preventDefault(),L()},children:[c("div",{className:"nf-send",children:[i("textarea",{rows:1,value:l,readOnly:u,"aria-label":o.replyLabel,placeholder:o.replyPlaceholder,"aria-invalid":!!k||void 0,onChange:g=>p(g.target.value),onKeyDown:g=>{g.key==="Enter"&&!g.shiftKey&&!g.nativeEvent.isComposing&&(g.preventDefault(),L())}}),i("button",{type:"submit",disabled:u||!f||f>2e4,"aria-busy":u||void 0,children:u?o.sending:o.send})]}),k&&i("p",{className:"nf-error",role:"alert",children:k}),c("label",{className:"nf-note",children:[i("input",{type:"checkbox",checked:x,onChange:g=>h(g.target.checked)}),i("span",{children:o.noteLabel})]}),i("p",{className:"nf-hint",children:o.noteHint})]})}function Xe({threadId:e,group:t,closed:n,sent:o,shown:d,tick:r,t:s,textOf:l,onSent:p,onBack:x}){let h=X(),u=t.threadId,[w,b]=v({ok:!0,out:[]});C(()=>{if(!u||!d)return;let f=!0;return h("talk",{threadId:e,peerId:u}).then(k=>{f&&b(k)}).catch(()=>{f&&b(k=>({...k,ok:!1}))}),()=>{f=!1}},[h,e,u,d,r]);let y=_e(t,w.out,o);return c(P,{children:[c("header",{className:"nf-bar",children:[i("button",{type:"button",onClick:x,children:`\u2190 ${s.back}`}),i("b",{title:t.name,children:t.name})]}),i("div",{className:"nf-scroll",children:i("div",{className:"nf-talk",children:y.map(f=>{let k=new Date(f.time),L=f.who==="state"?oe(f.kind??"",s):f.who==="you"?s.you:f.who==="agent"?s.agent:u?s.thread:t.name;return c("div",{className:`nf-msg nf-${f.who==="state"?ie(f.kind??""):"plain"}`,"data-who":f.who,children:[c("div",{className:"nf-msg-head",children:[i("b",{children:L}),i("time",{dateTime:k.toISOString(),children:Ne(k,s)})]}),i(z,{content:l(f.text)})]},f.id)})})}),!w.ok&&i("p",{className:"nf-hint",children:s.outFailed}),i("div",{className:"nf-foot",children:u&&!n?i(je,{threadId:e,peerId:u,title:t.name,t:s,onSent:p}):i("p",{className:"nf-hint",children:u?s.closed[n??"gone"]:s.closed.none})})]})}function ze({threadId:e}){return i(Ye,{threadId:e},e)}function Ye({threadId:e}){let t=X(),n=re(e),{items:o,seenAt:d,lang:r,marker:s=""}=n,l=Q(()=>Pe(s),[s]),[p,x]=v("all"),h=$(null),[u,w]=v(!1);C(()=>{let a=h.current;if(!a)return;let m=new IntersectionObserver(I=>w(I[I.length-1].isIntersecting));return m.observe(a),()=>m.disconnect()},[]);let[b,y]=v(null),f=o.reduce((a,m)=>Math.max(a,ne(m)),0);C(()=>{if(!u){y(null);return}if(d===void 0)return;let a=Math.max(d,j.get(e)??0);y(m=>m??a),!(f<=d)&&(j.set(e,Math.max(f,j.get(e)??0)),te.forEach(m=>m()),t("seen",{threadId:e,at:f}).catch(()=>{}))},[t,e,u,n]);let[k,L]=v(null),g=k??n.view??"time",[F,E]=v(null),[S,_]=v([]),N=Q(()=>J([...n.sent??[],...S]),[n.sent,S]),ae=$(new Set);if(C(()=>{for(let a of S)ae.current.has(a.id)||n.sent?.some(m=>m.id===a.id)||t("sent",{threadId:e,...a}).then(()=>{ae.current.add(a.id)}).catch(()=>{})},[t,e,n,S]),!r)return i("div",{className:"nf-panel",ref:h});let T=R[r];if(!o.length)return i("div",{className:"nf-panel",ref:h,children:i("p",{className:"nf-empty",children:T.empty})});let O=Ue(o),D=g==="threads"?O.find(a=>a.key===F):void 0;if(D)return i("div",{className:"nf-panel nf-chat",ref:h,children:i(Xe,{threadId:e,group:D,closed:D.threadId?n.closed?.[D.threadId]:void 0,sent:N,shown:u,tick:n,t:T,textOf:l,onSent:a=>_(m=>J([...m,{...a,time:Math.max(a.time,(N.at(-1)?.time??0)+1)}])),onBack:()=>E(null)},D.key)});let se=o.filter(a=>p==="all"||V(a)===p),le=O.filter(a=>p==="all"||V(a.items[0])===p),Ce=a=>g==="threads"?a==="all"?O.length:O.filter(m=>V(m.items[0])===a).length:a==="all"?o.length:o.filter(m=>V(m)===a).length,Y=new Map;for(let a of se){let m=new Date(a.time).toDateString();Y.set(m,[...Y.get(m)??[],a])}let Re=a=>{L(a),E(null),t("view",{threadId:e,view:a}).catch(()=>{})};return c("div",{className:"nf-panel",ref:h,children:[c("header",{className:"nf-top",children:[i("nav",{"aria-label":T.filtersLabel,children:Ae.map(a=>c("button",{type:"button","aria-pressed":p===a,onClick:()=>x(a),children:[T.filters[a]," ",i("b",{children:Ce(a)})]},a))}),i("div",{className:"nf-views",role:"group","aria-label":T.viewsLabel,children:["time","threads"].map(a=>i("button",{type:"button","aria-pressed":g===a,onClick:()=>Re(a),children:T.views[a]},a))})]}),g==="threads"?c(P,{children:[!le.length&&i("p",{className:"nf-empty",children:T.emptyThreads}),i("div",{className:"nf-threads",children:le.map(a=>i(Ve,{group:a,count:_e(a,[],N).length,t:T,textOf:l,onOpen:()=>E(a.key)},a.key))})]}):c(P,{children:[!se.length&&i("p",{className:"nf-empty",children:T.emptyFilter}),[...Y].map(([a,m])=>c("section",{className:"nf-day",children:[c("h2",{children:[i("span",{children:Be(new Date(m[0].time),T)}),i("small",{children:m.length})]}),i("div",{className:"nf-stream",children:m.map(I=>i(He,{item:I,fresh:b!==null&&ne(I)>b,t:T,textOf:l},I.id))})]},a))]})]})}function Ke(){let{threadId:e}=ce();return i(ke,{threadId:e})}function qe({threadId:e}){let{openThreadPanel:t}=B(),n=Se(e);return n?i("button",{type:"button",className:"nf-trigger","data-new":n.fresh||void 0,onClick:()=>t({actionId:"feed",title:n.title}),children:n.label}):null}var yr=pe(e=>{let t=e.slots;e.slots.experimental_tab({id:"feed",title:R.en.title,icon:"Bell",context:{kind:"thread"},availability:"action",component:ze,run:({openPanel:n})=>{n({title:we()})}}),t.experimental_appOverlay?.({id:"feed-overlay",component:Ke}),t.experimental_threadHeaderAction?.({id:"feed-trigger",title:R.en.title,component:qe})});export{yr as default};
@@ -0,0 +1,11 @@
1
+ {
2
+ "sdkMajor": 0,
3
+ "sdkVersion": "0.6.78",
4
+ "artifactFormatVersion": 1,
5
+ "pluginId": "notify-feed",
6
+ "pluginVersion": "0.3.3",
7
+ "builtWith": {
8
+ "bbVersion": "0.47.0",
9
+ "pluginSdkVersion": "0.6.78"
10
+ }
11
+ }
@@ -0,0 +1 @@
1
+ {"type":"module"}
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from "node:module";
2
+ import { dirname as __pathDirname } from "node:path";
3
+ import { fileURLToPath as __fileURLToPath } from "node:url";
4
+ const require = __createRequire(import.meta.url);
5
+ var __filename = __fileURLToPath(import.meta.url);
6
+ var __dirname = __pathDirname(__filename);
7
+ var xe=Object.defineProperty;var i=(e,n)=>xe(e,"name",{value:n,configurable:!0});import{defineRpcContract as Ae}from"@get-bb/plugin-sdk";import{z as A}from"zod";var C=["en","ru"],z=i(e=>e==="ru"?"ru":"en","langOf"),ee=2e4,Se=300,te=i(e=>[...new Map(e.map(n=>[n.id,n])).values()].map((n,u)=>({message:n,index:u})).sort((n,u)=>n.message.time-u.message.time||n.index-u.index).slice(-Se).map(({message:n})=>n),"lastSent"),E={en:{locale:"en-US",title:"Notifications",button:i(e=>`Notifications: ${e}`,"button"),fresh:i(e=>`${e} new`,"fresh"),kinds:{done:"Done",failed:"Failed",interrupted:"Interrupted",attention:"Needs reply",digest:"Digest",message:"Message",reply:"Agent reply",system:"System"},filters:{all:"All",done:"Done",attention:"Attention",info:"Info / replies"},filtersLabel:"Notification filters",today:"Today",yesterday:"Yesterday",isNew:"New",hasReply:"Has an agent reply",replyTag:"\u21A9 +reply",more:"More",less:"Less",threadMessage:"Thread message",agentReply:"Agent reply",empty:"No notifications.",emptyFilter:"No entries of this kind.",system:"System",agent:"Agent",views:{time:"By time",threads:"By thread"},viewsLabel:"View",entries:i(e=>`Entries: ${e}`,"entries"),emptyThreads:"No threads in this state.",back:"Threads",thread:"Thread",you:"You",outFailed:"The agent's own messages to this thread could not be read, so some may be missing here.",replyLabel:"Message to the thread",replyPlaceholder:"Write to this thread\u2026",send:"Send",sending:"Sending\u2026",sendFailed:i(e=>`Not sent: ${e}. Your text is kept, try again.`,"sendFailed"),tooLong:i((e,n)=>`The message is ${e.toLocaleString("en-US")} characters long; the limit is ${n.toLocaleString("en-US")}. Shorten it to send.`,"tooLong"),maybeSent:"It may have been sent: the connection dropped before BB answered. Check the conversation before you send it again.",noteUnknown:"The message was sent. The note to the agent may not have been: the connection dropped before BB answered.",noteLabel:"Tell the agent",noteHint:"The agent gets a note in its Notifications tab. The note starts its turn.",noteFailed:i(e=>`The message was sent, but the note to the agent was not: ${e}.`,"noteFailed"),noteText:i((e,n)=>`wrote to thread ${e}: ${n}`,"noteText"),closed:{archived:"This thread is archived, so you cannot write to it from here.",gone:"This thread is unavailable: it was deleted or cannot be read. You cannot write to it.",none:"These entries have no sending thread, so there is nobody to reply to."},instruction:i(e=>`Start a short housekeeping reply to a message from another thread or from the system with ${e}; a result meant for the user goes without the marker.`,"instruction"),systemTexts:[[/^\s*failed\.?(?=\s|$)/i,"Failed."],[/^\s*was interrupted because\s+/i,"Interrupted: "],[/^\s*was interrupted\.?(?=\s|$)/i,"Interrupted."]],bareCompleted:"Completed."},ru:{locale:"ru-RU",title:"\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F",button:i(e=>`\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F: ${e}`,"button"),fresh:i(e=>`${e} ${e%10===1&&e%100!==11?"\u043D\u043E\u0432\u043E\u0435":"\u043D\u043E\u0432\u044B\u0445"}`,"fresh"),kinds:{done:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B",failed:"\u0423\u043F\u0430\u043B",interrupted:"\u041F\u0440\u0435\u0440\u0432\u0430\u043D",attention:"\u041D\u0443\u0436\u0435\u043D \u043E\u0442\u0432\u0435\u0442",digest:"\u0421\u0432\u043E\u0434\u043A\u0430",message:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435",reply:"\u041E\u0442\u0432\u0435\u0442 \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",system:"\u0421\u0438\u0441\u0442\u0435\u043C\u0430"},filters:{all:"\u0412\u0441\u0435",done:"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B",attention:"\u0412\u043D\u0438\u043C\u0430\u043D\u0438\u0435",info:"\u0418\u043D\u0444\u043E / \u043E\u0442\u0432\u0435\u0442\u044B"},filtersLabel:"\u0424\u0438\u043B\u044C\u0442\u0440\u044B \u0443\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439",today:"\u0421\u0435\u0433\u043E\u0434\u043D\u044F",yesterday:"\u0412\u0447\u0435\u0440\u0430",isNew:"\u041D\u043E\u0432\u043E\u0435",hasReply:"\u0421 \u043E\u0442\u0432\u0435\u0442\u043E\u043C \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",replyTag:"\u21A9 +\u043E\u0442\u0432\u0435\u0442",more:"\u041F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435",less:"\u0421\u0432\u0435\u0440\u043D\u0443\u0442\u044C",threadMessage:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0442\u0440\u0435\u0434\u0430",agentReply:"\u041E\u0442\u0432\u0435\u0442 \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E",empty:"\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u0439 \u043D\u0435\u0442.",emptyFilter:"\u041D\u0435\u0442 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u044D\u0442\u043E\u0433\u043E \u0432\u0438\u0434\u0430.",system:"\u0421\u0438\u0441\u0442\u0435\u043C\u0430",agent:"\u0412\u0435\u0434\u0443\u0449\u0438\u0439",views:{time:"\u041F\u043E \u0432\u0440\u0435\u043C\u0435\u043D\u0438",threads:"\u041F\u043E \u0442\u0440\u0435\u0434\u0430\u043C"},viewsLabel:"\u0412\u0438\u0434",entries:i(e=>`\u0417\u0430\u043F\u0438\u0441\u0435\u0439: ${e}`,"entries"),emptyThreads:"\u041D\u0435\u0442 \u0442\u0440\u0435\u0434\u043E\u0432 \u0441 \u0442\u0430\u043A\u0438\u043C \u0441\u043E\u0441\u0442\u043E\u044F\u043D\u0438\u0435\u043C.",back:"\u0422\u0440\u0435\u0434\u044B",thread:"\u0422\u0440\u0435\u0434",you:"\u0412\u044B",outFailed:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u044F \u0432\u0435\u0434\u0443\u0449\u0435\u0433\u043E \u044D\u0442\u043E\u043C\u0443 \u0442\u0440\u0435\u0434\u0443 \u043F\u0440\u043E\u0447\u0438\u0442\u0430\u0442\u044C \u043D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C, \u043F\u043E\u044D\u0442\u043E\u043C\u0443 \u0437\u0434\u0435\u0441\u044C \u043C\u043E\u0433\u0443\u0442 \u0431\u044B\u0442\u044C \u043D\u0435 \u0432\u0441\u0435.",replyLabel:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0442\u0440\u0435\u0434\u0443",replyPlaceholder:"\u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u044D\u0442\u043E\u043C\u0443 \u0442\u0440\u0435\u0434\u0443\u2026",send:"\u041E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C",sending:"\u041E\u0442\u043F\u0440\u0430\u0432\u043A\u0430\u2026",sendFailed:i(e=>`\u041D\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E: ${e}. \u0422\u0435\u043A\u0441\u0442 \u0441\u043E\u0445\u0440\u0430\u043D\u0451\u043D, \u043F\u043E\u043F\u0440\u043E\u0431\u0443\u0439\u0442\u0435 \u0435\u0449\u0451 \u0440\u0430\u0437.`,"sendFailed"),tooLong:i((e,n)=>`\u0412 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0438 ${e.toLocaleString("ru-RU")} \u0437\u043D\u0430\u043A\u043E\u0432, \u043F\u0440\u0435\u0434\u0435\u043B \u2014 ${n.toLocaleString("ru-RU")}. \u0421\u043E\u043A\u0440\u0430\u0442\u0438\u0442\u0435 \u0435\u0433\u043E, \u0447\u0442\u043E\u0431\u044B \u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u044C.`,"tooLong"),maybeSent:"\u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E: \u0441\u0432\u044F\u0437\u044C \u043E\u0431\u043E\u0440\u0432\u0430\u043B\u0430\u0441\u044C \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u0442\u0432\u0435\u0442\u0430 BB. \u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u043F\u0435\u0440\u0435\u043F\u0438\u0441\u043A\u0443, \u043F\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043C \u043F\u043E\u0432\u0442\u043E\u0440\u044F\u0442\u044C.",noteUnknown:"\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E. \u0417\u0430\u043C\u0435\u0442\u043A\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443, \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u043D\u0435 \u0443\u0448\u043B\u0430: \u0441\u0432\u044F\u0437\u044C \u043E\u0431\u043E\u0440\u0432\u0430\u043B\u0430\u0441\u044C \u0440\u0430\u043D\u044C\u0448\u0435 \u043E\u0442\u0432\u0435\u0442\u0430 BB.",noteLabel:"\u0421\u043E\u043E\u0431\u0449\u0438\u0442\u044C \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443",noteHint:"\u0412\u0435\u0434\u0443\u0449\u0438\u0439 \u043F\u043E\u043B\u0443\u0447\u0438\u0442 \u0437\u0430\u043C\u0435\u0442\u043A\u0443 \u0432\u043E \u0432\u043A\u043B\u0430\u0434\u043A\u0443 \xAB\u0423\u0432\u0435\u0434\u043E\u043C\u043B\u0435\u043D\u0438\u044F\xBB. \u0417\u0430\u043C\u0435\u0442\u043A\u0430 \u0437\u0430\u043F\u0443\u0441\u043A\u0430\u0435\u0442 \u0435\u0433\u043E \u0445\u043E\u0434.",noteFailed:i(e=>`\u0421\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u043E\u0442\u043F\u0440\u0430\u0432\u043B\u0435\u043D\u043E, \u043D\u043E \u0437\u0430\u043C\u0435\u0442\u043A\u0430 \u0432\u0435\u0434\u0443\u0449\u0435\u043C\u0443 \u043D\u0435 \u0443\u0448\u043B\u0430: ${e}.`,"noteFailed"),noteText:i((e,n)=>`\u043D\u0430\u043F\u0438\u0441\u0430\u043B \u0442\u0440\u0435\u0434\u0443 ${e}: ${n}`,"noteText"),closed:{archived:"\u0422\u0440\u0435\u0434 \u0432 \u0430\u0440\u0445\u0438\u0432\u0435, \u043D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0435\u043C\u0443 \u043E\u0442\u0441\u044E\u0434\u0430 \u043D\u0435\u043B\u044C\u0437\u044F.",gone:"\u0422\u0440\u0435\u0434 \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D: \u043E\u043D \u0443\u0434\u0430\u043B\u0451\u043D \u0438\u043B\u0438 \u043D\u0435 \u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044F. \u041D\u0430\u043F\u0438\u0441\u0430\u0442\u044C \u0435\u043C\u0443 \u043D\u0435\u043B\u044C\u0437\u044F.",none:"\u0423 \u044D\u0442\u0438\u0445 \u0437\u0430\u043F\u0438\u0441\u0435\u0439 \u043D\u0435\u0442 \u0442\u0440\u0435\u0434\u0430-\u043E\u0442\u043F\u0440\u0430\u0432\u0438\u0442\u0435\u043B\u044F, \u043E\u0442\u0432\u0435\u0447\u0430\u0442\u044C \u043D\u0435\u043A\u043E\u043C\u0443."},instruction:i(e=>`\u041A\u043E\u0440\u043E\u0442\u043A\u0438\u0439 \u0441\u043B\u0443\u0436\u0435\u0431\u043D\u044B\u0439 \u043E\u0442\u0432\u0435\u0442 \u043D\u0430 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0435 \u0434\u0440\u0443\u0433\u043E\u0433\u043E \u0442\u0440\u0435\u0434\u0430 \u0438\u043B\u0438 \u0441\u0438\u0441\u0442\u0435\u043C\u044B \u043D\u0430\u0447\u0438\u043D\u0430\u0439 \u0441 ${e}; \u0438\u0442\u043E\u0433 \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u2014 \u0431\u0435\u0437 \u043C\u0435\u0442\u043A\u0438.`,"instruction"),systemTexts:[[/^\s*failed\.?(?=\s|$)/i,"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0441\u044F \u0441 \u043E\u0448\u0438\u0431\u043A\u043E\u0439."],[/was interrupted because its host daemon restarted\./gi,"\u041F\u0440\u0435\u0440\u0432\u0430\u043D: \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0443\u0441\u0442\u0438\u043B\u0430\u0441\u044C \u0441\u043B\u0443\u0436\u0431\u0430 BB \u043D\u0430 \u043C\u0430\u0448\u0438\u043D\u0435 \u0438\u0441\u043F\u043E\u043B\u043D\u0438\u0442\u0435\u043B\u044F."],[/Child thread updates:/g,"\u0417\u0430\u0432\u0435\u0440\u0448\u0438\u043B\u0438 \u0445\u043E\u0434:"],[/\bcompleted\./gi,"\u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043B."],[/\bfailed\./gi,"\u0443\u043F\u0430\u043B."],[/\bwas interrupted\b/gi,"\u043F\u0440\u0435\u0440\u0432\u0430\u043D"],[/Review the thread before deciding next steps\./g,"\u041F\u0440\u043E\u0432\u0435\u0440\u044C\u0442\u0435 \u0442\u0440\u0435\u0434 \u043F\u0435\u0440\u0435\u0434 \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u043C \u0448\u0430\u0433\u043E\u043C."]],bareCompleted:""}};import{z as s}from"zod";var ke=s.object({kind:s.enum(["message","reply"]),text:s.string(),time:s.number().optional()}),Te=s.object({id:s.string(),time:s.number(),sender:s.string(),senderThreadId:s.string().nullable().optional(),senderTitle:s.string().nullable().optional(),kind:s.string(),text:s.string(),reply:s.string(),replyAt:s.number(),parts:s.array(ke)}),Re=s.object({hideIds:s.array(s.string()),items:s.array(Te),closed:s.record(s.string(),s.enum(["archived","gone"]))}),x=s.string().min(1).max(128),$=["time","threads"],L=s.object({id:s.string().min(1).max(64),to:x,text:s.string().min(1).max(ee),time:s.number()}),ne={feed:{input:s.object({threadId:x}),output:Re.extend({seenAt:s.number(),lang:s.enum(C),marker:s.string(),hide:s.boolean(),view:s.enum($),sent:s.array(L)})},seen:{input:s.object({threadId:x,at:s.number()}),output:s.object({seenAt:s.number()})},view:{input:s.object({threadId:x,view:s.enum($)}),output:s.object({view:s.enum($)})},talk:{input:s.object({threadId:x,peerId:x}),output:s.object({ok:s.boolean(),out:s.array(s.object({id:s.string(),time:s.number(),text:s.string()}))})},sent:{input:L.extend({threadId:x}),output:s.object({sent:s.array(L)})},delivered:{input:s.object({threadId:x,peerId:x,text:s.string().min(1),since:s.number()}),output:s.object({found:s.boolean()})}};var ve=Ae(ne),de=A.array(A.string().min(1)),Ie=A.string().refine(e=>{try{return de.safeParse(JSON.parse(e)).success}catch{return!1}},"Must be a JSON array of thread ids"),se=i(e=>{try{return de.parse(JSON.parse(e))}catch{return null}},"scopeOf"),Me=20,$e=50,Le=10*6e4,H=i((e,n,u)=>{for(e.delete(n),e.set(n,u);e.size>$e;)e.delete(e.keys().next().value)},"keep"),Ne=5e3,_e=2e4,Pe=6e4,je=5e3,Ce=["active","pending","starting","stopping"],F=i((e,n=[])=>{for(let u of e)n.push(u),u.children&&F(u.children,n);return n},"flatten"),W=i((e,n)=>{if(!e.children||!n.children)return{...e,...n,children:n.children??e.children};let u=new Map(e.children.map(h=>[h.id,h])),c=new Set(n.children.map(h=>h.id)),p=[...e.children.filter(h=>!c.has(h.id)),...n.children.map(h=>u.has(h.id)?W(u.get(h.id),h):h)];return{...e,...n,children:p}},"joinRow"),re=i((e,n)=>{let u=new Set(n.map(f=>f.id)),c=e.findIndex(f=>u.has(f.id));if(c<0)return[...e,...n];let p=n[0],h=e.find(f=>f.id===p.id);return[...e.slice(0,c),...h?[W(h,p)]:[p],...n.slice(1)]},"joinRows"),Ee=i(e=>n=>!!e&&n.kind==="conversation"&&n.role==="assistant"&&!!n.text?.trimStart().startsWith(e),"isBgWith"),le=i(e=>e.kind==="conversation"&&e.role==="user"&&(!!e.senderThreadId||e.systemMessageKind?.startsWith("child-")===!0)||e.kind==="system"&&/@thread:[\w-]+\s+(?:finished|completed)\s*:/i.test(`${e.title??""} ${e.detail??""}`),"notification"),ce=/^\[notify:([\p{L}\p{N}][\p{L}\p{N} .-]{0,31})\](?:\r?\n|$)/u,ie=i(e=>e.kind==="conversation"&&e.role==="user"&&!le(e)?e.text?.match(ce)?.[1]??null:null,"toolOf"),ae=/((?:```[\s\S]*?```|~~~[\s\S]*?~~~|`+[^`\r\n]+`+|^[ ]{4,}.*$|!?\[(?:[^\[\]]|\[[^\[\]]*\])*\](?:\([^\)]*\)|\[[^\]]*\])|^[ \t]*\[[^\]]+\]:[ \t]*\S+.*$|\b[a-z]+:\/\/[^\s<>()]+|\bthr_\w+(?::[\w-]+)+|(?<!\w)[\/.][\w.\/-]+))|(?<![\w/:.\-=?&#])(?:@thread:)?(thr_\w+)(?![\w/\-=?&#]|[.:](?!\s|$))|(::task\{key="([^"]+)"[^}]*\})/gm,Fe=i(e=>e.replace(/[\\\[\]*_`]/g,"\\$&"),"esc"),Be=/^(?:(?:\[bb message from thread:[^\]]+\]|\[bb system\](?=\s*Child thread updates:))[ \t]*(?:\r?\n(?:\r?\n)?)?|\[bb system\]\s*@thread:[^\s:]+[ \t]*(?:(?:completed|finished):[ \t]*(?:\r?\n(?:\r?\n)?|$))?)/i,oe=i(e=>e.replace(Be,""),"clean"),De=i((e,n,u)=>{let c=E[e];return n.systemMessageKind==="child-completed"?c.bareCompleted&&/^\s*completed\.?\s*$/i.test(u)?c.bareCompleted:u:n.kind==="system"||n.systemMessageKind?.startsWith("child-")?c.systemTexts.reduce((p,[h,f])=>p.replace(h,f),u):u},"systemTextOf"),R=new Map,Oe=i(e=>{let n=R.get(e);return n?n.failed?Date.now()-n.at>=6e4:Date.now()-n.at>=6e5:!0},"isStale");function Ke(e){let n=[...e].sort((c,p)=>c.time-p.time),u=new Set;return n.forEach((c,p)=>{if(!(c.kind!=="message"||!c.senderThreadId))for(let h of n.slice(p+1)){if(h.time-c.time>Pe)break;if(!(h.kind!=="done"||h.senderThreadId!==c.senderThreadId)){h.parts.push({kind:"message",text:c.text,time:c.time}),c.reply&&h.parts.push({kind:"reply",text:c.reply,time:c.replyAt??c.time}),u.add(c.id);break}}}),n.filter(c=>!u.has(c.id)).reverse()}i(Ke,"glue");async function Ue(e){let n=e.settings.define({language:{type:"select",label:"Language",options:[...C],default:"en"},marker:{type:"string",label:"Reply marker, for example [bg] (empty = agent replies are not hidden and agents get no instruction)",experimental_schema:A.string().max(32,"At most 32 characters"),default:""},hide:{type:"boolean",label:"Hide rows in the main feed (off = stock feed, the button and the tab keep working)",default:!0},threads:{type:"string",label:"Threads (JSON array of thread ids; empty = every thread)",experimental_multiline:!0,experimental_schema:Ie,default:"[]"}}),u=await n.get(),c=se(u.threads),p=u.hide,h=z(u.language),f=u.marker.trim(),N=i(r=>c!==null&&(c.length===0||c.includes(r)),"inScope"),B=new Map,ge=i(async(r,a)=>{let m=new Set(a?.map(g=>g.id)),o=[],d=[],l=!1,y={threadId:r,includeNestedRows:"true"};for(let g=0;g<Me;g++){let w=await e.sdk.threads.timeline(y),j=w.rows;o=re(j,o),g===0&&(d=w.timelinePage.olderRowUpdates??[]);let k=w.timelinePage.olderCursor;if(l=!k,!k||j.some(v=>m.has(v.id)))break;y={threadId:r,includeNestedRows:"true",beforeAnchorId:k.anchorId,beforeAnchorSeq:String(k.anchorSeq)}}if(!a||l)return o;let S=new Map(d.map(g=>[g.id,g]));return re(a.map(g=>S.has(g.id)?W(g,S.get(g.id)):g),o)},"readRows"),X=i(async r=>{let a=B.get(r);if(a?.reading)return F(await a.reading);let m=Date.now(),o=!a||m-a.at>=Le,d=ge(r,o?null:a.rows),l={rows:a?.rows??[],at:a?.at??0,reading:d};H(B,r,l);try{l.rows=await d,o&&(l.at=m)}catch(y){throw a||B.delete(r),y}finally{delete l.reading}return F(l.rows)},"allRows"),V=i(async(r,a=[])=>{let m=new Set(a);for(let o of r)for(let d of o.matchAll(ae))d[2]&&m.add(d[2]);return await Promise.all([...m].filter(Oe).map(async o=>{try{let d=await e.sdk.threads.get({threadId:o});R.set(o,{title:d.title||d.titleFallback||o,href:`/projects/${d.projectId}/threads/${o}`,at:Date.now(),archived:d.archivedAt!=null})}catch{R.set(o,{at:Date.now(),failed:!0})}})),o=>o.replace(ae,(d,l,y,S,g)=>{if(l)return l;if(y){let w=R.get(y);return w?.title&&w.href?`[${Fe(w.title)}](${w.href})`:d}return g?`[${g}](/plugins/tasks/tasks/task/${g})`:d})},"linker"),ue=i(async r=>{if(!N(r))return{hideIds:[],items:[],closed:{}};let a=E[h],m=Ee(f),o=await X(r),d=o.filter(t=>le(t)||ie(t)!==null),y=Ce.includes((await e.sdk.threads.get({threadId:r})).status)?[...o].reverse().find(t=>t.turnId)?.turnId:null,S=o.filter(t=>m(t)&&!!t.turnId&&t.turnId!==y),g=[...new Set([...d,...S].map(t=>t.id))],w=new Set(d.map(t=>t.id)),j=new Set(o.filter(m).map(t=>t.id)),k=new Map,v=new Map,Q=new Set,I=null;for(let t of o)t.kind==="conversation"&&t.role==="user"?I=w.has(t.id)?t.id:null:I&&j.has(t.id)&&(k.set(I,t.text??""),v.set(I,t.createdAt??t.startedAt??0),Q.add(t.id),I=null);let pe={"child-completed":"done","child-failed":"failed","child-interrupted":"interrupted","child-stopped":"interrupted","child-needs-attention":"attention","child-question":"attention","child-outcome-batch":"digest"},fe=d.map(t=>{let T=ie(t);if(T!==null)return{id:t.id,time:t.createdAt??t.startedAt??0,sender:T,senderThreadId:null,kind:"notify",text:(t.text??"").replace(ce,""),reply:k.get(t.id)??"",replyAt:v.get(t.id)??t.createdAt??t.startedAt??0,parts:[]};let G=t.systemMessageSubject?.kind==="thread-batch"?null:t.senderThreadId??t.systemMessageSubject?.threadId??t.text?.match(/@thread:(thr_[\w-]+)/)?.[1]??null,M=t.systemMessageKind&&t.systemMessageKind!=="unlabeled"?t.systemMessageKind:t.kind==="system"?t.title??"system":"message",be=t.text??[t.title,t.detail].filter(Boolean).join(`
8
+ `);return{id:t.id,time:t.createdAt??t.startedAt??0,sender:t.senderThreadId??t.systemMessageSubject?.threadName??t.systemMessageSubject?.threadId??a.system,senderThreadId:G,kind:pe[M]??M,text:De(h,t,oe(be)),reply:k.get(t.id)??"",replyAt:v.get(t.id)??t.createdAt??t.startedAt??0,parts:[]}}),ye=S.filter(t=>!Q.has(t.id)).map(t=>({id:t.id,time:t.createdAt??t.startedAt??0,sender:a.agent,senderThreadId:null,kind:"reply",text:t.text??"",reply:"",replyAt:t.createdAt??t.startedAt??0,parts:[]})),O=Ke([...fe,...ye]),Z=[...new Set(O.flatMap(t=>t.senderThreadId?[t.senderThreadId]:[]))],K=await V(O.flatMap(t=>[t.text,t.reply,...t.parts.map(T=>T.text)]),Z),we=O.map(t=>{let G=(t.senderThreadId?R.get(t.senderThreadId):null)?.title??null;return{...t,senderTitle:G,text:K(t.text),reply:K(t.reply),parts:t.parts.map(M=>({...M,text:K(M.text)}))}}),U={};for(let t of Z){let T=R.get(t);T?.failed?U[t]="gone":T?.archived&&(U[t]="archived")}return{hideIds:g,items:we,closed:U}},"compute"),Y=new Map,he=i((r,a)=>{let m=`${r}|${a}`,o=Y.get(m);if(o&&Date.now()-o.at<_e)return o.value;let d=(async()=>{if(!N(r))return{ok:!0,out:[]};try{let l=(await X(a)).filter(g=>g.kind==="conversation"&&g.role==="user"&&g.senderThreadId===r),y=l.map(g=>oe(g.text??"")),S=await V(y);return{ok:!0,out:l.map((g,w)=>({id:g.id,time:g.createdAt??g.startedAt??0,text:S(y[w])}))}}catch{return{ok:!1,out:[]}}})();return H(Y,m,{at:Date.now(),value:d}),d},"talkOf"),D=new Map,me=i(r=>{let a=D.get(r);if(a&&Date.now()-a.at<Ne)return a.value;let m=ue(r);return H(D,r,{at:Date.now(),value:m}),m},"rowsOf");n.onChange(r=>{c=se(r.threads),p=r.hide,h=z(r.language),f=r.marker.trim(),D.clear()});let b=e.storage.kv,_=await b.get("since");typeof _!="number"&&(_=Date.now(),await b.set("since",_));let q=_,P=Promise.resolve(),J=i(async r=>A.array(L).catch([]).parse(await b.get(`sent:${r}`)),"sentOf");e.rpc.register(ve,{feed:i(async({threadId:r})=>({...await me(r),seenAt:await b.get(`seen:${r}`)??q,lang:h,marker:f,hide:p,view:A.enum($).catch("time").parse(await b.get(`view:${r}`)),sent:await J(r)}),"feed"),view:i(async({threadId:r,view:a})=>(await b.set(`view:${r}`,a),{view:a}),"view"),talk:i(({threadId:r,peerId:a})=>he(r,a),"talk"),delivered:i(async({threadId:r,peerId:a,text:m,since:o})=>{if(!N(r))return{found:!1};try{return{found:F((await e.sdk.threads.timeline({threadId:a,includeNestedRows:"true"})).rows).some(l=>l.kind==="conversation"&&l.role==="user"&&!l.senderThreadId&&(l.createdAt??l.startedAt??0)>=o-je&&l.text?.trim()===m.trim())}}catch{return{found:!1}}},"delivered"),sent:i(({threadId:r,...a})=>{let m=P.then(async()=>{let o=await J(r);if(o.some(l=>l.id===a.id))return{sent:o};let d=te([...o,a]);return d.some(l=>l.id===a.id)?(await b.set(`sent:${r}`,d),{sent:d}):{sent:o}});return P=m.catch(()=>{}),m},"sent"),seen:i(({threadId:r,at:a})=>{let m=P.then(async()=>{let o=`seen:${r}`,d=await b.get(o)??q,l=Math.max(d,Math.min(a,Date.now()));return l>d&&await b.set(o,l),{seenAt:l}});return P=m.catch(()=>{}),m},"seen")}),e.agents.contributeInstructions(r=>f&&N(r.threadId)?E[h].instruction(f):null)}i(Ue,"plugin");export{Ue as default,Ke as glue,ve as rpcContract,De as systemTextOf,ie as toolOf};
9
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1,11 @@
1
+ {
2
+ "sdkMajor": 0,
3
+ "sdkVersion": "0.6.78",
4
+ "artifactFormatVersion": 1,
5
+ "pluginId": "notify-feed",
6
+ "pluginVersion": "0.3.3",
7
+ "builtWith": {
8
+ "bbVersion": "0.47.0",
9
+ "pluginSdkVersion": "0.6.78"
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
2
+ <path d="M6 9a6 6 0 0 1 12 0c0 5 2 6.5 2 6.5H4S6 14 6 9z"/>
3
+ <path d="M10 19.5a2 2 0 0 0 4 0"/>
4
+ <path d="M12 3V2"/>
5
+ </svg>
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "bb-plugin-notify-feed",
3
+ "version": "0.3.3",
4
+ "engines": {
5
+ "bb": ">=0.45",
6
+ "bbPluginSdk": ">=0.6.15"
7
+ },
8
+ "bb": {
9
+ "name": "Notify Feed",
10
+ "description": "Keep your conversation from drowning in child-thread reports when a thread delegates work. Background messages and completion notices move to a Notifications tab beside the feed.",
11
+ "branding": {
12
+ "icon": "./icon.svg"
13
+ },
14
+ "server": "./dist/server.js",
15
+ "app": "./dist/app.js"
16
+ },
17
+ "private": true,
18
+ "description": "Keep your conversation from drowning in child-thread reports when a thread delegates work. Background messages and completion notices move to a Notifications tab beside the feed.",
19
+ "license": "MIT",
20
+ "type": "module",
21
+ "exports": {
22
+ "./embed": "./embed.tsx"
23
+ },
24
+ "scripts": {
25
+ "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.app.json",
26
+ "test": "node --test \"*.test.ts\"",
27
+ "prepare:bundled": "bb-plugin-build prepare-bundled"
28
+ },
29
+ "dependencies": {
30
+ "zod": "^4.6.7"
31
+ },
32
+ "devDependencies": {
33
+ "@bb/plugin-build": "workspace:*",
34
+ "@get-bb/plugin-sdk": "workspace:*",
35
+ "@testing-library/react": "^16.3.3",
36
+ "@types/jsdom": "^30.0.0",
37
+ "@types/node": "^24.19.2",
38
+ "@types/react": "^19.0.0",
39
+ "@types/react-dom": "^19.0.0",
40
+ "esbuild": "0.28.1",
41
+ "jsdom": "^30.1.3",
42
+ "typescript": "^7.0.2"
43
+ }
44
+ }