@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
|
@@ -15,99 +15,20 @@
|
|
|
15
15
|
* Not rigid: profiles are declarative tables, all weights live in one policy
|
|
16
16
|
* object, new languages register by adding a profile. AST/LSP signals (Phase
|
|
17
17
|
* 2/3) layer on top without changing this contract.
|
|
18
|
+
*
|
|
19
|
+
* This file is a thin barrel: the implementation lives in `rankingProfile/`,
|
|
20
|
+
* split by concern —
|
|
21
|
+
* - `rankingProfile/rankingProfiles.ts`: profile data/config (language
|
|
22
|
+
* tables, path-role regexes, `selectProfile`/`classifyPathRole`).
|
|
23
|
+
* - `rankingProfile/rankingScoring.ts`: the scoring engine (`bestLineScore`,
|
|
24
|
+
* `pathAffinityScore`, `candidateTermRarityScore`, `scoreFileWithRarity`).
|
|
25
|
+
* - `rankingProfile/rankingResults.ts`: `rankFiles`/`RankResult` plus the
|
|
26
|
+
* lexical helpers (`lexicalCategoryOf`, `isIndexInsideString`, etc.).
|
|
27
|
+
* Re-exported here so no other module needs to change its import path.
|
|
18
28
|
*/
|
|
19
|
-
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* All ranking weights in one place. Tuning happens here and in the golden
|
|
27
|
-
* fixtures, never scattered across the scorer. Values are deliberately
|
|
28
|
-
* integer-ish and additive so a score can be read back from its reasons.
|
|
29
|
-
*/
|
|
30
|
-
export declare const RANK_WEIGHTS: {
|
|
31
|
-
readonly exactWholeWord: 6;
|
|
32
|
-
readonly exactCaseInsensitive: 3;
|
|
33
|
-
readonly substring: 1;
|
|
34
|
-
readonly declarationLine: 8;
|
|
35
|
-
readonly exportLine: 4;
|
|
36
|
-
readonly importLine: 3;
|
|
37
|
-
readonly configKeyLine: 4;
|
|
38
|
-
readonly headingLine: 4;
|
|
39
|
-
readonly commentOrStringPenalty: -2;
|
|
40
|
-
readonly pathUnderQuery: 4;
|
|
41
|
-
readonly pathSegmentToken: 3;
|
|
42
|
-
readonly extMatchesLangType: 2;
|
|
43
|
-
readonly sourceDir: 1.5;
|
|
44
|
-
readonly lowSignalPathPenalty: -5;
|
|
45
|
-
readonly rareQueryTokenScale: 2;
|
|
46
|
-
readonly rareQueryTokenCap: 3;
|
|
47
|
-
readonly matchCountScale: 1.5;
|
|
48
|
-
readonly matchCountCap: 6;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Bound on how many files get full scoring before pagination. The engine text
|
|
52
|
-
* path returns the entire result set unbounded (no global file/match cap), so
|
|
53
|
-
* for broad terms in a large monorepo we must not score O(total files). When
|
|
54
|
-
* the cap bites we deterministically prefilter (matchCount desc, path asc)
|
|
55
|
-
* before scoring, and the builder surfaces a `truncated`-style note.
|
|
56
|
-
*/
|
|
57
|
-
export declare const RANK_CANDIDATE_CAP = 2000;
|
|
58
|
-
interface RankingProfile {
|
|
59
|
-
id: RankingProfileId;
|
|
60
|
-
extensions: readonly string[];
|
|
61
|
-
/** Lines that declare/define a symbol named like the query — highest signal. */
|
|
62
|
-
declaration: readonly RegExp[];
|
|
63
|
-
/** Exported/public surface. */
|
|
64
|
-
export: readonly RegExp[];
|
|
65
|
-
/** Import/use lines. */
|
|
66
|
-
import: readonly RegExp[];
|
|
67
|
-
}
|
|
68
|
-
/** Deterministic profile selection from query langType then file extension. */
|
|
69
|
-
export declare function selectProfile(path: string, langType?: string, override?: RankingProfileId | 'auto'): RankingProfile;
|
|
70
|
-
export declare function classifyPathRole(path: string): PathRole;
|
|
71
|
-
export interface RankContext {
|
|
72
|
-
/** Validated, sanitized search base path (query.path). */
|
|
73
|
-
queryPath?: string;
|
|
74
|
-
/** The literal keyword/pattern, used for whole-word / token / path checks. */
|
|
75
|
-
keyword?: string;
|
|
76
|
-
langType?: string;
|
|
77
|
-
caseSensitive?: boolean;
|
|
78
|
-
wholeWord?: boolean;
|
|
79
|
-
/** Profile override from query.rankingProfile. */
|
|
80
|
-
profileOverride?: RankingProfileId | 'auto';
|
|
81
|
-
/** True when the user explicitly searched into a low-signal/test/docs area. */
|
|
82
|
-
explicitLowSignal?: boolean;
|
|
83
|
-
}
|
|
84
|
-
export interface FileScore {
|
|
85
|
-
score: number;
|
|
86
|
-
profile: RankingProfileId;
|
|
87
|
-
pathRole: PathRole;
|
|
88
|
-
reasons: string[];
|
|
89
|
-
}
|
|
90
|
-
/** Score one file. Pure and deterministic. */
|
|
91
|
-
export declare function scoreFile(file: LocalSearchCodeFile, ctx: RankContext): FileScore;
|
|
92
|
-
export interface RankResult {
|
|
93
|
-
files: LocalSearchCodeFile[];
|
|
94
|
-
/** Per-path debug info, only populated when debug is requested. */
|
|
95
|
-
debug?: Map<string, FileScore>;
|
|
96
|
-
/** Number of files dropped by the candidate cap before scoring (0 if none). */
|
|
97
|
-
cappedCandidates: number;
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Rank files by the requested sort mode. `relevance` is the language-aware
|
|
101
|
-
* scorer (default); `matchCount` and `path` are deterministic escape hatches;
|
|
102
|
-
* filesystem sorts (created/modified/accessed) preserve the engine's order.
|
|
103
|
-
*/
|
|
104
|
-
export declare function rankFiles(files: LocalSearchCodeFile[], sort: RankSort, ctx: RankContext, opts?: {
|
|
105
|
-
debug?: boolean;
|
|
106
|
-
candidateCap?: number;
|
|
107
|
-
}): RankResult;
|
|
108
|
-
/** True when the query path explicitly targets a low-signal area, so the
|
|
109
|
-
* scorer should not penalize generated/test/docs/fixture roles. Uses anchored
|
|
110
|
-
* path-segment matching (not substring) so `latest/`, `contest/`, `manifest/`
|
|
111
|
-
* do NOT count as low-signal. */
|
|
112
|
-
export declare function isLowSignalQueryPath(path: string | undefined): boolean;
|
|
113
|
-
export {};
|
|
29
|
+
export type { RankingProfileId, RankSort, PathRole, RankingProfile, } from './rankingProfile/rankingProfiles.js';
|
|
30
|
+
export { RANKING_PROFILE_IDS, RANK_WEIGHTS, RANK_CANDIDATE_CAP, COMMENT_LINE, HEADING_LINE, LOW_SIGNAL_PATH, EXT_RE, fileExtension, selectProfile, classifyPathRole, isLowSignalQueryPath, } from './rankingProfile/rankingProfiles.js';
|
|
31
|
+
export type { RankContext, FileScore, } from './rankingProfile/rankingScoring.js';
|
|
32
|
+
export { buildCandidateTermRarity, scoreFileWithRarity, scoreFile, } from './rankingProfile/rankingScoring.js';
|
|
33
|
+
export type { RankResult } from './rankingProfile/rankingResults.js';
|
|
34
|
+
export { rankFiles, matchesAny, escapeRegex, isPlainIdentifierKeyword, matchedLineOf, lexicalCategoryOf, isIndexInsideString, } from './rankingProfile/rankingResults.js';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
2
|
+
import type { LocalSearchCodeToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
3
|
+
import type { SearchStats } from '../../../utils/core/types.js';
|
|
4
|
+
import type { RipgrepQuery } from '../scheme.js';
|
|
5
|
+
export type LocalSearchEngine = 'rg' | 'structural';
|
|
6
|
+
export declare function buildSearchResult(parsedFiles: LocalSearchCodeFile[], configuredQuery: RipgrepQuery, searchEngine: LocalSearchEngine, warnings: string[], stats?: SearchStats): Promise<LocalSearchCodeToolResult>;
|
|
7
|
+
export declare function finalizeRipgrepResult(result: LocalSearchCodeToolResult, _query: RipgrepQuery, _totals: {
|
|
8
|
+
totalMatches: number;
|
|
9
|
+
totalFiles: number;
|
|
10
|
+
}): LocalSearchCodeToolResult;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { LocalSearchCodeFile } from '@octocodeai/octocode-core/types';
|
|
2
|
+
import type { RipgrepQuery } from '../scheme.js';
|
|
3
|
+
import type { LocalSearchEngine } from './buildResult.js';
|
|
4
|
+
type NextToolName = 'localGetFileContent' | 'lspGetSemantics' | 'localSearchCode';
|
|
5
|
+
type NextConfidence = 'exact' | 'heuristic';
|
|
6
|
+
type SearchNextCall = {
|
|
7
|
+
tool: NextToolName;
|
|
8
|
+
query: Record<string, unknown>;
|
|
9
|
+
why: string;
|
|
10
|
+
confidence?: NextConfidence;
|
|
11
|
+
};
|
|
12
|
+
export type SearchNextMap = {
|
|
13
|
+
fetch?: SearchNextCall;
|
|
14
|
+
lspDefinition?: SearchNextCall;
|
|
15
|
+
lspReferences?: SearchNextCall;
|
|
16
|
+
nextPage?: SearchNextCall;
|
|
17
|
+
nextMatchPage?: SearchNextCall;
|
|
18
|
+
};
|
|
19
|
+
type FlowMatch = {
|
|
20
|
+
line?: number;
|
|
21
|
+
endLine?: number;
|
|
22
|
+
value?: string;
|
|
23
|
+
metavars?: Record<string, string[]>;
|
|
24
|
+
metavarRanges?: Record<string, Array<{
|
|
25
|
+
line: number;
|
|
26
|
+
}>>;
|
|
27
|
+
};
|
|
28
|
+
export declare function buildSearchNextMap(files: LocalSearchCodeFile[], query: RipgrepQuery, searchEngine: LocalSearchEngine, options: {
|
|
29
|
+
isFileListMode: boolean;
|
|
30
|
+
currentPage: number;
|
|
31
|
+
totalFilePages: number;
|
|
32
|
+
matchPage: number;
|
|
33
|
+
matchesPerPage: number;
|
|
34
|
+
hasFileWithMoreMatches: boolean;
|
|
35
|
+
}): SearchNextMap;
|
|
36
|
+
export type InferredLspSymbol = {
|
|
37
|
+
symbol: string;
|
|
38
|
+
/**
|
|
39
|
+
* Precise capture line from `metavarRanges` (structural search only).
|
|
40
|
+
* Undefined when the search engine doesn't carry per-capture ranges — the
|
|
41
|
+
* caller falls back to the match's own start line.
|
|
42
|
+
*/
|
|
43
|
+
line?: number;
|
|
44
|
+
};
|
|
45
|
+
export declare function inferLspSymbolName(match: FlowMatch | undefined, query: RipgrepQuery, searchEngine: LocalSearchEngine): InferredLspSymbol | undefined;
|
|
46
|
+
export {};
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { SearchStats } from '../../utils/core/types.js';
|
|
4
|
-
import type { RipgrepQuery } from './scheme.js';
|
|
5
|
-
export type LocalSearchEngine = 'rg' | 'structural';
|
|
6
|
-
type FlowMatch = {
|
|
7
|
-
line?: number;
|
|
8
|
-
endLine?: number;
|
|
9
|
-
value?: string;
|
|
10
|
-
metavars?: Record<string, string[]>;
|
|
11
|
-
};
|
|
12
|
-
export declare function buildSearchResult(parsedFiles: LocalSearchCodeFile[], configuredQuery: RipgrepQuery, searchEngine: LocalSearchEngine, warnings: string[], stats?: SearchStats): Promise<LocalSearchCodeToolResult>;
|
|
13
|
-
export declare function finalizeRipgrepResult(result: LocalSearchCodeToolResult, _query: RipgrepQuery, _totals: {
|
|
14
|
-
totalMatches: number;
|
|
15
|
-
totalFiles: number;
|
|
16
|
-
}): LocalSearchCodeToolResult;
|
|
17
|
-
export declare function inferLspSymbolName(match: FlowMatch | undefined, query: RipgrepQuery, searchEngine: LocalSearchEngine): string | undefined;
|
|
18
|
-
export {};
|
|
1
|
+
export * from './ripgrepResultBuilder/buildResult.js';
|
|
2
|
+
export * from './ripgrepResultBuilder/searchNext.js';
|
|
@@ -78,3 +78,173 @@ export declare const LocalRipgrepBulkQuerySchema: z.ZodObject<{
|
|
|
78
78
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
79
79
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
80
80
|
}, z.core.$strip>;
|
|
81
|
+
export declare const LocalSearchCodeOutputSchema: z.ZodObject<{
|
|
82
|
+
results: z.ZodArray<z.ZodObject<{
|
|
83
|
+
id: z.ZodString;
|
|
84
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
empty: "empty";
|
|
86
|
+
error: "error";
|
|
87
|
+
}>>;
|
|
88
|
+
data: z.ZodObject<{
|
|
89
|
+
files: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
90
|
+
path: z.ZodString;
|
|
91
|
+
matches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
92
|
+
line: z.ZodNumber;
|
|
93
|
+
endLine: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
value: z.ZodOptional<z.ZodString>;
|
|
95
|
+
column: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
endColumn: z.ZodOptional<z.ZodNumber>;
|
|
97
|
+
count: z.ZodOptional<z.ZodNumber>;
|
|
98
|
+
kind: z.ZodOptional<z.ZodString>;
|
|
99
|
+
scoreHint: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
metavars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
101
|
+
metavarRanges: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodObject<{
|
|
102
|
+
text: z.ZodString;
|
|
103
|
+
line: z.ZodNumber;
|
|
104
|
+
column: z.ZodNumber;
|
|
105
|
+
endLine: z.ZodNumber;
|
|
106
|
+
endColumn: z.ZodNumber;
|
|
107
|
+
}, z.core.$strip>>>>;
|
|
108
|
+
}, z.core.$strip>>>;
|
|
109
|
+
totalOccurrences: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
totalMatchedLines: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
totalMatchRows: z.ZodOptional<z.ZodNumber>;
|
|
112
|
+
returnedMatchRows: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
ranking: z.ZodOptional<z.ZodObject<{
|
|
114
|
+
score: z.ZodNumber;
|
|
115
|
+
profile: z.ZodOptional<z.ZodString>;
|
|
116
|
+
pathRole: z.ZodOptional<z.ZodString>;
|
|
117
|
+
reasons: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
matchPagination: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
currentPage: z.ZodNumber;
|
|
121
|
+
totalPages: z.ZodNumber;
|
|
122
|
+
hasMore: z.ZodBoolean;
|
|
123
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
125
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
129
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
131
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
132
|
+
exact: "exact";
|
|
133
|
+
reported: "reported";
|
|
134
|
+
lowerBound: "lowerBound";
|
|
135
|
+
}>>;
|
|
136
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
filesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
140
|
+
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
matchesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
143
|
+
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
144
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
totalFilesFound: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
149
|
+
currentPage: z.ZodNumber;
|
|
150
|
+
totalPages: z.ZodNumber;
|
|
151
|
+
hasMore: z.ZodBoolean;
|
|
152
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
155
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
161
|
+
exact: "exact";
|
|
162
|
+
reported: "reported";
|
|
163
|
+
lowerBound: "lowerBound";
|
|
164
|
+
}>>;
|
|
165
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
166
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
filesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
170
|
+
matchesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
171
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
172
|
+
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
173
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
totalFilesFound: z.ZodOptional<z.ZodNumber>;
|
|
175
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
176
|
+
}, z.core.$strip>>;
|
|
177
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
178
|
+
tool: z.ZodString;
|
|
179
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
180
|
+
why: z.ZodOptional<z.ZodString>;
|
|
181
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
182
|
+
exact: "exact";
|
|
183
|
+
heuristic: "heuristic";
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
}, z.core.$strip>>>;
|
|
187
|
+
summary: z.ZodOptional<z.ZodString>;
|
|
188
|
+
searchEngine: z.ZodOptional<z.ZodString>;
|
|
189
|
+
stats: z.ZodOptional<z.ZodObject<{
|
|
190
|
+
totalOccurrences: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
matchedLines: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
filesMatched: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
filesSearched: z.ZodOptional<z.ZodNumber>;
|
|
194
|
+
bytesSearched: z.ZodOptional<z.ZodNumber>;
|
|
195
|
+
searchTime: z.ZodOptional<z.ZodString>;
|
|
196
|
+
}, z.core.$loose>>;
|
|
197
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
198
|
+
currentPage: z.ZodNumber;
|
|
199
|
+
totalPages: z.ZodNumber;
|
|
200
|
+
hasMore: z.ZodBoolean;
|
|
201
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
202
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
203
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
204
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
205
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
206
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
207
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
208
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
209
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
210
|
+
exact: "exact";
|
|
211
|
+
reported: "reported";
|
|
212
|
+
lowerBound: "lowerBound";
|
|
213
|
+
}>>;
|
|
214
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
216
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
filesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
218
|
+
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
matchesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
222
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
223
|
+
totalFilesFound: z.ZodOptional<z.ZodNumber>;
|
|
224
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
225
|
+
}, z.core.$strip>>;
|
|
226
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
227
|
+
tool: z.ZodString;
|
|
228
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
229
|
+
why: z.ZodOptional<z.ZodString>;
|
|
230
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
231
|
+
exact: "exact";
|
|
232
|
+
heuristic: "heuristic";
|
|
233
|
+
}>>;
|
|
234
|
+
}, z.core.$strip>>>;
|
|
235
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
}, z.core.$strip>>;
|
|
238
|
+
base: z.ZodOptional<z.ZodString>;
|
|
239
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
240
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
241
|
+
currentPage: z.ZodNumber;
|
|
242
|
+
totalPages: z.ZodNumber;
|
|
243
|
+
hasMore: z.ZodBoolean;
|
|
244
|
+
charOffset: z.ZodNumber;
|
|
245
|
+
charLength: z.ZodNumber;
|
|
246
|
+
totalChars: z.ZodNumber;
|
|
247
|
+
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>>;
|
|
249
|
+
}, z.core.$strip>;
|
|
250
|
+
export type LocalSearchCodeOutput = z.infer<typeof LocalSearchCodeOutputSchema>;
|
|
@@ -31,3 +31,86 @@ export declare const LocalViewStructureBulkQuerySchema: z.ZodObject<{
|
|
|
31
31
|
responseCharLength: z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>;
|
|
32
32
|
queries: z.ZodArray<z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>;
|
|
33
33
|
}, z.core.$strip>;
|
|
34
|
+
export declare const LocalViewStructureOutputSchema: z.ZodObject<{
|
|
35
|
+
results: z.ZodArray<z.ZodObject<{
|
|
36
|
+
id: z.ZodString;
|
|
37
|
+
status: z.ZodOptional<z.ZodEnum<{
|
|
38
|
+
empty: "empty";
|
|
39
|
+
error: "error";
|
|
40
|
+
}>>;
|
|
41
|
+
data: z.ZodObject<{
|
|
42
|
+
path: z.ZodOptional<z.ZodString>;
|
|
43
|
+
entries: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
type: z.ZodEnum<{
|
|
46
|
+
file: "file";
|
|
47
|
+
link: "link";
|
|
48
|
+
directory: "directory";
|
|
49
|
+
dir: "dir";
|
|
50
|
+
symlink: "symlink";
|
|
51
|
+
}>;
|
|
52
|
+
path: z.ZodOptional<z.ZodString>;
|
|
53
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
size: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
55
|
+
sizeBytes: z.ZodOptional<z.ZodNumber>;
|
|
56
|
+
modified: z.ZodOptional<z.ZodString>;
|
|
57
|
+
permissions: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>>;
|
|
59
|
+
files: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
60
|
+
folders: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
61
|
+
links: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
62
|
+
summary: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>]>>;
|
|
63
|
+
pagination: z.ZodOptional<z.ZodObject<{
|
|
64
|
+
currentPage: z.ZodNumber;
|
|
65
|
+
totalPages: z.ZodNumber;
|
|
66
|
+
hasMore: z.ZodBoolean;
|
|
67
|
+
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
69
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
70
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
exact: "exact";
|
|
77
|
+
reported: "reported";
|
|
78
|
+
lowerBound: "lowerBound";
|
|
79
|
+
}>>;
|
|
80
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
81
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
82
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
filesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
entriesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
matchesPerPage: z.ZodOptional<z.ZodNumber>;
|
|
86
|
+
totalFiles: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
totalEntries: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
totalFilesFound: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
nextMatchPage: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
92
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
93
|
+
tool: z.ZodString;
|
|
94
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
95
|
+
why: z.ZodOptional<z.ZodString>;
|
|
96
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
97
|
+
exact: "exact";
|
|
98
|
+
heuristic: "heuristic";
|
|
99
|
+
}>>;
|
|
100
|
+
}, z.core.$strip>>>;
|
|
101
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
}, z.core.$strip>>;
|
|
104
|
+
base: z.ZodOptional<z.ZodString>;
|
|
105
|
+
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
106
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
currentPage: z.ZodNumber;
|
|
108
|
+
totalPages: z.ZodNumber;
|
|
109
|
+
hasMore: z.ZodBoolean;
|
|
110
|
+
charOffset: z.ZodNumber;
|
|
111
|
+
charLength: z.ZodNumber;
|
|
112
|
+
totalChars: z.ZodNumber;
|
|
113
|
+
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
}, z.core.$strip>>;
|
|
115
|
+
}, z.core.$strip>;
|
|
116
|
+
export type LocalViewStructureOutput = z.infer<typeof LocalViewStructureOutputSchema>;
|
|
@@ -95,11 +95,11 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
95
95
|
foundAtLine: z.ZodNumber;
|
|
96
96
|
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
97
97
|
}, z.core.$strip>>;
|
|
98
|
-
lsp: z.ZodObject<{
|
|
98
|
+
lsp: z.ZodOptional<z.ZodObject<{
|
|
99
99
|
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
100
100
|
provider: z.ZodOptional<z.ZodString>;
|
|
101
101
|
source: z.ZodOptional<z.ZodString>;
|
|
102
|
-
}, z.core.$strip
|
|
102
|
+
}, z.core.$strip>>;
|
|
103
103
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
104
104
|
kind: z.ZodLiteral<"definition">;
|
|
105
105
|
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -356,13 +356,37 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
356
356
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
357
357
|
currentPage: z.ZodNumber;
|
|
358
358
|
totalPages: z.ZodNumber;
|
|
359
|
-
totalResults: z.ZodNumber;
|
|
360
359
|
hasMore: z.ZodBoolean;
|
|
361
|
-
itemsPerPage: z.ZodNumber;
|
|
362
360
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
361
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
362
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
363
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
364
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
365
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
366
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
367
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
368
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
369
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
370
|
+
exact: "exact";
|
|
371
|
+
reported: "reported";
|
|
372
|
+
lowerBound: "lowerBound";
|
|
373
|
+
}>>;
|
|
374
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
375
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
363
377
|
}, z.core.$strip>>;
|
|
364
378
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
365
379
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
380
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
381
|
+
tool: z.ZodString;
|
|
382
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
383
|
+
why: z.ZodOptional<z.ZodString>;
|
|
384
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
385
|
+
exact: "exact";
|
|
386
|
+
heuristic: "heuristic";
|
|
387
|
+
}>>;
|
|
388
|
+
}, z.core.$strip>>>;
|
|
389
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
366
390
|
}, z.core.$strip>;
|
|
367
391
|
}, z.core.$strip>, z.ZodObject<{
|
|
368
392
|
id: z.ZodString;
|
|
@@ -386,11 +410,11 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
386
410
|
foundAtLine: z.ZodNumber;
|
|
387
411
|
orderHint: z.ZodOptional<z.ZodNumber>;
|
|
388
412
|
}, z.core.$strip>>;
|
|
389
|
-
lsp: z.ZodObject<{
|
|
413
|
+
lsp: z.ZodOptional<z.ZodObject<{
|
|
390
414
|
serverAvailable: z.ZodOptional<z.ZodBoolean>;
|
|
391
415
|
provider: z.ZodOptional<z.ZodString>;
|
|
392
416
|
source: z.ZodOptional<z.ZodString>;
|
|
393
|
-
}, z.core.$strip
|
|
417
|
+
}, z.core.$strip>>;
|
|
394
418
|
payload: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
395
419
|
kind: z.ZodLiteral<"definition">;
|
|
396
420
|
locations: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
@@ -647,13 +671,37 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
647
671
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
648
672
|
currentPage: z.ZodNumber;
|
|
649
673
|
totalPages: z.ZodNumber;
|
|
650
|
-
totalResults: z.ZodNumber;
|
|
651
674
|
hasMore: z.ZodBoolean;
|
|
652
|
-
itemsPerPage: z.ZodNumber;
|
|
653
675
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
676
|
+
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
677
|
+
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
678
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
679
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
680
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
681
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
682
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
683
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
684
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
685
|
+
exact: "exact";
|
|
686
|
+
reported: "reported";
|
|
687
|
+
lowerBound: "lowerBound";
|
|
688
|
+
}>>;
|
|
689
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
690
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
691
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
654
692
|
}, z.core.$strip>>;
|
|
655
693
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
656
694
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
695
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
696
|
+
tool: z.ZodString;
|
|
697
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
698
|
+
why: z.ZodOptional<z.ZodString>;
|
|
699
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
700
|
+
exact: "exact";
|
|
701
|
+
heuristic: "heuristic";
|
|
702
|
+
}>>;
|
|
703
|
+
}, z.core.$strip>>>;
|
|
704
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
657
705
|
}, z.core.$strip>;
|
|
658
706
|
}, z.core.$strip>]>>;
|
|
659
707
|
}, z.core.$strip>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { acquirePooledClient } from '@octocodeai/octocode-engine/lsp/manager';
|
|
2
|
+
import type { SymbolAnchor } from '../shared/resolveSymbolAnchor.js';
|
|
3
|
+
import type { LspSemanticEnvelope, SymbolAnchoredSemanticQuery } from '../shared/semanticTypes.js';
|
|
4
|
+
declare const CONSUMER_SCOPED_TYPES: ReadonlySet<string>;
|
|
5
|
+
export { CONSUMER_SCOPED_TYPES };
|
|
6
|
+
export declare function warmLikelyConsumers(client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>, anchor: SymbolAnchor, workspaceRoot: string): Promise<void>;
|
|
7
|
+
export declare function dispatchAnchoredSemantic(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>): Promise<LspSemanticEnvelope>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { acquirePooledClient } from '@octocodeai/octocode-engine/lsp/manager';
|
|
2
|
+
import { type LspSemanticEnvelope, type SymbolAnchoredSemanticQuery } from '../../shared/semanticTypes.js';
|
|
3
|
+
import type { SymbolAnchor } from '../../shared/resolveSymbolAnchor.js';
|
|
4
|
+
export declare function callsEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>): Promise<LspSemanticEnvelope>;
|
|
5
|
+
export declare function typeHierarchyEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, client: NonNullable<Awaited<ReturnType<typeof acquirePooledClient>>>): Promise<LspSemanticEnvelope>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type LspGetSemanticsQuery, type LspSemanticEnvelope, type SemanticEmptyCategory, type SemanticContentType } from '../../shared/semanticTypes.js';
|
|
2
|
+
import type { SymbolAnchor } from '../../shared/resolveSymbolAnchor.js';
|
|
3
|
+
export declare const DEFAULT_SYMBOLS_PER_PAGE = 40;
|
|
4
|
+
export declare const DEFAULT_LOCATIONS_PER_PAGE = 40;
|
|
5
|
+
export declare const DEFAULT_CALLS_PER_PAGE = 10;
|
|
6
|
+
export type PaginationInfo = {
|
|
7
|
+
currentPage: number;
|
|
8
|
+
totalPages: number;
|
|
9
|
+
totalResults: number;
|
|
10
|
+
hasMore: boolean;
|
|
11
|
+
itemsPerPage: number;
|
|
12
|
+
nextPage?: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function emptyCategoryForReason(type: SemanticContentType, reason: string): SemanticEmptyCategory;
|
|
15
|
+
export declare function failedAnchorEnvelope(query: LspGetSemanticsQuery, reason: string): LspSemanticEnvelope;
|
|
16
|
+
export declare function emptyEnvelope(type: SemanticContentType, anchor: SymbolAnchor, reason: string, serverAvailable?: boolean): LspSemanticEnvelope;
|
|
17
|
+
export declare function paginateItems<T>(items: readonly T[], requestedPage: number, requestedItemsPerPage: number): {
|
|
18
|
+
pageItems: T[];
|
|
19
|
+
pagination: PaginationInfo;
|
|
20
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LSPRange, ReferenceLocation, ReferencesByFile, CodeSnippet } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import { type LspSemanticEnvelope, type SymbolAnchoredSemanticQuery } from '../../shared/semanticTypes.js';
|
|
3
|
+
import type { SymbolAnchor } from '../../shared/resolveSymbolAnchor.js';
|
|
4
|
+
export declare function locationsEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, kind: 'definition' | 'typeDefinition' | 'implementation', provider: string, locations: CodeSnippet[]): LspSemanticEnvelope;
|
|
5
|
+
export declare function referencesEnvelope(query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, locations: CodeSnippet[]): LspSemanticEnvelope;
|
|
6
|
+
export declare function hoverEnvelope(_query: SymbolAnchoredSemanticQuery, anchor: SymbolAnchor, hover: unknown): Promise<LspSemanticEnvelope>;
|
|
7
|
+
export declare function buildReferencesByFile(locations: readonly ReferenceLocation[]): ReferencesByFile[];
|
|
8
|
+
export declare function normalizeHover(hover: unknown): {
|
|
9
|
+
markdown?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
range?: LSPRange;
|
|
12
|
+
};
|
|
13
|
+
export declare function stringifyHoverPart(part: unknown): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DEFAULT_SYMBOLS_PER_PAGE, DEFAULT_LOCATIONS_PER_PAGE, DEFAULT_CALLS_PER_PAGE, type PaginationInfo, emptyCategoryForReason, failedAnchorEnvelope, emptyEnvelope, paginateItems, } from './semanticEnvelopes/envelopeHelpers.js';
|
|
2
|
+
export { locationsEnvelope, referencesEnvelope, hoverEnvelope, buildReferencesByFile, normalizeHover, stringifyHoverPart, } from './semanticEnvelopes/locationEnvelopes.js';
|
|
3
|
+
export { callsEnvelope, typeHierarchyEnvelope, } from './semanticEnvelopes/callEnvelopes.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { SemanticContentType, WorkspaceSymbolSemanticQuery } from '../../shared/semanticTypes.js';
|
|
2
|
+
export declare function isNativeJsTsFile(uri: string): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Throw when a real language server cannot answer a semantic operation. We do
|
|
5
|
+
* NOT fabricate a syntactic/same-file stand-in: a faked answer is worse than an
|
|
6
|
+
* honest failure because the agent would trust it. The thrown ToolError is
|
|
7
|
+
* routed by the execution boundary into the standard `status:"error"` envelope
|
|
8
|
+
* (errorCode `lspServerUnavailable`), and the message directs the agent to text
|
|
9
|
+
* search instead. documentSymbols/structural search keep their tree-sitter path
|
|
10
|
+
* and never reach here.
|
|
11
|
+
*/
|
|
12
|
+
export declare function throwLspUnavailable(uri: string, op: SemanticContentType): never;
|
|
13
|
+
export declare function toLocalPath(value: string, workspaceRoot: string): string;
|
|
14
|
+
export declare function workspaceSymbolAnchorExtensions(): string[];
|
|
15
|
+
export declare function workspaceSymbolAnchorIncludeGlobs(): string[];
|
|
16
|
+
export declare function findWorkspaceSymbolAnchorByName(query: WorkspaceSymbolSemanticQuery, workspaceRoot: string): Promise<string | undefined>;
|
|
17
|
+
export declare function resolveWorkspaceSymbolAnchor(query: WorkspaceSymbolSemanticQuery, workspaceRoot: string): Promise<string>;
|
|
18
|
+
export declare function lspErrorMessage(error: unknown): string;
|
|
19
|
+
/**
|
|
20
|
+
* Native JS/TS document symbols via oxc, parsed into the LSP `DocumentSymbol[]`
|
|
21
|
+
* shape. Returns `null` when oxc declines the input so the caller can fall back
|
|
22
|
+
* to the "no symbols" empty state.
|
|
23
|
+
*/
|
|
24
|
+
export declare function nativeDocumentSymbols(uri: string, content: string): unknown[] | null;
|