@get-bb/plugin-sdk 0.6.94 → 0.6.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/app.js CHANGED
@@ -222,6 +222,9 @@ var experimental_useCanOpenFileExternally = runtimeFunction(
222
222
  var experimental_useTabVisible = runtimeFunction(
223
223
  "experimental_useTabVisible"
224
224
  );
225
+ var experimental_useServers = runtimeFunction(
226
+ "experimental_useServers"
227
+ );
225
228
  var experimental_useAppPanel = runtimeFunction(
226
229
  "experimental_useAppPanel"
227
230
  );
@@ -424,6 +427,7 @@ export {
424
427
  experimental_useRpcMutation,
425
428
  experimental_useRpcQuery,
426
429
  experimental_useRpcRefresh,
430
+ experimental_useServers,
427
431
  experimental_useSidebarNavigation,
428
432
  experimental_useSidebarNavigationSplit,
429
433
  experimental_useSidebarThreadActions,
@@ -2134,9 +2134,7 @@ function runPluginStorageMigrations(database, statements) {
2134
2134
  if (!migrationColumns.some((column) => column.name === "statement_hash")) {
2135
2135
  database.exec("ALTER TABLE _bb_migrations ADD COLUMN statement_hash TEXT");
2136
2136
  }
2137
- const rows = database.prepare(
2138
- "SELECT id, statement_hash FROM _bb_migrations ORDER BY id"
2139
- ).all();
2137
+ const rows = database.prepare("SELECT id, statement_hash FROM _bb_migrations ORDER BY id").all();
2140
2138
  const applied = /* @__PURE__ */ new Map();
2141
2139
  for (const row of rows) applied.set(row.id, row.statement_hash);
2142
2140
  const statementHashes = statements.map(migrationStatementHash);
@@ -512,6 +512,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
512
512
  messageDirectives: [],
513
513
  codeFenceRenderers: [],
514
514
  messageActions: [],
515
+ messageMetadata: [],
515
516
  commandPaletteActions: [],
516
517
  providerIcons: [],
517
518
  icons: [],
@@ -550,6 +551,7 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
550
551
  codeFenceRenderer: /* @__PURE__ */ new Set(),
551
552
  codeFenceLanguage: /* @__PURE__ */ new Set(),
552
553
  messageAction: /* @__PURE__ */ new Set(),
554
+ messageMetadata: /* @__PURE__ */ new Set(),
553
555
  command: /* @__PURE__ */ new Set(),
554
556
  providerIcon: /* @__PURE__ */ new Set(),
555
557
  timelineRenderer: /* @__PURE__ */ new Set(),
@@ -1089,6 +1091,22 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
1089
1091
  run: registration.run
1090
1092
  });
1091
1093
  },
1094
+ experimental_messageMetadata(registration) {
1095
+ const kind = "slots.experimental_messageMetadata";
1096
+ const id = requireSlotId(kind, registration?.id);
1097
+ requireUniqueId(kind, seenIds.messageMetadata, id);
1098
+ const placement = registration.placement ?? "above";
1099
+ if (placement !== "above" && placement !== "actionRow") {
1100
+ throw new Error(
1101
+ `${kind}: "placement" must be "above" or "actionRow"`
1102
+ );
1103
+ }
1104
+ collected.messageMetadata.push({
1105
+ id,
1106
+ placement,
1107
+ component: requireComponent(kind, registration.component)
1108
+ });
1109
+ },
1092
1110
  commandPaletteAction(registration) {
1093
1111
  registerCommand(registration);
1094
1112
  },
@@ -991,13 +991,13 @@ async function invalidateTags(client, scope, tags) {
991
991
  }
992
992
  async function executeTaggedMutation(invalidate, call, prediction) {
993
993
  const { result, invalidated } = await call();
994
- prediction?.accept(result);
994
+ prediction.accept(result);
995
995
  const refresh = async () => {
996
996
  try {
997
997
  if (invalidate !== void 0 && invalidated.length > 0)
998
998
  await invalidate(invalidated);
999
999
  } finally {
1000
- prediction?.settle();
1000
+ prediction.settle();
1001
1001
  }
1002
1002
  };
1003
1003
  void refresh().catch(() => {
@@ -1505,7 +1505,7 @@ var sessionOptionSelectionsSchema = z2.record(
1505
1505
  var runtimeThreadExecutionBaseOptionsSchema = z2.object({
1506
1506
  model: z2.string().min(1),
1507
1507
  serviceTier: serviceTierSchema,
1508
- reasoningLevel: reasoningLevelSchema,
1508
+ reasoningLevel: reasoningLevelSchema.optional(),
1509
1509
  promptMode: promptModeSchema.optional(),
1510
1510
  sessionOptions: sessionOptionSelectionsSchema.optional(),
1511
1511
  providerOptions: jsonObjectSchema
@@ -2031,6 +2031,7 @@ var SYSTEM_CHANGE_KINDS = [
2031
2031
  "plugin-install-jobs-changed",
2032
2032
  "plugin-update-jobs-changed",
2033
2033
  "provider-registrations-changed",
2034
+ "ui-preferences-changed",
2034
2035
  "environment-availability-changed",
2035
2036
  "server-move-changed",
2036
2037
  "app-update-changed"
@@ -2188,11 +2189,6 @@ var systemChangedMessageSchema = z17.object({
2188
2189
  entity: z17.literal("system"),
2189
2190
  changes: z17.array(systemChangeKindSchema).readonly()
2190
2191
  }).strict();
2191
- var tagsChangedMessageSchema = z17.object({
2192
- type: z17.literal("changed"),
2193
- entity: z17.literal("tags"),
2194
- tags: z17.array(z17.string().min(1)).min(1)
2195
- }).strict();
2196
2192
  var pluginChangedMessageSchema = z17.object({
2197
2193
  type: z17.literal("changed"),
2198
2194
  entity: z17.literal("plugin"),
@@ -2205,7 +2201,6 @@ var changedMessageSchema = z17.discriminatedUnion("entity", [
2205
2201
  environmentChangedMessageSchema,
2206
2202
  hostChangedMessageSchema,
2207
2203
  systemChangedMessageSchema,
2208
- tagsChangedMessageSchema,
2209
2204
  pluginChangedMessageSchema
2210
2205
  ]);
2211
2206
  function lenientKinds(kinds) {
@@ -2265,7 +2260,6 @@ var changedMessageLenientSchema = z17.discriminatedUnion("entity", [
2265
2260
  environmentChangedMessageLenientSchema,
2266
2261
  hostChangedMessageLenientSchema,
2267
2262
  systemChangedMessageLenientSchema,
2268
- tagsChangedMessageSchema.strip(),
2269
2263
  pluginChangedMessageSchema.strip()
2270
2264
  ]);
2271
2265