@octocodeai/octocode-tools-core 16.5.1 → 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.
Files changed (90) hide show
  1. package/README.md +113 -95
  2. package/dist/direct.js +38 -33
  3. package/dist/github/githubAPI.d.ts +22 -0
  4. package/dist/github/history.d.ts +3 -0
  5. package/dist/github/prTransformation.d.ts +1 -1
  6. package/dist/index.d.ts +6 -8
  7. package/dist/index.js +45 -40
  8. package/dist/oql/adapters/compile.d.ts +25 -0
  9. package/dist/oql/adapters/github.d.ts +3 -0
  10. package/dist/oql/adapters/local.d.ts +7 -0
  11. package/dist/oql/adapters/materialize.d.ts +11 -0
  12. package/dist/oql/adapters/pagination.d.ts +21 -0
  13. package/dist/oql/adapters/researchTargets.d.ts +50 -0
  14. package/dist/oql/adapters/resultMap.d.ts +20 -0
  15. package/dist/oql/adapters/ruleYaml.d.ts +11 -0
  16. package/dist/oql/adapters/runner.d.ts +14 -0
  17. package/dist/oql/adapters/v2.d.ts +32 -0
  18. package/dist/oql/capabilities.d.ts +31 -0
  19. package/dist/oql/defaults.d.ts +26 -0
  20. package/dist/oql/diagnostics.d.ts +25 -0
  21. package/dist/oql/diffLanes.d.ts +29 -0
  22. package/dist/oql/envelope.d.ts +19 -0
  23. package/dist/oql/features.d.ts +7 -0
  24. package/dist/oql/index.d.ts +26 -0
  25. package/dist/oql/index.js +49 -0
  26. package/dist/oql/normalize.d.ts +5 -0
  27. package/dist/oql/planner.d.ts +7 -0
  28. package/dist/oql/research/analyze.d.ts +134 -0
  29. package/dist/oql/research/packets.d.ts +80 -0
  30. package/dist/oql/run.d.ts +32 -0
  31. package/dist/oql/schema.d.ts +1018 -0
  32. package/dist/oql/schemeText.d.ts +138 -0
  33. package/dist/oql/shorthand.d.ts +177 -0
  34. package/dist/oql/targetParams.d.ts +20 -0
  35. package/dist/oql/transformers/contract.d.ts +19 -0
  36. package/dist/oql/transformers/github/code.d.ts +17 -0
  37. package/dist/oql/transformers/github/common.d.ts +8 -0
  38. package/dist/oql/transformers/language.d.ts +1 -0
  39. package/dist/oql/transformers/registry.d.ts +16 -0
  40. package/dist/oql/transformers/types.d.ts +11 -0
  41. package/dist/oql/types.d.ts +633 -0
  42. package/dist/oql/v2params.d.ts +22 -0
  43. package/dist/providers/types.d.ts +1 -1
  44. package/dist/schema.d.ts +13 -0
  45. package/dist/schema.js +8 -0
  46. package/dist/serverConfig.d.ts +0 -1
  47. package/dist/session.d.ts +2 -24
  48. package/dist/shared/config/defaults.d.ts +1 -2
  49. package/dist/shared/config/index.d.ts +2 -3
  50. package/dist/shared/config/index.js +2 -3
  51. package/dist/shared/config/resolverSections.d.ts +1 -3
  52. package/dist/shared/config/runtimeSurface.d.ts +2 -2
  53. package/dist/shared/config/schemas.d.ts +0 -1
  54. package/dist/shared/config/types.d.ts +0 -8
  55. package/dist/shared/credentials/index.js +1 -2
  56. package/dist/shared/index.d.ts +0 -1
  57. package/dist/shared/languageSelectors.d.ts +23 -0
  58. package/dist/shared/paths.d.ts +0 -2
  59. package/dist/shared/paths.js +1 -1
  60. package/dist/shared/session/index.js +1 -2
  61. package/dist/tools/directToolCatalog.d.ts +15 -56
  62. package/dist/tools/directToolCatalog.exec.d.ts +11 -0
  63. package/dist/tools/directToolCatalog.meta.d.ts +82 -0
  64. package/dist/tools/github_clone_repo/cache.d.ts +1 -1
  65. package/dist/tools/github_clone_repo/types.d.ts +2 -0
  66. package/dist/tools/github_fetch_content/scheme.d.ts +104 -0
  67. package/dist/tools/github_fetch_content/types.d.ts +27 -0
  68. package/dist/tools/lsp/semantic_content/scheme.d.ts +170 -2
  69. package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +2 -2
  70. package/dist/tools/lsp/shared/semanticTypes.d.ts +34 -5
  71. package/dist/tools/oql_search/execution.d.ts +7 -0
  72. package/dist/tools/package_search/execution.d.ts +10 -0
  73. package/dist/tools/providerMappers.d.ts +7 -7
  74. package/dist/tools/toolConfig.d.ts +1 -0
  75. package/dist/tools/toolNames.d.ts +2 -0
  76. package/dist/types/server.d.ts +0 -1
  77. package/dist/types/session.d.ts +0 -19
  78. package/dist/utils/contextUtils.d.ts +15 -1
  79. package/dist/utils/core/types.d.ts +2 -1
  80. package/dist/utils/markdownOutline.d.ts +10 -0
  81. package/dist/utils/response/groupedFinalizer.d.ts +0 -23
  82. package/package.json +11 -3
  83. package/dist/commands/BaseCommandBuilder.d.ts +0 -14
  84. package/dist/commands/FindCommandBuilder.d.ts +0 -23
  85. package/dist/commands/LsCommandBuilder.d.ts +0 -15
  86. package/dist/shared/logger/index.d.ts +0 -2
  87. package/dist/shared/logger/logger.d.ts +0 -17
  88. package/dist/utils/pagination/outputSizeLimit.d.ts +0 -16
  89. package/dist/utils/ranking/evidenceRanker.d.ts +0 -86
  90. package/dist/utils/response/structuredPagination.d.ts +0 -9
@@ -1,6 +1,6 @@
1
1
  import type { ExactPosition, LSPRange } from '@octocodeai/octocode-engine/lsp/types';
2
- export declare const LSP_GET_SEMANTIC_CONTENT_TOOL_NAME = "lspGetSemantics";
3
- export declare const SEMANTIC_CONTENT_TYPES: readonly ["definition", "references", "callers", "callees", "callHierarchy", "hover", "documentSymbols", "typeDefinition", "implementation"];
2
+ export { LSP_GET_SEMANTIC_CONTENT_TOOL_NAME } from '../../toolNames.js';
3
+ export declare const SEMANTIC_CONTENT_TYPES: readonly ["definition", "references", "callers", "callees", "callHierarchy", "hover", "documentSymbols", "typeDefinition", "implementation", "workspaceSymbol", "supertypes", "subtypes", "diagnostic"];
4
4
  export type SemanticContentType = (typeof SEMANTIC_CONTENT_TYPES)[number];
5
5
  export type SemanticOutputFormat = 'structured' | 'compact';
6
6
  export type SemanticQueryBase = {
@@ -17,7 +17,7 @@ export type SemanticQueryBase = {
17
17
  reasoning?: string;
18
18
  };
19
19
  export type SymbolAnchoredSemanticQuery = SemanticQueryBase & {
20
- type: Exclude<SemanticContentType, 'documentSymbols'>;
20
+ type: Exclude<SemanticContentType, 'documentSymbols' | 'workspaceSymbol' | 'diagnostic'>;
21
21
  symbolName: string;
22
22
  lineHint: number;
23
23
  orderHint?: number;
@@ -28,7 +28,16 @@ export type SymbolAnchoredSemanticQuery = SemanticQueryBase & {
28
28
  export type DocumentSymbolsSemanticQuery = SemanticQueryBase & {
29
29
  type: 'documentSymbols';
30
30
  };
31
- export type LspGetSemanticsQuery = SymbolAnchoredSemanticQuery | DocumentSymbolsSemanticQuery;
31
+ /** `workspace/symbol`: project-wide fuzzy symbol search. `symbolName` is the query string. */
32
+ export type WorkspaceSymbolSemanticQuery = SemanticQueryBase & {
33
+ type: 'workspaceSymbol';
34
+ symbolName: string;
35
+ };
36
+ /** `textDocument/diagnostic` (pull): errors/warnings for a file without a position anchor. */
37
+ export type DiagnosticSemanticQuery = SemanticQueryBase & {
38
+ type: 'diagnostic';
39
+ };
40
+ export type LspGetSemanticsQuery = SymbolAnchoredSemanticQuery | DocumentSymbolsSemanticQuery | WorkspaceSymbolSemanticQuery | DiagnosticSemanticQuery;
32
41
  export type ResolvedSymbol = {
33
42
  name: string;
34
43
  uri: string;
@@ -65,7 +74,7 @@ export declare function compactLocation(snippet: {
65
74
  };
66
75
  isDefinition?: boolean;
67
76
  }): CompactLocation;
68
- export type SemanticEmptyCategory = 'serverUnavailable' | 'unsupportedOperation' | 'symbolNotFound' | 'anchorFailed' | 'noLocations' | 'noReferences' | 'noHover' | 'noCalls';
77
+ export type SemanticEmptyCategory = 'serverUnavailable' | 'unsupportedOperation' | 'symbolNotFound' | 'anchorFailed' | 'noLocations' | 'noReferences' | 'noHover' | 'noCalls' | 'noWorkspaceSymbols' | 'noTypeHierarchy' | 'noDiagnostics';
69
78
  export type SemanticEmptyState = {
70
79
  category: SemanticEmptyCategory;
71
80
  reason: string;
@@ -124,6 +133,26 @@ export type LspSemanticEnvelope = {
124
133
  totalSymbols?: number;
125
134
  topLevelSymbols?: number;
126
135
  empty?: SemanticEmptyState;
136
+ } | {
137
+ kind: 'workspaceSymbol';
138
+ query: string;
139
+ symbols: unknown[];
140
+ totalSymbols: number;
141
+ empty?: SemanticEmptyState;
142
+ } | {
143
+ kind: 'typeHierarchy';
144
+ direction: 'supertypes' | 'subtypes';
145
+ root?: unknown;
146
+ items: unknown[];
147
+ totalItems: number;
148
+ empty?: SemanticEmptyState;
149
+ } | {
150
+ kind: 'diagnostic';
151
+ diagnostics: unknown[];
152
+ totalDiagnostics: number;
153
+ errorCount: number;
154
+ warningCount: number;
155
+ empty?: SemanticEmptyState;
127
156
  } | {
128
157
  kind: 'empty';
129
158
  category: SemanticEmptyCategory;
@@ -0,0 +1,7 @@
1
+ import { type CallToolResult } from '@modelcontextprotocol/sdk/types.js';
2
+ import type { AuthInfo } from '@modelcontextprotocol/sdk/server/auth/types.js';
3
+ type OqlSearchToolInput = Record<string, unknown> & {
4
+ authInfo?: AuthInfo;
5
+ };
6
+ export declare function executeOqlSearchTool(input: OqlSearchToolInput): Promise<CallToolResult>;
7
+ export {};
@@ -3,5 +3,15 @@ import type { z } from 'zod';
3
3
  import type { NpmPackageQuerySchema } from '@octocodeai/octocode-core/schemas';
4
4
  type NpmSearchQuery = z.input<typeof NpmPackageQuerySchema>;
5
5
  import type { ToolExecutionArgs } from '../../types/execution.js';
6
+ type PackagePagination = {
7
+ currentPage: number;
8
+ totalPages: number;
9
+ perPage: number;
10
+ totalFound: number;
11
+ returned: number;
12
+ hasMore: boolean;
13
+ nextPage?: number;
14
+ };
15
+ export declare function buildPackagePagination(query: NpmSearchQuery, totalFound: number, returned: number, isKeyword: boolean): PackagePagination;
6
16
  export declare function searchPackages(args: ToolExecutionArgs<NpmSearchQuery>): Promise<CallToolResult>;
7
17
  export {};
@@ -42,7 +42,7 @@ export declare function mapCodeSearchToolQuery(query: WithOptionalMeta<GitHubCod
42
42
  filename: string;
43
43
  extension: string;
44
44
  language: string | undefined;
45
- match: "path" | "file";
45
+ match: "file" | "path";
46
46
  limit: number | undefined;
47
47
  page: number;
48
48
  mainResearchGoal: string;
@@ -101,7 +101,7 @@ export declare function mapRepoSearchToolQuery(query: WithOptionalMeta<GitHubRep
101
101
  forks: string | undefined;
102
102
  license: string | undefined;
103
103
  goodFirstIssues: string | undefined;
104
- match: ("name" | "description" | "readme")[];
104
+ match: ("description" | "name" | "readme")[];
105
105
  sort: "stars" | "forks" | "updated" | "created" | "best-match" | undefined;
106
106
  limit: number | undefined;
107
107
  page: number;
@@ -138,18 +138,18 @@ export declare function mapPullRequestToolQuery(query: PartialPRQuery): {
138
138
  reactions: string;
139
139
  interactions: string;
140
140
  draft: boolean;
141
- match: ("comments" | "title" | "body")[];
141
+ match: ("title" | "comments" | "body")[];
142
142
  milestone: string;
143
143
  language: string;
144
- checks: "pending" | "success" | "failure";
145
- review: "none" | "required" | "approved" | "changes_requested";
144
+ checks: "success" | "failure" | "pending";
145
+ review: "none" | "approved" | "changes_requested" | "required";
146
146
  locked: boolean;
147
147
  visibility: "public" | "private";
148
148
  teamMentions: string;
149
149
  project: string;
150
150
  archived: boolean | undefined;
151
151
  content: unknown;
152
- reviewMode: "summary" | "full";
152
+ reviewMode: "full" | "summary";
153
153
  filePage: number;
154
154
  commentPage: number;
155
155
  commitPage: number;
@@ -217,7 +217,7 @@ export declare function mapPullRequestProviderResultData(data: ProviderPullReque
217
217
  in_reply_to_id?: number;
218
218
  }[];
219
219
  url: string;
220
- state: "closed" | "open" | "merged";
220
+ state: "open" | "closed" | "merged";
221
221
  draft: boolean;
222
222
  author: string;
223
223
  assignees: string[];
@@ -38,4 +38,5 @@ export declare const LOCAL_FIND_FILES: ToolConfig;
38
38
  export declare const LOCAL_FETCH_CONTENT: ToolConfig;
39
39
  export declare const LSP_GET_SEMANTIC_CONTENT: ToolConfig;
40
40
  export declare const LOCAL_BINARY_INSPECT: ToolConfig;
41
+ export declare const OQL_SEARCH: ToolConfig;
41
42
  export declare const ALL_TOOLS: ToolConfig[];
@@ -1,2 +1,4 @@
1
1
  export declare const STATIC_TOOL_NAMES: import("@octocodeai/octocode-core/types").ToolNames;
2
+ export declare const LSP_GET_SEMANTIC_CONTENT_TOOL_NAME: "lspGetSemantics";
3
+ export declare const OQL_SEARCH_TOOL_NAME = "oqlSearch";
2
4
  export declare function isLocalTool(toolName: string): boolean;
@@ -7,7 +7,6 @@ export interface ServerConfig {
7
7
  disableTools?: string[];
8
8
  timeout: number;
9
9
  maxRetries: number;
10
- loggingEnabled: boolean;
11
10
  enableLocal: boolean;
12
11
  enableClone: boolean;
13
12
  outputFormat: 'yaml' | 'json';
@@ -1,22 +1,3 @@
1
- export interface SessionData {
2
- sessionId: string;
3
- intent: 'init' | 'error' | 'tool_call' | 'rate_limit';
4
- data: ToolCallData | ErrorData | RateLimitData | Record<string, never>;
5
- timestamp: string;
6
- version: string;
7
- }
8
- export interface ToolCallData {
9
- tool_name: string;
10
- repos: string[];
11
- provider?: string;
12
- mainResearchGoal?: string;
13
- researchGoal?: string;
14
- reasoning?: string;
15
- }
16
- export interface ErrorData {
17
- error: string;
18
- provider?: string;
19
- }
20
1
  export interface RateLimitData {
21
2
  limit_type: 'primary' | 'secondary' | 'graphql' | 'precheck_blocked';
22
3
  retry_after_seconds?: number;
@@ -1,5 +1,5 @@
1
1
  import type * as NativeContextUtils from '@octocodeai/octocode-engine';
2
- export type { BinaryInspectInfo, BinaryStrings, ExtractMatchingLinesOptions, ExtractMatchingLinesResult, FilterPatchOptions, FileSystemEntry, FileSystemQueryOptions, FileSystemQueryResult, MinifyResult, JsonInput, RipgrepParseOptions, RipgrepParseResult, RipgrepSearchOptions, SliceContentOptions, SliceContentResult, StructuralMatch, YamlConversionConfig, } from '@octocodeai/octocode-engine';
2
+ export type { BinaryInspectInfo, BinaryStrings, ExtractMatchingLinesOptions, ExtractMatchingLinesResult, FilterPatchOptions, FileSystemEntry, FileSystemQueryOptions, FileSystemQueryResult, GraphFactCapability, GraphFactCall, GraphFactDeclaration, GraphFactEdge, GraphFactExport, GraphFactImport, GraphFacts, MinifyResult, JsonInput, RipgrepParseOptions, RipgrepParseResult, RipgrepSearchOptions, SliceContentOptions, SliceContentResult, StructuralMatch, YamlConversionConfig, } from '@octocodeai/octocode-engine';
3
3
  type NativeContextUtilsModule = typeof NativeContextUtils;
4
4
  type NativeLoader = () => NativeContextUtilsModule;
5
5
  export declare class ContextUtilsLoadError extends Error {
@@ -28,11 +28,25 @@ export declare const contextUtils: {
28
28
  * Same-file only, syntax-only — no type inference, no cross-file resolution.
29
29
  */
30
30
  findInFileReferences(content: string, filePath: string, line: number, character: number): string | null;
31
+ /**
32
+ * Native JS/TS graph facts as a JSON `GraphFacts` object. Syntax-level only:
33
+ * declarations/imports/exports, containment, and direct call expressions.
34
+ */
35
+ extractGraphFacts(content: string, filePath: string): string | null;
31
36
  /**
32
37
  * Canonical lowercase extensions (no leading dot) the native oxc JS/TS path
33
38
  * handles. Source of truth lives in the engine — gate native dispatch on this.
34
39
  */
35
40
  getSupportedJsTsExtensions(): string[];
41
+ /**
42
+ * Canonical lowercase extensions (no leading dot) that can emit native
43
+ * GraphFacts. JS/TS use OXC; other entries use tree-sitter syntax inventory.
44
+ */
45
+ getSupportedGraphFactExtensions(): string[];
46
+ /**
47
+ * Native graph-fact capability matrix as a JSON `GraphFactCapability[]`.
48
+ */
49
+ getGraphFactCapabilities(): string;
36
50
  structuralSearch(content: string, filePath: string, pattern?: string | null, rule?: string | null): NativeContextUtils.StructuralMatch[];
37
51
  structuralSearchFiles(options: NativeContextUtils.StructuralSearchFilesOptions): NativeContextUtils.StructuralSearchFilesResult;
38
52
  getSupportedStructuralExtensions(): string[];
@@ -44,7 +44,8 @@ export interface PaginationInfo {
44
44
  totalMatchesCapped?: boolean;
45
45
  }
46
46
  export interface SearchStats {
47
- matchCount?: number;
47
+ totalOccurrences?: number;
48
+ totalStructuralMatches?: number;
48
49
  matchedLines?: number;
49
50
  filesMatched?: number;
50
51
  filesSearched?: number;
@@ -0,0 +1,10 @@
1
+ export type MarkdownHeading = {
2
+ line: number;
3
+ level: number;
4
+ text: string;
5
+ children: MarkdownHeading[];
6
+ };
7
+ export declare function isMarkdownFilePath(filePath: string): boolean;
8
+ export declare function extractMarkdownHeadingOutline(content: string, filePath: string): MarkdownHeading[] | null;
9
+ export declare function markdownHeadingOutlineToText(content: string, filePath: string): string | null;
10
+ export declare function markdownHeadingOutlineToDocumentSymbols(content: string, filePath: string): unknown[] | null;
@@ -1,35 +1,12 @@
1
1
  import type { BulkFinalizerOutput } from '../../types/bulk.js';
2
2
  import type { FlatQueryResult } from '../../types/toolResults.js';
3
- export type CharPagination = {
4
- currentPage: number;
5
- totalPages: number;
6
- hasMore: boolean;
7
- charOffset: number;
8
- charLength: number;
9
- totalChars: number;
10
- };
11
3
  export type QueryWithPagination = {
12
4
  id?: unknown;
13
5
  charLength?: unknown;
14
6
  charOffset?: unknown;
15
7
  };
16
- type CharWindowConfig<TGroup, TItem> = {
17
- groups: TGroup[];
18
- getItems: (group: TGroup) => readonly TItem[];
19
- setItems: (group: TGroup, items: TItem[]) => TGroup;
20
- getItemText?: (item: TItem) => string | undefined;
21
- setItemText?: (item: TItem, text: string) => TItem;
22
- charOffset: number;
23
- charLength: number;
24
- maxItems?: number;
25
- };
26
- export declare function paginateGroupsCharWindow<TGroup, TItem>({ groups, getItems, setItems, getItemText, setItemText, charOffset, charLength, maxItems, }: CharWindowConfig<TGroup, TItem>): {
27
- groups: TGroup[];
28
- pagination: CharPagination;
29
- };
30
8
  export declare function collectFlatErrors(results: readonly FlatQueryResult[]): Array<{
31
9
  id: string;
32
10
  error: string;
33
11
  }>;
34
12
  export declare function formatFinalizedResponse<T extends Record<string, unknown>>(responseData: T, keysPriority: readonly string[], isError?: boolean): BulkFinalizerOutput<T>;
35
- export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octocodeai/octocode-tools-core",
3
- "version": "16.5.1",
3
+ "version": "16.6.0",
4
4
  "description": "Core tool implementations for Octocode: GitHub, local filesystem, LSP, and package search tools.",
5
5
  "author": "Guy Bary <bgauryy@octocodeai.com>",
6
6
  "license": "MIT",
@@ -16,6 +16,14 @@
16
16
  "types": "./dist/direct.d.ts",
17
17
  "import": "./dist/direct.js"
18
18
  },
19
+ "./schema": {
20
+ "types": "./dist/schema.d.ts",
21
+ "import": "./dist/schema.js"
22
+ },
23
+ "./oql": {
24
+ "types": "./dist/oql/index.d.ts",
25
+ "import": "./dist/oql/index.js"
26
+ },
19
27
  "./zod": {
20
28
  "types": "./dist/zod.d.ts",
21
29
  "import": "./dist/zod.js"
@@ -72,8 +80,8 @@
72
80
  },
73
81
  "dependencies": {
74
82
  "@modelcontextprotocol/sdk": "^1.29.0",
75
- "@octocodeai/octocode-core": "^16.5.1",
76
- "@octocodeai/octocode-engine": "^16.5.1",
83
+ "@octocodeai/octocode-core": "^16.5.3",
84
+ "@octocodeai/octocode-engine": "^16.6.0",
77
85
  "@octokit/oauth-methods": "^6.0.2",
78
86
  "@octokit/plugin-throttling": "^11.0.3",
79
87
  "@octokit/request": "^10.0.10",
@@ -1,14 +0,0 @@
1
- export declare abstract class BaseCommandBuilder {
2
- protected command: string;
3
- protected args: string[];
4
- constructor(command: string);
5
- addFlag(flag: string): this;
6
- protected addOption(option: string, value: string | number): this;
7
- protected addArg(arg: string): this;
8
- build(): {
9
- command: string;
10
- args: string[];
11
- };
12
- reset(): this;
13
- getArgs(): string[];
14
- }
@@ -1,23 +0,0 @@
1
- import { BaseCommandBuilder } from './BaseCommandBuilder.js';
2
- import type { FindFilesQuery } from '../tools/local_find_files/scheme.js';
3
- export declare class FindCommandBuilder extends BaseCommandBuilder {
4
- private isMacOS;
5
- private isLinux;
6
- private isWindows;
7
- constructor();
8
- fromQuery(query: Partial<FindFilesQuery> & Pick<FindFilesQuery, 'path'>): this;
9
- private buildExcludeDirPrune;
10
- private addFilters;
11
- simple(path: string, name: string): this;
12
- entryType(entryType: 'f' | 'd' | 'l'): this;
13
- name(pattern: string): this;
14
- maxDepth(depth: number): this;
15
- minDepth(depth: number): this;
16
- size(size: string): this;
17
- mtime(time: string): this;
18
- path(path: string): this;
19
- private normalizeRegexForFullPath;
20
- private parseTimeString;
21
- private parseTimeStringAccess;
22
- private normalizeSizeForPlatform;
23
- }
@@ -1,15 +0,0 @@
1
- import { BaseCommandBuilder } from './BaseCommandBuilder.js';
2
- import type { ViewStructureQuery } from '../tools/local_view_structure/scheme.js';
3
- export declare class LsCommandBuilder extends BaseCommandBuilder {
4
- constructor();
5
- fromQuery(query: Partial<ViewStructureQuery> & Pick<ViewStructureQuery, 'path'>): this;
6
- simple(path: string): this;
7
- detailed(): this;
8
- all(): this;
9
- humanReadable(): this;
10
- recursive(): this;
11
- sortBySize(): this;
12
- sortByTime(): this;
13
- reverse(): this;
14
- path(path: string): this;
15
- }
@@ -1,2 +0,0 @@
1
- export { createLogger, setLogHandler, _getLogHandler } from './logger.js';
2
- export type { LogLevel, LogEntry } from './logger.js';
@@ -1,17 +0,0 @@
1
- export type LogLevel = 'debug' | 'info' | 'warn' | 'error';
2
- export interface LogEntry {
3
- level: LogLevel;
4
- module: string;
5
- message: string;
6
- data?: Record<string, unknown>;
7
- }
8
- type LogHandler = (entry: LogEntry) => void;
9
- export declare function setLogHandler(handler: LogHandler | null): void;
10
- export declare function _getLogHandler(): LogHandler | null;
11
- export declare function createLogger(module: string): {
12
- debug: (message: string, data?: Record<string, unknown>) => void;
13
- info: (message: string, data?: Record<string, unknown>) => void;
14
- warn: (message: string, data?: Record<string, unknown>) => void;
15
- error: (message: string, data?: Record<string, unknown>) => void;
16
- };
17
- export {};
@@ -1,16 +0,0 @@
1
- import type { PaginationInfo } from '../../types/toolResults.js';
2
- interface OutputSizeLimitOptions {
3
- charOffset?: number;
4
- charLength?: number;
5
- maxOutputChars?: number;
6
- recommendedCharLength?: number;
7
- }
8
- interface OutputSizeLimitResult {
9
- content: string;
10
- wasLimited: boolean;
11
- pagination?: PaginationInfo;
12
- warnings: string[];
13
- paginationHints: string[];
14
- }
15
- export declare function applyOutputSizeLimit(content: string, options: OutputSizeLimitOptions): OutputSizeLimitResult;
16
- export {};
@@ -1,86 +0,0 @@
1
- /**
2
- * Tier 2 — cross-source evidence fusion for code-research results.
3
- *
4
- * Raw LSP, structural-search, and code-search scores are not comparable. This
5
- * layer normalizes hits into `EvidenceItem`s, merges them into `EvidenceBundle`s
6
- * (one per useful target), fuses incomparable per-source ranks with weighted
7
- * Reciprocal Rank Fusion, reranks by task intent, diversifies, budgets for
8
- * tokens, and explains every result. See `.octocode/RANKING-ARCHITECTURE.md`.
9
- *
10
- * Determinism: no clock, no randomness. Sort is total via explicit
11
- * tie-breakers. Weak evidence is penalized but never silently dropped.
12
- */
13
- export interface Range {
14
- startLine: number;
15
- endLine?: number;
16
- }
17
- export type EvidenceSource = 'lsp' | 'structural' | 'codeSearch' | 'fileGraph' | 'signature' | 'contentView' | 'recentEdit' | 'testSignal' | 'diagnostic';
18
- export type EvidenceStatus = 'ok' | 'partial' | 'fallback' | 'ambiguous' | 'unsupported' | 'parserFailed' | 'truncated' | 'stale';
19
- export type EvidenceIntent = 'definition' | 'reference' | 'callsite' | 'declaration' | 'implementation' | 'test' | 'config' | 'doc' | 'schema' | 'route' | 'error' | 'unknown';
20
- export type EvidenceConfidence = 'high' | 'medium' | 'low';
21
- /** A measurement that can be mapped to a source weight (e.g. LSP fallback kind). */
22
- export type EvidenceQuality = 'exact' | 'detailed' | 'nearLineFallback' | 'wholeFileFallback' | 'partialAst' | 'fallbackText' | 'comment' | 'broadRegex';
23
- export interface EvidenceItem {
24
- id: string;
25
- source: EvidenceSource;
26
- /** 1-based rank within this item's own source list (for RRF). */
27
- sourceRank: number;
28
- sourceScore?: number;
29
- status: EvidenceStatus;
30
- confidence: EvidenceConfidence;
31
- intent: EvidenceIntent;
32
- quality?: EvidenceQuality;
33
- path: string;
34
- range?: Range;
35
- symbol?: string;
36
- languageId?: string;
37
- textPreview?: string;
38
- tokenCost?: number;
39
- reasons: string[];
40
- }
41
- export interface EvidenceBundle {
42
- id: string;
43
- target: {
44
- path: string;
45
- range?: Range;
46
- symbol?: string;
47
- languageId?: string;
48
- };
49
- primaryIntent: EvidenceIntent;
50
- contributors: EvidenceItem[];
51
- fusedScore: number;
52
- finalScore: number;
53
- confidence: EvidenceConfidence;
54
- status: EvidenceStatus;
55
- tokenCost: number;
56
- reasons: string[];
57
- warnings: string[];
58
- }
59
- export interface RankedEvidenceGroups {
60
- mustRead: EvidenceBundle[];
61
- supporting: EvidenceBundle[];
62
- maybe: EvidenceBundle[];
63
- weakOrSkipped: EvidenceBundle[];
64
- }
65
- export type RankTask = 'definition' | 'references' | 'edit' | 'explain' | 'security' | 'test' | 'generic';
66
- export interface RankEvidenceOptions {
67
- task: RankTask;
68
- seed?: {
69
- path?: string;
70
- range?: Range;
71
- symbol?: string;
72
- query?: string;
73
- };
74
- tokenBudget?: number;
75
- maxBundles?: number;
76
- includeWeak?: boolean;
77
- }
78
- export interface RankEvidenceResult {
79
- groups: RankedEvidenceGroups;
80
- allBundles: EvidenceBundle[];
81
- scorerVersion: string;
82
- }
83
- export declare const SCORER_VERSION = "tier2-rrf-1";
84
- export declare function bundleEvidence(items: EvidenceItem[]): EvidenceBundle[];
85
- /** Rank a flat list of normalized evidence items into explained groups. */
86
- export declare function rankEvidence(items: EvidenceItem[], options: RankEvidenceOptions): RankEvidenceResult;
@@ -1,9 +0,0 @@
1
- import type { BulkToolResponse } from '../../types/bulk.js';
2
- import type { FlatQueryResult } from '../../types/toolResults.js';
3
- interface PaginationRequest {
4
- offset?: number;
5
- length?: number;
6
- }
7
- export declare function applyQueryOutputPagination(queryResult: FlatQueryResult, originalQuery: Record<string, unknown>, toolName: string): FlatQueryResult;
8
- export declare function applyBulkResponsePagination(response: BulkToolResponse, request: PaginationRequest, toolName: string): BulkToolResponse;
9
- export {};