@octocodeai/octocode-tools-core 17.0.2 → 18.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 +48 -38
- package/dist/direct.js +52 -35
- 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 +42 -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 +56 -39
- 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 +12 -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 +26 -96
- package/dist/tools/github_fetch_content/finalizer/types.d.ts +2 -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 +2 -16
- 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 +216 -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/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
package/dist/oql/schemeText.d.ts
DELETED
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
export declare const OQL_SCHEMA_DOC: {
|
|
2
|
-
readonly schema: "oql";
|
|
3
|
-
readonly description: "octocode search — typed read-only queries over code, files, symbols, repos, packages, history, diffs, and graph evidence. Think source + answer type + filters + read/output options; use --explain for routing; follow next.* for pages, exact reads, materialization, or proof.";
|
|
4
|
-
readonly activeTargets: readonly import("./types.js").OqlActiveTarget[];
|
|
5
|
-
readonly reservedTargets: readonly import("./types.js").OqlReservedTarget[];
|
|
6
|
-
readonly sourceGuide: {
|
|
7
|
-
readonly local: "from:{kind:\"local\",path:\"./src\"}; shorthand: search \"term\" ./src, search ./src --tree, search file.ts --op documentSymbols. Best for local code/content/files/tree/LSP/diff.";
|
|
8
|
-
readonly github: "from:{kind:\"github\",repo:\"owner/repo\",ref?}; shorthand: search \"term\" owner/repo, search owner/repo --tree, search owner/repo#123 --target pullRequests. GitHub code is indexed/default-branch scoped; materialize for AST/LSP/local proof.";
|
|
9
|
-
readonly npm: "from:{kind:\"npm\"} with target:\"packages\"; shorthand: search zod --target packages. Use to resolve package metadata and source repo, then continue with GitHub or local/materialized proof.";
|
|
10
|
-
readonly materialized: "from:{kind:\"materialized\",localPath:\"/abs/path\"} after target:\"materialize\", clone, or cache fetch. Use when a remote repo/subtree must behave like local code.";
|
|
11
|
-
};
|
|
12
|
-
readonly plainLanguage: {
|
|
13
|
-
readonly source: "`from` = where to look: local path, GitHub repo, npm, or a materialized checkout.";
|
|
14
|
-
readonly answerType: "`target` = what kind of answer you want: code matches, file content, tree, files, symbols, repos, packages, PRs, commits, diffs, research packets, graph proof, or materialization.";
|
|
15
|
-
readonly filters: "`where` = match/filter conditions for code and file discovery only: text, regex, AST shape, file fields, and boolean combinations.";
|
|
16
|
-
readonly readOptions: "`fetch` = what to read once you know the file/tree: exact content, compact content, symbol outline, ranges, match slices, or tree depth.";
|
|
17
|
-
readonly targetOptions: "`params` = options that belong to one answer type, such as LSP operation, PR number, package name, research intent, or graph proof.";
|
|
18
|
-
readonly output: "`view`, `select`, and `controls` = response shape, projected fields, search tuning, and cost limits.";
|
|
19
|
-
readonly paging: "`page` + `itemsPerPage` page the target's primary result domain. For code search that may be matched files; per-file match paging uses `controls.search.matchPage` / `--match-page`.";
|
|
20
|
-
};
|
|
21
|
-
readonly targetDecisionTree: {
|
|
22
|
-
readonly 'find a string/pattern in code': "target:code (shorthand default for text/regex/--pattern/--rule; needs a where filter)";
|
|
23
|
-
readonly 'read or slice a known file': "target:content (file positional + --content-view, --start-line/--end-line, or --match-string)";
|
|
24
|
-
readonly 'see the file/dir layout': "target:structure (--tree)";
|
|
25
|
-
readonly 'find files by name/glob/ext/size/mtime': "target:files (--search path, --name/--ext/--size-greater/--modified-within)";
|
|
26
|
-
readonly 'symbol defs/refs/callers/hover': "target:semantics (--op …; local or materialized only)";
|
|
27
|
-
readonly 'search GitHub repos': "target:repositories (--stars/--lang/--topic)";
|
|
28
|
-
readonly 'resolve an npm package': "target:packages";
|
|
29
|
-
readonly 'PR list or deep-read': "target:pullRequests (owner/repo#N)";
|
|
30
|
-
readonly 'commit history': "target:commits (--since/--until)";
|
|
31
|
-
readonly 'a diff': "target:diff ({prNumber} for a PR patch, {baseRef,headRef,path} for two refs)";
|
|
32
|
-
readonly 'dead-code / reachability sweep': "target:research, then upgrade with target:graph proof:\"lsp\"";
|
|
33
|
-
readonly 'make a remote repo behave like local (AST/LSP/negation)': "target:materialize (or clone / cache fetch)";
|
|
34
|
-
};
|
|
35
|
-
readonly agentBestPractices: readonly ["Start with cheap orientation: --tree, --search path, --view discovery, or --content-view symbols.", "Then narrow and read exact evidence: --match-string, --start-line/--end-line, --char-offset/--char-length, or --content-view none.", "Use snippets as discovery only; make decisions from exact content, PR/commit metadata, or LSP/graph proof.", "For semantics, run documentSymbols first to get line anchors, then references/callers/hover with symbolName + lineHint.", "For GitHub zero rows / providerUnindexed, do NOT claim absence — follow evidenceSemantics.providerUnindexed (verify path with structure, then materialize a bounded path).", "Read evidence.answerReady, evidence.complete, diagnostics, pagination, and next.* before concluding."];
|
|
36
|
-
readonly quickStart: {
|
|
37
|
-
readonly 'text search (local)': "search \"functionName\" ./src";
|
|
38
|
-
readonly 'text search (GitHub)': "search \"functionName\" vercel/next.js";
|
|
39
|
-
readonly 'package lookup (npm)': "search zod --target packages";
|
|
40
|
-
readonly 'PR deep read (GitHub)': "search vercel/next.js#1 --target pullRequests --comments --patches";
|
|
41
|
-
readonly 'commit history (GitHub)': "search vercel/next.js/packages/next/src --target commits --since 2024-01-01T00:00:00Z";
|
|
42
|
-
readonly 'browse a tree (local dir or owner/repo)': "search ./src --tree | search vercel/next.js --tree";
|
|
43
|
-
readonly 'read a file (local or owner/repo/path)': "search ./src/index.ts | search vercel/next.js/packages/next/src/server/config.ts";
|
|
44
|
-
readonly 'read a remote file (exact)': "search vercel/next.js/README.md --content-view none";
|
|
45
|
-
readonly 'semantics (local/materialized)': "search ./src/index.ts --op documentSymbols | search ./src/index.ts --op references --symbol runCLI --line 42";
|
|
46
|
-
readonly 'PR diff (GitHub)': "search vercel/next.js#123 --target diff | search vercel/next.js --target diff --pr 123";
|
|
47
|
-
readonly 'two-ref / two-file diff': "search src/a.ts src/b.ts --target diff | search owner/repo --target diff --base-ref <sha> --head-ref <sha> --path <file>";
|
|
48
|
-
readonly 'structural AST (local \u2014 needs full node shape)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" ./src --lang ts";
|
|
49
|
-
readonly 'structural AST (GitHub \u2014 clones bounded subtree)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" vercel/next.js/packages/next/src --lang ts --materialize auto";
|
|
50
|
-
readonly 'GitHub index miss recovery': "search useState packages/next/src --repo vercel/next.js --materialize required | clone vercel/next.js/packages/next/src | cache fetch vercel/next.js packages/next/src --depth tree";
|
|
51
|
-
readonly 'dead-code triage (research)': "search --query '{\"schema\":\"oql\",\"target\":\"research\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"params\":{\"intent\":\"reachability\",\"facets\":[\"symbols\",\"files\"]},\"itemsPerPage\":1,\"page\":1}'";
|
|
52
|
-
readonly 'LSP-proven dead symbols (graph)': "search --query '{\"schema\":\"oql\",\"target\":\"graph\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"params\":{\"intent\":\"reachability\",\"facets\":[\"symbols\"],\"proof\":\"lsp\",\"proofLimit\":5,\"includePackets\":true},\"page\":1,\"itemsPerPage\":10}'";
|
|
53
|
-
readonly 'OQL full-schema reference': "search --scheme";
|
|
54
|
-
readonly 'routing explanation before running': "search --explain --query '{\"target\":\"code\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"where\":{\"kind\":\"text\",\"value\":\"term\"}}'";
|
|
55
|
-
};
|
|
56
|
-
readonly evidenceSemantics: {
|
|
57
|
-
readonly 'answerReady:true': "The envelope answers the query as asked. No required follow-up.";
|
|
58
|
-
readonly 'answerReady:false': "Normal, NOT a failure — the results above are valid; only answerReady:true means no follow-up is needed. Follow next.* for more pages, LSP proof, or content.";
|
|
59
|
-
readonly 'complete:false': "Pages/proof/slices may remain. Read diagnostics: non-blocking warnings can still leave usable rows, but deletion/absence claims need the requested scope plus the listed continuations.";
|
|
60
|
-
readonly 'kind:proof': "Backend evaluated the request exactly.";
|
|
61
|
-
readonly 'kind:partial': "Truncation, pagination, or residual checks remain.";
|
|
62
|
-
readonly 'kind:candidate': "Useful evidence, not proof. research/graph are always candidate — upgrade via next.semantic/search/fetch.";
|
|
63
|
-
readonly 'kind:unsupported': "OQL could not safely execute the requested semantics.";
|
|
64
|
-
readonly 'proofStatus:confirmed-by-lsp': "LSP refs=0 inside the bounded workspace. Inspect for deletion only after checking entrypoints, framework conventions, dynamic imports, package exports, and scripts.";
|
|
65
|
-
readonly 'proofStatus:conflicting-evidence': "LSP refs>0 — symbol IS retained; check retainedBy before acting.";
|
|
66
|
-
readonly 'proofStatus:needs-framework-graph': "Maybe an entrypoint (framework/export/dynamic import) — LSP alone can't prove reachability.";
|
|
67
|
-
readonly 'proofStatus:candidate': "Pre-proof state (no LSP run yet) — run the row's next.graph (proof:\"lsp\") to resolve it to confirmed-by-lsp / conflicting-evidence / needs-framework-graph.";
|
|
68
|
-
readonly partialParse: "Non-fatal structural-search warning. Some files were not parsed, often because a literal prefilter had no anchor; add a literal/rule or broaden proof before claiming absence.";
|
|
69
|
-
readonly providerUnindexed: "GitHub provider returned zero rows. This is NOT absence. Verify the path with structure, then use bounded local proof: search \"term\" path --repo owner/repo --materialize required, clone owner/repo[/path], or cache fetch owner/repo [path] --depth file|tree|clone.";
|
|
70
|
-
};
|
|
71
|
-
readonly semanticsGuide: {
|
|
72
|
-
readonly documentSymbols: "list a file's symbols to get line anchors first (run before references/callers/hover)";
|
|
73
|
-
readonly references: "all usages of a symbol across the workspace (often includes its declaration)";
|
|
74
|
-
readonly callers: "incoming calls to a function/method (call sites only) — narrower than references";
|
|
75
|
-
readonly hover: "type, signature, and docs at a symbol";
|
|
76
|
-
};
|
|
77
|
-
readonly query: {
|
|
78
|
-
readonly schema: "\"oql\" (inserted by normalization)";
|
|
79
|
-
readonly target: string;
|
|
80
|
-
readonly from: "{ kind:\"local\", path } | { kind:\"github\", repo?, owner?, ref? } | { kind:\"materialized\", localPath, source? } | { kind:\"npm\" } — local row.path is relative to from.path; the pre-filled next.fetch carries the resolved ABSOLUTE path, so follow it directly rather than re-joining paths yourself";
|
|
81
|
-
readonly scope: "{ path?, language?, include?, exclude?, excludeDir?, hidden?, noIgnore?, minDepth?, maxDepth? } — minDepth/maxDepth bound directory recursion depth (0-64)";
|
|
82
|
-
readonly where: "filters for code/files only: text | regex | structural | field | all | any | not. To read a matched file slice, use fetch.content.match. For PR/commit text narrowing, use that target params hint.";
|
|
83
|
-
readonly materialize: "{ mode:\"never\"|\"auto\"|\"required\", strategy?:\"file\"|\"tree\"|\"subtree\"|\"repo\", allowFullRepo?, forceRefresh? }";
|
|
84
|
-
readonly fetch: "{ content?: { contentView:\"none\"|\"standard\"|\"symbols\", fullContent?, match?:{text|regex,case?}, range?:{startLine?,endLine?,contextLines?}, charOffset?, charLength? }, tree?:{ maxDepth?, pattern?, includeSizes?, extensions?, filesOnly?, directoriesOnly?, sortBy?:\"name\"|\"size\"|\"time\"|\"extension\", reverse? } } — read options for known files/trees; fetch.content.fullContent:true returns the WHOLE file in one shot (lossless, no char-window paging); to read the region around a string, anchor with fetch.content.match (NOT a top-level where, which is code/files only)";
|
|
85
|
-
readonly params: "target options (validated by OQL for common fields and by the backing tool exhaustively) — see params hints below";
|
|
86
|
-
readonly select: "string[] projection of result/continuation fields";
|
|
87
|
-
readonly view: "discovery | paginated | detailed";
|
|
88
|
-
readonly controls: "{ search?: { countLinesPerFile?, countMatchesPerFile?, onlyMatching?, unique?, countUnique?, contextLines?, invertMatch?, matchWindow?, matchContentLength?, maxMatchesPerFile?, matchPage?, sort?:\"relevance\"|\"matchCount\"|\"path\"|\"modified\"|\"accessed\"|\"created\"|\"size\"|\"name\", sortReverse?, rankingProfile?, debugRanking? }, budget?: { maxFiles?, maxCandidates?, maxBytes?, maxMaterializedBytes?, maxPlanNodes?, maxBooleanExpansion?, timeoutMs? } } — output/cost controls; sort values \"size\"/\"name\" apply to target:\"files\" only (lowered to localFindFiles sortBy), the rest are code-search sorts";
|
|
89
|
-
readonly limit: "number — total result cap where supported. Prefer itemsPerPage for paged research/graph/file-history continuations.";
|
|
90
|
-
readonly page: "number — top-level page number for OQL windowing/continuations";
|
|
91
|
-
readonly itemsPerPage: "number — page size for the target primary result domain. For code search this may be matched files, not individual matches; per-file match paging uses controls.search.matchPage. Per-target params expose backing-tool sub-pages only (filePage/commentPage/commitPage, etc.).";
|
|
92
|
-
readonly explain: "boolean";
|
|
93
|
-
};
|
|
94
|
-
readonly params: {
|
|
95
|
-
readonly semantics: "{ type:\"definition\"|\"references\"|\"callers\"|\"callees\"|\"callHierarchy\"|\"hover\"|\"documentSymbols\"|\"typeDefinition\"|\"implementation\"|\"workspaceSymbol\"|\"supertypes\"|\"subtypes\"|\"diagnostic\", uri?, symbolName?, symbolKind?, lineHint?, orderHint?, depth?, contextLines?, includeDeclaration?, groupByFile?, workspaceRoot?, format? } — backing tool lspGetSemantics; contextLines adds call-flow snippets; symbolKind filters returned symbol rows after documentSymbols/workspaceSymbol";
|
|
96
|
-
readonly repositories: "{ keywords?: string[], topicsToSearch?: string[], language?, owner?, stars?, license?, sort?, archived?, limit?, page? } — backing tool ghSearchRepos; keywords/topicsToSearch are arrays even for one term";
|
|
97
|
-
readonly packages: "{ packageName?: string | keywords?: string[], mode?:\"lean\"|\"full\", page? } — backing tool npmSearch";
|
|
98
|
-
readonly pullRequests: "{ state?:\"open\"|\"closed\"|\"merged\", author?, label?, keywordsToSearch?, prNumber?, reviewMode?, filePage?, commentPage?, commitPage?, limit?, page?, matchString?, matchScope?:\"body\"|\"title\"|\"comments\"|\"reviews\"|\"all\", content? } — backing tool ghHistoryResearch; matchString filters fetched PR title/body/comments/reviews per matchScope (default body), not a search-index query — no match → zeroMatches";
|
|
99
|
-
readonly commits: "{ path?, branch?, since?, until?, includeDiff?, limit?, page?, filePage?, itemsPerPage?, matchString? } — backing tool ghHistoryResearch type:\"commits\"; matchString filters commit messages; repo/directory diffs page changed files per commit with filePage/itemsPerPage";
|
|
100
|
-
readonly diff: "{ prNumber, files? } (PR patch via ghHistoryResearch) | { baseRef, headRef, path } (direct two-ref file diff via ghGetFileContent + local line diff); neither shape -> invalidQuery repair";
|
|
101
|
-
readonly research: "{ goal?, intent?:\"general\"|\"reachability\"|\"dependencies\"|\"symbols\", facets?:(\"symbols\"|\"files\"|\"dependencies\"|\"relations\")[], mode?:\"plan\"|\"analyze\"|\"prove\", maxFiles? } — TWO-PHASE: page:1+itemsPerPage:1 → data.summary (full-scope counts) and may include a bounded first packet page; page:2+ → data.packets[] continuation pages (candidates w/ retainedBy edges + per-packet next.*). Always evidence:\"candidate\"/answerReady:false (normal). Follow the row's pre-filled next.graph (proof:\"lsp\", proofLimit-bounded) to upgrade a page to LSP-proven proofStatus.";
|
|
102
|
-
readonly graph: "{ goal?, intent?:\"general\"|\"reachability\"|\"dependencies\"|\"symbols\", facets?:(…)[], mode?:\"plan\"|\"analyze\"|\"prove\", maxFiles?, subject?, subjectKind?, relation?, verdict?, direction?:\"incoming\"|\"outgoing\"|\"both\", proof?:\"none\"|\"lsp\", proofLimit?, includePackets?, includeFacts?, includeEdges? } — UPGRADE PATH: run a research row's pre-filled next.graph directly. proof:\"lsp\" sets per-row proofStatus: \"confirmed-by-lsp\" (refs=0 in bounded workspace; still inspect entrypoints/exports before deletion), \"conflicting-evidence\" (refs>0 → retained, check retainedBy), \"needs-framework-graph\" (maybe an entrypoint). answerReady:false is normal — follow next.* for more pages/proof.";
|
|
103
|
-
readonly materialize: "(no params; no `where`) clone/cache a bounded corpus (from:{kind:\"github\",repo} + scope.path) and return a stable materialized checkpoint row (localPath/repoRoot/ref/cache/complete) with next.structure/next.files. Use after GitHub providerUnindexed; for CLI alternatives use clone owner/repo[/path] or cache fetch owner/repo [path] --depth file|tree|clone.";
|
|
104
|
-
};
|
|
105
|
-
readonly predicates: {
|
|
106
|
-
readonly text: "{ kind:\"text\", value, case?, wholeWord? }";
|
|
107
|
-
readonly regex: "{ kind:\"regex\", value, dialect?:\"rust\"|\"pcre2\"|\"provider\", case?, wholeWord?, multiline?, dotAll? }";
|
|
108
|
-
readonly structural: "{ kind:\"structural\", lang, pattern? | rule? } (exactly one; rule is a JSON object or grep-compatible YAML rule string) — pattern must match the COMPLETE node, so include the parts the real node has: a fn WITH a return type only matches if the pattern has one too (`function $N($$$A): $R { $$$B }`); omitting it returns 0. Shapes: `function $N($$$A) { $$$B }` (no-return-type fn), `($$$A) => $$$B` (arrow, block+expression), `$F($$$A)` (call), `$O.$M($$$A)` (method). For \"find symbol X\" the ROBUST form is a rule, not a pattern: `{ kind:\"function_declaration\", has:{ pattern:\"X\" } }`. 0 matches + no parse error = pattern shape ≠ real node (add `: $R`, or switch to a rule). Note: $$$-only patterns skip files with no literal anchor → low counts; add a literal name or use a regex where.";
|
|
109
|
-
readonly field: "{ kind:\"field\", field:\"path\"|\"basename\"|\"extension\"|\"size\"|\"modified\"|\"accessed\"|\"empty\"|\"permissions\"|\"executable\"|\"readable\"|\"writable\"|\"entryType\", op:\"=\"|\"!=\"|\"in\"|\"exists\"|\"glob\"|\"regex\"|\">\"|\">=\"|\"<\"|\"<=\"|\"within\"|\"before\", value? } (use symbolic ops like \"=\"; aliases such as \"eq\" are invalid; there is no \"contains\" op — use op:\"glob\", value:\"*term*\" or op:\"regex\"; \"within\"/\"before\" compare modified/accessed times; empty/executable/readable/writable are boolean file attributes paired with op:\"exists\" or op:\"=\") SCOPE: field predicates evaluate file attributes, so they run on target:\"files\" (and mixed into files-lane booleans); target:\"code\" rejects a bare field predicate with unsupportedPredicate — use text/regex/structural for code content, or target:\"files\" for file discovery.";
|
|
110
|
-
readonly boolean: "{ kind:\"all\"|\"any\", of: Predicate[] } | { kind:\"not\", predicate }";
|
|
111
|
-
readonly booleanSugar: "Top-level sugar keys lower to canonical booleans at normalize time: and:[...]→all, or:[...]→any, noneOf:[...]→not(any), xor:[a,b]→any(all(a,not b),all(not a,b)), oneOf:[...]→exactly-one expansion (bounded by controls.budget.maxBooleanExpansion), invert:true→not(where). Prefer canonical all/any/not in programmatic queries; sugar is for terse hand-written ones.";
|
|
112
|
-
};
|
|
113
|
-
readonly batch: {
|
|
114
|
-
readonly queries: "OqlQuery[] (1-5)";
|
|
115
|
-
readonly combine: "independent | merge";
|
|
116
|
-
};
|
|
117
|
-
readonly explainRoutes: {
|
|
118
|
-
readonly PUSHDOWN: "Backend evaluates this predicate exactly — good. No residual work.";
|
|
119
|
-
readonly RESIDUAL: "Backend narrows candidates but OQL must finish evaluation locally.";
|
|
120
|
-
readonly ROUTE: "OQL must use a different lane, often materialization.";
|
|
121
|
-
readonly UNSUPPORTED: "OQL cannot execute this predicate safely on the chosen source.";
|
|
122
|
-
};
|
|
123
|
-
readonly defaults: {
|
|
124
|
-
schema: "oql";
|
|
125
|
-
view: "paginated";
|
|
126
|
-
page: number;
|
|
127
|
-
itemsPerPage: number;
|
|
128
|
-
githubMaterializeMode: "never";
|
|
129
|
-
textCase: "smart";
|
|
130
|
-
regexDialectLocal: "rust";
|
|
131
|
-
regexCase: "smart";
|
|
132
|
-
contentView: "standard";
|
|
133
|
-
contentCharLength: number;
|
|
134
|
-
matchContentLength: number;
|
|
135
|
-
maxPlanNodes: number;
|
|
136
|
-
maxBooleanExpansion: number;
|
|
137
|
-
normalCodeContext: number;
|
|
138
|
-
detailedCodeContext: number;
|
|
139
|
-
localSearchSort: "relevance";
|
|
140
|
-
localRankingProfile: "auto";
|
|
141
|
-
};
|
|
142
|
-
};
|
|
143
|
-
export declare function oqlSchemaText(): string;
|
|
144
|
-
export declare function oqlCompactSchemeJson(): string;
|
|
145
|
-
/**
|
|
146
|
-
* Lean, agent-facing summary of the OQL contract, served by
|
|
147
|
-
* `octocode search --scheme --compact`. Every section is DERIVED from
|
|
148
|
-
* `OQL_SCHEMA_DOC` (sourceGuide, targetDecisionTree, quickStart, semanticsGuide,
|
|
149
|
-
* agentBestPractices, evidenceSemantics) so it can never drift from the full
|
|
150
|
-
* `--scheme`. Cold agents read this; advanced flows stay in the full schema.
|
|
151
|
-
*/
|
|
152
|
-
export declare function oqlCompactSchemeText(): string;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `where` predicate lowering for `octocode search`.
|
|
3
|
-
*
|
|
4
|
-
* Turns the flat shorthand flags (--pattern/--rule/--regex/text, plus the
|
|
5
|
-
* file-discovery field flags like --extension/--filename/--size-greater)
|
|
6
|
-
* into the canonical `Predicate` tree. Predicate precedence within a search
|
|
7
|
-
* term is pattern > rule > regex > text.
|
|
8
|
-
*/
|
|
9
|
-
import type { Predicate } from '../types.js';
|
|
10
|
-
import type { SearchShorthand } from './types.js';
|
|
11
|
-
export declare function buildPredicate(parts: SearchShorthand): {
|
|
12
|
-
where?: Predicate;
|
|
13
|
-
} | {
|
|
14
|
-
error: string;
|
|
15
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `controls`/`fetch`/`materialize`/`view` lowering for `octocode search`.
|
|
3
|
-
*
|
|
4
|
-
* These are the non-predicate parts of an OQL query: search-result shaping
|
|
5
|
-
* (counting, dedup, context, ranking), content/tree fetch instructions, the
|
|
6
|
-
* materialize policy, and the discovery/paginated/detailed view mode.
|
|
7
|
-
*/
|
|
8
|
-
import type { OqlInputQuery, QueryControls, QueryView } from '../types.js';
|
|
9
|
-
import type { SearchShorthand } from './types.js';
|
|
10
|
-
export declare function queryControls(parts: SearchShorthand): QueryControls | undefined;
|
|
11
|
-
export declare function fetchInstructions(parts: SearchShorthand): OqlInputQuery['fetch'] | undefined;
|
|
12
|
-
export declare function materializePolicy(parts: SearchShorthand): OqlInputQuery['materialize'] | undefined;
|
|
13
|
-
export declare function resolveView(value: string | undefined): {
|
|
14
|
-
view?: QueryView;
|
|
15
|
-
} | {
|
|
16
|
-
error: string;
|
|
17
|
-
};
|
|
18
|
-
export declare function hasContentFetch(parts: SearchShorthand): boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `params` lowering for `octocode search` — target-specific parameter bags.
|
|
3
|
-
*
|
|
4
|
-
* Every active target (semantics, repositories, packages, pullRequests,
|
|
5
|
-
* commits, diff, research/graph) accepts its own flat `params`
|
|
6
|
-
* shape; this maps the shared shorthand flags onto each target's fields.
|
|
7
|
-
*/
|
|
8
|
-
import type { SearchShorthand } from './types.js';
|
|
9
|
-
export declare function targetParams(parts: SearchShorthand): Record<string, unknown>;
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public shorthand input types for `octocode search`.
|
|
3
|
-
*
|
|
4
|
-
* `SearchShorthand` is the flat, CLI-flag-shaped bag of parts the shorthand
|
|
5
|
-
* lowering pipeline (see ../shorthand.ts) consumes; `ShorthandResult` is what
|
|
6
|
-
* it produces (either a lowered OQL input or a typed error).
|
|
7
|
-
*/
|
|
8
|
-
import type { OqlInputBatch, OqlInputQuery } from '../types.js';
|
|
9
|
-
/** Corpus already classified by the caller (local path vs GitHub ref). */
|
|
10
|
-
export type ShorthandCorpus = {
|
|
11
|
-
kind: 'local';
|
|
12
|
-
path: string;
|
|
13
|
-
} | {
|
|
14
|
-
kind: 'github';
|
|
15
|
-
repo: string;
|
|
16
|
-
path?: string;
|
|
17
|
-
ref?: string;
|
|
18
|
-
} | {
|
|
19
|
-
kind: 'npm';
|
|
20
|
-
};
|
|
21
|
-
export interface SearchShorthand {
|
|
22
|
-
target?: string;
|
|
23
|
-
view?: string;
|
|
24
|
-
contentView?: string;
|
|
25
|
-
search?: string;
|
|
26
|
-
/** literal text term (used when no pattern/rule/regex flag is set) */
|
|
27
|
-
text?: string;
|
|
28
|
-
/** regex pattern (rust dialect unless pcre2) */
|
|
29
|
-
regex?: string;
|
|
30
|
-
pcre2?: boolean;
|
|
31
|
-
/** structural AST pattern (requires lang) */
|
|
32
|
-
pattern?: string;
|
|
33
|
-
/** structural rule, already parsed from JSON (requires lang) */
|
|
34
|
-
rule?: unknown;
|
|
35
|
-
lang?: string;
|
|
36
|
-
corpus: ShorthandCorpus;
|
|
37
|
-
materialize?: 'never' | 'auto' | 'required';
|
|
38
|
-
branch?: string;
|
|
39
|
-
forceRefresh?: boolean;
|
|
40
|
-
limit?: number;
|
|
41
|
-
page?: number;
|
|
42
|
-
itemsPerPage?: number;
|
|
43
|
-
include?: string[];
|
|
44
|
-
exclude?: string[];
|
|
45
|
-
excludeDir?: string[];
|
|
46
|
-
extension?: string;
|
|
47
|
-
filename?: string;
|
|
48
|
-
pathPattern?: string;
|
|
49
|
-
hidden?: boolean;
|
|
50
|
-
noIgnore?: boolean;
|
|
51
|
-
minDepth?: number;
|
|
52
|
-
maxDepth?: number;
|
|
53
|
-
empty?: boolean;
|
|
54
|
-
modifiedWithin?: string;
|
|
55
|
-
modifiedBefore?: string;
|
|
56
|
-
accessedWithin?: string;
|
|
57
|
-
sizeGreater?: string;
|
|
58
|
-
sizeLess?: string;
|
|
59
|
-
permissions?: string;
|
|
60
|
-
executable?: boolean;
|
|
61
|
-
readable?: boolean;
|
|
62
|
-
writable?: boolean;
|
|
63
|
-
details?: boolean;
|
|
64
|
-
showModified?: boolean;
|
|
65
|
-
caseInsensitive?: boolean;
|
|
66
|
-
caseSensitive?: boolean;
|
|
67
|
-
wholeWord?: boolean;
|
|
68
|
-
fixedString?: boolean;
|
|
69
|
-
multiline?: boolean;
|
|
70
|
-
multilineDotall?: boolean;
|
|
71
|
-
filesOnly?: boolean;
|
|
72
|
-
directoriesOnly?: boolean;
|
|
73
|
-
filesWithoutMatch?: boolean;
|
|
74
|
-
entryType?: 'file' | 'directory';
|
|
75
|
-
countLinesPerFile?: boolean;
|
|
76
|
-
countMatchesPerFile?: boolean;
|
|
77
|
-
onlyMatching?: boolean;
|
|
78
|
-
unique?: boolean;
|
|
79
|
-
countUnique?: boolean;
|
|
80
|
-
contextLines?: number;
|
|
81
|
-
invertMatch?: boolean;
|
|
82
|
-
matchWindow?: number;
|
|
83
|
-
matchContentLength?: number;
|
|
84
|
-
maxMatchesPerFile?: number;
|
|
85
|
-
matchPage?: number;
|
|
86
|
-
maxFiles?: number;
|
|
87
|
-
sort?: string;
|
|
88
|
-
sortReverse?: boolean;
|
|
89
|
-
rankingProfile?: string;
|
|
90
|
-
debugRanking?: boolean;
|
|
91
|
-
matchString?: string;
|
|
92
|
-
matchRegex?: boolean;
|
|
93
|
-
matchCaseSensitive?: boolean;
|
|
94
|
-
startLine?: number;
|
|
95
|
-
endLine?: number;
|
|
96
|
-
charOffset?: number;
|
|
97
|
-
charLength?: number;
|
|
98
|
-
fullContent?: boolean;
|
|
99
|
-
tree?: boolean;
|
|
100
|
-
includeSizes?: boolean;
|
|
101
|
-
op?: string;
|
|
102
|
-
symbol?: string;
|
|
103
|
-
symbolKind?: string;
|
|
104
|
-
uri?: string;
|
|
105
|
-
line?: number;
|
|
106
|
-
order?: number;
|
|
107
|
-
orderDirection?: string;
|
|
108
|
-
depth?: number;
|
|
109
|
-
workspaceRoot?: string;
|
|
110
|
-
format?: string;
|
|
111
|
-
owner?: string;
|
|
112
|
-
topic?: string[];
|
|
113
|
-
stars?: string;
|
|
114
|
-
forks?: string;
|
|
115
|
-
goodFirstIssues?: string;
|
|
116
|
-
license?: string;
|
|
117
|
-
created?: string;
|
|
118
|
-
updated?: string;
|
|
119
|
-
closed?: string;
|
|
120
|
-
mergedAt?: string;
|
|
121
|
-
size?: string;
|
|
122
|
-
match?: string[];
|
|
123
|
-
archived?: boolean;
|
|
124
|
-
visibility?: string;
|
|
125
|
-
concise?: boolean;
|
|
126
|
-
state?: string;
|
|
127
|
-
author?: string;
|
|
128
|
-
label?: string;
|
|
129
|
-
prNumber?: number;
|
|
130
|
-
base?: string;
|
|
131
|
-
head?: string;
|
|
132
|
-
draft?: boolean;
|
|
133
|
-
commentsContent?: boolean;
|
|
134
|
-
commitsContent?: boolean;
|
|
135
|
-
deep?: boolean;
|
|
136
|
-
patchFile?: string;
|
|
137
|
-
reviewMode?: string;
|
|
138
|
-
filePage?: number;
|
|
139
|
-
commentPage?: number;
|
|
140
|
-
commitPage?: number;
|
|
141
|
-
since?: string;
|
|
142
|
-
until?: string;
|
|
143
|
-
patches?: boolean;
|
|
144
|
-
baseRef?: string;
|
|
145
|
-
headRef?: string;
|
|
146
|
-
diffPath?: string;
|
|
147
|
-
intent?: string;
|
|
148
|
-
facets?: string[];
|
|
149
|
-
proof?: string;
|
|
150
|
-
proofLimit?: number;
|
|
151
|
-
includePackets?: boolean;
|
|
152
|
-
includeFacts?: boolean;
|
|
153
|
-
includeEdges?: boolean;
|
|
154
|
-
}
|
|
155
|
-
export type ShorthandResult = {
|
|
156
|
-
input: OqlInputQuery | OqlInputBatch;
|
|
157
|
-
} | {
|
|
158
|
-
error: string;
|
|
159
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Small stateless helpers shared across the shorthand lowering builders.
|
|
3
|
-
*/
|
|
4
|
-
/** Drop `undefined` values so callers don't emit sparse-but-present keys. */
|
|
5
|
-
export declare function clean(input: Record<string, unknown>): Record<string, unknown>;
|
|
6
|
-
export declare function listFromComma(value: string): string[];
|
|
7
|
-
export declare function isTreeSort(value: string | undefined): value is 'name' | 'size' | 'time' | 'extension';
|
package/dist/oql/shorthand.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { SearchShorthand, ShorthandCorpus, ShorthandResult } from './shorthand/types.js';
|
|
2
|
-
export type { SearchShorthand, ShorthandCorpus, ShorthandResult };
|
|
3
|
-
/**
|
|
4
|
-
* Lower shorthand parts into the OQL sugar object. Predicate precedence:
|
|
5
|
-
* pattern > rule > regex > text. Returns a typed error for invalid combos
|
|
6
|
-
* (e.g. structural without `lang`) instead of throwing.
|
|
7
|
-
*/
|
|
8
|
-
export declare function buildShorthandInput(parts: SearchShorthand): ShorthandResult;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OqlActiveTarget } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Validate a target's `params` bag against its typed schema. Returns `null` when
|
|
4
|
-
* valid (or no schema applies), or a Zod-style error message string the caller
|
|
5
|
-
* raises as `invalidQuery`.
|
|
6
|
-
*/
|
|
7
|
-
export declare function validateTargetParams(target: OqlActiveTarget, params: unknown): string | null;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { OqlActiveTarget, OqlRecordResultRow, QuerySource } from '../types.js';
|
|
2
|
-
export type TransformerStatus = 'active' | 'planned';
|
|
3
|
-
export type TransformerBackend = {
|
|
4
|
-
readonly backend: string;
|
|
5
|
-
readonly operation: string;
|
|
6
|
-
readonly exact: boolean;
|
|
7
|
-
};
|
|
8
|
-
export type TransformerRegistryEntry = {
|
|
9
|
-
readonly id: string;
|
|
10
|
-
readonly target: OqlActiveTarget;
|
|
11
|
-
readonly sourceKinds: readonly QuerySource['kind'][];
|
|
12
|
-
readonly status: TransformerStatus;
|
|
13
|
-
readonly backends: readonly TransformerBackend[];
|
|
14
|
-
readonly rowKind: 'code' | 'file' | 'tree' | 'content' | 'record';
|
|
15
|
-
readonly recordType?: OqlRecordResultRow['recordType'];
|
|
16
|
-
readonly adapterModule?: string;
|
|
17
|
-
readonly adapterFunctions: readonly string[];
|
|
18
|
-
readonly notes?: readonly string[];
|
|
19
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { OqlQuery } from '../../types.js';
|
|
2
|
-
import type { TransformResult } from '../types.js';
|
|
3
|
-
export type GithubCodeSearchToolQuery = Record<string, unknown>;
|
|
4
|
-
export type GithubCodeSearchTransformOptions = {
|
|
5
|
-
defaultMatch?: 'file' | 'path';
|
|
6
|
-
unsupportedMessage?: string;
|
|
7
|
-
unsupportedBackend?: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function toGithubCodeSearchToolQuery(query: OqlQuery, options?: GithubCodeSearchTransformOptions): TransformResult<GithubCodeSearchToolQuery>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { OqlQuery, Predicate, QueryScope, QuerySource } from '../../types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Collect the leaf predicates (text/regex/structural/field) of a `where`
|
|
4
|
-
* tree. Mirrors the planner's walk without importing planner.ts (cycle risk);
|
|
5
|
-
* used to verify a provider transformer consumed every routed leaf.
|
|
6
|
-
*/
|
|
7
|
-
export declare function leafPredicates(where: Predicate): Predicate[];
|
|
8
|
-
export declare function splitGithubSource(source: QuerySource | undefined): {
|
|
9
|
-
owner?: string;
|
|
10
|
-
repo?: string;
|
|
11
|
-
};
|
|
12
|
-
export declare function firstScopePath(scope: QueryScope | undefined): string | undefined;
|
|
13
|
-
export declare function firstScopeLanguage(scope: QueryScope | undefined): string | undefined;
|
|
14
|
-
export declare function requestedRowLimit(query: OqlQuery): number | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { classifyLanguageSelector, toGithubCodeLanguageParams, toGithubRepositoryLanguage, toLocalFileLanguageGlobs, toLocalSearchLanguageParams, } from '../../shared/languageSelectors.js';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { OqlActiveTarget, OqlBackendCall, OqlTransformerTrace, QuerySource } from '../types.js';
|
|
2
|
-
import type { TransformerRegistryEntry } from './contract.js';
|
|
3
|
-
export declare function listTransformerEntries(): readonly TransformerRegistryEntry[];
|
|
4
|
-
export declare function findTransformerEntry(args: {
|
|
5
|
-
sourceKind: QuerySource['kind'];
|
|
6
|
-
target: OqlActiveTarget;
|
|
7
|
-
variant?: string;
|
|
8
|
-
}): TransformerRegistryEntry | undefined;
|
|
9
|
-
export declare function findTransformerById(id: string): TransformerRegistryEntry | undefined;
|
|
10
|
-
export declare function findTransformerForQuery(args: {
|
|
11
|
-
source?: QuerySource;
|
|
12
|
-
target: OqlActiveTarget;
|
|
13
|
-
params?: Record<string, unknown>;
|
|
14
|
-
}): TransformerRegistryEntry | undefined;
|
|
15
|
-
export declare function backendCallsForTransformer(entry: TransformerRegistryEntry, source?: QuerySource): OqlBackendCall[];
|
|
16
|
-
export declare function transformerTrace(entry: TransformerRegistryEntry): OqlTransformerTrace;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { OqlDiagnostic } from '../types.js';
|
|
2
|
-
export type TransformOk<TQuery extends Record<string, unknown>> = {
|
|
3
|
-
ok: true;
|
|
4
|
-
query: TQuery;
|
|
5
|
-
diagnostics: OqlDiagnostic[];
|
|
6
|
-
};
|
|
7
|
-
export type TransformBlocked = {
|
|
8
|
-
ok: false;
|
|
9
|
-
diagnostics: OqlDiagnostic[];
|
|
10
|
-
};
|
|
11
|
-
export type TransformResult<TQuery extends Record<string, unknown>> = TransformOk<TQuery> | TransformBlocked;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL diagnostics — the coded, severity-ranked notices the planner/runner
|
|
3
|
-
* attach to a result envelope (unsupported predicates, truncation, auth,
|
|
4
|
-
* etc.), each optionally carrying a repair suggestion or continuation.
|
|
5
|
-
*/
|
|
6
|
-
import type { OqlSearchInput } from './query.js';
|
|
7
|
-
import type { OqlContinuation } from './envelope.js';
|
|
8
|
-
export type DiagnosticCode = 'invalidQuery' | 'ambiguousSugar' | 'unknownField' | 'unsupportedTarget' | 'unsupportedPredicate' | 'unsupportedBoolean' | 'unsupportedScope' | 'negativeUniverseRequired' | 'residualNotExact' | 'fieldTypeMismatch' | 'requiresMaterialization' | 'vendorNoEquivalent' | 'lossyTransform' | 'unsupportedVendorPredicate' | 'responseShapeMismatch' | 'materializationNotAllowed' | 'materializationFailed' | 'providerUnindexed' | 'providerSemanticsApproximate' | 'partialResult' | 'contentTruncated' | 'matchTruncated' | 'planTruncated' | 'budgetExhausted' | 'parserFailed' | 'partialParse' | 'signatureUnsupported' | 'lspUnavailable' | 'staleCache' | 'sanitized' | 'rateLimited' | 'authRequired' | 'zeroMatches' | 'symbolNotFound';
|
|
9
|
-
export interface OqlDiagnostic {
|
|
10
|
-
code: DiagnosticCode;
|
|
11
|
-
severity: 'info' | 'warning' | 'error';
|
|
12
|
-
queryPath?: string;
|
|
13
|
-
predicateId?: string;
|
|
14
|
-
backend?: string;
|
|
15
|
-
message: string;
|
|
16
|
-
blocksAnswer: boolean;
|
|
17
|
-
repair?: {
|
|
18
|
-
message: string;
|
|
19
|
-
suggestedQuery?: OqlSearchInput;
|
|
20
|
-
};
|
|
21
|
-
continuation?: OqlContinuation;
|
|
22
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL result envelope — pagination, provenance, continuations, and the
|
|
3
|
-
* top-level `OqlResultEnvelope`/`OqlBatchResultEnvelope` shapes `runOqlSearch`
|
|
4
|
-
* returns.
|
|
5
|
-
*/
|
|
6
|
-
import type { QuerySource } from './predicates.js';
|
|
7
|
-
import type { OqlCanonicalInput } from './query.js';
|
|
8
|
-
import type { OqlDiagnostic } from './diagnostics.js';
|
|
9
|
-
import type { OqlExplainPlan } from './planner.js';
|
|
10
|
-
import type { OqlProofGradedResultRow } from './recordRows.js';
|
|
11
|
-
export interface Pagination {
|
|
12
|
-
currentPage?: number;
|
|
13
|
-
totalPages?: number;
|
|
14
|
-
nextPage?: number;
|
|
15
|
-
itemsPerPage?: number;
|
|
16
|
-
totalItems?: number;
|
|
17
|
-
reportedTotalItems?: number;
|
|
18
|
-
reachableTotalItems?: number;
|
|
19
|
-
totalItemsKind?: string;
|
|
20
|
-
itemUnit?: string;
|
|
21
|
-
rowCount?: number;
|
|
22
|
-
reportedRowCount?: number;
|
|
23
|
-
totalItemsCapped?: boolean;
|
|
24
|
-
uniqueFileCount?: number;
|
|
25
|
-
hasMore: boolean;
|
|
26
|
-
next?: OqlContinuation;
|
|
27
|
-
}
|
|
28
|
-
export interface OqlProvenance {
|
|
29
|
-
backend: string;
|
|
30
|
-
source?: QuerySource;
|
|
31
|
-
predicateIds?: string[];
|
|
32
|
-
pushed?: string[];
|
|
33
|
-
residual?: string[];
|
|
34
|
-
routed?: string[];
|
|
35
|
-
materializedPath?: string;
|
|
36
|
-
cache?: 'hit' | 'miss' | 'refresh' | 'stale';
|
|
37
|
-
}
|
|
38
|
-
export interface OqlContinuation {
|
|
39
|
-
query: OqlCanonicalInput;
|
|
40
|
-
baseQueryId?: string;
|
|
41
|
-
queryIndex?: number;
|
|
42
|
-
why?: string;
|
|
43
|
-
confidence?: 'exact' | 'heuristic';
|
|
44
|
-
}
|
|
45
|
-
export interface OqlContinuationHint {
|
|
46
|
-
why: string;
|
|
47
|
-
confidence: 'exact' | 'heuristic';
|
|
48
|
-
}
|
|
49
|
-
export type EvidenceKind = 'proof' | 'partial' | 'candidate' | 'unsupported';
|
|
50
|
-
export interface OqlResultEnvelope {
|
|
51
|
-
queryId?: string;
|
|
52
|
-
queryIndex?: number;
|
|
53
|
-
results: OqlProofGradedResultRow[];
|
|
54
|
-
shared?: Record<string, unknown>;
|
|
55
|
-
pagination?: Pagination;
|
|
56
|
-
next?: Record<string, OqlContinuation>;
|
|
57
|
-
nextHints?: Record<string, OqlContinuationHint>;
|
|
58
|
-
diagnostics: OqlDiagnostic[];
|
|
59
|
-
provenance: OqlProvenance[];
|
|
60
|
-
evidence: {
|
|
61
|
-
answerReady: boolean;
|
|
62
|
-
complete: boolean;
|
|
63
|
-
kind: EvidenceKind;
|
|
64
|
-
};
|
|
65
|
-
plan?: OqlExplainPlan;
|
|
66
|
-
}
|
|
67
|
-
export interface OqlBatchResultEnvelope {
|
|
68
|
-
batchId?: string;
|
|
69
|
-
mode: 'independent' | 'merge';
|
|
70
|
-
children: Array<{
|
|
71
|
-
queryId: string;
|
|
72
|
-
queryIndex: number;
|
|
73
|
-
envelope: OqlResultEnvelope;
|
|
74
|
-
}>;
|
|
75
|
-
merged?: OqlResultEnvelope;
|
|
76
|
-
diagnostics: OqlDiagnostic[];
|
|
77
|
-
}
|
|
78
|
-
export type OqlRunResult = OqlResultEnvelope | OqlBatchResultEnvelope;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL type guards — runtime discriminators for the input/output union types
|
|
3
|
-
* (single query vs batch, single envelope vs batch envelope).
|
|
4
|
-
*/
|
|
5
|
-
import type { OqlBatch, OqlCanonicalInput, OqlInputBatch, OqlSearchInput } from './query.js';
|
|
6
|
-
import type { OqlBatchResultEnvelope, OqlRunResult } from './envelope.js';
|
|
7
|
-
export declare function isBatchInput(input: OqlSearchInput): input is OqlInputBatch;
|
|
8
|
-
export declare function isCanonicalBatch(input: OqlCanonicalInput): input is OqlBatch;
|
|
9
|
-
export declare function isBatchEnvelope(result: OqlRunResult): result is OqlBatchResultEnvelope;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* OQL planner — the explain-plan shapes describing how a query's predicates
|
|
3
|
-
* were routed to backends (pushdown/residual/route/unsupported), the backend
|
|
4
|
-
* calls made, and transformer traces, surfaced when `explain:true`.
|
|
5
|
-
*/
|
|
6
|
-
import type { PredicateId, QuerySource } from './predicates.js';
|
|
7
|
-
import type { MaterializePolicy, OqlCanonicalInput, QueryControls } from './query.js';
|
|
8
|
-
import type { OqlDiagnostic } from './diagnostics.js';
|
|
9
|
-
import type { OqlContinuation } from './envelope.js';
|
|
10
|
-
export type PlanRoute = 'PUSHDOWN' | 'RESIDUAL' | 'ROUTE' | 'UNSUPPORTED';
|
|
11
|
-
export interface OqlPlanNode {
|
|
12
|
-
predicateId: PredicateId;
|
|
13
|
-
path: string;
|
|
14
|
-
route: PlanRoute;
|
|
15
|
-
backend?: string;
|
|
16
|
-
reason: string;
|
|
17
|
-
}
|
|
18
|
-
export interface OqlBackendCall {
|
|
19
|
-
backend: string;
|
|
20
|
-
source?: QuerySource;
|
|
21
|
-
operation: string;
|
|
22
|
-
exact: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface OqlTransformerTrace {
|
|
25
|
-
id: string;
|
|
26
|
-
status: string;
|
|
27
|
-
sourceKinds: readonly string[];
|
|
28
|
-
target: string;
|
|
29
|
-
backends: readonly Pick<OqlBackendCall, 'backend' | 'operation' | 'exact'>[];
|
|
30
|
-
}
|
|
31
|
-
export interface OqlExplainPlan {
|
|
32
|
-
input: unknown;
|
|
33
|
-
normalized: OqlCanonicalInput;
|
|
34
|
-
defaults: Record<string, unknown>;
|
|
35
|
-
nodes: OqlPlanNode[];
|
|
36
|
-
backendCalls: OqlBackendCall[];
|
|
37
|
-
transformers?: readonly OqlTransformerTrace[];
|
|
38
|
-
materialization?: MaterializePolicy & {
|
|
39
|
-
required: boolean;
|
|
40
|
-
reason: string;
|
|
41
|
-
};
|
|
42
|
-
budgets: QueryControls['budget'];
|
|
43
|
-
truncated?: boolean;
|
|
44
|
-
diagnostics: OqlDiagnostic[];
|
|
45
|
-
next?: Record<string, OqlContinuation>;
|
|
46
|
-
}
|