@githits/mcp 0.9.0 → 0.9.2
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 +176 -3
- package/dist/client.js +1 -1
- package/dist/index.d.ts +17 -12
- package/dist/index.js +13 -13
- package/dist/shared/chunk-0p63psz9.js +1302 -0
- package/package.json +1 -1
- package/dist/shared/chunk-k30yatty.js +0 -1209
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
|
|
@@ -224,6 +238,8 @@ interface UnifiedSearchSourceStatus {
|
|
|
224
238
|
appliedQueryFeatures: string[];
|
|
225
239
|
ignoredQueryFeatures: string[];
|
|
226
240
|
incompatibleQueryFeatures: string[];
|
|
241
|
+
suggestedSiteTargets: string[];
|
|
242
|
+
suggestedSiteTargetsTruncated: boolean;
|
|
227
243
|
note?: string;
|
|
228
244
|
coverage?: DocCoverage;
|
|
229
245
|
}
|
|
@@ -350,6 +366,147 @@ interface ReadFileResult {
|
|
|
350
366
|
targetResolution?: TargetResolution;
|
|
351
367
|
availableVersions?: AvailableVersion[];
|
|
352
368
|
}
|
|
369
|
+
/**
|
|
370
|
+
* A package target for CodeDiff. Version resolution belongs to the
|
|
371
|
+
* comparison endpoints, so this target intentionally has no version field.
|
|
372
|
+
* Target selection uses own-key presence; a `repoUrl` key rejects this shape
|
|
373
|
+
* even when its value is `undefined`.
|
|
374
|
+
*/
|
|
375
|
+
interface CodeDiffPackageTarget {
|
|
376
|
+
registry: CodeNavigationRegistry;
|
|
377
|
+
packageName: string;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* A public repository target for CodeDiff. Ref resolution belongs to the
|
|
381
|
+
* comparison endpoints, so this target intentionally has no gitRef field.
|
|
382
|
+
* Target selection uses own-key presence; a `registry` or `packageName` key
|
|
383
|
+
* rejects this shape even when its value is `undefined`.
|
|
384
|
+
*/
|
|
385
|
+
interface CodeDiffRepositoryTarget {
|
|
386
|
+
repoUrl: string;
|
|
387
|
+
}
|
|
388
|
+
type CodeDiffTarget = CodeDiffPackageTarget | CodeDiffRepositoryTarget;
|
|
389
|
+
type CodeDiffMode = "inventory" | "stats" | "patches";
|
|
390
|
+
interface CodeDiffOptions {
|
|
391
|
+
maxFiles?: number;
|
|
392
|
+
maxPatchBytes?: number;
|
|
393
|
+
pathPrefix?: string;
|
|
394
|
+
pathGlob?: string;
|
|
395
|
+
}
|
|
396
|
+
interface CodeDiffParams {
|
|
397
|
+
target: CodeDiffTarget;
|
|
398
|
+
from: string;
|
|
399
|
+
to: string;
|
|
400
|
+
mode: CodeDiffMode;
|
|
401
|
+
options?: CodeDiffOptions;
|
|
402
|
+
}
|
|
403
|
+
type CodeDiffRefKind = "SHA" | "TAG" | "BRANCH" | "HEAD" | "UNKNOWN";
|
|
404
|
+
type CodeDiffVersionSource = "REGISTRY" | "GIT_HEAD" | "TAG" | "RELEASE";
|
|
405
|
+
type RawCodeDiffScopeStatus = "PACKAGE" | "REPOSITORY" | "UNKNOWN";
|
|
406
|
+
type RawCodeDiffFileStatus = "ADDED" | "DELETED" | "MODIFIED";
|
|
407
|
+
type RawCodeDiffPathEncoding = "UTF8" | "BYTE_ESCAPED";
|
|
408
|
+
type RawCodeDiffFileContentStatus = "NOT_REQUESTED" | "STATS" | "PATCH" | "BINARY" | "METADATA_ONLY" | "OMITTED" | "UNAVAILABLE";
|
|
409
|
+
type RawCodeDiffContentCoverage = "NOT_REQUESTED" | "COMPLETE" | "PARTIAL" | "FAILED";
|
|
410
|
+
type ContentModification = "INVISIBLE_CONTROLS_STRIPPED" | "HTML_COMMENTS_STRIPPED" | "IMAGES_REPLACED" | "UNSAFE_LINKS_NEUTRALIZED";
|
|
411
|
+
interface CodeDiffPackageInfo {
|
|
412
|
+
registry: CodeNavigationRegistry;
|
|
413
|
+
name: string;
|
|
414
|
+
repoUrl: string;
|
|
415
|
+
}
|
|
416
|
+
interface CodeDiffRefResolution {
|
|
417
|
+
requested: string;
|
|
418
|
+
resolvedVersion?: string;
|
|
419
|
+
ref: string;
|
|
420
|
+
commitSha: string;
|
|
421
|
+
refKind: CodeDiffRefKind;
|
|
422
|
+
versionSource?: CodeDiffVersionSource;
|
|
423
|
+
}
|
|
424
|
+
interface RawCodeDiffSummary {
|
|
425
|
+
filesChanged: number;
|
|
426
|
+
added: number;
|
|
427
|
+
deleted: number;
|
|
428
|
+
modified: number;
|
|
429
|
+
modeChanged: number;
|
|
430
|
+
typeChanged: number;
|
|
431
|
+
inventoryComplete: boolean;
|
|
432
|
+
unprojectableFiles: number;
|
|
433
|
+
}
|
|
434
|
+
interface RawCodeDiffScope {
|
|
435
|
+
status: RawCodeDiffScopeStatus;
|
|
436
|
+
fromSubpath?: string;
|
|
437
|
+
toSubpath?: string;
|
|
438
|
+
pathPrefix?: string;
|
|
439
|
+
pathGlob?: string;
|
|
440
|
+
}
|
|
441
|
+
interface RawCodeDiffContentFailure {
|
|
442
|
+
code: string;
|
|
443
|
+
retryable: boolean;
|
|
444
|
+
retryAfterMs?: number;
|
|
445
|
+
stage?: string;
|
|
446
|
+
limitKind?: string;
|
|
447
|
+
}
|
|
448
|
+
interface ContentSafety {
|
|
449
|
+
filtered: boolean;
|
|
450
|
+
modifications: ContentModification[];
|
|
451
|
+
}
|
|
452
|
+
interface RawCodeDiffFile {
|
|
453
|
+
path: string;
|
|
454
|
+
pathEncoding: RawCodeDiffPathEncoding;
|
|
455
|
+
status: RawCodeDiffFileStatus;
|
|
456
|
+
modeChanged: boolean;
|
|
457
|
+
typeChanged: boolean;
|
|
458
|
+
additions?: number;
|
|
459
|
+
deletions?: number;
|
|
460
|
+
patch?: string;
|
|
461
|
+
contentStatus: RawCodeDiffFileContentStatus;
|
|
462
|
+
contentOmissionReason?: string;
|
|
463
|
+
contentSafety: ContentSafety;
|
|
464
|
+
}
|
|
465
|
+
interface RawCodeDiff {
|
|
466
|
+
summary: RawCodeDiffSummary;
|
|
467
|
+
scope: RawCodeDiffScope;
|
|
468
|
+
contentCoverage: RawCodeDiffContentCoverage;
|
|
469
|
+
contentFailure?: RawCodeDiffContentFailure;
|
|
470
|
+
files: RawCodeDiffFile[];
|
|
471
|
+
hasMoreFiles: boolean;
|
|
472
|
+
}
|
|
473
|
+
interface CodeDiffResult {
|
|
474
|
+
package?: CodeDiffPackageInfo;
|
|
475
|
+
fromResolution: CodeDiffRefResolution;
|
|
476
|
+
toResolution: CodeDiffRefResolution;
|
|
477
|
+
raw: RawCodeDiff;
|
|
478
|
+
}
|
|
479
|
+
interface CodeDiffErrorRef {
|
|
480
|
+
ref: string;
|
|
481
|
+
version?: string;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Bounded metadata retained from PkgSeer CodeDiff GraphQL errors. Do not add
|
|
485
|
+
* arbitrary extension values here: this object is safe to pass to public
|
|
486
|
+
* error envelopes and telemetry.
|
|
487
|
+
*/
|
|
488
|
+
interface CodeDiffErrorDetails {
|
|
489
|
+
code?: string;
|
|
490
|
+
retryable?: boolean;
|
|
491
|
+
side?: string;
|
|
492
|
+
publishedVersions?: string[];
|
|
493
|
+
publishedVersionsTruncated?: boolean;
|
|
494
|
+
registry?: string;
|
|
495
|
+
retryAfterMs?: number;
|
|
496
|
+
stage?: string;
|
|
497
|
+
limitKind?: string;
|
|
498
|
+
repoUrl?: string;
|
|
499
|
+
gitRef?: string;
|
|
500
|
+
availableRefs?: CodeDiffErrorRef[];
|
|
501
|
+
suggestedRefs?: CodeDiffErrorRef[];
|
|
502
|
+
refKinds?: string[];
|
|
503
|
+
}
|
|
504
|
+
interface CodeDiffPartialResult {
|
|
505
|
+
package?: CodeDiffPackageInfo;
|
|
506
|
+
fromResolution: CodeDiffRefResolution;
|
|
507
|
+
toResolution: CodeDiffRefResolution;
|
|
508
|
+
raw?: RawCodeDiff;
|
|
509
|
+
}
|
|
353
510
|
type GrepRepoPatternType = "LITERAL" | "REGEX";
|
|
354
511
|
type GrepPathSelectorKind = "EXACT" | "PREFIX" | "GLOB";
|
|
355
512
|
interface GrepRepoPathSelector {
|
|
@@ -429,7 +586,20 @@ interface CodeNavigationService {
|
|
|
429
586
|
readFile(params: ReadFileParams): Promise<ReadFileResult>;
|
|
430
587
|
grepRepo(params: GrepRepoParams): Promise<GrepRepoResult>;
|
|
431
588
|
}
|
|
432
|
-
|
|
589
|
+
/** Additive client capability for the unpromoted CodeDiff surface. */
|
|
590
|
+
interface CodeDiffService {
|
|
591
|
+
codeDiff(params: CodeDiffParams): Promise<CodeDiffResult>;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* GraphQL resolver error for CodeDiff. `partial` is present only when the
|
|
595
|
+
* backend returned a valid root resolution alongside a field-local error.
|
|
596
|
+
*/
|
|
597
|
+
declare class CodeDiffError extends Error {
|
|
598
|
+
readonly details: CodeDiffErrorDetails | undefined;
|
|
599
|
+
readonly partial: CodeDiffPartialResult | undefined;
|
|
600
|
+
constructor(message: string, details?: CodeDiffErrorDetails | undefined, partial?: CodeDiffPartialResult | undefined);
|
|
601
|
+
}
|
|
602
|
+
declare class CodeNavigationServiceImpl implements CodeNavigationService, CodeDiffService {
|
|
433
603
|
private readonly codeNavigationUrl;
|
|
434
604
|
private readonly tokenProvider;
|
|
435
605
|
private readonly fetchFn;
|
|
@@ -442,6 +612,9 @@ declare class CodeNavigationServiceImpl implements CodeNavigationService {
|
|
|
442
612
|
private postGraphqlWithTargetResolutionFallback;
|
|
443
613
|
search(params: UnifiedSearchParams): Promise<UnifiedSearchOutcome>;
|
|
444
614
|
searchStatus(searchRef: string, waitTimeoutMs?: number): Promise<UnifiedSearchOutcome>;
|
|
615
|
+
codeDiff(params: CodeDiffParams): Promise<CodeDiffResult>;
|
|
616
|
+
private executeCodeDiff;
|
|
617
|
+
private createCodeDiffRootError;
|
|
445
618
|
private executeUnifiedSearch;
|
|
446
619
|
private executeUnifiedSearchStatus;
|
|
447
620
|
private createHttpError;
|
|
@@ -1275,4 +1448,4 @@ declare function withTelemetrySpan<T>(name: string, operation: () => Promise<T>,
|
|
|
1275
1448
|
declare function startTelemetrySpan(name: string, attributes?: TelemetryAttributes): TelemetrySpanHandle | undefined;
|
|
1276
1449
|
declare function endTelemetrySpan(handle: TelemetrySpanHandle | undefined, attributes?: TelemetryAttributes): void;
|
|
1277
1450
|
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 };
|
|
1451
|
+
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-0p63psz9.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
|
|
@@ -198,6 +201,8 @@ interface UnifiedSearchSourceStatus {
|
|
|
198
201
|
appliedQueryFeatures: string[];
|
|
199
202
|
ignoredQueryFeatures: string[];
|
|
200
203
|
incompatibleQueryFeatures: string[];
|
|
204
|
+
suggestedSiteTargets: string[];
|
|
205
|
+
suggestedSiteTargetsTruncated: boolean;
|
|
201
206
|
note?: string;
|
|
202
207
|
coverage?: DocCoverage;
|
|
203
208
|
}
|