@octocodeai/octocode-tools-core 18.1.2 → 18.2.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 +113 -162
- package/dist/cacheMaintenance.d.ts +8 -0
- package/dist/direct.js +41 -51
- package/dist/github/client.d.ts +1 -1
- package/dist/github/codeSearch.d.ts +2 -2
- package/dist/github/commit.d.ts +48 -0
- package/dist/github/compare.d.ts +2 -2
- package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +1 -1
- package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +1 -1
- package/dist/github/directoryFetch/refResolution.d.ts +6 -0
- package/dist/github/fileContent.d.ts +1 -1
- package/dist/github/fileContentRaw/fetch.d.ts +2 -2
- package/dist/github/githubAPI.d.ts +1 -2
- package/dist/github/history/commitFiles.d.ts +5 -0
- package/dist/github/history.d.ts +1 -1
- package/dist/github/issues/fetchers.d.ts +1 -1
- package/dist/github/issues/orchestrator.d.ts +1 -1
- package/dist/github/issues/types.d.ts +5 -0
- package/dist/github/prByNumber.d.ts +1 -1
- package/dist/github/prContentFetcher/commits.d.ts +1 -1
- package/dist/github/prContentFetcher/transform.d.ts +1 -1
- package/dist/github/pullRequestSearch.d.ts +1 -1
- package/dist/github/queryBuilders/codeAndRepo.d.ts +1 -1
- package/dist/github/repoSearch.d.ts +2 -2
- package/dist/github/repoStructure/contentResolution.d.ts +1 -1
- package/dist/github/repoStructure/fetchOrchestration.d.ts +2 -2
- package/dist/github/repoStructurePagination.d.ts +1 -1
- package/dist/graph/advancedOperations.d.ts +22 -0
- package/dist/{tools/local_dead_code/graphBuilder.d.ts → graph/buildFileGraph.d.ts} +6 -5
- package/dist/graph/cycleOperations.d.ts +12 -0
- package/dist/{tools/local_dead_code → graph}/importResolver.d.ts +1 -1
- package/dist/graph/operations.d.ts +7 -0
- package/dist/{tools/local_dead_code → graph}/reachability.d.ts +1 -1
- package/dist/{tools/local_dead_code → graph}/types.d.ts +11 -0
- package/dist/graph/workspacePackageResolver.d.ts +2 -0
- package/dist/index.d.ts +11 -30
- package/dist/index.js +45 -55
- package/dist/providers/github/githubContent.d.ts +1 -1
- package/dist/providers/github/githubPullRequests.d.ts +1 -1
- package/dist/providers/github/githubSearch.d.ts +1 -1
- package/dist/providers/github/githubStructure.d.ts +1 -1
- package/dist/providers/github/paginationMetadata.d.ts +4 -5
- package/dist/providers/providerQueries.d.ts +1 -3
- package/dist/providers/providerResults.d.ts +4 -0
- package/dist/providers/types.d.ts +1 -1
- package/dist/responses.d.ts +1 -1
- package/dist/schema.d.ts +2 -0
- package/dist/schema.js +13 -1
- package/dist/scheme/conditionalSchemas.d.ts +12 -0
- package/dist/scheme/fields.d.ts +2 -1
- package/dist/security/bridge.d.ts +7 -10
- package/dist/shared/credentials/index.js +2 -2
- package/dist/shared/paths.d.ts +1 -0
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/toolContract/descriptions.d.ts +14 -0
- package/dist/toolContract/input/resources/global.d.ts +15 -0
- package/dist/toolContract/input/resources/toolRelations.d.ts +1 -0
- package/dist/toolContract/input/resources/toolVariants.d.ts +9 -0
- package/dist/toolContract/input/resources/tools/_toolkit.d.ts +75 -0
- package/dist/toolContract/input/resources/tools/ghCloneRepo.d.ts +12 -0
- package/dist/toolContract/input/resources/tools/ghGetFileContent.d.ts +30 -0
- package/dist/toolContract/input/resources/tools/ghSearch.d.ts +76 -0
- package/dist/toolContract/input/resources/tools/githubCodeOperation.d.ts +29 -0
- package/dist/toolContract/input/resources/tools/githubHistorySchema.d.ts +114 -0
- package/dist/toolContract/input/resources/tools/githubRepositoriesOperation.d.ts +54 -0
- package/dist/toolContract/input/resources/tools/githubTreeOperation.d.ts +26 -0
- package/dist/toolContract/input/resources/tools/historyCommitInput.d.ts +21 -0
- package/dist/toolContract/input/resources/tools/historyIssueInput.d.ts +59 -0
- package/dist/toolContract/input/resources/tools/historyPullRequestInput.d.ts +98 -0
- package/dist/toolContract/input/resources/tools/localAnalyzeGraph.d.ts +75 -0
- package/dist/toolContract/input/resources/tools/localFilesOperation.d.ts +70 -0
- package/dist/toolContract/input/resources/tools/localGetFileContent.d.ts +22 -0
- package/dist/toolContract/input/resources/tools/localSearch.d.ts +258 -0
- package/dist/toolContract/input/resources/tools/localTextOperation.d.ts +113 -0
- package/dist/toolContract/input/resources/tools/localTreeOperation.d.ts +44 -0
- package/dist/toolContract/input/resources/tools/lspGetSemantics.d.ts +37 -0
- package/dist/toolContract/input/resources/tools/npmSearch.d.ts +10 -0
- package/dist/toolContract/input/types/index.d.ts +24 -0
- package/dist/toolContract/metadata.d.ts +11 -0
- package/dist/toolContract/runtime.d.ts +11 -0
- package/dist/toolContract/schemas.d.ts +31 -0
- package/dist/toolContract/types.d.ts +11 -0
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +6 -16
- package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +1 -1
- package/dist/tools/directToolCatalog/toolCommandPatternUnifiedSearchQueries.d.ts +6 -0
- package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +2 -2
- package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +10 -0
- package/dist/tools/directToolCatalog/toolSchemaRelations.d.ts +9 -0
- package/dist/tools/directToolCatalog/toolSpecifications.d.ts +13 -0
- package/dist/tools/directToolCatalog.exec.d.ts +1 -1
- package/dist/tools/directToolCatalog.meta.d.ts +1 -0
- package/dist/tools/executionGuard.d.ts +1 -2
- package/dist/tools/github_clone_repo/cache.d.ts +1 -2
- package/dist/tools/github_clone_repo/cacheArtifacts.d.ts +3 -0
- package/dist/tools/github_clone_repo/cachePaths.d.ts +1 -1
- package/dist/tools/github_clone_repo/cloneRepo.d.ts +1 -1
- package/dist/tools/github_clone_repo/execution.d.ts +1 -1
- package/dist/tools/github_clone_repo/scheme.d.ts +24 -24
- package/dist/tools/github_fetch_content/execution.d.ts +1 -1
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +19 -16
- package/dist/tools/github_fetch_content/scheme.d.ts +19 -16
- package/dist/tools/github_fetch_content/types.d.ts +4 -3
- package/dist/tools/github_search/execution.d.ts +4 -0
- package/dist/tools/github_search/finalizer.d.ts +3 -0
- package/dist/tools/github_search/scheme.d.ts +79 -0
- package/dist/tools/github_search_code/execution.d.ts +4 -2
- package/dist/tools/github_search_code/finalizer/groups.d.ts +3 -3
- package/dist/tools/github_search_code/finalizer/ranking.d.ts +1 -2
- package/dist/tools/github_search_code/scheme.d.ts +10 -16
- package/dist/tools/github_search_pull_requests/contentRequest.d.ts +1 -4
- package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +8 -4
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +13 -10
- package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +3 -2
- package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +10 -3
- package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +2 -2
- package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +2 -2
- package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +1 -1
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -1
- package/dist/tools/github_search_pull_requests/historyContinuations.d.ts +15 -0
- package/dist/tools/github_search_pull_requests/historyExecutions.d.ts +6 -0
- package/dist/tools/github_search_pull_requests/historyPartialContinuations.d.ts +5 -0
- package/dist/tools/github_search_pull_requests/historySchemes.d.ts +58 -0
- package/dist/tools/github_search_pull_requests/historySearchPagination.d.ts +3 -0
- package/dist/tools/github_search_pull_requests/scheme.d.ts +14 -30
- package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +1 -2
- package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +197 -181
- package/dist/tools/github_search_repos/execution/pagination.d.ts +4 -4
- package/dist/tools/github_search_repos/execution/queryVariants.d.ts +3 -1
- package/dist/tools/github_search_repos/execution.d.ts +3 -1
- package/dist/tools/github_search_repos/scheme.d.ts +5 -7
- package/dist/tools/github_view_repo_structure/execution.d.ts +4 -2
- package/dist/tools/github_view_repo_structure/scheme.d.ts +2 -4
- package/dist/tools/github_view_repo_structure/types.d.ts +3 -0
- package/dist/tools/local_analyze_graph/analysisTypes.d.ts +46 -0
- package/dist/tools/local_analyze_graph/analyzeGraph.d.ts +3 -0
- package/dist/tools/{local_dead_code → local_analyze_graph}/deadCodeScan.d.ts +2 -1
- package/dist/tools/{local_dead_code → local_analyze_graph}/entrypoints.d.ts +1 -0
- package/dist/tools/local_analyze_graph/execution.d.ts +4 -0
- package/dist/tools/local_analyze_graph/pagination.d.ts +3 -0
- package/dist/tools/{local_dead_code → local_analyze_graph}/retention.d.ts +1 -1
- package/dist/tools/{local_dead_code → local_analyze_graph}/scheme.d.ts +31 -15
- package/dist/tools/local_fetch_content/execution.d.ts +1 -1
- package/dist/tools/local_fetch_content/scheme.d.ts +2 -4
- package/dist/tools/local_find_files/execution.d.ts +1 -1
- package/dist/tools/local_find_files/findFiles.d.ts +1 -1
- package/dist/tools/local_find_files/findFilesNext.d.ts +3 -3
- package/dist/tools/local_find_files/scheme.d.ts +6 -2
- package/dist/tools/local_ripgrep/captureBudget.d.ts +1 -0
- package/dist/tools/local_ripgrep/execution.d.ts +1 -1
- package/dist/tools/local_ripgrep/rankingProfile/rankingLexical.d.ts +20 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -18
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +5 -4
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +4 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +9 -7
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +1 -1
- package/dist/tools/local_search/execution.d.ts +5 -0
- package/dist/tools/local_search/scheme.d.ts +260 -0
- package/dist/tools/local_view_structure/execution.d.ts +1 -1
- package/dist/tools/local_view_structure/scheme.d.ts +8 -5
- package/dist/tools/local_view_structure/viewStructureNext.d.ts +3 -3
- package/dist/tools/lsp/semantic_content/execution.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/scheme.d.ts +4 -42
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +1 -1
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +0 -1
- package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -3
- package/dist/tools/package_search/execution.d.ts +6 -13
- package/dist/tools/package_search/pagination.d.ts +21 -0
- package/dist/tools/package_search/queryHelpers.d.ts +3 -5
- package/dist/tools/package_search/scheme.d.ts +12 -7
- package/dist/tools/providerExecution.d.ts +3 -4
- package/dist/tools/providerMappers/codeSearch.d.ts +3 -4
- package/dist/tools/providerMappers/fileContent.d.ts +1 -2
- package/dist/tools/providerMappers/pullRequests.d.ts +6 -6
- package/dist/tools/providerMappers/repoSearch.d.ts +7 -4
- package/dist/tools/providerMappers/repoStructure.d.ts +2 -3
- package/dist/tools/toolCatalogFactory.d.ts +5 -6
- package/dist/tools/toolConfig.d.ts +6 -17
- package/dist/tools/toolMetadata/baseSchema.d.ts +1 -2
- package/dist/tools/toolMetadata/descriptions.d.ts +1 -1
- package/dist/tools/toolMetadata/names.d.ts +18 -2
- package/dist/tools/toolMetadata/state.d.ts +3 -3
- package/dist/tools/toolMetadata/types.d.ts +1 -1
- package/dist/tools/toolNames.d.ts +16 -3
- package/dist/tools/toolSchemaImports.d.ts +5 -4
- package/dist/tools/utils.d.ts +3 -6
- package/dist/types/bulk.d.ts +11 -1
- package/dist/types/execution.d.ts +6 -1
- package/dist/types/server.d.ts +0 -2
- package/dist/types/toolOutput.d.ts +10 -9
- package/dist/types/toolResults.d.ts +17 -1
- package/dist/utils/contextUtils.d.ts +4 -2
- package/dist/utils/file/toolHelpers.d.ts +1 -1
- package/dist/utils/http/cache/conditional.d.ts +9 -4
- package/dist/utils/http/cache/dataCache.d.ts +7 -2
- package/dist/utils/http/cache/diskStore.d.ts +30 -0
- package/dist/utils/http/cache/management.d.ts +5 -0
- package/dist/utils/http/cache/store.d.ts +1 -0
- package/dist/utils/http/cache/trace.d.ts +10 -0
- package/dist/utils/http/cache.d.ts +1 -0
- package/dist/utils/package/types.d.ts +5 -2
- package/dist/utils/pagination/charLimit.d.ts +0 -2
- package/dist/utils/response/bulk/pagination.d.ts +2 -1
- package/dist/utils/response/bulk/paginationDiagnostics.d.ts +2 -0
- package/dist/utils/response/bulk/queries.d.ts +0 -9
- package/dist/utils/response/bulk/response.d.ts +3 -2
- package/dist/utils/response/bulk.d.ts +1 -1
- package/dist/utils/response/callToolResult.d.ts +1 -1
- package/dist/utils/response/error.d.ts +3 -4
- package/dist/utils/response/groupedFinalizer.d.ts +2 -6
- package/dist/utils/response/normalizedError.d.ts +6 -0
- package/dist/utils/response/responseChannels.d.ts +4 -0
- package/package.json +7 -6
- package/dist/github/discussions.d.ts +0 -45
- package/dist/github/releases.d.ts +0 -45
- package/dist/scheme/responseEnvelope.d.ts +0 -88
- package/dist/tools/github_search_discussions/execution.d.ts +0 -15
- package/dist/tools/github_search_discussions/scheme.d.ts +0 -16
- package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +0 -4
- package/dist/tools/local_dead_code/execution.d.ts +0 -4
- package/dist/tools/local_dead_code/local_dead_code.d.ts +0 -5
- package/dist/tools/local_find_files/pathPatternBraces.d.ts +0 -20
- package/dist/tools/toolMetadata/gateway.d.ts +0 -7
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolSpec } from '../../types/index.js';
|
|
3
|
+
export declare const lspGetSemantics: ToolSpec;
|
|
4
|
+
export declare const LspGetSemanticsQuerySchema: z.ZodObject<{
|
|
5
|
+
uri: z.ZodOptional<z.ZodString>;
|
|
6
|
+
type: z.ZodDefault<z.ZodEnum<{
|
|
7
|
+
definition: "definition";
|
|
8
|
+
documentSymbols: "documentSymbols";
|
|
9
|
+
workspaceSymbol: "workspaceSymbol";
|
|
10
|
+
references: "references";
|
|
11
|
+
callers: "callers";
|
|
12
|
+
callees: "callees";
|
|
13
|
+
callHierarchy: "callHierarchy";
|
|
14
|
+
hover: "hover";
|
|
15
|
+
typeDefinition: "typeDefinition";
|
|
16
|
+
implementation: "implementation";
|
|
17
|
+
supertypes: "supertypes";
|
|
18
|
+
subtypes: "subtypes";
|
|
19
|
+
diagnostic: "diagnostic";
|
|
20
|
+
}>>;
|
|
21
|
+
symbolName: z.ZodOptional<z.ZodString>;
|
|
22
|
+
lineHint: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
orderHint: z.ZodDefault<z.ZodNumber>;
|
|
24
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
25
|
+
includeDeclaration: z.ZodDefault<z.ZodBoolean>;
|
|
26
|
+
groupByFile: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
28
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
contextLines: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
format: z.ZodDefault<z.ZodEnum<{
|
|
31
|
+
structured: "structured";
|
|
32
|
+
compact: "compact";
|
|
33
|
+
}>>;
|
|
34
|
+
workspaceRoot: z.ZodOptional<z.ZodString>;
|
|
35
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
36
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ToolSpec } from '../../types/index.js';
|
|
3
|
+
export declare const npmSearch: ToolSpec;
|
|
4
|
+
export declare const NpmPackageQuerySchema: z.ZodObject<{
|
|
5
|
+
packageName: z.ZodOptional<z.ZodString>;
|
|
6
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
7
|
+
page: z.ZodDefault<z.ZodNumber>;
|
|
8
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
9
|
+
reasoning: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strip>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ToolNames {
|
|
2
|
+
GITHUB_SEARCH: 'ghSearch';
|
|
3
|
+
GITHUB_FETCH_CONTENT: 'ghGetFileContent';
|
|
4
|
+
GITHUB_SEARCH_HISTORY: 'ghSearchHistory';
|
|
5
|
+
GITHUB_GET_HISTORY_ITEM: 'ghGetHistoryItem';
|
|
6
|
+
PACKAGE_SEARCH: 'npmSearch';
|
|
7
|
+
GITHUB_CLONE_REPO: 'ghCloneRepo';
|
|
8
|
+
LOCAL_SEARCH: 'localSearch';
|
|
9
|
+
LOCAL_ANALYZE_GRAPH: 'localAnalyzeGraph';
|
|
10
|
+
LOCAL_FETCH_CONTENT: 'localGetFileContent';
|
|
11
|
+
LSP_GET_SEMANTIC_CONTENT: 'lspGetSemantics';
|
|
12
|
+
}
|
|
13
|
+
export interface ToolSchema {
|
|
14
|
+
readonly [param: string]: string;
|
|
15
|
+
}
|
|
16
|
+
export type ToolType = 'Github' | 'Local' | 'NPM';
|
|
17
|
+
export interface ToolSpec {
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly type: ToolType;
|
|
20
|
+
readonly shortDescription: string;
|
|
21
|
+
readonly instructions: string;
|
|
22
|
+
readonly description: string;
|
|
23
|
+
readonly schema: ToolSchema;
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Shared prompt plus the canonical tools-core-owned executable catalog. */
|
|
2
|
+
export declare const localCompleteMetadata: {
|
|
3
|
+
systemPrompt: string;
|
|
4
|
+
toolNames: import("./types.js").ToolNames;
|
|
5
|
+
baseSchema: Record<"goal" | "reasoning", string>;
|
|
6
|
+
tools: {
|
|
7
|
+
[k: string]: {
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { RipgrepQuerySchema } from './schemas.js';
|
|
3
|
+
type RuntimeRipgrepQuery = z.infer<typeof RipgrepQuerySchema>;
|
|
4
|
+
export interface RipgrepValidationResult {
|
|
5
|
+
isValid: boolean;
|
|
6
|
+
errors: string[];
|
|
7
|
+
warnings: string[];
|
|
8
|
+
}
|
|
9
|
+
export declare function validateRipgrepQuery(query: RuntimeRipgrepQuery): RipgrepValidationResult;
|
|
10
|
+
export declare function applyWorkflowMode<T extends RuntimeRipgrepQuery>(query: T): T;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal input-schema primitives owned by tools-core.
|
|
3
|
+
*
|
|
4
|
+
* Public canonical schemas are exported from each direct tool's scheme and
|
|
5
|
+
* assembled by the direct-tool catalog. This barrel intentionally has no
|
|
6
|
+
* second tool-name registry.
|
|
7
|
+
*/
|
|
8
|
+
export { baseSchema, baseSchemaDescriptions, toolNames, } from './input/resources/global.js';
|
|
9
|
+
export type { BaseSchemaShape } from './input/resources/global.js';
|
|
10
|
+
export { getToolSchemaRelations } from './input/resources/toolRelations.js';
|
|
11
|
+
export { getToolSchemaVariants } from './input/resources/toolVariants.js';
|
|
12
|
+
export type { ToolSchemaVariant } from './input/resources/toolVariants.js';
|
|
13
|
+
export { MAX_CONTEXT_LINES, MAX_PAGE_NUMBER, MAX_CHAR_OFFSET, MAX_CHAR_LENGTH, MAX_LINE_NUMBER, MAX_ORDER_HINT, MAX_LOCAL_DEPTH, MAX_FIND_DEPTH, MAX_LOCAL_LIMIT, MAX_LOCAL_ITEMS_PER_PAGE, MAX_GITHUB_SEARCH_LIMIT, DEFAULT_GITHUB_SEARCH_LIMIT, MAX_GITHUB_STRUCTURE_ITEMS_PER_PAGE, DEFAULT_GITHUB_STRUCTURE_ITEMS_PER_PAGE, MAX_PR_ITEMS_PER_PAGE, DEFAULT_PR_ITEMS_PER_PAGE, MAX_MATCH_CONTENT_LENGTH, DEFAULT_MATCH_CONTENT_LENGTH, MAX_MATCH_COUNT, MAX_SEARCH_ITEMS_PER_PAGE, MAX_LSP_DEPTH, MAX_LSP_ITEMS_PER_PAGE, MAX_GITHUB_STRUCTURE_DEPTH, } from './input/resources/tools/_toolkit.js';
|
|
14
|
+
export { GitHubSearchQuerySchema } from './input/resources/tools/ghSearch.js';
|
|
15
|
+
export { GitHubCodeSearchQuerySchema } from './input/resources/tools/githubCodeOperation.js';
|
|
16
|
+
export { FileContentQuerySchema } from './input/resources/tools/ghGetFileContent.js';
|
|
17
|
+
export { GitHubViewRepoStructureQuerySchema } from './input/resources/tools/githubTreeOperation.js';
|
|
18
|
+
export { GitHubReposSearchSingleQuerySchema } from './input/resources/tools/githubRepositoriesOperation.js';
|
|
19
|
+
export { GitHubPullRequestSearchQuerySchema } from './input/resources/tools/githubHistorySchema.js';
|
|
20
|
+
export { SearchPullRequestsQuerySchema } from './input/resources/tools/historyPullRequestInput.js';
|
|
21
|
+
export { SearchIssuesQuerySchema } from './input/resources/tools/historyIssueInput.js';
|
|
22
|
+
export { SearchCommitsQuerySchema } from './input/resources/tools/historyCommitInput.js';
|
|
23
|
+
export { NpmPackageQuerySchema } from './input/resources/tools/npmSearch.js';
|
|
24
|
+
export { CloneRepoQuerySchema } from './input/resources/tools/ghCloneRepo.js';
|
|
25
|
+
export { LocalSearchQuerySchema } from './input/resources/tools/localSearch.js';
|
|
26
|
+
export { RipgrepQuerySchema } from './input/resources/tools/localTextOperation.js';
|
|
27
|
+
export { ViewStructureQuerySchema } from './input/resources/tools/localTreeOperation.js';
|
|
28
|
+
export { FindFilesQuerySchema } from './input/resources/tools/localFilesOperation.js';
|
|
29
|
+
export { LocalAnalyzeGraphQuerySchema } from './input/resources/tools/localAnalyzeGraph.js';
|
|
30
|
+
export { FetchContentQuerySchema } from './input/resources/tools/localGetFileContent.js';
|
|
31
|
+
export { LspGetSemanticsQuerySchema } from './input/resources/tools/lspGetSemantics.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { ToolNames, ToolSchema, ToolSpec, ToolType, } from './input/types/index.js';
|
|
2
|
+
import type { ToolNames } from './input/types/index.js';
|
|
3
|
+
export interface LocalCompleteMetadata {
|
|
4
|
+
readonly systemPrompt: string;
|
|
5
|
+
readonly toolNames: ToolNames;
|
|
6
|
+
readonly baseSchema: Readonly<Record<string, string>>;
|
|
7
|
+
readonly tools: Readonly<Record<string, {
|
|
8
|
+
description?: string;
|
|
9
|
+
schema?: Record<string, string>;
|
|
10
|
+
}>>;
|
|
11
|
+
}
|
|
@@ -10,18 +10,10 @@ export type DirectToolInput = Record<string, unknown> & {
|
|
|
10
10
|
};
|
|
11
11
|
export interface DirectToolDefinition {
|
|
12
12
|
name: string;
|
|
13
|
+
title: string;
|
|
14
|
+
description: string;
|
|
13
15
|
schema: z.ZodType;
|
|
14
16
|
inputSchema: z.ZodType;
|
|
15
|
-
/**
|
|
16
|
-
* Present only for opt-in tools (ghListReleases/ghSearchDiscussions) that
|
|
17
|
-
* are NOT currently enabled. Their entry still appears here (schema/help
|
|
18
|
-
* stay discoverable via `tools <name> --scheme` without already knowing the
|
|
19
|
-
* env var) — the runtime execution registry (`ALL_TOOLS` in toolConfig.ts)
|
|
20
|
-
* is the actual enforcement point and still omits them until enabled.
|
|
21
|
-
*/
|
|
22
|
-
disabled?: {
|
|
23
|
-
envVar: string;
|
|
24
|
-
};
|
|
25
17
|
}
|
|
26
18
|
export type DirectToolCategory = 'GitHub' | 'Local Code' | 'Package' | 'Other';
|
|
27
19
|
export declare const DIRECT_TOOL_CATEGORIES: readonly DirectToolCategory[];
|
|
@@ -45,7 +37,7 @@ export interface DirectToolMetadata {
|
|
|
45
37
|
schema?: Record<string, string>;
|
|
46
38
|
}>;
|
|
47
39
|
}
|
|
48
|
-
export type DirectToolAutoFilledField = '
|
|
40
|
+
export type DirectToolAutoFilledField = 'goal' | 'reasoning';
|
|
49
41
|
export interface PrepareDirectToolInputOptions {
|
|
50
42
|
sourceLabel?: string;
|
|
51
43
|
rejectUnknownFields?: boolean;
|
|
@@ -56,12 +48,10 @@ export declare class DirectToolInputError extends Error {
|
|
|
56
48
|
constructor(message: string, details?: string[]);
|
|
57
49
|
}
|
|
58
50
|
export declare const DIRECT_TOOL_AUTO_FILLED_FIELDS: ReadonlySet<string>;
|
|
59
|
-
/**
|
|
60
|
-
* Engine-free tool definitions (name + display/bulk schema). Order mirrors
|
|
61
|
-
* `ALL_TOOLS` in `toolConfig.ts`; each schema is the SAME object that
|
|
62
|
-
* `toolConfig` attaches an executionFn to. Kept in lockstep by a drift test.
|
|
63
|
-
*/
|
|
51
|
+
/** Engine-free definitions, derived from the shared specification. */
|
|
64
52
|
export declare const DIRECT_TOOL_DEFINITIONS: DirectToolDefinition[];
|
|
53
|
+
/** Every public direct-tool schema. */
|
|
54
|
+
export declare const DIRECT_TOOL_DISCOVERY_DEFINITIONS: DirectToolDefinition[];
|
|
65
55
|
export declare function findDirectToolDefinition(name: string): DirectToolDefinition | undefined;
|
|
66
56
|
export declare function getDirectToolCategory(toolName: string): DirectToolCategory;
|
|
67
57
|
export declare function sortDirectToolNames(toolNames: string[]): string[];
|
|
@@ -2,4 +2,4 @@ import { type DirectToolMetadata } from './toolCatalogDefinitions.js';
|
|
|
2
2
|
export declare function formatDirectToolSchemaText(toolName: string): string;
|
|
3
3
|
export declare function formatDirectToolMetadataSchemaText(schema: Record<string, string> | undefined): string;
|
|
4
4
|
export declare function getDirectToolAutoFilledFields(toolName: string): string[];
|
|
5
|
-
export declare function getDirectToolDescription(toolName: string,
|
|
5
|
+
export declare function getDirectToolDescription(toolName: string, _metadata?: DirectToolMetadata | null): string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Input preparation/normalization for the engine-free direct-tool catalog:
|
|
3
|
-
* JSON parsing, envelope handling, default-field filling, field
|
|
4
|
-
*
|
|
3
|
+
* JSON parsing, envelope handling, default-field filling, and unknown-field
|
|
4
|
+
* detection (with did-you-mean suggestions). Split
|
|
5
5
|
* out of `directToolCatalog.meta.ts` (still the public barrel) — see that
|
|
6
6
|
* file's header comment for the full P3 rationale.
|
|
7
7
|
*/
|
|
@@ -6,8 +6,18 @@ interface JsonSchemaObject extends Record<string, unknown> {
|
|
|
6
6
|
required?: string[];
|
|
7
7
|
properties?: Record<string, unknown>;
|
|
8
8
|
items?: unknown;
|
|
9
|
+
anyOf?: unknown[];
|
|
10
|
+
oneOf?: unknown[];
|
|
11
|
+
const?: unknown;
|
|
9
12
|
}
|
|
10
13
|
export declare function getDirectToolDisplayFields(toolName: string): DirectToolDisplayField[];
|
|
14
|
+
/** Exact per-operation fields for discriminated schemas. Unlike the merged
|
|
15
|
+
* display view, this preserves branch-specific enums and numeric limits. */
|
|
16
|
+
export declare function getDirectToolVariantDisplayFields(toolName: string): Record<string, DirectToolDisplayField[]>;
|
|
17
|
+
/** Top-level fields accepted by the schema branches compatible with the
|
|
18
|
+
* selectors already present in a query. This keeps recovery suggestions inside
|
|
19
|
+
* the active discriminated-union branch instead of the merged catalog view. */
|
|
20
|
+
export declare function getDirectToolAllowedFieldNames(toolName: string, query: Readonly<Record<string, unknown>>): ReadonlySet<string>;
|
|
11
21
|
export declare function describeSchemaConstraints(schema: JsonSchemaObject): string | undefined;
|
|
12
22
|
export declare function describeSchemaType(schema: JsonSchemaObject): string;
|
|
13
23
|
export declare function collectDisplayFields(properties: Record<string, unknown>, requiredFields: ReadonlySet<string>, prefix?: string): DirectToolDisplayField[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function getDirectToolSchemaRelations(toolName: string): string[];
|
|
2
|
+
export declare function getDirectToolSchemaVariants(toolName: string): {
|
|
3
|
+
fields?: string[];
|
|
4
|
+
requires: string[];
|
|
5
|
+
name: string;
|
|
6
|
+
when: string;
|
|
7
|
+
excludes?: string[];
|
|
8
|
+
example: Record<string, unknown>;
|
|
9
|
+
}[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Engine-free source of truth for public direct-tool names and schemas.
|
|
3
|
+
* Runtime execution metadata is attached separately by `toolConfig.ts`.
|
|
4
|
+
*/
|
|
5
|
+
import type { z } from 'zod';
|
|
6
|
+
export interface DirectToolSpecification {
|
|
7
|
+
name: string;
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
schema: z.ZodType;
|
|
11
|
+
inputSchema: z.ZodType;
|
|
12
|
+
}
|
|
13
|
+
export declare const DIRECT_TOOL_SPECIFICATIONS: readonly DirectToolSpecification[];
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* actually runs — schema/help/`--scheme`/`context` use `directToolCatalog.meta.ts`
|
|
6
6
|
* (and the `@octocodeai/octocode-tools-core/schema` subpath), which is engine-free.
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
9
9
|
import { DirectToolInputError } from './directToolCatalog.meta.js';
|
|
10
10
|
type InitializeFn = () => Promise<void>;
|
|
11
11
|
/** @internal — test use only; not part of the public API. */
|
|
@@ -25,3 +25,4 @@ export * from './directToolCatalog/toolCatalogFormatters.js';
|
|
|
25
25
|
export * from './directToolCatalog/toolSchemaIntrospection.js';
|
|
26
26
|
export * from './directToolCatalog/toolCommandPatterns.js';
|
|
27
27
|
export * from './directToolCatalog/toolInputPreparation.js';
|
|
28
|
+
export * from './directToolCatalog/toolSchemaRelations.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { CloneCacheMeta, CacheSource } from './types.js';
|
|
2
|
+
export { cleanupStaleCloneArtifacts, tryRecoverStaleCloneLock, writeCloneLockMeta, } from './cacheArtifacts.js';
|
|
2
3
|
export { getReposBaseDir, getCloneBaseDir, getTreeBaseDir, getCloneDir, getTreeDir, } from './cachePaths.js';
|
|
3
4
|
export declare function readCacheMeta(cloneDir: string): CloneCacheMeta | null;
|
|
4
5
|
export declare function writeCacheMeta(cloneDir: string, meta: CloneCacheMeta): void;
|
|
@@ -17,5 +18,3 @@ export declare function ensureCloneParentDir(cloneDir: string): void;
|
|
|
17
18
|
export declare function removeCloneDir(cloneDir: string): void;
|
|
18
19
|
export declare function evictExpiredClones(octocodeDir: string): number;
|
|
19
20
|
export declare function evictExpiredTrees(octocodeDir: string): number;
|
|
20
|
-
export declare function startCacheGC(octocodeDir: string): void;
|
|
21
|
-
export declare function stopCacheGC(): void;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function writeCloneLockMeta(lockDir: string, pid?: number, createdAt?: number): void;
|
|
2
|
+
export declare function tryRecoverStaleCloneLock(lockDir: string, now?: number): boolean;
|
|
3
|
+
export declare function cleanupStaleCloneArtifacts(octocodeDir: string, now?: number): number;
|
|
@@ -2,4 +2,4 @@ export declare function getReposBaseDir(octocodeDir: string): string;
|
|
|
2
2
|
export declare function getCloneBaseDir(octocodeDir: string): string;
|
|
3
3
|
export declare function getTreeBaseDir(octocodeDir: string): string;
|
|
4
4
|
export declare function getCloneDir(octocodeDir: string, owner: string, repo: string, branch: string, sparsePath?: string): string;
|
|
5
|
-
export declare function getTreeDir(octocodeDir: string, owner: string, repo: string,
|
|
5
|
+
export declare function getTreeDir(octocodeDir: string, owner: string, repo: string, commitSha: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AuthInfo } from '@modelcontextprotocol/
|
|
1
|
+
import type { AuthInfo } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
3
3
|
import type { CloneRepoQueryLocalSchema } from './scheme.js';
|
|
4
4
|
import type { z } from 'zod';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { ToolExecutionArgs, WithOptionalMeta } from '../../types/execution.js';
|
|
3
3
|
type PartialCloneRepoQuery = WithOptionalMeta<CloneRepoQuery>;
|
|
4
4
|
import type { CloneRepoQueryLocalSchema } from './scheme.js';
|
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import type { ToolContinuation } from '../../scheme/pagination.js';
|
|
2
|
-
import type { ResponsePaginationInfo } from '../../types/toolOutput.js';
|
|
3
2
|
export declare const CloneRepoQueryLocalSchema: import("zod").ZodObject<{
|
|
4
3
|
owner: import("zod").ZodString;
|
|
5
4
|
repo: import("zod").ZodString;
|
|
6
5
|
branch: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
6
|
sparsePath: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
7
|
forceRefresh: import("zod").ZodOptional<import("zod").ZodBoolean>;
|
|
9
|
-
|
|
10
|
-
mainResearchGoal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
11
|
-
researchGoal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
8
|
+
goal: import("zod").ZodOptional<import("zod").ZodString>;
|
|
12
9
|
reasoning: import("zod").ZodOptional<import("zod").ZodString>;
|
|
13
10
|
}, import("zod/v4/core").$strip>;
|
|
14
11
|
export declare const BulkCloneRepoLocalSchema: import("zod").ZodObject<{
|
|
15
12
|
responseCharOffset: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodNumber>>;
|
|
16
13
|
responseCharLength: import("zod").ZodOptional<import("zod").ZodPreprocess<import("zod").ZodNumber>>;
|
|
17
14
|
queries: import("zod").ZodArray<import("zod").ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>>;
|
|
18
|
-
}, import("zod/v4/core").$
|
|
19
|
-
interface
|
|
15
|
+
}, import("zod/v4/core").$strict>;
|
|
16
|
+
interface GitHubCloneRepoLocation {
|
|
17
|
+
kind: 'repo' | 'tree';
|
|
20
18
|
localPath: string;
|
|
21
|
-
|
|
22
|
-
cached
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
source: 'clone';
|
|
20
|
+
cached: boolean;
|
|
21
|
+
complete: boolean;
|
|
22
|
+
resolvedBranch: string;
|
|
23
|
+
requestedPath?: string;
|
|
24
|
+
}
|
|
25
|
+
interface GitHubCloneRepoData {
|
|
26
|
+
owner: string;
|
|
27
|
+
repo: string;
|
|
28
|
+
totalSize: number;
|
|
29
|
+
location: GitHubCloneRepoLocation;
|
|
30
|
+
next: {
|
|
31
|
+
viewStructure: ToolContinuation;
|
|
32
|
+
};
|
|
28
33
|
}
|
|
29
34
|
export type GitHubCloneRepoOutputLocal = {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
location?: Record<string, unknown>;
|
|
37
|
-
warnings?: string[];
|
|
38
|
-
error?: string;
|
|
35
|
+
results: Array<{
|
|
36
|
+
index: number;
|
|
37
|
+
status?: 'empty' | 'error';
|
|
38
|
+
meta?: Record<string, unknown>;
|
|
39
|
+
data: GitHubCloneRepoData | Record<string, unknown>;
|
|
40
|
+
}>;
|
|
39
41
|
base?: string;
|
|
40
42
|
shared?: Record<string, string | number | boolean>;
|
|
41
|
-
responsePagination?: ResponsePaginationInfo;
|
|
42
|
-
next?: Record<string, ToolContinuation>;
|
|
43
43
|
} & Record<string, unknown>;
|
|
44
44
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
4
|
import { FileContentQueryLocalSchema } from './scheme.js';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { FileContentQuerySchema } from '
|
|
2
|
+
import type { FileContentQuerySchema } from '../../../toolContract/schemas.js';
|
|
3
3
|
type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
|
|
4
4
|
import type { PaginationInfo } from '../../../types/toolResults.js';
|
|
5
5
|
import type { QueryWithPagination } from '../../../utils/response/groupedFinalizer.js';
|
|
6
|
-
import type { GitHubFetchContentOutputLocal } from '../scheme.js';
|
|
7
6
|
import type { WithOptionalMeta } from '../../../types/execution.js';
|
|
8
7
|
export type PartialFileContentQuery = WithOptionalMeta<FileContentQuery> & QueryWithPagination;
|
|
9
8
|
export type FileEntry = {
|
|
@@ -17,6 +16,7 @@ export type FileEntry = {
|
|
|
17
16
|
totalLines?: number;
|
|
18
17
|
sourceChars?: number;
|
|
19
18
|
resolvedBranch?: string;
|
|
19
|
+
commitSha?: string;
|
|
20
20
|
pagination?: PaginationInfo;
|
|
21
21
|
isPartial?: boolean;
|
|
22
22
|
startLine?: number;
|
|
@@ -40,13 +40,26 @@ export type FileContentNextMap = {
|
|
|
40
40
|
tool: 'ghGetFileContent';
|
|
41
41
|
query: Record<string, unknown>;
|
|
42
42
|
};
|
|
43
|
+
continueLines?: {
|
|
44
|
+
tool: 'ghGetFileContent';
|
|
45
|
+
query: Record<string, unknown>;
|
|
46
|
+
why: string;
|
|
47
|
+
confidence: 'exact';
|
|
48
|
+
};
|
|
43
49
|
cloneForSemantics?: {
|
|
44
50
|
tool: 'ghCloneRepo';
|
|
45
51
|
query: Record<string, unknown>;
|
|
46
52
|
why: string;
|
|
47
53
|
confidence: 'exact';
|
|
48
54
|
};
|
|
55
|
+
escalateToClone?: {
|
|
56
|
+
tool: 'ghCloneRepo';
|
|
57
|
+
query: Record<string, unknown>;
|
|
58
|
+
why: string;
|
|
59
|
+
confidence: 'exact';
|
|
60
|
+
};
|
|
49
61
|
};
|
|
62
|
+
export type DirectoryPartialReason = keyof NonNullable<DirectoryEntry['skipped']> | 'providerDirectoryIncomplete';
|
|
50
63
|
export type DirectoryEntry = {
|
|
51
64
|
path: string;
|
|
52
65
|
localPath: string;
|
|
@@ -84,19 +97,9 @@ export type DirectoryEntry = {
|
|
|
84
97
|
}>;
|
|
85
98
|
cached?: boolean;
|
|
86
99
|
resolvedBranch?: string;
|
|
100
|
+
isPartial?: boolean;
|
|
101
|
+
terminalLimit?: boolean;
|
|
102
|
+
partialReasons?: DirectoryPartialReason[];
|
|
103
|
+
next?: Pick<FileContentNextMap, 'escalateToClone'>;
|
|
87
104
|
};
|
|
88
|
-
export type RepoGroup = {
|
|
89
|
-
id: string;
|
|
90
|
-
owner: string;
|
|
91
|
-
repo: string;
|
|
92
|
-
files?: FileEntry[];
|
|
93
|
-
directories?: DirectoryEntry[];
|
|
94
|
-
};
|
|
95
|
-
export type RepoGroupData = {
|
|
96
|
-
owner: string;
|
|
97
|
-
repo: string;
|
|
98
|
-
files?: FileEntry[];
|
|
99
|
-
directories?: DirectoryEntry[];
|
|
100
|
-
};
|
|
101
|
-
export type FileContentResponse = GitHubFetchContentOutputLocal;
|
|
102
105
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import type { CharPagination, ItemPagination, ToolContinuation } from '../../scheme/pagination.js';
|
|
3
|
-
import type { ResponsePaginationInfo } from '../../types/toolOutput.js';
|
|
3
|
+
import type { BulkToolResultRow, ResponsePaginationInfo } from '../../types/toolOutput.js';
|
|
4
4
|
export declare const FileContentQueryBaseLocalSchema: z.ZodObject<Readonly<{
|
|
5
5
|
[k: string]: z.core.$ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
6
6
|
}>, z.core.$strip>;
|
|
@@ -28,16 +28,14 @@ export declare const FileContentQueryLocalSchema: z.ZodObject<{
|
|
|
28
28
|
standard: "standard";
|
|
29
29
|
symbols: "symbols";
|
|
30
30
|
}>>;
|
|
31
|
-
|
|
32
|
-
mainResearchGoal: z.ZodOptional<z.ZodString>;
|
|
33
|
-
researchGoal: z.ZodOptional<z.ZodString>;
|
|
31
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
34
32
|
reasoning: z.ZodOptional<z.ZodString>;
|
|
35
33
|
}, z.core.$strip>;
|
|
36
34
|
export declare const FileContentBulkQueryLocalSchema: z.ZodObject<{
|
|
37
35
|
responseCharOffset: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
38
36
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
39
37
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
40
|
-
}, z.core.$
|
|
38
|
+
}, z.core.$strict>;
|
|
41
39
|
export type GitHubFetchFilePagination = (CharPagination & {
|
|
42
40
|
nextPage?: number;
|
|
43
41
|
}) | (ItemPagination & {
|
|
@@ -55,6 +53,7 @@ export interface GitHubFetchFileEntry {
|
|
|
55
53
|
totalLines?: number;
|
|
56
54
|
sourceChars?: number;
|
|
57
55
|
resolvedBranch?: string;
|
|
56
|
+
commitSha?: string;
|
|
58
57
|
pagination?: GitHubFetchFilePagination;
|
|
59
58
|
next?: Record<string, ToolContinuation>;
|
|
60
59
|
isPartial?: boolean;
|
|
@@ -78,6 +77,10 @@ export interface GitHubFetchDirectoryEntry {
|
|
|
78
77
|
fileCount: number;
|
|
79
78
|
totalSize: number;
|
|
80
79
|
complete?: boolean;
|
|
80
|
+
verified?: boolean;
|
|
81
|
+
commitSha?: string;
|
|
82
|
+
hasSubdirectories?: boolean;
|
|
83
|
+
skippedSummary?: Record<string, number>;
|
|
81
84
|
directoryEntryCount?: number;
|
|
82
85
|
eligibleFileCount?: number;
|
|
83
86
|
savedFileCount?: number;
|
|
@@ -104,6 +107,10 @@ export interface GitHubFetchDirectoryEntry {
|
|
|
104
107
|
}>;
|
|
105
108
|
cached?: boolean;
|
|
106
109
|
resolvedBranch?: string;
|
|
110
|
+
isPartial?: boolean;
|
|
111
|
+
terminalLimit?: boolean;
|
|
112
|
+
partialReasons?: string[];
|
|
113
|
+
next?: Record<string, ToolContinuation>;
|
|
107
114
|
}
|
|
108
115
|
export interface GitHubFetchContentData {
|
|
109
116
|
owner: string;
|
|
@@ -111,20 +118,16 @@ export interface GitHubFetchContentData {
|
|
|
111
118
|
files?: GitHubFetchFileEntry[];
|
|
112
119
|
directories?: GitHubFetchDirectoryEntry[];
|
|
113
120
|
}
|
|
121
|
+
export interface GitHubFetchContentErrorData {
|
|
122
|
+
owner?: string;
|
|
123
|
+
repo?: string;
|
|
124
|
+
path?: string;
|
|
125
|
+
error: string;
|
|
126
|
+
}
|
|
114
127
|
export interface GitHubFetchContentOutputLocal {
|
|
115
128
|
base?: string;
|
|
116
129
|
shared?: Record<string, string | number | boolean>;
|
|
117
130
|
responsePagination?: ResponsePaginationInfo;
|
|
118
|
-
results: Array<
|
|
119
|
-
id: string;
|
|
120
|
-
data?: GitHubFetchContentData;
|
|
121
|
-
}>;
|
|
122
|
-
errors?: Array<{
|
|
123
|
-
id: string;
|
|
124
|
-
owner?: string;
|
|
125
|
-
repo?: string;
|
|
126
|
-
path?: string;
|
|
127
|
-
error: string;
|
|
128
|
-
}>;
|
|
131
|
+
results: Array<BulkToolResultRow<GitHubFetchContentData | GitHubFetchContentErrorData>>;
|
|
129
132
|
[key: string]: unknown;
|
|
130
133
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
|
-
import type { FileContentQuerySchema } from '
|
|
2
|
+
import type { FileContentQuerySchema } from '../../toolContract/schemas.js';
|
|
3
3
|
import type { MinifyMode } from '../../scheme/fields.js';
|
|
4
4
|
type FileContentQuery = z.infer<typeof FileContentQuerySchema>;
|
|
5
5
|
import type { PaginationInfo } from '../../types/toolResults.js';
|
|
@@ -61,8 +61,8 @@ export interface DirectoryFetchResult {
|
|
|
61
61
|
complete: boolean;
|
|
62
62
|
/** true = completeness was proven against the remote tree (fresh fetch + complete) */
|
|
63
63
|
verified: boolean;
|
|
64
|
-
/**
|
|
65
|
-
commitSha
|
|
64
|
+
/** Immutable commit identity used by repoRoot and localPath. */
|
|
65
|
+
commitSha: string;
|
|
66
66
|
/** true when nonFile > 0 — subdirectory entries were present but not fetched; use ghCloneRepo for full coverage */
|
|
67
67
|
hasSubdirectories?: boolean;
|
|
68
68
|
directoryEntryCount: number;
|
|
@@ -101,5 +101,6 @@ export interface FileMaterializationResult {
|
|
|
101
101
|
owner: string;
|
|
102
102
|
repo: string;
|
|
103
103
|
branch: string;
|
|
104
|
+
commitSha: string;
|
|
104
105
|
}
|
|
105
106
|
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CallToolResult } from '@modelcontextprotocol/server';
|
|
2
|
+
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
3
|
+
import { type GitHubSearchQuery } from './scheme.js';
|
|
4
|
+
export declare function executeGitHubSearch(args: ToolExecutionArgs<GitHubSearchQuery>): Promise<CallToolResult>;
|