agent-trajectories 0.2.3 → 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.
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ type TrajectoryStatus = "active" | "completed" | "abandoned";
40
40
  /**
41
41
  * Event types that can be recorded in a trajectory
42
42
  */
43
- type TrajectoryEventType = "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
43
+ type TrajectoryEventType = "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
44
44
  /**
45
45
  * Significance level for events
46
46
  */
@@ -59,9 +59,20 @@ interface TrajectoryEvent {
59
59
  raw?: unknown;
60
60
  /** Importance level */
61
61
  significance?: EventSignificance;
62
+ /** Confidence level for this event (0-1) */
63
+ confidence?: number;
62
64
  /** User-defined tags */
63
65
  tags?: string[];
64
66
  }
67
+ /**
68
+ * An alternative option that was considered
69
+ */
70
+ interface Alternative {
71
+ /** The alternative option */
72
+ option: string;
73
+ /** Why this alternative was not chosen */
74
+ reason?: string;
75
+ }
65
76
  /**
66
77
  * A structured decision record
67
78
  */
@@ -71,9 +82,11 @@ interface Decision {
71
82
  /** What was chosen */
72
83
  chosen: string;
73
84
  /** What alternatives were considered */
74
- alternatives: string[];
85
+ alternatives: Alternative[];
75
86
  /** Why this choice was made */
76
87
  reasoning: string;
88
+ /** Confidence in this decision (0-1) */
89
+ confidence?: number;
77
90
  }
78
91
  /**
79
92
  * Agent participation record
@@ -156,6 +169,8 @@ interface Trajectory {
156
169
  projectId: string;
157
170
  /** User-defined tags */
158
171
  tags: string[];
172
+ /** Trace information for code attribution */
173
+ _trace?: TrajectoryTraceRef;
159
174
  }
160
175
  /**
161
176
  * Summary of a trajectory for listing/indexing
@@ -239,6 +254,17 @@ interface TrajectoryQuery {
239
254
  /** Sort direction */
240
255
  sortOrder?: "asc" | "desc";
241
256
  }
257
+ /**
258
+ * Reference to trace information within a trajectory
259
+ */
260
+ interface TrajectoryTraceRef {
261
+ /** Git ref (commit hash) when trace started */
262
+ startRef: string;
263
+ /** Git ref (commit hash) when trace ended */
264
+ endRef?: string;
265
+ /** ID of the associated trace record */
266
+ traceId?: string;
267
+ }
242
268
 
243
269
  /**
244
270
  * Trajectory operations
@@ -310,22 +336,41 @@ declare function abandonTrajectory(trajectory: Trajectory, reason?: string): Tra
310
336
 
311
337
  /**
312
338
  * Decision schema
339
+ * Note: alternatives supports both string[] (legacy) and Alternative[] (new)
313
340
  */
314
341
  declare const DecisionSchema: z.ZodObject<{
315
342
  question: z.ZodString;
316
343
  chosen: z.ZodString;
317
- alternatives: z.ZodArray<z.ZodString, "many">;
344
+ alternatives: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
345
+ option: z.ZodString;
346
+ reason: z.ZodOptional<z.ZodString>;
347
+ }, "strip", z.ZodTypeAny, {
348
+ option: string;
349
+ reason?: string | undefined;
350
+ }, {
351
+ option: string;
352
+ reason?: string | undefined;
353
+ }>]>, "many">;
318
354
  reasoning: z.ZodString;
355
+ confidence: z.ZodOptional<z.ZodNumber>;
319
356
  }, "strip", z.ZodTypeAny, {
320
357
  question: string;
321
358
  chosen: string;
322
- alternatives: string[];
359
+ alternatives: (string | {
360
+ option: string;
361
+ reason?: string | undefined;
362
+ })[];
323
363
  reasoning: string;
364
+ confidence?: number | undefined;
324
365
  }, {
325
366
  question: string;
326
367
  chosen: string;
327
- alternatives: string[];
368
+ alternatives: (string | {
369
+ option: string;
370
+ reason?: string | undefined;
371
+ })[];
328
372
  reasoning: string;
373
+ confidence?: number | undefined;
329
374
  }>;
330
375
  /**
331
376
  * Full trajectory schema
@@ -393,25 +438,28 @@ declare const TrajectorySchema: z.ZodObject<{
393
438
  endedAt: z.ZodOptional<z.ZodString>;
394
439
  events: z.ZodArray<z.ZodObject<{
395
440
  ts: z.ZodNumber;
396
- type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "note", "error"]>;
441
+ type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "finding", "note", "error"]>;
397
442
  content: z.ZodString;
398
443
  raw: z.ZodOptional<z.ZodUnknown>;
399
444
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
400
445
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
446
+ confidence: z.ZodOptional<z.ZodNumber>;
401
447
  }, "strip", z.ZodTypeAny, {
402
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
448
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
403
449
  ts: number;
404
450
  content: string;
405
451
  raw?: unknown;
406
452
  significance?: "low" | "medium" | "high" | "critical" | undefined;
407
453
  tags?: string[] | undefined;
454
+ confidence?: number | undefined;
408
455
  }, {
409
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
456
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
410
457
  ts: number;
411
458
  content: string;
412
459
  raw?: unknown;
413
460
  significance?: "low" | "medium" | "high" | "critical" | undefined;
414
461
  tags?: string[] | undefined;
462
+ confidence?: number | undefined;
415
463
  }>, "many">;
416
464
  }, "strip", z.ZodTypeAny, {
417
465
  id: string;
@@ -419,12 +467,13 @@ declare const TrajectorySchema: z.ZodObject<{
419
467
  agentName: string;
420
468
  startedAt: string;
421
469
  events: {
422
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
470
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
423
471
  ts: number;
424
472
  content: string;
425
473
  raw?: unknown;
426
474
  significance?: "low" | "medium" | "high" | "critical" | undefined;
427
475
  tags?: string[] | undefined;
476
+ confidence?: number | undefined;
428
477
  }[];
429
478
  endedAt?: string | undefined;
430
479
  }, {
@@ -433,12 +482,13 @@ declare const TrajectorySchema: z.ZodObject<{
433
482
  agentName: string;
434
483
  startedAt: string;
435
484
  events: {
436
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
485
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
437
486
  ts: number;
438
487
  content: string;
439
488
  raw?: unknown;
440
489
  significance?: "low" | "medium" | "high" | "critical" | undefined;
441
490
  tags?: string[] | undefined;
491
+ confidence?: number | undefined;
442
492
  }[];
443
493
  endedAt?: string | undefined;
444
494
  }>, "many">;
@@ -448,18 +498,36 @@ declare const TrajectorySchema: z.ZodObject<{
448
498
  decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
449
499
  question: z.ZodString;
450
500
  chosen: z.ZodString;
451
- alternatives: z.ZodArray<z.ZodString, "many">;
501
+ alternatives: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
502
+ option: z.ZodString;
503
+ reason: z.ZodOptional<z.ZodString>;
504
+ }, "strip", z.ZodTypeAny, {
505
+ option: string;
506
+ reason?: string | undefined;
507
+ }, {
508
+ option: string;
509
+ reason?: string | undefined;
510
+ }>]>, "many">;
452
511
  reasoning: z.ZodString;
512
+ confidence: z.ZodOptional<z.ZodNumber>;
453
513
  }, "strip", z.ZodTypeAny, {
454
514
  question: string;
455
515
  chosen: string;
456
- alternatives: string[];
516
+ alternatives: (string | {
517
+ option: string;
518
+ reason?: string | undefined;
519
+ })[];
457
520
  reasoning: string;
521
+ confidence?: number | undefined;
458
522
  }, {
459
523
  question: string;
460
524
  chosen: string;
461
- alternatives: string[];
525
+ alternatives: (string | {
526
+ option: string;
527
+ reason?: string | undefined;
528
+ })[];
462
529
  reasoning: string;
530
+ confidence?: number | undefined;
463
531
  }>, "many">>;
464
532
  challenges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
465
533
  learnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -467,28 +535,36 @@ declare const TrajectorySchema: z.ZodObject<{
467
535
  confidence: z.ZodNumber;
468
536
  timeSpent: z.ZodOptional<z.ZodString>;
469
537
  }, "strip", z.ZodTypeAny, {
538
+ confidence: number;
470
539
  summary: string;
471
540
  approach: string;
472
- confidence: number;
473
541
  decisions?: {
474
542
  question: string;
475
543
  chosen: string;
476
- alternatives: string[];
544
+ alternatives: (string | {
545
+ option: string;
546
+ reason?: string | undefined;
547
+ })[];
477
548
  reasoning: string;
549
+ confidence?: number | undefined;
478
550
  }[] | undefined;
479
551
  challenges?: string[] | undefined;
480
552
  learnings?: string[] | undefined;
481
553
  suggestions?: string[] | undefined;
482
554
  timeSpent?: string | undefined;
483
555
  }, {
556
+ confidence: number;
484
557
  summary: string;
485
558
  approach: string;
486
- confidence: number;
487
559
  decisions?: {
488
560
  question: string;
489
561
  chosen: string;
490
- alternatives: string[];
562
+ alternatives: (string | {
563
+ option: string;
564
+ reason?: string | undefined;
565
+ })[];
491
566
  reasoning: string;
567
+ confidence?: number | undefined;
492
568
  }[] | undefined;
493
569
  challenges?: string[] | undefined;
494
570
  learnings?: string[] | undefined;
@@ -499,6 +575,19 @@ declare const TrajectorySchema: z.ZodObject<{
499
575
  filesChanged: z.ZodArray<z.ZodString, "many">;
500
576
  projectId: z.ZodString;
501
577
  tags: z.ZodArray<z.ZodString, "many">;
578
+ _trace: z.ZodOptional<z.ZodObject<{
579
+ startRef: z.ZodString;
580
+ endRef: z.ZodOptional<z.ZodString>;
581
+ traceId: z.ZodOptional<z.ZodString>;
582
+ }, "strip", z.ZodTypeAny, {
583
+ startRef: string;
584
+ endRef?: string | undefined;
585
+ traceId?: string | undefined;
586
+ }, {
587
+ startRef: string;
588
+ endRef?: string | undefined;
589
+ traceId?: string | undefined;
590
+ }>>;
502
591
  }, "strip", z.ZodTypeAny, {
503
592
  status: "active" | "completed" | "abandoned";
504
593
  id: string;
@@ -526,12 +615,13 @@ declare const TrajectorySchema: z.ZodObject<{
526
615
  agentName: string;
527
616
  startedAt: string;
528
617
  events: {
529
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
618
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
530
619
  ts: number;
531
620
  content: string;
532
621
  raw?: unknown;
533
622
  significance?: "low" | "medium" | "high" | "critical" | undefined;
534
623
  tags?: string[] | undefined;
624
+ confidence?: number | undefined;
535
625
  }[];
536
626
  endedAt?: string | undefined;
537
627
  }[];
@@ -540,20 +630,29 @@ declare const TrajectorySchema: z.ZodObject<{
540
630
  projectId: string;
541
631
  completedAt?: string | undefined;
542
632
  retrospective?: {
633
+ confidence: number;
543
634
  summary: string;
544
635
  approach: string;
545
- confidence: number;
546
636
  decisions?: {
547
637
  question: string;
548
638
  chosen: string;
549
- alternatives: string[];
639
+ alternatives: (string | {
640
+ option: string;
641
+ reason?: string | undefined;
642
+ })[];
550
643
  reasoning: string;
644
+ confidence?: number | undefined;
551
645
  }[] | undefined;
552
646
  challenges?: string[] | undefined;
553
647
  learnings?: string[] | undefined;
554
648
  suggestions?: string[] | undefined;
555
649
  timeSpent?: string | undefined;
556
650
  } | undefined;
651
+ _trace?: {
652
+ startRef: string;
653
+ endRef?: string | undefined;
654
+ traceId?: string | undefined;
655
+ } | undefined;
557
656
  }, {
558
657
  status: "active" | "completed" | "abandoned";
559
658
  id: string;
@@ -581,12 +680,13 @@ declare const TrajectorySchema: z.ZodObject<{
581
680
  agentName: string;
582
681
  startedAt: string;
583
682
  events: {
584
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
683
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
585
684
  ts: number;
586
685
  content: string;
587
686
  raw?: unknown;
588
687
  significance?: "low" | "medium" | "high" | "critical" | undefined;
589
688
  tags?: string[] | undefined;
689
+ confidence?: number | undefined;
590
690
  }[];
591
691
  endedAt?: string | undefined;
592
692
  }[];
@@ -595,20 +695,29 @@ declare const TrajectorySchema: z.ZodObject<{
595
695
  projectId: string;
596
696
  completedAt?: string | undefined;
597
697
  retrospective?: {
698
+ confidence: number;
598
699
  summary: string;
599
700
  approach: string;
600
- confidence: number;
601
701
  decisions?: {
602
702
  question: string;
603
703
  chosen: string;
604
- alternatives: string[];
704
+ alternatives: (string | {
705
+ option: string;
706
+ reason?: string | undefined;
707
+ })[];
605
708
  reasoning: string;
709
+ confidence?: number | undefined;
606
710
  }[] | undefined;
607
711
  challenges?: string[] | undefined;
608
712
  learnings?: string[] | undefined;
609
713
  suggestions?: string[] | undefined;
610
714
  timeSpent?: string | undefined;
611
715
  } | undefined;
716
+ _trace?: {
717
+ startRef: string;
718
+ endRef?: string | undefined;
719
+ traceId?: string | undefined;
720
+ } | undefined;
612
721
  }>;
613
722
  /**
614
723
  * Create trajectory input schema
@@ -661,45 +770,71 @@ declare const CompleteTrajectoryInputSchema: z.ZodObject<{
661
770
  decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
662
771
  question: z.ZodString;
663
772
  chosen: z.ZodString;
664
- alternatives: z.ZodArray<z.ZodString, "many">;
773
+ alternatives: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
774
+ option: z.ZodString;
775
+ reason: z.ZodOptional<z.ZodString>;
776
+ }, "strip", z.ZodTypeAny, {
777
+ option: string;
778
+ reason?: string | undefined;
779
+ }, {
780
+ option: string;
781
+ reason?: string | undefined;
782
+ }>]>, "many">;
665
783
  reasoning: z.ZodString;
784
+ confidence: z.ZodOptional<z.ZodNumber>;
666
785
  }, "strip", z.ZodTypeAny, {
667
786
  question: string;
668
787
  chosen: string;
669
- alternatives: string[];
788
+ alternatives: (string | {
789
+ option: string;
790
+ reason?: string | undefined;
791
+ })[];
670
792
  reasoning: string;
793
+ confidence?: number | undefined;
671
794
  }, {
672
795
  question: string;
673
796
  chosen: string;
674
- alternatives: string[];
797
+ alternatives: (string | {
798
+ option: string;
799
+ reason?: string | undefined;
800
+ })[];
675
801
  reasoning: string;
802
+ confidence?: number | undefined;
676
803
  }>, "many">>;
677
804
  challenges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
678
805
  learnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
679
806
  suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
680
807
  confidence: z.ZodNumber;
681
808
  }, "strip", z.ZodTypeAny, {
809
+ confidence: number;
682
810
  summary: string;
683
811
  approach: string;
684
- confidence: number;
685
812
  decisions?: {
686
813
  question: string;
687
814
  chosen: string;
688
- alternatives: string[];
815
+ alternatives: (string | {
816
+ option: string;
817
+ reason?: string | undefined;
818
+ })[];
689
819
  reasoning: string;
820
+ confidence?: number | undefined;
690
821
  }[] | undefined;
691
822
  challenges?: string[] | undefined;
692
823
  learnings?: string[] | undefined;
693
824
  suggestions?: string[] | undefined;
694
825
  }, {
826
+ confidence: number;
695
827
  summary: string;
696
828
  approach: string;
697
- confidence: number;
698
829
  decisions?: {
699
830
  question: string;
700
831
  chosen: string;
701
- alternatives: string[];
832
+ alternatives: (string | {
833
+ option: string;
834
+ reason?: string | undefined;
835
+ })[];
702
836
  reasoning: string;
837
+ confidence?: number | undefined;
703
838
  }[] | undefined;
704
839
  challenges?: string[] | undefined;
705
840
  learnings?: string[] | undefined;
@@ -736,25 +871,28 @@ declare function validateCompleteInput(data: unknown): {
736
871
  */
737
872
  declare const TrajectoryEventSchema: z.ZodObject<{
738
873
  ts: z.ZodNumber;
739
- type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "note", "error"]>;
874
+ type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "finding", "note", "error"]>;
740
875
  content: z.ZodString;
741
876
  raw: z.ZodOptional<z.ZodUnknown>;
742
877
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
743
878
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
879
+ confidence: z.ZodOptional<z.ZodNumber>;
744
880
  }, "strip", z.ZodTypeAny, {
745
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
881
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
746
882
  ts: number;
747
883
  content: string;
748
884
  raw?: unknown;
749
885
  significance?: "low" | "medium" | "high" | "critical" | undefined;
750
886
  tags?: string[] | undefined;
887
+ confidence?: number | undefined;
751
888
  }, {
752
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
889
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
753
890
  ts: number;
754
891
  content: string;
755
892
  raw?: unknown;
756
893
  significance?: "low" | "medium" | "high" | "critical" | undefined;
757
894
  tags?: string[] | undefined;
895
+ confidence?: number | undefined;
758
896
  }>;
759
897
  type TrajectoryEventSchema = z.infer<typeof TrajectoryEventSchema>;
760
898
  /**
@@ -768,25 +906,28 @@ declare const ChapterSchema: z.ZodObject<{
768
906
  endedAt: z.ZodOptional<z.ZodString>;
769
907
  events: z.ZodArray<z.ZodObject<{
770
908
  ts: z.ZodNumber;
771
- type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "note", "error"]>;
909
+ type: z.ZodEnum<["prompt", "thinking", "tool_call", "tool_result", "message_sent", "message_received", "decision", "finding", "note", "error"]>;
772
910
  content: z.ZodString;
773
911
  raw: z.ZodOptional<z.ZodUnknown>;
774
912
  significance: z.ZodOptional<z.ZodEnum<["low", "medium", "high", "critical"]>>;
775
913
  tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
914
+ confidence: z.ZodOptional<z.ZodNumber>;
776
915
  }, "strip", z.ZodTypeAny, {
777
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
916
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
778
917
  ts: number;
779
918
  content: string;
780
919
  raw?: unknown;
781
920
  significance?: "low" | "medium" | "high" | "critical" | undefined;
782
921
  tags?: string[] | undefined;
922
+ confidence?: number | undefined;
783
923
  }, {
784
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
924
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
785
925
  ts: number;
786
926
  content: string;
787
927
  raw?: unknown;
788
928
  significance?: "low" | "medium" | "high" | "critical" | undefined;
789
929
  tags?: string[] | undefined;
930
+ confidence?: number | undefined;
790
931
  }>, "many">;
791
932
  }, "strip", z.ZodTypeAny, {
792
933
  id: string;
@@ -794,12 +935,13 @@ declare const ChapterSchema: z.ZodObject<{
794
935
  agentName: string;
795
936
  startedAt: string;
796
937
  events: {
797
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
938
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
798
939
  ts: number;
799
940
  content: string;
800
941
  raw?: unknown;
801
942
  significance?: "low" | "medium" | "high" | "critical" | undefined;
802
943
  tags?: string[] | undefined;
944
+ confidence?: number | undefined;
803
945
  }[];
804
946
  endedAt?: string | undefined;
805
947
  }, {
@@ -808,12 +950,13 @@ declare const ChapterSchema: z.ZodObject<{
808
950
  agentName: string;
809
951
  startedAt: string;
810
952
  events: {
811
- type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "note" | "error";
953
+ type: "prompt" | "thinking" | "tool_call" | "tool_result" | "message_sent" | "message_received" | "decision" | "finding" | "note" | "error";
812
954
  ts: number;
813
955
  content: string;
814
956
  raw?: unknown;
815
957
  significance?: "low" | "medium" | "high" | "critical" | undefined;
816
958
  tags?: string[] | undefined;
959
+ confidence?: number | undefined;
817
960
  }[];
818
961
  endedAt?: string | undefined;
819
962
  }>;
@@ -827,18 +970,36 @@ declare const RetrospectiveSchema: z.ZodObject<{
827
970
  decisions: z.ZodOptional<z.ZodArray<z.ZodObject<{
828
971
  question: z.ZodString;
829
972
  chosen: z.ZodString;
830
- alternatives: z.ZodArray<z.ZodString, "many">;
973
+ alternatives: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
974
+ option: z.ZodString;
975
+ reason: z.ZodOptional<z.ZodString>;
976
+ }, "strip", z.ZodTypeAny, {
977
+ option: string;
978
+ reason?: string | undefined;
979
+ }, {
980
+ option: string;
981
+ reason?: string | undefined;
982
+ }>]>, "many">;
831
983
  reasoning: z.ZodString;
984
+ confidence: z.ZodOptional<z.ZodNumber>;
832
985
  }, "strip", z.ZodTypeAny, {
833
986
  question: string;
834
987
  chosen: string;
835
- alternatives: string[];
988
+ alternatives: (string | {
989
+ option: string;
990
+ reason?: string | undefined;
991
+ })[];
836
992
  reasoning: string;
993
+ confidence?: number | undefined;
837
994
  }, {
838
995
  question: string;
839
996
  chosen: string;
840
- alternatives: string[];
997
+ alternatives: (string | {
998
+ option: string;
999
+ reason?: string | undefined;
1000
+ })[];
841
1001
  reasoning: string;
1002
+ confidence?: number | undefined;
842
1003
  }>, "many">>;
843
1004
  challenges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
844
1005
  learnings: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -846,28 +1007,36 @@ declare const RetrospectiveSchema: z.ZodObject<{
846
1007
  confidence: z.ZodNumber;
847
1008
  timeSpent: z.ZodOptional<z.ZodString>;
848
1009
  }, "strip", z.ZodTypeAny, {
1010
+ confidence: number;
849
1011
  summary: string;
850
1012
  approach: string;
851
- confidence: number;
852
1013
  decisions?: {
853
1014
  question: string;
854
1015
  chosen: string;
855
- alternatives: string[];
1016
+ alternatives: (string | {
1017
+ option: string;
1018
+ reason?: string | undefined;
1019
+ })[];
856
1020
  reasoning: string;
1021
+ confidence?: number | undefined;
857
1022
  }[] | undefined;
858
1023
  challenges?: string[] | undefined;
859
1024
  learnings?: string[] | undefined;
860
1025
  suggestions?: string[] | undefined;
861
1026
  timeSpent?: string | undefined;
862
1027
  }, {
1028
+ confidence: number;
863
1029
  summary: string;
864
1030
  approach: string;
865
- confidence: number;
866
1031
  decisions?: {
867
1032
  question: string;
868
1033
  chosen: string;
869
- alternatives: string[];
1034
+ alternatives: (string | {
1035
+ option: string;
1036
+ reason?: string | undefined;
1037
+ })[];
870
1038
  reasoning: string;
1039
+ confidence?: number | undefined;
871
1040
  }[] | undefined;
872
1041
  challenges?: string[] | undefined;
873
1042
  learnings?: string[] | undefined;
package/dist/index.js CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  validateCompleteInput,
24
24
  validateCreateInput,
25
25
  validateTrajectory
26
- } from "./chunk-2NBMLFIW.js";
26
+ } from "./chunk-DX4OPGH7.js";
27
27
 
28
28
  // src/export/pr-summary.ts
29
29
  function exportToPRSummary(trajectory, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-trajectories",
3
- "version": "0.2.3",
3
+ "version": "0.3.0",
4
4
  "description": "Capture the complete train of thought of agent work as first-class artifacts",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,6 +29,10 @@
29
29
  ],
30
30
  "author": "",
31
31
  "license": "MIT",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/AgentWorkforce/trajectories"
35
+ },
32
36
  "files": [
33
37
  "dist"
34
38
  ],