@get-bb/plugin-sdk 0.6.26 → 0.6.31

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.
@@ -49,14 +49,17 @@ declare const appSettingsSchema: z$1.ZodObject<{
49
49
  confirmThreadArchive: z$1.ZodBoolean;
50
50
  defaultMachineAccess: z$1.ZodNullable<z$1.ZodString>;
51
51
  defaultProviderId: z$1.ZodNullable<z$1.ZodString>;
52
+ keepHistoryAfterContextClear: z$1.ZodBoolean;
52
53
  machineGitCredentialsEnabled: z$1.ZodBoolean;
53
54
  machineServerUrl: z$1.ZodNullable<z$1.ZodString>;
54
55
  managedBranchPrefix: z$1.ZodString;
56
+ onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;
55
57
  providerCompletedTurnDisplay: z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
56
58
  collapse: "collapse";
57
59
  flat: "flat";
58
60
  }>>;
59
61
  providerOrder: z$1.ZodArray<z$1.ZodString>;
62
+ setupChecklistVisible: z$1.ZodBoolean;
60
63
  showDiagnosticEvents: z$1.ZodBoolean;
61
64
  showGitChanges: z$1.ZodBoolean;
62
65
  showKeyboardHints: z$1.ZodBoolean;
@@ -70,14 +73,17 @@ declare const appSettingsUpdateSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{
70
73
  confirmThreadArchive: z$1.ZodOptional<z$1.ZodBoolean>;
71
74
  defaultMachineAccess: z$1.ZodNullable<z$1.ZodString>;
72
75
  defaultProviderId: z$1.ZodNullable<z$1.ZodString>;
76
+ keepHistoryAfterContextClear: z$1.ZodOptional<z$1.ZodBoolean>;
73
77
  machineGitCredentialsEnabled: z$1.ZodBoolean;
74
78
  machineServerUrl: z$1.ZodNullable<z$1.ZodString>;
75
79
  managedBranchPrefix: z$1.ZodString;
80
+ onboardingCompletedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
76
81
  providerCompletedTurnDisplay: z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
77
82
  collapse: "collapse";
78
83
  flat: "flat";
79
84
  }>>;
80
85
  providerOrder: z$1.ZodArray<z$1.ZodString>;
86
+ setupChecklistVisible: z$1.ZodOptional<z$1.ZodBoolean>;
81
87
  showDiagnosticEvents: z$1.ZodBoolean;
82
88
  showGitChanges: z$1.ZodOptional<z$1.ZodBoolean>;
83
89
  showKeyboardHints: z$1.ZodBoolean;
@@ -90,14 +96,17 @@ declare const appSettingsUpdateSchema: z$1.ZodUnion<readonly [z$1.ZodObject<{
90
96
  confirmThreadArchive: z$1.ZodOptional<z$1.ZodBoolean>;
91
97
  defaultMachineAccess: z$1.ZodNullable<z$1.ZodString>;
92
98
  defaultProviderId: z$1.ZodNullable<z$1.ZodString>;
99
+ keepHistoryAfterContextClear: z$1.ZodOptional<z$1.ZodBoolean>;
93
100
  machineGitCredentialsEnabled: z$1.ZodBoolean;
94
101
  machineServerUrl: z$1.ZodNullable<z$1.ZodString>;
95
102
  managedBranchPrefix: z$1.ZodString;
103
+ onboardingCompletedAt: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
96
104
  providerCompletedTurnDisplay: z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
97
105
  collapse: "collapse";
98
106
  flat: "flat";
99
107
  }>>;
100
108
  providerOrder: z$1.ZodArray<z$1.ZodString>;
109
+ setupChecklistVisible: z$1.ZodOptional<z$1.ZodBoolean>;
101
110
  showGitChanges: z$1.ZodOptional<z$1.ZodBoolean>;
102
111
  showKeyboardHints: z$1.ZodBoolean;
103
112
  showUnhandledProviderEvents: z$1.ZodBoolean;
@@ -4457,6 +4466,14 @@ declare const mobileAppDownloads: {
4457
4466
  android: string;
4458
4467
  };
4459
4468
 
4469
+ interface EnvironmentRemoval {
4470
+ environmentId: string;
4471
+ removedAt: number;
4472
+ hostId: string | null;
4473
+ path: string | null;
4474
+ providerOwnedPath: boolean;
4475
+ }
4476
+
4460
4477
  declare const threadContextResponseSchema: z$1.ZodObject<{
4461
4478
  usage: z$1.ZodNullable<z$1.ZodObject<{
4462
4479
  estimated: z$1.ZodBoolean;
@@ -8177,6 +8194,7 @@ declare const hostDaemonCommandRegistry: {
8177
8194
  canInstall: z$1.ZodBoolean;
8178
8195
  canUpdate: z$1.ZodBoolean;
8179
8196
  installedVersion: z$1.ZodNullable<z$1.ZodString>;
8197
+ localLoginCommand: z$1.ZodOptional<z$1.ZodNullable<z$1.ZodString>>;
8180
8198
  loginCommand: z$1.ZodNullable<z$1.ZodString>;
8181
8199
  minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;
8182
8200
  planLabel: z$1.ZodNullable<z$1.ZodString>;
@@ -8366,6 +8384,20 @@ declare const hostDaemonCommandRegistry: {
8366
8384
  status: z$1.ZodLiteral<"error">;
8367
8385
  }, z$1.core.$loose>], "status">;
8368
8386
  }, z$1.core.$loose>], "supported">, "onlineRpc", true>;
8387
+ "host.discover_repos": HostDaemonCommandDescriptor<"host.discover_repos", z$1.ZodObject<{
8388
+ limit: z$1.ZodNumber;
8389
+ maxDepth: z$1.ZodNumber;
8390
+ sinceDays: z$1.ZodNumber;
8391
+ type: z$1.ZodLiteral<"host.discover_repos">;
8392
+ }, z$1.core.$strict>, z$1.ZodObject<{
8393
+ repos: z$1.ZodArray<z$1.ZodObject<{
8394
+ lastActivityAt: z$1.ZodString;
8395
+ name: z$1.ZodString;
8396
+ originUrl: z$1.ZodNullable<z$1.ZodString>;
8397
+ path: z$1.ZodString;
8398
+ }, z$1.core.$strict>>;
8399
+ truncated: z$1.ZodBoolean;
8400
+ }, z$1.core.$strict>, "onlineRpc", true>;
8369
8401
  "workspace.status": HostDaemonCommandDescriptor<"workspace.status", z$1.ZodObject<{
8370
8402
  environmentId: z$1.ZodString;
8371
8403
  maxUntrackedLineStatBytes: z$1.ZodNumber;
@@ -9120,6 +9152,17 @@ declare const hostDirectoryListingSchema: z$1.ZodObject<{
9120
9152
  parent: z$1.ZodNullable<z$1.ZodString>;
9121
9153
  }, z$1.core.$strip>;
9122
9154
  type HostDirectoryListing = z$1.infer<typeof hostDirectoryListingSchema>;
9155
+ declare const hostDiscoveredReposResponseSchema: z$1.ZodObject<{
9156
+ repos: z$1.ZodArray<z$1.ZodObject<{
9157
+ lastActivityAt: z$1.ZodString;
9158
+ name: z$1.ZodString;
9159
+ originUrl: z$1.ZodNullable<z$1.ZodString>;
9160
+ path: z$1.ZodString;
9161
+ projectId: z$1.ZodNullable<z$1.ZodString>;
9162
+ }, z$1.core.$strip>>;
9163
+ truncated: z$1.ZodBoolean;
9164
+ }, z$1.core.$strip>;
9165
+ type HostDiscoveredReposResponse = z$1.infer<typeof hostDiscoveredReposResponseSchema>;
9123
9166
  declare const hostCloneDefaultPathQuerySchema: z$1.ZodObject<{
9124
9167
  projectId: z$1.ZodString;
9125
9168
  }, z$1.core.$strip>;
@@ -10342,6 +10385,10 @@ type SystemExecutionOptionsQuery = z$1.infer<typeof systemExecutionOptionsQueryS
10342
10385
  declare const systemUsageLimitsQuerySchema: z$1.ZodObject<{
10343
10386
  hostId: z$1.ZodOptional<z$1.ZodString>;
10344
10387
  providerId: z$1.ZodOptional<z$1.ZodString>;
10388
+ refresh: z$1.ZodOptional<z$1.ZodEnum<{
10389
+ false: "false";
10390
+ true: "true";
10391
+ }>>;
10345
10392
  }, z$1.core.$strip>;
10346
10393
  type SystemUsageLimitsQuery = z$1.infer<typeof systemUsageLimitsQuerySchema>;
10347
10394
  declare const systemVoiceTranscriptionResponseSchema: z$1.ZodObject<{
@@ -10355,6 +10402,7 @@ declare const systemProviderStatesResponseSchema: z$1.ZodObject<{
10355
10402
  canUpdate: z$1.ZodBoolean;
10356
10403
  displayName: z$1.ZodString;
10357
10404
  installedVersion: z$1.ZodNullable<z$1.ZodString>;
10405
+ localLoginCommand: z$1.ZodNullable<z$1.ZodString>;
10358
10406
  loginCommand: z$1.ZodNullable<z$1.ZodString>;
10359
10407
  minimumSupportedVersion: z$1.ZodNullable<z$1.ZodString>;
10360
10408
  planLabel: z$1.ZodNullable<z$1.ZodString>;
@@ -10619,14 +10667,17 @@ declare const systemConfigResponseSchema: z$1.ZodObject<{
10619
10667
  confirmThreadArchive: z$1.ZodBoolean;
10620
10668
  defaultMachineAccess: z$1.ZodNullable<z$1.ZodString>;
10621
10669
  defaultProviderId: z$1.ZodNullable<z$1.ZodString>;
10670
+ keepHistoryAfterContextClear: z$1.ZodBoolean;
10622
10671
  machineGitCredentialsEnabled: z$1.ZodBoolean;
10623
10672
  machineServerUrl: z$1.ZodNullable<z$1.ZodString>;
10624
10673
  managedBranchPrefix: z$1.ZodString;
10674
+ onboardingCompletedAt: z$1.ZodNullable<z$1.ZodString>;
10625
10675
  providerCompletedTurnDisplay: z$1.ZodRecord<z$1.ZodString, z$1.ZodEnum<{
10626
10676
  collapse: "collapse";
10627
10677
  flat: "flat";
10628
10678
  }>>;
10629
10679
  providerOrder: z$1.ZodArray<z$1.ZodString>;
10680
+ setupChecklistVisible: z$1.ZodBoolean;
10630
10681
  showDiagnosticEvents: z$1.ZodBoolean;
10631
10682
  showGitChanges: z$1.ZodBoolean;
10632
10683
  showKeyboardHints: z$1.ZodBoolean;
@@ -13702,6 +13753,10 @@ declare const updateQueuedMessageRequestSchema: z$1.ZodObject<{
13702
13753
  }, z$1.core.$strip>], "type">>;
13703
13754
  }, z$1.core.$strip>;
13704
13755
  type UpdateQueuedMessageRequest = z$1.infer<typeof updateQueuedMessageRequestSchema>;
13756
+ declare const queuedMessageEditHoldResponseSchema: z$1.ZodObject<{
13757
+ leaseMs: z$1.ZodNumber;
13758
+ }, z$1.core.$strip>;
13759
+ type QueuedMessageEditHoldResponse = z$1.infer<typeof queuedMessageEditHoldResponseSchema>;
13705
13760
  declare const sendQueuedMessageRequestSchema: z$1.ZodObject<{
13706
13761
  mode: z$1.ZodEnum<{
13707
13762
  auto: "auto";
@@ -16711,6 +16766,10 @@ interface HostDirectoryArgs extends HostDirectoryQuery {
16711
16766
  hostId: string;
16712
16767
  signal?: AbortSignal;
16713
16768
  }
16769
+ interface HostDiscoverReposArgs {
16770
+ hostId: string;
16771
+ signal?: AbortSignal;
16772
+ }
16714
16773
  interface HostCloneDefaultPathArgs extends HostCloneDefaultPathQuery {
16715
16774
  hostId: string;
16716
16775
  signal?: AbortSignal;
@@ -16743,6 +16802,7 @@ type HostDeleteResult = {
16743
16802
  ok: true;
16744
16803
  };
16745
16804
  type HostDirectoryResult = HostDirectoryListing;
16805
+ type HostDiscoverReposResult = HostDiscoveredReposResponse;
16746
16806
  type HostGetResult = Host & {
16747
16807
  connectMachineId: string | null;
16748
16808
  threadStorageRootPath: string | null;
@@ -16768,6 +16828,7 @@ interface HostsArea {
16768
16828
  delete(args: HostDeleteArgs): Promise<HostDeleteResult>;
16769
16829
  experimental_deleteOldServerCopy(args: HostActionArgs): Promise<DeleteOldServerCopyResponse>;
16770
16830
  directory(args: HostDirectoryArgs): Promise<HostDirectoryResult>;
16831
+ experimental_discoverRepos(args: HostDiscoverReposArgs): Promise<HostDiscoverReposResult>;
16771
16832
  get(args: HostGetArgs): Promise<HostGetResult>;
16772
16833
  cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise<HostCloneDefaultPathResult>;
16773
16834
  installProviderCli(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallResult>;
@@ -17085,6 +17146,9 @@ interface PluginListUpdateResultsArgs {
17085
17146
  interface PluginGetSafeModeArgs {
17086
17147
  signal?: AbortSignal;
17087
17148
  }
17149
+ interface PluginRpcDiscoveryArgs extends PluginRpcDiscoveryQuery {
17150
+ signal?: AbortSignal;
17151
+ }
17088
17152
  interface PluginSetSafeModeArgs {
17089
17153
  enabled: boolean;
17090
17154
  }
@@ -17144,7 +17208,7 @@ interface PluginUpdateJobsArea {
17144
17208
  }): Promise<PluginUpdateJob[]>;
17145
17209
  }
17146
17210
  interface PluginsArea {
17147
- experimental_discoverRpc(args?: PluginRpcDiscoveryQuery): Promise<PublishedPluginRpcMethod[]>;
17211
+ experimental_discoverRpc(args?: PluginRpcDiscoveryArgs): Promise<PublishedPluginRpcMethod[]>;
17148
17212
  experimental_getSafeMode(args?: PluginGetSafeModeArgs): Promise<PluginSafeModeResult>;
17149
17213
  experimental_setSafeMode(args: PluginSetSafeModeArgs): Promise<PluginSetSafeModeResult>;
17150
17214
  experimental_pruneCache(args?: PluginPruneCacheArgs): Promise<PluginPruneCacheResult>;
@@ -17376,7 +17440,8 @@ interface SystemConfigArgs {
17376
17440
  interface SystemExecutionOptionsArgs extends SystemExecutionOptionsQuery {
17377
17441
  signal?: AbortSignal;
17378
17442
  }
17379
- interface SystemUsageLimitsArgs extends SystemUsageLimitsQuery {
17443
+ interface SystemUsageLimitsArgs extends Omit<SystemUsageLimitsQuery, "refresh"> {
17444
+ refresh?: boolean;
17380
17445
  signal?: AbortSignal;
17381
17446
  }
17382
17447
  interface SystemVersionArgs {
@@ -17687,6 +17752,10 @@ type ThreadQueuedMessageUpdateResult = ThreadQueuedMessage;
17687
17752
  type ThreadQueuedMessageDeleteResult = {
17688
17753
  ok: true;
17689
17754
  };
17755
+ type ThreadQueuedMessageEditHoldResult = QueuedMessageEditHoldResponse;
17756
+ type ThreadQueuedMessageEditHoldReleaseResult = {
17757
+ ok: true;
17758
+ };
17690
17759
  type ThreadQueuedMessageReorderResult = ThreadQueuedMessageListResponse;
17691
17760
  type ThreadQueuedMessageSendResult = SendQueuedMessageResponse;
17692
17761
  type ThreadQueuedMessageGroupBoundaryResult = ThreadQueuedMessageListResponse;
@@ -17917,6 +17986,8 @@ interface ThreadEventsArea {
17917
17986
  interface ThreadQueuedMessagesArea {
17918
17987
  create(args: ThreadQueuedMessageCreateArgs): Promise<ThreadQueuedMessageCreateResult>;
17919
17988
  delete(args: ThreadQueuedMessageTargetArgs): Promise<ThreadQueuedMessageDeleteResult>;
17989
+ experimental_holdForEdit(args: ThreadQueuedMessageTargetArgs): Promise<ThreadQueuedMessageEditHoldResult>;
17990
+ experimental_releaseEditHold(args: ThreadQueuedMessageTargetArgs): Promise<ThreadQueuedMessageEditHoldReleaseResult>;
17920
17991
  list(args: ThreadQueuedMessageArgs): Promise<ThreadQueuedMessagesResult>;
17921
17992
  reorder(args: ThreadQueuedMessageReorderArgs): Promise<ThreadQueuedMessageReorderResult>;
17922
17993
  send(args: ThreadQueuedMessageSendArgs): Promise<ThreadQueuedMessageSendResult>;
@@ -19353,6 +19424,15 @@ interface PluginCodeThemeState {
19353
19424
  /** null only before the first theme file resolves. */
19354
19425
  theme: PluginCodeThemeData | null;
19355
19426
  }
19427
+ /**
19428
+ * What {@link PluginSdkApp.experimental_copyToClipboard} writes: plain text,
19429
+ * plus an HTML representation for paste targets that accept rich text.
19430
+ * Without `html`, only plain text is written.
19431
+ */
19432
+ interface ExperimentalClipboardContent {
19433
+ text: string;
19434
+ html?: string;
19435
+ }
19356
19436
  /**
19357
19437
  * The `threads` area of {@link PluginBrowserBbSdk}: bb's public thread API
19358
19438
  * with the calling plugin's identity filled in. `spawn` and `fork` stamp
@@ -21187,9 +21267,11 @@ interface BbNavigate {
21187
21267
  focusPrompt?: boolean;
21188
21268
  }): void;
21189
21269
  /**
21190
- * Open one of this plugin's registered thread-panel actions in the current
21191
- * thread surface. Returns false when the surface has no thread side panel or
21192
- * the action is unavailable.
21270
+ * Open one of this plugin's registered panel actions in the current
21271
+ * surface's side panel: a `threadPanelAction` in a thread, or an
21272
+ * `experimental_newThreadPanelAction` on the New thread screen. Plugin
21273
+ * commands use the same opener. Returns false when the surface has no side
21274
+ * panel actions (plugin pages) or the action is unavailable.
21193
21275
  */
21194
21276
  openThreadPanel(options: PluginTargetedPanelActionOpenOptions): boolean;
21195
21277
  /**
@@ -21202,6 +21284,20 @@ interface BbNavigate {
21202
21284
  experimental_openFilePreview(options: ExperimentalFileOpenOptions): boolean;
21203
21285
  /** Open a live file in this client's preferred external file target. */
21204
21286
  experimental_openFileExternally(options: ExperimentalFileOpenOptions): boolean;
21287
+ /**
21288
+ * Show a terminal session in this surface's BB terminal panel: select its
21289
+ * tab, adding one when needed, and reveal the panel. Create the session
21290
+ * first with `useSdk().terminals.create`, whose scope chooses the thread,
21291
+ * environment, or host directory it runs in. A thread surface accepts only
21292
+ * that thread's terminals, the New thread screen only terminals in its
21293
+ * current terminal scope, and a plugin page any terminal. Resolves false
21294
+ * for unknown or exited terminals and surfaces without a terminal panel.
21295
+ * Closing the tab closes the terminal. Experimental: see
21296
+ * docs/api_to_audit.md.
21297
+ */
21298
+ experimental_openTerminal(options: {
21299
+ terminalId: string;
21300
+ }): Promise<boolean>;
21205
21301
  }
21206
21302
  /**
21207
21303
  * Everything `@get-bb/plugin-sdk/app` resolves to at runtime. The BB app builds
@@ -21418,6 +21514,17 @@ interface PluginSdkApp {
21418
21514
  * docs/api_to_audit.md.
21419
21515
  */
21420
21516
  experimental_useCodeTheme(): PluginCodeThemeState;
21517
+ /**
21518
+ * Writes content to the system clipboard through bb's own clipboard writer,
21519
+ * the one bb's copy actions use. A plain function, callable from
21520
+ * components, content scripts, and command callbacks. bb Desktop writes
21521
+ * through the native clipboard, so copies work without window focus or a
21522
+ * secure origin; browsers use the Clipboard API, then the copy command.
21523
+ * Resolves true once the clipboard holds the content and false when every
21524
+ * write path failed; it never rejects. Callers own their success and
21525
+ * failure feedback. Experimental: see docs/api_to_audit.md.
21526
+ */
21527
+ experimental_copyToClipboard(content: ExperimentalClipboardContent): Promise<boolean>;
21421
21528
  /**
21422
21529
  * The host-owned chat component (see {@link ThreadChatProps}). Together
21423
21530
  * with `Markdown`, the only components the SDK ships — everything else
@@ -22005,6 +22112,9 @@ interface PluginTurnFailedEvent {
22005
22112
  * queued row GET /threads/:id/queued-messages serves.
22006
22113
  */
22007
22114
  interface PluginThreadEventPayloads {
22115
+ "experimental_environment.removed": {
22116
+ removal: EnvironmentRemoval;
22117
+ };
22008
22118
  /** Debounced per thread (at most once per second), with the latest sequence and current thread DTO. Reading history does not emit this event. */
22009
22119
  "experimental_thread.events": {
22010
22120
  thread: ThreadResponse;
@@ -22635,7 +22745,7 @@ interface PluginInteractionRequest {
22635
22745
  rendererId: string;
22636
22746
  title: string;
22637
22747
  payload: JsonValue;
22638
- /** Defaults to ten minutes; capped at one hour. */
22748
+ /** Defaults to ten minutes; capped at seven days. */
22639
22749
  timeoutMs?: number;
22640
22750
  /**
22641
22751
  * How the form reads as a timeline row while it waits and once it settles,
@@ -23913,4 +24023,4 @@ declare function cliCommand<const TOptions extends CliOptions = Record<string, n
23913
24023
  declare function defineCli(spec: PluginCliSpec): PluginCliRegistration;
23914
24024
 
23915
24025
  export { PLUGIN_CLI_OUTPUT_MAX_BYTES, PluginCliError, cliCommand, defineCli, defineRpcContract, experimental_defineHostEntry };
23916
- export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalComposerCommandRegistration, ExperimentalComposerPopupRegistration, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginRpcCaller, ExperimentalPluginRpcHandlerContext, ExperimentalPluginRpcHandlersWithContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, ExperimentalVoiceInputTextareaProps, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiCompleteOptions, PluginAiServiceDeclaration, PluginAiServiceStatus, PluginAiServices, PluginAiTranscribeOptions, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCli, PluginCliBooleanOption, PluginCliCommand, PluginCliCommandInfo, PluginCliConstraint, PluginCliContext, PluginCliDurationOption, PluginCliDurationUnit, PluginCliEnumOption, PluginCliErrorCode, PluginCliExecutionResult, PluginCliIntegerOption, PluginCliOption, PluginCliOptionValues, PluginCliOutputLimitError, PluginCliPositional, PluginCliPositionalValues, PluginCliRegistration, PluginCliResult, PluginCliRunInput, PluginCliSpec, PluginCliStringOption, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProvider, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentProvidersState, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionDescription, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderCompletedTurnDisplay, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRowLabels, PluginRowPresentation, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
24026
+ export type { BbContext, BbNavigate, BbPluginApi, BranchPickerProps, BranchesState, CheckoutState, CodeOverflowMode, ComposerAttachment, ComposerCustomization, ComposerDraft, ComposerDraftReplacement, ComposerDraftSnapshot, ComposerInsertOptions, ComposerInsertPart, ComposerMention, ComposerPlusMenuItem, ComposerRichTextSpec, ComposerSelection, ComposerSendMenuItem, ComposerSubmitOptions, DiffProps, DiffViewMode, ExperimentalAppIcons, ExperimentalAppOverlayProps, ExperimentalAppOverlayRegistration, ExperimentalAppPanel, ExperimentalAppPanelSurface, ExperimentalClipboardContent, ExperimentalComposerCommandRegistration, ExperimentalComposerPopupRegistration, ExperimentalDesktopBrowserAcquireInput, ExperimentalDesktopBrowserCreateInput, ExperimentalDesktopBrowserLease, ExperimentalDesktopBrowserScope, ExperimentalDesktopBrowsersArea, ExperimentalDiffFileContent, ExperimentalDiffFullFileContents, ExperimentalFileLinkProps, ExperimentalFileLocation, ExperimentalFileOpenOptions, ExperimentalFixedTabTargetContract, ExperimentalFixedTabTargetState, ExperimentalHostCallOptions, ExperimentalHostClient, ExperimentalHostEntry, ExperimentalHostPaths, ExperimentalHostRpcContext, ExperimentalHostRpcHandlers, ExperimentalHostSignalContract, ExperimentalHostSignalEvent, ExperimentalHostSignals, ExperimentalHostWatchChange, ExperimentalHostWatchChangeType, ExperimentalHostWatchEvent, ExperimentalHostWatchListener, ExperimentalHostWatchOptions, ExperimentalHostWatchSubscription, ExperimentalHostWorkerLease, ExperimentalIconProps, ExperimentalIconRegistration, ExperimentalLiveFileTarget, ExperimentalOpenFixedTabOptions, ExperimentalPermissionModePickerProps, ExperimentalPluginBrowserPage, ExperimentalPluginBrowserPageEvaluateOptions, ExperimentalPluginBrowserPageWorld, ExperimentalPluginBrowserToolbarActionProps, ExperimentalPluginBrowserToolbarActionRegistration, ExperimentalPluginFixedTabReference, ExperimentalPluginMentionImage, ExperimentalPluginProviderEnvContext, ExperimentalPluginProviderEnvEntry, ExperimentalPluginProviderEnvHealth, ExperimentalPluginProviderEnvHealthContext, ExperimentalPluginRpcCaller, ExperimentalPluginRpcHandlerContext, ExperimentalPluginRpcHandlersWithContext, ExperimentalPluginWebSocket, ExperimentalPluginWebSocketContext, ExperimentalPluginWebSocketHandler, ExperimentalPluginWebSocketHandlers, ExperimentalProviderIconProps, ExperimentalProviderModelPickerProps, ExperimentalProviderModelPickerRouting, ExperimentalProviderModelPickerValue, ExperimentalQuestionFormHost, ExperimentalQuestionShortcut, ExperimentalSidebarFooter, ExperimentalSidebarFooterActionContext, ExperimentalSidebarFooterActionRegistration, ExperimentalSidebarFooterDisclosureController, ExperimentalSidebarFooterDisclosureProps, ExperimentalSidebarFooterDisclosureRegistration, ExperimentalSidebarFooterItemBase, ExperimentalSidebarFooterItemRegistration, ExperimentalSidebarHeaderProps, ExperimentalSidebarHeaderRegistration, ExperimentalSidebarNavigationAction, ExperimentalSidebarNavigationActions, ExperimentalSidebarNavigationActivationOptions, ExperimentalSidebarNavigationIcon, ExperimentalSidebarNavigationIconProps, ExperimentalSidebarNavigationItem, ExperimentalSidebarNavigationProps, ExperimentalSidebarNavigationRegistration, ExperimentalSidebarNavigationShortcut, ExperimentalSidebarNavigationSplit, ExperimentalSidebarNavigationSplitOptions, ExperimentalSidebarNavigationState, ExperimentalVoiceInputTextareaProps, JsonValue, MachineBootstrapApi, MachineBootstrapRequest, MachineExecutor, MachineExecutorRequest, MarkdownProps, MessageDispatchHookContext, MessageDispatchHookDecision, NewThreadComposerProps, NewThreadRequest, PluginAgentConfiguration, PluginAgentConfigurationContext, PluginAgentToolContentPart, PluginAgentToolContext, PluginAgentToolRegistrationBase, PluginAgentToolResult, PluginAgentToolSelection, PluginAgents, PluginAiCompleteOptions, PluginAiServiceDeclaration, PluginAiServiceStatus, PluginAiServices, PluginAiTranscribeOptions, PluginAppBuilder, PluginAppCommands, PluginAppComposer, PluginAppContentScripts, PluginAppDefinition, PluginAppSetup, PluginAppSlots, PluginBackground, PluginBbSdk, PluginBoundThreadsArea, PluginBrowserBbSdk, PluginCli, PluginCliBooleanOption, PluginCliCommand, PluginCliCommandInfo, PluginCliConstraint, PluginCliContext, PluginCliDurationOption, PluginCliDurationUnit, PluginCliEnumOption, PluginCliErrorCode, PluginCliExecutionResult, PluginCliIntegerOption, PluginCliOption, PluginCliOptionValues, PluginCliOutputLimitError, PluginCliPositional, PluginCliPositionalValues, PluginCliRegistration, PluginCliResult, PluginCliRunInput, PluginCliSpec, PluginCliStringOption, PluginCodeThemeData, PluginCodeThemeState, PluginCodeThemeTokenRule, PluginCommandContext, PluginCommandRegistration, PluginCommandShortcut, PluginComposerApi, PluginComposerMention, PluginComposerScope, PluginComposerTextEffect, PluginComposerThreadRowStatus, PluginContentScriptContext, PluginContentScriptDisposer, PluginContentScriptRegistration, PluginDiffRendererProps, PluginDiffRendererRegistration, PluginDispatchAttemptKind, PluginDispatchEnvironmentIntent, PluginDispatchExecution, PluginDispatchExecutionSources, PluginDispatchInput, PluginEnvironmentProvider, PluginEnvironmentProviderDeclaration, PluginEnvironmentProviderInputsChange, PluginEnvironmentProviderInputsProps, PluginEnvironmentProviderInputsRegistration, PluginEnvironmentProviderRequirements, PluginEnvironmentProvidersState, PluginEnvironmentValidateDecision, PluginEnvironments, PluginEvents, PluginFileOpenerProps, PluginFileOpenerRegistration, PluginFileOpenerSource, PluginFixedTabDeclaration, PluginFixedTabRegistration, PluginHomepageSectionProps, PluginHomepageSectionRegistration, PluginHookHandler, PluginHookName, PluginHookSignatures, PluginHooks, PluginHosts, PluginHttp, PluginHttpAuthMode, PluginHttpHandler, PluginInteractionCancelReason, PluginInteractionDescription, PluginInteractionRequest, PluginInteractionResult, PluginKvStorage, PluginLogger, PluginMachineProviderDeclaration, PluginMachineProviderInputsChange, PluginMachineProviderInputsProps, PluginMachineProviderInputsRegistration, PluginMachineValidateDecision, PluginMachines, PluginMentionItem, PluginMentionProviderRegistration, PluginMentionSearchContext, PluginMentionTrigger, PluginMessageActionContext, PluginMessageActionRegistration, PluginMessageDirectiveMessage, PluginMessageDirectiveOpenWorkspaceFile, PluginMessageDirectiveProps, PluginMessageDirectiveRegistration, PluginNavPanelProps, PluginNavPanelRegistration, PluginNewThreadPanelActionContext, PluginNewThreadPanelActionRegistration, PluginNewThreadPanelProps, PluginPanelActionOpenOptions, PluginPendingInteractionProps, PluginPendingInteractionRegistration, PluginPendingInteractionView, PluginProviderCapabilities, PluginProviderCompletedTurnDisplay, PluginProviderComposerAction, PluginProviderDeclaration, PluginProviderExtensionKindDeclaration, PluginProviderFallbackModel, PluginProviderIconRegistration, PluginProviderMaintenance, PluginProviderModelCatalogScope, PluginProviderNativeRootEntry, PluginProviderNativeRoots, PluginProviderOptionDescriptor, PluginProviderOptionsContext, PluginProviderPermissionMode, PluginProviderReasoningLevel, PluginProviderStrings, PluginProviders, PluginProvidersState, PluginRealtime, PluginRealtimeConnectionState, PluginRowLabels, PluginRowPresentation, PluginRpc, PluginRpcCallArgs, PluginRpcClient, PluginRpcContract, PluginRpcError, PluginRpcErrorCode, PluginRpcHandlers, PluginRpcIssuePathSegment, PluginRpcMethodContract, PluginRpcResult, PluginRpcValidationIssue, PluginSdkApp, PluginServerAccess, PluginServerApi, PluginSettingDescriptor, PluginSettingDescriptors, PluginSettingValue, PluginSettings, PluginSettingsHandle, PluginSettingsSectionProps, PluginSettingsSectionRegistration, PluginSettingsState, PluginSettingsValues, PluginSharedPortTunnelIdentity, PluginSidebarFooterActionContext, PluginSidebarFooterActionProps, PluginSidebarFooterActionRegistration, PluginSidebarProject, PluginSidebarPullRequest, PluginSidebarSection, PluginSidebarSplitLayout, PluginSidebarSplitPane, PluginSidebarThread, PluginSidebarThreadActions, PluginSidebarThreadActivity, PluginSidebarThreadDraftState, PluginSidebarThreadIndicator, PluginSidebarThreadPullRequestState, PluginSidebarThreadRowStatus, PluginSidebarThreadShortcut, PluginSidebarThreadSplit, PluginSidebarThreadsState, PluginSourceCodeRendererProps, PluginSourceCodeRendererRegistration, PluginStatusApi, PluginStorage, PluginTargetedPanelActionOpenOptions, PluginThreadEventHandler, PluginThreadEventName, PluginThreadEventPayloads, PluginThreadHeaderActionProps, PluginThreadHeaderActionRegistration, PluginThreadListProps, PluginThreadListRegistration, PluginThreadPanelActionContext, PluginThreadPanelActionRegistration, PluginThreadPanelProps, PluginThreadTitleProps, PluginTimelineRendererProps, PluginTimelineRendererRegistration, PluginTimelineRendererRow, PluginTimelineRowPresentation, PluginTimelineRowStatus, PluginTurnFailedEvent, PluginUi, ReadonlyJsonValue, ServerAccessGrant, ServerAccessProviderDeclaration, SourceCodeLineRange, SourceCodeProps, StandardSchemaV1, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1Result, ThreadChatMessageAction, ThreadChatMessageReference, ThreadChatProps, UrlLinkProps, UseBranchesArgs, UseCheckoutStateArgs };
package/dist/app.js CHANGED
@@ -141,6 +141,9 @@ var experimental_useProviders = runtimeFunction(
141
141
  var experimental_useCodeTheme = runtimeFunction(
142
142
  "experimental_useCodeTheme"
143
143
  );
144
+ var experimental_copyToClipboard = runtimeFunction(
145
+ "experimental_copyToClipboard"
146
+ );
144
147
  export {
145
148
  Markdown,
146
149
  ThreadChat,
@@ -158,6 +161,7 @@ export {
158
161
  experimental_SidebarNavigationIcon,
159
162
  experimental_SourceCode,
160
163
  experimental_VoiceInputTextarea,
164
+ experimental_copyToClipboard,
161
165
  experimental_useAppPanel,
162
166
  experimental_useBranches,
163
167
  experimental_useCheckoutState,
package/dist/host.js CHANGED
@@ -854,12 +854,22 @@ async function listLsofProcessCwds() {
854
854
  }
855
855
  async function resolveSweepDirectory(directory) {
856
856
  const resolved = resolve(directory);
857
- let parent = dirname(resolved);
858
- try {
859
- parent = await realpath(parent);
860
- } catch {
857
+ let ancestor = dirname(resolved);
858
+ const missing = [basename(resolved)];
859
+ for (; ; ) {
860
+ try {
861
+ ancestor = await realpath(ancestor);
862
+ break;
863
+ } catch {
864
+ }
865
+ const parent = dirname(ancestor);
866
+ if (parent === ancestor) {
867
+ break;
868
+ }
869
+ missing.unshift(basename(ancestor));
870
+ ancestor = parent;
861
871
  }
862
- const canonical = join(parent, basename(resolved));
872
+ const canonical = join(ancestor, ...missing);
863
873
  try {
864
874
  if ((await lstat(canonical)).isSymbolicLink()) {
865
875
  return null;
@@ -872,13 +882,15 @@ async function listProcessesWithCwdUnder(args) {
872
882
  if (process.platform === "win32") {
873
883
  return [];
874
884
  }
875
- const directory = await resolveSweepDirectory(args.directory);
876
- if (directory === null) {
885
+ const directories = (await Promise.all(args.directories.map(resolveSweepDirectory))).filter((directory) => directory !== null);
886
+ if (directories.length === 0) {
877
887
  return [];
878
888
  }
879
889
  const all = process.platform === "linux" ? await listLinuxProcessCwds() : await listLsofProcessCwds();
880
890
  return all.filter(
881
- (entry) => entry.pid !== process.pid && isPathUnderDirectory(entry.cwd, directory)
891
+ (entry) => entry.pid !== process.pid && directories.some(
892
+ (directory) => isPathUnderDirectory(entry.cwd, directory)
893
+ )
882
894
  );
883
895
  }
884
896
  function isProcessAlive(pid) {
@@ -907,7 +919,7 @@ async function killProcessesWithCwdUnder(args) {
907
919
  const signalled = /* @__PURE__ */ new Map();
908
920
  for (let round = 0; round < MAX_CWD_SWEEP_ROUNDS; round += 1) {
909
921
  const targets = await listProcessesWithCwdUnder({
910
- directory: args.directory
922
+ directories: args.directories
911
923
  });
912
924
  if (targets.length === 0) {
913
925
  break;
@@ -918,7 +930,7 @@ async function killProcessesWithCwdUnder(args) {
918
930
  await delay(50);
919
931
  }
920
932
  const survivors = await listProcessesWithCwdUnder({
921
- directory: args.directory
933
+ directories: args.directories
922
934
  });
923
935
  if (survivors.length === 0) {
924
936
  break;
@@ -950,20 +962,108 @@ function sanitizeInheritedChildProcessEnv(args) {
950
962
 
951
963
  // ../process-utils/src/process-info.ts
952
964
  import { execFile } from "node:child_process";
965
+ import path2 from "node:path";
953
966
  import { promisify } from "node:util";
954
967
  var execFileAsync = promisify(execFile);
968
+ async function readProcessIdentity(pid) {
969
+ if (!Number.isSafeInteger(pid) || pid <= 0) return null;
970
+ if (process.platform === "win32") return readWindowsProcess(pid);
971
+ try {
972
+ const { stdout } = await execFileAsync(
973
+ "ps",
974
+ ["-p", String(pid), "-o", "etime=", "-o", "command="],
975
+ {
976
+ timeout: 5e3,
977
+ maxBuffer: 1024 * 1024
978
+ }
979
+ );
980
+ const match = stdout.trim().match(/^(\S+)\s+([\s\S]+)$/u);
981
+ if (match === null) return null;
982
+ const elapsed = parseElapsedSeconds(match[1] ?? "");
983
+ return {
984
+ command: match[2] ?? null,
985
+ startedAt: elapsed === null ? null : Date.now() - elapsed * 1e3
986
+ };
987
+ } catch {
988
+ return null;
989
+ }
990
+ }
991
+ async function readWindowsProcess(pid) {
992
+ try {
993
+ const pending = execFileAsync(
994
+ path2.join(
995
+ process.env.SystemRoot ?? "C:\\Windows",
996
+ "System32",
997
+ "WindowsPowerShell",
998
+ "v1.0",
999
+ "powershell.exe"
1000
+ ),
1001
+ [
1002
+ "-NoProfile",
1003
+ "-NonInteractive",
1004
+ "-Command",
1005
+ [
1006
+ "$ErrorActionPreference = 'Stop'",
1007
+ "[Console]::OutputEncoding = [System.Text.UTF8Encoding]::new($false)",
1008
+ `Get-CimInstance Win32_Process -Filter 'ProcessId = ${pid}' | ForEach-Object { @{ command = $_.CommandLine; startedAt = ([DateTimeOffset]$_.CreationDate).ToUnixTimeMilliseconds() } | ConvertTo-Json -Compress }`
1009
+ ].join("; ")
1010
+ ],
1011
+ {
1012
+ encoding: "utf8",
1013
+ windowsHide: true,
1014
+ timeout: 3e4,
1015
+ maxBuffer: 1024 * 1024
1016
+ }
1017
+ );
1018
+ pending.child.stdin?.end();
1019
+ const { stdout } = await pending;
1020
+ const value = JSON.parse(stdout);
1021
+ if (typeof value !== "object" || value === null || !("command" in value) || !("startedAt" in value) || typeof value.command !== "string" && value.command !== null || typeof value.startedAt !== "number" || !Number.isFinite(value.startedAt))
1022
+ return null;
1023
+ return { command: value.command, startedAt: value.startedAt };
1024
+ } catch {
1025
+ return null;
1026
+ }
1027
+ }
1028
+ function parseElapsedSeconds(rawElapsed) {
1029
+ const match = rawElapsed.trim().match(/^(?:(?:(\d+)-)?(\d+):)?(\d{1,2}):(\d{2})$/u);
1030
+ if (match === null) {
1031
+ return null;
1032
+ }
1033
+ const days = Number(match[1] ?? "0");
1034
+ const hours = Number(match[2] ?? "0");
1035
+ const minutes = Number(match[3]);
1036
+ const seconds = Number(match[4]);
1037
+ return ((days * 24 + hours) * 60 + minutes) * 60 + seconds;
1038
+ }
955
1039
 
956
1040
  // ../process-utils/src/performance-diagnostics.ts
957
1041
  import { Session } from "node:inspector/promises";
958
1042
  var PROFILE_RETENTION_MS = 12 * 60 * 60 * 1e3;
959
1043
  var MAX_PROFILE_BYTES = 12 * 1024 * 1024;
1044
+
1045
+ // src/kill-processes.ts
1046
+ function experimental_killProcessesWithCwdUnder(args) {
1047
+ if ("directory" in args && typeof args.directory === "string")
1048
+ return killProcessesWithCwdUnder({
1049
+ ...args,
1050
+ directories: [args.directory]
1051
+ });
1052
+ return killProcessesWithCwdUnder(args);
1053
+ }
1054
+
1055
+ // src/process-identity.ts
1056
+ function experimental_readProcessIdentity(pid) {
1057
+ return readProcessIdentity(pid);
1058
+ }
960
1059
  export {
961
1060
  experimental_defineHostEntry,
962
1061
  experimental_filterResolvedNativeRoots,
963
- killProcessesWithCwdUnder as experimental_killProcessesWithCwdUnder,
1062
+ experimental_killProcessesWithCwdUnder,
964
1063
  experimental_nativeRootsHostContract,
965
1064
  experimental_nativeRootsResolveInputSchema,
966
1065
  experimental_nativeRootsResolveOutputSchema,
1066
+ experimental_readProcessIdentity,
967
1067
  experimental_resolveClaudePluginRoots,
968
1068
  experimental_resolveVendorPluginRoots,
969
1069
  sanitizeInheritedChildProcessEnv as experimental_sanitizeInheritedChildProcessEnv,
@@ -50,6 +50,7 @@ var RESERVED_BB_CLI_COMMANDS = [
50
50
  // ../domain/src/plugin-interaction-limits.ts
51
51
  var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
52
52
  var PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES = 64 * 1024;
53
+ var PLUGIN_INTERACTION_MAX_TIMEOUT_MS = 7 * 24 * 60 * 60 * 1e3;
53
54
 
54
55
  // ../domain/src/provider-fork.ts
55
56
  import { z } from "zod";
@@ -2453,8 +2454,10 @@ function normalizeInteractionRequest(request) {
2453
2454
  throw new Error("ui.requestInput payload must be JSON-serializable");
2454
2455
  }
2455
2456
  const timeoutMs = request.timeoutMs ?? 10 * 60 * 1e3;
2456
- if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > 60 * 60 * 1e3) {
2457
- throw new Error("ui.requestInput timeoutMs must be between 1 and 3600000");
2457
+ if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > PLUGIN_INTERACTION_MAX_TIMEOUT_MS) {
2458
+ throw new Error(
2459
+ `ui.requestInput timeoutMs must be between 1 and ${PLUGIN_INTERACTION_MAX_TIMEOUT_MS}`
2460
+ );
2458
2461
  }
2459
2462
  if (request.describeSubmission !== void 0 && typeof request.describeSubmission !== "function") {
2460
2463
  throw new Error("ui.requestInput describeSubmission must be a function");