@halcyonlabs/app 0.47.0-halcyon.320 → 0.47.0-halcyon.323
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/index.d.ts +12 -12
- package/package.json +1 -1
- package/server/dist/builtin-plugins/notify-feed/dist/app.js +1 -1
- package/server/dist/builtin-plugins/notify-feed/dist/server.js +2 -2
- package/server/dist/builtin-plugins/orbit/dist/app.js +28 -28
- package/server/dist/builtin-plugins/orbit/dist/assets/orbit/revision +1 -1
- package/server/dist/builtin-plugins/orbit/dist/server.js +271 -271
package/dist/index.d.ts
CHANGED
|
@@ -5766,9 +5766,9 @@ declare const hostDaemonCommandRegistry: {
|
|
|
5766
5766
|
}, z$1.core.$strict>, z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
|
|
5767
5767
|
kind: z$1.ZodLiteral<"wording">;
|
|
5768
5768
|
status: z$1.ZodEnum<{
|
|
5769
|
+
unavailable: "unavailable";
|
|
5769
5770
|
pass: "pass";
|
|
5770
5771
|
revise: "revise";
|
|
5771
|
-
unavailable: "unavailable";
|
|
5772
5772
|
}>;
|
|
5773
5773
|
}, z$1.core.$strict>, z$1.ZodObject<{
|
|
5774
5774
|
kind: z$1.ZodLiteral<"review">;
|
|
@@ -6129,8 +6129,8 @@ declare const hostDaemonCommandRegistry: {
|
|
|
6129
6129
|
skillFilePath: z$1.ZodString;
|
|
6130
6130
|
}, z$1.core.$strict>], "kind">>;
|
|
6131
6131
|
instructionMode: z$1.ZodEnum<{
|
|
6132
|
-
append: "append";
|
|
6133
6132
|
replace: "replace";
|
|
6133
|
+
append: "append";
|
|
6134
6134
|
}>;
|
|
6135
6135
|
type: z$1.ZodLiteral<"thread.rewind.prepare">;
|
|
6136
6136
|
leaseId: z$1.ZodString;
|
|
@@ -6278,8 +6278,8 @@ declare const hostDaemonCommandRegistry: {
|
|
|
6278
6278
|
skillFilePath: z$1.ZodString;
|
|
6279
6279
|
}, z$1.core.$strict>], "kind">>;
|
|
6280
6280
|
instructionMode: z$1.ZodEnum<{
|
|
6281
|
-
append: "append";
|
|
6282
6281
|
replace: "replace";
|
|
6282
|
+
append: "append";
|
|
6283
6283
|
}>;
|
|
6284
6284
|
type: z$1.ZodLiteral<"thread.start">;
|
|
6285
6285
|
requestId: z$1.ZodString;
|
|
@@ -6742,8 +6742,8 @@ declare const hostDaemonCommandRegistry: {
|
|
|
6742
6742
|
envPassthrough: z$1.ZodArray<z$1.ZodString>;
|
|
6743
6743
|
}, z$1.core.$strict>;
|
|
6744
6744
|
instructionMode: z$1.ZodEnum<{
|
|
6745
|
-
append: "append";
|
|
6746
6745
|
replace: "replace";
|
|
6746
|
+
append: "append";
|
|
6747
6747
|
}>;
|
|
6748
6748
|
projectId: z$1.ZodString;
|
|
6749
6749
|
providerId: z$1.ZodString;
|
|
@@ -6958,8 +6958,8 @@ declare const hostDaemonCommandRegistry: {
|
|
|
6958
6958
|
envPassthrough: z$1.ZodArray<z$1.ZodString>;
|
|
6959
6959
|
}, z$1.core.$strict>;
|
|
6960
6960
|
instructionMode: z$1.ZodEnum<{
|
|
6961
|
-
append: "append";
|
|
6962
6961
|
replace: "replace";
|
|
6962
|
+
append: "append";
|
|
6963
6963
|
}>;
|
|
6964
6964
|
projectId: z$1.ZodString;
|
|
6965
6965
|
providerId: z$1.ZodString;
|
|
@@ -7860,14 +7860,14 @@ declare const hostDaemonCommandRegistry: {
|
|
|
7860
7860
|
modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
7861
7861
|
sha256: z$1.ZodString;
|
|
7862
7862
|
}, z$1.core.$strip>, z$1.ZodObject<{
|
|
7863
|
-
path: z$1.ZodString;
|
|
7864
7863
|
contentEncoding: z$1.ZodEnum<{
|
|
7865
7864
|
base64: "base64";
|
|
7866
7865
|
utf8: "utf8";
|
|
7867
7866
|
}>;
|
|
7868
|
-
mimeType: z$1.ZodOptional<z$1.ZodString>;
|
|
7869
|
-
sizeBytes: z$1.ZodNumber;
|
|
7870
7867
|
sha256: z$1.ZodString;
|
|
7868
|
+
sizeBytes: z$1.ZodNumber;
|
|
7869
|
+
path: z$1.ZodString;
|
|
7870
|
+
mimeType: z$1.ZodOptional<z$1.ZodString>;
|
|
7871
7871
|
modifiedAtMs: z$1.ZodOptional<z$1.ZodNumber>;
|
|
7872
7872
|
notModified: z$1.ZodLiteral<true>;
|
|
7873
7873
|
}, z$1.core.$strip>]>, "onlineRpc", true>;
|
|
@@ -8132,10 +8132,10 @@ declare const hostDaemonCommandRegistry: {
|
|
|
8132
8132
|
health: z$1.ZodObject<{
|
|
8133
8133
|
status: z$1.ZodEnum<{
|
|
8134
8134
|
unknown: "unknown";
|
|
8135
|
+
ready: "ready";
|
|
8135
8136
|
not_installed: "not_installed";
|
|
8136
8137
|
unauthenticated: "unauthenticated";
|
|
8137
8138
|
expired: "expired";
|
|
8138
|
-
ready: "ready";
|
|
8139
8139
|
unsupported_version: "unsupported_version";
|
|
8140
8140
|
}>;
|
|
8141
8141
|
statusMessage: z$1.ZodNullable<z$1.ZodString>;
|
|
@@ -8183,9 +8183,9 @@ declare const hostDaemonCommandRegistry: {
|
|
|
8183
8183
|
executablePath: z$1.ZodNullable<z$1.ZodString>;
|
|
8184
8184
|
installed: z$1.ZodBoolean;
|
|
8185
8185
|
installSource: z$1.ZodEnum<{
|
|
8186
|
-
external: "external";
|
|
8187
8186
|
notInstalled: "notInstalled";
|
|
8188
8187
|
npmGlobal: "npmGlobal";
|
|
8188
|
+
external: "external";
|
|
8189
8189
|
}>;
|
|
8190
8190
|
currentVersion: z$1.ZodNullable<z$1.ZodString>;
|
|
8191
8191
|
latestVersion: z$1.ZodNullable<z$1.ZodString>;
|
|
@@ -8631,8 +8631,8 @@ declare const hostDaemonCommandRegistry: {
|
|
|
8631
8631
|
message: z$1.ZodNullable<z$1.ZodString>;
|
|
8632
8632
|
state: z$1.ZodNullable<z$1.ZodEnum<{
|
|
8633
8633
|
pending: "pending";
|
|
8634
|
-
ready: "ready";
|
|
8635
8634
|
activating: "activating";
|
|
8635
|
+
ready: "ready";
|
|
8636
8636
|
}>>;
|
|
8637
8637
|
}, z$1.core.$strict>, "onlineRpc", true>;
|
|
8638
8638
|
"server_move.prepare": HostDaemonCommandDescriptor<"server_move.prepare", z$1.ZodObject<{
|
|
@@ -8734,9 +8734,9 @@ declare const providerCliStatusResponseSchema: z$1.ZodRecord<z$1.ZodString, z$1.
|
|
|
8734
8734
|
executablePath: z$1.ZodNullable<z$1.ZodString>;
|
|
8735
8735
|
installed: z$1.ZodBoolean;
|
|
8736
8736
|
installSource: z$1.ZodEnum<{
|
|
8737
|
-
external: "external";
|
|
8738
8737
|
notInstalled: "notInstalled";
|
|
8739
8738
|
npmGlobal: "npmGlobal";
|
|
8739
|
+
external: "external";
|
|
8740
8740
|
}>;
|
|
8741
8741
|
currentVersion: z$1.ZodNullable<z$1.ZodString>;
|
|
8742
8742
|
latestVersion: z$1.ZodNullable<z$1.ZodString>;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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(`,
|
|
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 the server 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 the server 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 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \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 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.",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
2
|
`),d=e.map(n).join(`,
|
|
3
3
|
`),r=e.map(s=>`${n(s)}>*`).join(`,
|
|
4
4
|
`);return`${o}{display:none!important}
|
|
@@ -4,6 +4,6 @@ import { fileURLToPath as __fileURLToPath } from "node:url";
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
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:
|
|
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 the server 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 the server 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 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \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 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.",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"),De=/^(?:(?:\[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(De,""),"clean"),Oe=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,Ke=i(e=>{let n=R.get(e);return n?n.failed?Date.now()-n.at>=6e4:Date.now()-n.at>=6e5:!0},"isStale");function Ue(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(Ue,"glue");async function Be(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"),D=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=D.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(D,r,l);try{l.rows=await d,o&&(l.at=m)}catch(y){throw a||D.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(Ke).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:Oe(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:[]})),K=Ue([...fe,...ye]),Z=[...new Set(K.flatMap(t=>t.senderThreadId?[t.senderThreadId]:[]))],U=await V(K.flatMap(t=>[t.text,t.reply,...t.parts.map(T=>T.text)]),Z),we=K.map(t=>{let G=(t.senderThreadId?R.get(t.senderThreadId):null)?.title??null;return{...t,senderTitle:G,text:U(t.text),reply:U(t.reply),parts:t.parts.map(M=>({...M,text:U(M.text)}))}}),B={};for(let t of Z){let T=R.get(t);T?.failed?B[t]="gone":T?.archived&&(B[t]="archived")}return{hideIds:g,items:we,closed:B}},"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"),O=new Map,me=i(r=>{let a=O.get(r);if(a&&Date.now()-a.at<Ne)return a.value;let m=ue(r);return H(O,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(),O.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(Be,"plugin");export{Be as default,Ue as glue,ve as rpcContract,Oe as systemTextOf,ie as toolOf};
|
|
9
9
|
//# sourceMappingURL=server.js.map
|