@get-bb/plugin-sdk 0.6.136 → 0.6.138

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.
@@ -496,6 +496,7 @@ declare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
496
496
  changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{
497
497
  "host-connected": "host-connected";
498
498
  "host-disconnected": "host-disconnected";
499
+ "provider-cli-install-jobs-changed": "provider-cli-install-jobs-changed";
499
500
  "provider-cli-status-changed": "provider-cli-status-changed";
500
501
  "provider-commands-changed": "provider-commands-changed";
501
502
  "provider-model-catalog-changed": "provider-model-catalog-changed";
@@ -8704,6 +8705,64 @@ type HostPickFolderResponse = PickFolderResponse;
8704
8705
  type HostProviderCliStatusResponse = ProviderCliStatusResponse;
8705
8706
  type HostProviderCliInstallRequest = ProviderCliInstallRequest;
8706
8707
  type HostProviderCliInstallEvent = ProviderCliInstallEvent;
8708
+ declare const hostProviderCliInstallJobSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
8709
+ actionKind: z$1.ZodEnum<{
8710
+ install: "install";
8711
+ update: "update";
8712
+ }>;
8713
+ hostId: z$1.ZodString;
8714
+ id: z$1.ZodString;
8715
+ provider: z$1.ZodString;
8716
+ startedAt: z$1.ZodNumber;
8717
+ state: z$1.ZodLiteral<"running">;
8718
+ }, z$1.core.$strip>, z$1.ZodObject<{
8719
+ actionKind: z$1.ZodEnum<{
8720
+ install: "install";
8721
+ update: "update";
8722
+ }>;
8723
+ events: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
8724
+ command: z$1.ZodString;
8725
+ provider: z$1.ZodString;
8726
+ type: z$1.ZodLiteral<"started">;
8727
+ }, z$1.core.$strip>, z$1.ZodObject<{
8728
+ provider: z$1.ZodString;
8729
+ stream: z$1.ZodEnum<{
8730
+ stderr: "stderr";
8731
+ stdout: "stdout";
8732
+ }>;
8733
+ text: z$1.ZodString;
8734
+ type: z$1.ZodLiteral<"output">;
8735
+ }, z$1.core.$strip>, z$1.ZodObject<{
8736
+ exitCode: z$1.ZodNullable<z$1.ZodNumber>;
8737
+ provider: z$1.ZodString;
8738
+ signal: z$1.ZodNullable<z$1.ZodString>;
8739
+ success: z$1.ZodBoolean;
8740
+ type: z$1.ZodLiteral<"completed">;
8741
+ }, z$1.core.$strip>, z$1.ZodObject<{
8742
+ message: z$1.ZodString;
8743
+ provider: z$1.ZodString;
8744
+ type: z$1.ZodLiteral<"error">;
8745
+ }, z$1.core.$strip>], "type">>;
8746
+ finishedAt: z$1.ZodNumber;
8747
+ hostId: z$1.ZodString;
8748
+ id: z$1.ZodString;
8749
+ provider: z$1.ZodString;
8750
+ startedAt: z$1.ZodNumber;
8751
+ state: z$1.ZodLiteral<"completed">;
8752
+ }, z$1.core.$strip>, z$1.ZodObject<{
8753
+ actionKind: z$1.ZodEnum<{
8754
+ install: "install";
8755
+ update: "update";
8756
+ }>;
8757
+ error: z$1.ZodString;
8758
+ finishedAt: z$1.ZodNumber;
8759
+ hostId: z$1.ZodString;
8760
+ id: z$1.ZodString;
8761
+ provider: z$1.ZodString;
8762
+ startedAt: z$1.ZodNumber;
8763
+ state: z$1.ZodLiteral<"failed">;
8764
+ }, z$1.core.$strip>], "state">;
8765
+ type HostProviderCliInstallJob = z$1.infer<typeof hostProviderCliInstallJobSchema>;
8707
8766
 
8708
8767
  declare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{
8709
8768
  blocked: z$1.ZodOptional<z$1.ZodObject<{
@@ -17881,6 +17940,20 @@ interface HostPickFolderArgs extends HostPickFolderRequest {
17881
17940
  }
17882
17941
  interface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {
17883
17942
  hostId: string;
17943
+ signal?: AbortSignal;
17944
+ }
17945
+ interface HostProviderCliInstallJobArgs {
17946
+ hostId: string;
17947
+ jobId: string;
17948
+ signal?: AbortSignal;
17949
+ }
17950
+ interface HostProviderCliInstallJobWaitArgs extends HostProviderCliInstallJobArgs {
17951
+ onJob?: (job: HostProviderCliInstallJob) => void;
17952
+ }
17953
+ interface HostProviderCliInstallJobsArea {
17954
+ list(args: HostGetArgs): Promise<HostProviderCliInstallJob[]>;
17955
+ get(args: HostProviderCliInstallJobArgs): Promise<HostProviderCliInstallJob>;
17956
+ wait(args: HostProviderCliInstallJobWaitArgs): Promise<HostProviderCliInstallJob>;
17884
17957
  }
17885
17958
  interface HostListArgs {
17886
17959
  includeCreating?: boolean;
@@ -17929,6 +18002,8 @@ interface HostsArea {
17929
18002
  get(args: HostGetArgs): Promise<HostGetResult>;
17930
18003
  cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise<HostCloneDefaultPathResult>;
17931
18004
  installProviderCli(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallResult>;
18005
+ experimental_startProviderCliInstall(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallJob>;
18006
+ experimental_providerCliInstallJobs: HostProviderCliInstallJobsArea;
17932
18007
  list(args?: HostListArgs): Promise<HostListResult>;
17933
18008
  experimental_listProviders(args?: MachineProviderListArgs): Promise<MachineProviderListResult>;
17934
18009
  pathsExist(args: HostPathsExistArgs): Promise<HostPathsExistResult>;
@@ -581,6 +581,7 @@ declare const changedMessageSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
581
581
  changes: z$1.ZodReadonly<z$1.ZodArray<z$1.ZodEnum<{
582
582
  "host-connected": "host-connected";
583
583
  "host-disconnected": "host-disconnected";
584
+ "provider-cli-install-jobs-changed": "provider-cli-install-jobs-changed";
584
585
  "provider-cli-status-changed": "provider-cli-status-changed";
585
586
  "provider-commands-changed": "provider-commands-changed";
586
587
  "provider-model-catalog-changed": "provider-model-catalog-changed";
@@ -8919,6 +8920,64 @@ type HostPickFolderResponse = PickFolderResponse;
8919
8920
  type HostProviderCliStatusResponse = ProviderCliStatusResponse;
8920
8921
  type HostProviderCliInstallRequest = ProviderCliInstallRequest;
8921
8922
  type HostProviderCliInstallEvent = ProviderCliInstallEvent;
8923
+ declare const hostProviderCliInstallJobSchema: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
8924
+ actionKind: z$1.ZodEnum<{
8925
+ install: "install";
8926
+ update: "update";
8927
+ }>;
8928
+ hostId: z$1.ZodString;
8929
+ id: z$1.ZodString;
8930
+ provider: z$1.ZodString;
8931
+ startedAt: z$1.ZodNumber;
8932
+ state: z$1.ZodLiteral<"running">;
8933
+ }, z$1.core.$strip>, z$1.ZodObject<{
8934
+ actionKind: z$1.ZodEnum<{
8935
+ install: "install";
8936
+ update: "update";
8937
+ }>;
8938
+ events: z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
8939
+ command: z$1.ZodString;
8940
+ provider: z$1.ZodString;
8941
+ type: z$1.ZodLiteral<"started">;
8942
+ }, z$1.core.$strip>, z$1.ZodObject<{
8943
+ provider: z$1.ZodString;
8944
+ stream: z$1.ZodEnum<{
8945
+ stderr: "stderr";
8946
+ stdout: "stdout";
8947
+ }>;
8948
+ text: z$1.ZodString;
8949
+ type: z$1.ZodLiteral<"output">;
8950
+ }, z$1.core.$strip>, z$1.ZodObject<{
8951
+ exitCode: z$1.ZodNullable<z$1.ZodNumber>;
8952
+ provider: z$1.ZodString;
8953
+ signal: z$1.ZodNullable<z$1.ZodString>;
8954
+ success: z$1.ZodBoolean;
8955
+ type: z$1.ZodLiteral<"completed">;
8956
+ }, z$1.core.$strip>, z$1.ZodObject<{
8957
+ message: z$1.ZodString;
8958
+ provider: z$1.ZodString;
8959
+ type: z$1.ZodLiteral<"error">;
8960
+ }, z$1.core.$strip>], "type">>;
8961
+ finishedAt: z$1.ZodNumber;
8962
+ hostId: z$1.ZodString;
8963
+ id: z$1.ZodString;
8964
+ provider: z$1.ZodString;
8965
+ startedAt: z$1.ZodNumber;
8966
+ state: z$1.ZodLiteral<"completed">;
8967
+ }, z$1.core.$strip>, z$1.ZodObject<{
8968
+ actionKind: z$1.ZodEnum<{
8969
+ install: "install";
8970
+ update: "update";
8971
+ }>;
8972
+ error: z$1.ZodString;
8973
+ finishedAt: z$1.ZodNumber;
8974
+ hostId: z$1.ZodString;
8975
+ id: z$1.ZodString;
8976
+ provider: z$1.ZodString;
8977
+ startedAt: z$1.ZodNumber;
8978
+ state: z$1.ZodLiteral<"failed">;
8979
+ }, z$1.core.$strip>], "state">;
8980
+ type HostProviderCliInstallJob = z$1.infer<typeof hostProviderCliInstallJobSchema>;
8922
8981
 
8923
8982
  declare const pluginUpdateCheckEntrySchema: z$1.ZodObject<{
8924
8983
  blocked: z$1.ZodOptional<z$1.ZodObject<{
@@ -18108,6 +18167,20 @@ interface HostPickFolderArgs extends HostPickFolderRequest {
18108
18167
  }
18109
18168
  interface HostProviderCliInstallArgs extends HostProviderCliInstallRequest {
18110
18169
  hostId: string;
18170
+ signal?: AbortSignal;
18171
+ }
18172
+ interface HostProviderCliInstallJobArgs {
18173
+ hostId: string;
18174
+ jobId: string;
18175
+ signal?: AbortSignal;
18176
+ }
18177
+ interface HostProviderCliInstallJobWaitArgs extends HostProviderCliInstallJobArgs {
18178
+ onJob?: (job: HostProviderCliInstallJob) => void;
18179
+ }
18180
+ interface HostProviderCliInstallJobsArea {
18181
+ list(args: HostGetArgs): Promise<HostProviderCliInstallJob[]>;
18182
+ get(args: HostProviderCliInstallJobArgs): Promise<HostProviderCliInstallJob>;
18183
+ wait(args: HostProviderCliInstallJobWaitArgs): Promise<HostProviderCliInstallJob>;
18111
18184
  }
18112
18185
  interface HostListArgs {
18113
18186
  includeCreating?: boolean;
@@ -18156,6 +18229,8 @@ interface HostsArea {
18156
18229
  get(args: HostGetArgs): Promise<HostGetResult>;
18157
18230
  cloneDefaultPath(args: HostCloneDefaultPathArgs): Promise<HostCloneDefaultPathResult>;
18158
18231
  installProviderCli(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallResult>;
18232
+ experimental_startProviderCliInstall(args: HostProviderCliInstallArgs): Promise<HostProviderCliInstallJob>;
18233
+ experimental_providerCliInstallJobs: HostProviderCliInstallJobsArea;
18159
18234
  list(args?: HostListArgs): Promise<HostListResult>;
18160
18235
  experimental_listProviders(args?: MachineProviderListArgs): Promise<MachineProviderListResult>;
18161
18236
  pathsExist(args: HostPathsExistArgs): Promise<HostPathsExistResult>;
@@ -2033,7 +2033,8 @@ var HOST_CHANGE_KINDS = [
2033
2033
  "host-disconnected",
2034
2034
  "provider-model-catalog-changed",
2035
2035
  "provider-commands-changed",
2036
- "provider-cli-status-changed"
2036
+ "provider-cli-status-changed",
2037
+ "provider-cli-install-jobs-changed"
2037
2038
  ];
2038
2039
  var SYSTEM_CHANGE_KINDS = [
2039
2040
  "config-changed",
@@ -22432,7 +22432,7 @@ async function loadDeclaredSessionOptions(agent, parameterizedModelPicker, diale
22432
22432
  let timeout;
22433
22433
  const timeoutReached = new Promise((_, reject) => {
22434
22434
  timeout = setTimeout(() => {
22435
- connection.kill();
22435
+ void connection.kill();
22436
22436
  reject(
22437
22437
  new Error(
22438
22438
  `ACP option discovery timed out after ${MODEL_LIST_TIMEOUT_MS}ms`
@@ -22530,7 +22530,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
22530
22530
  let timeout;
22531
22531
  const timeoutReached = new Promise((_, reject) => {
22532
22532
  timeout = setTimeout(() => {
22533
- connection.kill();
22533
+ void connection.kill();
22534
22534
  reject(
22535
22535
  new Error(
22536
22536
  `The agent did not answer within ${MODEL_LIST_TIMEOUT_MS / 1e3} seconds while bb asked it for its models`
@@ -22666,7 +22666,7 @@ async function discoverAcpNativeModelSupport(args) {
22666
22666
  const timeoutReached = new Promise((resolve5) => {
22667
22667
  timeout = setTimeout(() => {
22668
22668
  timedOut = true;
22669
- args.connection.kill();
22669
+ void args.connection.kill();
22670
22670
  resolve5(supportByModel);
22671
22671
  }, ACP_NATIVE_REASONING_DISCOVERY_TIMEOUT_MS);
22672
22672
  });
@@ -23503,13 +23503,18 @@ async function startAgentSession(request) {
23503
23503
  let loadedConfigOptions;
23504
23504
  let loadedModels;
23505
23505
  let createdFreshSession = false;
23506
+ let forkHandoffProviderThreadId;
23506
23507
  if (request.kind === "fork") {
23507
- const forkedSession = await connection.request({
23508
+ const source = getSessionByProviderThreadId(
23509
+ request.sourceProviderThreadId
23510
+ );
23511
+ const handoffSource = source !== void 0 && !source.stopping && !source.connection.exited && source.capabilities?.session.fork === true && source.capabilities.session.close === true && (capabilities.session.resume || supportsLoadSession) ? source : void 0;
23512
+ const forkedSession = await (handoffSource?.connection ?? connection).request({
23508
23513
  method: "session/fork",
23509
23514
  params: {
23510
23515
  sessionId: request.sourceProviderThreadId,
23511
23516
  cwd: params.cwd,
23512
- mcpServers,
23517
+ mcpServers: handoffSource === void 0 ? mcpServers : [],
23513
23518
  ...additionalSessionDirectories(params, capabilities)
23514
23519
  },
23515
23520
  resultSchema: acpSessionForkResultSchema,
@@ -23520,21 +23525,33 @@ async function startAgentSession(request) {
23520
23525
  `ACP agent "${agentLabel}" returned an active session ID for session/fork.`
23521
23526
  );
23522
23527
  }
23523
- sessionId = forkedSession.sessionId;
23524
23528
  loadedConfigOptions = forkedSession.configOptions;
23525
23529
  loadedModels = forkedSession.models;
23526
- rememberGrokContextWindow(session, forkedSession.models);
23527
- } else if (request.kind === "resume" && (capabilities.session.resume || supportsLoadSession)) {
23530
+ if (handoffSource === void 0) {
23531
+ sessionId = forkedSession.sessionId;
23532
+ rememberGrokContextWindow(session, forkedSession.models);
23533
+ } else {
23534
+ forkHandoffProviderThreadId = forkedSession.sessionId;
23535
+ await handoffSource.connection.request({
23536
+ method: "session/close",
23537
+ params: { sessionId: forkedSession.sessionId },
23538
+ resultSchema: z51.unknown(),
23539
+ timeoutMs: ACP_SESSION_SETUP_TIMEOUT_MS
23540
+ });
23541
+ }
23542
+ }
23543
+ const resumeProviderThreadId = request.kind === "resume" ? request.resumeProviderThreadId : forkHandoffProviderThreadId;
23544
+ if (resumeProviderThreadId !== void 0 && (capabilities.session.resume || supportsLoadSession)) {
23528
23545
  const restoreMethod = capabilities.session.resume ? "session/resume" : "session/load";
23529
23546
  session.loading = true;
23530
- session.loadingSessionId = request.resumeProviderThreadId;
23547
+ session.loadingSessionId = resumeProviderThreadId;
23531
23548
  session.pendingLoadUsageUpdate = void 0;
23532
23549
  session.model.beginReplay();
23533
23550
  try {
23534
23551
  const configState = await connection.request({
23535
23552
  method: restoreMethod,
23536
23553
  params: {
23537
- sessionId: request.resumeProviderThreadId,
23554
+ sessionId: resumeProviderThreadId,
23538
23555
  cwd: params.cwd,
23539
23556
  mcpServers,
23540
23557
  ...additionalSessionDirectories(params, capabilities)
@@ -23542,12 +23559,16 @@ async function startAgentSession(request) {
23542
23559
  resultSchema: z51.union([acpConfigStateResultSchema, z51.null()]),
23543
23560
  timeoutMs: ACP_SESSION_SETUP_TIMEOUT_MS
23544
23561
  });
23545
- loadedConfigOptions = configState?.configOptions;
23546
- loadedModels = configState?.models;
23562
+ if (configState?.configOptions !== void 0) {
23563
+ loadedConfigOptions = configState.configOptions;
23564
+ }
23565
+ if (configState?.models !== void 0) {
23566
+ loadedModels = configState.models;
23567
+ }
23547
23568
  rememberGrokContextWindow(session, configState?.models);
23548
- sessionId = request.resumeProviderThreadId;
23569
+ sessionId = resumeProviderThreadId;
23549
23570
  } catch (error) {
23550
- if (isAcpAuthRequiredResponse(error)) {
23571
+ if (isAcpAuthRequiredResponse(error) || request.kind === "fork") {
23551
23572
  throw error;
23552
23573
  }
23553
23574
  sessionId = void 0;
@@ -23872,6 +23893,9 @@ function noteAgentResponse(session, method, result) {
23872
23893
  case "session/load":
23873
23894
  case "session/resume":
23874
23895
  case "session/fork":
23896
+ if (session.providerThreadId !== "") {
23897
+ return;
23898
+ }
23875
23899
  publishSessionStateEvents(
23876
23900
  session,
23877
23901
  session.model.applySessionSetup(result)
@@ -24908,7 +24932,12 @@ async function probeAcpAgent(request) {
24908
24932
  } catch (error) {
24909
24933
  return { reachable: false, reason: describe(error) };
24910
24934
  } finally {
24911
- connected.kill();
24935
+ void connected.kill().catch((error) => {
24936
+ process.stderr.write(
24937
+ `acp probe: stopping "${request.command}" failed: ${describe(error)}
24938
+ `
24939
+ );
24940
+ });
24912
24941
  }
24913
24942
  }
24914
24943
  var acpAgentProbeSchema = z52.union([
@@ -22432,7 +22432,7 @@ async function loadDeclaredSessionOptions(agent, parameterizedModelPicker, diale
22432
22432
  let timeout;
22433
22433
  const timeoutReached = new Promise((_, reject) => {
22434
22434
  timeout = setTimeout(() => {
22435
- connection.kill();
22435
+ void connection.kill();
22436
22436
  reject(
22437
22437
  new Error(
22438
22438
  `ACP option discovery timed out after ${MODEL_LIST_TIMEOUT_MS}ms`
@@ -22530,7 +22530,7 @@ async function loadSessionDiscoveredModels(agent, reasoningProbePriorityModelIds
22530
22530
  let timeout;
22531
22531
  const timeoutReached = new Promise((_, reject) => {
22532
22532
  timeout = setTimeout(() => {
22533
- connection.kill();
22533
+ void connection.kill();
22534
22534
  reject(
22535
22535
  new Error(
22536
22536
  `The agent did not answer within ${MODEL_LIST_TIMEOUT_MS / 1e3} seconds while bb asked it for its models`
@@ -22666,7 +22666,7 @@ async function discoverAcpNativeModelSupport(args) {
22666
22666
  const timeoutReached = new Promise((resolve5) => {
22667
22667
  timeout = setTimeout(() => {
22668
22668
  timedOut = true;
22669
- args.connection.kill();
22669
+ void args.connection.kill();
22670
22670
  resolve5(supportByModel);
22671
22671
  }, ACP_NATIVE_REASONING_DISCOVERY_TIMEOUT_MS);
22672
22672
  });
@@ -23503,13 +23503,18 @@ async function startAgentSession(request) {
23503
23503
  let loadedConfigOptions;
23504
23504
  let loadedModels;
23505
23505
  let createdFreshSession = false;
23506
+ let forkHandoffProviderThreadId;
23506
23507
  if (request.kind === "fork") {
23507
- const forkedSession = await connection.request({
23508
+ const source = getSessionByProviderThreadId(
23509
+ request.sourceProviderThreadId
23510
+ );
23511
+ const handoffSource = source !== void 0 && !source.stopping && !source.connection.exited && source.capabilities?.session.fork === true && source.capabilities.session.close === true && (capabilities.session.resume || supportsLoadSession) ? source : void 0;
23512
+ const forkedSession = await (handoffSource?.connection ?? connection).request({
23508
23513
  method: "session/fork",
23509
23514
  params: {
23510
23515
  sessionId: request.sourceProviderThreadId,
23511
23516
  cwd: params.cwd,
23512
- mcpServers,
23517
+ mcpServers: handoffSource === void 0 ? mcpServers : [],
23513
23518
  ...additionalSessionDirectories(params, capabilities)
23514
23519
  },
23515
23520
  resultSchema: acpSessionForkResultSchema,
@@ -23520,21 +23525,33 @@ async function startAgentSession(request) {
23520
23525
  `ACP agent "${agentLabel}" returned an active session ID for session/fork.`
23521
23526
  );
23522
23527
  }
23523
- sessionId = forkedSession.sessionId;
23524
23528
  loadedConfigOptions = forkedSession.configOptions;
23525
23529
  loadedModels = forkedSession.models;
23526
- rememberGrokContextWindow(session, forkedSession.models);
23527
- } else if (request.kind === "resume" && (capabilities.session.resume || supportsLoadSession)) {
23530
+ if (handoffSource === void 0) {
23531
+ sessionId = forkedSession.sessionId;
23532
+ rememberGrokContextWindow(session, forkedSession.models);
23533
+ } else {
23534
+ forkHandoffProviderThreadId = forkedSession.sessionId;
23535
+ await handoffSource.connection.request({
23536
+ method: "session/close",
23537
+ params: { sessionId: forkedSession.sessionId },
23538
+ resultSchema: z51.unknown(),
23539
+ timeoutMs: ACP_SESSION_SETUP_TIMEOUT_MS
23540
+ });
23541
+ }
23542
+ }
23543
+ const resumeProviderThreadId = request.kind === "resume" ? request.resumeProviderThreadId : forkHandoffProviderThreadId;
23544
+ if (resumeProviderThreadId !== void 0 && (capabilities.session.resume || supportsLoadSession)) {
23528
23545
  const restoreMethod = capabilities.session.resume ? "session/resume" : "session/load";
23529
23546
  session.loading = true;
23530
- session.loadingSessionId = request.resumeProviderThreadId;
23547
+ session.loadingSessionId = resumeProviderThreadId;
23531
23548
  session.pendingLoadUsageUpdate = void 0;
23532
23549
  session.model.beginReplay();
23533
23550
  try {
23534
23551
  const configState = await connection.request({
23535
23552
  method: restoreMethod,
23536
23553
  params: {
23537
- sessionId: request.resumeProviderThreadId,
23554
+ sessionId: resumeProviderThreadId,
23538
23555
  cwd: params.cwd,
23539
23556
  mcpServers,
23540
23557
  ...additionalSessionDirectories(params, capabilities)
@@ -23542,12 +23559,16 @@ async function startAgentSession(request) {
23542
23559
  resultSchema: z51.union([acpConfigStateResultSchema, z51.null()]),
23543
23560
  timeoutMs: ACP_SESSION_SETUP_TIMEOUT_MS
23544
23561
  });
23545
- loadedConfigOptions = configState?.configOptions;
23546
- loadedModels = configState?.models;
23562
+ if (configState?.configOptions !== void 0) {
23563
+ loadedConfigOptions = configState.configOptions;
23564
+ }
23565
+ if (configState?.models !== void 0) {
23566
+ loadedModels = configState.models;
23567
+ }
23547
23568
  rememberGrokContextWindow(session, configState?.models);
23548
- sessionId = request.resumeProviderThreadId;
23569
+ sessionId = resumeProviderThreadId;
23549
23570
  } catch (error) {
23550
- if (isAcpAuthRequiredResponse(error)) {
23571
+ if (isAcpAuthRequiredResponse(error) || request.kind === "fork") {
23551
23572
  throw error;
23552
23573
  }
23553
23574
  sessionId = void 0;
@@ -23872,6 +23893,9 @@ function noteAgentResponse(session, method, result) {
23872
23893
  case "session/load":
23873
23894
  case "session/resume":
23874
23895
  case "session/fork":
23896
+ if (session.providerThreadId !== "") {
23897
+ return;
23898
+ }
23875
23899
  publishSessionStateEvents(
23876
23900
  session,
23877
23901
  session.model.applySessionSetup(result)
@@ -24908,7 +24932,12 @@ async function probeAcpAgent(request) {
24908
24932
  } catch (error) {
24909
24933
  return { reachable: false, reason: describe(error) };
24910
24934
  } finally {
24911
- connected.kill();
24935
+ void connected.kill().catch((error) => {
24936
+ process.stderr.write(
24937
+ `acp probe: stopping "${request.command}" failed: ${describe(error)}
24938
+ `
24939
+ );
24940
+ });
24912
24941
  }
24913
24942
  }
24914
24943
  var acpAgentProbeSchema = z52.union([
@@ -2036,7 +2036,8 @@ var HOST_CHANGE_KINDS = [
2036
2036
  "host-disconnected",
2037
2037
  "provider-model-catalog-changed",
2038
2038
  "provider-commands-changed",
2039
- "provider-cli-status-changed"
2039
+ "provider-cli-status-changed",
2040
+ "provider-cli-install-jobs-changed"
2040
2041
  ];
2041
2042
  var SYSTEM_CHANGE_KINDS = [
2042
2043
  "config-changed",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.136",
3
+ "version": "0.6.138",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"
@@ -161,7 +161,8 @@
161
161
  "clean": "rimraf bundled-types dist tsconfig.tsbuildinfo",
162
162
  "prepack": "node --max-semi-space-size=128 --max-old-space-size=4096 scripts/build-bundled-dts.mjs && node scripts/build-runtime.mjs",
163
163
  "test": "vitest run --config vitest.config.ts",
164
- "typecheck": "tsrs --noEmit"
164
+ "typecheck": "tsrs --noEmit",
165
+ "lint:type-aware": "oxlint -c ../../.oxlintrc.type-aware.json"
165
166
  },
166
167
  "dependencies": {
167
168
  "@tanstack/react-query": "^5.106.1",