@get-bb/plugin-sdk 0.6.109 → 0.6.116

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.
@@ -1755,7 +1755,8 @@ var queuedMessageWaitingOnKindValues = [
1755
1755
  "provisioning",
1756
1756
  "host-offline",
1757
1757
  "interaction",
1758
- "plugin"
1758
+ "plugin",
1759
+ "superseded"
1759
1760
  ];
1760
1761
  var queuedMessageWaitingOnKindSchema = z9.enum(
1761
1762
  queuedMessageWaitingOnKindValues
@@ -1778,7 +1779,8 @@ var queuedMessageWaitingOnSchema = z9.discriminatedUnion("kind", [
1778
1779
  kind: z9.literal("plugin"),
1779
1780
  pluginId: pluginIdSchema,
1780
1781
  reason: queuedMessageWaitReasonSchema
1781
- })
1782
+ }),
1783
+ z9.object({ kind: z9.literal("superseded") })
1782
1784
  ]);
1783
1785
  var QUEUED_MESSAGE_FAILURE_REASON_MAX_LENGTH = 200;
1784
1786
  var queuedMessageFailureReasonSchema = z9.string().min(1).max(QUEUED_MESSAGE_FAILURE_REASON_MAX_LENGTH);
@@ -3582,6 +3584,113 @@ var experimental_THREAD_ACTION_GROUPS = {
3582
3584
  lifecycle: "4_lifecycle"
3583
3585
  };
3584
3586
 
3587
+ // src/internal/thread-status.ts
3588
+ var INDICATOR_LABELS = {
3589
+ "unread-error": "Unread thread failed",
3590
+ "waiting-for-input": "Thread needs user input",
3591
+ "working-draft": "Thread working with unsubmitted draft",
3592
+ workflow: "Workflow running",
3593
+ "background-agent": "Background agent running",
3594
+ "background-command": "Background command running",
3595
+ "plan-mode": "Plan mode active",
3596
+ goal: "Goal active",
3597
+ runtime: "Thread working",
3598
+ "queued-failed": "Queued message failed to send",
3599
+ "queued-waiting": "Thread has a message waiting to send",
3600
+ draft: "Thread has unsubmitted draft",
3601
+ "unread-success": "Unread thread succeeded"
3602
+ };
3603
+ var RUNNING_RUNTIME_STATUSES = {
3604
+ active: true,
3605
+ provisioning: true,
3606
+ starting: true,
3607
+ stopping: true,
3608
+ error: false,
3609
+ idle: false,
3610
+ pending: false,
3611
+ "waiting-for-host": false
3612
+ };
3613
+ var DONE_THREAD_STATUSES = {
3614
+ error: true,
3615
+ idle: true,
3616
+ active: false,
3617
+ starting: false,
3618
+ stopping: false,
3619
+ pending: false
3620
+ };
3621
+ var INDICATORS_OVER_ROW_STATUS = /* @__PURE__ */ new Set(["runtime", "unread-error", "waiting-for-input"]);
3622
+ function threadIndicatorLabel(indicator) {
3623
+ return indicator === "none" ? null : INDICATOR_LABELS[indicator];
3624
+ }
3625
+ function visibleThreadRowStatus(indicator, rowStatus) {
3626
+ return INDICATORS_OVER_ROW_STATUS.has(indicator) ? null : rowStatus;
3627
+ }
3628
+ function isUnreadDoneThread(thread) {
3629
+ return thread.parentThreadId === null && thread.isUnread && DONE_THREAD_STATUSES[thread.status];
3630
+ }
3631
+ function addThreadFlags(flags, thread) {
3632
+ const unreadDone = isUnreadDoneThread(thread);
3633
+ flags.pending ||= thread.hasPendingInteraction;
3634
+ flags.unreadError ||= unreadDone && thread.status === "error";
3635
+ flags.unreadSuccess ||= unreadDone && thread.status !== "error";
3636
+ flags.runtime ||= RUNNING_RUNTIME_STATUSES[thread.runtimeStatus];
3637
+ flags.workflow ||= thread.activity.workflows > 0;
3638
+ flags.backgroundAgent ||= thread.activity.backgroundAgents > 0;
3639
+ flags.backgroundCommand ||= thread.activity.backgroundCommands > 0;
3640
+ flags.planMode ||= thread.activity.planMode > 0;
3641
+ flags.goal ||= thread.activity.goals > 0;
3642
+ }
3643
+ function resolveIndicator(flags, queuedWork, hasUnsubmittedDraft, isWorking) {
3644
+ if (flags.unreadError) return "unread-error";
3645
+ if (flags.pending) return "waiting-for-input";
3646
+ if (hasUnsubmittedDraft && isWorking) return "working-draft";
3647
+ if (flags.planMode) return "plan-mode";
3648
+ if (flags.goal) return "goal";
3649
+ if (flags.runtime) return "runtime";
3650
+ if (flags.workflow) return "workflow";
3651
+ if (queuedWork === "failed") return "queued-failed";
3652
+ if (flags.unreadSuccess) return "unread-success";
3653
+ if (flags.backgroundAgent) return "background-agent";
3654
+ if (flags.backgroundCommand) return "background-command";
3655
+ if (queuedWork === "waiting") return "queued-waiting";
3656
+ if (hasUnsubmittedDraft) return "draft";
3657
+ return "none";
3658
+ }
3659
+ function experimental_resolveThreadStatus({
3660
+ thread,
3661
+ hiddenThreads,
3662
+ hasUnsubmittedDraft,
3663
+ rowStatus
3664
+ }) {
3665
+ const flags = {
3666
+ pending: false,
3667
+ unreadError: false,
3668
+ unreadSuccess: false,
3669
+ runtime: false,
3670
+ workflow: false,
3671
+ backgroundAgent: false,
3672
+ backgroundCommand: false,
3673
+ planMode: false,
3674
+ goal: false
3675
+ };
3676
+ if (thread !== null) addThreadFlags(flags, thread);
3677
+ for (const hiddenThread of hiddenThreads) addThreadFlags(flags, hiddenThread);
3678
+ const isThreadWorking = flags.runtime || flags.workflow || flags.backgroundAgent || flags.backgroundCommand || flags.planMode || flags.goal;
3679
+ const indicator = resolveIndicator(
3680
+ flags,
3681
+ thread?.queuedWork ?? "none",
3682
+ hasUnsubmittedDraft,
3683
+ isThreadWorking
3684
+ );
3685
+ const shownRowStatus = visibleThreadRowStatus(indicator, rowStatus);
3686
+ return {
3687
+ indicator,
3688
+ rowStatus: shownRowStatus,
3689
+ label: shownRowStatus?.label ?? threadIndicatorLabel(indicator),
3690
+ isWorking: isThreadWorking || rowStatus?.tone === "running"
3691
+ };
3692
+ }
3693
+
3585
3694
  // src/thread-info-groups.ts
3586
3695
  var experimental_THREAD_CONTEXT_SEGMENT_GROUPS = {
3587
3696
  thread: "1_thread",
@@ -3835,6 +3944,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
3835
3944
  homepageSections: [],
3836
3945
  settingsSections: [],
3837
3946
  appOverlays: [],
3947
+ setupGuideSections: [],
3838
3948
  navPanels: [],
3839
3949
  tabs: [],
3840
3950
  get threadPanelActions() {
@@ -3879,6 +3989,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
3879
3989
  homepageSection: /* @__PURE__ */ new Set(),
3880
3990
  settingsSection: /* @__PURE__ */ new Set(),
3881
3991
  appOverlay: /* @__PURE__ */ new Set(),
3992
+ setupGuideSection: /* @__PURE__ */ new Set(),
3882
3993
  navPanel: /* @__PURE__ */ new Set(),
3883
3994
  tab: /* @__PURE__ */ new Set(),
3884
3995
  newThreadPanelAction: /* @__PURE__ */ new Set(),
@@ -4081,6 +4192,15 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
4081
4192
  component: requireComponent(kind, registration.component)
4082
4193
  });
4083
4194
  },
4195
+ internal_DO_NOT_USE_setupGuideSection(registration) {
4196
+ const kind = "slots.internal_DO_NOT_USE_setupGuideSection";
4197
+ const id = requireSlotId(kind, registration?.id);
4198
+ requireUniqueId(kind, seenIds.setupGuideSection, id);
4199
+ collected.setupGuideSections.push({
4200
+ id,
4201
+ component: requireComponent(kind, registration.component)
4202
+ });
4203
+ },
4084
4204
  navPanel(registration) {
4085
4205
  const kind = "slots.navPanel";
4086
4206
  const id = requireSlotId(kind, registration?.id);
@@ -5838,6 +5958,7 @@ var testPluginSdkApp = {
5838
5958
  },
5839
5959
  ThreadTitle: TestThreadTitle,
5840
5960
  experimental_ThreadStatusGlyph: TestThreadStatusGlyph,
5961
+ experimental_resolveThreadStatus,
5841
5962
  experimental_ThreadRowMetadata: TestThreadRowMetadata,
5842
5963
  useEnvironmentProviders() {
5843
5964
  return useSlotEnv("useEnvironmentProviders").environmentProviders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.109",
3
+ "version": "0.6.116",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"
@@ -92,6 +92,12 @@
92
92
  "import": "./dist/internal/composer-view.js",
93
93
  "default": "./dist/internal/composer-view.js"
94
94
  },
95
+ "./internal/thread-status": {
96
+ "source": "./src/internal/thread-status.ts",
97
+ "types": "./bundled-types/bb-plugin-sdk-internal-thread-status.d.ts",
98
+ "import": "./dist/internal/thread-status.js",
99
+ "default": "./dist/internal/thread-status.js"
100
+ },
95
101
  "./internal/file-navigation-validation": {
96
102
  "source": "./src/internal/file-navigation-validation.ts",
97
103
  "types": "./bundled-types/bb-plugin-sdk-internal-file-navigation-validation.d.ts",