@flytedan/flytebot-design-system 0.77.0 → 0.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4146,6 +4146,32 @@ interface PacketSchema {
4146
4146
  /** `false` hides the Apply footer for this packet type (a live query card, a CSV). Default: Apply shows. */
4147
4147
  apply?: boolean;
4148
4148
  }
4149
+ type PacketDecisionAction = "confirm" | "dismiss";
4150
+ type PacketDecisionTone = "neutral" | "info" | "success" | "warning" | "danger";
4151
+ /** What the app says about a packet right now. The design system keeps no state beyond the pending press. */
4152
+ interface PacketDecisionState {
4153
+ /** Header badge: waiting, confirming, done, refused, failed, unknown… */
4154
+ status?: {
4155
+ label: string;
4156
+ tone: PacketDecisionTone;
4157
+ };
4158
+ /** Once set the packet is decided: replaces the footer. */
4159
+ outcome?: {
4160
+ message: React.ReactNode;
4161
+ tone: "success" | "danger";
4162
+ };
4163
+ /** App-reported error banner, shown with both buttons usable. A rejection of `onDecide` shows its own message. */
4164
+ error?: React.ReactNode;
4165
+ }
4166
+ /** Decision mode for one packet type. */
4167
+ interface PacketDecision {
4168
+ /** Called with the pressed action; the buttons stay pending until it settles, a rejection shows an error banner. */
4169
+ onDecide: (action: PacketDecisionAction, packet: Packet) => Promise<void>;
4170
+ /** Packet's current status, outcome and error. */
4171
+ state: (packet: Packet) => PacketDecisionState;
4172
+ confirmLabel?: string;
4173
+ dismissLabel?: string;
4174
+ }
4149
4175
  interface JobStatus {
4150
4176
  id?: string;
4151
4177
  /** queued | running keep polling · completed | recovered are success · anything else fails loudly. */
@@ -4416,6 +4442,8 @@ interface AgentChatPanelProps {
4416
4442
  packetSchemas?: Record<string, PacketSchema>;
4417
4443
  packetRenderers?: Record<string, (p: Packet) => React.ReactNode>;
4418
4444
  onApplyPacket?: (p: Packet) => void;
4445
+ /** Decision mode per packet type: header status badge, pinned Confirm/Dismiss footer, then the outcome. */
4446
+ packetDecisions?: Record<string, PacketDecision>;
4419
4447
  /** Give-up time for a queued/running turn, in ms. Default 180000. The server's terminal job status always wins. */
4420
4448
  pendingTimeoutMs?: number;
4421
4449
  /** Words for the background work a live turn waits on, given the still-working cards ("Running 2 queries"). */
@@ -4476,7 +4504,7 @@ interface AgentChatPanelProps {
4476
4504
  * renders only when its input is supplied. A panel with no telemetry shows no
4477
4505
  * telemetry, not zeroes.
4478
4506
  */
4479
- declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4507
+ declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, packetDecisions, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4480
4508
 
4481
4509
  /**
4482
4510
  * Staged files, the queue strip, the markdown editor, slash/mention triggers, send + stop.
@@ -4588,6 +4616,8 @@ interface ChatRenderContext {
4588
4616
  packetSchemas?: Record<string, PacketSchema>;
4589
4617
  packetRenderers?: Record<string, (p: Packet) => React.ReactNode>;
4590
4618
  appliedPackets?: Record<string, boolean>;
4619
+ /** Decision mode per packet type (see PacketCard `decision`). */
4620
+ packetDecisions?: Record<string, PacketDecision>;
4591
4621
  /** Sidebar-width layout: tighter padding, stacked controls. */
4592
4622
  narrow?: boolean;
4593
4623
  onOpenAttachment?: (a: Attachment) => void;
@@ -4623,12 +4653,14 @@ interface PacketCardProps {
4623
4653
  render?: (p: Packet) => React.ReactNode;
4624
4654
  onApply?: (p: Packet) => void;
4625
4655
  applied?: boolean;
4656
+ /** Decision mode: a status badge, a pinned Confirm/Dismiss footer, then the outcome. Replaces the Apply footer. */
4657
+ decision?: PacketDecision;
4626
4658
  }
4627
4659
  /**
4628
4660
  * A structured result carried by a message. `valid` is tri-state: only an
4629
4661
  * explicit `false` blocks Apply — an unvalidated packet is a legitimate result.
4630
4662
  */
4631
- declare function PacketCard({ packet, schema, render, onApply, applied }: PacketCardProps): React.JSX.Element | null;
4663
+ declare function PacketCard({ packet, schema, render, onApply, applied, decision }: PacketCardProps): React.JSX.Element | null;
4632
4664
  interface ThinkingBlockProps {
4633
4665
  text?: string;
4634
4666
  durationMs?: number;
@@ -5570,4 +5602,4 @@ declare function usePublishCornerStackOffset(ref: React.RefObject<HTMLElement |
5570
5602
  /** Marks the document while a side-panel sheet is open. */
5571
5603
  declare function useSheetOpenMark(active: boolean): void;
5572
5604
 
5573
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
5605
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
package/dist/index.d.ts CHANGED
@@ -4146,6 +4146,32 @@ interface PacketSchema {
4146
4146
  /** `false` hides the Apply footer for this packet type (a live query card, a CSV). Default: Apply shows. */
4147
4147
  apply?: boolean;
4148
4148
  }
4149
+ type PacketDecisionAction = "confirm" | "dismiss";
4150
+ type PacketDecisionTone = "neutral" | "info" | "success" | "warning" | "danger";
4151
+ /** What the app says about a packet right now. The design system keeps no state beyond the pending press. */
4152
+ interface PacketDecisionState {
4153
+ /** Header badge: waiting, confirming, done, refused, failed, unknown… */
4154
+ status?: {
4155
+ label: string;
4156
+ tone: PacketDecisionTone;
4157
+ };
4158
+ /** Once set the packet is decided: replaces the footer. */
4159
+ outcome?: {
4160
+ message: React.ReactNode;
4161
+ tone: "success" | "danger";
4162
+ };
4163
+ /** App-reported error banner, shown with both buttons usable. A rejection of `onDecide` shows its own message. */
4164
+ error?: React.ReactNode;
4165
+ }
4166
+ /** Decision mode for one packet type. */
4167
+ interface PacketDecision {
4168
+ /** Called with the pressed action; the buttons stay pending until it settles, a rejection shows an error banner. */
4169
+ onDecide: (action: PacketDecisionAction, packet: Packet) => Promise<void>;
4170
+ /** Packet's current status, outcome and error. */
4171
+ state: (packet: Packet) => PacketDecisionState;
4172
+ confirmLabel?: string;
4173
+ dismissLabel?: string;
4174
+ }
4149
4175
  interface JobStatus {
4150
4176
  id?: string;
4151
4177
  /** queued | running keep polling · completed | recovered are success · anything else fails loudly. */
@@ -4416,6 +4442,8 @@ interface AgentChatPanelProps {
4416
4442
  packetSchemas?: Record<string, PacketSchema>;
4417
4443
  packetRenderers?: Record<string, (p: Packet) => React.ReactNode>;
4418
4444
  onApplyPacket?: (p: Packet) => void;
4445
+ /** Decision mode per packet type: header status badge, pinned Confirm/Dismiss footer, then the outcome. */
4446
+ packetDecisions?: Record<string, PacketDecision>;
4419
4447
  /** Give-up time for a queued/running turn, in ms. Default 180000. The server's terminal job status always wins. */
4420
4448
  pendingTimeoutMs?: number;
4421
4449
  /** Words for the background work a live turn waits on, given the still-working cards ("Running 2 queries"). */
@@ -4476,7 +4504,7 @@ interface AgentChatPanelProps {
4476
4504
  * renders only when its input is supplied. A panel with no telemetry shows no
4477
4505
  * telemetry, not zeroes.
4478
4506
  */
4479
- declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4507
+ declare function AgentChatPanel({ contextType, contextId, draftOwner, apiAdapter, threadId, reloadKey, title, subtitle, showHeader, headerActions, onClose, assistantName, userName, assistantAvatar, userAvatar, assistantIcon, showAvatars, markdown, maxVisibleChars, messageActions, showSteps, showThinking, emptyTitle, emptyDescription, emptyIcon, suggestions, renderEmpty, packetSchemas, packetRenderers, packetDecisions, onApplyPacket, pendingTimeoutMs, describeWaiting, onOpenAttachment, errorCopy, placeholder, maxLength, hint, fileUploadHandler, acceptFiles, maxFileSize, largePasteThreshold, slashCommands, mentionSources, voiceHandler, initialMessage, contextUsage, sessionStats, usageLimits, models, model, onModelChange, effortLevels, effort, onEffortChange, fastMode, onFastModeChange, moreModels, threads, onSelectThread, onNewThread, onDeleteThread, surface, height, className, style, onPacket, onThreadReady, onError, onSend, onClear, onFeedback, onEditMessage, }: AgentChatPanelProps): React.JSX.Element;
4480
4508
 
4481
4509
  /**
4482
4510
  * Staged files, the queue strip, the markdown editor, slash/mention triggers, send + stop.
@@ -4588,6 +4616,8 @@ interface ChatRenderContext {
4588
4616
  packetSchemas?: Record<string, PacketSchema>;
4589
4617
  packetRenderers?: Record<string, (p: Packet) => React.ReactNode>;
4590
4618
  appliedPackets?: Record<string, boolean>;
4619
+ /** Decision mode per packet type (see PacketCard `decision`). */
4620
+ packetDecisions?: Record<string, PacketDecision>;
4591
4621
  /** Sidebar-width layout: tighter padding, stacked controls. */
4592
4622
  narrow?: boolean;
4593
4623
  onOpenAttachment?: (a: Attachment) => void;
@@ -4623,12 +4653,14 @@ interface PacketCardProps {
4623
4653
  render?: (p: Packet) => React.ReactNode;
4624
4654
  onApply?: (p: Packet) => void;
4625
4655
  applied?: boolean;
4656
+ /** Decision mode: a status badge, a pinned Confirm/Dismiss footer, then the outcome. Replaces the Apply footer. */
4657
+ decision?: PacketDecision;
4626
4658
  }
4627
4659
  /**
4628
4660
  * A structured result carried by a message. `valid` is tri-state: only an
4629
4661
  * explicit `false` blocks Apply — an unvalidated packet is a legitimate result.
4630
4662
  */
4631
- declare function PacketCard({ packet, schema, render, onApply, applied }: PacketCardProps): React.JSX.Element | null;
4663
+ declare function PacketCard({ packet, schema, render, onApply, applied, decision }: PacketCardProps): React.JSX.Element | null;
4632
4664
  interface ThinkingBlockProps {
4633
4665
  text?: string;
4634
4666
  durationMs?: number;
@@ -5570,4 +5602,4 @@ declare function usePublishCornerStackOffset(ref: React.RefObject<HTMLElement |
5570
5602
  /** Marks the document while a side-panel sheet is open. */
5571
5603
  declare function useSheetOpenMark(active: boolean): void;
5572
5604
 
5573
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
5605
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_UNAVAILABLE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, Calendar, type CalendarProps, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, ChatTranscript, type ChatTranscriptProps, ChatTurn, type ChatTurnProps, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QueryKit, type QueryPaging, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createLocalStorageAppearanceStore, createVersionStore, eqFilter, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isImage, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, writeQueryToUrl };
package/dist/index.js CHANGED
@@ -8415,6 +8415,7 @@ function CodeEditor({
8415
8415
  const onChangeRef = React56.useRef(onChange);
8416
8416
  onChangeRef.current = onChange;
8417
8417
  const editableCompartment = React56.useRef(new Compartment()).current;
8418
+ const readOnlyCompartment = React56.useRef(new Compartment()).current;
8418
8419
  const attributesCompartment = React56.useRef(new Compartment()).current;
8419
8420
  const errorRef = React56.useRef(error);
8420
8421
  errorRef.current = error;
@@ -8457,7 +8458,7 @@ function CodeEditor({
8457
8458
  ...historyKeymap
8458
8459
  ]),
8459
8460
  editableCompartment.of(EditorView.editable.of(!disabled)),
8460
- EditorState.readOnly.of(readOnly),
8461
+ readOnlyCompartment.of(EditorState.readOnly.of(readOnly)),
8461
8462
  updateListener,
8462
8463
  attributesCompartment.of(EditorView.contentAttributes.of(contentAttributes()))
8463
8464
  ]
@@ -8484,6 +8485,11 @@ function CodeEditor({
8484
8485
  if (!view) return;
8485
8486
  view.dispatch({ effects: editableCompartment.reconfigure(EditorView.editable.of(!disabled)) });
8486
8487
  }, [disabled, editableCompartment]);
8488
+ React56.useEffect(() => {
8489
+ const view = viewRef.current;
8490
+ if (!view) return;
8491
+ view.dispatch({ effects: readOnlyCompartment.reconfigure(EditorState.readOnly.of(readOnly)) });
8492
+ }, [readOnly, readOnlyCompartment]);
8487
8493
  React56.useEffect(() => {
8488
8494
  const view = viewRef.current;
8489
8495
  if (!view) return;
@@ -13129,7 +13135,7 @@ import * as React77 from "react";
13129
13135
 
13130
13136
  // src/components/chat/ChatTurn.tsx
13131
13137
  import * as React76 from "react";
13132
- import { jsx as jsx102, jsxs as jsxs89 } from "react/jsx-runtime";
13138
+ import { Fragment as Fragment29, jsx as jsx102, jsxs as jsxs89 } from "react/jsx-runtime";
13133
13139
  function JsonView({ value }) {
13134
13140
  let text;
13135
13141
  try {
@@ -13139,9 +13145,44 @@ function JsonView({ value }) {
13139
13145
  }
13140
13146
  return /* @__PURE__ */ jsx102(CodeBlock, { code: text, language: "json", collapseAfter: 18 });
13141
13147
  }
13142
- function PacketCard({ packet, schema, render, onApply, applied }) {
13148
+ function DecisionFooter({ packet, decision, state }) {
13149
+ const [pending, setPending] = React76.useState(null);
13150
+ const [failure, setFailure] = React76.useState(null);
13151
+ const mounted = React76.useRef(true);
13152
+ React76.useEffect(() => {
13153
+ mounted.current = true;
13154
+ return () => {
13155
+ mounted.current = false;
13156
+ };
13157
+ }, []);
13158
+ const press = (action) => {
13159
+ if (pending) return;
13160
+ setPending(action);
13161
+ setFailure(null);
13162
+ decision.onDecide(action, packet).then(
13163
+ () => {
13164
+ if (mounted.current) setPending(null);
13165
+ },
13166
+ (e) => {
13167
+ if (!mounted.current) return;
13168
+ setPending(null);
13169
+ setFailure(e instanceof Error && e.message ? e.message : "That didn\u2019t go through.");
13170
+ }
13171
+ );
13172
+ };
13173
+ const error = failure !== null ? failure : state.error;
13174
+ return /* @__PURE__ */ jsxs89(Fragment29, { children: [
13175
+ error ? /* @__PURE__ */ jsx102("div", { className: "fdc-packet-decision-msg", children: /* @__PURE__ */ jsx102(Banner, { tone: "danger", title: error }) }) : null,
13176
+ /* @__PURE__ */ jsxs89("footer", { className: "fdc-packet-foot fdc-packet-decision", children: [
13177
+ /* @__PURE__ */ jsx102(Button, { variant: "secondary", size: "sm", loading: pending === "dismiss", disabled: pending === "confirm", onClick: () => press("dismiss"), children: decision.dismissLabel || "Dismiss" }),
13178
+ /* @__PURE__ */ jsx102(Button, { variant: "primary", size: "sm", loading: pending === "confirm", disabled: pending === "dismiss", onClick: () => press("confirm"), children: decision.confirmLabel || "Confirm" })
13179
+ ] })
13180
+ ] });
13181
+ }
13182
+ function PacketCard({ packet, schema, render, onApply, applied, decision }) {
13143
13183
  if (!packet) return null;
13144
13184
  const s = schema || {};
13185
+ const state = decision ? decision.state(packet) : {};
13145
13186
  const invalid = packet.valid === false;
13146
13187
  const title = s.heading || packet.type;
13147
13188
  return /* @__PURE__ */ jsxs89("section", { className: "fdc-packet" + (invalid ? " is-invalid" : ""), "aria-label": title, children: [
@@ -13149,13 +13190,14 @@ function PacketCard({ packet, schema, render, onApply, applied }) {
13149
13190
  /* @__PURE__ */ jsx102("i", { className: "ph ph-" + (s.icon || "package"), "aria-hidden": "true" }),
13150
13191
  /* @__PURE__ */ jsx102("span", { className: "fdc-packet-title", title: truncationTitle(title), children: title }),
13151
13192
  packet.repaired ? /* @__PURE__ */ jsx102("span", { className: "fdc-packet-badge", children: "Repaired" }) : null,
13152
- invalid ? /* @__PURE__ */ jsx102("span", { className: "fdc-packet-badge is-danger", children: "Invalid" }) : null
13193
+ invalid ? /* @__PURE__ */ jsx102("span", { className: "fdc-packet-badge is-danger", children: "Invalid" }) : null,
13194
+ decision && state.status ? /* @__PURE__ */ jsx102(Badge, { tone: state.status.tone, children: state.status.label }) : null
13153
13195
  ] }),
13154
13196
  invalid ? /* @__PURE__ */ jsxs89("div", { className: "fdc-packet-alert", role: "alert", children: [
13155
13197
  /* @__PURE__ */ jsx102("i", { className: "ph ph-warning-circle", "aria-hidden": "true" }),
13156
13198
  /* @__PURE__ */ jsx102("span", { children: packet.error || "This result failed validation and can\u2019t be applied." })
13157
13199
  ] }) : /* @__PURE__ */ jsx102("div", { className: "fdc-packet-body", children: render ? render(packet) : /* @__PURE__ */ jsx102(JsonView, { value: packet.payload }) }),
13158
- !invalid && onApply && s.apply !== false ? /* @__PURE__ */ jsxs89("footer", { className: "fdc-packet-foot", children: [
13200
+ !invalid && decision ? state.outcome ? /* @__PURE__ */ jsx102("div", { className: "fdc-packet-decision-msg", children: /* @__PURE__ */ jsx102(Banner, { tone: state.outcome.tone === "success" ? "ok" : "danger", role: "status", title: state.outcome.message }) }) : /* @__PURE__ */ jsx102(DecisionFooter, { packet, decision, state }) : !invalid && onApply && s.apply !== false ? /* @__PURE__ */ jsxs89("footer", { className: "fdc-packet-foot", children: [
13159
13201
  packet.repaired ? /* @__PURE__ */ jsx102("span", { className: "fdc-packet-note", children: "Corrected by the backend after a first attempt." }) : /* @__PURE__ */ jsx102("span", {}),
13160
13202
  /* @__PURE__ */ jsxs89("button", { type: "button", className: "fd-btn fd-btn-primary fd-btn-sm", disabled: applied, onClick: () => onApply(packet), children: [
13161
13203
  /* @__PURE__ */ jsx102("i", { className: "ph ph-" + (applied ? "check" : "arrow-square-in"), "aria-hidden": "true" }),
@@ -13237,6 +13279,7 @@ function MessageBody({ message: m, ctx }) {
13237
13279
  schema: (ctx.packetSchemas || {})[m.packet.type],
13238
13280
  render: (ctx.packetRenderers || {})[m.packet.type],
13239
13281
  onApply: ctx.onApplyPacket,
13282
+ decision: (ctx.packetDecisions || {})[m.packet.type],
13240
13283
  applied: ctx.appliedPackets && ctx.appliedPackets[m.id]
13241
13284
  }
13242
13285
  ) : null,
@@ -13955,6 +13998,7 @@ function AgentChatPanel({
13955
13998
  renderEmpty,
13956
13999
  packetSchemas,
13957
14000
  packetRenderers,
14001
+ packetDecisions,
13958
14002
  onApplyPacket,
13959
14003
  pendingTimeoutMs,
13960
14004
  describeWaiting,
@@ -14044,6 +14088,7 @@ function AgentChatPanel({
14044
14088
  showThinking,
14045
14089
  packetSchemas,
14046
14090
  packetRenderers,
14091
+ packetDecisions,
14047
14092
  appliedPackets: applied,
14048
14093
  narrow,
14049
14094
  onOpenAttachment,
@@ -14397,7 +14442,7 @@ function FileViewer({ file, resolveUrl, sidePanel, sidePanelLabel = "Details", o
14397
14442
 
14398
14443
  // src/components/files/FileBrowser.tsx
14399
14444
  import * as React82 from "react";
14400
- import { Fragment as Fragment31, jsx as jsx108, jsxs as jsxs95 } from "react/jsx-runtime";
14445
+ import { Fragment as Fragment32, jsx as jsx108, jsxs as jsxs95 } from "react/jsx-runtime";
14401
14446
  function childrenOf(folders, parentId) {
14402
14447
  return folders.filter((f) => f.parentId === parentId).sort((a, b) => a.name.localeCompare(b.name));
14403
14448
  }
@@ -14696,7 +14741,7 @@ function FileBrowser({
14696
14741
  ] }),
14697
14742
  /* @__PURE__ */ jsxs95("span", { className: "fd-fb-actions", children: [
14698
14743
  canCreateFolder ? /* @__PURE__ */ jsx108(Button, { variant: "secondary", size: "sm", icon: "folder-simple-plus", onClick: openCreate, children: "New folder" }) : null,
14699
- canUpload ? /* @__PURE__ */ jsxs95(Fragment31, { children: [
14744
+ canUpload ? /* @__PURE__ */ jsxs95(Fragment32, { children: [
14700
14745
  /* @__PURE__ */ jsx108(Button, { variant: "secondary", size: "sm", icon: "upload-simple", onClick: () => uploadInputRef.current && uploadInputRef.current.click(), children: "Upload" }),
14701
14746
  /* @__PURE__ */ jsx108(
14702
14747
  "input",
@@ -14763,7 +14808,7 @@ function FileBrowser({
14763
14808
  draggableId: canMove ? { kind: "folder", id: f.id } : void 0,
14764
14809
  isDropTarget: canMove,
14765
14810
  onDropPayload: (p) => moveIntoFolder(p, f.id),
14766
- actions: /* @__PURE__ */ jsxs95(Fragment31, { children: [
14811
+ actions: /* @__PURE__ */ jsxs95(Fragment32, { children: [
14767
14812
  canRenameFolder ? /* @__PURE__ */ jsx108(IconButton, { icon: "pencil-simple", label: "Rename " + f.name, size: "sm", variant: "ghost", onClick: () => openRename(f) }) : null,
14768
14813
  canMove ? /* @__PURE__ */ jsx108(
14769
14814
  FolderPickerMenu,
@@ -14786,7 +14831,7 @@ function FileBrowser({
14786
14831
  meta: file.size ? formatBytes(file.size) : void 0,
14787
14832
  onOpen: onOpenFile ? () => onOpenFile(file) : void 0,
14788
14833
  draggableId: canMove ? { kind: "file", id: file.id } : void 0,
14789
- actions: /* @__PURE__ */ jsxs95(Fragment31, { children: [
14834
+ actions: /* @__PURE__ */ jsxs95(Fragment32, { children: [
14790
14835
  canMove ? /* @__PURE__ */ jsx108(
14791
14836
  FolderPickerMenu,
14792
14837
  {
@@ -14804,7 +14849,7 @@ function FileBrowser({
14804
14849
  }
14805
14850
  ) })
14806
14851
  ] }),
14807
- /* @__PURE__ */ jsx108(Modal, { open: createOpen, title: "New folder", onClose: () => setCreateOpen(false), footer: /* @__PURE__ */ jsxs95(Fragment31, { children: [
14852
+ /* @__PURE__ */ jsx108(Modal, { open: createOpen, title: "New folder", onClose: () => setCreateOpen(false), footer: /* @__PURE__ */ jsxs95(Fragment32, { children: [
14808
14853
  /* @__PURE__ */ jsx108(Button, { variant: "secondary", onClick: () => setCreateOpen(false), children: "Cancel" }),
14809
14854
  /* @__PURE__ */ jsx108(Button, { onClick: submitCreate, disabled: !createName.trim(), children: "Create" })
14810
14855
  ] }), children: /* @__PURE__ */ jsx108(
@@ -14821,7 +14866,7 @@ function FileBrowser({
14821
14866
  autoFocus: true
14822
14867
  }
14823
14868
  ) }),
14824
- /* @__PURE__ */ jsx108(Modal, { open: renameTarget != null, title: "Rename folder", onClose: () => setRenameTarget(null), footer: /* @__PURE__ */ jsxs95(Fragment31, { children: [
14869
+ /* @__PURE__ */ jsx108(Modal, { open: renameTarget != null, title: "Rename folder", onClose: () => setRenameTarget(null), footer: /* @__PURE__ */ jsxs95(Fragment32, { children: [
14825
14870
  /* @__PURE__ */ jsx108(Button, { variant: "secondary", onClick: () => setRenameTarget(null), children: "Cancel" }),
14826
14871
  /* @__PURE__ */ jsx108(Button, { onClick: submitRename, disabled: !renameValue.trim(), children: "Save" })
14827
14872
  ] }), children: /* @__PURE__ */ jsx108(
@@ -14845,7 +14890,7 @@ function FileBrowser({
14845
14890
  title: deleteTarget ? "Delete \u201C" + deleteTarget.name + "\u201D?" : "Delete folder?",
14846
14891
  description: "This can't be undone. The folder must be empty.",
14847
14892
  onClose: () => setDeleteTarget(null),
14848
- footer: /* @__PURE__ */ jsxs95(Fragment31, { children: [
14893
+ footer: /* @__PURE__ */ jsxs95(Fragment32, { children: [
14849
14894
  /* @__PURE__ */ jsx108(Button, { variant: "secondary", onClick: () => setDeleteTarget(null), children: "Cancel" }),
14850
14895
  /* @__PURE__ */ jsx108(Button, { variant: "danger", onClick: confirmDelete, children: "Delete" })
14851
14896
  ] })