@githits/mcp 0.26.0 → 0.27.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/README.md +16 -0
- package/dist/client.d.ts +136 -28
- package/dist/client.js +1 -1
- package/dist/index.d.ts +117 -28
- package/dist/index.js +38 -35
- package/dist/shared/chunk-4gcqyg9g.js +1528 -0
- package/dist/shared/chunk-54c4zdmn.js +352 -0
- package/dist/shared/chunk-78y1gbky.js +24 -0
- package/dist/smoke-test.d.ts +5 -2
- package/dist/smoke-test.js +5 -4
- package/dist/tools.d.ts +110 -5
- package/dist/tools.js +1 -1
- package/package.json +1 -1
- package/dist/shared/chunk-fy8ypkev.js +0 -16
- package/dist/shared/chunk-vhhae3y9.js +0 -2
- package/dist/shared/chunk-yxxmv1b1.js +0 -1778
package/README.md
CHANGED
|
@@ -18,6 +18,22 @@ update and deployment rather than through a parallel implementation.
|
|
|
18
18
|
> filesystem access, authentication implementation or storage, configuration
|
|
19
19
|
> discovery, or any other host behavior.
|
|
20
20
|
|
|
21
|
+
## Stable Target Resolution
|
|
22
|
+
|
|
23
|
+
The public inventory includes `resolve_target` by default. It ranks fuzzy public
|
|
24
|
+
package, repository and documentation-site names using the existing backend
|
|
25
|
+
resolver. Canonical targets go directly to the next tool; confidence, ambiguity
|
|
26
|
+
and malicious-content status govern continuation. This does not establish
|
|
27
|
+
vulnerability-free or upgrade-safe status.
|
|
28
|
+
|
|
29
|
+
Providers must now supply `resolveTargetService: ResolveTargetService`. Import
|
|
30
|
+
`ResolveTargetServiceImpl` and its service/request/result contracts from
|
|
31
|
+
`@githits/mcp/client`; construct it with the existing OSS endpoint and the
|
|
32
|
+
request's token provider, headers and optional diagnostics. The browser-callable
|
|
33
|
+
factory and `ResolveTargetMcpArgs` are exported from `@githits/mcp/tools`.
|
|
34
|
+
No private core or workspace-internal imports are needed. Hosted MCP must adopt
|
|
35
|
+
and deploy the released package before its clients receive the tool.
|
|
36
|
+
|
|
21
37
|
## Stable Source Diff
|
|
22
38
|
|
|
23
39
|
The public tool inventory includes `code_diff` by default. It compares raw
|
package/dist/client.d.ts
CHANGED
|
@@ -96,6 +96,22 @@ declare function toPkgseerRegistry(registry: PkgseerRegistryArg): PkgseerRegistr
|
|
|
96
96
|
* lowering a response field for user display.
|
|
97
97
|
*/
|
|
98
98
|
declare function toPkgseerRegistryLowercase(registry: PkgseerRegistry): PkgseerRegistryArg;
|
|
99
|
+
interface IndexingDurationEstimate {
|
|
100
|
+
lowerSeconds?: number;
|
|
101
|
+
upperSeconds?: number;
|
|
102
|
+
elapsedSeconds?: number;
|
|
103
|
+
sampleCount?: number;
|
|
104
|
+
source?: string;
|
|
105
|
+
}
|
|
106
|
+
/** Pending preparation evidence; total execution seconds, never a search ETA. */
|
|
107
|
+
interface DiscoveryIndexingEstimate {
|
|
108
|
+
kind: "REPOSITORY" | "DOCUMENTATION";
|
|
109
|
+
targets: string[];
|
|
110
|
+
repositoryUrl?: string;
|
|
111
|
+
commitSha?: string;
|
|
112
|
+
estimate?: IndexingDurationEstimate;
|
|
113
|
+
unavailableReason?: "NO_HISTORY" | "UNSUPPORTED_WORK";
|
|
114
|
+
}
|
|
99
115
|
/** A backend-selected address for a code or documentation read. */
|
|
100
116
|
interface ReadTarget {
|
|
101
117
|
target: string;
|
|
@@ -155,6 +171,8 @@ interface TargetResolutionIdentity {
|
|
|
155
171
|
repoUrl?: string;
|
|
156
172
|
gitRef?: string;
|
|
157
173
|
commitSha?: string;
|
|
174
|
+
/** Verified UTC committer time for this exact repository commit, not freshness. */
|
|
175
|
+
committedAt?: string;
|
|
158
176
|
site?: string;
|
|
159
177
|
}
|
|
160
178
|
type AvailableRef = AvailableVersion;
|
|
@@ -439,15 +457,6 @@ interface UnifiedSearchResult {
|
|
|
439
457
|
sourceStatus: UnifiedSearchSourceStatus[];
|
|
440
458
|
evidenceNotice?: string;
|
|
441
459
|
}
|
|
442
|
-
/** Pending preparation evidence; total execution seconds, never a search ETA. */
|
|
443
|
-
interface DiscoveryIndexingEstimate {
|
|
444
|
-
kind: "REPOSITORY" | "DOCUMENTATION";
|
|
445
|
-
targets: string[];
|
|
446
|
-
repositoryUrl?: string;
|
|
447
|
-
commitSha?: string;
|
|
448
|
-
estimate?: IndexingDurationEstimate;
|
|
449
|
-
unavailableReason?: "NO_HISTORY" | "UNSUPPORTED_WORK";
|
|
450
|
-
}
|
|
451
460
|
interface UnifiedSearchProgress {
|
|
452
461
|
searchRef: string;
|
|
453
462
|
status: UnifiedSearchSessionStatus;
|
|
@@ -486,13 +495,6 @@ interface AvailableVersion {
|
|
|
486
495
|
version?: string;
|
|
487
496
|
ref: string;
|
|
488
497
|
}
|
|
489
|
-
interface IndexingDurationEstimate {
|
|
490
|
-
lowerSeconds?: number;
|
|
491
|
-
upperSeconds?: number;
|
|
492
|
-
elapsedSeconds?: number;
|
|
493
|
-
sampleCount?: number;
|
|
494
|
-
source?: string;
|
|
495
|
-
}
|
|
496
498
|
/**
|
|
497
499
|
* Input for {@link CodeNavigationService.listFiles}.
|
|
498
500
|
*/
|
|
@@ -520,6 +522,7 @@ interface RepoFileEntry {
|
|
|
520
522
|
byteSize?: number;
|
|
521
523
|
}
|
|
522
524
|
interface ListFilesResult {
|
|
525
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
523
526
|
files: RepoFileEntry[];
|
|
524
527
|
total: number;
|
|
525
528
|
hasMore: boolean;
|
|
@@ -539,6 +542,7 @@ interface ReadFileParams {
|
|
|
539
542
|
waitTimeoutMs?: number;
|
|
540
543
|
}
|
|
541
544
|
interface ReadFileResult {
|
|
545
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
542
546
|
/** Served action selected by unified read; legacy readers may omit it. */
|
|
543
547
|
readTarget?: ReadTarget | null;
|
|
544
548
|
filePath?: string;
|
|
@@ -762,6 +766,7 @@ interface GrepRepoMatch {
|
|
|
762
766
|
type GrepRouteTaken = "SINGLE_FILE" | "CONTENT_INDEX";
|
|
763
767
|
type GrepTruncatedReason = "NONE" | "MAX_MATCHES" | "MAX_MATCHES_PER_FILE" | "DEADLINE";
|
|
764
768
|
interface GrepRepoResult {
|
|
769
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
765
770
|
matches: GrepRepoMatch[];
|
|
766
771
|
nextCursor?: string;
|
|
767
772
|
hasMore: boolean;
|
|
@@ -873,6 +878,8 @@ declare function getEnvApiToken(): string | undefined;
|
|
|
873
878
|
*/
|
|
874
879
|
interface SearchParams {
|
|
875
880
|
query: string;
|
|
881
|
+
/** Source read syntax; omission preserves the server's client default. */
|
|
882
|
+
sourceFormat?: "cli" | "mcp" | "url";
|
|
876
883
|
language?: string;
|
|
877
884
|
licenseMode?: "strict" | "yolo" | "custom";
|
|
878
885
|
includeExplanation?: boolean;
|
|
@@ -1025,6 +1032,7 @@ interface GrepUnavailableTarget {
|
|
|
1025
1032
|
suggestedSiteTargets: string[] | null;
|
|
1026
1033
|
}
|
|
1027
1034
|
interface GrepResult {
|
|
1035
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1028
1036
|
hits: GrepHit[];
|
|
1029
1037
|
targets: GrepTargetStatus[];
|
|
1030
1038
|
unavailableTargets: GrepUnavailableTarget[];
|
|
@@ -1085,6 +1093,7 @@ interface ListParams {
|
|
|
1085
1093
|
after?: string;
|
|
1086
1094
|
waitTimeoutMs?: number;
|
|
1087
1095
|
includeDetailedFields: boolean;
|
|
1096
|
+
includeTargetProvenance?: boolean;
|
|
1088
1097
|
/** Select exact read actions for compact site text; detailed fields always include them. */
|
|
1089
1098
|
includeReadActions?: boolean;
|
|
1090
1099
|
}
|
|
@@ -1124,13 +1133,14 @@ interface ListResolution {
|
|
|
1124
1133
|
commitSha: string | null;
|
|
1125
1134
|
}
|
|
1126
1135
|
interface ListTargetIdentity {
|
|
1127
|
-
kind
|
|
1128
|
-
registry
|
|
1129
|
-
packageName
|
|
1130
|
-
version
|
|
1131
|
-
repoUrl
|
|
1136
|
+
kind?: string | null;
|
|
1137
|
+
registry?: string | null;
|
|
1138
|
+
packageName?: string | null;
|
|
1139
|
+
version?: string | null;
|
|
1140
|
+
repoUrl?: string | null;
|
|
1132
1141
|
gitRef: string | null;
|
|
1133
|
-
commitSha
|
|
1142
|
+
commitSha?: string | null;
|
|
1143
|
+
committedAt?: string | null;
|
|
1134
1144
|
}
|
|
1135
1145
|
interface ListTargetResolution {
|
|
1136
1146
|
requested: ListTargetIdentity | null;
|
|
@@ -1138,10 +1148,10 @@ interface ListTargetResolution {
|
|
|
1138
1148
|
served: ListTargetIdentity | null;
|
|
1139
1149
|
freshness: string | null;
|
|
1140
1150
|
freshnessReason: string | null;
|
|
1141
|
-
indexingRef
|
|
1142
|
-
availableVersions
|
|
1143
|
-
availableRefs
|
|
1144
|
-
suggestedRefs
|
|
1151
|
+
indexingRef?: string | null;
|
|
1152
|
+
availableVersions?: ListAvailableVersion[] | null;
|
|
1153
|
+
availableRefs?: ListAvailableVersion[] | null;
|
|
1154
|
+
suggestedRefs?: ListAvailableVersion[] | null;
|
|
1145
1155
|
}
|
|
1146
1156
|
interface ListIndexingEstimate {
|
|
1147
1157
|
lowerSeconds: number | null;
|
|
@@ -1165,6 +1175,7 @@ interface ListSitePreparation {
|
|
|
1165
1175
|
awaited: ListSiteWait[];
|
|
1166
1176
|
}
|
|
1167
1177
|
interface ListResult {
|
|
1178
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1168
1179
|
inventoryKind: ListInventoryKind;
|
|
1169
1180
|
requestedTarget: string;
|
|
1170
1181
|
canonicalTarget: string | null;
|
|
@@ -1197,6 +1208,11 @@ interface ListServiceRuntime {
|
|
|
1197
1208
|
declare class ListAccessError extends Error {
|
|
1198
1209
|
constructor(message: string);
|
|
1199
1210
|
}
|
|
1211
|
+
interface ListIndexingErrorMetadata {
|
|
1212
|
+
indexingEstimate?: IndexingDurationEstimate;
|
|
1213
|
+
availableVersions?: AvailableVersion[];
|
|
1214
|
+
package?: string;
|
|
1215
|
+
}
|
|
1200
1216
|
declare class ListGraphQLError extends Error {
|
|
1201
1217
|
readonly code?: string | undefined;
|
|
1202
1218
|
readonly retryable?: boolean | undefined;
|
|
@@ -1204,7 +1220,8 @@ declare class ListGraphQLError extends Error {
|
|
|
1204
1220
|
readonly commitSha?: string | undefined;
|
|
1205
1221
|
readonly indexingRef?: string | undefined;
|
|
1206
1222
|
readonly hint?: string | undefined;
|
|
1207
|
-
|
|
1223
|
+
readonly indexingMetadata: ListIndexingErrorMetadata | undefined;
|
|
1224
|
+
constructor(message: string, code?: string | undefined, retryable?: boolean | undefined, repoUrl?: string | undefined, commitSha?: string | undefined, indexingRef?: string | undefined, hint?: string | undefined, indexingMetadata?: ListIndexingErrorMetadata | undefined);
|
|
1208
1225
|
}
|
|
1209
1226
|
declare class ListBackendError extends Error {
|
|
1210
1227
|
readonly status?: number | undefined;
|
|
@@ -1843,6 +1860,7 @@ interface PackageDocsPageInfo {
|
|
|
1843
1860
|
totalCount?: number;
|
|
1844
1861
|
}
|
|
1845
1862
|
interface PackageDocsList {
|
|
1863
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1846
1864
|
registry?: string;
|
|
1847
1865
|
packageName?: string;
|
|
1848
1866
|
version?: string;
|
|
@@ -2039,4 +2057,94 @@ declare class RefreshingGitHitsService implements GitHitsService {
|
|
|
2039
2057
|
*/
|
|
2040
2058
|
private withTokenRefresh;
|
|
2041
2059
|
}
|
|
2042
|
-
|
|
2060
|
+
type ResolveTargetKind = "PACKAGE" | "REPOSITORY" | "SITE";
|
|
2061
|
+
type KnownLatestVersionMaliciousStatus = "NOT_APPLICABLE" | "CLEAR" | "AFFECTED" | "UNKNOWN";
|
|
2062
|
+
/**
|
|
2063
|
+
* Backend-owned malicious-content decision for the displayed latest version.
|
|
2064
|
+
* Future values remain readable and are interpreted conservatively by clients.
|
|
2065
|
+
*/
|
|
2066
|
+
type LatestVersionMaliciousStatus = KnownLatestVersionMaliciousStatus | (string & {});
|
|
2067
|
+
type KnownMaliciousAdvisoryClassificationReason = "AFFECTED_VERSION_RANGE_MATCH" | "MISSING_DISPLAYED_VERSION" | "INVALID_DISPLAYED_VERSION" | "MISSING_AFFECTED_RANGES" | "EMPTY_AFFECTED_RANGES" | "INVALID_AFFECTED_RANGE";
|
|
2068
|
+
type MaliciousAdvisoryClassificationReason = KnownMaliciousAdvisoryClassificationReason | (string & {});
|
|
2069
|
+
interface ResolveTargetLatestVersionMaliciousAdvisory {
|
|
2070
|
+
osvId: string;
|
|
2071
|
+
classificationReasons: MaliciousAdvisoryClassificationReason[];
|
|
2072
|
+
}
|
|
2073
|
+
interface ResolveTargetLatestVersionMaliciousEvidence {
|
|
2074
|
+
advisories: ResolveTargetLatestVersionMaliciousAdvisory[];
|
|
2075
|
+
totalCount: number;
|
|
2076
|
+
truncated: boolean;
|
|
2077
|
+
}
|
|
2078
|
+
interface ResolveTargetParams {
|
|
2079
|
+
name: string;
|
|
2080
|
+
query?: string;
|
|
2081
|
+
registries?: PkgseerRegistry[];
|
|
2082
|
+
preferredKinds?: ResolveTargetKind[];
|
|
2083
|
+
intentHints?: string[];
|
|
2084
|
+
limit: number;
|
|
2085
|
+
includeDetailedFields: boolean;
|
|
2086
|
+
includeNameSimilarity: boolean;
|
|
2087
|
+
}
|
|
2088
|
+
interface ResolveTargetReference {
|
|
2089
|
+
kind: string;
|
|
2090
|
+
canonicalKey: string;
|
|
2091
|
+
confidence: string;
|
|
2092
|
+
}
|
|
2093
|
+
interface ResolveTargetMatch {
|
|
2094
|
+
confidence: string;
|
|
2095
|
+
nameSimilarity?: number;
|
|
2096
|
+
matchedAliases?: string[];
|
|
2097
|
+
matchTier?: number;
|
|
2098
|
+
score?: number;
|
|
2099
|
+
}
|
|
2100
|
+
interface ResolveTargetTarget {
|
|
2101
|
+
kind: string;
|
|
2102
|
+
canonicalKey: string;
|
|
2103
|
+
displayName?: string;
|
|
2104
|
+
description?: string;
|
|
2105
|
+
registry?: string;
|
|
2106
|
+
packageName?: string;
|
|
2107
|
+
latestVersion?: string;
|
|
2108
|
+
latestVersionMaliciousStatus: LatestVersionMaliciousStatus;
|
|
2109
|
+
latestVersionMaliciousEvidence?: ResolveTargetLatestVersionMaliciousEvidence;
|
|
2110
|
+
repositoryUrl?: string;
|
|
2111
|
+
repositoryOwner?: string;
|
|
2112
|
+
repositoryName?: string;
|
|
2113
|
+
stars?: number;
|
|
2114
|
+
downloadsLastMonth?: number;
|
|
2115
|
+
downloadsTotal?: number;
|
|
2116
|
+
documentationUrl?: string;
|
|
2117
|
+
docsAvailable: boolean;
|
|
2118
|
+
codeAvailable: boolean;
|
|
2119
|
+
groupKey?: string;
|
|
2120
|
+
match?: ResolveTargetMatch;
|
|
2121
|
+
docsPageCount?: number;
|
|
2122
|
+
codeFileCount?: number;
|
|
2123
|
+
license?: string;
|
|
2124
|
+
}
|
|
2125
|
+
interface ResolveTargetResult {
|
|
2126
|
+
best?: ResolveTargetReference;
|
|
2127
|
+
protectedMatches: ResolveTargetReference[];
|
|
2128
|
+
targets: ResolveTargetTarget[];
|
|
2129
|
+
targetsTruncated: boolean;
|
|
2130
|
+
ambiguous: boolean;
|
|
2131
|
+
ambiguousReason: string;
|
|
2132
|
+
}
|
|
2133
|
+
interface ResolveTargetService {
|
|
2134
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
2135
|
+
}
|
|
2136
|
+
declare class ResolveTargetServiceImpl implements ResolveTargetService {
|
|
2137
|
+
private readonly endpointUrl;
|
|
2138
|
+
private readonly tokenProvider;
|
|
2139
|
+
private readonly fetchFn;
|
|
2140
|
+
private readonly runtime;
|
|
2141
|
+
constructor(endpointUrl: string, tokenProvider: TokenProvider, fetchFn?: typeof fetch, runtime?: {
|
|
2142
|
+
clientHeaders?: ClientHeaderBuilder;
|
|
2143
|
+
userAgent?: string;
|
|
2144
|
+
clientVersion?: string;
|
|
2145
|
+
diagnostics?: ServiceDiagnostics;
|
|
2146
|
+
});
|
|
2147
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
2148
|
+
private executeResolveTarget;
|
|
2149
|
+
}
|
|
2150
|
+
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, DiscoveryIndexingEstimate, GitHitsService, GitHitsServiceImpl, GrepAccessError, GrepBackendError, GrepContentSafety, GrepCorpus, GrepFileIssue, GrepGraphQLError, GrepHit, GrepLineSlice, GrepNetworkError, GrepParams, GrepPathSelector, GrepReadAction, GrepReadiness, GrepRepositoryHit, GrepResult, GrepService, GrepServiceImpl, GrepSiteHit, GrepTarget, GrepTargetStatus, GrepTraversal, GrepUnavailableTarget, IndexingDurationEstimate, KnownLatestVersionMaliciousStatus, KnownMaliciousAdvisoryClassificationReason, LatestVersionMaliciousStatus, 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, MaliciousAdvisoryClassificationReason, PKGSEER_REGISTRY_LIST, PackageIntelligenceService, PackageIntelligenceServiceImpl, RawCodeDiff, RawCodeDiffContentCoverage, RawCodeDiffContentFailure, RawCodeDiffFile, RawCodeDiffFileContentStatus, RawCodeDiffFileStatus, RawCodeDiffPathEncoding, RawCodeDiffScope, RawCodeDiffScopeStatus, RawCodeDiffSummary, ReadCodeResult, ReadDocsResult, ReadParams, ReadResult, ReadService, ReadServiceImpl, ReadSymbolResolutionResult, ReadTarget, RefreshingGitHitsService, ResolveTargetKind, ResolveTargetLatestVersionMaliciousAdvisory, ResolveTargetLatestVersionMaliciousEvidence, ResolveTargetMatch, ResolveTargetParams, ResolveTargetReference, ResolveTargetResult, ResolveTargetService, ResolveTargetServiceImpl, ResolveTargetTarget, ServiceDiagnostics, SessionIdConfigError, TokenProvider, createClientHeaderBuilder, createStaticTokenProvider, getApiUrl, getCodeNavigationUrl, getEnvApiToken, getEnvSessionId, getMcpUrl, toPkgseerRegistry, toPkgseerRegistryLowercase };
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{GrepGraphQLError2,GrepBackendError2,GrepAccessError2,GrepNetworkError2,MalformedGrepResponseError2,GrepServiceImpl2,ListAccessError2,ListGraphQLError2,ListBackendError2,ListNetworkError2,MalformedListResponseError2,ListServiceImpl2,ReadServiceImpl2,RefreshingGitHitsService2,ResolveTargetServiceImpl2,createStaticTokenProvider2,SessionIdConfigError2,getEnvSessionId2,createClientHeaderBuilder2}from"./shared/chunk-54c4zdmn.js";import{DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,GitHitsServiceImpl2,CodeDiffError2,CodeNavigationServiceImpl2,PackageIntelligenceServiceImpl2}from"./shared/chunk-4gcqyg9g.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,ResolveTargetServiceImpl2 as ResolveTargetServiceImpl,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
|
@@ -34,6 +34,22 @@ declare const registryMap: {
|
|
|
34
34
|
readonly swift: "SWIFT";
|
|
35
35
|
};
|
|
36
36
|
type PkgseerRegistry = (typeof registryMap)[keyof typeof registryMap];
|
|
37
|
+
interface IndexingDurationEstimate {
|
|
38
|
+
lowerSeconds?: number;
|
|
39
|
+
upperSeconds?: number;
|
|
40
|
+
elapsedSeconds?: number;
|
|
41
|
+
sampleCount?: number;
|
|
42
|
+
source?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Pending preparation evidence; total execution seconds, never a search ETA. */
|
|
45
|
+
interface DiscoveryIndexingEstimate {
|
|
46
|
+
kind: "REPOSITORY" | "DOCUMENTATION";
|
|
47
|
+
targets: string[];
|
|
48
|
+
repositoryUrl?: string;
|
|
49
|
+
commitSha?: string;
|
|
50
|
+
estimate?: IndexingDurationEstimate;
|
|
51
|
+
unavailableReason?: "NO_HISTORY" | "UNSUPPORTED_WORK";
|
|
52
|
+
}
|
|
37
53
|
/** A backend-selected address for a code or documentation read. */
|
|
38
54
|
interface ReadTarget {
|
|
39
55
|
target: string;
|
|
@@ -93,6 +109,8 @@ interface TargetResolutionIdentity {
|
|
|
93
109
|
repoUrl?: string;
|
|
94
110
|
gitRef?: string;
|
|
95
111
|
commitSha?: string;
|
|
112
|
+
/** Verified UTC committer time for this exact repository commit, not freshness. */
|
|
113
|
+
committedAt?: string;
|
|
96
114
|
site?: string;
|
|
97
115
|
}
|
|
98
116
|
type AvailableRef = AvailableVersion;
|
|
@@ -377,15 +395,6 @@ interface UnifiedSearchResult {
|
|
|
377
395
|
sourceStatus: UnifiedSearchSourceStatus[];
|
|
378
396
|
evidenceNotice?: string;
|
|
379
397
|
}
|
|
380
|
-
/** Pending preparation evidence; total execution seconds, never a search ETA. */
|
|
381
|
-
interface DiscoveryIndexingEstimate {
|
|
382
|
-
kind: "REPOSITORY" | "DOCUMENTATION";
|
|
383
|
-
targets: string[];
|
|
384
|
-
repositoryUrl?: string;
|
|
385
|
-
commitSha?: string;
|
|
386
|
-
estimate?: IndexingDurationEstimate;
|
|
387
|
-
unavailableReason?: "NO_HISTORY" | "UNSUPPORTED_WORK";
|
|
388
|
-
}
|
|
389
398
|
interface UnifiedSearchProgress {
|
|
390
399
|
searchRef: string;
|
|
391
400
|
status: UnifiedSearchSessionStatus;
|
|
@@ -424,13 +433,6 @@ interface AvailableVersion {
|
|
|
424
433
|
version?: string;
|
|
425
434
|
ref: string;
|
|
426
435
|
}
|
|
427
|
-
interface IndexingDurationEstimate {
|
|
428
|
-
lowerSeconds?: number;
|
|
429
|
-
upperSeconds?: number;
|
|
430
|
-
elapsedSeconds?: number;
|
|
431
|
-
sampleCount?: number;
|
|
432
|
-
source?: string;
|
|
433
|
-
}
|
|
434
436
|
/**
|
|
435
437
|
* Input for {@link CodeNavigationService.listFiles}.
|
|
436
438
|
*/
|
|
@@ -458,6 +460,7 @@ interface RepoFileEntry {
|
|
|
458
460
|
byteSize?: number;
|
|
459
461
|
}
|
|
460
462
|
interface ListFilesResult {
|
|
463
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
461
464
|
files: RepoFileEntry[];
|
|
462
465
|
total: number;
|
|
463
466
|
hasMore: boolean;
|
|
@@ -477,6 +480,7 @@ interface ReadFileParams {
|
|
|
477
480
|
waitTimeoutMs?: number;
|
|
478
481
|
}
|
|
479
482
|
interface ReadFileResult {
|
|
483
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
480
484
|
/** Served action selected by unified read; legacy readers may omit it. */
|
|
481
485
|
readTarget?: ReadTarget | null;
|
|
482
486
|
filePath?: string;
|
|
@@ -668,6 +672,7 @@ interface GrepRepoMatch {
|
|
|
668
672
|
type GrepRouteTaken = "SINGLE_FILE" | "CONTENT_INDEX";
|
|
669
673
|
type GrepTruncatedReason = "NONE" | "MAX_MATCHES" | "MAX_MATCHES_PER_FILE" | "DEADLINE";
|
|
670
674
|
interface GrepRepoResult {
|
|
675
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
671
676
|
matches: GrepRepoMatch[];
|
|
672
677
|
nextCursor?: string;
|
|
673
678
|
hasMore: boolean;
|
|
@@ -699,6 +704,8 @@ interface CodeDiffService {
|
|
|
699
704
|
*/
|
|
700
705
|
interface SearchParams {
|
|
701
706
|
query: string;
|
|
707
|
+
/** Source read syntax; omission preserves the server's client default. */
|
|
708
|
+
sourceFormat?: "cli" | "mcp" | "url";
|
|
702
709
|
language?: string;
|
|
703
710
|
licenseMode?: "strict" | "yolo" | "custom";
|
|
704
711
|
includeExplanation?: boolean;
|
|
@@ -829,6 +836,7 @@ interface GrepUnavailableTarget {
|
|
|
829
836
|
suggestedSiteTargets: string[] | null;
|
|
830
837
|
}
|
|
831
838
|
interface GrepResult {
|
|
839
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
832
840
|
hits: GrepHit[];
|
|
833
841
|
targets: GrepTargetStatus[];
|
|
834
842
|
unavailableTargets: GrepUnavailableTarget[];
|
|
@@ -851,6 +859,7 @@ interface ListParams {
|
|
|
851
859
|
after?: string;
|
|
852
860
|
waitTimeoutMs?: number;
|
|
853
861
|
includeDetailedFields: boolean;
|
|
862
|
+
includeTargetProvenance?: boolean;
|
|
854
863
|
/** Select exact read actions for compact site text; detailed fields always include them. */
|
|
855
864
|
includeReadActions?: boolean;
|
|
856
865
|
}
|
|
@@ -889,13 +898,14 @@ interface ListResolution {
|
|
|
889
898
|
commitSha: string | null;
|
|
890
899
|
}
|
|
891
900
|
interface ListTargetIdentity {
|
|
892
|
-
kind
|
|
893
|
-
registry
|
|
894
|
-
packageName
|
|
895
|
-
version
|
|
896
|
-
repoUrl
|
|
901
|
+
kind?: string | null;
|
|
902
|
+
registry?: string | null;
|
|
903
|
+
packageName?: string | null;
|
|
904
|
+
version?: string | null;
|
|
905
|
+
repoUrl?: string | null;
|
|
897
906
|
gitRef: string | null;
|
|
898
|
-
commitSha
|
|
907
|
+
commitSha?: string | null;
|
|
908
|
+
committedAt?: string | null;
|
|
899
909
|
}
|
|
900
910
|
interface ListTargetResolution {
|
|
901
911
|
requested: ListTargetIdentity | null;
|
|
@@ -903,10 +913,10 @@ interface ListTargetResolution {
|
|
|
903
913
|
served: ListTargetIdentity | null;
|
|
904
914
|
freshness: string | null;
|
|
905
915
|
freshnessReason: string | null;
|
|
906
|
-
indexingRef
|
|
907
|
-
availableVersions
|
|
908
|
-
availableRefs
|
|
909
|
-
suggestedRefs
|
|
916
|
+
indexingRef?: string | null;
|
|
917
|
+
availableVersions?: ListAvailableVersion[] | null;
|
|
918
|
+
availableRefs?: ListAvailableVersion[] | null;
|
|
919
|
+
suggestedRefs?: ListAvailableVersion[] | null;
|
|
910
920
|
}
|
|
911
921
|
interface ListIndexingEstimate {
|
|
912
922
|
lowerSeconds: number | null;
|
|
@@ -930,6 +940,7 @@ interface ListSitePreparation {
|
|
|
930
940
|
awaited: ListSiteWait[];
|
|
931
941
|
}
|
|
932
942
|
interface ListResult {
|
|
943
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
933
944
|
inventoryKind: ListInventoryKind;
|
|
934
945
|
requestedTarget: string;
|
|
935
946
|
canonicalTarget: string | null;
|
|
@@ -1566,6 +1577,7 @@ interface PackageDocsPageInfo {
|
|
|
1566
1577
|
totalCount?: number;
|
|
1567
1578
|
}
|
|
1568
1579
|
interface PackageDocsList {
|
|
1580
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1569
1581
|
registry?: string;
|
|
1570
1582
|
packageName?: string;
|
|
1571
1583
|
version?: string;
|
|
@@ -1678,7 +1690,83 @@ type ReadResult = ReadCodeResult | ReadDocsResult | ReadSymbolResolutionResult;
|
|
|
1678
1690
|
interface ReadService {
|
|
1679
1691
|
read(params: ReadParams): Promise<ReadResult>;
|
|
1680
1692
|
}
|
|
1681
|
-
|
|
1693
|
+
type ResolveTargetKind = "PACKAGE" | "REPOSITORY" | "SITE";
|
|
1694
|
+
type KnownLatestVersionMaliciousStatus = "NOT_APPLICABLE" | "CLEAR" | "AFFECTED" | "UNKNOWN";
|
|
1695
|
+
/**
|
|
1696
|
+
* Backend-owned malicious-content decision for the displayed latest version.
|
|
1697
|
+
* Future values remain readable and are interpreted conservatively by clients.
|
|
1698
|
+
*/
|
|
1699
|
+
type LatestVersionMaliciousStatus = KnownLatestVersionMaliciousStatus | (string & {});
|
|
1700
|
+
type KnownMaliciousAdvisoryClassificationReason = "AFFECTED_VERSION_RANGE_MATCH" | "MISSING_DISPLAYED_VERSION" | "INVALID_DISPLAYED_VERSION" | "MISSING_AFFECTED_RANGES" | "EMPTY_AFFECTED_RANGES" | "INVALID_AFFECTED_RANGE";
|
|
1701
|
+
type MaliciousAdvisoryClassificationReason = KnownMaliciousAdvisoryClassificationReason | (string & {});
|
|
1702
|
+
interface ResolveTargetLatestVersionMaliciousAdvisory {
|
|
1703
|
+
osvId: string;
|
|
1704
|
+
classificationReasons: MaliciousAdvisoryClassificationReason[];
|
|
1705
|
+
}
|
|
1706
|
+
interface ResolveTargetLatestVersionMaliciousEvidence {
|
|
1707
|
+
advisories: ResolveTargetLatestVersionMaliciousAdvisory[];
|
|
1708
|
+
totalCount: number;
|
|
1709
|
+
truncated: boolean;
|
|
1710
|
+
}
|
|
1711
|
+
interface ResolveTargetParams {
|
|
1712
|
+
name: string;
|
|
1713
|
+
query?: string;
|
|
1714
|
+
registries?: PkgseerRegistry[];
|
|
1715
|
+
preferredKinds?: ResolveTargetKind[];
|
|
1716
|
+
intentHints?: string[];
|
|
1717
|
+
limit: number;
|
|
1718
|
+
includeDetailedFields: boolean;
|
|
1719
|
+
includeNameSimilarity: boolean;
|
|
1720
|
+
}
|
|
1721
|
+
interface ResolveTargetReference {
|
|
1722
|
+
kind: string;
|
|
1723
|
+
canonicalKey: string;
|
|
1724
|
+
confidence: string;
|
|
1725
|
+
}
|
|
1726
|
+
interface ResolveTargetMatch {
|
|
1727
|
+
confidence: string;
|
|
1728
|
+
nameSimilarity?: number;
|
|
1729
|
+
matchedAliases?: string[];
|
|
1730
|
+
matchTier?: number;
|
|
1731
|
+
score?: number;
|
|
1732
|
+
}
|
|
1733
|
+
interface ResolveTargetTarget {
|
|
1734
|
+
kind: string;
|
|
1735
|
+
canonicalKey: string;
|
|
1736
|
+
displayName?: string;
|
|
1737
|
+
description?: string;
|
|
1738
|
+
registry?: string;
|
|
1739
|
+
packageName?: string;
|
|
1740
|
+
latestVersion?: string;
|
|
1741
|
+
latestVersionMaliciousStatus: LatestVersionMaliciousStatus;
|
|
1742
|
+
latestVersionMaliciousEvidence?: ResolveTargetLatestVersionMaliciousEvidence;
|
|
1743
|
+
repositoryUrl?: string;
|
|
1744
|
+
repositoryOwner?: string;
|
|
1745
|
+
repositoryName?: string;
|
|
1746
|
+
stars?: number;
|
|
1747
|
+
downloadsLastMonth?: number;
|
|
1748
|
+
downloadsTotal?: number;
|
|
1749
|
+
documentationUrl?: string;
|
|
1750
|
+
docsAvailable: boolean;
|
|
1751
|
+
codeAvailable: boolean;
|
|
1752
|
+
groupKey?: string;
|
|
1753
|
+
match?: ResolveTargetMatch;
|
|
1754
|
+
docsPageCount?: number;
|
|
1755
|
+
codeFileCount?: number;
|
|
1756
|
+
license?: string;
|
|
1757
|
+
}
|
|
1758
|
+
interface ResolveTargetResult {
|
|
1759
|
+
best?: ResolveTargetReference;
|
|
1760
|
+
protectedMatches: ResolveTargetReference[];
|
|
1761
|
+
targets: ResolveTargetTarget[];
|
|
1762
|
+
targetsTruncated: boolean;
|
|
1763
|
+
ambiguous: boolean;
|
|
1764
|
+
ambiguousReason: string;
|
|
1765
|
+
}
|
|
1766
|
+
interface ResolveTargetService {
|
|
1767
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
1768
|
+
}
|
|
1769
|
+
import { z as z3 } from "zod";
|
|
1682
1770
|
/** Annotation fields required by OpenAI's MCP marketplace validation. */
|
|
1683
1771
|
interface CompleteToolAnnotations {
|
|
1684
1772
|
title?: string;
|
|
@@ -1717,7 +1805,7 @@ type ToolResult = {
|
|
|
1717
1805
|
* Zod raw shape type (what MCP SDK expects)
|
|
1718
1806
|
*/
|
|
1719
1807
|
type ZodRawShape = {
|
|
1720
|
-
[k: string]:
|
|
1808
|
+
[k: string]: z3.ZodTypeAny;
|
|
1721
1809
|
};
|
|
1722
1810
|
/**
|
|
1723
1811
|
* Services required to construct the MCP tool surface.
|
|
@@ -1732,6 +1820,7 @@ interface McpToolServices {
|
|
|
1732
1820
|
listService: ListService;
|
|
1733
1821
|
readService: ReadService;
|
|
1734
1822
|
grepService: GrepService;
|
|
1823
|
+
resolveTargetService: ResolveTargetService;
|
|
1735
1824
|
}
|
|
1736
1825
|
interface McpServerMetadata {
|
|
1737
1826
|
name: string;
|