@comma-agents/tui 2.0.0-rc.0 → 2.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,6 +17,10 @@ export interface ChatTextAreaProps {
17
17
  readonly height?: number;
18
18
  /** Placeholder shown when the text area is empty. */
19
19
  readonly placeholder?: string;
20
+ /** Label shown in the strategy row when no strategies are available. */
21
+ readonly emptyStrategyLabel?: string;
22
+ /** Placeholder shown when no strategies are available. */
23
+ readonly emptyPlaceholder?: string;
20
24
  /**
21
25
  * Whether to show the strategy row (label + "Tab to change strategy" hint).
22
26
  * Hide it when the strategy is fixed (e.g. steering or replying mid-run).
@@ -38,7 +42,7 @@ export interface ChatTextAreaProps {
38
42
  * />
39
43
  * ```
40
44
  */
41
- export declare function ChatTextArea({ id, strategies, initialStrategyPath, width, height, placeholder, showStrategyRow, onSubmit, }: ChatTextAreaProps): React.ReactElement;
45
+ export declare function ChatTextArea({ id, strategies, initialStrategyPath, width, height, placeholder, emptyStrategyLabel, emptyPlaceholder, showStrategyRow, onSubmit, }: ChatTextAreaProps): React.ReactElement;
42
46
  /** Props for the ChatTextArea render function. */
43
47
  export interface ChatTextAreaRenderProps {
44
48
  /**
@@ -0,0 +1,6 @@
1
+ import type React from "react";
2
+ export interface HubPackagesPageProps {
3
+ readonly focusId: string;
4
+ }
5
+ /** Browse and mutate Hub packages through the daemon-owned manager. */
6
+ export declare function HubPackagesPage({ focusId, }: HubPackagesPageProps): React.ReactElement;
@@ -0,0 +1 @@
1
+ export { HubPackagesPage } from "./HubPackagesPage";
@@ -20,6 +20,8 @@ export type { MouseScrollDirection, MouseScrollEvent, UseMouseWheelScrollOptions
20
20
  export { useMouseWheelScroll } from "./useMouseWheelScroll";
21
21
  export type { RegionDimensions, RegionHandle, RegionOptions, RegionPosition, } from "./useRegion";
22
22
  export { useRegion } from "./useRegion";
23
+ export type { StrategyDiscoveryStatus } from "./useStrategies";
24
+ export { StrategyDiscoveryContextProvider, useDiscoveredStrategies, useRefreshDiscoveredStrategies, useStrategyDiscoveryStatus, } from "./useStrategies";
23
25
  export { TOOL_SPINNER_FRAMES, TOOL_SPINNER_INTERVAL_MS, useToolSpinner, } from "./useToolSpinner";
24
26
  export type { UserConfig, UserConfigContextProviderProps, UserConfigContextType, } from "./useUserConfig";
25
27
  export { DEFAULT_USER_CONFIG, resolveDefaultConfigFilePath, UserConfigContextProvider, useUserConfig, } from "./useUserConfig";
@@ -0,0 +1,2 @@
1
+ /** Format daemon protocol data for logs without exposing secrets or unbounded content. */
2
+ export declare function formatDaemonLogPayload(payload: unknown): string;
@@ -0,0 +1,2 @@
1
+ export { StrategyDiscoveryContextProvider, useDiscoveredStrategies, useRefreshDiscoveredStrategies, useStrategyDiscoveryStatus, } from "./useStrategies";
2
+ export type { StrategyDiscoveryStatus } from "./useStrategies.types";
@@ -1,10 +1,13 @@
1
1
  import { type DiscoveredStrategy } from "@comma-agents/core";
2
- /**
3
- * Discover available strategies once on mount.
4
- *
5
- * `discoverStrategies()` is async (parses & validates each candidate),
6
- * so we kick it off in `useEffect` and store the result in state.
7
- * Initial value is an empty array; the picker renders empty for a
8
- * single frame and then populates.
9
- */
2
+ import type React from "react";
3
+ import type { StrategyDiscoveryStatus } from "./useStrategies.types";
4
+ /** Owns strategy discovery so package mutations can refresh every consumer. */
5
+ export declare function StrategyDiscoveryContextProvider({ children, }: {
6
+ readonly children: React.ReactNode;
7
+ }): React.ReactElement;
10
8
  export declare function useDiscoveredStrategies(): readonly DiscoveredStrategy[];
9
+ export declare function useStrategyDiscoveryStatus(): {
10
+ readonly status: StrategyDiscoveryStatus;
11
+ readonly error: string | null;
12
+ };
13
+ export declare function useRefreshDiscoveredStrategies(): () => Promise<void>;
@@ -0,0 +1,8 @@
1
+ import type { DiscoveredStrategy } from "@comma-agents/core";
2
+ export type StrategyDiscoveryStatus = "loading" | "ready" | "error";
3
+ export interface StrategyDiscoveryContextValue {
4
+ readonly strategies: readonly DiscoveredStrategy[];
5
+ readonly status: StrategyDiscoveryStatus;
6
+ readonly error: string | null;
7
+ readonly refresh: () => Promise<void>;
8
+ }
@@ -1,4 +1,5 @@
1
1
  export { useUserConfig } from "./useUserConfig";
2
- export { CONFIG_FILE_NAME, CONFIG_SUBDIRECTORY, DEFAULT_USER_CONFIG, resolveConfigRoot, resolveDefaultConfigFilePath, } from "./useUserConfig.constants";
2
+ export { CONFIG_FILE_NAME, DEFAULT_USER_CONFIG, } from "./useUserConfig.constants";
3
3
  export { UserConfigContextProvider } from "./useUserConfig.context";
4
4
  export type { UserConfig, UserConfigContextProviderProps, UserConfigContextType, } from "./useUserConfig.types";
5
+ export { resolveDefaultConfigFilePath } from "./useUserConfig.utils";
@@ -1,17 +1,5 @@
1
1
  import type { UserConfig } from "./useUserConfig.types";
2
- /** Subdirectory under the OS config dir that holds all comma-agents files. */
3
- export declare const CONFIG_SUBDIRECTORY = "comma-agents";
4
2
  /** Filename of the persisted TUI configuration. */
5
3
  export declare const CONFIG_FILE_NAME = "tui-config.json";
6
4
  /** Defaults applied when no config file exists or fields are missing. */
7
5
  export declare const DEFAULT_USER_CONFIG: UserConfig;
8
- /**
9
- * Resolve the platform-appropriate config directory root.
10
- *
11
- * - macOS: `~/Library/Application Support`
12
- * - Windows: `%APPDATA%` (falls back to `~/AppData/Roaming`)
13
- * - Linux/other: `$XDG_CONFIG_HOME` or `~/.config`
14
- */
15
- export declare function resolveConfigRoot(): string;
16
- /** Absolute path to the TUI config file for this user. */
17
- export declare function resolveDefaultConfigFilePath(): string;
@@ -2,7 +2,7 @@ import type { ThemeName } from "../../Theme";
2
2
  /**
3
3
  * Persisted user configuration for the TUI.
4
4
  *
5
- * Stored as JSON at `{config_dir}/comma-agents/tui-config.json`. New optional
5
+ * Stored as JSON at `~/.comma/tui-config.json`. New optional
6
6
  * fields can be added without breaking older config files because
7
7
  * `loadUserConfig` merges any partial input over the defaults.
8
8
  */
@@ -1,4 +1,6 @@
1
1
  import type { UserConfig } from "./useUserConfig.types";
2
+ /** Resolve the TUI configuration file inside the shared user data directory. */
3
+ export declare function resolveDefaultConfigFilePath(): string;
2
4
  /**
3
5
  * Sanitize a parsed JSON object into a valid `UserConfig`. Unknown or
4
6
  * mistyped fields fall back to defaults so old config files keep working
@@ -6,6 +6,8 @@ export interface UseWebSocketConfig {
6
6
  readonly url: string;
7
7
  /** Delay before reconnecting after a dropped connection. Default: 2000ms. */
8
8
  readonly reconnectDelayMs?: number;
9
+ /** Maximum time to wait for a connection to open. Default: 10000ms. */
10
+ readonly connectionTimeoutMs?: number;
9
11
  /** Called with every incoming message (raw string data). */
10
12
  readonly onMessage: (data: string) => void;
11
13
  /** Called when the connection status changes. */