@octocodeai/octocode-tools-core 16.3.0 → 16.6.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 +564 -0
- package/dist/config.d.ts +7 -0
- package/dist/direct.js +39 -41
- package/dist/errors/pathUtils.d.ts +1 -1
- package/dist/github/directoryFetch.d.ts +2 -1
- package/dist/github/githubAPI.d.ts +32 -1
- package/dist/github/history.d.ts +3 -0
- package/dist/github/prTransformation.d.ts +1 -1
- package/dist/github/repoStructureRecursive.d.ts +6 -0
- package/dist/index.d.ts +16 -30
- package/dist/index.js +44 -46
- package/dist/oql/adapters/compile.d.ts +25 -0
- package/dist/oql/adapters/github.d.ts +3 -0
- package/dist/oql/adapters/local.d.ts +7 -0
- package/dist/oql/adapters/materialize.d.ts +11 -0
- package/dist/oql/adapters/pagination.d.ts +21 -0
- package/dist/oql/adapters/researchTargets.d.ts +50 -0
- package/dist/oql/adapters/resultMap.d.ts +20 -0
- package/dist/oql/adapters/ruleYaml.d.ts +11 -0
- package/dist/oql/adapters/runner.d.ts +14 -0
- package/dist/oql/adapters/v2.d.ts +32 -0
- package/dist/oql/capabilities.d.ts +31 -0
- package/dist/oql/defaults.d.ts +26 -0
- package/dist/oql/diagnostics.d.ts +25 -0
- package/dist/oql/diffLanes.d.ts +29 -0
- package/dist/oql/envelope.d.ts +19 -0
- package/dist/oql/features.d.ts +7 -0
- package/dist/oql/index.d.ts +26 -0
- package/dist/oql/index.js +49 -0
- package/dist/oql/normalize.d.ts +5 -0
- package/dist/oql/planner.d.ts +7 -0
- package/dist/oql/research/analyze.d.ts +134 -0
- package/dist/oql/research/packets.d.ts +80 -0
- package/dist/oql/run.d.ts +32 -0
- package/dist/oql/schema.d.ts +1018 -0
- package/dist/oql/schemeText.d.ts +138 -0
- package/dist/oql/shorthand.d.ts +177 -0
- package/dist/oql/targetParams.d.ts +20 -0
- package/dist/oql/transformers/contract.d.ts +19 -0
- package/dist/oql/transformers/github/code.d.ts +17 -0
- package/dist/oql/transformers/github/common.d.ts +8 -0
- package/dist/oql/transformers/language.d.ts +1 -0
- package/dist/oql/transformers/registry.d.ts +16 -0
- package/dist/oql/transformers/types.d.ts +11 -0
- package/dist/oql/types.d.ts +633 -0
- package/dist/oql/v2params.d.ts +22 -0
- package/dist/providers/providerQueries.d.ts +9 -0
- package/dist/providers/providerResults.d.ts +2 -0
- package/dist/providers/types.d.ts +1 -1
- package/dist/schema.d.ts +13 -0
- package/dist/schema.js +8 -0
- package/dist/scheme/coreSchemas.d.ts +5 -5
- package/dist/scheme/fields.d.ts +6 -6
- package/dist/serverConfig.d.ts +1 -2
- package/dist/session.d.ts +2 -24
- package/dist/shared/config/defaults.d.ts +14 -0
- package/dist/shared/config/index.d.ts +9 -0
- package/dist/shared/config/index.js +9 -0
- package/dist/shared/config/loader.d.ts +7 -0
- package/dist/shared/config/resolver.d.ts +2 -0
- package/dist/shared/config/resolverCache.d.ts +12 -0
- package/dist/shared/config/resolverSections.d.ts +10 -0
- package/dist/shared/config/runtimeSurface.d.ts +21 -0
- package/dist/shared/config/schemas.d.ts +11 -0
- package/dist/shared/config/types.d.ts +92 -0
- package/dist/shared/config/validator.d.ts +2 -0
- package/dist/shared/credentials/constants.d.ts +2 -0
- package/dist/shared/credentials/credentialCache.d.ts +13 -0
- package/dist/shared/credentials/credentialEncryption.d.ts +10 -0
- package/dist/shared/credentials/credentialUtils.d.ts +4 -0
- package/dist/shared/credentials/envTokens.d.ts +9 -0
- package/dist/shared/credentials/ghCli.d.ts +1 -0
- package/dist/shared/credentials/index.d.ts +3 -0
- package/dist/shared/credentials/index.js +8 -0
- package/dist/shared/credentials/schemas.d.ts +22 -0
- package/dist/shared/credentials/storage.d.ts +30 -0
- package/dist/shared/credentials/testing.d.ts +2 -0
- package/dist/shared/credentials/testing.js +8 -0
- package/dist/shared/credentials/tokenRefresh.d.ts +24 -0
- package/dist/shared/credentials/tokenResolution.d.ts +30 -0
- package/dist/shared/credentials/types.d.ts +28 -0
- package/dist/shared/fs-utils.d.ts +2 -0
- package/dist/shared/fs-utils.js +8 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/languageSelectors.d.ts +23 -0
- package/dist/shared/paths.d.ts +31 -0
- package/dist/shared/paths.js +8 -0
- package/dist/shared/platform/index.d.ts +1 -0
- package/dist/shared/platform/index.js +8 -0
- package/dist/shared/platform/platform.d.ts +8 -0
- package/dist/shared/session/index.d.ts +5 -0
- package/dist/shared/session/index.js +8 -0
- package/dist/shared/session/schemas.d.ts +103 -0
- package/dist/shared/session/sessionCache.d.ts +9 -0
- package/dist/shared/session/sessionDiskIO.d.ts +6 -0
- package/dist/shared/session/statsDefaults.d.ts +4 -0
- package/dist/shared/session/storage.d.ts +20 -0
- package/dist/shared/session/types.d.ts +53 -0
- package/dist/tools/directToolCatalog.d.ts +15 -56
- package/dist/tools/directToolCatalog.exec.d.ts +11 -0
- package/dist/tools/directToolCatalog.meta.d.ts +82 -0
- package/dist/tools/github_clone_repo/cache.d.ts +5 -1
- package/dist/tools/github_clone_repo/scheme.d.ts +56 -9
- package/dist/tools/github_clone_repo/types.d.ts +3 -1
- package/dist/tools/github_fetch_content/scheme.d.ts +112 -4
- package/dist/tools/github_fetch_content/types.d.ts +39 -0
- package/dist/tools/github_search_code/scheme.d.ts +6 -6
- package/dist/tools/github_search_pull_requests/contentResponse.d.ts +0 -1
- package/dist/tools/github_search_pull_requests/execution.d.ts +1 -11
- package/dist/tools/github_search_pull_requests/scheme.d.ts +6 -2
- package/dist/tools/github_search_repos/scheme.d.ts +7 -6
- package/dist/tools/github_view_repo_structure/execution.d.ts +0 -9
- package/dist/tools/github_view_repo_structure/scheme.d.ts +10 -6
- package/dist/tools/local_binary_inspect/archiveOps.d.ts +2 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +48 -7
- package/dist/tools/local_binary_inspect/binaryOps.d.ts +16 -7
- package/dist/tools/local_binary_inspect/scheme.d.ts +10 -7
- package/dist/tools/local_fetch_content/scheme.d.ts +2 -2
- package/dist/tools/local_find_files/scheme.d.ts +2 -2
- package/dist/tools/local_ripgrep/lspBoost.d.ts +54 -0
- package/dist/tools/local_ripgrep/rankingProfile.d.ts +113 -0
- package/dist/tools/local_ripgrep/ripgrepResultBuilder.d.ts +10 -1
- package/dist/tools/local_ripgrep/scheme.d.ts +29 -4
- package/dist/tools/local_ripgrep/structuralSearch.d.ts +3 -4
- package/dist/tools/local_view_structure/scheme.d.ts +2 -2
- package/dist/tools/local_view_structure/structureFilters.d.ts +1 -3
- package/dist/tools/local_view_structure/structureResponse.d.ts +1 -0
- package/dist/tools/lsp/semantic_content/scheme.d.ts +174 -10
- package/dist/tools/lsp/shared/callHierarchyTraversal.d.ts +2 -2
- package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +2 -2
- package/dist/tools/lsp/shared/semanticTypes.d.ts +36 -6
- package/dist/tools/oql_search/execution.d.ts +7 -0
- package/dist/tools/package_search/execution.d.ts +10 -0
- package/dist/tools/package_search/scheme.d.ts +9 -7
- package/dist/tools/providerMappers.d.ts +24 -5
- package/dist/tools/toolConfig.d.ts +1 -0
- package/dist/tools/toolMetadata/proxies.d.ts +0 -6
- package/dist/tools/toolNames.d.ts +2 -0
- package/dist/tools/utils.d.ts +3 -7
- package/dist/types/bulk.d.ts +0 -2
- package/dist/types/execution.d.ts +1 -2
- package/dist/types/server.d.ts +0 -1
- package/dist/types/session.d.ts +0 -19
- package/dist/types/toolResults.d.ts +2 -3
- package/dist/utils/contextUtils.d.ts +49 -2
- package/dist/utils/core/lines.d.ts +16 -0
- package/dist/utils/core/types.d.ts +12 -1
- package/dist/utils/file/filters.d.ts +2 -11
- package/dist/utils/markdownOutline.d.ts +10 -0
- package/dist/utils/parsers/diff.d.ts +18 -0
- package/dist/utils/response/error.d.ts +38 -4
- package/dist/utils/response/groupedFinalizer.d.ts +0 -25
- package/package.json +51 -14
- package/dist/commands/BaseCommandBuilder.d.ts +0 -14
- package/dist/commands/FindCommandBuilder.d.ts +0 -23
- package/dist/commands/LsCommandBuilder.d.ts +0 -15
- package/dist/commands/RipgrepCommandBuilder.d.ts +0 -27
- package/dist/hints/dynamic.d.ts +0 -6
- package/dist/hints/index.d.ts +0 -2
- package/dist/hints/types.d.ts +0 -1
- package/dist/tools/github_clone_repo/hints.d.ts +0 -2
- package/dist/tools/github_fetch_content/hints.d.ts +0 -2
- package/dist/tools/github_search_code/hints.d.ts +0 -2
- package/dist/tools/github_search_pull_requests/hints.d.ts +0 -2
- package/dist/tools/github_search_repos/hints.d.ts +0 -2
- package/dist/tools/github_view_repo_structure/hints.d.ts +0 -2
- package/dist/tools/local_fetch_content/hints.d.ts +0 -2
- package/dist/tools/local_find_files/hints.d.ts +0 -2
- package/dist/tools/local_ripgrep/grepFallbackExecutor.d.ts +0 -3
- package/dist/tools/local_ripgrep/hints.d.ts +0 -2
- package/dist/tools/local_ripgrep/ripgrepParser.d.ts +0 -9
- package/dist/tools/local_view_structure/hints.d.ts +0 -2
- package/dist/tools/local_view_structure/structureParser.d.ts +0 -3
- package/dist/tools/local_view_structure/structureWalker.d.ts +0 -24
- package/dist/tools/lsp/semantic_content/hints.d.ts +0 -4
- package/dist/tools/package_search/hints.d.ts +0 -2
- package/dist/types/metadata.d.ts +0 -69
- package/dist/utils/exec/commandAvailability.d.ts +0 -19
- package/dist/utils/exec/ripgrepBinary.d.ts +0 -3
- package/dist/utils/pagination/outputSizeLimit.d.ts +0 -16
- package/dist/utils/response/structuredPagination.d.ts +0 -9
|
@@ -0,0 +1,138 @@
|
|
|
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, artifacts, 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/artifacts/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, artifacts, 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, artifact mode, 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 'inspect a binary/archive': "target:artifacts (--inspect/--list/--strings/--extract)";
|
|
33
|
+
readonly 'dead-code / reachability sweep': "target:research, then upgrade with target:graph proof:\"lsp\"";
|
|
34
|
+
readonly 'make a remote repo behave like local (AST/LSP/negation)': "target:materialize (or clone / cache fetch)";
|
|
35
|
+
};
|
|
36
|
+
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 exact.", "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."];
|
|
37
|
+
readonly quickStart: {
|
|
38
|
+
readonly 'text search (local)': "search \"functionName\" ./src";
|
|
39
|
+
readonly 'text search (GitHub)': "search \"functionName\" facebook/react";
|
|
40
|
+
readonly 'package lookup (npm)': "search zod --target packages";
|
|
41
|
+
readonly 'PR deep read (GitHub)': "search facebook/react#1 --target pullRequests --comments --patches";
|
|
42
|
+
readonly 'commit history (GitHub)': "search facebook/react/packages/react/src --target commits --since 2024-01-01T00:00:00Z";
|
|
43
|
+
readonly 'browse a tree (local dir or owner/repo)': "search ./src --tree | search facebook/react --tree";
|
|
44
|
+
readonly 'read a file (local or owner/repo/path)': "search ./src/index.ts | search facebook/react/packages/react/src/index.js";
|
|
45
|
+
readonly 'semantics (local/materialized)': "search ./src/index.ts --op documentSymbols | search ./src/index.ts --op references --symbol runCLI --line 42";
|
|
46
|
+
readonly 'artifact inspect/list': "search app.tgz --target artifacts --list | search dist/server.node --target artifacts --inspect";
|
|
47
|
+
readonly 'PR diff (GitHub)': "search facebook/react#123 --target diff | search facebook/react --target diff --pr 123";
|
|
48
|
+
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>";
|
|
49
|
+
readonly 'structural AST (local \u2014 needs full node shape)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" ./src --lang ts";
|
|
50
|
+
readonly 'structural AST (GitHub \u2014 clones bounded subtree)': "search --pattern \"function $NAME($$$ARGS) { $$$BODY }\" facebook/react/packages --lang js --materialize auto";
|
|
51
|
+
readonly 'GitHub index miss recovery': "search useState packages/react/src --repo facebook/react --materialize required | clone facebook/react/packages/react/src | cache fetch facebook/react packages/react/src --depth tree";
|
|
52
|
+
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}'";
|
|
53
|
+
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}'";
|
|
54
|
+
readonly 'OQL full-schema reference': "search --scheme";
|
|
55
|
+
readonly 'routing explanation before running': "search --explain --query '{\"target\":\"code\",\"from\":{\"kind\":\"local\",\"path\":\"./src\"},\"where\":{\"kind\":\"text\",\"value\":\"term\"}}'";
|
|
56
|
+
};
|
|
57
|
+
readonly evidenceSemantics: {
|
|
58
|
+
readonly 'answerReady:true': "The envelope answers the query as asked. No required follow-up.";
|
|
59
|
+
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.";
|
|
60
|
+
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.";
|
|
61
|
+
readonly 'kind:proof': "Backend evaluated the request exactly.";
|
|
62
|
+
readonly 'kind:partial': "Truncation, pagination, or residual checks remain.";
|
|
63
|
+
readonly 'kind:candidate': "Useful evidence, not proof. research/graph are always candidate — upgrade via next.semantic/search/fetch.";
|
|
64
|
+
readonly 'kind:unsupported': "OQL could not safely execute the requested semantics.";
|
|
65
|
+
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.";
|
|
66
|
+
readonly 'proofStatus:conflicting-evidence': "LSP refs>0 — symbol IS retained; check retainedBy before acting.";
|
|
67
|
+
readonly 'proofStatus:needs-framework-graph': "Maybe an entrypoint (framework/export/dynamic import) — LSP alone can't prove reachability.";
|
|
68
|
+
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.";
|
|
69
|
+
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.";
|
|
70
|
+
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.";
|
|
71
|
+
};
|
|
72
|
+
readonly query: {
|
|
73
|
+
readonly schema: "\"oql\" (inserted by normalization)";
|
|
74
|
+
readonly target: string;
|
|
75
|
+
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";
|
|
76
|
+
readonly scope: "{ path?, language?, include?, exclude?, excludeDir?, hidden?, noIgnore?, minDepth?, maxDepth? } — minDepth/maxDepth bound directory recursion depth (0-64)";
|
|
77
|
+
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/artifact text narrowing, use that target params hint.";
|
|
78
|
+
readonly materialize: "{ mode:\"never\"|\"auto\"|\"required\", strategy?:\"file\"|\"tree\"|\"subtree\"|\"repo\", allowFullRepo?, forceRefresh? }";
|
|
79
|
+
readonly fetch: "{ content?: { contentView:\"exact\"|\"compact\"|\"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)";
|
|
80
|
+
readonly params: "target options (validated by OQL for common fields and by the backing tool exhaustively) — see params hints below";
|
|
81
|
+
readonly select: "string[] projection of result/continuation fields";
|
|
82
|
+
readonly view: "discovery | paginated | detailed";
|
|
83
|
+
readonly controls: "{ search?: { countLinesPerFile?, countMatchesPerFile?, onlyMatching?, unique?, countUnique?, contextLines?, invertMatch?, matchWindow?, matchContentLength?, maxMatchesPerFile?, matchPage?, sort?, sortReverse?, rankingProfile?, debugRanking? }, budget?: { maxFiles?, maxCandidates?, maxBytes?, maxMaterializedBytes?, maxPlanNodes?, maxBooleanExpansion?, timeoutMs? } } — output/cost controls";
|
|
84
|
+
readonly limit: "number — total result cap where supported. Prefer itemsPerPage for paged research/graph/file-history continuations.";
|
|
85
|
+
readonly page: "number — top-level page number for OQL windowing/continuations";
|
|
86
|
+
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, entryPageNumber, scanOffset, etc.).";
|
|
87
|
+
readonly explain: "boolean";
|
|
88
|
+
};
|
|
89
|
+
readonly params: {
|
|
90
|
+
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";
|
|
91
|
+
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";
|
|
92
|
+
readonly packages: "{ packageName?: string | keywords?: string[], mode?:\"lean\"|\"full\", page? } — backing tool npmSearch";
|
|
93
|
+
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";
|
|
94
|
+
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";
|
|
95
|
+
readonly artifacts: "{ mode:\"inspect\"|\"list\"|\"extract\"|\"decompress\"|\"strings\"|\"unpack\", minLength?, entryPageNumber?, scanOffset?, charOffset?, charLength?, matchString? } — localBinaryInspect. matchString filters text-producing modes (extract/decompress/strings) over the current fetched payload. For large strings dumps, follow next.search on data.localPath for lossless ripgrep paging; next.artifactContent (charOffset) = next inline text window; next.artifactStrings (scanOffset) = next binary scan window. extract/unpack/decompress → tree at data.localPath (next.structure/next.files).";
|
|
96
|
+
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";
|
|
97
|
+
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.";
|
|
98
|
+
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.";
|
|
99
|
+
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.";
|
|
100
|
+
};
|
|
101
|
+
readonly predicates: {
|
|
102
|
+
readonly text: "{ kind:\"text\", value, case?, wholeWord? }";
|
|
103
|
+
readonly regex: "{ kind:\"regex\", value, dialect?:\"rust\"|\"pcre2\"|\"provider\", case?, wholeWord?, multiline?, dotAll? }";
|
|
104
|
+
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.";
|
|
105
|
+
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:\"=\")";
|
|
106
|
+
readonly boolean: "{ kind:\"all\"|\"any\", of: Predicate[] } | { kind:\"not\", predicate }";
|
|
107
|
+
};
|
|
108
|
+
readonly batch: {
|
|
109
|
+
readonly queries: "OqlQuery[] (1-5)";
|
|
110
|
+
readonly combine: "independent | merge";
|
|
111
|
+
};
|
|
112
|
+
readonly explainRoutes: {
|
|
113
|
+
readonly PUSHDOWN: "Backend evaluates this predicate exactly — good. No residual work.";
|
|
114
|
+
readonly RESIDUAL: "Backend narrows candidates but OQL must finish evaluation locally.";
|
|
115
|
+
readonly ROUTE: "OQL must use a different lane, often materialization.";
|
|
116
|
+
readonly UNSUPPORTED: "OQL cannot execute this predicate safely on the chosen source.";
|
|
117
|
+
};
|
|
118
|
+
readonly defaults: {
|
|
119
|
+
schema: "oql";
|
|
120
|
+
view: "paginated";
|
|
121
|
+
page: number;
|
|
122
|
+
itemsPerPage: number;
|
|
123
|
+
githubMaterializeMode: "never";
|
|
124
|
+
textCase: "smart";
|
|
125
|
+
regexDialectLocal: "rust";
|
|
126
|
+
regexCase: "smart";
|
|
127
|
+
contentView: "compact";
|
|
128
|
+
contentCharLength: number;
|
|
129
|
+
matchContentLength: number;
|
|
130
|
+
maxPlanNodes: number;
|
|
131
|
+
maxBooleanExpansion: number;
|
|
132
|
+
normalCodeContext: number;
|
|
133
|
+
detailedCodeContext: number;
|
|
134
|
+
localSearchSort: "relevance";
|
|
135
|
+
localRankingProfile: "auto";
|
|
136
|
+
};
|
|
137
|
+
};
|
|
138
|
+
export declare function oqlSchemaText(): string;
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shorthand lowering for `octocode search`.
|
|
3
|
+
*
|
|
4
|
+
* The CLI reads argv and resolves a target string to a corpus (local path vs
|
|
5
|
+
* GitHub ref — the only step that needs the filesystem). Everything else —
|
|
6
|
+
* which predicate the flags select, dialect, lang requirements, and assembling
|
|
7
|
+
* the sugar object the normalizer accepts — lives here so it is owned once in
|
|
8
|
+
* tools-core (not re-implemented in the interface) and is unit-testable without
|
|
9
|
+
* argv or a terminal.
|
|
10
|
+
*/
|
|
11
|
+
import { type OqlInputBatch, type OqlInputQuery } from './types.js';
|
|
12
|
+
/** Corpus already classified by the caller (local path vs GitHub ref). */
|
|
13
|
+
export type ShorthandCorpus = {
|
|
14
|
+
kind: 'local';
|
|
15
|
+
path: string;
|
|
16
|
+
} | {
|
|
17
|
+
kind: 'github';
|
|
18
|
+
repo: string;
|
|
19
|
+
path?: string;
|
|
20
|
+
ref?: string;
|
|
21
|
+
} | {
|
|
22
|
+
kind: 'npm';
|
|
23
|
+
};
|
|
24
|
+
export interface SearchShorthand {
|
|
25
|
+
target?: string;
|
|
26
|
+
view?: string;
|
|
27
|
+
contentView?: string;
|
|
28
|
+
search?: string;
|
|
29
|
+
/** literal text term (used when no pattern/rule/regex flag is set) */
|
|
30
|
+
text?: string;
|
|
31
|
+
/** regex pattern (rust dialect unless pcre2) */
|
|
32
|
+
regex?: string;
|
|
33
|
+
pcre2?: boolean;
|
|
34
|
+
/** structural AST pattern (requires lang) */
|
|
35
|
+
pattern?: string;
|
|
36
|
+
/** structural rule, already parsed from JSON (requires lang) */
|
|
37
|
+
rule?: unknown;
|
|
38
|
+
lang?: string;
|
|
39
|
+
corpus: ShorthandCorpus;
|
|
40
|
+
materialize?: 'never' | 'auto' | 'required';
|
|
41
|
+
branch?: string;
|
|
42
|
+
forceRefresh?: boolean;
|
|
43
|
+
limit?: number;
|
|
44
|
+
page?: number;
|
|
45
|
+
itemsPerPage?: number;
|
|
46
|
+
include?: string[];
|
|
47
|
+
exclude?: string[];
|
|
48
|
+
excludeDir?: string[];
|
|
49
|
+
extension?: string;
|
|
50
|
+
filename?: string;
|
|
51
|
+
pathPattern?: string;
|
|
52
|
+
hidden?: boolean;
|
|
53
|
+
noIgnore?: boolean;
|
|
54
|
+
minDepth?: number;
|
|
55
|
+
maxDepth?: number;
|
|
56
|
+
empty?: boolean;
|
|
57
|
+
modifiedWithin?: string;
|
|
58
|
+
modifiedBefore?: string;
|
|
59
|
+
accessedWithin?: string;
|
|
60
|
+
sizeGreater?: string;
|
|
61
|
+
sizeLess?: string;
|
|
62
|
+
permissions?: string;
|
|
63
|
+
executable?: boolean;
|
|
64
|
+
readable?: boolean;
|
|
65
|
+
writable?: boolean;
|
|
66
|
+
details?: boolean;
|
|
67
|
+
showModified?: boolean;
|
|
68
|
+
caseInsensitive?: boolean;
|
|
69
|
+
caseSensitive?: boolean;
|
|
70
|
+
wholeWord?: boolean;
|
|
71
|
+
fixedString?: boolean;
|
|
72
|
+
multiline?: boolean;
|
|
73
|
+
multilineDotall?: boolean;
|
|
74
|
+
filesOnly?: boolean;
|
|
75
|
+
directoriesOnly?: boolean;
|
|
76
|
+
filesWithoutMatch?: boolean;
|
|
77
|
+
entryType?: 'file' | 'directory';
|
|
78
|
+
countLinesPerFile?: boolean;
|
|
79
|
+
countMatchesPerFile?: boolean;
|
|
80
|
+
onlyMatching?: boolean;
|
|
81
|
+
unique?: boolean;
|
|
82
|
+
countUnique?: boolean;
|
|
83
|
+
contextLines?: number;
|
|
84
|
+
invertMatch?: boolean;
|
|
85
|
+
matchWindow?: number;
|
|
86
|
+
matchContentLength?: number;
|
|
87
|
+
maxMatchesPerFile?: number;
|
|
88
|
+
matchPage?: number;
|
|
89
|
+
maxFiles?: number;
|
|
90
|
+
sort?: string;
|
|
91
|
+
sortReverse?: boolean;
|
|
92
|
+
rankingProfile?: string;
|
|
93
|
+
debugRanking?: boolean;
|
|
94
|
+
matchString?: string;
|
|
95
|
+
matchRegex?: boolean;
|
|
96
|
+
matchCaseSensitive?: boolean;
|
|
97
|
+
startLine?: number;
|
|
98
|
+
endLine?: number;
|
|
99
|
+
charOffset?: number;
|
|
100
|
+
charLength?: number;
|
|
101
|
+
fullContent?: boolean;
|
|
102
|
+
tree?: boolean;
|
|
103
|
+
includeSizes?: boolean;
|
|
104
|
+
op?: string;
|
|
105
|
+
symbol?: string;
|
|
106
|
+
symbolKind?: string;
|
|
107
|
+
uri?: string;
|
|
108
|
+
line?: number;
|
|
109
|
+
order?: number;
|
|
110
|
+
orderDirection?: string;
|
|
111
|
+
depth?: number;
|
|
112
|
+
workspaceRoot?: string;
|
|
113
|
+
format?: string;
|
|
114
|
+
owner?: string;
|
|
115
|
+
topic?: string[];
|
|
116
|
+
stars?: string;
|
|
117
|
+
forks?: string;
|
|
118
|
+
goodFirstIssues?: string;
|
|
119
|
+
license?: string;
|
|
120
|
+
created?: string;
|
|
121
|
+
updated?: string;
|
|
122
|
+
closed?: string;
|
|
123
|
+
mergedAt?: string;
|
|
124
|
+
size?: string;
|
|
125
|
+
match?: string[];
|
|
126
|
+
archived?: boolean;
|
|
127
|
+
visibility?: string;
|
|
128
|
+
concise?: boolean;
|
|
129
|
+
state?: string;
|
|
130
|
+
author?: string;
|
|
131
|
+
label?: string;
|
|
132
|
+
prNumber?: number;
|
|
133
|
+
base?: string;
|
|
134
|
+
head?: string;
|
|
135
|
+
draft?: boolean;
|
|
136
|
+
commentsContent?: boolean;
|
|
137
|
+
commitsContent?: boolean;
|
|
138
|
+
deep?: boolean;
|
|
139
|
+
patchFile?: string;
|
|
140
|
+
reviewMode?: string;
|
|
141
|
+
filePage?: number;
|
|
142
|
+
commentPage?: number;
|
|
143
|
+
commitPage?: number;
|
|
144
|
+
since?: string;
|
|
145
|
+
until?: string;
|
|
146
|
+
patches?: boolean;
|
|
147
|
+
baseRef?: string;
|
|
148
|
+
headRef?: string;
|
|
149
|
+
diffPath?: string;
|
|
150
|
+
artifactMode?: string;
|
|
151
|
+
detailed?: boolean;
|
|
152
|
+
verbose?: boolean;
|
|
153
|
+
maxEntries?: number;
|
|
154
|
+
minLength?: number;
|
|
155
|
+
entryPageNumber?: number;
|
|
156
|
+
scanOffset?: number;
|
|
157
|
+
includeOffsets?: boolean;
|
|
158
|
+
archiveFile?: string;
|
|
159
|
+
intent?: string;
|
|
160
|
+
facets?: string[];
|
|
161
|
+
proof?: string;
|
|
162
|
+
proofLimit?: number;
|
|
163
|
+
includePackets?: boolean;
|
|
164
|
+
includeFacts?: boolean;
|
|
165
|
+
includeEdges?: boolean;
|
|
166
|
+
}
|
|
167
|
+
export type ShorthandResult = {
|
|
168
|
+
input: OqlInputQuery | OqlInputBatch;
|
|
169
|
+
} | {
|
|
170
|
+
error: string;
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Lower shorthand parts into the OQL sugar object. Predicate precedence:
|
|
174
|
+
* pattern > rule > regex > text. Returns a typed error for invalid combos
|
|
175
|
+
* (e.g. structural without `lang`) instead of throwing.
|
|
176
|
+
*/
|
|
177
|
+
export declare function buildShorthandInput(parts: SearchShorthand): ShorthandResult;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed target-specific `params` schemas.
|
|
3
|
+
*
|
|
4
|
+
* Research targets (semantics/repositories/packages/pullRequests/commits/
|
|
5
|
+
* artifacts/diff/research/graph) carry a `params` bag that the backing tool validates
|
|
6
|
+
* exhaustively. These schemas type the documented common fields so a type
|
|
7
|
+
* mistake (e.g. `prNumber:"abc"`) is caught at the OQL layer with a clear
|
|
8
|
+
* `invalidQuery` instead of failing opaquely at the tool, while `.passthrough()`
|
|
9
|
+
* keeps the backing tool the source of truth for the rest.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from 'zod';
|
|
12
|
+
import type { OqlActiveTarget } from './types.js';
|
|
13
|
+
/** Per-target params schema; targets without a `params` bag are absent. */
|
|
14
|
+
export declare const TARGET_PARAM_SCHEMAS: Partial<Record<OqlActiveTarget, z.ZodTypeAny>>;
|
|
15
|
+
/**
|
|
16
|
+
* Validate a target's `params` bag against its typed schema. Returns `null` when
|
|
17
|
+
* valid (or no schema applies), or a Zod-style error message string the caller
|
|
18
|
+
* raises as `invalidQuery`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function validateTargetParams(target: OqlActiveTarget, params: unknown): string | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OqlQuery, Predicate } 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
|
+
/**
|
|
10
|
+
* Path-like field predicates (`basename`/`extension`/`path` with op `=`) map
|
|
11
|
+
* directly onto GitHub code-search path qualifiers — the same provider route
|
|
12
|
+
* OQL target:"files" uses. Returns the ghSearchCode param
|
|
13
|
+
* fragment, or `null` if the predicate is not a provider-expressible path-field
|
|
14
|
+
* equality (those still require materialization, per the planner files lane).
|
|
15
|
+
*/
|
|
16
|
+
export declare function githubPathFieldParams(where: Predicate): GithubCodeSearchToolQuery | null;
|
|
17
|
+
export declare function toGithubCodeSearchToolQuery(query: OqlQuery, options?: GithubCodeSearchTransformOptions): TransformResult<GithubCodeSearchToolQuery>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OqlQuery, QueryScope, QuerySource } from '../../types.js';
|
|
2
|
+
export declare function splitGithubSource(source: QuerySource | undefined): {
|
|
3
|
+
owner?: string;
|
|
4
|
+
repo?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function firstScopePath(scope: QueryScope | undefined): string | undefined;
|
|
7
|
+
export declare function firstScopeLanguage(scope: QueryScope | undefined): string | undefined;
|
|
8
|
+
export declare function requestedRowLimit(query: OqlQuery): number | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { classifyLanguageSelector, toGithubCodeLanguageParams, toGithubRepositoryLanguage, toLocalFileLanguageGlobs, toLocalSearchLanguageParams, } from '../../shared/languageSelectors.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
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;
|
|
@@ -0,0 +1,11 @@
|
|
|
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;
|