@agents24/chat-react 0.1.7 → 0.1.8

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 (42) hide show
  1. package/README.md +25 -12
  2. package/dist/chunk-E3TJ3I6G.js +358 -0
  3. package/dist/chunk-E3TJ3I6G.js.map +1 -0
  4. package/dist/chunk-EWZO4QJI.js +140 -0
  5. package/dist/chunk-EWZO4QJI.js.map +1 -0
  6. package/dist/chunk-UU7OXHL3.js +11 -0
  7. package/dist/chunk-UU7OXHL3.js.map +1 -0
  8. package/dist/context-window.d.ts +38 -0
  9. package/dist/controller.d.ts +22 -0
  10. package/dist/index.cjs +392 -314
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.ts +10 -530
  13. package/dist/index.js +41 -439
  14. package/dist/index.js.map +1 -1
  15. package/dist/latest-thread-scroller.d.ts +54 -0
  16. package/dist/model.d.ts +29 -0
  17. package/dist/renderers.d.ts +10 -0
  18. package/dist/sse.d.ts +3 -0
  19. package/dist/streaming-text.d.ts +24 -0
  20. package/dist/templates/agent-chat-shell.d.ts +25 -0
  21. package/dist/templates/index.cjs +523 -0
  22. package/dist/templates/index.cjs.map +1 -0
  23. package/dist/templates/index.d.ts +1 -0
  24. package/dist/templates/index.js +140 -0
  25. package/dist/templates/index.js.map +1 -0
  26. package/dist/transport.d.ts +29 -0
  27. package/dist/types.d.ts +312 -0
  28. package/dist/ui/adapters.d.ts +36 -0
  29. package/dist/ui/attachment.d.ts +23 -0
  30. package/dist/ui/bubble.d.ts +17 -0
  31. package/dist/ui/index.cjs +943 -0
  32. package/dist/ui/index.cjs.map +1 -0
  33. package/dist/ui/index.d.ts +7 -0
  34. package/dist/ui/index.js +734 -0
  35. package/dist/ui/index.js.map +1 -0
  36. package/dist/ui/marker.d.ts +11 -0
  37. package/dist/ui/message-response.d.ts +7 -0
  38. package/dist/ui/message.d.ts +10 -0
  39. package/dist/ui/utils.d.ts +2 -0
  40. package/dist/viewport.d.ts +2 -0
  41. package/package.json +22 -4
  42. package/dist/index.d.cts +0 -530
@@ -0,0 +1,38 @@
1
+ export type ContextWindowSource = "exact" | "estimated" | "provider_count_api" | "provider_usage" | "runtime_tokenizer" | "hf_tokenizer" | "multimodal_estimate" | "text_estimate" | "tokenizer_estimate" | "heuristic_estimate" | "unknown";
2
+ export type ContextWindowStage = "preflight" | "sent_prompt" | "final_usage";
3
+ export type ContextWindowConfidence = "exact" | "high" | "medium" | "low" | "unknown";
4
+ export type ContextCompressionStatus = {
5
+ active: boolean;
6
+ reason?: string | null;
7
+ input_tokens?: number | null;
8
+ max_tokens?: number | null;
9
+ usage_ratio?: number | null;
10
+ full_frame_count?: number | null;
11
+ compact_frame_count?: number | null;
12
+ dropped_frame_count?: number | null;
13
+ artifact_ref_count?: number | null;
14
+ compression_trigger_budget?: number | null;
15
+ compression_target_budget?: number | null;
16
+ compression_target_ratio?: number | null;
17
+ threshold_used?: number | null;
18
+ };
19
+ export type ContextWindow = {
20
+ source: ContextWindowSource;
21
+ run_id?: string | null;
22
+ stage?: ContextWindowStage | null;
23
+ confidence?: ContextWindowConfidence | null;
24
+ counter?: string | null;
25
+ model_id?: string | null;
26
+ max_tokens?: number | null;
27
+ max_tokens_source?: string | null;
28
+ input_tokens?: number | null;
29
+ remaining_tokens?: number | null;
30
+ usage_ratio?: number | null;
31
+ assembly?: Record<string, unknown> | null;
32
+ context_compression?: ContextCompressionStatus | null;
33
+ };
34
+ export declare function normalizeContextCompression(value: unknown): ContextCompressionStatus | null;
35
+ export declare function normalizeContextWindow(value: unknown): ContextWindow | null;
36
+ export declare function mergeContextWindow(current: ContextWindow | null | undefined, incoming: ContextWindow | null | undefined): ContextWindow | null;
37
+ export declare function mergeContextWindowUpdate(current: ContextWindow | null | undefined, incoming: unknown): ContextWindow | null;
38
+ export declare function compressionFromContextWindow(contextWindow: ContextWindow | null | undefined): ContextCompressionStatus | null;
@@ -0,0 +1,22 @@
1
+ import type { ChatController, ChatMessage, ChatRuntimeEvent, ChatStorageAdapter, ChatTransport } from "./types";
2
+ export type ChatRuntimeEventContext = {
3
+ mode: "submit" | "attach";
4
+ assistantMessageId: string;
5
+ threadId: string | null;
6
+ runId: string | null;
7
+ startedAt: number;
8
+ };
9
+ export type UseAgents24ChatControllerOptions = {
10
+ transport: ChatTransport;
11
+ storage: ChatStorageAdapter;
12
+ activeThreadId?: string | null;
13
+ pageSize?: number;
14
+ storageKey?: unknown;
15
+ createId?: () => string;
16
+ onActiveThreadIdChange?: (threadId: string | null) => void;
17
+ onSourceClick?: (citations: ChatMessage["citations"]) => void;
18
+ onStreamErrorMessage?: (error: unknown) => string;
19
+ onRuntimeEvent?: (event: ChatRuntimeEvent, context: ChatRuntimeEventContext) => void | Promise<void>;
20
+ onThreadDetailLoaded?: (detail: unknown) => void | Promise<void>;
21
+ };
22
+ export declare function useAgents24ChatController({ transport, storage, activeThreadId: controlledActiveThreadId, pageSize, storageKey, createId, onActiveThreadIdChange, onSourceClick, onStreamErrorMessage, onRuntimeEvent, onThreadDetailLoaded, }: UseAgents24ChatControllerOptions): ChatController;