@get-bb/plugin-sdk 0.4.15 → 0.4.17
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 +3 -3
- package/bundled-types/bb-plugin-sdk-ai-services.d.ts +141 -0
- package/bundled-types/bb-plugin-sdk-app.d.ts +144 -21
- package/bundled-types/bb-plugin-sdk-host.d.ts +479 -2
- package/bundled-types/bb-plugin-sdk-internal-composer-customization-validation.d.ts +10 -1
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +339 -32
- package/bundled-types/bb-plugin-sdk-internal-plugin-app-collector.d.ts +2 -1
- package/bundled-types/bb-plugin-sdk-provider-bridge-acp.d.ts +824 -0
- package/bundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts +1742 -211
- package/bundled-types/bb-plugin-sdk-provider-bridge.d.ts +2985 -2442
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +4 -3
- package/bundled-types/bb-plugin-sdk-testing.d.ts +551 -9
- package/bundled-types/bb-plugin-sdk.d.ts +1337 -1349
- package/dist/ai-services.js +91 -0
- package/dist/app.js +2 -2
- package/dist/host.js +14547 -1
- package/dist/internal/composer-customization-validation.js +11 -0
- package/dist/internal/host-policy.js +656 -91
- package/dist/internal/plugin-app-collector.js +58 -14
- package/dist/provider-bridge-acp.js +9940 -0
- package/dist/provider-bridge-testing.js +2979 -1395
- package/dist/provider-bridge-worker-entry.mjs +917 -0
- package/dist/provider-bridge.js +2255 -3718
- package/dist/replay-provider-child.mjs +650 -0
- package/dist/testing/app.js +63 -19
- package/dist/testing/index.js +803 -115
- package/package.json +14 -1
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// src/ai-services.ts
|
|
2
|
+
import { z as z2 } from "zod";
|
|
3
|
+
|
|
4
|
+
// ../domain/src/json-value.ts
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
var jsonValueSchema = z.lazy(
|
|
7
|
+
() => z.union([
|
|
8
|
+
z.string(),
|
|
9
|
+
z.number(),
|
|
10
|
+
z.boolean(),
|
|
11
|
+
z.null(),
|
|
12
|
+
z.array(jsonValueSchema),
|
|
13
|
+
z.record(z.string(), jsonValueSchema)
|
|
14
|
+
])
|
|
15
|
+
);
|
|
16
|
+
var jsonObjectSchema = z.record(
|
|
17
|
+
z.string(),
|
|
18
|
+
jsonValueSchema
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
// src/rpc-contract.ts
|
|
22
|
+
function defineRpcContract(contract) {
|
|
23
|
+
return contract;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// src/ai-services.ts
|
|
27
|
+
var experimental_aiServiceErrorCodeSchema = z2.enum([
|
|
28
|
+
/** The service did not answer within the request's `timeoutMs`. */
|
|
29
|
+
"timeout",
|
|
30
|
+
/** The upstream rejected the request for rate or quota reasons; retryable. */
|
|
31
|
+
"rate_limited",
|
|
32
|
+
/** The upstream is down or overloaded; retryable. */
|
|
33
|
+
"service_unavailable",
|
|
34
|
+
/** No usable credentials on this host; the user must sign in. Not retryable. */
|
|
35
|
+
"auth_required",
|
|
36
|
+
/** The upstream rejected the request (bad model, bad input, policy). Not retryable. */
|
|
37
|
+
"request_failed",
|
|
38
|
+
/** The upstream answered, but not with something that satisfies the request. */
|
|
39
|
+
"invalid_response"
|
|
40
|
+
]);
|
|
41
|
+
var failureSchema = z2.object({
|
|
42
|
+
ok: z2.literal(false),
|
|
43
|
+
code: experimental_aiServiceErrorCodeSchema,
|
|
44
|
+
message: z2.string().min(1)
|
|
45
|
+
}).strict();
|
|
46
|
+
var experimental_aiInferenceCompleteInputSchema = z2.object({
|
|
47
|
+
serviceId: z2.string().min(1),
|
|
48
|
+
/** The model segment of the user's `<serviceId>/<model>` setting. */
|
|
49
|
+
model: z2.string().min(1),
|
|
50
|
+
/** Helper inference is short and latency-bound; no reasoning. */
|
|
51
|
+
reasoningEffort: z2.literal("none"),
|
|
52
|
+
prompt: z2.string().min(1),
|
|
53
|
+
/** A JSON Schema object the structured result must satisfy. */
|
|
54
|
+
outputSchema: jsonObjectSchema,
|
|
55
|
+
timeoutMs: z2.number().int().positive()
|
|
56
|
+
}).strict();
|
|
57
|
+
var experimental_aiInferenceCompleteOutputSchema = z2.union([
|
|
58
|
+
z2.object({ ok: z2.literal(true), model: z2.string().min(1), value: jsonObjectSchema }).strict(),
|
|
59
|
+
failureSchema
|
|
60
|
+
]);
|
|
61
|
+
var experimental_aiVoiceTranscribeInputSchema = z2.object({
|
|
62
|
+
serviceId: z2.string().min(1),
|
|
63
|
+
model: z2.string().min(1),
|
|
64
|
+
audioBase64: z2.string().min(1),
|
|
65
|
+
mimeType: z2.string().min(1),
|
|
66
|
+
filename: z2.string().min(1),
|
|
67
|
+
prompt: z2.string().nullable(),
|
|
68
|
+
timeoutMs: z2.number().int().positive()
|
|
69
|
+
}).strict();
|
|
70
|
+
var experimental_aiVoiceTranscribeOutputSchema = z2.union([
|
|
71
|
+
z2.object({ ok: z2.literal(true), model: z2.string().min(1), text: z2.string() }).strict(),
|
|
72
|
+
failureSchema
|
|
73
|
+
]);
|
|
74
|
+
var experimental_aiServicesHostContract = defineRpcContract({
|
|
75
|
+
"ai.inference.complete": {
|
|
76
|
+
input: experimental_aiInferenceCompleteInputSchema,
|
|
77
|
+
output: experimental_aiInferenceCompleteOutputSchema
|
|
78
|
+
},
|
|
79
|
+
"ai.voice.transcribe": {
|
|
80
|
+
input: experimental_aiVoiceTranscribeInputSchema,
|
|
81
|
+
output: experimental_aiVoiceTranscribeOutputSchema
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
experimental_aiInferenceCompleteInputSchema,
|
|
86
|
+
experimental_aiInferenceCompleteOutputSchema,
|
|
87
|
+
experimental_aiServiceErrorCodeSchema,
|
|
88
|
+
experimental_aiServicesHostContract,
|
|
89
|
+
experimental_aiVoiceTranscribeInputSchema,
|
|
90
|
+
experimental_aiVoiceTranscribeOutputSchema
|
|
91
|
+
};
|
package/dist/app.js
CHANGED
|
@@ -4,7 +4,7 @@ var definePluginApp = runtime.definePluginApp;
|
|
|
4
4
|
var ThreadChat = runtime.ThreadChat;
|
|
5
5
|
var Markdown = runtime.Markdown;
|
|
6
6
|
var experimental_FileLink = runtime.experimental_FileLink;
|
|
7
|
-
var
|
|
7
|
+
var UrlLink = runtime.UrlLink;
|
|
8
8
|
var experimental_NewThreadComposer = runtime.experimental_NewThreadComposer;
|
|
9
9
|
var experimental_ProviderModelPicker = runtime.experimental_ProviderModelPicker;
|
|
10
10
|
var experimental_PermissionModePicker = runtime.experimental_PermissionModePicker;
|
|
@@ -28,6 +28,7 @@ var experimental_useProviders = runtime.experimental_useProviders;
|
|
|
28
28
|
export {
|
|
29
29
|
Markdown,
|
|
30
30
|
ThreadChat,
|
|
31
|
+
UrlLink,
|
|
31
32
|
definePluginApp,
|
|
32
33
|
experimental_Diff,
|
|
33
34
|
experimental_FileLink,
|
|
@@ -35,7 +36,6 @@ export {
|
|
|
35
36
|
experimental_PermissionModePicker,
|
|
36
37
|
experimental_ProviderModelPicker,
|
|
37
38
|
experimental_SourceCode,
|
|
38
|
-
experimental_UrlLink,
|
|
39
39
|
experimental_useAppPanel,
|
|
40
40
|
experimental_useFixedTabTarget,
|
|
41
41
|
experimental_useProviders,
|