@githits/mcp 0.15.1 → 0.16.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 +2 -28
- package/dist/client.js +1 -1
- package/dist/index.d.ts +41 -65
- package/dist/index.js +25 -31
- package/dist/shared/chunk-9kvwrp49.js +16 -0
- package/dist/shared/{chunk-dybf4ebf.js → chunk-kpjbjs3v.js} +2 -2
- package/dist/smoke-test.d.ts +4 -1
- package/dist/smoke-test.js +2 -2
- package/dist/tools.js +1 -1
- package/package.json +1 -1
- package/dist/shared/chunk-j0jr58yz.js +0 -16
package/dist/client.d.ts
CHANGED
|
@@ -804,7 +804,7 @@ declare class CodeNavigationServiceImpl implements CodeNavigationService, CodeDi
|
|
|
804
804
|
*
|
|
805
805
|
* Three separate URLs are needed:
|
|
806
806
|
* - MCP URL: For OAuth discovery (.well-known endpoints) and auth flow
|
|
807
|
-
* - API URL: For REST API calls (search
|
|
807
|
+
* - API URL: For REST API calls (search and languages)
|
|
808
808
|
* - Code navigation URL: For indexed package/source calls
|
|
809
809
|
*/
|
|
810
810
|
declare const DEFAULT_MCP_URL = "https://mcp.githits.com";
|
|
@@ -816,7 +816,7 @@ declare const DEFAULT_CODE_NAV_URL = "https://pkgseer.dev";
|
|
|
816
816
|
*/
|
|
817
817
|
declare function getMcpUrl(): string;
|
|
818
818
|
/**
|
|
819
|
-
* Get the REST API base URL (for search
|
|
819
|
+
* Get the REST API base URL (for search and languages).
|
|
820
820
|
* Override with GITHITS_API_URL environment variable.
|
|
821
821
|
*/
|
|
822
822
|
declare function getApiUrl(): string;
|
|
@@ -854,28 +854,6 @@ interface SearchParams {
|
|
|
854
854
|
interface GitHitsServiceRequestOptions {
|
|
855
855
|
signal?: AbortSignal;
|
|
856
856
|
}
|
|
857
|
-
/**
|
|
858
|
-
* Parameters for feedback API call.
|
|
859
|
-
*
|
|
860
|
-
* Feedback can target an example, a solution, or the current CLI/MCP
|
|
861
|
-
* session. When neither `exampleId` nor `solutionId` is present, the
|
|
862
|
-
* backend uses the `x-githits-session-id` header from injected client headers
|
|
863
|
-
* to create generic session feedback.
|
|
864
|
-
*/
|
|
865
|
-
interface FeedbackParams {
|
|
866
|
-
exampleId?: string;
|
|
867
|
-
solutionId?: string;
|
|
868
|
-
accepted: boolean;
|
|
869
|
-
feedbackText?: string;
|
|
870
|
-
toolName?: string;
|
|
871
|
-
}
|
|
872
|
-
/**
|
|
873
|
-
* Feedback response from the API.
|
|
874
|
-
*/
|
|
875
|
-
interface FeedbackResult {
|
|
876
|
-
success: boolean;
|
|
877
|
-
message: string;
|
|
878
|
-
}
|
|
879
857
|
interface GitHitsServiceRuntimeOptions {
|
|
880
858
|
clientHeaders?: ClientHeaderBuilder;
|
|
881
859
|
userAgent?: string;
|
|
@@ -892,8 +870,6 @@ interface GitHitsService {
|
|
|
892
870
|
getLanguages(): Promise<Language[]>;
|
|
893
871
|
/** Search supported languages using backend-ranked matching. */
|
|
894
872
|
searchLanguages(query: string, limit?: number): Promise<Language[]>;
|
|
895
|
-
/** Submit feedback on a result or the current GitHits session. */
|
|
896
|
-
submitFeedback(params: FeedbackParams): Promise<FeedbackResult>;
|
|
897
873
|
}
|
|
898
874
|
/**
|
|
899
875
|
* Production implementation of GitHitsService.
|
|
@@ -908,7 +884,6 @@ declare class GitHitsServiceImpl implements GitHitsService {
|
|
|
908
884
|
search(params: SearchParams, options?: GitHitsServiceRequestOptions): Promise<string>;
|
|
909
885
|
getLanguages(): Promise<Language[]>;
|
|
910
886
|
searchLanguages(query: string, limit?: number): Promise<Language[]>;
|
|
911
|
-
submitFeedback(params: FeedbackParams): Promise<FeedbackResult>;
|
|
912
887
|
private headers;
|
|
913
888
|
private fetchOptions;
|
|
914
889
|
private request;
|
|
@@ -1635,7 +1610,6 @@ declare class RefreshingGitHitsService implements GitHitsService {
|
|
|
1635
1610
|
search(params: SearchParams, options?: GitHitsServiceRequestOptions): Promise<string>;
|
|
1636
1611
|
getLanguages(): Promise<Language[]>;
|
|
1637
1612
|
searchLanguages(query: string, limit?: number): Promise<Language[]>;
|
|
1638
|
-
submitFeedback(params: FeedbackParams): Promise<FeedbackResult>;
|
|
1639
1613
|
/**
|
|
1640
1614
|
* Execute an operation with a fresh token.
|
|
1641
1615
|
* On AuthenticationError, force-refresh and retry once.
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,GitHitsServiceImpl2,PackageIntelligenceServiceImpl2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,CodeDiffError2,CodeNavigationServiceImpl2,RefreshingGitHitsService2,createStaticTokenProvider2,createClientHeaderBuilder2}from"./shared/chunk-
|
|
1
|
+
import{DEFAULT_MCP_URL2,DEFAULT_API_URL2,DEFAULT_CODE_NAV_URL2,getMcpUrl2,getApiUrl2,getCodeNavigationUrl2,getEnvApiToken2,GitHitsServiceImpl2,PackageIntelligenceServiceImpl2,PKGSEER_REGISTRY_LIST2,toPkgseerRegistry2,toPkgseerRegistryLowercase2,CodeDiffError2,CodeNavigationServiceImpl2,RefreshingGitHitsService2,createStaticTokenProvider2,createClientHeaderBuilder2}from"./shared/chunk-kpjbjs3v.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,PKGSEER_REGISTRY_LIST2 as PKGSEER_REGISTRY_LIST,PackageIntelligenceServiceImpl2 as PackageIntelligenceServiceImpl,RefreshingGitHitsService2 as RefreshingGitHitsService,createClientHeaderBuilder2 as createClientHeaderBuilder,createStaticTokenProvider2 as createStaticTokenProvider,getApiUrl2 as getApiUrl,getCodeNavigationUrl2 as getCodeNavigationUrl,getEnvApiToken2 as getEnvApiToken,getMcpUrl2 as getMcpUrl,toPkgseerRegistry2 as toPkgseerRegistry,toPkgseerRegistryLowercase2 as toPkgseerRegistryLowercase};
|
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,47 @@ declare function buildMcpQuickStart(options?: BuildMcpQuickStartOptions): string
|
|
|
23
23
|
*/
|
|
24
24
|
declare function buildMcpInstructions(options?: BuildMcpInstructionsOptions): string;
|
|
25
25
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
26
|
+
import { z } from "zod";
|
|
27
|
+
/** Annotation fields required by OpenAI's MCP marketplace validation. */
|
|
28
|
+
interface CompleteToolAnnotations {
|
|
29
|
+
title?: string;
|
|
30
|
+
readOnlyHint: boolean;
|
|
31
|
+
idempotentHint?: boolean;
|
|
32
|
+
openWorldHint: boolean;
|
|
33
|
+
destructiveHint: boolean;
|
|
34
|
+
}
|
|
35
|
+
interface McpAuthActionContext {
|
|
36
|
+
authSource: unknown;
|
|
37
|
+
defaultAction: string;
|
|
38
|
+
}
|
|
39
|
+
type McpAuthAction = string | ((context: McpAuthActionContext) => string);
|
|
40
|
+
/** Host-selected message and action for terms-acceptance failures. */
|
|
41
|
+
interface ToolTermsRemediation {
|
|
42
|
+
message: string;
|
|
43
|
+
action: string;
|
|
44
|
+
}
|
|
45
|
+
/** Host-provided execution state shared by MCP and direct tool callers. */
|
|
46
|
+
interface ToolExecutionContext {
|
|
47
|
+
authAction?: McpAuthAction;
|
|
48
|
+
termsRemediation?: ToolTermsRemediation;
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Standard result type for all MCP tools
|
|
53
|
+
*/
|
|
54
|
+
type ToolResult = {
|
|
55
|
+
content: Array<{
|
|
56
|
+
type: "text";
|
|
57
|
+
text: string;
|
|
58
|
+
}>;
|
|
59
|
+
isError?: boolean;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Zod raw shape type (what MCP SDK expects)
|
|
63
|
+
*/
|
|
64
|
+
type ZodRawShape2 = {
|
|
65
|
+
[k: string]: z.ZodTypeAny;
|
|
66
|
+
};
|
|
26
67
|
declare const registryMap: {
|
|
27
68
|
readonly npm: "NPM";
|
|
28
69
|
readonly pypi: "PYPI";
|
|
@@ -570,28 +611,6 @@ interface GitHitsServiceRequestOptions {
|
|
|
570
611
|
signal?: AbortSignal;
|
|
571
612
|
}
|
|
572
613
|
/**
|
|
573
|
-
* Parameters for feedback API call.
|
|
574
|
-
*
|
|
575
|
-
* Feedback can target an example, a solution, or the current CLI/MCP
|
|
576
|
-
* session. When neither `exampleId` nor `solutionId` is present, the
|
|
577
|
-
* backend uses the `x-githits-session-id` header from injected client headers
|
|
578
|
-
* to create generic session feedback.
|
|
579
|
-
*/
|
|
580
|
-
interface FeedbackParams {
|
|
581
|
-
exampleId?: string;
|
|
582
|
-
solutionId?: string;
|
|
583
|
-
accepted: boolean;
|
|
584
|
-
feedbackText?: string;
|
|
585
|
-
toolName?: string;
|
|
586
|
-
}
|
|
587
|
-
/**
|
|
588
|
-
* Feedback response from the API.
|
|
589
|
-
*/
|
|
590
|
-
interface FeedbackResult {
|
|
591
|
-
success: boolean;
|
|
592
|
-
message: string;
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
614
|
* Service interface for GitHits REST API.
|
|
596
615
|
*/
|
|
597
616
|
interface GitHitsService {
|
|
@@ -601,8 +620,6 @@ interface GitHitsService {
|
|
|
601
620
|
getLanguages(): Promise<Language[]>;
|
|
602
621
|
/** Search supported languages using backend-ranked matching. */
|
|
603
622
|
searchLanguages(query: string, limit?: number): Promise<Language[]>;
|
|
604
|
-
/** Submit feedback on a result or the current GitHits session. */
|
|
605
|
-
submitFeedback(params: FeedbackParams): Promise<FeedbackResult>;
|
|
606
623
|
}
|
|
607
624
|
interface PackageSummaryParams {
|
|
608
625
|
registry: PkgseerRegistry;
|
|
@@ -1262,47 +1279,6 @@ interface PackageIntelligenceService {
|
|
|
1262
1279
|
listPackageDocs(params: ListPackageDocsParams): Promise<PackageDocsList>;
|
|
1263
1280
|
readPackageDoc(params: ReadPackageDocParams): Promise<PackageDocResult>;
|
|
1264
1281
|
}
|
|
1265
|
-
import { z } from "zod";
|
|
1266
|
-
/** Annotation fields required by OpenAI's MCP marketplace validation. */
|
|
1267
|
-
interface CompleteToolAnnotations {
|
|
1268
|
-
title?: string;
|
|
1269
|
-
readOnlyHint: boolean;
|
|
1270
|
-
idempotentHint?: boolean;
|
|
1271
|
-
openWorldHint: boolean;
|
|
1272
|
-
destructiveHint: boolean;
|
|
1273
|
-
}
|
|
1274
|
-
interface McpAuthActionContext {
|
|
1275
|
-
authSource: unknown;
|
|
1276
|
-
defaultAction: string;
|
|
1277
|
-
}
|
|
1278
|
-
type McpAuthAction = string | ((context: McpAuthActionContext) => string);
|
|
1279
|
-
/** Host-selected message and action for terms-acceptance failures. */
|
|
1280
|
-
interface ToolTermsRemediation {
|
|
1281
|
-
message: string;
|
|
1282
|
-
action: string;
|
|
1283
|
-
}
|
|
1284
|
-
/** Host-provided execution state shared by MCP and direct tool callers. */
|
|
1285
|
-
interface ToolExecutionContext {
|
|
1286
|
-
authAction?: McpAuthAction;
|
|
1287
|
-
termsRemediation?: ToolTermsRemediation;
|
|
1288
|
-
signal?: AbortSignal;
|
|
1289
|
-
}
|
|
1290
|
-
/**
|
|
1291
|
-
* Standard result type for all MCP tools
|
|
1292
|
-
*/
|
|
1293
|
-
type ToolResult = {
|
|
1294
|
-
content: Array<{
|
|
1295
|
-
type: "text";
|
|
1296
|
-
text: string;
|
|
1297
|
-
}>;
|
|
1298
|
-
isError?: boolean;
|
|
1299
|
-
};
|
|
1300
|
-
/**
|
|
1301
|
-
* Zod raw shape type (what MCP SDK expects)
|
|
1302
|
-
*/
|
|
1303
|
-
type ZodRawShape2 = {
|
|
1304
|
-
[k: string]: z.ZodTypeAny;
|
|
1305
|
-
};
|
|
1306
1282
|
/**
|
|
1307
1283
|
* Services required to construct the MCP tool surface.
|
|
1308
1284
|
*
|