@get-bb/plugin-sdk 0.6.60 → 0.6.68

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.
@@ -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
- readonly input: z.ZodObject<{
396
- cwd: z.ZodNullable<z.ZodString>;
397
- providerId: z.ZodString;
398
- }, z.core.$strict>;
399
- readonly output: z.ZodPipe<z.ZodPipe<z.ZodObject<{
400
- commands: z.ZodOptional<z.ZodArray<z.ZodObject<{
401
- ancestors: z.ZodOptional<z.ZodBoolean>;
402
- fallbackName: z.ZodOptional<z.ZodString>;
403
- namePrefix: z.ZodOptional<z.ZodString>;
404
- origin: z.ZodEnum<{
405
- project: "project";
406
- user: "user";
407
- }>;
408
- path: z.ZodString;
409
- recursive: z.ZodOptional<z.ZodBoolean>;
410
- shape: z.ZodOptional<z.ZodEnum<{
411
- "command-file": "command-file";
412
- "skill-file": "skill-file";
413
- commands: "commands";
414
- skill: "skill";
415
- skills: "skills";
416
- }>>;
417
- skipIfManifest: z.ZodOptional<z.ZodString>;
418
- }, z.core.$strict>>>;
419
- skills: z.ZodOptional<z.ZodArray<z.ZodObject<{
420
- ancestors: z.ZodOptional<z.ZodBoolean>;
421
- fallbackName: z.ZodOptional<z.ZodString>;
422
- namePrefix: z.ZodOptional<z.ZodString>;
423
- origin: z.ZodEnum<{
424
- project: "project";
425
- user: "user";
426
- }>;
427
- path: z.ZodString;
428
- recursive: z.ZodOptional<z.ZodBoolean>;
429
- shape: z.ZodOptional<z.ZodEnum<{
430
- "command-file": "command-file";
431
- "skill-file": "skill-file";
432
- commands: "commands";
433
- skill: "skill";
434
- skills: "skills";
435
- }>>;
436
- skipIfManifest: z.ZodOptional<z.ZodString>;
437
- }, z.core.$strict>>>;
438
- }, z.core.$strict>, z.ZodTransform<{
439
- skills: {
440
- path: string;
441
- origin: "project" | "user";
442
- recursive: boolean;
443
- ancestors: boolean;
444
- namePrefix: string;
445
- shape: "command-file" | "commands" | "skill" | "skill-file" | "skills";
446
- fallbackName?: string | undefined;
447
- skipIfManifest?: string | undefined;
448
- }[];
449
- commands: {
450
- path: string;
451
- origin: "project" | "user";
452
- recursive: boolean;
453
- ancestors: boolean;
454
- namePrefix: string;
455
- shape: "command-file" | "commands" | "skill" | "skill-file" | "skills";
456
- fallbackName?: string | undefined;
457
- skipIfManifest?: string | undefined;
458
- }[];
459
- }, {
460
- skills?: {
461
- path: string;
462
- origin: "project" | "user";
463
- recursive?: boolean | undefined;
464
- ancestors?: boolean | undefined;
465
- namePrefix?: string | undefined;
466
- shape?: "command-file" | "commands" | "skill" | "skill-file" | "skills" | undefined;
467
- fallbackName?: string | undefined;
468
- skipIfManifest?: string | undefined;
469
- }[] | undefined;
470
- commands?: {
471
- path: string;
472
- origin: "project" | "user";
473
- recursive?: boolean | undefined;
474
- ancestors?: boolean | undefined;
475
- namePrefix?: string | undefined;
476
- shape?: "command-file" | "commands" | "skill" | "skill-file" | "skills" | undefined;
477
- fallbackName?: string | undefined;
478
- skipIfManifest?: string | undefined;
479
- }[] | undefined;
480
- }>>, z.ZodObject<{
481
- commands: z.ZodArray<z.ZodObject<{
482
- ancestors: z.ZodBoolean;
483
- fallbackName: z.ZodOptional<z.ZodString>;
484
- namePrefix: z.ZodString;
485
- origin: z.ZodEnum<{
486
- project: "project";
487
- user: "user";
488
- }>;
489
- path: z.ZodString;
490
- recursive: z.ZodBoolean;
491
- shape: z.ZodEnum<{
492
- "command-file": "command-file";
493
- "skill-file": "skill-file";
494
- commands: "commands";
495
- skill: "skill";
496
- skills: "skills";
497
- }>;
498
- skipIfManifest: z.ZodOptional<z.ZodString>;
499
- }, z.core.$strict>>;
500
- skills: z.ZodArray<z.ZodObject<{
501
- ancestors: z.ZodBoolean;
502
- fallbackName: z.ZodOptional<z.ZodString>;
503
- namePrefix: z.ZodString;
504
- origin: z.ZodEnum<{
505
- project: "project";
506
- user: "user";
507
- }>;
508
- path: z.ZodString;
509
- recursive: z.ZodBoolean;
510
- shape: z.ZodEnum<{
511
- "command-file": "command-file";
512
- "skill-file": "skill-file";
513
- commands: "commands";
514
- skill: "skill";
515
- skills: "skills";
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 { PluginComposerApi as PluginComposerApi$1, PluginComposerScope as PluginComposerScope$1, ComposerDraftSnapshot as ComposerDraftSnapshot$1, ComposerSelection as ComposerSelection$1, ComposerDraftReplacement as ComposerDraftReplacement$1, ComposerDraft as ComposerDraft$1, ComposerSubmitOptions as ComposerSubmitOptions$1, JsonValue as JsonValue$2, ComposerMention as ComposerMention$1, PluginComposerTextEffect as PluginComposerTextEffect$1 } from '@get-bb/plugin-sdk';
9
+ import { JsonValue as JsonValue$2, PluginComposerApi as PluginComposerApi$1, PluginComposerScope as PluginComposerScope$1, ComposerDraftSnapshot as ComposerDraftSnapshot$1, ComposerSelection as ComposerSelection$1, ComposerDraftReplacement as ComposerDraftReplacement$1, ComposerDraft as ComposerDraft$1, ComposerMention as ComposerMention$1, PluginComposerTextEffect as PluginComposerTextEffect$1 } from '@get-bb/plugin-sdk';
10
10
 
11
11
  interface JsonObject {
12
12
  [key: string]: JsonValue$1;
@@ -295,29 +295,41 @@ interface PluginComposerApi {
295
295
  /** Focus the composer caret at the end of the draft. */
296
296
  focus(): void;
297
297
  /**
298
- * Submit this composer's draft exactly as pressing Enter would: the same
299
- * checks and the same action (send, or queue while the thread is busy; a
300
- * provider handoff creates a new thread). The draft's attachments and
298
+ * Submit this composer's draft through the composer's own send and steer
299
+ * handlers, the ones Enter and modifier+Enter run, including a
300
+ * provider handoff that creates a new thread. The draft's attachments and
301
301
  * @-mentions, and — in the new-thread composer — the provider, model,
302
302
  * reasoning level, service tier, permission mode and environment the user
303
303
  * has selected on screen, all travel with it.
304
304
  *
305
- * While attachments are uploading it waits for them, then checks again; it
306
- * rejects if an upload fails. Otherwise, when submitting is blocked it
307
- * rejects with `submittingBlockedReason`, a message safe to show to the
308
- * user. The queued-message and sent-message editors save edits and reject.
305
+ * It submits only the draft, so it rejects an empty one, even where the
306
+ * shortcut would steer the next queued message instead. Otherwise it runs
307
+ * only when the matching shortcut would. While attachments are uploading it
308
+ * waits for them, then checks again; it rejects if an upload fails. When
309
+ * the shortcut could not submit, it rejects with the reason, a message safe
310
+ * to show to the user. The composer must be on screen. The queued-message
311
+ * and sent-message editors reject.
309
312
  *
310
- * `sendAt` queues the submission until that time. `experimental_data` is
311
- * opaque JSON delivered to dispatch hooks together with the calling plugin's
312
- * id on this initial attempt. Hooks run before operational core waits. If a
313
- * hook queues the message, its existing plugin wait identifies the owner on
314
- * later attempts; core does not persist or interpret the opaque data.
313
+ * Every option combines with the others. `experimental_mode` uses the
314
+ * names `bb.sdk.threads.send` uses. Without it, submit does what Enter
315
+ * does for this user, which may be to queue or to steer.
316
+ * `"queue-if-active"` queues behind the running turn, or starts a turn.
317
+ * `"steer-if-active"` adds the message to the running turn. Where nothing
318
+ * can be steered, such as on an idle thread, it starts a turn.
319
+ * `sendAt` makes the chosen action wait until the given time; a scheduled
320
+ * steer steers whatever turn is running then. `experimental_data` is
321
+ * opaque JSON delivered to dispatch hooks together with the calling
322
+ * plugin's id on this initial attempt. Hooks run before operational core
323
+ * waits. If a hook queues the message, its existing plugin wait identifies
324
+ * the owner on later attempts; core does not persist or interpret the
325
+ * opaque data.
315
326
  *
316
- * Resolves once the host has accepted the submission and cleared the draft.
317
- * Failures of the underlying request are reported by bb's own submit error
318
- * handling and restore the draft, exactly as an interactive failure does.
327
+ * Resolves once the composer has accepted the submission and cleared the
328
+ * draft. Failures of the underlying request show bb's usual error toast
329
+ * and restore the draft, exactly as an interactive failure does, and then
330
+ * reject with the toast's message.
319
331
  */
320
- submit(options: ComposerSubmitOptions): Promise<void>;
332
+ submit(options?: ComposerSubmitOptions): Promise<void>;
321
333
  /**
322
334
  * Set this composer's pickers as if each value had been picked by hand.
323
335
  *
@@ -396,20 +408,22 @@ interface ComposerSelection {
396
408
  serviceTier?: ServiceTier;
397
409
  permissionMode?: PermissionMode;
398
410
  }
399
- /**
400
- * What `submit` does differently from pressing Enter.
401
- *
402
- * `experimental_data` is opaque JSON delivered to dispatch hooks. The runtime
403
- * associates it with the calling plugin automatically for the initial
404
- * dispatch attempt.
405
- */
406
- type ComposerSubmitOptions = {
407
- sendAt: number;
411
+ /** What `submit` adds to pressing Enter. Every field combines with the others. */
412
+ interface ComposerSubmitOptions {
413
+ /**
414
+ * `"queue-if-active"` queues behind the running turn and
415
+ * `"steer-if-active"` adds to it; both start a turn when none is running.
416
+ * Omitted, it does what Enter does for this user.
417
+ */
418
+ experimental_mode?: "queue-if-active" | "steer-if-active";
419
+ /** Epoch ms in the future; the action waits until then. */
420
+ sendAt?: number;
421
+ /**
422
+ * Opaque JSON delivered to dispatch hooks with the calling plugin's id on
423
+ * the initial dispatch attempt.
424
+ */
408
425
  experimental_data?: JsonValue;
409
- } | {
410
- experimental_data: JsonValue;
411
- sendAt?: never;
412
- };
426
+ }
413
427
 
414
428
  declare function reconcileComposerMentions(currentText: string, nextText: string, mentions: readonly ComposerMention[]): ComposerMention[];
415
429
 
@@ -425,6 +439,16 @@ interface ComposerEditorState {
425
439
  isAttaching: boolean;
426
440
  attachmentError: string | null;
427
441
  }
442
+ interface ComposerSubmitExtras {
443
+ sendAt?: number;
444
+ pluginSubmission?: {
445
+ pluginId: string;
446
+ data: JsonValue$2;
447
+ };
448
+ }
449
+ interface ComposerEditorSubmission extends ComposerSubmitExtras {
450
+ mode: "enter" | "queue-if-active" | "steer-if-active";
451
+ }
428
452
  interface ComposerHandleTarget {
429
453
  key: string;
430
454
  scope: PluginComposerScope$1;
@@ -440,10 +464,11 @@ interface ComposerHandleTarget {
440
464
  focus(): void;
441
465
  openPopup?(pluginId: string, popupId: string): boolean;
442
466
  closePopup?(pluginId: string): boolean;
443
- submit?(options: ComposerSubmitOptions$1, pluginSubmission: {
444
- pluginId: string;
445
- data: JsonValue$2;
446
- } | undefined): Promise<void>;
467
+ /**
468
+ * Runs the on-screen composer's own Enter, queue or steer handler with the
469
+ * submission's extras, or returns null when no composer box is mounted.
470
+ */
471
+ editorSubmit(submission: ComposerEditorSubmission): Promise<void> | null;
447
472
  setSelection?(selection: ComposerSelection$1): Promise<ComposerSelection$1>;
448
473
  }
449
474
  interface ComposerHandleController {
@@ -464,4 +489,4 @@ declare function appendComposerDraft(current: ComposerDraft$1, value: ComposerDr
464
489
  declare function createComposerHandleBinding(key: string, initial: ComposerHandleController): ComposerHandleBinding;
465
490
 
466
491
  export { OFF_SCREEN_EDITOR_STATE, appendComposerDraft, createComposerDraftActions, createComposerHandleBinding, reconcileComposerMentions };
467
- export type { ComposerEditorState, ComposerHandleBinding, ComposerHandleController, ComposerHandleTarget };
492
+ export type { ComposerEditorState, ComposerEditorSubmission, ComposerHandleBinding, ComposerHandleController, ComposerHandleTarget, ComposerSubmitExtras };