@dudousxd/nestjs-agent-react 0.26.0 → 0.28.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 +51 -1
- package/dist/{client-D4ZSbZJ8.d.cts → client-CKwSMitS.d.cts} +88 -2
- package/dist/{client-D4ZSbZJ8.d.ts → client-CKwSMitS.d.ts} +88 -2
- package/dist/{generative-ui-BejHxxbR.d.cts → generative-ui-jT9TYfCi.d.cts} +1 -1
- package/dist/{generative-ui-BejHxxbR.d.ts → generative-ui-jT9TYfCi.d.ts} +1 -1
- package/dist/genui-json-render.cjs +202 -370
- package/dist/genui-json-render.cjs.map +1 -1
- package/dist/genui-json-render.d.cts +1 -1
- package/dist/genui-json-render.d.ts +1 -1
- package/dist/genui-json-render.js +209 -373
- package/dist/genui-json-render.js.map +1 -1
- package/dist/genui.cjs +178 -320
- package/dist/genui.cjs.map +1 -1
- package/dist/genui.d.cts +2 -2
- package/dist/genui.d.ts +2 -2
- package/dist/genui.js +185 -323
- package/dist/genui.js.map +1 -1
- package/dist/index.cjs +2266 -2479
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +193 -13
- package/dist/index.d.ts +193 -13
- package/dist/index.js +2292 -2487
- package/dist/index.js.map +1 -1
- package/dist/markdown.cjs +23 -36
- package/dist/markdown.cjs.map +1 -1
- package/dist/markdown.js +23 -28
- package/dist/markdown.js.map +1 -1
- package/dist/media.cjs +46 -79
- package/dist/media.cjs.map +1 -1
- package/dist/media.d.cts +1 -1
- package/dist/media.d.ts +1 -1
- package/dist/media.js +46 -81
- package/dist/media.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ handlers passed. On top of the AI SDK chat it returns:
|
|
|
37
37
|
| On `chat` | What it is |
|
|
38
38
|
|---|---|
|
|
39
39
|
| `transcript` | `useChatTranscript` already bound to the chat — approve/reject/answer/skip, stop, fork, regenerate, the tool catalog, and timestamps/usage read from message metadata. Override any of it with `useAgentChat({ transcript: { … } })`. |
|
|
40
|
-
| `composer` | `{ text, setText, files, canSend, blockedBy, submit() }` — `files` is `useAttachments` on the chat's backend; `submit()` sends the draft with the ready files attached and clears both; `blockedBy` is `'empty' \| 'busy' \| 'uploading' \| 'quota'
|
|
40
|
+
| `composer` | `{ text, setText, files, canSend, blockedBy, submit() }` — `files` is `useAttachments` on the chat's backend; `submit()` sends the draft with the ready files attached and clears both — while a turn runs it QUEUES it (see *Typing ahead*), and `submit({ mode: 'interrupt' \| 'queue' })` picks what happens mid-turn for that one send; `blockedBy` is `'empty' \| 'busy' \| 'uploading' \| 'quota'` (`'busy'` only with `whileRunning: 'block'`). |
|
|
41
|
+
| `queue` | `{ items, paused, isSupported, add(text, { attachments?, mode? }), remove(id), interrupt(id), edit(id, text), move(id, index), clear(), resume(), error }` — messages sent mid-turn, waiting server-side for the running turn to settle. |
|
|
41
42
|
| `models` | `{ list, providers, selected, pinned, locked, select(id), pinToThread(id) }` — loaded the first time `list` is read. |
|
|
42
43
|
| `quota` / `blocked` | `useQuota`'s state, and the window blocking sends (the `blocked` option overrides it). |
|
|
43
44
|
| `approve` / `reject` / `answer` / `skip` | `({ toolCallId, … })` — the same object shape the transcript's handlers take. |
|
|
@@ -580,6 +581,55 @@ const readCookie = (name: string) =>
|
|
|
580
581
|
</AgentProvider>;
|
|
581
582
|
```
|
|
582
583
|
|
|
584
|
+
### Typing ahead: the message queue
|
|
585
|
+
|
|
586
|
+
Send while a turn is still answering and the message waits in the thread's queue — server-side, so
|
|
587
|
+
it survives a reload or a closed tab — and runs the moment the turn settles. Nothing to wire:
|
|
588
|
+
`composer.submit()` and `sendMessage` queue on their own mid-turn, and the chat attaches to the
|
|
589
|
+
queued turn when it starts.
|
|
590
|
+
|
|
591
|
+
```tsx
|
|
592
|
+
const chat = useAgentChat({ threadId });
|
|
593
|
+
// …render chat.transcript.items, then what is waiting:
|
|
594
|
+
{chat.transcript.queued.map((item) => (
|
|
595
|
+
<div key={item.id} data-state={item.state /* 'sending' | 'queued' | 'paused' */}>
|
|
596
|
+
{item.text}
|
|
597
|
+
{item.remove.available && <button onClick={item.remove.run}>Remove</button>}
|
|
598
|
+
</div>
|
|
599
|
+
))}
|
|
600
|
+
{chat.queue.paused && (
|
|
601
|
+
<button onClick={() => chat.queue.resume()}>
|
|
602
|
+
Paused ({chat.queue.paused.reason}) — resume
|
|
603
|
+
</button>
|
|
604
|
+
)}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
- `useAgentChat({ whileRunning })`: `'queue'` (default), `'interrupt'` (cancel the running turn and
|
|
608
|
+
run this next), or `'block'` (refuse, `composer.blockedBy === 'busy'` — the old behaviour, also
|
|
609
|
+
what a backend without `enqueueMessage` gets).
|
|
610
|
+
- One send can answer differently from the chat's `whileRunning`: `composer.submit({ mode })` and
|
|
611
|
+
`sendMessage(message, { mode })` take `'queue'` or `'interrupt'` — a "send now" button next to a
|
|
612
|
+
plain send that queues. The composer clears its own draft and files either way; with nothing
|
|
613
|
+
running, `mode` means nothing and the message is simply sent. It also lifts `'block'` for that
|
|
614
|
+
send.
|
|
615
|
+
- `chat.queue.edit(id, text)`, `move(id, index)`, `remove(id)`, `clear()` change what is waiting;
|
|
616
|
+
`add(text, { attachments, mode })` queues from your own code.
|
|
617
|
+
- `chat.queue.interrupt(id)` runs a message that is already waiting NOW: it moves to the head as an
|
|
618
|
+
interrupt and the running turn is cancelled for it, in one server call (the message keeps its id
|
|
619
|
+
and never leaves the queue — do not `remove` and `add` it again). With nothing running it starts
|
|
620
|
+
at once.
|
|
621
|
+
- A waiting message's files have the shape a sent message's do: `chat.queue.items[n].files` is
|
|
622
|
+
`MessageFile[]` — what `messageFiles(message)` gives — and `chat.transcript.queued[n].files` is the
|
|
623
|
+
same plus `isImage`, so one file renderer draws both. `attachmentFile(attachment)` makes one from
|
|
624
|
+
an uploaded `MessageAttachment`.
|
|
625
|
+
- The queue pauses behind a failed turn (`run_failed`), a Stop (`cancelled`) or an exhausted quota
|
|
626
|
+
(`quota_exceeded`); `chat.queue.paused` says which, `resume()` lifts it. A queue left waiting with
|
|
627
|
+
nothing running is started when the thread loads.
|
|
628
|
+
- A send that the server queued anyway (another tab was mid-turn) moves into `chat.queue` instead of
|
|
629
|
+
showing as a sent message.
|
|
630
|
+
|
|
631
|
+
The wire contract (for a backend of your own) is *Message queue* in docs/stream-protocol.md.
|
|
632
|
+
|
|
583
633
|
### Reconnecting a dropped stream
|
|
584
634
|
|
|
585
635
|
A server that numbers its frames (SSE `id:`, as this library's does) can be resumed: when the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
|
|
1
|
+
import { ChatQueueState, ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* What a server said when it refused a request, read once so every error class of this package
|
|
@@ -68,6 +68,39 @@ interface ChatStreamResponse {
|
|
|
68
68
|
body: ReadableStream<Uint8Array>;
|
|
69
69
|
runId?: string;
|
|
70
70
|
threadId?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The server queued the message instead of starting a turn (`202`): the thread already had one
|
|
73
|
+
* running — another tab, another device. `body` is then empty; the transport reports this as a
|
|
74
|
+
* transient `data-queue` part and `useAgentChat` moves the message into `chat.queue`.
|
|
75
|
+
*/
|
|
76
|
+
queued?: QueuedSendResult;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `POST <base>/chat` answered `202`: the message waits in the thread's queue (see
|
|
80
|
+
* docs/stream-protocol.md, "Message queue").
|
|
81
|
+
*/
|
|
82
|
+
interface QueuedSendResult {
|
|
83
|
+
queued: true;
|
|
84
|
+
threadId: string;
|
|
85
|
+
/** The queued message's id — also the id of the run it will start. */
|
|
86
|
+
messageId: string;
|
|
87
|
+
/** 0-based place in the queue when it was queued. */
|
|
88
|
+
position: number;
|
|
89
|
+
queue: ChatQueueState;
|
|
90
|
+
/** Set when it started straight away (the thread was idle after all): attach to this run. */
|
|
91
|
+
runId?: string;
|
|
92
|
+
/** The run an interrupt cancelled to make room for it. */
|
|
93
|
+
interrupting?: string;
|
|
94
|
+
}
|
|
95
|
+
/** What `PATCH <base>/queue/:messageId` takes. */
|
|
96
|
+
interface QueuedMessageUpdate {
|
|
97
|
+
message?: string;
|
|
98
|
+
/** `[{ mediaId }]` refs replacing the message's attachments; `null` drops them. */
|
|
99
|
+
attachments?: Array<{
|
|
100
|
+
mediaId: string;
|
|
101
|
+
}> | null;
|
|
102
|
+
/** Move it to this 0-based place in the queue. */
|
|
103
|
+
position?: number;
|
|
71
104
|
}
|
|
72
105
|
/** What `POST <base>/messages/:id/feedback` takes. `value: null` clears the rating. */
|
|
73
106
|
interface MessageFeedbackInput {
|
|
@@ -123,6 +156,34 @@ interface AgentBackend {
|
|
|
123
156
|
getThread(id: string): Promise<ThreadDetail>;
|
|
124
157
|
updateThread(id: string, patch: ThreadPatch): Promise<unknown>;
|
|
125
158
|
deleteThread(id: string): Promise<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* Queue a message on a thread (`POST <base>/chat` with `mode: 'queue'` or `'interrupt'`), which
|
|
161
|
+
* the server answers with `202` JSON rather than a stream. What `chat.queue` sends through; a
|
|
162
|
+
* backend without it keeps the composer blocked while a turn runs.
|
|
163
|
+
*/
|
|
164
|
+
enqueueMessage?(request: ChatStreamRequest): Promise<QueuedSendResult>;
|
|
165
|
+
/** `GET <base>/threads/:id/queue`. */
|
|
166
|
+
getQueue?(threadId: string): Promise<ChatQueueState>;
|
|
167
|
+
/** `PATCH <base>/queue/:messageId` — edit and/or move a waiting message. */
|
|
168
|
+
updateQueuedMessage?(messageId: string, update: QueuedMessageUpdate): Promise<ChatQueueState>;
|
|
169
|
+
/** `DELETE <base>/queue/:messageId`. */
|
|
170
|
+
removeQueuedMessage?(messageId: string): Promise<ChatQueueState>;
|
|
171
|
+
/**
|
|
172
|
+
* `POST <base>/queue/:messageId/interrupt` — run a waiting message now: it moves to the head as an
|
|
173
|
+
* interrupt and the running turn is cancelled for it. `interrupting` is the run that was
|
|
174
|
+
* cancelled; `runId` is set instead when nothing was running and the message started at once.
|
|
175
|
+
* What `chat.queue.interrupt(id)` calls.
|
|
176
|
+
*/
|
|
177
|
+
interruptQueuedMessage?(messageId: string): Promise<ChatQueueState & {
|
|
178
|
+
runId?: string;
|
|
179
|
+
interrupting?: string;
|
|
180
|
+
}>;
|
|
181
|
+
/** `DELETE <base>/threads/:id/queue`. */
|
|
182
|
+
clearQueue?(threadId: string): Promise<ChatQueueState>;
|
|
183
|
+
/** `POST <base>/threads/:id/queue/resume` — `runId` when the head started. */
|
|
184
|
+
resumeQueue?(threadId: string): Promise<ChatQueueState & {
|
|
185
|
+
runId?: string;
|
|
186
|
+
}>;
|
|
126
187
|
forkFromMessage?(threadId: string, messageId: string): Promise<ThreadSummary>;
|
|
127
188
|
promoteThread?(id: string): Promise<unknown>;
|
|
128
189
|
truncateFromMessage?(threadId: string, messageId: string): Promise<unknown>;
|
|
@@ -251,6 +312,31 @@ declare class AgentClient implements AgentBackend {
|
|
|
251
312
|
constructor(options?: AgentClientOptions);
|
|
252
313
|
/** `POST <path>/chat` → the turn's SSE stream. Throws {@link AgentHttpError} on a non-2xx. */
|
|
253
314
|
openChatStream(request: ChatStreamRequest): Promise<ChatStreamResponse>;
|
|
315
|
+
/**
|
|
316
|
+
* `POST <path>/chat` for a message that should wait in the thread's queue — the body carries
|
|
317
|
+
* `mode: 'queue'` (or `'interrupt'`), which the server always answers with `202` JSON.
|
|
318
|
+
*/
|
|
319
|
+
enqueueMessage(request: ChatStreamRequest): Promise<QueuedSendResult>;
|
|
320
|
+
/** `GET <path>/threads/:id/queue` — the thread's waiting messages, and whether it drains. */
|
|
321
|
+
getQueue(threadId: string): Promise<ChatQueueState>;
|
|
322
|
+
/** `PATCH <path>/queue/:messageId` — change a waiting message's text/attachments, or move it. */
|
|
323
|
+
updateQueuedMessage(messageId: string, update: QueuedMessageUpdate): Promise<ChatQueueState>;
|
|
324
|
+
/** `DELETE <path>/queue/:messageId`. */
|
|
325
|
+
removeQueuedMessage(messageId: string): Promise<ChatQueueState>;
|
|
326
|
+
/**
|
|
327
|
+
* `POST <path>/queue/:messageId/interrupt` — run a waiting message now, cancelling the running
|
|
328
|
+
* turn for it. `runId` when nothing was running and it started; else `interrupting`.
|
|
329
|
+
*/
|
|
330
|
+
interruptQueuedMessage(messageId: string): Promise<ChatQueueState & {
|
|
331
|
+
runId?: string;
|
|
332
|
+
interrupting?: string;
|
|
333
|
+
}>;
|
|
334
|
+
/** `DELETE <path>/threads/:id/queue` — drop every waiting message. */
|
|
335
|
+
clearQueue(threadId: string): Promise<ChatQueueState>;
|
|
336
|
+
/** `POST <path>/threads/:id/queue/resume` — lift a pause; `runId` when the head started. */
|
|
337
|
+
resumeQueue(threadId: string): Promise<ChatQueueState & {
|
|
338
|
+
runId?: string;
|
|
339
|
+
}>;
|
|
254
340
|
/**
|
|
255
341
|
* `GET <path>/chat/:runId/stream[?after=<seq>]` → the run's SSE stream, or `null` when nothing is
|
|
256
342
|
* streaming under that id (404).
|
|
@@ -350,4 +436,4 @@ declare class AgentClient implements AgentBackend {
|
|
|
350
436
|
private handleResponse;
|
|
351
437
|
}
|
|
352
438
|
|
|
353
|
-
export { type AgentBackend as A, type CancelResult as C, type ErrorAnswer as E, type HttpErrorListener as H, type MessageFeedbackInput as M, type ResumeStreamRequest as R, type ThreadPatch as T, type UploadAttachmentOptions as U, type AttachmentUploadStrategy as a, AgentBackendUnsupportedError as b, AgentClient as c, type AgentClientOptions as d, type AgentConnection as e, AgentHttpError as f, type AgentRequestError as g, type ChatStreamRequest as h, type ChatStreamResponse as i, requireBackendMethod as r };
|
|
439
|
+
export { type AgentBackend as A, type CancelResult as C, type ErrorAnswer as E, type HttpErrorListener as H, type MessageFeedbackInput as M, type QueuedMessageUpdate as Q, type ResumeStreamRequest as R, type ThreadPatch as T, type UploadAttachmentOptions as U, type AttachmentUploadStrategy as a, AgentBackendUnsupportedError as b, AgentClient as c, type AgentClientOptions as d, type AgentConnection as e, AgentHttpError as f, type AgentRequestError as g, type ChatStreamRequest as h, type ChatStreamResponse as i, type QueuedSendResult as j, requireBackendMethod as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
|
|
1
|
+
import { ChatQueueState, ThreadSummary, ThreadDetail, MessageAttachment, ToolCatalogEntry, SkillCatalogEntry, QuotaReport, ModelCatalogView, AgentCatalogEntry, AgentClientConfig, MessageFeedbackValue, MessageFeedback } from '@dudousxd/nestjs-agent-core';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* What a server said when it refused a request, read once so every error class of this package
|
|
@@ -68,6 +68,39 @@ interface ChatStreamResponse {
|
|
|
68
68
|
body: ReadableStream<Uint8Array>;
|
|
69
69
|
runId?: string;
|
|
70
70
|
threadId?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The server queued the message instead of starting a turn (`202`): the thread already had one
|
|
73
|
+
* running — another tab, another device. `body` is then empty; the transport reports this as a
|
|
74
|
+
* transient `data-queue` part and `useAgentChat` moves the message into `chat.queue`.
|
|
75
|
+
*/
|
|
76
|
+
queued?: QueuedSendResult;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* `POST <base>/chat` answered `202`: the message waits in the thread's queue (see
|
|
80
|
+
* docs/stream-protocol.md, "Message queue").
|
|
81
|
+
*/
|
|
82
|
+
interface QueuedSendResult {
|
|
83
|
+
queued: true;
|
|
84
|
+
threadId: string;
|
|
85
|
+
/** The queued message's id — also the id of the run it will start. */
|
|
86
|
+
messageId: string;
|
|
87
|
+
/** 0-based place in the queue when it was queued. */
|
|
88
|
+
position: number;
|
|
89
|
+
queue: ChatQueueState;
|
|
90
|
+
/** Set when it started straight away (the thread was idle after all): attach to this run. */
|
|
91
|
+
runId?: string;
|
|
92
|
+
/** The run an interrupt cancelled to make room for it. */
|
|
93
|
+
interrupting?: string;
|
|
94
|
+
}
|
|
95
|
+
/** What `PATCH <base>/queue/:messageId` takes. */
|
|
96
|
+
interface QueuedMessageUpdate {
|
|
97
|
+
message?: string;
|
|
98
|
+
/** `[{ mediaId }]` refs replacing the message's attachments; `null` drops them. */
|
|
99
|
+
attachments?: Array<{
|
|
100
|
+
mediaId: string;
|
|
101
|
+
}> | null;
|
|
102
|
+
/** Move it to this 0-based place in the queue. */
|
|
103
|
+
position?: number;
|
|
71
104
|
}
|
|
72
105
|
/** What `POST <base>/messages/:id/feedback` takes. `value: null` clears the rating. */
|
|
73
106
|
interface MessageFeedbackInput {
|
|
@@ -123,6 +156,34 @@ interface AgentBackend {
|
|
|
123
156
|
getThread(id: string): Promise<ThreadDetail>;
|
|
124
157
|
updateThread(id: string, patch: ThreadPatch): Promise<unknown>;
|
|
125
158
|
deleteThread(id: string): Promise<unknown>;
|
|
159
|
+
/**
|
|
160
|
+
* Queue a message on a thread (`POST <base>/chat` with `mode: 'queue'` or `'interrupt'`), which
|
|
161
|
+
* the server answers with `202` JSON rather than a stream. What `chat.queue` sends through; a
|
|
162
|
+
* backend without it keeps the composer blocked while a turn runs.
|
|
163
|
+
*/
|
|
164
|
+
enqueueMessage?(request: ChatStreamRequest): Promise<QueuedSendResult>;
|
|
165
|
+
/** `GET <base>/threads/:id/queue`. */
|
|
166
|
+
getQueue?(threadId: string): Promise<ChatQueueState>;
|
|
167
|
+
/** `PATCH <base>/queue/:messageId` — edit and/or move a waiting message. */
|
|
168
|
+
updateQueuedMessage?(messageId: string, update: QueuedMessageUpdate): Promise<ChatQueueState>;
|
|
169
|
+
/** `DELETE <base>/queue/:messageId`. */
|
|
170
|
+
removeQueuedMessage?(messageId: string): Promise<ChatQueueState>;
|
|
171
|
+
/**
|
|
172
|
+
* `POST <base>/queue/:messageId/interrupt` — run a waiting message now: it moves to the head as an
|
|
173
|
+
* interrupt and the running turn is cancelled for it. `interrupting` is the run that was
|
|
174
|
+
* cancelled; `runId` is set instead when nothing was running and the message started at once.
|
|
175
|
+
* What `chat.queue.interrupt(id)` calls.
|
|
176
|
+
*/
|
|
177
|
+
interruptQueuedMessage?(messageId: string): Promise<ChatQueueState & {
|
|
178
|
+
runId?: string;
|
|
179
|
+
interrupting?: string;
|
|
180
|
+
}>;
|
|
181
|
+
/** `DELETE <base>/threads/:id/queue`. */
|
|
182
|
+
clearQueue?(threadId: string): Promise<ChatQueueState>;
|
|
183
|
+
/** `POST <base>/threads/:id/queue/resume` — `runId` when the head started. */
|
|
184
|
+
resumeQueue?(threadId: string): Promise<ChatQueueState & {
|
|
185
|
+
runId?: string;
|
|
186
|
+
}>;
|
|
126
187
|
forkFromMessage?(threadId: string, messageId: string): Promise<ThreadSummary>;
|
|
127
188
|
promoteThread?(id: string): Promise<unknown>;
|
|
128
189
|
truncateFromMessage?(threadId: string, messageId: string): Promise<unknown>;
|
|
@@ -251,6 +312,31 @@ declare class AgentClient implements AgentBackend {
|
|
|
251
312
|
constructor(options?: AgentClientOptions);
|
|
252
313
|
/** `POST <path>/chat` → the turn's SSE stream. Throws {@link AgentHttpError} on a non-2xx. */
|
|
253
314
|
openChatStream(request: ChatStreamRequest): Promise<ChatStreamResponse>;
|
|
315
|
+
/**
|
|
316
|
+
* `POST <path>/chat` for a message that should wait in the thread's queue — the body carries
|
|
317
|
+
* `mode: 'queue'` (or `'interrupt'`), which the server always answers with `202` JSON.
|
|
318
|
+
*/
|
|
319
|
+
enqueueMessage(request: ChatStreamRequest): Promise<QueuedSendResult>;
|
|
320
|
+
/** `GET <path>/threads/:id/queue` — the thread's waiting messages, and whether it drains. */
|
|
321
|
+
getQueue(threadId: string): Promise<ChatQueueState>;
|
|
322
|
+
/** `PATCH <path>/queue/:messageId` — change a waiting message's text/attachments, or move it. */
|
|
323
|
+
updateQueuedMessage(messageId: string, update: QueuedMessageUpdate): Promise<ChatQueueState>;
|
|
324
|
+
/** `DELETE <path>/queue/:messageId`. */
|
|
325
|
+
removeQueuedMessage(messageId: string): Promise<ChatQueueState>;
|
|
326
|
+
/**
|
|
327
|
+
* `POST <path>/queue/:messageId/interrupt` — run a waiting message now, cancelling the running
|
|
328
|
+
* turn for it. `runId` when nothing was running and it started; else `interrupting`.
|
|
329
|
+
*/
|
|
330
|
+
interruptQueuedMessage(messageId: string): Promise<ChatQueueState & {
|
|
331
|
+
runId?: string;
|
|
332
|
+
interrupting?: string;
|
|
333
|
+
}>;
|
|
334
|
+
/** `DELETE <path>/threads/:id/queue` — drop every waiting message. */
|
|
335
|
+
clearQueue(threadId: string): Promise<ChatQueueState>;
|
|
336
|
+
/** `POST <path>/threads/:id/queue/resume` — lift a pause; `runId` when the head started. */
|
|
337
|
+
resumeQueue(threadId: string): Promise<ChatQueueState & {
|
|
338
|
+
runId?: string;
|
|
339
|
+
}>;
|
|
254
340
|
/**
|
|
255
341
|
* `GET <path>/chat/:runId/stream[?after=<seq>]` → the run's SSE stream, or `null` when nothing is
|
|
256
342
|
* streaming under that id (404).
|
|
@@ -350,4 +436,4 @@ declare class AgentClient implements AgentBackend {
|
|
|
350
436
|
private handleResponse;
|
|
351
437
|
}
|
|
352
438
|
|
|
353
|
-
export { type AgentBackend as A, type CancelResult as C, type ErrorAnswer as E, type HttpErrorListener as H, type MessageFeedbackInput as M, type ResumeStreamRequest as R, type ThreadPatch as T, type UploadAttachmentOptions as U, type AttachmentUploadStrategy as a, AgentBackendUnsupportedError as b, AgentClient as c, type AgentClientOptions as d, type AgentConnection as e, AgentHttpError as f, type AgentRequestError as g, type ChatStreamRequest as h, type ChatStreamResponse as i, requireBackendMethod as r };
|
|
439
|
+
export { type AgentBackend as A, type CancelResult as C, type ErrorAnswer as E, type HttpErrorListener as H, type MessageFeedbackInput as M, type QueuedMessageUpdate as Q, type ResumeStreamRequest as R, type ThreadPatch as T, type UploadAttachmentOptions as U, type AttachmentUploadStrategy as a, AgentBackendUnsupportedError as b, AgentClient as c, type AgentClientOptions as d, type AgentConnection as e, AgentHttpError as f, type AgentRequestError as g, type ChatStreamRequest as h, type ChatStreamResponse as i, type QueuedSendResult as j, requireBackendMethod as r };
|
|
@@ -726,4 +726,4 @@ interface GenerativeUIProps extends Partial<GenerativeUIOptions> {
|
|
|
726
726
|
*/
|
|
727
727
|
declare function GenerativeUI({ part, registry, catalog, resolveComponent, treeRenderer, fallback: ownFallback, loading: ownLoading, onError: ownOnError, }: GenerativeUIProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
728
728
|
|
|
729
|
-
export { type TranscriptQuestionOption as $, type ApproveOptions as A, type BuildBlocksOptions as B, type ChatStatus as C, type CoercibleQuestion as D, type DescribeToolCallOptions as E, type ElicitationBlockOptions as F, type GenerativeUIItem as G, type GroupToolActivityOptions as H, type RawAnswer as I, type ResolvedReading as J, type ResolvedResultView as K, type RetrievedPassage as L, type MessageUsageInfo as M, type ToolActivityGroup as N, type ToolCallDescription as O, type ToolCallState as P, type ToolCallStatus as Q, type ResolveComponent as R, type SettleAction as S, type TranscriptUiBlock as T, type UsageSummary as U, type TranscriptApproval as V, type TranscriptApprovalStatus as W, type TranscriptElicitationBlock as X, type TranscriptElicitationOutcome as Y, type TranscriptFilesBlock as Z, type TranscriptQuestion as _, GENUI_TREE_COMPONENT as a, type TranscriptReasoningBlock as a0, type TranscriptSettleState as a1, type TranscriptSource as a2, type TranscriptSourcesBlock as a3, type TranscriptTextBlock as a4, type TranscriptToolBlock as a5, type TranscriptToolCall as a6, buildTranscriptBlocks as a7, coerceAnswer as a8, correctedCallIds as a9, describeTimestamp as aa, describeToolCall as ab, describeUsage as ac, extractMessageText as ad, fillTemplate as ae, formatRelativeTime as af, groupToolActivity as ag, inferResultView as ah, isActionCall as ai, phraseFor as aj, readPath as ak, resolveResultView as al, toolCallState as am, toolCatalogFrom as an, GenerativeUI as b, type GenerativeUIElement as c, type GenerativeUIFallback as d, type GenerativeUIOptions as e, type GenerativeUIProblem as f, type GenerativeUIProps as g, GenerativeUIScope as h, type GenerativeUIScopeProps as i, type GenerativeUIState as j, type GenuiCatalogLike as k, type GenuiIssueLike as l, GenuiProvider as m, type GenuiProviderProps as n, type GenuiProviderValue as o, type GenuiRegistry as p, type GenuiRenderer as q, GenuiTree as r, useGenuiProvider as s, type TranscriptBlock as t, useGenerativeUI as u, type TimestampInfo as v, type
|
|
729
|
+
export { type TranscriptQuestionOption as $, type ApproveOptions as A, type BuildBlocksOptions as B, type ChatStatus as C, type CoercibleQuestion as D, type DescribeToolCallOptions as E, type ElicitationBlockOptions as F, type GenerativeUIItem as G, type GroupToolActivityOptions as H, type RawAnswer as I, type ResolvedReading as J, type ResolvedResultView as K, type RetrievedPassage as L, type MessageUsageInfo as M, type ToolActivityGroup as N, type ToolCallDescription as O, type ToolCallState as P, type ToolCallStatus as Q, type ResolveComponent as R, type SettleAction as S, type TranscriptUiBlock as T, type UsageSummary as U, type TranscriptApproval as V, type TranscriptApprovalStatus as W, type TranscriptElicitationBlock as X, type TranscriptElicitationOutcome as Y, type TranscriptFilesBlock as Z, type TranscriptQuestion as _, GENUI_TREE_COMPONENT as a, type TranscriptReasoningBlock as a0, type TranscriptSettleState as a1, type TranscriptSource as a2, type TranscriptSourcesBlock as a3, type TranscriptTextBlock as a4, type TranscriptToolBlock as a5, type TranscriptToolCall as a6, buildTranscriptBlocks as a7, coerceAnswer as a8, correctedCallIds as a9, describeTimestamp as aa, describeToolCall as ab, describeUsage as ac, extractMessageText as ad, fillTemplate as ae, formatRelativeTime as af, groupToolActivity as ag, inferResultView as ah, isActionCall as ai, phraseFor as aj, readPath as ak, resolveResultView as al, toolCallState as am, toolCatalogFrom as an, GenerativeUI as b, type GenerativeUIElement as c, type GenerativeUIFallback as d, type GenerativeUIOptions as e, type GenerativeUIProblem as f, type GenerativeUIProps as g, GenerativeUIScope as h, type GenerativeUIScopeProps as i, type GenerativeUIState as j, type GenuiCatalogLike as k, type GenuiIssueLike as l, GenuiProvider as m, type GenuiProviderProps as n, type GenuiProviderValue as o, type GenuiRegistry as p, type GenuiRenderer as q, GenuiTree as r, useGenuiProvider as s, type TranscriptBlock as t, useGenerativeUI as u, type TimestampInfo as v, type TranscriptFile as w, type ToolCatalog as x, type AnyToolUIPart as y, type ApprovalBlockOptions as z };
|
|
@@ -726,4 +726,4 @@ interface GenerativeUIProps extends Partial<GenerativeUIOptions> {
|
|
|
726
726
|
*/
|
|
727
727
|
declare function GenerativeUI({ part, registry, catalog, resolveComponent, treeRenderer, fallback: ownFallback, loading: ownLoading, onError: ownOnError, }: GenerativeUIProps): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | React.JSX.Element | null | undefined;
|
|
728
728
|
|
|
729
|
-
export { type TranscriptQuestionOption as $, type ApproveOptions as A, type BuildBlocksOptions as B, type ChatStatus as C, type CoercibleQuestion as D, type DescribeToolCallOptions as E, type ElicitationBlockOptions as F, type GenerativeUIItem as G, type GroupToolActivityOptions as H, type RawAnswer as I, type ResolvedReading as J, type ResolvedResultView as K, type RetrievedPassage as L, type MessageUsageInfo as M, type ToolActivityGroup as N, type ToolCallDescription as O, type ToolCallState as P, type ToolCallStatus as Q, type ResolveComponent as R, type SettleAction as S, type TranscriptUiBlock as T, type UsageSummary as U, type TranscriptApproval as V, type TranscriptApprovalStatus as W, type TranscriptElicitationBlock as X, type TranscriptElicitationOutcome as Y, type TranscriptFilesBlock as Z, type TranscriptQuestion as _, GENUI_TREE_COMPONENT as a, type TranscriptReasoningBlock as a0, type TranscriptSettleState as a1, type TranscriptSource as a2, type TranscriptSourcesBlock as a3, type TranscriptTextBlock as a4, type TranscriptToolBlock as a5, type TranscriptToolCall as a6, buildTranscriptBlocks as a7, coerceAnswer as a8, correctedCallIds as a9, describeTimestamp as aa, describeToolCall as ab, describeUsage as ac, extractMessageText as ad, fillTemplate as ae, formatRelativeTime as af, groupToolActivity as ag, inferResultView as ah, isActionCall as ai, phraseFor as aj, readPath as ak, resolveResultView as al, toolCallState as am, toolCatalogFrom as an, GenerativeUI as b, type GenerativeUIElement as c, type GenerativeUIFallback as d, type GenerativeUIOptions as e, type GenerativeUIProblem as f, type GenerativeUIProps as g, GenerativeUIScope as h, type GenerativeUIScopeProps as i, type GenerativeUIState as j, type GenuiCatalogLike as k, type GenuiIssueLike as l, GenuiProvider as m, type GenuiProviderProps as n, type GenuiProviderValue as o, type GenuiRegistry as p, type GenuiRenderer as q, GenuiTree as r, useGenuiProvider as s, type TranscriptBlock as t, useGenerativeUI as u, type TimestampInfo as v, type
|
|
729
|
+
export { type TranscriptQuestionOption as $, type ApproveOptions as A, type BuildBlocksOptions as B, type ChatStatus as C, type CoercibleQuestion as D, type DescribeToolCallOptions as E, type ElicitationBlockOptions as F, type GenerativeUIItem as G, type GroupToolActivityOptions as H, type RawAnswer as I, type ResolvedReading as J, type ResolvedResultView as K, type RetrievedPassage as L, type MessageUsageInfo as M, type ToolActivityGroup as N, type ToolCallDescription as O, type ToolCallState as P, type ToolCallStatus as Q, type ResolveComponent as R, type SettleAction as S, type TranscriptUiBlock as T, type UsageSummary as U, type TranscriptApproval as V, type TranscriptApprovalStatus as W, type TranscriptElicitationBlock as X, type TranscriptElicitationOutcome as Y, type TranscriptFilesBlock as Z, type TranscriptQuestion as _, GENUI_TREE_COMPONENT as a, type TranscriptReasoningBlock as a0, type TranscriptSettleState as a1, type TranscriptSource as a2, type TranscriptSourcesBlock as a3, type TranscriptTextBlock as a4, type TranscriptToolBlock as a5, type TranscriptToolCall as a6, buildTranscriptBlocks as a7, coerceAnswer as a8, correctedCallIds as a9, describeTimestamp as aa, describeToolCall as ab, describeUsage as ac, extractMessageText as ad, fillTemplate as ae, formatRelativeTime as af, groupToolActivity as ag, inferResultView as ah, isActionCall as ai, phraseFor as aj, readPath as ak, resolveResultView as al, toolCallState as am, toolCatalogFrom as an, GenerativeUI as b, type GenerativeUIElement as c, type GenerativeUIFallback as d, type GenerativeUIOptions as e, type GenerativeUIProblem as f, type GenerativeUIProps as g, GenerativeUIScope as h, type GenerativeUIScopeProps as i, type GenerativeUIState as j, type GenuiCatalogLike as k, type GenuiIssueLike as l, GenuiProvider as m, type GenuiProviderProps as n, type GenuiProviderValue as o, type GenuiRegistry as p, type GenuiRenderer as q, GenuiTree as r, useGenuiProvider as s, type TranscriptBlock as t, useGenerativeUI as u, type TimestampInfo as v, type TranscriptFile as w, type ToolCatalog as x, type AnyToolUIPart as y, type ApprovalBlockOptions as z };
|