@octocodeai/octocode-tools-core 17.0.2 → 18.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +266 -123
- package/dist/direct.d.ts +1 -1
- package/dist/direct.js +51 -36
- package/dist/github/canonicalRepo.d.ts +14 -0
- package/dist/github/codeSearch/matchPositions.d.ts +11 -0
- package/dist/github/codeSearch.d.ts +2 -1
- package/dist/github/compare.d.ts +51 -0
- package/dist/github/dateWindow.d.ts +4 -0
- package/dist/github/discussions.d.ts +45 -0
- package/dist/github/githubAPI.d.ts +7 -13
- package/dist/github/history/commitFiles.d.ts +39 -0
- package/dist/github/history.d.ts +1 -0
- package/dist/github/issues/types.d.ts +8 -8
- package/dist/github/prTransformation.d.ts +24 -25
- package/dist/github/queryBuilders/base.d.ts +0 -1
- package/dist/github/queryBuilders/issues.d.ts +0 -6
- package/dist/github/releases.d.ts +9 -1
- package/dist/github/responseHeaders.d.ts +6 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +55 -40
- package/dist/providers/github/githubPullRequests.d.ts +9 -0
- package/dist/providers/github/paginationMetadata.d.ts +6 -5
- package/dist/providers/providerQueries.d.ts +11 -6
- package/dist/providers/providerResults.d.ts +9 -1
- package/dist/schema.d.ts +0 -1
- package/dist/schema.js +1 -2
- package/dist/scheme/pagination.d.ts +5 -13
- package/dist/scheme/responseEnvelope.d.ts +28 -22
- package/dist/security/bridge.d.ts +3 -2
- package/dist/shared/config/index.d.ts +0 -1
- package/dist/shared/config/index.js +1 -1
- package/dist/shared/languageSelectors/classify.d.ts +2 -2
- package/dist/shared/languageSelectors/data.d.ts +4 -4
- package/dist/shared/languageSelectors.d.ts +1 -1
- package/dist/shared/paths.d.ts +1 -4
- package/dist/tools/directToolCatalog/toolCatalogDefinitions.d.ts +10 -11
- package/dist/tools/directToolCatalog/toolCatalogFormatters.d.ts +5 -0
- package/dist/tools/directToolCatalog.meta.d.ts +1 -0
- package/dist/tools/github_clone_repo/contentSize.d.ts +9 -0
- package/dist/tools/github_clone_repo/scheme.d.ts +28 -80
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +4 -3
- package/dist/tools/github_fetch_content/scheme.d.ts +92 -140
- package/dist/tools/github_fetch_content/types.d.ts +2 -1
- package/dist/tools/github_search_code/scheme.d.ts +39 -87
- package/dist/tools/github_search_discussions/execution.d.ts +15 -0
- package/dist/tools/github_search_discussions/scheme.d.ts +16 -0
- package/dist/tools/github_search_pull_requests/contentResponse/fileSurfaces.d.ts +3 -18
- package/dist/tools/github_search_pull_requests/scheme.d.ts +97 -119
- package/dist/tools/github_search_pull_requests/splitExecutions.d.ts +8 -0
- package/dist/tools/github_search_pull_requests/splitSchemes.d.ts +219 -0
- package/dist/tools/github_search_pull_requests/types.d.ts +28 -29
- package/dist/tools/github_search_repos/execution.d.ts +0 -2
- package/dist/tools/github_search_repos/scheme.d.ts +36 -64
- package/dist/tools/github_view_repo_structure/scheme.d.ts +37 -66
- package/dist/tools/local_dead_code/deadCodeScan.d.ts +26 -0
- package/dist/tools/local_dead_code/entrypoints.d.ts +16 -0
- package/dist/tools/local_dead_code/execution.d.ts +4 -0
- package/dist/tools/local_dead_code/graphBuilder.d.ts +43 -0
- package/dist/tools/local_dead_code/importResolver.d.ts +6 -0
- package/dist/tools/local_dead_code/local_dead_code.d.ts +5 -0
- package/dist/tools/local_dead_code/reachability.d.ts +21 -0
- package/dist/tools/local_dead_code/retention.d.ts +22 -0
- package/dist/tools/local_dead_code/scheme.d.ts +51 -0
- package/dist/tools/local_dead_code/types.d.ts +56 -0
- package/dist/tools/local_fetch_content/execution.d.ts +0 -1
- package/dist/tools/local_fetch_content/fetchContent/extraction.d.ts +6 -0
- package/dist/tools/local_fetch_content/fetchContent/validation.d.ts +9 -1
- package/dist/tools/local_fetch_content/fetchContent.d.ts +0 -1
- package/dist/tools/local_fetch_content/scheme.d.ts +28 -90
- package/dist/tools/local_find_files/execution.d.ts +0 -1
- package/dist/tools/local_find_files/findFiles.d.ts +0 -3
- package/dist/tools/local_find_files/findFilesNext.d.ts +26 -0
- package/dist/tools/local_find_files/pathPatternBraces.d.ts +20 -0
- package/dist/tools/local_find_files/scheme.d.ts +19 -81
- package/dist/tools/local_ripgrep/captureBudget.d.ts +25 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingProfiles.d.ts +1 -0
- package/dist/tools/local_ripgrep/rankingProfile/rankingResults.d.ts +1 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder/searchNext.d.ts +1 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +89 -190
- package/dist/tools/local_view_structure/execution.d.ts +0 -1
- package/dist/tools/local_view_structure/local_view_structure.d.ts +0 -1
- package/dist/tools/local_view_structure/scheme.d.ts +34 -87
- package/dist/tools/local_view_structure/structureFilters.d.ts +2 -4
- package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
- package/dist/tools/local_view_structure/viewStructureNext.d.ts +25 -0
- package/dist/tools/lsp/semantic_content/index.d.ts +2 -1
- package/dist/tools/lsp/semantic_content/scheme.d.ts +167 -642
- package/dist/tools/lsp/semantic_content/semanticAnchored.d.ts +8 -2
- package/dist/tools/lsp/semantic_content/semanticEnvelopes/locationEnvelopes.d.ts +2 -1
- package/dist/tools/lsp/semantic_content/semanticFileOps/anchor.d.ts +17 -1
- package/dist/tools/lsp/semantic_content/semanticNext.d.ts +2 -0
- package/dist/tools/lsp/semantic_content/semanticPresentation.d.ts +1 -1
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +14 -2
- package/dist/tools/lsp/shared/semanticTypes.d.ts +14 -1
- package/dist/tools/package_search/execution.d.ts +9 -6
- package/dist/tools/package_search/queryHelpers.d.ts +8 -0
- package/dist/tools/package_search/scheme.d.ts +30 -86
- package/dist/tools/providerMappers/codeSearch.d.ts +0 -1
- package/dist/tools/providerMappers/pullRequests.d.ts +0 -13
- package/dist/tools/providerMappers/repoSearch.d.ts +1 -5
- package/dist/tools/providerMappers/repoStructure.d.ts +4 -0
- package/dist/tools/toolCatalogFactory.d.ts +25 -0
- package/dist/tools/toolConfig.d.ts +9 -24
- package/dist/tools/toolNames.d.ts +2 -2
- package/dist/tools/toolSchemaImports.d.ts +3 -1
- package/dist/types/execution.d.ts +1 -0
- package/dist/types/toolOutput.d.ts +38 -0
- package/dist/utils/contextUtils.d.ts +6 -0
- package/dist/utils/core/types.d.ts +4 -0
- package/dist/utils/file/configFiles.d.ts +70 -0
- package/dist/utils/jsSymbolNames.d.ts +6 -0
- package/package.json +4 -8
- package/dist/oql/adapters/compile.d.ts +0 -25
- package/dist/oql/adapters/github/execute.d.ts +0 -16
- package/dist/oql/adapters/github/provider-diagnostics.d.ts +0 -14
- package/dist/oql/adapters/github/shared.d.ts +0 -75
- package/dist/oql/adapters/github.d.ts +0 -14
- package/dist/oql/adapters/graphProof.d.ts +0 -6
- package/dist/oql/adapters/graphView/filters.d.ts +0 -25
- package/dist/oql/adapters/graphView/nativeEdges.d.ts +0 -5
- package/dist/oql/adapters/graphView.d.ts +0 -29
- package/dist/oql/adapters/local/code.d.ts +0 -3
- package/dist/oql/adapters/local/codeBoolean.d.ts +0 -3
- package/dist/oql/adapters/local/fileRowOps.d.ts +0 -11
- package/dist/oql/adapters/local/files.d.ts +0 -3
- package/dist/oql/adapters/local/filesBoolean.d.ts +0 -10
- package/dist/oql/adapters/local/filesContentLeaf.d.ts +0 -12
- package/dist/oql/adapters/local/filesUniverse.d.ts +0 -6
- package/dist/oql/adapters/local/findToolType.d.ts +0 -10
- package/dist/oql/adapters/local/predicates.d.ts +0 -18
- package/dist/oql/adapters/local/scope.d.ts +0 -14
- package/dist/oql/adapters/local/searchToolType.d.ts +0 -7
- package/dist/oql/adapters/local/structureContent.d.ts +0 -6
- package/dist/oql/adapters/local/types.d.ts +0 -34
- package/dist/oql/adapters/local.d.ts +0 -4
- package/dist/oql/adapters/materialize.d.ts +0 -11
- package/dist/oql/adapters/pagination.d.ts +0 -21
- package/dist/oql/adapters/researchTargets/diff.d.ts +0 -16
- package/dist/oql/adapters/researchTargets/graph.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/history.d.ts +0 -20
- package/dist/oql/adapters/researchTargets/pagination.d.ts +0 -54
- package/dist/oql/adapters/researchTargets/repositories.d.ts +0 -4
- package/dist/oql/adapters/researchTargets/research.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/rows.d.ts +0 -16
- package/dist/oql/adapters/researchTargets/semantics.d.ts +0 -3
- package/dist/oql/adapters/researchTargets/shared.d.ts +0 -11
- package/dist/oql/adapters/researchTargets.d.ts +0 -8
- package/dist/oql/adapters/resultMap.d.ts +0 -27
- package/dist/oql/adapters/ruleYaml.d.ts +0 -11
- package/dist/oql/adapters/runner.d.ts +0 -21
- package/dist/oql/capabilities.d.ts +0 -31
- package/dist/oql/defaults.d.ts +0 -26
- package/dist/oql/diagnostics.d.ts +0 -25
- package/dist/oql/diffLanes.d.ts +0 -29
- package/dist/oql/envelope.d.ts +0 -21
- package/dist/oql/features.d.ts +0 -7
- package/dist/oql/index.d.ts +0 -27
- package/dist/oql/index.js +0 -47
- package/dist/oql/normalize/batch.d.ts +0 -2
- package/dist/oql/normalize/materialize.d.ts +0 -2
- package/dist/oql/normalize/params.d.ts +0 -2
- package/dist/oql/normalize/query.d.ts +0 -2
- package/dist/oql/normalize/scope.d.ts +0 -2
- package/dist/oql/normalize/shared.d.ts +0 -7
- package/dist/oql/normalize/source.d.ts +0 -2
- package/dist/oql/normalize/where.d.ts +0 -2
- package/dist/oql/normalize.d.ts +0 -20
- package/dist/oql/planner/planDiagnostics.d.ts +0 -13
- package/dist/oql/planner/predicateRouting.d.ts +0 -35
- package/dist/oql/planner.d.ts +0 -7
- package/dist/oql/predicateUtils.d.ts +0 -3
- package/dist/oql/research/analyze/manifest-scan.d.ts +0 -4
- package/dist/oql/research/analyze/source-graph.d.ts +0 -7
- package/dist/oql/research/analyze/symbol-scoring.d.ts +0 -4
- package/dist/oql/research/analyze/types.d.ts +0 -163
- package/dist/oql/research/analyze/utils.d.ts +0 -16
- package/dist/oql/research/analyze.d.ts +0 -3
- package/dist/oql/research/packets/builders.d.ts +0 -4
- package/dist/oql/research/packets/types.d.ts +0 -91
- package/dist/oql/research/packets.d.ts +0 -21
- package/dist/oql/run/batch.d.ts +0 -3
- package/dist/oql/run/continuations/records.d.ts +0 -19
- package/dist/oql/run/continuations/registry.d.ts +0 -22
- package/dist/oql/run/continuations/semantics.d.ts +0 -3
- package/dist/oql/run/continuations/types.d.ts +0 -12
- package/dist/oql/run/dryRun.d.ts +0 -11
- package/dist/oql/run/paths.d.ts +0 -15
- package/dist/oql/run/proofGrades.d.ts +0 -8
- package/dist/oql/run/select.d.ts +0 -10
- package/dist/oql/run/single.d.ts +0 -22
- package/dist/oql/run.d.ts +0 -5
- package/dist/oql/schema/predicates.d.ts +0 -12
- package/dist/oql/schema.d.ts +0 -1049
- package/dist/oql/schemeText.d.ts +0 -152
- package/dist/oql/shorthand/predicates.d.ts +0 -15
- package/dist/oql/shorthand/query-controls.d.ts +0 -18
- package/dist/oql/shorthand/target-params.d.ts +0 -9
- package/dist/oql/shorthand/types.d.ts +0 -159
- package/dist/oql/shorthand/utils.d.ts +0 -7
- package/dist/oql/shorthand.d.ts +0 -8
- package/dist/oql/targetParams.d.ts +0 -7
- package/dist/oql/transformers/contract.d.ts +0 -19
- package/dist/oql/transformers/github/code.d.ts +0 -9
- package/dist/oql/transformers/github/common.d.ts +0 -14
- package/dist/oql/transformers/language.d.ts +0 -1
- package/dist/oql/transformers/registry.d.ts +0 -16
- package/dist/oql/transformers/types.d.ts +0 -11
- package/dist/oql/types/diagnostics.d.ts +0 -22
- package/dist/oql/types/envelope.d.ts +0 -78
- package/dist/oql/types/guards.d.ts +0 -9
- package/dist/oql/types/planner.d.ts +0 -46
- package/dist/oql/types/predicates.d.ts +0 -93
- package/dist/oql/types/query.d.ts +0 -143
- package/dist/oql/types/recordData.d.ts +0 -127
- package/dist/oql/types/recordRows.d.ts +0 -48
- package/dist/oql/types/results.d.ts +0 -118
- package/dist/oql/types/targets.d.ts +0 -22
- package/dist/oql/types.d.ts +0 -27
- package/dist/tools/oql_search/execution.d.ts +0 -7
- package/dist/tools/toolMetadata/descriptionOverrides.d.ts +0 -4
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result/record shaping shared by every research-target adapter: turning a
|
|
3
|
-
* backing tool's `data` payload into generic `OqlRecordResultRow`s, deriving
|
|
4
|
-
* a citeable `id` per record type, and trimming parent-level metadata/shared
|
|
5
|
-
* repository refs that ride alongside the array payload.
|
|
6
|
-
*/
|
|
7
|
-
import type { OqlRecordResultRow, QuerySource } from '../../types.js';
|
|
8
|
-
/** Known array-valued payload fields, in priority order. */
|
|
9
|
-
export declare const RECORD_ARRAY_KEYS: string[];
|
|
10
|
-
export declare const RECORD_PARENT_METADATA_EXCLUDE: Set<string>;
|
|
11
|
-
/** Expand a tool `data` payload into row items (an inner array if present). */
|
|
12
|
-
export declare function expandData(data: Record<string, unknown> | undefined): unknown[];
|
|
13
|
-
export declare function sharedRepositoryRefs(parent: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
14
|
-
export declare function parentMetadata(data: Record<string, unknown> | undefined): Record<string, unknown> | undefined;
|
|
15
|
-
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
16
|
-
export declare function records(items: unknown[], recordType: OqlRecordResultRow['recordType'], source?: QuerySource, metadata?: Record<string, unknown>): OqlRecordResultRow[];
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
-
import type { OqlQuery, QuerySource } from '../../types.js';
|
|
3
|
-
export declare function errorText(value: unknown, fallback: string): string;
|
|
4
|
-
export declare function materializedClonePath(result: CallToolResult, localPath: string | undefined): string | undefined;
|
|
5
|
-
export declare function isExistingDirectory(path: string): boolean;
|
|
6
|
-
export declare function splitRepo(source: QuerySource | undefined): {
|
|
7
|
-
owner?: string;
|
|
8
|
-
repo?: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function params(query: OqlQuery): Record<string, unknown>;
|
|
11
|
-
export declare function withOqlPaging(query: OqlQuery, limitKey?: 'limit' | 'perPage'): Record<string, unknown>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { filterCommitsByMatch, filterPullRequestsByMatch, type PullRequestMatch } from './researchTargets/history.js';
|
|
2
|
-
import { computeLineDiff, executeDiff, type LineDiff } from './researchTargets/diff.js';
|
|
3
|
-
import type { AdapterResult } from './local.js';
|
|
4
|
-
import type { OqlQuery } from '../types.js';
|
|
5
|
-
export { filterCommitsByMatch, filterPullRequestsByMatch, executeDiff, computeLineDiff, };
|
|
6
|
-
export type { PullRequestMatch, LineDiff };
|
|
7
|
-
/** Dispatch map: target -> adapter. */
|
|
8
|
-
export declare const RESEARCH_TARGET_ADAPTERS: Record<string, (q: OqlQuery) => Promise<AdapterResult>>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Map typed tool results into OQL result rows + pagination. Pure functions —
|
|
3
|
-
* no I/O — so they are unit-testable without backends.
|
|
4
|
-
*/
|
|
5
|
-
import type { LocalFindFilesToolResult, LocalGetFileContentToolResult, LocalSearchCodeToolResult, LocalViewStructureToolResult } from '@octocodeai/octocode-core/extra-types';
|
|
6
|
-
import type { OqlContentResultRow, OqlResultRow, Pagination, QuerySource } from '../types.js';
|
|
7
|
-
export interface MappedResult {
|
|
8
|
-
results: OqlResultRow[];
|
|
9
|
-
pagination?: Pagination;
|
|
10
|
-
}
|
|
11
|
-
export declare function mapCodeResult(result: LocalSearchCodeToolResult, source: QuerySource): MappedResult;
|
|
12
|
-
/**
|
|
13
|
-
* Mark file-unit code pagination: `page`/`itemsPerPage` count matched FILES
|
|
14
|
-
* while OQL code rows are individual matches. `filesUnit` forces the marker
|
|
15
|
-
* for providers (GitHub code search) whose totalItemsKind carries exactness
|
|
16
|
-
* (`lowerBound`/`reported`) instead of the local `'files'` unit tag.
|
|
17
|
-
*/
|
|
18
|
-
export declare function enrichCodePagination(pagination: Pagination | undefined, rowCount: number, filesUnit?: boolean): Pagination | undefined;
|
|
19
|
-
export declare function mapFilesResult(result: LocalFindFilesToolResult, source: QuerySource): MappedResult;
|
|
20
|
-
export declare function mapStructureResult(result: LocalViewStructureToolResult, source: QuerySource): MappedResult;
|
|
21
|
-
export declare function mapContentResult(result: LocalGetFileContentToolResult, source: QuerySource, path: string,
|
|
22
|
-
/**
|
|
23
|
-
* The view the OQL query *requested*. The backing tool does not reliably echo
|
|
24
|
-
* the minify mode back (e.g. a `symbols` read reports `standard`), so the row
|
|
25
|
-
* must report the requested view to satisfy "report the view used".
|
|
26
|
-
*/
|
|
27
|
-
requestedView?: OqlContentResultRow['contentView']): MappedResult;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Serialize an OQL JSON `StructuralRule` into the engine's YAML rule string.
|
|
3
|
-
*
|
|
4
|
-
* The structural engine's `rule` field is a YAML string with a top-level
|
|
5
|
-
* `rule:` key (matching the `search --rule` surface). OQL accepts that YAML
|
|
6
|
-
* string directly, or this JSON object form for typed callers. Covers the
|
|
7
|
-
* currently supported rule fields: pattern, kind, inside, has, not, all, any,
|
|
8
|
-
* stopBy.
|
|
9
|
-
*/
|
|
10
|
-
import type { StructuralRule } from '../types.js';
|
|
11
|
-
export declare function structuralRuleToYaml(rule: StructuralRule): string;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single entry for OQL adapters to invoke a backing tool.
|
|
3
|
-
*
|
|
4
|
-
* Routes through `executeDirectTool` — the SAME path the CLI's `tools <name>`
|
|
5
|
-
* uses — so OQL gets identical credential resolution (withSecurityValidation),
|
|
6
|
-
* provider initialization, input validation, and secret sanitization. Calling
|
|
7
|
-
* the bulk runners directly bypassed auth (the CLI runs `runOqlSearch` without
|
|
8
|
-
* an MCP `authInfo`), which silently failed GitHub/npm calls.
|
|
9
|
-
*
|
|
10
|
-
* GitHub/package tools require `mainResearchGoal`; we fill OQL defaults.
|
|
11
|
-
*/
|
|
12
|
-
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
13
|
-
/** Run one backing tool with a single query, via the shared direct-tool path. */
|
|
14
|
-
export declare function runDirect(name: string, query: Record<string, unknown>): Promise<CallToolResult>;
|
|
15
|
-
/** Pull the single query's `{data,status}` out of a bulk-shaped tool result. */
|
|
16
|
-
export declare function firstQueryData<T = Record<string, unknown>>(result: CallToolResult): {
|
|
17
|
-
data?: T;
|
|
18
|
-
status?: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function numberFrom(value: unknown): number | undefined;
|
|
21
|
-
export declare function stringFrom(value: unknown): string | undefined;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL capability registry — makes backend limits explicit and testable.
|
|
3
|
-
*
|
|
4
|
-
* Given the source kind, target, materialization stance, and a single leaf
|
|
5
|
-
* predicate, decide how that predicate can be evaluated:
|
|
6
|
-
* PUSHDOWN backend evaluates it directly (exact or approximate)
|
|
7
|
-
* RESIDUAL fetch bounded candidates and filter locally
|
|
8
|
-
* ROUTE move to another lane (materialize -> local)
|
|
9
|
-
* UNSUPPORTED cannot be evaluated; emit a diagnostic
|
|
10
|
-
*
|
|
11
|
-
* This is intentionally conservative: anything that cannot be proven exactly is
|
|
12
|
-
* flagged so the planner never reports `proof` it cannot back.
|
|
13
|
-
*/
|
|
14
|
-
import type { DiagnosticCode, LeafPredicate, MaterializePolicy, OqlActiveTarget, PlanRoute, QuerySource } from './types.js';
|
|
15
|
-
export interface CapabilityContext {
|
|
16
|
-
sourceKind: QuerySource['kind'];
|
|
17
|
-
target: OqlActiveTarget;
|
|
18
|
-
materialize: MaterializePolicy | undefined;
|
|
19
|
-
}
|
|
20
|
-
export interface CapabilityDecision {
|
|
21
|
-
route: PlanRoute;
|
|
22
|
-
backend: string;
|
|
23
|
-
/** Whether the backend evaluates the predicate exactly (proof-grade). */
|
|
24
|
-
exact: boolean;
|
|
25
|
-
reason: string;
|
|
26
|
-
diagnostic?: {
|
|
27
|
-
code: DiagnosticCode;
|
|
28
|
-
message: string;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export declare function routeLeafPredicate(ctx: CapabilityContext, predicate: LeafPredicate, inNegation?: boolean): CapabilityDecision;
|
package/dist/oql/defaults.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL defaults (see OCTOCODE_QUERY_LANGUAGE.md §defaults). `--explain` must
|
|
3
|
-
* surface every applied default, so they live in one place.
|
|
4
|
-
*/
|
|
5
|
-
import type { OqlQuery } from './types.js';
|
|
6
|
-
export declare const DEFAULTS: {
|
|
7
|
-
schema: "oql";
|
|
8
|
-
view: "paginated";
|
|
9
|
-
page: number;
|
|
10
|
-
itemsPerPage: number;
|
|
11
|
-
githubMaterializeMode: "never";
|
|
12
|
-
textCase: "smart";
|
|
13
|
-
regexDialectLocal: "rust";
|
|
14
|
-
regexCase: "smart";
|
|
15
|
-
contentView: "standard";
|
|
16
|
-
contentCharLength: number;
|
|
17
|
-
matchContentLength: number;
|
|
18
|
-
maxPlanNodes: number;
|
|
19
|
-
maxBooleanExpansion: number;
|
|
20
|
-
normalCodeContext: number;
|
|
21
|
-
detailedCodeContext: number;
|
|
22
|
-
localSearchSort: "relevance";
|
|
23
|
-
localRankingProfile: "auto";
|
|
24
|
-
};
|
|
25
|
-
/** The subset of defaults actually applied to (or relevant for) this query. */
|
|
26
|
-
export declare function appliedDefaults(query: OqlQuery): Record<string, unknown>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL diagnostic helpers. Diagnostics are first-class typed output, not prose
|
|
3
|
-
* hints. `blocksAnswer:true` marks diagnostics that prevent `proof`.
|
|
4
|
-
*/
|
|
5
|
-
import type { DiagnosticCode, OqlContinuation, OqlDiagnostic, OqlSearchInput } from './types.js';
|
|
6
|
-
export interface DiagnosticOptions {
|
|
7
|
-
queryPath?: string;
|
|
8
|
-
predicateId?: string;
|
|
9
|
-
backend?: string;
|
|
10
|
-
blocksAnswer?: boolean;
|
|
11
|
-
severity?: OqlDiagnostic['severity'];
|
|
12
|
-
repair?: {
|
|
13
|
-
message: string;
|
|
14
|
-
suggestedQuery?: OqlSearchInput;
|
|
15
|
-
};
|
|
16
|
-
continuation?: OqlContinuation;
|
|
17
|
-
}
|
|
18
|
-
export declare function diagnostic(code: DiagnosticCode, message: string, options?: DiagnosticOptions): OqlDiagnostic;
|
|
19
|
-
export declare function blocksAnswer(diagnostics: OqlDiagnostic[]): boolean;
|
|
20
|
-
export declare function hasErrors(diagnostics: OqlDiagnostic[]): boolean;
|
|
21
|
-
/** Error raised when validation/normalization cannot produce a canonical query. */
|
|
22
|
-
export declare class OqlValidationError extends Error {
|
|
23
|
-
readonly diagnostics: OqlDiagnostic[];
|
|
24
|
-
constructor(diagnostics: OqlDiagnostic[]);
|
|
25
|
-
}
|
package/dist/oql/diffLanes.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Single source of truth for the `target:"diff"` lane discriminant.
|
|
3
|
-
*
|
|
4
|
-
* `target:"diff"` has two typed execution lanes plus an invalid shape:
|
|
5
|
-
* - prPatch: { prNumber, files? } -> ghHistoryResearch (PR patches)
|
|
6
|
-
* - directFile: { baseRef, headRef, path } -> 2× ghGetFileContent + line diff
|
|
7
|
-
* - neither: repair diagnostic, no call
|
|
8
|
-
*
|
|
9
|
-
* Both the planner (to announce the right backend in `--explain --dry-run`) and
|
|
10
|
-
* the diff adapter (to dispatch execution) classify a query off this one
|
|
11
|
-
* helper, so the plan can never contradict execution. Pure: no imports beyond
|
|
12
|
-
* its own return types.
|
|
13
|
-
*/
|
|
14
|
-
export type DiffLane = {
|
|
15
|
-
kind: 'prPatch';
|
|
16
|
-
prNumber: number;
|
|
17
|
-
files?: string[];
|
|
18
|
-
} | {
|
|
19
|
-
kind: 'directFile';
|
|
20
|
-
baseRef: string;
|
|
21
|
-
headRef: string;
|
|
22
|
-
path: string;
|
|
23
|
-
} | {
|
|
24
|
-
kind: 'neither';
|
|
25
|
-
};
|
|
26
|
-
/** Unified lane discriminant for target:"diff". Single source of truth. */
|
|
27
|
-
export declare function classifyDiffLane(params: Record<string, unknown> | undefined): DiffLane;
|
|
28
|
-
/** Backend name the planner should announce for a lane (`''` = no call). */
|
|
29
|
-
export declare function diffLaneBackend(lane: DiffLane): string;
|
package/dist/oql/envelope.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { OqlBackendCall, OqlDiagnostic, OqlExplainPlan, OqlProofGradedResultRow, OqlProvenance, OqlResultEnvelope, Pagination } from './types.js';
|
|
2
|
-
export interface BuildEnvelopeArgs {
|
|
3
|
-
queryId?: string;
|
|
4
|
-
queryIndex?: number;
|
|
5
|
-
results: OqlProofGradedResultRow[];
|
|
6
|
-
shared?: OqlResultEnvelope['shared'];
|
|
7
|
-
pagination?: Pagination;
|
|
8
|
-
next?: OqlResultEnvelope['next'];
|
|
9
|
-
nextHints?: OqlResultEnvelope['nextHints'];
|
|
10
|
-
diagnostics: OqlDiagnostic[];
|
|
11
|
-
provenance: OqlProvenance[];
|
|
12
|
-
/** Whether the plan was executable (no UNSUPPORTED nodes / blocking errors). */
|
|
13
|
-
executable: boolean;
|
|
14
|
-
/** Whether any backend call was approximate (exact:false). */
|
|
15
|
-
approximate?: boolean;
|
|
16
|
-
plan?: OqlExplainPlan;
|
|
17
|
-
}
|
|
18
|
-
export declare function buildEnvelope(args: BuildEnvelopeArgs): OqlResultEnvelope;
|
|
19
|
-
export declare function backendsApproximate(calls: OqlBackendCall[]): boolean;
|
|
20
|
-
/** Envelope for a query that failed validation/planning (no execution). */
|
|
21
|
-
export declare function unsupportedEnvelope(diagnostics: OqlDiagnostic[], plan?: OqlExplainPlan, queryId?: string, queryIndex?: number, next?: OqlResultEnvelope['next']): OqlResultEnvelope;
|
package/dist/oql/features.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OqlDiagnostic, OqlQuery } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Diagnose requested-but-unbackable output features. Pure; emits zero or more
|
|
4
|
-
* non-blocking diagnostics. Called by the planner so the limitation rides in the
|
|
5
|
-
* plan and the envelope alike.
|
|
6
|
-
*/
|
|
7
|
-
export declare function checkOutputFeatures(query: OqlQuery): OqlDiagnostic[];
|
package/dist/oql/index.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Octocode Query Language (OQL) public surface.
|
|
3
|
-
*
|
|
4
|
-
* `octocode search` (CLI) and the OQL MCP tool both consume this module:
|
|
5
|
-
* - `runOqlSearch` executes a query/batch and returns a typed envelope.
|
|
6
|
-
* - `normalizeInput` / `planQuery` expose the normalize + explain stages.
|
|
7
|
-
* - `oqlSchemaText()` / `OQL_SCHEMA_JSON` back `octocode search --scheme`.
|
|
8
|
-
*
|
|
9
|
-
* Schemas/types co-locate here for now (tools-core). They may migrate to
|
|
10
|
-
* `@octocodeai/octocode-core/oql` once a second consumer needs OQL validation
|
|
11
|
-
* without the rest of tools-core.
|
|
12
|
-
*/
|
|
13
|
-
export * from './types.js';
|
|
14
|
-
export { OqlQuerySchema, OqlBatchSchema, OqlCanonicalInputSchema, OqlInputQuerySchema, OqlInputBatchSchema, OqlSearchInputSchema, PredicateSchema, QuerySourceSchema, StructuralRuleSchema, } from './schema.js';
|
|
15
|
-
export { normalizeInput, normalizeQuery } from './normalize.js';
|
|
16
|
-
export { planQuery, type PlanQueryResult } from './planner.js';
|
|
17
|
-
export { DEFAULTS, appliedDefaults } from './defaults.js';
|
|
18
|
-
export { diagnostic, blocksAnswer, hasErrors, OqlValidationError, } from './diagnostics.js';
|
|
19
|
-
export { buildEnvelope, unsupportedEnvelope, backendsApproximate, } from './envelope.js';
|
|
20
|
-
export { runOqlSearch, type RunOptions } from './run.js';
|
|
21
|
-
export { buildShorthandInput, type SearchShorthand, type ShorthandCorpus, type ShorthandResult, } from './shorthand.js';
|
|
22
|
-
export { listTransformerEntries, findTransformerById, findTransformerEntry, backendCallsForTransformer, } from './transformers/registry.js';
|
|
23
|
-
export type { TransformerRegistryEntry, TransformerStatus, } from './transformers/contract.js';
|
|
24
|
-
export { oqlSchemaText, oqlCompactSchemeText, oqlCompactSchemeJson, OQL_SCHEMA_DOC, } from './schemeText.js';
|
|
25
|
-
export { sanitizeStructuredContent } from '../responses.js';
|
|
26
|
-
export { analyzeResearchFlow, type AnalyzeResearchOptions, type ResearchAnalysisResult, type ResearchDependencyIssue, type ResearchFileIssue, type ResearchFlowStep, type ResearchIntent, type ResearchManifestSummary, type ResearchMode, type ResearchSymbolRow, type ResearchSymbolVerdict, } from './research/analyze.js';
|
|
27
|
-
export { buildResearchPackets, type EvidenceClaim, type EvidenceConfidence, type EvidenceEdge, type EvidenceFact, type EvidenceFlag, type EvidenceLocation, type EvidenceRelation, type EvidenceSource, type EvidenceSubject, type MissingProof, type MissingProofKind, type PacketProofStatus, type PacketVerdict, type ResearchEvidencePacket, type ResearchGraphSummary, type ResearchPacketBundle, } from './research/packets.js';
|