@githits/mcp 0.10.0 → 0.11.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 +3 -2
- package/dist/client.d.ts +13 -7
- package/dist/client.js +1 -1
- package/dist/index.d.ts +27 -10
- package/dist/index.js +26 -24
- package/dist/shared/{chunk-qawyzgzx.js → chunk-7xsjs2xx.js} +2 -2
- package/dist/smoke-test.d.ts +2 -2
- package/dist/smoke-test.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,11 +9,12 @@ This package exposes transport-neutral helpers for servers that want the GitHits
|
|
|
9
9
|
- `createMcpServer(options)` creates an MCP server with GitHits tools registered.
|
|
10
10
|
- `registerMcpTools(server, options)` registers GitHits tools on an existing MCP server.
|
|
11
11
|
- `getMcpToolDescriptors()` returns static tool metadata without requiring concrete services.
|
|
12
|
-
- `
|
|
12
|
+
- `buildMcpQuickStart(options?)` builds the guide returned by the read-only `quick_start` tool.
|
|
13
|
+
- `buildMcpInstructions(options?)` is a deprecated compatibility alias for `buildMcpQuickStart()`.
|
|
13
14
|
- `@githits/mcp/client` exports concrete GitHits service implementations, static token providers, URL/config helpers, request-header helpers, telemetry helpers, and registry helpers for remote MCP servers.
|
|
14
15
|
- `@githits/mcp/smoke-test` exports reusable smoke assertions and `runMcpSmoke()` for remote MCP server validation.
|
|
15
16
|
|
|
16
|
-
The package expects callers to provide service implementations through `McpToolServices` or a request-scoped `McpToolServicesProvider`. Servers can pass `traceTool` to `createMcpServer()` or `registerMcpTools()` to wrap public tool execution for instrumentation without receiving arguments or auth data.
|
|
17
|
+
The package expects callers to provide service implementations through `McpToolServices` or a request-scoped `McpToolServicesProvider`. GitHits does not populate MCP initialize instructions because hosts expose them inconsistently; `quick_start` owns shared guidance instead. Callers may still pass their own `instructions` explicitly. Use `quickStartOptions` to configure the guide. Servers can pass `traceTool` to `createMcpServer()` or `registerMcpTools()` to wrap public tool execution for instrumentation without receiving arguments or auth data.
|
|
17
18
|
|
|
18
19
|
Only imports from `@githits/mcp`, `@githits/mcp/client`, `@githits/mcp/smoke-test`, and `@githits/mcp/package.json` are public. The workspace alias `@githits/mcp/internal` is not exported, is not supported for external consumers, and must not be used by remote MCP server implementations.
|
|
19
20
|
|
package/dist/client.d.ts
CHANGED
|
@@ -136,8 +136,14 @@ interface TargetResolution {
|
|
|
136
136
|
}
|
|
137
137
|
type UnifiedSearchSource = "AUTO" | "DOCS" | "CODE" | "SYMBOL";
|
|
138
138
|
type UnifiedSearchResultType = "DOCUMENTATION_PAGE" | "REPOSITORY_SYMBOL" | "REPOSITORY_CODE" | "REPOSITORY_DOC";
|
|
139
|
-
type
|
|
140
|
-
|
|
139
|
+
type KnownUnifiedSearchSessionStatus = "PENDING" | "INDEXING" | "SEARCHING" | "COMPLETED" | "DEFERRED" | "TIMEOUT" | "FAILED";
|
|
140
|
+
/**
|
|
141
|
+
* Backend-owned search-session status. Known values have explicit client
|
|
142
|
+
* behavior; future values remain readable instead of invalidating the whole
|
|
143
|
+
* response.
|
|
144
|
+
*/
|
|
145
|
+
type UnifiedSearchSessionStatus = KnownUnifiedSearchSessionStatus | (string & {});
|
|
146
|
+
type CodeIndexState = "CURRENT" | "INDEXED" | "INDEXING" | "PROVISIONAL" | "STALE" | "FAILED" | "MISSING" | string;
|
|
141
147
|
/** Coverage state of the selected published documentation corpus. */
|
|
142
148
|
type DocCoverageState = "NONE" | "PARTIAL" | "CAPPED" | "COMPLETE" | string;
|
|
143
149
|
/**
|
|
@@ -240,7 +246,7 @@ interface UnifiedSearchSourceStatus {
|
|
|
240
246
|
}
|
|
241
247
|
type UnifiedSearchDocumentationContributorKind = "REPOSITORY_DOCS" | "DOCPACK";
|
|
242
248
|
type UnifiedSearchDocumentationContributorState = "SEARCHED" | "READY" | "PENDING" | "UNAVAILABLE";
|
|
243
|
-
type UnifiedSearchDocumentationFreshness = "CURRENT" | "STALE";
|
|
249
|
+
type UnifiedSearchDocumentationFreshness = "CURRENT" | "PROVISIONAL" | "STALE";
|
|
244
250
|
/** One physical documentation corpus disclosed for a DOCS source row. */
|
|
245
251
|
interface UnifiedSearchDocumentationContributor {
|
|
246
252
|
kind: UnifiedSearchDocumentationContributorKind;
|
|
@@ -1279,8 +1285,8 @@ interface PackageChangelogParams {
|
|
|
1279
1285
|
/** Branch or tag for CHANGELOG.md fetching. Ignored for GH Releases. */
|
|
1280
1286
|
gitRef?: string;
|
|
1281
1287
|
/**
|
|
1282
|
-
*
|
|
1283
|
-
*
|
|
1288
|
+
* Exclusive start of version range. When set, the backend returns every
|
|
1289
|
+
* entry after `fromVersion` through `toVersion` (or latest); `limit` is
|
|
1284
1290
|
* rejected client-side in this mode.
|
|
1285
1291
|
*/
|
|
1286
1292
|
fromVersion?: string;
|
|
@@ -1317,7 +1323,7 @@ interface ChangelogReport {
|
|
|
1317
1323
|
package?: ChangelogPackageInfo;
|
|
1318
1324
|
/** `"releases"` | `"changelog_file"` | `"hexdocs"` when resolved; absent for package versions with no changelog entry. */
|
|
1319
1325
|
source?: string;
|
|
1320
|
-
/** Entries
|
|
1326
|
+
/** Entries in backend/source order. Empty array = resolved source but nothing in range. */
|
|
1321
1327
|
entries: ChangelogEntryDetail[];
|
|
1322
1328
|
}
|
|
1323
1329
|
type PackageDocSourceKind = "CRAWLED" | "REPOSITORY";
|
|
@@ -1471,4 +1477,4 @@ declare function withTelemetrySpan<T>(name: string, operation: () => Promise<T>,
|
|
|
1471
1477
|
declare function startTelemetrySpan(name: string, attributes?: TelemetryAttributes): TelemetrySpanHandle | undefined;
|
|
1472
1478
|
declare function endTelemetrySpan(handle: TelemetrySpanHandle | undefined, attributes?: TelemetryAttributes): void;
|
|
1473
1479
|
declare function flushTelemetry(exitCode?: number): void;
|
|
1474
|
-
export {
|
|
1480
|
+
export { AgentInfo, CodeDiffError, CodeDiffErrorDetails, CodeDiffErrorRef, CodeDiffMode, CodeDiffOptions, CodeDiffPackageInfo, CodeDiffPackageTarget, CodeDiffParams, CodeDiffPartialResult, CodeDiffRefKind, CodeDiffRefResolution, CodeDiffRepositoryTarget, CodeDiffResult, CodeDiffService, CodeDiffTarget, CodeDiffVersionSource, CodeNavigationService, CodeNavigationServiceImpl, ContentModification, ContentSafety, DEFAULT_API_URL, DEFAULT_CODE_NAV_URL, DEFAULT_MCP_URL, GitHitsService, GitHitsServiceImpl, PKGSEER_REGISTRY_LIST, PackageIntelligenceService, PackageIntelligenceServiceImpl, RawCodeDiff, RawCodeDiffContentCoverage, RawCodeDiffContentFailure, RawCodeDiffFile, RawCodeDiffFileContentStatus, RawCodeDiffFileStatus, RawCodeDiffPathEncoding, RawCodeDiffScope, RawCodeDiffScopeStatus, RawCodeDiffSummary, RefreshingGitHitsService, TokenProvider, createClientHeaderBuilder, createStaticTokenProvider, endTelemetrySpan, flushTelemetry, getApiUrl, getCodeNavigationUrl, getEnvApiToken, getMcpUrl, startTelemetrySpan, toPkgseerRegistry, toPkgseerRegistryLowercase, withTelemetrySpan };
|
package/dist/client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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-
|
|
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-7xsjs2xx.js";export{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};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Build the
|
|
2
|
+
* Build the detailed guide returned by `quick_start`.
|
|
3
3
|
*
|
|
4
4
|
* Emits the core block plus the package/code-tools section.
|
|
5
5
|
* Mirrors `getMcpToolDefinitions` so the instructions stay aligned
|
|
6
6
|
* with the registered tool surface.
|
|
7
7
|
*/
|
|
8
|
-
interface
|
|
8
|
+
interface BuildMcpQuickStartOptions {
|
|
9
9
|
/**
|
|
10
10
|
* Include the external-content posture (shared guardrail block).
|
|
11
11
|
* Defaults to `true` — production always wants it. The eval mock
|
|
@@ -14,6 +14,13 @@ interface BuildMcpInstructionsOptions {
|
|
|
14
14
|
*/
|
|
15
15
|
includeExternalContentPosture?: boolean;
|
|
16
16
|
}
|
|
17
|
+
/** @deprecated Use `BuildMcpQuickStartOptions`; retained for API compatibility. */
|
|
18
|
+
type BuildMcpInstructionsOptions = BuildMcpQuickStartOptions;
|
|
19
|
+
declare function buildMcpQuickStart(options?: BuildMcpQuickStartOptions): string;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `buildMcpQuickStart`. GitHits no longer publishes MCP
|
|
22
|
+
* initialize instructions because clients expose them inconsistently.
|
|
23
|
+
*/
|
|
17
24
|
declare function buildMcpInstructions(options?: BuildMcpInstructionsOptions): string;
|
|
18
25
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
26
|
declare const registryMap: {
|
|
@@ -99,8 +106,14 @@ interface TargetResolution {
|
|
|
99
106
|
}
|
|
100
107
|
type UnifiedSearchSource = "AUTO" | "DOCS" | "CODE" | "SYMBOL";
|
|
101
108
|
type UnifiedSearchResultType = "DOCUMENTATION_PAGE" | "REPOSITORY_SYMBOL" | "REPOSITORY_CODE" | "REPOSITORY_DOC";
|
|
102
|
-
type
|
|
103
|
-
|
|
109
|
+
type KnownUnifiedSearchSessionStatus = "PENDING" | "INDEXING" | "SEARCHING" | "COMPLETED" | "DEFERRED" | "TIMEOUT" | "FAILED";
|
|
110
|
+
/**
|
|
111
|
+
* Backend-owned search-session status. Known values have explicit client
|
|
112
|
+
* behavior; future values remain readable instead of invalidating the whole
|
|
113
|
+
* response.
|
|
114
|
+
*/
|
|
115
|
+
type UnifiedSearchSessionStatus = KnownUnifiedSearchSessionStatus | (string & {});
|
|
116
|
+
type CodeIndexState = "CURRENT" | "INDEXED" | "INDEXING" | "PROVISIONAL" | "STALE" | "FAILED" | "MISSING" | string;
|
|
104
117
|
/** Coverage state of the selected published documentation corpus. */
|
|
105
118
|
type DocCoverageState = "NONE" | "PARTIAL" | "CAPPED" | "COMPLETE" | string;
|
|
106
119
|
/**
|
|
@@ -203,7 +216,7 @@ interface UnifiedSearchSourceStatus {
|
|
|
203
216
|
}
|
|
204
217
|
type UnifiedSearchDocumentationContributorKind = "REPOSITORY_DOCS" | "DOCPACK";
|
|
205
218
|
type UnifiedSearchDocumentationContributorState = "SEARCHED" | "READY" | "PENDING" | "UNAVAILABLE";
|
|
206
|
-
type UnifiedSearchDocumentationFreshness = "CURRENT" | "STALE";
|
|
219
|
+
type UnifiedSearchDocumentationFreshness = "CURRENT" | "PROVISIONAL" | "STALE";
|
|
207
220
|
/** One physical documentation corpus disclosed for a DOCS source row. */
|
|
208
221
|
interface UnifiedSearchDocumentationContributor {
|
|
209
222
|
kind: UnifiedSearchDocumentationContributorKind;
|
|
@@ -981,8 +994,8 @@ interface PackageChangelogParams {
|
|
|
981
994
|
/** Branch or tag for CHANGELOG.md fetching. Ignored for GH Releases. */
|
|
982
995
|
gitRef?: string;
|
|
983
996
|
/**
|
|
984
|
-
*
|
|
985
|
-
*
|
|
997
|
+
* Exclusive start of version range. When set, the backend returns every
|
|
998
|
+
* entry after `fromVersion` through `toVersion` (or latest); `limit` is
|
|
986
999
|
* rejected client-side in this mode.
|
|
987
1000
|
*/
|
|
988
1001
|
fromVersion?: string;
|
|
@@ -1019,7 +1032,7 @@ interface ChangelogReport {
|
|
|
1019
1032
|
package?: ChangelogPackageInfo;
|
|
1020
1033
|
/** `"releases"` | `"changelog_file"` | `"hexdocs"` when resolved; absent for package versions with no changelog entry. */
|
|
1021
1034
|
source?: string;
|
|
1022
|
-
/** Entries
|
|
1035
|
+
/** Entries in backend/source order. Empty array = resolved source but nothing in range. */
|
|
1023
1036
|
entries: ChangelogEntryDetail[];
|
|
1024
1037
|
}
|
|
1025
1038
|
type PackageDocSourceKind = "CRAWLED" | "REPOSITORY";
|
|
@@ -1155,8 +1168,12 @@ interface CreateMcpServerOptions<TExtra = unknown> {
|
|
|
1155
1168
|
metadata: McpServerMetadata;
|
|
1156
1169
|
services: McpToolServicesProvider<TExtra>;
|
|
1157
1170
|
authAction?: McpAuthAction;
|
|
1171
|
+
/** Optional caller-owned MCP instructions. GitHits does not provide defaults. */
|
|
1158
1172
|
instructions?: string;
|
|
1159
|
-
|
|
1173
|
+
/** Controls the guide returned by `quick_start`. */
|
|
1174
|
+
quickStartOptions?: Parameters<typeof buildMcpQuickStart>[0];
|
|
1175
|
+
/** @deprecated Use `quickStartOptions`. */
|
|
1176
|
+
instructionOptions?: Parameters<typeof buildMcpQuickStart>[0];
|
|
1160
1177
|
traceTool?: McpToolExecutionHook;
|
|
1161
1178
|
}
|
|
1162
1179
|
interface McpToolDescriptor<TSchema extends ZodRawShape2 = ZodRawShape2> {
|
|
@@ -1175,4 +1192,4 @@ declare function registerMcpTools<TExtra = unknown>(server: McpServer, options:
|
|
|
1175
1192
|
* Creates the transport-neutral MCP server with injected services.
|
|
1176
1193
|
*/
|
|
1177
1194
|
declare function createMcpServer<TExtra = unknown>(options: CreateMcpServerOptions<TExtra>): McpServer;
|
|
1178
|
-
export {
|
|
1195
|
+
export { BuildMcpInstructionsOptions, BuildMcpQuickStartOptions, CreateMcpServerOptions, McpAuthAction, McpAuthActionContext, McpRequestContext, McpServerMetadata, McpToolDescriptor, McpToolExecutionHook, McpToolServices, McpToolServicesProvider, buildMcpInstructions, buildMcpQuickStart, createMcpServer, getMcpToolDescriptors, registerMcpTools };
|