@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.
- package/README.md +26 -23
- package/bundled-types/bb-plugin-sdk-app.d.ts +1035 -897
- package/bundled-types/bb-plugin-sdk-internal-file-navigation-validation.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +7 -0
- package/bundled-types/bb-plugin-sdk-process.d.ts +61 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +45 -21
- package/bundled-types/bb-plugin-sdk-testing.d.ts +11 -0
- package/bundled-types/bb-plugin-sdk.d.ts +1029 -895
- package/dist/app.js +16 -0
- package/dist/host.js +557 -13
- package/dist/index.js +1 -1
- package/dist/internal/file-navigation-validation.js +14 -3
- package/dist/internal/host-policy.js +1 -1
- package/dist/internal/plugin-app-collector.js +11 -3
- package/dist/internal/rpc-query-host.js +307 -445
- package/dist/process.js +694 -0
- package/dist/provider-bridge-acp-next.js +739 -320
- package/dist/provider-bridge-acp.js +739 -320
- package/dist/provider-bridge-testing.js +677 -43
- package/dist/provider-bridge-worker-entry.mjs +534 -66
- package/dist/provider-bridge.js +604 -212
- package/dist/testing/app.js +543 -573
- package/dist/testing/index.js +126 -108
- package/package.json +7 -1
|
@@ -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
|
-
|
|
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
|
-
|
|
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 && (
|
|
583
|
+
if (target !== void 0 && (availability !== "fixed" || typeof target?.validate !== "function")) {
|
|
584
584
|
throw new Error(
|
|
585
|
-
`${kind}: experimental_target requires a
|
|
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) {
|