@get-bb/plugin-sdk 0.6.16 → 0.6.23

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.
@@ -77,18 +77,6 @@ declare const createThreadEnvironmentArgsSchema: z.ZodDiscriminatedUnion<[z.ZodO
77
77
  }, z.core.$strip>], "type">;
78
78
  type CreateThreadEnvironmentArgs = z.infer<typeof createThreadEnvironmentArgsSchema>;
79
79
 
80
- declare const uploadedPromptAttachmentSchema: z.ZodObject<{
81
- mimeType: z.ZodOptional<z.ZodString>;
82
- name: z.ZodString;
83
- path: z.ZodString;
84
- sizeBytes: z.ZodNumber;
85
- type: z.ZodEnum<{
86
- localFile: "localFile";
87
- localImage: "localImage";
88
- }>;
89
- }, z.core.$strip>;
90
- type UploadedPromptAttachment = z.infer<typeof uploadedPromptAttachmentSchema>;
91
-
92
80
  /**
93
81
  * A value that survives a JSON round trip without coercion or data loss.
94
82
  *
@@ -117,8 +105,26 @@ interface ComposerDraft {
117
105
  text: string;
118
106
  mentions: readonly ComposerMention[];
119
107
  }
120
- /** An already uploaded attachment; paths retain their original project or thread ownership. */
121
- type ComposerAttachment = UploadedPromptAttachment;
108
+ /**
109
+ * A composer attachment: an uploaded file, optionally owned by another
110
+ * project, or an absolute path on one machine. Never both.
111
+ */
112
+ type ComposerAttachment = {
113
+ type: "localFile" | "localImage";
114
+ path: string;
115
+ name: string;
116
+ mimeType?: string;
117
+ /** Exact size in bytes; omit when unknown. Zero is treated as unknown. A wrong nonzero size can make the send fail when bb stages a file. */
118
+ sizeBytes?: number;
119
+ } & ({
120
+ /** Project that currently owns this uploaded path; omit for destination-relative attachments. */
121
+ sourceProjectId?: string;
122
+ hostId?: never;
123
+ } | {
124
+ /** Machine whose absolute `path` this is; core rejects sending it to a thread on another machine. */
125
+ hostId: string;
126
+ sourceProjectId?: never;
127
+ });
122
128
  /** The complete current draft. Snapshots and their entries are immutable. */
123
129
  interface ComposerDraftSnapshot extends ComposerDraft {
124
130
  readonly attachments: readonly ComposerAttachment[];
@@ -263,8 +269,10 @@ interface PluginComposerApi {
263
269
  * an empty list clears them. Does not infer or rebase mention ranges.
264
270
  * Ranges are non-overlapping UTF-16 offsets into the supplied text.
265
271
  * Invalid results, throwing updaters, and unavailable editors leave the
266
- * draft unchanged. Does not focus, submit, upload, or copy files between
267
- * projects. Use `insert` for insertion at the editor's cursor.
272
+ * draft unchanged. Source project references on uploaded attachments are
273
+ * preserved; core copies them into the destination project when the draft
274
+ * is submitted. Does not focus or submit. Use `insert` for insertion at the
275
+ * editor's cursor.
268
276
  */
269
277
  replace(next: ComposerDraftReplacement | ((current: ComposerDraftSnapshot) => ComposerDraftReplacement)): void;
270
278
  /**
@@ -278,16 +278,20 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
278
278
  "agent-only": "agent-only";
279
279
  }>>;
280
280
  }, z.core.$strip>, z.ZodObject<{
281
+ hostId: z.ZodOptional<z.ZodString>;
281
282
  path: z.ZodString;
283
+ sourceProjectId: z.ZodOptional<z.ZodString>;
282
284
  type: z.ZodLiteral<"localImage">;
283
285
  visibility: z.ZodOptional<z.ZodEnum<{
284
286
  "agent-only": "agent-only";
285
287
  }>>;
286
288
  }, z.core.$strip>, z.ZodObject<{
289
+ hostId: z.ZodOptional<z.ZodString>;
287
290
  mimeType: z.ZodOptional<z.ZodString>;
288
291
  name: z.ZodOptional<z.ZodString>;
289
292
  path: z.ZodString;
290
293
  sizeBytes: z.ZodOptional<z.ZodNumber>;
294
+ sourceProjectId: z.ZodOptional<z.ZodString>;
291
295
  type: z.ZodLiteral<"localFile">;
292
296
  visibility: z.ZodOptional<z.ZodEnum<{
293
297
  "agent-only": "agent-only";
@@ -386,16 +390,20 @@ declare const threadQueuedMessageSchema: z.ZodObject<{
386
390
  "agent-only": "agent-only";
387
391
  }>>;
388
392
  }, z.core.$strip>, z.ZodObject<{
393
+ hostId: z.ZodOptional<z.ZodString>;
389
394
  path: z.ZodString;
395
+ sourceProjectId: z.ZodOptional<z.ZodString>;
390
396
  type: z.ZodLiteral<"localImage">;
391
397
  visibility: z.ZodOptional<z.ZodEnum<{
392
398
  "agent-only": "agent-only";
393
399
  }>>;
394
400
  }, z.core.$strip>, z.ZodObject<{
401
+ hostId: z.ZodOptional<z.ZodString>;
395
402
  mimeType: z.ZodOptional<z.ZodString>;
396
403
  name: z.ZodOptional<z.ZodString>;
397
404
  path: z.ZodString;
398
405
  sizeBytes: z.ZodOptional<z.ZodNumber>;
406
+ sourceProjectId: z.ZodOptional<z.ZodString>;
399
407
  type: z.ZodLiteral<"localFile">;
400
408
  visibility: z.ZodOptional<z.ZodEnum<{
401
409
  "agent-only": "agent-only";
@@ -3466,16 +3466,20 @@ declare const threadEventSchema: z.ZodUnion<readonly [z.ZodIntersection<z.ZodDis
3466
3466
  "agent-only": "agent-only";
3467
3467
  }>>;
3468
3468
  }, z.core.$strip>, z.ZodObject<{
3469
+ hostId: z.ZodOptional<z.ZodString>;
3469
3470
  path: z.ZodString;
3471
+ sourceProjectId: z.ZodOptional<z.ZodString>;
3470
3472
  type: z.ZodLiteral<"localImage">;
3471
3473
  visibility: z.ZodOptional<z.ZodEnum<{
3472
3474
  "agent-only": "agent-only";
3473
3475
  }>>;
3474
3476
  }, z.core.$strip>, z.ZodObject<{
3477
+ hostId: z.ZodOptional<z.ZodString>;
3475
3478
  mimeType: z.ZodOptional<z.ZodString>;
3476
3479
  name: z.ZodOptional<z.ZodString>;
3477
3480
  path: z.ZodString;
3478
3481
  sizeBytes: z.ZodOptional<z.ZodNumber>;
3482
+ sourceProjectId: z.ZodOptional<z.ZodString>;
3479
3483
  type: z.ZodLiteral<"localFile">;
3480
3484
  visibility: z.ZodOptional<z.ZodEnum<{
3481
3485
  "agent-only": "agent-only";
@@ -3548,16 +3552,20 @@ declare const threadEventSchema: z.ZodUnion<readonly [z.ZodIntersection<z.ZodDis
3548
3552
  "agent-only": "agent-only";
3549
3553
  }>>;
3550
3554
  }, z.core.$strip>, z.ZodObject<{
3555
+ hostId: z.ZodOptional<z.ZodString>;
3551
3556
  path: z.ZodString;
3557
+ sourceProjectId: z.ZodOptional<z.ZodString>;
3552
3558
  type: z.ZodLiteral<"localImage">;
3553
3559
  visibility: z.ZodOptional<z.ZodEnum<{
3554
3560
  "agent-only": "agent-only";
3555
3561
  }>>;
3556
3562
  }, z.core.$strip>, z.ZodObject<{
3563
+ hostId: z.ZodOptional<z.ZodString>;
3557
3564
  mimeType: z.ZodOptional<z.ZodString>;
3558
3565
  name: z.ZodOptional<z.ZodString>;
3559
3566
  path: z.ZodString;
3560
3567
  sizeBytes: z.ZodOptional<z.ZodNumber>;
3568
+ sourceProjectId: z.ZodOptional<z.ZodString>;
3561
3569
  type: z.ZodLiteral<"localFile">;
3562
3570
  visibility: z.ZodOptional<z.ZodEnum<{
3563
3571
  "agent-only": "agent-only";
@@ -4156,16 +4164,20 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
4156
4164
  "agent-only": "agent-only";
4157
4165
  }>>;
4158
4166
  }, z.core.$strip>, z.ZodObject<{
4167
+ hostId: z.ZodOptional<z.ZodString>;
4159
4168
  path: z.ZodString;
4169
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4160
4170
  type: z.ZodLiteral<"localImage">;
4161
4171
  visibility: z.ZodOptional<z.ZodEnum<{
4162
4172
  "agent-only": "agent-only";
4163
4173
  }>>;
4164
4174
  }, z.core.$strip>, z.ZodObject<{
4175
+ hostId: z.ZodOptional<z.ZodString>;
4165
4176
  mimeType: z.ZodOptional<z.ZodString>;
4166
4177
  name: z.ZodOptional<z.ZodString>;
4167
4178
  path: z.ZodString;
4168
4179
  sizeBytes: z.ZodOptional<z.ZodNumber>;
4180
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4169
4181
  type: z.ZodLiteral<"localFile">;
4170
4182
  visibility: z.ZodOptional<z.ZodEnum<{
4171
4183
  "agent-only": "agent-only";
@@ -1473,16 +1473,20 @@ declare const promptInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1473
1473
  "agent-only": "agent-only";
1474
1474
  }>>;
1475
1475
  }, z.core.$strip>, z.ZodObject<{
1476
+ hostId: z.ZodOptional<z.ZodString>;
1476
1477
  path: z.ZodString;
1478
+ sourceProjectId: z.ZodOptional<z.ZodString>;
1477
1479
  type: z.ZodLiteral<"localImage">;
1478
1480
  visibility: z.ZodOptional<z.ZodEnum<{
1479
1481
  "agent-only": "agent-only";
1480
1482
  }>>;
1481
1483
  }, z.core.$strip>, z.ZodObject<{
1484
+ hostId: z.ZodOptional<z.ZodString>;
1482
1485
  mimeType: z.ZodOptional<z.ZodString>;
1483
1486
  name: z.ZodOptional<z.ZodString>;
1484
1487
  path: z.ZodString;
1485
1488
  sizeBytes: z.ZodOptional<z.ZodNumber>;
1489
+ sourceProjectId: z.ZodOptional<z.ZodString>;
1486
1490
  type: z.ZodLiteral<"localFile">;
1487
1491
  visibility: z.ZodOptional<z.ZodEnum<{
1488
1492
  "agent-only": "agent-only";
@@ -4604,16 +4608,20 @@ declare const threadStartParamsSchema: z.ZodObject<{
4604
4608
  "agent-only": "agent-only";
4605
4609
  }>>;
4606
4610
  }, z.core.$strip>, z.ZodObject<{
4611
+ hostId: z.ZodOptional<z.ZodString>;
4607
4612
  path: z.ZodString;
4613
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4608
4614
  type: z.ZodLiteral<"localImage">;
4609
4615
  visibility: z.ZodOptional<z.ZodEnum<{
4610
4616
  "agent-only": "agent-only";
4611
4617
  }>>;
4612
4618
  }, z.core.$strip>, z.ZodObject<{
4619
+ hostId: z.ZodOptional<z.ZodString>;
4613
4620
  mimeType: z.ZodOptional<z.ZodString>;
4614
4621
  name: z.ZodOptional<z.ZodString>;
4615
4622
  path: z.ZodString;
4616
4623
  sizeBytes: z.ZodOptional<z.ZodNumber>;
4624
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4617
4625
  type: z.ZodLiteral<"localFile">;
4618
4626
  visibility: z.ZodOptional<z.ZodEnum<{
4619
4627
  "agent-only": "agent-only";
@@ -4922,16 +4930,20 @@ declare const turnStartParamsSchema: z.ZodObject<{
4922
4930
  "agent-only": "agent-only";
4923
4931
  }>>;
4924
4932
  }, z.core.$strip>, z.ZodObject<{
4933
+ hostId: z.ZodOptional<z.ZodString>;
4925
4934
  path: z.ZodString;
4935
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4926
4936
  type: z.ZodLiteral<"localImage">;
4927
4937
  visibility: z.ZodOptional<z.ZodEnum<{
4928
4938
  "agent-only": "agent-only";
4929
4939
  }>>;
4930
4940
  }, z.core.$strip>, z.ZodObject<{
4941
+ hostId: z.ZodOptional<z.ZodString>;
4931
4942
  mimeType: z.ZodOptional<z.ZodString>;
4932
4943
  name: z.ZodOptional<z.ZodString>;
4933
4944
  path: z.ZodString;
4934
4945
  sizeBytes: z.ZodOptional<z.ZodNumber>;
4946
+ sourceProjectId: z.ZodOptional<z.ZodString>;
4935
4947
  type: z.ZodLiteral<"localFile">;
4936
4948
  visibility: z.ZodOptional<z.ZodEnum<{
4937
4949
  "agent-only": "agent-only";
@@ -5049,16 +5061,20 @@ declare const turnSteerParamsSchema: z.ZodObject<{
5049
5061
  "agent-only": "agent-only";
5050
5062
  }>>;
5051
5063
  }, z.core.$strip>, z.ZodObject<{
5064
+ hostId: z.ZodOptional<z.ZodString>;
5052
5065
  path: z.ZodString;
5066
+ sourceProjectId: z.ZodOptional<z.ZodString>;
5053
5067
  type: z.ZodLiteral<"localImage">;
5054
5068
  visibility: z.ZodOptional<z.ZodEnum<{
5055
5069
  "agent-only": "agent-only";
5056
5070
  }>>;
5057
5071
  }, z.core.$strip>, z.ZodObject<{
5072
+ hostId: z.ZodOptional<z.ZodString>;
5058
5073
  mimeType: z.ZodOptional<z.ZodString>;
5059
5074
  name: z.ZodOptional<z.ZodString>;
5060
5075
  path: z.ZodString;
5061
5076
  sizeBytes: z.ZodOptional<z.ZodNumber>;
5077
+ sourceProjectId: z.ZodOptional<z.ZodString>;
5062
5078
  type: z.ZodLiteral<"localFile">;
5063
5079
  visibility: z.ZodOptional<z.ZodEnum<{
5064
5080
  "agent-only": "agent-only";