@octocodeai/octocode-tools-core 16.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/dist/commands/BaseCommandBuilder.d.ts +14 -0
- package/dist/commands/FindCommandBuilder.d.ts +23 -0
- package/dist/commands/LsCommandBuilder.d.ts +15 -0
- package/dist/commands/RipgrepCommandBuilder.d.ts +27 -0
- package/dist/config.d.ts +16 -0
- package/dist/direct.d.ts +3 -0
- package/dist/direct.js +53 -0
- package/dist/errors/ToolError.d.ts +21 -0
- package/dist/errors/domainErrors.d.ts +310 -0
- package/dist/errors/errorFactories.d.ts +12 -0
- package/dist/errors/localToolErrors.d.ts +29 -0
- package/dist/errors/pathUtils.d.ts +1 -0
- package/dist/github/client.d.ts +12 -0
- package/dist/github/codeSearch.d.ts +8 -0
- package/dist/github/directoryFetch.d.ts +5 -0
- package/dist/github/errorConstants.d.ts +81 -0
- package/dist/github/errors.d.ts +3 -0
- package/dist/github/fileContent.d.ts +4 -0
- package/dist/github/fileContentProcess.d.ts +11 -0
- package/dist/github/fileContentRaw.d.ts +12 -0
- package/dist/github/githubAPI.d.ts +237 -0
- package/dist/github/history.d.ts +16 -0
- package/dist/github/prByNumber.d.ts +5 -0
- package/dist/github/prContentFetcher.d.ts +5 -0
- package/dist/github/prTransformation.d.ts +109 -0
- package/dist/github/pullRequestSearch.d.ts +4 -0
- package/dist/github/queryBuilders.d.ts +12 -0
- package/dist/github/repoSearch.d.ts +25 -0
- package/dist/github/repoStructure.d.ts +7 -0
- package/dist/github/repoStructurePagination.d.ts +6 -0
- package/dist/github/repoStructureRecursive.d.ts +3 -0
- package/dist/github/responseHeaders.d.ts +1 -0
- package/dist/hints/dynamic.d.ts +6 -0
- package/dist/hints/index.d.ts +2 -0
- package/dist/hints/types.d.ts +1 -0
- package/dist/index.d.ts +187 -0
- package/dist/index.js +64 -0
- package/dist/providers/capabilities.d.ts +2 -0
- package/dist/providers/factory.d.ts +9 -0
- package/dist/providers/github/GitHubProvider.d.ts +14 -0
- package/dist/providers/github/githubContent.d.ts +9 -0
- package/dist/providers/github/githubPullRequests.d.ts +12 -0
- package/dist/providers/github/githubSearch.d.ts +12 -0
- package/dist/providers/github/githubStructure.d.ts +9 -0
- package/dist/providers/github/utils.d.ts +10 -0
- package/dist/providers/providerQueries.d.ts +111 -0
- package/dist/providers/providerResults.d.ts +175 -0
- package/dist/providers/types.d.ts +48 -0
- package/dist/responses.d.ts +47 -0
- package/dist/scheme/coreSchemas.d.ts +10 -0
- package/dist/scheme/fields.d.ts +13 -0
- package/dist/scheme/responseEnvelope.d.ts +16 -0
- package/dist/security/bridge.d.ts +10 -0
- package/dist/serverConfig.d.ts +23 -0
- package/dist/session.d.ts +25 -0
- package/dist/tools/directToolCatalog.d.ts +56 -0
- package/dist/tools/executionGuard.d.ts +14 -0
- package/dist/tools/github_clone_repo/cache.d.ts +21 -0
- package/dist/tools/github_clone_repo/cloneRepo.d.ts +6 -0
- package/dist/tools/github_clone_repo/execution.d.ts +8 -0
- package/dist/tools/github_clone_repo/hints.d.ts +2 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +50 -0
- package/dist/tools/github_clone_repo/types.d.ts +19 -0
- package/dist/tools/github_fetch_content/execution.d.ts +7 -0
- package/dist/tools/github_fetch_content/finalizer.d.ts +10 -0
- package/dist/tools/github_fetch_content/hints.d.ts +2 -0
- package/dist/tools/github_fetch_content/scheme.d.ts +120 -0
- package/dist/tools/github_fetch_content/types.d.ts +66 -0
- package/dist/tools/github_search_code/execution.d.ts +8 -0
- package/dist/tools/github_search_code/finalizer.d.ts +6 -0
- package/dist/tools/github_search_code/hints.d.ts +2 -0
- package/dist/tools/github_search_code/scheme.d.ts +88 -0
- package/dist/tools/github_search_pull_requests/contentRequest.d.ts +52 -0
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +18 -0
- package/dist/tools/github_search_pull_requests/execution.d.ts +17 -0
- package/dist/tools/github_search_pull_requests/hints.d.ts +2 -0
- package/dist/tools/github_search_pull_requests/scheme.d.ts +224 -0
- package/dist/tools/github_search_pull_requests/types.d.ts +120 -0
- package/dist/tools/github_search_repos/execution.d.ts +17 -0
- package/dist/tools/github_search_repos/hints.d.ts +2 -0
- package/dist/tools/github_search_repos/scheme.d.ts +96 -0
- package/dist/tools/github_view_repo_structure/constants.d.ts +4 -0
- package/dist/tools/github_view_repo_structure/execution.d.ts +20 -0
- package/dist/tools/github_view_repo_structure/hints.d.ts +2 -0
- package/dist/tools/github_view_repo_structure/scheme.d.ts +81 -0
- package/dist/tools/github_view_repo_structure/types.d.ts +39 -0
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +22 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +49 -0
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +18 -0
- package/dist/tools/local_binary_inspect/decompressOps.d.ts +16 -0
- package/dist/tools/local_binary_inspect/execution.d.ts +4 -0
- package/dist/tools/local_binary_inspect/scheme.d.ts +44 -0
- package/dist/tools/local_fetch_content/contentExtractor.d.ts +9 -0
- package/dist/tools/local_fetch_content/execution.d.ts +5 -0
- package/dist/tools/local_fetch_content/fetchContent.d.ts +4 -0
- package/dist/tools/local_fetch_content/hints.d.ts +2 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +31 -0
- package/dist/tools/local_find_files/execution.d.ts +5 -0
- package/dist/tools/local_find_files/findFiles.d.ts +11 -0
- package/dist/tools/local_find_files/hints.d.ts +2 -0
- package/dist/tools/local_find_files/scheme.d.ts +9 -0
- package/dist/tools/local_ripgrep/execution.d.ts +5 -0
- package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/hints.d.ts +2 -0
- package/dist/tools/local_ripgrep/patternValidation.d.ts +12 -0
- package/dist/tools/local_ripgrep/ripgrepExecutor.d.ts +3 -0
- package/dist/tools/local_ripgrep/ripgrepParser.d.ts +9 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +9 -0
- package/dist/tools/local_ripgrep/scheme.d.ts +55 -0
- package/dist/tools/local_ripgrep/searchContentRipgrep.d.ts +5 -0
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +9 -0
- package/dist/tools/local_view_structure/execution.d.ts +5 -0
- package/dist/tools/local_view_structure/hints.d.ts +2 -0
- package/dist/tools/local_view_structure/local_view_structure.d.ts +7 -0
- package/dist/tools/local_view_structure/scheme.d.ts +33 -0
- package/dist/tools/local_view_structure/structureFilters.d.ts +33 -0
- package/dist/tools/local_view_structure/structureParser.d.ts +3 -0
- package/dist/tools/local_view_structure/structureResponse.d.ts +32 -0
- package/dist/tools/local_view_structure/structureWalker.d.ts +24 -0
- package/dist/tools/lsp/semantic_content/execution.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/hints.d.ts +4 -0
- package/dist/tools/lsp/semantic_content/index.d.ts +2 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +509 -0
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +11 -0
- package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +20 -0
- package/dist/tools/lsp/shared/semanticTypes.d.ts +134 -0
- package/dist/tools/package_search/execution.d.ts +7 -0
- package/dist/tools/package_search/hints.d.ts +2 -0
- package/dist/tools/package_search/scheme.d.ts +51 -0
- package/dist/tools/providerExecution.d.ts +51 -0
- package/dist/tools/providerMappers.d.ts +277 -0
- package/dist/tools/toolConfig.d.ts +41 -0
- package/dist/tools/toolMetadata/baseSchema.d.ts +2 -0
- package/dist/tools/toolMetadata/descriptions.d.ts +1 -0
- package/dist/tools/toolMetadata/gateway.d.ts +7 -0
- package/dist/tools/toolMetadata/metadataPresence.d.ts +1 -0
- package/dist/tools/toolMetadata/names.d.ts +2 -0
- package/dist/tools/toolMetadata/proxies.d.ts +10 -0
- package/dist/tools/toolMetadata/state.d.ts +5 -0
- package/dist/tools/toolMetadata/types.d.ts +2 -0
- package/dist/tools/toolNames.d.ts +2 -0
- package/dist/tools/utils.d.ts +27 -0
- package/dist/types/bulk.d.ts +41 -0
- package/dist/types/execution.d.ts +11 -0
- package/dist/types/metadata.d.ts +69 -0
- package/dist/types/promise.d.ts +12 -0
- package/dist/types/responseTypes.d.ts +57 -0
- package/dist/types/server.d.ts +15 -0
- package/dist/types/session.d.ts +29 -0
- package/dist/types/toolResults.d.ts +62 -0
- package/dist/utils/contextUtils.d.ts +31 -0
- package/dist/utils/core/bestEffort.d.ts +2 -0
- package/dist/utils/core/compare.d.ts +1 -0
- package/dist/utils/core/constants.d.ts +47 -0
- package/dist/utils/core/promise.d.ts +2 -0
- package/dist/utils/core/safeRegex.d.ts +5 -0
- package/dist/utils/core/types.d.ts +50 -0
- package/dist/utils/environment/environmentDetection.d.ts +5 -0
- package/dist/utils/exec/commandAvailability.d.ts +19 -0
- package/dist/utils/exec/npm.d.ts +16 -0
- package/dist/utils/exec/ripgrepBinary.d.ts +3 -0
- package/dist/utils/exec/safe.d.ts +2 -0
- package/dist/utils/exec/spawn.d.ts +34 -0
- package/dist/utils/file/byteOffset.d.ts +12 -0
- package/dist/utils/file/filters.d.ts +11 -0
- package/dist/utils/file/size.d.ts +2 -0
- package/dist/utils/file/toolHelpers.d.ts +28 -0
- package/dist/utils/http/cache.d.ts +16 -0
- package/dist/utils/http/circuitBreaker.d.ts +17 -0
- package/dist/utils/http/fetch.d.ts +13 -0
- package/dist/utils/package/common.d.ts +5 -0
- package/dist/utils/package/npm.d.ts +8 -0
- package/dist/utils/package/schemas.d.ts +60 -0
- package/dist/utils/package/types.d.ts +55 -0
- package/dist/utils/pagination/boundary.d.ts +11 -0
- package/dist/utils/pagination/charLimit.d.ts +3 -0
- package/dist/utils/pagination/core.d.ts +15 -0
- package/dist/utils/pagination/hints.d.ts +3 -0
- package/dist/utils/pagination/outputSizeLimit.d.ts +16 -0
- package/dist/utils/pagination/types.d.ts +43 -0
- package/dist/utils/parsers/diff.d.ts +2 -0
- package/dist/utils/parsers/ripgrep.d.ts +11 -0
- package/dist/utils/parsers/schemas.d.ts +72 -0
- package/dist/utils/response/bulk.d.ts +5 -0
- package/dist/utils/response/callToolResult.d.ts +3 -0
- package/dist/utils/response/charSavings.d.ts +3 -0
- package/dist/utils/response/error.d.ts +20 -0
- package/dist/utils/response/groupedFinalizer.d.ts +37 -0
- package/dist/utils/response/pathRelativize.d.ts +9 -0
- package/dist/utils/response/structuredPagination.d.ts +9 -0
- package/dist/zod.d.ts +1 -0
- package/dist/zod.js +8 -0
- package/package.json +66 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export type ContentRole = 'system' | 'assistant' | 'user';
|
|
2
|
+
export interface RoleAnnotations {
|
|
3
|
+
audience?: Array<'user' | 'assistant'>;
|
|
4
|
+
priority?: number;
|
|
5
|
+
role?: ContentRole;
|
|
6
|
+
lastModified?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface RoleContentBlock {
|
|
9
|
+
type: 'text';
|
|
10
|
+
text: string;
|
|
11
|
+
annotations?: RoleAnnotations;
|
|
12
|
+
}
|
|
13
|
+
interface ResponsePagination {
|
|
14
|
+
currentPage: number;
|
|
15
|
+
totalPages: number;
|
|
16
|
+
hasMore: boolean;
|
|
17
|
+
perPage?: number;
|
|
18
|
+
totalItems?: number;
|
|
19
|
+
}
|
|
20
|
+
interface SystemContentOptions {
|
|
21
|
+
instructions?: string;
|
|
22
|
+
hints?: string[];
|
|
23
|
+
pagination?: ResponsePagination;
|
|
24
|
+
warnings?: string[];
|
|
25
|
+
}
|
|
26
|
+
interface AssistantContentOptions {
|
|
27
|
+
summary: string;
|
|
28
|
+
details?: string;
|
|
29
|
+
format?: 'yaml' | 'json' | 'markdown' | 'plain';
|
|
30
|
+
}
|
|
31
|
+
interface UserContentOptions {
|
|
32
|
+
message: string;
|
|
33
|
+
emoji?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface RoleBasedResultOptions {
|
|
36
|
+
system?: SystemContentOptions;
|
|
37
|
+
assistant: AssistantContentOptions;
|
|
38
|
+
user?: UserContentOptions;
|
|
39
|
+
data: unknown;
|
|
40
|
+
isError?: boolean;
|
|
41
|
+
}
|
|
42
|
+
export declare const StatusEmojis: {
|
|
43
|
+
readonly success: "✅";
|
|
44
|
+
readonly empty: "📭";
|
|
45
|
+
readonly error: "❌";
|
|
46
|
+
readonly partial: "⚠️";
|
|
47
|
+
readonly searching: "🔍";
|
|
48
|
+
readonly loading: "⏳";
|
|
49
|
+
readonly info: "ℹ️";
|
|
50
|
+
readonly file: "📄";
|
|
51
|
+
readonly folder: "📁";
|
|
52
|
+
readonly page: "📃";
|
|
53
|
+
readonly definition: "🎯";
|
|
54
|
+
readonly reference: "🔗";
|
|
55
|
+
readonly call: "📞";
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type TokenSourceType = 'env:OCTOCODE_TOKEN' | 'env:GH_TOKEN' | 'env:GITHUB_TOKEN' | 'gh-cli' | 'octocode-storage' | 'none';
|
|
2
|
+
export interface ServerConfig {
|
|
3
|
+
version: string;
|
|
4
|
+
githubApiUrl: string;
|
|
5
|
+
toolsToRun?: string[];
|
|
6
|
+
enableTools?: string[];
|
|
7
|
+
disableTools?: string[];
|
|
8
|
+
timeout: number;
|
|
9
|
+
maxRetries: number;
|
|
10
|
+
loggingEnabled: boolean;
|
|
11
|
+
enableLocal: boolean;
|
|
12
|
+
enableClone: boolean;
|
|
13
|
+
outputFormat: 'yaml' | 'json';
|
|
14
|
+
tokenSource: TokenSourceType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SessionData {
|
|
2
|
+
sessionId: string;
|
|
3
|
+
intent: 'init' | 'error' | 'tool_call' | 'rate_limit';
|
|
4
|
+
data: ToolCallData | ErrorData | RateLimitData | Record<string, never>;
|
|
5
|
+
timestamp: string;
|
|
6
|
+
version: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ToolCallData {
|
|
9
|
+
tool_name: string;
|
|
10
|
+
repos: string[];
|
|
11
|
+
provider?: string;
|
|
12
|
+
mainResearchGoal?: string;
|
|
13
|
+
researchGoal?: string;
|
|
14
|
+
reasoning?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ErrorData {
|
|
17
|
+
error: string;
|
|
18
|
+
provider?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RateLimitData {
|
|
21
|
+
limit_type: 'primary' | 'secondary' | 'graphql' | 'precheck_blocked';
|
|
22
|
+
retry_after_seconds?: number;
|
|
23
|
+
rate_limit_remaining?: number;
|
|
24
|
+
rate_limit_reset_ms?: number;
|
|
25
|
+
api_method?: string;
|
|
26
|
+
api_url?: string;
|
|
27
|
+
details?: string;
|
|
28
|
+
provider?: string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { GitHubAPIError } from '../github/githubAPI.js';
|
|
2
|
+
export type QueryStatus = 'empty' | 'error';
|
|
3
|
+
interface ToolResult {
|
|
4
|
+
status?: QueryStatus;
|
|
5
|
+
hints?: string[];
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export interface ToolErrorResult extends ToolResult {
|
|
9
|
+
status: 'error';
|
|
10
|
+
error: string | GitHubAPIError;
|
|
11
|
+
}
|
|
12
|
+
export interface ToolSuccessResult extends ToolResult {
|
|
13
|
+
status?: 'empty';
|
|
14
|
+
}
|
|
15
|
+
export interface PaginationInfo {
|
|
16
|
+
currentPage: number;
|
|
17
|
+
totalPages: number;
|
|
18
|
+
hasMore: boolean;
|
|
19
|
+
charOffset?: number;
|
|
20
|
+
charLength?: number;
|
|
21
|
+
totalChars?: number;
|
|
22
|
+
nextCharOffset?: number;
|
|
23
|
+
chunkMode?: 'semantic' | 'char-limit';
|
|
24
|
+
nextBlockChar?: number;
|
|
25
|
+
perPage?: number;
|
|
26
|
+
itemsPerPage?: number;
|
|
27
|
+
filesPerPage?: number;
|
|
28
|
+
totalFiles?: number;
|
|
29
|
+
entriesPerPage?: number;
|
|
30
|
+
totalEntries?: number;
|
|
31
|
+
matchesPerPage?: number;
|
|
32
|
+
totalMatches?: number;
|
|
33
|
+
reportedTotalMatches?: number;
|
|
34
|
+
reachableTotalMatches?: number;
|
|
35
|
+
totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
|
|
36
|
+
totalMatchesCapped?: boolean;
|
|
37
|
+
uniqueFileCount?: number;
|
|
38
|
+
}
|
|
39
|
+
export type ToolInvocationCallback = (toolName: string, queries: unknown[]) => Promise<void>;
|
|
40
|
+
export interface ProcessedBulkResult {
|
|
41
|
+
data?: Record<string, unknown>;
|
|
42
|
+
error?: string | GitHubAPIError;
|
|
43
|
+
status?: QueryStatus;
|
|
44
|
+
hints?: readonly string[] | string[];
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface FlatQueryResult {
|
|
48
|
+
id: string;
|
|
49
|
+
status?: QueryStatus;
|
|
50
|
+
data: Record<string, unknown>;
|
|
51
|
+
}
|
|
52
|
+
export interface QueryError {
|
|
53
|
+
queryIndex: number;
|
|
54
|
+
error: string;
|
|
55
|
+
}
|
|
56
|
+
export interface StructuredToolResponse {
|
|
57
|
+
data?: unknown;
|
|
58
|
+
hints?: string[];
|
|
59
|
+
instructions?: string;
|
|
60
|
+
[key: string]: unknown;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type * as NativeContextUtils from '@octocodeai/octocode-context-utils';
|
|
2
|
+
export type { ExtractMatchingLinesOptions, ExtractMatchingLinesResult, FilterPatchOptions, FileSystemEntry, FileSystemQueryOptions, FileSystemQueryResult, MinifyResult, JsonInput, RipgrepParseOptions, RipgrepParseResult, SliceContentOptions, SliceContentResult, StructuralMatch, YamlConversionConfig, } from '@octocodeai/octocode-context-utils';
|
|
3
|
+
type NativeContextUtilsModule = typeof NativeContextUtils;
|
|
4
|
+
type NativeLoader = () => NativeContextUtilsModule;
|
|
5
|
+
export declare class ContextUtilsLoadError extends Error {
|
|
6
|
+
readonly cause: unknown;
|
|
7
|
+
constructor(cause: unknown);
|
|
8
|
+
}
|
|
9
|
+
export declare function setContextUtilsNativeLoaderForTesting(loader: NativeLoader): void;
|
|
10
|
+
export declare function resetContextUtilsNativeLoaderForTesting(): void;
|
|
11
|
+
export declare const contextUtils: {
|
|
12
|
+
applyContentViewMinification(content: string, filePath: string): string;
|
|
13
|
+
applyMinification(content: string, filePath: string): string;
|
|
14
|
+
minifyContent(content: string, filePath: string): Promise<NativeContextUtils.MinifyResult>;
|
|
15
|
+
minifyContentSync(content: string, filePath: string): string;
|
|
16
|
+
minifyContentResult(content: string, filePath: string): NativeContextUtils.MinifyResult;
|
|
17
|
+
minifyMarkdownCore(content: string): string;
|
|
18
|
+
extractSignatures(content: string, filePath: string): string | null;
|
|
19
|
+
structuralSearch(content: string, filePath: string, pattern?: string | null, rule?: string | null): NativeContextUtils.StructuralMatch[];
|
|
20
|
+
getSemanticBoundaryOffsets(content: string, filePath: string): number[];
|
|
21
|
+
jsonToYamlString(jsonObject: NativeContextUtils.JsonInput, config?: NativeContextUtils.YamlConversionConfig | null): string;
|
|
22
|
+
parseRipgrepJson(stdout: string, options?: NativeContextUtils.RipgrepParseOptions | null): NativeContextUtils.RipgrepParseResult;
|
|
23
|
+
queryFileSystem(options: NativeContextUtils.FileSystemQueryOptions): NativeContextUtils.FileSystemQueryResult;
|
|
24
|
+
extractMatchingLines(content: string, pattern: string, options?: NativeContextUtils.ExtractMatchingLinesOptions | null): NativeContextUtils.ExtractMatchingLinesResult;
|
|
25
|
+
filterPatch(patch: string, options?: NativeContextUtils.FilterPatchOptions | null): string;
|
|
26
|
+
charToByteOffset(content: string, charIndex: number): number;
|
|
27
|
+
byteToCharOffset(content: string, byteOffset: number): number;
|
|
28
|
+
byteSliceContent(content: string, byteStart: number, byteEnd: number): string;
|
|
29
|
+
sliceContent(content: string, charOffset: number, charLength: number, options?: NativeContextUtils.SliceContentOptions | null): NativeContextUtils.SliceContentResult;
|
|
30
|
+
readonly SIGNATURES_ONLY_HINT: string;
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function compareIsoDateDescending(left?: string, right?: string): number;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export declare const DEFAULTS: {
|
|
2
|
+
readonly COMMAND_TIMEOUT: 30000;
|
|
3
|
+
readonly MAX_OUTPUT_SIZE: number;
|
|
4
|
+
readonly MAX_RESULTS: 100;
|
|
5
|
+
readonly CONTEXT_LINES: 5;
|
|
6
|
+
};
|
|
7
|
+
export declare const RESOURCE_LIMITS: {
|
|
8
|
+
readonly MCP_MAX_TOKENS: 25000;
|
|
9
|
+
readonly CHARS_PER_TOKEN: 4;
|
|
10
|
+
readonly MAX_FETCH_CONTENT_CHARS: 50000;
|
|
11
|
+
readonly MAX_OUTPUT_SIZE_BYTES: number;
|
|
12
|
+
readonly LARGE_FILE_THRESHOLD_KB: 100;
|
|
13
|
+
readonly MAX_ENTRIES_BEFORE_PAGINATION: 100;
|
|
14
|
+
readonly MAX_FILES_DEFAULT: 1000;
|
|
15
|
+
readonly DEFAULT_ENTRIES_PER_PAGE: 100;
|
|
16
|
+
readonly MAX_ENTRIES_PER_PAGE: 200;
|
|
17
|
+
readonly MAX_LIST_ITEMS_DETAILED: 100;
|
|
18
|
+
readonly MAX_LIST_ITEMS_SIMPLE: 200;
|
|
19
|
+
readonly MAX_ARCHIVE_ENTRIES_PER_PAGE: 100;
|
|
20
|
+
readonly MAX_DIR_ENTRIES_PER_PAGE: 100;
|
|
21
|
+
readonly MAX_DIR_ENTRIES_TREE: 1000;
|
|
22
|
+
readonly DEFAULT_EXEC_TIMEOUT_MS: 30000;
|
|
23
|
+
readonly DEFAULT_MAX_MATCHES_PER_FILE: 3;
|
|
24
|
+
readonly DEFAULT_CONTEXT_LINES: 5;
|
|
25
|
+
readonly DEFAULT_MATCH_CONTENT_LENGTH: 500;
|
|
26
|
+
readonly MAX_MATCH_CONTENT_LENGTH: 800;
|
|
27
|
+
readonly DEFAULT_MATCHES_PER_PAGE: 10;
|
|
28
|
+
readonly MAX_MATCHES_PER_PAGE: 100;
|
|
29
|
+
readonly DEFAULT_FILES_PER_PAGE: 20;
|
|
30
|
+
readonly MAX_FILES_PER_PAGE: 50;
|
|
31
|
+
readonly MAX_RIPGREP_DIRECTORY_SIZE_MB: 100;
|
|
32
|
+
readonly MAX_FILE_COUNT_FOR_SEARCH: 1000;
|
|
33
|
+
readonly ESTIMATED_AVG_FILE_SIZE_BYTES: number;
|
|
34
|
+
readonly LARGE_RESULT_BYTES_HINT: number;
|
|
35
|
+
readonly BINARY_MAX_BYTES: number;
|
|
36
|
+
readonly BINARY_DEFAULT_HEX_LINES: 20;
|
|
37
|
+
readonly BINARY_DEFAULT_MIN_STRING_LENGTH: 6;
|
|
38
|
+
readonly MAX_ARCHIVE_FILES: 1000;
|
|
39
|
+
readonly DEFAULT_ARCHIVE_MAX_FILES: 200;
|
|
40
|
+
readonly GLOBAL_MEMORY_LIMIT_BYTES: number;
|
|
41
|
+
readonly PER_OPERATION_MEMORY_LIMIT_BYTES: number;
|
|
42
|
+
readonly MEMORY_RESERVATION_TIMEOUT_MS: number;
|
|
43
|
+
readonly TOKEN_CRITICAL_THRESHOLD: 50000;
|
|
44
|
+
readonly TOKEN_HIGH_THRESHOLD: 25000;
|
|
45
|
+
readonly TOKEN_MODERATE_THRESHOLD: 10000;
|
|
46
|
+
readonly TOKEN_NOTICE_THRESHOLD: 2500;
|
|
47
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface ExecResult {
|
|
2
|
+
code: number | null;
|
|
3
|
+
stdout: string;
|
|
4
|
+
stderr: string;
|
|
5
|
+
success: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ExecOptions {
|
|
8
|
+
cwd?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
env?: Record<string, string>;
|
|
11
|
+
maxOutputSize?: number;
|
|
12
|
+
toolName?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PaginationInfo {
|
|
15
|
+
currentPage: number;
|
|
16
|
+
totalPages: number;
|
|
17
|
+
hasMore: boolean;
|
|
18
|
+
charOffset?: number;
|
|
19
|
+
charLength?: number;
|
|
20
|
+
totalChars?: number;
|
|
21
|
+
chunkMode?: 'semantic' | 'char-limit';
|
|
22
|
+
nextBlockChar?: number;
|
|
23
|
+
perPage?: number;
|
|
24
|
+
itemsPerPage?: number;
|
|
25
|
+
filesPerPage?: number;
|
|
26
|
+
totalFiles?: number;
|
|
27
|
+
entriesPerPage?: number;
|
|
28
|
+
totalEntries?: number;
|
|
29
|
+
matchesPerPage?: number;
|
|
30
|
+
totalMatches?: number;
|
|
31
|
+
reportedTotalMatches?: number;
|
|
32
|
+
reachableTotalMatches?: number;
|
|
33
|
+
totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
|
|
34
|
+
totalMatchesCapped?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface SearchStats {
|
|
37
|
+
matchCount?: number;
|
|
38
|
+
matchedLines?: number;
|
|
39
|
+
filesMatched?: number;
|
|
40
|
+
filesSearched?: number;
|
|
41
|
+
bytesSearched?: number;
|
|
42
|
+
searchTime?: string;
|
|
43
|
+
}
|
|
44
|
+
export interface CacheStats {
|
|
45
|
+
hits: number;
|
|
46
|
+
misses: number;
|
|
47
|
+
sets: number;
|
|
48
|
+
totalKeys: number;
|
|
49
|
+
lastReset: Date;
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface CommandAvailabilityResult {
|
|
2
|
+
available: boolean;
|
|
3
|
+
command: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
error?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const REQUIRED_COMMANDS: {
|
|
8
|
+
readonly rg: {
|
|
9
|
+
readonly name: "ripgrep";
|
|
10
|
+
readonly versionFlag: "--version";
|
|
11
|
+
readonly tool: "localSearchCode";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type CommandName = keyof typeof REQUIRED_COMMANDS;
|
|
15
|
+
export declare function checkCommandAvailability(command: CommandName, forceCheck?: boolean): Promise<CommandAvailabilityResult>;
|
|
16
|
+
export declare function checkAllCommandsAvailability(): Promise<Map<CommandName, CommandAvailabilityResult>>;
|
|
17
|
+
export declare function getMissingCommandError(command: CommandName): string;
|
|
18
|
+
export declare function clearAvailabilityCache(): void;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare const ALLOWED_NPM_COMMANDS: readonly ["view", "search", "ping", "config", "whoami"];
|
|
2
|
+
type NpmCommand = (typeof ALLOWED_NPM_COMMANDS)[number];
|
|
3
|
+
type NpmExecOptions = {
|
|
4
|
+
timeout?: number;
|
|
5
|
+
cwd?: string;
|
|
6
|
+
env?: Record<string, string>;
|
|
7
|
+
};
|
|
8
|
+
interface NpmExecResult {
|
|
9
|
+
stdout: string;
|
|
10
|
+
stderr: string;
|
|
11
|
+
error?: Error;
|
|
12
|
+
exitCode?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare function checkNpmAvailability(timeoutMs?: number): Promise<boolean>;
|
|
15
|
+
export declare function executeNpmCommand(command: NpmCommand, args: string[], options?: NpmExecOptions): Promise<NpmExecResult>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface SpawnWithTimeoutOptions {
|
|
2
|
+
timeout?: number;
|
|
3
|
+
cwd?: string;
|
|
4
|
+
env?: Record<string, string | undefined>;
|
|
5
|
+
allowEnvVars?: readonly string[];
|
|
6
|
+
maxOutputSize?: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const SENSITIVE_ENV_VARS: readonly ["NODE_OPTIONS", "GITHUB_TOKEN", "GH_TOKEN", "OCTOCODE_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN", "NPM_TOKEN", "AWS_SECRET_ACCESS_KEY", "AWS_SESSION_TOKEN"];
|
|
9
|
+
export declare const CORE_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT"];
|
|
10
|
+
export declare const TOOLING_ALLOWED_ENV_VARS: readonly ["PATH", "TMPDIR", "TMP", "TEMP", "SYSTEMROOT", "WINDIR", "COMSPEC", "PATHEXT", "HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA"];
|
|
11
|
+
export declare const PROXY_ENV_VARS: readonly ["HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY", "http_proxy", "https_proxy", "no_proxy"];
|
|
12
|
+
export declare function buildChildProcessEnv(envOverrides?: Record<string, string | undefined>, allowEnvVars?: readonly string[]): typeof process.env;
|
|
13
|
+
interface SpawnResult {
|
|
14
|
+
stdout: string;
|
|
15
|
+
stderr: string;
|
|
16
|
+
exitCode: number | null;
|
|
17
|
+
success: boolean;
|
|
18
|
+
error?: Error;
|
|
19
|
+
timedOut?: boolean;
|
|
20
|
+
outputLimitExceeded?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function spawnWithTimeout(command: string, args: string[], options?: SpawnWithTimeoutOptions): Promise<SpawnResult>;
|
|
23
|
+
export declare function spawnCheckSuccess(command: string, args: string[], timeoutMs?: number, options?: {
|
|
24
|
+
allowEnvVars?: readonly string[];
|
|
25
|
+
}): Promise<boolean>;
|
|
26
|
+
export declare function spawnCollectStdout(command: string, args: string[], timeoutMs?: number, options?: {
|
|
27
|
+
allowEnvVars?: readonly string[];
|
|
28
|
+
maxOutputSize?: number;
|
|
29
|
+
}): Promise<string | null>;
|
|
30
|
+
export declare function validateArgs(args: string[], maxLength?: number): {
|
|
31
|
+
valid: boolean;
|
|
32
|
+
error?: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SliceContentOptions, type SliceContentResult } from '../contextUtils.js';
|
|
2
|
+
export declare function byteSlice(content: string, byteStart: number, byteEnd: number): string;
|
|
3
|
+
export declare function byteToCharIndex(content: string, byteOffset: number): number;
|
|
4
|
+
export declare function charToByteIndex(content: string, charIndex: number): number;
|
|
5
|
+
export declare function getByteLength(content: string): number;
|
|
6
|
+
export declare function convertByteMatchToChar(content: string, byteOffset: number, byteLength: number): {
|
|
7
|
+
charOffset: number;
|
|
8
|
+
charLength: number;
|
|
9
|
+
text: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function sliceContent(content: string, charOffset: number, charLength: number, options?: SliceContentOptions): SliceContentResult;
|
|
12
|
+
export type { SliceContentOptions, SliceContentResult };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const IGNORED_FOLDER_NAMES: string[];
|
|
2
|
+
export declare const IGNORED_FILE_NAMES: string[];
|
|
3
|
+
export declare const IGNORED_FILE_EXTENSIONS: string[];
|
|
4
|
+
export declare function shouldIgnoreDir(folderName: string): boolean;
|
|
5
|
+
export declare function shouldIgnoreFile(filePath: string): boolean;
|
|
6
|
+
interface GetExtensionOptions {
|
|
7
|
+
lowercase?: boolean;
|
|
8
|
+
fallback?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function getExtension(filePath: string, options?: GetExtensionOptions): string;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { BaseQueryLocal } from '@octocodeai/octocode-core/extra-types';
|
|
2
|
+
type PartialBaseQueryLocal = Partial<BaseQueryLocal>;
|
|
3
|
+
import { createErrorResult, type UnifiedErrorResult } from '../response/error.js';
|
|
4
|
+
type LocalErrorResult = UnifiedErrorResult;
|
|
5
|
+
export { createErrorResult };
|
|
6
|
+
type ToolPathValidationResult = {
|
|
7
|
+
isValid: false;
|
|
8
|
+
errorResult: LocalErrorResult;
|
|
9
|
+
sanitizedPath?: undefined;
|
|
10
|
+
} | {
|
|
11
|
+
isValid: true;
|
|
12
|
+
sanitizedPath: string;
|
|
13
|
+
errorResult?: undefined;
|
|
14
|
+
};
|
|
15
|
+
export declare function validateToolPath(query: PartialBaseQueryLocal & {
|
|
16
|
+
path?: string;
|
|
17
|
+
}, toolName: string): ToolPathValidationResult;
|
|
18
|
+
interface LargeOutputSafetyOptions {
|
|
19
|
+
threshold?: number;
|
|
20
|
+
itemType?: string;
|
|
21
|
+
detailed?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface LargeOutputSafetyResult {
|
|
24
|
+
shouldBlock: boolean;
|
|
25
|
+
errorCode?: string;
|
|
26
|
+
hints?: string[];
|
|
27
|
+
}
|
|
28
|
+
export declare function checkLargeOutputSafety(itemCount: number, hasCharLength: boolean, options?: LargeOutputSafetyOptions): LargeOutputSafetyResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CacheStats } from '../core/types.js';
|
|
2
|
+
export declare function generateCacheKey(prefix: string, params: unknown, sessionId?: string): string;
|
|
3
|
+
export declare function withDataCache<T>(cacheKey: string, operation: () => Promise<T>, options?: {
|
|
4
|
+
ttl?: number;
|
|
5
|
+
skipCache?: boolean;
|
|
6
|
+
forceRefresh?: boolean;
|
|
7
|
+
shouldCache?: (value: T) => boolean;
|
|
8
|
+
}): Promise<T>;
|
|
9
|
+
export declare function clearAllCache(): void;
|
|
10
|
+
export declare function clearLocalToolCache(): number;
|
|
11
|
+
export declare function clearLSPToolCache(): number;
|
|
12
|
+
export declare function clearRemoteAPICache(): number;
|
|
13
|
+
export declare function getCacheStats(): CacheStats & {
|
|
14
|
+
hitRate: number;
|
|
15
|
+
cacheSize: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface CircuitBreakerOptions {
|
|
2
|
+
failureThreshold?: number;
|
|
3
|
+
cooldownMs?: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const DEFAULT_CIRCUIT_FAILURE_THRESHOLD = 5;
|
|
6
|
+
export declare class CircuitOpenError extends Error {
|
|
7
|
+
readonly retryable = false;
|
|
8
|
+
readonly host: string;
|
|
9
|
+
readonly retryAfterMs: number;
|
|
10
|
+
constructor(host: string, retryAfterMs: number);
|
|
11
|
+
}
|
|
12
|
+
export declare function assertCircuitAvailable(url: string, now?: number): void;
|
|
13
|
+
export declare function recordCircuitSuccess(url: string): void;
|
|
14
|
+
export declare function recordCircuitFailure(url: string, now?: number): void;
|
|
15
|
+
export declare function resetCircuitBreaker(): void;
|
|
16
|
+
export declare function configureCircuitBreaker(options: CircuitBreakerOptions): void;
|
|
17
|
+
export declare function isCircuitOpen(url: string, now?: number): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface FetchWithRetriesOptions {
|
|
2
|
+
maxRetries?: number;
|
|
3
|
+
initialDelayMs?: number;
|
|
4
|
+
maxDelayMs?: number;
|
|
5
|
+
headers?: Record<string, string>;
|
|
6
|
+
method?: string;
|
|
7
|
+
includeVersion?: boolean;
|
|
8
|
+
signal?: AbortSignal;
|
|
9
|
+
rateLimitProvider?: string;
|
|
10
|
+
packageRegistry?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function fetchWithRetries(url: string, options?: FetchWithRetriesOptions): Promise<unknown>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { checkNpmDeprecation } from './npm.js';
|
|
2
|
+
import type { NpmSearchAPIResult, NpmSearchError, NpmSearchInput } from './types.js';
|
|
3
|
+
export type { DeprecationInfo, MinimalPackageResult, NpmPackageResult, PackageResult, NpmSearchAPIResult, NpmSearchError, NpmSearchInput, } from './types.js';
|
|
4
|
+
export declare function searchPackage(query: NpmSearchInput): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
5
|
+
export { checkNpmDeprecation };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NpmSearchAPIResult, NpmSearchError, DeprecationInfo } from './types.js';
|
|
2
|
+
export declare function getNpmRegistryUrl(): Promise<string>;
|
|
3
|
+
export declare function _resetNpmRegistryUrlCache(): void;
|
|
4
|
+
export declare function checkNpmRegistryReachable(): Promise<boolean>;
|
|
5
|
+
export declare function isExactPackageName(query: string): boolean;
|
|
6
|
+
export declare function _packageNameToSearchKeywords(packageName: string): string;
|
|
7
|
+
export declare function searchNpmPackage(packageName: string, limit: number, fetchMetadata: boolean, from?: number): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
8
|
+
export declare function checkNpmDeprecation(packageName: string): Promise<DeprecationInfo | null>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const NpmViewResultSchema: z.ZodObject<{
|
|
3
|
+
name: z.ZodString;
|
|
4
|
+
version: z.ZodString;
|
|
5
|
+
repository: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
6
|
+
url: z.ZodOptional<z.ZodString>;
|
|
7
|
+
type: z.ZodOptional<z.ZodString>;
|
|
8
|
+
directory: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, z.core.$strip>]>>;
|
|
10
|
+
main: z.ZodOptional<z.ZodString>;
|
|
11
|
+
module: z.ZodOptional<z.ZodString>;
|
|
12
|
+
type: z.ZodOptional<z.ZodString>;
|
|
13
|
+
exports: z.ZodOptional<z.ZodUnknown>;
|
|
14
|
+
types: z.ZodOptional<z.ZodString>;
|
|
15
|
+
typings: z.ZodOptional<z.ZodString>;
|
|
16
|
+
description: z.ZodOptional<z.ZodString>;
|
|
17
|
+
keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
18
|
+
license: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
19
|
+
type: z.ZodOptional<z.ZodString>;
|
|
20
|
+
}, z.core.$strip>]>>;
|
|
21
|
+
homepage: z.ZodOptional<z.ZodString>;
|
|
22
|
+
author: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
23
|
+
name: z.ZodOptional<z.ZodString>;
|
|
24
|
+
email: z.ZodOptional<z.ZodString>;
|
|
25
|
+
url: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, z.core.$strip>]>>;
|
|
27
|
+
maintainers: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
28
|
+
name: z.ZodOptional<z.ZodString>;
|
|
29
|
+
email: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>>>;
|
|
31
|
+
engines: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
32
|
+
dependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
33
|
+
devDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
34
|
+
peerDependencies: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
35
|
+
time: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodString>>>;
|
|
36
|
+
}, z.core.$loose>;
|
|
37
|
+
export declare const NpmRegistrySearchSchema: z.ZodObject<{
|
|
38
|
+
objects: z.ZodArray<z.ZodObject<{
|
|
39
|
+
package: z.ZodObject<{
|
|
40
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
41
|
+
version: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
42
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
43
|
+
links: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
44
|
+
npm: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
45
|
+
homepage: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
46
|
+
repository: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
47
|
+
}, z.core.$loose>>>;
|
|
48
|
+
}, z.core.$loose>;
|
|
49
|
+
score: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
50
|
+
final: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
51
|
+
detail: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
52
|
+
quality: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
53
|
+
popularity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
54
|
+
maintenance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
|
+
}, z.core.$loose>>>;
|
|
56
|
+
}, z.core.$loose>>>;
|
|
57
|
+
}, z.core.$loose>>;
|
|
58
|
+
total: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
59
|
+
}, z.core.$loose>;
|
|
60
|
+
export declare const NpmDeprecationOutputSchema: z.ZodUnion<readonly [z.ZodString, z.ZodBoolean, z.ZodNumber, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodUnknown>]>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface NpmSearchInput {
|
|
2
|
+
name: string;
|
|
3
|
+
itemsPerPage?: number;
|
|
4
|
+
page?: number;
|
|
5
|
+
mainResearchGoal?: string;
|
|
6
|
+
researchGoal?: string;
|
|
7
|
+
reasoning?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MinimalPackageResult {
|
|
10
|
+
name: string;
|
|
11
|
+
repository: string | null;
|
|
12
|
+
owner?: string;
|
|
13
|
+
repo?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface NpmPackageResult {
|
|
16
|
+
name: string;
|
|
17
|
+
npmUrl: string;
|
|
18
|
+
repoUrl: string | null;
|
|
19
|
+
path?: string;
|
|
20
|
+
version: string;
|
|
21
|
+
source?: 'cli' | 'registry' | 'cdn' | 'web';
|
|
22
|
+
mainEntry?: string | null;
|
|
23
|
+
moduleEntry?: string | null;
|
|
24
|
+
typeDefinitions?: string | null;
|
|
25
|
+
packageType?: 'module' | 'commonjs' | 'types-only' | 'unknown';
|
|
26
|
+
exports?: string[];
|
|
27
|
+
bin?: string[];
|
|
28
|
+
repositoryDirectory?: string;
|
|
29
|
+
lastPublished?: string;
|
|
30
|
+
owner?: string;
|
|
31
|
+
repo?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
license?: string;
|
|
34
|
+
weeklyDownloads?: number;
|
|
35
|
+
keywords?: string[];
|
|
36
|
+
homepage?: string;
|
|
37
|
+
author?: string;
|
|
38
|
+
engines?: Record<string, string>;
|
|
39
|
+
dependencies?: Record<string, string>;
|
|
40
|
+
peerDependencies?: Record<string, string>;
|
|
41
|
+
}
|
|
42
|
+
export type PackageResult = MinimalPackageResult | NpmPackageResult;
|
|
43
|
+
export interface NpmSearchAPIResult {
|
|
44
|
+
packages: PackageResult[];
|
|
45
|
+
totalFound: number;
|
|
46
|
+
rawResponseChars?: number;
|
|
47
|
+
}
|
|
48
|
+
export interface NpmSearchError {
|
|
49
|
+
error: string;
|
|
50
|
+
hints?: string[];
|
|
51
|
+
}
|
|
52
|
+
export interface DeprecationInfo {
|
|
53
|
+
deprecated: boolean;
|
|
54
|
+
message?: string;
|
|
55
|
+
}
|