@get-bb/plugin-sdk 0.6.60 → 0.6.65
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 +341 -83
- package/bundled-types/bb-plugin-sdk-host.d.ts +196 -214
- package/bundled-types/bb-plugin-sdk-internal-host-policy.d.ts +17 -7
- package/bundled-types/bb-plugin-sdk-internal-rpc-query-host.d.ts +192 -0
- package/bundled-types/bb-plugin-sdk-internal-rpc-tags.d.ts +23 -0
- package/bundled-types/bb-plugin-sdk-testing-app.d.ts +7 -2
- package/bundled-types/bb-plugin-sdk-testing.d.ts +12 -4
- package/bundled-types/bb-plugin-sdk.d.ts +392 -109
- package/dist/app.js +98 -0
- package/dist/host.js +12 -0
- package/dist/index.js +81 -0
- package/dist/internal/host-policy.js +33 -1
- package/dist/internal/plugin-app-collector.js +16 -0
- package/dist/internal/rpc-query-host.js +922 -0
- package/dist/internal/rpc-tags.js +18 -0
- package/dist/provider-bridge-acp-next.js +37 -26
- package/dist/provider-bridge-acp.js +37 -26
- package/dist/provider-bridge.js +21 -20
- package/dist/replay-provider-child.mjs +6 -2
- package/dist/testing/app.js +1128 -100
- package/dist/testing/index.js +247 -104
- package/package.json +16 -2
|
@@ -9,6 +9,75 @@ import { z } from 'zod';
|
|
|
9
9
|
import { ChildProcess } from 'node:child_process';
|
|
10
10
|
import { Readable } from 'node:stream';
|
|
11
11
|
|
|
12
|
+
/** The input form a resolver writes: the options optional, filled per side by the normalizer. */
|
|
13
|
+
declare const providerResolvedNativeRootInputSchema: z.ZodObject<{
|
|
14
|
+
ancestors: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
16
|
+
namePrefix: z.ZodOptional<z.ZodString>;
|
|
17
|
+
origin: z.ZodEnum<{
|
|
18
|
+
project: "project";
|
|
19
|
+
user: "user";
|
|
20
|
+
}>;
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
"command-file": "command-file";
|
|
25
|
+
"skill-file": "skill-file";
|
|
26
|
+
commands: "commands";
|
|
27
|
+
skill: "skill";
|
|
28
|
+
skills: "skills";
|
|
29
|
+
}>>;
|
|
30
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
type ProviderResolvedNativeRootInput = z.input<typeof providerResolvedNativeRootInputSchema>;
|
|
33
|
+
declare const providerResolvedNativeRootsSchema: z.ZodObject<{
|
|
34
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
35
|
+
ancestors: z.ZodBoolean;
|
|
36
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
37
|
+
namePrefix: z.ZodString;
|
|
38
|
+
origin: z.ZodEnum<{
|
|
39
|
+
project: "project";
|
|
40
|
+
user: "user";
|
|
41
|
+
}>;
|
|
42
|
+
path: z.ZodString;
|
|
43
|
+
recursive: z.ZodBoolean;
|
|
44
|
+
shape: z.ZodEnum<{
|
|
45
|
+
"command-file": "command-file";
|
|
46
|
+
"skill-file": "skill-file";
|
|
47
|
+
commands: "commands";
|
|
48
|
+
skill: "skill";
|
|
49
|
+
skills: "skills";
|
|
50
|
+
}>;
|
|
51
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strict>>;
|
|
53
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
54
|
+
ancestors: z.ZodBoolean;
|
|
55
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
56
|
+
namePrefix: z.ZodString;
|
|
57
|
+
origin: z.ZodEnum<{
|
|
58
|
+
project: "project";
|
|
59
|
+
user: "user";
|
|
60
|
+
}>;
|
|
61
|
+
path: z.ZodString;
|
|
62
|
+
recursive: z.ZodBoolean;
|
|
63
|
+
shape: z.ZodEnum<{
|
|
64
|
+
"command-file": "command-file";
|
|
65
|
+
"skill-file": "skill-file";
|
|
66
|
+
commands: "commands";
|
|
67
|
+
skill: "skill";
|
|
68
|
+
skills: "skills";
|
|
69
|
+
}>;
|
|
70
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
type ProviderResolvedNativeRoots = z.infer<typeof providerResolvedNativeRootsSchema>;
|
|
74
|
+
|
|
75
|
+
interface ContractTagDeclarations<Input, Output> {
|
|
76
|
+
tags?(input: Input, output: Output): readonly string[];
|
|
77
|
+
keyTags?(key: string, value: Output extends Readonly<Record<string, infer Value>> ? Value : unknown): readonly string[];
|
|
78
|
+
invalidates?(input: Input, output: Output): readonly string[];
|
|
79
|
+
}
|
|
80
|
+
|
|
12
81
|
/**
|
|
13
82
|
* The validator-neutral subset of Standard Schema v1 used by plugin contracts.
|
|
14
83
|
* Zod 4 schemas implement this interface directly; other validators can do
|
|
@@ -47,7 +116,7 @@ interface StandardSchemaV1Issue {
|
|
|
47
116
|
}
|
|
48
117
|
type StandardSchemaV1InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
49
118
|
type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
50
|
-
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> {
|
|
119
|
+
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> extends ContractTagDeclarations<StandardSchemaV1InferOutput<InputSchema>, StandardSchemaV1InferOutput<OutputSchema>> {
|
|
51
120
|
readonly experimental_description?: string;
|
|
52
121
|
readonly input: InputSchema;
|
|
53
122
|
readonly output: OutputSchema;
|
|
@@ -133,94 +202,6 @@ declare function experimental_defineHostEntry<const Contract extends PluginRpcCo
|
|
|
133
202
|
dispose?: () => void | Promise<void>;
|
|
134
203
|
}): ExperimentalHostEntry<Contract, Signals>;
|
|
135
204
|
|
|
136
|
-
/** The input form a resolver writes: the options optional, filled per side by the normalizer. */
|
|
137
|
-
declare const providerResolvedNativeRootInputSchema: z.ZodObject<{
|
|
138
|
-
ancestors: z.ZodOptional<z.ZodBoolean>;
|
|
139
|
-
fallbackName: z.ZodOptional<z.ZodString>;
|
|
140
|
-
namePrefix: z.ZodOptional<z.ZodString>;
|
|
141
|
-
origin: z.ZodEnum<{
|
|
142
|
-
project: "project";
|
|
143
|
-
user: "user";
|
|
144
|
-
}>;
|
|
145
|
-
path: z.ZodString;
|
|
146
|
-
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
147
|
-
shape: z.ZodOptional<z.ZodEnum<{
|
|
148
|
-
"command-file": "command-file";
|
|
149
|
-
"skill-file": "skill-file";
|
|
150
|
-
commands: "commands";
|
|
151
|
-
skill: "skill";
|
|
152
|
-
skills: "skills";
|
|
153
|
-
}>>;
|
|
154
|
-
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
155
|
-
}, z.core.$strict>;
|
|
156
|
-
type ProviderResolvedNativeRootInput = z.input<typeof providerResolvedNativeRootInputSchema>;
|
|
157
|
-
declare const providerResolvedNativeRootsSchema: z.ZodObject<{
|
|
158
|
-
commands: z.ZodArray<z.ZodObject<{
|
|
159
|
-
ancestors: z.ZodBoolean;
|
|
160
|
-
fallbackName: z.ZodOptional<z.ZodString>;
|
|
161
|
-
namePrefix: z.ZodString;
|
|
162
|
-
origin: z.ZodEnum<{
|
|
163
|
-
project: "project";
|
|
164
|
-
user: "user";
|
|
165
|
-
}>;
|
|
166
|
-
path: z.ZodString;
|
|
167
|
-
recursive: z.ZodBoolean;
|
|
168
|
-
shape: z.ZodEnum<{
|
|
169
|
-
"command-file": "command-file";
|
|
170
|
-
"skill-file": "skill-file";
|
|
171
|
-
commands: "commands";
|
|
172
|
-
skill: "skill";
|
|
173
|
-
skills: "skills";
|
|
174
|
-
}>;
|
|
175
|
-
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
176
|
-
}, z.core.$strict>>;
|
|
177
|
-
skills: z.ZodArray<z.ZodObject<{
|
|
178
|
-
ancestors: z.ZodBoolean;
|
|
179
|
-
fallbackName: z.ZodOptional<z.ZodString>;
|
|
180
|
-
namePrefix: z.ZodString;
|
|
181
|
-
origin: z.ZodEnum<{
|
|
182
|
-
project: "project";
|
|
183
|
-
user: "user";
|
|
184
|
-
}>;
|
|
185
|
-
path: z.ZodString;
|
|
186
|
-
recursive: z.ZodBoolean;
|
|
187
|
-
shape: z.ZodEnum<{
|
|
188
|
-
"command-file": "command-file";
|
|
189
|
-
"skill-file": "skill-file";
|
|
190
|
-
commands: "commands";
|
|
191
|
-
skill: "skill";
|
|
192
|
-
skills: "skills";
|
|
193
|
-
}>;
|
|
194
|
-
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
195
|
-
}, z.core.$strict>>;
|
|
196
|
-
}, z.core.$strict>;
|
|
197
|
-
type ProviderResolvedNativeRoots = z.infer<typeof providerResolvedNativeRootsSchema>;
|
|
198
|
-
|
|
199
|
-
/**
|
|
200
|
-
* The host RPC a provider plugin implements when its declaration sets
|
|
201
|
-
* `experimental_resolvesNativeRoots`. Core calls `resolveNativeRoots` on the
|
|
202
|
-
* workspace host each time it lists a provider's commands or skills (cached
|
|
203
|
-
* briefly per host and workspace) and scans the returned roots beside the
|
|
204
|
-
* declared ones. The plugin answers from the host's own files — a moved
|
|
205
|
-
* config directory, installed vendor plugins, config-file skill entries —
|
|
206
|
-
* and decides each root's origin: a project-scoped vendor plugin is
|
|
207
|
-
* `project`, a home-directory entry is `user`.
|
|
208
|
-
*
|
|
209
|
-
* Paths are host-absolute without dot segments. A root's `shape` says how the
|
|
210
|
-
* daemon reads it; the defaults (`skills` for the skills side, `commands` for
|
|
211
|
-
* the commands side) are filled by the contract. A thrown error or a
|
|
212
|
-
* malformed answer is logged by core and yields no resolved roots for that
|
|
213
|
-
* listing; it never fails the listing. A side longer than
|
|
214
|
-
* `PROVIDER_RESOLVED_NATIVE_ROOTS_MAX` is cut to the cap, not refused.
|
|
215
|
-
*
|
|
216
|
-
* The contract validates the whole answer at once, so one root the contract
|
|
217
|
-
* refuses (a vendor plugin whose name cannot be a name prefix, say) would
|
|
218
|
-
* cost the user every other root. A resolver runs its answer through
|
|
219
|
-
* `experimental_filterResolvedNativeRoots` before it returns: each root is
|
|
220
|
-
* judged on its own, a refused one is dropped with a warning, and the rest
|
|
221
|
-
* stand.
|
|
222
|
-
*/
|
|
223
|
-
|
|
224
205
|
declare const experimental_nativeRootsResolveInputSchema: z.ZodObject<{
|
|
225
206
|
cwd: z.ZodNullable<z.ZodString>;
|
|
226
207
|
providerId: z.ZodString;
|
|
@@ -391,132 +372,133 @@ declare function experimental_filterResolvedNativeRoots<Skill extends ProviderRe
|
|
|
391
372
|
warned?: Set<string>;
|
|
392
373
|
}): ExperimentalFilteredNativeRoots<Skill, Command>;
|
|
393
374
|
declare const experimental_nativeRootsHostContract: {
|
|
394
|
-
readonly resolveNativeRoots: {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
}>;
|
|
517
|
-
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
518
|
-
}, z.core.$strict>>;
|
|
375
|
+
readonly resolveNativeRoots: PluginRpcMethodContract<z.ZodObject<{
|
|
376
|
+
cwd: z.ZodNullable<z.ZodString>;
|
|
377
|
+
providerId: z.ZodString;
|
|
378
|
+
}, z.core.$strict>, z.ZodPipe<z.ZodPipe<z.ZodObject<{
|
|
379
|
+
commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
380
|
+
ancestors: z.ZodOptional<z.ZodBoolean>;
|
|
381
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
382
|
+
namePrefix: z.ZodOptional<z.ZodString>;
|
|
383
|
+
origin: z.ZodEnum<{
|
|
384
|
+
project: "project";
|
|
385
|
+
user: "user";
|
|
386
|
+
}>;
|
|
387
|
+
path: z.ZodString;
|
|
388
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
389
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
390
|
+
"command-file": "command-file";
|
|
391
|
+
"skill-file": "skill-file";
|
|
392
|
+
commands: "commands";
|
|
393
|
+
skill: "skill";
|
|
394
|
+
skills: "skills";
|
|
395
|
+
}>>;
|
|
396
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
397
|
+
}, z.core.$strict>>>;
|
|
398
|
+
skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
399
|
+
ancestors: z.ZodOptional<z.ZodBoolean>;
|
|
400
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
401
|
+
namePrefix: z.ZodOptional<z.ZodString>;
|
|
402
|
+
origin: z.ZodEnum<{
|
|
403
|
+
project: "project";
|
|
404
|
+
user: "user";
|
|
405
|
+
}>;
|
|
406
|
+
path: z.ZodString;
|
|
407
|
+
recursive: z.ZodOptional<z.ZodBoolean>;
|
|
408
|
+
shape: z.ZodOptional<z.ZodEnum<{
|
|
409
|
+
"command-file": "command-file";
|
|
410
|
+
"skill-file": "skill-file";
|
|
411
|
+
commands: "commands";
|
|
412
|
+
skill: "skill";
|
|
413
|
+
skills: "skills";
|
|
414
|
+
}>>;
|
|
415
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
416
|
+
}, z.core.$strict>>>;
|
|
417
|
+
}, z.core.$strict>, z.ZodTransform<{
|
|
418
|
+
skills: {
|
|
419
|
+
path: string;
|
|
420
|
+
origin: "project" | "user";
|
|
421
|
+
recursive: boolean;
|
|
422
|
+
ancestors: boolean;
|
|
423
|
+
namePrefix: string;
|
|
424
|
+
shape: "command-file" | "commands" | "skill" | "skill-file" | "skills";
|
|
425
|
+
fallbackName?: string | undefined;
|
|
426
|
+
skipIfManifest?: string | undefined;
|
|
427
|
+
}[];
|
|
428
|
+
commands: {
|
|
429
|
+
path: string;
|
|
430
|
+
origin: "project" | "user";
|
|
431
|
+
recursive: boolean;
|
|
432
|
+
ancestors: boolean;
|
|
433
|
+
namePrefix: string;
|
|
434
|
+
shape: "command-file" | "commands" | "skill" | "skill-file" | "skills";
|
|
435
|
+
fallbackName?: string | undefined;
|
|
436
|
+
skipIfManifest?: string | undefined;
|
|
437
|
+
}[];
|
|
438
|
+
}, {
|
|
439
|
+
skills?: {
|
|
440
|
+
path: string;
|
|
441
|
+
origin: "project" | "user";
|
|
442
|
+
recursive?: boolean | undefined;
|
|
443
|
+
ancestors?: boolean | undefined;
|
|
444
|
+
namePrefix?: string | undefined;
|
|
445
|
+
shape?: "command-file" | "commands" | "skill" | "skill-file" | "skills" | undefined;
|
|
446
|
+
fallbackName?: string | undefined;
|
|
447
|
+
skipIfManifest?: string | undefined;
|
|
448
|
+
}[] | undefined;
|
|
449
|
+
commands?: {
|
|
450
|
+
path: string;
|
|
451
|
+
origin: "project" | "user";
|
|
452
|
+
recursive?: boolean | undefined;
|
|
453
|
+
ancestors?: boolean | undefined;
|
|
454
|
+
namePrefix?: string | undefined;
|
|
455
|
+
shape?: "command-file" | "commands" | "skill" | "skill-file" | "skills" | undefined;
|
|
456
|
+
fallbackName?: string | undefined;
|
|
457
|
+
skipIfManifest?: string | undefined;
|
|
458
|
+
}[] | undefined;
|
|
459
|
+
}>>, z.ZodObject<{
|
|
460
|
+
commands: z.ZodArray<z.ZodObject<{
|
|
461
|
+
ancestors: z.ZodBoolean;
|
|
462
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
463
|
+
namePrefix: z.ZodString;
|
|
464
|
+
origin: z.ZodEnum<{
|
|
465
|
+
project: "project";
|
|
466
|
+
user: "user";
|
|
467
|
+
}>;
|
|
468
|
+
path: z.ZodString;
|
|
469
|
+
recursive: z.ZodBoolean;
|
|
470
|
+
shape: z.ZodEnum<{
|
|
471
|
+
"command-file": "command-file";
|
|
472
|
+
"skill-file": "skill-file";
|
|
473
|
+
commands: "commands";
|
|
474
|
+
skill: "skill";
|
|
475
|
+
skills: "skills";
|
|
476
|
+
}>;
|
|
477
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
478
|
+
}, z.core.$strict>>;
|
|
479
|
+
skills: z.ZodArray<z.ZodObject<{
|
|
480
|
+
ancestors: z.ZodBoolean;
|
|
481
|
+
fallbackName: z.ZodOptional<z.ZodString>;
|
|
482
|
+
namePrefix: z.ZodString;
|
|
483
|
+
origin: z.ZodEnum<{
|
|
484
|
+
project: "project";
|
|
485
|
+
user: "user";
|
|
486
|
+
}>;
|
|
487
|
+
path: z.ZodString;
|
|
488
|
+
recursive: z.ZodBoolean;
|
|
489
|
+
shape: z.ZodEnum<{
|
|
490
|
+
"command-file": "command-file";
|
|
491
|
+
"skill-file": "skill-file";
|
|
492
|
+
commands: "commands";
|
|
493
|
+
skill: "skill";
|
|
494
|
+
skills: "skills";
|
|
495
|
+
}>;
|
|
496
|
+
skipIfManifest: z.ZodOptional<z.ZodString>;
|
|
519
497
|
}, z.core.$strict>>;
|
|
498
|
+
}, z.core.$strict>>>;
|
|
499
|
+
} & {
|
|
500
|
+
readonly resolveNativeRoots: {
|
|
501
|
+
keyTags?: never;
|
|
520
502
|
};
|
|
521
503
|
};
|
|
522
504
|
type ExperimentalNativeRootsHostContract = typeof experimental_nativeRootsHostContract;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// and read the real source: https://github.com/get-bb/bb
|
|
7
7
|
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
-
import { StandardSchemaV1 as StandardSchemaV1$1, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, StandardSchemaV1InferOutput, PluginEnvironmentValidateDecision, JsonValue as JsonValue$2, PluginMachineValidateDecision } from '@get-bb/plugin-sdk';
|
|
9
|
+
import { StandardSchemaV1 as StandardSchemaV1$1, PluginEnvironmentProviderRequirements as PluginEnvironmentProviderRequirements$1, StandardSchemaV1InferOutput as StandardSchemaV1InferOutput$1, PluginEnvironmentValidateDecision, JsonValue as JsonValue$2, PluginMachineValidateDecision } from '@get-bb/plugin-sdk';
|
|
10
10
|
import Database from 'better-sqlite3';
|
|
11
11
|
|
|
12
12
|
/** Input-form entry: a path, or a path with options. */
|
|
@@ -476,6 +476,12 @@ declare const threadQueuedMessageSchema: z.ZodObject<{
|
|
|
476
476
|
}, z.core.$strip>;
|
|
477
477
|
type ThreadQueuedMessage = z.infer<typeof threadQueuedMessageSchema>;
|
|
478
478
|
|
|
479
|
+
interface ContractTagDeclarations<Input, Output> {
|
|
480
|
+
tags?(input: Input, output: Output): readonly string[];
|
|
481
|
+
keyTags?(key: string, value: Output extends Readonly<Record<string, infer Value>> ? Value : unknown): readonly string[];
|
|
482
|
+
invalidates?(input: Input, output: Output): readonly string[];
|
|
483
|
+
}
|
|
484
|
+
|
|
479
485
|
type ExecutionInputFieldSource = CallerExecutionInputSource;
|
|
480
486
|
declare const threadResponseSchema: z.ZodObject<{
|
|
481
487
|
activeBackgroundAgentCount: z.ZodNumber;
|
|
@@ -549,7 +555,7 @@ type Checkout<R> = R extends {
|
|
|
549
555
|
path: string;
|
|
550
556
|
experimental_ownsPath: boolean;
|
|
551
557
|
} | null;
|
|
552
|
-
type InputsValue$1<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput<S> : null;
|
|
558
|
+
type InputsValue$1<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput$1<S> : null;
|
|
553
559
|
/** Attempt-scoped updates; core persists each update before this call returns. */
|
|
554
560
|
interface PluginEnvironmentProviderProgress {
|
|
555
561
|
step(text: string): void;
|
|
@@ -662,7 +668,7 @@ declare const RESERVED_BB_CLI_COMMANDS: readonly string[];
|
|
|
662
668
|
|
|
663
669
|
type PluginMachineProviderResource = Exclude<JsonValue$2, null>;
|
|
664
670
|
type PluginMachineProviderInputsSchema = StandardSchemaV1$1 | undefined;
|
|
665
|
-
type InputsValue<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput<S> : null;
|
|
671
|
+
type InputsValue<S> = S extends StandardSchemaV1$1 ? StandardSchemaV1InferOutput$1<S> : null;
|
|
666
672
|
interface PluginMachineProviderProgress {
|
|
667
673
|
step(text: string): void;
|
|
668
674
|
log(text: string): void;
|
|
@@ -753,8 +759,9 @@ interface PluginRpcValidationIssue {
|
|
|
753
759
|
message: string;
|
|
754
760
|
path?: PluginRpcIssuePathSegment[];
|
|
755
761
|
}
|
|
756
|
-
|
|
757
|
-
|
|
762
|
+
declare const rpcErrorCodes: readonly ["forbidden", "not_found", "conflict", "invalid", "invalid_json", "invalid_input", "handler_error", "invalid_output", "non_json_result", "unknown_method", "transport_error", "invalid_response", "unknown_error"];
|
|
763
|
+
/** RPC categories may grow. Handle unknown_error as a fallback for newer server codes. */
|
|
764
|
+
type PluginRpcErrorCode = (typeof rpcErrorCodes)[number];
|
|
758
765
|
/** Structured RPC failure returned as `{ ok: false, error }`. */
|
|
759
766
|
interface PluginRpcError {
|
|
760
767
|
code: PluginRpcErrorCode;
|
|
@@ -797,7 +804,8 @@ interface StandardSchemaV1Issue {
|
|
|
797
804
|
readonly key: PropertyKey;
|
|
798
805
|
})[];
|
|
799
806
|
}
|
|
800
|
-
|
|
807
|
+
type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
808
|
+
interface PluginRpcMethodContract<InputSchema extends StandardSchemaV1 = StandardSchemaV1, OutputSchema extends StandardSchemaV1 = StandardSchemaV1> extends ContractTagDeclarations<StandardSchemaV1InferOutput<InputSchema>, StandardSchemaV1InferOutput<OutputSchema>> {
|
|
801
809
|
readonly experimental_description?: string;
|
|
802
810
|
readonly input: InputSchema;
|
|
803
811
|
readonly output: OutputSchema;
|
|
@@ -2038,6 +2046,7 @@ declare function normalizeWebSocketRouteRegistration(path: string, handler: unkn
|
|
|
2038
2046
|
auth: PluginHttpAuthMode;
|
|
2039
2047
|
};
|
|
2040
2048
|
type RpcRegistrationRecord = {
|
|
2049
|
+
declarations: ContractTagDeclarations<unknown, unknown>;
|
|
2041
2050
|
publication: ReturnType<typeof publishRpcMethod>;
|
|
2042
2051
|
inputSchema: StandardSchemaV1;
|
|
2043
2052
|
outputSchema: StandardSchemaV1;
|
|
@@ -2126,8 +2135,9 @@ declare function normalizePluginAgentConfiguration(args: {
|
|
|
2126
2135
|
skillIds: string[];
|
|
2127
2136
|
instructions: string | null;
|
|
2128
2137
|
};
|
|
2138
|
+
declare function readPluginRpcRefusal(error: unknown): PluginRpcError | null;
|
|
2129
2139
|
declare function validateRpcValue(schema: StandardSchemaV1, value: unknown, phase: "input" | "output", fail: (error: PluginRpcError) => never): Promise<unknown>;
|
|
2130
2140
|
declare function normalizeRpcJsonResult(value: unknown, fail: (error: PluginRpcError) => never): JsonValue;
|
|
2131
2141
|
|
|
2132
|
-
export { ENVIRONMENT_PROVIDER_DESCRIPTION_MAX_CHARS, ENVIRONMENT_PROVIDER_DISPLAY_NAME_MAX_CHARS, ENVIRONMENT_PROVIDER_ID_PATTERN, ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES, KV_VALUE_MAX_BYTES, MACHINE_PROVIDER_DESCRIPTION_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_ENV_MAX_ENTRIES, PLUGIN_PROVIDER_ENV_NAME_PATTERN, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, aiServiceAlreadyRegisteredMessage, coerceStoredPluginSettingValue, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, environmentCompositionSchema, isPluginMentionTrigger, isStandardSchema, normalizeAgentToolRegistration, normalizeCliRegistration, normalizeHttpRouteRegistration, normalizeInteractionRequest, normalizeMentionProviderRegistration, normalizePluginAgentConfiguration, normalizeRealtimePayload, normalizeRpcJsonResult, normalizeRpcRegistration, normalizeWebSocketRouteRegistration, parsePluginRowPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, publishRpcMethod, readRpcPublicationOptions, registerSettingDescriptors, runPluginStorageMigrations, storePluginHook, summarizeStandardIssues, undeclaredIconProblem, validateBackgroundServiceRegistration, validatePluginAiServiceDeclaration, validatePluginEnvironmentProviderDeclaration, validatePluginMachineProviderDeclaration, validatePluginProviderDeclaration, validatePluginProviderEnvEntries, validateProviderEnvContribution, validateRpcValue, validateScheduleRegistration, validateServerAccessProviderDeclaration, validateSettingsUpdate };
|
|
2142
|
+
export { ENVIRONMENT_PROVIDER_DESCRIPTION_MAX_CHARS, ENVIRONMENT_PROVIDER_DISPLAY_NAME_MAX_CHARS, ENVIRONMENT_PROVIDER_ID_PATTERN, ENVIRONMENT_PROVIDER_REQUIREMENT_NAMES, KV_VALUE_MAX_BYTES, MACHINE_PROVIDER_DESCRIPTION_MAX_CHARS, PLUGIN_AGENT_STATUS_LABEL_MAX_CHARS, PLUGIN_MENTION_TRIGGER_VALUES, PLUGIN_PROVIDER_BRIDGE_OPTIONS_MAX_BYTES, PLUGIN_PROVIDER_COMPOSER_ACTION_VALUES, PLUGIN_PROVIDER_DISPLAY_NAME_MAX_CHARS, PLUGIN_PROVIDER_ENV_MAX_ENTRIES, PLUGIN_PROVIDER_ENV_NAME_PATTERN, PLUGIN_PROVIDER_PERMISSION_MODE_VALUES, PLUGIN_PROVIDER_REASONING_LEVEL_VALUES, PROVIDER_ID_PATTERN, RESERVED_AGENT_TOOL_NAMES, RESERVED_BB_CLI_COMMANDS, SETTING_KEY_PATTERN, adoptHttpRouteResponse, aiServiceAlreadyRegisteredMessage, coerceStoredPluginSettingValue, deriveValidatedProviderOptions, enforcePluginCliOutputLimit, environmentCompositionSchema, isPluginMentionTrigger, isStandardSchema, normalizeAgentToolRegistration, normalizeCliRegistration, normalizeHttpRouteRegistration, normalizeInteractionRequest, normalizeMentionProviderRegistration, normalizePluginAgentConfiguration, normalizeRealtimePayload, normalizeRpcJsonResult, normalizeRpcRegistration, normalizeWebSocketRouteRegistration, parsePluginRowPresentation, pluginCliCollisionWarning, pluginHookAlreadyRegisteredMessage, providerAlreadyRegisteredMessage, providerIconRefusalMessage, providerWithoutBridgeMessage, publishRpcMethod, readPluginRpcRefusal, readRpcPublicationOptions, registerSettingDescriptors, runPluginStorageMigrations, storePluginHook, summarizeStandardIssues, undeclaredIconProblem, validateBackgroundServiceRegistration, validatePluginAiServiceDeclaration, validatePluginEnvironmentProviderDeclaration, validatePluginMachineProviderDeclaration, validatePluginProviderDeclaration, validatePluginProviderEnvEntries, validateProviderEnvContribution, validateRpcValue, validateScheduleRegistration, validateServerAccessProviderDeclaration, validateSettingsUpdate };
|
|
2133
2143
|
export type { NormalizedPluginAiService, NormalizedPluginEnvironmentComposition, NormalizedPluginEnvironmentProvider, NormalizedPluginEnvironmentProviderRequirements, NormalizedPluginInteractionRequest, NormalizedPluginMachineProvider, NormalizedPluginProviderDeclaration };
|