From 279e7f0429af10b59885cc9c94a6cc4e8dfe9eab Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sun, 15 Feb 2026 12:22:55 +0000 Subject: [PATCH 1/3] refactor: minimize tui-components public API and fix internal imports Remove internal-only types (RuntimeInfo, EventHistoryItem) from public exports, replace barrel re-exports of external package types with direct imports from @perstack/core and @perstack/react, and clean up the types barrel to stop re-exporting Activity, PerstackEvent, PerRunStreamingState, and StreamingState. Co-Authored-By: Claude Opus 4.6 --- .../tui-components/src/components/streaming-display.tsx | 2 +- .../tui-components/src/hooks/state/use-runtime-info.ts | 3 ++- packages/tui-components/src/index.ts | 7 +++---- packages/tui-components/src/types/base.ts | 3 --- packages/tui-components/src/types/index.ts | 4 ---- packages/tui-components/src/utils/event-queue.ts | 2 +- 6 files changed, 7 insertions(+), 14 deletions(-) diff --git a/packages/tui-components/src/components/streaming-display.tsx b/packages/tui-components/src/components/streaming-display.tsx index 24f8881e..afbb5c94 100644 --- a/packages/tui-components/src/components/streaming-display.tsx +++ b/packages/tui-components/src/components/streaming-display.tsx @@ -1,6 +1,6 @@ import { Box, Text } from "ink" import type React from "react" -import type { PerRunStreamingState, StreamingState } from "../types/index.js" +import type { PerRunStreamingState, StreamingState } from "@perstack/react" 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..e8429504 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 { useCallback, useState } from "react" import { STOP_EVENT_TYPES } from "../../constants.js" -import type { InitialRuntimeConfig, PerstackEvent, RuntimeInfo } from "../../types/index.js" +import type { PerstackEvent } from "@perstack/core" +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..b369e612 100644 --- a/packages/tui-components/src/index.ts +++ b/packages/tui-components/src/index.ts @@ -1,16 +1,15 @@ -export type { ExecutionParams, ExecutionResult } from "./execution/index.js" // Execution export { renderExecution } from "./execution/index.js" -export type { SelectionParams, SelectionResult } from "./selection/index.js" +export type { ExecutionParams, ExecutionResult } from "./execution/index.js" + // Selection export { renderSelection } from "./selection/index.js" +export type { SelectionParams, SelectionResult } 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) => { From 6182adca6a2dfe72aaafc94a58000a0af69846da Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sun, 15 Feb 2026 12:23:14 +0000 Subject: [PATCH 2/3] chore: add changeset for tui-components export cleanup Co-Authored-By: Claude Opus 4.6 --- .changeset/tui-components-export-cleanup.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tui-components-export-cleanup.md 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 From b1105566b142ee836bfa6b135170f000fa818017 Mon Sep 17 00:00:00 2001 From: HiranoMasaaki Date: Sun, 15 Feb 2026 12:25:41 +0000 Subject: [PATCH 3/3] fix: correct import ordering for Biome lint Co-Authored-By: Claude Opus 4.6 --- .../tui-components/src/components/streaming-display.tsx | 2 +- packages/tui-components/src/hooks/state/use-runtime-info.ts | 2 +- packages/tui-components/src/index.ts | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/tui-components/src/components/streaming-display.tsx b/packages/tui-components/src/components/streaming-display.tsx index afbb5c94..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 "@perstack/react" 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 e8429504..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,6 @@ +import type { PerstackEvent } from "@perstack/core" import { useCallback, useState } from "react" import { STOP_EVENT_TYPES } from "../../constants.js" -import type { PerstackEvent } from "@perstack/core" import type { InitialRuntimeConfig, RuntimeInfo } from "../../types/index.js" type UseRuntimeInfoOptions = { diff --git a/packages/tui-components/src/index.ts b/packages/tui-components/src/index.ts index b369e612..f6553db2 100644 --- a/packages/tui-components/src/index.ts +++ b/packages/tui-components/src/index.ts @@ -1,10 +1,10 @@ // Execution -export { renderExecution } from "./execution/index.js" -export type { ExecutionParams, ExecutionResult } from "./execution/index.js" +export type { ExecutionParams, ExecutionResult } from "./execution/index.js" +export { renderExecution } from "./execution/index.js" +export type { SelectionParams, SelectionResult } from "./selection/index.js" // Selection export { renderSelection } from "./selection/index.js" -export type { SelectionParams, SelectionResult } from "./selection/index.js" // Types export type {