diff --git a/.changeset/tui-components-export-cleanup.md b/.changeset/tui-components-export-cleanup.md new file mode 100644 index 00000000..6f48a56b --- /dev/null +++ b/.changeset/tui-components-export-cleanup.md @@ -0,0 +1,5 @@ +--- +"@perstack/tui-components": patch +--- + +Minimize public API surface by removing internal-only type exports and replacing barrel re-exports of external package types with direct imports diff --git a/packages/tui-components/src/components/streaming-display.tsx b/packages/tui-components/src/components/streaming-display.tsx index 24f8881e..672ae03a 100644 --- a/packages/tui-components/src/components/streaming-display.tsx +++ b/packages/tui-components/src/components/streaming-display.tsx @@ -1,6 +1,6 @@ +import type { PerRunStreamingState, StreamingState } from "@perstack/react" import { Box, Text } from "ink" import type React from "react" -import type { PerRunStreamingState, StreamingState } from "../types/index.js" import { ActionRow } from "./action-row.js" type StreamingDisplayProps = { diff --git a/packages/tui-components/src/hooks/state/use-runtime-info.ts b/packages/tui-components/src/hooks/state/use-runtime-info.ts index b8ead15d..b78e7cfd 100644 --- a/packages/tui-components/src/hooks/state/use-runtime-info.ts +++ b/packages/tui-components/src/hooks/state/use-runtime-info.ts @@ -1,6 +1,7 @@ +import type { PerstackEvent } from "@perstack/core" import { useCallback, useState } from "react" import { STOP_EVENT_TYPES } from "../../constants.js" -import type { InitialRuntimeConfig, PerstackEvent, RuntimeInfo } from "../../types/index.js" +import type { InitialRuntimeConfig, RuntimeInfo } from "../../types/index.js" type UseRuntimeInfoOptions = { initialExpertName?: string diff --git a/packages/tui-components/src/index.ts b/packages/tui-components/src/index.ts index 0370efc3..f6553db2 100644 --- a/packages/tui-components/src/index.ts +++ b/packages/tui-components/src/index.ts @@ -1,5 +1,6 @@ -export type { ExecutionParams, ExecutionResult } from "./execution/index.js" // Execution + +export type { ExecutionParams, ExecutionResult } from "./execution/index.js" export { renderExecution } from "./execution/index.js" export type { SelectionParams, SelectionResult } from "./selection/index.js" // Selection @@ -8,9 +9,7 @@ export { renderSelection } from "./selection/index.js" // Types export type { CheckpointHistoryItem, - EventHistoryItem, ExpertOption, InitialRuntimeConfig, JobHistoryItem, - RuntimeInfo, } from "./types/index.js" diff --git a/packages/tui-components/src/types/base.ts b/packages/tui-components/src/types/base.ts index d626f205..b6e94bf0 100644 --- a/packages/tui-components/src/types/base.ts +++ b/packages/tui-components/src/types/base.ts @@ -1,6 +1,3 @@ -export type { Activity, PerstackEvent } from "@perstack/core" -export type { PerRunStreamingState, StreamingState } from "@perstack/react" - export type RuntimeInfo = { runtimeVersion?: string expertName?: string diff --git a/packages/tui-components/src/types/index.ts b/packages/tui-components/src/types/index.ts index b30e3266..219efb55 100644 --- a/packages/tui-components/src/types/index.ts +++ b/packages/tui-components/src/types/index.ts @@ -1,14 +1,10 @@ export type { - Activity, CheckpointHistoryItem, EventHistoryItem, ExpertOption, InitialRuntimeConfig, JobHistoryItem, - PerRunStreamingState, - PerstackEvent, RuntimeInfo, - StreamingState, } from "./base.js" export type { BrowsingCheckpointsState, diff --git a/packages/tui-components/src/utils/event-queue.ts b/packages/tui-components/src/utils/event-queue.ts index 52fc44b6..07d13a8a 100644 --- a/packages/tui-components/src/utils/event-queue.ts +++ b/packages/tui-components/src/utils/event-queue.ts @@ -1,4 +1,4 @@ -import type { PerstackEvent } from "../types/index.js" +import type { PerstackEvent } from "@perstack/core" type ErrorLogger = (message: string, error: unknown) => void const defaultErrorLogger: ErrorLogger = (message, error) => {