From 00b34c9551b6ff7f1c832426068605d56189b4a8 Mon Sep 17 00:00:00 2001 From: Erik van der Boom Date: Wed, 6 May 2026 09:24:57 +0200 Subject: [PATCH] refactor: update parameter names to improve clarity and consistency across the codebase Co-authored-by: Copilot --- bindery-core/src/templates.ts | 2 +- bindery-merge/test/merge-extended.test.ts | 4 +- bindery-merge/test/merge-mocked.test.ts | 2 +- eslint.config.js | 113 ++++++++++++++++++- mcp-ts/src/registry.ts | 2 +- mcp-ts/src/search.ts | 2 +- mcp-ts/src/tool-probe.ts | 2 +- mcp-ts/test/integration-stdio.test.ts | 10 +- obsidian-plugin/src/ai-setup.ts | 3 +- obsidian-plugin/src/main.ts | 8 +- obsidian-plugin/src/merge.ts | 6 +- obsidian-plugin/src/obsidian.d.ts | 32 +++--- obsidian-plugin/test/ai-setup.test.ts | 6 +- obsidian-plugin/test/exporter.test.ts | 4 +- obsidian-plugin/test/formatter.test.ts | 2 +- obsidian-plugin/test/main.test.ts | 14 +-- obsidian-plugin/test/workspace.test.ts | 2 +- package.json | 3 + vscode-ext/src/extension.ts | 7 +- vscode-ext/src/mcp.ts | 53 +++++---- vscode-ext/test/integration-commands.test.ts | 4 +- 21 files changed, 194 insertions(+), 87 deletions(-) diff --git a/bindery-core/src/templates.ts b/bindery-core/src/templates.ts index 79eaa6c..a82c8b1 100644 --- a/bindery-core/src/templates.ts +++ b/bindery-core/src/templates.ts @@ -35,7 +35,7 @@ export type { TemplateContext } from './templates/context'; interface TemplateModule { meta: TemplateMeta; - render: (ctx: TemplateContext) => string; + render: (_ctx: TemplateContext) => string; } const TEMPLATES: Record = { diff --git a/bindery-merge/test/merge-extended.test.ts b/bindery-merge/test/merge-extended.test.ts index 1fb8e71..e477372 100644 --- a/bindery-merge/test/merge-extended.test.ts +++ b/bindery-merge/test/merge-extended.test.ts @@ -24,8 +24,8 @@ vi.mock('vscode', () => ({ }, Uri: { file: (p: string) => ({ fsPath: p }) }, ConfigurationTarget: { Global: 1, Workspace: 2 }, - LanguageModelToolResult: class { constructor(public readonly content: unknown[]) {} }, - LanguageModelTextPart: class { constructor(public readonly value: string) {} }, + LanguageModelToolResult: class { constructor(public readonly _content: unknown[]) {} }, + LanguageModelTextPart: class { constructor(public readonly _value: string) {} }, })); import * as fs from 'node:fs'; diff --git a/bindery-merge/test/merge-mocked.test.ts b/bindery-merge/test/merge-mocked.test.ts index d4f317b..22fb129 100644 --- a/bindery-merge/test/merge-mocked.test.ts +++ b/bindery-merge/test/merge-mocked.test.ts @@ -12,7 +12,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; // ─── Mock child_process ─────────────────────────────────────────────────────── vi.mock('node:child_process', () => { - type ExecFileCallback = (err: Error | null, stdout: string, stderr: string) => void; + type ExecFileCallback = (_err: Error | null, _stdout: string, _stderr: string) => void; return { execFile: vi.fn(( diff --git a/eslint.config.js b/eslint.config.js index 6ed19c9..6685aff 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,10 +1,109 @@ import js from '@eslint/js'; import tsPlugin from '@typescript-eslint/eslint-plugin'; import tsParser from '@typescript-eslint/parser'; +import { fileURLToPath } from 'node:url'; +import { dirname } from 'node:path'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); export default [ { - ignores: ['**/node_modules/**', '**/dist/**', '**/out/**', '**/.vscode/**'], + ignores: ['**/node_modules/**', '**/dist/**', '**/out/**', '**/.vscode/**', '**/coverage/**'], + }, + { + files: ['bindery-core/src/**/*.ts', 'bindery-merge/src/**/*.ts', 'mcp-ts/src/**/*.ts', 'vscode-ext/src/**/*.ts', 'obsidian-plugin/src/**/*.ts'], + languageOptions: { + parser: tsParser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: [ + `${__dirname}/bindery-core/tsconfig.json`, + `${__dirname}/bindery-merge/tsconfig.json`, + `${__dirname}/mcp-ts/tsconfig.json`, + `${__dirname}/vscode-ext/tsconfig.json`, + `${__dirname}/obsidian-plugin/tsconfig.json`, + ], + tsconfigRootDir: __dirname, + }, + globals: { + console: 'readonly', + process: 'readonly', + Buffer: 'readonly', + globalThis: 'readonly', + setTimeout: 'readonly', + clearTimeout: 'readonly', + fetch: 'readonly', + AbortSignal: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + require: 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tsPlugin, + }, + rules: { + ...js.configs.recommended.rules, + ...tsPlugin.configs.recommended.rules, + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-unused-vars': ['warn', { + args: 'all', + argsIgnorePattern: '^_', + caughtErrors: 'all', + caughtErrorsIgnorePattern: '^_', + }], + '@typescript-eslint/no-require-imports': 'off', + 'no-unused-vars': 'off', + 'no-undef': 'off', + 'no-empty': ['warn', { allowEmptyCatch: true }], + }, + }, + { + files: ['**/test/**/*.ts', '**/*.test.ts', '**/*.spec.ts'], + languageOptions: { + parser: tsParser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + globals: { + console: 'readonly', + process: 'readonly', + Buffer: 'readonly', + globalThis: 'readonly', + setTimeout: 'readonly', + clearTimeout: 'readonly', + fetch: 'readonly', + AbortSignal: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + HTMLElement: 'readonly', + RequestInit: 'readonly', + require: 'readonly', + vi: 'readonly', + describe: 'readonly', + it: 'readonly', + expect: 'readonly', + beforeEach: 'readonly', + beforeAll: 'readonly', + afterEach: 'readonly', + afterAll: 'readonly', + }, + }, + plugins: { + '@typescript-eslint': tsPlugin, + }, + rules: { + ...js.configs.recommended.rules, + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-explicit-any': 'off', + 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + '@typescript-eslint/no-require-imports': 'off', + 'no-undef': 'off', + 'no-empty': ['warn', { allowEmptyCatch: true }], + }, }, { files: ['**/*.ts', '**/*.js'], @@ -20,6 +119,12 @@ export default [ Buffer: 'readonly', globalThis: 'readonly', setTimeout: 'readonly', + clearTimeout: 'readonly', + fetch: 'readonly', + AbortSignal: 'readonly', + __dirname: 'readonly', + __filename: 'readonly', + HTMLElement: 'readonly', }, }, plugins: { @@ -27,11 +132,13 @@ export default [ }, rules: { ...js.configs.recommended.rules, - ...tsPlugin.configs.recommended.rules, '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-explicit-any': 'off', - '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + 'no-unused-vars': ['warn', { argsIgnorePattern: '^_' }], + '@typescript-eslint/no-require-imports': 'off', 'no-empty': ['warn', { allowEmptyCatch: true }], }, }, ]; + + diff --git a/mcp-ts/src/registry.ts b/mcp-ts/src/registry.ts index 4198e32..c9ba141 100644 --- a/mcp-ts/src/registry.ts +++ b/mcp-ts/src/registry.ts @@ -35,7 +35,7 @@ function parseBooksFromArgs(): Map { const args = process.argv; for (let i = 0; i < args.length; i++) { if (args[i] === '--book' && args[i + 1]) { - parseEntry(args[i + 1]!, books); + parseEntry(args[i + 1], books); i++; } } diff --git a/mcp-ts/src/search.ts b/mcp-ts/src/search.ts index 3a05257..14b1a87 100644 --- a/mcp-ts/src/search.ts +++ b/mcp-ts/src/search.ts @@ -143,7 +143,7 @@ export interface BuildSemanticProgress { export interface BuildSemanticOptions { /** Called after each chunk finishes embedding. */ - onProgress?: (p: BuildSemanticProgress) => void; + onProgress?: (_p: BuildSemanticProgress) => void; } export async function buildSemanticIndex( diff --git a/mcp-ts/src/tool-probe.ts b/mcp-ts/src/tool-probe.ts index de12f68..bcb0ae3 100644 --- a/mcp-ts/src/tool-probe.ts +++ b/mcp-ts/src/tool-probe.ts @@ -109,7 +109,7 @@ function resolveOnPath(cmd: string): string | null { } } -function versionFlag(tool: ToolName): string { +function versionFlag(_tool: ToolName): string { return '--version'; } diff --git a/mcp-ts/test/integration-stdio.test.ts b/mcp-ts/test/integration-stdio.test.ts index 7a01cb3..da61d26 100644 --- a/mcp-ts/test/integration-stdio.test.ts +++ b/mcp-ts/test/integration-stdio.test.ts @@ -47,7 +47,7 @@ interface JsonRpcResponse { */ function spawnServer(bookName: string, bookRoot: string): { proc: child_process.ChildProcessWithoutNullStreams; - send: (msg: JsonRpcRequest | JsonRpcNotification) => void; + send: (_msg: JsonRpcRequest | JsonRpcNotification) => void; readOne: () => Promise; kill: () => void; } { @@ -62,7 +62,7 @@ function spawnServer(bookName: string, bookRoot: string): { ); let buffer = ''; - const pending: Array<(line: string) => void> = []; + const pending: Array<(_line: string) => void> = []; const lines: string[] = []; proc.stdout.on('data', (chunk: Buffer) => { @@ -90,9 +90,9 @@ function spawnServer(bookName: string, bookRoot: string): { reject(new Error(`Timed out waiting for MCP message after ${MSG_TIMEOUT_MS}ms`)); }, MSG_TIMEOUT_MS); - const handler = (line: string) => { + const handler = (_line: string) => { clearTimeout(timer); - try { resolve(JSON.parse(line) as JsonRpcResponse); } catch (e) { reject(e); } + try { resolve(JSON.parse(_line) as JsonRpcResponse); } catch (e) { reject(e); } }; pending.push(handler); }); @@ -110,7 +110,7 @@ function spawnServer(bookName: string, bookRoot: string): { /** Perform the mandatory MCP initialize handshake and return the server's init result. */ async function handshake( - send: (msg: JsonRpcRequest | JsonRpcNotification) => void, + send: (_msg: JsonRpcRequest | JsonRpcNotification) => void, readOne: () => Promise, ): Promise { send({ diff --git a/obsidian-plugin/src/ai-setup.ts b/obsidian-plugin/src/ai-setup.ts index 30ba711..67827c3 100644 --- a/obsidian-plugin/src/ai-setup.ts +++ b/obsidian-plugin/src/ai-setup.ts @@ -40,9 +40,8 @@ export interface AiSetupResult { /** * Generate AI instruction files from vault settings. */ -// eslint-disable-next-line @typescript-eslint/require-await -- Function is async for API consistency even though operations are synchronous export async function setupAiFiles( - app: App, + _app: App, bookRoot: string, targets: AiTarget[] = ['claude', 'copilot'], skills: SkillTemplate[] = ALL_SKILLS, diff --git a/obsidian-plugin/src/main.ts b/obsidian-plugin/src/main.ts index 520c5d4..f6d65b2 100644 --- a/obsidian-plugin/src/main.ts +++ b/obsidian-plugin/src/main.ts @@ -41,10 +41,10 @@ export default class BinderyPlugin extends Plugin { private addContextMenuItems(menu: unknown, forEditor: boolean): void { const m = menu as { addSeparator?: () => void; - addItem: (cb: (item: { - setTitle: (title: string) => unknown; - setIcon?: (icon: string) => unknown; - onClick: (fn: () => void) => unknown; + addItem: (_cb: (_item: { + setTitle: (_title: string) => unknown; + setIcon?: (_icon: string) => unknown; + onClick: (_fn: () => void) => unknown; }) => void) => void; }; diff --git a/obsidian-plugin/src/merge.ts b/obsidian-plugin/src/merge.ts index e1810bf..4e3062f 100644 --- a/obsidian-plugin/src/merge.ts +++ b/obsidian-plugin/src/merge.ts @@ -33,9 +33,9 @@ import { resolvePandocPath, resolveLibreOfficePath } from './exporter'; * @returns Merged book result with output paths and file count */ export async function mergeBook( - app: App, - vault: Vault, - vaultBasePath: string, + _app: App, + _vault: Vault, + _vaultBasePath: string, bookRoot: string, settings: BinderySettings, outputTypes: OutputType[] diff --git a/obsidian-plugin/src/obsidian.d.ts b/obsidian-plugin/src/obsidian.d.ts index 6e7ad6c..af1029e 100644 --- a/obsidian-plugin/src/obsidian.d.ts +++ b/obsidian-plugin/src/obsidian.d.ts @@ -5,11 +5,11 @@ declare module 'obsidian' { } export interface Editor { - getCursor(which?: 'from' | 'to' | 'head' | 'anchor'): EditorPosition; - getLine(line: number): string; + getCursor(_which?: 'from' | 'to' | 'head' | 'anchor'): EditorPosition; + getLine(_line: number): string; getSelection(): string; - replaceSelection(text: string): void; - replaceRange(text: string, from: EditorPosition, to?: EditorPosition): void; + replaceSelection(_text: string): void; + replaceRange(_text: string, _from: EditorPosition, _to?: EditorPosition): void; } export interface EventRef { @@ -24,10 +24,10 @@ declare module 'obsidian' { } export interface Vault { - read(file: TFile): Promise; - modify(file: TFile, data: string): Promise; + read(_file: TFile): Promise; + modify(_file: TFile, _data: string): Promise; getName(): string; - on(event: string, callback: (...args: unknown[]) => unknown): EventRef; + on(_event: string, _callback: (..._args: unknown[]) => unknown): EventRef; adapter?: { basePath: string; [key: string]: unknown }; } @@ -35,29 +35,29 @@ declare module 'obsidian' { vault: Vault; workspace?: { getActiveFile(): TFile | null; - on(event: string, callback: (...args: unknown[]) => unknown): EventRef; + on(_event: string, _callback: (..._args: unknown[]) => unknown): EventRef; }; } export class Notice { - constructor(message: string, timeout?: number); + constructor(_message: string, _timeout?: number); } export interface Command { id: string; name: string; callback?: () => void | Promise; - editorCallback?: (editor: Editor) => void; + editorCallback?: (_editor: Editor) => void; } export class Plugin { app: App; - constructor(app: App); + constructor(_app: App); loadData(): Promise; - saveData(data: unknown): Promise; - addRibbonIcon(icon: string, title: string, callback: () => void): HTMLElement; - addCommand(command: Command): void; - addSettingTab(tab: unknown): void; - registerEvent(eventRef: EventRef): void; + saveData(_data: unknown): Promise; + addRibbonIcon(_icon: string, _title: string, _callback: () => void): HTMLElement; + addCommand(_command: Command): void; + addSettingTab(_tab: unknown): void; + registerEvent(_eventRef: EventRef): void; } } diff --git a/obsidian-plugin/test/ai-setup.test.ts b/obsidian-plugin/test/ai-setup.test.ts index 358baaf..4ae6172 100644 --- a/obsidian-plugin/test/ai-setup.test.ts +++ b/obsidian-plugin/test/ai-setup.test.ts @@ -4,7 +4,7 @@ * Tests AI instruction file generation from vault settings */ -import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; @@ -133,7 +133,7 @@ describe('AI Setup', () => { bookTitle: 'Test Book', }, null, 2), 'utf-8'); - const result = await setupAiFiles(mockApp, tempRoot, ['claude'], ['review', 'brainstorm'], false); + await setupAiFiles(mockApp, tempRoot, ['claude'], ['review', 'brainstorm'], false); const reviewSkillPath = path.join(tempRoot, '.claude', 'skills', 'review', 'SKILL.md'); const brainstormSkillPath = path.join(tempRoot, '.claude', 'skills', 'brainstorm', 'SKILL.md'); @@ -158,7 +158,7 @@ describe('AI Setup', () => { ], }, null, 2), 'utf-8'); - const result = await setupAiFiles(mockApp, tempRoot, ['agents'], [], false); + await setupAiFiles(mockApp, tempRoot, ['agents'], [], false); const agentsPath = path.join(tempRoot, 'AGENTS.md'); const content = fs.readFileSync(agentsPath, 'utf-8'); diff --git a/obsidian-plugin/test/exporter.test.ts b/obsidian-plugin/test/exporter.test.ts index ff8b160..7d69743 100644 --- a/obsidian-plugin/test/exporter.test.ts +++ b/obsidian-plugin/test/exporter.test.ts @@ -121,7 +121,7 @@ describe('buildPandocArgs', () => { // ─── exportBook ────────────────────────────────────────────────────────────── vi.mock('node:child_process', () => ({ - execFile: vi.fn((_cmd: string, _args: string[], cb: (err: null, stdout: string, stderr: string) => void) => { + execFile: vi.fn((_cmd: string, _args: string[], cb: (_err: null, _stdout: string, _stderr: string) => void) => { cb(null, '', ''); }), })); @@ -295,7 +295,7 @@ describe('exportBook', () => { it('rejects when execFile reports an error', async () => { const { execFile } = await import('node:child_process'); const execMock = vi.mocked(execFile); - execMock.mockImplementationOnce((_cmd, _args, cb: (err: Error | null, stdout: string, stderr: string) => void) => { + execMock.mockImplementationOnce((_cmd, _args, cb: (_err: Error | null, _stdout: string, _stderr: string) => void) => { cb(new Error('not found'), '', 'command not found'); return undefined as unknown as ReturnType; }); diff --git a/obsidian-plugin/test/formatter.test.ts b/obsidian-plugin/test/formatter.test.ts index 2a68d08..9e1b239 100644 --- a/obsidian-plugin/test/formatter.test.ts +++ b/obsidian-plugin/test/formatter.test.ts @@ -1,4 +1,4 @@ -import { describe, it, expect, vi, beforeEach } from 'vitest'; +import { describe, it, expect, vi } from 'vitest'; import { formatFile, formatText } from '../src/formatter'; import type { TFile, Vault } from 'obsidian'; diff --git a/obsidian-plugin/test/main.test.ts b/obsidian-plugin/test/main.test.ts index bcfb80e..c616686 100644 --- a/obsidian-plugin/test/main.test.ts +++ b/obsidian-plugin/test/main.test.ts @@ -39,7 +39,7 @@ vi.mock('obsidian', () => { id: string; name: string; callback?: () => void | Promise; - editorCallback?: (editor: unknown) => void; + editorCallback?: (_editor: unknown) => void; }): void { return; } addRibbonIcon(_icon: string, _title: string, _callback: () => void): HTMLElement { @@ -202,9 +202,9 @@ describe('formatOnSave bookRoot scoping', () => { const bp = new BinderyPlugin(app); // Capture the vault.on callback before onload - let savedCallback: ((...args: unknown[]) => void) | undefined; - vi.spyOn(app.vault, 'on').mockImplementation((_event: string, cb: (...args: unknown[]) => unknown) => { - savedCallback = cb as (...args: unknown[]) => void; + let savedCallback: ((..._args: unknown[]) => void) | undefined; + vi.spyOn(app.vault, 'on').mockImplementation((_event: string, cb: (..._args: unknown[]) => unknown) => { + savedCallback = cb as (..._args: unknown[]) => void; return {}; }); @@ -226,9 +226,9 @@ describe('formatOnSave bookRoot scoping', () => { const app = makeApp(vaultPath, 'MyVault'); const bp = new BinderyPlugin(app); - let savedCallback: ((...args: unknown[]) => void) | undefined; - vi.spyOn(app.vault, 'on').mockImplementation((_event: string, cb: (...args: unknown[]) => unknown) => { - savedCallback = cb as (...args: unknown[]) => void; + let savedCallback: ((..._args: unknown[]) => void) | undefined; + vi.spyOn(app.vault, 'on').mockImplementation((_event: string, cb: (..._args: unknown[]) => unknown) => { + savedCallback = cb as (..._args: unknown[]) => void; return {}; }); diff --git a/obsidian-plugin/test/workspace.test.ts b/obsidian-plugin/test/workspace.test.ts index ba181e9..183e505 100644 --- a/obsidian-plugin/test/workspace.test.ts +++ b/obsidian-plugin/test/workspace.test.ts @@ -8,7 +8,7 @@ import { describe, it, expect, beforeEach, afterEach } from 'vitest'; import * as fs from 'node:fs'; import * as path from 'node:path'; import * as os from 'node:os'; -import { readTranslations, upsertGlossaryRule, upsertSubstitutionRule } from '@bindery/core'; +import { readTranslations, upsertGlossaryRule } from '@bindery/core'; import { readSettings, writeSettings, diff --git a/package.json b/package.json index 797d4ab..821e0e3 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,6 @@ { "name": "bindery-monorepo", + "type": "module", "private": true, "workspaces": [ "bindery-core", @@ -11,6 +12,8 @@ "scripts": { "build": "npm run build -ws --if-present", "test": "npm run test -ws --if-present", + "lint": "npx eslint . --format=stylish", + "lint:fix": "npx eslint . --fix", "build:core": "npm run build --workspace=bindery-core", "obsidian:sync-version": "node ./scripts/sync-obsidian-version.mjs" } diff --git a/vscode-ext/src/extension.ts b/vscode-ext/src/extension.ts index a4982c6..4cc46f4 100644 --- a/vscode-ext/src/extension.ts +++ b/vscode-ext/src/extension.ts @@ -62,16 +62,15 @@ function getWorkspaceRoot(): string | undefined { } interface McpToolsForAi { - toolHealth: (root: string) => string; - toolSetupAiFiles: (root: string, args: { targets?: string[]; skills?: string[]; overwrite?: boolean }) => string; - writeBinderyCapabilitiesReadme: (root: string) => void; + toolHealth: (_root: string) => string; + toolSetupAiFiles: (_root: string, _args: { targets?: string[]; skills?: string[]; overwrite?: boolean }) => string; + writeBinderyCapabilitiesReadme: (_root: string) => void; } function loadMcpToolsForAi(extensionPath: string): McpToolsForAi { const bundledPath = path.join(extensionPath, 'mcp-ts', 'out', 'tools'); const devPath = path.join(extensionPath, '..', 'mcp-ts', 'out', 'tools'); const modulePath = fs.existsSync(bundledPath + '.js') ? bundledPath : devPath; - // eslint-disable-next-line @typescript-eslint/no-require-imports -- Load bundled mcp-ts tools at runtime return require(modulePath) as McpToolsForAi; } diff --git a/vscode-ext/src/mcp.ts b/vscode-ext/src/mcp.ts index 83c54ba..dddd108 100644 --- a/vscode-ext/src/mcp.ts +++ b/vscode-ext/src/mcp.ts @@ -37,32 +37,32 @@ interface MemoryCompactInput { file: string; compacted_content: string } interface ChapterStatusUpdateInput { chapters: Array<{ number: number; title: string; language: string; status: 'done' | 'in-progress' | 'draft' | 'planned' | 'needs-review'; wordCount?: number; notes?: string }> } interface McpTools { - toolHealth: (root: string) => string; - toolIndexBuild: (root: string) => Promise; - toolIndexStatus: (root: string) => string; - toolGetText: (root: string, args: GetTextInput) => string; - toolGetChapter: (root: string, args: GetChapterInput) => string; - toolGetBookUntil: (root: string, args: GetBookUntilInput) => string; - toolGetOverview: (root: string, args: GetOverviewInput) => string; - toolGetNotes: (root: string, args: GetNotesInput) => string; - toolSearch: (root: string, args: SearchInput) => Promise; - toolFormat: (root: string, args: FormatInput) => string; - toolGetReviewText: (root: string, args: GetReviewTextInput) => string; - toolUpdateWorkspace: (root: string, args: UpdateWorkspaceInput) => string; - toolGitSnapshot: (root: string, args: GitSnapshotInput) => string; - toolAddTranslation: (root: string, args: AddTranslationInput) => string; - toolGetTranslation: (root: string, args: GetTranslationInput) => string; - toolAddDialect: (root: string, args: AddDialectInput) => string; - toolGetDialect: (root: string, args: GetDialectInput) => string; - toolAddLanguage: (root: string, args: AddLanguageInput) => string; - toolInitWorkspace: (root: string, args: InitWorkspaceInput) => string; - toolSettingsUpdate: (root: string, args: SettingsUpdateInput) => string; - toolSetupAiFiles: (root: string, args: SetupAiFilesInput) => string; - toolMemoryList: (root: string) => string; - toolMemoryAppend: (root: string, args: MemoryAppendInput) => string; - toolMemoryCompact: (root: string, args: MemoryCompactInput) => string; - toolChapterStatusGet: (root: string) => string; - toolChapterStatusUpdate: (root: string, args: ChapterStatusUpdateInput) => string; + toolHealth: (_root: string) => string; + toolIndexBuild: (_root: string) => Promise; + toolIndexStatus: (_root: string) => string; + toolGetText: (_root: string, _args: GetTextInput) => string; + toolGetChapter: (_root: string, _args: GetChapterInput) => string; + toolGetBookUntil: (_root: string, _args: GetBookUntilInput) => string; + toolGetOverview: (_root: string, _args: GetOverviewInput) => string; + toolGetNotes: (_root: string, _args: GetNotesInput) => string; + toolSearch: (_root: string, _args: SearchInput) => Promise; + toolFormat: (_root: string, _args: FormatInput) => string; + toolGetReviewText: (_root: string, _args: GetReviewTextInput) => string; + toolUpdateWorkspace: (_root: string, _args: UpdateWorkspaceInput) => string; + toolGitSnapshot: (_root: string, _args: GitSnapshotInput) => string; + toolAddTranslation: (_root: string, _args: AddTranslationInput) => string; + toolGetTranslation: (_root: string, _args: GetTranslationInput) => string; + toolAddDialect: (_root: string, _args: AddDialectInput) => string; + toolGetDialect: (_root: string, _args: GetDialectInput) => string; + toolAddLanguage: (_root: string, _args: AddLanguageInput) => string; + toolInitWorkspace: (_root: string, _args: InitWorkspaceInput) => string; + toolSettingsUpdate: (_root: string, _args: SettingsUpdateInput) => string; + toolSetupAiFiles: (_root: string, _args: SetupAiFilesInput) => string; + toolMemoryList: (_root: string) => string; + toolMemoryAppend: (_root: string, _args: MemoryAppendInput) => string; + toolMemoryCompact: (_root: string, _args: MemoryCompactInput) => string; + toolChapterStatusGet: (_root: string) => string; + toolChapterStatusUpdate: (_root: string, _args: ChapterStatusUpdateInput) => string; } /** @@ -77,7 +77,6 @@ function loadMcpTools(extensionPath: string): McpTools { const bundledPath = path.join(extensionPath, 'mcp-ts', 'out', 'tools'); const devPath = path.join(extensionPath, '..', 'mcp-ts', 'out', 'tools'); const modulePath = fs.existsSync(bundledPath + '.js') ? bundledPath : devPath; - // eslint-disable-next-line @typescript-eslint/no-require-imports -- Load bundled mcp-ts tools at runtime return require(modulePath) as McpTools; } diff --git a/vscode-ext/test/integration-commands.test.ts b/vscode-ext/test/integration-commands.test.ts index 3528f92..db2c4ad 100644 --- a/vscode-ext/test/integration-commands.test.ts +++ b/vscode-ext/test/integration-commands.test.ts @@ -38,10 +38,10 @@ vi.mock('vscode', () => ({ Uri: { file: (p: string) => ({ fsPath: p }) }, ConfigurationTarget: { Global: 1, Workspace: 2 }, LanguageModelToolResult: class { - constructor(public readonly content: unknown[]) {} + constructor(public readonly _content: unknown[]) {} }, LanguageModelTextPart: class { - constructor(public readonly value: string) {} + constructor(public readonly _value: string) {} }, }));