@octocodeai/octocode-tools-core 16.6.3 → 17.0.2
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 +22 -50
- package/dist/direct.js +33 -38
- 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 -1
- 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 +1 -4
- package/dist/index.js +35 -40
- 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/graphView/filters.d.ts +25 -0
- package/dist/oql/adapters/graphView/nativeEdges.d.ts +5 -0
- package/dist/oql/adapters/graphView.d.ts +17 -16
- 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/defaults.d.ts +1 -1
- package/dist/oql/index.js +34 -39
- 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 +50 -35
- package/dist/oql/schemeText.d.ts +10 -13
- 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/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 -640
- package/dist/providers/github/paginationMetadata.d.ts +12 -0
- package/dist/providers/providerResults.d.ts +0 -1
- package/dist/schema.js +2 -2
- package/dist/scheme/pagination.d.ts +65 -0
- package/dist/shared/config/index.js +1 -1
- package/dist/shared/credentials/index.js +2 -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 +0 -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.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_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 +42 -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 +29 -2
- 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 -1
- 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 -71
- package/dist/tools/github_search_repos/scheme.d.ts +8 -0
- 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 +25 -1
- package/dist/tools/local_find_files/scheme.d.ts +32 -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 +95 -0
- package/dist/tools/local_view_structure/scheme.d.ts +31 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +61 -0
- 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/semanticTypes.d.ts +6 -0
- package/dist/tools/package_search/execution.d.ts +8 -0
- package/dist/tools/package_search/scheme.d.ts +43 -2
- 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/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/file/toolHelpers.d.ts +12 -0
- 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 -6
- package/package.json +42 -35
- 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 -144
- package/dist/tools/local_ripgrep/lspBoost.d.ts +0 -54
- package/dist/utils/parsers/ripgrep.d.ts +0 -11
|
@@ -79,6 +79,19 @@ export declare const BulkLspGetSemanticsQuerySchema: z.ZodObject<{
|
|
|
79
79
|
export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
80
80
|
base: z.ZodOptional<z.ZodString>;
|
|
81
81
|
shared: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
82
|
+
responsePagination: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
charOffset: z.ZodNumber;
|
|
84
|
+
charLength: z.ZodNumber;
|
|
85
|
+
totalChars: z.ZodNumber;
|
|
86
|
+
hasMore: z.ZodBoolean;
|
|
87
|
+
nextCharOffset: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
currentPage: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
totalPages: z.ZodOptional<z.ZodNumber>;
|
|
90
|
+
chunkMode: z.ZodOptional<z.ZodEnum<{
|
|
91
|
+
semantic: "semantic";
|
|
92
|
+
"char-limit": "char-limit";
|
|
93
|
+
}>>;
|
|
94
|
+
}, z.core.$strip>>;
|
|
82
95
|
results: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
83
96
|
id: z.ZodString;
|
|
84
97
|
status: z.ZodLiteral<"empty">;
|
|
@@ -360,9 +373,33 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
360
373
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
361
374
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
362
375
|
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
376
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
377
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
378
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
379
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
380
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
381
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
382
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
383
|
+
exact: "exact";
|
|
384
|
+
reported: "reported";
|
|
385
|
+
lowerBound: "lowerBound";
|
|
386
|
+
}>>;
|
|
387
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
388
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
389
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
363
390
|
}, z.core.$strip>>;
|
|
364
391
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
365
392
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
393
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
394
|
+
tool: z.ZodString;
|
|
395
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
396
|
+
why: z.ZodOptional<z.ZodString>;
|
|
397
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
398
|
+
exact: "exact";
|
|
399
|
+
heuristic: "heuristic";
|
|
400
|
+
}>>;
|
|
401
|
+
}, z.core.$strip>>>;
|
|
402
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
366
403
|
}, z.core.$strip>;
|
|
367
404
|
}, z.core.$strip>, z.ZodObject<{
|
|
368
405
|
id: z.ZodString;
|
|
@@ -651,9 +688,33 @@ export declare const LspGetSemanticsOutputSchema: z.ZodObject<{
|
|
|
651
688
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
652
689
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
653
690
|
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
691
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
692
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
693
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
694
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
695
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
696
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
697
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
698
|
+
exact: "exact";
|
|
699
|
+
reported: "reported";
|
|
700
|
+
lowerBound: "lowerBound";
|
|
701
|
+
}>>;
|
|
702
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
703
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
704
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
654
705
|
}, z.core.$strip>>;
|
|
655
706
|
summary: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
656
707
|
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
708
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
709
|
+
tool: z.ZodString;
|
|
710
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
711
|
+
why: z.ZodOptional<z.ZodString>;
|
|
712
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
713
|
+
exact: "exact";
|
|
714
|
+
heuristic: "heuristic";
|
|
715
|
+
}>>;
|
|
716
|
+
}, z.core.$strip>>>;
|
|
717
|
+
hints: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
657
718
|
}, z.core.$strip>;
|
|
658
719
|
}, z.core.$strip>]>>;
|
|
659
720
|
}, 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;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { LSPRange } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import { type LspGetSemanticsQuery, type LspSemanticEnvelope } from '../../shared/semanticTypes.js';
|
|
3
|
+
export type CompactSymbol = {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
line: number;
|
|
7
|
+
character: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
childCount: number;
|
|
10
|
+
containerName?: string;
|
|
11
|
+
};
|
|
12
|
+
type LspPositionLike = {
|
|
13
|
+
line: number;
|
|
14
|
+
character: number;
|
|
15
|
+
};
|
|
16
|
+
export declare function getDocumentSymbols(query: LspGetSemanticsQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
17
|
+
export declare function flattenDocumentSymbols(symbols: readonly unknown[]): CompactSymbol[];
|
|
18
|
+
export declare function flattenDocumentSymbol(value: unknown, output: CompactSymbol[], containerName?: string): void;
|
|
19
|
+
export declare function getSymbolRange(value: {
|
|
20
|
+
range?: unknown;
|
|
21
|
+
location?: unknown;
|
|
22
|
+
}): LSPRange | undefined;
|
|
23
|
+
export declare function isLspRange(value: unknown): value is LSPRange;
|
|
24
|
+
export declare function isPosition(value: unknown): value is LspPositionLike;
|
|
25
|
+
export declare function countTopLevelDocumentSymbols(symbols: readonly unknown[]): number;
|
|
26
|
+
export declare function countBy<T>(items: readonly T[], keyForItem: (item: T) => string): Record<string, number>;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LspSemanticEnvelope, DiagnosticSemanticQuery, WorkspaceSymbolSemanticQuery } from '../../shared/semanticTypes.js';
|
|
2
|
+
import type { CompactSymbol } from './documentSymbols.js';
|
|
3
|
+
type CompactWorkspaceSymbol = CompactSymbol & {
|
|
4
|
+
uri: string;
|
|
5
|
+
};
|
|
6
|
+
type DiagnosticItem = {
|
|
7
|
+
severity?: number;
|
|
8
|
+
message: string;
|
|
9
|
+
line: number;
|
|
10
|
+
endLine: number;
|
|
11
|
+
character: number;
|
|
12
|
+
code?: string | number;
|
|
13
|
+
source?: string;
|
|
14
|
+
};
|
|
15
|
+
export declare function getWorkspaceSymbols(query: WorkspaceSymbolSemanticQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
16
|
+
export declare function compactWorkspaceSymbols(raw: unknown[]): CompactWorkspaceSymbol[];
|
|
17
|
+
export declare function getFileDiagnostics(query: DiagnosticSemanticQuery): Promise<LspSemanticEnvelope | Record<string, unknown>>;
|
|
18
|
+
export declare function extractDiagnostics(raw: unknown): DiagnosticItem[];
|
|
19
|
+
export declare function parseDiagnostic(item: unknown): DiagnosticItem[];
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel for the semanticFileOps/ split (anchor & workspace resolution vs.
|
|
3
|
+
* documentSymbols vs. workspaceSymbols/diagnostics operations). Kept so no
|
|
4
|
+
* other file in the repo needs to change its import path.
|
|
5
|
+
*/
|
|
6
|
+
export { isNativeJsTsFile, throwLspUnavailable, toLocalPath, workspaceSymbolAnchorExtensions, workspaceSymbolAnchorIncludeGlobs, findWorkspaceSymbolAnchorByName, resolveWorkspaceSymbolAnchor, lspErrorMessage, nativeDocumentSymbols, } from './semanticFileOps/anchor.js';
|
|
7
|
+
export { type CompactSymbol, getDocumentSymbols, flattenDocumentSymbols, flattenDocumentSymbol, getSymbolRange, isLspRange, isPosition, countTopLevelDocumentSymbols, countBy, } from './semanticFileOps/documentSymbols.js';
|
|
8
|
+
export { getWorkspaceSymbols, compactWorkspaceSymbols, getFileDiagnostics, extractDiagnostics, parseDiagnostic, } from './semanticFileOps/workspaceSymbolsAndDiagnostics.js';
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { CallHierarchyItem, IncomingCall, LSPRange, OutgoingCall } from '@octocodeai/octocode-engine/lsp/types';
|
|
2
|
+
import { type CompactLocation, type LspGetSemanticsQuery, type LspSemanticEnvelope } from '../shared/semanticTypes.js';
|
|
3
|
+
export type CompactCallTarget = {
|
|
4
|
+
name: string;
|
|
5
|
+
kind: string;
|
|
6
|
+
uri: string;
|
|
7
|
+
line: number;
|
|
8
|
+
endLine: number;
|
|
9
|
+
selectionLine?: number;
|
|
10
|
+
};
|
|
11
|
+
export type CompactCall = {
|
|
12
|
+
direction: 'incoming' | 'outgoing';
|
|
13
|
+
item: CompactCallTarget;
|
|
14
|
+
ranges: Array<{
|
|
15
|
+
line: number;
|
|
16
|
+
character: number;
|
|
17
|
+
}>;
|
|
18
|
+
rangeCount: number;
|
|
19
|
+
rangeSampleCount: number;
|
|
20
|
+
contentPreview?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function attachSemanticRawEvidence<T extends object>(result: T): T;
|
|
23
|
+
export declare function formatSemanticResult(query: LspGetSemanticsQuery, result: LspSemanticEnvelope | Record<string, unknown>): LspSemanticEnvelope | Record<string, unknown>;
|
|
24
|
+
export declare function withSemanticNext(result: LspSemanticEnvelope | Record<string, unknown>): LspSemanticEnvelope | Record<string, unknown>;
|
|
25
|
+
export declare function isSemanticEnvelope(value: LspSemanticEnvelope | Record<string, unknown>): value is LspSemanticEnvelope;
|
|
26
|
+
export declare function compactSemanticEnvelope(envelope: LspSemanticEnvelope): LspSemanticEnvelope;
|
|
27
|
+
export declare function compactSemanticPayload(payload: LspSemanticEnvelope['payload']): LspSemanticEnvelope['payload'];
|
|
28
|
+
export declare function formatSymbolRow(value: unknown): string;
|
|
29
|
+
export declare function formatLocationRow(location: CompactLocation | string): string;
|
|
30
|
+
export declare function formatReferenceFileRow(value: unknown): string;
|
|
31
|
+
export declare function formatCallRow(value: unknown): string;
|
|
32
|
+
export declare function formatCallTargetRow(value: unknown): string;
|
|
33
|
+
export declare function formatRangeRow(value: unknown): string;
|
|
34
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
35
|
+
export declare function stringField(record: Record<string, unknown>, key: string, fallback?: string): string;
|
|
36
|
+
export declare function numberField(record: Record<string, unknown>, key: string, fallback?: number): number;
|
|
37
|
+
export declare function arrayField(record: Record<string, unknown>, key: string): unknown[];
|
|
38
|
+
export declare function oneLine(value: string, maxLength: number): string;
|
|
39
|
+
export declare function compactIncomingCall(call: IncomingCall & {
|
|
40
|
+
direction: 'incoming';
|
|
41
|
+
}, contextLines: number): CompactCall;
|
|
42
|
+
export declare function compactOutgoingCall(call: OutgoingCall & {
|
|
43
|
+
direction: 'outgoing';
|
|
44
|
+
}, contextLines: number): CompactCall;
|
|
45
|
+
export declare function compactCallItem(item: CallHierarchyItem): CompactCallTarget;
|
|
46
|
+
export declare function compactRanges(ranges: readonly LSPRange[]): {
|
|
47
|
+
line: number;
|
|
48
|
+
character: number;
|
|
49
|
+
}[];
|
|
50
|
+
export declare function contentPreview(item: CallHierarchyItem, contextLines: number): {
|
|
51
|
+
contentPreview?: string;
|
|
52
|
+
};
|
|
53
|
+
export declare function symbolKindName(kind: unknown): string;
|
|
@@ -161,4 +161,10 @@ export type LspSemanticEnvelope = {
|
|
|
161
161
|
pagination?: unknown;
|
|
162
162
|
warnings?: string[];
|
|
163
163
|
hints?: string[];
|
|
164
|
+
next?: Record<string, {
|
|
165
|
+
tool: string;
|
|
166
|
+
query: Record<string, unknown>;
|
|
167
|
+
why?: string;
|
|
168
|
+
confidence?: 'exact' | 'heuristic';
|
|
169
|
+
}>;
|
|
164
170
|
};
|
|
@@ -2,6 +2,7 @@ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import type { NpmPackageQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
4
|
type NpmSearchQuery = z.input<typeof NpmPackageQuerySchema>;
|
|
5
|
+
import type { PackageResult } from '../../utils/package/common.js';
|
|
5
6
|
import type { ToolExecutionArgs } from '../../types/execution.js';
|
|
6
7
|
type PackageData = {
|
|
7
8
|
name: string;
|
|
@@ -13,6 +14,12 @@ type PackageData = {
|
|
|
13
14
|
repositoryDirectory?: string;
|
|
14
15
|
repositoryId?: string;
|
|
15
16
|
next?: Record<string, unknown>;
|
|
17
|
+
warnings?: string[];
|
|
18
|
+
diagnostics?: Array<{
|
|
19
|
+
level: 'info' | 'warning' | 'error';
|
|
20
|
+
message: string;
|
|
21
|
+
code?: string;
|
|
22
|
+
}>;
|
|
16
23
|
};
|
|
17
24
|
type PackageRepositoryData = {
|
|
18
25
|
repository: string;
|
|
@@ -25,6 +32,7 @@ type CompactPackageData = {
|
|
|
25
32
|
packages: PackageData[];
|
|
26
33
|
repositories?: Record<string, PackageRepositoryData>;
|
|
27
34
|
};
|
|
35
|
+
export declare function formatPackageData(pkg: PackageResult): PackageData;
|
|
28
36
|
export declare function compactPackageRepositories(packages: PackageData[]): CompactPackageData;
|
|
29
37
|
type PackagePagination = {
|
|
30
38
|
currentPage: number;
|
|
@@ -25,14 +25,41 @@ export declare const NpmSearchOutputLocalSchema: z.ZodObject<{
|
|
|
25
25
|
repository: z.ZodOptional<z.ZodString>;
|
|
26
26
|
repositoryDirectory: z.ZodOptional<z.ZodString>;
|
|
27
27
|
repositoryId: z.ZodOptional<z.ZodString>;
|
|
28
|
-
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.
|
|
28
|
+
next: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
29
|
+
tool: z.ZodString;
|
|
30
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
31
|
+
why: z.ZodOptional<z.ZodString>;
|
|
32
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
33
|
+
exact: "exact";
|
|
34
|
+
heuristic: "heuristic";
|
|
35
|
+
}>>;
|
|
36
|
+
}, z.core.$strip>>>;
|
|
37
|
+
warnings: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
38
|
+
diagnostics: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
+
level: z.ZodEnum<{
|
|
40
|
+
error: "error";
|
|
41
|
+
info: "info";
|
|
42
|
+
warning: "warning";
|
|
43
|
+
}>;
|
|
44
|
+
message: z.ZodString;
|
|
45
|
+
field: z.ZodOptional<z.ZodString>;
|
|
46
|
+
code: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$strip>>>;
|
|
29
48
|
}, z.core.$loose>>>;
|
|
30
49
|
repositories: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
31
50
|
repository: z.ZodString;
|
|
32
51
|
owner: z.ZodString;
|
|
33
52
|
repo: z.ZodString;
|
|
34
53
|
repositoryDirectory: z.ZodOptional<z.ZodString>;
|
|
35
|
-
next: z.ZodRecord<z.ZodString, z.
|
|
54
|
+
next: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
55
|
+
tool: z.ZodString;
|
|
56
|
+
query: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
57
|
+
why: z.ZodOptional<z.ZodString>;
|
|
58
|
+
confidence: z.ZodOptional<z.ZodEnum<{
|
|
59
|
+
exact: "exact";
|
|
60
|
+
heuristic: "heuristic";
|
|
61
|
+
}>>;
|
|
62
|
+
}, z.core.$strip>>;
|
|
36
63
|
}, z.core.$loose>>>;
|
|
37
64
|
pagination: z.ZodOptional<z.ZodObject<{
|
|
38
65
|
currentPage: z.ZodNumber;
|
|
@@ -41,6 +68,20 @@ export declare const NpmSearchOutputLocalSchema: z.ZodObject<{
|
|
|
41
68
|
nextPage: z.ZodOptional<z.ZodNumber>;
|
|
42
69
|
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
43
70
|
totalItems: z.ZodOptional<z.ZodNumber>;
|
|
71
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
72
|
+
totalFound: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
returned: z.ZodOptional<z.ZodNumber>;
|
|
74
|
+
totalMatches: z.ZodOptional<z.ZodNumber>;
|
|
75
|
+
reportedTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
76
|
+
reachableTotalMatches: z.ZodOptional<z.ZodNumber>;
|
|
77
|
+
totalMatchesKind: z.ZodOptional<z.ZodEnum<{
|
|
78
|
+
exact: "exact";
|
|
79
|
+
reported: "reported";
|
|
80
|
+
lowerBound: "lowerBound";
|
|
81
|
+
}>>;
|
|
82
|
+
totalMatchesCapped: z.ZodOptional<z.ZodBoolean>;
|
|
83
|
+
totalResults: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
itemsPerPage: z.ZodOptional<z.ZodNumber>;
|
|
44
85
|
}, z.core.$strip>>;
|
|
45
86
|
}, z.core.$loose>>;
|
|
46
87
|
status: z.ZodOptional<z.ZodString>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { CodeSearchResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubCodeSearchQuerySchema } from '@octocodeai/octocode-core/schemas';
|
|
4
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
|
+
type GitHubCodeSearchQuery = z.infer<typeof GitHubCodeSearchQuerySchema>;
|
|
6
|
+
/**
|
|
7
|
+
* Char-boundary truncation mirroring the Rust engine's `truncate_unicode`:
|
|
8
|
+
* keeps at most `maxChars` Unicode scalars and appends `...` when it cuts.
|
|
9
|
+
* Never slices UTF-8 mid-codepoint or mid-token — the single data-layer bound
|
|
10
|
+
* for GitHub code-search match fragments (the render layer must not re-trim).
|
|
11
|
+
*/
|
|
12
|
+
export declare function truncateSnippetChars(value: string, maxChars?: number): string;
|
|
13
|
+
export declare function mapCodeSearchToolQuery(query: WithOptionalMeta<GitHubCodeSearchQuery>): {
|
|
14
|
+
keywords: string[];
|
|
15
|
+
projectId: string;
|
|
16
|
+
owner: string;
|
|
17
|
+
path: string;
|
|
18
|
+
filename: string;
|
|
19
|
+
extension: string;
|
|
20
|
+
language: string | undefined;
|
|
21
|
+
match: "file" | "path";
|
|
22
|
+
limit: number | undefined;
|
|
23
|
+
page: number;
|
|
24
|
+
mainResearchGoal: string;
|
|
25
|
+
researchGoal: string;
|
|
26
|
+
reasoning: string;
|
|
27
|
+
};
|
|
28
|
+
export interface CodeSearchGroupedMatch {
|
|
29
|
+
path: string;
|
|
30
|
+
value?: string;
|
|
31
|
+
pathOnly?: boolean;
|
|
32
|
+
matchIndices?: Array<{
|
|
33
|
+
start: number;
|
|
34
|
+
end: number;
|
|
35
|
+
lineOffset: number;
|
|
36
|
+
}>;
|
|
37
|
+
url?: string;
|
|
38
|
+
}
|
|
39
|
+
export interface CodeSearchGroupedResult {
|
|
40
|
+
id: string;
|
|
41
|
+
queryId?: string;
|
|
42
|
+
owner: string;
|
|
43
|
+
repo: string;
|
|
44
|
+
matches: CodeSearchGroupedMatch[];
|
|
45
|
+
}
|
|
46
|
+
export interface CodeSearchPagination {
|
|
47
|
+
currentPage: number;
|
|
48
|
+
totalPages: number;
|
|
49
|
+
perPage: number;
|
|
50
|
+
totalMatches: number;
|
|
51
|
+
reportedTotalMatches?: number;
|
|
52
|
+
reachableTotalMatches?: number;
|
|
53
|
+
totalMatchesKind?: 'exact' | 'reported' | 'lowerBound';
|
|
54
|
+
totalMatchesCapped?: boolean;
|
|
55
|
+
hasMore: boolean;
|
|
56
|
+
nextPage?: number;
|
|
57
|
+
uniqueFileCount?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface CodeSearchFlatResult {
|
|
60
|
+
results: CodeSearchGroupedResult[];
|
|
61
|
+
pagination?: CodeSearchPagination;
|
|
62
|
+
nonExistentScope?: boolean;
|
|
63
|
+
incompleteResults?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export declare function mapCodeSearchProviderResult(data: CodeSearchResult, query: WithOptionalMeta<GitHubCodeSearchQuery>): CodeSearchFlatResult;
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FileContentResult as ProviderFileContentResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
4
|
+
import { FileContentQueryLocalSchema } from '../github_fetch_content/scheme.js';
|
|
5
|
+
type LocalFileContentQuery = z.infer<typeof FileContentQueryLocalSchema> & {
|
|
6
|
+
minify: import('../../scheme/fields.js').MinifyMode;
|
|
7
|
+
};
|
|
8
|
+
export declare function mapFileContentToolQuery(query: LocalFileContentQuery): {
|
|
9
|
+
projectId: string;
|
|
10
|
+
path: string;
|
|
11
|
+
ref: string;
|
|
12
|
+
startLine: number;
|
|
13
|
+
endLine: number;
|
|
14
|
+
matchString: string;
|
|
15
|
+
contextLines: number;
|
|
16
|
+
fullContent: boolean;
|
|
17
|
+
forceRefresh: boolean;
|
|
18
|
+
charOffset: number;
|
|
19
|
+
charLength: number;
|
|
20
|
+
minify: "none" | "standard" | "symbols";
|
|
21
|
+
matchStringIsRegex: boolean;
|
|
22
|
+
matchStringCaseSensitive: boolean;
|
|
23
|
+
mainResearchGoal: string;
|
|
24
|
+
researchGoal: string;
|
|
25
|
+
reasoning: string;
|
|
26
|
+
};
|
|
27
|
+
export declare function mapFileContentProviderResult(data: ProviderFileContentResult, query: WithOptionalMeta<LocalFileContentQuery>): Record<string, unknown>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { PullRequestSearchResult as ProviderPullRequestSearchResult } from '../../providers/types.js';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import type { GitHubPullRequestSearchQueryLocalSchema } from '../github_search_pull_requests/scheme.js';
|
|
4
|
+
import type { WithOptionalMeta } from '../../types/execution.js';
|
|
5
|
+
type GitHubPullRequestSearchQuery = z.infer<typeof GitHubPullRequestSearchQueryLocalSchema>;
|
|
6
|
+
type PRDefaultKeys = 'order' | 'limit' | 'page';
|
|
7
|
+
type PartialPRQuery = WithOptionalMeta<Omit<GitHubPullRequestSearchQuery, PRDefaultKeys> & Partial<Pick<GitHubPullRequestSearchQuery, PRDefaultKeys>>>;
|
|
8
|
+
export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
|
|
9
|
+
projectId: string;
|
|
10
|
+
owner: string;
|
|
11
|
+
query: string;
|
|
12
|
+
number: number;
|
|
13
|
+
state: "open" | "closed" | "merged" | "all" | undefined;
|
|
14
|
+
author: string;
|
|
15
|
+
assignee: string;
|
|
16
|
+
commenter: string;
|
|
17
|
+
involves: string;
|
|
18
|
+
mentions: string;
|
|
19
|
+
reviewRequested: string;
|
|
20
|
+
reviewedBy: string;
|
|
21
|
+
labels: string[];
|
|
22
|
+
noLabel: boolean;
|
|
23
|
+
noMilestone: boolean;
|
|
24
|
+
noProject: boolean;
|
|
25
|
+
noAssignee: boolean;
|
|
26
|
+
baseBranch: string;
|
|
27
|
+
headBranch: string;
|
|
28
|
+
created: string;
|
|
29
|
+
updated: string;
|
|
30
|
+
closed: string;
|
|
31
|
+
mergedAt: string;
|
|
32
|
+
comments: string;
|
|
33
|
+
reactions: string;
|
|
34
|
+
interactions: string;
|
|
35
|
+
draft: boolean;
|
|
36
|
+
match: ("title" | "body" | "comments")[];
|
|
37
|
+
milestone: string;
|
|
38
|
+
language: string;
|
|
39
|
+
checks: "success" | "failure" | "pending";
|
|
40
|
+
review: "none" | "approved" | "changes_requested" | "required";
|
|
41
|
+
locked: boolean;
|
|
42
|
+
visibility: "public" | "private";
|
|
43
|
+
teamMentions: string;
|
|
44
|
+
project: string;
|
|
45
|
+
archived: boolean | undefined;
|
|
46
|
+
content: unknown;
|
|
47
|
+
reviewMode: "full" | "summary";
|
|
48
|
+
filePage: number;
|
|
49
|
+
commentPage: number;
|
|
50
|
+
commitPage: number;
|
|
51
|
+
itemsPerPage: number;
|
|
52
|
+
sort: "created" | "updated" | "best-match" | "comments" | "reactions" | undefined;
|
|
53
|
+
order: "asc" | "desc" | undefined;
|
|
54
|
+
limit: number;
|
|
55
|
+
page: number;
|
|
56
|
+
charOffset: number;
|
|
57
|
+
charLength: number;
|
|
58
|
+
mainResearchGoal: string;
|
|
59
|
+
researchGoal: string;
|
|
60
|
+
reasoning: string;
|
|
61
|
+
};
|
|
62
|
+
export declare function mapPullRequestProviderResultData(data: ProviderPullRequestSearchResult, options?: {
|
|
63
|
+
includeFileChanges?: boolean;
|
|
64
|
+
}): {
|
|
65
|
+
pullRequests: {
|
|
66
|
+
sanitizationWarnings?: string[];
|
|
67
|
+
fileChanges?: {
|
|
68
|
+
path: string;
|
|
69
|
+
status: string;
|
|
70
|
+
additions: number;
|
|
71
|
+
deletions: number;
|
|
72
|
+
patch?: string;
|
|
73
|
+
}[];
|
|
74
|
+
reviewSummary: {
|
|
75
|
+
totalComments: number;
|
|
76
|
+
inlineComments: number;
|
|
77
|
+
discussionComments: number;
|
|
78
|
+
commenters: string[];
|
|
79
|
+
latestCommentAt?: string;
|
|
80
|
+
themes: string[];
|
|
81
|
+
};
|
|
82
|
+
commits: {
|
|
83
|
+
sha: string;
|
|
84
|
+
message: string;
|
|
85
|
+
author: string;
|
|
86
|
+
date: string;
|
|
87
|
+
}[];
|
|
88
|
+
reviews: {
|
|
89
|
+
id: string;
|
|
90
|
+
user: string;
|
|
91
|
+
state: string;
|
|
92
|
+
body: string;
|
|
93
|
+
submittedAt?: string;
|
|
94
|
+
commitId?: string;
|
|
95
|
+
}[];
|
|
96
|
+
comments: {
|
|
97
|
+
bodyPagination: {
|
|
98
|
+
charOffset: number;
|
|
99
|
+
charLength: number;
|
|
100
|
+
totalChars: number;
|
|
101
|
+
hasMore: boolean;
|
|
102
|
+
nextCharOffset?: number;
|
|
103
|
+
};
|
|
104
|
+
id: string;
|
|
105
|
+
author: string;
|
|
106
|
+
body: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
commentType?: "discussion" | "review_inline";
|
|
110
|
+
path?: string;
|
|
111
|
+
line?: number;
|
|
112
|
+
in_reply_to_id?: number;
|
|
113
|
+
}[];
|
|
114
|
+
url: string;
|
|
115
|
+
state: "open" | "closed" | "merged";
|
|
116
|
+
draft: boolean;
|
|
117
|
+
author: string;
|
|
118
|
+
assignees: string[];
|
|
119
|
+
labels: string[];
|
|
120
|
+
sourceBranch: string;
|
|
121
|
+
targetBranch: string;
|
|
122
|
+
sourceSha: string;
|
|
123
|
+
targetSha: string;
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
closedAt: string;
|
|
127
|
+
mergedAt: string;
|
|
128
|
+
commentsCount: number;
|
|
129
|
+
changedFilesCount: number;
|
|
130
|
+
additions: number;
|
|
131
|
+
deletions: number;
|
|
132
|
+
bodyPagination: {
|
|
133
|
+
charOffset: number;
|
|
134
|
+
charLength: number;
|
|
135
|
+
totalChars: number;
|
|
136
|
+
hasMore: boolean;
|
|
137
|
+
nextCharOffset?: number;
|
|
138
|
+
};
|
|
139
|
+
number: number;
|
|
140
|
+
title: string;
|
|
141
|
+
body: string;
|
|
142
|
+
}[];
|
|
143
|
+
resultData: Record<string, unknown>;
|
|
144
|
+
pagination: {
|
|
145
|
+
nextPage?: number;
|
|
146
|
+
hasMore: boolean;
|
|
147
|
+
uniqueFileCount?: number;
|
|
148
|
+
totalMatchesCapped?: boolean;
|
|
149
|
+
totalMatchesKind?: "exact" | "reported" | "lowerBound";
|
|
150
|
+
reachableTotalMatches?: number;
|
|
151
|
+
reportedTotalMatches?: number;
|
|
152
|
+
totalMatches?: number;
|
|
153
|
+
currentPage: number;
|
|
154
|
+
totalPages: number;
|
|
155
|
+
perPage: number;
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
export {};
|