@threadplane/chat 0.0.55 → 0.0.57

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.
@@ -9,20 +9,78 @@ import * as _json_render_core from '@json-render/core';
9
9
  import { StateStore, Spec } from '@json-render/core';
10
10
  import { Observable } from 'rxjs';
11
11
  import * as _threadplane_chat from '@threadplane/chat';
12
+ import * as _cacheplane_partial_markdown from '@cacheplane/partial-markdown';
13
+ import { MarkdownDocumentNode, CitationDefinition, MarkdownNode, MarkdownParagraphNode, MarkdownHeadingNode, MarkdownBlockquoteNode, MarkdownListNode, MarkdownListItemNode, MarkdownCodeBlockNode, MarkdownThematicBreakNode, MarkdownTextNode, MarkdownEmphasisNode, MarkdownStrongNode, MarkdownStrikethroughNode, MarkdownInlineCodeNode, MarkdownMathInlineNode, MarkdownMathDisplayNode, MarkdownHtmlInlineNode, MarkdownHtmlBlockNode, MarkdownLinkNode, MarkdownAutolinkNode, MarkdownImageNode, MarkdownSoftBreakNode, MarkdownHardBreakNode, MarkdownCitationReferenceNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTableCellNode } from '@cacheplane/partial-markdown';
12
14
  import { PartialJsonParser } from '@cacheplane/partial-json';
13
15
  import { BaseMessage } from '@langchain/core/messages';
14
- import * as _cacheplane_partial_markdown from '@cacheplane/partial-markdown';
15
- import { CitationDefinition, MarkdownDocumentNode, MarkdownNode, MarkdownParagraphNode, MarkdownHeadingNode, MarkdownBlockquoteNode, MarkdownListNode, MarkdownListItemNode, MarkdownCodeBlockNode, MarkdownThematicBreakNode, MarkdownTextNode, MarkdownEmphasisNode, MarkdownStrongNode, MarkdownStrikethroughNode, MarkdownInlineCodeNode, MarkdownMathInlineNode, MarkdownMathDisplayNode, MarkdownHtmlInlineNode, MarkdownHtmlBlockNode, MarkdownLinkNode, MarkdownAutolinkNode, MarkdownImageNode, MarkdownSoftBreakNode, MarkdownHardBreakNode, MarkdownCitationReferenceNode, MarkdownTableNode, MarkdownTableRowNode, MarkdownTableCellNode } from '@cacheplane/partial-markdown';
16
16
  import { SafeHtml, DomSanitizer } from '@angular/platform-browser';
17
17
  import { NavigationExtras } from '@angular/router';
18
18
 
19
+ type ToolCallStatus = 'pending' | 'running' | 'complete' | 'error';
20
+ interface ToolCall {
21
+ id: string;
22
+ name: string;
23
+ /** Arguments. May be partial while streaming (`status !== 'complete'`). */
24
+ args: unknown;
25
+ status: ToolCallStatus;
26
+ /** Present when status === 'complete' or 'error'. */
27
+ result?: unknown;
28
+ /** Optional error payload when status === 'error'. */
29
+ error?: unknown;
30
+ }
31
+
32
+ /** Runtime context passed to browser-executed function tool handlers. */
33
+ interface FunctionToolHandlerContext {
34
+ /** Aborts when the client tool execution should stop without resolving. */
35
+ readonly signal: AbortSignal;
36
+ }
37
+ /** Execution policy options for browser-executed function tools. */
38
+ interface ClientToolContinuationOptions {
39
+ /** False when the tool result should be recorded without forcing a continuation. */
40
+ readonly followUp?: boolean;
41
+ }
42
+ /** Execution policy options for browser-executed function tools. */
43
+ interface ClientToolExecutionOptions extends ClientToolContinuationOptions {
44
+ /** True when the handler may safely re-run and should skip durable pre-claims. */
45
+ readonly idempotent?: boolean;
46
+ }
47
+ /** Diagnostic emitted when client-tool continuation would exceed the configured max turn count. */
48
+ interface ClientToolContinuationLimitEvent {
49
+ readonly maxTurns: number;
50
+ readonly attemptedTurn: number;
51
+ readonly toolCallIds: readonly string[];
52
+ readonly toolNames: readonly string[];
53
+ }
54
+ /** Policy for automatic client-tool continuation. */
55
+ interface ClientToolContinuationPolicy {
56
+ /** Maximum consecutive client-tool continuation groups per user turn. Default: 10. Use 0 for unlimited. */
57
+ readonly maxTurns?: number;
58
+ /** Called when the max-turn guard stops a continuation group. */
59
+ readonly onLimit?: (event: ClientToolContinuationLimitEvent) => void;
60
+ }
61
+ type ClientToolLifecyclePhase = 'running' | 'complete' | 'error';
62
+ interface ClientToolLifecycle {
63
+ readonly id: string;
64
+ readonly name: string;
65
+ readonly status: ToolCallStatus;
66
+ readonly phase: ClientToolLifecyclePhase;
67
+ readonly hasResult: boolean;
68
+ readonly result?: unknown;
69
+ readonly error?: unknown;
70
+ }
71
+ type ClientToolViewProps<S extends StandardSchemaV1> = StandardSchemaInferOutput<S> & {
72
+ readonly status?: ToolCallStatus;
73
+ readonly clientTool?: ClientToolLifecycle;
74
+ };
19
75
  /** Precise authored function tool — what `action()` returns. Carries the schema
20
76
  * `S` and the handler's resolved return type `R`. */
21
77
  interface FunctionToolDef<S extends StandardSchemaV1 = StandardSchemaV1, R = unknown> {
22
78
  readonly kind: 'function';
23
79
  readonly description: string;
24
80
  readonly schema: S;
25
- readonly handler: (args: StandardSchemaInferOutput<S>) => R | Promise<R>;
81
+ readonly followUp?: boolean;
82
+ readonly idempotent?: boolean;
83
+ readonly handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>;
26
84
  }
27
85
  /** Bivariant union member used only for registry storage/iteration. The handler
28
86
  * param is `any` (NOT `never`): `any` is simultaneously a supertype any precise
@@ -33,18 +91,22 @@ interface AnyFunctionToolDef {
33
91
  readonly kind: 'function';
34
92
  readonly description: string;
35
93
  readonly schema: StandardSchemaV1;
36
- readonly handler: (args: any) => unknown | Promise<unknown>;
94
+ readonly followUp?: boolean;
95
+ readonly idempotent?: boolean;
96
+ readonly handler: (args: any, context: FunctionToolHandlerContext) => unknown | Promise<unknown>;
37
97
  }
38
98
  interface ViewToolDef<S extends StandardSchemaV1 = StandardSchemaV1, C = unknown> {
39
99
  readonly kind: 'view';
40
100
  readonly description: string;
41
101
  readonly schema: S;
102
+ readonly followUp?: boolean;
42
103
  readonly component: Type<C>;
43
104
  }
44
105
  interface AskToolDef<S extends StandardSchemaV1 = StandardSchemaV1, C = unknown> {
45
106
  readonly kind: 'ask';
46
107
  readonly description: string;
47
108
  readonly schema: S;
109
+ readonly followUp?: boolean;
48
110
  readonly component: Type<C>;
49
111
  }
50
112
  /** A client tool the model can call; executed in the browser. */
@@ -162,11 +224,66 @@ interface Citation {
162
224
  snippet?: string;
163
225
  /** Provider-specific extras (retrieval score, source type, etc.). */
164
226
  extra?: Record<string, unknown>;
227
+ /**
228
+ * Source classification driving the type badge. Free-form and extensible:
229
+ * 'web' (default-inferred from an http(s) url) | 'file' | 'app' | 'memory'
230
+ * | any custom string. Optional — display derives 'web' from the url when absent.
231
+ */
232
+ sourceType?: string;
233
+ /**
234
+ * Provider-supplied favicon/logo (absolute URL or `data:` URI). NEVER
235
+ * auto-fetched by the library — supply this from your own resolver if you
236
+ * want real favicons; otherwise a monogram is rendered.
237
+ */
238
+ iconUrl?: string;
239
+ /** Freshness signal shown in the preview-card footer. */
240
+ publishedAt?: string | number | Date;
165
241
  }
166
242
 
243
+ /**
244
+ * Terminal result of one response attempt.
245
+ *
246
+ * `paused` is an intentional stop awaiting resumable input; `interrupted` means
247
+ * the response stream ended unexpectedly. The other outcomes indicate normal
248
+ * completion, failure, or caller cancellation.
249
+ */
250
+ type CompleteOutcome = 'success' | 'error' | 'aborted' | 'interrupted' | 'paused';
251
+ /**
252
+ * Delivery lifecycle for one response attempt. `generation` identifies that
253
+ * attempt and is stable only for its lifetime. `streaming` means chunks may
254
+ * still arrive; `complete` means the attempt has stopped with a terminal outcome.
255
+ */
256
+ type MessageDelivery = {
257
+ readonly generation: string;
258
+ readonly phase: 'streaming';
259
+ } | {
260
+ readonly generation: string;
261
+ readonly phase: 'complete';
262
+ readonly outcome: CompleteOutcome;
263
+ };
264
+ /** Creates the active delivery state for one response-attempt generation. */
265
+ declare function streamingDelivery(generation: string): {
266
+ readonly generation: string;
267
+ readonly phase: "streaming";
268
+ };
269
+ /** Creates a terminal delivery state for an existing response-attempt generation. */
270
+ declare function completeDelivery<const TOutcome extends CompleteOutcome>(generation: string, outcome: TOutcome): {
271
+ readonly generation: string;
272
+ readonly phase: "complete";
273
+ readonly outcome: TOutcome;
274
+ };
275
+ /** Creates a successful terminal delivery state for an already-complete message. */
276
+ declare function staticDelivery(messageId: string): {
277
+ readonly generation: string;
278
+ readonly phase: "complete";
279
+ readonly outcome: "success";
280
+ };
281
+
167
282
  type Role = 'user' | 'assistant' | 'system' | 'tool';
168
283
  interface Message {
169
284
  id: string;
285
+ /** Adapter-owned authoritative delivery lifecycle state for this message. */
286
+ delivery: MessageDelivery;
170
287
  role: Role;
171
288
  /** Plain text, or a list of structured content blocks. */
172
289
  content: string | ContentBlock[];
@@ -257,19 +374,6 @@ declare function isSystemMessage(m: Message): m is Message & {
257
374
  role: 'system';
258
375
  };
259
376
 
260
- type ToolCallStatus = 'pending' | 'running' | 'complete' | 'error';
261
- interface ToolCall {
262
- id: string;
263
- name: string;
264
- /** Arguments. May be partial while streaming (`status !== 'complete'`). */
265
- args: unknown;
266
- status: ToolCallStatus;
267
- /** Present when status === 'complete' or 'error'. */
268
- result?: unknown;
269
- /** Optional error payload when status === 'error'. */
270
- error?: unknown;
271
- }
272
-
273
377
  type AgentStatus = 'idle' | 'running' | 'error';
274
378
 
275
379
  interface AgentInterrupt {
@@ -371,6 +475,15 @@ interface ClientToolsCapability {
371
475
  setCatalog(specs: readonly ClientToolSpec[]): void;
372
476
  /** Tool calls the model made for client tools that await a client result. */
373
477
  readonly pending: Signal<readonly ToolCall[]>;
478
+ /** Record a client tool's result without continuing the run. */
479
+ settle?(toolCallId: string, result: ClientToolResult): void;
480
+ /**
481
+ * Make every result recorded via {@link settle} durable on the server
482
+ * WITHOUT continuing the run. No-op for adapters whose settle() is already
483
+ * durable. Adapters that buffer locally MUST clear their buffer only on a
484
+ * successful write, so a failure degrades to a later flush or submit.
485
+ */
486
+ flush?(): void | Promise<void>;
374
487
  /** Return a client tool's result (or error) and continue the run. */
375
488
  resolve(toolCallId: string, result: ClientToolResult): void;
376
489
  }
@@ -442,7 +555,7 @@ declare const AGENT_ERROR_MESSAGES: Record<AgentErrorKind, string>;
442
555
  * Invariant: state lives on signals; `events$` carries only things that are
443
556
  * not derivable from signals.
444
557
  */
445
- interface Agent<TState = Record<string, unknown>> {
558
+ interface Agent<TState = unknown> {
446
559
  messages: Signal<Message[]>;
447
560
  status: Signal<AgentStatus>;
448
561
  isLoading: Signal<boolean>;
@@ -525,7 +638,7 @@ interface AgentCheckpoint {
525
638
  * implement this. Pure request/response runtimes that don't have checkpoints
526
639
  * should implement plain Agent.
527
640
  */
528
- interface AgentWithHistory<TState = Record<string, unknown>> extends Agent<TState> {
641
+ interface AgentWithHistory<TState = unknown> extends Agent<TState> {
529
642
  history: Signal<AgentCheckpoint[]>;
530
643
  /**
531
644
  * Optional reactive map of `messageId → checkpointId`, computed by
@@ -587,7 +700,7 @@ declare class MessageTemplateDirective {
587
700
  */
588
701
  declare function getMessageType(message: Message): MessageTemplateType;
589
702
  declare class ChatMessageListComponent {
590
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
703
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
591
704
  readonly messageTemplates: _angular_core.Signal<readonly MessageTemplateDirective[]>;
592
705
  readonly messages: _angular_core.Signal<Message[]>;
593
706
  readonly getMessageType: typeof getMessageType;
@@ -675,17 +788,19 @@ declare class ChatTraceComponent {
675
788
  * step labels often appear in reasoning output).
676
789
  *
677
790
  * Internal state: a tristate "expanded" — null means follow auto state-
678
- * driven logic (force-expand on isStreaming, otherwise honor
791
+ * driven logic (force-expand while delivery is streaming, otherwise honor
679
792
  * defaultExpanded), boolean is a manual user choice that wins for the
680
793
  * lifetime of the instance.
681
794
  */
682
795
  declare class ChatReasoningComponent {
683
796
  readonly content: _angular_core.InputSignal<string>;
684
- readonly isStreaming: _angular_core.InputSignal<boolean>;
797
+ readonly delivery: _angular_core.InputSignal<MessageDelivery>;
685
798
  readonly durationMs: _angular_core.InputSignal<number | undefined>;
686
799
  readonly label: _angular_core.InputSignal<string | undefined>;
687
800
  readonly defaultExpanded: _angular_core.InputSignal<boolean>;
688
801
  readonly hasContent: _angular_core.Signal<boolean>;
802
+ readonly isStreaming: _angular_core.Signal<boolean>;
803
+ readonly document: _angular_core.Signal<_threadplane_chat.StreamingMarkdownDocument>;
689
804
  /** null = follow auto logic (streaming → expanded, else defaultExpanded). */
690
805
  private readonly _expandedOverride;
691
806
  readonly expanded: _angular_core.Signal<boolean>;
@@ -694,7 +809,7 @@ declare class ChatReasoningComponent {
694
809
  constructor();
695
810
  toggle(): void;
696
811
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatReasoningComponent, never>;
697
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatReasoningComponent, "chat-reasoning", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "isStreaming": { "alias": "isStreaming"; "required": false; "isSignal": true; }; "durationMs": { "alias": "durationMs"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "defaultExpanded": { "alias": "defaultExpanded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
812
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatReasoningComponent, "chat-reasoning", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "delivery": { "alias": "delivery"; "required": true; "isSignal": true; }; "durationMs": { "alias": "durationMs"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "defaultExpanded": { "alias": "defaultExpanded"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
698
813
  }
699
814
 
700
815
  declare class ChatLauncherButtonComponent {
@@ -722,7 +837,7 @@ declare class ChatSuggestionsComponent {
722
837
  */
723
838
  declare function submitMessage(agent: Agent, text: string): string | null;
724
839
  declare class ChatInputComponent {
725
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
840
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
726
841
  readonly submitOnEnter: _angular_core.InputSignal<boolean>;
727
842
  readonly placeholder: _angular_core.InputSignal<string>;
728
843
  /** When true (default), shows a stop button while the agent is streaming. */
@@ -774,7 +889,7 @@ declare class ChatInputComponent {
774
889
  */
775
890
  declare function isTyping(agent: Agent): boolean;
776
891
  declare class ChatTypingIndicatorComponent {
777
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
892
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
778
893
  readonly visible: _angular_core.Signal<boolean>;
779
894
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatTypingIndicatorComponent, never>;
780
895
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatTypingIndicatorComponent, "chat-typing-indicator", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
@@ -883,7 +998,7 @@ declare class ChatScrollBubbleComponent {
883
998
  */
884
999
  declare function extractErrorMessage(error: unknown): string | null;
885
1000
  declare class ChatErrorComponent {
886
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1001
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
887
1002
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatErrorComponent, never>;
888
1003
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatErrorComponent, "chat-error", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
889
1004
  }
@@ -902,7 +1017,7 @@ declare class ChatErrorComponent {
902
1017
  */
903
1018
  declare function getInterrupt(agent: Agent): AgentInterrupt | undefined;
904
1019
  declare class ChatInterruptComponent {
905
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1020
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
906
1021
  readonly templateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
907
1022
  readonly interrupt: _angular_core.Signal<AgentInterrupt | undefined>;
908
1023
  defaultText(i: AgentInterrupt): string;
@@ -973,7 +1088,7 @@ interface Group {
973
1088
  subagent?: Subagent;
974
1089
  }
975
1090
  declare class ChatToolCallsComponent {
976
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1091
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
977
1092
  readonly message: _angular_core.InputSignal<Message | undefined>;
978
1093
  readonly grouping: _angular_core.InputSignal<"auto" | "none">;
979
1094
  readonly groupSummary: _angular_core.InputSignal<((name: string, count: number) => string) | undefined>;
@@ -1012,7 +1127,7 @@ declare class ChatToolCallsComponent {
1012
1127
  * (and a `status` a component chooses not to declare) are harmless.
1013
1128
  */
1014
1129
  declare class ChatToolViewsComponent {
1015
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1130
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
1016
1131
  readonly events: _angular_core.OutputEmitterRef<RenderEvent>;
1017
1132
  readonly message: _angular_core.InputSignal<Message | undefined>;
1018
1133
  readonly views: _angular_core.InputSignal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>> | undefined>;
@@ -1029,7 +1144,7 @@ declare class ChatToolViewsComponent {
1029
1144
  }
1030
1145
 
1031
1146
  declare class ChatSubagentsComponent {
1032
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1147
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
1033
1148
  readonly templateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
1034
1149
  readonly activeSubagents: _angular_core.Signal<Subagent[]>;
1035
1150
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatSubagentsComponent, never>;
@@ -1235,7 +1350,7 @@ declare class ChatGenuiSkeletonComponent {
1235
1350
  }
1236
1351
 
1237
1352
  declare class ChatTimelineComponent {
1238
- readonly agent: _angular_core.InputSignal<AgentWithHistory<Record<string, unknown>>>;
1353
+ readonly agent: _angular_core.InputSignal<AgentWithHistory<unknown>>;
1239
1354
  readonly checkpointSelected: _angular_core.OutputEmitterRef<AgentCheckpoint>;
1240
1355
  readonly templateRef: _angular_core.Signal<TemplateRef<any> | undefined>;
1241
1356
  readonly history: _angular_core.Signal<AgentCheckpoint[]>;
@@ -1404,6 +1519,53 @@ declare class ChatConnectedOverlayDirective {
1404
1519
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ChatConnectedOverlayDirective, "[chatConnectedOverlay]", never, { "origin": { "alias": "chatOverlayOrigin"; "required": true; "isSignal": true; }; "open": { "alias": "chatOverlayOpen"; "required": false; "isSignal": true; }; "positions": { "alias": "chatOverlayPositions"; "required": false; "isSignal": true; }; "panelClass": { "alias": "chatOverlayPanelClass"; "required": false; "isSignal": true; }; }, { "attached": "chatOverlayAttached"; "outsideClick": "chatOverlayOutsideClick"; "detached": "chatOverlayDetach"; }, never, never, true, never>;
1405
1520
  }
1406
1521
 
1522
+ type CitationTypeIcon = 'web' | 'file' | 'app' | 'memory' | 'generic';
1523
+ interface CitationTypeMeta {
1524
+ type: string;
1525
+ label: string | null;
1526
+ icon: CitationTypeIcon;
1527
+ tone: CitationTypeIcon;
1528
+ isKnown: boolean;
1529
+ }
1530
+ interface CitationImageVisual {
1531
+ kind: 'image';
1532
+ iconUrl: string;
1533
+ }
1534
+ interface CitationTypeIconVisual {
1535
+ kind: 'type-icon';
1536
+ icon: CitationTypeIcon;
1537
+ tone: CitationTypeIcon;
1538
+ label: string | null;
1539
+ }
1540
+ interface CitationMonogramVisual {
1541
+ kind: 'monogram';
1542
+ monogram: string;
1543
+ color: string;
1544
+ }
1545
+ type CitationSourceVisual = CitationImageVisual | CitationTypeIconVisual | CitationMonogramVisual;
1546
+ /** Hostname of `url` with a leading `www.` removed; null if absent/malformed. */
1547
+ declare function deriveDomain(url?: string): string | null;
1548
+ /** Explicit `sourceType`, else 'web' inferred from a url, else 'unknown'. */
1549
+ declare function deriveSourceType(c: Citation): string;
1550
+ /** Uppercased first letter of the domain (or title) for the monogram chip. */
1551
+ declare function deriveMonogram(c: Citation): string;
1552
+ /** Deterministic hue in [0,360) from a seed string (stable monogram color). */
1553
+ declare function monogramHue(seed: string): number;
1554
+ /** Short freshness label (e.g. "Apr 2024"); null when absent or unparseable. */
1555
+ declare function formatPublished(value?: string | number | Date): string | null;
1556
+ /** Deterministic monogram-chip background color (stable per source). */
1557
+ declare function monogramColor(c: Citation): string;
1558
+ /**
1559
+ * Derive normalized source-type metadata for badges, icons, and tone tokens.
1560
+ */
1561
+ declare function citationTypeMeta(c: Citation): CitationTypeMeta;
1562
+ /**
1563
+ * Choose the visual source marker for a citation: provider image, type icon, or monogram.
1564
+ */
1565
+ declare function citationSourceVisual(c: Citation): CitationSourceVisual;
1566
+ /** Human label for the source-type badge; null when type is 'unknown'. */
1567
+ declare function citationTypeLabel(c: Citation): string | null;
1568
+
1407
1569
  /**
1408
1570
  * ContentChild template directive for custom citation card rendering.
1409
1571
  * Usage: <ng-template chatCitationCard let-citation>...</ng-template>
@@ -1415,37 +1577,79 @@ declare class ChatCitationCardTemplateDirective {
1415
1577
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatCitationCardTemplateDirective, never>;
1416
1578
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ChatCitationCardTemplateDirective, "ng-template[chatCitationCard]", never, {}, {}, never, never, true, never>;
1417
1579
  }
1580
+ interface FavEntry {
1581
+ id: string;
1582
+ kind: 'image' | 'type-icon' | 'monogram';
1583
+ iconUrl?: string;
1584
+ icon?: CitationTypeIcon;
1585
+ tone?: CitationTypeIcon;
1586
+ monogram?: string;
1587
+ color?: string;
1588
+ }
1418
1589
  declare class ChatCitationsComponent {
1419
1590
  readonly message: _angular_core.InputSignal<Message>;
1420
1591
  readonly heading: _angular_core.InputSignal<string>;
1592
+ protected readonly expanded: _angular_core.WritableSignal<boolean>;
1593
+ protected readonly listId: string;
1421
1594
  cardTpl: ChatCitationCardTemplateDirective | null;
1422
- /**
1423
- * Optional resolver — present when chat-citations is rendered inside a
1424
- * chat-message that provides CitationsResolverService (the standard
1425
- * placement). When absent, the panel reads only Message.citations.
1426
- */
1427
1595
  private readonly resolver;
1428
1596
  /**
1429
1597
  * Combined citation list:
1430
1598
  * 1. Message.citations (provider-populated, takes precedence by id)
1431
- * 2. Markdown sidecar defs (Pandoc-formatted [^id]: lines), merged in
1432
- * for any id not already present.
1433
- *
1434
- * Sorted by index ascending. This guarantees the sources panel surfaces
1435
- * citations whether they come from message metadata, content syntax, or
1436
- * both — matching the same precedence as inline-marker resolution.
1599
+ * 2. Markdown sidecar defs (Pandoc [^id]: lines), merged for unseen ids.
1600
+ * Sorted by index ascending.
1437
1601
  */
1438
1602
  protected readonly citations: _angular_core.Signal<Citation[]>;
1603
+ /** First 3 sources, mapped to favicon/monogram chips for the header preview. */
1604
+ protected readonly favstack: _angular_core.Signal<FavEntry[]>;
1439
1605
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatCitationsComponent, never>;
1440
1606
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatCitationsComponent, "chat-citations", never, { "message": { "alias": "message"; "required": true; "isSignal": true; }; "heading": { "alias": "heading"; "required": false; "isSignal": true; }; }, {}, ["cardTpl"], never, true, never>;
1441
1607
  }
1442
1608
 
1609
+ /**
1610
+ * Sources-panel detail card: index badge, favicon/monogram + domain + type,
1611
+ * title, one-line snippet. Renders as an <a> (opens the source) when a url is
1612
+ * present, otherwise a non-interactive <div>. Shares the panel style module.
1613
+ */
1443
1614
  declare class ChatCitationsCardComponent {
1444
1615
  readonly citation: _angular_core.InputSignal<Citation>;
1616
+ private readonly sourceVisual;
1617
+ private readonly typeMeta;
1618
+ protected readonly domain: _angular_core.Signal<string | null>;
1619
+ protected readonly title: _angular_core.Signal<string | null>;
1620
+ protected readonly sourceIconUrl: _angular_core.Signal<string | null>;
1621
+ protected readonly sourceIcon: _angular_core.Signal<CitationTypeIcon | null>;
1622
+ protected readonly sourceMonogram: _angular_core.Signal<string | null>;
1623
+ protected readonly sourceMonoColor: _angular_core.Signal<string | null>;
1624
+ protected readonly typeLabel: _angular_core.Signal<string | null>;
1625
+ protected readonly typeTone: _angular_core.Signal<CitationTypeIcon>;
1626
+ protected isTypeTone(tone: CitationTypeIcon): boolean;
1445
1627
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatCitationsCardComponent, never>;
1446
1628
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatCitationsCardComponent, "chat-citations-card", never, { "citation": { "alias": "citation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
1447
1629
  }
1448
1630
 
1631
+ /**
1632
+ * Presentational provenance card for a single Citation. Rendered inside the
1633
+ * inline marker's connected-overlay pane (hover/tap preview) — self-contained
1634
+ * so its encapsulated styles apply even when portaled to the body-level pane.
1635
+ */
1636
+ declare class ChatCitationPreviewComponent {
1637
+ readonly citation: _angular_core.InputSignal<Citation>;
1638
+ private readonly sourceVisual;
1639
+ private readonly typeMeta;
1640
+ protected readonly domain: _angular_core.Signal<string | null>;
1641
+ protected readonly sourceIconUrl: _angular_core.Signal<string | null>;
1642
+ protected readonly sourceIcon: _angular_core.Signal<CitationTypeIcon | null>;
1643
+ protected readonly sourceMonogram: _angular_core.Signal<string | null>;
1644
+ protected readonly sourceMonoColor: _angular_core.Signal<string | null>;
1645
+ protected readonly typeLabel: _angular_core.Signal<string | null>;
1646
+ protected readonly typeTone: _angular_core.Signal<CitationTypeIcon>;
1647
+ protected readonly published: _angular_core.Signal<string | null>;
1648
+ protected isTypeTone(tone: CitationTypeIcon): boolean;
1649
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatCitationPreviewComponent, never>;
1650
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatCitationPreviewComponent, "chat-citation-preview", never, { "citation": { "alias": "citation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
1651
+ }
1652
+
1449
1653
  interface ThreadRoutingConfig {
1450
1654
  /** The app-owned source-of-truth signal for the active thread id. */
1451
1655
  threadId: WritableSignal<string | null>;
@@ -1487,6 +1691,76 @@ interface ChatLifecycle {
1487
1691
  }
1488
1692
  declare const CHAT_LIFECYCLE: InjectionToken<ChatLifecycle>;
1489
1693
 
1694
+ /** Durable identity for one client-tool execution on one thread. */
1695
+ interface ClientToolExecutionKey {
1696
+ readonly threadId: string;
1697
+ readonly toolCallId: string;
1698
+ }
1699
+ /** Prior durable execution state returned by a client-tool execution store. */
1700
+ type ClientToolExecutionRecord = {
1701
+ readonly status: 'executing';
1702
+ } | {
1703
+ readonly status: 'done';
1704
+ readonly result: ClientToolResult;
1705
+ } | {
1706
+ readonly status: 'failed';
1707
+ readonly result?: ClientToolResult;
1708
+ };
1709
+ /** Structural store contract for guarded browser client-tool execution. */
1710
+ interface ClientToolExecutionStore {
1711
+ /** Atomically claim a tool-call execution. Returns prior state when present. */
1712
+ claim(key: ClientToolExecutionKey): Promise<'claimed' | ClientToolExecutionRecord>;
1713
+ /** Record the final client-tool result for a claimed execution. */
1714
+ record(key: ClientToolExecutionKey, result: ClientToolResult): Promise<void>;
1715
+ /** Lookup prior execution states for pending tool calls on a thread. */
1716
+ lookup(threadId: string, toolCallIds: readonly string[]): Promise<Record<string, ClientToolExecutionRecord>>;
1717
+ }
1718
+ /** Opt-in guard configuration for claim-before-execute client tools. */
1719
+ interface ClientToolExecutionGuard {
1720
+ readonly threadId: string;
1721
+ readonly store: ClientToolExecutionStore;
1722
+ }
1723
+ /** Return whether this function tool should claim before browser execution. */
1724
+ declare function shouldClaimBeforeExecute(def: AnyFunctionToolDef): boolean;
1725
+ /** Default fail-closed result for a stale in-progress client-tool execution. */
1726
+ declare function defaultInterruptedClientToolResult(toolCallId: string): ClientToolResult;
1727
+ /** Result recorded when the user stops a run while a client tool is running. */
1728
+ declare function cancelledClientToolResult(toolCallId: string): ClientToolResult;
1729
+ /** Default fail-closed result when the execution guard itself cannot be reached. */
1730
+ declare function clientToolGuardFailureResult(toolCallId: string, error: unknown): ClientToolResult;
1731
+
1732
+ interface StreamingMarkdownDocument {
1733
+ readonly generation: string;
1734
+ readonly phase: 'streaming' | 'complete';
1735
+ readonly content: string;
1736
+ }
1737
+ /** Creates the atomic document consumed by the streaming Markdown renderer. */
1738
+ declare function markdownDocument(content: string, delivery: MessageDelivery, suffix?: string): StreamingMarkdownDocument;
1739
+ type StreamingMarkdownContractViolationPolicy = 'throw' | 'rebuild';
1740
+ declare const STREAMING_MARKDOWN_CONTRACT_VIOLATION_POLICY: InjectionToken<StreamingMarkdownContractViolationPolicy>;
1741
+ /**
1742
+ * Renders one explicitly-versioned markdown document through the shared view
1743
+ * registry. A generation owns one parser session; append-only updates preserve
1744
+ * parser and subtree identity, while generation changes replace the session.
1745
+ */
1746
+ declare class ChatStreamingMdComponent {
1747
+ readonly document: _angular_core.InputSignal<StreamingMarkdownDocument>;
1748
+ readonly viewRegistry: _angular_core.InputSignal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>> | undefined>;
1749
+ readonly resolvedRegistry: _angular_core.Signal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>>>;
1750
+ private readonly resolver;
1751
+ private readonly violationPolicy;
1752
+ private readonly createParser;
1753
+ private parser;
1754
+ private prior;
1755
+ private materializedRoot;
1756
+ readonly root: _angular_core.Signal<MarkdownDocumentNode | null>;
1757
+ constructor();
1758
+ private process;
1759
+ private replaceFrom;
1760
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatStreamingMdComponent, never>;
1761
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatStreamingMdComponent, "chat-streaming-md", never, { "document": { "alias": "document"; "required": true; "isSignal": true; }; "viewRegistry": { "alias": "viewRegistry"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
1762
+ }
1763
+
1490
1764
  interface ElementAccumulationState {
1491
1765
  hasType: boolean;
1492
1766
  hasProps: boolean;
@@ -1629,7 +1903,7 @@ interface ChatRenderEvent {
1629
1903
  }
1630
1904
 
1631
1905
  declare class ChatComponent {
1632
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
1906
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
1633
1907
  readonly views: _angular_core.InputSignal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>> | undefined>;
1634
1908
  /**
1635
1909
  * Client-declared tools (`view`/`ask`/`function`) the model may call. When
@@ -1670,9 +1944,12 @@ declare class ChatComponent {
1670
1944
  * Default covers the canonical A2UI + json-render schema tools.
1671
1945
  */
1672
1946
  readonly genuiToolNames: _angular_core.InputSignal<readonly string[]>;
1947
+ readonly clientToolExecutionGuard: _angular_core.InputSignal<ClientToolExecutionGuard | undefined>;
1948
+ readonly clientToolContinuationPolicy: _angular_core.InputSignal<ClientToolContinuationPolicy | undefined>;
1673
1949
  readonly showWelcome: _angular_core.Signal<boolean>;
1674
1950
  readonly threadSelected: _angular_core.OutputEmitterRef<string>;
1675
1951
  readonly renderEvent: _angular_core.OutputEmitterRef<ChatRenderEvent>;
1952
+ readonly clientToolContinuationLimit: _angular_core.OutputEmitterRef<ClientToolContinuationLimitEvent>;
1676
1953
  /** Emitted when the user clicks the regenerate button on an assistant message. */
1677
1954
  readonly regenerate: _angular_core.OutputEmitterRef<void>;
1678
1955
  /** Emitted when the user rates an assistant message. */
@@ -1727,13 +2004,6 @@ declare class ChatComponent {
1727
2004
  * back to the original text.
1728
2005
  */
1729
2006
  protected humanContent(message: unknown): string;
1730
- /**
1731
- * True while a message's reasoning is mid-stream — i.e. it's the latest
1732
- * message, the agent is loading, the message has reasoning content, and
1733
- * no response text has arrived yet. Once the response text begins, the
1734
- * reasoning pill collapses (per its internal logic).
1735
- */
1736
- protected isReasoningStreaming(message: Message, index: number): boolean;
1737
2007
  /** The nearest preceding assistant message (skipping hidden tool messages), or undefined. */
1738
2008
  private prevAssistant;
1739
2009
  /**
@@ -1744,17 +2014,19 @@ declare class ChatComponent {
1744
2014
  protected reasoningRunStart(index: number): boolean;
1745
2015
  /**
1746
2016
  * Aggregate the reasoning RUN starting at `index`: joins each step's
1747
- * reasoning, sums durations, counts steps, and computes the streaming flag
1748
- * and the merged label when N > 1 ("Thought for {total} · {N} steps", or
1749
- * just "{N} steps" when no step reported timing).
2017
+ * reasoning, sums durations, counts steps, and returns the last step's
2018
+ * delivery because that step owns the current aggregate snapshot. Also
2019
+ * computes the merged label when N > 1 ("Thought for {total} · {N} steps",
2020
+ * or just "{N} steps" when no step reported timing).
1750
2021
  */
1751
2022
  protected reasoningRun(index: number): {
1752
2023
  content: string;
1753
2024
  durationMs: number | undefined;
1754
- streaming: boolean;
2025
+ delivery: MessageDelivery;
1755
2026
  label: string | undefined;
1756
2027
  };
1757
2028
  private readonly classifiers;
2029
+ private readonly markdownDocuments;
1758
2030
  private readonly destroyRef;
1759
2031
  private readonly injector;
1760
2032
  private readonly lifecycle;
@@ -1775,15 +2047,13 @@ declare class ChatComponent {
1775
2047
  private programmaticScrollCount;
1776
2048
  private static readonly PIN_TOLERANCE_PX;
1777
2049
  /**
1778
- * True iff there's a current (last-index) assistant message that's
1779
- * still streaming. The bubble's own caret already signals loading;
2050
+ * True iff the current (last-index) assistant message owns an active
2051
+ * delivery generation. The bubble's own caret already signals loading;
1780
2052
  * we suppress the floor typing-indicator in that case so the user
1781
2053
  * doesn't see two loading affordances at once.
1782
2054
  *
1783
2055
  * Matches the same `streaming + current` condition the bubble uses
1784
- * to enable `.chat-message__caret`:
1785
- * `agent().isLoading() && i === agent().messages().length - 1`
1786
- * `i === agent().messages().length - 1`
2056
+ * to enable `.chat-message__caret`.
1787
2057
  *
1788
2058
  * Restricted to assistant role because the caret only renders on
1789
2059
  * assistant bubbles (`:host([data-role="assistant"][data-current=...
@@ -1833,9 +2103,8 @@ declare class ChatComponent {
1833
2103
  * unlike a single prev-message check.
1834
2104
  */
1835
2105
  protected isGenuiTurn(message: unknown, _prevMsg: unknown, index?: number): boolean;
1836
- classifyMessage(content: string, message: {
1837
- id?: string;
1838
- }): ContentClassifier;
2106
+ classifyMessage(content: string, message: Pick<Message, 'id' | 'delivery'>): ContentClassifier;
2107
+ protected markdownDocumentFor(content: string, message: Pick<Message, 'id' | 'delivery'>): StreamingMarkdownDocument;
1839
2108
  clearClassifiers(): void;
1840
2109
  onSpecEvent(event: RenderEvent, messageIndex: number): void;
1841
2110
  /**
@@ -1852,11 +2121,11 @@ declare class ChatComponent {
1852
2121
  onRate(message: unknown, value: 'up' | 'down'): void;
1853
2122
  onCopy(message: unknown, content: string): void;
1854
2123
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatComponent, never>;
1855
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatComponent, "chat", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; "views": { "alias": "views"; "required": false; "isSignal": true; }; "clientTools": { "alias": "clientTools"; "required": false; "isSignal": true; }; "store": { "alias": "store"; "required": false; "isSignal": true; }; "handlers": { "alias": "handlers"; "required": false; "isSignal": true; }; "threads": { "alias": "threads"; "required": false; "isSignal": true; }; "activeThreadId": { "alias": "activeThreadId"; "required": false; "isSignal": true; }; "welcomeDisabled": { "alias": "welcomeDisabled"; "required": false; "isSignal": true; }; "modelOptions": { "alias": "modelOptions"; "required": false; "isSignal": true; }; "showModelPicker": { "alias": "showModelPicker"; "required": false; "isSignal": true; }; "selectedModel": { "alias": "selectedModel"; "required": false; "isSignal": true; }; "modelPickerPlaceholder": { "alias": "modelPickerPlaceholder"; "required": false; "isSignal": true; }; "genuiToolNames": { "alias": "genuiToolNames"; "required": false; "isSignal": true; }; }, { "selectedModel": "selectedModelChange"; "threadSelected": "threadSelected"; "renderEvent": "renderEvent"; "regenerate": "regenerate"; "rate": "rate"; "messageCopy": "messageCopy"; }, never, ["[chatWelcomeSuggestions]", "[chatHeader]", "[chatToolCallTemplate]", "[chatInputModelSelect]"], true, never>;
2124
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatComponent, "chat", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; "views": { "alias": "views"; "required": false; "isSignal": true; }; "clientTools": { "alias": "clientTools"; "required": false; "isSignal": true; }; "store": { "alias": "store"; "required": false; "isSignal": true; }; "handlers": { "alias": "handlers"; "required": false; "isSignal": true; }; "threads": { "alias": "threads"; "required": false; "isSignal": true; }; "activeThreadId": { "alias": "activeThreadId"; "required": false; "isSignal": true; }; "welcomeDisabled": { "alias": "welcomeDisabled"; "required": false; "isSignal": true; }; "modelOptions": { "alias": "modelOptions"; "required": false; "isSignal": true; }; "showModelPicker": { "alias": "showModelPicker"; "required": false; "isSignal": true; }; "selectedModel": { "alias": "selectedModel"; "required": false; "isSignal": true; }; "modelPickerPlaceholder": { "alias": "modelPickerPlaceholder"; "required": false; "isSignal": true; }; "genuiToolNames": { "alias": "genuiToolNames"; "required": false; "isSignal": true; }; "clientToolExecutionGuard": { "alias": "clientToolExecutionGuard"; "required": false; "isSignal": true; }; "clientToolContinuationPolicy": { "alias": "clientToolContinuationPolicy"; "required": false; "isSignal": true; }; }, { "selectedModel": "selectedModelChange"; "threadSelected": "threadSelected"; "renderEvent": "renderEvent"; "clientToolContinuationLimit": "clientToolContinuationLimit"; "regenerate": "regenerate"; "rate": "rate"; "messageCopy": "messageCopy"; }, never, ["[chatWelcomeSuggestions]", "[chatHeader]", "[chatToolCallTemplate]", "[chatInputModelSelect]"], true, never>;
1856
2125
  }
1857
2126
 
1858
2127
  declare class ChatPopupComponent {
1859
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
2128
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
1860
2129
  /** A2UI component catalog forwarded to the inner <chat>. Without it,
1861
2130
  * messages classified as A2UI parse correctly but never mount a
1862
2131
  * surface. Pass `a2uiBasicCatalog()` from `@threadplane/chat`. */
@@ -1896,7 +2165,7 @@ declare class ChatPopupComponent {
1896
2165
  }
1897
2166
 
1898
2167
  declare class ChatSidebarComponent {
1899
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
2168
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
1900
2169
  /** A2UI component catalog forwarded to the inner <chat>. Without it,
1901
2170
  * messages classified as A2UI parse correctly but never mount a
1902
2171
  * surface. Pass `a2uiBasicCatalog()` from `@threadplane/chat`. */
@@ -1930,7 +2199,7 @@ declare class ChatSidebarComponent {
1930
2199
  }
1931
2200
 
1932
2201
  declare class ChatTimelineSliderComponent {
1933
- readonly agent: _angular_core.InputSignal<AgentWithHistory<Record<string, unknown>>>;
2202
+ readonly agent: _angular_core.InputSignal<AgentWithHistory<unknown>>;
1934
2203
  readonly selectedIndex: _angular_core.WritableSignal<number>;
1935
2204
  readonly history: _angular_core.Signal<AgentCheckpoint[]>;
1936
2205
  readonly replayRequested: _angular_core.OutputEmitterRef<string>;
@@ -1952,7 +2221,7 @@ declare class ChatSidenavComponent {
1952
2221
  readonly projects: _angular_core.InputSignal<Project[] | null>;
1953
2222
  readonly selectedProjectId: _angular_core.InputSignal<string | null>;
1954
2223
  readonly projectActions: _angular_core.InputSignal<ProjectActionAdapter | null>;
1955
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>> | AgentWithHistory<Record<string, unknown>> | null>;
2224
+ readonly agent: _angular_core.InputSignal<Agent<unknown> | AgentWithHistory<unknown> | null>;
1956
2225
  readonly debug: _angular_core.InputSignal<boolean>;
1957
2226
  readonly newChat: _angular_core.OutputEmitterRef<void>;
1958
2227
  readonly threadSelected: _angular_core.OutputEmitterRef<string>;
@@ -2003,7 +2272,7 @@ declare class ChatSidenavScrimComponent {
2003
2272
 
2004
2273
  type InterruptAction = 'accept' | 'edit' | 'respond' | 'ignore';
2005
2274
  declare class ChatInterruptPanelComponent {
2006
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
2275
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
2007
2276
  readonly action: _angular_core.OutputEmitterRef<InterruptAction>;
2008
2277
  readonly interrupt: _angular_core.Signal<AgentInterrupt | undefined>;
2009
2278
  readonly interruptReason: _angular_core.Signal<string>;
@@ -2013,7 +2282,7 @@ declare class ChatInterruptPanelComponent {
2013
2282
 
2014
2283
  type ChatApprovalAction = 'approve' | 'edit' | 'cancel';
2015
2284
  declare class ChatApprovalCardComponent {
2016
- readonly agent: _angular_core.InputSignal<Agent<Record<string, unknown>>>;
2285
+ readonly agent: _angular_core.InputSignal<Agent<unknown>>;
2017
2286
  readonly matchKind: _angular_core.InputSignal<string | undefined>;
2018
2287
  readonly title: _angular_core.InputSignal<string>;
2019
2288
  readonly showEdit: _angular_core.InputSignal<boolean>;
@@ -2043,6 +2312,9 @@ declare function statusColor(status: SubagentStatus): string;
2043
2312
  declare class ChatSubagentCardComponent {
2044
2313
  readonly subagent: _angular_core.InputSignal<Subagent>;
2045
2314
  readonly state: _angular_core.Signal<TraceState>;
2315
+ private readonly markdownDocuments;
2316
+ constructor();
2317
+ protected markdownDocumentFor(content: string, message: Message): StreamingMarkdownDocument;
2046
2318
  protected textOf(m: Message): string;
2047
2319
  protected toolCallsFor(m: Message): ToolCall[];
2048
2320
  protected toToolCallInfo(tc: ToolCall): ToolCallInfo;
@@ -2062,39 +2334,6 @@ declare class CitationsResolverService {
2062
2334
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<CitationsResolverService>;
2063
2335
  }
2064
2336
 
2065
- /**
2066
- * Renders streaming markdown by walking a @cacheplane/partial-markdown AST
2067
- * through @threadplane/render's view registry.
2068
- *
2069
- * Reactivity model: the live `parser.root` keeps a stable JS reference
2070
- * across pushes (partial-markdown's identity guarantee). To make Angular
2071
- * signals propagate downstream when the underlying tree changes, we surface
2072
- * a materialized snapshot via `materialize()`. The snapshot shares
2073
- * structurally — unchanged subtrees keep the SAME reference, and any
2074
- * descendant change yields a NEW root reference. This lets Angular's
2075
- * `Object.is` equality check both detect changes (root reference differs)
2076
- * and short-circuit unchanged subtrees (per-node references stable).
2077
- *
2078
- * Override per-node-type renderers via the `[viewRegistry]` input or by
2079
- * supplying a different `MARKDOWN_VIEW_REGISTRY` provider in the injector
2080
- * tree.
2081
- */
2082
- declare class ChatStreamingMdComponent {
2083
- readonly content: _angular_core.InputSignal<string>;
2084
- readonly streaming: _angular_core.InputSignal<boolean>;
2085
- readonly viewRegistry: _angular_core.InputSignal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>> | undefined>;
2086
- readonly resolvedRegistry: _angular_core.Signal<Readonly<Record<string, _angular_core.Type<unknown> | _threadplane_render.RenderViewEntry>>>;
2087
- private readonly resolver;
2088
- constructor();
2089
- private parser;
2090
- private prior;
2091
- private finished;
2092
- private readonly finalizeTick;
2093
- readonly root: _angular_core.Signal<MarkdownDocumentNode | null>;
2094
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChatStreamingMdComponent, never>;
2095
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChatStreamingMdComponent, "chat-streaming-md", never, { "content": { "alias": "content"; "required": false; "isSignal": true; }; "streaming": { "alias": "streaming"; "required": false; "isSignal": true; }; "viewRegistry": { "alias": "viewRegistry"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
2096
- }
2097
-
2098
2337
  /**
2099
2338
  * DI token for the markdown view registry consumed by <chat-streaming-md>
2100
2339
  * and <md-children>. Maps MarkdownNode.type strings (e.g. "paragraph",
@@ -2274,10 +2513,41 @@ declare class MarkdownHardBreakComponent {
2274
2513
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownHardBreakComponent, "chat-md-hard-break", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
2275
2514
  }
2276
2515
 
2516
+ /**
2517
+ * Inline citation marker. Renders a numbered pill and reveals a provenance
2518
+ * preview card (portaled via the connected-overlay primitive) on hover/focus
2519
+ * (desktop) or tap (touch). Click navigates on desktop when a url exists;
2520
+ * on touch it previews instead of navigating.
2521
+ */
2277
2522
  declare class MarkdownCitationReferenceComponent {
2278
2523
  readonly node: _angular_core.InputSignal<MarkdownCitationReferenceNode>;
2279
2524
  private readonly resolver;
2525
+ private readonly document;
2280
2526
  protected readonly resolved: _angular_core.Signal<_threadplane_chat.ResolvedCitation | null>;
2527
+ protected readonly open: _angular_core.WritableSignal<boolean>;
2528
+ protected readonly positions: ConnectedPosition[];
2529
+ /** Read fresh each time: SSR renders with no window, and hybrid devices change. */
2530
+ private get hoverCapable();
2531
+ private openTimer;
2532
+ private closeTimer;
2533
+ private pane;
2534
+ private justOpenedByFocus;
2535
+ constructor();
2536
+ protected ariaLabel(c: Citation): string;
2537
+ protected onEnter(): void;
2538
+ protected onLeave(): void;
2539
+ protected onFocus(): void;
2540
+ protected onBlur(): void;
2541
+ protected onClick(e: MouseEvent, c: Citation): void;
2542
+ protected onKeydown(e: KeyboardEvent, c: Citation): void;
2543
+ protected onAttached(pane: HTMLElement): void;
2544
+ protected close(): void;
2545
+ private readonly onPaneEnter;
2546
+ private readonly onPaneLeave;
2547
+ private scheduleClose;
2548
+ private cancelOpen;
2549
+ private cancelClose;
2550
+ private clearTimers;
2281
2551
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<MarkdownCitationReferenceComponent, never>;
2282
2552
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<MarkdownCitationReferenceComponent, "chat-md-citation-reference", never, { "node": { "alias": "node"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
2283
2553
  }
@@ -2874,8 +3144,11 @@ type ViewProps<S extends StandardSchemaV1> = Prettify<StandardSchemaInferOutput<
2874
3144
  * @param description Natural-language description the model sees.
2875
3145
  * @param schema Standard Schema (e.g. a Zod object) for the arguments; the
2876
3146
  * handler's argument type is inferred from it.
2877
- * @param handler Runs in the browser when the model calls the tool; its return
2878
- * type `R` is carried on the resulting {@link FunctionToolDef}.
3147
+ * @param handler Runs in the browser when the model calls the tool. The second
3148
+ * argument carries an `AbortSignal`; its return type `R` is carried on the
3149
+ * resulting {@link FunctionToolDef}.
3150
+ * @param options Execution policy options, including `idempotent: true` to skip
3151
+ * durable pre-execution claims when a guard is configured.
2879
3152
  * @returns A {@link FunctionToolDef} for inclusion in {@link tools}.
2880
3153
  * @example
2881
3154
  * ```ts
@@ -2883,7 +3156,7 @@ type ViewProps<S extends StandardSchemaV1> = Prettify<StandardSchemaInferOutput<
2883
3156
  * const registry = tools({ move_stop: move });
2884
3157
  * ```
2885
3158
  */
2886
- declare function action<S extends StandardSchemaV1, R>(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>) => R | Promise<R>): FunctionToolDef<S, R>;
3159
+ declare function action<S extends StandardSchemaV1, R>(description: string, schema: S, handler: (args: StandardSchemaInferOutput<S>, context: FunctionToolHandlerContext) => R | Promise<R>, options?: ClientToolExecutionOptions): FunctionToolDef<S, R>;
2887
3160
  /**
2888
3161
  * Render-only component tool — the model fills the component's props from the
2889
3162
  * schema's output; the tool call is auto-acknowledged once the component mounts.
@@ -2914,7 +3187,7 @@ declare function action<S extends StandardSchemaV1, R>(description: string, sche
2914
3187
  * const registry = tools({ day_card: dayCard });
2915
3188
  * ```
2916
3189
  */
2917
- declare function view<S extends StandardSchemaV1, C>(description: string, schema: S, component: AcceptComponent<S, C>): ViewToolDef<S, C>;
3190
+ declare function view<S extends StandardSchemaV1, C>(description: string, schema: S, component: AcceptComponent<S, C>, options?: ClientToolContinuationOptions): ViewToolDef<S, C>;
2918
3191
  /**
2919
3192
  * Interactive (human-in-the-loop) component tool — the model fills the
2920
3193
  * component's props from the schema's output; the value the component emits
@@ -2947,7 +3220,7 @@ declare function view<S extends StandardSchemaV1, C>(description: string, schema
2947
3220
  * const registry = tools({ pick_option: choice });
2948
3221
  * ```
2949
3222
  */
2950
- declare function ask<S extends StandardSchemaV1, C>(description: string, schema: S, component: AcceptComponent<S, C>): AskToolDef<S, C>;
3223
+ declare function ask<S extends StandardSchemaV1, C>(description: string, schema: S, component: AcceptComponent<S, C>, options?: ClientToolContinuationOptions): AskToolDef<S, C>;
2951
3224
  /**
2952
3225
  * Collect named client tools into a frozen, name-keyed registry.
2953
3226
  *
@@ -2972,6 +3245,20 @@ declare function ask<S extends StandardSchemaV1, C>(description: string, schema:
2972
3245
  */
2973
3246
  declare function tools<const M extends Record<string, ClientToolDef>>(map: M): Readonly<M>;
2974
3247
 
3248
+ /** Inputs for {@link selectPendingClientToolCalls}. */
3249
+ interface SelectPendingClientToolCallsInput {
3250
+ /** Whether the agent is currently streaming a run. Pending client tools are hidden while loading. */
3251
+ isLoading: boolean;
3252
+ /** Tool calls observed from the current agent state. */
3253
+ toolCalls: readonly ToolCall[];
3254
+ /** Client-declared tool names that should be handled in the browser. */
3255
+ catalogNames: ReadonlySet<string>;
3256
+ /** Tool-call ids already resolved by the local client instance. */
3257
+ resolvedIds: ReadonlySet<string>;
3258
+ }
3259
+ /** Select client tool calls that are ready for browser-side resolution. */
3260
+ declare function selectPendingClientToolCalls(input: SelectPendingClientToolCallsInput): readonly ToolCall[];
3261
+
2975
3262
  /** Validate raw model args against a Standard Schema. */
2976
3263
  declare function validateArgs(schema: StandardSchemaV1, args: unknown): Promise<{
2977
3264
  ok: true;
@@ -2981,15 +3268,23 @@ declare function validateArgs(schema: StandardSchemaV1, args: unknown): Promise<
2981
3268
  error: string;
2982
3269
  }>;
2983
3270
  /** Validate args, run the handler, and normalize the outcome to a ClientToolResult. */
2984
- declare function executeFunctionTool(def: AnyFunctionToolDef, rawArgs: unknown): Promise<ClientToolResult>;
3271
+ declare function executeFunctionTool(def: AnyFunctionToolDef, rawArgs: unknown, context?: FunctionToolHandlerContext): Promise<ClientToolResult>;
2985
3272
 
3273
+ /** Options for wiring automatic browser function-tool execution. */
3274
+ interface ClientToolExecutorOptions {
3275
+ readonly executionGuard?: ClientToolExecutionGuard;
3276
+ readonly settleToolCall?: (toolCall: ToolCall, result: ClientToolResult) => void;
3277
+ /** Settlement for calls that must NOT continue the run (user abort, teardown). */
3278
+ readonly settleWithoutContinuing?: (toolCall: ToolCall, result: ClientToolResult) => void;
3279
+ readonly shouldExecuteToolCall?: (toolCall: ToolCall) => boolean;
3280
+ }
2986
3281
  /**
2987
3282
  * Watches the agent's pending client tool calls and auto-runs FUNCTION tools,
2988
3283
  * resolving each with its result. View/ask (component) tools are handled by the
2989
3284
  * rendering layer, not here. No-op if the agent lacks the clientTools
2990
3285
  * capability. MUST be called in an injection context (sets up an effect).
2991
3286
  */
2992
- declare function startClientToolExecutor(agent: Agent, registry: ClientToolRegistry): void;
3287
+ declare function startClientToolExecutor(agent: Agent, registry: ClientToolRegistry, options?: ClientToolExecutorOptions): void;
2993
3288
 
2994
3289
  interface ClientToolsCoordinator {
2995
3290
  /** Components for `view`/`ask` tools, keyed by tool name — merge into the chat `views`. */
@@ -3062,8 +3357,10 @@ interface MockAgentOptions {
3062
3357
  * @returns A {@link MockAgent} satisfying the full `Agent` contract.
3063
3358
  * @example
3064
3359
  * ```ts
3360
+ * import { staticDelivery } from '@threadplane/chat';
3361
+ *
3065
3362
  * const agent = mockAgent({
3066
- * messages: [{ id: '1', role: 'assistant', content: 'Hi' }],
3363
+ * messages: [{ id: '1', role: 'assistant', content: 'Hi', delivery: staticDelivery('1') }],
3067
3364
  * isLoading: true,
3068
3365
  * });
3069
3366
  * ```
@@ -3073,5 +3370,5 @@ declare function mockAgent(opts?: MockAgentOptions): MockAgent;
3073
3370
  /** Inferred argument type for a schema (alias of StandardSchemaInferOutput). */
3074
3371
  type ToolArgs<S extends StandardSchemaV1> = StandardSchemaInferOutput<S>;
3075
3372
 
3076
- export { A2uiAudioPlayerComponent, A2uiButtonComponent, A2uiCardComponent, A2uiCheckBoxComponent, A2uiColumnComponent, A2uiDateTimeInputComponent, A2uiDividerComponent, A2uiIconComponent, A2uiImageComponent, A2uiListComponent, A2uiModalComponent, A2uiMultipleChoiceComponent, A2uiRowComponent, A2uiSliderComponent, A2uiSurfaceComponent, A2uiTabsComponent, A2uiTextComponent, A2uiTextFieldComponent, A2uiVideoComponent, AGENT_ERROR_MESSAGES, AgentError, CHAT_CONFIG, CHAT_LIFECYCLE, ChatApprovalCardComponent, ChatCitationCardTemplateDirective, ChatCitationsCardComponent, ChatCitationsComponent, ChatComponent, ChatConfirmDialogComponent, ChatConnectedOverlayDirective, ChatErrorComponent, ChatGenerativeUiComponent, ChatGenuiSkeletonComponent, ChatHistorySearchPaletteComponent, ChatInputComponent, ChatInterruptComponent, ChatInterruptPanelComponent, ChatLauncherButtonComponent, ChatMessageActionsComponent, ChatMessageComponent, ChatMessageListComponent, ChatOverflowMenuComponent, ChatOverlayOriginDirective, ChatPopupComponent, ChatProjectListComponent, ChatReasoningComponent, ChatScrollBubbleComponent, ChatSelectComponent, ChatSidebarComponent, ChatSidenavComponent, ChatSidenavScrimComponent, ChatStreamingMdComponent, ChatSubagentCardComponent, ChatSubagentsComponent, ChatSuggestionsComponent, ChatThreadListComponent, ChatTimelineComponent, ChatTimelineSliderComponent, ChatToolCallCardComponent, ChatToolCallTemplateDirective, ChatToolCallsComponent, ChatToolViewsComponent, ChatTraceComponent, ChatTypingIndicatorComponent, ChatWelcomeComponent, ChatWelcomeSuggestionComponent, ChatWindowComponent, CitationsResolverService, IS_HEADER_ROW, MARKDOWN_VIEW_REGISTRY, MarkdownAutolinkComponent, MarkdownBlockquoteComponent, MarkdownChildrenComponent, MarkdownCitationReferenceComponent, MarkdownCodeBlockComponent, MarkdownDocumentComponent, MarkdownEmphasisComponent, MarkdownHardBreakComponent, MarkdownHeadingComponent, MarkdownHtmlComponent, MarkdownImageComponent, MarkdownInlineCodeComponent, MarkdownLinkComponent, MarkdownListComponent, MarkdownListItemComponent, MarkdownMathComponent, MarkdownParagraphComponent, MarkdownSoftBreakComponent, MarkdownStrikethroughComponent, MarkdownStrongComponent, MarkdownTableCellComponent, MarkdownTableComponent, MarkdownTableRowComponent, MarkdownTextComponent, MarkdownThematicBreakComponent, MessageTemplateDirective, a2uiBasicCatalog, action, ask, buildA2uiActionMessage, cacheplaneMarkdownViews, createA2uiSurfaceStore, createAgentRef, createContentClassifier, createParseTreeStore, createPartialArgsBridge, deriveJsonSchema, emitBinding, executeFunctionTool, extractErrorMessage, formatDuration, getInterrupt, getMessageType, injectThreadRouting, isAbortError, isAssistantMessage, isSystemMessage, isToolMessage, isTyping, isUserMessage, messageContent, mockAgent, normalizeEnvelopeArgs, normalizeViewEntry, provideChat, renderMarkdown, startClientToolExecutor, statusColor, submitMessage, toAgentError, toClientToolSpecs, tools, validateArgs, view };
3077
- export type { A2uiComponentView, A2uiSurfaceState, A2uiSurfaceStore, A2uiViewEntry, A2uiViews, Agent, AgentCheckpoint, AgentCustomEvent, AgentErrorKind, AgentEvent, AgentInterrupt, AgentRef, AgentRuntimeTelemetryEvent, AgentRuntimeTelemetryPayload, AgentRuntimeTelemetryProperties, AgentRuntimeTelemetrySink, AgentStateUpdateEvent, AgentStatus, AgentSubmitInput, AgentSubmitOptions, AgentWithHistory, AnyFunctionToolDef, AskToolDef, ChatApprovalAction, ChatConfig, ChatLifecycle, ChatMessageRole, ChatRenderEvent, ChatScrollBubbleMode, ChatSelectOption, ChatSidenavMode, ChatToolCallTemplateContext, Citation, ClientToolDef, ClientToolRegistry, ClientToolResult, ClientToolSpec, ClientToolsCapability, ClientToolsCoordinator, ConnectedPosition, ContentBlock, ContentClassifier, ContentType, ElementAccumulationState, FunctionToolDef, InterruptAction, Message, MessageTemplateType, MockAgent, MockAgentOptions, OverflowMenuItem, OverlayPositionResult, ParseTreeStore, PartialArgsBridge, Project, ProjectActionAdapter, ResolvedCitation, Role, Subagent, SubagentStatus, Thread, ThreadActionAdapter, ThreadMatch, ThreadRoutingConfig, ToolArgs, ToolCall, ToolCallInfo, ToolCallStatus, TraceState, ViewProps, ViewToolDef };
3373
+ export { A2uiAudioPlayerComponent, A2uiButtonComponent, A2uiCardComponent, A2uiCheckBoxComponent, A2uiColumnComponent, A2uiDateTimeInputComponent, A2uiDividerComponent, A2uiIconComponent, A2uiImageComponent, A2uiListComponent, A2uiModalComponent, A2uiMultipleChoiceComponent, A2uiRowComponent, A2uiSliderComponent, A2uiSurfaceComponent, A2uiTabsComponent, A2uiTextComponent, A2uiTextFieldComponent, A2uiVideoComponent, AGENT_ERROR_MESSAGES, AgentError, CHAT_CONFIG, CHAT_LIFECYCLE, ChatApprovalCardComponent, ChatCitationCardTemplateDirective, ChatCitationPreviewComponent, ChatCitationsCardComponent, ChatCitationsComponent, ChatComponent, ChatConfirmDialogComponent, ChatConnectedOverlayDirective, ChatErrorComponent, ChatGenerativeUiComponent, ChatGenuiSkeletonComponent, ChatHistorySearchPaletteComponent, ChatInputComponent, ChatInterruptComponent, ChatInterruptPanelComponent, ChatLauncherButtonComponent, ChatMessageActionsComponent, ChatMessageComponent, ChatMessageListComponent, ChatOverflowMenuComponent, ChatOverlayOriginDirective, ChatPopupComponent, ChatProjectListComponent, ChatReasoningComponent, ChatScrollBubbleComponent, ChatSelectComponent, ChatSidebarComponent, ChatSidenavComponent, ChatSidenavScrimComponent, ChatStreamingMdComponent, ChatSubagentCardComponent, ChatSubagentsComponent, ChatSuggestionsComponent, ChatThreadListComponent, ChatTimelineComponent, ChatTimelineSliderComponent, ChatToolCallCardComponent, ChatToolCallTemplateDirective, ChatToolCallsComponent, ChatToolViewsComponent, ChatTraceComponent, ChatTypingIndicatorComponent, ChatWelcomeComponent, ChatWelcomeSuggestionComponent, ChatWindowComponent, CitationsResolverService, IS_HEADER_ROW, MARKDOWN_VIEW_REGISTRY, MarkdownAutolinkComponent, MarkdownBlockquoteComponent, MarkdownChildrenComponent, MarkdownCitationReferenceComponent, MarkdownCodeBlockComponent, MarkdownDocumentComponent, MarkdownEmphasisComponent, MarkdownHardBreakComponent, MarkdownHeadingComponent, MarkdownHtmlComponent, MarkdownImageComponent, MarkdownInlineCodeComponent, MarkdownLinkComponent, MarkdownListComponent, MarkdownListItemComponent, MarkdownMathComponent, MarkdownParagraphComponent, MarkdownSoftBreakComponent, MarkdownStrikethroughComponent, MarkdownStrongComponent, MarkdownTableCellComponent, MarkdownTableComponent, MarkdownTableRowComponent, MarkdownTextComponent, MarkdownThematicBreakComponent, MessageTemplateDirective, STREAMING_MARKDOWN_CONTRACT_VIOLATION_POLICY, a2uiBasicCatalog, action, ask, buildA2uiActionMessage, cacheplaneMarkdownViews, cancelledClientToolResult, citationSourceVisual, citationTypeLabel, citationTypeMeta, clientToolGuardFailureResult, completeDelivery, createA2uiSurfaceStore, createAgentRef, createContentClassifier, createParseTreeStore, createPartialArgsBridge, defaultInterruptedClientToolResult, deriveDomain, deriveJsonSchema, deriveMonogram, deriveSourceType, emitBinding, executeFunctionTool, extractErrorMessage, formatDuration, formatPublished, getInterrupt, getMessageType, injectThreadRouting, isAbortError, isAssistantMessage, isSystemMessage, isToolMessage, isTyping, isUserMessage, markdownDocument, messageContent, mockAgent, monogramColor, monogramHue, normalizeEnvelopeArgs, normalizeViewEntry, provideChat, renderMarkdown, selectPendingClientToolCalls, shouldClaimBeforeExecute, startClientToolExecutor, staticDelivery, statusColor, streamingDelivery, submitMessage, toAgentError, toClientToolSpecs, tools, validateArgs, view };
3374
+ export type { A2uiComponentView, A2uiSurfaceState, A2uiSurfaceStore, A2uiViewEntry, A2uiViews, Agent, AgentCheckpoint, AgentCustomEvent, AgentErrorKind, AgentEvent, AgentInterrupt, AgentRef, AgentRuntimeTelemetryEvent, AgentRuntimeTelemetryPayload, AgentRuntimeTelemetryProperties, AgentRuntimeTelemetrySink, AgentStateUpdateEvent, AgentStatus, AgentSubmitInput, AgentSubmitOptions, AgentWithHistory, AnyFunctionToolDef, AskToolDef, ChatApprovalAction, ChatConfig, ChatLifecycle, ChatMessageRole, ChatRenderEvent, ChatScrollBubbleMode, ChatSelectOption, ChatSidenavMode, ChatToolCallTemplateContext, Citation, CitationImageVisual, CitationMonogramVisual, CitationSourceVisual, CitationTypeIcon, CitationTypeIconVisual, CitationTypeMeta, ClientToolContinuationLimitEvent, ClientToolContinuationOptions, ClientToolContinuationPolicy, ClientToolDef, ClientToolExecutionGuard, ClientToolExecutionKey, ClientToolExecutionOptions, ClientToolExecutionRecord, ClientToolExecutionStore, ClientToolExecutorOptions, ClientToolLifecycle, ClientToolLifecyclePhase, ClientToolRegistry, ClientToolResult, ClientToolSpec, ClientToolViewProps, ClientToolsCapability, ClientToolsCoordinator, CompleteOutcome, ConnectedPosition, ContentBlock, ContentClassifier, ContentType, ElementAccumulationState, FunctionToolDef, FunctionToolHandlerContext, InterruptAction, Message, MessageDelivery, MessageTemplateType, MockAgent, MockAgentOptions, OverflowMenuItem, OverlayPositionResult, ParseTreeStore, PartialArgsBridge, Project, ProjectActionAdapter, ResolvedCitation, Role, SelectPendingClientToolCallsInput, StreamingMarkdownContractViolationPolicy, StreamingMarkdownDocument, Subagent, SubagentStatus, Thread, ThreadActionAdapter, ThreadMatch, ThreadRoutingConfig, ToolArgs, ToolCall, ToolCallInfo, ToolCallStatus, TraceState, ViewProps, ViewToolDef };