@githits/mcp 0.26.0 → 0.27.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/README.md +16 -0
- package/dist/client.d.ts +134 -28
- package/dist/client.js +1 -1
- package/dist/index.d.ts +115 -28
- package/dist/index.js +37 -34
- package/dist/shared/chunk-7tz3wz0p.js +24 -0
- package/dist/shared/chunk-p5khgrbg.js +1528 -0
- package/dist/shared/chunk-t8y1be33.js +352 -0
- package/dist/smoke-test.d.ts +5 -2
- package/dist/smoke-test.js +5 -4
- package/dist/tools.d.ts +108 -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;
|
|
@@ -1025,6 +1030,7 @@ interface GrepUnavailableTarget {
|
|
|
1025
1030
|
suggestedSiteTargets: string[] | null;
|
|
1026
1031
|
}
|
|
1027
1032
|
interface GrepResult {
|
|
1033
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1028
1034
|
hits: GrepHit[];
|
|
1029
1035
|
targets: GrepTargetStatus[];
|
|
1030
1036
|
unavailableTargets: GrepUnavailableTarget[];
|
|
@@ -1085,6 +1091,7 @@ interface ListParams {
|
|
|
1085
1091
|
after?: string;
|
|
1086
1092
|
waitTimeoutMs?: number;
|
|
1087
1093
|
includeDetailedFields: boolean;
|
|
1094
|
+
includeTargetProvenance?: boolean;
|
|
1088
1095
|
/** Select exact read actions for compact site text; detailed fields always include them. */
|
|
1089
1096
|
includeReadActions?: boolean;
|
|
1090
1097
|
}
|
|
@@ -1124,13 +1131,14 @@ interface ListResolution {
|
|
|
1124
1131
|
commitSha: string | null;
|
|
1125
1132
|
}
|
|
1126
1133
|
interface ListTargetIdentity {
|
|
1127
|
-
kind
|
|
1128
|
-
registry
|
|
1129
|
-
packageName
|
|
1130
|
-
version
|
|
1131
|
-
repoUrl
|
|
1134
|
+
kind?: string | null;
|
|
1135
|
+
registry?: string | null;
|
|
1136
|
+
packageName?: string | null;
|
|
1137
|
+
version?: string | null;
|
|
1138
|
+
repoUrl?: string | null;
|
|
1132
1139
|
gitRef: string | null;
|
|
1133
|
-
commitSha
|
|
1140
|
+
commitSha?: string | null;
|
|
1141
|
+
committedAt?: string | null;
|
|
1134
1142
|
}
|
|
1135
1143
|
interface ListTargetResolution {
|
|
1136
1144
|
requested: ListTargetIdentity | null;
|
|
@@ -1138,10 +1146,10 @@ interface ListTargetResolution {
|
|
|
1138
1146
|
served: ListTargetIdentity | null;
|
|
1139
1147
|
freshness: string | null;
|
|
1140
1148
|
freshnessReason: string | null;
|
|
1141
|
-
indexingRef
|
|
1142
|
-
availableVersions
|
|
1143
|
-
availableRefs
|
|
1144
|
-
suggestedRefs
|
|
1149
|
+
indexingRef?: string | null;
|
|
1150
|
+
availableVersions?: ListAvailableVersion[] | null;
|
|
1151
|
+
availableRefs?: ListAvailableVersion[] | null;
|
|
1152
|
+
suggestedRefs?: ListAvailableVersion[] | null;
|
|
1145
1153
|
}
|
|
1146
1154
|
interface ListIndexingEstimate {
|
|
1147
1155
|
lowerSeconds: number | null;
|
|
@@ -1165,6 +1173,7 @@ interface ListSitePreparation {
|
|
|
1165
1173
|
awaited: ListSiteWait[];
|
|
1166
1174
|
}
|
|
1167
1175
|
interface ListResult {
|
|
1176
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1168
1177
|
inventoryKind: ListInventoryKind;
|
|
1169
1178
|
requestedTarget: string;
|
|
1170
1179
|
canonicalTarget: string | null;
|
|
@@ -1197,6 +1206,11 @@ interface ListServiceRuntime {
|
|
|
1197
1206
|
declare class ListAccessError extends Error {
|
|
1198
1207
|
constructor(message: string);
|
|
1199
1208
|
}
|
|
1209
|
+
interface ListIndexingErrorMetadata {
|
|
1210
|
+
indexingEstimate?: IndexingDurationEstimate;
|
|
1211
|
+
availableVersions?: AvailableVersion[];
|
|
1212
|
+
package?: string;
|
|
1213
|
+
}
|
|
1200
1214
|
declare class ListGraphQLError extends Error {
|
|
1201
1215
|
readonly code?: string | undefined;
|
|
1202
1216
|
readonly retryable?: boolean | undefined;
|
|
@@ -1204,7 +1218,8 @@ declare class ListGraphQLError extends Error {
|
|
|
1204
1218
|
readonly commitSha?: string | undefined;
|
|
1205
1219
|
readonly indexingRef?: string | undefined;
|
|
1206
1220
|
readonly hint?: string | undefined;
|
|
1207
|
-
|
|
1221
|
+
readonly indexingMetadata: ListIndexingErrorMetadata | undefined;
|
|
1222
|
+
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
1223
|
}
|
|
1209
1224
|
declare class ListBackendError extends Error {
|
|
1210
1225
|
readonly status?: number | undefined;
|
|
@@ -1843,6 +1858,7 @@ interface PackageDocsPageInfo {
|
|
|
1843
1858
|
totalCount?: number;
|
|
1844
1859
|
}
|
|
1845
1860
|
interface PackageDocsList {
|
|
1861
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1846
1862
|
registry?: string;
|
|
1847
1863
|
packageName?: string;
|
|
1848
1864
|
version?: string;
|
|
@@ -2039,4 +2055,94 @@ declare class RefreshingGitHitsService implements GitHitsService {
|
|
|
2039
2055
|
*/
|
|
2040
2056
|
private withTokenRefresh;
|
|
2041
2057
|
}
|
|
2042
|
-
|
|
2058
|
+
type ResolveTargetKind = "PACKAGE" | "REPOSITORY" | "SITE";
|
|
2059
|
+
type KnownLatestVersionMaliciousStatus = "NOT_APPLICABLE" | "CLEAR" | "AFFECTED" | "UNKNOWN";
|
|
2060
|
+
/**
|
|
2061
|
+
* Backend-owned malicious-content decision for the displayed latest version.
|
|
2062
|
+
* Future values remain readable and are interpreted conservatively by clients.
|
|
2063
|
+
*/
|
|
2064
|
+
type LatestVersionMaliciousStatus = KnownLatestVersionMaliciousStatus | (string & {});
|
|
2065
|
+
type KnownMaliciousAdvisoryClassificationReason = "AFFECTED_VERSION_RANGE_MATCH" | "MISSING_DISPLAYED_VERSION" | "INVALID_DISPLAYED_VERSION" | "MISSING_AFFECTED_RANGES" | "EMPTY_AFFECTED_RANGES" | "INVALID_AFFECTED_RANGE";
|
|
2066
|
+
type MaliciousAdvisoryClassificationReason = KnownMaliciousAdvisoryClassificationReason | (string & {});
|
|
2067
|
+
interface ResolveTargetLatestVersionMaliciousAdvisory {
|
|
2068
|
+
osvId: string;
|
|
2069
|
+
classificationReasons: MaliciousAdvisoryClassificationReason[];
|
|
2070
|
+
}
|
|
2071
|
+
interface ResolveTargetLatestVersionMaliciousEvidence {
|
|
2072
|
+
advisories: ResolveTargetLatestVersionMaliciousAdvisory[];
|
|
2073
|
+
totalCount: number;
|
|
2074
|
+
truncated: boolean;
|
|
2075
|
+
}
|
|
2076
|
+
interface ResolveTargetParams {
|
|
2077
|
+
name: string;
|
|
2078
|
+
query?: string;
|
|
2079
|
+
registries?: PkgseerRegistry[];
|
|
2080
|
+
preferredKinds?: ResolveTargetKind[];
|
|
2081
|
+
intentHints?: string[];
|
|
2082
|
+
limit: number;
|
|
2083
|
+
includeDetailedFields: boolean;
|
|
2084
|
+
includeNameSimilarity: boolean;
|
|
2085
|
+
}
|
|
2086
|
+
interface ResolveTargetReference {
|
|
2087
|
+
kind: string;
|
|
2088
|
+
canonicalKey: string;
|
|
2089
|
+
confidence: string;
|
|
2090
|
+
}
|
|
2091
|
+
interface ResolveTargetMatch {
|
|
2092
|
+
confidence: string;
|
|
2093
|
+
nameSimilarity?: number;
|
|
2094
|
+
matchedAliases?: string[];
|
|
2095
|
+
matchTier?: number;
|
|
2096
|
+
score?: number;
|
|
2097
|
+
}
|
|
2098
|
+
interface ResolveTargetTarget {
|
|
2099
|
+
kind: string;
|
|
2100
|
+
canonicalKey: string;
|
|
2101
|
+
displayName?: string;
|
|
2102
|
+
description?: string;
|
|
2103
|
+
registry?: string;
|
|
2104
|
+
packageName?: string;
|
|
2105
|
+
latestVersion?: string;
|
|
2106
|
+
latestVersionMaliciousStatus: LatestVersionMaliciousStatus;
|
|
2107
|
+
latestVersionMaliciousEvidence?: ResolveTargetLatestVersionMaliciousEvidence;
|
|
2108
|
+
repositoryUrl?: string;
|
|
2109
|
+
repositoryOwner?: string;
|
|
2110
|
+
repositoryName?: string;
|
|
2111
|
+
stars?: number;
|
|
2112
|
+
downloadsLastMonth?: number;
|
|
2113
|
+
downloadsTotal?: number;
|
|
2114
|
+
documentationUrl?: string;
|
|
2115
|
+
docsAvailable: boolean;
|
|
2116
|
+
codeAvailable: boolean;
|
|
2117
|
+
groupKey?: string;
|
|
2118
|
+
match?: ResolveTargetMatch;
|
|
2119
|
+
docsPageCount?: number;
|
|
2120
|
+
codeFileCount?: number;
|
|
2121
|
+
license?: string;
|
|
2122
|
+
}
|
|
2123
|
+
interface ResolveTargetResult {
|
|
2124
|
+
best?: ResolveTargetReference;
|
|
2125
|
+
protectedMatches: ResolveTargetReference[];
|
|
2126
|
+
targets: ResolveTargetTarget[];
|
|
2127
|
+
targetsTruncated: boolean;
|
|
2128
|
+
ambiguous: boolean;
|
|
2129
|
+
ambiguousReason: string;
|
|
2130
|
+
}
|
|
2131
|
+
interface ResolveTargetService {
|
|
2132
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
2133
|
+
}
|
|
2134
|
+
declare class ResolveTargetServiceImpl implements ResolveTargetService {
|
|
2135
|
+
private readonly endpointUrl;
|
|
2136
|
+
private readonly tokenProvider;
|
|
2137
|
+
private readonly fetchFn;
|
|
2138
|
+
private readonly runtime;
|
|
2139
|
+
constructor(endpointUrl: string, tokenProvider: TokenProvider, fetchFn?: typeof fetch, runtime?: {
|
|
2140
|
+
clientHeaders?: ClientHeaderBuilder;
|
|
2141
|
+
userAgent?: string;
|
|
2142
|
+
clientVersion?: string;
|
|
2143
|
+
diagnostics?: ServiceDiagnostics;
|
|
2144
|
+
});
|
|
2145
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
2146
|
+
private executeResolveTarget;
|
|
2147
|
+
}
|
|
2148
|
+
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-t8y1be33.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-p5khgrbg.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;
|
|
@@ -829,6 +834,7 @@ interface GrepUnavailableTarget {
|
|
|
829
834
|
suggestedSiteTargets: string[] | null;
|
|
830
835
|
}
|
|
831
836
|
interface GrepResult {
|
|
837
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
832
838
|
hits: GrepHit[];
|
|
833
839
|
targets: GrepTargetStatus[];
|
|
834
840
|
unavailableTargets: GrepUnavailableTarget[];
|
|
@@ -851,6 +857,7 @@ interface ListParams {
|
|
|
851
857
|
after?: string;
|
|
852
858
|
waitTimeoutMs?: number;
|
|
853
859
|
includeDetailedFields: boolean;
|
|
860
|
+
includeTargetProvenance?: boolean;
|
|
854
861
|
/** Select exact read actions for compact site text; detailed fields always include them. */
|
|
855
862
|
includeReadActions?: boolean;
|
|
856
863
|
}
|
|
@@ -889,13 +896,14 @@ interface ListResolution {
|
|
|
889
896
|
commitSha: string | null;
|
|
890
897
|
}
|
|
891
898
|
interface ListTargetIdentity {
|
|
892
|
-
kind
|
|
893
|
-
registry
|
|
894
|
-
packageName
|
|
895
|
-
version
|
|
896
|
-
repoUrl
|
|
899
|
+
kind?: string | null;
|
|
900
|
+
registry?: string | null;
|
|
901
|
+
packageName?: string | null;
|
|
902
|
+
version?: string | null;
|
|
903
|
+
repoUrl?: string | null;
|
|
897
904
|
gitRef: string | null;
|
|
898
|
-
commitSha
|
|
905
|
+
commitSha?: string | null;
|
|
906
|
+
committedAt?: string | null;
|
|
899
907
|
}
|
|
900
908
|
interface ListTargetResolution {
|
|
901
909
|
requested: ListTargetIdentity | null;
|
|
@@ -903,10 +911,10 @@ interface ListTargetResolution {
|
|
|
903
911
|
served: ListTargetIdentity | null;
|
|
904
912
|
freshness: string | null;
|
|
905
913
|
freshnessReason: string | null;
|
|
906
|
-
indexingRef
|
|
907
|
-
availableVersions
|
|
908
|
-
availableRefs
|
|
909
|
-
suggestedRefs
|
|
914
|
+
indexingRef?: string | null;
|
|
915
|
+
availableVersions?: ListAvailableVersion[] | null;
|
|
916
|
+
availableRefs?: ListAvailableVersion[] | null;
|
|
917
|
+
suggestedRefs?: ListAvailableVersion[] | null;
|
|
910
918
|
}
|
|
911
919
|
interface ListIndexingEstimate {
|
|
912
920
|
lowerSeconds: number | null;
|
|
@@ -930,6 +938,7 @@ interface ListSitePreparation {
|
|
|
930
938
|
awaited: ListSiteWait[];
|
|
931
939
|
}
|
|
932
940
|
interface ListResult {
|
|
941
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
933
942
|
inventoryKind: ListInventoryKind;
|
|
934
943
|
requestedTarget: string;
|
|
935
944
|
canonicalTarget: string | null;
|
|
@@ -1566,6 +1575,7 @@ interface PackageDocsPageInfo {
|
|
|
1566
1575
|
totalCount?: number;
|
|
1567
1576
|
}
|
|
1568
1577
|
interface PackageDocsList {
|
|
1578
|
+
indexingEstimates?: DiscoveryIndexingEstimate[];
|
|
1569
1579
|
registry?: string;
|
|
1570
1580
|
packageName?: string;
|
|
1571
1581
|
version?: string;
|
|
@@ -1678,7 +1688,83 @@ type ReadResult = ReadCodeResult | ReadDocsResult | ReadSymbolResolutionResult;
|
|
|
1678
1688
|
interface ReadService {
|
|
1679
1689
|
read(params: ReadParams): Promise<ReadResult>;
|
|
1680
1690
|
}
|
|
1681
|
-
|
|
1691
|
+
type ResolveTargetKind = "PACKAGE" | "REPOSITORY" | "SITE";
|
|
1692
|
+
type KnownLatestVersionMaliciousStatus = "NOT_APPLICABLE" | "CLEAR" | "AFFECTED" | "UNKNOWN";
|
|
1693
|
+
/**
|
|
1694
|
+
* Backend-owned malicious-content decision for the displayed latest version.
|
|
1695
|
+
* Future values remain readable and are interpreted conservatively by clients.
|
|
1696
|
+
*/
|
|
1697
|
+
type LatestVersionMaliciousStatus = KnownLatestVersionMaliciousStatus | (string & {});
|
|
1698
|
+
type KnownMaliciousAdvisoryClassificationReason = "AFFECTED_VERSION_RANGE_MATCH" | "MISSING_DISPLAYED_VERSION" | "INVALID_DISPLAYED_VERSION" | "MISSING_AFFECTED_RANGES" | "EMPTY_AFFECTED_RANGES" | "INVALID_AFFECTED_RANGE";
|
|
1699
|
+
type MaliciousAdvisoryClassificationReason = KnownMaliciousAdvisoryClassificationReason | (string & {});
|
|
1700
|
+
interface ResolveTargetLatestVersionMaliciousAdvisory {
|
|
1701
|
+
osvId: string;
|
|
1702
|
+
classificationReasons: MaliciousAdvisoryClassificationReason[];
|
|
1703
|
+
}
|
|
1704
|
+
interface ResolveTargetLatestVersionMaliciousEvidence {
|
|
1705
|
+
advisories: ResolveTargetLatestVersionMaliciousAdvisory[];
|
|
1706
|
+
totalCount: number;
|
|
1707
|
+
truncated: boolean;
|
|
1708
|
+
}
|
|
1709
|
+
interface ResolveTargetParams {
|
|
1710
|
+
name: string;
|
|
1711
|
+
query?: string;
|
|
1712
|
+
registries?: PkgseerRegistry[];
|
|
1713
|
+
preferredKinds?: ResolveTargetKind[];
|
|
1714
|
+
intentHints?: string[];
|
|
1715
|
+
limit: number;
|
|
1716
|
+
includeDetailedFields: boolean;
|
|
1717
|
+
includeNameSimilarity: boolean;
|
|
1718
|
+
}
|
|
1719
|
+
interface ResolveTargetReference {
|
|
1720
|
+
kind: string;
|
|
1721
|
+
canonicalKey: string;
|
|
1722
|
+
confidence: string;
|
|
1723
|
+
}
|
|
1724
|
+
interface ResolveTargetMatch {
|
|
1725
|
+
confidence: string;
|
|
1726
|
+
nameSimilarity?: number;
|
|
1727
|
+
matchedAliases?: string[];
|
|
1728
|
+
matchTier?: number;
|
|
1729
|
+
score?: number;
|
|
1730
|
+
}
|
|
1731
|
+
interface ResolveTargetTarget {
|
|
1732
|
+
kind: string;
|
|
1733
|
+
canonicalKey: string;
|
|
1734
|
+
displayName?: string;
|
|
1735
|
+
description?: string;
|
|
1736
|
+
registry?: string;
|
|
1737
|
+
packageName?: string;
|
|
1738
|
+
latestVersion?: string;
|
|
1739
|
+
latestVersionMaliciousStatus: LatestVersionMaliciousStatus;
|
|
1740
|
+
latestVersionMaliciousEvidence?: ResolveTargetLatestVersionMaliciousEvidence;
|
|
1741
|
+
repositoryUrl?: string;
|
|
1742
|
+
repositoryOwner?: string;
|
|
1743
|
+
repositoryName?: string;
|
|
1744
|
+
stars?: number;
|
|
1745
|
+
downloadsLastMonth?: number;
|
|
1746
|
+
downloadsTotal?: number;
|
|
1747
|
+
documentationUrl?: string;
|
|
1748
|
+
docsAvailable: boolean;
|
|
1749
|
+
codeAvailable: boolean;
|
|
1750
|
+
groupKey?: string;
|
|
1751
|
+
match?: ResolveTargetMatch;
|
|
1752
|
+
docsPageCount?: number;
|
|
1753
|
+
codeFileCount?: number;
|
|
1754
|
+
license?: string;
|
|
1755
|
+
}
|
|
1756
|
+
interface ResolveTargetResult {
|
|
1757
|
+
best?: ResolveTargetReference;
|
|
1758
|
+
protectedMatches: ResolveTargetReference[];
|
|
1759
|
+
targets: ResolveTargetTarget[];
|
|
1760
|
+
targetsTruncated: boolean;
|
|
1761
|
+
ambiguous: boolean;
|
|
1762
|
+
ambiguousReason: string;
|
|
1763
|
+
}
|
|
1764
|
+
interface ResolveTargetService {
|
|
1765
|
+
resolveTarget(params: ResolveTargetParams): Promise<ResolveTargetResult>;
|
|
1766
|
+
}
|
|
1767
|
+
import { z as z3 } from "zod";
|
|
1682
1768
|
/** Annotation fields required by OpenAI's MCP marketplace validation. */
|
|
1683
1769
|
interface CompleteToolAnnotations {
|
|
1684
1770
|
title?: string;
|
|
@@ -1717,7 +1803,7 @@ type ToolResult = {
|
|
|
1717
1803
|
* Zod raw shape type (what MCP SDK expects)
|
|
1718
1804
|
*/
|
|
1719
1805
|
type ZodRawShape = {
|
|
1720
|
-
[k: string]:
|
|
1806
|
+
[k: string]: z3.ZodTypeAny;
|
|
1721
1807
|
};
|
|
1722
1808
|
/**
|
|
1723
1809
|
* Services required to construct the MCP tool surface.
|
|
@@ -1732,6 +1818,7 @@ interface McpToolServices {
|
|
|
1732
1818
|
listService: ListService;
|
|
1733
1819
|
readService: ReadService;
|
|
1734
1820
|
grepService: GrepService;
|
|
1821
|
+
resolveTargetService: ResolveTargetService;
|
|
1735
1822
|
}
|
|
1736
1823
|
interface McpServerMetadata {
|
|
1737
1824
|
name: string;
|