@dudousxd/nestjs-agent-react 0.12.0 → 0.14.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/README.md +46 -1
- package/dist/genui-json-render.cjs +93 -0
- package/dist/genui-json-render.cjs.map +1 -0
- package/dist/genui-json-render.d.cts +34 -0
- package/dist/genui-json-render.d.ts +34 -0
- package/dist/genui-json-render.js +67 -0
- package/dist/genui-json-render.js.map +1 -0
- package/dist/genui.cjs +450 -0
- package/dist/genui.cjs.map +1 -0
- package/dist/genui.d.cts +62 -0
- package/dist/genui.d.ts +62 -0
- package/dist/genui.js +420 -0
- package/dist/genui.js.map +1 -0
- package/dist/index.cjs +20 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +31 -580
- package/dist/index.d.ts +31 -580
- package/dist/index.js +20 -3
- package/dist/index.js.map +1 -1
- package/dist/markdown.d.cts +2 -2
- package/dist/markdown.d.ts +2 -2
- package/dist/model-CMNhyau6.d.cts +557 -0
- package/dist/model-CMNhyau6.d.ts +557 -0
- package/dist/types-DFD-soWU.d.cts +86 -0
- package/dist/types-DFD-soWU.d.ts +86 -0
- package/package.json +30 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as ai from 'ai';
|
|
2
|
-
import { ChatTransport, UIMessage, UIMessageChunk,
|
|
2
|
+
import { ChatTransport, UIMessage, UIMessageChunk, DataUIPart, UIDataTypes } from 'ai';
|
|
3
3
|
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
4
|
-
import { StoredMessage, ThreadSummary, SkillCatalogEntry, ToolCatalogEntry, ThreadDetail, MessageAttachment, QuotaView
|
|
4
|
+
import { StoredMessage, ThreadSummary, SkillCatalogEntry, ToolCatalogEntry, ThreadDetail, MessageAttachment, QuotaView } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
export { ElicitationInput, ElicitationInputType, validateElicitationAnswer as validateAnswer, validateElicitationValue as validateAnswerValue } from '@dudousxd/nestjs-agent-core';
|
|
6
|
-
import
|
|
6
|
+
import React__default from 'react';
|
|
7
|
+
import { a as TranscriptBlock, U as UsageSummary, b as TimestampInfo, C as ChatStatus, M as MessageUsageInfo, c as ToolCatalog, A as ApproveOptions, d as AnyToolUIPart, e as TranscriptFile, T as TranscriptUiBlock } from './model-CMNhyau6.js';
|
|
8
|
+
export { f as ApprovalBlockOptions, B as BuildBlocksOptions, g as CoercibleQuestion, D as DescribeToolCallOptions, E as ElicitationBlockOptions, G as GroupToolActivityOptions, R as RawAnswer, h as ResolvedReading, i as ResolvedResultView, j as RetrievedPassage, S as SettleAction, k as ToolActivityGroup, l as ToolCallDescription, m as ToolCallState, n as ToolCallStatus, o as TranscriptApproval, p as TranscriptApprovalStatus, q as TranscriptElicitationBlock, r as TranscriptElicitationOutcome, s as TranscriptFilesBlock, t as TranscriptQuestion, u as TranscriptQuestionOption, v as TranscriptReasoningBlock, w as TranscriptSettleState, x as TranscriptSource, y as TranscriptSourcesBlock, z as TranscriptTextBlock, F as TranscriptToolBlock, H as TranscriptToolCall, I as buildTranscriptBlocks, J as coerceAnswer, K as correctedCallIds, L as describeTimestamp, N as describeToolCall, O as describeUsage, P as extractMessageText, Q as fillTemplate, V as formatRelativeTime, W as groupToolActivity, X as inferResultView, Y as isActionCall, Z as phraseFor, _ as readPath, $ as resolveResultView, a0 as toolCallState, a1 as toolCatalogFrom } from './model-CMNhyau6.js';
|
|
7
9
|
|
|
8
10
|
/** Identity surfaced by the backend's `meta` SSE frame / response headers. */
|
|
9
11
|
interface AgentStreamMeta {
|
|
@@ -282,7 +284,7 @@ interface ChatInputProps {
|
|
|
282
284
|
/** BCP-47 locale for dictation. Default `en-US`. */
|
|
283
285
|
speechLang?: string;
|
|
284
286
|
/** Label/content for the send button. Default `"Send"`. */
|
|
285
|
-
sendLabel?:
|
|
287
|
+
sendLabel?: React__default.ReactNode;
|
|
286
288
|
/**
|
|
287
289
|
* Cancel the turn in flight — wire to `useAgentChat`'s `cancel`. Rendered only alongside
|
|
288
290
|
* `isStreaming`, so the affordance exists exactly while there is something to cancel.
|
|
@@ -291,7 +293,7 @@ interface ChatInputProps {
|
|
|
291
293
|
/** Whether a turn is currently in flight. Gates the stop affordance. */
|
|
292
294
|
isStreaming?: boolean;
|
|
293
295
|
/** Label/content for the stop button. Default `"Stop generating"` — the mic's own is `"Stop"`. */
|
|
294
|
-
stopLabel?:
|
|
296
|
+
stopLabel?: React__default.ReactNode;
|
|
295
297
|
/** Wrapper class. The component ships no styles of its own. */
|
|
296
298
|
className?: string;
|
|
297
299
|
textareaClassName?: string;
|
|
@@ -304,7 +306,7 @@ interface ChatInputProps {
|
|
|
304
306
|
*/
|
|
305
307
|
renderMic?: (state: {
|
|
306
308
|
isListening: boolean;
|
|
307
|
-
}) =>
|
|
309
|
+
}) => React__default.ReactNode;
|
|
308
310
|
}
|
|
309
311
|
/**
|
|
310
312
|
* Styling-agnostic chat composer. Enter submits, Shift+Enter inserts a
|
|
@@ -313,558 +315,7 @@ interface ChatInputProps {
|
|
|
313
315
|
* cancel next to send. No design-system or icon-library deps —
|
|
314
316
|
* style it entirely through the `*ClassName` props.
|
|
315
317
|
*/
|
|
316
|
-
declare function ChatInput({ onSubmit, disabled, placeholder, rows, enableSpeech, speechLang, sendLabel, onStop, isStreaming, stopLabel, className, textareaClassName, sendButtonClassName, micButtonClassName, stopButtonClassName, renderMic, }: ChatInputProps):
|
|
317
|
-
|
|
318
|
-
/** What a form control can hand over: a field's value, a checkbox's state, a picked date, a list. */
|
|
319
|
-
type RawAnswer = string | number | boolean | Date | null | undefined | readonly RawAnswer[];
|
|
320
|
-
/** The question fields {@link coerceAnswer} reads. A transcript question and a core one both fit. */
|
|
321
|
-
type CoercibleQuestion = Pick<ElicitationQuestion, 'multiple'> & {
|
|
322
|
-
input?: {
|
|
323
|
-
type: ElicitationInputType;
|
|
324
|
-
} | null;
|
|
325
|
-
};
|
|
326
|
-
/**
|
|
327
|
-
* Turn whatever a form control produced into the `string[]` the answer route takes, in the
|
|
328
|
-
* question's canonical form: numbers as decimals, booleans as `"true"`/`"false"`, dates as
|
|
329
|
-
* `YYYY-MM-DD` (a `Date` is read as the local calendar day), trimmed where whitespace means
|
|
330
|
-
* nothing. An empty value becomes `[]` — no answer, not an empty string. A single-choice question
|
|
331
|
-
* keeps the first value.
|
|
332
|
-
*
|
|
333
|
-
* Coercion never judges: pair it with {@link validateAnswer} (the same rules the server applies) to
|
|
334
|
-
* say what is wrong before sending.
|
|
335
|
-
*/
|
|
336
|
-
declare function coerceAnswer(question: CoercibleQuestion, raw: RawAnswer): string[];
|
|
337
|
-
|
|
338
|
-
/** Tool name → how the server said it is spoken about. */
|
|
339
|
-
type ToolCatalog = Record<string, ToolPresentation>;
|
|
340
|
-
/** Index `GET <base>/tools` by tool name, keeping only the tools that declared a presentation. */
|
|
341
|
-
declare function toolCatalogFrom(entries: readonly ToolCatalogEntry[]): ToolCatalog;
|
|
342
|
-
/** Dotted-path read. `undefined` rather than a throw, so a template can outlive a field. */
|
|
343
|
-
declare function readPath(value: unknown, path: string): unknown;
|
|
344
|
-
/**
|
|
345
|
-
* Fill `{dotted.path}` placeholders from `context`. A placeholder with nothing behind it collapses
|
|
346
|
-
* along with the whitespace in front of it, so "Reading {key}" degrades to "Reading" rather than
|
|
347
|
-
* printing braces at a person; a filled one keeps the whitespace the author wrote ("({n} files)").
|
|
348
|
-
*/
|
|
349
|
-
declare function fillTemplate(template: string, context: unknown): string;
|
|
350
|
-
/**
|
|
351
|
-
* The sentence for one call: the presentation's `running` or `done` template over the call's input.
|
|
352
|
-
*
|
|
353
|
-
* Nothing here reads the tool's name. A tool the catalog does not describe — added since the catalog
|
|
354
|
-
* loaded, or declared without a presentation — is narrated generically (`fallback`), because the only
|
|
355
|
-
* other thing available to say is its identifier.
|
|
356
|
-
*/
|
|
357
|
-
declare function phraseFor(presentation: ToolPresentation | undefined, input: unknown, isSettled: boolean, fallback?: {
|
|
358
|
-
running: string;
|
|
359
|
-
done: string;
|
|
360
|
-
}): string;
|
|
361
|
-
|
|
362
|
-
/** One labelled reading of a `metrics` view. */
|
|
363
|
-
interface ResolvedReading {
|
|
364
|
-
label: string;
|
|
365
|
-
/** The value as text (`—` for nothing). */
|
|
366
|
-
value: string;
|
|
367
|
-
unit: string | null;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* A tool's output resolved through its view into plain data a renderer draws — never the payload
|
|
371
|
-
* itself. `null` from {@link resolveResultView} means "draw nothing".
|
|
372
|
-
*/
|
|
373
|
-
type ResolvedResultView = {
|
|
374
|
-
kind: 'metrics';
|
|
375
|
-
readings: ResolvedReading[];
|
|
376
|
-
} | {
|
|
377
|
-
kind: 'table';
|
|
378
|
-
columns: ToolResultField[];
|
|
379
|
-
rows: string[][];
|
|
380
|
-
empty: string | null;
|
|
381
|
-
} | {
|
|
382
|
-
kind: 'log';
|
|
383
|
-
lines: string[];
|
|
384
|
-
} | {
|
|
385
|
-
kind: 'note';
|
|
386
|
-
text: string;
|
|
387
|
-
};
|
|
388
|
-
/**
|
|
389
|
-
* A view for an output whose tool declared none, from its shape: an array of flat records is a
|
|
390
|
-
* table, an array of strings a log, a flat record a set of readings. `undefined` when nothing fits —
|
|
391
|
-
* a serialized payload is what a person-facing surface exists to avoid, so failing to infer must not
|
|
392
|
-
* fall back to one.
|
|
393
|
-
*/
|
|
394
|
-
declare function inferResultView(output: unknown): ToolResultView | undefined;
|
|
395
|
-
/**
|
|
396
|
-
* Read `output` through `view` (or one inferred from its shape when `view` is omitted and `infer` is
|
|
397
|
-
* on). `null` when there is nothing to draw: an `elsewhere` view, an empty reading set, a missing
|
|
398
|
-
* array. A table whose rows array is present but empty resolves with no rows and its `empty` line.
|
|
399
|
-
*/
|
|
400
|
-
declare function resolveResultView(output: unknown, view: ToolResultView | undefined, options?: {
|
|
401
|
-
infer?: boolean;
|
|
402
|
-
}): ResolvedResultView | null;
|
|
403
|
-
|
|
404
|
-
/**
|
|
405
|
-
* Where one call stands, as a person reads it:
|
|
406
|
-
* - `running` — input streaming or the tool executing;
|
|
407
|
-
* - `awaiting-approval` — an `action` call parked on a person;
|
|
408
|
-
* - `done` / `failed` / `denied` — settled. A tool that RETURNS `{ error }` has failed just as much
|
|
409
|
-
* as one that threw; the two arrive differently and read the same to a person.
|
|
410
|
-
*/
|
|
411
|
-
type ToolCallStatus = 'running' | 'awaiting-approval' | 'done' | 'failed' | 'denied';
|
|
412
|
-
interface ToolCallState {
|
|
413
|
-
status: ToolCallStatus;
|
|
414
|
-
isSettled: boolean;
|
|
415
|
-
isFailed: boolean;
|
|
416
|
-
isDenied: boolean;
|
|
417
|
-
output: unknown;
|
|
418
|
-
error: string | null;
|
|
419
|
-
}
|
|
420
|
-
/** Whether the stream classified this call as an `action` (it parks for approval before it runs). */
|
|
421
|
-
declare function isActionCall(part: AnyToolUIPart): boolean;
|
|
422
|
-
declare function toolCallState(part: AnyToolUIPart): ToolCallState;
|
|
423
|
-
/**
|
|
424
|
-
* Which failed calls the model went on to correct, by call id: a call that failed and was followed,
|
|
425
|
-
* in the same run, by a SUCCESS of the same tool. The operator wants to know a retry happened, not
|
|
426
|
-
* to read every attempt. A failed read is not corrected by a successful query.
|
|
427
|
-
*/
|
|
428
|
-
declare function correctedCallIds(parts: readonly AnyToolUIPart[]): Set<string>;
|
|
429
|
-
/** Everything a surface needs to talk about one call without naming it. */
|
|
430
|
-
interface ToolCallDescription {
|
|
431
|
-
status: ToolCallStatus;
|
|
432
|
-
/** "Querying orders" / "Queried orders" — or the generic fallback when the tool declared nothing. */
|
|
433
|
-
phrase: string;
|
|
434
|
-
/** The server's noun phrase for the tool; `null` when it declared no presentation. */
|
|
435
|
-
label: string | null;
|
|
436
|
-
icon: string | null;
|
|
437
|
-
tone: ToolPresentationTone;
|
|
438
|
-
detail: string | null;
|
|
439
|
-
/** The approval prompt, templated over the call's input; `null` when the tool declared none. */
|
|
440
|
-
confirm: {
|
|
441
|
-
title: string;
|
|
442
|
-
verb: string;
|
|
443
|
-
detail: string | null;
|
|
444
|
-
} | null;
|
|
445
|
-
/** The output read through its view, once the call is `done`; `null` otherwise or when nothing to draw. */
|
|
446
|
-
result: ResolvedResultView | null;
|
|
447
|
-
error: string | null;
|
|
448
|
-
presentation: ToolPresentation | null;
|
|
449
|
-
}
|
|
450
|
-
interface DescribeToolCallOptions {
|
|
451
|
-
/** Words for a tool the catalog does not describe. Default `Working` / `Done`. */
|
|
452
|
-
fallback?: {
|
|
453
|
-
running: string;
|
|
454
|
-
done: string;
|
|
455
|
-
};
|
|
456
|
-
/** Infer a result view from the output's shape when the tool declared none. Default `false`. */
|
|
457
|
-
inferResult?: boolean;
|
|
458
|
-
}
|
|
459
|
-
declare function describeToolCall(part: AnyToolUIPart, catalog: ToolCatalog | undefined, options?: DescribeToolCallOptions): ToolCallDescription;
|
|
460
|
-
/**
|
|
461
|
-
* Calls folded under one key — "Database query ×3" — with the state that matters most across them.
|
|
462
|
-
*/
|
|
463
|
-
interface ToolActivityGroup {
|
|
464
|
-
key: string;
|
|
465
|
-
/** The server's label for the group's tool; `null` when it declared no presentation. */
|
|
466
|
-
label: string | null;
|
|
467
|
-
icon: string | null;
|
|
468
|
-
/** Worst-first across the calls: running › awaiting-approval › failed › denied › done. */
|
|
469
|
-
status: ToolCallStatus;
|
|
470
|
-
count: number;
|
|
471
|
-
/** The phrase of the group's LATEST call — what is happening now. */
|
|
472
|
-
phrase: string;
|
|
473
|
-
calls: TranscriptToolCall[];
|
|
474
|
-
/** Calls nested under the group's calls (all depths), when nesting was not expanded. */
|
|
475
|
-
innerCount: number;
|
|
476
|
-
}
|
|
477
|
-
interface GroupToolActivityOptions {
|
|
478
|
-
catalog?: ToolCatalog;
|
|
479
|
-
/**
|
|
480
|
-
* What makes two calls "the same activity". Default: the tool's presentation `label`, else its
|
|
481
|
-
* name. Flippy-style source grouping passes its own (e.g. `github:search`).
|
|
482
|
-
*/
|
|
483
|
-
keyOf?: (call: TranscriptToolCall, presentation: ToolPresentation | undefined) => string;
|
|
484
|
-
/**
|
|
485
|
-
* Replace a call that has nested calls with those calls (recursively), so the activity reads as
|
|
486
|
-
* what the code-mode run DID rather than "ran code". Default `false`: groups are built over the
|
|
487
|
-
* top-level calls, and `innerCount` says how much ran beneath them.
|
|
488
|
-
*/
|
|
489
|
-
expandNested?: boolean;
|
|
490
|
-
/** Drop failed calls the model corrected with a later success of the same tool. Default `false`. */
|
|
491
|
-
hideCorrected?: boolean;
|
|
492
|
-
fallback?: {
|
|
493
|
-
running: string;
|
|
494
|
-
done: string;
|
|
495
|
-
};
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
|
-
* Fold a tool run into activity groups, in order of first appearance. Pass `block.roots` (the
|
|
499
|
-
* transcript's call tree) so nesting is honoured; a flat `block.calls` works too and simply has
|
|
500
|
-
* nothing nested.
|
|
501
|
-
*/
|
|
502
|
-
declare function groupToolActivity(calls: readonly TranscriptToolCall[], options?: GroupToolActivityOptions): ToolActivityGroup[];
|
|
503
|
-
|
|
504
|
-
/** A tool UI part on a `UIMessage` — a static `tool-*` part or the `dynamic-tool` part. */
|
|
505
|
-
type AnyToolUIPart = ToolUIPart | DynamicToolUIPart;
|
|
506
|
-
type ChatStatus = 'ready' | 'submitted' | 'streaming' | 'error';
|
|
507
|
-
/** Server-aggregated usage for an assistant turn. */
|
|
508
|
-
interface MessageUsageInfo {
|
|
509
|
-
inputTokens: number;
|
|
510
|
-
outputTokens: number;
|
|
511
|
-
/**
|
|
512
|
-
* `null` when no price is on record for the model that ran the turn. Distinct from `0`, which is
|
|
513
|
-
* a turn that genuinely cost nothing — printing `$0` for an unpriced turn states a number the
|
|
514
|
-
* store never had.
|
|
515
|
-
*/
|
|
516
|
-
costUsd: number | null;
|
|
517
|
-
}
|
|
518
|
-
/** A run of contiguous prose. `isStreaming` is the PART's own state, not the message's. */
|
|
519
|
-
interface TranscriptTextBlock {
|
|
520
|
-
kind: 'text';
|
|
521
|
-
key: string;
|
|
522
|
-
text: string;
|
|
523
|
-
isStreaming: boolean;
|
|
524
|
-
}
|
|
525
|
-
/** One file on a message — an uploaded attachment, or one the model produced. */
|
|
526
|
-
interface TranscriptFile {
|
|
527
|
-
/** Presigned or otherwise directly fetchable. Display-only: the model reads its own copy. */
|
|
528
|
-
url: string;
|
|
529
|
-
mediaType: string;
|
|
530
|
-
filename: string | null;
|
|
531
|
-
/** `image/*`, which a renderer can show inline rather than as a link. */
|
|
532
|
-
isImage: boolean;
|
|
533
|
-
}
|
|
534
|
-
/** A run of contiguous files. Grouped so a renderer can lay several out as one strip. */
|
|
535
|
-
interface TranscriptFilesBlock {
|
|
536
|
-
kind: 'files';
|
|
537
|
-
key: string;
|
|
538
|
-
files: TranscriptFile[];
|
|
539
|
-
}
|
|
540
|
-
/**
|
|
541
|
-
* A run of contiguous reasoning. Carries its own disclosure state because a thread can hold many
|
|
542
|
-
* of them and each is toggled independently; `isOpen` defaults to `isStreaming` (thinking is worth
|
|
543
|
-
* watching live, worth folding away once answered) until `toggle` is called for that run.
|
|
544
|
-
*/
|
|
545
|
-
interface TranscriptReasoningBlock {
|
|
546
|
-
kind: 'reasoning';
|
|
547
|
-
key: string;
|
|
548
|
-
text: string;
|
|
549
|
-
isStreaming: boolean;
|
|
550
|
-
/**
|
|
551
|
-
* How long the model thought, in ms — the backend's measurement once the run closed (live) or as
|
|
552
|
-
* persisted (reloaded). `null` while it still streams, or when nothing was recorded: pair it with
|
|
553
|
-
* `useElapsed(block.isStreaming)` for a ticking label (`block.durationMs ?? elapsed`).
|
|
554
|
-
*/
|
|
555
|
-
durationMs: number | null;
|
|
556
|
-
isOpen: boolean;
|
|
557
|
-
toggle: (open?: boolean) => void;
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* A decision a run is waiting on a human for, and which one a parked call is currently sending.
|
|
561
|
-
*
|
|
562
|
-
* One call settles one way at a time, and WHICH one is what lets a surface report progress on the
|
|
563
|
-
* affordance the person pressed instead of on all of them.
|
|
564
|
-
*/
|
|
565
|
-
type SettleAction = 'approve' | 'reject' | 'answer' | 'skip';
|
|
566
|
-
/** One such decision: whether it can be made, whether it is on its way, and how to send it. */
|
|
567
|
-
interface TranscriptSettleState {
|
|
568
|
-
available: boolean;
|
|
569
|
-
/** True from the click until the run resumes and settles the call. */
|
|
570
|
-
isSubmitting: boolean;
|
|
571
|
-
run: () => void;
|
|
572
|
-
}
|
|
573
|
-
/** How an approval stands. */
|
|
574
|
-
type TranscriptApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
|
|
575
|
-
/**
|
|
576
|
-
* Who has to settle a parked call, until when, and — once it settled — how. From the stream's
|
|
577
|
-
* `approval-requested` / `approval-settled` frames, or the same parts a reloaded thread carries.
|
|
578
|
-
* `null` on a call whose runner never said (the call can still be awaiting approval).
|
|
579
|
-
*/
|
|
580
|
-
interface TranscriptApproval {
|
|
581
|
-
/** Open vocabulary the host defines: `'requester'`, `'admin'`, a role… */
|
|
582
|
-
approver: string;
|
|
583
|
-
/** ISO-8601; `null` when the request never lapses. Pair with `useApprovalCountdown`. */
|
|
584
|
-
expiresAt: string | null;
|
|
585
|
-
/** Why the call needs a person, when the runner said. */
|
|
586
|
-
reason: string | null;
|
|
587
|
-
/**
|
|
588
|
-
* `pending` until a settlement arrives; then what it said. Falls back to the call's own state
|
|
589
|
-
* (denied → `rejected`, an output → `approved`) for a runner that streams no settlement.
|
|
590
|
-
*/
|
|
591
|
-
status: TranscriptApprovalStatus;
|
|
592
|
-
/** The approval also covers later calls of this tool in this thread. */
|
|
593
|
-
remember: boolean;
|
|
594
|
-
/** Opaque ref of who decided; `null` while pending, on an expiry, or when the runner did not say. */
|
|
595
|
-
decidedBy: string | null;
|
|
596
|
-
/** The surface the decision came through (`'web'`, `'slack'`, `'remembered'`, …). */
|
|
597
|
-
decidedVia: string | null;
|
|
598
|
-
/** What the person said when declining. */
|
|
599
|
-
decisionReason: string | null;
|
|
600
|
-
}
|
|
601
|
-
/** What an approval can carry beyond yes. */
|
|
602
|
-
interface ApproveOptions {
|
|
603
|
-
/** Approve later calls of the same tool in the same thread without asking again. */
|
|
604
|
-
remember?: boolean;
|
|
605
|
-
}
|
|
606
|
-
/** One call in a tool run, with whatever human decision it is parked on. */
|
|
607
|
-
interface TranscriptToolCall {
|
|
608
|
-
part: AnyToolUIPart;
|
|
609
|
-
toolCallId: string;
|
|
610
|
-
name: string;
|
|
611
|
-
/** `read` / `action` as the stream classified the call; `null` when the backend did not say. */
|
|
612
|
-
toolKind: string | null;
|
|
613
|
-
/** The call this one ran inside (a code-mode `execute`, a delegated agent); `null` for a top-level call. */
|
|
614
|
-
parentId: string | null;
|
|
615
|
-
/**
|
|
616
|
-
* Calls nested under this one within the same block, in stream order. Always empty for a call
|
|
617
|
-
* nothing names as its parent.
|
|
618
|
-
*/
|
|
619
|
-
children: TranscriptToolCall[];
|
|
620
|
-
/** Who has to decide, when the runner said so. See {@link TranscriptApproval}. */
|
|
621
|
-
approval: TranscriptApproval | null;
|
|
622
|
-
/**
|
|
623
|
-
* How to talk about this call without naming it — status, phrase, label, icon, approval prompt,
|
|
624
|
-
* resolved result — from the server's presentation when `toolCatalog` was given, generic otherwise.
|
|
625
|
-
*/
|
|
626
|
-
description: ToolCallDescription;
|
|
627
|
-
/**
|
|
628
|
-
* Parked on a person. An `action` tool's input lands and its output never follows on its own —
|
|
629
|
-
* the loop waits for an approval between the two — so a settled-looking card that never settles
|
|
630
|
-
* IS the pending approval.
|
|
631
|
-
*/
|
|
632
|
-
isAwaitingApproval: boolean;
|
|
633
|
-
/** `run({ remember: true })` approves this tool for the rest of the thread. */
|
|
634
|
-
approve: TranscriptSettleState & {
|
|
635
|
-
run: (options?: ApproveOptions) => void;
|
|
636
|
-
};
|
|
637
|
-
reject: TranscriptSettleState;
|
|
638
|
-
/** A failed decision — the call is still parked, so the affordance stays live. */
|
|
639
|
-
error: string | null;
|
|
640
|
-
}
|
|
641
|
-
/**
|
|
642
|
-
* A run of CONSECUTIVE tool parts, grouped so a UI can collapse "5 tools ran" into one affordance.
|
|
643
|
-
* Any non-tool part between two tool parts ends the run — including the AI SDK's `step-start`
|
|
644
|
-
* markers, so tools from different steps never merge into one group.
|
|
645
|
-
*/
|
|
646
|
-
interface TranscriptToolBlock {
|
|
647
|
-
kind: 'tools';
|
|
648
|
-
key: string;
|
|
649
|
-
parts: AnyToolUIPart[];
|
|
650
|
-
/** The same calls, each with its human-decision state. Same order as `parts`. */
|
|
651
|
-
calls: TranscriptToolCall[];
|
|
652
|
-
/**
|
|
653
|
-
* The same calls as a tree: every call whose parent is NOT in this block, each carrying its
|
|
654
|
-
* nested calls in `children`. Equal to `calls` when nothing is nested.
|
|
655
|
-
*/
|
|
656
|
-
roots: TranscriptToolCall[];
|
|
657
|
-
/**
|
|
658
|
-
* The run folded into activity groups ("Database query ×3"), over `roots`, keyed by each tool's
|
|
659
|
-
* presentation label (else its name). For another grouping, call `groupToolActivity` yourself.
|
|
660
|
-
*/
|
|
661
|
-
activity: ToolActivityGroup[];
|
|
662
|
-
}
|
|
663
|
-
/**
|
|
664
|
-
* A component the server pushed into the message (the stream's `ui` frame, or a persisted
|
|
665
|
-
* `data-ui` part). Rendered by looking `component` up in the host's own registry.
|
|
666
|
-
*/
|
|
667
|
-
interface TranscriptUiBlock {
|
|
668
|
-
kind: 'ui';
|
|
669
|
-
key: string;
|
|
670
|
-
/** The component's identity within the message. */
|
|
671
|
-
id: string;
|
|
672
|
-
component: string;
|
|
673
|
-
props: Record<string, unknown>;
|
|
674
|
-
/** Schema version of `props`; `null` when the server did not stamp one. */
|
|
675
|
-
version: number | null;
|
|
676
|
-
}
|
|
677
|
-
/** One choice a question offers, with its live selection state. */
|
|
678
|
-
interface TranscriptQuestionOption {
|
|
679
|
-
value: string;
|
|
680
|
-
label: string;
|
|
681
|
-
/** A single character the request suggested as a shortcut; `null` when it suggested none. */
|
|
682
|
-
hotkey: string | null;
|
|
683
|
-
isSelected: boolean;
|
|
684
|
-
/** Pre-picked by the agent — what an untouched question submits as. */
|
|
685
|
-
isDefault: boolean;
|
|
686
|
-
/** Single choice: replaces the selection. Multiple: adds or removes this value. */
|
|
687
|
-
select: () => void;
|
|
688
|
-
}
|
|
689
|
-
/** One question of a set, numbered against the whole. */
|
|
690
|
-
interface TranscriptQuestion {
|
|
691
|
-
id: string;
|
|
692
|
-
prompt: string;
|
|
693
|
-
/** A line of help under the prompt; `null` when the request gave none. */
|
|
694
|
-
description: string | null;
|
|
695
|
-
/**
|
|
696
|
-
* How the answer is typed — `{ type, placeholder?, required?, min?, max?, pattern? }` — or `null`
|
|
697
|
-
* for a plain pick from `options`. Render the control from `input.type`; `select` still picks
|
|
698
|
-
* from `options`.
|
|
699
|
-
*/
|
|
700
|
-
input: ElicitationInput | null;
|
|
701
|
-
multiple: boolean;
|
|
702
|
-
/** 1-based. The request carries every question up front, so "Question 1 of N" is honest. */
|
|
703
|
-
position: number;
|
|
704
|
-
options: TranscriptQuestionOption[];
|
|
705
|
-
selected: string[];
|
|
706
|
-
/**
|
|
707
|
-
* The user has not touched this question, so a submission leaves it out and the server applies
|
|
708
|
-
* the same defaults it showed. Distinct from "selected happens to equal the defaults": only the
|
|
709
|
-
* first is recorded as `defaulted` rather than as a choice the user made.
|
|
710
|
-
*/
|
|
711
|
-
isPristine: boolean;
|
|
712
|
-
/** The first selected value, or `''` — what a single text/number/date field shows. */
|
|
713
|
-
value: string;
|
|
714
|
-
/**
|
|
715
|
-
* Set a typed answer from whatever the control produced (a string, a number, a checkbox's
|
|
716
|
-
* boolean, a `Date`, a list); coerced to the question's canonical strings with `coerceAnswer`.
|
|
717
|
-
* `null`/`''` clears it. Does nothing once the set settled.
|
|
718
|
-
*/
|
|
719
|
-
setValue: (raw: RawAnswer) => void;
|
|
720
|
-
/**
|
|
721
|
-
* Why the current selection would be refused (the server's own rules — `validateAnswer`), or
|
|
722
|
-
* `null`. A pristine required question with no default reads `requires an answer`; show it once
|
|
723
|
-
* the user tried to submit, or right away — the model does not decide that for you.
|
|
724
|
-
*/
|
|
725
|
-
error: string | null;
|
|
726
|
-
}
|
|
727
|
-
/** How a question set settled, once it did. */
|
|
728
|
-
interface TranscriptElicitationOutcome {
|
|
729
|
-
answers: Record<string, string[]>;
|
|
730
|
-
/** The user declined to answer and let the agent proceed on its own picks. */
|
|
731
|
-
skipped: boolean;
|
|
732
|
-
/** Questions filled from their own defaults rather than by the human. */
|
|
733
|
-
defaulted: string[];
|
|
734
|
-
/** The questions against the chosen labels, as the model read them back. */
|
|
735
|
-
summary: string | null;
|
|
736
|
-
}
|
|
737
|
-
/**
|
|
738
|
-
* A question set the run put to the user, parked until someone settles it — the intake an agent
|
|
739
|
-
* declares and the model's own `ask` produce the same block, because the loop streams the same
|
|
740
|
-
* frame for both.
|
|
741
|
-
*/
|
|
742
|
-
interface TranscriptElicitationBlock {
|
|
743
|
-
kind: 'elicitation';
|
|
744
|
-
key: string;
|
|
745
|
-
/** The parked tool call — what `answer`/`skip` route by. */
|
|
746
|
-
toolCallId: string;
|
|
747
|
-
preamble: string | null;
|
|
748
|
-
questions: TranscriptQuestion[];
|
|
749
|
-
questionCount: number;
|
|
750
|
-
/** Still waiting on a human. */
|
|
751
|
-
isPending: boolean;
|
|
752
|
-
/** Every question's current selection is acceptable (no question has an `error`). */
|
|
753
|
-
isValid: boolean;
|
|
754
|
-
outcome: TranscriptElicitationOutcome | null;
|
|
755
|
-
/** A failed submission — the run is still parked, so the form stays live. */
|
|
756
|
-
error: string | null;
|
|
757
|
-
answer: TranscriptSettleState;
|
|
758
|
-
skip: TranscriptSettleState;
|
|
759
|
-
}
|
|
760
|
-
/** One retrieved passage, as it rides a retrieval tool call's output. Mirrors core's `Passage`. */
|
|
761
|
-
interface RetrievedPassage {
|
|
762
|
-
id: string;
|
|
763
|
-
text: string;
|
|
764
|
-
score: number;
|
|
765
|
-
/** Citation-facing origin — a document title, URL or row id. */
|
|
766
|
-
source?: string;
|
|
767
|
-
metadata?: Record<string, unknown>;
|
|
768
|
-
}
|
|
769
|
-
/** The passages of one origin, folded together so a citation line reads once per source. */
|
|
770
|
-
interface TranscriptSource {
|
|
771
|
-
/** The `source` string the retriever stamped, falling back to the passage id when it stamped none. */
|
|
772
|
-
id: string;
|
|
773
|
-
label: string;
|
|
774
|
-
passageCount: number;
|
|
775
|
-
/** Highest relevance among this source's passages; the scale is the retriever's. */
|
|
776
|
-
topScore: number;
|
|
777
|
-
passages: RetrievedPassage[];
|
|
778
|
-
}
|
|
779
|
-
/**
|
|
780
|
-
* The provenance behind an answer: a run of CONSECUTIVE retrieval tool parts, aggregated by origin.
|
|
781
|
-
* Detection is structural — a tool output shaped `{ passages: [{ id, text, ... }] }` — because the
|
|
782
|
-
* tool's NAME is not fixed: inject-mode retrieval persists as `retrieve`, and `createRetrievalTool`
|
|
783
|
-
* lets the host rename `search_knowledge` to anything.
|
|
784
|
-
*/
|
|
785
|
-
interface TranscriptSourcesBlock {
|
|
786
|
-
kind: 'sources';
|
|
787
|
-
key: string;
|
|
788
|
-
/** What was searched, when the tool call recorded a `{ query }` input. */
|
|
789
|
-
query: string | null;
|
|
790
|
-
sources: TranscriptSource[];
|
|
791
|
-
passageCount: number;
|
|
792
|
-
}
|
|
793
|
-
type TranscriptBlock = TranscriptTextBlock | TranscriptFilesBlock | TranscriptReasoningBlock | TranscriptToolBlock | TranscriptSourcesBlock | TranscriptElicitationBlock | TranscriptUiBlock;
|
|
794
|
-
/** Where a question set's selection state is held, and where its settlement is sent. */
|
|
795
|
-
interface ElicitationBlockOptions {
|
|
796
|
-
/** The values a question is showing, or `undefined` while the user has not touched it. */
|
|
797
|
-
picked: (toolCallId: string, questionId: string) => string[] | undefined;
|
|
798
|
-
pick: (toolCallId: string, questionId: string, values: string[]) => void;
|
|
799
|
-
canAnswer: boolean;
|
|
800
|
-
canSkip: boolean;
|
|
801
|
-
answer: (toolCallId: string) => void;
|
|
802
|
-
skip: (toolCallId: string) => void;
|
|
803
|
-
/** Which decision this call is sending, or `null` for none. */
|
|
804
|
-
submitting: (toolCallId: string) => SettleAction | null;
|
|
805
|
-
errorOf: (toolCallId: string) => string | null;
|
|
806
|
-
}
|
|
807
|
-
/** Where an approval decision is sent, and what the last one did. */
|
|
808
|
-
interface ApprovalBlockOptions {
|
|
809
|
-
canApprove: boolean;
|
|
810
|
-
canReject: boolean;
|
|
811
|
-
approve: (toolCallId: string, options?: ApproveOptions) => void;
|
|
812
|
-
reject: (toolCallId: string) => void;
|
|
813
|
-
/** Which decision this call is sending, or `null` for none. */
|
|
814
|
-
submitting: (toolCallId: string) => SettleAction | null;
|
|
815
|
-
errorOf: (toolCallId: string) => string | null;
|
|
816
|
-
}
|
|
817
|
-
interface BuildBlocksOptions {
|
|
818
|
-
/** Disclosure lookup for a reasoning run; `isStreaming` is the fallback when untouched. */
|
|
819
|
-
isReasoningOpen: (key: string, isStreaming: boolean) => boolean;
|
|
820
|
-
toggleReasoning: (key: string, open?: boolean) => void;
|
|
821
|
-
/**
|
|
822
|
-
* Lift retrieval tool parts out of the tool run into a `sources` block. Off by default, so a
|
|
823
|
-
* renderer wired to draw tool cards keeps receiving them as the tool calls they are.
|
|
824
|
-
*/
|
|
825
|
-
sources?: boolean;
|
|
826
|
-
/**
|
|
827
|
-
* Lift a question set out of the tool run into an `elicitation` block. Omitted → it stays a tool
|
|
828
|
-
* card, which is all a host that has nowhere to send an answer could render anyway.
|
|
829
|
-
*/
|
|
830
|
-
elicitation?: ElicitationBlockOptions;
|
|
831
|
-
/** Wire approve/reject onto the calls parked on a human. Omitted → they are reported, not actionable. */
|
|
832
|
-
approval?: ApprovalBlockOptions;
|
|
833
|
-
/** Server-declared tool presentations (`useToolCatalog`), for each call's `description`. */
|
|
834
|
-
toolCatalog?: ToolCatalog;
|
|
835
|
-
}
|
|
836
|
-
/**
|
|
837
|
-
* Walk a message's parts into renderable blocks, buffering consecutive tool parts into one run and
|
|
838
|
-
* consecutive files into one strip. A `data-ui` part becomes a `ui` block. A
|
|
839
|
-
* `data-approval-requested` part is metadata about a call — it is folded into that call's
|
|
840
|
-
* `approval` and takes no position of its own. Other `data-*` parts are dropped rather than guessed
|
|
841
|
-
* at, but they still terminate a tool run — their position in the transcript is meaningful even
|
|
842
|
-
* when their content is not modelled here.
|
|
843
|
-
*/
|
|
844
|
-
declare function buildTranscriptBlocks(message: UIMessage, options: BuildBlocksOptions): TranscriptBlock[];
|
|
845
|
-
/** The message's prose, joined for the clipboard. Reasoning is excluded — it is not the answer. */
|
|
846
|
-
declare function extractMessageText(parts: UIMessage['parts'] | undefined): string;
|
|
847
|
-
interface UsageSummary extends MessageUsageInfo {
|
|
848
|
-
totalTokens: number;
|
|
849
|
-
/** `$0`, `$0.0123`, `$0.012`, `$1.23` — precision follows magnitude so sub-cent turns stay legible. */
|
|
850
|
-
costLabel: string;
|
|
851
|
-
tokensLabel: string;
|
|
852
|
-
}
|
|
853
|
-
declare function describeUsage(usage: MessageUsageInfo): UsageSummary;
|
|
854
|
-
interface TimestampInfo {
|
|
855
|
-
iso: string;
|
|
856
|
-
date: Date;
|
|
857
|
-
/** "just now" / "5 min. ago" / "Mar 3" — see {@link formatRelativeTime}. */
|
|
858
|
-
relative: string;
|
|
859
|
-
absolute: string;
|
|
860
|
-
}
|
|
861
|
-
/** `null` for an unparseable stamp, so a bad `created_at` renders nothing instead of "Invalid Date". */
|
|
862
|
-
declare function describeTimestamp(createdAt: string | null | undefined): TimestampInfo | null;
|
|
863
|
-
/**
|
|
864
|
-
* "just now" within ±10s (server `created_at` can land a few ms ahead of the client clock), a
|
|
865
|
-
* relative phrase up to a week, then a calendar date. Uses Intl.RelativeTimeFormat — no date-fns.
|
|
866
|
-
*/
|
|
867
|
-
declare function formatRelativeTime(date: Date): string;
|
|
318
|
+
declare function ChatInput({ onSubmit, disabled, placeholder, rows, enableSpeech, speechLang, sendLabel, onStop, isStreaming, stopLabel, className, textareaClassName, sendButtonClassName, micButtonClassName, stopButtonClassName, renderMic, }: ChatInputProps): React__default.JSX.Element;
|
|
868
319
|
|
|
869
320
|
interface StickToBottomOptions {
|
|
870
321
|
/**
|
|
@@ -919,8 +370,8 @@ interface TranscriptEditState {
|
|
|
919
370
|
getTextareaProps: () => {
|
|
920
371
|
ref: (element: HTMLTextAreaElement | null) => void;
|
|
921
372
|
value: string;
|
|
922
|
-
onChange: (event:
|
|
923
|
-
onKeyDown: (event:
|
|
373
|
+
onChange: (event: React__default.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
374
|
+
onKeyDown: (event: React__default.KeyboardEvent<HTMLTextAreaElement>) => void;
|
|
924
375
|
};
|
|
925
376
|
}
|
|
926
377
|
interface TranscriptActionState {
|
|
@@ -1050,26 +501,26 @@ interface UseTranscriptItemOptions extends TranscriptItemOptions {
|
|
|
1050
501
|
*/
|
|
1051
502
|
declare function useTranscriptItem(options: UseTranscriptItemOptions): TranscriptItem;
|
|
1052
503
|
|
|
1053
|
-
type RenderToolPartFn = (part: AnyToolUIPart, key: string) =>
|
|
504
|
+
type RenderToolPartFn = (part: AnyToolUIPart, key: string) => React__default.ReactNode;
|
|
1054
505
|
/** Render a run of consecutive tool parts as one block (e.g. a collapsible tool group). */
|
|
1055
|
-
type RenderToolGroupFn = (parts: AnyToolUIPart[], key: string) =>
|
|
506
|
+
type RenderToolGroupFn = (parts: AnyToolUIPart[], key: string) => React__default.ReactNode;
|
|
1056
507
|
/** Render a message's text — pass a markdown renderer (e.g. `AgentMarkdown`) here if desired. */
|
|
1057
508
|
type RenderTextFn = (text: string, ctx: {
|
|
1058
509
|
isStreaming: boolean;
|
|
1059
|
-
}) =>
|
|
510
|
+
}) => React__default.ReactNode;
|
|
1060
511
|
/** Render a run of files — attachments on a user turn, or files the model produced. */
|
|
1061
|
-
type RenderFilesFn = (files: TranscriptFile[]) =>
|
|
512
|
+
type RenderFilesFn = (files: TranscriptFile[]) => React__default.ReactNode;
|
|
1062
513
|
/**
|
|
1063
514
|
* Render a component the server pushed into the message — look `block.component` up in your own
|
|
1064
515
|
* registry. Omitted → pushed components are not drawn (there is no sensible default for an app's
|
|
1065
516
|
* own component).
|
|
1066
517
|
*/
|
|
1067
|
-
type RenderUiFn = (block: TranscriptUiBlock) =>
|
|
518
|
+
type RenderUiFn = (block: TranscriptUiBlock) => React__default.ReactNode;
|
|
1068
519
|
/** Render the body of a reasoning run; the disclosure toggle around it stays this component's. */
|
|
1069
520
|
type RenderReasoningFn = (text: string, ctx: {
|
|
1070
521
|
isStreaming: boolean;
|
|
1071
522
|
isOpen: boolean;
|
|
1072
|
-
}) =>
|
|
523
|
+
}) => React__default.ReactNode;
|
|
1073
524
|
interface MessageItemClassNames {
|
|
1074
525
|
root?: string;
|
|
1075
526
|
/** Resolved per role so user/assistant/system bubbles can differ. */
|
|
@@ -1103,9 +554,9 @@ interface MessageRenderSlots {
|
|
|
1103
554
|
* Extra content for the action row, after the built-in affordances and before usage — a badge
|
|
1104
555
|
* naming which agent answered, a status pill. Rendered for every message that has an action row.
|
|
1105
556
|
*/
|
|
1106
|
-
meta?:
|
|
557
|
+
meta?: React__default.ReactNode;
|
|
1107
558
|
/** Label on the reasoning disclosure toggle. Default `"Reasoning"`. */
|
|
1108
|
-
reasoningLabel?:
|
|
559
|
+
reasoningLabel?: React__default.ReactNode;
|
|
1109
560
|
classNames?: MessageItemClassNames;
|
|
1110
561
|
}
|
|
1111
562
|
interface MessageItemProps extends MessageRenderSlots {
|
|
@@ -1138,9 +589,9 @@ interface MessageItemViewProps extends MessageRenderSlots {
|
|
|
1138
589
|
* All of the logic lives in `useTranscriptItem`; this is one rendering of it. An app that wants
|
|
1139
590
|
* different markup drives that hook and writes its own.
|
|
1140
591
|
*/
|
|
1141
|
-
declare function MessageItem({ message, isStreaming, editable, onEditSubmit, regeneratable, onRegenerate, onFork, usage, createdAt, ...slots }: MessageItemProps):
|
|
592
|
+
declare function MessageItem({ message, isStreaming, editable, onEditSubmit, regeneratable, onRegenerate, onFork, usage, createdAt, ...slots }: MessageItemProps): React__default.JSX.Element;
|
|
1142
593
|
/** The default markup for one modelled message — what `MessageItem` renders once it has an item. */
|
|
1143
|
-
declare function MessageItemView({ item, ...slots }: MessageItemViewProps):
|
|
594
|
+
declare function MessageItemView({ item, ...slots }: MessageItemViewProps): React__default.JSX.Element;
|
|
1144
595
|
|
|
1145
596
|
interface MessageListClassNames {
|
|
1146
597
|
root?: string;
|
|
@@ -1165,9 +616,9 @@ interface MessageListProps {
|
|
|
1165
616
|
renderFiles?: RenderFilesFn;
|
|
1166
617
|
/** Draw a server-pushed component (a `ui` stream frame). Omitted → not drawn. */
|
|
1167
618
|
renderUi?: RenderUiFn;
|
|
1168
|
-
reasoningLabel?:
|
|
619
|
+
reasoningLabel?: React__default.ReactNode;
|
|
1169
620
|
/** Extra content for one message's action row — e.g. a badge naming which agent answered. */
|
|
1170
|
-
getMeta?: (message: UIMessage) =>
|
|
621
|
+
getMeta?: (message: UIMessage) => React__default.ReactNode;
|
|
1171
622
|
/** When set, every message gets a "Fork" affordance calling back with its id. */
|
|
1172
623
|
onFork?: (uiMessageId: string) => void | Promise<void>;
|
|
1173
624
|
/** User messages get an inline edit-and-resubmit affordance. */
|
|
@@ -1180,9 +631,9 @@ interface MessageListProps {
|
|
|
1180
631
|
getUsage?: (message: UIMessage) => MessageUsageInfo | null;
|
|
1181
632
|
getCreatedAt?: (message: UIMessage) => string | null;
|
|
1182
633
|
/** Shown (with example/follow-up chips) when idle and empty. */
|
|
1183
|
-
emptyState?:
|
|
634
|
+
emptyState?: React__default.ReactNode;
|
|
1184
635
|
/** Node rendered while waiting for the first assistant token. */
|
|
1185
|
-
typingIndicator?:
|
|
636
|
+
typingIndicator?: React__default.ReactNode;
|
|
1186
637
|
/** AI-generated follow-up prompts under the last assistant message. */
|
|
1187
638
|
followUps?: string[] | null;
|
|
1188
639
|
onFollowUpClick?: (text: string) => void;
|
|
@@ -1200,7 +651,7 @@ interface MessageListProps {
|
|
|
1200
651
|
* Every decision here comes from `useChatTranscript`; the file below it is markup. A host that
|
|
1201
652
|
* wants a different layout drives that hook directly and never imports this component.
|
|
1202
653
|
*/
|
|
1203
|
-
declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps):
|
|
654
|
+
declare function MessageList({ messages, status, renderToolPart, renderToolGroup, renderText, renderReasoning, renderFiles, renderUi, reasoningLabel, getMeta, onFork, editable, onEditSubmit, regeneratable, onRegenerate, getUsage, getCreatedAt, emptyState, typingIndicator, followUps, onFollowUpClick, error, onRetry, classNames, }: MessageListProps): React__default.JSX.Element;
|
|
1204
655
|
|
|
1205
656
|
/**
|
|
1206
657
|
* Languages the dictation mic offers. The Web Speech API expects a
|
|
@@ -1370,10 +821,10 @@ interface UseComposerAutocompleteOptions {
|
|
|
1370
821
|
}
|
|
1371
822
|
interface AutocompleteInputProps {
|
|
1372
823
|
ref: (element: HTMLTextAreaElement | HTMLInputElement | null) => void;
|
|
1373
|
-
onChange: (event:
|
|
1374
|
-
onKeyDown: (event:
|
|
1375
|
-
onSelect: (event:
|
|
1376
|
-
onClick: (event:
|
|
824
|
+
onChange: (event: React__default.ChangeEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
825
|
+
onKeyDown: (event: React__default.KeyboardEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
826
|
+
onSelect: (event: React__default.SyntheticEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
827
|
+
onClick: (event: React__default.MouseEvent<HTMLTextAreaElement | HTMLInputElement>) => void;
|
|
1377
828
|
role: 'combobox';
|
|
1378
829
|
'aria-expanded': boolean;
|
|
1379
830
|
'aria-autocomplete': 'list';
|
|
@@ -1756,4 +1207,4 @@ declare function useAgentChat(options: UseAgentChatOptions): {
|
|
|
1756
1207
|
clearError: () => void;
|
|
1757
1208
|
};
|
|
1758
1209
|
|
|
1759
|
-
export { AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentStreamMeta, type AggregatedTurnUsage,
|
|
1210
|
+
export { AgentChatTransport, type AgentChatTransportOptions, AgentClient, type AgentClientOptions, AgentHttpError, type AgentStreamMeta, type AggregatedTurnUsage, AnyToolUIPart, type ApprovalCountdown, ApproveOptions, type AutocompleteInputProps, type AutocompleteItem, type AutocompleteListboxProps, type AutocompleteOptionProps, type AutocompleteSource, type BackgroundRun, type CancelResult, type ChatBackground, ChatInput, type ChatInputProps, ChatStatus, type ChatTranscript, type CompletionEdit, type ComposerAutocomplete, DEFAULT_SPEECH_LANG, MessageItem, type MessageItemClassNames, type MessageItemProps, MessageItemView, type MessageItemViewProps, MessageList, type MessageListClassNames, type MessageListProps, MessageUsageInfo, type QuotaToday, type RenderFilesFn, type RenderReasoningFn, type RenderTextFn, type RenderToolGroupFn, type RenderToolPartFn, type RenderUiFn, SPEECH_LANGUAGES, type SkillSuggestionData, type SkillsSourceOptions, type SpeechLanguage, type SpeechRecognitionHook, type StickToBottom, type StickToBottomOptions, type StoredTurnMetadata, type ThreadPatch, TimestampInfo, ToolCatalog, type ToolCatalogState, type TranscriptActionState, TranscriptBlock, type TranscriptCopyState, type TranscriptEditState, TranscriptFile, type TranscriptItem, type TranscriptItemOptions, type TranscriptStopState, TranscriptUiBlock, type TranscriptWindow, type TriggerMatch, type TriggerPosition, UsageSummary, type UseAgentChatOptions, type UseApprovalCountdownOptions, type UseChatTranscriptOptions, type UseComposerAutocompleteOptions, type UseElapsedOptions, type UseSpeechRecognitionOptions, type UseToolCatalogOptions, type UseTranscriptItemOptions, applyCompletion, approvalCountdown, backgroundRunsFromThread, createSkillsSource, filterAutocompleteItems, findActiveTrigger, formatElapsed, loadStoredSpeechLang, persistSpeechLang, readReasoningMs, storedMessageToUiMessage, storedThreadToUiMessages, useAgentChat, useApprovalCountdown, useChatTranscript, useComposerAutocomplete, useElapsed, useSpeechRecognition, useStickToBottom, useToolCatalog, useTranscriptItem };
|