Clean up remaining dead code and dependencies

- Replace unused 'codemirror' barrel dep with explicit @codemirror/{state,
  view,commands,language} sub-packages that were imported but unlisted
- Remove unused exports: writeNamespacedQuery, targetWorkspacePathForRun,
  isWorkspaceDeletionRun, piWebConfigDir, duplicate parsePiWebRuntimeResponse
- Remove unused types: WorkspacePanelFiles, WorkspacePanelHost,
  GetActiveSession, SaveAttachmentsResponse, QueryValues
- Drop now-unused re-exports/imports cascading from the above
- Add knip config + 'npm run knip' script for ongoing dead-code detection
This commit is contained in:
Federico Jaramillo Martinez
2026-06-13 21:57:51 +02:00
parent 5d335a7e72
commit edae57b836
11 changed files with 929 additions and 88 deletions
-4
View File
@@ -175,10 +175,6 @@ export interface SavedPromptAttachment {
size: number;
}
export interface SaveAttachmentsResponse {
attachments: SavedPromptAttachment[];
}
export interface SessionModel {
provider?: string;
id?: string;
+1 -14
View File
@@ -1,4 +1,4 @@
import type { PiWebCapability, PiWebComponentStatus, PiWebInstallationInfo, PiWebRuntimeComponent, PiWebRuntimeResponse, PiWebVersionResponse } from "./apiTypes.js";
import type { PiWebCapability, PiWebComponentStatus, PiWebInstallationInfo, PiWebRuntimeComponent, PiWebVersionResponse } from "./apiTypes.js";
import { isPiWebCapability } from "./capabilities.js";
export function parsePiWebVersionResponse(value: unknown): PiWebVersionResponse | undefined {
@@ -13,19 +13,6 @@ export function parsePiWebVersionResponse(value: unknown): PiWebVersionResponse
return { packageName, generatedAt, components: { web, sessiond } };
}
export function parsePiWebRuntimeResponse(value: unknown): PiWebRuntimeResponse | undefined {
if (!isRecord(value)) return undefined;
const packageName = value["packageName"];
const generatedAt = value["generatedAt"];
const components = value["components"];
if (typeof packageName !== "string" || packageName === "" || typeof generatedAt !== "string" || generatedAt === "" || !isRecord(components)) return undefined;
const web = parsePiWebRuntimeComponent(components["web"]);
const sessiond = parsePiWebRuntimeComponent(components["sessiond"]);
const capabilities = parsePiWebCapabilities(value["capabilities"]);
if (web === undefined || sessiond === undefined || capabilities === undefined) return undefined;
return { packageName, generatedAt, components: { web, sessiond }, capabilities };
}
export function parsePiWebRuntimeComponent(value: unknown): PiWebRuntimeComponent | undefined {
if (!isRecord(value)) return undefined;
const component = value["component"];
+1 -1
View File
@@ -1,7 +1,7 @@
export const workspaceDeleteOperation = "workspace.delete";
export const workspaceDeleteOperationMetadataKey = "pi.operation";
export const targetWorkspaceIdMetadataKey = "target.workspaceId";
export const targetWorkspacePathMetadataKey = "target.workspacePath";
const targetWorkspacePathMetadataKey = "target.workspacePath";
export interface WorkspaceDeletionTarget {
id: string;