teodor-new-chat-ui 4.3.390 → 4.3.392

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.
@@ -1,4 +1,4 @@
1
- import type { AgentDetail, AgentSchemaInfo, AgentSummary, CheckpointSnapshot, HistoryPayload, SharedThreadSummary, ThreadInfo, ThreadShareResponse, ThreadSummary } from "@/types";
1
+ import type { AgentDetail, AgentSchemaInfo, AgentSummary, HistoryPayload, SharedThreadSummary, StateSnapshot, ThreadInfo, ThreadShareResponse, ThreadSummary } from "@/types";
2
2
  import type { TokenListener } from "../types";
3
3
  import { getChatToken, onChatTokenChanged, setChatToken } from "./utils";
4
4
  export declare class ChatApi {
@@ -27,7 +27,7 @@ export declare class ChatApi {
27
27
  threadId: string;
28
28
  checkpointId?: string;
29
29
  checkpointNs?: string;
30
- }): Promise<CheckpointSnapshot>;
30
+ }): Promise<StateSnapshot>;
31
31
  getStateHistory(params: {
32
32
  threadId: string;
33
33
  checkpointId?: string;
@@ -2,19 +2,7 @@
2
2
  * Message Component - With truncatable tool messages and responsive design
3
3
  */
4
4
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
5
- import type { CheckpointMetaWithAttempts } from "@/types/timeline";
6
- type MessageCheckpointMeta = {
7
- id: string;
8
- step: number | null;
9
- source: string | null;
10
- createdAt: string | null;
11
- namespace: string | null;
12
- parentId: string | null;
13
- };
14
- type EditMeta = {
15
- checkpointId?: string | null;
16
- checkpointNs?: string | null;
17
- };
5
+ import type { CheckpointMeta, CheckpointMetaWithAttempts, EditMeta } from "@/hooks/useCheckpointSelectors";
18
6
  export interface MessageComponentProps {
19
7
  message: ChatMessage | DefaultMessage;
20
8
  messageIndex: number;
@@ -43,7 +31,7 @@ export interface MessageComponentProps {
43
31
  disableInterruptActions?: boolean;
44
32
  onInterruptActionStart?: () => void;
45
33
  onInterruptActionEnd?: () => void;
46
- checkpointCandidates?: MessageCheckpointMeta[];
34
+ checkpointCandidates?: CheckpointMeta[];
47
35
  activeCheckpointId?: string | null;
48
36
  onSelectCheckpoint?: (checkpointId: string | null, parentCheckpointId?: string | null, isLatest?: boolean) => Promise<void> | void;
49
37
  defaultCheckpointId?: string | null;
@@ -1,5 +1,5 @@
1
1
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
2
- import type { CheckpointMeta, CheckpointMetaWithAttempts, EditMeta, TimelineCheckpoint } from "@/types/timeline";
2
+ import type { CheckpointMeta, CheckpointMetaWithAttempts, EditMeta, TimelineCheckpoint } from "@/hooks/useCheckpointSelectors";
3
3
  import React from "react";
4
4
  export interface MessageListProps {
5
5
  messages: (ChatMessage | DefaultMessage)[];
@@ -1,5 +1,5 @@
1
1
  import type { ChatMessage, DefaultMessage, PendingInterrupt } from "@/types";
2
- import type { CheckpointMeta, CheckpointMetaWithAttempts, EditMeta } from "@/types/timeline";
2
+ import type { CheckpointMeta, CheckpointMetaWithAttempts, EditMeta } from "@/hooks/useCheckpointSelectors";
3
3
  import React from "react";
4
4
  export declare const getMessageDomKey: (message: ChatMessage | DefaultMessage | undefined, index: number) => string;
5
5
  export interface MessageRowProps {
@@ -1,4 +1,4 @@
1
- import type { TimelineCheckpoint } from "@/types/timeline";
1
+ import type { TimelineCheckpoint } from "@/hooks/useCheckpointSelectors";
2
2
  export interface TimelineColumnProps {
3
3
  timelineEntries: TimelineCheckpoint[];
4
4
  activeCheckpointId?: string | null;
@@ -1,6 +1,6 @@
1
1
  import * as ResizablePrimitive from "react-resizable-panels";
2
2
  declare const ResizablePanelGroup: ({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => import("react/jsx-runtime").JSX.Element;
3
- declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLTextAreaElement | HTMLFormElement | HTMLDivElement | HTMLObjectElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLLabelElement | HTMLSourceElement | HTMLTitleElement | HTMLSlotElement | HTMLStyleElement | HTMLDialogElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLAnchorElement | HTMLHeadingElement | HTMLInputElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSelectElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLMenuElement | HTMLTableCaptionElement | HTMLPictureElement>, "id" | "onResize"> & {
3
+ declare const ResizablePanel: import("react").ForwardRefExoticComponent<Omit<import("react").HTMLAttributes<HTMLButtonElement | HTMLElement | HTMLTextAreaElement | HTMLFormElement | HTMLDivElement | HTMLObjectElement | HTMLSourceElement | HTMLDataElement | HTMLHeadElement | HTMLLinkElement | HTMLBodyElement | HTMLMapElement | HTMLInputElement | HTMLTitleElement | HTMLSlotElement | HTMLStyleElement | HTMLDialogElement | HTMLImageElement | HTMLOptionElement | HTMLTableElement | HTMLAnchorElement | HTMLHeadingElement | HTMLLabelElement | HTMLLIElement | HTMLOListElement | HTMLParagraphElement | HTMLSelectElement | HTMLSpanElement | HTMLUListElement | HTMLAreaElement | HTMLAudioElement | HTMLBaseElement | HTMLQuoteElement | HTMLBRElement | HTMLCanvasElement | HTMLTableColElement | HTMLDataListElement | HTMLModElement | HTMLDetailsElement | HTMLDListElement | HTMLEmbedElement | HTMLFieldSetElement | HTMLHRElement | HTMLHtmlElement | HTMLIFrameElement | HTMLLegendElement | HTMLMetaElement | HTMLMeterElement | HTMLOptGroupElement | HTMLOutputElement | HTMLPreElement | HTMLProgressElement | HTMLScriptElement | HTMLTemplateElement | HTMLTableSectionElement | HTMLTableCellElement | HTMLTimeElement | HTMLTableRowElement | HTMLTrackElement | HTMLVideoElement | HTMLMenuElement | HTMLTableCaptionElement | HTMLPictureElement>, "id" | "onResize"> & {
4
4
  className?: string | undefined;
5
5
  collapsedSize?: number | undefined;
6
6
  collapsible?: boolean | undefined;
@@ -31,7 +31,8 @@
31
31
  *
32
32
  * RESULT: Much easier to debug, faster development, no stale cache issues
33
33
  */
34
- import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, StreamContextValue, ThreadSummary, TimelineCheckpoint } from '@/types';
34
+ import type { ChatMessage, HydratedCheckpointSnapshot, PendingInterrupt, SharedThreadSummary, StreamContextValue, ThreadSummary } from '@/types';
35
+ import type { TimelineCheckpoint } from "@/hooks/useCheckpointSelectors";
35
36
  import type { ThreadStateMetadata } from '@/types/context';
36
37
  import type { ToolEndEvent } from '@/types/events';
37
38
  import { type ReactNode } from 'react';
@@ -12,7 +12,7 @@
12
12
  * resulting in cleaner separation of concerns.
13
13
  */
14
14
  import type { HydratedCheckpointSnapshot } from "@/types";
15
- import type { CheckpointMeta, CheckpointMetaWithAttempts } from "@/types/timeline";
15
+ import type { CheckpointMeta, CheckpointMetaWithAttempts } from "@/hooks/useCheckpointSelectors";
16
16
  export interface CheckpointMetadataResult {
17
17
  checkpointMetaById: Map<string, CheckpointMeta>;
18
18
  checkpointIndexByKey: Map<string, CheckpointMeta[]>;
@@ -0,0 +1,36 @@
1
+ import type { HydratedCheckpointSnapshot, PendingInterrupt as Interrupt } from "@/types";
2
+ export type EditMeta = {
3
+ checkpointId?: string | null;
4
+ checkpointNs?: string | null;
5
+ };
6
+ export type TimelineCheckpoint = {
7
+ id: string;
8
+ label: string;
9
+ messageId: string | null;
10
+ step: number | null;
11
+ source: string | null;
12
+ createdAt: string | null;
13
+ next?: string | null;
14
+ parentConfig?: Record<string, unknown> | null;
15
+ };
16
+ export declare function useCheckpointTimeline(checkpoints: HydratedCheckpointSnapshot[]): TimelineCheckpoint[];
17
+ export type CheckpointMeta = {
18
+ id: string;
19
+ step: number | null;
20
+ source: string | null;
21
+ createdAt: string | null;
22
+ namespace: string | null;
23
+ parentId: string | null;
24
+ };
25
+ export declare function useCheckpointMeta(checkpoints: HydratedCheckpointSnapshot[]): CheckpointMeta[];
26
+ export type CheckpointMetaWithAttempts = CheckpointMeta & {
27
+ attemptIndex: number;
28
+ attemptCount: number;
29
+ isLatestAttempt: boolean;
30
+ baseUserMessageId: string | null;
31
+ };
32
+ export declare function useCheckpointAttempts(checkpoints: HydratedCheckpointSnapshot[]): CheckpointMetaWithAttempts[];
33
+ export declare function isExecutionPaused(snapshot: HydratedCheckpointSnapshot): boolean;
34
+ export declare function getCurrentInterrupt(snapshot: HydratedCheckpointSnapshot): Interrupt | null;
35
+ export declare function getLatestCheckpoint(checkpoints: HydratedCheckpointSnapshot[]): HydratedCheckpointSnapshot | undefined;
36
+ export declare function useCheckpointById(checkpoints: HydratedCheckpointSnapshot[], checkpointId: string | null): HydratedCheckpointSnapshot | undefined;
@@ -10,7 +10,7 @@
10
10
  * that was previously embedded in MessageList.tsx's render function.
11
11
  */
12
12
  import type { ChatMessage, DefaultMessage } from "@/types";
13
- import type { CheckpointMeta, CheckpointMetaWithAttempts } from "@/types/timeline";
13
+ import type { CheckpointMeta, CheckpointMetaWithAttempts } from "@/hooks/useCheckpointSelectors";
14
14
  export interface MetadataResolverMaps {
15
15
  checkpointMetaById?: Map<string, CheckpointMeta>;
16
16
  checkpointIndexByKey?: Map<string, CheckpointMeta[]>;
@@ -1,6 +1,7 @@
1
1
  import type { ChatApi } from "@/api/chat-api";
2
2
  import type { StateHistoryEvent } from "@/context/services/streaming/use-streaming-service";
3
- import type { ChatMessage, HydratedCheckpointSnapshot, TimelineCheckpoint } from "@/types";
3
+ import type { ChatMessage, HydratedCheckpointSnapshot } from "@/types";
4
+ import type { TimelineCheckpoint } from "@/hooks/useCheckpointSelectors";
4
5
  import type { PendingInterrupt } from "@/types/models";
5
6
  interface UseThreadHistoryStateOptions {
6
7
  api: ChatApi;