refactor(cli): remove unused imports and variables

Eliminates no-unused-vars warnings across the CLI package by dropping
dead type imports, unused destructured helpers, and simplifying try/catch
blocks whose caught errors and intermediate results were never read.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-23 17:26:59 -07:00
parent 6296c3cb53
commit 90d8dfaef2
12 changed files with 18 additions and 28 deletions

View File

@@ -10,12 +10,10 @@
import { existsSync, mkdirSync, writeFileSync, readFileSync } from "node:fs";
import { join, resolve, basename } from "node:path";
import { homedir } from "node:os";
import { exec } from "node:child_process";
import { promisify } from "node:util";
const execAsync = promisify(exec);
import { CentralCore, QMD_INSTALL_COMMAND, isQmdAvailable } from "@fusion/core";
import { resolveGlobalDir } from "@fusion/core";
import { maybeInstallClaudeSkillForNewProject } from "./claude-skills-runner.js";
/** Options for the init command */

View File

@@ -1,4 +1,4 @@
import { type MissionStatus, type MilestoneStatus, type SliceStatus, type FeatureStatus } from "@fusion/core";
import { type MilestoneStatus, type SliceStatus, type FeatureStatus } from "@fusion/core";
import { createInterface } from "node:readline/promises";
import { getStore } from "../project-resolver.js";

View File

@@ -1,4 +1,4 @@
import { CentralCore, type NodeConfig, type SystemMetrics } from "@fusion/core";
import { CentralCore, type NodeConfig } from "@fusion/core";
import { createInterface } from "node:readline/promises";
// ── Options Interfaces ───────────────────────────────────────────────────────

View File

@@ -25,7 +25,6 @@ function toTitleCase(str: string): string {
* Generate package.json template
*/
function generatePackageJson(name: string): string {
const titleCase = toTitleCase(name);
return JSON.stringify(
{
name: `@fusion-plugin-examples/${name}`,

View File

@@ -25,7 +25,7 @@ import {
import { resolve, isAbsolute, relative, basename } from "node:path";
import { existsSync, statSync } from "node:fs";
import { createInterface } from "node:readline/promises";
import { formatProjectLine, detectProjectFromCwd, setDefaultProject, resolveProject as resolveProjectContext } from "../project-context.js";
import { detectProjectFromCwd, setDefaultProject } from "../project-context.js";
import { maybeInstallClaudeSkillForNewProject } from "./claude-skills-runner.js";
const VALID_ISOLATION_MODES: IsolationMode[] = ["in-process", "child-process"];

View File

@@ -38,7 +38,7 @@ import {
processPullRequestMergeTask,
} from "./task-lifecycle.js";
import { promptForPort } from "./port-prompt.js";
import { createReadOnlyProviderSettingsView, createProjectSettingsPersistence } from "./provider-settings.js";
import { createReadOnlyProviderSettingsView } from "./provider-settings.js";
import { createReadOnlyAuthFileStorage, mergeAuthStorageReads, wrapAuthStorageWithApiKeyProviders } from "./provider-auth.js";
import { getFusionAuthPath, getLegacyAuthPaths, getModelRegistryModelsPath, getPackageManagerAgentDir } from "./auth-paths.js";
import { resolveProject } from "../project-context.js";

View File

@@ -6,7 +6,7 @@
* - fn skills install <owner/repo> - Install skills from a source
*/
import { spawn, type ChildProcess } from "node:child_process";
import { spawn } from "node:child_process";
/**
* Skill entry from the skills.sh /api/search endpoint.

View File

@@ -1,4 +1,4 @@
import { TaskStore, COLUMNS, COLUMN_LABELS, type Column, type MergeResult, type StepStatus, type AgentLogType, type AgentLogEntry, type Task } from "@fusion/core";
import { TaskStore, COLUMNS, COLUMN_LABELS, type Column, type StepStatus, type AgentLogType, type AgentLogEntry } from "@fusion/core";
import { aiMergeTask } from "@fusion/engine";
import { createInterface } from "node:readline/promises";
import type { PlanningQuestion, PlanningSummary } from "@fusion/core";
@@ -60,7 +60,7 @@ async function getCommandContext(projectName?: string): Promise<CommandContext>
projectName: context.projectName,
explicit: false,
};
} catch (error) {
} catch {
const store = new TaskStore(process.cwd());
await store.init();
return {
@@ -331,7 +331,6 @@ export async function runTaskLogs(id: string, options: LogsOptions = {}, project
// Follow mode: watch for new entries
if (options.follow) {
const followStore = store;
const projectPath = projectContext?.projectPath ?? process.cwd();
const logPath = join(projectPath, ".fusion", "tasks", id, "agent.log");
@@ -666,10 +665,9 @@ export async function runTaskDelete(id: string, force?: boolean, projectName?: s
const store = await getStore(projectName);
// Check if task exists first
let task;
try {
task = await store.getTask(id);
} catch (err: any) {
await store.getTask(id);
} catch {
console.error(`✗ Task ${id} not found`);
process.exit(1);
return;

View File

@@ -1,11 +1,10 @@
import type { ExtensionAPI, ExtensionContext } from "@mariozechner/pi-coding-agent";
import { Type, type Static } from "typebox";
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
import { Type } from "typebox";
import { StringEnum } from "@mariozechner/pi-ai";
import {
TaskStore,
COLUMNS,
COLUMN_LABELS,
type Column,
type Task,
} from "@fusion/core";
import {
@@ -235,9 +234,8 @@ export default function kbExtension(pi: ExtensionAPI) {
const store = await getStore(ctx.cwd);
// Validate task exists
let task;
try {
task = await store.getTask(params.id);
await store.getTask(params.id);
} catch {
return {
content: [{ type: "text", text: `Task ${params.id} not found` }],
@@ -1018,7 +1016,7 @@ export default function kbExtension(pi: ExtensionAPI) {
),
}),
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
// Import the planning function dynamically to avoid circular dependencies
const { runTaskPlan } = await import("./commands/task.js");
@@ -1685,7 +1683,7 @@ export default function kbExtension(pi: ExtensionAPI) {
),
}),
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
async execute(_toolCallId, params, _signal, _onUpdate, _ctx) {
// Dynamic import to match existing extension patterns
const { searchSkills, formatInstalls } = await import("./commands/skills.js");
@@ -1781,12 +1779,9 @@ export default function kbExtension(pi: ExtensionAPI) {
stdio: "pipe",
});
let stdout = "";
let stderr = "";
child.stdout?.on("data", (data) => {
stdout += data.toString();
});
child.stdout?.on("data", () => {});
child.stderr?.on("data", (data) => {
stderr += data.toString();

View File

@@ -6,7 +6,7 @@
*/
import { TaskStore, type RegisteredProject, CentralCore, GlobalSettingsStore } from "@fusion/core";
import { isAbsolute, resolve, dirname } from "node:path";
import { resolve, dirname } from "node:path";
import { existsSync } from "node:fs";
/** Project context for CLI operations */

View File

@@ -868,7 +868,7 @@ export async function getProjectSummaryInfo(
lastActivity: string | undefined;
runtimeStatus: import("@fusion/engine").RuntimeStatus | "not_started";
}> {
const central = await getCentralCore();
await getCentralCore();
const pm = await getProjectManager();
const [taskCounts, lastActivity, runtime] = await Promise.all([

View File

@@ -144,7 +144,7 @@ export function setupNativeResolution(): { success: boolean; nativeDir: string |
symlinkSync(fnDir, bunfsRoot);
bunfsSymlinkPath = bunfsRoot;
console.log("[fn-native-patch] Created /$bunfs/root symlink for native module resolution");
} catch (symlinkErr) {
} catch {
// Symlink creation failed (likely permission denied) - not fatal
// The terminal service will try alternative loading methods
console.log("[fn-native-patch] Could not create /$bunfs/root symlink (permissions), using fallback");