@get-bb/plugin-sdk 0.6.80 → 0.6.90

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.
@@ -2,6 +2,7 @@
2
2
  var FILE_PATH_MAX_LENGTH = 32768;
3
3
  var WINDOWS_DRIVE_ABSOLUTE_PATH = /^[A-Za-z]:[\\/]/u;
4
4
  var WINDOWS_UNC_ABSOLUTE_PATH = /^\\\\/u;
5
+ var REVISION_REF = /^(?:HEAD|[0-9a-f]{4,40})$/iu;
5
6
  function isJsonObject(value) {
6
7
  if (typeof value !== "object" || value === null || Array.isArray(value)) {
7
8
  return false;
@@ -40,6 +41,9 @@ function hasUnpairedSurrogate(value) {
40
41
  function isValidPathSegment(segment) {
41
42
  return segment.length > 0 && segment !== "." && segment !== "..";
42
43
  }
44
+ function isValidRevisionRef(value) {
45
+ return typeof value === "string" && REVISION_REF.test(value);
46
+ }
43
47
  function isPositiveSafeInteger(value) {
44
48
  return typeof value === "number" && Number.isSafeInteger(value) && value > 0;
45
49
  }
@@ -70,15 +74,22 @@ function isValidAbsoluteHostFilePath(value) {
70
74
  function normalizeExperimentalLiveFileTarget(value) {
71
75
  if (!isJsonObject(value) || typeof value.kind !== "string") return null;
72
76
  switch (value.kind) {
73
- case "workspace":
74
- if (!hasExactKeys(value, ["kind", "environmentId", "path"]) || !isNonEmptyIdentity(value.environmentId) || !isValidRelativeFilePath(value.path)) {
77
+ case "workspace": {
78
+ const ref = value.experimental_ref;
79
+ if (!hasExactKeys(
80
+ value,
81
+ ref === void 0 ? ["kind", "environmentId", "path"] : ["kind", "environmentId", "path", "experimental_ref"]
82
+ ) || !isNonEmptyIdentity(value.environmentId) || !isValidRelativeFilePath(value.path)) {
75
83
  return null;
76
84
  }
77
- return {
85
+ const target = {
78
86
  kind: value.kind,
79
87
  environmentId: value.environmentId,
80
88
  path: value.path
81
89
  };
90
+ if (ref === void 0) return target;
91
+ return isValidRevisionRef(ref) ? { ...target, experimental_ref: ref } : null;
92
+ }
82
93
  case "host":
83
94
  if (!hasExactKeys(value, ["kind", "hostId", "path"]) || !isNonEmptyIdentity(value.hostId) || !isValidAbsoluteHostFilePath(value.path)) {
84
95
  return null;
@@ -288,7 +288,7 @@ var providerNativeRootSetSchema = z4.object({
288
288
  }).strict();
289
289
 
290
290
  // src/backend-contract.ts
291
- var PLUGIN_CLI_OUTPUT_MAX_BYTES = 1024 * 1024;
291
+ var PLUGIN_CLI_OUTPUT_MAX_BYTES = 32 * 1024 * 1024;
292
292
 
293
293
  // src/internal/host-policy.ts
294
294
  function pluginCliCollisionWarning(pluginId, commandName) {
@@ -580,9 +580,9 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
580
580
  throw new Error(`${kind}: run and params require action availability`);
581
581
  }
582
582
  const target = registration.experimental_target;
583
- if (target !== void 0 && (context.kind !== "nav-panel" || availability !== "fixed" || typeof target?.validate !== "function")) {
583
+ if (target !== void 0 && (availability !== "fixed" || typeof target?.validate !== "function")) {
584
584
  throw new Error(
585
- `${kind}: experimental_target requires a nav-panel fixed tab and a validate function`
585
+ `${kind}: experimental_target requires a fixed tab and a validate function`
586
586
  );
587
587
  }
588
588
  const validated = {
@@ -937,6 +937,11 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
937
937
  if (registration.useData !== void 0 && typeof registration.useData !== "function") {
938
938
  throw new Error(`${kind}: "useData" must be a function`);
939
939
  }
940
+ if (registration.experimental_bulkItem !== void 0 && typeof registration.experimental_bulkItem !== "function") {
941
+ throw new Error(
942
+ `${kind}: "experimental_bulkItem" must be a function`
943
+ );
944
+ }
940
945
  collected.threadActions.push({
941
946
  id,
942
947
  title: requireNonEmptyString(kind, "title", registration.title),
@@ -944,7 +949,10 @@ function collectPluginAppRegistrations(definition, onWarning = (message) => cons
944
949
  group: requireNonEmptyString(kind, "group", registration.group),
945
950
  ...requireOptionalOrder(kind, registration.order),
946
951
  ...registration.useData !== void 0 ? { useData: registration.useData } : {},
947
- item: registration.item
952
+ item: registration.item,
953
+ ...registration.experimental_bulkItem !== void 0 ? {
954
+ experimental_bulkItem: registration.experimental_bulkItem
955
+ } : {}
948
956
  });
949
957
  },
950
958
  experimental_browserToolbarAction(registration) {