Remove dead exports found by knip

- Un-export HOMEBREW_COMMANDS, systemSetupHost, ToolKind, BinaryArchitecture,
  HopperDiagnostic -- only consumed within their own files
- Remove unused HopperUnavailableError class (never instantiated)
- Reformat knip.json entry/project arrays to multi-line
This commit is contained in:
morluto
2026-07-12 10:20:45 +08:00
parent 4c9224990e
commit 4dec415fc8
7 changed files with 17 additions and 18 deletions
+12 -2
View File
@@ -1,7 +1,17 @@
{
"$schema": "./node_modules/knip/schema.json",
"entry": ["src/main.ts", "src/cli.ts", "scripts/rea.mjs", "scripts/scan-todos.mjs"],
"project": ["src/**/*.ts", "tests/**/*.ts", "scripts/**/*.mjs", "vitest.config.ts"],
"entry": [
"src/main.ts",
"src/cli.ts",
"scripts/rea.mjs",
"scripts/scan-todos.mjs"
],
"project": [
"src/**/*.ts",
"tests/**/*.ts",
"scripts/**/*.mjs",
"vitest.config.ts"
],
"ignore": ["dist/**", "docs/**", ".codex/**", ".devin/**"],
"ignoreDependencies": [],
"rules": {
+1 -1
View File
@@ -143,7 +143,7 @@ export const runSetup = async (
};
/** Production setup effects for macOS, Homebrew, JSON MCP clients, and the canonical skill directory. */
export const systemSetupHost = (): SetupHost => {
const systemSetupHost = (): SetupHost => {
const doctorHost = systemDoctorHost();
return {
platform: process.platform,
+1 -1
View File
@@ -1,5 +1,5 @@
/** Standard executable names and locations used to discover Homebrew. */
export const HOMEBREW_COMMANDS = [
const HOMEBREW_COMMANDS = [
"brew",
"/opt/homebrew/bin/brew",
"/usr/local/bin/brew",
+1 -1
View File
@@ -13,7 +13,7 @@ const caseSensitive = z
.describe("Whether to match case");
/** Adapter family responsible for implementing a public MCP tool. */
export type ToolKind = "official-proxy" | "enhanced" | "session";
type ToolKind = "official-proxy" | "enhanced" | "session";
/** Single source of truth for a public tool's name, description, and input. */
export interface ToolContract {
+1 -1
View File
@@ -12,7 +12,7 @@ import { BinaryTargetError } from "./errors.js";
import { err, ok, type Result } from "./result.js";
/** CPU families understood by the supported executable loaders. */
export type BinaryArchitecture = "x86" | "x86_64" | "arm" | "arm64";
type BinaryArchitecture = "x86" | "x86_64" | "arm" | "arm64";
/**
* A canonical local target plus deterministic Hopper loader arguments.
* Explicit loader and architecture flags prevent Hopper from presenting modal
-11
View File
@@ -47,17 +47,6 @@ export class HopperProcessError extends HopperError {
}
}
/** Hopper did not make the repository bridge available after launch. */
export class HopperUnavailableError extends HopperError {
readonly _tag = "HopperUnavailableError";
constructor() {
super(
"Hopper did not start the analysis bridge. Check the target and loader architecture options, then retry.",
);
}
}
/** Hopper or the repository bridge could not be started. */
export class HopperStartError extends HopperError {
readonly _tag = "HopperStartError";
+1 -1
View File
@@ -32,7 +32,7 @@ export interface HopperClientOptions {
}
/** Safe launcher telemetry; stderr content is intentionally never exposed. */
export type HopperDiagnostic =
type HopperDiagnostic =
| { readonly type: "launcher-stderr"; readonly bytes: number }
| { readonly type: "launcher-exit"; readonly code: number | null };