@get-bb/plugin-sdk 0.6.31 → 0.6.37
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/bundled-types/bb-plugin-sdk-app.d.ts +648 -355
- package/bundled-types/bb-plugin-sdk-internal-composer-handle.d.ts +4 -0
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +10 -0
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -3
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +12 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +16 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +27 -40
- package/bundled-types/bb-plugin-sdk.d.ts +650 -354
- package/dist/app.js +33 -12
- package/dist/index.js +9 -0
- package/dist/internal/composer-handle.js +1 -0
- package/dist/internal/host-policy.js +11 -0
- package/dist/internal/plugin-app-collector.js +25 -22
- package/dist/provider-bridge-acp.js +5 -0
- package/dist/provider-bridge-testing.js +5 -0
- package/dist/provider-bridge.js +5 -0
- package/dist/testing/app.js +241 -93
- package/dist/testing/index.js +12 -0
- package/package.json +1 -1
package/dist/app.js
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
// src/thread-action-groups.ts
|
|
2
|
+
var experimental_THREAD_ACTION_GROUPS = {
|
|
3
|
+
open: "1_open",
|
|
4
|
+
organize: "2_organize",
|
|
5
|
+
settings: "3_settings",
|
|
6
|
+
lifecycle: "4_lifecycle"
|
|
7
|
+
};
|
|
8
|
+
|
|
1
9
|
// src/app.ts
|
|
2
10
|
function runtimeHost() {
|
|
3
11
|
return globalThis.__bbPluginRuntime;
|
|
@@ -101,21 +109,27 @@ var experimental_useSidebarThreads = runtimeFunction(
|
|
|
101
109
|
var experimental_useSidebarThreadActions = runtimeFunction(
|
|
102
110
|
"experimental_useSidebarThreadActions"
|
|
103
111
|
);
|
|
112
|
+
var experimental_useThreadActions = runtimeFunction(
|
|
113
|
+
"experimental_useThreadActions"
|
|
114
|
+
);
|
|
115
|
+
var experimental_useArchiveEnvironmentThreads = runtimeFunction(
|
|
116
|
+
"experimental_useArchiveEnvironmentThreads"
|
|
117
|
+
);
|
|
118
|
+
var experimental_useThreadActionRegistrations = runtimeFunction(
|
|
119
|
+
"experimental_useThreadActionRegistrations"
|
|
120
|
+
);
|
|
121
|
+
var experimental_ThreadActionsMenu = runtimeComponent(
|
|
122
|
+
"experimental_ThreadActionsMenu"
|
|
123
|
+
);
|
|
124
|
+
var experimental_ThreadActionsContextMenu = runtimeComponent(
|
|
125
|
+
"experimental_ThreadActionsContextMenu"
|
|
126
|
+
);
|
|
104
127
|
var experimental_useSidebarThreadPullRequest = runtimeFunction(
|
|
105
128
|
"experimental_useSidebarThreadPullRequest"
|
|
106
129
|
);
|
|
107
130
|
var experimental_useSidebarThreadSplit = runtimeFunction(
|
|
108
131
|
"experimental_useSidebarThreadSplit"
|
|
109
132
|
);
|
|
110
|
-
var experimental_useSidebarNavigation = runtimeFunction(
|
|
111
|
-
"experimental_useSidebarNavigation"
|
|
112
|
-
);
|
|
113
|
-
var experimental_useSidebarNavigationSplit = runtimeFunction(
|
|
114
|
-
"experimental_useSidebarNavigationSplit"
|
|
115
|
-
);
|
|
116
|
-
var experimental_SidebarNavigationIcon = runtimeComponent(
|
|
117
|
-
"experimental_SidebarNavigationIcon"
|
|
118
|
-
);
|
|
119
133
|
var useSidebarThreadDraft = runtimeFunction("useSidebarThreadDraft");
|
|
120
134
|
var useSidebarThreadDraftIds = runtimeFunction(
|
|
121
135
|
"useSidebarThreadDraftIds"
|
|
@@ -131,6 +145,9 @@ var useSidebarThreadShortcut = runtimeFunction(
|
|
|
131
145
|
"useSidebarThreadShortcut"
|
|
132
146
|
);
|
|
133
147
|
var ThreadTitle = runtimeComponent("ThreadTitle");
|
|
148
|
+
var experimental_ThreadStatusGlyph = runtimeComponent(
|
|
149
|
+
"experimental_ThreadStatusGlyph"
|
|
150
|
+
);
|
|
134
151
|
var useEnvironmentProviders = runtimeFunction(
|
|
135
152
|
"useEnvironmentProviders"
|
|
136
153
|
);
|
|
@@ -158,11 +175,15 @@ export {
|
|
|
158
175
|
experimental_PermissionModePicker,
|
|
159
176
|
experimental_ProviderIcon,
|
|
160
177
|
experimental_ProviderModelPicker,
|
|
161
|
-
experimental_SidebarNavigationIcon,
|
|
162
178
|
experimental_SourceCode,
|
|
179
|
+
experimental_THREAD_ACTION_GROUPS,
|
|
180
|
+
experimental_ThreadActionsContextMenu,
|
|
181
|
+
experimental_ThreadActionsMenu,
|
|
182
|
+
experimental_ThreadStatusGlyph,
|
|
163
183
|
experimental_VoiceInputTextarea,
|
|
164
184
|
experimental_copyToClipboard,
|
|
165
185
|
experimental_useAppPanel,
|
|
186
|
+
experimental_useArchiveEnvironmentThreads,
|
|
166
187
|
experimental_useBranches,
|
|
167
188
|
experimental_useCheckoutState,
|
|
168
189
|
experimental_useCodeTheme,
|
|
@@ -170,12 +191,12 @@ export {
|
|
|
170
191
|
experimental_usePluginId,
|
|
171
192
|
experimental_useProviders,
|
|
172
193
|
experimental_useQuestionFormHost,
|
|
173
|
-
experimental_useSidebarNavigation,
|
|
174
|
-
experimental_useSidebarNavigationSplit,
|
|
175
194
|
experimental_useSidebarThreadActions,
|
|
176
195
|
experimental_useSidebarThreadPullRequest,
|
|
177
196
|
experimental_useSidebarThreadSplit,
|
|
178
197
|
experimental_useSidebarThreads,
|
|
198
|
+
experimental_useThreadActionRegistrations,
|
|
199
|
+
experimental_useThreadActions,
|
|
179
200
|
useBbContext,
|
|
180
201
|
useBbNavigate,
|
|
181
202
|
useComposer,
|
package/dist/index.js
CHANGED
|
@@ -812,11 +812,20 @@ function experimental_defineHostEntry(args) {
|
|
|
812
812
|
function defineRpcContract(contract) {
|
|
813
813
|
return contract;
|
|
814
814
|
}
|
|
815
|
+
|
|
816
|
+
// src/thread-action-groups.ts
|
|
817
|
+
var experimental_THREAD_ACTION_GROUPS = {
|
|
818
|
+
open: "1_open",
|
|
819
|
+
organize: "2_organize",
|
|
820
|
+
settings: "3_settings",
|
|
821
|
+
lifecycle: "4_lifecycle"
|
|
822
|
+
};
|
|
815
823
|
export {
|
|
816
824
|
PLUGIN_CLI_OUTPUT_MAX_BYTES,
|
|
817
825
|
PluginCliError,
|
|
818
826
|
cliCommand,
|
|
819
827
|
defineCli,
|
|
820
828
|
defineRpcContract,
|
|
829
|
+
experimental_THREAD_ACTION_GROUPS,
|
|
821
830
|
experimental_defineHostEntry
|
|
822
831
|
};
|
|
@@ -86,6 +86,7 @@ var mentionSchema = z.discriminatedUnion("kind", [
|
|
|
86
86
|
origin: z.enum(["builtin", "project", "user"]),
|
|
87
87
|
argumentHint: z.string().nullable()
|
|
88
88
|
}),
|
|
89
|
+
z.object({ ...range, kind: z.literal("attachment"), path: z.string() }),
|
|
89
90
|
z.object({
|
|
90
91
|
...range,
|
|
91
92
|
kind: z.literal("plugin"),
|
|
@@ -400,6 +400,7 @@ var settingDescriptorSchema = z5.discriminatedUnion("type", [
|
|
|
400
400
|
type: z5.literal("select"),
|
|
401
401
|
...settingsBaseFields,
|
|
402
402
|
options: z5.array(z5.string().min(1)).min(1),
|
|
403
|
+
experimental_optionLabels: z5.record(z5.string().min(1), z5.string().min(1)).optional(),
|
|
403
404
|
experimental_schema: stringSettingSchemaSchema.optional(),
|
|
404
405
|
default: z5.string().optional()
|
|
405
406
|
}).strict(),
|
|
@@ -435,6 +436,16 @@ function registerSettingDescriptors(target, added) {
|
|
|
435
436
|
`default for setting "${key}" must be one of its options`
|
|
436
437
|
);
|
|
437
438
|
}
|
|
439
|
+
if (descriptor.type === "select") {
|
|
440
|
+
const unknownLabel = Object.keys(
|
|
441
|
+
descriptor.experimental_optionLabels ?? {}
|
|
442
|
+
).find((option) => !descriptor.options.includes(option));
|
|
443
|
+
if (unknownLabel !== void 0) {
|
|
444
|
+
throw new Error(
|
|
445
|
+
`label for setting "${key}" names "${unknownLabel}", which is not one of its options`
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
438
449
|
if (descriptor.default !== void 0) {
|
|
439
450
|
const errors = validateSettingsUpdate(
|
|
440
451
|
{ [key]: descriptor },
|
|
@@ -469,10 +469,9 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
469
469
|
pendingInteractions: [],
|
|
470
470
|
sidebarFooterActions: [],
|
|
471
471
|
experimentalSidebarFooterItems: [],
|
|
472
|
-
experimentalSidebarNavigations: [],
|
|
473
|
-
experimentalSidebarHeaders: [],
|
|
474
472
|
threadLists: [],
|
|
475
473
|
threadHeaderActions: [],
|
|
474
|
+
threadActions: [],
|
|
476
475
|
browserToolbarActions: [],
|
|
477
476
|
fileOpeners: [],
|
|
478
477
|
sourceCodeRenderers: [],
|
|
@@ -499,10 +498,9 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
499
498
|
composerPopup: /* @__PURE__ */ new Set(),
|
|
500
499
|
pendingInteraction: /* @__PURE__ */ new Set(),
|
|
501
500
|
sidebarFooterItem: /* @__PURE__ */ new Set(),
|
|
502
|
-
sidebarNavigation: /* @__PURE__ */ new Set(),
|
|
503
|
-
sidebarHeader: /* @__PURE__ */ new Set(),
|
|
504
501
|
threadList: /* @__PURE__ */ new Set(),
|
|
505
502
|
threadHeaderAction: /* @__PURE__ */ new Set(),
|
|
503
|
+
threadAction: /* @__PURE__ */ new Set(),
|
|
506
504
|
browserToolbarAction: /* @__PURE__ */ new Set(),
|
|
507
505
|
fileOpener: /* @__PURE__ */ new Set(),
|
|
508
506
|
sourceCodeRenderer: /* @__PURE__ */ new Set(),
|
|
@@ -720,24 +718,6 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
720
718
|
collected.sidebarFooterActions.push(legacyRegistration);
|
|
721
719
|
sidebarFooterItems.push(adaptSidebarFooterAction(legacyRegistration));
|
|
722
720
|
},
|
|
723
|
-
experimental_sidebarNavigation(registration) {
|
|
724
|
-
collected.experimentalSidebarNavigations.push(
|
|
725
|
-
collectTitledComponent(
|
|
726
|
-
"slots.experimental_sidebarNavigation",
|
|
727
|
-
seenIds.sidebarNavigation,
|
|
728
|
-
registration
|
|
729
|
-
)
|
|
730
|
-
);
|
|
731
|
-
},
|
|
732
|
-
experimental_sidebarHeader(registration) {
|
|
733
|
-
collected.experimentalSidebarHeaders.push(
|
|
734
|
-
collectTitledComponent(
|
|
735
|
-
"slots.experimental_sidebarHeader",
|
|
736
|
-
seenIds.sidebarHeader,
|
|
737
|
-
registration
|
|
738
|
-
)
|
|
739
|
-
);
|
|
740
|
-
},
|
|
741
721
|
experimental_threadList(registration) {
|
|
742
722
|
collected.threadLists.push(
|
|
743
723
|
collectTitledComponent(
|
|
@@ -757,6 +737,29 @@ function collectPluginAppRegistrations(definition, onComposerCustomizationReject
|
|
|
757
737
|
component: requireComponent(kind, registration.component)
|
|
758
738
|
});
|
|
759
739
|
},
|
|
740
|
+
experimental_threadAction(registration) {
|
|
741
|
+
const kind = "slots.experimental_threadAction";
|
|
742
|
+
const id = requireSlotId(kind, registration?.id);
|
|
743
|
+
requireUniqueId(kind, seenIds.threadAction, id);
|
|
744
|
+
if (typeof registration.item !== "function") {
|
|
745
|
+
throw new Error(`${kind}: "item" must be a function`);
|
|
746
|
+
}
|
|
747
|
+
if (registration.useData !== void 0 && typeof registration.useData !== "function") {
|
|
748
|
+
throw new Error(`${kind}: "useData" must be a function`);
|
|
749
|
+
}
|
|
750
|
+
if (registration.order !== void 0 && !Number.isFinite(registration.order)) {
|
|
751
|
+
throw new Error(`${kind}: "order" must be a finite number`);
|
|
752
|
+
}
|
|
753
|
+
collected.threadActions.push({
|
|
754
|
+
id,
|
|
755
|
+
title: requireNonEmptyString(kind, "title", registration.title),
|
|
756
|
+
icon: requireNonEmptyString(kind, "icon", registration.icon),
|
|
757
|
+
group: requireNonEmptyString(kind, "group", registration.group),
|
|
758
|
+
...registration.order !== void 0 ? { order: registration.order } : {},
|
|
759
|
+
...registration.useData !== void 0 ? { useData: registration.useData } : {},
|
|
760
|
+
item: registration.item
|
|
761
|
+
});
|
|
762
|
+
},
|
|
760
763
|
experimental_browserToolbarAction(registration) {
|
|
761
764
|
const kind = "slots.experimental_browserToolbarAction";
|
|
762
765
|
const id = requireSlotId(kind, registration?.id);
|
|
@@ -706,6 +706,11 @@ var canonicalPromptMentionResourceSchema = z3.discriminatedUnion("kind", [
|
|
|
706
706
|
icon: z3.string().nullable().optional(),
|
|
707
707
|
itemId: z3.string(),
|
|
708
708
|
label: z3.string()
|
|
709
|
+
}),
|
|
710
|
+
z3.object({
|
|
711
|
+
kind: z3.literal("attachment"),
|
|
712
|
+
path: z3.string(),
|
|
713
|
+
label: z3.string()
|
|
709
714
|
})
|
|
710
715
|
]);
|
|
711
716
|
function normalizeLegacyPromptMentionResource(value) {
|
|
@@ -141,6 +141,11 @@ var canonicalPromptMentionResourceSchema = z3.discriminatedUnion("kind", [
|
|
|
141
141
|
icon: z3.string().nullable().optional(),
|
|
142
142
|
itemId: z3.string(),
|
|
143
143
|
label: z3.string()
|
|
144
|
+
}),
|
|
145
|
+
z3.object({
|
|
146
|
+
kind: z3.literal("attachment"),
|
|
147
|
+
path: z3.string(),
|
|
148
|
+
label: z3.string()
|
|
144
149
|
})
|
|
145
150
|
]);
|
|
146
151
|
function normalizeLegacyPromptMentionResource(value) {
|
package/dist/provider-bridge.js
CHANGED
|
@@ -1199,6 +1199,11 @@ var canonicalPromptMentionResourceSchema = z5.discriminatedUnion("kind", [
|
|
|
1199
1199
|
icon: z5.string().nullable().optional(),
|
|
1200
1200
|
itemId: z5.string(),
|
|
1201
1201
|
label: z5.string()
|
|
1202
|
+
}),
|
|
1203
|
+
z5.object({
|
|
1204
|
+
kind: z5.literal("attachment"),
|
|
1205
|
+
path: z5.string(),
|
|
1206
|
+
label: z5.string()
|
|
1202
1207
|
})
|
|
1203
1208
|
]);
|
|
1204
1209
|
function normalizeLegacyPromptMentionResource(value) {
|