Archived
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:
@@ -175,10 +175,6 @@ export interface SavedPromptAttachment {
|
||||
size: number;
|
||||
}
|
||||
|
||||
export interface SaveAttachmentsResponse {
|
||||
attachments: SavedPromptAttachment[];
|
||||
}
|
||||
|
||||
export interface SessionModel {
|
||||
provider?: string;
|
||||
id?: string;
|
||||
|
||||
@@ -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,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;
|
||||
|
||||
Reference in New Issue
Block a user