@octocodeai/octocode-tools-core 16.5.1 → 16.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +200 -254
- package/dist/direct.js +37 -33
- package/dist/errors/localToolErrors.d.ts +1 -0
- package/dist/github/githubAPI.d.ts +22 -0
- package/dist/github/history.d.ts +3 -0
- package/dist/github/prTransformation.d.ts +1 -1
- package/dist/index.d.ts +6 -8
- package/dist/index.js +44 -40
- 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 +8 -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 +21 -0
- package/dist/oql/features.d.ts +7 -0
- package/dist/oql/index.d.ts +27 -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 +154 -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 +640 -0
- package/dist/oql/v2params.d.ts +22 -0
- package/dist/providers/types.d.ts +1 -1
- package/dist/schema.d.ts +13 -0
- package/dist/schema.js +9 -0
- package/dist/serverConfig.d.ts +0 -1
- package/dist/session.d.ts +2 -24
- package/dist/shared/config/defaults.d.ts +1 -2
- package/dist/shared/config/index.d.ts +2 -3
- package/dist/shared/config/index.js +2 -3
- package/dist/shared/config/resolverSections.d.ts +1 -3
- package/dist/shared/config/runtimeSurface.d.ts +5 -4
- package/dist/shared/config/schemas.d.ts +0 -1
- package/dist/shared/config/types.d.ts +0 -8
- package/dist/shared/credentials/envTokens.d.ts +1 -1
- package/dist/shared/credentials/index.js +1 -2
- package/dist/shared/credentials/types.d.ts +1 -1
- package/dist/shared/index.d.ts +0 -1
- package/dist/shared/languageSelectors.d.ts +23 -0
- package/dist/shared/paths.d.ts +2 -3
- package/dist/shared/paths.js +1 -1
- package/dist/shared/session/index.js +1 -2
- package/dist/tools/directToolCatalog.d.ts +15 -56
- package/dist/tools/directToolCatalog.exec.d.ts +11 -0
- package/dist/tools/directToolCatalog.meta.d.ts +83 -0
- package/dist/tools/github_clone_repo/cache.d.ts +1 -1
- package/dist/tools/github_clone_repo/types.d.ts +2 -0
- package/dist/tools/github_fetch_content/scheme.d.ts +81 -59
- package/dist/tools/github_fetch_content/types.d.ts +27 -0
- package/dist/tools/local_binary_inspect/binaryInspector.d.ts +0 -4
- package/dist/tools/lsp/semantic_content/scheme.d.ts +164 -10
- package/dist/tools/lsp/shared/resolveSymbolAnchor.d.ts +2 -2
- package/dist/tools/lsp/shared/semanticTypes.d.ts +34 -5
- package/dist/tools/oql_search/execution.d.ts +7 -0
- package/dist/tools/package_search/execution.d.ts +33 -0
- package/dist/tools/package_search/scheme.d.ts +8 -0
- package/dist/tools/providerMappers.d.ts +7 -7
- package/dist/tools/toolConfig.d.ts +1 -0
- package/dist/tools/toolNames.d.ts +2 -0
- package/dist/types/server.d.ts +1 -2
- package/dist/types/session.d.ts +0 -19
- package/dist/utils/contextUtils.d.ts +15 -1
- package/dist/utils/core/types.d.ts +2 -1
- package/dist/utils/markdownOutline.d.ts +10 -0
- package/dist/utils/response/groupedFinalizer.d.ts +0 -23
- package/package.json +14 -3
- 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/shared/logger/index.d.ts +0 -2
- package/dist/shared/logger/logger.d.ts +0 -17
- package/dist/utils/pagination/outputSizeLimit.d.ts +0 -16
- package/dist/utils/ranking/evidenceRanker.d.ts +0 -86
- package/dist/utils/response/structuredPagination.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octocodeai/octocode-tools-core",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.6.2",
|
|
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",
|
|
7
7
|
"type": "module",
|
|
8
|
+
"publishConfig": {
|
|
9
|
+
"access": "public"
|
|
10
|
+
},
|
|
8
11
|
"main": "dist/index.js",
|
|
9
12
|
"types": "dist/index.d.ts",
|
|
10
13
|
"exports": {
|
|
@@ -16,6 +19,14 @@
|
|
|
16
19
|
"types": "./dist/direct.d.ts",
|
|
17
20
|
"import": "./dist/direct.js"
|
|
18
21
|
},
|
|
22
|
+
"./schema": {
|
|
23
|
+
"types": "./dist/schema.d.ts",
|
|
24
|
+
"import": "./dist/schema.js"
|
|
25
|
+
},
|
|
26
|
+
"./oql": {
|
|
27
|
+
"types": "./dist/oql/index.d.ts",
|
|
28
|
+
"import": "./dist/oql/index.js"
|
|
29
|
+
},
|
|
19
30
|
"./zod": {
|
|
20
31
|
"types": "./dist/zod.d.ts",
|
|
21
32
|
"import": "./dist/zod.js"
|
|
@@ -72,8 +83,8 @@
|
|
|
72
83
|
},
|
|
73
84
|
"dependencies": {
|
|
74
85
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
75
|
-
"@octocodeai/octocode-core": "^16.
|
|
76
|
-
"@octocodeai/octocode-engine": "^16.
|
|
86
|
+
"@octocodeai/octocode-core": "^16.6.1",
|
|
87
|
+
"@octocodeai/octocode-engine": "^16.6.2",
|
|
77
88
|
"@octokit/oauth-methods": "^6.0.2",
|
|
78
89
|
"@octokit/plugin-throttling": "^11.0.3",
|
|
79
90
|
"@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,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 {};
|