@gntik-ai/chat 0.5.0 → 0.9.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.
package/dist/index.d.ts CHANGED
@@ -1,6 +1,84 @@
1
1
 
2
- import { ComponentDoc } from "@gntik-ai/ui";
3
2
  import { ComponentType, ReactNode, Ref } from "react";
3
+ import { ComponentDoc } from "@gntik-ai/ui";
4
+ //#region src/AgentSurface/catalog.d.ts
5
+ /** Trusted host code: render explicit properties; never spread the agent's input. */
6
+ interface AgentCatalogRenderProps {
7
+ props: Readonly<Record<string, unknown>>;
8
+ children?: ReactNode;
9
+ onValueChange: (value: unknown) => void;
10
+ onAction: () => void;
11
+ }
12
+ interface AgentCatalogEntry {
13
+ component: ComponentType<AgentCatalogRenderProps>;
14
+ /** Return a fresh object of known properties, or null when invalid. */
15
+ validate: (props: Readonly<Record<string, unknown>>) => Record<string, unknown> | null;
16
+ }
17
+ type AgentCatalog = Readonly<Record<string, AgentCatalogEntry>>;
18
+ export declare function defineAgentCatalog(entries: AgentCatalog): AgentCatalog;
19
+ /** Small text/form catalog. Password, payment and file controls are deliberately absent. */
20
+ export declare const defaultAgentCatalog: Readonly<Record<string, AgentCatalogEntry>>;
21
+ //#endregion
22
+ //#region src/AgentSurface/protocol.d.ts
23
+ /** Supported command envelope. No v0.8 adaptation is performed. */
24
+ export declare const A2UI_VERSION: "v0.9";
25
+ interface AgentComponent {
26
+ id: string;
27
+ component: string;
28
+ children?: string[];
29
+ /** Catalog properties are flat, alongside id/component/children. */
30
+ [property: string]: unknown;
31
+ }
32
+ interface AgentAction {
33
+ name: string;
34
+ surfaceId: string;
35
+ context: Record<string, unknown>;
36
+ }
37
+ interface AgentSurfaceError {
38
+ code: 'version' | 'message' | 'component' | 'props' | 'graph' | 'binding';
39
+ surfaceId: string;
40
+ componentId?: string;
41
+ type?: string;
42
+ }
43
+ type Envelope<T> = {
44
+ version: typeof A2UI_VERSION;
45
+ } & T;
46
+ type A2uiMessage = Envelope<{
47
+ createSurface: {
48
+ surfaceId: string;
49
+ catalogId?: string;
50
+ };
51
+ }> | Envelope<{
52
+ updateComponents: {
53
+ surfaceId: string;
54
+ components: AgentComponent[];
55
+ };
56
+ }> | Envelope<{
57
+ updateDataModel: {
58
+ surfaceId: string;
59
+ path?: string;
60
+ value: unknown;
61
+ };
62
+ }> | Envelope<{
63
+ deleteSurface: {
64
+ surfaceId: string;
65
+ };
66
+ }>;
67
+ //#endregion
68
+ //#region src/AgentSurface/AgentSurface.d.ts
69
+ interface AgentSurfaceProps {
70
+ /** Immutable command log: append messages to update the rendered surfaces. */
71
+ messages: A2uiMessage[];
72
+ /** Trusted allow-list, created by the host rather than the agent. */
73
+ catalog: AgentCatalog;
74
+ onAction?: (action: AgentAction) => void;
75
+ onError?: (error: AgentSurfaceError) => void;
76
+ }
77
+ export declare function AgentSurface({ messages, catalog, onError, onAction }: AgentSurfaceProps): import("react").JSX.Element;
78
+ //#endregion
79
+ //#region src/AgentSurface/AgentSurface.doc.d.ts
80
+ declare const doc: ComponentDoc;
81
+ //#endregion
4
82
  //#region src/Attachment/AttachmentChip.d.ts
5
83
  /** A file attached to a message or waiting in the composer. */
6
84
  interface ChatAttachment {
@@ -107,7 +185,7 @@ export declare const attachmentStyles: {
107
185
  };
108
186
  //#endregion
109
187
  //#region src/Attachment/Attachment.doc.d.ts
110
- declare const doc: ComponentDoc;
188
+ declare const doc$1: ComponentDoc;
111
189
  //#endregion
112
190
  //#region src/ChatComposer/ChatComposer.d.ts
113
191
  /** A file in the composer: name and size, plus optional type, preview, progress and error. */
@@ -187,7 +265,7 @@ export declare const chatComposerStyles: {
187
265
  };
188
266
  //#endregion
189
267
  //#region src/ChatComposer/ChatComposer.doc.d.ts
190
- declare const doc$1: ComponentDoc;
268
+ declare const doc$2: ComponentDoc;
191
269
  //#endregion
192
270
  //#region src/ChatDemo/ChatDemo.d.ts
193
271
  interface ChatDemoProps {
@@ -205,7 +283,7 @@ interface ChatDemoProps {
205
283
  export declare function ChatDemo({ withPanel, tickMs, className }: ChatDemoProps): import("react").JSX.Element;
206
284
  //#endregion
207
285
  //#region src/ChatDemo/ChatDemo.doc.d.ts
208
- declare const doc$2: ComponentDoc;
286
+ declare const doc$3: ComponentDoc;
209
287
  //#endregion
210
288
  //#region src/ChatLayout/ChatLayout.d.ts
211
289
  interface ChatLayoutProps {
@@ -259,7 +337,7 @@ export declare const chatLayoutStyles: {
259
337
  };
260
338
  //#endregion
261
339
  //#region src/ChatLayout/ChatLayout.doc.d.ts
262
- declare const doc$3: ComponentDoc;
340
+ declare const doc$4: ComponentDoc;
263
341
  //#endregion
264
342
  //#region src/ChatMessage/ChatMessage.d.ts
265
343
  /**
@@ -379,7 +457,7 @@ export declare const chatMessageStyles: {
379
457
  };
380
458
  //#endregion
381
459
  //#region src/ChatMessage/ChatMessage.doc.d.ts
382
- declare const doc$4: ComponentDoc;
460
+ declare const doc$5: ComponentDoc;
383
461
  //#endregion
384
462
  //#region src/Citation/Citation.d.ts
385
463
  interface CitationSource {
@@ -437,7 +515,7 @@ export declare const citationStyles: {
437
515
  };
438
516
  //#endregion
439
517
  //#region src/Citation/Citation.doc.d.ts
440
- declare const doc$5: ComponentDoc;
518
+ declare const doc$6: ComponentDoc;
441
519
  //#endregion
442
520
  //#region src/Markdown/Markdown.d.ts
443
521
  interface MarkdownProps {
@@ -512,7 +590,7 @@ export declare const markdownStyles: {
512
590
  };
513
591
  //#endregion
514
592
  //#region src/Markdown/Markdown.doc.d.ts
515
- declare const doc$6: ComponentDoc;
593
+ declare const doc$7: ComponentDoc;
516
594
  //#endregion
517
595
  //#region src/MessageFeedback/MessageFeedback.d.ts
518
596
  type FeedbackRating = 'up' | 'down';
@@ -571,7 +649,7 @@ export declare const messageFeedbackStyles: {
571
649
  };
572
650
  //#endregion
573
651
  //#region src/MessageFeedback/MessageFeedback.doc.d.ts
574
- declare const doc$7: ComponentDoc;
652
+ declare const doc$8: ComponentDoc;
575
653
  //#endregion
576
654
  //#region src/ModelPicker/ModelPicker.d.ts
577
655
  type ModelCapability = 'vision' | 'tools' | 'reasoning' | 'files' | 'web' | 'audio';
@@ -640,7 +718,7 @@ export declare const modelPickerStyles: {
640
718
  export declare const DEMO_MODELS: ChatModel[];
641
719
  //#endregion
642
720
  //#region src/ModelPicker/ModelPicker.doc.d.ts
643
- declare const doc$8: ComponentDoc;
721
+ declare const doc$9: ComponentDoc;
644
722
  //#endregion
645
723
  //#region src/SuggestionChips/SuggestionChips.d.ts
646
724
  type IconComponent = ComponentType<{
@@ -689,7 +767,7 @@ export declare const suggestionChipsStyles: {
689
767
  };
690
768
  //#endregion
691
769
  //#region src/SuggestionChips/SuggestionChips.doc.d.ts
692
- declare const doc$9: ComponentDoc;
770
+ declare const doc$10: ComponentDoc;
693
771
  //#endregion
694
772
  //#region src/ToolCallCard/ToolCallCard.d.ts
695
773
  type ToolCallStatus = 'running' | 'succeeded' | 'failed';
@@ -752,7 +830,7 @@ export declare const toolCallCardStyles: {
752
830
  };
753
831
  //#endregion
754
832
  //#region src/ToolCallCard/ToolCallCard.doc.d.ts
755
- declare const doc$10: ComponentDoc;
833
+ declare const doc$11: ComponentDoc;
756
834
  //#endregion
757
835
  //#region src/TypingIndicator/TypingIndicator.d.ts
758
836
  interface TypingIndicatorProps {
@@ -800,7 +878,7 @@ export declare const typingIndicatorStyles: {
800
878
  export declare const streamingCaret = "ms-0.5 inline-block h-[1.05em] w-[2px] translate-y-[2px] bg-primary animate-pulse motion-reduce:animate-none";
801
879
  //#endregion
802
880
  //#region src/TypingIndicator/TypingIndicator.doc.d.ts
803
- declare const doc$11: ComponentDoc;
881
+ declare const doc$12: ComponentDoc;
804
882
  //#endregion
805
883
  //#region src/useChatScroll/useChatScroll.d.ts
806
884
  interface UseChatScrollOptions {
@@ -825,5 +903,5 @@ interface UseChatScrollResult {
825
903
  */
826
904
  export declare function useChatScroll({ threshold }?: UseChatScrollOptions): UseChatScrollResult;
827
905
  //#endregion
828
- export { type AttachmentChipProps, type AttachmentListProps, type AttachmentRejection, type AttachmentRejectionReason, type AttachmentStatus, type ChatAnnouncerProps, type ChatAttachment, type ChatComposerProps, type ChatDemoProps, type ChatFeedback, type ChatLayoutProps, type ChatMessageProps, type ChatModel, type ChatRole, type CitationListProps, type CitationProps, type CitationSource, type CodeBlockProps, type ComposerAttachment, type FeedbackRating, type FeedbackReason, type FeedbackValue, type JsonViewProps, type MarkdownProps, type MessageFeedbackProps, type ModelCapability, type ModelPickerProps, type Suggestion, type SuggestionChipsProps, type ToolCallCardProps, type ToolCallStatus, type TypingIndicatorProps, type UseChatScrollOptions, type UseChatScrollResult, type ValidateFilesOptions, doc as attachmentListDoc, doc$1 as chatComposerDoc, doc$2 as chatDemoDoc, doc$3 as chatLayoutDoc, doc$4 as chatMessageDoc, doc$5 as citationDoc, doc$6 as markdownDoc, doc$7 as messageFeedbackDoc, doc$8 as modelPickerDoc, doc$9 as suggestionChipsDoc, doc$10 as toolCallCardDoc, doc$11 as typingIndicatorDoc };
906
+ export { type A2uiMessage, type AgentAction, type AgentCatalog, type AgentCatalogEntry, type AgentCatalogRenderProps, type AgentComponent, type AgentSurfaceError, type AgentSurfaceProps, type AttachmentChipProps, type AttachmentListProps, type AttachmentRejection, type AttachmentRejectionReason, type AttachmentStatus, type ChatAnnouncerProps, type ChatAttachment, type ChatComposerProps, type ChatDemoProps, type ChatFeedback, type ChatLayoutProps, type ChatMessageProps, type ChatModel, type ChatRole, type CitationListProps, type CitationProps, type CitationSource, type CodeBlockProps, type ComposerAttachment, type FeedbackRating, type FeedbackReason, type FeedbackValue, type JsonViewProps, type MarkdownProps, type MessageFeedbackProps, type ModelCapability, type ModelPickerProps, type Suggestion, type SuggestionChipsProps, type ToolCallCardProps, type ToolCallStatus, type TypingIndicatorProps, type UseChatScrollOptions, type UseChatScrollResult, type ValidateFilesOptions, doc as agentSurfaceDoc, doc$1 as attachmentListDoc, doc$2 as chatComposerDoc, doc$3 as chatDemoDoc, doc$4 as chatLayoutDoc, doc$5 as chatMessageDoc, doc$6 as citationDoc, doc$7 as markdownDoc, doc$8 as messageFeedbackDoc, doc$9 as modelPickerDoc, doc$10 as suggestionChipsDoc, doc$11 as toolCallCardDoc, doc$12 as typingIndicatorDoc };
829
907
  //# sourceMappingURL=index.d.ts.map