@xyne/workflow-sdk 3.2.20 → 3.2.21

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.
Files changed (49) hide show
  1. package/dist/agents/citation-resolve.d.ts +23 -12
  2. package/dist/agents/citation-resolve.d.ts.map +1 -1
  3. package/dist/agents/citation-resolve.js +125 -24
  4. package/dist/agents/citation-resolve.js.map +1 -1
  5. package/dist/builder/index.d.ts +2 -2
  6. package/dist/builder/index.d.ts.map +1 -1
  7. package/dist/builder/index.js +1 -1
  8. package/dist/builder/index.js.map +1 -1
  9. package/dist/common/citation-ref.d.ts +525 -11
  10. package/dist/common/citation-ref.d.ts.map +1 -1
  11. package/dist/common/citation-ref.js +105 -14
  12. package/dist/common/citation-ref.js.map +1 -1
  13. package/dist/common/expression-eval.d.ts +35 -0
  14. package/dist/common/expression-eval.d.ts.map +1 -0
  15. package/dist/common/expression-eval.js +214 -0
  16. package/dist/common/expression-eval.js.map +1 -0
  17. package/dist/common/index.d.ts +2 -2
  18. package/dist/common/index.d.ts.map +1 -1
  19. package/dist/common/index.js +1 -1
  20. package/dist/common/index.js.map +1 -1
  21. package/dist/common/principal.d.ts +45 -0
  22. package/dist/common/principal.d.ts.map +1 -0
  23. package/dist/common/principal.js +9 -0
  24. package/dist/common/principal.js.map +1 -0
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +1 -1
  28. package/dist/index.js.map +1 -1
  29. package/dist/steps/builtin/transform.step.d.ts +247 -0
  30. package/dist/steps/builtin/transform.step.d.ts.map +1 -0
  31. package/dist/steps/builtin/transform.step.js +135 -0
  32. package/dist/steps/builtin/transform.step.js.map +1 -0
  33. package/dist/types/attachment.d.ts +23 -0
  34. package/dist/types/attachment.d.ts.map +1 -0
  35. package/dist/types/attachment.js +2 -0
  36. package/dist/types/attachment.js.map +1 -0
  37. package/dist/types/resume-payload.d.ts +34 -0
  38. package/dist/types/resume-payload.d.ts.map +1 -0
  39. package/dist/types/resume-payload.js +12 -0
  40. package/dist/types/resume-payload.js.map +1 -0
  41. package/dist/util/executable-check.d.ts +42 -0
  42. package/dist/util/executable-check.d.ts.map +1 -0
  43. package/dist/util/executable-check.js +115 -0
  44. package/dist/util/executable-check.js.map +1 -0
  45. package/package.json +1 -1
  46. package/dist/authz/principal-field.d.ts +0 -23
  47. package/dist/authz/principal-field.d.ts.map +0 -1
  48. package/dist/authz/principal-field.js +0 -34
  49. package/dist/authz/principal-field.js.map +0 -1
@@ -8,7 +8,7 @@ import { z } from 'zod';
8
8
  * execution time and travels *with the output data* — `output.response.citation`,
9
9
  * a structural mirror of `output.response.value`.
10
10
  *
11
- * Two kinds, because exactly two things are knowable to a model:
11
+ * Three kinds everything a model can honestly say about where a value came from:
12
12
  *
13
13
  * - `ref` — a path the agent was explicitly shown (the `[source: ...]` labels the
14
14
  * agent step injects around resolved `{{refs}}`). An agent can never emit an
@@ -16,78 +16,592 @@ import { z } from 'zod';
16
16
  * to know. Turning a `ref` into an openable document happens in the UI, which
17
17
  * alone holds the workflow config + step outputs required to walk to the source.
18
18
  * - `url` — an external link the agent browsed. Already concrete; nothing to resolve.
19
+ * - `derived` — the value was **computed**, so it appears nowhere to be quoted;
20
+ * its provenance is the inputs it combined and how. See {@link DerivedCitationSchema}.
19
21
  *
20
- * `page` / `quote` are the half only the reader of the text can supply: they
21
- * locate the passage *inside* the resolved document. Which document a value came
22
- * from is structural (the workflow knows it); where inside it is data (only the
23
- * agent knows it) — this split is why citations are never inferred by tracing.
22
+ * `locator` / `quote` are the half only the reader of the text can supply: they
23
+ * locate the passage *inside* the source the `ref` names. Which source a value
24
+ * came from is structural (the workflow knows it); where inside it is data (only
25
+ * the agent knows it) — this split is why citations are never inferred by tracing.
26
+ *
27
+ * **There is deliberately no separate "document" vs "value" kind.** Whether a ref
28
+ * resolves to an openable document or to plain step output is a *structural* fact
29
+ * the model cannot know — it saw text, not the workflow graph. Asking it to
30
+ * classify would guarantee confident mis-labelling, and a wrong discriminator is
31
+ * far worse than an omitted optional field. So the emitted union is shaped by what
32
+ * the agent can know; the *resolved* union (UI) splits `doc` from `value`, where
33
+ * the answer is actually available. When there is nothing to locate within, the
34
+ * agent simply omits `locator`/`quote`.
35
+ */
36
+ /**
37
+ * Where inside a source a value sits.
38
+ *
39
+ * Discriminated rather than a bag of optional fields: a spreadsheet has no pages
40
+ * and a PDF has no rows, so `page?`/`row?`/`line?` side by side would make most
41
+ * combinations meaningless and every consumer defensive.
42
+ *
43
+ * The agent asserts this only because the `[source: …]` label *shows* it — it is
44
+ * copied, never inferred. Anything a label can't show stays out of this union
45
+ * (an image bounding box, for instance, which no reader of text could know).
24
46
  */
47
+ export declare const LocatorSchema: z.ZodDiscriminatedUnion<"at", [z.ZodObject<{
48
+ at: z.ZodLiteral<"page">;
49
+ page: z.ZodNumber;
50
+ }, "strip", z.ZodTypeAny, {
51
+ at: "page";
52
+ page: number;
53
+ }, {
54
+ at: "page";
55
+ page: number;
56
+ }>, z.ZodObject<{
57
+ at: z.ZodLiteral<"cell">;
58
+ sheet: z.ZodOptional<z.ZodString>;
59
+ row: z.ZodNumber;
60
+ col: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
61
+ }, "strip", z.ZodTypeAny, {
62
+ at: "cell";
63
+ row: number;
64
+ col: string | number;
65
+ sheet?: string | undefined;
66
+ }, {
67
+ at: "cell";
68
+ row: number;
69
+ col: string | number;
70
+ sheet?: string | undefined;
71
+ }>, z.ZodObject<{
72
+ at: z.ZodLiteral<"line">;
73
+ from: z.ZodNumber;
74
+ to: z.ZodOptional<z.ZodNumber>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ at: "line";
77
+ from: number;
78
+ to?: number | undefined;
79
+ }, {
80
+ at: "line";
81
+ from: number;
82
+ to?: number | undefined;
83
+ }>]>;
84
+ export type Locator = z.infer<typeof LocatorSchema>;
25
85
  export declare const RefCitationSchema: z.ZodObject<{
26
86
  kind: z.ZodLiteral<"ref">;
27
87
  ref: z.ZodString;
28
- page: z.ZodOptional<z.ZodNumber>;
88
+ locator: z.ZodOptional<z.ZodDiscriminatedUnion<"at", [z.ZodObject<{
89
+ at: z.ZodLiteral<"page">;
90
+ page: z.ZodNumber;
91
+ }, "strip", z.ZodTypeAny, {
92
+ at: "page";
93
+ page: number;
94
+ }, {
95
+ at: "page";
96
+ page: number;
97
+ }>, z.ZodObject<{
98
+ at: z.ZodLiteral<"cell">;
99
+ sheet: z.ZodOptional<z.ZodString>;
100
+ row: z.ZodNumber;
101
+ col: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ at: "cell";
104
+ row: number;
105
+ col: string | number;
106
+ sheet?: string | undefined;
107
+ }, {
108
+ at: "cell";
109
+ row: number;
110
+ col: string | number;
111
+ sheet?: string | undefined;
112
+ }>, z.ZodObject<{
113
+ at: z.ZodLiteral<"line">;
114
+ from: z.ZodNumber;
115
+ to: z.ZodOptional<z.ZodNumber>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ at: "line";
118
+ from: number;
119
+ to?: number | undefined;
120
+ }, {
121
+ at: "line";
122
+ from: number;
123
+ to?: number | undefined;
124
+ }>]>>;
29
125
  quote: z.ZodOptional<z.ZodString>;
30
126
  label: z.ZodOptional<z.ZodString>;
31
127
  }, "strip", z.ZodTypeAny, {
32
128
  ref: string;
33
129
  kind: "ref";
34
130
  label?: string | undefined;
35
- page?: number | undefined;
131
+ locator?: {
132
+ at: "page";
133
+ page: number;
134
+ } | {
135
+ at: "cell";
136
+ row: number;
137
+ col: string | number;
138
+ sheet?: string | undefined;
139
+ } | {
140
+ at: "line";
141
+ from: number;
142
+ to?: number | undefined;
143
+ } | undefined;
36
144
  quote?: string | undefined;
37
145
  }, {
38
146
  ref: string;
39
147
  kind: "ref";
40
148
  label?: string | undefined;
41
- page?: number | undefined;
149
+ locator?: {
150
+ at: "page";
151
+ page: number;
152
+ } | {
153
+ at: "cell";
154
+ row: number;
155
+ col: string | number;
156
+ sheet?: string | undefined;
157
+ } | {
158
+ at: "line";
159
+ from: number;
160
+ to?: number | undefined;
161
+ } | undefined;
42
162
  quote?: string | undefined;
43
163
  }>;
44
164
  export declare const UrlCitationSchema: z.ZodObject<{
45
165
  kind: z.ZodLiteral<"url">;
46
166
  url: z.ZodString;
167
+ quote: z.ZodOptional<z.ZodString>;
47
168
  title: z.ZodOptional<z.ZodString>;
48
169
  }, "strip", z.ZodTypeAny, {
49
170
  url: string;
50
171
  kind: "url";
172
+ quote?: string | undefined;
51
173
  title?: string | undefined;
52
174
  }, {
53
175
  url: string;
54
176
  kind: "url";
177
+ quote?: string | undefined;
55
178
  title?: string | undefined;
56
179
  }>;
180
+ /**
181
+ * A value the agent **computed** rather than read — a total, a ratio, a growth
182
+ * rate. It appears nowhere in the source, so there is no passage to quote and no
183
+ * page to open; its provenance is *these inputs, combined this way*.
184
+ *
185
+ * This is a distinct kind rather than "several citations on one value" because
186
+ * the two mean opposite things. Two citations on a name are **corroboration** —
187
+ * either alone still supports it. Two inputs to a subtraction are **required** —
188
+ * if one is wrong, the value is wrong. Rendering them identically would hide that.
189
+ *
190
+ * `inputs` is deliberately only one level deep (an input can't itself be
191
+ * `derived`): it keeps every union member a plain `ZodObject`, which is what
192
+ * `z.discriminatedUnion` requires — a recursive member would force `z.union` plus
193
+ * lazy schemas for no real gain, since a chain of derivations is already handled
194
+ * by resolving *through* the upstream agent's own citation.
195
+ */
196
+ export declare const DerivedCitationSchema: z.ZodObject<{
197
+ kind: z.ZodLiteral<"derived">;
198
+ expression: z.ZodOptional<z.ZodString>;
199
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
200
+ kind: z.ZodLiteral<"ref">;
201
+ ref: z.ZodString;
202
+ locator: z.ZodOptional<z.ZodDiscriminatedUnion<"at", [z.ZodObject<{
203
+ at: z.ZodLiteral<"page">;
204
+ page: z.ZodNumber;
205
+ }, "strip", z.ZodTypeAny, {
206
+ at: "page";
207
+ page: number;
208
+ }, {
209
+ at: "page";
210
+ page: number;
211
+ }>, z.ZodObject<{
212
+ at: z.ZodLiteral<"cell">;
213
+ sheet: z.ZodOptional<z.ZodString>;
214
+ row: z.ZodNumber;
215
+ col: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ at: "cell";
218
+ row: number;
219
+ col: string | number;
220
+ sheet?: string | undefined;
221
+ }, {
222
+ at: "cell";
223
+ row: number;
224
+ col: string | number;
225
+ sheet?: string | undefined;
226
+ }>, z.ZodObject<{
227
+ at: z.ZodLiteral<"line">;
228
+ from: z.ZodNumber;
229
+ to: z.ZodOptional<z.ZodNumber>;
230
+ }, "strip", z.ZodTypeAny, {
231
+ at: "line";
232
+ from: number;
233
+ to?: number | undefined;
234
+ }, {
235
+ at: "line";
236
+ from: number;
237
+ to?: number | undefined;
238
+ }>]>>;
239
+ quote: z.ZodOptional<z.ZodString>;
240
+ label: z.ZodOptional<z.ZodString>;
241
+ }, "strip", z.ZodTypeAny, {
242
+ ref: string;
243
+ kind: "ref";
244
+ label?: string | undefined;
245
+ locator?: {
246
+ at: "page";
247
+ page: number;
248
+ } | {
249
+ at: "cell";
250
+ row: number;
251
+ col: string | number;
252
+ sheet?: string | undefined;
253
+ } | {
254
+ at: "line";
255
+ from: number;
256
+ to?: number | undefined;
257
+ } | undefined;
258
+ quote?: string | undefined;
259
+ }, {
260
+ ref: string;
261
+ kind: "ref";
262
+ label?: string | undefined;
263
+ locator?: {
264
+ at: "page";
265
+ page: number;
266
+ } | {
267
+ at: "cell";
268
+ row: number;
269
+ col: string | number;
270
+ sheet?: string | undefined;
271
+ } | {
272
+ at: "line";
273
+ from: number;
274
+ to?: number | undefined;
275
+ } | undefined;
276
+ quote?: string | undefined;
277
+ }>, z.ZodObject<{
278
+ kind: z.ZodLiteral<"url">;
279
+ url: z.ZodString;
280
+ quote: z.ZodOptional<z.ZodString>;
281
+ title: z.ZodOptional<z.ZodString>;
282
+ }, "strip", z.ZodTypeAny, {
283
+ url: string;
284
+ kind: "url";
285
+ quote?: string | undefined;
286
+ title?: string | undefined;
287
+ }, {
288
+ url: string;
289
+ kind: "url";
290
+ quote?: string | undefined;
291
+ title?: string | undefined;
292
+ }>]>, "many">;
293
+ label: z.ZodOptional<z.ZodString>;
294
+ }, "strip", z.ZodTypeAny, {
295
+ kind: "derived";
296
+ inputs: ({
297
+ ref: string;
298
+ kind: "ref";
299
+ label?: string | undefined;
300
+ locator?: {
301
+ at: "page";
302
+ page: number;
303
+ } | {
304
+ at: "cell";
305
+ row: number;
306
+ col: string | number;
307
+ sheet?: string | undefined;
308
+ } | {
309
+ at: "line";
310
+ from: number;
311
+ to?: number | undefined;
312
+ } | undefined;
313
+ quote?: string | undefined;
314
+ } | {
315
+ url: string;
316
+ kind: "url";
317
+ quote?: string | undefined;
318
+ title?: string | undefined;
319
+ })[];
320
+ expression?: string | undefined;
321
+ label?: string | undefined;
322
+ }, {
323
+ kind: "derived";
324
+ inputs: ({
325
+ ref: string;
326
+ kind: "ref";
327
+ label?: string | undefined;
328
+ locator?: {
329
+ at: "page";
330
+ page: number;
331
+ } | {
332
+ at: "cell";
333
+ row: number;
334
+ col: string | number;
335
+ sheet?: string | undefined;
336
+ } | {
337
+ at: "line";
338
+ from: number;
339
+ to?: number | undefined;
340
+ } | undefined;
341
+ quote?: string | undefined;
342
+ } | {
343
+ url: string;
344
+ kind: "url";
345
+ quote?: string | undefined;
346
+ title?: string | undefined;
347
+ })[];
348
+ expression?: string | undefined;
349
+ label?: string | undefined;
350
+ }>;
57
351
  export declare const CitationRefSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
58
352
  kind: z.ZodLiteral<"ref">;
59
353
  ref: z.ZodString;
60
- page: z.ZodOptional<z.ZodNumber>;
354
+ locator: z.ZodOptional<z.ZodDiscriminatedUnion<"at", [z.ZodObject<{
355
+ at: z.ZodLiteral<"page">;
356
+ page: z.ZodNumber;
357
+ }, "strip", z.ZodTypeAny, {
358
+ at: "page";
359
+ page: number;
360
+ }, {
361
+ at: "page";
362
+ page: number;
363
+ }>, z.ZodObject<{
364
+ at: z.ZodLiteral<"cell">;
365
+ sheet: z.ZodOptional<z.ZodString>;
366
+ row: z.ZodNumber;
367
+ col: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
368
+ }, "strip", z.ZodTypeAny, {
369
+ at: "cell";
370
+ row: number;
371
+ col: string | number;
372
+ sheet?: string | undefined;
373
+ }, {
374
+ at: "cell";
375
+ row: number;
376
+ col: string | number;
377
+ sheet?: string | undefined;
378
+ }>, z.ZodObject<{
379
+ at: z.ZodLiteral<"line">;
380
+ from: z.ZodNumber;
381
+ to: z.ZodOptional<z.ZodNumber>;
382
+ }, "strip", z.ZodTypeAny, {
383
+ at: "line";
384
+ from: number;
385
+ to?: number | undefined;
386
+ }, {
387
+ at: "line";
388
+ from: number;
389
+ to?: number | undefined;
390
+ }>]>>;
61
391
  quote: z.ZodOptional<z.ZodString>;
62
392
  label: z.ZodOptional<z.ZodString>;
63
393
  }, "strip", z.ZodTypeAny, {
64
394
  ref: string;
65
395
  kind: "ref";
66
396
  label?: string | undefined;
67
- page?: number | undefined;
397
+ locator?: {
398
+ at: "page";
399
+ page: number;
400
+ } | {
401
+ at: "cell";
402
+ row: number;
403
+ col: string | number;
404
+ sheet?: string | undefined;
405
+ } | {
406
+ at: "line";
407
+ from: number;
408
+ to?: number | undefined;
409
+ } | undefined;
68
410
  quote?: string | undefined;
69
411
  }, {
70
412
  ref: string;
71
413
  kind: "ref";
72
414
  label?: string | undefined;
73
- page?: number | undefined;
415
+ locator?: {
416
+ at: "page";
417
+ page: number;
418
+ } | {
419
+ at: "cell";
420
+ row: number;
421
+ col: string | number;
422
+ sheet?: string | undefined;
423
+ } | {
424
+ at: "line";
425
+ from: number;
426
+ to?: number | undefined;
427
+ } | undefined;
74
428
  quote?: string | undefined;
75
429
  }>, z.ZodObject<{
76
430
  kind: z.ZodLiteral<"url">;
77
431
  url: z.ZodString;
432
+ quote: z.ZodOptional<z.ZodString>;
78
433
  title: z.ZodOptional<z.ZodString>;
79
434
  }, "strip", z.ZodTypeAny, {
80
435
  url: string;
81
436
  kind: "url";
437
+ quote?: string | undefined;
82
438
  title?: string | undefined;
83
439
  }, {
84
440
  url: string;
85
441
  kind: "url";
442
+ quote?: string | undefined;
86
443
  title?: string | undefined;
444
+ }>, z.ZodObject<{
445
+ kind: z.ZodLiteral<"derived">;
446
+ expression: z.ZodOptional<z.ZodString>;
447
+ inputs: z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
448
+ kind: z.ZodLiteral<"ref">;
449
+ ref: z.ZodString;
450
+ locator: z.ZodOptional<z.ZodDiscriminatedUnion<"at", [z.ZodObject<{
451
+ at: z.ZodLiteral<"page">;
452
+ page: z.ZodNumber;
453
+ }, "strip", z.ZodTypeAny, {
454
+ at: "page";
455
+ page: number;
456
+ }, {
457
+ at: "page";
458
+ page: number;
459
+ }>, z.ZodObject<{
460
+ at: z.ZodLiteral<"cell">;
461
+ sheet: z.ZodOptional<z.ZodString>;
462
+ row: z.ZodNumber;
463
+ col: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
464
+ }, "strip", z.ZodTypeAny, {
465
+ at: "cell";
466
+ row: number;
467
+ col: string | number;
468
+ sheet?: string | undefined;
469
+ }, {
470
+ at: "cell";
471
+ row: number;
472
+ col: string | number;
473
+ sheet?: string | undefined;
474
+ }>, z.ZodObject<{
475
+ at: z.ZodLiteral<"line">;
476
+ from: z.ZodNumber;
477
+ to: z.ZodOptional<z.ZodNumber>;
478
+ }, "strip", z.ZodTypeAny, {
479
+ at: "line";
480
+ from: number;
481
+ to?: number | undefined;
482
+ }, {
483
+ at: "line";
484
+ from: number;
485
+ to?: number | undefined;
486
+ }>]>>;
487
+ quote: z.ZodOptional<z.ZodString>;
488
+ label: z.ZodOptional<z.ZodString>;
489
+ }, "strip", z.ZodTypeAny, {
490
+ ref: string;
491
+ kind: "ref";
492
+ label?: string | undefined;
493
+ locator?: {
494
+ at: "page";
495
+ page: number;
496
+ } | {
497
+ at: "cell";
498
+ row: number;
499
+ col: string | number;
500
+ sheet?: string | undefined;
501
+ } | {
502
+ at: "line";
503
+ from: number;
504
+ to?: number | undefined;
505
+ } | undefined;
506
+ quote?: string | undefined;
507
+ }, {
508
+ ref: string;
509
+ kind: "ref";
510
+ label?: string | undefined;
511
+ locator?: {
512
+ at: "page";
513
+ page: number;
514
+ } | {
515
+ at: "cell";
516
+ row: number;
517
+ col: string | number;
518
+ sheet?: string | undefined;
519
+ } | {
520
+ at: "line";
521
+ from: number;
522
+ to?: number | undefined;
523
+ } | undefined;
524
+ quote?: string | undefined;
525
+ }>, z.ZodObject<{
526
+ kind: z.ZodLiteral<"url">;
527
+ url: z.ZodString;
528
+ quote: z.ZodOptional<z.ZodString>;
529
+ title: z.ZodOptional<z.ZodString>;
530
+ }, "strip", z.ZodTypeAny, {
531
+ url: string;
532
+ kind: "url";
533
+ quote?: string | undefined;
534
+ title?: string | undefined;
535
+ }, {
536
+ url: string;
537
+ kind: "url";
538
+ quote?: string | undefined;
539
+ title?: string | undefined;
540
+ }>]>, "many">;
541
+ label: z.ZodOptional<z.ZodString>;
542
+ }, "strip", z.ZodTypeAny, {
543
+ kind: "derived";
544
+ inputs: ({
545
+ ref: string;
546
+ kind: "ref";
547
+ label?: string | undefined;
548
+ locator?: {
549
+ at: "page";
550
+ page: number;
551
+ } | {
552
+ at: "cell";
553
+ row: number;
554
+ col: string | number;
555
+ sheet?: string | undefined;
556
+ } | {
557
+ at: "line";
558
+ from: number;
559
+ to?: number | undefined;
560
+ } | undefined;
561
+ quote?: string | undefined;
562
+ } | {
563
+ url: string;
564
+ kind: "url";
565
+ quote?: string | undefined;
566
+ title?: string | undefined;
567
+ })[];
568
+ expression?: string | undefined;
569
+ label?: string | undefined;
570
+ }, {
571
+ kind: "derived";
572
+ inputs: ({
573
+ ref: string;
574
+ kind: "ref";
575
+ label?: string | undefined;
576
+ locator?: {
577
+ at: "page";
578
+ page: number;
579
+ } | {
580
+ at: "cell";
581
+ row: number;
582
+ col: string | number;
583
+ sheet?: string | undefined;
584
+ } | {
585
+ at: "line";
586
+ from: number;
587
+ to?: number | undefined;
588
+ } | undefined;
589
+ quote?: string | undefined;
590
+ } | {
591
+ url: string;
592
+ kind: "url";
593
+ quote?: string | undefined;
594
+ title?: string | undefined;
595
+ })[];
596
+ expression?: string | undefined;
597
+ label?: string | undefined;
87
598
  }>]>;
88
599
  export type CitationRef = z.infer<typeof CitationRefSchema>;
89
600
  export type RefCitation = z.infer<typeof RefCitationSchema>;
90
601
  export type UrlCitation = z.infer<typeof UrlCitationSchema>;
602
+ export type DerivedCitation = z.infer<typeof DerivedCitationSchema>;
603
+ /** An input to a derived citation — anything directly citable. */
604
+ export type SourceCitation = RefCitation | UrlCitation;
91
605
  /**
92
606
  * The `citation` half of a cited agent response — a structural mirror of `value`
93
607
  * whose leaves are `CitationRef[]`.
@@ -1 +1 @@
1
- {"version":3,"file":"citation-ref.d.ts","sourceRoot":"","sources":["../../src/common/citation-ref.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;EAsB5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;EAI5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAG5B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,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