@athenaintel/react 0.15.0 → 0.16.0

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.
Files changed (35) hide show
  1. package/dist/chat/super-grouping/toolkit-map.d.ts +8 -3
  2. package/dist/chat-ui/composer/tiptap-composer.d.ts +7 -0
  3. package/dist/chat-ui/header/chat-header.d.ts +19 -0
  4. package/dist/chat-ui/header/conversation-history-panel.d.ts +27 -0
  5. package/dist/chat-ui/index.d.ts +4 -0
  6. package/dist/chat-ui/messages/message-actions-config.d.ts +12 -0
  7. package/dist/chat-ui/messages/user-edit-composer.d.ts +8 -0
  8. package/dist/chat-ui/thread/chat-thread-shell.d.ts +13 -1
  9. package/dist/chat-ui.cjs +504 -144
  10. package/dist/chat-ui.cjs.map +1 -1
  11. package/dist/chat-ui.js +398 -38
  12. package/dist/chat-ui.js.map +1 -1
  13. package/dist/index.cjs +1451 -4295
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +6 -1
  16. package/dist/index.js +1015 -3838
  17. package/dist/index.js.map +1 -1
  18. package/dist/provider/AthenaProvider.d.ts +4 -1
  19. package/dist/runtime/statewire-run-config.d.ts +0 -2
  20. package/dist/runtime/useAthenaStatewireRuntime.d.ts +3 -1
  21. package/dist/styles.css +1 -1
  22. package/dist/threads/api.d.ts +7 -0
  23. package/dist/threads/conversation-list-fetcher.d.ts +5 -1
  24. package/dist/threads/use-rest-conversation-history.d.ts +43 -0
  25. package/dist/threads/use-statewire-conversation-history.d.ts +71 -0
  26. package/dist/tools/file-tool-uis.d.ts +8 -0
  27. package/dist/tools/todo-plan-store.d.ts +29 -0
  28. package/dist/tools/write-todos-tool-ui.d.ts +1 -0
  29. package/dist/{composer-send-or-stop-C5AVmcwO.js → use-rest-conversation-history-BZ9Pl9kF.js} +4459 -424
  30. package/dist/use-rest-conversation-history-BZ9Pl9kF.js.map +1 -0
  31. package/dist/{composer-send-or-stop-RPudYkWR.cjs → use-rest-conversation-history-DqpE-QGK.cjs} +4327 -271
  32. package/dist/use-rest-conversation-history-DqpE-QGK.cjs.map +1 -0
  33. package/package.json +1 -1
  34. package/dist/composer-send-or-stop-C5AVmcwO.js.map +0 -1
  35. package/dist/composer-send-or-stop-RPudYkWR.cjs.map +0 -1
@@ -0,0 +1,71 @@
1
+ import { type ConversationIndexEntry, type ConversationSummary, type UseConversationIndexOptions } from "@athenaintel/agent-runtime";
2
+ import { type RestConversationAuth } from "./use-rest-conversation-history";
3
+ export interface UseStatewireConversationHistoryOptions {
4
+ backendUrl: string;
5
+ conversationIndexBaseUrl: string;
6
+ principalId: string;
7
+ getAuth: () => RestConversationAuth | Promise<RestConversationAuth>;
8
+ headers: UseConversationIndexOptions["headers"];
9
+ search?: string;
10
+ enabled?: boolean;
11
+ sse?: boolean;
12
+ }
13
+ /** Convert the replicated wire row into the shared cross-surface contract. */
14
+ export declare function conversationSummaryFromIndexEntry(entry: ConversationIndexEntry): ConversationSummary;
15
+ export declare function conversationHistorySource({ indexEntries, restConversations, supportsStatewirePaging, hasSearch, }: {
16
+ indexEntries: readonly ConversationIndexEntry[] | null;
17
+ restConversations: readonly ConversationSummary[];
18
+ supportsStatewirePaging: boolean;
19
+ hasSearch: boolean;
20
+ }): ConversationSummary[];
21
+ export declare function shouldUseRestConversationHistory({ hasSearch, indexEntries, supportsStatewirePaging, connectionStatus, }: {
22
+ hasSearch: boolean;
23
+ indexEntries: readonly ConversationIndexEntry[] | null;
24
+ supportsStatewirePaging: boolean;
25
+ connectionStatus: string;
26
+ }): boolean;
27
+ /**
28
+ * Inclusive satellite conversation history backed by the user's Pinned
29
+ * Statewire instance. The replicated window is the render source; refreshes,
30
+ * pagination, thread creation, lifecycle changes, and title changes arrive on
31
+ * that same channel. A non-empty search deliberately uses the authorized REST
32
+ * list endpoint so matches are not limited to the replicated newest window.
33
+ */
34
+ export declare function useStatewireConversationHistory({ backendUrl, conversationIndexBaseUrl, principalId, getAuth, headers, search, enabled, sse, }: UseStatewireConversationHistoryOptions): {
35
+ conversations: {
36
+ threadId: string;
37
+ title: string;
38
+ updatedAt: string;
39
+ createdAt: string | null;
40
+ state: string | null;
41
+ runtime: string | null;
42
+ sourceChannel: string | null;
43
+ assetType: string | null;
44
+ assetId: string | null;
45
+ appId: string | null;
46
+ triggerType: string | null;
47
+ preview: string | null;
48
+ messageCount: number | null;
49
+ isUnread: boolean;
50
+ }[];
51
+ totalCount: number | null;
52
+ isLoading: boolean;
53
+ isFetching: boolean;
54
+ isRefreshing: boolean;
55
+ hasResolvedFirstPage: boolean;
56
+ hasNextPage: boolean;
57
+ isFetchingNextPage: boolean;
58
+ fetchNextPage: () => Promise<unknown>;
59
+ refresh: () => Promise<unknown>;
60
+ archiveConversation: import("@tanstack/react-query").UseMutateFunction<string, Error, string, void>;
61
+ archivePending: boolean;
62
+ setConversationReadState: import("@tanstack/react-query").UseMutateFunction<import("./api").ThreadReadStateResponse, Error, {
63
+ threadId: string;
64
+ isUnread: boolean;
65
+ }, {
66
+ previous: boolean;
67
+ threadId: string;
68
+ }>;
69
+ readStatePending: boolean;
70
+ connection: import("statewire").StatewireClient.Connection;
71
+ };
@@ -0,0 +1,8 @@
1
+ import type { ToolCallMessagePartComponent } from "@assistant-ui/react";
2
+ /** Human label for an agent-workspace path (never surface scratch-file garble). */
3
+ export declare function friendlyWorkspacePath(value: unknown): string | undefined;
4
+ export declare const ReadFileToolUI: ToolCallMessagePartComponent;
5
+ export declare const ListFilesToolUI: ToolCallMessagePartComponent;
6
+ export declare const WriteFileToolUI: ToolCallMessagePartComponent;
7
+ export declare const EditFileToolUI: ToolCallMessagePartComponent;
8
+ export declare const SearchFilesToolUI: ToolCallMessagePartComponent;
@@ -0,0 +1,29 @@
1
+ import type { TodoPlan } from "./write-todos-tool-ui";
2
+ /** Allocate a mount-ordered sequence number (pure counter — safe to discard). */
3
+ export declare function allocatePlanSeq(): number;
4
+ export declare function registerPlanCard(scope: string, seq: number, plan: TodoPlan, isWriting: boolean): void;
5
+ export declare function updatePlanCard(scope: string, seq: number, plan: TodoPlan, isWriting: boolean): void;
6
+ export declare function unregisterPlanCard(scope: string, seq: number): void;
7
+ export declare function latestPlanSeq(scope: string): number | null;
8
+ /** The plan scope for the calling component's chat (its thread id). */
9
+ export declare function usePlanScope(): string;
10
+ /**
11
+ * Whether the card with this sequence number is the newest mounted plan card
12
+ * in its scope. On the server (and before client effects have registered any
13
+ * card) every card reports latest, so static renders still show the plan.
14
+ */
15
+ export declare function useIsLatestPlanCard(scope: string, seq: number): boolean;
16
+ export interface LatestTodoPlan {
17
+ plan: TodoPlan;
18
+ /** True while the newest plan card's tool call is still streaming. */
19
+ isWriting: boolean;
20
+ }
21
+ /**
22
+ * The newest mounted plan for the calling chat, for hosts building their own
23
+ * pinned plan UI. Pair with `toolUIs={{ write_todos: HiddenWriteTodosToolUI }}`
24
+ * — that component keeps feeding this registry while rendering nothing inline
25
+ * (a bare `() => null` override would starve it).
26
+ */
27
+ export declare function useLatestTodoPlan(): LatestTodoPlan | null;
28
+ /** Test-only: reset module state between cases. */
29
+ export declare function resetTodoPlanStoreForTests(): void;
@@ -14,4 +14,5 @@ export declare function parseTodoPlan({ args, argsText, result, }: {
14
14
  argsText?: string;
15
15
  result?: unknown;
16
16
  }): TodoPlan;
17
+ export declare const HiddenWriteTodosToolUI: ToolCallMessagePartComponent;
17
18
  export declare const WriteTodosToolUI: ToolCallMessagePartComponent;