@miradorlabs/web-grpc 3.46.0 → 3.47.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.
@@ -346,6 +346,450 @@ export function aISessionComplexityToJSON(object: AISessionComplexity): string {
346
346
  }
347
347
  }
348
348
 
349
+ /**
350
+ * AISessionOutcome is whether a session delivered what was asked, as a model graded it (MIR-495). ClickHouse stores
351
+ * the number (ai_session_scores.Outcome); a retired value stays here, deprecated and never renumbered.
352
+ */
353
+ export enum AISessionOutcome {
354
+ /** AI_SESSION_OUTCOME_UNSPECIFIED - not graded yet */
355
+ AI_SESSION_OUTCOME_UNSPECIFIED = 0,
356
+ AI_SESSION_OUTCOME_DELIVERED = 1,
357
+ AI_SESSION_OUTCOME_PARTIAL = 2,
358
+ AI_SESSION_OUTCOME_ABANDONED = 3,
359
+ /** AI_SESSION_OUTCOME_UNCLEAR - the session does not show whether the work was delivered */
360
+ AI_SESSION_OUTCOME_UNCLEAR = 4,
361
+ UNRECOGNIZED = -1,
362
+ }
363
+
364
+ export function aISessionOutcomeFromJSON(object: any): AISessionOutcome {
365
+ switch (object) {
366
+ case 0:
367
+ case "AI_SESSION_OUTCOME_UNSPECIFIED":
368
+ return AISessionOutcome.AI_SESSION_OUTCOME_UNSPECIFIED;
369
+ case 1:
370
+ case "AI_SESSION_OUTCOME_DELIVERED":
371
+ return AISessionOutcome.AI_SESSION_OUTCOME_DELIVERED;
372
+ case 2:
373
+ case "AI_SESSION_OUTCOME_PARTIAL":
374
+ return AISessionOutcome.AI_SESSION_OUTCOME_PARTIAL;
375
+ case 3:
376
+ case "AI_SESSION_OUTCOME_ABANDONED":
377
+ return AISessionOutcome.AI_SESSION_OUTCOME_ABANDONED;
378
+ case 4:
379
+ case "AI_SESSION_OUTCOME_UNCLEAR":
380
+ return AISessionOutcome.AI_SESSION_OUTCOME_UNCLEAR;
381
+ case -1:
382
+ case "UNRECOGNIZED":
383
+ default:
384
+ return AISessionOutcome.UNRECOGNIZED;
385
+ }
386
+ }
387
+
388
+ export function aISessionOutcomeToJSON(object: AISessionOutcome): string {
389
+ switch (object) {
390
+ case AISessionOutcome.AI_SESSION_OUTCOME_UNSPECIFIED:
391
+ return "AI_SESSION_OUTCOME_UNSPECIFIED";
392
+ case AISessionOutcome.AI_SESSION_OUTCOME_DELIVERED:
393
+ return "AI_SESSION_OUTCOME_DELIVERED";
394
+ case AISessionOutcome.AI_SESSION_OUTCOME_PARTIAL:
395
+ return "AI_SESSION_OUTCOME_PARTIAL";
396
+ case AISessionOutcome.AI_SESSION_OUTCOME_ABANDONED:
397
+ return "AI_SESSION_OUTCOME_ABANDONED";
398
+ case AISessionOutcome.AI_SESSION_OUTCOME_UNCLEAR:
399
+ return "AI_SESSION_OUTCOME_UNCLEAR";
400
+ case AISessionOutcome.UNRECOGNIZED:
401
+ default:
402
+ return "UNRECOGNIZED";
403
+ }
404
+ }
405
+
406
+ /**
407
+ * AISessionSteeringLoad is how much the person had to correct or redirect the agent. Stored as
408
+ * ai_session_scores.SteeringLoad; retired values stay, deprecated.
409
+ */
410
+ export enum AISessionSteeringLoad {
411
+ /** AI_SESSION_STEERING_LOAD_UNSPECIFIED - not graded */
412
+ AI_SESSION_STEERING_LOAD_UNSPECIFIED = 0,
413
+ AI_SESSION_STEERING_LOAD_NONE = 1,
414
+ AI_SESSION_STEERING_LOAD_LIGHT = 2,
415
+ AI_SESSION_STEERING_LOAD_HEAVY = 3,
416
+ UNRECOGNIZED = -1,
417
+ }
418
+
419
+ export function aISessionSteeringLoadFromJSON(object: any): AISessionSteeringLoad {
420
+ switch (object) {
421
+ case 0:
422
+ case "AI_SESSION_STEERING_LOAD_UNSPECIFIED":
423
+ return AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_UNSPECIFIED;
424
+ case 1:
425
+ case "AI_SESSION_STEERING_LOAD_NONE":
426
+ return AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_NONE;
427
+ case 2:
428
+ case "AI_SESSION_STEERING_LOAD_LIGHT":
429
+ return AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_LIGHT;
430
+ case 3:
431
+ case "AI_SESSION_STEERING_LOAD_HEAVY":
432
+ return AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_HEAVY;
433
+ case -1:
434
+ case "UNRECOGNIZED":
435
+ default:
436
+ return AISessionSteeringLoad.UNRECOGNIZED;
437
+ }
438
+ }
439
+
440
+ export function aISessionSteeringLoadToJSON(object: AISessionSteeringLoad): string {
441
+ switch (object) {
442
+ case AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_UNSPECIFIED:
443
+ return "AI_SESSION_STEERING_LOAD_UNSPECIFIED";
444
+ case AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_NONE:
445
+ return "AI_SESSION_STEERING_LOAD_NONE";
446
+ case AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_LIGHT:
447
+ return "AI_SESSION_STEERING_LOAD_LIGHT";
448
+ case AISessionSteeringLoad.AI_SESSION_STEERING_LOAD_HEAVY:
449
+ return "AI_SESSION_STEERING_LOAD_HEAVY";
450
+ case AISessionSteeringLoad.UNRECOGNIZED:
451
+ default:
452
+ return "UNRECOGNIZED";
453
+ }
454
+ }
455
+
456
+ /**
457
+ * AISessionAgentReliability is how well the agent kept to what it was asked and allowed to do. Stored as
458
+ * ai_session_scores.AgentReliability; retired values stay, deprecated.
459
+ */
460
+ export enum AISessionAgentReliability {
461
+ /** AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED - not graded */
462
+ AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED = 0,
463
+ AI_SESSION_AGENT_RELIABILITY_CLEAN = 1,
464
+ AI_SESSION_AGENT_RELIABILITY_MINOR_ISSUES = 2,
465
+ /** AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION - did something the person had ruled out */
466
+ AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION = 3,
467
+ AI_SESSION_AGENT_RELIABILITY_MAJOR_FAILURE = 4,
468
+ UNRECOGNIZED = -1,
469
+ }
470
+
471
+ export function aISessionAgentReliabilityFromJSON(object: any): AISessionAgentReliability {
472
+ switch (object) {
473
+ case 0:
474
+ case "AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED":
475
+ return AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED;
476
+ case 1:
477
+ case "AI_SESSION_AGENT_RELIABILITY_CLEAN":
478
+ return AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_CLEAN;
479
+ case 2:
480
+ case "AI_SESSION_AGENT_RELIABILITY_MINOR_ISSUES":
481
+ return AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_MINOR_ISSUES;
482
+ case 3:
483
+ case "AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION":
484
+ return AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION;
485
+ case 4:
486
+ case "AI_SESSION_AGENT_RELIABILITY_MAJOR_FAILURE":
487
+ return AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_MAJOR_FAILURE;
488
+ case -1:
489
+ case "UNRECOGNIZED":
490
+ default:
491
+ return AISessionAgentReliability.UNRECOGNIZED;
492
+ }
493
+ }
494
+
495
+ export function aISessionAgentReliabilityToJSON(object: AISessionAgentReliability): string {
496
+ switch (object) {
497
+ case AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED:
498
+ return "AI_SESSION_AGENT_RELIABILITY_UNSPECIFIED";
499
+ case AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_CLEAN:
500
+ return "AI_SESSION_AGENT_RELIABILITY_CLEAN";
501
+ case AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_MINOR_ISSUES:
502
+ return "AI_SESSION_AGENT_RELIABILITY_MINOR_ISSUES";
503
+ case AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION:
504
+ return "AI_SESSION_AGENT_RELIABILITY_CONSTRAINT_VIOLATION";
505
+ case AISessionAgentReliability.AI_SESSION_AGENT_RELIABILITY_MAJOR_FAILURE:
506
+ return "AI_SESSION_AGENT_RELIABILITY_MAJOR_FAILURE";
507
+ case AISessionAgentReliability.UNRECOGNIZED:
508
+ default:
509
+ return "UNRECOGNIZED";
510
+ }
511
+ }
512
+
513
+ /**
514
+ * AISessionVerification is whether the agent's work was checked (tests run, output inspected). Stored as
515
+ * ai_session_scores.Verification; retired values stay, deprecated.
516
+ */
517
+ export enum AISessionVerification {
518
+ /** AI_SESSION_VERIFICATION_UNSPECIFIED - not graded */
519
+ AI_SESSION_VERIFICATION_UNSPECIFIED = 0,
520
+ AI_SESSION_VERIFICATION_VERIFIED = 1,
521
+ /** AI_SESSION_VERIFICATION_CLAIMED_ONLY - the agent said it worked without showing it */
522
+ AI_SESSION_VERIFICATION_CLAIMED_ONLY = 2,
523
+ /** AI_SESSION_VERIFICATION_NOT_APPLICABLE - nothing to verify (a question, a review) */
524
+ AI_SESSION_VERIFICATION_NOT_APPLICABLE = 3,
525
+ /** AI_SESSION_VERIFICATION_UNOBSERVED - something to verify, but the session does not show whether it was */
526
+ AI_SESSION_VERIFICATION_UNOBSERVED = 4,
527
+ UNRECOGNIZED = -1,
528
+ }
529
+
530
+ export function aISessionVerificationFromJSON(object: any): AISessionVerification {
531
+ switch (object) {
532
+ case 0:
533
+ case "AI_SESSION_VERIFICATION_UNSPECIFIED":
534
+ return AISessionVerification.AI_SESSION_VERIFICATION_UNSPECIFIED;
535
+ case 1:
536
+ case "AI_SESSION_VERIFICATION_VERIFIED":
537
+ return AISessionVerification.AI_SESSION_VERIFICATION_VERIFIED;
538
+ case 2:
539
+ case "AI_SESSION_VERIFICATION_CLAIMED_ONLY":
540
+ return AISessionVerification.AI_SESSION_VERIFICATION_CLAIMED_ONLY;
541
+ case 3:
542
+ case "AI_SESSION_VERIFICATION_NOT_APPLICABLE":
543
+ return AISessionVerification.AI_SESSION_VERIFICATION_NOT_APPLICABLE;
544
+ case 4:
545
+ case "AI_SESSION_VERIFICATION_UNOBSERVED":
546
+ return AISessionVerification.AI_SESSION_VERIFICATION_UNOBSERVED;
547
+ case -1:
548
+ case "UNRECOGNIZED":
549
+ default:
550
+ return AISessionVerification.UNRECOGNIZED;
551
+ }
552
+ }
553
+
554
+ export function aISessionVerificationToJSON(object: AISessionVerification): string {
555
+ switch (object) {
556
+ case AISessionVerification.AI_SESSION_VERIFICATION_UNSPECIFIED:
557
+ return "AI_SESSION_VERIFICATION_UNSPECIFIED";
558
+ case AISessionVerification.AI_SESSION_VERIFICATION_VERIFIED:
559
+ return "AI_SESSION_VERIFICATION_VERIFIED";
560
+ case AISessionVerification.AI_SESSION_VERIFICATION_CLAIMED_ONLY:
561
+ return "AI_SESSION_VERIFICATION_CLAIMED_ONLY";
562
+ case AISessionVerification.AI_SESSION_VERIFICATION_NOT_APPLICABLE:
563
+ return "AI_SESSION_VERIFICATION_NOT_APPLICABLE";
564
+ case AISessionVerification.AI_SESSION_VERIFICATION_UNOBSERVED:
565
+ return "AI_SESSION_VERIFICATION_UNOBSERVED";
566
+ case AISessionVerification.UNRECOGNIZED:
567
+ default:
568
+ return "UNRECOGNIZED";
569
+ }
570
+ }
571
+
572
+ /**
573
+ * AISessionInsightCategory is the kind of problem an insight names. Stored per insight in
574
+ * ai_session_insights.Insights (Category); retired values stay, deprecated.
575
+ */
576
+ export enum AISessionInsightCategory {
577
+ /** AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED - never stored */
578
+ AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED = 0,
579
+ AI_SESSION_INSIGHT_CATEGORY_CONSTRAINT_VIOLATION = 1,
580
+ AI_SESSION_INSIGHT_CATEGORY_MISREAD_REQUEST = 2,
581
+ AI_SESSION_INSIGHT_CATEGORY_REPEATED_CORRECTION = 3,
582
+ AI_SESSION_INSIGHT_CATEGORY_LOOPING = 4,
583
+ AI_SESSION_INSIGHT_CATEGORY_VERIFICATION_GAP = 5,
584
+ AI_SESSION_INSIGHT_CATEGORY_MISSING_CONTEXT = 6,
585
+ AI_SESSION_INSIGHT_CATEGORY_TOOLING_FAILURE = 7,
586
+ AI_SESSION_INSIGHT_CATEGORY_SCOPE_CREEP = 8,
587
+ AI_SESSION_INSIGHT_CATEGORY_MANUAL_WORKFLOW = 9,
588
+ UNRECOGNIZED = -1,
589
+ }
590
+
591
+ export function aISessionInsightCategoryFromJSON(object: any): AISessionInsightCategory {
592
+ switch (object) {
593
+ case 0:
594
+ case "AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED":
595
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED;
596
+ case 1:
597
+ case "AI_SESSION_INSIGHT_CATEGORY_CONSTRAINT_VIOLATION":
598
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_CONSTRAINT_VIOLATION;
599
+ case 2:
600
+ case "AI_SESSION_INSIGHT_CATEGORY_MISREAD_REQUEST":
601
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MISREAD_REQUEST;
602
+ case 3:
603
+ case "AI_SESSION_INSIGHT_CATEGORY_REPEATED_CORRECTION":
604
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_REPEATED_CORRECTION;
605
+ case 4:
606
+ case "AI_SESSION_INSIGHT_CATEGORY_LOOPING":
607
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_LOOPING;
608
+ case 5:
609
+ case "AI_SESSION_INSIGHT_CATEGORY_VERIFICATION_GAP":
610
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_VERIFICATION_GAP;
611
+ case 6:
612
+ case "AI_SESSION_INSIGHT_CATEGORY_MISSING_CONTEXT":
613
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MISSING_CONTEXT;
614
+ case 7:
615
+ case "AI_SESSION_INSIGHT_CATEGORY_TOOLING_FAILURE":
616
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_TOOLING_FAILURE;
617
+ case 8:
618
+ case "AI_SESSION_INSIGHT_CATEGORY_SCOPE_CREEP":
619
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_SCOPE_CREEP;
620
+ case 9:
621
+ case "AI_SESSION_INSIGHT_CATEGORY_MANUAL_WORKFLOW":
622
+ return AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MANUAL_WORKFLOW;
623
+ case -1:
624
+ case "UNRECOGNIZED":
625
+ default:
626
+ return AISessionInsightCategory.UNRECOGNIZED;
627
+ }
628
+ }
629
+
630
+ export function aISessionInsightCategoryToJSON(object: AISessionInsightCategory): string {
631
+ switch (object) {
632
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED:
633
+ return "AI_SESSION_INSIGHT_CATEGORY_UNSPECIFIED";
634
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_CONSTRAINT_VIOLATION:
635
+ return "AI_SESSION_INSIGHT_CATEGORY_CONSTRAINT_VIOLATION";
636
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MISREAD_REQUEST:
637
+ return "AI_SESSION_INSIGHT_CATEGORY_MISREAD_REQUEST";
638
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_REPEATED_CORRECTION:
639
+ return "AI_SESSION_INSIGHT_CATEGORY_REPEATED_CORRECTION";
640
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_LOOPING:
641
+ return "AI_SESSION_INSIGHT_CATEGORY_LOOPING";
642
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_VERIFICATION_GAP:
643
+ return "AI_SESSION_INSIGHT_CATEGORY_VERIFICATION_GAP";
644
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MISSING_CONTEXT:
645
+ return "AI_SESSION_INSIGHT_CATEGORY_MISSING_CONTEXT";
646
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_TOOLING_FAILURE:
647
+ return "AI_SESSION_INSIGHT_CATEGORY_TOOLING_FAILURE";
648
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_SCOPE_CREEP:
649
+ return "AI_SESSION_INSIGHT_CATEGORY_SCOPE_CREEP";
650
+ case AISessionInsightCategory.AI_SESSION_INSIGHT_CATEGORY_MANUAL_WORKFLOW:
651
+ return "AI_SESSION_INSIGHT_CATEGORY_MANUAL_WORKFLOW";
652
+ case AISessionInsightCategory.UNRECOGNIZED:
653
+ default:
654
+ return "UNRECOGNIZED";
655
+ }
656
+ }
657
+
658
+ /**
659
+ * AISessionInsightActionType is the kind of change an insight recommends: an insight always recommends one, and a
660
+ * session with nothing to change has no insights. Stored per insight in
661
+ * ai_session_insights.Insights (ActionType); retired values stay, deprecated.
662
+ */
663
+ export enum AISessionInsightActionType {
664
+ /** AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED - never stored */
665
+ AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED = 0,
666
+ AI_SESSION_INSIGHT_ACTION_TYPE_ADD_RULE = 1,
667
+ AI_SESSION_INSIGHT_ACTION_TYPE_ADD_SKILL = 2,
668
+ AI_SESSION_INSIGHT_ACTION_TYPE_USE_EXISTING_SKILL = 3,
669
+ AI_SESSION_INSIGHT_ACTION_TYPE_CHANGE_MODEL = 4,
670
+ AI_SESSION_INSIGHT_ACTION_TYPE_CLARIFY_PROMPTS = 5,
671
+ AI_SESSION_INSIGHT_ACTION_TYPE_FIX_TOOLING = 6,
672
+ UNRECOGNIZED = -1,
673
+ }
674
+
675
+ export function aISessionInsightActionTypeFromJSON(object: any): AISessionInsightActionType {
676
+ switch (object) {
677
+ case 0:
678
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED":
679
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED;
680
+ case 1:
681
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_ADD_RULE":
682
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_ADD_RULE;
683
+ case 2:
684
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_ADD_SKILL":
685
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_ADD_SKILL;
686
+ case 3:
687
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_USE_EXISTING_SKILL":
688
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_USE_EXISTING_SKILL;
689
+ case 4:
690
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_CHANGE_MODEL":
691
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_CHANGE_MODEL;
692
+ case 5:
693
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_CLARIFY_PROMPTS":
694
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_CLARIFY_PROMPTS;
695
+ case 6:
696
+ case "AI_SESSION_INSIGHT_ACTION_TYPE_FIX_TOOLING":
697
+ return AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_FIX_TOOLING;
698
+ case -1:
699
+ case "UNRECOGNIZED":
700
+ default:
701
+ return AISessionInsightActionType.UNRECOGNIZED;
702
+ }
703
+ }
704
+
705
+ export function aISessionInsightActionTypeToJSON(object: AISessionInsightActionType): string {
706
+ switch (object) {
707
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED:
708
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_UNSPECIFIED";
709
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_ADD_RULE:
710
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_ADD_RULE";
711
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_ADD_SKILL:
712
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_ADD_SKILL";
713
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_USE_EXISTING_SKILL:
714
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_USE_EXISTING_SKILL";
715
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_CHANGE_MODEL:
716
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_CHANGE_MODEL";
717
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_CLARIFY_PROMPTS:
718
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_CLARIFY_PROMPTS";
719
+ case AISessionInsightActionType.AI_SESSION_INSIGHT_ACTION_TYPE_FIX_TOOLING:
720
+ return "AI_SESSION_INSIGHT_ACTION_TYPE_FIX_TOOLING";
721
+ case AISessionInsightActionType.UNRECOGNIZED:
722
+ default:
723
+ return "UNRECOGNIZED";
724
+ }
725
+ }
726
+
727
+ /** AISessionScoreComponentKind names one part of a session score's formula (AISessionScore). */
728
+ export enum AISessionScoreComponentKind {
729
+ AI_SESSION_SCORE_COMPONENT_KIND_UNSPECIFIED = 0,
730
+ AI_SESSION_SCORE_COMPONENT_KIND_OUTCOME = 1,
731
+ AI_SESSION_SCORE_COMPONENT_KIND_STEERING_LOAD = 2,
732
+ AI_SESSION_SCORE_COMPONENT_KIND_AGENT_RELIABILITY = 3,
733
+ AI_SESSION_SCORE_COMPONENT_KIND_VERIFICATION = 4,
734
+ /** AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND - 1 minus the share of the session's spend after its first correction (MIR-469 prompt scores). */
735
+ AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND = 5,
736
+ /** AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY - The mean clarity of the session's scored prompts (MIR-469 prompt scores). */
737
+ AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY = 6,
738
+ UNRECOGNIZED = -1,
739
+ }
740
+
741
+ export function aISessionScoreComponentKindFromJSON(object: any): AISessionScoreComponentKind {
742
+ switch (object) {
743
+ case 0:
744
+ case "AI_SESSION_SCORE_COMPONENT_KIND_UNSPECIFIED":
745
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_UNSPECIFIED;
746
+ case 1:
747
+ case "AI_SESSION_SCORE_COMPONENT_KIND_OUTCOME":
748
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_OUTCOME;
749
+ case 2:
750
+ case "AI_SESSION_SCORE_COMPONENT_KIND_STEERING_LOAD":
751
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_STEERING_LOAD;
752
+ case 3:
753
+ case "AI_SESSION_SCORE_COMPONENT_KIND_AGENT_RELIABILITY":
754
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_AGENT_RELIABILITY;
755
+ case 4:
756
+ case "AI_SESSION_SCORE_COMPONENT_KIND_VERIFICATION":
757
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_VERIFICATION;
758
+ case 5:
759
+ case "AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND":
760
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND;
761
+ case 6:
762
+ case "AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY":
763
+ return AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY;
764
+ case -1:
765
+ case "UNRECOGNIZED":
766
+ default:
767
+ return AISessionScoreComponentKind.UNRECOGNIZED;
768
+ }
769
+ }
770
+
771
+ export function aISessionScoreComponentKindToJSON(object: AISessionScoreComponentKind): string {
772
+ switch (object) {
773
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_UNSPECIFIED:
774
+ return "AI_SESSION_SCORE_COMPONENT_KIND_UNSPECIFIED";
775
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_OUTCOME:
776
+ return "AI_SESSION_SCORE_COMPONENT_KIND_OUTCOME";
777
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_STEERING_LOAD:
778
+ return "AI_SESSION_SCORE_COMPONENT_KIND_STEERING_LOAD";
779
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_AGENT_RELIABILITY:
780
+ return "AI_SESSION_SCORE_COMPONENT_KIND_AGENT_RELIABILITY";
781
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_VERIFICATION:
782
+ return "AI_SESSION_SCORE_COMPONENT_KIND_VERIFICATION";
783
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND:
784
+ return "AI_SESSION_SCORE_COMPONENT_KIND_REWORK_SPEND";
785
+ case AISessionScoreComponentKind.AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY:
786
+ return "AI_SESSION_SCORE_COMPONENT_KIND_PROMPT_CLARITY";
787
+ case AISessionScoreComponentKind.UNRECOGNIZED:
788
+ default:
789
+ return "UNRECOGNIZED";
790
+ }
791
+ }
792
+
349
793
  export enum AIGitAction {
350
794
  AI_GIT_ACTION_UNSPECIFIED = 0,
351
795
  AI_GIT_ACTION_BRANCH_CREATE = 1,
@@ -1239,6 +1683,16 @@ export interface AISessionSummary {
1239
1683
  workType: AISessionWorkType;
1240
1684
  /** The session's size from the same label; UNSPECIFIED when it has no label. */
1241
1685
  complexity: AISessionComplexity;
1686
+ /**
1687
+ * The session's score (0-100, AISessionScore) under the current formula, from its latest grades; absent when it is
1688
+ * not scored: not graded yet, graded from an older session_version, or a grade is missing. GetSessionAnalysis has
1689
+ * the breakdown and the formula version.
1690
+ */
1691
+ sessionScore?:
1692
+ | number
1693
+ | undefined;
1694
+ /** The outcome its latest grades give when they were read from the current session_version; UNSPECIFIED otherwise. */
1695
+ outcome: AISessionOutcome;
1242
1696
  }
1243
1697
 
1244
1698
  export interface StreamSessionsRequest {
@@ -2255,6 +2709,189 @@ export interface SessionGitBucket {
2255
2709
  count: number;
2256
2710
  }
2257
2711
 
2712
+ export interface GetSessionAnalysisRequest {
2713
+ organizationId: string;
2714
+ projectId: string;
2715
+ /** source_system + session_id are the session identity. */
2716
+ sourceSystem: string;
2717
+ sessionId: string;
2718
+ }
2719
+
2720
+ /**
2721
+ * GetSessionAnalysisResponse holds what each analysis job has written for the session. A part is absent while its
2722
+ * job has not graded or analysed the session (or no such session is in the project), never defaulted.
2723
+ */
2724
+ export interface GetSessionAnalysisResponse {
2725
+ status:
2726
+ | ResponseStatus
2727
+ | undefined;
2728
+ /** The session's latest rubric grades (ai_session_scores). */
2729
+ grades:
2730
+ | AISessionGrades
2731
+ | undefined;
2732
+ /**
2733
+ * The score recomputed from grades on this read; absent with them, when they were graded from an older
2734
+ * session_version than the session's current one, or when a grade is UNSPECIFIED or unknown to the formula.
2735
+ */
2736
+ score:
2737
+ | AISessionScore
2738
+ | undefined;
2739
+ /** The session's latest insights (ai_session_insights); present with no insights when it ran and found nothing. */
2740
+ insights:
2741
+ | AISessionInsights
2742
+ | undefined;
2743
+ /**
2744
+ * The session's current session_version, to set against each part's input_session_version; absent, with every
2745
+ * other part, when the project has no such session.
2746
+ */
2747
+ sessionVersion?: number | undefined;
2748
+ }
2749
+
2750
+ /** AISessionGrades is the rubric a model graded the session on. scored_at with version is its identity. */
2751
+ export interface AISessionGrades {
2752
+ outcome: AISessionOutcome;
2753
+ steeringLoad: AISessionSteeringLoad;
2754
+ agentReliability: AISessionAgentReliability;
2755
+ verification: AISessionVerification;
2756
+ /** The model that graded it and the scoring task's version. */
2757
+ model: string;
2758
+ version: string;
2759
+ /** The session_version (AISessionSummary.session_version) the grading read. */
2760
+ inputSessionVersion: number;
2761
+ /** When the scoring run selected the session. */
2762
+ scoredAt: Date | undefined;
2763
+ }
2764
+
2765
+ /** AISessionInsights is what a model found to change in the session. analyzed_at with version is its identity. */
2766
+ export interface AISessionInsights {
2767
+ /** Zero to three insights in the model's order; empty is a session with nothing to change. */
2768
+ insights: AISessionInsight[];
2769
+ /** The model that analysed it and the insight task's version. */
2770
+ model: string;
2771
+ version: string;
2772
+ /** The session_version (AISessionSummary.session_version) the analysis read. */
2773
+ inputSessionVersion: number;
2774
+ /** When the insights run selected the session. */
2775
+ analyzedAt: Date | undefined;
2776
+ }
2777
+
2778
+ /**
2779
+ * AISessionInsight is one problem a model found in the session and the change it recommends. cause and action are
2780
+ * model-written text of at most 300 runes about this session alone, returned only to readers of the session's
2781
+ * project; they never name a person by design, which the model is told and nothing checks.
2782
+ */
2783
+ export interface AISessionInsight {
2784
+ category: AISessionInsightCategory;
2785
+ actionType: AISessionInsightActionType;
2786
+ /** The session's events the insight cites, in the model's order. Quote them from the stored events. */
2787
+ evidenceRefs: AISessionEventRef[];
2788
+ cause: string;
2789
+ action: string;
2790
+ }
2791
+
2792
+ /**
2793
+ * AISessionEventRef names one of a session's events by its stored identity within the session (ai_events'
2794
+ * EventType, EventSubtype and EventKey, e.g. message / user / <key>).
2795
+ */
2796
+ export interface AISessionEventRef {
2797
+ eventType: string;
2798
+ eventSubtype: string;
2799
+ eventKey: string;
2800
+ }
2801
+
2802
+ /**
2803
+ * AISessionScore is a session's 0-100 score, computed from its grades on every read and never stored. Each
2804
+ * component's value (0-1) is weighted; a component without an input is unavailable and its weight is spread over the
2805
+ * available ones in proportion, except verification NOT_APPLICABLE, whose weight moves to outcome while outcome is
2806
+ * available. score is the sum of the contributions rounded half away from zero.
2807
+ */
2808
+ export interface AISessionScore {
2809
+ /** The formula, "score-v1"; a changed weight or rule is a new version. */
2810
+ formulaVersion: string;
2811
+ score: number;
2812
+ /** Every component of the formula, available or not, in the formula's order. */
2813
+ components: AISessionScoreComponent[];
2814
+ /** The grades it was computed from: their scoring task's version, the session_version they read and when. */
2815
+ scoreVersion: string;
2816
+ inputSessionVersion: number;
2817
+ scoredAt: Date | undefined;
2818
+ }
2819
+
2820
+ export interface AISessionScoreComponent {
2821
+ kind: AISessionScoreComponentKind;
2822
+ /**
2823
+ * False when the component had no input: outcome UNCLEAR, verification UNOBSERVED or NOT_APPLICABLE, or no prompt
2824
+ * scores (rework spend and prompt clarity, not computed yet).
2825
+ */
2826
+ available: boolean;
2827
+ /** The formula's weight for the component (points out of 100). */
2828
+ baseWeight: number;
2829
+ /** The weight it carried in this score once unavailable weight was moved; 0 when unavailable. */
2830
+ weight: number;
2831
+ /** The component's value, 0-1; absent when unavailable. */
2832
+ value?:
2833
+ | number
2834
+ | undefined;
2835
+ /** weight x value: the points it added. */
2836
+ contribution: number;
2837
+ }
2838
+
2839
+ export interface GetSessionScoreTrendRequest {
2840
+ organizationId: string;
2841
+ projectId: string;
2842
+ /** The first ISO week as its Monday, YYYY-MM-DD (UTC); any other day is INVALID_ARGUMENT. */
2843
+ startWeek: string;
2844
+ /** How many weeks from start_week, 1 to 53. */
2845
+ weeks: number;
2846
+ /** Which of the project's sessions to roll up; unset rolls up the whole project. */
2847
+ filter: AISessionScoreTrendFilter | undefined;
2848
+ }
2849
+
2850
+ /**
2851
+ * AISessionScoreTrendFilter narrows the sessions a score trend rolls up. Fields AND, a repeated field matches any of
2852
+ * its values, and an unset or empty field does not filter.
2853
+ */
2854
+ export interface AISessionScoreTrendFilter {
2855
+ /**
2856
+ * The people whose sessions to roll up (AISessionSummary.user_id), at most 500; an empty id is INVALID_ARGUMENT.
2857
+ * A session that recorded no user id matches none, so it counts only toward an unfiltered trend.
2858
+ */
2859
+ userIds: string[];
2860
+ }
2861
+
2862
+ export interface GetSessionScoreTrendResponse {
2863
+ status:
2864
+ | ResponseStatus
2865
+ | undefined;
2866
+ /** The formula the scores use (AISessionScore.formula_version). */
2867
+ formulaVersion: string;
2868
+ /** One row per requested week, oldest first; a week with no graded session is present with zero counts. */
2869
+ weeks: AISessionScoreWeek[];
2870
+ }
2871
+
2872
+ /**
2873
+ * AISessionScoreWeek rolls up the graded sessions whose last activity fell in one ISO week (UTC), one latest grading
2874
+ * each, counted only when the grades were read from the session's current session_version.
2875
+ * Directional: a view of how sessions went, never a performance assessment of a person.
2876
+ */
2877
+ export interface AISessionScoreWeek {
2878
+ /** The week's Monday, YYYY-MM-DD. */
2879
+ weekStart: string;
2880
+ /** Sessions with grades read from their current session_version, and of those the ones with a score. */
2881
+ gradedSessions: number;
2882
+ scoredSessions: number;
2883
+ /** The mean score of the scored sessions; absent when none is scored. */
2884
+ meanScore?:
2885
+ | number
2886
+ | undefined;
2887
+ /**
2888
+ * Sessions whose outcome is known (DELIVERED, PARTIAL or ABANDONED; UNCLEAR is not observable), and of those the
2889
+ * DELIVERED ones: the share delivered is delivered_sessions / known_outcome_sessions.
2890
+ */
2891
+ knownOutcomeSessions: number;
2892
+ deliveredSessions: number;
2893
+ }
2894
+
2258
2895
  /** AISessionRef is a session's identity: two sources can issue the same session_id. */
2259
2896
  export interface AISessionRef {
2260
2897
  sourceSystem: string;
@@ -3599,6 +4236,8 @@ function createBaseAISessionSummary(): AISessionSummary {
3599
4236
  recap: "",
3600
4237
  workType: 0,
3601
4238
  complexity: 0,
4239
+ sessionScore: undefined,
4240
+ outcome: 0,
3602
4241
  };
3603
4242
  }
3604
4243
 
@@ -3715,6 +4354,12 @@ export const AISessionSummary: MessageFns<AISessionSummary> = {
3715
4354
  if (message.complexity !== 0) {
3716
4355
  writer.uint32(296).int32(message.complexity);
3717
4356
  }
4357
+ if (message.sessionScore !== undefined) {
4358
+ writer.uint32(304).int32(message.sessionScore);
4359
+ }
4360
+ if (message.outcome !== 0) {
4361
+ writer.uint32(312).int32(message.outcome);
4362
+ }
3718
4363
  return writer;
3719
4364
  },
3720
4365
 
@@ -4027,6 +4672,22 @@ export const AISessionSummary: MessageFns<AISessionSummary> = {
4027
4672
  message.complexity = reader.int32() as any;
4028
4673
  continue;
4029
4674
  }
4675
+ case 38: {
4676
+ if (tag !== 304) {
4677
+ break;
4678
+ }
4679
+
4680
+ message.sessionScore = reader.int32();
4681
+ continue;
4682
+ }
4683
+ case 39: {
4684
+ if (tag !== 312) {
4685
+ break;
4686
+ }
4687
+
4688
+ message.outcome = reader.int32() as any;
4689
+ continue;
4690
+ }
4030
4691
  }
4031
4692
  if ((tag & 7) === 4 || tag === 0) {
4032
4693
  break;
@@ -4182,6 +4843,12 @@ export const AISessionSummary: MessageFns<AISessionSummary> = {
4182
4843
  ? aISessionWorkTypeFromJSON(object.work_type)
4183
4844
  : 0,
4184
4845
  complexity: isSet(object.complexity) ? aISessionComplexityFromJSON(object.complexity) : 0,
4846
+ sessionScore: isSet(object.sessionScore)
4847
+ ? globalThis.Number(object.sessionScore)
4848
+ : isSet(object.session_score)
4849
+ ? globalThis.Number(object.session_score)
4850
+ : undefined,
4851
+ outcome: isSet(object.outcome) ? aISessionOutcomeFromJSON(object.outcome) : 0,
4185
4852
  };
4186
4853
  },
4187
4854
 
@@ -4298,6 +4965,12 @@ export const AISessionSummary: MessageFns<AISessionSummary> = {
4298
4965
  if (message.complexity !== 0) {
4299
4966
  obj.complexity = aISessionComplexityToJSON(message.complexity);
4300
4967
  }
4968
+ if (message.sessionScore !== undefined) {
4969
+ obj.sessionScore = Math.round(message.sessionScore);
4970
+ }
4971
+ if (message.outcome !== 0) {
4972
+ obj.outcome = aISessionOutcomeToJSON(message.outcome);
4973
+ }
4301
4974
  return obj;
4302
4975
  },
4303
4976
 
@@ -4345,6 +5018,8 @@ export const AISessionSummary: MessageFns<AISessionSummary> = {
4345
5018
  message.recap = object.recap ?? "";
4346
5019
  message.workType = object.workType ?? 0;
4347
5020
  message.complexity = object.complexity ?? 0;
5021
+ message.sessionScore = object.sessionScore ?? undefined;
5022
+ message.outcome = object.outcome ?? 0;
4348
5023
  return message;
4349
5024
  },
4350
5025
  };
@@ -17654,11 +18329,1728 @@ export const SessionGitBucket: MessageFns<SessionGitBucket> = {
17654
18329
  },
17655
18330
  };
17656
18331
 
17657
- function createBaseAISessionRef(): AISessionRef {
17658
- return { sourceSystem: "", sessionId: "" };
18332
+ function createBaseGetSessionAnalysisRequest(): GetSessionAnalysisRequest {
18333
+ return { organizationId: "", projectId: "", sourceSystem: "", sessionId: "" };
17659
18334
  }
17660
18335
 
17661
- export const AISessionRef: MessageFns<AISessionRef> = {
18336
+ export const GetSessionAnalysisRequest: MessageFns<GetSessionAnalysisRequest> = {
18337
+ encode(message: GetSessionAnalysisRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
18338
+ if (message.organizationId !== "") {
18339
+ writer.uint32(10).string(message.organizationId);
18340
+ }
18341
+ if (message.projectId !== "") {
18342
+ writer.uint32(18).string(message.projectId);
18343
+ }
18344
+ if (message.sourceSystem !== "") {
18345
+ writer.uint32(26).string(message.sourceSystem);
18346
+ }
18347
+ if (message.sessionId !== "") {
18348
+ writer.uint32(34).string(message.sessionId);
18349
+ }
18350
+ return writer;
18351
+ },
18352
+
18353
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionAnalysisRequest {
18354
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18355
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
18356
+ if (previousRecursionDepth >= 100) {
18357
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
18358
+ }
18359
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
18360
+ try {
18361
+ const end = length === undefined ? reader.len : reader.pos + length;
18362
+ const message = createBaseGetSessionAnalysisRequest();
18363
+ while (reader.pos < end) {
18364
+ const tag = reader.uint32();
18365
+ switch (tag >>> 3) {
18366
+ case 1: {
18367
+ if (tag !== 10) {
18368
+ break;
18369
+ }
18370
+
18371
+ message.organizationId = reader.string();
18372
+ continue;
18373
+ }
18374
+ case 2: {
18375
+ if (tag !== 18) {
18376
+ break;
18377
+ }
18378
+
18379
+ message.projectId = reader.string();
18380
+ continue;
18381
+ }
18382
+ case 3: {
18383
+ if (tag !== 26) {
18384
+ break;
18385
+ }
18386
+
18387
+ message.sourceSystem = reader.string();
18388
+ continue;
18389
+ }
18390
+ case 4: {
18391
+ if (tag !== 34) {
18392
+ break;
18393
+ }
18394
+
18395
+ message.sessionId = reader.string();
18396
+ continue;
18397
+ }
18398
+ }
18399
+ if ((tag & 7) === 4 || tag === 0) {
18400
+ break;
18401
+ }
18402
+ reader.skip(tag & 7);
18403
+ }
18404
+ return message;
18405
+ } finally {
18406
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
18407
+ }
18408
+ },
18409
+
18410
+ fromJSON(object: any): GetSessionAnalysisRequest {
18411
+ return {
18412
+ organizationId: isSet(object.organizationId)
18413
+ ? globalThis.String(object.organizationId)
18414
+ : isSet(object.organization_id)
18415
+ ? globalThis.String(object.organization_id)
18416
+ : "",
18417
+ projectId: isSet(object.projectId)
18418
+ ? globalThis.String(object.projectId)
18419
+ : isSet(object.project_id)
18420
+ ? globalThis.String(object.project_id)
18421
+ : "",
18422
+ sourceSystem: isSet(object.sourceSystem)
18423
+ ? globalThis.String(object.sourceSystem)
18424
+ : isSet(object.source_system)
18425
+ ? globalThis.String(object.source_system)
18426
+ : "",
18427
+ sessionId: isSet(object.sessionId)
18428
+ ? globalThis.String(object.sessionId)
18429
+ : isSet(object.session_id)
18430
+ ? globalThis.String(object.session_id)
18431
+ : "",
18432
+ };
18433
+ },
18434
+
18435
+ toJSON(message: GetSessionAnalysisRequest): unknown {
18436
+ const obj: any = {};
18437
+ if (message.organizationId !== "") {
18438
+ obj.organizationId = message.organizationId;
18439
+ }
18440
+ if (message.projectId !== "") {
18441
+ obj.projectId = message.projectId;
18442
+ }
18443
+ if (message.sourceSystem !== "") {
18444
+ obj.sourceSystem = message.sourceSystem;
18445
+ }
18446
+ if (message.sessionId !== "") {
18447
+ obj.sessionId = message.sessionId;
18448
+ }
18449
+ return obj;
18450
+ },
18451
+
18452
+ create<I extends Exact<DeepPartial<GetSessionAnalysisRequest>, I>>(base?: I): GetSessionAnalysisRequest {
18453
+ return GetSessionAnalysisRequest.fromPartial(base ?? ({} as any));
18454
+ },
18455
+ fromPartial<I extends Exact<DeepPartial<GetSessionAnalysisRequest>, I>>(object: I): GetSessionAnalysisRequest {
18456
+ const message = createBaseGetSessionAnalysisRequest();
18457
+ message.organizationId = object.organizationId ?? "";
18458
+ message.projectId = object.projectId ?? "";
18459
+ message.sourceSystem = object.sourceSystem ?? "";
18460
+ message.sessionId = object.sessionId ?? "";
18461
+ return message;
18462
+ },
18463
+ };
18464
+
18465
+ function createBaseGetSessionAnalysisResponse(): GetSessionAnalysisResponse {
18466
+ return { status: undefined, grades: undefined, score: undefined, insights: undefined, sessionVersion: undefined };
18467
+ }
18468
+
18469
+ export const GetSessionAnalysisResponse: MessageFns<GetSessionAnalysisResponse> = {
18470
+ encode(message: GetSessionAnalysisResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
18471
+ if (message.status !== undefined) {
18472
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
18473
+ }
18474
+ if (message.grades !== undefined) {
18475
+ AISessionGrades.encode(message.grades, writer.uint32(18).fork()).join();
18476
+ }
18477
+ if (message.score !== undefined) {
18478
+ AISessionScore.encode(message.score, writer.uint32(26).fork()).join();
18479
+ }
18480
+ if (message.insights !== undefined) {
18481
+ AISessionInsights.encode(message.insights, writer.uint32(34).fork()).join();
18482
+ }
18483
+ if (message.sessionVersion !== undefined) {
18484
+ writer.uint32(40).uint64(message.sessionVersion);
18485
+ }
18486
+ return writer;
18487
+ },
18488
+
18489
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionAnalysisResponse {
18490
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18491
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
18492
+ if (previousRecursionDepth >= 100) {
18493
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
18494
+ }
18495
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
18496
+ try {
18497
+ const end = length === undefined ? reader.len : reader.pos + length;
18498
+ const message = createBaseGetSessionAnalysisResponse();
18499
+ while (reader.pos < end) {
18500
+ const tag = reader.uint32();
18501
+ switch (tag >>> 3) {
18502
+ case 1: {
18503
+ if (tag !== 10) {
18504
+ break;
18505
+ }
18506
+
18507
+ message.status = ResponseStatus.decode(reader, reader.uint32());
18508
+ continue;
18509
+ }
18510
+ case 2: {
18511
+ if (tag !== 18) {
18512
+ break;
18513
+ }
18514
+
18515
+ message.grades = AISessionGrades.decode(reader, reader.uint32());
18516
+ continue;
18517
+ }
18518
+ case 3: {
18519
+ if (tag !== 26) {
18520
+ break;
18521
+ }
18522
+
18523
+ message.score = AISessionScore.decode(reader, reader.uint32());
18524
+ continue;
18525
+ }
18526
+ case 4: {
18527
+ if (tag !== 34) {
18528
+ break;
18529
+ }
18530
+
18531
+ message.insights = AISessionInsights.decode(reader, reader.uint32());
18532
+ continue;
18533
+ }
18534
+ case 5: {
18535
+ if (tag !== 40) {
18536
+ break;
18537
+ }
18538
+
18539
+ message.sessionVersion = longToNumber(reader.uint64());
18540
+ continue;
18541
+ }
18542
+ }
18543
+ if ((tag & 7) === 4 || tag === 0) {
18544
+ break;
18545
+ }
18546
+ reader.skip(tag & 7);
18547
+ }
18548
+ return message;
18549
+ } finally {
18550
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
18551
+ }
18552
+ },
18553
+
18554
+ fromJSON(object: any): GetSessionAnalysisResponse {
18555
+ return {
18556
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
18557
+ grades: isSet(object.grades) ? AISessionGrades.fromJSON(object.grades) : undefined,
18558
+ score: isSet(object.score) ? AISessionScore.fromJSON(object.score) : undefined,
18559
+ insights: isSet(object.insights) ? AISessionInsights.fromJSON(object.insights) : undefined,
18560
+ sessionVersion: isSet(object.sessionVersion)
18561
+ ? globalThis.Number(object.sessionVersion)
18562
+ : isSet(object.session_version)
18563
+ ? globalThis.Number(object.session_version)
18564
+ : undefined,
18565
+ };
18566
+ },
18567
+
18568
+ toJSON(message: GetSessionAnalysisResponse): unknown {
18569
+ const obj: any = {};
18570
+ if (message.status !== undefined) {
18571
+ obj.status = ResponseStatus.toJSON(message.status);
18572
+ }
18573
+ if (message.grades !== undefined) {
18574
+ obj.grades = AISessionGrades.toJSON(message.grades);
18575
+ }
18576
+ if (message.score !== undefined) {
18577
+ obj.score = AISessionScore.toJSON(message.score);
18578
+ }
18579
+ if (message.insights !== undefined) {
18580
+ obj.insights = AISessionInsights.toJSON(message.insights);
18581
+ }
18582
+ if (message.sessionVersion !== undefined) {
18583
+ obj.sessionVersion = Math.round(message.sessionVersion);
18584
+ }
18585
+ return obj;
18586
+ },
18587
+
18588
+ create<I extends Exact<DeepPartial<GetSessionAnalysisResponse>, I>>(base?: I): GetSessionAnalysisResponse {
18589
+ return GetSessionAnalysisResponse.fromPartial(base ?? ({} as any));
18590
+ },
18591
+ fromPartial<I extends Exact<DeepPartial<GetSessionAnalysisResponse>, I>>(object: I): GetSessionAnalysisResponse {
18592
+ const message = createBaseGetSessionAnalysisResponse();
18593
+ message.status = (object.status !== undefined && object.status !== null)
18594
+ ? ResponseStatus.fromPartial(object.status)
18595
+ : undefined;
18596
+ message.grades = (object.grades !== undefined && object.grades !== null)
18597
+ ? AISessionGrades.fromPartial(object.grades)
18598
+ : undefined;
18599
+ message.score = (object.score !== undefined && object.score !== null)
18600
+ ? AISessionScore.fromPartial(object.score)
18601
+ : undefined;
18602
+ message.insights = (object.insights !== undefined && object.insights !== null)
18603
+ ? AISessionInsights.fromPartial(object.insights)
18604
+ : undefined;
18605
+ message.sessionVersion = object.sessionVersion ?? undefined;
18606
+ return message;
18607
+ },
18608
+ };
18609
+
18610
+ function createBaseAISessionGrades(): AISessionGrades {
18611
+ return {
18612
+ outcome: 0,
18613
+ steeringLoad: 0,
18614
+ agentReliability: 0,
18615
+ verification: 0,
18616
+ model: "",
18617
+ version: "",
18618
+ inputSessionVersion: 0,
18619
+ scoredAt: undefined,
18620
+ };
18621
+ }
18622
+
18623
+ export const AISessionGrades: MessageFns<AISessionGrades> = {
18624
+ encode(message: AISessionGrades, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
18625
+ if (message.outcome !== 0) {
18626
+ writer.uint32(8).int32(message.outcome);
18627
+ }
18628
+ if (message.steeringLoad !== 0) {
18629
+ writer.uint32(16).int32(message.steeringLoad);
18630
+ }
18631
+ if (message.agentReliability !== 0) {
18632
+ writer.uint32(24).int32(message.agentReliability);
18633
+ }
18634
+ if (message.verification !== 0) {
18635
+ writer.uint32(32).int32(message.verification);
18636
+ }
18637
+ if (message.model !== "") {
18638
+ writer.uint32(42).string(message.model);
18639
+ }
18640
+ if (message.version !== "") {
18641
+ writer.uint32(50).string(message.version);
18642
+ }
18643
+ if (message.inputSessionVersion !== 0) {
18644
+ writer.uint32(56).uint64(message.inputSessionVersion);
18645
+ }
18646
+ if (message.scoredAt !== undefined) {
18647
+ Timestamp.encode(toTimestamp(message.scoredAt), writer.uint32(66).fork()).join();
18648
+ }
18649
+ return writer;
18650
+ },
18651
+
18652
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionGrades {
18653
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18654
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
18655
+ if (previousRecursionDepth >= 100) {
18656
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
18657
+ }
18658
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
18659
+ try {
18660
+ const end = length === undefined ? reader.len : reader.pos + length;
18661
+ const message = createBaseAISessionGrades();
18662
+ while (reader.pos < end) {
18663
+ const tag = reader.uint32();
18664
+ switch (tag >>> 3) {
18665
+ case 1: {
18666
+ if (tag !== 8) {
18667
+ break;
18668
+ }
18669
+
18670
+ message.outcome = reader.int32() as any;
18671
+ continue;
18672
+ }
18673
+ case 2: {
18674
+ if (tag !== 16) {
18675
+ break;
18676
+ }
18677
+
18678
+ message.steeringLoad = reader.int32() as any;
18679
+ continue;
18680
+ }
18681
+ case 3: {
18682
+ if (tag !== 24) {
18683
+ break;
18684
+ }
18685
+
18686
+ message.agentReliability = reader.int32() as any;
18687
+ continue;
18688
+ }
18689
+ case 4: {
18690
+ if (tag !== 32) {
18691
+ break;
18692
+ }
18693
+
18694
+ message.verification = reader.int32() as any;
18695
+ continue;
18696
+ }
18697
+ case 5: {
18698
+ if (tag !== 42) {
18699
+ break;
18700
+ }
18701
+
18702
+ message.model = reader.string();
18703
+ continue;
18704
+ }
18705
+ case 6: {
18706
+ if (tag !== 50) {
18707
+ break;
18708
+ }
18709
+
18710
+ message.version = reader.string();
18711
+ continue;
18712
+ }
18713
+ case 7: {
18714
+ if (tag !== 56) {
18715
+ break;
18716
+ }
18717
+
18718
+ message.inputSessionVersion = longToNumber(reader.uint64());
18719
+ continue;
18720
+ }
18721
+ case 8: {
18722
+ if (tag !== 66) {
18723
+ break;
18724
+ }
18725
+
18726
+ message.scoredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
18727
+ continue;
18728
+ }
18729
+ }
18730
+ if ((tag & 7) === 4 || tag === 0) {
18731
+ break;
18732
+ }
18733
+ reader.skip(tag & 7);
18734
+ }
18735
+ return message;
18736
+ } finally {
18737
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
18738
+ }
18739
+ },
18740
+
18741
+ fromJSON(object: any): AISessionGrades {
18742
+ return {
18743
+ outcome: isSet(object.outcome) ? aISessionOutcomeFromJSON(object.outcome) : 0,
18744
+ steeringLoad: isSet(object.steeringLoad)
18745
+ ? aISessionSteeringLoadFromJSON(object.steeringLoad)
18746
+ : isSet(object.steering_load)
18747
+ ? aISessionSteeringLoadFromJSON(object.steering_load)
18748
+ : 0,
18749
+ agentReliability: isSet(object.agentReliability)
18750
+ ? aISessionAgentReliabilityFromJSON(object.agentReliability)
18751
+ : isSet(object.agent_reliability)
18752
+ ? aISessionAgentReliabilityFromJSON(object.agent_reliability)
18753
+ : 0,
18754
+ verification: isSet(object.verification) ? aISessionVerificationFromJSON(object.verification) : 0,
18755
+ model: isSet(object.model) ? globalThis.String(object.model) : "",
18756
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
18757
+ inputSessionVersion: isSet(object.inputSessionVersion)
18758
+ ? globalThis.Number(object.inputSessionVersion)
18759
+ : isSet(object.input_session_version)
18760
+ ? globalThis.Number(object.input_session_version)
18761
+ : 0,
18762
+ scoredAt: isSet(object.scoredAt)
18763
+ ? fromJsonTimestamp(object.scoredAt)
18764
+ : isSet(object.scored_at)
18765
+ ? fromJsonTimestamp(object.scored_at)
18766
+ : undefined,
18767
+ };
18768
+ },
18769
+
18770
+ toJSON(message: AISessionGrades): unknown {
18771
+ const obj: any = {};
18772
+ if (message.outcome !== 0) {
18773
+ obj.outcome = aISessionOutcomeToJSON(message.outcome);
18774
+ }
18775
+ if (message.steeringLoad !== 0) {
18776
+ obj.steeringLoad = aISessionSteeringLoadToJSON(message.steeringLoad);
18777
+ }
18778
+ if (message.agentReliability !== 0) {
18779
+ obj.agentReliability = aISessionAgentReliabilityToJSON(message.agentReliability);
18780
+ }
18781
+ if (message.verification !== 0) {
18782
+ obj.verification = aISessionVerificationToJSON(message.verification);
18783
+ }
18784
+ if (message.model !== "") {
18785
+ obj.model = message.model;
18786
+ }
18787
+ if (message.version !== "") {
18788
+ obj.version = message.version;
18789
+ }
18790
+ if (message.inputSessionVersion !== 0) {
18791
+ obj.inputSessionVersion = Math.round(message.inputSessionVersion);
18792
+ }
18793
+ if (message.scoredAt !== undefined) {
18794
+ obj.scoredAt = message.scoredAt.toISOString();
18795
+ }
18796
+ return obj;
18797
+ },
18798
+
18799
+ create<I extends Exact<DeepPartial<AISessionGrades>, I>>(base?: I): AISessionGrades {
18800
+ return AISessionGrades.fromPartial(base ?? ({} as any));
18801
+ },
18802
+ fromPartial<I extends Exact<DeepPartial<AISessionGrades>, I>>(object: I): AISessionGrades {
18803
+ const message = createBaseAISessionGrades();
18804
+ message.outcome = object.outcome ?? 0;
18805
+ message.steeringLoad = object.steeringLoad ?? 0;
18806
+ message.agentReliability = object.agentReliability ?? 0;
18807
+ message.verification = object.verification ?? 0;
18808
+ message.model = object.model ?? "";
18809
+ message.version = object.version ?? "";
18810
+ message.inputSessionVersion = object.inputSessionVersion ?? 0;
18811
+ message.scoredAt = object.scoredAt ?? undefined;
18812
+ return message;
18813
+ },
18814
+ };
18815
+
18816
+ function createBaseAISessionInsights(): AISessionInsights {
18817
+ return { insights: [], model: "", version: "", inputSessionVersion: 0, analyzedAt: undefined };
18818
+ }
18819
+
18820
+ export const AISessionInsights: MessageFns<AISessionInsights> = {
18821
+ encode(message: AISessionInsights, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
18822
+ for (const v of message.insights) {
18823
+ AISessionInsight.encode(v!, writer.uint32(10).fork()).join();
18824
+ }
18825
+ if (message.model !== "") {
18826
+ writer.uint32(18).string(message.model);
18827
+ }
18828
+ if (message.version !== "") {
18829
+ writer.uint32(26).string(message.version);
18830
+ }
18831
+ if (message.inputSessionVersion !== 0) {
18832
+ writer.uint32(32).uint64(message.inputSessionVersion);
18833
+ }
18834
+ if (message.analyzedAt !== undefined) {
18835
+ Timestamp.encode(toTimestamp(message.analyzedAt), writer.uint32(42).fork()).join();
18836
+ }
18837
+ return writer;
18838
+ },
18839
+
18840
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionInsights {
18841
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18842
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
18843
+ if (previousRecursionDepth >= 100) {
18844
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
18845
+ }
18846
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
18847
+ try {
18848
+ const end = length === undefined ? reader.len : reader.pos + length;
18849
+ const message = createBaseAISessionInsights();
18850
+ while (reader.pos < end) {
18851
+ const tag = reader.uint32();
18852
+ switch (tag >>> 3) {
18853
+ case 1: {
18854
+ if (tag !== 10) {
18855
+ break;
18856
+ }
18857
+
18858
+ message.insights.push(AISessionInsight.decode(reader, reader.uint32()));
18859
+ continue;
18860
+ }
18861
+ case 2: {
18862
+ if (tag !== 18) {
18863
+ break;
18864
+ }
18865
+
18866
+ message.model = reader.string();
18867
+ continue;
18868
+ }
18869
+ case 3: {
18870
+ if (tag !== 26) {
18871
+ break;
18872
+ }
18873
+
18874
+ message.version = reader.string();
18875
+ continue;
18876
+ }
18877
+ case 4: {
18878
+ if (tag !== 32) {
18879
+ break;
18880
+ }
18881
+
18882
+ message.inputSessionVersion = longToNumber(reader.uint64());
18883
+ continue;
18884
+ }
18885
+ case 5: {
18886
+ if (tag !== 42) {
18887
+ break;
18888
+ }
18889
+
18890
+ message.analyzedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
18891
+ continue;
18892
+ }
18893
+ }
18894
+ if ((tag & 7) === 4 || tag === 0) {
18895
+ break;
18896
+ }
18897
+ reader.skip(tag & 7);
18898
+ }
18899
+ return message;
18900
+ } finally {
18901
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
18902
+ }
18903
+ },
18904
+
18905
+ fromJSON(object: any): AISessionInsights {
18906
+ return {
18907
+ insights: globalThis.Array.isArray(object?.insights)
18908
+ ? object.insights.map((e: any) => AISessionInsight.fromJSON(e))
18909
+ : [],
18910
+ model: isSet(object.model) ? globalThis.String(object.model) : "",
18911
+ version: isSet(object.version) ? globalThis.String(object.version) : "",
18912
+ inputSessionVersion: isSet(object.inputSessionVersion)
18913
+ ? globalThis.Number(object.inputSessionVersion)
18914
+ : isSet(object.input_session_version)
18915
+ ? globalThis.Number(object.input_session_version)
18916
+ : 0,
18917
+ analyzedAt: isSet(object.analyzedAt)
18918
+ ? fromJsonTimestamp(object.analyzedAt)
18919
+ : isSet(object.analyzed_at)
18920
+ ? fromJsonTimestamp(object.analyzed_at)
18921
+ : undefined,
18922
+ };
18923
+ },
18924
+
18925
+ toJSON(message: AISessionInsights): unknown {
18926
+ const obj: any = {};
18927
+ if (message.insights?.length) {
18928
+ obj.insights = message.insights.map((e) => AISessionInsight.toJSON(e));
18929
+ }
18930
+ if (message.model !== "") {
18931
+ obj.model = message.model;
18932
+ }
18933
+ if (message.version !== "") {
18934
+ obj.version = message.version;
18935
+ }
18936
+ if (message.inputSessionVersion !== 0) {
18937
+ obj.inputSessionVersion = Math.round(message.inputSessionVersion);
18938
+ }
18939
+ if (message.analyzedAt !== undefined) {
18940
+ obj.analyzedAt = message.analyzedAt.toISOString();
18941
+ }
18942
+ return obj;
18943
+ },
18944
+
18945
+ create<I extends Exact<DeepPartial<AISessionInsights>, I>>(base?: I): AISessionInsights {
18946
+ return AISessionInsights.fromPartial(base ?? ({} as any));
18947
+ },
18948
+ fromPartial<I extends Exact<DeepPartial<AISessionInsights>, I>>(object: I): AISessionInsights {
18949
+ const message = createBaseAISessionInsights();
18950
+ message.insights = object.insights?.map((e) => AISessionInsight.fromPartial(e)) || [];
18951
+ message.model = object.model ?? "";
18952
+ message.version = object.version ?? "";
18953
+ message.inputSessionVersion = object.inputSessionVersion ?? 0;
18954
+ message.analyzedAt = object.analyzedAt ?? undefined;
18955
+ return message;
18956
+ },
18957
+ };
18958
+
18959
+ function createBaseAISessionInsight(): AISessionInsight {
18960
+ return { category: 0, actionType: 0, evidenceRefs: [], cause: "", action: "" };
18961
+ }
18962
+
18963
+ export const AISessionInsight: MessageFns<AISessionInsight> = {
18964
+ encode(message: AISessionInsight, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
18965
+ if (message.category !== 0) {
18966
+ writer.uint32(8).int32(message.category);
18967
+ }
18968
+ if (message.actionType !== 0) {
18969
+ writer.uint32(16).int32(message.actionType);
18970
+ }
18971
+ for (const v of message.evidenceRefs) {
18972
+ AISessionEventRef.encode(v!, writer.uint32(26).fork()).join();
18973
+ }
18974
+ if (message.cause !== "") {
18975
+ writer.uint32(34).string(message.cause);
18976
+ }
18977
+ if (message.action !== "") {
18978
+ writer.uint32(42).string(message.action);
18979
+ }
18980
+ return writer;
18981
+ },
18982
+
18983
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionInsight {
18984
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
18985
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
18986
+ if (previousRecursionDepth >= 100) {
18987
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
18988
+ }
18989
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
18990
+ try {
18991
+ const end = length === undefined ? reader.len : reader.pos + length;
18992
+ const message = createBaseAISessionInsight();
18993
+ while (reader.pos < end) {
18994
+ const tag = reader.uint32();
18995
+ switch (tag >>> 3) {
18996
+ case 1: {
18997
+ if (tag !== 8) {
18998
+ break;
18999
+ }
19000
+
19001
+ message.category = reader.int32() as any;
19002
+ continue;
19003
+ }
19004
+ case 2: {
19005
+ if (tag !== 16) {
19006
+ break;
19007
+ }
19008
+
19009
+ message.actionType = reader.int32() as any;
19010
+ continue;
19011
+ }
19012
+ case 3: {
19013
+ if (tag !== 26) {
19014
+ break;
19015
+ }
19016
+
19017
+ message.evidenceRefs.push(AISessionEventRef.decode(reader, reader.uint32()));
19018
+ continue;
19019
+ }
19020
+ case 4: {
19021
+ if (tag !== 34) {
19022
+ break;
19023
+ }
19024
+
19025
+ message.cause = reader.string();
19026
+ continue;
19027
+ }
19028
+ case 5: {
19029
+ if (tag !== 42) {
19030
+ break;
19031
+ }
19032
+
19033
+ message.action = reader.string();
19034
+ continue;
19035
+ }
19036
+ }
19037
+ if ((tag & 7) === 4 || tag === 0) {
19038
+ break;
19039
+ }
19040
+ reader.skip(tag & 7);
19041
+ }
19042
+ return message;
19043
+ } finally {
19044
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19045
+ }
19046
+ },
19047
+
19048
+ fromJSON(object: any): AISessionInsight {
19049
+ return {
19050
+ category: isSet(object.category) ? aISessionInsightCategoryFromJSON(object.category) : 0,
19051
+ actionType: isSet(object.actionType)
19052
+ ? aISessionInsightActionTypeFromJSON(object.actionType)
19053
+ : isSet(object.action_type)
19054
+ ? aISessionInsightActionTypeFromJSON(object.action_type)
19055
+ : 0,
19056
+ evidenceRefs: globalThis.Array.isArray(object?.evidenceRefs)
19057
+ ? object.evidenceRefs.map((e: any) => AISessionEventRef.fromJSON(e))
19058
+ : globalThis.Array.isArray(object?.evidence_refs)
19059
+ ? object.evidence_refs.map((e: any) => AISessionEventRef.fromJSON(e))
19060
+ : [],
19061
+ cause: isSet(object.cause) ? globalThis.String(object.cause) : "",
19062
+ action: isSet(object.action) ? globalThis.String(object.action) : "",
19063
+ };
19064
+ },
19065
+
19066
+ toJSON(message: AISessionInsight): unknown {
19067
+ const obj: any = {};
19068
+ if (message.category !== 0) {
19069
+ obj.category = aISessionInsightCategoryToJSON(message.category);
19070
+ }
19071
+ if (message.actionType !== 0) {
19072
+ obj.actionType = aISessionInsightActionTypeToJSON(message.actionType);
19073
+ }
19074
+ if (message.evidenceRefs?.length) {
19075
+ obj.evidenceRefs = message.evidenceRefs.map((e) => AISessionEventRef.toJSON(e));
19076
+ }
19077
+ if (message.cause !== "") {
19078
+ obj.cause = message.cause;
19079
+ }
19080
+ if (message.action !== "") {
19081
+ obj.action = message.action;
19082
+ }
19083
+ return obj;
19084
+ },
19085
+
19086
+ create<I extends Exact<DeepPartial<AISessionInsight>, I>>(base?: I): AISessionInsight {
19087
+ return AISessionInsight.fromPartial(base ?? ({} as any));
19088
+ },
19089
+ fromPartial<I extends Exact<DeepPartial<AISessionInsight>, I>>(object: I): AISessionInsight {
19090
+ const message = createBaseAISessionInsight();
19091
+ message.category = object.category ?? 0;
19092
+ message.actionType = object.actionType ?? 0;
19093
+ message.evidenceRefs = object.evidenceRefs?.map((e) => AISessionEventRef.fromPartial(e)) || [];
19094
+ message.cause = object.cause ?? "";
19095
+ message.action = object.action ?? "";
19096
+ return message;
19097
+ },
19098
+ };
19099
+
19100
+ function createBaseAISessionEventRef(): AISessionEventRef {
19101
+ return { eventType: "", eventSubtype: "", eventKey: "" };
19102
+ }
19103
+
19104
+ export const AISessionEventRef: MessageFns<AISessionEventRef> = {
19105
+ encode(message: AISessionEventRef, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19106
+ if (message.eventType !== "") {
19107
+ writer.uint32(10).string(message.eventType);
19108
+ }
19109
+ if (message.eventSubtype !== "") {
19110
+ writer.uint32(18).string(message.eventSubtype);
19111
+ }
19112
+ if (message.eventKey !== "") {
19113
+ writer.uint32(26).string(message.eventKey);
19114
+ }
19115
+ return writer;
19116
+ },
19117
+
19118
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionEventRef {
19119
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19120
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19121
+ if (previousRecursionDepth >= 100) {
19122
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19123
+ }
19124
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19125
+ try {
19126
+ const end = length === undefined ? reader.len : reader.pos + length;
19127
+ const message = createBaseAISessionEventRef();
19128
+ while (reader.pos < end) {
19129
+ const tag = reader.uint32();
19130
+ switch (tag >>> 3) {
19131
+ case 1: {
19132
+ if (tag !== 10) {
19133
+ break;
19134
+ }
19135
+
19136
+ message.eventType = reader.string();
19137
+ continue;
19138
+ }
19139
+ case 2: {
19140
+ if (tag !== 18) {
19141
+ break;
19142
+ }
19143
+
19144
+ message.eventSubtype = reader.string();
19145
+ continue;
19146
+ }
19147
+ case 3: {
19148
+ if (tag !== 26) {
19149
+ break;
19150
+ }
19151
+
19152
+ message.eventKey = reader.string();
19153
+ continue;
19154
+ }
19155
+ }
19156
+ if ((tag & 7) === 4 || tag === 0) {
19157
+ break;
19158
+ }
19159
+ reader.skip(tag & 7);
19160
+ }
19161
+ return message;
19162
+ } finally {
19163
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19164
+ }
19165
+ },
19166
+
19167
+ fromJSON(object: any): AISessionEventRef {
19168
+ return {
19169
+ eventType: isSet(object.eventType)
19170
+ ? globalThis.String(object.eventType)
19171
+ : isSet(object.event_type)
19172
+ ? globalThis.String(object.event_type)
19173
+ : "",
19174
+ eventSubtype: isSet(object.eventSubtype)
19175
+ ? globalThis.String(object.eventSubtype)
19176
+ : isSet(object.event_subtype)
19177
+ ? globalThis.String(object.event_subtype)
19178
+ : "",
19179
+ eventKey: isSet(object.eventKey)
19180
+ ? globalThis.String(object.eventKey)
19181
+ : isSet(object.event_key)
19182
+ ? globalThis.String(object.event_key)
19183
+ : "",
19184
+ };
19185
+ },
19186
+
19187
+ toJSON(message: AISessionEventRef): unknown {
19188
+ const obj: any = {};
19189
+ if (message.eventType !== "") {
19190
+ obj.eventType = message.eventType;
19191
+ }
19192
+ if (message.eventSubtype !== "") {
19193
+ obj.eventSubtype = message.eventSubtype;
19194
+ }
19195
+ if (message.eventKey !== "") {
19196
+ obj.eventKey = message.eventKey;
19197
+ }
19198
+ return obj;
19199
+ },
19200
+
19201
+ create<I extends Exact<DeepPartial<AISessionEventRef>, I>>(base?: I): AISessionEventRef {
19202
+ return AISessionEventRef.fromPartial(base ?? ({} as any));
19203
+ },
19204
+ fromPartial<I extends Exact<DeepPartial<AISessionEventRef>, I>>(object: I): AISessionEventRef {
19205
+ const message = createBaseAISessionEventRef();
19206
+ message.eventType = object.eventType ?? "";
19207
+ message.eventSubtype = object.eventSubtype ?? "";
19208
+ message.eventKey = object.eventKey ?? "";
19209
+ return message;
19210
+ },
19211
+ };
19212
+
19213
+ function createBaseAISessionScore(): AISessionScore {
19214
+ return {
19215
+ formulaVersion: "",
19216
+ score: 0,
19217
+ components: [],
19218
+ scoreVersion: "",
19219
+ inputSessionVersion: 0,
19220
+ scoredAt: undefined,
19221
+ };
19222
+ }
19223
+
19224
+ export const AISessionScore: MessageFns<AISessionScore> = {
19225
+ encode(message: AISessionScore, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19226
+ if (message.formulaVersion !== "") {
19227
+ writer.uint32(10).string(message.formulaVersion);
19228
+ }
19229
+ if (message.score !== 0) {
19230
+ writer.uint32(16).int32(message.score);
19231
+ }
19232
+ for (const v of message.components) {
19233
+ AISessionScoreComponent.encode(v!, writer.uint32(26).fork()).join();
19234
+ }
19235
+ if (message.scoreVersion !== "") {
19236
+ writer.uint32(34).string(message.scoreVersion);
19237
+ }
19238
+ if (message.inputSessionVersion !== 0) {
19239
+ writer.uint32(40).uint64(message.inputSessionVersion);
19240
+ }
19241
+ if (message.scoredAt !== undefined) {
19242
+ Timestamp.encode(toTimestamp(message.scoredAt), writer.uint32(50).fork()).join();
19243
+ }
19244
+ return writer;
19245
+ },
19246
+
19247
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionScore {
19248
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19249
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19250
+ if (previousRecursionDepth >= 100) {
19251
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19252
+ }
19253
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19254
+ try {
19255
+ const end = length === undefined ? reader.len : reader.pos + length;
19256
+ const message = createBaseAISessionScore();
19257
+ while (reader.pos < end) {
19258
+ const tag = reader.uint32();
19259
+ switch (tag >>> 3) {
19260
+ case 1: {
19261
+ if (tag !== 10) {
19262
+ break;
19263
+ }
19264
+
19265
+ message.formulaVersion = reader.string();
19266
+ continue;
19267
+ }
19268
+ case 2: {
19269
+ if (tag !== 16) {
19270
+ break;
19271
+ }
19272
+
19273
+ message.score = reader.int32();
19274
+ continue;
19275
+ }
19276
+ case 3: {
19277
+ if (tag !== 26) {
19278
+ break;
19279
+ }
19280
+
19281
+ message.components.push(AISessionScoreComponent.decode(reader, reader.uint32()));
19282
+ continue;
19283
+ }
19284
+ case 4: {
19285
+ if (tag !== 34) {
19286
+ break;
19287
+ }
19288
+
19289
+ message.scoreVersion = reader.string();
19290
+ continue;
19291
+ }
19292
+ case 5: {
19293
+ if (tag !== 40) {
19294
+ break;
19295
+ }
19296
+
19297
+ message.inputSessionVersion = longToNumber(reader.uint64());
19298
+ continue;
19299
+ }
19300
+ case 6: {
19301
+ if (tag !== 50) {
19302
+ break;
19303
+ }
19304
+
19305
+ message.scoredAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
19306
+ continue;
19307
+ }
19308
+ }
19309
+ if ((tag & 7) === 4 || tag === 0) {
19310
+ break;
19311
+ }
19312
+ reader.skip(tag & 7);
19313
+ }
19314
+ return message;
19315
+ } finally {
19316
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19317
+ }
19318
+ },
19319
+
19320
+ fromJSON(object: any): AISessionScore {
19321
+ return {
19322
+ formulaVersion: isSet(object.formulaVersion)
19323
+ ? globalThis.String(object.formulaVersion)
19324
+ : isSet(object.formula_version)
19325
+ ? globalThis.String(object.formula_version)
19326
+ : "",
19327
+ score: isSet(object.score) ? globalThis.Number(object.score) : 0,
19328
+ components: globalThis.Array.isArray(object?.components)
19329
+ ? object.components.map((e: any) => AISessionScoreComponent.fromJSON(e))
19330
+ : [],
19331
+ scoreVersion: isSet(object.scoreVersion)
19332
+ ? globalThis.String(object.scoreVersion)
19333
+ : isSet(object.score_version)
19334
+ ? globalThis.String(object.score_version)
19335
+ : "",
19336
+ inputSessionVersion: isSet(object.inputSessionVersion)
19337
+ ? globalThis.Number(object.inputSessionVersion)
19338
+ : isSet(object.input_session_version)
19339
+ ? globalThis.Number(object.input_session_version)
19340
+ : 0,
19341
+ scoredAt: isSet(object.scoredAt)
19342
+ ? fromJsonTimestamp(object.scoredAt)
19343
+ : isSet(object.scored_at)
19344
+ ? fromJsonTimestamp(object.scored_at)
19345
+ : undefined,
19346
+ };
19347
+ },
19348
+
19349
+ toJSON(message: AISessionScore): unknown {
19350
+ const obj: any = {};
19351
+ if (message.formulaVersion !== "") {
19352
+ obj.formulaVersion = message.formulaVersion;
19353
+ }
19354
+ if (message.score !== 0) {
19355
+ obj.score = Math.round(message.score);
19356
+ }
19357
+ if (message.components?.length) {
19358
+ obj.components = message.components.map((e) => AISessionScoreComponent.toJSON(e));
19359
+ }
19360
+ if (message.scoreVersion !== "") {
19361
+ obj.scoreVersion = message.scoreVersion;
19362
+ }
19363
+ if (message.inputSessionVersion !== 0) {
19364
+ obj.inputSessionVersion = Math.round(message.inputSessionVersion);
19365
+ }
19366
+ if (message.scoredAt !== undefined) {
19367
+ obj.scoredAt = message.scoredAt.toISOString();
19368
+ }
19369
+ return obj;
19370
+ },
19371
+
19372
+ create<I extends Exact<DeepPartial<AISessionScore>, I>>(base?: I): AISessionScore {
19373
+ return AISessionScore.fromPartial(base ?? ({} as any));
19374
+ },
19375
+ fromPartial<I extends Exact<DeepPartial<AISessionScore>, I>>(object: I): AISessionScore {
19376
+ const message = createBaseAISessionScore();
19377
+ message.formulaVersion = object.formulaVersion ?? "";
19378
+ message.score = object.score ?? 0;
19379
+ message.components = object.components?.map((e) => AISessionScoreComponent.fromPartial(e)) || [];
19380
+ message.scoreVersion = object.scoreVersion ?? "";
19381
+ message.inputSessionVersion = object.inputSessionVersion ?? 0;
19382
+ message.scoredAt = object.scoredAt ?? undefined;
19383
+ return message;
19384
+ },
19385
+ };
19386
+
19387
+ function createBaseAISessionScoreComponent(): AISessionScoreComponent {
19388
+ return { kind: 0, available: false, baseWeight: 0, weight: 0, value: undefined, contribution: 0 };
19389
+ }
19390
+
19391
+ export const AISessionScoreComponent: MessageFns<AISessionScoreComponent> = {
19392
+ encode(message: AISessionScoreComponent, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19393
+ if (message.kind !== 0) {
19394
+ writer.uint32(8).int32(message.kind);
19395
+ }
19396
+ if (message.available !== false) {
19397
+ writer.uint32(16).bool(message.available);
19398
+ }
19399
+ if (message.baseWeight !== 0) {
19400
+ writer.uint32(25).double(message.baseWeight);
19401
+ }
19402
+ if (message.weight !== 0) {
19403
+ writer.uint32(33).double(message.weight);
19404
+ }
19405
+ if (message.value !== undefined) {
19406
+ writer.uint32(41).double(message.value);
19407
+ }
19408
+ if (message.contribution !== 0) {
19409
+ writer.uint32(49).double(message.contribution);
19410
+ }
19411
+ return writer;
19412
+ },
19413
+
19414
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionScoreComponent {
19415
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19416
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19417
+ if (previousRecursionDepth >= 100) {
19418
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19419
+ }
19420
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19421
+ try {
19422
+ const end = length === undefined ? reader.len : reader.pos + length;
19423
+ const message = createBaseAISessionScoreComponent();
19424
+ while (reader.pos < end) {
19425
+ const tag = reader.uint32();
19426
+ switch (tag >>> 3) {
19427
+ case 1: {
19428
+ if (tag !== 8) {
19429
+ break;
19430
+ }
19431
+
19432
+ message.kind = reader.int32() as any;
19433
+ continue;
19434
+ }
19435
+ case 2: {
19436
+ if (tag !== 16) {
19437
+ break;
19438
+ }
19439
+
19440
+ message.available = reader.bool();
19441
+ continue;
19442
+ }
19443
+ case 3: {
19444
+ if (tag !== 25) {
19445
+ break;
19446
+ }
19447
+
19448
+ message.baseWeight = reader.double();
19449
+ continue;
19450
+ }
19451
+ case 4: {
19452
+ if (tag !== 33) {
19453
+ break;
19454
+ }
19455
+
19456
+ message.weight = reader.double();
19457
+ continue;
19458
+ }
19459
+ case 5: {
19460
+ if (tag !== 41) {
19461
+ break;
19462
+ }
19463
+
19464
+ message.value = reader.double();
19465
+ continue;
19466
+ }
19467
+ case 6: {
19468
+ if (tag !== 49) {
19469
+ break;
19470
+ }
19471
+
19472
+ message.contribution = reader.double();
19473
+ continue;
19474
+ }
19475
+ }
19476
+ if ((tag & 7) === 4 || tag === 0) {
19477
+ break;
19478
+ }
19479
+ reader.skip(tag & 7);
19480
+ }
19481
+ return message;
19482
+ } finally {
19483
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19484
+ }
19485
+ },
19486
+
19487
+ fromJSON(object: any): AISessionScoreComponent {
19488
+ return {
19489
+ kind: isSet(object.kind) ? aISessionScoreComponentKindFromJSON(object.kind) : 0,
19490
+ available: isSet(object.available) ? globalThis.Boolean(object.available) : false,
19491
+ baseWeight: isSet(object.baseWeight)
19492
+ ? globalThis.Number(object.baseWeight)
19493
+ : isSet(object.base_weight)
19494
+ ? globalThis.Number(object.base_weight)
19495
+ : 0,
19496
+ weight: isSet(object.weight) ? globalThis.Number(object.weight) : 0,
19497
+ value: isSet(object.value) ? globalThis.Number(object.value) : undefined,
19498
+ contribution: isSet(object.contribution) ? globalThis.Number(object.contribution) : 0,
19499
+ };
19500
+ },
19501
+
19502
+ toJSON(message: AISessionScoreComponent): unknown {
19503
+ const obj: any = {};
19504
+ if (message.kind !== 0) {
19505
+ obj.kind = aISessionScoreComponentKindToJSON(message.kind);
19506
+ }
19507
+ if (message.available !== false) {
19508
+ obj.available = message.available;
19509
+ }
19510
+ if (message.baseWeight !== 0) {
19511
+ obj.baseWeight = floatToJson(message.baseWeight);
19512
+ }
19513
+ if (message.weight !== 0) {
19514
+ obj.weight = floatToJson(message.weight);
19515
+ }
19516
+ if (message.value !== undefined) {
19517
+ obj.value = floatToJson(message.value);
19518
+ }
19519
+ if (message.contribution !== 0) {
19520
+ obj.contribution = floatToJson(message.contribution);
19521
+ }
19522
+ return obj;
19523
+ },
19524
+
19525
+ create<I extends Exact<DeepPartial<AISessionScoreComponent>, I>>(base?: I): AISessionScoreComponent {
19526
+ return AISessionScoreComponent.fromPartial(base ?? ({} as any));
19527
+ },
19528
+ fromPartial<I extends Exact<DeepPartial<AISessionScoreComponent>, I>>(object: I): AISessionScoreComponent {
19529
+ const message = createBaseAISessionScoreComponent();
19530
+ message.kind = object.kind ?? 0;
19531
+ message.available = object.available ?? false;
19532
+ message.baseWeight = object.baseWeight ?? 0;
19533
+ message.weight = object.weight ?? 0;
19534
+ message.value = object.value ?? undefined;
19535
+ message.contribution = object.contribution ?? 0;
19536
+ return message;
19537
+ },
19538
+ };
19539
+
19540
+ function createBaseGetSessionScoreTrendRequest(): GetSessionScoreTrendRequest {
19541
+ return { organizationId: "", projectId: "", startWeek: "", weeks: 0, filter: undefined };
19542
+ }
19543
+
19544
+ export const GetSessionScoreTrendRequest: MessageFns<GetSessionScoreTrendRequest> = {
19545
+ encode(message: GetSessionScoreTrendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19546
+ if (message.organizationId !== "") {
19547
+ writer.uint32(10).string(message.organizationId);
19548
+ }
19549
+ if (message.projectId !== "") {
19550
+ writer.uint32(18).string(message.projectId);
19551
+ }
19552
+ if (message.startWeek !== "") {
19553
+ writer.uint32(34).string(message.startWeek);
19554
+ }
19555
+ if (message.weeks !== 0) {
19556
+ writer.uint32(40).uint32(message.weeks);
19557
+ }
19558
+ if (message.filter !== undefined) {
19559
+ AISessionScoreTrendFilter.encode(message.filter, writer.uint32(50).fork()).join();
19560
+ }
19561
+ return writer;
19562
+ },
19563
+
19564
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionScoreTrendRequest {
19565
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19566
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19567
+ if (previousRecursionDepth >= 100) {
19568
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19569
+ }
19570
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19571
+ try {
19572
+ const end = length === undefined ? reader.len : reader.pos + length;
19573
+ const message = createBaseGetSessionScoreTrendRequest();
19574
+ while (reader.pos < end) {
19575
+ const tag = reader.uint32();
19576
+ switch (tag >>> 3) {
19577
+ case 1: {
19578
+ if (tag !== 10) {
19579
+ break;
19580
+ }
19581
+
19582
+ message.organizationId = reader.string();
19583
+ continue;
19584
+ }
19585
+ case 2: {
19586
+ if (tag !== 18) {
19587
+ break;
19588
+ }
19589
+
19590
+ message.projectId = reader.string();
19591
+ continue;
19592
+ }
19593
+ case 4: {
19594
+ if (tag !== 34) {
19595
+ break;
19596
+ }
19597
+
19598
+ message.startWeek = reader.string();
19599
+ continue;
19600
+ }
19601
+ case 5: {
19602
+ if (tag !== 40) {
19603
+ break;
19604
+ }
19605
+
19606
+ message.weeks = reader.uint32();
19607
+ continue;
19608
+ }
19609
+ case 6: {
19610
+ if (tag !== 50) {
19611
+ break;
19612
+ }
19613
+
19614
+ message.filter = AISessionScoreTrendFilter.decode(reader, reader.uint32());
19615
+ continue;
19616
+ }
19617
+ }
19618
+ if ((tag & 7) === 4 || tag === 0) {
19619
+ break;
19620
+ }
19621
+ reader.skip(tag & 7);
19622
+ }
19623
+ return message;
19624
+ } finally {
19625
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19626
+ }
19627
+ },
19628
+
19629
+ fromJSON(object: any): GetSessionScoreTrendRequest {
19630
+ return {
19631
+ organizationId: isSet(object.organizationId)
19632
+ ? globalThis.String(object.organizationId)
19633
+ : isSet(object.organization_id)
19634
+ ? globalThis.String(object.organization_id)
19635
+ : "",
19636
+ projectId: isSet(object.projectId)
19637
+ ? globalThis.String(object.projectId)
19638
+ : isSet(object.project_id)
19639
+ ? globalThis.String(object.project_id)
19640
+ : "",
19641
+ startWeek: isSet(object.startWeek)
19642
+ ? globalThis.String(object.startWeek)
19643
+ : isSet(object.start_week)
19644
+ ? globalThis.String(object.start_week)
19645
+ : "",
19646
+ weeks: isSet(object.weeks) ? globalThis.Number(object.weeks) : 0,
19647
+ filter: isSet(object.filter) ? AISessionScoreTrendFilter.fromJSON(object.filter) : undefined,
19648
+ };
19649
+ },
19650
+
19651
+ toJSON(message: GetSessionScoreTrendRequest): unknown {
19652
+ const obj: any = {};
19653
+ if (message.organizationId !== "") {
19654
+ obj.organizationId = message.organizationId;
19655
+ }
19656
+ if (message.projectId !== "") {
19657
+ obj.projectId = message.projectId;
19658
+ }
19659
+ if (message.startWeek !== "") {
19660
+ obj.startWeek = message.startWeek;
19661
+ }
19662
+ if (message.weeks !== 0) {
19663
+ obj.weeks = Math.round(message.weeks);
19664
+ }
19665
+ if (message.filter !== undefined) {
19666
+ obj.filter = AISessionScoreTrendFilter.toJSON(message.filter);
19667
+ }
19668
+ return obj;
19669
+ },
19670
+
19671
+ create<I extends Exact<DeepPartial<GetSessionScoreTrendRequest>, I>>(base?: I): GetSessionScoreTrendRequest {
19672
+ return GetSessionScoreTrendRequest.fromPartial(base ?? ({} as any));
19673
+ },
19674
+ fromPartial<I extends Exact<DeepPartial<GetSessionScoreTrendRequest>, I>>(object: I): GetSessionScoreTrendRequest {
19675
+ const message = createBaseGetSessionScoreTrendRequest();
19676
+ message.organizationId = object.organizationId ?? "";
19677
+ message.projectId = object.projectId ?? "";
19678
+ message.startWeek = object.startWeek ?? "";
19679
+ message.weeks = object.weeks ?? 0;
19680
+ message.filter = (object.filter !== undefined && object.filter !== null)
19681
+ ? AISessionScoreTrendFilter.fromPartial(object.filter)
19682
+ : undefined;
19683
+ return message;
19684
+ },
19685
+ };
19686
+
19687
+ function createBaseAISessionScoreTrendFilter(): AISessionScoreTrendFilter {
19688
+ return { userIds: [] };
19689
+ }
19690
+
19691
+ export const AISessionScoreTrendFilter: MessageFns<AISessionScoreTrendFilter> = {
19692
+ encode(message: AISessionScoreTrendFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19693
+ for (const v of message.userIds) {
19694
+ writer.uint32(10).string(v!);
19695
+ }
19696
+ return writer;
19697
+ },
19698
+
19699
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionScoreTrendFilter {
19700
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19701
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19702
+ if (previousRecursionDepth >= 100) {
19703
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19704
+ }
19705
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19706
+ try {
19707
+ const end = length === undefined ? reader.len : reader.pos + length;
19708
+ const message = createBaseAISessionScoreTrendFilter();
19709
+ while (reader.pos < end) {
19710
+ const tag = reader.uint32();
19711
+ switch (tag >>> 3) {
19712
+ case 1: {
19713
+ if (tag !== 10) {
19714
+ break;
19715
+ }
19716
+
19717
+ message.userIds.push(reader.string());
19718
+ continue;
19719
+ }
19720
+ }
19721
+ if ((tag & 7) === 4 || tag === 0) {
19722
+ break;
19723
+ }
19724
+ reader.skip(tag & 7);
19725
+ }
19726
+ return message;
19727
+ } finally {
19728
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19729
+ }
19730
+ },
19731
+
19732
+ fromJSON(object: any): AISessionScoreTrendFilter {
19733
+ return {
19734
+ userIds: globalThis.Array.isArray(object?.userIds)
19735
+ ? object.userIds.map((e: any) => globalThis.String(e))
19736
+ : globalThis.Array.isArray(object?.user_ids)
19737
+ ? object.user_ids.map((e: any) => globalThis.String(e))
19738
+ : [],
19739
+ };
19740
+ },
19741
+
19742
+ toJSON(message: AISessionScoreTrendFilter): unknown {
19743
+ const obj: any = {};
19744
+ if (message.userIds?.length) {
19745
+ obj.userIds = message.userIds;
19746
+ }
19747
+ return obj;
19748
+ },
19749
+
19750
+ create<I extends Exact<DeepPartial<AISessionScoreTrendFilter>, I>>(base?: I): AISessionScoreTrendFilter {
19751
+ return AISessionScoreTrendFilter.fromPartial(base ?? ({} as any));
19752
+ },
19753
+ fromPartial<I extends Exact<DeepPartial<AISessionScoreTrendFilter>, I>>(object: I): AISessionScoreTrendFilter {
19754
+ const message = createBaseAISessionScoreTrendFilter();
19755
+ message.userIds = object.userIds?.map((e) => e) || [];
19756
+ return message;
19757
+ },
19758
+ };
19759
+
19760
+ function createBaseGetSessionScoreTrendResponse(): GetSessionScoreTrendResponse {
19761
+ return { status: undefined, formulaVersion: "", weeks: [] };
19762
+ }
19763
+
19764
+ export const GetSessionScoreTrendResponse: MessageFns<GetSessionScoreTrendResponse> = {
19765
+ encode(message: GetSessionScoreTrendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19766
+ if (message.status !== undefined) {
19767
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
19768
+ }
19769
+ if (message.formulaVersion !== "") {
19770
+ writer.uint32(18).string(message.formulaVersion);
19771
+ }
19772
+ for (const v of message.weeks) {
19773
+ AISessionScoreWeek.encode(v!, writer.uint32(26).fork()).join();
19774
+ }
19775
+ return writer;
19776
+ },
19777
+
19778
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionScoreTrendResponse {
19779
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19780
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19781
+ if (previousRecursionDepth >= 100) {
19782
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19783
+ }
19784
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19785
+ try {
19786
+ const end = length === undefined ? reader.len : reader.pos + length;
19787
+ const message = createBaseGetSessionScoreTrendResponse();
19788
+ while (reader.pos < end) {
19789
+ const tag = reader.uint32();
19790
+ switch (tag >>> 3) {
19791
+ case 1: {
19792
+ if (tag !== 10) {
19793
+ break;
19794
+ }
19795
+
19796
+ message.status = ResponseStatus.decode(reader, reader.uint32());
19797
+ continue;
19798
+ }
19799
+ case 2: {
19800
+ if (tag !== 18) {
19801
+ break;
19802
+ }
19803
+
19804
+ message.formulaVersion = reader.string();
19805
+ continue;
19806
+ }
19807
+ case 3: {
19808
+ if (tag !== 26) {
19809
+ break;
19810
+ }
19811
+
19812
+ message.weeks.push(AISessionScoreWeek.decode(reader, reader.uint32()));
19813
+ continue;
19814
+ }
19815
+ }
19816
+ if ((tag & 7) === 4 || tag === 0) {
19817
+ break;
19818
+ }
19819
+ reader.skip(tag & 7);
19820
+ }
19821
+ return message;
19822
+ } finally {
19823
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19824
+ }
19825
+ },
19826
+
19827
+ fromJSON(object: any): GetSessionScoreTrendResponse {
19828
+ return {
19829
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
19830
+ formulaVersion: isSet(object.formulaVersion)
19831
+ ? globalThis.String(object.formulaVersion)
19832
+ : isSet(object.formula_version)
19833
+ ? globalThis.String(object.formula_version)
19834
+ : "",
19835
+ weeks: globalThis.Array.isArray(object?.weeks)
19836
+ ? object.weeks.map((e: any) => AISessionScoreWeek.fromJSON(e))
19837
+ : [],
19838
+ };
19839
+ },
19840
+
19841
+ toJSON(message: GetSessionScoreTrendResponse): unknown {
19842
+ const obj: any = {};
19843
+ if (message.status !== undefined) {
19844
+ obj.status = ResponseStatus.toJSON(message.status);
19845
+ }
19846
+ if (message.formulaVersion !== "") {
19847
+ obj.formulaVersion = message.formulaVersion;
19848
+ }
19849
+ if (message.weeks?.length) {
19850
+ obj.weeks = message.weeks.map((e) => AISessionScoreWeek.toJSON(e));
19851
+ }
19852
+ return obj;
19853
+ },
19854
+
19855
+ create<I extends Exact<DeepPartial<GetSessionScoreTrendResponse>, I>>(base?: I): GetSessionScoreTrendResponse {
19856
+ return GetSessionScoreTrendResponse.fromPartial(base ?? ({} as any));
19857
+ },
19858
+ fromPartial<I extends Exact<DeepPartial<GetSessionScoreTrendResponse>, I>>(object: I): GetSessionScoreTrendResponse {
19859
+ const message = createBaseGetSessionScoreTrendResponse();
19860
+ message.status = (object.status !== undefined && object.status !== null)
19861
+ ? ResponseStatus.fromPartial(object.status)
19862
+ : undefined;
19863
+ message.formulaVersion = object.formulaVersion ?? "";
19864
+ message.weeks = object.weeks?.map((e) => AISessionScoreWeek.fromPartial(e)) || [];
19865
+ return message;
19866
+ },
19867
+ };
19868
+
19869
+ function createBaseAISessionScoreWeek(): AISessionScoreWeek {
19870
+ return {
19871
+ weekStart: "",
19872
+ gradedSessions: 0,
19873
+ scoredSessions: 0,
19874
+ meanScore: undefined,
19875
+ knownOutcomeSessions: 0,
19876
+ deliveredSessions: 0,
19877
+ };
19878
+ }
19879
+
19880
+ export const AISessionScoreWeek: MessageFns<AISessionScoreWeek> = {
19881
+ encode(message: AISessionScoreWeek, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
19882
+ if (message.weekStart !== "") {
19883
+ writer.uint32(10).string(message.weekStart);
19884
+ }
19885
+ if (message.gradedSessions !== 0) {
19886
+ writer.uint32(16).uint64(message.gradedSessions);
19887
+ }
19888
+ if (message.scoredSessions !== 0) {
19889
+ writer.uint32(24).uint64(message.scoredSessions);
19890
+ }
19891
+ if (message.meanScore !== undefined) {
19892
+ writer.uint32(33).double(message.meanScore);
19893
+ }
19894
+ if (message.knownOutcomeSessions !== 0) {
19895
+ writer.uint32(40).uint64(message.knownOutcomeSessions);
19896
+ }
19897
+ if (message.deliveredSessions !== 0) {
19898
+ writer.uint32(48).uint64(message.deliveredSessions);
19899
+ }
19900
+ return writer;
19901
+ },
19902
+
19903
+ decode(input: BinaryReader | Uint8Array, length?: number): AISessionScoreWeek {
19904
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
19905
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
19906
+ if (previousRecursionDepth >= 100) {
19907
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
19908
+ }
19909
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
19910
+ try {
19911
+ const end = length === undefined ? reader.len : reader.pos + length;
19912
+ const message = createBaseAISessionScoreWeek();
19913
+ while (reader.pos < end) {
19914
+ const tag = reader.uint32();
19915
+ switch (tag >>> 3) {
19916
+ case 1: {
19917
+ if (tag !== 10) {
19918
+ break;
19919
+ }
19920
+
19921
+ message.weekStart = reader.string();
19922
+ continue;
19923
+ }
19924
+ case 2: {
19925
+ if (tag !== 16) {
19926
+ break;
19927
+ }
19928
+
19929
+ message.gradedSessions = longToNumber(reader.uint64());
19930
+ continue;
19931
+ }
19932
+ case 3: {
19933
+ if (tag !== 24) {
19934
+ break;
19935
+ }
19936
+
19937
+ message.scoredSessions = longToNumber(reader.uint64());
19938
+ continue;
19939
+ }
19940
+ case 4: {
19941
+ if (tag !== 33) {
19942
+ break;
19943
+ }
19944
+
19945
+ message.meanScore = reader.double();
19946
+ continue;
19947
+ }
19948
+ case 5: {
19949
+ if (tag !== 40) {
19950
+ break;
19951
+ }
19952
+
19953
+ message.knownOutcomeSessions = longToNumber(reader.uint64());
19954
+ continue;
19955
+ }
19956
+ case 6: {
19957
+ if (tag !== 48) {
19958
+ break;
19959
+ }
19960
+
19961
+ message.deliveredSessions = longToNumber(reader.uint64());
19962
+ continue;
19963
+ }
19964
+ }
19965
+ if ((tag & 7) === 4 || tag === 0) {
19966
+ break;
19967
+ }
19968
+ reader.skip(tag & 7);
19969
+ }
19970
+ return message;
19971
+ } finally {
19972
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
19973
+ }
19974
+ },
19975
+
19976
+ fromJSON(object: any): AISessionScoreWeek {
19977
+ return {
19978
+ weekStart: isSet(object.weekStart)
19979
+ ? globalThis.String(object.weekStart)
19980
+ : isSet(object.week_start)
19981
+ ? globalThis.String(object.week_start)
19982
+ : "",
19983
+ gradedSessions: isSet(object.gradedSessions)
19984
+ ? globalThis.Number(object.gradedSessions)
19985
+ : isSet(object.graded_sessions)
19986
+ ? globalThis.Number(object.graded_sessions)
19987
+ : 0,
19988
+ scoredSessions: isSet(object.scoredSessions)
19989
+ ? globalThis.Number(object.scoredSessions)
19990
+ : isSet(object.scored_sessions)
19991
+ ? globalThis.Number(object.scored_sessions)
19992
+ : 0,
19993
+ meanScore: isSet(object.meanScore)
19994
+ ? globalThis.Number(object.meanScore)
19995
+ : isSet(object.mean_score)
19996
+ ? globalThis.Number(object.mean_score)
19997
+ : undefined,
19998
+ knownOutcomeSessions: isSet(object.knownOutcomeSessions)
19999
+ ? globalThis.Number(object.knownOutcomeSessions)
20000
+ : isSet(object.known_outcome_sessions)
20001
+ ? globalThis.Number(object.known_outcome_sessions)
20002
+ : 0,
20003
+ deliveredSessions: isSet(object.deliveredSessions)
20004
+ ? globalThis.Number(object.deliveredSessions)
20005
+ : isSet(object.delivered_sessions)
20006
+ ? globalThis.Number(object.delivered_sessions)
20007
+ : 0,
20008
+ };
20009
+ },
20010
+
20011
+ toJSON(message: AISessionScoreWeek): unknown {
20012
+ const obj: any = {};
20013
+ if (message.weekStart !== "") {
20014
+ obj.weekStart = message.weekStart;
20015
+ }
20016
+ if (message.gradedSessions !== 0) {
20017
+ obj.gradedSessions = Math.round(message.gradedSessions);
20018
+ }
20019
+ if (message.scoredSessions !== 0) {
20020
+ obj.scoredSessions = Math.round(message.scoredSessions);
20021
+ }
20022
+ if (message.meanScore !== undefined) {
20023
+ obj.meanScore = floatToJson(message.meanScore);
20024
+ }
20025
+ if (message.knownOutcomeSessions !== 0) {
20026
+ obj.knownOutcomeSessions = Math.round(message.knownOutcomeSessions);
20027
+ }
20028
+ if (message.deliveredSessions !== 0) {
20029
+ obj.deliveredSessions = Math.round(message.deliveredSessions);
20030
+ }
20031
+ return obj;
20032
+ },
20033
+
20034
+ create<I extends Exact<DeepPartial<AISessionScoreWeek>, I>>(base?: I): AISessionScoreWeek {
20035
+ return AISessionScoreWeek.fromPartial(base ?? ({} as any));
20036
+ },
20037
+ fromPartial<I extends Exact<DeepPartial<AISessionScoreWeek>, I>>(object: I): AISessionScoreWeek {
20038
+ const message = createBaseAISessionScoreWeek();
20039
+ message.weekStart = object.weekStart ?? "";
20040
+ message.gradedSessions = object.gradedSessions ?? 0;
20041
+ message.scoredSessions = object.scoredSessions ?? 0;
20042
+ message.meanScore = object.meanScore ?? undefined;
20043
+ message.knownOutcomeSessions = object.knownOutcomeSessions ?? 0;
20044
+ message.deliveredSessions = object.deliveredSessions ?? 0;
20045
+ return message;
20046
+ },
20047
+ };
20048
+
20049
+ function createBaseAISessionRef(): AISessionRef {
20050
+ return { sourceSystem: "", sessionId: "" };
20051
+ }
20052
+
20053
+ export const AISessionRef: MessageFns<AISessionRef> = {
17662
20054
  encode(message: AISessionRef, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
17663
20055
  if (message.sourceSystem !== "") {
17664
20056
  writer.uint32(10).string(message.sourceSystem);
@@ -23131,6 +25523,19 @@ export interface AIGatewayService {
23131
25523
  * calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
23132
25524
  */
23133
25525
  GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
25526
+ /**
25527
+ * One session's latest rubric grades, the score computed from them on this read, and its latest insights with
25528
+ * their cause and action; each part absent until its job has run. Mirrors ai.api.v1.
25529
+ */
25530
+ GetSessionAnalysis(request: GetSessionAnalysisRequest, metadata?: Metadata): Promise<GetSessionAnalysisResponse>;
25531
+ /**
25532
+ * A project's graded sessions, or one person's, per ISO week (UTC, by last activity): counts, the mean score and
25533
+ * outcomes delivered. Directional. Mirrors ai.api.v1.
25534
+ */
25535
+ GetSessionScoreTrend(
25536
+ request: GetSessionScoreTrendRequest,
25537
+ metadata?: Metadata,
25538
+ ): Promise<GetSessionScoreTrendResponse>;
23134
25539
  /**
23135
25540
  * Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
23136
25541
  * per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
@@ -23177,6 +25582,8 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
23177
25582
  this.ListResourceRankings = this.ListResourceRankings.bind(this);
23178
25583
  this.ListModelActivity = this.ListModelActivity.bind(this);
23179
25584
  this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
25585
+ this.GetSessionAnalysis = this.GetSessionAnalysis.bind(this);
25586
+ this.GetSessionScoreTrend = this.GetSessionScoreTrend.bind(this);
23180
25587
  this.StreamEntitlements = this.StreamEntitlements.bind(this);
23181
25588
  this.ListRelayHeartbeats = this.ListRelayHeartbeats.bind(this);
23182
25589
  }
@@ -23339,6 +25746,21 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
23339
25746
  return promise.then((data) => SessionUsageTrendResponse.decode(new BinaryReader(data)));
23340
25747
  }
23341
25748
 
25749
+ GetSessionAnalysis(request: GetSessionAnalysisRequest, metadata?: Metadata): Promise<GetSessionAnalysisResponse> {
25750
+ const data = GetSessionAnalysisRequest.encode(request).finish();
25751
+ const promise = this.rpc.request(this.service, "GetSessionAnalysis", data, metadata);
25752
+ return promise.then((data) => GetSessionAnalysisResponse.decode(new BinaryReader(data)));
25753
+ }
25754
+
25755
+ GetSessionScoreTrend(
25756
+ request: GetSessionScoreTrendRequest,
25757
+ metadata?: Metadata,
25758
+ ): Promise<GetSessionScoreTrendResponse> {
25759
+ const data = GetSessionScoreTrendRequest.encode(request).finish();
25760
+ const promise = this.rpc.request(this.service, "GetSessionScoreTrend", data, metadata);
25761
+ return promise.then((data) => GetSessionScoreTrendResponse.decode(new BinaryReader(data)));
25762
+ }
25763
+
23342
25764
  StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot> {
23343
25765
  const data = StreamEntitlementsRequest.encode(request).finish();
23344
25766
  const result = this.rpc.serverStreamingRequest(this.service, "StreamEntitlements", data, metadata);