@octocodeai/octocode-tools-core 16.6.2 → 17.0.1
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 +29 -55
- package/dist/direct.js +34 -36
- package/dist/github/botFilter.d.ts +1 -0
- package/dist/github/client.d.ts +6 -0
- package/dist/github/directoryFetch/fetchDirectoryContents.d.ts +3 -0
- package/dist/github/directoryFetch/fetchFileContentToDisk.d.ts +3 -0
- package/dist/github/directoryFetch/helpers.d.ts +35 -0
- package/dist/github/directoryFetch.d.ts +3 -6
- package/dist/github/fileContentPagination.d.ts +9 -0
- package/dist/github/fileContentProcess.d.ts +1 -8
- package/dist/github/fileContentRaw/fetch.d.ts +20 -0
- package/dist/github/fileContentRaw/pathSuggestions.d.ts +3 -0
- package/dist/github/fileContentRaw.d.ts +2 -12
- package/dist/github/githubAPI.d.ts +4 -1
- package/dist/github/history.d.ts +6 -2
- package/dist/github/issues/fetchers.d.ts +7 -0
- package/dist/github/issues/helpers.d.ts +32 -0
- package/dist/github/issues/orchestrator.d.ts +4 -0
- package/dist/github/issues/types.d.ts +72 -0
- package/dist/github/issues.d.ts +3 -0
- package/dist/github/prContentFetcher/comments.d.ts +11 -0
- package/dist/github/prContentFetcher/commits.d.ts +27 -0
- package/dist/github/prContentFetcher/flags.d.ts +21 -0
- package/dist/github/prContentFetcher/transform.d.ts +5 -0
- package/dist/github/prContentFetcher.d.ts +2 -5
- package/dist/github/pullRequestSearch/restSearch.d.ts +6 -0
- package/dist/github/pullRequestSearch.d.ts +1 -0
- package/dist/github/queryBuilders/base.d.ts +25 -0
- package/dist/github/queryBuilders/codeAndRepo.d.ts +20 -0
- package/dist/github/queryBuilders/issues.d.ts +42 -0
- package/dist/github/queryBuilders/pullRequests.d.ts +13 -0
- package/dist/github/queryBuilders.d.ts +4 -12
- package/dist/github/releases.d.ts +37 -0
- package/dist/github/repoStructure/contentResolution.d.ts +12 -0
- package/dist/github/repoStructure/fetchOrchestration.d.ts +7 -0
- package/dist/github/repoStructure/resultBuilder.d.ts +22 -0
- package/dist/github/repoStructure.d.ts +1 -7
- package/dist/github/repoStructureTree.d.ts +38 -0
- package/dist/github/responseHeaders.d.ts +2 -0
- package/dist/github/searchKeyword.d.ts +2 -0
- package/dist/index.d.ts +6 -7
- package/dist/index.js +36 -45
- package/dist/oql/adapters/github/execute.d.ts +16 -0
- package/dist/oql/adapters/github/provider-diagnostics.d.ts +14 -0
- package/dist/oql/adapters/github/shared.d.ts +75 -0
- package/dist/oql/adapters/github.d.ts +11 -0
- package/dist/oql/adapters/graphProof.d.ts +6 -0
- package/dist/oql/adapters/graphView/filters.d.ts +25 -0
- package/dist/oql/adapters/graphView/nativeEdges.d.ts +5 -0
- package/dist/oql/adapters/graphView.d.ts +29 -0
- package/dist/oql/adapters/local/code.d.ts +3 -0
- package/dist/oql/adapters/local/codeBoolean.d.ts +3 -0
- package/dist/oql/adapters/local/fileRowOps.d.ts +11 -0
- package/dist/oql/adapters/local/files.d.ts +3 -0
- package/dist/oql/adapters/local/filesBoolean.d.ts +10 -0
- package/dist/oql/adapters/local/filesContentLeaf.d.ts +12 -0
- package/dist/oql/adapters/local/filesUniverse.d.ts +6 -0
- package/dist/oql/adapters/local/findToolType.d.ts +10 -0
- package/dist/oql/adapters/local/predicates.d.ts +18 -0
- package/dist/oql/adapters/local/scope.d.ts +14 -0
- package/dist/oql/adapters/local/searchToolType.d.ts +7 -0
- package/dist/oql/adapters/local/structureContent.d.ts +6 -0
- package/dist/oql/adapters/local/types.d.ts +34 -0
- package/dist/oql/adapters/local.d.ts +3 -7
- package/dist/oql/adapters/researchTargets/diff.d.ts +16 -0
- package/dist/oql/adapters/researchTargets/graph.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/history.d.ts +20 -0
- package/dist/oql/adapters/researchTargets/pagination.d.ts +54 -0
- package/dist/oql/adapters/researchTargets/repositories.d.ts +4 -0
- package/dist/oql/adapters/researchTargets/research.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/rows.d.ts +16 -0
- package/dist/oql/adapters/researchTargets/semantics.d.ts +3 -0
- package/dist/oql/adapters/researchTargets/shared.d.ts +11 -0
- package/dist/oql/adapters/researchTargets.d.ts +4 -46
- package/dist/oql/adapters/resultMap.d.ts +7 -0
- package/dist/oql/adapters/runner.d.ts +7 -0
- package/dist/oql/defaults.d.ts +1 -1
- package/dist/oql/index.js +35 -37
- package/dist/oql/normalize/batch.d.ts +2 -0
- package/dist/oql/normalize/materialize.d.ts +2 -0
- package/dist/oql/normalize/params.d.ts +2 -0
- package/dist/oql/normalize/query.d.ts +2 -0
- package/dist/oql/normalize/scope.d.ts +2 -0
- package/dist/oql/normalize/shared.d.ts +7 -0
- package/dist/oql/normalize/source.d.ts +2 -0
- package/dist/oql/normalize/where.d.ts +2 -0
- package/dist/oql/normalize.d.ts +19 -4
- package/dist/oql/planner/planDiagnostics.d.ts +13 -0
- package/dist/oql/planner/predicateRouting.d.ts +35 -0
- package/dist/oql/predicateUtils.d.ts +3 -0
- package/dist/oql/research/analyze/manifest-scan.d.ts +4 -0
- package/dist/oql/research/analyze/source-graph.d.ts +7 -0
- package/dist/oql/research/analyze/symbol-scoring.d.ts +4 -0
- package/dist/oql/research/analyze/types.d.ts +163 -0
- package/dist/oql/research/analyze/utils.d.ts +16 -0
- package/dist/oql/research/analyze.d.ts +2 -133
- package/dist/oql/research/packets/builders.d.ts +4 -0
- package/dist/oql/research/packets/types.d.ts +91 -0
- package/dist/oql/research/packets.d.ts +21 -80
- package/dist/oql/run/batch.d.ts +3 -0
- package/dist/oql/run/continuations/records.d.ts +19 -0
- package/dist/oql/run/continuations/registry.d.ts +22 -0
- package/dist/oql/run/continuations/semantics.d.ts +3 -0
- package/dist/oql/run/continuations/types.d.ts +12 -0
- package/dist/oql/run/dryRun.d.ts +11 -0
- package/dist/oql/run/paths.d.ts +15 -0
- package/dist/oql/run/proofGrades.d.ts +8 -0
- package/dist/oql/run/select.d.ts +10 -0
- package/dist/oql/run/single.d.ts +22 -0
- package/dist/oql/run.d.ts +4 -31
- package/dist/oql/schema/predicates.d.ts +12 -0
- package/dist/oql/schema.d.ts +74 -43
- package/dist/oql/schemeText.d.ts +21 -23
- package/dist/oql/shorthand/predicates.d.ts +15 -0
- package/dist/oql/shorthand/query-controls.d.ts +18 -0
- package/dist/oql/shorthand/target-params.d.ts +9 -0
- package/dist/oql/shorthand/types.d.ts +159 -0
- package/dist/oql/shorthand/utils.d.ts +7 -0
- package/dist/oql/shorthand.d.ts +2 -171
- package/dist/oql/targetParams.d.ts +0 -13
- package/dist/oql/transformers/github/code.d.ts +1 -9
- package/dist/oql/transformers/github/common.d.ts +7 -1
- package/dist/oql/types/diagnostics.d.ts +22 -0
- package/dist/oql/types/envelope.d.ts +78 -0
- package/dist/oql/types/guards.d.ts +9 -0
- package/dist/oql/types/planner.d.ts +46 -0
- package/dist/oql/types/predicates.d.ts +93 -0
- package/dist/oql/types/query.d.ts +143 -0
- package/dist/oql/types/recordData.d.ts +127 -0
- package/dist/oql/types/recordRows.d.ts +48 -0
- package/dist/oql/types/results.d.ts +118 -0
- package/dist/oql/types/targets.d.ts +22 -0
- package/dist/oql/types.d.ts +17 -630
- package/dist/providers/github/paginationMetadata.d.ts +12 -0
- package/dist/providers/providerResults.d.ts +0 -1
- package/dist/responses.d.ts +4 -35
- package/dist/schema.js +2 -2
- package/dist/scheme/pagination.d.ts +116 -0
- package/dist/scheme/responseEnvelope.d.ts +67 -1
- package/dist/shared/config/index.d.ts +1 -8
- package/dist/shared/config/index.js +1 -2
- package/dist/shared/credentials/index.d.ts +1 -1
- package/dist/shared/credentials/index.js +2 -1
- package/dist/shared/credentials/storage.d.ts +0 -2
- package/dist/shared/credentials/testing.js +1 -1
- package/dist/shared/languageSelectors/classify.d.ts +15 -0
- package/dist/shared/languageSelectors/data.d.ts +12 -0
- package/dist/shared/languageSelectors.d.ts +3 -23
- package/dist/shared/paths.d.ts +4 -4
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -1
- package/dist/shared/session/statsDefaults.d.ts +1 -2
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +68 -0
- package/dist/tools/directToolCatalog/toolCommandPatternQueries.d.ts +4 -0
- package/dist/tools/directToolCatalog/toolCommandPatterns.d.ts +4 -0
- package/dist/tools/directToolCatalog/toolInputPreparation.d.ts +12 -0
- package/dist/tools/directToolCatalog/toolSchemaIntrospection.d.ts +19 -0
- package/dist/tools/directToolCatalog.exec.d.ts +5 -0
- package/dist/tools/directToolCatalog.meta.d.ts +10 -67
- package/dist/tools/github_clone_repo/cache.d.ts +1 -5
- package/dist/tools/github_clone_repo/cachePaths.d.ts +5 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +0 -1
- package/dist/tools/github_fetch_content/finalizer/entryParsers.d.ts +9 -0
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +101 -0
- package/dist/tools/github_fetch_content/finalizer.d.ts +1 -7
- package/dist/tools/github_fetch_content/scheme.d.ts +43 -9
- package/dist/tools/github_fetch_content/types.d.ts +1 -2
- package/dist/tools/github_search_code/execution.d.ts +9 -0
- package/dist/tools/github_search_code/finalizer/build.d.ts +4 -0
- package/dist/tools/github_search_code/finalizer/groups.d.ts +23 -0
- package/dist/tools/github_search_code/finalizer/ranking.d.ts +12 -0
- package/dist/tools/github_search_code/finalizer.d.ts +2 -6
- package/dist/tools/github_search_code/scheme.d.ts +31 -6
- package/dist/tools/github_search_pull_requests/contentResponse/commentsShaping.d.ts +68 -0
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +52 -0
- package/dist/tools/github_search_pull_requests/contentResponse/nextCalls.d.ts +17 -0
- package/dist/tools/github_search_pull_requests/contentResponse/pagination.d.ts +63 -0
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +1 -15
- package/dist/tools/github_search_pull_requests/execution/commitsMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/issuesMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/pullRequestsMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/releasesMode.d.ts +4 -0
- package/dist/tools/github_search_pull_requests/execution/types.d.ts +6 -0
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -4
- package/dist/tools/github_search_pull_requests/scheme.d.ts +11 -2
- package/dist/tools/github_search_repos/execution/pagination.d.ts +39 -0
- package/dist/tools/github_search_repos/execution/queryVariants.d.ts +38 -0
- package/dist/tools/github_search_repos/execution/ranking.d.ts +4 -0
- package/dist/tools/github_search_repos/execution.d.ts +3 -13
- package/dist/tools/github_search_repos/scheme.d.ts +7 -2
- package/dist/tools/github_view_repo_structure/scheme.d.ts +0 -1
- package/dist/tools/github_view_repo_structure/types.d.ts +2 -0
- package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +15 -0
- package/dist/tools/local_fetch_content/fetchContent/pagination.d.ts +38 -0
- package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +26 -0
- package/dist/tools/local_fetch_content/fetchContent.d.ts +2 -0
- package/dist/tools/local_fetch_content/scheme.d.ts +90 -0
- package/dist/tools/local_find_files/scheme.d.ts +81 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +70 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +47 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingScoring.d.ts +41 -0
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +16 -95
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/buildResult.d.ts +10 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +46 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +2 -18
- package/dist/tools/local_ripgrep/scheme.d.ts +170 -0
- package/dist/tools/local_view_structure/scheme.d.ts +83 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +56 -8
- package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +7 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/callEnvelopes.d.ts +5 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/envelopeHelpers.d.ts +20 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +13 -0
- package/dist/tools/lsp/semantic_content/semanticEnvelopes.d.ts +3 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +24 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/documentSymbols.d.ts +27 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps/workspaceSymbolsAndDiagnostics.d.ts +20 -0
- package/dist/tools/lsp/semantic_content/semanticFileOps.d.ts +8 -0
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +53 -0
- package/dist/tools/lsp/shared/readiness.d.ts +17 -0
- package/dist/tools/lsp/shared/semanticTypes.d.ts +6 -0
- package/dist/tools/package_search/execution.d.ts +8 -0
- package/dist/tools/package_search/scheme.d.ts +45 -6
- package/dist/tools/providerMappers/codeSearch.d.ts +66 -0
- package/dist/tools/providerMappers/fileContent.d.ts +28 -0
- package/dist/tools/providerMappers/pullRequests.d.ts +158 -0
- package/dist/tools/providerMappers/repoSearch.d.ts +30 -0
- package/dist/tools/providerMappers/repoStructure.d.ts +20 -0
- package/dist/tools/providerMappers/shared.d.ts +23 -0
- package/dist/tools/providerMappers.d.ts +9 -294
- package/dist/tools/toolConfig.d.ts +0 -2
- package/dist/tools/toolMetadata/descriptionOverrides.d.ts +4 -0
- package/dist/tools/toolNames.d.ts +1 -0
- package/dist/tools/toolSchemaImports.d.ts +13 -0
- package/dist/utils/contextUtils.d.ts +5 -16
- package/dist/utils/core/types.d.ts +2 -24
- package/dist/utils/exec/spawn/env.d.ts +5 -0
- package/dist/utils/exec/spawn/wrappers.d.ts +29 -0
- package/dist/utils/exec/spawn.d.ts +2 -34
- package/dist/utils/http/cache/conditional.d.ts +21 -0
- package/dist/utils/http/cache/dataCache.d.ts +6 -0
- package/dist/utils/http/cache/key.d.ts +1 -0
- package/dist/utils/http/cache/management.d.ts +9 -0
- package/dist/utils/http/cache/store.d.ts +28 -0
- package/dist/utils/http/cache.d.ts +4 -16
- package/dist/utils/markdownOutline.d.ts +0 -2
- package/dist/utils/package/npm/npmDeprecation.d.ts +5 -0
- package/dist/utils/package/npm/npmDetailsFetchers.d.ts +15 -0
- package/dist/utils/package/npm/npmMappers.d.ts +12 -0
- package/dist/utils/package/npm/npmRegistry.d.ts +79 -0
- package/dist/utils/package/npm/npmSearchStrategies.d.ts +6 -0
- package/dist/utils/package/npm.d.ts +2 -8
- package/dist/utils/pagination/boundary.d.ts +5 -5
- package/dist/utils/response/bulk/pagination.d.ts +6 -0
- package/dist/utils/response/bulk/queries.d.ts +19 -0
- package/dist/utils/response/bulk/response.d.ts +4 -0
- package/dist/utils/response/bulk.d.ts +2 -5
- package/dist/utils/response/groupedFinalizer.d.ts +7 -2
- package/package.json +10 -3
- package/dist/oql/adapters/v2.d.ts +0 -32
- package/dist/oql/v2params.d.ts +0 -22
- package/dist/shared/config/defaults.d.ts +0 -14
- package/dist/shared/config/loader.d.ts +0 -7
- package/dist/shared/config/resolver.d.ts +0 -2
- package/dist/shared/config/resolverCache.d.ts +0 -12
- package/dist/shared/config/resolverSections.d.ts +0 -10
- package/dist/shared/config/runtimeSurface.d.ts +0 -22
- package/dist/shared/config/types.d.ts +0 -92
- package/dist/shared/config/validator.d.ts +0 -2
- package/dist/shared/credentials/envTokens.d.ts +0 -9
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +0 -24
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +0 -86
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +0 -27
- package/dist/tools/local_binary_inspect/decompressOps.d.ts +0 -16
- package/dist/tools/local_binary_inspect/execution.d.ts +0 -4
- package/dist/tools/local_binary_inspect/scheme.d.ts +0 -47
- package/dist/tools/local_ripgrep/lspBoost.d.ts +0 -54
- package/dist/utils/parsers/ripgrep.d.ts +0 -11
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const DEFAULT_NPM_REGISTRY = "https://registry.npmjs.org";
|
|
2
|
+
export declare function getNpmRegistryUrl(): Promise<string>;
|
|
3
|
+
export declare function _resetNpmRegistryUrlCache(): void;
|
|
4
|
+
export declare function checkNpmRegistryReachable(): Promise<boolean>;
|
|
5
|
+
export interface NpmViewResult {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
repository?: string | {
|
|
9
|
+
url?: string;
|
|
10
|
+
type?: string;
|
|
11
|
+
directory?: string;
|
|
12
|
+
};
|
|
13
|
+
main?: string;
|
|
14
|
+
module?: string;
|
|
15
|
+
type?: string;
|
|
16
|
+
exports?: unknown;
|
|
17
|
+
bin?: unknown;
|
|
18
|
+
types?: string;
|
|
19
|
+
typings?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
keywords?: string[];
|
|
22
|
+
license?: string | {
|
|
23
|
+
type?: string;
|
|
24
|
+
};
|
|
25
|
+
homepage?: string;
|
|
26
|
+
author?: string | {
|
|
27
|
+
name?: string;
|
|
28
|
+
email?: string;
|
|
29
|
+
url?: string;
|
|
30
|
+
};
|
|
31
|
+
maintainers?: Array<{
|
|
32
|
+
name?: string;
|
|
33
|
+
email?: string;
|
|
34
|
+
}>;
|
|
35
|
+
engines?: Record<string, string>;
|
|
36
|
+
dependencies?: Record<string, string>;
|
|
37
|
+
devDependencies?: Record<string, string>;
|
|
38
|
+
peerDependencies?: Record<string, string>;
|
|
39
|
+
time?: {
|
|
40
|
+
modified?: string;
|
|
41
|
+
created?: string;
|
|
42
|
+
[version: string]: string | undefined;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export interface NpmRegistrySearchItem {
|
|
46
|
+
name: string | null | undefined;
|
|
47
|
+
version: string | null | undefined;
|
|
48
|
+
description?: string | null;
|
|
49
|
+
links?: {
|
|
50
|
+
npm?: string | null;
|
|
51
|
+
homepage?: string | null;
|
|
52
|
+
repository?: string | null;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export interface NpmCliSearchItem {
|
|
56
|
+
name?: string;
|
|
57
|
+
version?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
keywords?: string[];
|
|
60
|
+
date?: string;
|
|
61
|
+
links?: {
|
|
62
|
+
npm?: string;
|
|
63
|
+
homepage?: string;
|
|
64
|
+
repository?: string;
|
|
65
|
+
bugs?: string;
|
|
66
|
+
};
|
|
67
|
+
repository?: string | {
|
|
68
|
+
url?: string;
|
|
69
|
+
type?: string;
|
|
70
|
+
};
|
|
71
|
+
score?: {
|
|
72
|
+
final?: number;
|
|
73
|
+
detail?: {
|
|
74
|
+
quality?: number;
|
|
75
|
+
popularity?: number;
|
|
76
|
+
maintenance?: number;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { NpmSearchAPIResult, NpmSearchError } from '../types.js';
|
|
2
|
+
export declare function searchNpmPackageViaCliSearch(keywords: string, limit: number, fetchMetadata: boolean, from?: number): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
3
|
+
export declare function searchNpmPackageViaRegistrySearch(keywords: string, limit: number, fetchMetadata: boolean, from?: number): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
4
|
+
export declare function searchNpmPackageViaWebSearch(packageName: string, limit: number): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
5
|
+
export declare function searchNpmPackageViaSearch(keywords: string, limit: number, fetchMetadata: boolean, from?: number): Promise<NpmSearchAPIResult | NpmSearchError>;
|
|
6
|
+
export declare function enrichTopSearchResult(result: NpmSearchAPIResult): Promise<NpmSearchAPIResult>;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
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>;
|
|
1
|
+
export { getNpmRegistryUrl, _resetNpmRegistryUrlCache, checkNpmRegistryReachable, } from './npm/npmRegistry.js';
|
|
2
|
+
export { isExactPackageName, _packageNameToSearchKeywords, searchNpmPackage, checkNpmDeprecation, } from './npm/npmDeprecation.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
export declare function isMidBlockCut(paginatedContent: string): boolean;
|
|
2
|
-
export declare function findNextBlockBoundary(content: string, fromChar: number, filePath?: string): number | undefined
|
|
3
|
-
export declare function buildBlockBoundaryHint(paginatedContent: string, fullContent: string, cutPos: number, currentCharLength: number, filePath?: string): {
|
|
2
|
+
export declare function findNextBlockBoundary(content: string, fromChar: number, filePath?: string): Promise<number | undefined>;
|
|
3
|
+
export declare function buildBlockBoundaryHint(paginatedContent: string, fullContent: string, cutPos: number, currentCharLength: number, filePath?: string): Promise<{
|
|
4
4
|
nextBlockChar: number;
|
|
5
5
|
hint: string;
|
|
6
|
-
} | undefined
|
|
6
|
+
} | undefined>;
|
|
7
7
|
export type ChunkMode = 'semantic' | 'char-limit';
|
|
8
|
-
export declare function snapToSemanticBoundary(content: string, charOffset: number, charLength: number, filePath?: string): {
|
|
8
|
+
export declare function snapToSemanticBoundary(content: string, charOffset: number, charLength: number, filePath?: string): Promise<{
|
|
9
9
|
length: number;
|
|
10
10
|
chunkMode: ChunkMode;
|
|
11
|
-
}
|
|
11
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BulkToolResponse, BulkResponsePagination } from '../../../types/bulk.js';
|
|
2
|
+
export declare function paginateBulkText(text: string, pagination?: BulkResponsePagination): {
|
|
3
|
+
text: string;
|
|
4
|
+
pagination?: NonNullable<BulkToolResponse['responsePagination']>;
|
|
5
|
+
};
|
|
6
|
+
export declare function appendResponsePagination<T extends Record<string, unknown>>(structuredContent: T, pagination?: NonNullable<BulkToolResponse['responsePagination']>): T;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ProcessedBulkResult, QueryError } from '../../../types/toolResults.js';
|
|
2
|
+
export declare function computeQueryTimeout(queryCount: number, concurrency: number, minTimeoutMs?: number): number;
|
|
3
|
+
export declare function processBulkQueries<TQuery extends object>(queries: Array<TQuery>, processor: (query: TQuery, index: number) => Promise<ProcessedBulkResult>, concurrency: number, minQueryTimeoutMs?: number): Promise<{
|
|
4
|
+
results: Array<{
|
|
5
|
+
result: ProcessedBulkResult;
|
|
6
|
+
queryIndex: number;
|
|
7
|
+
originalQuery: TQuery;
|
|
8
|
+
}>;
|
|
9
|
+
errors: QueryError[];
|
|
10
|
+
}>;
|
|
11
|
+
export declare function resolveQueryId<TQuery extends object>(originalQuery: TQuery, queryIndex: number): string;
|
|
12
|
+
/**
|
|
13
|
+
* Resolve one id per query, guaranteed unique within the batch. Everything
|
|
14
|
+
* downstream (finalizer grouping, per-query pagination maps) keys off these
|
|
15
|
+
* ids, so two queries submitted with the same explicit `id` would otherwise
|
|
16
|
+
* silently merge and the second query's pagination would overwrite the first.
|
|
17
|
+
* Collisions get a `#2`, `#3`… suffix in submission order.
|
|
18
|
+
*/
|
|
19
|
+
export declare function resolveUniqueQueryIds<TQuery extends object>(queries: readonly TQuery[]): string[];
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CallToolResult } from '@modelcontextprotocol/sdk/types';
|
|
2
|
+
import type { ProcessedBulkResult } from '../../../types/toolResults.js';
|
|
3
|
+
import type { BulkResponseConfig, BulkResponsePagination } from '../../../types/bulk.js';
|
|
4
|
+
export declare function executeBulkOperation<TQuery extends object, TOutput extends Record<string, unknown> = Record<string, unknown>>(queries: Array<TQuery>, processor: (query: TQuery, index: number) => Promise<ProcessedBulkResult>, config: BulkResponseConfig<TQuery, TOutput>, pagination?: BulkResponsePagination): Promise<CallToolResult>;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { BulkResponseConfig, BulkResponsePagination } from '../../types/bulk.js';
|
|
4
|
-
export declare function computeQueryTimeout(queryCount: number, concurrency: number, minTimeoutMs?: number): number;
|
|
5
|
-
export declare function executeBulkOperation<TQuery extends object, TOutput extends Record<string, unknown> = Record<string, unknown>>(queries: Array<TQuery>, processor: (query: TQuery, index: number) => Promise<ProcessedBulkResult>, config: BulkResponseConfig<TQuery, TOutput>, pagination?: BulkResponsePagination): Promise<CallToolResult>;
|
|
1
|
+
export { computeQueryTimeout, resolveQueryId, resolveUniqueQueryIds, } from './bulk/queries.js';
|
|
2
|
+
export { executeBulkOperation } from './bulk/response.js';
|
|
@@ -5,8 +5,13 @@ export type QueryWithPagination = {
|
|
|
5
5
|
charLength?: unknown;
|
|
6
6
|
charOffset?: unknown;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type FlatErrorEntry = {
|
|
9
9
|
id: string;
|
|
10
10
|
error: string;
|
|
11
|
-
|
|
11
|
+
status?: number;
|
|
12
|
+
retryAfterSeconds?: number;
|
|
13
|
+
rateLimitRemaining?: number;
|
|
14
|
+
rateLimitReset?: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function collectFlatErrors(results: readonly FlatQueryResult[]): FlatErrorEntry[];
|
|
12
17
|
export declare function formatFinalizedResponse<T extends Record<string, unknown>>(responseData: T, keysPriority: readonly string[], isError?: boolean): BulkFinalizerOutput<T>;
|
package/package.json
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/octocode-tools-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "17.0.1",
|
|
4
4
|
"description": "Core tool implementations for Octocode: GitHub, local filesystem, LSP, and package search tools.",
|
|
5
5
|
"author": "Guy Bary <bgauryy@octocodeai.com>",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/bgauryy/octocode.git",
|
|
9
|
+
"directory": "packages/octocode-tools-core"
|
|
10
|
+
},
|
|
11
|
+
"bugs": "https://github.com/bgauryy/octocode/issues",
|
|
6
12
|
"license": "MIT",
|
|
7
13
|
"type": "module",
|
|
8
14
|
"publishConfig": {
|
|
@@ -83,8 +89,9 @@
|
|
|
83
89
|
},
|
|
84
90
|
"dependencies": {
|
|
85
91
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
86
|
-
"@octocodeai/
|
|
87
|
-
"@octocodeai/octocode-
|
|
92
|
+
"@octocodeai/config": "^17.0.1",
|
|
93
|
+
"@octocodeai/octocode-core": "^16.6.3",
|
|
94
|
+
"@octocodeai/octocode-engine": "^17.0.1",
|
|
88
95
|
"@octokit/oauth-methods": "^6.0.2",
|
|
89
96
|
"@octokit/plugin-throttling": "^11.0.3",
|
|
90
97
|
"@octokit/request": "^10.0.10",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { AdapterResult } from './local.js';
|
|
2
|
-
import type { OqlQuery } from '../types.js';
|
|
3
|
-
export declare function executeRepositories(query: OqlQuery): Promise<AdapterResult>;
|
|
4
|
-
export declare function executePackages(query: OqlQuery): Promise<AdapterResult>;
|
|
5
|
-
export declare function executeHistory(query: OqlQuery): Promise<AdapterResult>;
|
|
6
|
-
/**
|
|
7
|
-
* `target:"diff"` has two typed lanes, discriminated by params shape:
|
|
8
|
-
* - PR patch: { prNumber, files? } -> ghHistoryResearch patches
|
|
9
|
-
* - direct file: { baseRef, headRef, path } -> two ghGetFileContent reads
|
|
10
|
-
* + a pure local line diff
|
|
11
|
-
* A request that fits neither returns a repair diagnostic rather than silently
|
|
12
|
-
* falling through to a PR-patch call (see OCTOCODE_SEARCH_PARITY_CHECKLIST.md gap log #8).
|
|
13
|
-
*/
|
|
14
|
-
export declare function executeDiff(query: OqlQuery): Promise<AdapterResult>;
|
|
15
|
-
export interface LineDiff {
|
|
16
|
-
additions: number;
|
|
17
|
-
deletions: number;
|
|
18
|
-
unchanged: number;
|
|
19
|
-
/** Unified-style patch text (`+`/`-`/` ` line prefixes). */
|
|
20
|
-
patch: string;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Minimal LCS-based line diff between two file bodies. Pure and dependency-free
|
|
24
|
-
* so it is unit-testable without any backend. Not a byte-perfect git patch —
|
|
25
|
-
* a line-granular additions/deletions view for direct two-ref comparison.
|
|
26
|
-
*/
|
|
27
|
-
export declare function computeLineDiff(baseText: string, headText: string): LineDiff;
|
|
28
|
-
export declare function executeArtifacts(query: OqlQuery): Promise<AdapterResult>;
|
|
29
|
-
export declare function executeSemantics(query: OqlQuery): Promise<AdapterResult>;
|
|
30
|
-
export declare function executeResearch(query: OqlQuery): Promise<AdapterResult>;
|
|
31
|
-
/** Dispatch map: V2 target -> adapter. */
|
|
32
|
-
export declare const V2_ADAPTERS: Record<string, (q: OqlQuery) => Promise<AdapterResult>>;
|
package/dist/oql/v2params.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Typed V2-target `params` schemas.
|
|
3
|
-
*
|
|
4
|
-
* V2 research targets (semantics/repositories/packages/pullRequests/commits/
|
|
5
|
-
* artifacts/diff/research) carry a `params` bag that the backing tool validates
|
|
6
|
-
* exhaustively. These schemas type the *documented, commonly-used* fields so a
|
|
7
|
-
* type mistake (e.g. `prNumber:"abc"`) is caught at the OQL layer with a clear
|
|
8
|
-
* `invalidQuery` instead of failing opaquely at the tool — while `.passthrough()`
|
|
9
|
-
* keeps the backing tool the exhaustive source of truth for the rest.
|
|
10
|
-
*
|
|
11
|
-
* This is the typed-contract layer for OCTOCODE_SEARCH_PARITY_CHECKLIST gap #3.
|
|
12
|
-
*/
|
|
13
|
-
import { z } from 'zod';
|
|
14
|
-
import type { OqlActiveTarget } from './types.js';
|
|
15
|
-
/** Per-target params schema; targets without a `params` bag are absent. */
|
|
16
|
-
export declare const V2_PARAM_SCHEMAS: Partial<Record<OqlActiveTarget, z.ZodTypeAny>>;
|
|
17
|
-
/**
|
|
18
|
-
* Validate a target's `params` bag against its typed schema. Returns `null` when
|
|
19
|
-
* valid (or no schema applies), or a Zod-style error message string the caller
|
|
20
|
-
* raises as `invalidQuery`.
|
|
21
|
-
*/
|
|
22
|
-
export declare function validateV2Params(target: OqlActiveTarget, params: unknown): string | null;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { RequiredGitHubConfig, RequiredLocalConfig, RequiredToolsConfig, RequiredNetworkConfig, RequiredLspConfig, RequiredOutputConfig, ResolvedConfig } from './types.js';
|
|
2
|
-
export declare const DEFAULT_GITHUB_CONFIG: RequiredGitHubConfig;
|
|
3
|
-
export declare const DEFAULT_LOCAL_CONFIG: RequiredLocalConfig;
|
|
4
|
-
export declare const DEFAULT_TOOLS_CONFIG: RequiredToolsConfig;
|
|
5
|
-
export declare const DEFAULT_NETWORK_CONFIG: RequiredNetworkConfig;
|
|
6
|
-
export declare const DEFAULT_LSP_CONFIG: RequiredLspConfig;
|
|
7
|
-
export declare const DEFAULT_OUTPUT_CONFIG: RequiredOutputConfig;
|
|
8
|
-
export declare const DEFAULT_CONFIG: Omit<ResolvedConfig, 'source' | 'configPath'>;
|
|
9
|
-
export declare const MIN_TIMEOUT = 5000;
|
|
10
|
-
export declare const MAX_TIMEOUT = 300000;
|
|
11
|
-
export declare const MIN_RETRIES = 0;
|
|
12
|
-
export declare const MAX_RETRIES = 10;
|
|
13
|
-
export declare const MIN_OUTPUT_DEFAULT_CHAR_LENGTH = 1000;
|
|
14
|
-
export declare const MAX_OUTPUT_DEFAULT_CHAR_LENGTH = 50000;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LoadConfigResult } from './types.js';
|
|
2
|
-
export declare const CONFIG_FILE_PATH: string;
|
|
3
|
-
export declare function configExists(): boolean;
|
|
4
|
-
export declare function loadConfig(): Promise<LoadConfigResult>;
|
|
5
|
-
export declare function loadConfigSync(): LoadConfigResult;
|
|
6
|
-
export declare function getConfigPath(): string;
|
|
7
|
-
export declare function getOctocodeDir(): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ResolvedConfig } from './types.js';
|
|
2
|
-
export declare function resolveConfigSync(): ResolvedConfig;
|
|
3
|
-
export declare function resolveConfig(): Promise<ResolvedConfig>;
|
|
4
|
-
export declare function getConfigSync(): ResolvedConfig;
|
|
5
|
-
export declare function getConfig(): Promise<ResolvedConfig>;
|
|
6
|
-
export declare function reloadConfig(): Promise<ResolvedConfig>;
|
|
7
|
-
export declare function invalidateConfigCache(): void;
|
|
8
|
-
export declare function _resetConfigCache(): void;
|
|
9
|
-
export declare function _getCacheState(): {
|
|
10
|
-
cached: boolean;
|
|
11
|
-
timestamp: number;
|
|
12
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { OctocodeConfig, RequiredGitHubConfig, RequiredLocalConfig, RequiredToolsConfig, RequiredNetworkConfig, RequiredLspConfig, RequiredOutputConfig } from './types.js';
|
|
2
|
-
export declare function parseBooleanEnv(value: string | undefined): boolean | undefined;
|
|
3
|
-
export declare function parseIntEnv(value: string | undefined): number | undefined;
|
|
4
|
-
export declare function parseStringArrayEnv(value: string | undefined): string[] | undefined;
|
|
5
|
-
export declare function resolveGitHub(fileConfig?: OctocodeConfig['github']): RequiredGitHubConfig;
|
|
6
|
-
export declare function resolveLocal(fileConfig?: OctocodeConfig['local']): RequiredLocalConfig;
|
|
7
|
-
export declare function resolveTools(fileConfig?: OctocodeConfig['tools']): RequiredToolsConfig;
|
|
8
|
-
export declare function resolveNetwork(fileConfig?: OctocodeConfig['network']): RequiredNetworkConfig;
|
|
9
|
-
export declare function resolveLsp(fileConfig?: OctocodeConfig['lsp']): RequiredLspConfig;
|
|
10
|
-
export declare function resolveOutput(fileConfig?: OctocodeConfig['output']): RequiredOutputConfig;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Which interface is driving the shared tool core right now.
|
|
3
|
-
*
|
|
4
|
-
* Some config defaults differ by surface (see `resolveLocal`):
|
|
5
|
-
* - `cli`: local tools default to ENABLED; clone defaults to ENABLED.
|
|
6
|
-
* - `mcp`: local tools default to ENABLED; clone defaults to DISABLED.
|
|
7
|
-
*
|
|
8
|
-
* `ENABLE_LOCAL=false` or `local.enabled=false` explicitly disables local tools
|
|
9
|
-
* on every surface.
|
|
10
|
-
*
|
|
11
|
-
* Defaults to `mcp`, the primary consumer. The CLI binary calls
|
|
12
|
-
* `setRuntimeSurface('cli')` at startup before any tool runs.
|
|
13
|
-
*
|
|
14
|
-
* State lives on `globalThis` (not a module-level variable) so a single shared
|
|
15
|
-
* value is seen even when bundlers (esbuild) inline this module more than once
|
|
16
|
-
* across different package subpath entry points (`/config`, `/direct`, …).
|
|
17
|
-
*/
|
|
18
|
-
export type RuntimeSurface = 'cli' | 'mcp';
|
|
19
|
-
export declare function setRuntimeSurface(surface: RuntimeSurface): void;
|
|
20
|
-
export declare function getRuntimeSurface(): RuntimeSurface;
|
|
21
|
-
/** Test helper: restore the default surface. */
|
|
22
|
-
export declare function _resetRuntimeSurface(): void;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
export declare const CONFIG_SCHEMA_VERSION = 1;
|
|
2
|
-
export declare const CONFIG_FILE_NAME = ".octocoderc";
|
|
3
|
-
export interface GitHubConfigOptions {
|
|
4
|
-
apiUrl?: string;
|
|
5
|
-
}
|
|
6
|
-
export interface LocalConfigOptions {
|
|
7
|
-
enabled?: boolean;
|
|
8
|
-
enableClone?: boolean;
|
|
9
|
-
allowedPaths?: string[];
|
|
10
|
-
workspaceRoot?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface ToolsConfigOptions {
|
|
13
|
-
enabled?: string[] | null;
|
|
14
|
-
enableAdditional?: string[] | null;
|
|
15
|
-
disabled?: string[] | null;
|
|
16
|
-
}
|
|
17
|
-
export interface NetworkConfigOptions {
|
|
18
|
-
timeout?: number;
|
|
19
|
-
maxRetries?: number;
|
|
20
|
-
}
|
|
21
|
-
export interface LspConfigOptions {
|
|
22
|
-
configPath?: string;
|
|
23
|
-
}
|
|
24
|
-
export interface OutputPaginationConfigOptions {
|
|
25
|
-
defaultCharLength?: number;
|
|
26
|
-
}
|
|
27
|
-
export type MinifyMode = 'none' | 'standard' | 'symbols';
|
|
28
|
-
export interface OutputConfigOptions {
|
|
29
|
-
format?: 'yaml' | 'json';
|
|
30
|
-
pagination?: OutputPaginationConfigOptions;
|
|
31
|
-
}
|
|
32
|
-
export interface OctocodeConfig {
|
|
33
|
-
$schema?: string;
|
|
34
|
-
version?: number;
|
|
35
|
-
github?: GitHubConfigOptions;
|
|
36
|
-
local?: LocalConfigOptions;
|
|
37
|
-
tools?: ToolsConfigOptions;
|
|
38
|
-
network?: NetworkConfigOptions;
|
|
39
|
-
lsp?: LspConfigOptions;
|
|
40
|
-
output?: OutputConfigOptions;
|
|
41
|
-
}
|
|
42
|
-
export interface RequiredGitHubConfig {
|
|
43
|
-
apiUrl: string;
|
|
44
|
-
}
|
|
45
|
-
export interface RequiredLocalConfig {
|
|
46
|
-
enabled: boolean;
|
|
47
|
-
enableClone: boolean;
|
|
48
|
-
allowedPaths: string[];
|
|
49
|
-
workspaceRoot: string | undefined;
|
|
50
|
-
}
|
|
51
|
-
export interface RequiredToolsConfig {
|
|
52
|
-
enabled: string[] | null;
|
|
53
|
-
enableAdditional: string[] | null;
|
|
54
|
-
disabled: string[] | null;
|
|
55
|
-
}
|
|
56
|
-
export interface RequiredNetworkConfig {
|
|
57
|
-
timeout: number;
|
|
58
|
-
maxRetries: number;
|
|
59
|
-
}
|
|
60
|
-
export interface RequiredLspConfig {
|
|
61
|
-
configPath: string | undefined;
|
|
62
|
-
}
|
|
63
|
-
export interface RequiredOutputPaginationConfig {
|
|
64
|
-
defaultCharLength: number;
|
|
65
|
-
}
|
|
66
|
-
export interface RequiredOutputConfig {
|
|
67
|
-
format: 'yaml' | 'json';
|
|
68
|
-
pagination: RequiredOutputPaginationConfig;
|
|
69
|
-
}
|
|
70
|
-
export interface ResolvedConfig {
|
|
71
|
-
version: number;
|
|
72
|
-
github: RequiredGitHubConfig;
|
|
73
|
-
local: RequiredLocalConfig;
|
|
74
|
-
tools: RequiredToolsConfig;
|
|
75
|
-
network: RequiredNetworkConfig;
|
|
76
|
-
lsp: RequiredLspConfig;
|
|
77
|
-
output: RequiredOutputConfig;
|
|
78
|
-
source: 'file' | 'defaults' | 'mixed';
|
|
79
|
-
configPath?: string;
|
|
80
|
-
}
|
|
81
|
-
export interface ValidationResult {
|
|
82
|
-
valid: boolean;
|
|
83
|
-
errors: string[];
|
|
84
|
-
warnings: string[];
|
|
85
|
-
config?: OctocodeConfig;
|
|
86
|
-
}
|
|
87
|
-
export interface LoadConfigResult {
|
|
88
|
-
success: boolean;
|
|
89
|
-
config?: OctocodeConfig;
|
|
90
|
-
error?: string;
|
|
91
|
-
path: string;
|
|
92
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { TokenSource } from './types.js';
|
|
2
|
-
export declare const ENV_TOKEN_VARS: readonly ["OCTOCODE_TOKEN", "GH_TOKEN", "GITHUB_TOKEN", "GITHUB_PERSONAL_ACCESS_TOKEN"];
|
|
3
|
-
export declare function getTokenFromEnv(): string | null;
|
|
4
|
-
export declare function getEnvTokenSource(): TokenSource;
|
|
5
|
-
export declare function hasEnvToken(): boolean;
|
|
6
|
-
export declare function resolveEnvToken(): {
|
|
7
|
-
token: string;
|
|
8
|
-
source: NonNullable<TokenSource>;
|
|
9
|
-
} | null;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Archive list/extract operations.
|
|
3
|
-
* Backs mode="list" and mode="extract" in localBinaryInspect.
|
|
4
|
-
*
|
|
5
|
-
* Backend selection (falls through on missing CLI):
|
|
6
|
-
* .aar/.yaa → aa only
|
|
7
|
-
* .dmg/.rar/.cpgz → 7z → 7zz → bsdtar
|
|
8
|
-
* .7z/.iso/.cab/… → bsdtar → 7z → 7zz
|
|
9
|
-
* .tar.* → tar → bsdtar → 7z
|
|
10
|
-
* default (zip-fam.) → unzip → tar → bsdtar → 7z
|
|
11
|
-
*/
|
|
12
|
-
export interface ArchiveChainResult {
|
|
13
|
-
success: boolean;
|
|
14
|
-
stdout: string;
|
|
15
|
-
stderr: string;
|
|
16
|
-
commandUsed?: string;
|
|
17
|
-
missingCommands?: string[];
|
|
18
|
-
}
|
|
19
|
-
export declare function listArchiveEntries(path: string, verbose: boolean): Promise<ArchiveChainResult & {
|
|
20
|
-
entries?: string[];
|
|
21
|
-
}>;
|
|
22
|
-
export declare function extractArchiveEntry(path: string, entry: string): Promise<ArchiveChainResult>;
|
|
23
|
-
/** Extracts the whole archive into destDir (which must already exist). */
|
|
24
|
-
export declare function extractArchiveToDir(path: string, destDir: string): Promise<ArchiveChainResult>;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import type { BinaryInspectQuery } from './scheme.js';
|
|
2
|
-
interface ContentCharPagination {
|
|
3
|
-
currentPage: number;
|
|
4
|
-
totalPages: number;
|
|
5
|
-
hasMore: boolean;
|
|
6
|
-
charOffset: number;
|
|
7
|
-
charLength: number;
|
|
8
|
-
totalChars: number;
|
|
9
|
-
nextCharOffset?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare function inspectBinary(query: BinaryInspectQuery): Promise<import("../../index.js").UnifiedErrorResult | {
|
|
12
|
-
warnings?: string[];
|
|
13
|
-
truncated?: boolean;
|
|
14
|
-
detailed?: boolean;
|
|
15
|
-
libraries?: string[];
|
|
16
|
-
sections?: string[];
|
|
17
|
-
exports?: string[];
|
|
18
|
-
imports?: string[];
|
|
19
|
-
symbols?: string[];
|
|
20
|
-
symbolCount: number;
|
|
21
|
-
importCount: number;
|
|
22
|
-
exportCount: number;
|
|
23
|
-
entry?: string;
|
|
24
|
-
stripped?: boolean;
|
|
25
|
-
endianness?: string;
|
|
26
|
-
bits?: number;
|
|
27
|
-
arch?: string;
|
|
28
|
-
status: "success";
|
|
29
|
-
mode: "inspect";
|
|
30
|
-
path: string;
|
|
31
|
-
format: string;
|
|
32
|
-
description: string;
|
|
33
|
-
magicBytes: string;
|
|
34
|
-
} | {
|
|
35
|
-
pagination: {
|
|
36
|
-
currentPage: number;
|
|
37
|
-
totalPages: number;
|
|
38
|
-
hasMore: boolean;
|
|
39
|
-
entriesPerPage: number;
|
|
40
|
-
};
|
|
41
|
-
status: "success";
|
|
42
|
-
mode: "list";
|
|
43
|
-
path: string;
|
|
44
|
-
backend: string;
|
|
45
|
-
totalEntries: number;
|
|
46
|
-
entries: string[];
|
|
47
|
-
} | {
|
|
48
|
-
pagination?: ContentCharPagination;
|
|
49
|
-
status: "success";
|
|
50
|
-
mode: "extract";
|
|
51
|
-
path: string;
|
|
52
|
-
archiveFile: string;
|
|
53
|
-
backend: string;
|
|
54
|
-
localPath: string;
|
|
55
|
-
content: string;
|
|
56
|
-
isPartial: boolean;
|
|
57
|
-
} | {
|
|
58
|
-
pagination?: ContentCharPagination;
|
|
59
|
-
status: "success";
|
|
60
|
-
mode: "decompress";
|
|
61
|
-
path: string;
|
|
62
|
-
format: "gzip" | "bzip2" | "xz" | "lzma" | "zstd" | "lz4" | "brotli" | "lzfse";
|
|
63
|
-
backend: string;
|
|
64
|
-
localPath: string;
|
|
65
|
-
content: string;
|
|
66
|
-
isPartial: boolean;
|
|
67
|
-
} | {
|
|
68
|
-
nextScanOffset?: number;
|
|
69
|
-
scanOffset: number;
|
|
70
|
-
pagination?: ContentCharPagination;
|
|
71
|
-
totalFound: number;
|
|
72
|
-
isPartial: boolean;
|
|
73
|
-
localPath?: string;
|
|
74
|
-
status: "success";
|
|
75
|
-
mode: "strings";
|
|
76
|
-
path: string;
|
|
77
|
-
content: string;
|
|
78
|
-
} | {
|
|
79
|
-
status: "success";
|
|
80
|
-
mode: "unpack";
|
|
81
|
-
path: string;
|
|
82
|
-
localPath: string;
|
|
83
|
-
cached: boolean;
|
|
84
|
-
topLevelEntries: number;
|
|
85
|
-
}>;
|
|
86
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Binary file inspection (format lane) — native, via octocode-engine.
|
|
3
|
-
* Backs mode="inspect" and mode="strings" in localBinaryInspect.
|
|
4
|
-
*
|
|
5
|
-
* No GNU binutils/coreutils dependency: `goblin`-backed parsing and a native
|
|
6
|
-
* string scanner replace the old `file` / `xxd` / `strings` shell-outs, so this
|
|
7
|
-
* lane works on Windows and on distroless/Alpine Linux, returns parser-stable
|
|
8
|
-
* structured data, and recovers UTF-16 strings GNU `strings -a` misses.
|
|
9
|
-
*/
|
|
10
|
-
import type { BinaryInspectInfo } from '@octocodeai/octocode-engine';
|
|
11
|
-
export interface InspectResult {
|
|
12
|
-
success: boolean;
|
|
13
|
-
info?: BinaryInspectInfo;
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function inspectBinaryFile(path: string): InspectResult;
|
|
17
|
-
export interface StringsResult {
|
|
18
|
-
success: boolean;
|
|
19
|
-
strings?: string[];
|
|
20
|
-
totalFound?: number;
|
|
21
|
-
/** True when more of the file remains to scan beyond this window (follow nextScanOffset). */
|
|
22
|
-
truncated?: boolean;
|
|
23
|
-
/** Absolute byte offset for the next scan window, or undefined at EOF. */
|
|
24
|
-
nextScanOffset?: number;
|
|
25
|
-
error?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare function extractStrings(path: string, minLength: number, includeOffsets: boolean, scanOffset?: number): StringsResult;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single-stream decompression.
|
|
3
|
-
* Backs mode="decompress" in localBinaryInspect.
|
|
4
|
-
*
|
|
5
|
-
* Handles: .gz .bz2 .xz .lzma .zst .lz4 .br .lzfse
|
|
6
|
-
* Does NOT handle multi-entry archives (.tar.gz, .zip etc.) — those belong to archiveOps.
|
|
7
|
-
*/
|
|
8
|
-
export type DecompressFormat = 'auto' | 'gzip' | 'bzip2' | 'xz' | 'lzma' | 'zstd' | 'lz4' | 'brotli' | 'lzfse';
|
|
9
|
-
export interface DecompressResult {
|
|
10
|
-
success: boolean;
|
|
11
|
-
content?: string;
|
|
12
|
-
format?: Exclude<DecompressFormat, 'auto'>;
|
|
13
|
-
backend?: string;
|
|
14
|
-
error?: string;
|
|
15
|
-
}
|
|
16
|
-
export declare function decompressFile(path: string, format: DecompressFormat): Promise<DecompressResult>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import { type BinaryInspectQuery } from './scheme.js';
|
|
3
|
-
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
4
|
-
export declare function executeInspectBinary(args: ToolExecutionArgs<BinaryInspectQuery>): Promise<CallToolResult>;
|