@phosphorco/bb-cross-references 0.1.1 → 0.3.0

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.
@@ -0,0 +1,1080 @@
1
+ /** Pure V2 evidence wire. V1 schemas and projection meanings are independent. */
2
+ import { z } from 'zod';
3
+ export declare const MENTION_V2_LIMITS: Readonly<{
4
+ responseBytes: 1048576;
5
+ inputBytes: 65536;
6
+ pageSize: 100;
7
+ cursorBytes: 4096;
8
+ excerptCodePoints: 320;
9
+ excerptBytes: 1280;
10
+ rowBytes: 131072;
11
+ readMs: 2000;
12
+ callMs: 5000;
13
+ lookupMs: 1500;
14
+ lookupCalls: 8;
15
+ }>;
16
+ export declare const MENTION_V2_METHODS: Readonly<{
17
+ readonly list: "crossReferencesV2ListMentions";
18
+ readonly resolve: "crossReferencesV2ResolveLookup";
19
+ }>;
20
+ /** UTF16 offsets may address only complete code points. No normalization or
21
+ * replacement: a genuine U+FFFD remains ordinary source text. */
22
+ export declare function isUtf16CodePointBoundary(text: string, offset: number): boolean;
23
+ export declare const identityInputV2Schema: z.ZodObject<{
24
+ provider: z.ZodString;
25
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
26
+ }, z.core.$strict>;
27
+ export declare const resourceOutputV2Schema: z.ZodObject<{
28
+ presentation: z.ZodObject<{
29
+ label: z.ZodString;
30
+ url: z.ZodOptional<z.ZodString>;
31
+ detail: z.ZodOptional<z.ZodString>;
32
+ }, z.core.$loose>;
33
+ provider: z.ZodString;
34
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
35
+ }, z.core.$loose>;
36
+ export declare const safeAuthoredHrefSchema: z.ZodString;
37
+ export declare const mentionQueryV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ kind: z.ZodLiteral<"resource">;
39
+ target: z.ZodObject<{
40
+ provider: z.ZodString;
41
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
42
+ }, z.core.$strict>;
43
+ relation: z.ZodEnum<{
44
+ self: "self";
45
+ "github-pr-family": "github-pr-family";
46
+ }>;
47
+ }, z.core.$strict>, z.ZodObject<{
48
+ kind: z.ZodLiteral<"authored-url">;
49
+ href: z.ZodString;
50
+ }, z.core.$strict>], "kind">;
51
+ export declare const listMentionsInputV2Schema: z.ZodObject<{
52
+ version: z.ZodLiteral<2>;
53
+ query: z.ZodDiscriminatedUnion<[z.ZodObject<{
54
+ kind: z.ZodLiteral<"resource">;
55
+ target: z.ZodObject<{
56
+ provider: z.ZodString;
57
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
58
+ }, z.core.$strict>;
59
+ relation: z.ZodEnum<{
60
+ self: "self";
61
+ "github-pr-family": "github-pr-family";
62
+ }>;
63
+ }, z.core.$strict>, z.ZodObject<{
64
+ kind: z.ZodLiteral<"authored-url">;
65
+ href: z.ZodString;
66
+ }, z.core.$strict>], "kind">;
67
+ source: z.ZodOptional<z.ZodObject<{
68
+ provider: z.ZodString;
69
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
70
+ }, z.core.$strict>>;
71
+ producerPluginId: z.ZodOptional<z.ZodString>;
72
+ pageSize: z.ZodOptional<z.ZodNumber>;
73
+ cursor: z.ZodOptional<z.ZodString>;
74
+ ifSnapshot: z.ZodOptional<z.ZodString>;
75
+ }, z.core.$strict>;
76
+ export declare const spanOutputV2Schema: z.ZodObject<{
77
+ start: z.ZodNumber;
78
+ end: z.ZodNumber;
79
+ }, z.core.$loose>;
80
+ export declare const excerptV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
81
+ state: z.ZodLiteral<"ready">;
82
+ text: z.ZodString;
83
+ sourceSpan: z.ZodObject<{
84
+ start: z.ZodNumber;
85
+ end: z.ZodNumber;
86
+ }, z.core.$loose>;
87
+ matchSpan: z.ZodObject<{
88
+ start: z.ZodNumber;
89
+ end: z.ZodNumber;
90
+ }, z.core.$loose>;
91
+ clippedBefore: z.ZodBoolean;
92
+ clippedAfter: z.ZodBoolean;
93
+ matchClippedBefore: z.ZodBoolean;
94
+ matchClippedAfter: z.ZodBoolean;
95
+ codecVersion: z.ZodLiteral<1>;
96
+ }, z.core.$loose>, z.ZodObject<{
97
+ state: z.ZodLiteral<"unavailable">;
98
+ reason: z.ZodEnum<{
99
+ "not-materialized": "not-materialized";
100
+ "indivisible-word": "indivisible-word";
101
+ "no-eligible-context": "no-eligible-context";
102
+ }>;
103
+ codecVersion: z.ZodLiteral<1>;
104
+ }, z.core.$loose>], "state">;
105
+ /** Strict internal record; the store validates binding to admitted source bytes. */
106
+ export declare const excerptRecordV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
107
+ sourceSpan: z.ZodObject<{
108
+ start: z.ZodNumber;
109
+ end: z.ZodNumber;
110
+ }, z.core.$strict>;
111
+ matchSpan: z.ZodObject<{
112
+ start: z.ZodNumber;
113
+ end: z.ZodNumber;
114
+ }, z.core.$strict>;
115
+ state: z.ZodLiteral<"ready">;
116
+ text: z.ZodString;
117
+ clippedBefore: z.ZodBoolean;
118
+ clippedAfter: z.ZodBoolean;
119
+ matchClippedBefore: z.ZodBoolean;
120
+ matchClippedAfter: z.ZodBoolean;
121
+ codecVersion: z.ZodLiteral<1>;
122
+ }, z.core.$strict>, z.ZodObject<{
123
+ state: z.ZodLiteral<"unavailable">;
124
+ reason: z.ZodEnum<{
125
+ "indivisible-word": "indivisible-word";
126
+ "no-eligible-context": "no-eligible-context";
127
+ }>;
128
+ codecVersion: z.ZodLiteral<1>;
129
+ }, z.core.$strict>], "state">;
130
+ export declare const locatorOutputV2Schema: z.ZodObject<{
131
+ kind: z.ZodLiteral<"conversation">;
132
+ threadId: z.ZodString;
133
+ messageId: z.ZodString;
134
+ messageSeq: z.ZodNumber;
135
+ anchorSeq: z.ZodNullable<z.ZodNumber>;
136
+ role: z.ZodEnum<{
137
+ user: "user";
138
+ assistant: "assistant";
139
+ }>;
140
+ }, z.core.$loose>;
141
+ /** Future item/locator/excerpt enums occupy a slot; malformed known items still reject. */
142
+ export declare const mentionItemV2Schema: z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
143
+ [x: string]: unknown;
144
+ kind: "occurrence";
145
+ evidenceRevision: number;
146
+ occurrenceKey: string;
147
+ locator: {
148
+ [x: string]: unknown;
149
+ kind: "conversation";
150
+ threadId: string;
151
+ messageId: string;
152
+ messageSeq: number;
153
+ anchorSeq: number | null;
154
+ role: "user" | "assistant";
155
+ };
156
+ sourceContentRevision: string;
157
+ span: {
158
+ [x: string]: unknown;
159
+ start: number;
160
+ end: number;
161
+ };
162
+ excerpt: {
163
+ [x: string]: unknown;
164
+ state: "ready";
165
+ text: string;
166
+ sourceSpan: {
167
+ [x: string]: unknown;
168
+ start: number;
169
+ end: number;
170
+ };
171
+ matchSpan: {
172
+ [x: string]: unknown;
173
+ start: number;
174
+ end: number;
175
+ };
176
+ clippedBefore: boolean;
177
+ clippedAfter: boolean;
178
+ matchClippedBefore: boolean;
179
+ matchClippedAfter: boolean;
180
+ codecVersion: 1;
181
+ } | {
182
+ [x: string]: unknown;
183
+ state: "unavailable";
184
+ reason: "not-materialized" | "indivisible-word" | "no-eligible-context";
185
+ codecVersion: 1;
186
+ };
187
+ messageCreatedAt: number;
188
+ observedAt: number;
189
+ confirmation: "observed" | "retained-unconfirmed";
190
+ provenance: {
191
+ [x: string]: unknown;
192
+ pluginId: string;
193
+ origin: "builtin" | "contributed";
194
+ confidence: "high" | "medium" | "low";
195
+ recognition: {
196
+ [x: string]: unknown;
197
+ basis: "explicit" | "text-url" | "existing-link" | "git-remote" | "context";
198
+ explanation: string;
199
+ evidence?: {
200
+ [x: string]: unknown;
201
+ span?: {
202
+ [x: string]: unknown;
203
+ start: number;
204
+ end: number;
205
+ } | undefined;
206
+ link?: number | undefined;
207
+ remote?: string | undefined;
208
+ } | undefined;
209
+ };
210
+ source: {
211
+ [x: string]: unknown;
212
+ provider: string;
213
+ id: string;
214
+ kind?: string | undefined;
215
+ };
216
+ authoredHref?: string | undefined;
217
+ verifiedFile?: {
218
+ [x: string]: unknown;
219
+ kind: "workspace";
220
+ environmentId: string;
221
+ path: string;
222
+ } | {
223
+ [x: string]: unknown;
224
+ kind: "thread-storage";
225
+ threadId: string;
226
+ path: string;
227
+ } | undefined;
228
+ };
229
+ authoredUrlState: "unknown" | "exact" | "not-url";
230
+ source: {
231
+ [x: string]: unknown;
232
+ presentation: {
233
+ [x: string]: unknown;
234
+ label: string;
235
+ url?: string | undefined;
236
+ detail?: string | undefined;
237
+ };
238
+ provider: string;
239
+ keys: Record<string, string>;
240
+ };
241
+ target: {
242
+ [x: string]: unknown;
243
+ presentation: {
244
+ [x: string]: unknown;
245
+ label: string;
246
+ url?: string | undefined;
247
+ detail?: string | undefined;
248
+ };
249
+ provider: string;
250
+ keys: Record<string, string>;
251
+ };
252
+ producerPluginId: string;
253
+ graphRevision: number;
254
+ cap: {
255
+ [x: string]: unknown;
256
+ state: "unknown" | "uncapped" | "capped";
257
+ limit: 100 | null;
258
+ sourceHistoryUnknown: boolean | null;
259
+ };
260
+ } | {
261
+ [x: string]: unknown;
262
+ kind: "claim-without-evidence";
263
+ reason: "legacy" | "producer-no-evidence" | "not-yet-collected";
264
+ matchBasis: "primary-resource" | "primary-url-identity";
265
+ source: {
266
+ [x: string]: unknown;
267
+ presentation: {
268
+ [x: string]: unknown;
269
+ label: string;
270
+ url?: string | undefined;
271
+ detail?: string | undefined;
272
+ };
273
+ provider: string;
274
+ keys: Record<string, string>;
275
+ };
276
+ target: {
277
+ [x: string]: unknown;
278
+ presentation: {
279
+ [x: string]: unknown;
280
+ label: string;
281
+ url?: string | undefined;
282
+ detail?: string | undefined;
283
+ };
284
+ provider: string;
285
+ keys: Record<string, string>;
286
+ };
287
+ producerPluginId: string;
288
+ graphRevision: number;
289
+ cap: {
290
+ [x: string]: unknown;
291
+ state: "unknown" | "uncapped" | "capped";
292
+ limit: 100 | null;
293
+ sourceHistoryUnknown: boolean | null;
294
+ };
295
+ } | {
296
+ [x: string]: unknown;
297
+ kind: "unsupported";
298
+ reason: "unsupported-format";
299
+ source: {
300
+ [x: string]: unknown;
301
+ presentation: {
302
+ [x: string]: unknown;
303
+ label: string;
304
+ url?: string | undefined;
305
+ detail?: string | undefined;
306
+ };
307
+ provider: string;
308
+ keys: Record<string, string>;
309
+ };
310
+ target: {
311
+ [x: string]: unknown;
312
+ presentation: {
313
+ [x: string]: unknown;
314
+ label: string;
315
+ url?: string | undefined;
316
+ detail?: string | undefined;
317
+ };
318
+ provider: string;
319
+ keys: Record<string, string>;
320
+ };
321
+ producerPluginId: string;
322
+ graphRevision: number;
323
+ cap: {
324
+ [x: string]: unknown;
325
+ state: "unknown" | "uncapped" | "capped";
326
+ limit: 100 | null;
327
+ sourceHistoryUnknown: boolean | null;
328
+ };
329
+ }, unknown>>;
330
+ export declare const mentionCountsV2Schema: z.ZodObject<{
331
+ retainedOccurrences: z.ZodNumber;
332
+ confirmedOccurrences: z.ZodNumber;
333
+ unconfirmedOccurrences: z.ZodNumber;
334
+ producerClaims: z.ZodNumber;
335
+ indexedSources: z.ZodNumber;
336
+ claimsWithoutLocations: z.ZodNumber;
337
+ excerptUnavailable: z.ZodNumber;
338
+ }, z.core.$loose>;
339
+ export declare const coverageV2Schema: z.ZodObject<{
340
+ scope: z.ZodLiteral<"known-sources">;
341
+ collectionIncomplete: z.ZodBoolean;
342
+ retentionLimited: z.ZodBoolean;
343
+ capHistoryUnknown: z.ZodBoolean;
344
+ legacyClaimsPresent: z.ZodBoolean;
345
+ evidenceStateUnknown: z.ZodBoolean;
346
+ authoredUrlCoverage: z.ZodObject<{
347
+ state: z.ZodEnum<{
348
+ "complete-for-known-locations": "complete-for-known-locations";
349
+ partial: "partial";
350
+ }>;
351
+ unknownLocations: z.ZodNumber;
352
+ scope: z.ZodLiteral<"known-locations">;
353
+ watermark: z.ZodString;
354
+ }, z.core.$loose>;
355
+ reasons: z.ZodArray<z.ZodString>;
356
+ reasonsClipped: z.ZodBoolean;
357
+ checkedAt: z.ZodNullable<z.ZodNumber>;
358
+ }, z.core.$loose>;
359
+ export declare const listMentionsOutputV2Schema: z.ZodDiscriminatedUnion<[z.ZodObject<{
360
+ version: z.ZodLiteral<2>;
361
+ status: z.ZodLiteral<"page">;
362
+ snapshot: z.ZodString;
363
+ items: z.ZodArray<z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
364
+ [x: string]: unknown;
365
+ kind: "occurrence";
366
+ evidenceRevision: number;
367
+ occurrenceKey: string;
368
+ locator: {
369
+ [x: string]: unknown;
370
+ kind: "conversation";
371
+ threadId: string;
372
+ messageId: string;
373
+ messageSeq: number;
374
+ anchorSeq: number | null;
375
+ role: "user" | "assistant";
376
+ };
377
+ sourceContentRevision: string;
378
+ span: {
379
+ [x: string]: unknown;
380
+ start: number;
381
+ end: number;
382
+ };
383
+ excerpt: {
384
+ [x: string]: unknown;
385
+ state: "ready";
386
+ text: string;
387
+ sourceSpan: {
388
+ [x: string]: unknown;
389
+ start: number;
390
+ end: number;
391
+ };
392
+ matchSpan: {
393
+ [x: string]: unknown;
394
+ start: number;
395
+ end: number;
396
+ };
397
+ clippedBefore: boolean;
398
+ clippedAfter: boolean;
399
+ matchClippedBefore: boolean;
400
+ matchClippedAfter: boolean;
401
+ codecVersion: 1;
402
+ } | {
403
+ [x: string]: unknown;
404
+ state: "unavailable";
405
+ reason: "not-materialized" | "indivisible-word" | "no-eligible-context";
406
+ codecVersion: 1;
407
+ };
408
+ messageCreatedAt: number;
409
+ observedAt: number;
410
+ confirmation: "observed" | "retained-unconfirmed";
411
+ provenance: {
412
+ [x: string]: unknown;
413
+ pluginId: string;
414
+ origin: "builtin" | "contributed";
415
+ confidence: "high" | "medium" | "low";
416
+ recognition: {
417
+ [x: string]: unknown;
418
+ basis: "explicit" | "text-url" | "existing-link" | "git-remote" | "context";
419
+ explanation: string;
420
+ evidence?: {
421
+ [x: string]: unknown;
422
+ span?: {
423
+ [x: string]: unknown;
424
+ start: number;
425
+ end: number;
426
+ } | undefined;
427
+ link?: number | undefined;
428
+ remote?: string | undefined;
429
+ } | undefined;
430
+ };
431
+ source: {
432
+ [x: string]: unknown;
433
+ provider: string;
434
+ id: string;
435
+ kind?: string | undefined;
436
+ };
437
+ authoredHref?: string | undefined;
438
+ verifiedFile?: {
439
+ [x: string]: unknown;
440
+ kind: "workspace";
441
+ environmentId: string;
442
+ path: string;
443
+ } | {
444
+ [x: string]: unknown;
445
+ kind: "thread-storage";
446
+ threadId: string;
447
+ path: string;
448
+ } | undefined;
449
+ };
450
+ authoredUrlState: "unknown" | "exact" | "not-url";
451
+ source: {
452
+ [x: string]: unknown;
453
+ presentation: {
454
+ [x: string]: unknown;
455
+ label: string;
456
+ url?: string | undefined;
457
+ detail?: string | undefined;
458
+ };
459
+ provider: string;
460
+ keys: Record<string, string>;
461
+ };
462
+ target: {
463
+ [x: string]: unknown;
464
+ presentation: {
465
+ [x: string]: unknown;
466
+ label: string;
467
+ url?: string | undefined;
468
+ detail?: string | undefined;
469
+ };
470
+ provider: string;
471
+ keys: Record<string, string>;
472
+ };
473
+ producerPluginId: string;
474
+ graphRevision: number;
475
+ cap: {
476
+ [x: string]: unknown;
477
+ state: "unknown" | "uncapped" | "capped";
478
+ limit: 100 | null;
479
+ sourceHistoryUnknown: boolean | null;
480
+ };
481
+ } | {
482
+ [x: string]: unknown;
483
+ kind: "claim-without-evidence";
484
+ reason: "legacy" | "producer-no-evidence" | "not-yet-collected";
485
+ matchBasis: "primary-resource" | "primary-url-identity";
486
+ source: {
487
+ [x: string]: unknown;
488
+ presentation: {
489
+ [x: string]: unknown;
490
+ label: string;
491
+ url?: string | undefined;
492
+ detail?: string | undefined;
493
+ };
494
+ provider: string;
495
+ keys: Record<string, string>;
496
+ };
497
+ target: {
498
+ [x: string]: unknown;
499
+ presentation: {
500
+ [x: string]: unknown;
501
+ label: string;
502
+ url?: string | undefined;
503
+ detail?: string | undefined;
504
+ };
505
+ provider: string;
506
+ keys: Record<string, string>;
507
+ };
508
+ producerPluginId: string;
509
+ graphRevision: number;
510
+ cap: {
511
+ [x: string]: unknown;
512
+ state: "unknown" | "uncapped" | "capped";
513
+ limit: 100 | null;
514
+ sourceHistoryUnknown: boolean | null;
515
+ };
516
+ } | {
517
+ [x: string]: unknown;
518
+ kind: "unsupported";
519
+ reason: "unsupported-format";
520
+ source: {
521
+ [x: string]: unknown;
522
+ presentation: {
523
+ [x: string]: unknown;
524
+ label: string;
525
+ url?: string | undefined;
526
+ detail?: string | undefined;
527
+ };
528
+ provider: string;
529
+ keys: Record<string, string>;
530
+ };
531
+ target: {
532
+ [x: string]: unknown;
533
+ presentation: {
534
+ [x: string]: unknown;
535
+ label: string;
536
+ url?: string | undefined;
537
+ detail?: string | undefined;
538
+ };
539
+ provider: string;
540
+ keys: Record<string, string>;
541
+ };
542
+ producerPluginId: string;
543
+ graphRevision: number;
544
+ cap: {
545
+ [x: string]: unknown;
546
+ state: "unknown" | "uncapped" | "capped";
547
+ limit: 100 | null;
548
+ sourceHistoryUnknown: boolean | null;
549
+ };
550
+ }, unknown>>>;
551
+ counts: z.ZodObject<{
552
+ retainedOccurrences: z.ZodNumber;
553
+ confirmedOccurrences: z.ZodNumber;
554
+ unconfirmedOccurrences: z.ZodNumber;
555
+ producerClaims: z.ZodNumber;
556
+ indexedSources: z.ZodNumber;
557
+ claimsWithoutLocations: z.ZodNumber;
558
+ excerptUnavailable: z.ZodNumber;
559
+ }, z.core.$loose>;
560
+ coverage: z.ZodObject<{
561
+ scope: z.ZodLiteral<"known-sources">;
562
+ collectionIncomplete: z.ZodBoolean;
563
+ retentionLimited: z.ZodBoolean;
564
+ capHistoryUnknown: z.ZodBoolean;
565
+ legacyClaimsPresent: z.ZodBoolean;
566
+ evidenceStateUnknown: z.ZodBoolean;
567
+ authoredUrlCoverage: z.ZodObject<{
568
+ state: z.ZodEnum<{
569
+ "complete-for-known-locations": "complete-for-known-locations";
570
+ partial: "partial";
571
+ }>;
572
+ unknownLocations: z.ZodNumber;
573
+ scope: z.ZodLiteral<"known-locations">;
574
+ watermark: z.ZodString;
575
+ }, z.core.$loose>;
576
+ reasons: z.ZodArray<z.ZodString>;
577
+ reasonsClipped: z.ZodBoolean;
578
+ checkedAt: z.ZodNullable<z.ZodNumber>;
579
+ }, z.core.$loose>;
580
+ nextCursor: z.ZodNullable<z.ZodString>;
581
+ }, z.core.$loose>, z.ZodObject<{
582
+ version: z.ZodLiteral<2>;
583
+ status: z.ZodLiteral<"not-modified">;
584
+ snapshot: z.ZodString;
585
+ coverage: z.ZodObject<{
586
+ scope: z.ZodLiteral<"known-sources">;
587
+ collectionIncomplete: z.ZodBoolean;
588
+ retentionLimited: z.ZodBoolean;
589
+ capHistoryUnknown: z.ZodBoolean;
590
+ legacyClaimsPresent: z.ZodBoolean;
591
+ evidenceStateUnknown: z.ZodBoolean;
592
+ authoredUrlCoverage: z.ZodObject<{
593
+ state: z.ZodEnum<{
594
+ "complete-for-known-locations": "complete-for-known-locations";
595
+ partial: "partial";
596
+ }>;
597
+ unknownLocations: z.ZodNumber;
598
+ scope: z.ZodLiteral<"known-locations">;
599
+ watermark: z.ZodString;
600
+ }, z.core.$loose>;
601
+ reasons: z.ZodArray<z.ZodString>;
602
+ reasonsClipped: z.ZodBoolean;
603
+ checkedAt: z.ZodNullable<z.ZodNumber>;
604
+ }, z.core.$loose>;
605
+ }, z.core.$loose>, z.ZodObject<{
606
+ version: z.ZodLiteral<2>;
607
+ status: z.ZodLiteral<"restart">;
608
+ reason: z.ZodLiteral<"snapshot-changed">;
609
+ snapshot: z.ZodString;
610
+ }, z.core.$loose>, z.ZodObject<{
611
+ version: z.ZodLiteral<2>;
612
+ status: z.ZodLiteral<"unavailable">;
613
+ reason: z.ZodEnum<{
614
+ "index-warming": "index-warming";
615
+ "read-budget": "read-budget";
616
+ }>;
617
+ retryable: z.ZodBoolean;
618
+ }, z.core.$loose>], "status">;
619
+ export declare const lookupContextV2Schema: z.ZodObject<{
620
+ projectId: z.ZodOptional<z.ZodString>;
621
+ threadId: z.ZodOptional<z.ZodString>;
622
+ environmentId: z.ZodOptional<z.ZodString>;
623
+ git: z.ZodOptional<z.ZodObject<{
624
+ branch: z.ZodOptional<z.ZodString>;
625
+ upstream: z.ZodOptional<z.ZodObject<{
626
+ remote: z.ZodString;
627
+ branch: z.ZodString;
628
+ }, z.core.$strict>>;
629
+ remotes: z.ZodArray<z.ZodObject<{
630
+ name: z.ZodString;
631
+ url: z.ZodString;
632
+ }, z.core.$strict>>;
633
+ }, z.core.$strict>>;
634
+ locale: z.ZodOptional<z.ZodString>;
635
+ timeZone: z.ZodOptional<z.ZodString>;
636
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
637
+ href: z.ZodString;
638
+ }, z.core.$strict>>>;
639
+ }, z.core.$strict>;
640
+ export declare const resolveLookupInputV2Schema: z.ZodObject<{
641
+ version: z.ZodLiteral<2>;
642
+ text: z.ZodString;
643
+ mode: z.ZodEnum<{
644
+ recognize: "recognize";
645
+ "exact-url": "exact-url";
646
+ }>;
647
+ context: z.ZodOptional<z.ZodObject<{
648
+ projectId: z.ZodOptional<z.ZodString>;
649
+ threadId: z.ZodOptional<z.ZodString>;
650
+ environmentId: z.ZodOptional<z.ZodString>;
651
+ git: z.ZodOptional<z.ZodObject<{
652
+ branch: z.ZodOptional<z.ZodString>;
653
+ upstream: z.ZodOptional<z.ZodObject<{
654
+ remote: z.ZodString;
655
+ branch: z.ZodString;
656
+ }, z.core.$strict>>;
657
+ remotes: z.ZodArray<z.ZodObject<{
658
+ name: z.ZodString;
659
+ url: z.ZodString;
660
+ }, z.core.$strict>>;
661
+ }, z.core.$strict>>;
662
+ locale: z.ZodOptional<z.ZodString>;
663
+ timeZone: z.ZodOptional<z.ZodString>;
664
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
665
+ href: z.ZodString;
666
+ }, z.core.$strict>>>;
667
+ }, z.core.$strict>>;
668
+ }, z.core.$strict>;
669
+ export declare const resolveLookupOutputV2Schema: z.ZodObject<{
670
+ version: z.ZodLiteral<2>;
671
+ state: z.ZodEnum<{
672
+ ready: "ready";
673
+ ambiguous: "ambiguous";
674
+ unrecognized: "unrecognized";
675
+ incomplete: "incomplete";
676
+ }>;
677
+ options: z.ZodArray<z.ZodObject<{
678
+ query: z.ZodDiscriminatedUnion<[z.ZodObject<{
679
+ kind: z.ZodLiteral<"resource">;
680
+ target: z.ZodObject<{
681
+ provider: z.ZodString;
682
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
683
+ }, z.core.$loose>;
684
+ relation: z.ZodEnum<{
685
+ self: "self";
686
+ "github-pr-family": "github-pr-family";
687
+ }>;
688
+ }, z.core.$loose>, z.ZodObject<{
689
+ kind: z.ZodLiteral<"authored-url">;
690
+ href: z.ZodString;
691
+ }, z.core.$loose>], "kind">;
692
+ label: z.ZodString;
693
+ inputSpan: z.ZodObject<{
694
+ start: z.ZodNumber;
695
+ end: z.ZodNumber;
696
+ }, z.core.$loose>;
697
+ basis: z.ZodEnum<{
698
+ supplier: "supplier";
699
+ native: "native";
700
+ "stored-codec": "stored-codec";
701
+ }>;
702
+ reasons: z.ZodArray<z.ZodString>;
703
+ }, z.core.$loose>>;
704
+ reasons: z.ZodArray<z.ZodString>;
705
+ }, z.core.$loose>;
706
+ export declare const crossReferencesV2RpcSchemas: {
707
+ readonly crossReferencesV2ListMentions: {
708
+ readonly input: z.ZodObject<{
709
+ version: z.ZodLiteral<2>;
710
+ query: z.ZodDiscriminatedUnion<[z.ZodObject<{
711
+ kind: z.ZodLiteral<"resource">;
712
+ target: z.ZodObject<{
713
+ provider: z.ZodString;
714
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
715
+ }, z.core.$strict>;
716
+ relation: z.ZodEnum<{
717
+ self: "self";
718
+ "github-pr-family": "github-pr-family";
719
+ }>;
720
+ }, z.core.$strict>, z.ZodObject<{
721
+ kind: z.ZodLiteral<"authored-url">;
722
+ href: z.ZodString;
723
+ }, z.core.$strict>], "kind">;
724
+ source: z.ZodOptional<z.ZodObject<{
725
+ provider: z.ZodString;
726
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
727
+ }, z.core.$strict>>;
728
+ producerPluginId: z.ZodOptional<z.ZodString>;
729
+ pageSize: z.ZodOptional<z.ZodNumber>;
730
+ cursor: z.ZodOptional<z.ZodString>;
731
+ ifSnapshot: z.ZodOptional<z.ZodString>;
732
+ }, z.core.$strict>;
733
+ readonly output: z.ZodDiscriminatedUnion<[z.ZodObject<{
734
+ version: z.ZodLiteral<2>;
735
+ status: z.ZodLiteral<"page">;
736
+ snapshot: z.ZodString;
737
+ items: z.ZodArray<z.ZodPipe<z.ZodUnknown, z.ZodTransform<{
738
+ [x: string]: unknown;
739
+ kind: "occurrence";
740
+ evidenceRevision: number;
741
+ occurrenceKey: string;
742
+ locator: {
743
+ [x: string]: unknown;
744
+ kind: "conversation";
745
+ threadId: string;
746
+ messageId: string;
747
+ messageSeq: number;
748
+ anchorSeq: number | null;
749
+ role: "user" | "assistant";
750
+ };
751
+ sourceContentRevision: string;
752
+ span: {
753
+ [x: string]: unknown;
754
+ start: number;
755
+ end: number;
756
+ };
757
+ excerpt: {
758
+ [x: string]: unknown;
759
+ state: "ready";
760
+ text: string;
761
+ sourceSpan: {
762
+ [x: string]: unknown;
763
+ start: number;
764
+ end: number;
765
+ };
766
+ matchSpan: {
767
+ [x: string]: unknown;
768
+ start: number;
769
+ end: number;
770
+ };
771
+ clippedBefore: boolean;
772
+ clippedAfter: boolean;
773
+ matchClippedBefore: boolean;
774
+ matchClippedAfter: boolean;
775
+ codecVersion: 1;
776
+ } | {
777
+ [x: string]: unknown;
778
+ state: "unavailable";
779
+ reason: "not-materialized" | "indivisible-word" | "no-eligible-context";
780
+ codecVersion: 1;
781
+ };
782
+ messageCreatedAt: number;
783
+ observedAt: number;
784
+ confirmation: "observed" | "retained-unconfirmed";
785
+ provenance: {
786
+ [x: string]: unknown;
787
+ pluginId: string;
788
+ origin: "builtin" | "contributed";
789
+ confidence: "high" | "medium" | "low";
790
+ recognition: {
791
+ [x: string]: unknown;
792
+ basis: "explicit" | "text-url" | "existing-link" | "git-remote" | "context";
793
+ explanation: string;
794
+ evidence?: {
795
+ [x: string]: unknown;
796
+ span?: {
797
+ [x: string]: unknown;
798
+ start: number;
799
+ end: number;
800
+ } | undefined;
801
+ link?: number | undefined;
802
+ remote?: string | undefined;
803
+ } | undefined;
804
+ };
805
+ source: {
806
+ [x: string]: unknown;
807
+ provider: string;
808
+ id: string;
809
+ kind?: string | undefined;
810
+ };
811
+ authoredHref?: string | undefined;
812
+ verifiedFile?: {
813
+ [x: string]: unknown;
814
+ kind: "workspace";
815
+ environmentId: string;
816
+ path: string;
817
+ } | {
818
+ [x: string]: unknown;
819
+ kind: "thread-storage";
820
+ threadId: string;
821
+ path: string;
822
+ } | undefined;
823
+ };
824
+ authoredUrlState: "unknown" | "exact" | "not-url";
825
+ source: {
826
+ [x: string]: unknown;
827
+ presentation: {
828
+ [x: string]: unknown;
829
+ label: string;
830
+ url?: string | undefined;
831
+ detail?: string | undefined;
832
+ };
833
+ provider: string;
834
+ keys: Record<string, string>;
835
+ };
836
+ target: {
837
+ [x: string]: unknown;
838
+ presentation: {
839
+ [x: string]: unknown;
840
+ label: string;
841
+ url?: string | undefined;
842
+ detail?: string | undefined;
843
+ };
844
+ provider: string;
845
+ keys: Record<string, string>;
846
+ };
847
+ producerPluginId: string;
848
+ graphRevision: number;
849
+ cap: {
850
+ [x: string]: unknown;
851
+ state: "unknown" | "uncapped" | "capped";
852
+ limit: 100 | null;
853
+ sourceHistoryUnknown: boolean | null;
854
+ };
855
+ } | {
856
+ [x: string]: unknown;
857
+ kind: "claim-without-evidence";
858
+ reason: "legacy" | "producer-no-evidence" | "not-yet-collected";
859
+ matchBasis: "primary-resource" | "primary-url-identity";
860
+ source: {
861
+ [x: string]: unknown;
862
+ presentation: {
863
+ [x: string]: unknown;
864
+ label: string;
865
+ url?: string | undefined;
866
+ detail?: string | undefined;
867
+ };
868
+ provider: string;
869
+ keys: Record<string, string>;
870
+ };
871
+ target: {
872
+ [x: string]: unknown;
873
+ presentation: {
874
+ [x: string]: unknown;
875
+ label: string;
876
+ url?: string | undefined;
877
+ detail?: string | undefined;
878
+ };
879
+ provider: string;
880
+ keys: Record<string, string>;
881
+ };
882
+ producerPluginId: string;
883
+ graphRevision: number;
884
+ cap: {
885
+ [x: string]: unknown;
886
+ state: "unknown" | "uncapped" | "capped";
887
+ limit: 100 | null;
888
+ sourceHistoryUnknown: boolean | null;
889
+ };
890
+ } | {
891
+ [x: string]: unknown;
892
+ kind: "unsupported";
893
+ reason: "unsupported-format";
894
+ source: {
895
+ [x: string]: unknown;
896
+ presentation: {
897
+ [x: string]: unknown;
898
+ label: string;
899
+ url?: string | undefined;
900
+ detail?: string | undefined;
901
+ };
902
+ provider: string;
903
+ keys: Record<string, string>;
904
+ };
905
+ target: {
906
+ [x: string]: unknown;
907
+ presentation: {
908
+ [x: string]: unknown;
909
+ label: string;
910
+ url?: string | undefined;
911
+ detail?: string | undefined;
912
+ };
913
+ provider: string;
914
+ keys: Record<string, string>;
915
+ };
916
+ producerPluginId: string;
917
+ graphRevision: number;
918
+ cap: {
919
+ [x: string]: unknown;
920
+ state: "unknown" | "uncapped" | "capped";
921
+ limit: 100 | null;
922
+ sourceHistoryUnknown: boolean | null;
923
+ };
924
+ }, unknown>>>;
925
+ counts: z.ZodObject<{
926
+ retainedOccurrences: z.ZodNumber;
927
+ confirmedOccurrences: z.ZodNumber;
928
+ unconfirmedOccurrences: z.ZodNumber;
929
+ producerClaims: z.ZodNumber;
930
+ indexedSources: z.ZodNumber;
931
+ claimsWithoutLocations: z.ZodNumber;
932
+ excerptUnavailable: z.ZodNumber;
933
+ }, z.core.$loose>;
934
+ coverage: z.ZodObject<{
935
+ scope: z.ZodLiteral<"known-sources">;
936
+ collectionIncomplete: z.ZodBoolean;
937
+ retentionLimited: z.ZodBoolean;
938
+ capHistoryUnknown: z.ZodBoolean;
939
+ legacyClaimsPresent: z.ZodBoolean;
940
+ evidenceStateUnknown: z.ZodBoolean;
941
+ authoredUrlCoverage: z.ZodObject<{
942
+ state: z.ZodEnum<{
943
+ "complete-for-known-locations": "complete-for-known-locations";
944
+ partial: "partial";
945
+ }>;
946
+ unknownLocations: z.ZodNumber;
947
+ scope: z.ZodLiteral<"known-locations">;
948
+ watermark: z.ZodString;
949
+ }, z.core.$loose>;
950
+ reasons: z.ZodArray<z.ZodString>;
951
+ reasonsClipped: z.ZodBoolean;
952
+ checkedAt: z.ZodNullable<z.ZodNumber>;
953
+ }, z.core.$loose>;
954
+ nextCursor: z.ZodNullable<z.ZodString>;
955
+ }, z.core.$loose>, z.ZodObject<{
956
+ version: z.ZodLiteral<2>;
957
+ status: z.ZodLiteral<"not-modified">;
958
+ snapshot: z.ZodString;
959
+ coverage: z.ZodObject<{
960
+ scope: z.ZodLiteral<"known-sources">;
961
+ collectionIncomplete: z.ZodBoolean;
962
+ retentionLimited: z.ZodBoolean;
963
+ capHistoryUnknown: z.ZodBoolean;
964
+ legacyClaimsPresent: z.ZodBoolean;
965
+ evidenceStateUnknown: z.ZodBoolean;
966
+ authoredUrlCoverage: z.ZodObject<{
967
+ state: z.ZodEnum<{
968
+ "complete-for-known-locations": "complete-for-known-locations";
969
+ partial: "partial";
970
+ }>;
971
+ unknownLocations: z.ZodNumber;
972
+ scope: z.ZodLiteral<"known-locations">;
973
+ watermark: z.ZodString;
974
+ }, z.core.$loose>;
975
+ reasons: z.ZodArray<z.ZodString>;
976
+ reasonsClipped: z.ZodBoolean;
977
+ checkedAt: z.ZodNullable<z.ZodNumber>;
978
+ }, z.core.$loose>;
979
+ }, z.core.$loose>, z.ZodObject<{
980
+ version: z.ZodLiteral<2>;
981
+ status: z.ZodLiteral<"restart">;
982
+ reason: z.ZodLiteral<"snapshot-changed">;
983
+ snapshot: z.ZodString;
984
+ }, z.core.$loose>, z.ZodObject<{
985
+ version: z.ZodLiteral<2>;
986
+ status: z.ZodLiteral<"unavailable">;
987
+ reason: z.ZodEnum<{
988
+ "index-warming": "index-warming";
989
+ "read-budget": "read-budget";
990
+ }>;
991
+ retryable: z.ZodBoolean;
992
+ }, z.core.$loose>], "status">;
993
+ };
994
+ readonly crossReferencesV2ResolveLookup: {
995
+ readonly input: z.ZodObject<{
996
+ version: z.ZodLiteral<2>;
997
+ text: z.ZodString;
998
+ mode: z.ZodEnum<{
999
+ recognize: "recognize";
1000
+ "exact-url": "exact-url";
1001
+ }>;
1002
+ context: z.ZodOptional<z.ZodObject<{
1003
+ projectId: z.ZodOptional<z.ZodString>;
1004
+ threadId: z.ZodOptional<z.ZodString>;
1005
+ environmentId: z.ZodOptional<z.ZodString>;
1006
+ git: z.ZodOptional<z.ZodObject<{
1007
+ branch: z.ZodOptional<z.ZodString>;
1008
+ upstream: z.ZodOptional<z.ZodObject<{
1009
+ remote: z.ZodString;
1010
+ branch: z.ZodString;
1011
+ }, z.core.$strict>>;
1012
+ remotes: z.ZodArray<z.ZodObject<{
1013
+ name: z.ZodString;
1014
+ url: z.ZodString;
1015
+ }, z.core.$strict>>;
1016
+ }, z.core.$strict>>;
1017
+ locale: z.ZodOptional<z.ZodString>;
1018
+ timeZone: z.ZodOptional<z.ZodString>;
1019
+ links: z.ZodOptional<z.ZodArray<z.ZodObject<{
1020
+ href: z.ZodString;
1021
+ }, z.core.$strict>>>;
1022
+ }, z.core.$strict>>;
1023
+ }, z.core.$strict>;
1024
+ readonly output: z.ZodObject<{
1025
+ version: z.ZodLiteral<2>;
1026
+ state: z.ZodEnum<{
1027
+ ready: "ready";
1028
+ ambiguous: "ambiguous";
1029
+ unrecognized: "unrecognized";
1030
+ incomplete: "incomplete";
1031
+ }>;
1032
+ options: z.ZodArray<z.ZodObject<{
1033
+ query: z.ZodDiscriminatedUnion<[z.ZodObject<{
1034
+ kind: z.ZodLiteral<"resource">;
1035
+ target: z.ZodObject<{
1036
+ provider: z.ZodString;
1037
+ keys: z.ZodRecord<z.ZodString, z.ZodString>;
1038
+ }, z.core.$loose>;
1039
+ relation: z.ZodEnum<{
1040
+ self: "self";
1041
+ "github-pr-family": "github-pr-family";
1042
+ }>;
1043
+ }, z.core.$loose>, z.ZodObject<{
1044
+ kind: z.ZodLiteral<"authored-url">;
1045
+ href: z.ZodString;
1046
+ }, z.core.$loose>], "kind">;
1047
+ label: z.ZodString;
1048
+ inputSpan: z.ZodObject<{
1049
+ start: z.ZodNumber;
1050
+ end: z.ZodNumber;
1051
+ }, z.core.$loose>;
1052
+ basis: z.ZodEnum<{
1053
+ supplier: "supplier";
1054
+ native: "native";
1055
+ "stored-codec": "stored-codec";
1056
+ }>;
1057
+ reasons: z.ZodArray<z.ZodString>;
1058
+ }, z.core.$loose>>;
1059
+ reasons: z.ZodArray<z.ZodString>;
1060
+ }, z.core.$loose>;
1061
+ };
1062
+ };
1063
+ export declare const mentionsChangedV2Schema: z.ZodObject<{
1064
+ version: z.ZodLiteral<2>;
1065
+ producerPluginId: z.ZodString;
1066
+ sourceIdentityDigest: z.ZodString;
1067
+ graphRevision: z.ZodNumber;
1068
+ evidenceRevision: z.ZodNullable<z.ZodNumber>;
1069
+ affectedIdentityDigests: z.ZodArray<z.ZodString>;
1070
+ scopeListClipped: z.ZodBoolean;
1071
+ }, z.core.$loose>;
1072
+ export declare const MENTIONS_V2_CHANNEL = "cross-references-mentions-v2-changed";
1073
+ export type MentionQueryV2 = z.infer<typeof mentionQueryV2Schema>;
1074
+ export type ListMentionsInputV2 = z.infer<typeof listMentionsInputV2Schema>;
1075
+ export type ListMentionsOutputV2 = z.infer<typeof listMentionsOutputV2Schema>;
1076
+ export type ResolveLookupInputV2 = z.infer<typeof resolveLookupInputV2Schema>;
1077
+ export type ResolveLookupOutputV2 = z.infer<typeof resolveLookupOutputV2Schema>;
1078
+ export type ExcerptRecordV2 = z.infer<typeof excerptRecordV2Schema>;
1079
+ export type ExcerptV2 = z.infer<typeof excerptV2Schema>;
1080
+ export type MentionsChangedV2 = z.infer<typeof mentionsChangedV2Schema>;