@githits/mcp 0.9.1 → 0.10.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/client.d.ts +208 -12
- package/dist/client.js +1 -1
- package/dist/index.d.ts +42 -22
- package/dist/index.js +14 -14
- package/dist/shared/{chunk-xd3b13qj.js → chunk-qawyzgzx.js} +113 -5
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -9,9 +9,23 @@
|
|
|
9
9
|
* Back-compat: `src/shared/code-navigation.ts` re-exports these under
|
|
10
10
|
* the existing `CodeNavigationRegistry*` names.
|
|
11
11
|
*/
|
|
12
|
-
type PkgseerRegistry = "NPM" | "PYPI" | "HEX" | "CRATES" | "NUGET" | "MAVEN" | "ZIG" | "VCPKG" | "PACKAGIST" | "RUBYGEMS" | "GO" | "SWIFT";
|
|
13
12
|
declare const PKGSEER_REGISTRY_ARGS: readonly ["npm", "pypi", "hex", "crates", "nuget", "maven", "zig", "vcpkg", "packagist", "rubygems", "go", "swift"];
|
|
14
13
|
type PkgseerRegistryArg = (typeof PKGSEER_REGISTRY_ARGS)[number];
|
|
14
|
+
declare const registryMap: {
|
|
15
|
+
readonly npm: "NPM";
|
|
16
|
+
readonly pypi: "PYPI";
|
|
17
|
+
readonly hex: "HEX";
|
|
18
|
+
readonly crates: "CRATES";
|
|
19
|
+
readonly nuget: "NUGET";
|
|
20
|
+
readonly maven: "MAVEN";
|
|
21
|
+
readonly zig: "ZIG";
|
|
22
|
+
readonly vcpkg: "VCPKG";
|
|
23
|
+
readonly packagist: "PACKAGIST";
|
|
24
|
+
readonly rubygems: "RUBYGEMS";
|
|
25
|
+
readonly go: "GO";
|
|
26
|
+
readonly swift: "SWIFT";
|
|
27
|
+
};
|
|
28
|
+
type PkgseerRegistry = (typeof registryMap)[keyof typeof registryMap];
|
|
15
29
|
declare const PKGSEER_REGISTRY_LIST: string;
|
|
16
30
|
/**
|
|
17
31
|
* Lowercase surface value → uppercase backend enum. Exhaustive over
|
|
@@ -124,13 +138,7 @@ type UnifiedSearchSource = "AUTO" | "DOCS" | "CODE" | "SYMBOL";
|
|
|
124
138
|
type UnifiedSearchResultType = "DOCUMENTATION_PAGE" | "REPOSITORY_SYMBOL" | "REPOSITORY_CODE" | "REPOSITORY_DOC";
|
|
125
139
|
type UnifiedSearchSessionStatus = "PENDING" | "INDEXING" | "SEARCHING" | "COMPLETED" | "TIMEOUT" | "FAILED";
|
|
126
140
|
type CodeIndexState = "CURRENT" | "INDEXED" | "INDEXING" | "STALE" | "FAILED" | "MISSING" | string;
|
|
127
|
-
/**
|
|
128
|
-
* Coverage lifecycle for crawled documentation site data.
|
|
129
|
-
*
|
|
130
|
-
* `PARTIAL` is transient (a crawl is still running, so retrying later can
|
|
131
|
-
* return more); `CAPPED` is terminal (a crawl limit stopped indexing, so
|
|
132
|
-
* retrying will not help). Both mean served evidence may be incomplete.
|
|
133
|
-
*/
|
|
141
|
+
/** Coverage state of the selected published documentation corpus. */
|
|
134
142
|
type DocCoverageState = "NONE" | "PARTIAL" | "CAPPED" | "COMPLETE" | string;
|
|
135
143
|
/**
|
|
136
144
|
* Coverage metadata for crawled documentation site data. Present on docs
|
|
@@ -140,10 +148,10 @@ interface DocCoverage {
|
|
|
140
148
|
coverageState: DocCoverageState;
|
|
141
149
|
coverageReason?: string;
|
|
142
150
|
pagesCrawled?: number;
|
|
143
|
-
frontierRemaining?: number;
|
|
151
|
+
frontierRemaining?: number | null;
|
|
144
152
|
artifactOverflowPageCount?: number;
|
|
145
153
|
estimatedTotalPages?: number;
|
|
146
|
-
/** Backend-owned note
|
|
154
|
+
/** Backend-owned coverage note retained for structured callers. */
|
|
147
155
|
note?: string;
|
|
148
156
|
}
|
|
149
157
|
type DiscoveryRequestedRefKind = "OMITTED_VERSION" | "LATEST_VERSION" | "EXACT_VERSION" | "DEFAULT_BRANCH" | "HEAD" | "BRANCH" | "SHA";
|
|
@@ -224,8 +232,26 @@ interface UnifiedSearchSourceStatus {
|
|
|
224
232
|
appliedQueryFeatures: string[];
|
|
225
233
|
ignoredQueryFeatures: string[];
|
|
226
234
|
incompatibleQueryFeatures: string[];
|
|
235
|
+
suggestedSiteTargets: string[];
|
|
236
|
+
suggestedSiteTargetsTruncated: boolean;
|
|
227
237
|
note?: string;
|
|
228
238
|
coverage?: DocCoverage;
|
|
239
|
+
contributors?: UnifiedSearchDocumentationContributor[];
|
|
240
|
+
}
|
|
241
|
+
type UnifiedSearchDocumentationContributorKind = "REPOSITORY_DOCS" | "DOCPACK";
|
|
242
|
+
type UnifiedSearchDocumentationContributorState = "SEARCHED" | "READY" | "PENDING" | "UNAVAILABLE";
|
|
243
|
+
type UnifiedSearchDocumentationFreshness = "CURRENT" | "STALE";
|
|
244
|
+
/** One physical documentation corpus disclosed for a DOCS source row. */
|
|
245
|
+
interface UnifiedSearchDocumentationContributor {
|
|
246
|
+
kind: UnifiedSearchDocumentationContributorKind;
|
|
247
|
+
state: UnifiedSearchDocumentationContributorState;
|
|
248
|
+
freshness?: UnifiedSearchDocumentationFreshness;
|
|
249
|
+
resultCount: number;
|
|
250
|
+
repositoryUrl?: string;
|
|
251
|
+
commitSha?: string;
|
|
252
|
+
siteKey?: string;
|
|
253
|
+
siteUrl?: string;
|
|
254
|
+
coverage?: DocCoverage;
|
|
229
255
|
}
|
|
230
256
|
interface UnifiedSearchProgressTarget {
|
|
231
257
|
requested?: string;
|
|
@@ -256,6 +282,7 @@ interface UnifiedSearchResult {
|
|
|
256
282
|
page: UnifiedSearchPageInfo;
|
|
257
283
|
partialResults: boolean;
|
|
258
284
|
sourceStatus: UnifiedSearchSourceStatus[];
|
|
285
|
+
evidenceNotice?: string;
|
|
259
286
|
}
|
|
260
287
|
interface UnifiedSearchProgress {
|
|
261
288
|
searchRef: string;
|
|
@@ -350,6 +377,159 @@ interface ReadFileResult {
|
|
|
350
377
|
targetResolution?: TargetResolution;
|
|
351
378
|
availableVersions?: AvailableVersion[];
|
|
352
379
|
}
|
|
380
|
+
/**
|
|
381
|
+
* A package-addressing target for a repository-wide CodeDiff. Version
|
|
382
|
+
* resolution belongs to the comparison endpoints, so this target
|
|
383
|
+
* intentionally has no version field. Package addressing resolves repository
|
|
384
|
+
* identity and commits; it does not narrow raw file results to a package path.
|
|
385
|
+
* Target selection uses own-key presence; a `repoUrl` key rejects this shape
|
|
386
|
+
* even when its value is `undefined`.
|
|
387
|
+
*/
|
|
388
|
+
interface CodeDiffPackageTarget {
|
|
389
|
+
registry: CodeNavigationRegistry;
|
|
390
|
+
packageName: string;
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* A public repository target for CodeDiff. Ref resolution belongs to the
|
|
394
|
+
* comparison endpoints, so this target intentionally has no gitRef field.
|
|
395
|
+
* Target selection uses own-key presence; a `registry` or `packageName` key
|
|
396
|
+
* rejects this shape even when its value is `undefined`.
|
|
397
|
+
*/
|
|
398
|
+
interface CodeDiffRepositoryTarget {
|
|
399
|
+
repoUrl: string;
|
|
400
|
+
}
|
|
401
|
+
type CodeDiffTarget = CodeDiffPackageTarget | CodeDiffRepositoryTarget;
|
|
402
|
+
type CodeDiffMode = "inventory" | "stats" | "patches";
|
|
403
|
+
interface CodeDiffOptions {
|
|
404
|
+
maxFiles?: number;
|
|
405
|
+
maxPatchBytes?: number;
|
|
406
|
+
pathPrefix?: string;
|
|
407
|
+
pathGlob?: string;
|
|
408
|
+
}
|
|
409
|
+
interface CodeDiffParams {
|
|
410
|
+
target: CodeDiffTarget;
|
|
411
|
+
from: string;
|
|
412
|
+
to: string;
|
|
413
|
+
mode: CodeDiffMode;
|
|
414
|
+
options?: CodeDiffOptions;
|
|
415
|
+
}
|
|
416
|
+
type CodeDiffRefKind = "SHA" | "TAG" | "BRANCH" | "HEAD" | "UNKNOWN";
|
|
417
|
+
type CodeDiffVersionSource = "REGISTRY" | "GIT_HEAD" | "TAG" | "RELEASE";
|
|
418
|
+
/**
|
|
419
|
+
* Effective raw inventory scope. Current successful backends return
|
|
420
|
+
* `REPOSITORY`; `PACKAGE` and `UNKNOWN` remain accepted for compatibility with
|
|
421
|
+
* legacy responses.
|
|
422
|
+
*/
|
|
423
|
+
type RawCodeDiffScopeStatus = "PACKAGE" | "REPOSITORY" | "UNKNOWN";
|
|
424
|
+
type RawCodeDiffFileStatus = "ADDED" | "DELETED" | "MODIFIED";
|
|
425
|
+
type RawCodeDiffPathEncoding = "UTF8" | "BYTE_ESCAPED";
|
|
426
|
+
type RawCodeDiffFileContentStatus = "NOT_REQUESTED" | "STATS" | "PATCH" | "BINARY" | "METADATA_ONLY" | "OMITTED" | "UNAVAILABLE";
|
|
427
|
+
type RawCodeDiffContentCoverage = "NOT_REQUESTED" | "COMPLETE" | "PARTIAL" | "FAILED";
|
|
428
|
+
type ContentModification = "INVISIBLE_CONTROLS_STRIPPED" | "HTML_COMMENTS_STRIPPED" | "IMAGES_REPLACED" | "UNSAFE_LINKS_NEUTRALIZED";
|
|
429
|
+
interface CodeDiffPackageInfo {
|
|
430
|
+
registry: CodeNavigationRegistry;
|
|
431
|
+
name: string;
|
|
432
|
+
repoUrl: string;
|
|
433
|
+
}
|
|
434
|
+
interface CodeDiffRefResolution {
|
|
435
|
+
requested: string;
|
|
436
|
+
resolvedVersion?: string;
|
|
437
|
+
ref: string;
|
|
438
|
+
commitSha: string;
|
|
439
|
+
refKind: CodeDiffRefKind;
|
|
440
|
+
versionSource?: CodeDiffVersionSource;
|
|
441
|
+
}
|
|
442
|
+
interface RawCodeDiffSummary {
|
|
443
|
+
filesChanged: number;
|
|
444
|
+
added: number;
|
|
445
|
+
deleted: number;
|
|
446
|
+
modified: number;
|
|
447
|
+
modeChanged: number;
|
|
448
|
+
typeChanged: number;
|
|
449
|
+
inventoryComplete: boolean;
|
|
450
|
+
unprojectableFiles: number;
|
|
451
|
+
}
|
|
452
|
+
interface RawCodeDiffScope {
|
|
453
|
+
/** Scope of returned paths and counts, independent of addressing form. */
|
|
454
|
+
status: RawCodeDiffScopeStatus;
|
|
455
|
+
/** Legacy package-scope metadata; absent from current repository results. */
|
|
456
|
+
fromSubpath?: string;
|
|
457
|
+
/** Legacy package-scope metadata; absent from current repository results. */
|
|
458
|
+
toSubpath?: string;
|
|
459
|
+
/** Caller-supplied repository-relative filter, not verified package scope. */
|
|
460
|
+
pathPrefix?: string;
|
|
461
|
+
/** Caller-supplied repository-relative filter, not verified package scope. */
|
|
462
|
+
pathGlob?: string;
|
|
463
|
+
}
|
|
464
|
+
interface RawCodeDiffContentFailure {
|
|
465
|
+
code: string;
|
|
466
|
+
retryable: boolean;
|
|
467
|
+
retryAfterMs?: number;
|
|
468
|
+
stage?: string;
|
|
469
|
+
limitKind?: string;
|
|
470
|
+
}
|
|
471
|
+
interface ContentSafety {
|
|
472
|
+
filtered: boolean;
|
|
473
|
+
modifications: ContentModification[];
|
|
474
|
+
}
|
|
475
|
+
interface RawCodeDiffFile {
|
|
476
|
+
path: string;
|
|
477
|
+
pathEncoding: RawCodeDiffPathEncoding;
|
|
478
|
+
status: RawCodeDiffFileStatus;
|
|
479
|
+
modeChanged: boolean;
|
|
480
|
+
typeChanged: boolean;
|
|
481
|
+
additions?: number;
|
|
482
|
+
deletions?: number;
|
|
483
|
+
patch?: string;
|
|
484
|
+
contentStatus: RawCodeDiffFileContentStatus;
|
|
485
|
+
contentOmissionReason?: string;
|
|
486
|
+
contentSafety: ContentSafety;
|
|
487
|
+
}
|
|
488
|
+
interface RawCodeDiff {
|
|
489
|
+
summary: RawCodeDiffSummary;
|
|
490
|
+
scope: RawCodeDiffScope;
|
|
491
|
+
contentCoverage: RawCodeDiffContentCoverage;
|
|
492
|
+
contentFailure?: RawCodeDiffContentFailure;
|
|
493
|
+
files: RawCodeDiffFile[];
|
|
494
|
+
hasMoreFiles: boolean;
|
|
495
|
+
}
|
|
496
|
+
interface CodeDiffResult {
|
|
497
|
+
package?: CodeDiffPackageInfo;
|
|
498
|
+
fromResolution: CodeDiffRefResolution;
|
|
499
|
+
toResolution: CodeDiffRefResolution;
|
|
500
|
+
raw: RawCodeDiff;
|
|
501
|
+
}
|
|
502
|
+
interface CodeDiffErrorRef {
|
|
503
|
+
ref: string;
|
|
504
|
+
version?: string;
|
|
505
|
+
}
|
|
506
|
+
/**
|
|
507
|
+
* Bounded metadata retained from PkgSeer CodeDiff GraphQL errors. Do not add
|
|
508
|
+
* arbitrary extension values here: this object is safe to pass to public
|
|
509
|
+
* error envelopes and telemetry.
|
|
510
|
+
*/
|
|
511
|
+
interface CodeDiffErrorDetails {
|
|
512
|
+
code?: string;
|
|
513
|
+
retryable?: boolean;
|
|
514
|
+
side?: string;
|
|
515
|
+
publishedVersions?: string[];
|
|
516
|
+
publishedVersionsTruncated?: boolean;
|
|
517
|
+
registry?: string;
|
|
518
|
+
retryAfterMs?: number;
|
|
519
|
+
stage?: string;
|
|
520
|
+
limitKind?: string;
|
|
521
|
+
repoUrl?: string;
|
|
522
|
+
gitRef?: string;
|
|
523
|
+
availableRefs?: CodeDiffErrorRef[];
|
|
524
|
+
suggestedRefs?: CodeDiffErrorRef[];
|
|
525
|
+
refKinds?: string[];
|
|
526
|
+
}
|
|
527
|
+
interface CodeDiffPartialResult {
|
|
528
|
+
package?: CodeDiffPackageInfo;
|
|
529
|
+
fromResolution: CodeDiffRefResolution;
|
|
530
|
+
toResolution: CodeDiffRefResolution;
|
|
531
|
+
raw?: RawCodeDiff;
|
|
532
|
+
}
|
|
353
533
|
type GrepRepoPatternType = "LITERAL" | "REGEX";
|
|
354
534
|
type GrepPathSelectorKind = "EXACT" | "PREFIX" | "GLOB";
|
|
355
535
|
interface GrepRepoPathSelector {
|
|
@@ -429,7 +609,20 @@ interface CodeNavigationService {
|
|
|
429
609
|
readFile(params: ReadFileParams): Promise<ReadFileResult>;
|
|
430
610
|
grepRepo(params: GrepRepoParams): Promise<GrepRepoResult>;
|
|
431
611
|
}
|
|
432
|
-
|
|
612
|
+
/** Additive client capability for the unpromoted CodeDiff surface. */
|
|
613
|
+
interface CodeDiffService {
|
|
614
|
+
codeDiff(params: CodeDiffParams): Promise<CodeDiffResult>;
|
|
615
|
+
}
|
|
616
|
+
/**
|
|
617
|
+
* GraphQL resolver error for CodeDiff. `partial` is present only when the
|
|
618
|
+
* backend returned a valid root resolution alongside a field-local error.
|
|
619
|
+
*/
|
|
620
|
+
declare class CodeDiffError extends Error {
|
|
621
|
+
readonly details: CodeDiffErrorDetails | undefined;
|
|
622
|
+
readonly partial: CodeDiffPartialResult | undefined;
|
|
623
|
+
constructor(message: string, details?: CodeDiffErrorDetails | undefined, partial?: CodeDiffPartialResult | undefined);
|
|
624
|
+
}
|
|
625
|
+
declare class CodeNavigationServiceImpl implements CodeNavigationService, CodeDiffService {
|
|
433
626
|
private readonly codeNavigationUrl;
|
|
434
627
|
private readonly tokenProvider;
|
|
435
628
|
private readonly fetchFn;
|
|
@@ -442,6 +635,9 @@ declare class CodeNavigationServiceImpl implements CodeNavigationService {
|
|
|
442
635
|
private postGraphqlWithTargetResolutionFallback;
|
|
443
636
|
search(params: UnifiedSearchParams): Promise<UnifiedSearchOutcome>;
|
|
444
637
|
searchStatus(searchRef: string, waitTimeoutMs?: number): Promise<UnifiedSearchOutcome>;
|
|
638
|
+
codeDiff(params: CodeDiffParams): Promise<CodeDiffResult>;
|
|
639
|
+
private executeCodeDiff;
|
|
640
|
+
private createCodeDiffRootError;
|
|
445
641
|
private executeUnifiedSearch;
|
|
446
642
|
private executeUnifiedSearchStatus;
|
|
447
643
|
private createHttpError;
|
|
@@ -1275,4 +1471,4 @@ declare function withTelemetrySpan<T>(name: string, operation: () => Promise<T>,
|
|
|
1275
1471
|
declare function startTelemetrySpan(name: string, attributes?: TelemetryAttributes): TelemetrySpanHandle | undefined;
|
|
1276
1472
|
declare function endTelemetrySpan(handle: TelemetrySpanHandle | undefined, attributes?: TelemetryAttributes): void;
|
|
1277
1473
|
declare function flushTelemetry(exitCode?: number): void;
|
|
1278
|
-
export { withTelemetrySpan, toPkgseerRegistryLowercase, toPkgseerRegistry, startTelemetrySpan, getMcpUrl, getEnvApiToken, getCodeNavigationUrl, getApiUrl, flushTelemetry, endTelemetrySpan, createStaticTokenProvider, createClientHeaderBuilder, TokenProvider, RefreshingGitHitsService, PackageIntelligenceServiceImpl, PackageIntelligenceService, PKGSEER_REGISTRY_LIST, GitHitsServiceImpl, GitHitsService, DEFAULT_MCP_URL, DEFAULT_CODE_NAV_URL, DEFAULT_API_URL, CodeNavigationServiceImpl, CodeNavigationService, AgentInfo };
|
|
1474
|
+
export { withTelemetrySpan, toPkgseerRegistryLowercase, toPkgseerRegistry, startTelemetrySpan, getMcpUrl, getEnvApiToken, getCodeNavigationUrl, getApiUrl, flushTelemetry, endTelemetrySpan, createStaticTokenProvider, createClientHeaderBuilder, TokenProvider, RefreshingGitHitsService, RawCodeDiffSummary, RawCodeDiffScopeStatus, RawCodeDiffScope, RawCodeDiffPathEncoding, RawCodeDiffFileStatus, RawCodeDiffFileContentStatus, RawCodeDiffFile, RawCodeDiffContentFailure, RawCodeDiffContentCoverage, RawCodeDiff, PackageIntelligenceServiceImpl, PackageIntelligenceService, PKGSEER_REGISTRY_LIST, GitHitsServiceImpl, GitHitsService, DEFAULT_MCP_URL, DEFAULT_CODE_NAV_URL, DEFAULT_API_URL, ContentSafety, ContentModification, CodeNavigationServiceImpl, CodeNavigationService, CodeDiffVersionSource, CodeDiffTarget, CodeDiffService, CodeDiffResult, CodeDiffRepositoryTarget, CodeDiffRefResolution, CodeDiffRefKind, CodeDiffPartialResult, CodeDiffParams, CodeDiffPackageTarget, CodeDiffPackageInfo, CodeDiffOptions, CodeDiffMode, CodeDiffErrorRef, CodeDiffErrorDetails, CodeDiffError, AgentInfo };
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{CodeNavigationServiceImpl,DEFAULT_API_URL,DEFAULT_CODE_NAV_URL,DEFAULT_MCP_URL,GitHitsServiceImpl,PKGSEER_REGISTRY_LIST,PackageIntelligenceServiceImpl,RefreshingGitHitsService,createClientHeaderBuilder,createStaticTokenProvider,endTelemetrySpan,flushTelemetry,getApiUrl,getCodeNavigationUrl,getEnvApiToken,getMcpUrl,startTelemetrySpan,toPkgseerRegistry,toPkgseerRegistryLowercase,withTelemetrySpan}from"./shared/chunk-
|
|
1
|
+
import{CodeDiffError,CodeNavigationServiceImpl,DEFAULT_API_URL,DEFAULT_CODE_NAV_URL,DEFAULT_MCP_URL,GitHitsServiceImpl,PKGSEER_REGISTRY_LIST,PackageIntelligenceServiceImpl,RefreshingGitHitsService,createClientHeaderBuilder,createStaticTokenProvider,endTelemetrySpan,flushTelemetry,getApiUrl,getCodeNavigationUrl,getEnvApiToken,getMcpUrl,startTelemetrySpan,toPkgseerRegistry,toPkgseerRegistryLowercase,withTelemetrySpan}from"./shared/chunk-qawyzgzx.js";export{withTelemetrySpan,toPkgseerRegistryLowercase,toPkgseerRegistry,startTelemetrySpan,getMcpUrl,getEnvApiToken,getCodeNavigationUrl,getApiUrl,flushTelemetry,endTelemetrySpan,createStaticTokenProvider,createClientHeaderBuilder,RefreshingGitHitsService,PackageIntelligenceServiceImpl,PKGSEER_REGISTRY_LIST,GitHitsServiceImpl,DEFAULT_MCP_URL,DEFAULT_CODE_NAV_URL,DEFAULT_API_URL,CodeNavigationServiceImpl,CodeDiffError};
|
package/dist/index.d.ts
CHANGED
|
@@ -16,18 +16,21 @@ interface BuildMcpInstructionsOptions {
|
|
|
16
16
|
}
|
|
17
17
|
declare function buildMcpInstructions(options?: BuildMcpInstructionsOptions): string;
|
|
18
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
declare const registryMap: {
|
|
20
|
+
readonly npm: "NPM";
|
|
21
|
+
readonly pypi: "PYPI";
|
|
22
|
+
readonly hex: "HEX";
|
|
23
|
+
readonly crates: "CRATES";
|
|
24
|
+
readonly nuget: "NUGET";
|
|
25
|
+
readonly maven: "MAVEN";
|
|
26
|
+
readonly zig: "ZIG";
|
|
27
|
+
readonly vcpkg: "VCPKG";
|
|
28
|
+
readonly packagist: "PACKAGIST";
|
|
29
|
+
readonly rubygems: "RUBYGEMS";
|
|
30
|
+
readonly go: "GO";
|
|
31
|
+
readonly swift: "SWIFT";
|
|
32
|
+
};
|
|
33
|
+
type PkgseerRegistry = (typeof registryMap)[keyof typeof registryMap];
|
|
31
34
|
/**
|
|
32
35
|
* Back-compat alias — the canonical registry union now lives in
|
|
33
36
|
* `src/shared/pkgseer-registry.ts`. Re-exported here so existing
|
|
@@ -98,13 +101,7 @@ type UnifiedSearchSource = "AUTO" | "DOCS" | "CODE" | "SYMBOL";
|
|
|
98
101
|
type UnifiedSearchResultType = "DOCUMENTATION_PAGE" | "REPOSITORY_SYMBOL" | "REPOSITORY_CODE" | "REPOSITORY_DOC";
|
|
99
102
|
type UnifiedSearchSessionStatus = "PENDING" | "INDEXING" | "SEARCHING" | "COMPLETED" | "TIMEOUT" | "FAILED";
|
|
100
103
|
type CodeIndexState = "CURRENT" | "INDEXED" | "INDEXING" | "STALE" | "FAILED" | "MISSING" | string;
|
|
101
|
-
/**
|
|
102
|
-
* Coverage lifecycle for crawled documentation site data.
|
|
103
|
-
*
|
|
104
|
-
* `PARTIAL` is transient (a crawl is still running, so retrying later can
|
|
105
|
-
* return more); `CAPPED` is terminal (a crawl limit stopped indexing, so
|
|
106
|
-
* retrying will not help). Both mean served evidence may be incomplete.
|
|
107
|
-
*/
|
|
104
|
+
/** Coverage state of the selected published documentation corpus. */
|
|
108
105
|
type DocCoverageState = "NONE" | "PARTIAL" | "CAPPED" | "COMPLETE" | string;
|
|
109
106
|
/**
|
|
110
107
|
* Coverage metadata for crawled documentation site data. Present on docs
|
|
@@ -114,10 +111,10 @@ interface DocCoverage {
|
|
|
114
111
|
coverageState: DocCoverageState;
|
|
115
112
|
coverageReason?: string;
|
|
116
113
|
pagesCrawled?: number;
|
|
117
|
-
frontierRemaining?: number;
|
|
114
|
+
frontierRemaining?: number | null;
|
|
118
115
|
artifactOverflowPageCount?: number;
|
|
119
116
|
estimatedTotalPages?: number;
|
|
120
|
-
/** Backend-owned note
|
|
117
|
+
/** Backend-owned coverage note retained for structured callers. */
|
|
121
118
|
note?: string;
|
|
122
119
|
}
|
|
123
120
|
type DiscoveryRequestedRefKind = "OMITTED_VERSION" | "LATEST_VERSION" | "EXACT_VERSION" | "DEFAULT_BRANCH" | "HEAD" | "BRANCH" | "SHA";
|
|
@@ -198,8 +195,26 @@ interface UnifiedSearchSourceStatus {
|
|
|
198
195
|
appliedQueryFeatures: string[];
|
|
199
196
|
ignoredQueryFeatures: string[];
|
|
200
197
|
incompatibleQueryFeatures: string[];
|
|
198
|
+
suggestedSiteTargets: string[];
|
|
199
|
+
suggestedSiteTargetsTruncated: boolean;
|
|
201
200
|
note?: string;
|
|
202
201
|
coverage?: DocCoverage;
|
|
202
|
+
contributors?: UnifiedSearchDocumentationContributor[];
|
|
203
|
+
}
|
|
204
|
+
type UnifiedSearchDocumentationContributorKind = "REPOSITORY_DOCS" | "DOCPACK";
|
|
205
|
+
type UnifiedSearchDocumentationContributorState = "SEARCHED" | "READY" | "PENDING" | "UNAVAILABLE";
|
|
206
|
+
type UnifiedSearchDocumentationFreshness = "CURRENT" | "STALE";
|
|
207
|
+
/** One physical documentation corpus disclosed for a DOCS source row. */
|
|
208
|
+
interface UnifiedSearchDocumentationContributor {
|
|
209
|
+
kind: UnifiedSearchDocumentationContributorKind;
|
|
210
|
+
state: UnifiedSearchDocumentationContributorState;
|
|
211
|
+
freshness?: UnifiedSearchDocumentationFreshness;
|
|
212
|
+
resultCount: number;
|
|
213
|
+
repositoryUrl?: string;
|
|
214
|
+
commitSha?: string;
|
|
215
|
+
siteKey?: string;
|
|
216
|
+
siteUrl?: string;
|
|
217
|
+
coverage?: DocCoverage;
|
|
203
218
|
}
|
|
204
219
|
interface UnifiedSearchProgressTarget {
|
|
205
220
|
requested?: string;
|
|
@@ -230,6 +245,7 @@ interface UnifiedSearchResult {
|
|
|
230
245
|
page: UnifiedSearchPageInfo;
|
|
231
246
|
partialResults: boolean;
|
|
232
247
|
sourceStatus: UnifiedSearchSourceStatus[];
|
|
248
|
+
evidenceNotice?: string;
|
|
233
249
|
}
|
|
234
250
|
interface UnifiedSearchProgress {
|
|
235
251
|
searchRef: string;
|
|
@@ -1128,7 +1144,11 @@ interface McpServerMetadata {
|
|
|
1128
1144
|
interface McpRequestContext<TExtra = unknown> {
|
|
1129
1145
|
extra: TExtra | undefined;
|
|
1130
1146
|
}
|
|
1131
|
-
type
|
|
1147
|
+
type McpToolServicesProviderFor<
|
|
1148
|
+
TServices extends McpToolServices,
|
|
1149
|
+
TExtra = unknown
|
|
1150
|
+
> = TServices | ((context: McpRequestContext<TExtra>) => TServices | Promise<TServices>);
|
|
1151
|
+
type McpToolServicesProvider<TExtra = unknown> = McpToolServicesProviderFor<McpToolServices, TExtra>;
|
|
1132
1152
|
/** Wraps one public MCP tool call without receiving arguments or auth data. */
|
|
1133
1153
|
type McpToolExecutionHook = (toolName: string, runHandler: () => Promise<ToolResult>) => ToolResult | Promise<ToolResult>;
|
|
1134
1154
|
interface CreateMcpServerOptions<TExtra = unknown> {
|