@githits/mcp 0.23.0 → 0.25.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -75,6 +75,14 @@ declare const registryMap: {
75
75
  readonly swift: "SWIFT";
76
76
  };
77
77
  type PkgseerRegistry = (typeof registryMap)[keyof typeof registryMap];
78
+ /** A backend-selected address for a code or documentation read. */
79
+ interface ReadTarget {
80
+ target: string;
81
+ path?: string;
82
+ selector?: string;
83
+ startLine?: number;
84
+ endLine?: number;
85
+ }
78
86
  /**
79
87
  * Back-compat alias — the canonical registry union now lives in
80
88
  * `src/shared/pkgseer-registry.ts`. Re-exported here so existing
@@ -314,6 +322,8 @@ interface UnifiedSearchLocator {
314
322
  language?: string;
315
323
  }
316
324
  interface UnifiedSearchHit {
325
+ /** Backend-selected action; absent only for older custom providers. */
326
+ readTarget?: ReadTarget | null;
317
327
  id: string;
318
328
  resultType: UnifiedSearchResultType;
319
329
  targetLabel: string;
@@ -508,6 +518,8 @@ interface ReadFileParams {
508
518
  waitTimeoutMs?: number;
509
519
  }
510
520
  interface ReadFileResult {
521
+ /** Served action selected by unified read; legacy readers may omit it. */
522
+ readTarget?: ReadTarget | null;
511
523
  filePath?: string;
512
524
  language?: string;
513
525
  totalLines?: number;
@@ -622,6 +634,245 @@ interface GitHitsService {
622
634
  /** Search for code examples. Returns markdown-formatted result. */
623
635
  search(params: SearchParams, options?: GitHitsServiceRequestOptions): Promise<string>;
624
636
  }
637
+ type GrepCorpus = "SOURCE" | "DOCUMENTATION" | "ALL";
638
+ type GrepTraversal = "COMPLETE" | "RESUMABLE_LIMIT" | "NON_RESUMABLE_PARTIAL" | "FAILED" | "CURSOR_EXPIRED";
639
+ /** Observed readiness; UNSPECIFIED denotes a scope not yet visited in this page. */
640
+ type GrepReadiness = "UNSPECIFIED" | "CURRENT" | "STALE" | "NOT_AVAILABLE" | "MISSING_REF" | "READER_OPEN_FAILED" | "INCOMPLETE" | "RESOURCE_LIMIT" | "VERSION_UNSUPPORTED" | "READ_FAILED";
641
+ interface GrepPathSelector {
642
+ kind: "EXACT" | "PREFIX" | "GLOB";
643
+ value: string;
644
+ }
645
+ interface GrepTarget {
646
+ target: string;
647
+ corpus?: GrepCorpus;
648
+ pathSelectors?: GrepPathSelector[];
649
+ allowUnscoped?: boolean;
650
+ }
651
+ interface GrepParams {
652
+ targets: GrepTarget[];
653
+ pattern: string;
654
+ patternType: "REGEX" | "LITERAL";
655
+ caseSensitive: boolean;
656
+ contextLinesBefore: number;
657
+ contextLinesAfter: number;
658
+ maxMatches?: number;
659
+ cursor?: string;
660
+ waitTimeoutMs?: number;
661
+ includeDetailedFields: boolean;
662
+ }
663
+ interface GrepLineSlice {
664
+ content: string;
665
+ startByte: number;
666
+ endByte: number;
667
+ originalLineBytes: number;
668
+ }
669
+ interface GrepContentSafety {
670
+ filtered: boolean;
671
+ modifications?: ContentModification[];
672
+ }
673
+ interface GrepReadAction {
674
+ target: string;
675
+ path: string | null;
676
+ startLine: number;
677
+ endLine: number;
678
+ }
679
+ interface GrepHitBase {
680
+ targetIndex: number;
681
+ line: number;
682
+ lineSlice: GrepLineSlice;
683
+ contextBeforeSlices: GrepLineSlice[];
684
+ contextAfterSlices: GrepLineSlice[];
685
+ read: GrepReadAction;
686
+ contentSafety: GrepContentSafety;
687
+ lineContent?: string;
688
+ matchStartByte: number;
689
+ matchEndByte: number;
690
+ sourceMatchStartByte?: number;
691
+ sourceMatchEndByte?: number;
692
+ }
693
+ interface GrepRepositoryHit extends GrepHitBase {
694
+ __typename: "GrepRepositoryHit";
695
+ read: GrepReadAction & {
696
+ path: string;
697
+ };
698
+ filePath: string;
699
+ repoUrl?: string;
700
+ commitSha?: string;
701
+ repositoryFilePath?: string;
702
+ }
703
+ interface GrepSiteHit extends GrepHitBase {
704
+ __typename: "GrepSiteHit";
705
+ read: GrepReadAction & {
706
+ path: null;
707
+ };
708
+ pageUrl: string;
709
+ }
710
+ type GrepHit = GrepRepositoryHit | GrepSiteHit;
711
+ interface GrepFileIssue {
712
+ filePath: string;
713
+ code: string;
714
+ line: number;
715
+ contentSafety: GrepContentSafety;
716
+ lineBytes?: number;
717
+ matchStartByte?: number | null;
718
+ matchEndByte?: number | null;
719
+ }
720
+ interface GrepTargetStatus {
721
+ targetIndex: number;
722
+ requestedInputIndices: number[];
723
+ kind: "REPOSITORY" | "SITE";
724
+ target: string;
725
+ traversal: GrepTraversal;
726
+ readiness: GrepReadiness;
727
+ errorCode: string | null;
728
+ retryable: boolean;
729
+ publicMessage: string | null;
730
+ requestedRef: string | null;
731
+ commitSha: string | null;
732
+ corpus: GrepCorpus | null;
733
+ filesScanned: number | null;
734
+ filesInScope: number | null;
735
+ binaryFilesSkipped: number | null;
736
+ filesTooLargeSkipped: number | null;
737
+ fileIssues: GrepFileIssue[] | null;
738
+ fileIssuesOmitted: number | null;
739
+ repoUrl: string | null;
740
+ canonicalSite: string | null;
741
+ urlPrefixes?: string[];
742
+ }
743
+ interface GrepUnavailableTarget {
744
+ inputIndex: number;
745
+ target: string;
746
+ reason: string;
747
+ retryable: boolean;
748
+ progressRef: string | null;
749
+ suggestedSiteTargets: string[] | null;
750
+ }
751
+ interface GrepResult {
752
+ hits: GrepHit[];
753
+ targets: GrepTargetStatus[];
754
+ unavailableTargets: GrepUnavailableTarget[];
755
+ traversal: GrepTraversal;
756
+ nextCursor: string | null;
757
+ totalMatches: number;
758
+ }
759
+ interface GrepService {
760
+ grep(params: GrepParams): Promise<GrepResult>;
761
+ }
762
+ type ListFileIntent = "PRODUCTION" | "TEST" | "BENCHMARK" | "EXAMPLE" | "GENERATED" | "FIXTURE" | "BUILD" | "VENDOR";
763
+ interface ListParams {
764
+ target: string;
765
+ paths?: string[];
766
+ recursive?: boolean;
767
+ fileTypes?: string[];
768
+ languages?: string[];
769
+ intents?: ListFileIntent[];
770
+ limit?: number;
771
+ after?: string;
772
+ waitTimeoutMs?: number;
773
+ includeDetailedFields: boolean;
774
+ /** Select exact read actions for compact site text; detailed fields always include them. */
775
+ includeReadActions?: boolean;
776
+ }
777
+ type ListInventoryKind = "SOURCE" | "SITE";
778
+ type ListEntryKind = "FILE" | "PAGE" | "DIRECTORY";
779
+ type ListSiteWaitOutcome = "COMPLETED" | "DISCARDED" | "CANCELLED" | "TIMEOUT";
780
+ interface ListReadAction {
781
+ target: string;
782
+ path: string | null;
783
+ }
784
+ interface ListBrowseAction {
785
+ target: string;
786
+ paths: string[] | null;
787
+ }
788
+ interface ListEntry {
789
+ kind: ListEntryKind;
790
+ path: string;
791
+ title?: string | null;
792
+ language?: string | null;
793
+ fileType?: string | null;
794
+ intent?: string | null;
795
+ byteSize?: number | null;
796
+ lineCount?: number | null;
797
+ contentHash?: string | null;
798
+ read?: ListReadAction | null;
799
+ browse?: ListBrowseAction | null;
800
+ }
801
+ interface ListAvailableVersion {
802
+ version: string | null;
803
+ ref: string;
804
+ }
805
+ interface ListResolution {
806
+ requestedVersion: string | null;
807
+ requestedRef: string | null;
808
+ resolvedRef: string | null;
809
+ commitSha: string | null;
810
+ }
811
+ interface ListTargetIdentity {
812
+ kind: string | null;
813
+ registry: string | null;
814
+ packageName: string | null;
815
+ version: string | null;
816
+ repoUrl: string | null;
817
+ gitRef: string | null;
818
+ commitSha: string | null;
819
+ }
820
+ interface ListTargetResolution {
821
+ requested: ListTargetIdentity | null;
822
+ resolvedRequested: ListTargetIdentity | null;
823
+ served: ListTargetIdentity | null;
824
+ freshness: string | null;
825
+ freshnessReason: string | null;
826
+ indexingRef: string | null;
827
+ availableVersions: ListAvailableVersion[] | null;
828
+ availableRefs: ListAvailableVersion[] | null;
829
+ suggestedRefs: ListAvailableVersion[] | null;
830
+ }
831
+ interface ListIndexingEstimate {
832
+ lowerSeconds: number | null;
833
+ upperSeconds: number | null;
834
+ elapsedSeconds: number | null;
835
+ sampleCount: number | null;
836
+ source: string | null;
837
+ }
838
+ interface ListSiteJob {
839
+ mode: string | null;
840
+ state: string;
841
+ }
842
+ interface ListSiteWait {
843
+ mode: string | null;
844
+ outcome: ListSiteWaitOutcome;
845
+ }
846
+ interface ListSitePreparation {
847
+ selected: number;
848
+ enqueued: number;
849
+ activeJobs: ListSiteJob[];
850
+ awaited: ListSiteWait[];
851
+ }
852
+ interface ListResult {
853
+ inventoryKind: ListInventoryKind;
854
+ requestedTarget: string;
855
+ canonicalTarget: string | null;
856
+ entries: ListEntry[];
857
+ hasMore: boolean;
858
+ nextCursor: string | null;
859
+ indexedVersion: string | null;
860
+ resolution?: ListResolution | null;
861
+ targetResolution?: ListTargetResolution | null;
862
+ codeIndexState: string | null;
863
+ indexingStatus: string | null;
864
+ indexingRef: string | null;
865
+ availableVersions?: ListAvailableVersion[] | null;
866
+ indexingEstimate?: ListIndexingEstimate | null;
867
+ inventoryState: "AVAILABLE" | "EMPTY" | null;
868
+ crawlStatus: "IDLE" | "RUNNING" | "COMPLETE" | "FAILED" | null;
869
+ coverageState: "NONE" | "PARTIAL" | "CAPPED" | "COMPLETE" | null;
870
+ coverageReason: string | null;
871
+ preparation: ListSitePreparation | null;
872
+ }
873
+ interface ListService {
874
+ list(params: ListParams): Promise<ListResult>;
875
+ }
625
876
  interface PackageSummaryParams {
626
877
  registry: PkgseerRegistry;
627
878
  packageName: string;
@@ -1277,6 +1528,8 @@ interface PackageDocContentRange {
1277
1528
  anchor?: string;
1278
1529
  }
1279
1530
  interface PackageDocResult {
1531
+ /** Enclosing served selection; legacy readers may omit it. */
1532
+ readTarget?: ReadTarget;
1280
1533
  registry?: string;
1281
1534
  packageName?: string;
1282
1535
  version?: string;
@@ -1355,7 +1608,9 @@ interface McpToolServices {
1355
1608
  githitsService: GitHitsService;
1356
1609
  codeNavigationService: CodeNavigationService;
1357
1610
  packageIntelligenceService: PackageIntelligenceService;
1611
+ listService: ListService;
1358
1612
  readService: ReadService;
1613
+ grepService: GrepService;
1359
1614
  }
1360
1615
  interface McpServerMetadata {
1361
1616
  name: string;