@get-bb/plugin-sdk 0.6.23 → 0.6.31
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 +10 -2
- package/bundled-types/bb-plugin-sdk-app.d.ts +459 -11
- package/bundled-types/bb-plugin-sdk-host.d.ts +30 -3
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +1 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +2 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +27 -1
- package/bundled-types/bb-plugin-sdk.d.ts +469 -11
- package/dist/app.js +4 -0
- package/dist/host.js +111 -11
- package/dist/internal/host-policy.js +5 -2
- package/dist/provider-bridge-acp.js +133 -42
- package/dist/provider-bridge-testing.js +8 -2
- package/dist/provider-bridge.js +3 -1
- package/dist/testing/app.js +35 -1
- package/dist/testing/index.js +7 -2
- package/package.json +1 -1
package/dist/testing/app.js
CHANGED
|
@@ -2162,6 +2162,15 @@ function TestDiff({
|
|
|
2162
2162
|
}
|
|
2163
2163
|
);
|
|
2164
2164
|
}
|
|
2165
|
+
var activeClipboard = null;
|
|
2166
|
+
function captureClipboardWrites(result) {
|
|
2167
|
+
const writes = [];
|
|
2168
|
+
activeClipboard = (content) => {
|
|
2169
|
+
writes.push({ ...content });
|
|
2170
|
+
return result?.(content) ?? Promise.resolve(true);
|
|
2171
|
+
};
|
|
2172
|
+
return writes;
|
|
2173
|
+
}
|
|
2165
2174
|
var testPluginSdkApp = {
|
|
2166
2175
|
definePluginApp,
|
|
2167
2176
|
useRpc() {
|
|
@@ -2297,6 +2306,9 @@ var testPluginSdkApp = {
|
|
|
2297
2306
|
experimental_useCodeTheme() {
|
|
2298
2307
|
return useSlotEnv("experimental_useCodeTheme").codeTheme;
|
|
2299
2308
|
},
|
|
2309
|
+
experimental_copyToClipboard(content) {
|
|
2310
|
+
return activeClipboard?.(content) ?? Promise.resolve(true);
|
|
2311
|
+
},
|
|
2300
2312
|
experimental_useSidebarThreadActions() {
|
|
2301
2313
|
return useSlotEnv("experimental_useSidebarThreadActions").sidebarActions;
|
|
2302
2314
|
},
|
|
@@ -2426,6 +2438,9 @@ async function mountPluginContentScripts(app, options) {
|
|
|
2426
2438
|
const mounted = [];
|
|
2427
2439
|
const threadRowStatuses = /* @__PURE__ */ new Map();
|
|
2428
2440
|
const threadRowStatusCalls = [];
|
|
2441
|
+
const experimental_clipboardWrites = captureClipboardWrites(
|
|
2442
|
+
options.experimental_copyToClipboard
|
|
2443
|
+
);
|
|
2429
2444
|
let disposed = false;
|
|
2430
2445
|
const setThreadRowStatus = (threadId, status) => {
|
|
2431
2446
|
if (controller.signal.aborted) return;
|
|
@@ -2505,7 +2520,8 @@ async function mountPluginContentScripts(app, options) {
|
|
|
2505
2520
|
getThreadRowStatus(threadId) {
|
|
2506
2521
|
const status = threadRowStatuses.get(threadId);
|
|
2507
2522
|
return status === void 0 ? null : { ...status };
|
|
2508
|
-
}
|
|
2523
|
+
},
|
|
2524
|
+
experimental_clipboardWrites
|
|
2509
2525
|
},
|
|
2510
2526
|
lifecycle: { dispose }
|
|
2511
2527
|
};
|
|
@@ -2722,6 +2738,9 @@ function renderSlot(registration, props, options = {}) {
|
|
|
2722
2738
|
name: options.codeTheme?.name ?? "pierre-light",
|
|
2723
2739
|
theme: options.codeTheme?.theme ?? null
|
|
2724
2740
|
};
|
|
2741
|
+
const experimental_clipboardWrites = captureClipboardWrites(
|
|
2742
|
+
options.experimental_copyToClipboard
|
|
2743
|
+
);
|
|
2725
2744
|
const sidebarActions = {
|
|
2726
2745
|
open(threadId2, openOptions) {
|
|
2727
2746
|
sidebarActionCalls.push({
|
|
@@ -2748,6 +2767,12 @@ function renderSlot(registration, props, options = {}) {
|
|
|
2748
2767
|
archive(threadId2) {
|
|
2749
2768
|
sidebarActionCalls.push({ method: "archive", threadId: threadId2 });
|
|
2750
2769
|
},
|
|
2770
|
+
async experimental_archiveEnvironmentThreads(environmentId) {
|
|
2771
|
+
sidebarActionCalls.push({
|
|
2772
|
+
method: "experimental_archiveEnvironmentThreads",
|
|
2773
|
+
environmentId
|
|
2774
|
+
});
|
|
2775
|
+
},
|
|
2751
2776
|
requestDelete(threadId2) {
|
|
2752
2777
|
sidebarActionCalls.push({ method: "requestDelete", threadId: threadId2 });
|
|
2753
2778
|
}
|
|
@@ -2796,6 +2821,13 @@ function renderSlot(registration, props, options = {}) {
|
|
|
2796
2821
|
options: fileOptions
|
|
2797
2822
|
});
|
|
2798
2823
|
return options.openFileExternally?.(fileOptions) ?? false;
|
|
2824
|
+
},
|
|
2825
|
+
async experimental_openTerminal(terminalOptions) {
|
|
2826
|
+
navigateCalls.push({
|
|
2827
|
+
method: "experimental_openTerminal",
|
|
2828
|
+
options: terminalOptions
|
|
2829
|
+
});
|
|
2830
|
+
return options.openTerminal?.(terminalOptions) ?? false;
|
|
2799
2831
|
}
|
|
2800
2832
|
};
|
|
2801
2833
|
const projectId = options.context?.projectId ?? null;
|
|
@@ -3131,6 +3163,7 @@ ${block}
|
|
|
3131
3163
|
sidebarActionCalls,
|
|
3132
3164
|
sidebarNavigationCalls,
|
|
3133
3165
|
sdkCalls,
|
|
3166
|
+
experimental_clipboardWrites,
|
|
3134
3167
|
composer: composerLog,
|
|
3135
3168
|
behavior: {
|
|
3136
3169
|
emitRealtime,
|
|
@@ -3145,6 +3178,7 @@ ${block}
|
|
|
3145
3178
|
sidebarActionCalls,
|
|
3146
3179
|
sidebarNavigationCalls,
|
|
3147
3180
|
sdkCalls,
|
|
3181
|
+
experimental_clipboardWrites,
|
|
3148
3182
|
composer: composerLog
|
|
3149
3183
|
},
|
|
3150
3184
|
lifecycle: { rerender: rerenderSlot, unmount: unmountSlot }
|
package/dist/testing/index.js
CHANGED
|
@@ -50,6 +50,7 @@ var RESERVED_BB_CLI_COMMANDS = [
|
|
|
50
50
|
// ../domain/src/plugin-interaction-limits.ts
|
|
51
51
|
var PLUGIN_INTERACTION_MAX_TITLE_LENGTH = 160;
|
|
52
52
|
var PLUGIN_INTERACTION_MAX_PAYLOAD_BYTES = 64 * 1024;
|
|
53
|
+
var PLUGIN_INTERACTION_MAX_TIMEOUT_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
53
54
|
|
|
54
55
|
// ../domain/src/provider-fork.ts
|
|
55
56
|
import { z } from "zod";
|
|
@@ -2478,8 +2479,10 @@ function normalizeInteractionRequest(request) {
|
|
|
2478
2479
|
throw new Error("ui.requestInput payload must be JSON-serializable");
|
|
2479
2480
|
}
|
|
2480
2481
|
const timeoutMs = request.timeoutMs ?? 10 * 60 * 1e3;
|
|
2481
|
-
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs >
|
|
2482
|
-
throw new Error(
|
|
2482
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs <= 0 || timeoutMs > PLUGIN_INTERACTION_MAX_TIMEOUT_MS) {
|
|
2483
|
+
throw new Error(
|
|
2484
|
+
`ui.requestInput timeoutMs must be between 1 and ${PLUGIN_INTERACTION_MAX_TIMEOUT_MS}`
|
|
2485
|
+
);
|
|
2483
2486
|
}
|
|
2484
2487
|
if (request.describeSubmission !== void 0 && typeof request.describeSubmission !== "function") {
|
|
2485
2488
|
throw new Error("ui.requestInput describeSubmission must be a function");
|
|
@@ -3303,6 +3306,7 @@ function createFakePluginHostInternal(options, sharedState) {
|
|
|
3303
3306
|
"experimental_thread.events": [],
|
|
3304
3307
|
"experimental_terminal.input": [],
|
|
3305
3308
|
"experimental_host.deleted": [],
|
|
3309
|
+
"experimental_environment.removed": [],
|
|
3306
3310
|
"thread.created": [],
|
|
3307
3311
|
"thread.active": [],
|
|
3308
3312
|
"thread.idle": [],
|
|
@@ -3740,6 +3744,7 @@ function createFakePluginHostInternal(options, sharedState) {
|
|
|
3740
3744
|
return {
|
|
3741
3745
|
"experimental_thread.events": threadEventHandlers["experimental_thread.events"].length,
|
|
3742
3746
|
"experimental_terminal.input": threadEventHandlers["experimental_terminal.input"].length,
|
|
3747
|
+
"experimental_environment.removed": threadEventHandlers["experimental_environment.removed"].length,
|
|
3743
3748
|
"experimental_host.deleted": threadEventHandlers["experimental_host.deleted"].length,
|
|
3744
3749
|
"thread.created": threadEventHandlers["thread.created"].length,
|
|
3745
3750
|
"thread.active": threadEventHandlers["thread.active"].length,
|