@githits/mcp 0.38.1 → 0.40.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 +84 -25
- package/dist/client.js +1 -1
- package/dist/index.d.ts +73 -14
- package/dist/index.js +21 -13
- package/dist/shared/{chunk-rxe14jq0.js → chunk-38x0tqhy.js} +25 -13
- package/dist/shared/{chunk-m2pmp47r.js → chunk-g355w82s.js} +3 -3
- package/dist/shared/{chunk-rk9w8cvk.js → chunk-yy4545de.js} +5 -5
- package/dist/smoke-test.js +1 -1
- package/dist/tools.d.ts +13 -13
- package/dist/tools.js +1 -1
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -27,19 +27,50 @@ interface CreateClientHeaderBuilderOptions {
|
|
|
27
27
|
* relying on module-level CLI state.
|
|
28
28
|
*/
|
|
29
29
|
declare function createClientHeaderBuilder(options: CreateClientHeaderBuilderOptions): ClientHeaderBuilder;
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
interface OsvCredit {
|
|
31
|
+
name: string;
|
|
32
|
+
contact: string[];
|
|
33
|
+
type: string | null;
|
|
34
|
+
}
|
|
35
|
+
interface OsvSourceMetadata {
|
|
36
|
+
schemaVersion: string;
|
|
37
|
+
relatedIds: string[];
|
|
38
|
+
upstreamIds: string[];
|
|
39
|
+
credits: OsvCredit[];
|
|
40
|
+
}
|
|
41
|
+
interface OsvSourceDetails extends OsvSourceMetadata {
|
|
42
|
+
osvId: string;
|
|
43
|
+
aliases: string[];
|
|
44
|
+
summary: string | null;
|
|
45
|
+
details: string | null;
|
|
46
|
+
sourceUrl: string;
|
|
47
|
+
publishedAt: string | null;
|
|
48
|
+
modifiedAt: string;
|
|
49
|
+
withdrawnAt: string | null;
|
|
50
|
+
severity: Array<{
|
|
51
|
+
type: string;
|
|
52
|
+
score: string;
|
|
53
|
+
source: string | null;
|
|
54
|
+
}>;
|
|
55
|
+
references: Array<{
|
|
56
|
+
type: string;
|
|
57
|
+
url: string | null;
|
|
58
|
+
}>;
|
|
59
|
+
contentSafety: {
|
|
60
|
+
filtered: boolean;
|
|
61
|
+
modifications: string[];
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
interface VulnerabilitySourceEntry {
|
|
65
|
+
/** Exact representative ID from one original backend row, before assessment dedup. */
|
|
66
|
+
advisoryId: string | null;
|
|
67
|
+
source: OsvSourceDetails | null;
|
|
68
|
+
error?: {
|
|
69
|
+
code: string;
|
|
70
|
+
message: string;
|
|
71
|
+
retryable: boolean;
|
|
72
|
+
retryAfterSeconds?: number;
|
|
73
|
+
};
|
|
43
74
|
}
|
|
44
75
|
/**
|
|
45
76
|
* Host-supplied diagnostics for transport-neutral service clients.
|
|
@@ -63,6 +94,17 @@ interface ServiceDiagnostics {
|
|
|
63
94
|
isEnabled(area: string): boolean;
|
|
64
95
|
debug(area: string, event: Record<string, unknown>): void;
|
|
65
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Optional per-call controls shared by network-backed service methods.
|
|
99
|
+
*
|
|
100
|
+
* `signal` is the caller's cancellation signal, such as an MCP request
|
|
101
|
+
* cancellation. Services combine it with their own request deadline: a caller
|
|
102
|
+
* abort rejects with the signal's reason and is never retried, while an
|
|
103
|
+
* internal deadline keeps each service's timeout error mapping.
|
|
104
|
+
*/
|
|
105
|
+
interface ServiceRequestOptions {
|
|
106
|
+
signal?: AbortSignal;
|
|
107
|
+
}
|
|
66
108
|
interface TokenProvider {
|
|
67
109
|
/** Get a valid token, refreshing proactively or reactively as needed. */
|
|
68
110
|
getToken(): Promise<string | undefined>;
|
|
@@ -70,6 +112,20 @@ interface TokenProvider {
|
|
|
70
112
|
forceRefresh(): Promise<string | undefined>;
|
|
71
113
|
}
|
|
72
114
|
declare function createStaticTokenProvider(token: string): TokenProvider;
|
|
115
|
+
/**
|
|
116
|
+
* Optional per-call progress correlation for backend requests.
|
|
117
|
+
*
|
|
118
|
+
* Progress is best effort: the HTTP result stays authoritative. The backend
|
|
119
|
+
* validates progress headers before admission, accounting and execution, so a
|
|
120
|
+
* rejection carrying `X-GitHits-Progress-Error` means nothing ran and the same
|
|
121
|
+
* request is safe to resend once without the progress headers.
|
|
122
|
+
*/
|
|
123
|
+
interface ProgressRequest {
|
|
124
|
+
/** Correlation headers merged after client headers and before auth. */
|
|
125
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
126
|
+
/** Reports a pre-execution progress rejection; the call is then resent without progress. */
|
|
127
|
+
rejected(code: string): void;
|
|
128
|
+
}
|
|
73
129
|
declare const AGENTIC_ASK_REQUEST_TIMEOUT_MS = 21e4;
|
|
74
130
|
interface AgenticAskQuestion {
|
|
75
131
|
question: string;
|
|
@@ -185,17 +241,6 @@ interface ReadTarget {
|
|
|
185
241
|
startLine?: number;
|
|
186
242
|
endLine?: number;
|
|
187
243
|
}
|
|
188
|
-
/**
|
|
189
|
-
* Optional per-call controls shared by network-backed service methods.
|
|
190
|
-
*
|
|
191
|
-
* `signal` is the caller's cancellation signal, such as an MCP request
|
|
192
|
-
* cancellation. Services combine it with their own request deadline: a caller
|
|
193
|
-
* abort rejects with the signal's reason and is never retried, while an
|
|
194
|
-
* internal deadline keeps each service's timeout error mapping.
|
|
195
|
-
*/
|
|
196
|
-
interface ServiceRequestOptions {
|
|
197
|
-
signal?: AbortSignal;
|
|
198
|
-
}
|
|
199
244
|
/** Nullable registry-version association carried by public error inventories. */
|
|
200
245
|
interface RecoveryRef {
|
|
201
246
|
ref: string;
|
|
@@ -1390,11 +1435,22 @@ interface RegistryRepository {
|
|
|
1390
1435
|
name: string;
|
|
1391
1436
|
url: string;
|
|
1392
1437
|
}
|
|
1438
|
+
/** Why the registry pointer is excluded from default release selection. */
|
|
1439
|
+
type RegistryLatestDifferenceReason = "DEPRECATED" | "YANKED" | "NO_FILES" | "UNLISTED" | "PRERELEASE_EXCLUDED";
|
|
1440
|
+
interface RegistryLatestDifference {
|
|
1441
|
+
version: string;
|
|
1442
|
+
reason: RegistryLatestDifferenceReason;
|
|
1443
|
+
}
|
|
1393
1444
|
interface PackageIdentity {
|
|
1394
1445
|
name: string;
|
|
1395
1446
|
registry?: string;
|
|
1396
1447
|
description?: string;
|
|
1397
|
-
|
|
1448
|
+
/** Release selected for this overview; absent when no release is selected. */
|
|
1449
|
+
version?: string;
|
|
1450
|
+
publishedAt?: string;
|
|
1451
|
+
registryLatestDifference?: RegistryLatestDifference;
|
|
1452
|
+
/** Registry pointer, which may differ from the selected release. */
|
|
1453
|
+
latestVersion?: string;
|
|
1398
1454
|
latestVersionPublishedAt?: string;
|
|
1399
1455
|
homepage?: string;
|
|
1400
1456
|
repositoryUrl?: string;
|
|
@@ -1438,6 +1494,8 @@ interface PackageSummary {
|
|
|
1438
1494
|
latestChangelogs?: ChangelogEntry[];
|
|
1439
1495
|
}
|
|
1440
1496
|
interface PackageVulnerabilitiesParams {
|
|
1497
|
+
/** Opt in to full current OSV explanations on bounded direct advisory pages. */
|
|
1498
|
+
includeSourceDetails?: boolean;
|
|
1441
1499
|
registry: PkgseerRegistry;
|
|
1442
1500
|
packageName: string;
|
|
1443
1501
|
/** Optional — backend defaults to latest when omitted. */
|
|
@@ -1494,6 +1552,7 @@ interface VulnerabilitySecurityDetails {
|
|
|
1494
1552
|
upgradePaths?: string[];
|
|
1495
1553
|
}
|
|
1496
1554
|
interface VulnerabilityReport {
|
|
1555
|
+
sourceDetails?: VulnerabilitySourceEntry[];
|
|
1497
1556
|
package: PackageVersionIdentity;
|
|
1498
1557
|
security?: VulnerabilitySecurityDetails;
|
|
1499
1558
|
transitive?: TransitiveVulnerabilityAudit;
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{GrepGraphQLError2,GrepBackendError2,GrepAccessError2,GrepNetworkError2,MalformedGrepResponseError2,GrepServiceImpl2,ListAccessError2,ListGraphQLError2,ListBackendError2,ListNetworkError2,MalformedListResponseError2,ListServiceImpl2,ReadServiceImpl2,RefreshingGitHitsService2,ResolveTargetServiceImpl2,createStaticTokenProvider2,SessionIdConfigError2,getEnvSessionId2,createClientHeaderBuilder2}from"./shared/chunk-
|
|
1
|
+
import{GrepGraphQLError2,GrepBackendError2,GrepAccessError2,GrepNetworkError2,MalformedGrepResponseError2,GrepServiceImpl2,ListAccessError2,ListGraphQLError2,ListBackendError2,ListNetworkError2,MalformedListResponseError2,ListServiceImpl2,ReadServiceImpl2,RefreshingGitHitsService2,ResolveTargetServiceImpl2,createStaticTokenProvider2,SessionIdConfigError2,getEnvSessionId2,createClientHeaderBuilder2}from"./shared/chunk-yy4545de.js";import{ProviderReauthenticationRequiredError2,DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,GitHitsServiceImpl2,AGENTIC_ASK_REQUEST_TIMEOUT_MS2,AgenticAskServiceImpl2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,CodeDiffError2,CodeNavigationServiceImpl2,PackageIntelligenceServiceImpl2}from"./shared/chunk-38x0tqhy.js";export{AGENTIC_ASK_REQUEST_TIMEOUT_MS2 as AGENTIC_ASK_REQUEST_TIMEOUT_MS,AgenticAskServiceImpl2 as AgenticAskServiceImpl,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,ProviderReauthenticationRequiredError2 as ProviderReauthenticationRequiredError,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
|
@@ -19,6 +19,62 @@ declare function buildMcpQuickStart(options?: BuildMcpQuickStartOptions): string
|
|
|
19
19
|
*/
|
|
20
20
|
declare function buildMcpInstructions(options?: BuildMcpInstructionsOptions): string;
|
|
21
21
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
22
|
+
interface OsvCredit {
|
|
23
|
+
name: string;
|
|
24
|
+
contact: string[];
|
|
25
|
+
type: string | null;
|
|
26
|
+
}
|
|
27
|
+
interface OsvSourceMetadata {
|
|
28
|
+
schemaVersion: string;
|
|
29
|
+
relatedIds: string[];
|
|
30
|
+
upstreamIds: string[];
|
|
31
|
+
credits: OsvCredit[];
|
|
32
|
+
}
|
|
33
|
+
interface OsvSourceDetails extends OsvSourceMetadata {
|
|
34
|
+
osvId: string;
|
|
35
|
+
aliases: string[];
|
|
36
|
+
summary: string | null;
|
|
37
|
+
details: string | null;
|
|
38
|
+
sourceUrl: string;
|
|
39
|
+
publishedAt: string | null;
|
|
40
|
+
modifiedAt: string;
|
|
41
|
+
withdrawnAt: string | null;
|
|
42
|
+
severity: Array<{
|
|
43
|
+
type: string;
|
|
44
|
+
score: string;
|
|
45
|
+
source: string | null;
|
|
46
|
+
}>;
|
|
47
|
+
references: Array<{
|
|
48
|
+
type: string;
|
|
49
|
+
url: string | null;
|
|
50
|
+
}>;
|
|
51
|
+
contentSafety: {
|
|
52
|
+
filtered: boolean;
|
|
53
|
+
modifications: string[];
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
interface VulnerabilitySourceEntry {
|
|
57
|
+
/** Exact representative ID from one original backend row, before assessment dedup. */
|
|
58
|
+
advisoryId: string | null;
|
|
59
|
+
source: OsvSourceDetails | null;
|
|
60
|
+
error?: {
|
|
61
|
+
code: string;
|
|
62
|
+
message: string;
|
|
63
|
+
retryable: boolean;
|
|
64
|
+
retryAfterSeconds?: number;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Optional per-call controls shared by network-backed service methods.
|
|
69
|
+
*
|
|
70
|
+
* `signal` is the caller's cancellation signal, such as an MCP request
|
|
71
|
+
* cancellation. Services combine it with their own request deadline: a caller
|
|
72
|
+
* abort rejects with the signal's reason and is never retried, while an
|
|
73
|
+
* internal deadline keeps each service's timeout error mapping.
|
|
74
|
+
*/
|
|
75
|
+
interface ServiceRequestOptions {
|
|
76
|
+
signal?: AbortSignal;
|
|
77
|
+
}
|
|
22
78
|
/**
|
|
23
79
|
* Optional per-call progress correlation for backend requests.
|
|
24
80
|
*
|
|
@@ -102,17 +158,6 @@ interface ReadTarget {
|
|
|
102
158
|
endLine?: number;
|
|
103
159
|
}
|
|
104
160
|
/**
|
|
105
|
-
* Optional per-call controls shared by network-backed service methods.
|
|
106
|
-
*
|
|
107
|
-
* `signal` is the caller's cancellation signal, such as an MCP request
|
|
108
|
-
* cancellation. Services combine it with their own request deadline: a caller
|
|
109
|
-
* abort rejects with the signal's reason and is never retried, while an
|
|
110
|
-
* internal deadline keeps each service's timeout error mapping.
|
|
111
|
-
*/
|
|
112
|
-
interface ServiceRequestOptions {
|
|
113
|
-
signal?: AbortSignal;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
161
|
* Back-compat alias — the canonical registry union now lives in
|
|
117
162
|
* `src/shared/pkgseer-registry.ts`. Re-exported here so existing
|
|
118
163
|
* consumers of `CodeNavigationRegistry` compile unchanged.
|
|
@@ -1061,11 +1106,22 @@ interface RegistryRepository {
|
|
|
1061
1106
|
name: string;
|
|
1062
1107
|
url: string;
|
|
1063
1108
|
}
|
|
1109
|
+
/** Why the registry pointer is excluded from default release selection. */
|
|
1110
|
+
type RegistryLatestDifferenceReason = "DEPRECATED" | "YANKED" | "NO_FILES" | "UNLISTED" | "PRERELEASE_EXCLUDED";
|
|
1111
|
+
interface RegistryLatestDifference {
|
|
1112
|
+
version: string;
|
|
1113
|
+
reason: RegistryLatestDifferenceReason;
|
|
1114
|
+
}
|
|
1064
1115
|
interface PackageIdentity {
|
|
1065
1116
|
name: string;
|
|
1066
1117
|
registry?: string;
|
|
1067
1118
|
description?: string;
|
|
1068
|
-
|
|
1119
|
+
/** Release selected for this overview; absent when no release is selected. */
|
|
1120
|
+
version?: string;
|
|
1121
|
+
publishedAt?: string;
|
|
1122
|
+
registryLatestDifference?: RegistryLatestDifference;
|
|
1123
|
+
/** Registry pointer, which may differ from the selected release. */
|
|
1124
|
+
latestVersion?: string;
|
|
1069
1125
|
latestVersionPublishedAt?: string;
|
|
1070
1126
|
homepage?: string;
|
|
1071
1127
|
repositoryUrl?: string;
|
|
@@ -1109,6 +1165,8 @@ interface PackageSummary {
|
|
|
1109
1165
|
latestChangelogs?: ChangelogEntry[];
|
|
1110
1166
|
}
|
|
1111
1167
|
interface PackageVulnerabilitiesParams {
|
|
1168
|
+
/** Opt in to full current OSV explanations on bounded direct advisory pages. */
|
|
1169
|
+
includeSourceDetails?: boolean;
|
|
1112
1170
|
registry: PkgseerRegistry;
|
|
1113
1171
|
packageName: string;
|
|
1114
1172
|
/** Optional — backend defaults to latest when omitted. */
|
|
@@ -1165,6 +1223,7 @@ interface VulnerabilitySecurityDetails {
|
|
|
1165
1223
|
upgradePaths?: string[];
|
|
1166
1224
|
}
|
|
1167
1225
|
interface VulnerabilityReport {
|
|
1226
|
+
sourceDetails?: VulnerabilitySourceEntry[];
|
|
1168
1227
|
package: PackageVersionIdentity;
|
|
1169
1228
|
security?: VulnerabilitySecurityDetails;
|
|
1170
1229
|
transitive?: TransitiveVulnerabilityAudit;
|
|
@@ -2109,7 +2168,7 @@ interface McpProgressAnimationOptions {
|
|
|
2109
2168
|
}
|
|
2110
2169
|
/** Backend stage covered by the opening message. */
|
|
2111
2170
|
declare const OPENING_STAGE = "started";
|
|
2112
|
-
import { z as
|
|
2171
|
+
import { z as z5 } from "zod";
|
|
2113
2172
|
/** Annotation fields required by OpenAI's MCP marketplace validation. */
|
|
2114
2173
|
interface CompleteToolAnnotations {
|
|
2115
2174
|
title?: string;
|
|
@@ -2162,7 +2221,7 @@ type ToolResult = {
|
|
|
2162
2221
|
* Zod raw shape type (what MCP SDK expects)
|
|
2163
2222
|
*/
|
|
2164
2223
|
type ZodRawShape = {
|
|
2165
|
-
[k: string]:
|
|
2224
|
+
[k: string]: z5.ZodTypeAny;
|
|
2166
2225
|
};
|
|
2167
2226
|
/**
|
|
2168
2227
|
* Services required to construct the MCP tool surface.
|