@tangle-network/agent-app 0.60.235 → 0.60.237
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DesignCanvas-SNE3H3TH.js → DesignCanvas-OW3W2QXW.js} +2 -2
- package/dist/{DesignCanvasEditor-G5O75CUT.js → DesignCanvasEditor-TCHZF25W.js} +3 -3
- package/dist/VaultPane-RXL3WLA2.js +7 -0
- package/dist/assistant/index.js +7 -7
- package/dist/chat-react/index.js +4 -4
- package/dist/{chunk-BNFUJNPS.js → chunk-A77IBQ7S.js} +456 -431
- package/dist/chunk-A77IBQ7S.js.map +1 -0
- package/dist/{chunk-JYIMW5U5.js → chunk-BGDQ7245.js} +3571 -3546
- package/dist/chunk-BGDQ7245.js.map +1 -0
- package/dist/{chunk-232KA6MR.js → chunk-CI53V6DD.js} +3 -3
- package/dist/{chunk-4JAXSEYW.js → chunk-DLVMKDFX.js} +3 -3
- package/dist/{chunk-I57SNMX4.js → chunk-EWOJATDS.js} +3 -3
- package/dist/{chunk-JYVUFRRV.js → chunk-FUZETA6Z.js} +2 -2
- package/dist/{chunk-P2NJIDLE.js → chunk-JH3CKHF4.js} +380 -366
- package/dist/chunk-JH3CKHF4.js.map +1 -0
- package/dist/{chunk-XIN7DOAB.js → chunk-R4X5474U.js} +35 -33
- package/dist/chunk-R4X5474U.js.map +1 -0
- package/dist/{chunk-IDQU36M5.js → chunk-RL3Z747H.js} +708 -659
- package/dist/chunk-RL3Z747H.js.map +1 -0
- package/dist/{chunk-3KXYYAY4.js → chunk-VBWYH7UZ.js} +243 -232
- package/dist/chunk-VBWYH7UZ.js.map +1 -0
- package/dist/{chunk-5IZRAZEZ.js → chunk-ZDPUC6CM.js} +3 -3
- package/dist/design-canvas-react/components/Toolbar.d.ts +1 -2
- package/dist/design-canvas-react/components/toolbar-fields.d.ts +65 -0
- package/dist/design-canvas-react/components/toolbar-page-controls.d.ts +20 -0
- package/dist/design-canvas-react/components/toolbar-selection-controls.d.ts +22 -0
- package/dist/design-canvas-react/components/use-workspace-keyboard.d.ts +24 -0
- package/dist/design-canvas-react/components/use-workspace-viewport.d.ts +16 -0
- package/dist/design-canvas-react/components/workspace-gesture-state.d.ts +10 -0
- package/dist/design-canvas-react/index.js +3 -3
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/{mention-editor-6FJ6HRSN.js → mention-editor-B23OMFT2.js} +2 -2
- package/dist/public-consultation/index.d.ts +1 -1
- package/dist/settings-react/index.js +1 -1
- package/dist/studio-react/index.js +1 -1
- package/dist/vault/SourceEditor.d.ts +8 -0
- package/dist/vault/VaultCreateDialog.d.ts +14 -0
- package/dist/vault/VaultDocumentToolbar.d.ts +29 -0
- package/dist/vault/VaultPaneNavigation.d.ts +10 -0
- package/dist/vault/VaultPaneStates.d.ts +59 -0
- package/dist/vault/VaultTreePanel.d.ts +19 -0
- package/dist/vault/index.js +1 -1
- package/dist/vault/lazy.js +1 -1
- package/dist/vault/useVaultDockPlacement.d.ts +5 -0
- package/dist/vault/useVaultSearch.d.ts +13 -0
- package/dist/vault/vault-tree-paths.d.ts +12 -0
- package/dist/web-react/agent-profile-editor.js +4 -4
- package/dist/web-react/chat-composer-types.d.ts +301 -0
- package/dist/web-react/chat-composer.d.ts +2 -300
- package/dist/web-react/chat-empty-state.d.ts +27 -0
- package/dist/web-react/chat-message-body.d.ts +23 -0
- package/dist/web-react/chat-message-metrics.d.ts +6 -0
- package/dist/web-react/chat-message-types.d.ts +158 -0
- package/dist/web-react/chat-messages.d.ts +17 -0
- package/dist/web-react/chat-tool-call.d.ts +31 -0
- package/dist/web-react/composer-glyphs.d.ts +28 -0
- package/dist/web-react/index.d.ts +6 -245
- package/dist/web-react/index.js +7 -7
- package/dist/web-react/record-grid-editors.d.ts +31 -0
- package/dist/web-react/record-grid-review-actions.d.ts +13 -0
- package/dist/web-react/record-grid-source-marker.d.ts +27 -0
- package/dist/web-react/record-grid-types.d.ts +86 -0
- package/dist/web-react/record-grid.d.ts +2 -85
- package/dist/web-react/run-drill-in.d.ts +28 -0
- package/dist/web-react/use-composer-commands.d.ts +25 -0
- package/dist/web-react/use-composer-file-intake.d.ts +20 -0
- package/dist/web-react/use-composer-send.d.ts +34 -0
- package/dist/workspace-react/index.js +3 -3
- package/package.json +1 -1
- package/dist/VaultPane-QEG35UAZ.js +0 -7
- package/dist/chunk-3KXYYAY4.js.map +0 -1
- package/dist/chunk-BNFUJNPS.js.map +0 -1
- package/dist/chunk-IDQU36M5.js.map +0 -1
- package/dist/chunk-JYIMW5U5.js.map +0 -1
- package/dist/chunk-P2NJIDLE.js.map +0 -1
- package/dist/chunk-XIN7DOAB.js.map +0 -1
- /package/dist/{DesignCanvas-SNE3H3TH.js.map → DesignCanvas-OW3W2QXW.js.map} +0 -0
- /package/dist/{DesignCanvasEditor-G5O75CUT.js.map → DesignCanvasEditor-TCHZF25W.js.map} +0 -0
- /package/dist/{VaultPane-QEG35UAZ.js.map → VaultPane-RXL3WLA2.js.map} +0 -0
- /package/dist/{chunk-232KA6MR.js.map → chunk-CI53V6DD.js.map} +0 -0
- /package/dist/{chunk-4JAXSEYW.js.map → chunk-DLVMKDFX.js.map} +0 -0
- /package/dist/{chunk-I57SNMX4.js.map → chunk-EWOJATDS.js.map} +0 -0
- /package/dist/{chunk-JYVUFRRV.js.map → chunk-FUZETA6Z.js.map} +0 -0
- /package/dist/{chunk-5IZRAZEZ.js.map → chunk-ZDPUC6CM.js.map} +0 -0
- /package/dist/{mention-editor-6FJ6HRSN.js.map → mention-editor-B23OMFT2.js.map} +0 -0
|
@@ -22,12 +22,6 @@
|
|
|
22
22
|
* share one row implementation instead of drifting. That makes
|
|
23
23
|
* `@tangle-network/ui` a peer of this subpath.
|
|
24
24
|
*/
|
|
25
|
-
import { type ReactNode } from 'react';
|
|
26
|
-
import type { ChatAuthor, ToolPart } from '@tangle-network/ui/types';
|
|
27
|
-
import { type DurableChatCardsProps } from './durable-chat-cards';
|
|
28
|
-
import { type ChatAttachmentPart } from './chat-attachments';
|
|
29
|
-
import type { WorkProductPersistedPart } from '../work-product/types';
|
|
30
|
-
import type { TurnPhaseData } from '../chat-routes/turn-progress';
|
|
31
25
|
export * from './chat-stream';
|
|
32
26
|
export { TurnProgress, type TurnProgressProps } from './turn-progress';
|
|
33
27
|
export { ReasoningRow, type ReasoningRowProps } from './reasoning-row';
|
|
@@ -76,246 +70,13 @@ export { ReviewFeedbackForm, type ReviewFeedbackFormProps, type ReviewFeedbackFo
|
|
|
76
70
|
export * from './use-dictation';
|
|
77
71
|
export { usePopover, usePending, PopoverSurface, POPOVER_SURFACE_ATTR, ModelPicker, formatModelPrice, EffortPicker, EffortMeter, effortMeterFill, effortLevelLabel, effortLevelsFromIds, reconcileEffortLevels, DEFAULT_EFFORT_LEVELS, EFFORT_METER_SEGMENTS, OVERLAY_SHADOW, fieldPickerTriggerClass, type ModelPickerProps, type EffortPickerProps, type EffortLevel, type PickerVariant, type PopoverSurfaceProps, } from './controls';
|
|
78
72
|
export { AgentSessionControls, HarnessPicker, type AgentSessionControlsProps, type HarnessPickerProps, } from './agent-session-controls';
|
|
79
|
-
import type { CatalogModel } from '../runtime/model-catalog';
|
|
80
73
|
export type { CatalogModel } from '../runtime/model-catalog';
|
|
81
|
-
|
|
82
|
-
export
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
/** "$0.0042" from token counts × catalogue per-token pricing; null when unknown. */
|
|
89
|
-
export declare function formatModelCost(msg: ChatMessageMetrics, models: CatalogModel[]): string | null;
|
|
90
|
-
/** "38 tok/s" from completion tokens over first-token→end duration; null when unknown. */
|
|
91
|
-
export declare function formatTokensPerSecond(msg: ChatMessageMetrics): string | null;
|
|
92
|
-
/** One step of a retained tool run (e.g. a sandbox command + its output). */
|
|
93
|
-
export interface ToolRunStep {
|
|
94
|
-
at: string;
|
|
95
|
-
label: string;
|
|
96
|
-
detail?: string;
|
|
97
|
-
status?: 'ok' | 'error';
|
|
98
|
-
}
|
|
99
|
-
/** A retained tool run keyed by the parent message's toolCallId. The product
|
|
100
|
-
* persists these server-side (fail-closed: only ids its own loop created)
|
|
101
|
-
* and serves them to the drill-in panel. */
|
|
102
|
-
export interface ToolRunRecord {
|
|
103
|
-
toolCallId: string;
|
|
104
|
-
toolName: string;
|
|
105
|
-
title: string;
|
|
106
|
-
status: 'running' | 'complete' | 'error';
|
|
107
|
-
steps: ToolRunStep[];
|
|
108
|
-
}
|
|
109
|
-
/** Define properties required to run a drill and handle its closure event */
|
|
110
|
-
export interface RunDrillInProps {
|
|
111
|
-
run: ToolRunRecord;
|
|
112
|
-
onClose: () => void;
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Readonly side panel showing a retained tool run's transcript — the
|
|
116
|
-
* "drill into what the sandbox actually did" view. Follow-ups happen in the
|
|
117
|
-
* main chat, never here.
|
|
118
|
-
*/
|
|
119
|
-
export declare function RunDrillIn({ run, onClose }: RunDrillInProps): import("react").JSX.Element;
|
|
120
|
-
/** Describe the structure and state of a tool call within a chat interaction */
|
|
121
|
-
export interface ChatToolCallInfo {
|
|
122
|
-
id: string;
|
|
123
|
-
name: string;
|
|
124
|
-
status: 'running' | 'done' | 'error';
|
|
125
|
-
/** The call arguments, captured from the tool_call event — shown in the
|
|
126
|
-
* expanded card so users see exactly what the agent invoked. */
|
|
127
|
-
args?: Record<string, unknown>;
|
|
128
|
-
/** The tool outcome (`{ok, result}` shape). When `result.status` is
|
|
129
|
-
* 'queued_for_approval' the card renders the approval state. */
|
|
130
|
-
result?: unknown;
|
|
131
|
-
}
|
|
132
|
-
/** Extract `{proposalId, status}` from a tool outcome when it is a proposal
|
|
133
|
-
* awaiting human approval; null otherwise. */
|
|
134
|
-
export declare function pendingApprovalOf(call: ChatToolCallInfo): {
|
|
135
|
-
proposalId: string;
|
|
136
|
-
} | null;
|
|
137
|
-
/** One ordered piece of an assistant turn: a run of answer text, or a tool
|
|
138
|
-
* call, in the sequence the agent emitted them. A message carrying `segments`
|
|
139
|
-
* is rendered in order — interleaving text and tool rows — so the agent's
|
|
140
|
-
* pre- and post-tool reasoning reads chronologically instead of as one text
|
|
141
|
-
* blob with the tool rows collected after it. */
|
|
142
|
-
export type ChatMessageSegment = {
|
|
143
|
-
kind: 'text';
|
|
144
|
-
content: string;
|
|
145
|
-
} | {
|
|
146
|
-
kind: 'tool';
|
|
147
|
-
call: ChatToolCallInfo;
|
|
148
|
-
}
|
|
149
|
-
/** An out-of-band transcript notice — a failed turn's error, a warning —
|
|
150
|
-
* rendered in its status tone so it never reads as answer prose. Map a
|
|
151
|
-
* persisted `notice` part (`noticeKind: 'error' | 'warning'`) to this. */
|
|
152
|
-
| {
|
|
153
|
-
kind: 'notice';
|
|
154
|
-
tone: ChatNoticeTone;
|
|
155
|
-
content: string;
|
|
156
|
-
};
|
|
157
|
-
/** Status tone of a {@link ChatMessageSegment} notice. */
|
|
158
|
-
export type ChatNoticeTone = 'error' | 'warning';
|
|
159
|
-
/** Describe the structure and properties of a chat message with roles, content, and optional metadata */
|
|
160
|
-
export interface ChatUiMessage extends ChatMessageMetrics {
|
|
161
|
-
id: string;
|
|
162
|
-
role: 'user' | 'assistant' | 'system';
|
|
163
|
-
content: string;
|
|
164
|
-
/** The model's reasoning for this message, shown in a {@link ReasoningRow} above the answer. */
|
|
165
|
-
reasoning?: string;
|
|
166
|
-
/** When the model started reasoning (epoch ms): `ChatReasoningState.startedAt` from the stream or the saved parts. */
|
|
167
|
-
reasoningStartedAt?: number;
|
|
168
|
-
/** When the reasoning ended (epoch ms). Set, the row reads "Thought for N seconds"; unset while streaming, it is still thinking. */
|
|
169
|
-
reasoningEndedAt?: number;
|
|
170
|
-
toolCalls?: ChatToolCallInfo[];
|
|
171
|
-
/** Ordered text/tool sequence for true chronological interleaving. When
|
|
172
|
-
* present and non-empty it is rendered in place of `content` + `toolCalls`;
|
|
173
|
-
* both remain the fallback for producers that don't segment a turn. */
|
|
174
|
-
segments?: ChatMessageSegment[];
|
|
175
|
-
/** Persisted assistant parts. When `ChatMessages.durableCards` is supplied,
|
|
176
|
-
* shared plan/question cards render directly from these projections. */
|
|
177
|
-
parts?: Array<Record<string, unknown>>;
|
|
178
|
-
/** Who wrote the message, when more than one person shares the thread: a
|
|
179
|
-
* client, an attorney and the agent. A user message whose author is not
|
|
180
|
-
* `ChatMessages.viewerId` is someone else's: start-aligned on a card under
|
|
181
|
-
* their avatar, name and role. An assistant message's author replaces the
|
|
182
|
-
* agent label. Absent → today's rendering, byte-identical. */
|
|
183
|
-
author?: ChatAuthor;
|
|
184
|
-
}
|
|
185
|
-
/** Define properties for rendering chat messages with optional models, markdown, extras, and durable cards */
|
|
186
|
-
export interface ChatMessagesProps {
|
|
187
|
-
messages: ChatUiMessage[];
|
|
188
|
-
/** Shared reading scale for both user and assistant prose. Defaults to 16px
|
|
189
|
-
* at a 1.6 line height; `large` uses 17px at the same leading without
|
|
190
|
-
* enlarging labels, tool chrome, or metadata. */
|
|
191
|
-
messageSize?: 'default' | 'large';
|
|
192
|
-
/** Transcript chrome. `labeled` (default) keeps the always-on role label +
|
|
193
|
-
* model/tok-s/cost meta line and the primary-tinted user bubble. `quiet`
|
|
194
|
-
* drops the label row into a fixed-height meta lane at each row's bottom
|
|
195
|
-
* (copy + the demoted meta, revealed on hover/focus, always visible on
|
|
196
|
-
* touch) and renders user bubbles neutral with a symmetric radius.
|
|
197
|
-
* Everything else — tool rows, reasoning, streaming — is identical. */
|
|
198
|
-
chrome?: 'labeled' | 'quiet';
|
|
199
|
-
/** Catalogue models, for per-message cost from pricing. Pass [] to skip cost. */
|
|
200
|
-
models?: CatalogModel[];
|
|
201
|
-
/** Markdown renderer for assistant content; default renders pre-wrapped text. */
|
|
202
|
-
renderMarkdown?: (content: string) => ReactNode;
|
|
203
|
-
/** Extra per-message content (artifacts, custom panels) appended after the body. */
|
|
204
|
-
renderExtras?: (message: ChatUiMessage) => ReactNode;
|
|
205
|
-
/** Canonical durable plan/question card wiring. Apps inject only transport,
|
|
206
|
-
* access, and optional visual callbacks; card selection/dedupe stays shared. */
|
|
207
|
-
durableCards?: Omit<DurableChatCardsProps, 'parts' | 'renderMarkdown'>;
|
|
208
|
-
userLabel?: string;
|
|
209
|
-
agentLabel?: string;
|
|
210
|
-
/** Render the trailing "agent is thinking" row. */
|
|
211
|
-
loading?: boolean;
|
|
212
|
-
/** The pending turn's latest stage from its `session.run.phase` events. The
|
|
213
|
-
* trailing row shows it in place of "Thinking…" until the first output. */
|
|
214
|
-
turnPhase?: Pick<TurnPhaseData, 'message'> | null;
|
|
215
|
-
/** Approve/Reject handlers for proposals awaiting approval. When omitted the
|
|
216
|
-
* card still shows "awaiting approval" but without action buttons. */
|
|
217
|
-
approval?: ProposalApprovalHandlers;
|
|
218
|
-
/** Open a full-transcript view (e.g. {@link RunDrillIn}) from a tool row's
|
|
219
|
-
* actions slot. */
|
|
220
|
-
onToolCallClick?: (call: ChatToolCallInfo, message: ChatUiMessage) => void;
|
|
221
|
-
/** Per-tool custom detail renderers for the expanded tool row body. */
|
|
222
|
-
toolRenderers?: ToolDetailRenderers;
|
|
223
|
-
/** Stream-error affordance: when the turn failed (a thrown transport error or
|
|
224
|
-
* a loop-level `onErrorEvent`), pass the message here to render an error row.
|
|
225
|
-
* A failed turn otherwise just stops with no UI signal. */
|
|
226
|
-
error?: string | null;
|
|
227
|
-
/** Retry control shown on the error row; omit to render the error without a
|
|
228
|
-
* retry button (e.g. when the product retries automatically). */
|
|
229
|
-
onRetry?: () => void;
|
|
230
|
-
/** Zero-state renderer, shown when there are no messages and the turn is
|
|
231
|
-
* neither loading nor errored. When omitted, a branded first-run state is
|
|
232
|
-
* shown ({@link ChatEmptyState}); pass `() => null` to render nothing. */
|
|
233
|
-
renderEmpty?: () => ReactNode;
|
|
234
|
-
/** First-run state config used when `renderEmpty` is not supplied. Lets a
|
|
235
|
-
* product set the headline and the "doors" (e.g. start from a template, ask
|
|
236
|
-
* the agent) without replacing the whole zero-state. */
|
|
237
|
-
emptyState?: ChatEmptyStateProps;
|
|
238
|
-
/** Optional branded header slot rendered above the thread. Off by default to
|
|
239
|
-
* preserve the current layout; pass `{ title }` (or your own node via
|
|
240
|
-
* `header`) to show the Tangle mark + product title in the chat shell. */
|
|
241
|
-
header?: ReactNode;
|
|
242
|
-
/** Resolve a raw-bytes download URL for one attachment part. When set, any
|
|
243
|
-
* message carrying attachment parts (`file`/`image` parts with a `path`,
|
|
244
|
-
* see `attachmentPartsFromMessageParts`) renders them as a `MessageAttachments`
|
|
245
|
-
* row next to the bubble — thumbnails for images, download chips for files.
|
|
246
|
-
* Absent → today's rendering, byte-identical (no attachment row). */
|
|
247
|
-
resolveAttachmentUrl?: (part: ChatAttachmentPart) => string;
|
|
248
|
-
/** Render persisted `type:'work_product'` anchor parts as `WorkProductCard`
|
|
249
|
-
* rows under the message body — the chat card that keeps chat the driver
|
|
250
|
-
* surface for review. `onOpen` opens the product's queue/detail surface.
|
|
251
|
-
* Absent → today's rendering, byte-identical (no card row). */
|
|
252
|
-
workProductCards?: {
|
|
253
|
-
onOpen?: (part: WorkProductPersistedPart) => void;
|
|
254
|
-
};
|
|
255
|
-
/** The reader's participant id, compared with each user message's
|
|
256
|
-
* `author.id`. A user message without an author is always the reader's. */
|
|
257
|
-
viewerId?: string;
|
|
258
|
-
}
|
|
259
|
-
/** One starting "door" in the chat first-run state — a concrete, labeled action
|
|
260
|
-
* (start from a template, do it by hand, ask the agent), not a placeholder. */
|
|
261
|
-
export interface ChatEmptyDoor {
|
|
262
|
-
label: string;
|
|
263
|
-
description?: string;
|
|
264
|
-
onSelect: () => void;
|
|
265
|
-
/** Optional glyph rendered left of the label. */
|
|
266
|
-
icon?: ReactNode;
|
|
267
|
-
}
|
|
268
|
-
/** Define properties for rendering the chat empty state with customizable text and starting doors */
|
|
269
|
-
export interface ChatEmptyStateProps {
|
|
270
|
-
/** Product name shown next to the Tangle mark. Default "Agent". */
|
|
271
|
-
productName?: string;
|
|
272
|
-
/** Headline. Default frames delegation, not messaging. */
|
|
273
|
-
headline?: string;
|
|
274
|
-
/** Subline under the headline. */
|
|
275
|
-
subline?: string;
|
|
276
|
-
/** Up to three concrete starting doors. Omit for a mark-and-prompt-only state. */
|
|
277
|
-
doors?: ChatEmptyDoor[];
|
|
278
|
-
}
|
|
279
|
-
/**
|
|
280
|
-
* Branded chat first-run state: the Tangle mark, a delegation-framed prompt, and
|
|
281
|
-
* up to three concrete doors. Replaces the blank thread that read as "empty or
|
|
282
|
-
* broken". Concrete + actionable — never a "coming soon" placeholder.
|
|
283
|
-
*/
|
|
284
|
-
export declare function ChatEmptyState({ productName, headline, subline, doors, }: ChatEmptyStateProps): import("react").JSX.Element;
|
|
285
|
-
/** Handle approval and rejection actions for proposals with asynchronous support */
|
|
286
|
-
export interface ProposalApprovalHandlers {
|
|
287
|
-
onApprove: (proposalId: string, toolCallId: string) => void | Promise<void>;
|
|
288
|
-
onReject: (proposalId: string, toolCallId: string) => void | Promise<void>;
|
|
289
|
-
}
|
|
290
|
-
/** Per-tool custom detail renderers for the expanded card body — keyed by
|
|
291
|
-
* tool name. Return null to fall back to the generic detail view. */
|
|
292
|
-
export type ToolDetailRenderers = Record<string, (call: ChatToolCallInfo, message: ChatUiMessage) => ReactNode>;
|
|
293
|
-
/**
|
|
294
|
-
* Adapt a chat tool call to the canonical `@tangle-network/ui` `ToolPart`, so
|
|
295
|
-
* the row renders through ui's `InlineToolItem` — one run-row grammar shared
|
|
296
|
-
* with every other Tangle run view (the same adapter pattern ui's own
|
|
297
|
-
* `ToolCallStep` uses for its flat props). `sandbox_run_command` maps to ui's
|
|
298
|
-
* canonical `bash` name so the row takes the command category (terminal icon);
|
|
299
|
-
* every other tool keeps its real name. agent-app carries no per-call timings,
|
|
300
|
-
* so `state.time` stays unset and the row shows no duration.
|
|
301
|
-
*/
|
|
302
|
-
export declare function chatToolCallPart(call: ChatToolCallInfo): ToolPart;
|
|
303
|
-
/** Whole seconds elapsed while `active`, ticking once a second; counts from
|
|
304
|
-
* when `active` first turns true and freezes when it clears. Kept for
|
|
305
|
-
* existing consumers: `ReasoningRow` times reasoning from the stream's own
|
|
306
|
-
* start instead. */
|
|
307
|
-
export declare function useThinkingSeconds(active: boolean): number;
|
|
308
|
-
/**
|
|
309
|
-
* The message thread: one centered column; user messages are right-aligned
|
|
310
|
-
* bubbles with a User label; agent messages carry an Agent meta line with
|
|
311
|
-
* model id, tokens/sec, and cost, plus a collapsible thinking section and
|
|
312
|
-
* tool rows. `chrome="quiet"` opts into the label-free variant: the
|
|
313
|
-
* label/meta row becomes a hover-revealed meta lane under each row.
|
|
314
|
-
* A thread shared by several people passes each message's `author` and the
|
|
315
|
-
* reader's `viewerId`: the reader's own messages stay right-aligned, everyone
|
|
316
|
-
* else's are named, and a named agent replaces the agent label.
|
|
317
|
-
*/
|
|
318
|
-
export declare function ChatMessages({ messages, messageSize, chrome, models, renderMarkdown, renderExtras, durableCards, userLabel, agentLabel, loading, turnPhase, approval, onToolCallClick, toolRenderers, error, onRetry, renderEmpty, emptyState, header, resolveAttachmentUrl, workProductCards, viewerId, }: ChatMessagesProps): import("react").JSX.Element;
|
|
74
|
+
export * from './chat-message-types';
|
|
75
|
+
export * from './chat-message-metrics';
|
|
76
|
+
export * from './run-drill-in';
|
|
77
|
+
export * from './chat-empty-state';
|
|
78
|
+
export { pendingApprovalOf, chatToolCallPart } from './chat-tool-call';
|
|
79
|
+
export { ChatMessages, useThinkingSeconds } from './chat-messages';
|
|
319
80
|
export * from './api-access-panel';
|
|
320
81
|
export * from './agent-setup-block';
|
|
321
82
|
export * from './agent-settings-popover';
|
package/dist/web-react/index.js
CHANGED
|
@@ -145,7 +145,7 @@ import {
|
|
|
145
145
|
withoutRecordGridCreated,
|
|
146
146
|
withoutRecordGridRemoved,
|
|
147
147
|
withoutRecordGridUpdate
|
|
148
|
-
} from "../chunk-
|
|
148
|
+
} from "../chunk-BGDQ7245.js";
|
|
149
149
|
import {
|
|
150
150
|
MENTION_PILL_CLASS
|
|
151
151
|
} from "../chunk-3HUFJ5LO.js";
|
|
@@ -181,12 +181,12 @@ import {
|
|
|
181
181
|
preloadWhenIdle,
|
|
182
182
|
useComposerAttachments,
|
|
183
183
|
useDictation
|
|
184
|
-
} from "../chunk-
|
|
184
|
+
} from "../chunk-A77IBQ7S.js";
|
|
185
185
|
import "../chunk-L7MB2LLM.js";
|
|
186
186
|
import {
|
|
187
187
|
WorkspaceInitial,
|
|
188
188
|
WorkspaceSwitcher
|
|
189
|
-
} from "../chunk-
|
|
189
|
+
} from "../chunk-ZDPUC6CM.js";
|
|
190
190
|
import {
|
|
191
191
|
WorkspacePrewarmContext,
|
|
192
192
|
requestWorkspacePrewarm,
|
|
@@ -202,7 +202,7 @@ import {
|
|
|
202
202
|
AGENT_PROFILE_EDITOR_SECTIONS,
|
|
203
203
|
AgentProfileEditor,
|
|
204
204
|
AgentProfileRegistryError
|
|
205
|
-
} from "../chunk-
|
|
205
|
+
} from "../chunk-DLVMKDFX.js";
|
|
206
206
|
import {
|
|
207
207
|
AgentSessionControls,
|
|
208
208
|
AgentSettingsPopover,
|
|
@@ -212,8 +212,8 @@ import {
|
|
|
212
212
|
filterAcceptedFiles,
|
|
213
213
|
isAcceptedFileType,
|
|
214
214
|
renamePastedImages
|
|
215
|
-
} from "../chunk-
|
|
216
|
-
import "../chunk-
|
|
215
|
+
} from "../chunk-CI53V6DD.js";
|
|
216
|
+
import "../chunk-FUZETA6Z.js";
|
|
217
217
|
import {
|
|
218
218
|
DEFAULT_EFFORT_LEVELS,
|
|
219
219
|
EFFORT_METER_SEGMENTS,
|
|
@@ -231,7 +231,7 @@ import {
|
|
|
231
231
|
reconcileEffortLevels,
|
|
232
232
|
usePending,
|
|
233
233
|
usePopover
|
|
234
|
-
} from "../chunk-
|
|
234
|
+
} from "../chunk-R4X5474U.js";
|
|
235
235
|
import {
|
|
236
236
|
ReviewFeedbackForm
|
|
237
237
|
} from "../chunk-ATQQCG4I.js";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type RecordGridColumn, type RecordGridValue } from './record-grid-model';
|
|
2
|
+
interface CellEditorProps {
|
|
3
|
+
column: RecordGridColumn;
|
|
4
|
+
rowLabel: string;
|
|
5
|
+
text: string;
|
|
6
|
+
invalid: boolean;
|
|
7
|
+
describedBy?: string;
|
|
8
|
+
onText: (text: string) => void;
|
|
9
|
+
onCommit: (text: string) => void;
|
|
10
|
+
onCancel: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** The in-cell control for one edit. Enter commits, Escape cancels, blur
|
|
13
|
+
* commits — the editor never disappears without deciding. */
|
|
14
|
+
export declare function CellEditor({ column, rowLabel, text, invalid, describedBy, onText, onCommit, onCancel }: CellEditorProps): import("react").JSX.Element;
|
|
15
|
+
interface AddRecordFormProps {
|
|
16
|
+
columns: readonly RecordGridColumn[];
|
|
17
|
+
draft: Record<string, RecordGridValue>;
|
|
18
|
+
setDraft: (next: Record<string, RecordGridValue>) => void;
|
|
19
|
+
errors: Readonly<Record<string, string>>;
|
|
20
|
+
formError: string | null;
|
|
21
|
+
busy: boolean;
|
|
22
|
+
label: string;
|
|
23
|
+
fieldPrefix: string;
|
|
24
|
+
onSubmit: () => void;
|
|
25
|
+
onCancel: () => void;
|
|
26
|
+
}
|
|
27
|
+
/** The inline add form. Every control is labelled, every rejection names its
|
|
28
|
+
* field, and a column whose `dependsOn` is unsatisfied is not rendered — the
|
|
29
|
+
* nested sub-form case. */
|
|
30
|
+
export declare function AddRecordForm({ columns, draft, setDraft, errors, formError, busy, label, fieldPrefix, onSubmit, onCancel, }: AddRecordFormProps): import("react").JSX.Element;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RecordGridRowDiff } from './record-grid-model';
|
|
2
|
+
interface ReviewActionsProps {
|
|
3
|
+
rowId: string;
|
|
4
|
+
kind: RecordGridRowDiff['kind'];
|
|
5
|
+
rowLabel: string;
|
|
6
|
+
onAccept?: (rowId: string) => void;
|
|
7
|
+
onReject?: (rowId: string) => void;
|
|
8
|
+
}
|
|
9
|
+
/** Per-row accept/reject in review mode. The verbs name what accepting DOES:
|
|
10
|
+
* a changed row is written, an added row is adopted, a removed row is
|
|
11
|
+
* deleted. */
|
|
12
|
+
export declare function ReviewActions({ rowId, kind, rowLabel, onAccept, onReject }: ReviewActionsProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RecordGridCellSource } from './record-grid-model';
|
|
2
|
+
interface SourceMarkerProps {
|
|
3
|
+
panelId: string;
|
|
4
|
+
columnHeader: string;
|
|
5
|
+
rowLabel: string;
|
|
6
|
+
source: RecordGridCellSource;
|
|
7
|
+
open: boolean;
|
|
8
|
+
onToggle: () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The per-cell provenance affordance: a marker that opens the quote, the
|
|
12
|
+
* source's name, and a link to it.
|
|
13
|
+
*
|
|
14
|
+
* Renders its panel through `PopoverSurface` (not an in-place `absolute`
|
|
15
|
+
* span): the grid is a scrollable table by construction — `overflow-x-auto`/
|
|
16
|
+
* `overflow-y-auto` on the scroll region is the whole reason `RecordGrid`
|
|
17
|
+
* stays usable with many columns/rows — and that scroll container clips every
|
|
18
|
+
* positioned descendant whose containing block sits inside it exactly the way
|
|
19
|
+
* the composer's control rail clipped the model/thinking menus (see AGENTS.md
|
|
20
|
+
* "UI chrome ownership (picker canon)"). `open` stays parent-owned (only one
|
|
21
|
+
* marker across the grid may be open at a time); `usePopover` never calls
|
|
22
|
+
* `setOpen(true)` itself — its listeners only run while `open` is already
|
|
23
|
+
* true — so translating its `setOpen(false)` into the existing `onToggle`
|
|
24
|
+
* flip is safe.
|
|
25
|
+
*/
|
|
26
|
+
export declare function SourceMarker({ panelId, columnHeader, rowLabel, source, open, onToggle }: SourceMarkerProps): import("react").JSX.Element;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/** Host data and mutation contracts for the editable record table. */
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { AsyncEmptySpec, AsyncResourceState } from './async';
|
|
4
|
+
import type { RecordGridColumn, RecordGridProposal, RecordGridRow, RecordGridValue } from './record-grid-model';
|
|
5
|
+
/** One committed cell edit, handed to `onUpdate`. */
|
|
6
|
+
export interface RecordGridCellChange {
|
|
7
|
+
/** The row as it was BEFORE the edit — what rollback restores. */
|
|
8
|
+
row: RecordGridRow;
|
|
9
|
+
columnId: string;
|
|
10
|
+
value: RecordGridValue;
|
|
11
|
+
/** The full value bag after the edit: what a whole-row write would send. */
|
|
12
|
+
values: Readonly<Record<string, RecordGridValue>>;
|
|
13
|
+
}
|
|
14
|
+
/** Outcome of an update or a delete. `value` optionally carries the server's
|
|
15
|
+
* canonical row, which replaces the optimistic one. */
|
|
16
|
+
export type RecordGridWriteOutcome = {
|
|
17
|
+
succeeded: true;
|
|
18
|
+
value?: RecordGridRow;
|
|
19
|
+
} | {
|
|
20
|
+
succeeded: false;
|
|
21
|
+
error: string;
|
|
22
|
+
};
|
|
23
|
+
/** Outcome of a create. The row is REQUIRED on success: a create that does not
|
|
24
|
+
* name the row it wrote leaves the grid unable to address it. */
|
|
25
|
+
export type RecordGridCreateOutcome = {
|
|
26
|
+
succeeded: true;
|
|
27
|
+
value: RecordGridRow;
|
|
28
|
+
} | {
|
|
29
|
+
succeeded: false;
|
|
30
|
+
error: string;
|
|
31
|
+
};
|
|
32
|
+
/** Properties for the editable, provenance-aware record grid. */
|
|
33
|
+
export interface RecordGridProps {
|
|
34
|
+
/** Column definitions, in render order. */
|
|
35
|
+
columns: readonly RecordGridColumn[];
|
|
36
|
+
/** Fetch state over the caller's rows — `web-react/async`'s
|
|
37
|
+
* `AsyncResourceState`, the same three-state contract every other screen
|
|
38
|
+
* in the shell fetches through. `ready`/`empty`'s value is the base rows;
|
|
39
|
+
* optimistic edits are layered over it and dropped as a later value
|
|
40
|
+
* catches up. `error` always carries `retry` — there is no way to render a
|
|
41
|
+
* failed fetch with no recovery action, by construction. */
|
|
42
|
+
state: AsyncResourceState<readonly RecordGridRow[]>;
|
|
43
|
+
/** Accessible name for the grid. Required — an unnamed grid is unusable with
|
|
44
|
+
* a screen reader. */
|
|
45
|
+
caption: string;
|
|
46
|
+
/** What the empty state says, and what it offers next — `web-react/async`'s
|
|
47
|
+
* `AsyncEmptySpec`, so an empty grid reads in the same words as an empty
|
|
48
|
+
* list or panel elsewhere in the product. */
|
|
49
|
+
empty: AsyncEmptySpec;
|
|
50
|
+
/** Persist one created row. Absent → no add affordance. */
|
|
51
|
+
onCreate?: (values: Readonly<Record<string, RecordGridValue>>) => Promise<RecordGridCreateOutcome>;
|
|
52
|
+
/** Persist one cell edit. Absent → every cell renders read-only. */
|
|
53
|
+
onUpdate?: (change: RecordGridCellChange) => Promise<RecordGridWriteOutcome>;
|
|
54
|
+
/** Delete one row. Absent → no delete affordance. */
|
|
55
|
+
onDelete?: (row: RecordGridRow) => Promise<RecordGridWriteOutcome>;
|
|
56
|
+
/** A proposed change set to review against the live rows (see
|
|
57
|
+
* `diffRecordGridProposal`). While a non-empty diff is on the table the grid
|
|
58
|
+
* is a REVIEW surface, not an editor: cell editing, row add, and row delete
|
|
59
|
+
* are inert; changed cells render the struck live value against the
|
|
60
|
+
* proposed one; added/removed rows are marked; each diffed row carries
|
|
61
|
+
* accept/reject controls. A proposal that diffs to nothing renders the grid
|
|
62
|
+
* unchanged — there is nothing to review. */
|
|
63
|
+
proposed?: RecordGridProposal;
|
|
64
|
+
/** Accept one diffed row — write its proposed values, adopt the addition, or
|
|
65
|
+
* confirm the removal. The caller owns what accepting MEANS (a record-store
|
|
66
|
+
* review write); the grid reports the decision and the caller moves the row
|
|
67
|
+
* out of `proposed`. */
|
|
68
|
+
onAcceptRow?: (rowId: string) => void;
|
|
69
|
+
/** Reject one diffed row — the live row stands. */
|
|
70
|
+
onRejectRow?: (rowId: string) => void;
|
|
71
|
+
/** Accept every remaining diffed row at once. */
|
|
72
|
+
onAcceptAll?: () => void;
|
|
73
|
+
/** Reject every remaining diffed row at once. */
|
|
74
|
+
onRejectAll?: () => void;
|
|
75
|
+
/** Starting values for the add form. */
|
|
76
|
+
newRowDefaults?: Readonly<Record<string, RecordGridValue>>;
|
|
77
|
+
/** Label of the add control and of the add form. Defaults to `Add row`. */
|
|
78
|
+
addLabel?: string;
|
|
79
|
+
/** BCP-47 locale for number, currency, and date display. */
|
|
80
|
+
locale?: string;
|
|
81
|
+
/** Rendered above the grid — filters, counts, a product action row. */
|
|
82
|
+
toolbar?: ReactNode;
|
|
83
|
+
/** Skeleton rows in the loading state. Defaults to 3. */
|
|
84
|
+
loadingRowCount?: number;
|
|
85
|
+
className?: string;
|
|
86
|
+
}
|
|
@@ -40,92 +40,9 @@
|
|
|
40
40
|
* Presentation is Tailwind against the shared design tokens, with no icon
|
|
41
41
|
* library and no sandbox-ui — the same contract as the rest of `/web-react`.
|
|
42
42
|
*/
|
|
43
|
-
import { type ReactNode } from 'react';
|
|
44
|
-
import { type AsyncEmptySpec, type AsyncResourceState } from './async';
|
|
45
|
-
import { type RecordGridColumn, type RecordGridProposal, type RecordGridRow, type RecordGridValue } from './record-grid-model';
|
|
46
43
|
export * from './record-grid-model';
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/** The row as it was BEFORE the edit — what rollback restores. */
|
|
50
|
-
row: RecordGridRow;
|
|
51
|
-
columnId: string;
|
|
52
|
-
value: RecordGridValue;
|
|
53
|
-
/** The full value bag after the edit: what a whole-row write would send. */
|
|
54
|
-
values: Readonly<Record<string, RecordGridValue>>;
|
|
55
|
-
}
|
|
56
|
-
/** Outcome of an update or a delete. `value` optionally carries the server's
|
|
57
|
-
* canonical row, which replaces the optimistic one. */
|
|
58
|
-
export type RecordGridWriteOutcome = {
|
|
59
|
-
succeeded: true;
|
|
60
|
-
value?: RecordGridRow;
|
|
61
|
-
} | {
|
|
62
|
-
succeeded: false;
|
|
63
|
-
error: string;
|
|
64
|
-
};
|
|
65
|
-
/** Outcome of a create. The row is REQUIRED on success: a create that does not
|
|
66
|
-
* name the row it wrote leaves the grid unable to address it. */
|
|
67
|
-
export type RecordGridCreateOutcome = {
|
|
68
|
-
succeeded: true;
|
|
69
|
-
value: RecordGridRow;
|
|
70
|
-
} | {
|
|
71
|
-
succeeded: false;
|
|
72
|
-
error: string;
|
|
73
|
-
};
|
|
74
|
-
/** Properties for the editable, provenance-aware record grid. */
|
|
75
|
-
export interface RecordGridProps {
|
|
76
|
-
/** Column definitions, in render order. */
|
|
77
|
-
columns: readonly RecordGridColumn[];
|
|
78
|
-
/** Fetch state over the caller's rows — `web-react/async`'s
|
|
79
|
-
* `AsyncResourceState`, the same three-state contract every other screen
|
|
80
|
-
* in the shell fetches through. `ready`/`empty`'s value is the base rows;
|
|
81
|
-
* optimistic edits are layered over it and dropped as a later value
|
|
82
|
-
* catches up. `error` always carries `retry` — there is no way to render a
|
|
83
|
-
* failed fetch with no recovery action, by construction. */
|
|
84
|
-
state: AsyncResourceState<readonly RecordGridRow[]>;
|
|
85
|
-
/** Accessible name for the grid. Required — an unnamed grid is unusable with
|
|
86
|
-
* a screen reader. */
|
|
87
|
-
caption: string;
|
|
88
|
-
/** What the empty state says, and what it offers next — `web-react/async`'s
|
|
89
|
-
* `AsyncEmptySpec`, so an empty grid reads in the same words as an empty
|
|
90
|
-
* list or panel elsewhere in the product. */
|
|
91
|
-
empty: AsyncEmptySpec;
|
|
92
|
-
/** Persist one created row. Absent → no add affordance. */
|
|
93
|
-
onCreate?: (values: Readonly<Record<string, RecordGridValue>>) => Promise<RecordGridCreateOutcome>;
|
|
94
|
-
/** Persist one cell edit. Absent → every cell renders read-only. */
|
|
95
|
-
onUpdate?: (change: RecordGridCellChange) => Promise<RecordGridWriteOutcome>;
|
|
96
|
-
/** Delete one row. Absent → no delete affordance. */
|
|
97
|
-
onDelete?: (row: RecordGridRow) => Promise<RecordGridWriteOutcome>;
|
|
98
|
-
/** A proposed change set to review against the live rows (see
|
|
99
|
-
* `diffRecordGridProposal`). While a non-empty diff is on the table the grid
|
|
100
|
-
* is a REVIEW surface, not an editor: cell editing, row add, and row delete
|
|
101
|
-
* are inert; changed cells render the struck live value against the
|
|
102
|
-
* proposed one; added/removed rows are marked; each diffed row carries
|
|
103
|
-
* accept/reject controls. A proposal that diffs to nothing renders the grid
|
|
104
|
-
* unchanged — there is nothing to review. */
|
|
105
|
-
proposed?: RecordGridProposal;
|
|
106
|
-
/** Accept one diffed row — write its proposed values, adopt the addition, or
|
|
107
|
-
* confirm the removal. The caller owns what accepting MEANS (a record-store
|
|
108
|
-
* review write); the grid reports the decision and the caller moves the row
|
|
109
|
-
* out of `proposed`. */
|
|
110
|
-
onAcceptRow?: (rowId: string) => void;
|
|
111
|
-
/** Reject one diffed row — the live row stands. */
|
|
112
|
-
onRejectRow?: (rowId: string) => void;
|
|
113
|
-
/** Accept every remaining diffed row at once. */
|
|
114
|
-
onAcceptAll?: () => void;
|
|
115
|
-
/** Reject every remaining diffed row at once. */
|
|
116
|
-
onRejectAll?: () => void;
|
|
117
|
-
/** Starting values for the add form. */
|
|
118
|
-
newRowDefaults?: Readonly<Record<string, RecordGridValue>>;
|
|
119
|
-
/** Label of the add control and of the add form. Defaults to `Add row`. */
|
|
120
|
-
addLabel?: string;
|
|
121
|
-
/** BCP-47 locale for number, currency, and date display. */
|
|
122
|
-
locale?: string;
|
|
123
|
-
/** Rendered above the grid — filters, counts, a product action row. */
|
|
124
|
-
toolbar?: ReactNode;
|
|
125
|
-
/** Skeleton rows in the loading state. Defaults to 3. */
|
|
126
|
-
loadingRowCount?: number;
|
|
127
|
-
className?: string;
|
|
128
|
-
}
|
|
44
|
+
export type { RecordGridCellChange, RecordGridWriteOutcome, RecordGridCreateOutcome, RecordGridProps } from './record-grid-types';
|
|
45
|
+
import type { RecordGridProps } from './record-grid-types';
|
|
129
46
|
/**
|
|
130
47
|
* The shared editable record table. A row is a flat value bag keyed by column
|
|
131
48
|
* id, so a record store's fold output maps straight on: one cell per entry,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** One step of a retained tool run (e.g. a sandbox command + its output). */
|
|
2
|
+
export interface ToolRunStep {
|
|
3
|
+
at: string;
|
|
4
|
+
label: string;
|
|
5
|
+
detail?: string;
|
|
6
|
+
status?: 'ok' | 'error';
|
|
7
|
+
}
|
|
8
|
+
/** A retained tool run keyed by the parent message's toolCallId. The product
|
|
9
|
+
* persists these server-side (fail-closed: only ids its own loop created)
|
|
10
|
+
* and serves them to the drill-in panel. */
|
|
11
|
+
export interface ToolRunRecord {
|
|
12
|
+
toolCallId: string;
|
|
13
|
+
toolName: string;
|
|
14
|
+
title: string;
|
|
15
|
+
status: 'running' | 'complete' | 'error';
|
|
16
|
+
steps: ToolRunStep[];
|
|
17
|
+
}
|
|
18
|
+
/** Define properties required to run a drill and handle its closure event */
|
|
19
|
+
export interface RunDrillInProps {
|
|
20
|
+
run: ToolRunRecord;
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Readonly side panel showing a retained tool run's transcript — the
|
|
25
|
+
* "drill into what the sandbox actually did" view. Follow-ups happen in the
|
|
26
|
+
* main chat, never here.
|
|
27
|
+
*/
|
|
28
|
+
export declare function RunDrillIn({ run, onClose }: RunDrillInProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Slash-command and skill selection for plain and rich composer inputs. */
|
|
2
|
+
import { type RefObject } from 'react';
|
|
3
|
+
import { type CommandPaletteItem } from '../session-shell/index';
|
|
4
|
+
import type { ChatComposerProps } from './chat-composer-types';
|
|
5
|
+
type ComposerCommandsOptions = Pick<ChatComposerProps, 'mention' | 'slashCommands' | 'onSelectedSkillChange'> & {
|
|
6
|
+
text: string;
|
|
7
|
+
textRef: RefObject<string>;
|
|
8
|
+
setText: (next: string) => void;
|
|
9
|
+
eligibleSkills: NonNullable<ChatComposerProps['eligibleSkills']>;
|
|
10
|
+
};
|
|
11
|
+
export declare function useComposerCommands({ text, textRef, setText, mention, slashCommands, eligibleSkills, onSelectedSkillChange }: ComposerCommandsOptions): {
|
|
12
|
+
cardRef: RefObject<HTMLDivElement | null>;
|
|
13
|
+
slashPanelRef: RefObject<HTMLDivElement | null>;
|
|
14
|
+
slashListId: string;
|
|
15
|
+
setMentionSuggestionOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
16
|
+
slashActiveIndex: number;
|
|
17
|
+
slashOpen: boolean;
|
|
18
|
+
slashFiltered: CommandPaletteItem[];
|
|
19
|
+
skillQuery: string | undefined;
|
|
20
|
+
hasSkills: boolean;
|
|
21
|
+
setSlashActive: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
22
|
+
pickSlash: (id: string) => void;
|
|
23
|
+
handleSlashKeyDown: (e: Pick<globalThis.KeyboardEvent, 'key' | 'shiftKey' | 'preventDefault'>) => boolean;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** One accepted-file path for file pickers, clipboard pastes, and drops. */
|
|
2
|
+
import { type ChangeEvent, type ClipboardEvent, type DragEvent } from 'react';
|
|
3
|
+
import type { ChatComposerProps } from './chat-composer-types';
|
|
4
|
+
type ComposerFileIntakeOptions = Pick<ChatComposerProps, 'onAttach' | 'onAttachFolder' | 'accept' | 'onRejectFiles'> & {
|
|
5
|
+
pendingFiles: NonNullable<ChatComposerProps['pendingFiles']>;
|
|
6
|
+
};
|
|
7
|
+
export declare function useComposerFileIntake({ onAttach, onAttachFolder, accept, onRejectFiles, pendingFiles }: ComposerFileIntakeOptions): {
|
|
8
|
+
fileInputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
9
|
+
folderInputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
10
|
+
dragOver: boolean;
|
|
11
|
+
handleFileChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
handleFolderChange: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
13
|
+
handlePaste: (e: ClipboardEvent<HTMLTextAreaElement>) => void;
|
|
14
|
+
ingestPastedFiles: (clipboardFiles: FileList) => boolean;
|
|
15
|
+
handleDragEnter: (e: DragEvent) => void;
|
|
16
|
+
handleDragLeave: (e: DragEvent) => void;
|
|
17
|
+
handleDragOver: (e: DragEvent) => void;
|
|
18
|
+
handleDrop: (e: DragEvent) => void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|