@githits/mcp 0.24.0 → 0.25.1

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/client.d.ts CHANGED
@@ -1,3 +1,9 @@
1
+ /** Invalid explicit session configuration; never includes the supplied value. */
2
+ declare class SessionIdConfigError extends Error {
3
+ constructor();
4
+ }
5
+ /** Validate an explicit identifier without trimming, hashing, or caching it. */
6
+ declare function getEnvSessionId(env?: Record<string, string | undefined>): string | undefined;
1
7
  /**
2
8
  * Agent identity: the tool/IDE driving the CLI.
3
9
  */
@@ -904,6 +910,169 @@ declare class GitHitsServiceImpl implements GitHitsService {
904
910
  private request;
905
911
  private createError;
906
912
  }
913
+ type GrepCorpus = "SOURCE" | "DOCUMENTATION" | "ALL";
914
+ type GrepTraversal = "COMPLETE" | "RESUMABLE_LIMIT" | "NON_RESUMABLE_PARTIAL" | "FAILED" | "CURSOR_EXPIRED";
915
+ /** Observed readiness; UNSPECIFIED denotes a scope not yet visited in this page. */
916
+ type GrepReadiness = "UNSPECIFIED" | "CURRENT" | "STALE" | "NOT_AVAILABLE" | "MISSING_REF" | "READER_OPEN_FAILED" | "INCOMPLETE" | "RESOURCE_LIMIT" | "VERSION_UNSUPPORTED" | "READ_FAILED";
917
+ interface GrepPathSelector {
918
+ kind: "EXACT" | "PREFIX" | "GLOB";
919
+ value: string;
920
+ }
921
+ interface GrepTarget {
922
+ target: string;
923
+ corpus?: GrepCorpus;
924
+ pathSelectors?: GrepPathSelector[];
925
+ allowUnscoped?: boolean;
926
+ }
927
+ interface GrepParams {
928
+ targets: GrepTarget[];
929
+ pattern: string;
930
+ patternType: "REGEX" | "LITERAL";
931
+ caseSensitive: boolean;
932
+ contextLinesBefore: number;
933
+ contextLinesAfter: number;
934
+ maxMatches?: number;
935
+ cursor?: string;
936
+ waitTimeoutMs?: number;
937
+ includeDetailedFields: boolean;
938
+ }
939
+ interface GrepLineSlice {
940
+ content: string;
941
+ startByte: number;
942
+ endByte: number;
943
+ originalLineBytes: number;
944
+ }
945
+ interface GrepContentSafety {
946
+ filtered: boolean;
947
+ modifications?: ContentModification[];
948
+ }
949
+ interface GrepReadAction {
950
+ target: string;
951
+ path: string | null;
952
+ startLine: number;
953
+ endLine: number;
954
+ }
955
+ interface GrepHitBase {
956
+ targetIndex: number;
957
+ line: number;
958
+ lineSlice: GrepLineSlice;
959
+ contextBeforeSlices: GrepLineSlice[];
960
+ contextAfterSlices: GrepLineSlice[];
961
+ read: GrepReadAction;
962
+ contentSafety: GrepContentSafety;
963
+ lineContent?: string;
964
+ matchStartByte: number;
965
+ matchEndByte: number;
966
+ sourceMatchStartByte?: number;
967
+ sourceMatchEndByte?: number;
968
+ }
969
+ interface GrepRepositoryHit extends GrepHitBase {
970
+ __typename: "GrepRepositoryHit";
971
+ read: GrepReadAction & {
972
+ path: string;
973
+ };
974
+ filePath: string;
975
+ repoUrl?: string;
976
+ commitSha?: string;
977
+ repositoryFilePath?: string;
978
+ }
979
+ interface GrepSiteHit extends GrepHitBase {
980
+ __typename: "GrepSiteHit";
981
+ read: GrepReadAction & {
982
+ path: null;
983
+ };
984
+ pageUrl: string;
985
+ }
986
+ type GrepHit = GrepRepositoryHit | GrepSiteHit;
987
+ interface GrepFileIssue {
988
+ filePath: string;
989
+ code: string;
990
+ line: number;
991
+ contentSafety: GrepContentSafety;
992
+ lineBytes?: number;
993
+ matchStartByte?: number | null;
994
+ matchEndByte?: number | null;
995
+ }
996
+ interface GrepTargetStatus {
997
+ targetIndex: number;
998
+ requestedInputIndices: number[];
999
+ kind: "REPOSITORY" | "SITE";
1000
+ target: string;
1001
+ traversal: GrepTraversal;
1002
+ readiness: GrepReadiness;
1003
+ errorCode: string | null;
1004
+ retryable: boolean;
1005
+ publicMessage: string | null;
1006
+ requestedRef: string | null;
1007
+ commitSha: string | null;
1008
+ corpus: GrepCorpus | null;
1009
+ filesScanned: number | null;
1010
+ filesInScope: number | null;
1011
+ binaryFilesSkipped: number | null;
1012
+ filesTooLargeSkipped: number | null;
1013
+ fileIssues: GrepFileIssue[] | null;
1014
+ fileIssuesOmitted: number | null;
1015
+ repoUrl: string | null;
1016
+ canonicalSite: string | null;
1017
+ urlPrefixes?: string[];
1018
+ }
1019
+ interface GrepUnavailableTarget {
1020
+ inputIndex: number;
1021
+ target: string;
1022
+ reason: string;
1023
+ retryable: boolean;
1024
+ progressRef: string | null;
1025
+ suggestedSiteTargets: string[] | null;
1026
+ }
1027
+ interface GrepResult {
1028
+ hits: GrepHit[];
1029
+ targets: GrepTargetStatus[];
1030
+ unavailableTargets: GrepUnavailableTarget[];
1031
+ traversal: GrepTraversal;
1032
+ nextCursor: string | null;
1033
+ totalMatches: number;
1034
+ }
1035
+ interface GrepService {
1036
+ grep(params: GrepParams): Promise<GrepResult>;
1037
+ }
1038
+ interface GrepServiceRuntime {
1039
+ clientHeaders?: ClientHeaderBuilder;
1040
+ userAgent?: string;
1041
+ clientVersion?: string;
1042
+ diagnostics?: ServiceDiagnostics;
1043
+ }
1044
+ /** Public backend error details, retained without interpreting message text. */
1045
+ declare class GrepGraphQLError extends Error {
1046
+ readonly extensions: Record<string, unknown>;
1047
+ constructor(message: string, extensions?: Record<string, unknown>);
1048
+ }
1049
+ declare class GrepBackendError extends Error {
1050
+ readonly status?: number | undefined;
1051
+ readonly graphqlCode?: string | undefined;
1052
+ readonly retryable?: boolean | undefined;
1053
+ constructor(message: string, status?: number | undefined, graphqlCode?: string | undefined, retryable?: boolean | undefined);
1054
+ }
1055
+ declare class GrepAccessError extends Error {
1056
+ constructor(message: string);
1057
+ }
1058
+ declare class GrepNetworkError extends Error {
1059
+ constructor(message: string, options?: {
1060
+ cause?: unknown;
1061
+ });
1062
+ }
1063
+ declare class MalformedGrepResponseError extends Error {
1064
+ constructor();
1065
+ }
1066
+ /** One transport-neutral request for a mixed-source grep page. */
1067
+ declare class GrepServiceImpl implements GrepService {
1068
+ private readonly endpointUrl;
1069
+ private readonly tokenProvider;
1070
+ private readonly fetchFn;
1071
+ private readonly runtime;
1072
+ constructor(endpointUrl: string, tokenProvider: TokenProvider, fetchFn?: typeof fetch, runtime?: GrepServiceRuntime);
1073
+ grep(params: GrepParams): Promise<GrepResult>;
1074
+ private executeGrep;
1075
+ }
907
1076
  type ListFileIntent = "PRODUCTION" | "TEST" | "BENCHMARK" | "EXAMPLE" | "GENERATED" | "FIXTURE" | "BUILD" | "VENDOR";
908
1077
  interface ListParams {
909
1078
  target: string;
@@ -1870,4 +2039,4 @@ declare class RefreshingGitHitsService implements GitHitsService {
1870
2039
  */
1871
2040
  private withTokenRefresh;
1872
2041
  }
1873
- export { AgentInfo, CodeDiffError, CodeDiffErrorDetails, CodeDiffErrorRef, CodeDiffMode, CodeDiffOptions, CodeDiffPackageInfo, CodeDiffPackageTarget, CodeDiffParams, CodeDiffPartialResult, CodeDiffRefKind, CodeDiffRefResolution, CodeDiffRepositoryTarget, CodeDiffResult, CodeDiffService, CodeDiffTarget, CodeDiffVersionSource, CodeNavigationService, CodeNavigationServiceImpl, CodeSymbolCandidate, CodeSymbolResolution, CodeSymbolSuggestion, ContentModification, ContentSafety, DEFAULT_API_URL, DEFAULT_CODE_NAV_URL, DEFAULT_MCP_URL, GitHitsService, GitHitsServiceImpl, ListAccessError, ListAction, ListAvailableVersion, ListBackendError, ListBrowseAction, ListEntry, ListEntryKind, ListFileIntent, ListGraphQLError, ListIndexingEstimate, ListInventoryKind, ListNetworkError, ListParams, ListReadAction, ListResolution, ListResult, ListService, ListServiceImpl, ListSiteJob, ListSitePreparation, ListSiteWait, ListSiteWaitOutcome, ListTargetIdentity, ListTargetResolution, MalformedListResponseError, PKGSEER_REGISTRY_LIST, PackageIntelligenceService, PackageIntelligenceServiceImpl, RawCodeDiff, RawCodeDiffContentCoverage, RawCodeDiffContentFailure, RawCodeDiffFile, RawCodeDiffFileContentStatus, RawCodeDiffFileStatus, RawCodeDiffPathEncoding, RawCodeDiffScope, RawCodeDiffScopeStatus, RawCodeDiffSummary, ReadCodeResult, ReadDocsResult, ReadParams, ReadResult, ReadService, ReadServiceImpl, ReadSymbolResolutionResult, ReadTarget, RefreshingGitHitsService, ServiceDiagnostics, TokenProvider, createClientHeaderBuilder, createStaticTokenProvider, getApiUrl, getCodeNavigationUrl, getEnvApiToken, getMcpUrl, toPkgseerRegistry, toPkgseerRegistryLowercase };
2042
+ export { AgentInfo, CodeDiffError, CodeDiffErrorDetails, CodeDiffErrorRef, CodeDiffMode, CodeDiffOptions, CodeDiffPackageInfo, CodeDiffPackageTarget, CodeDiffParams, CodeDiffPartialResult, CodeDiffRefKind, CodeDiffRefResolution, CodeDiffRepositoryTarget, CodeDiffResult, CodeDiffService, CodeDiffTarget, CodeDiffVersionSource, CodeNavigationService, CodeNavigationServiceImpl, CodeSymbolCandidate, CodeSymbolResolution, CodeSymbolSuggestion, ContentModification, ContentSafety, DEFAULT_API_URL, DEFAULT_CODE_NAV_URL, DEFAULT_MCP_URL, GitHitsService, GitHitsServiceImpl, GrepAccessError, GrepBackendError, GrepContentSafety, GrepCorpus, GrepFileIssue, GrepGraphQLError, GrepHit, GrepLineSlice, GrepNetworkError, GrepParams, GrepPathSelector, GrepReadAction, GrepReadiness, GrepRepositoryHit, GrepResult, GrepService, GrepServiceImpl, GrepSiteHit, GrepTarget, GrepTargetStatus, GrepTraversal, GrepUnavailableTarget, ListAccessError, ListAction, ListAvailableVersion, ListBackendError, ListBrowseAction, ListEntry, ListEntryKind, ListFileIntent, ListGraphQLError, ListIndexingEstimate, ListInventoryKind, ListNetworkError, ListParams, ListReadAction, ListResolution, ListResult, ListService, ListServiceImpl, ListSiteJob, ListSitePreparation, ListSiteWait, ListSiteWaitOutcome, ListTargetIdentity, ListTargetResolution, MalformedGrepResponseError, MalformedListResponseError, PKGSEER_REGISTRY_LIST, PackageIntelligenceService, PackageIntelligenceServiceImpl, RawCodeDiff, RawCodeDiffContentCoverage, RawCodeDiffContentFailure, RawCodeDiffFile, RawCodeDiffFileContentStatus, RawCodeDiffFileStatus, RawCodeDiffPathEncoding, RawCodeDiffScope, RawCodeDiffScopeStatus, RawCodeDiffSummary, ReadCodeResult, ReadDocsResult, ReadParams, ReadResult, ReadService, ReadServiceImpl, ReadSymbolResolutionResult, ReadTarget, RefreshingGitHitsService, ServiceDiagnostics, SessionIdConfigError, TokenProvider, createClientHeaderBuilder, createStaticTokenProvider, getApiUrl, getCodeNavigationUrl, getEnvApiToken, getEnvSessionId, getMcpUrl, toPkgseerRegistry, toPkgseerRegistryLowercase };
package/dist/client.js CHANGED
@@ -1 +1 @@
1
- import{DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,GitHitsServiceImpl2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,CodeDiffError2,CodeNavigationServiceImpl2,ListAccessError2,ListGraphQLError2,ListBackendError2,ListNetworkError2,MalformedListResponseError2,ListServiceImpl2,PackageIntelligenceServiceImpl2,ReadServiceImpl2,RefreshingGitHitsService2,createStaticTokenProvider2,createClientHeaderBuilder2}from"./shared/chunk-1tvgyfva.js";export{CodeDiffError2 as CodeDiffError,CodeNavigationServiceImpl2 as CodeNavigationServiceImpl,DEFAULT_API_URL2 as DEFAULT_API_URL,DEFAULT_CODE_NAV_URL2 as DEFAULT_CODE_NAV_URL,DEFAULT_MCP_URL2 as DEFAULT_MCP_URL,GitHitsServiceImpl2 as GitHitsServiceImpl,ListAccessError2 as ListAccessError,ListBackendError2 as ListBackendError,ListGraphQLError2 as ListGraphQLError,ListNetworkError2 as ListNetworkError,ListServiceImpl2 as ListServiceImpl,MalformedListResponseError2 as MalformedListResponseError,PKGSEER_REGISTRY_LIST2 as PKGSEER_REGISTRY_LIST,PackageIntelligenceServiceImpl2 as PackageIntelligenceServiceImpl,ReadServiceImpl2 as ReadServiceImpl,RefreshingGitHitsService2 as RefreshingGitHitsService,createClientHeaderBuilder2 as createClientHeaderBuilder,createStaticTokenProvider2 as createStaticTokenProvider,getApiUrl2 as getApiUrl,getCodeNavigationUrl2 as getCodeNavigationUrl,getEnvApiToken2 as getEnvApiToken,getMcpUrl2 as getMcpUrl,toPkgseerRegistry2 as toPkgseerRegistry,toPkgseerRegistryLowercase2 as toPkgseerRegistryLowercase};
1
+ import{DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,GitHitsServiceImpl2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,CodeDiffError2,CodeNavigationServiceImpl2,GrepGraphQLError2,GrepBackendError2,GrepAccessError2,GrepNetworkError2,MalformedGrepResponseError2,GrepServiceImpl2,ListAccessError2,ListGraphQLError2,ListBackendError2,ListNetworkError2,MalformedListResponseError2,ListServiceImpl2,PackageIntelligenceServiceImpl2,ReadServiceImpl2,RefreshingGitHitsService2,createStaticTokenProvider2,SessionIdConfigError2,getEnvSessionId2,createClientHeaderBuilder2}from"./shared/chunk-ge2panr3.js";export{CodeDiffError2 as CodeDiffError,CodeNavigationServiceImpl2 as CodeNavigationServiceImpl,DEFAULT_API_URL2 as DEFAULT_API_URL,DEFAULT_CODE_NAV_URL2 as DEFAULT_CODE_NAV_URL,DEFAULT_MCP_URL2 as DEFAULT_MCP_URL,GitHitsServiceImpl2 as GitHitsServiceImpl,GrepAccessError2 as GrepAccessError,GrepBackendError2 as GrepBackendError,GrepGraphQLError2 as GrepGraphQLError,GrepNetworkError2 as GrepNetworkError,GrepServiceImpl2 as GrepServiceImpl,ListAccessError2 as ListAccessError,ListBackendError2 as ListBackendError,ListGraphQLError2 as ListGraphQLError,ListNetworkError2 as ListNetworkError,ListServiceImpl2 as ListServiceImpl,MalformedGrepResponseError2 as MalformedGrepResponseError,MalformedListResponseError2 as MalformedListResponseError,PKGSEER_REGISTRY_LIST2 as PKGSEER_REGISTRY_LIST,PackageIntelligenceServiceImpl2 as PackageIntelligenceServiceImpl,ReadServiceImpl2 as ReadServiceImpl,RefreshingGitHitsService2 as RefreshingGitHitsService,SessionIdConfigError2 as SessionIdConfigError,createClientHeaderBuilder2 as createClientHeaderBuilder,createStaticTokenProvider2 as createStaticTokenProvider,getApiUrl2 as getApiUrl,getCodeNavigationUrl2 as getCodeNavigationUrl,getEnvApiToken2 as getEnvApiToken,getEnvSessionId2 as getEnvSessionId,getMcpUrl2 as getMcpUrl,toPkgseerRegistry2 as toPkgseerRegistry,toPkgseerRegistryLowercase2 as toPkgseerRegistryLowercase};
package/dist/index.d.ts CHANGED
@@ -634,6 +634,131 @@ interface GitHitsService {
634
634
  /** Search for code examples. Returns markdown-formatted result. */
635
635
  search(params: SearchParams, options?: GitHitsServiceRequestOptions): Promise<string>;
636
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
+ }
637
762
  type ListFileIntent = "PRODUCTION" | "TEST" | "BENCHMARK" | "EXAMPLE" | "GENERATED" | "FIXTURE" | "BUILD" | "VENDOR";
638
763
  interface ListParams {
639
764
  target: string;
@@ -1485,6 +1610,7 @@ interface McpToolServices {
1485
1610
  packageIntelligenceService: PackageIntelligenceService;
1486
1611
  listService: ListService;
1487
1612
  readService: ReadService;
1613
+ grepService: GrepService;
1488
1614
  }
1489
1615
  interface McpServerMetadata {
1490
1616
  name: string;