@get-bb/plugin-sdk 0.6.5 → 0.6.9

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.
@@ -31,7 +31,6 @@ var RESERVED_BB_CLI_COMMANDS = [
31
31
  "guide",
32
32
  "help",
33
33
  "machine",
34
- "manager",
35
34
  "marketplace",
36
35
  "plugin",
37
36
  "project",
@@ -542,7 +542,12 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
542
542
  "description",
543
543
  registration.description
544
544
  );
545
+ const page = registration.experimental_page;
546
+ if (page !== void 0 && page !== "mobile") {
547
+ throw new Error(`${kind}: experimental_page must be "mobile"`);
548
+ }
545
549
  collected.settingsSections.push({
550
+ ...page !== void 0 ? { experimental_page: page } : {},
546
551
  id,
547
552
  ...title !== void 0 ? { title } : {},
548
553
  ...description !== void 0 ? { description } : {},
@@ -1826,25 +1826,7 @@ var turnRequestRejectedEventDataSchema = z13.object({
1826
1826
  var systemErrorEventDataSchema = z13.object({
1827
1827
  code: z13.string().optional(),
1828
1828
  message: z13.string(),
1829
- detail: z13.string().optional(),
1830
- reconnectAttempt: z13.number().int().positive().optional(),
1831
- reconnectTotal: z13.number().int().positive().optional()
1832
- }).superRefine((value, ctx) => {
1833
- const hasReconnectAttempt = value.reconnectAttempt !== void 0;
1834
- const hasReconnectTotal = value.reconnectTotal !== void 0;
1835
- if (hasReconnectAttempt !== hasReconnectTotal) {
1836
- ctx.addIssue({
1837
- code: z13.ZodIssueCode.custom,
1838
- message: "system/error reconnectAttempt and reconnectTotal must be provided together"
1839
- });
1840
- return;
1841
- }
1842
- if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
1843
- ctx.addIssue({
1844
- code: z13.ZodIssueCode.custom,
1845
- message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
1846
- });
1847
- }
1829
+ detail: z13.string().optional()
1848
1830
  });
1849
1831
  var ownershipChangeOperationActionValues = [
1850
1832
  "assign",
@@ -2755,46 +2737,20 @@ var unscopedSystemEventSchema = z16.discriminatedUnion("type", [
2755
2737
  }).merge(systemProviderTurnWatchdogEventDataSchema)
2756
2738
  ]);
2757
2739
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
2758
- var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
2759
- function isEventPropertyBag(value) {
2760
- return typeof value === "object" && value !== null && !Array.isArray(value);
2761
- }
2762
- var rejectLegacyClientRequestSequenceSchema = z16.unknown().superRefine((value, ctx) => {
2763
- if (!isEventPropertyBag(value)) {
2764
- return;
2765
- }
2766
- if (Object.hasOwn(value, legacyClientRequestKey)) {
2767
- ctx.addIssue({
2768
- code: z16.ZodIssueCode.custom,
2769
- message: "legacy request sequence field is no longer accepted",
2770
- path: [legacyClientRequestKey]
2771
- });
2772
- }
2773
- const item = value.item;
2774
- if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
2740
+ var threadEventSchema = z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2741
+ const result = validateThreadEventScope({
2742
+ type: event.type,
2743
+ scope: event.scope
2744
+ });
2745
+ if (!result.valid) {
2775
2746
  ctx.addIssue({
2776
2747
  code: z16.ZodIssueCode.custom,
2777
- message: "legacy user-message request sequence field is no longer accepted",
2778
- path: ["item", legacyClientRequestKey]
2748
+ message: result.message ?? "Invalid thread event scope",
2749
+ path: ["scope"]
2779
2750
  });
2751
+ return;
2780
2752
  }
2781
2753
  });
2782
- var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
2783
- z16.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
2784
- const result = validateThreadEventScope({
2785
- type: event.type,
2786
- scope: event.scope
2787
- });
2788
- if (!result.valid) {
2789
- ctx.addIssue({
2790
- code: z16.ZodIssueCode.custom,
2791
- message: result.message ?? "Invalid thread event scope",
2792
- path: ["scope"]
2793
- });
2794
- return;
2795
- }
2796
- })
2797
- );
2798
2754
  var threadEventTypeValues = [
2799
2755
  ...providerEventTypeValues,
2800
2756
  ...systemEventTypeValues
@@ -3083,7 +3039,8 @@ var providerMaintenanceParamsSchema = z22.object({
3083
3039
  }).passthrough();
3084
3040
  var providerInstallationRequirementSchema = z22.enum(["thread_rewind"]);
3085
3041
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
3086
- requirement: providerInstallationRequirementSchema.optional()
3042
+ requirement: providerInstallationRequirementSchema.optional(),
3043
+ checkUpdates: z22.boolean().default(true)
3087
3044
  });
3088
3045
  var providerHealthSchema = z22.object({
3089
3046
  status: z22.enum([
@@ -4590,9 +4547,7 @@ var acpInitializeResultSchema = z35.object({
4590
4547
  fork: z35.object({}).passthrough().nullable().optional()
4591
4548
  }).passthrough().optional(),
4592
4549
  promptCapabilities: z35.object({
4593
- image: z35.boolean().optional(),
4594
- audio: z35.boolean().optional(),
4595
- embeddedContext: z35.boolean().optional()
4550
+ image: z35.boolean().optional()
4596
4551
  }).passthrough().optional()
4597
4552
  }).passthrough().optional(),
4598
4553
  authMethods: z35.array(z35.object({ id: z35.string() }).passthrough()).optional()
@@ -4816,7 +4771,6 @@ var ACP_COMPACTION_COMPLETED_METHOD = "acp/compaction/completed";
4816
4771
  var ACP_UPDATE_METHOD = "acp/update";
4817
4772
  var ACP_FS_WRITE_METHOD = "acp/fs/write";
4818
4773
  var ACP_WARNING_METHOD = "acp/warning";
4819
- var ACP_BRIDGE_NO_ACTIVE_TURN_ERROR_CODE = -32001;
4820
4774
  var acpTurnStartedNotificationParamsSchema = z36.object({
4821
4775
  threadId: z36.string().min(1)
4822
4776
  }).passthrough();
@@ -10459,7 +10413,7 @@ async function handleRequest2(request) {
10459
10413
  }
10460
10414
  if (session.activePromptKind !== "turn") {
10461
10415
  const message = "No active turn to steer";
10462
- sendError(request.id, ACP_BRIDGE_NO_ACTIVE_TURN_ERROR_CODE, message, {
10416
+ sendError(request.id, BRIDGE_JSON_RPC_ERRORS.NO_ACTIVE_TURN, message, {
10463
10417
  recovery: { kind: "staleTurn", message, retryable: false }
10464
10418
  });
10465
10419
  return;
@@ -915,25 +915,7 @@ var turnRequestRejectedEventDataSchema = z11.object({
915
915
  var systemErrorEventDataSchema = z11.object({
916
916
  code: z11.string().optional(),
917
917
  message: z11.string(),
918
- detail: z11.string().optional(),
919
- reconnectAttempt: z11.number().int().positive().optional(),
920
- reconnectTotal: z11.number().int().positive().optional()
921
- }).superRefine((value, ctx) => {
922
- const hasReconnectAttempt = value.reconnectAttempt !== void 0;
923
- const hasReconnectTotal = value.reconnectTotal !== void 0;
924
- if (hasReconnectAttempt !== hasReconnectTotal) {
925
- ctx.addIssue({
926
- code: z11.ZodIssueCode.custom,
927
- message: "system/error reconnectAttempt and reconnectTotal must be provided together"
928
- });
929
- return;
930
- }
931
- if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
932
- ctx.addIssue({
933
- code: z11.ZodIssueCode.custom,
934
- message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
935
- });
936
- }
918
+ detail: z11.string().optional()
937
919
  });
938
920
  var ownershipChangeOperationActionValues = [
939
921
  "assign",
@@ -1853,46 +1835,20 @@ var unscopedSystemEventSchema = z14.discriminatedUnion("type", [
1853
1835
  }).merge(systemProviderTurnWatchdogEventDataSchema)
1854
1836
  ]);
1855
1837
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
1856
- var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
1857
- function isEventPropertyBag(value) {
1858
- return typeof value === "object" && value !== null && !Array.isArray(value);
1859
- }
1860
- var rejectLegacyClientRequestSequenceSchema = z14.unknown().superRefine((value, ctx) => {
1861
- if (!isEventPropertyBag(value)) {
1862
- return;
1863
- }
1864
- if (Object.hasOwn(value, legacyClientRequestKey)) {
1865
- ctx.addIssue({
1866
- code: z14.ZodIssueCode.custom,
1867
- message: "legacy request sequence field is no longer accepted",
1868
- path: [legacyClientRequestKey]
1869
- });
1870
- }
1871
- const item = value.item;
1872
- if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
1838
+ var threadEventSchema = z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1839
+ const result2 = validateThreadEventScope({
1840
+ type: event.type,
1841
+ scope: event.scope
1842
+ });
1843
+ if (!result2.valid) {
1873
1844
  ctx.addIssue({
1874
1845
  code: z14.ZodIssueCode.custom,
1875
- message: "legacy user-message request sequence field is no longer accepted",
1876
- path: ["item", legacyClientRequestKey]
1846
+ message: result2.message ?? "Invalid thread event scope",
1847
+ path: ["scope"]
1877
1848
  });
1849
+ return;
1878
1850
  }
1879
1851
  });
1880
- var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
1881
- z14.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
1882
- const result2 = validateThreadEventScope({
1883
- type: event.type,
1884
- scope: event.scope
1885
- });
1886
- if (!result2.valid) {
1887
- ctx.addIssue({
1888
- code: z14.ZodIssueCode.custom,
1889
- message: result2.message ?? "Invalid thread event scope",
1890
- path: ["scope"]
1891
- });
1892
- return;
1893
- }
1894
- })
1895
- );
1896
1852
  function isThreadEventWithItem(event) {
1897
1853
  switch (event.type) {
1898
1854
  case "item/started":
@@ -4251,11 +4207,6 @@ function assembleCapturedThreadEvents(messages, providerId = "pi") {
4251
4207
  const collector = createBridgeDeltaEventCollector(providerId);
4252
4208
  return messages.flatMap((message) => collector.assembleMessage(message));
4253
4209
  }
4254
- function toConformanceMessages() {
4255
- throw new Error(
4256
- "experimental_toConformanceMessages was removed: experimental_runBridgeConformance assembles thread/delta itself. Hand it a transport whose takeMessages returns the raw captured messages (CapturedBridgeJsonRpcOutput.takeMessages) and pass the bridge's providerId."
4257
- );
4258
- }
4259
4210
 
4260
4211
  // ../provider-bridge-protocol/src/conformance/client.ts
4261
4212
  import { z as z20 } from "zod";
@@ -4435,7 +4386,8 @@ var providerMaintenanceParamsSchema = z23.object({
4435
4386
  }).passthrough();
4436
4387
  var providerInstallationRequirementSchema = z23.enum(["thread_rewind"]);
4437
4388
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4438
- requirement: providerInstallationRequirementSchema.optional()
4389
+ requirement: providerInstallationRequirementSchema.optional(),
4390
+ checkUpdates: z23.boolean().default(true)
4439
4391
  });
4440
4392
  var providerHealthSchema = z23.object({
4441
4393
  status: z23.enum([
@@ -7166,6 +7118,5 @@ export {
7166
7118
  rerecordCurrentBridgeLane as experimental_rerecordCurrentBridgeLane,
7167
7119
  resolveProviderBridgeLaunch as experimental_resolveProviderBridgeLaunch,
7168
7120
  runBridgeConformance as experimental_runBridgeConformance,
7169
- toConformanceMessages as experimental_toConformanceMessages,
7170
7121
  withCurrentBridgeLane as experimental_withCurrentBridgeLane
7171
7122
  };
@@ -2353,25 +2353,7 @@ var turnRequestRejectedEventDataSchema = z15.object({
2353
2353
  var systemErrorEventDataSchema = z15.object({
2354
2354
  code: z15.string().optional(),
2355
2355
  message: z15.string(),
2356
- detail: z15.string().optional(),
2357
- reconnectAttempt: z15.number().int().positive().optional(),
2358
- reconnectTotal: z15.number().int().positive().optional()
2359
- }).superRefine((value, ctx) => {
2360
- const hasReconnectAttempt = value.reconnectAttempt !== void 0;
2361
- const hasReconnectTotal = value.reconnectTotal !== void 0;
2362
- if (hasReconnectAttempt !== hasReconnectTotal) {
2363
- ctx.addIssue({
2364
- code: z15.ZodIssueCode.custom,
2365
- message: "system/error reconnectAttempt and reconnectTotal must be provided together"
2366
- });
2367
- return;
2368
- }
2369
- if (value.reconnectAttempt !== void 0 && value.reconnectTotal !== void 0 && value.reconnectAttempt > value.reconnectTotal) {
2370
- ctx.addIssue({
2371
- code: z15.ZodIssueCode.custom,
2372
- message: "system/error reconnectAttempt cannot be greater than reconnectTotal"
2373
- });
2374
- }
2356
+ detail: z15.string().optional()
2375
2357
  });
2376
2358
  var ownershipChangeOperationActionValues = [
2377
2359
  "assign",
@@ -3282,46 +3264,20 @@ var unscopedSystemEventSchema = z18.discriminatedUnion("type", [
3282
3264
  }).merge(systemProviderTurnWatchdogEventDataSchema)
3283
3265
  ]);
3284
3266
  var systemEventSchema = unscopedSystemEventSchema.and(scopedEventDataSchema);
3285
- var legacyClientRequestKey = ["clientRequest", "Sequence"].join("");
3286
- function isEventPropertyBag(value) {
3287
- return typeof value === "object" && value !== null && !Array.isArray(value);
3288
- }
3289
- var rejectLegacyClientRequestSequenceSchema = z18.unknown().superRefine((value, ctx) => {
3290
- if (!isEventPropertyBag(value)) {
3291
- return;
3292
- }
3293
- if (Object.hasOwn(value, legacyClientRequestKey)) {
3294
- ctx.addIssue({
3295
- code: z18.ZodIssueCode.custom,
3296
- message: "legacy request sequence field is no longer accepted",
3297
- path: [legacyClientRequestKey]
3298
- });
3299
- }
3300
- const item = value.item;
3301
- if (isEventPropertyBag(item) && item.type === "userMessage" && Object.hasOwn(item, legacyClientRequestKey)) {
3267
+ var threadEventSchema = z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3268
+ const result = validateThreadEventScope({
3269
+ type: event.type,
3270
+ scope: event.scope
3271
+ });
3272
+ if (!result.valid) {
3302
3273
  ctx.addIssue({
3303
3274
  code: z18.ZodIssueCode.custom,
3304
- message: "legacy user-message request sequence field is no longer accepted",
3305
- path: ["item", legacyClientRequestKey]
3275
+ message: result.message ?? "Invalid thread event scope",
3276
+ path: ["scope"]
3306
3277
  });
3278
+ return;
3307
3279
  }
3308
3280
  });
3309
- var threadEventSchema = rejectLegacyClientRequestSequenceSchema.pipe(
3310
- z18.union([providerEventSchema, systemEventSchema]).superRefine((event, ctx) => {
3311
- const result = validateThreadEventScope({
3312
- type: event.type,
3313
- scope: event.scope
3314
- });
3315
- if (!result.valid) {
3316
- ctx.addIssue({
3317
- code: z18.ZodIssueCode.custom,
3318
- message: result.message ?? "Invalid thread event scope",
3319
- path: ["scope"]
3320
- });
3321
- return;
3322
- }
3323
- })
3324
- );
3325
3281
  var threadEventTypeValues = [
3326
3282
  ...providerEventTypeValues,
3327
3283
  ...systemEventTypeValues
@@ -4147,7 +4103,8 @@ var providerMaintenanceParamsSchema = z30.object({
4147
4103
  }).passthrough();
4148
4104
  var providerInstallationRequirementSchema = z30.enum(["thread_rewind"]);
4149
4105
  var providerInstallationStatusParamsSchema = providerMaintenanceParamsSchema.extend({
4150
- requirement: providerInstallationRequirementSchema.optional()
4106
+ requirement: providerInstallationRequirementSchema.optional(),
4107
+ checkUpdates: z30.boolean().default(true)
4151
4108
  });
4152
4109
  var providerHealthSchema = z30.object({
4153
4110
  status: z30.enum([
@@ -1233,7 +1233,12 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
1233
1233
  "description",
1234
1234
  registration.description
1235
1235
  );
1236
+ const page = registration.experimental_page;
1237
+ if (page !== void 0 && page !== "mobile") {
1238
+ throw new Error(`${kind}: experimental_page must be "mobile"`);
1239
+ }
1236
1240
  collected.settingsSections.push({
1241
+ ...page !== void 0 ? { experimental_page: page } : {},
1237
1242
  id,
1238
1243
  ...title !== void 0 ? { title } : {},
1239
1244
  ...description !== void 0 ? { description } : {},
@@ -1893,7 +1898,16 @@ function TestProviderModelPicker({
1893
1898
  className
1894
1899
  }) {
1895
1900
  const [draft, setDraft] = useState(value);
1896
- useEffect(() => setDraft(value), [value]);
1901
+ const { providerId, model, reasoningLevel, serviceTier } = value;
1902
+ useEffect(
1903
+ () => setDraft({
1904
+ providerId,
1905
+ model,
1906
+ reasoningLevel,
1907
+ ...serviceTier === void 0 ? {} : { serviceTier }
1908
+ }),
1909
+ [providerId, model, reasoningLevel, serviceTier]
1910
+ );
1897
1911
  const reasoningLevels = [
1898
1912
  "none",
1899
1913
  "low",
@@ -1941,11 +1955,11 @@ function TestProviderModelPicker({
1941
1955
  "aria-label": "Reasoning level",
1942
1956
  value: draft.reasoningLevel,
1943
1957
  onChange: (event) => {
1944
- const reasoningLevel = reasoningLevels.find(
1958
+ const reasoningLevel2 = reasoningLevels.find(
1945
1959
  (candidate) => candidate === event.target.value
1946
1960
  );
1947
- if (reasoningLevel === void 0) return;
1948
- setDraft((current) => ({ ...current, reasoningLevel }));
1961
+ if (reasoningLevel2 === void 0) return;
1962
+ setDraft((current) => ({ ...current, reasoningLevel: reasoningLevel2 }));
1949
1963
  }
1950
1964
  }
1951
1965
  ),
@@ -1955,13 +1969,13 @@ function TestProviderModelPicker({
1955
1969
  "aria-label": "Service tier",
1956
1970
  value: draft.serviceTier ?? "",
1957
1971
  onChange: (event) => setDraft((current) => {
1958
- const serviceTier = event.target.value;
1959
- if (serviceTier !== "fast" && serviceTier !== "default") {
1972
+ const serviceTier2 = event.target.value;
1973
+ if (serviceTier2 !== "fast" && serviceTier2 !== "default") {
1960
1974
  const next = { ...current };
1961
1975
  delete next.serviceTier;
1962
1976
  return next;
1963
1977
  }
1964
- return { ...current, serviceTier };
1978
+ return { ...current, serviceTier: serviceTier2 };
1965
1979
  }),
1966
1980
  children: [
1967
1981
  /* @__PURE__ */ jsx("option", { value: "", children: "Unsupported" }),
@@ -31,7 +31,6 @@ var RESERVED_BB_CLI_COMMANDS = [
31
31
  "guide",
32
32
  "help",
33
33
  "machine",
34
- "manager",
35
34
  "marketplace",
36
35
  "plugin",
37
36
  "project",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@get-bb/plugin-sdk",
3
- "version": "0.6.5",
3
+ "version": "0.6.9",
4
4
  "homepage": "https://github.com/get-bb/bb#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/get-bb/bb/issues"
@@ -135,7 +135,7 @@
135
135
  },
136
136
  "dependencies": {
137
137
  "cross-spawn": "^7.0.6",
138
- "zod": "^4.3.6"
138
+ "zod": "^4.6.5"
139
139
  },
140
140
  "devDependencies": {
141
141
  "@bb/domain": "workspace:*",