@percena/weft 0.4.0-next.7 → 0.4.0-next.8
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/chat.cjs +2 -2
- package/dist/chat.d.cts +0 -167
- package/dist/chat.d.ts +0 -167
- package/dist/chat.js +2 -2
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +0 -1725
- package/dist/index.d.ts +0 -1725
- package/dist/index.js +2 -2
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -3654,1728 +3654,3 @@ interface CreateFlitroRuntimeOptions {
|
|
|
3654
3654
|
declare function createFlitroRuntime(options: CreateFlitroRuntimeOptions): Promise<AgentRuntime>;
|
|
3655
3655
|
|
|
3656
3656
|
export { type CreateFlitroDriverOptions, type CreateFlitroEmbedRuntimeOptions, type CreateFlitroProviderRuntimeOptions, type CreateFlitroRuntimeCandidatesOptions, type CreateFlitroRuntimeCapabilityReportOptions, type CreateFlitroRuntimeOptions, type FlitroCapabilityProbeResult, type FlitroProviderRuntimeDriver, createFlitroDriver, createFlitroEmbedRuntime, createFlitroProviderRuntime, createFlitroRuntime, createFlitroRuntimeCandidates, createFlitroRuntimeCapabilityReport, probeFlitroCapabilities };
|
|
3657
|
-
|
|
3658
|
-
// ── inlined from @weft/ui ──
|
|
3659
|
-
// -- @weft/ui/index.d.ts --
|
|
3660
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3661
|
-
import * as React$1 from 'react';
|
|
3662
|
-
import React__default, { ReactNode } from 'react';
|
|
3663
|
-
|
|
3664
|
-
type ActivityStatus = 'pending' | 'running' | 'completed' | 'error' | 'backgrounded';
|
|
3665
|
-
type ActivityType = 'tool' | 'thinking' | 'intermediate' | 'status' | 'plan';
|
|
3666
|
-
type AnnotationInteractionMode = 'interactive' | 'tooltip-only';
|
|
3667
|
-
type TodoStatus = 'pending' | 'in_progress' | 'completed' | 'interrupted';
|
|
3668
|
-
interface TodoItem {
|
|
3669
|
-
/** Task content/description */
|
|
3670
|
-
content: string;
|
|
3671
|
-
/** Current status */
|
|
3672
|
-
status: TodoStatus;
|
|
3673
|
-
/** Present continuous form shown when in_progress (e.g., "Running tests") */
|
|
3674
|
-
activeForm?: string;
|
|
3675
|
-
}
|
|
3676
|
-
interface ActivityItem {
|
|
3677
|
-
id: string;
|
|
3678
|
-
type: ActivityType;
|
|
3679
|
-
status: ActivityStatus;
|
|
3680
|
-
toolName?: string;
|
|
3681
|
-
toolUseId?: string;
|
|
3682
|
-
toolInput?: Record<string, unknown>;
|
|
3683
|
-
content?: string;
|
|
3684
|
-
intent?: string;
|
|
3685
|
-
/** Optional backing message id (used by plan activities for branching/annotations) */
|
|
3686
|
-
messageId?: string;
|
|
3687
|
-
/** Optional persisted annotations (used by plan activities) */
|
|
3688
|
-
annotations?: AnnotationV1[];
|
|
3689
|
-
displayName?: string;
|
|
3690
|
-
toolDisplayMeta?: ToolDisplayMeta;
|
|
3691
|
-
timestamp: number;
|
|
3692
|
-
error?: string;
|
|
3693
|
-
parentId?: string;
|
|
3694
|
-
depth?: number;
|
|
3695
|
-
statusType?: string;
|
|
3696
|
-
taskId?: string;
|
|
3697
|
-
shellId?: string;
|
|
3698
|
-
elapsedSeconds?: number;
|
|
3699
|
-
isBackground?: boolean;
|
|
3700
|
-
}
|
|
3701
|
-
interface ResponseContent {
|
|
3702
|
-
text: string;
|
|
3703
|
-
isStreaming: boolean;
|
|
3704
|
-
streamStartTime?: number;
|
|
3705
|
-
/** Whether this response is a plan (renders with plan variant) */
|
|
3706
|
-
isPlan?: boolean;
|
|
3707
|
-
/** ID of the underlying message (for branching + annotations) */
|
|
3708
|
-
messageId?: string;
|
|
3709
|
-
/** Persisted annotations attached to the response message */
|
|
3710
|
-
annotations?: AnnotationV1[];
|
|
3711
|
-
}
|
|
3712
|
-
/** Represents one complete assistant turn */
|
|
3713
|
-
interface AssistantTurn {
|
|
3714
|
-
type: 'assistant';
|
|
3715
|
-
turnId: string;
|
|
3716
|
-
activities: ActivityItem[];
|
|
3717
|
-
response?: ResponseContent;
|
|
3718
|
-
intent?: string;
|
|
3719
|
-
isStreaming: boolean;
|
|
3720
|
-
isComplete: boolean;
|
|
3721
|
-
timestamp: number;
|
|
3722
|
-
/** Extracted from TodoWrite tool - latest todo state in this turn */
|
|
3723
|
-
todos?: TodoItem[];
|
|
3724
|
-
}
|
|
3725
|
-
/** Represents a user message */
|
|
3726
|
-
interface UserTurn {
|
|
3727
|
-
type: 'user';
|
|
3728
|
-
message: Message;
|
|
3729
|
-
timestamp: number;
|
|
3730
|
-
}
|
|
3731
|
-
/** Represents a system/info/error message that stands alone */
|
|
3732
|
-
interface SystemTurn {
|
|
3733
|
-
type: 'system';
|
|
3734
|
-
message: Message;
|
|
3735
|
-
timestamp: number;
|
|
3736
|
-
}
|
|
3737
|
-
/** Represents an auth request (credential input, OAuth flow) */
|
|
3738
|
-
interface AuthRequestTurn {
|
|
3739
|
-
type: 'auth-request';
|
|
3740
|
-
message: Message;
|
|
3741
|
-
timestamp: number;
|
|
3742
|
-
}
|
|
3743
|
-
type Turn = AssistantTurn | UserTurn | SystemTurn | AuthRequestTurn;
|
|
3744
|
-
type OpenAnnotationRequest = {
|
|
3745
|
-
messageId: string;
|
|
3746
|
-
annotationId: string;
|
|
3747
|
-
mode: 'view' | 'edit';
|
|
3748
|
-
anchorX?: number;
|
|
3749
|
-
anchorY?: number;
|
|
3750
|
-
nonce: number;
|
|
3751
|
-
};
|
|
3752
|
-
|
|
3753
|
-
/**
|
|
3754
|
-
* turn-phase.ts
|
|
3755
|
-
*
|
|
3756
|
-
* Turn lifecycle phase detection for assistant turns.
|
|
3757
|
-
*/
|
|
3758
|
-
|
|
3759
|
-
/**
|
|
3760
|
-
* Build a stable UI identity key for an assistant turn card.
|
|
3761
|
-
*
|
|
3762
|
-
* Why this exists:
|
|
3763
|
-
* - Backend turnId can be reused across visually split assistant cards
|
|
3764
|
-
* (e.g., steer/interruption boundaries).
|
|
3765
|
-
* - Expansion state must be keyed by UI-card identity, not raw backend turnId.
|
|
3766
|
-
*/
|
|
3767
|
-
declare function getAssistantTurnUiKey(turn: AssistantTurn, index: number): string;
|
|
3768
|
-
|
|
3769
|
-
/**
|
|
3770
|
-
* turn-grouping.ts
|
|
3771
|
-
*
|
|
3772
|
-
* Core groupMessagesByTurn function plus internal helpers for converting
|
|
3773
|
-
* a flat Message[] array into grouped Turn[] for TurnCard rendering.
|
|
3774
|
-
*/
|
|
3775
|
-
|
|
3776
|
-
/**
|
|
3777
|
-
* Groups messages into turns for TurnCard rendering
|
|
3778
|
-
*
|
|
3779
|
-
* Rules:
|
|
3780
|
-
* - User messages flush and start fresh context
|
|
3781
|
-
* - Tool messages + intermediate assistant messages belong to current turn
|
|
3782
|
-
* - Final assistant message (non-streaming, non-intermediate) flushes the turn
|
|
3783
|
-
* - Error/status/info messages are standalone system turns
|
|
3784
|
-
*
|
|
3785
|
-
* Note: We intentionally ignore turnId for grouping. The SDK generates a new
|
|
3786
|
-
* turnId for each API message, but from a user perspective, all work between
|
|
3787
|
-
* a user message and the final response should be ONE turn. We use isIntermediate
|
|
3788
|
-
* as the signal: isIntermediate=true means more work coming, isIntermediate=false
|
|
3789
|
-
* means final response.
|
|
3790
|
-
*/
|
|
3791
|
-
declare function groupMessagesByTurn(messages: Message[]): Turn[];
|
|
3792
|
-
|
|
3793
|
-
/**
|
|
3794
|
-
* Global size configuration for TurnCard components.
|
|
3795
|
-
* Adjust these values to scale the entire component uniformly.
|
|
3796
|
-
*/
|
|
3797
|
-
/** Shared size configuration for activity UI - exported for reuse in inline execution */
|
|
3798
|
-
declare const SIZE_CONFIG: {
|
|
3799
|
-
/** Base font size class for all text */
|
|
3800
|
-
readonly fontSize: "text-[13px]";
|
|
3801
|
-
/** Icon size class (width and height) */
|
|
3802
|
-
readonly iconSize: "w-3 h-3";
|
|
3803
|
-
/** Spinner text size class */
|
|
3804
|
-
readonly spinnerSize: "text-[10px]";
|
|
3805
|
-
/** Small spinner for header */
|
|
3806
|
-
readonly spinnerSizeSmall: "text-[8px]";
|
|
3807
|
-
/** Activity row height in pixels (approx for calculation) */
|
|
3808
|
-
readonly activityRowHeight: 24;
|
|
3809
|
-
/** Max visible activities before scrolling (show ~15 items) */
|
|
3810
|
-
readonly maxVisibleActivities: 15;
|
|
3811
|
-
/** Number of items before which we apply staggered animation */
|
|
3812
|
-
readonly staggeredAnimationLimit: 10;
|
|
3813
|
-
};
|
|
3814
|
-
type BufferReason = 'complete' | 'min_time' | 'timeout' | 'code_block' | 'list' | 'header' | 'question' | 'threshold_met' | 'high_word_count' | 'buffering';
|
|
3815
|
-
|
|
3816
|
-
/**
|
|
3817
|
-
* tool-display.ts
|
|
3818
|
-
*
|
|
3819
|
-
* Tool display formatting functions extracted from TurnCard.tsx.
|
|
3820
|
-
* No JSX — pure string/object formatting logic.
|
|
3821
|
-
*/
|
|
3822
|
-
|
|
3823
|
-
/**
|
|
3824
|
-
* Determine if buffered content should be shown.
|
|
3825
|
-
* This is the core buffering decision function.
|
|
3826
|
-
*
|
|
3827
|
-
* @param text - The accumulated response text
|
|
3828
|
-
* @param isStreaming - Whether the response is still streaming
|
|
3829
|
-
* @param streamStartTime - When streaming started (for timeout calculation)
|
|
3830
|
-
* @returns Decision with reason for debugging
|
|
3831
|
-
*/
|
|
3832
|
-
declare function shouldShowStreamingContent(text: string, isStreaming: boolean, streamStartTime?: number): {
|
|
3833
|
-
shouldShow: boolean;
|
|
3834
|
-
reason: BufferReason;
|
|
3835
|
-
wordCount: number;
|
|
3836
|
-
};
|
|
3837
|
-
|
|
3838
|
-
interface ResponseCardProps {
|
|
3839
|
-
/** The content to display (markdown) */
|
|
3840
|
-
text: string;
|
|
3841
|
-
/** Whether the content is still streaming */
|
|
3842
|
-
isStreaming: boolean;
|
|
3843
|
-
/** When streaming started - used for buffering timeout calculation */
|
|
3844
|
-
streamStartTime?: number;
|
|
3845
|
-
/** Callback to open file in editor */
|
|
3846
|
-
onOpenFile?: (path: string) => void;
|
|
3847
|
-
/** Callback to open URL */
|
|
3848
|
-
onOpenUrl?: (url: string) => void;
|
|
3849
|
-
/** Callback to open response in Monaco editor */
|
|
3850
|
-
onPopOut?: () => void;
|
|
3851
|
-
/** Card variant - 'response' for AI messages, 'plan' for plan messages */
|
|
3852
|
-
variant?: 'response' | 'plan';
|
|
3853
|
-
/** Parent session ID (used to reset local annotation/island UI state on session switches) */
|
|
3854
|
-
sessionId?: string;
|
|
3855
|
-
/** Underlying message ID for annotation actions */
|
|
3856
|
-
messageId?: string;
|
|
3857
|
-
/** Persisted annotations for this response */
|
|
3858
|
-
annotations?: AnnotationV1[];
|
|
3859
|
-
/** Callback when user accepts the plan (plan variant only) */
|
|
3860
|
-
onAccept?: () => void;
|
|
3861
|
-
/** Callback when user accepts the plan with compaction (compact first, then execute) */
|
|
3862
|
-
onAcceptWithCompact?: () => void;
|
|
3863
|
-
/** Whether this is the last response in the session (shows Accept Plan button only for last response) */
|
|
3864
|
-
isLastResponse?: boolean;
|
|
3865
|
-
/** Whether to show the Accept Plan button (default: true) */
|
|
3866
|
-
showAcceptPlan?: boolean;
|
|
3867
|
-
/** Hide footer for compact embedding (EditPopover) */
|
|
3868
|
-
compactMode?: boolean;
|
|
3869
|
-
/** Callback to branch the session from this response */
|
|
3870
|
-
onBranch?: (options?: {
|
|
3871
|
-
newPanel?: boolean;
|
|
3872
|
-
}) => void;
|
|
3873
|
-
/** Callback to add annotation from selected text */
|
|
3874
|
-
onAddAnnotation?: (messageId: string, annotation: AnnotationV1) => void;
|
|
3875
|
-
/** Callback to remove persisted annotation */
|
|
3876
|
-
onRemoveAnnotation?: (messageId: string, annotationId: string) => void;
|
|
3877
|
-
/** Callback to update persisted annotation */
|
|
3878
|
-
onUpdateAnnotation?: (messageId: string, annotationId: string, patch: Partial<AnnotationV1>) => void;
|
|
3879
|
-
/** Input send key behavior used by follow-up editor */
|
|
3880
|
-
sendMessageKey?: 'enter' | 'cmd-enter';
|
|
3881
|
-
/** Callback when follow-up is saved via "Save & Send" action */
|
|
3882
|
-
onSaveAndSendFollowUp?: (target: {
|
|
3883
|
-
messageId: string;
|
|
3884
|
-
annotationId: string;
|
|
3885
|
-
note: string;
|
|
3886
|
-
selectedText: string;
|
|
3887
|
-
}) => void;
|
|
3888
|
-
/** Whether there are active pending follow-up annotations in the session */
|
|
3889
|
-
hasActiveFollowUpAnnotations?: boolean;
|
|
3890
|
-
/** External request to open a specific annotation in this response */
|
|
3891
|
-
openAnnotationRequest?: OpenAnnotationRequest | null;
|
|
3892
|
-
/** Annotation interaction mode (viewer uses tooltip-only to suppress the island) */
|
|
3893
|
-
annotationInteractionMode?: AnnotationInteractionMode;
|
|
3894
|
-
}
|
|
3895
|
-
/**
|
|
3896
|
-
* ResponseCard - Unified card component for AI responses and plans
|
|
3897
|
-
*
|
|
3898
|
-
* Variants:
|
|
3899
|
-
* - 'response': Buffered streaming response with smart content gating
|
|
3900
|
-
* - 'plan': Plan message with header and Accept Plan button
|
|
3901
|
-
*
|
|
3902
|
-
* Response variant implements smart buffering:
|
|
3903
|
-
* - Waits for 40+ words with structure OR
|
|
3904
|
-
* - High-confidence patterns (code blocks, headers, lists) with lower threshold OR
|
|
3905
|
-
* - Timeout after 2.5 seconds
|
|
3906
|
-
*
|
|
3907
|
-
* Performance optimization: Uses throttled static snapshots instead of re-rendering
|
|
3908
|
-
* on every character. Content updates every 300ms during streaming, avoiding
|
|
3909
|
-
* expensive markdown parsing on every delta.
|
|
3910
|
-
*/
|
|
3911
|
-
declare function ResponseCard({ text, isStreaming, streamStartTime, onOpenFile, onOpenUrl, onPopOut, variant, sessionId, messageId, annotations, onAccept, onAcceptWithCompact, isLastResponse, showAcceptPlan, compactMode, onBranch, onAddAnnotation, onRemoveAnnotation, onUpdateAnnotation, sendMessageKey, onSaveAndSendFollowUp, hasActiveFollowUpAnnotations, openAnnotationRequest, annotationInteractionMode, }: ResponseCardProps): react_jsx_runtime.JSX.Element | null;
|
|
3912
|
-
|
|
3913
|
-
interface TurnCardProps {
|
|
3914
|
-
/** Session ID for state persistence (optional in shared context) */
|
|
3915
|
-
sessionId?: string;
|
|
3916
|
-
/** Turn ID for state persistence */
|
|
3917
|
-
turnId: string;
|
|
3918
|
-
/** All activities in this turn (tools, thinking, intermediate text) */
|
|
3919
|
-
activities: ActivityItem[];
|
|
3920
|
-
/** Final response content (may be streaming) */
|
|
3921
|
-
response?: ResponseContent;
|
|
3922
|
-
/** Primary intent/goal for this turn (shown in collapsed preview) */
|
|
3923
|
-
intent?: string;
|
|
3924
|
-
/** Whether content is still being received */
|
|
3925
|
-
isStreaming: boolean;
|
|
3926
|
-
/** Whether this turn is fully complete */
|
|
3927
|
-
isComplete: boolean;
|
|
3928
|
-
/** Start in expanded state */
|
|
3929
|
-
defaultExpanded?: boolean;
|
|
3930
|
-
/** Controlled expansion state (overrides internal state) */
|
|
3931
|
-
isExpanded?: boolean;
|
|
3932
|
-
/** Callback when expansion state changes */
|
|
3933
|
-
onExpandedChange?: (expanded: boolean) => void;
|
|
3934
|
-
/** Controlled expansion state for activity groups */
|
|
3935
|
-
expandedActivityGroups?: Set<string>;
|
|
3936
|
-
/** Callback when activity group expansion changes */
|
|
3937
|
-
onExpandedActivityGroupsChange?: (groups: Set<string>) => void;
|
|
3938
|
-
/** Callback when file path is clicked */
|
|
3939
|
-
onOpenFile?: (path: string) => void;
|
|
3940
|
-
/** Callback when URL is clicked */
|
|
3941
|
-
onOpenUrl?: (url: string) => void;
|
|
3942
|
-
/** Callback to open response in Monaco editor */
|
|
3943
|
-
onPopOut?: (text: string) => void;
|
|
3944
|
-
/** Callback to open turn details in a new window */
|
|
3945
|
-
onOpenDetails?: () => void;
|
|
3946
|
-
/** Callback to open individual activity details in Monaco */
|
|
3947
|
-
onOpenActivityDetails?: (activity: ActivityItem) => void;
|
|
3948
|
-
/** Callback to open all edits/writes in multi-file diff view */
|
|
3949
|
-
onOpenMultiFileDiff?: () => void;
|
|
3950
|
-
/** Whether this turn has any Edit or Write activities */
|
|
3951
|
-
hasEditOrWriteActivities?: boolean;
|
|
3952
|
-
/** TodoWrite tool state - shown at bottom of turn */
|
|
3953
|
-
todos?: TodoItem[];
|
|
3954
|
-
/** Optional render prop for actions menu (Electron provides dropdown) */
|
|
3955
|
-
renderActionsMenu?: () => React$1.ReactNode;
|
|
3956
|
-
/** Callback when user accepts the plan (plan responses only) */
|
|
3957
|
-
onAcceptPlan?: () => void;
|
|
3958
|
-
/** Callback when user accepts the plan with compaction (compact conversation first, then execute) */
|
|
3959
|
-
onAcceptPlanWithCompact?: () => void;
|
|
3960
|
-
/** Whether this is the last response in the session (shows Accept Plan button only for last response) */
|
|
3961
|
-
isLastResponse?: boolean;
|
|
3962
|
-
/** Session folder path for stripping from file paths in tool display */
|
|
3963
|
-
sessionFolderPath?: string;
|
|
3964
|
-
/** Display mode: 'detailed' shows all info, 'informative' hides MCP/API names and params */
|
|
3965
|
-
displayMode?: 'informative' | 'detailed';
|
|
3966
|
-
/** Animate response appearance (for playground demos) */
|
|
3967
|
-
animateResponse?: boolean;
|
|
3968
|
-
/** Hide footers for compact embedding (EditPopover) */
|
|
3969
|
-
compactMode?: boolean;
|
|
3970
|
-
/** Callback to branch the session from a specific message */
|
|
3971
|
-
onBranch?: (messageId: string, options?: {
|
|
3972
|
-
newPanel?: boolean;
|
|
3973
|
-
}) => void;
|
|
3974
|
-
/** Callback to add an annotation to a response message */
|
|
3975
|
-
onAddAnnotation?: (messageId: string, annotation: AnnotationV1) => void;
|
|
3976
|
-
/** Callback to remove a persisted annotation from a response message */
|
|
3977
|
-
onRemoveAnnotation?: (messageId: string, annotationId: string) => void;
|
|
3978
|
-
/** Callback to update a persisted annotation */
|
|
3979
|
-
onUpdateAnnotation?: (messageId: string, annotationId: string, patch: Partial<AnnotationV1>) => void;
|
|
3980
|
-
/** Input send key behavior used by follow-up editor */
|
|
3981
|
-
sendMessageKey?: 'enter' | 'cmd-enter';
|
|
3982
|
-
/** Callback when follow-up is saved via "Save & Send" action */
|
|
3983
|
-
onSaveAndSendFollowUp?: (target: {
|
|
3984
|
-
messageId: string;
|
|
3985
|
-
annotationId: string;
|
|
3986
|
-
note: string;
|
|
3987
|
-
selectedText: string;
|
|
3988
|
-
}) => void;
|
|
3989
|
-
/** Whether there are active pending follow-up annotations in the session */
|
|
3990
|
-
hasActiveFollowUpAnnotations?: boolean;
|
|
3991
|
-
/** External request to open a specific annotation in the follow-up island */
|
|
3992
|
-
openAnnotationRequest?: OpenAnnotationRequest | null;
|
|
3993
|
-
/** Annotation interaction mode (viewer uses tooltip-only to suppress the island) */
|
|
3994
|
-
annotationInteractionMode?: AnnotationInteractionMode;
|
|
3995
|
-
}
|
|
3996
|
-
/**
|
|
3997
|
-
* TurnCard - Email-like display for one assistant turn
|
|
3998
|
-
*
|
|
3999
|
-
* Batches all activities (tools, thinking) into a collapsible section
|
|
4000
|
-
* with the final response displayed separately below.
|
|
4001
|
-
*
|
|
4002
|
-
* Memoized to prevent re-renders of completed turns during session switches.
|
|
4003
|
-
* Only complete, non-streaming turns are memoized - active turns always re-render.
|
|
4004
|
-
*/
|
|
4005
|
-
declare const TurnCard: React$1.MemoExoticComponent<({ sessionId, turnId, activities, response, intent, isStreaming, isComplete, defaultExpanded, isExpanded: externalIsExpanded, onExpandedChange, expandedActivityGroups: externalExpandedActivityGroups, onExpandedActivityGroupsChange, onOpenFile, onOpenUrl, onPopOut, onOpenDetails, onOpenActivityDetails, onOpenMultiFileDiff, hasEditOrWriteActivities, todos, renderActionsMenu, onAcceptPlan, onAcceptPlanWithCompact, isLastResponse, sessionFolderPath, displayMode, animateResponse, compactMode, onBranch, onAddAnnotation, onRemoveAnnotation, onUpdateAnnotation, sendMessageKey, onSaveAndSendFollowUp, hasActiveFollowUpAnnotations, openAnnotationRequest, annotationInteractionMode, }: TurnCardProps) => react_jsx_runtime.JSX.Element | null>;
|
|
4006
|
-
|
|
4007
|
-
type InlineExecutionStatus = 'executing' | 'success' | 'error';
|
|
4008
|
-
interface InlineActivityItem {
|
|
4009
|
-
id: string;
|
|
4010
|
-
name: string;
|
|
4011
|
-
status: ActivityStatus;
|
|
4012
|
-
description?: string;
|
|
4013
|
-
}
|
|
4014
|
-
interface InlineExecutionProps {
|
|
4015
|
-
/** Current execution status */
|
|
4016
|
-
status: InlineExecutionStatus;
|
|
4017
|
-
/** Activities to display (simplified from full ActivityItem) */
|
|
4018
|
-
activities: InlineActivityItem[];
|
|
4019
|
-
/** Result message on success */
|
|
4020
|
-
result?: string;
|
|
4021
|
-
/** Error message on failure */
|
|
4022
|
-
error?: string;
|
|
4023
|
-
/** Callback to cancel execution */
|
|
4024
|
-
onCancel?: () => void;
|
|
4025
|
-
/** Callback to dismiss (on success/error) */
|
|
4026
|
-
onDismiss?: () => void;
|
|
4027
|
-
/** Callback to retry (on error) */
|
|
4028
|
-
onRetry?: () => void;
|
|
4029
|
-
/** Optional className */
|
|
4030
|
-
className?: string;
|
|
4031
|
-
}
|
|
4032
|
-
declare function InlineExecution({ status, activities, result, error, onCancel, onDismiss, onRetry, className, }: InlineExecutionProps): react_jsx_runtime.JSX.Element;
|
|
4033
|
-
|
|
4034
|
-
/**
|
|
4035
|
-
* Platform-specific actions for UI components.
|
|
4036
|
-
* Consumers provide these via PlatformProvider.
|
|
4037
|
-
*/
|
|
4038
|
-
interface PlatformActions {
|
|
4039
|
-
/** Open a file in the system editor/Finder */
|
|
4040
|
-
onOpenFile?: (path: string) => void;
|
|
4041
|
-
/** Open a URL in the system browser */
|
|
4042
|
-
onOpenUrl?: (url: string) => void;
|
|
4043
|
-
/** Open a markdown preview popover */
|
|
4044
|
-
onOpenMarkdownPreview?: (sessionId: string, markdown: string) => void;
|
|
4045
|
-
/** Open turn details in a new window/panel */
|
|
4046
|
-
onOpenTurnDetails?: (sessionId: string, turnId: string) => void;
|
|
4047
|
-
/** Open activity details */
|
|
4048
|
-
onOpenActivityDetails?: (sessionId: string, activityId: string) => void;
|
|
4049
|
-
/** Open multi-file diff view for a turn */
|
|
4050
|
-
onOpenMultiFileDiff?: (sessionId: string, turnId: string) => void;
|
|
4051
|
-
/** Respond to a permission or auth request */
|
|
4052
|
-
onPermissionAllow?: (requestId: string, allowed: boolean, remember?: boolean) => void;
|
|
4053
|
-
}
|
|
4054
|
-
/**
|
|
4055
|
-
* Provider that injects platform-specific actions into the component tree.
|
|
4056
|
-
*/
|
|
4057
|
-
declare function PlatformProvider({ actions, children, }: {
|
|
4058
|
-
actions: PlatformActions;
|
|
4059
|
-
children: React__default.ReactNode;
|
|
4060
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4061
|
-
|
|
4062
|
-
interface ChatTranscriptProps {
|
|
4063
|
-
messages: Message[];
|
|
4064
|
-
platformActions?: PlatformActions;
|
|
4065
|
-
className?: string;
|
|
4066
|
-
onTurnClick?: (turnId: string) => void;
|
|
4067
|
-
onActivityClick?: (activity: ActivityItem) => void;
|
|
4068
|
-
defaultExpanded?: boolean;
|
|
4069
|
-
displayMode?: 'informative' | 'detailed';
|
|
4070
|
-
animateResponse?: boolean;
|
|
4071
|
-
annotationInteractionMode?: AnnotationInteractionMode;
|
|
4072
|
-
sessionId?: string;
|
|
4073
|
-
sessionFolderPath?: string;
|
|
4074
|
-
children?: ReactNode;
|
|
4075
|
-
}
|
|
4076
|
-
declare function ChatTranscript({ messages, platformActions, className, onTurnClick, onActivityClick, defaultExpanded, displayMode, animateResponse, annotationInteractionMode, sessionId, sessionFolderPath, children, }: ChatTranscriptProps): react_jsx_runtime.JSX.Element;
|
|
4077
|
-
|
|
4078
|
-
type SessionViewerMode = 'interactive' | 'readonly';
|
|
4079
|
-
interface SessionViewerProps {
|
|
4080
|
-
session: StoredSession;
|
|
4081
|
-
mode?: SessionViewerMode;
|
|
4082
|
-
platformActions?: PlatformActions;
|
|
4083
|
-
className?: string;
|
|
4084
|
-
onTurnClick?: (turnId: string) => void;
|
|
4085
|
-
onActivityClick?: (activity: ActivityItem) => void;
|
|
4086
|
-
defaultExpanded?: boolean;
|
|
4087
|
-
header?: ReactNode;
|
|
4088
|
-
footer?: ReactNode;
|
|
4089
|
-
sessionFolderPath?: string;
|
|
4090
|
-
}
|
|
4091
|
-
declare function SessionViewer({ session, mode, platformActions, className, onTurnClick, onActivityClick, defaultExpanded, header, footer, sessionFolderPath, }: SessionViewerProps): react_jsx_runtime.JSX.Element;
|
|
4092
|
-
|
|
4093
|
-
interface PendingIndicatorProps {
|
|
4094
|
-
isReconnecting?: boolean;
|
|
4095
|
-
}
|
|
4096
|
-
declare function PendingIndicator({ isReconnecting, }: PendingIndicatorProps): react_jsx_runtime.JSX.Element;
|
|
4097
|
-
|
|
4098
|
-
interface UserMessageBubbleProps {
|
|
4099
|
-
/** Message content (markdown supported) */
|
|
4100
|
-
content: string;
|
|
4101
|
-
/** Additional className for the outer container */
|
|
4102
|
-
className?: string;
|
|
4103
|
-
/** Callback when a URL is clicked */
|
|
4104
|
-
onUrlClick?: (url: string) => void;
|
|
4105
|
-
/** Callback when a file path is clicked */
|
|
4106
|
-
onFileClick?: (path: string) => void;
|
|
4107
|
-
/** Stored attachments (images, documents) */
|
|
4108
|
-
attachments?: StoredAttachment[];
|
|
4109
|
-
/** Content badges for inline display (sources, skills) */
|
|
4110
|
-
badges?: ContentBadge[];
|
|
4111
|
-
/** Whether the message is awaiting backend confirmation. User bubbles stay visually stable. */
|
|
4112
|
-
isPending?: boolean;
|
|
4113
|
-
/** Whether the message is queued (badge shown) */
|
|
4114
|
-
isQueued?: boolean;
|
|
4115
|
-
/** Compact mode - reduces padding for popover embedding */
|
|
4116
|
-
compactMode?: boolean;
|
|
4117
|
-
}
|
|
4118
|
-
declare function UserMessageBubble({ content, className, onUrlClick, onFileClick, attachments, badges, isQueued, compactMode, }: UserMessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
4119
|
-
|
|
4120
|
-
/**
|
|
4121
|
-
* SystemMessage - Displays system/info/error/warning messages
|
|
4122
|
-
*
|
|
4123
|
-
* Used for displaying non-conversational messages like errors, warnings,
|
|
4124
|
-
* info notices, and general system messages. Supports different visual
|
|
4125
|
-
* styles based on the message type.
|
|
4126
|
-
*
|
|
4127
|
-
* Error and warning types use shadow-tinted for a softer, more polished appearance.
|
|
4128
|
-
* System and info types use a simple bordered style.
|
|
4129
|
-
*/
|
|
4130
|
-
type SystemMessageType = 'error' | 'info' | 'warning' | 'system';
|
|
4131
|
-
interface SystemMessageProps {
|
|
4132
|
-
/** Message content (markdown supported) */
|
|
4133
|
-
content: string;
|
|
4134
|
-
/** Message type determining visual style */
|
|
4135
|
-
type: SystemMessageType;
|
|
4136
|
-
/** Additional className for the outer container */
|
|
4137
|
-
className?: string;
|
|
4138
|
-
}
|
|
4139
|
-
/**
|
|
4140
|
-
* SystemMessage - Renders a styled message bubble based on type
|
|
4141
|
-
*/
|
|
4142
|
-
declare function SystemMessage({ content, type, className, }: SystemMessageProps): react_jsx_runtime.JSX.Element;
|
|
4143
|
-
|
|
4144
|
-
/**
|
|
4145
|
-
* PermissionRequestCard - Inline permission prompt for agent tool approval
|
|
4146
|
-
*
|
|
4147
|
-
* Renders when the agent is paused awaiting user approval for a tool
|
|
4148
|
-
* invocation (e.g. bash command, file write, MCP mutation). Displays
|
|
4149
|
-
* the tool name, input preview, and reason, with Allow/Deny/Remember
|
|
4150
|
-
* action buttons.
|
|
4151
|
-
*
|
|
4152
|
-
* Styling follows the Weft design system:
|
|
4153
|
-
* - Rounded-[8px] card with shadow-minimal
|
|
4154
|
-
* - Accent-coloured header strip for tool identity
|
|
4155
|
-
* - Truncated input preview in a subtle code block
|
|
4156
|
-
* - Two or three action buttons (Allow, Deny, Remember)
|
|
4157
|
-
*/
|
|
4158
|
-
interface PermissionRequestCardProps {
|
|
4159
|
-
/** Unique request ID matching the runtime permission request */
|
|
4160
|
-
requestId: string;
|
|
4161
|
-
/** Tool name requesting approval (e.g. "Bash", "Write", "Edit") */
|
|
4162
|
-
toolName: string;
|
|
4163
|
-
/** Optional scope descriptor (session, workspace, source, skill, tool-call) */
|
|
4164
|
-
scope?: {
|
|
4165
|
-
type: string;
|
|
4166
|
-
label?: string;
|
|
4167
|
-
};
|
|
4168
|
-
/** Optional input preview (command, file path, MCP payload) */
|
|
4169
|
-
input?: Record<string, unknown>;
|
|
4170
|
-
/** Optional reason text explaining why permission is needed */
|
|
4171
|
-
reason?: string;
|
|
4172
|
-
/** Whether this request is currently active (not yet resolved) */
|
|
4173
|
-
isActive?: boolean;
|
|
4174
|
-
/** Previous resolution if re-shown for context (allowed/denied) */
|
|
4175
|
-
previousResolution?: {
|
|
4176
|
-
allowed: boolean;
|
|
4177
|
-
remember?: boolean;
|
|
4178
|
-
reason?: string;
|
|
4179
|
-
};
|
|
4180
|
-
/** Callback when user approves the request */
|
|
4181
|
-
onAllow?: (requestId: string, remember?: boolean) => void;
|
|
4182
|
-
/** Callback when user denies the request */
|
|
4183
|
-
onDeny?: (requestId: string) => void;
|
|
4184
|
-
/** Additional className */
|
|
4185
|
-
className?: string;
|
|
4186
|
-
}
|
|
4187
|
-
declare function PermissionRequestCard({ requestId, toolName, scope, input, reason, isActive, previousResolution, onAllow, onDeny, className, }: PermissionRequestCardProps): react_jsx_runtime.JSX.Element;
|
|
4188
|
-
|
|
4189
|
-
/**
|
|
4190
|
-
* Standard assistant-turn presentation: a TurnCard with local expand state that
|
|
4191
|
-
* stays open while the turn streams, the detailed display mode, and a click
|
|
4192
|
-
* handler that surfaces a step for inspection. Shared so the web app and the
|
|
4193
|
-
* embeddable chat panel render thinking steps identically.
|
|
4194
|
-
*/
|
|
4195
|
-
declare function AssistantTurnCard({ sessionId, turn, isLast, onInspectActivity, }: {
|
|
4196
|
-
sessionId: string;
|
|
4197
|
-
turn: Extract<Turn, {
|
|
4198
|
-
type: 'assistant';
|
|
4199
|
-
}>;
|
|
4200
|
-
isLast: boolean;
|
|
4201
|
-
onInspectActivity: (activity: ActivityItem) => void;
|
|
4202
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4203
|
-
|
|
4204
|
-
/**
|
|
4205
|
-
* Renders a single activity's input / output / error for inspection. Shared by
|
|
4206
|
-
* the web app's side panel and the embeddable chat panel's detail popup so the
|
|
4207
|
-
* step-detail view stays identical across hosts.
|
|
4208
|
-
*/
|
|
4209
|
-
declare function ActivityInspector({ activity, onClose, }: {
|
|
4210
|
-
activity: ActivityItem | null;
|
|
4211
|
-
onClose?: () => void;
|
|
4212
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4213
|
-
|
|
4214
|
-
/**
|
|
4215
|
-
* Modal popup wrapping ActivityInspector: centered, dismissable via backdrop
|
|
4216
|
-
* click or Escape. Open it from a TurnCard's onOpenActivityDetails callback.
|
|
4217
|
-
*/
|
|
4218
|
-
declare function ActivityDetailsPanel({ activity, onClose, }: {
|
|
4219
|
-
activity: ActivityItem | null;
|
|
4220
|
-
onClose: () => void;
|
|
4221
|
-
}): react_jsx_runtime.JSX.Element | null;
|
|
4222
|
-
|
|
4223
|
-
declare function PermissionModeMenu({ value, onChange, onClose, isOpen, onToggle, }: {
|
|
4224
|
-
value: PermissionMode;
|
|
4225
|
-
onChange: (mode: PermissionMode) => void;
|
|
4226
|
-
onClose?: () => void;
|
|
4227
|
-
isOpen: boolean;
|
|
4228
|
-
onToggle: () => void;
|
|
4229
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4230
|
-
|
|
4231
|
-
interface CodeBlockProps {
|
|
4232
|
-
code: string;
|
|
4233
|
-
language?: string;
|
|
4234
|
-
className?: string;
|
|
4235
|
-
/**
|
|
4236
|
-
* Render mode affects code block styling:
|
|
4237
|
-
* - 'terminal': Minimal, keeps control chars visible
|
|
4238
|
-
* - 'minimal': Clean code, basic styling
|
|
4239
|
-
* - 'full': Rich styling with background, copy button, etc.
|
|
4240
|
-
*/
|
|
4241
|
-
mode?: 'terminal' | 'minimal' | 'full';
|
|
4242
|
-
/**
|
|
4243
|
-
* Force a specific theme. If not provided, detects from document.documentElement.classList
|
|
4244
|
-
*/
|
|
4245
|
-
forcedTheme?: 'light' | 'dark';
|
|
4246
|
-
}
|
|
4247
|
-
/**
|
|
4248
|
-
* CodeBlock - Syntax highlighted code block using Shiki
|
|
4249
|
-
*
|
|
4250
|
-
* Uses VS Code's syntax highlighting engine for accurate highlighting.
|
|
4251
|
-
* Lazy-loads highlighting and caches results for performance.
|
|
4252
|
-
*/
|
|
4253
|
-
declare function CodeBlock({ code, language, className, mode, forcedTheme }: CodeBlockProps): react_jsx_runtime.JSX.Element;
|
|
4254
|
-
/**
|
|
4255
|
-
* InlineCode - Styled inline code span
|
|
4256
|
-
* Features: subtle background (3%), no border, 75% opacity text
|
|
4257
|
-
*/
|
|
4258
|
-
declare function InlineCode({ children, className }: {
|
|
4259
|
-
children: React$1.ReactNode;
|
|
4260
|
-
className?: string;
|
|
4261
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4262
|
-
|
|
4263
|
-
declare function CollapsibleMarkdownProvider({ children, }: {
|
|
4264
|
-
children: React.ReactNode;
|
|
4265
|
-
}): react_jsx_runtime.JSX.Element;
|
|
4266
|
-
|
|
4267
|
-
/**
|
|
4268
|
-
* Render modes for markdown content:
|
|
4269
|
-
*
|
|
4270
|
-
* - 'terminal': Raw output with minimal formatting, control chars visible
|
|
4271
|
-
* Best for: Debug output, raw logs, when you want to see exactly what's there
|
|
4272
|
-
*
|
|
4273
|
-
* - 'minimal': Clean rendering with syntax highlighting but no extra chrome
|
|
4274
|
-
* Best for: Chat messages, inline content, when you want readability without clutter
|
|
4275
|
-
*
|
|
4276
|
-
* - 'full': Rich rendering with beautiful tables, styled code blocks, proper typography
|
|
4277
|
-
* Best for: Documentation, long-form content, when presentation matters
|
|
4278
|
-
*/
|
|
4279
|
-
type RenderMode = 'terminal' | 'minimal' | 'full';
|
|
4280
|
-
interface MarkdownProps {
|
|
4281
|
-
children: string;
|
|
4282
|
-
/**
|
|
4283
|
-
* Render mode controlling formatting level
|
|
4284
|
-
* @default 'minimal'
|
|
4285
|
-
*/
|
|
4286
|
-
mode?: RenderMode;
|
|
4287
|
-
className?: string;
|
|
4288
|
-
/**
|
|
4289
|
-
* Message ID for memoization (optional)
|
|
4290
|
-
* When provided, memoizes parsed blocks to avoid re-parsing during streaming
|
|
4291
|
-
*/
|
|
4292
|
-
id?: string;
|
|
4293
|
-
/**
|
|
4294
|
-
* Callback when a URL is clicked
|
|
4295
|
-
*/
|
|
4296
|
-
onUrlClick?: (url: string) => void;
|
|
4297
|
-
/**
|
|
4298
|
-
* Callback when a file path is clicked
|
|
4299
|
-
*/
|
|
4300
|
-
onFileClick?: (path: string) => void;
|
|
4301
|
-
/**
|
|
4302
|
-
* Enable collapsible headings
|
|
4303
|
-
* Requires wrapping in CollapsibleMarkdownProvider
|
|
4304
|
-
* @default false
|
|
4305
|
-
*/
|
|
4306
|
-
collapsible?: boolean;
|
|
4307
|
-
/**
|
|
4308
|
-
* Hide expand button on first mermaid block (when message starts with mermaid)
|
|
4309
|
-
* Used in chat to avoid overlap with TurnCard's fullscreen button
|
|
4310
|
-
* @default true
|
|
4311
|
-
*/
|
|
4312
|
-
hideFirstMermaidExpand?: boolean;
|
|
4313
|
-
}
|
|
4314
|
-
/**
|
|
4315
|
-
* Markdown - Customizable markdown renderer with multiple render modes
|
|
4316
|
-
*
|
|
4317
|
-
* Features:
|
|
4318
|
-
* - Three render modes: terminal, minimal, full
|
|
4319
|
-
* - Syntax highlighting via Shiki
|
|
4320
|
-
* - GFM support (tables, task lists, strikethrough)
|
|
4321
|
-
* - Clickable links and file paths
|
|
4322
|
-
* - Memoization for streaming performance
|
|
4323
|
-
*/
|
|
4324
|
-
declare function Markdown({ children, mode, className, id, onUrlClick, onFileClick, collapsible, hideFirstMermaidExpand, }: MarkdownProps): react_jsx_runtime.JSX.Element;
|
|
4325
|
-
/**
|
|
4326
|
-
* MemoizedMarkdown - Optimized for streaming scenarios
|
|
4327
|
-
*
|
|
4328
|
-
* Splits content into blocks and memoizes each block separately,
|
|
4329
|
-
* so only new/changed blocks re-render during streaming.
|
|
4330
|
-
*/
|
|
4331
|
-
declare const MemoizedMarkdown: React$1.MemoExoticComponent<typeof Markdown>;
|
|
4332
|
-
|
|
4333
|
-
interface AnchoredSelection {
|
|
4334
|
-
anchorX: number;
|
|
4335
|
-
anchorY: number;
|
|
4336
|
-
start: number;
|
|
4337
|
-
end: number;
|
|
4338
|
-
exact: string;
|
|
4339
|
-
selectedText?: string;
|
|
4340
|
-
prefix?: string;
|
|
4341
|
-
suffix?: string;
|
|
4342
|
-
}
|
|
4343
|
-
|
|
4344
|
-
/**
|
|
4345
|
-
* annotation-core — stub for annotation overlay core utilities.
|
|
4346
|
-
*
|
|
4347
|
-
* Provides type definitions and utility functions for annotation rendering.
|
|
4348
|
-
* Full implementation will be ported from the upstream source project.
|
|
4349
|
-
*/
|
|
4350
|
-
|
|
4351
|
-
interface AnnotationOverlayRect {
|
|
4352
|
-
id: string;
|
|
4353
|
-
left: number;
|
|
4354
|
-
top: number;
|
|
4355
|
-
width: number;
|
|
4356
|
-
height: number;
|
|
4357
|
-
color: string;
|
|
4358
|
-
}
|
|
4359
|
-
type AnnotationOverlayChip = {
|
|
4360
|
-
id: string;
|
|
4361
|
-
index: number;
|
|
4362
|
-
left: number;
|
|
4363
|
-
top: number;
|
|
4364
|
-
sentFollowUp: boolean;
|
|
4365
|
-
};
|
|
4366
|
-
declare function hasExistingTextRangeAnnotation(annotations: AnnotationV1[], start: number, end: number): boolean;
|
|
4367
|
-
declare function createSelectionPreviewAnnotation(messageId: string, sessionIdOrSelection: string | AnchoredSelection, startOrSessionId?: number | string, end?: number, exact?: string): AnnotationV1;
|
|
4368
|
-
declare function createTextSelectionAnnotation(messageId: string, sessionId: string, start: number, end: number, exact: string, note: string): AnnotationV1;
|
|
4369
|
-
interface TextSegment {
|
|
4370
|
-
start: number;
|
|
4371
|
-
end: number;
|
|
4372
|
-
node: Text;
|
|
4373
|
-
}
|
|
4374
|
-
declare function collectTextSegments(_content: string | HTMLElement, _annotations: AnnotationV1[]): TextSegment[];
|
|
4375
|
-
/** Stub — full implementation will compute canonical text from DOM */
|
|
4376
|
-
declare function getCanonicalText(_content: string | HTMLElement): string;
|
|
4377
|
-
/**
|
|
4378
|
-
* Stub — resolves character offset within a DOM node.
|
|
4379
|
-
* Full implementation will walk the DOM tree to compute text offset.
|
|
4380
|
-
*/
|
|
4381
|
-
declare function resolveNodeOffset(_root: string | HTMLElement, _node?: Node, _offset?: number): number | null;
|
|
4382
|
-
|
|
4383
|
-
/**
|
|
4384
|
-
* annotation-overlay-geometry — stub for annotation overlay geometry computation.
|
|
4385
|
-
*/
|
|
4386
|
-
|
|
4387
|
-
interface AnnotationOverlayGeometryResult {
|
|
4388
|
-
rects: AnnotationOverlayRect[];
|
|
4389
|
-
chips: AnnotationOverlayChip[];
|
|
4390
|
-
unresolved: Array<{
|
|
4391
|
-
annotation: AnnotationV1;
|
|
4392
|
-
reason: string;
|
|
4393
|
-
}>;
|
|
4394
|
-
}
|
|
4395
|
-
declare function computeAnnotationOverlayGeometry(_containerOrOpts: HTMLElement | {
|
|
4396
|
-
root: HTMLElement;
|
|
4397
|
-
renderedAnnotations: AnnotationV1[];
|
|
4398
|
-
persistedAnnotations?: AnnotationV1[];
|
|
4399
|
-
}, _annotations?: AnnotationV1[], _content?: string): AnnotationOverlayGeometryResult;
|
|
4400
|
-
|
|
4401
|
-
interface AnnotationOverlayLayerProps {
|
|
4402
|
-
rects: AnnotationOverlayRect[];
|
|
4403
|
-
chips: AnnotationOverlayChip[];
|
|
4404
|
-
annotations?: AnnotationV1[];
|
|
4405
|
-
getTooltipText?: (annotation: AnnotationV1, index: number) => string;
|
|
4406
|
-
/** Whether clicking a chip should open the annotation island/details view. */
|
|
4407
|
-
allowChipOpen?: boolean;
|
|
4408
|
-
onChipOpen: (params: {
|
|
4409
|
-
annotationId: string;
|
|
4410
|
-
index: number;
|
|
4411
|
-
anchorX: number;
|
|
4412
|
-
anchorY: number;
|
|
4413
|
-
mode: 'view' | 'edit';
|
|
4414
|
-
}) => void;
|
|
4415
|
-
}
|
|
4416
|
-
declare function AnnotationOverlayLayer({ rects, chips, annotations, getTooltipText, allowChipOpen, onChipOpen, }: AnnotationOverlayLayerProps): react_jsx_runtime.JSX.Element | null;
|
|
4417
|
-
|
|
4418
|
-
/**
|
|
4419
|
-
* IslandTransitionConfig — type stub for annotation island transition animations.
|
|
4420
|
-
*/
|
|
4421
|
-
interface IslandTransitionConfig {
|
|
4422
|
-
duration?: number;
|
|
4423
|
-
easing?: string;
|
|
4424
|
-
}
|
|
4425
|
-
|
|
4426
|
-
/**
|
|
4427
|
-
* AnnotationIslandMenu — stub for annotation island menu component.
|
|
4428
|
-
* Accepts all props used by TurnCard but renders nothing.
|
|
4429
|
-
*/
|
|
4430
|
-
|
|
4431
|
-
interface AnnotationIslandMenuProps {
|
|
4432
|
-
anchor?: {
|
|
4433
|
-
x: number;
|
|
4434
|
-
y: number;
|
|
4435
|
-
} | null;
|
|
4436
|
-
sourceKey?: string;
|
|
4437
|
-
replayNonce?: number;
|
|
4438
|
-
isVisible?: boolean;
|
|
4439
|
-
activeView?: string | null;
|
|
4440
|
-
mode?: string;
|
|
4441
|
-
draft?: string;
|
|
4442
|
-
onDraftChange?: (draft: string) => void;
|
|
4443
|
-
onOpenFollowUp?: () => void;
|
|
4444
|
-
onCancel?: () => void;
|
|
4445
|
-
onRequestBack?: () => boolean;
|
|
4446
|
-
onRequestEdit?: () => void;
|
|
4447
|
-
onSubmit?: (note: string) => void;
|
|
4448
|
-
onSubmitAndSend?: (...args: any[]) => void;
|
|
4449
|
-
onDelete?: () => void;
|
|
4450
|
-
sendMessageKey?: string;
|
|
4451
|
-
transitionConfig?: Record<string, unknown> | IslandTransitionConfig;
|
|
4452
|
-
onExitComplete?: () => void;
|
|
4453
|
-
usePortal?: boolean;
|
|
4454
|
-
className?: string;
|
|
4455
|
-
}
|
|
4456
|
-
declare function AnnotationIslandMenu(_props: AnnotationIslandMenuProps): React$1.ReactNode;
|
|
4457
|
-
|
|
4458
|
-
/**
|
|
4459
|
-
* island-motion — stub for annotation island motion/animation utilities.
|
|
4460
|
-
*/
|
|
4461
|
-
interface PointerSnapshot {
|
|
4462
|
-
x: number;
|
|
4463
|
-
y: number;
|
|
4464
|
-
timestamp: number;
|
|
4465
|
-
}
|
|
4466
|
-
declare function buildAnnotationChipEntryTransition(_snapshot?: PointerSnapshot | null): Record<string, unknown>;
|
|
4467
|
-
declare function buildSelectionEntryTransition(_primary?: PointerSnapshot | null, _secondary?: PointerSnapshot | null): Record<string, unknown>;
|
|
4468
|
-
|
|
4469
|
-
/**
|
|
4470
|
-
* Event Processor Types
|
|
4471
|
-
*
|
|
4472
|
-
* Defines the state and event types for the centralized event processor.
|
|
4473
|
-
* All agent events flow through a single pure function for consistent state transitions.
|
|
4474
|
-
*/
|
|
4475
|
-
|
|
4476
|
-
/**
|
|
4477
|
-
* Runtime Session type — extends core Session with messages and processing state.
|
|
4478
|
-
* Aliased from ProtocolSession which includes all runtime fields needed by the processor.
|
|
4479
|
-
*/
|
|
4480
|
-
type Session = ProtocolSession;
|
|
4481
|
-
|
|
4482
|
-
/**
|
|
4483
|
-
* Streaming state for a session - replaces streamingTextRef
|
|
4484
|
-
*/
|
|
4485
|
-
interface StreamingState {
|
|
4486
|
-
content: string;
|
|
4487
|
-
turnId?: string;
|
|
4488
|
-
parentToolUseId?: string;
|
|
4489
|
-
}
|
|
4490
|
-
/**
|
|
4491
|
-
* Complete state for a session - combines session + streaming
|
|
4492
|
-
*/
|
|
4493
|
-
interface SessionState {
|
|
4494
|
-
session: Session;
|
|
4495
|
-
streaming: StreamingState | null;
|
|
4496
|
-
}
|
|
4497
|
-
/**
|
|
4498
|
-
* Text delta event - streaming text content
|
|
4499
|
-
*/
|
|
4500
|
-
interface TextDeltaEvent {
|
|
4501
|
-
type: 'text_delta';
|
|
4502
|
-
sessionId: string;
|
|
4503
|
-
delta: string;
|
|
4504
|
-
turnId?: string;
|
|
4505
|
-
/** Timestamp from canonical timeline for stable ordering */
|
|
4506
|
-
timestamp?: number;
|
|
4507
|
-
/** When true, this delta belongs to a reasoning/thinking block (intermediate content). */
|
|
4508
|
-
isIntermediate?: boolean;
|
|
4509
|
-
}
|
|
4510
|
-
/**
|
|
4511
|
-
* Text complete event - finalizes streaming text
|
|
4512
|
-
*/
|
|
4513
|
-
interface TextCompleteEvent {
|
|
4514
|
-
type: 'text_complete';
|
|
4515
|
-
sessionId: string;
|
|
4516
|
-
text: string;
|
|
4517
|
-
turnId?: string;
|
|
4518
|
-
isIntermediate?: boolean;
|
|
4519
|
-
parentToolUseId?: string;
|
|
4520
|
-
/** Timestamp from main process for consistent ordering with session.jsonl */
|
|
4521
|
-
timestamp?: number;
|
|
4522
|
-
/** Authoritative message ID from main process for persistence/branching parity */
|
|
4523
|
-
messageId?: string;
|
|
4524
|
-
}
|
|
4525
|
-
/**
|
|
4526
|
-
* Tool start event - begins tool execution
|
|
4527
|
-
* Field names match SessionEvent from @weft/protocol
|
|
4528
|
-
*/
|
|
4529
|
-
interface ToolStartEvent {
|
|
4530
|
-
type: 'tool_start';
|
|
4531
|
-
sessionId: string;
|
|
4532
|
-
toolUseId: string;
|
|
4533
|
-
toolName: string;
|
|
4534
|
-
toolInput?: Record<string, unknown>;
|
|
4535
|
-
/** Timestamp from main process for consistent ordering */
|
|
4536
|
-
timestamp?: number;
|
|
4537
|
-
turnId?: string;
|
|
4538
|
-
parentToolUseId?: string;
|
|
4539
|
-
toolIntent?: string;
|
|
4540
|
-
toolDisplayName?: string;
|
|
4541
|
-
/** Tool display metadata with base64-encoded icon for viewer compatibility */
|
|
4542
|
-
toolDisplayMeta?: ToolDisplayMeta;
|
|
4543
|
-
}
|
|
4544
|
-
/**
|
|
4545
|
-
* Tool result event - completes tool execution
|
|
4546
|
-
*/
|
|
4547
|
-
interface ToolResultEvent {
|
|
4548
|
-
type: 'tool_result';
|
|
4549
|
-
sessionId: string;
|
|
4550
|
-
toolUseId: string;
|
|
4551
|
-
toolName?: string;
|
|
4552
|
-
result: string;
|
|
4553
|
-
isError?: boolean;
|
|
4554
|
-
turnId?: string;
|
|
4555
|
-
parentToolUseId?: string;
|
|
4556
|
-
/** Timestamp from main process for consistent ordering */
|
|
4557
|
-
timestamp?: number;
|
|
4558
|
-
}
|
|
4559
|
-
/**
|
|
4560
|
-
* Tool delta event - appends streaming output to an executing tool.
|
|
4561
|
-
*/
|
|
4562
|
-
interface ToolDeltaEvent {
|
|
4563
|
-
type: 'tool_delta';
|
|
4564
|
-
sessionId: string;
|
|
4565
|
-
toolUseId: string;
|
|
4566
|
-
delta: string;
|
|
4567
|
-
stream?: string;
|
|
4568
|
-
turnId?: string;
|
|
4569
|
-
/** Timestamp from main process for consistent ordering */
|
|
4570
|
-
timestamp?: number;
|
|
4571
|
-
}
|
|
4572
|
-
/**
|
|
4573
|
-
* Complete event - agent loop finished
|
|
4574
|
-
*/
|
|
4575
|
-
interface CompleteEvent {
|
|
4576
|
-
type: 'complete';
|
|
4577
|
-
sessionId: string;
|
|
4578
|
-
tokenUsage?: Session['tokenUsage'];
|
|
4579
|
-
/** Explicit unread flag - set by main process based on viewing state */
|
|
4580
|
-
hasUnread?: boolean;
|
|
4581
|
-
}
|
|
4582
|
-
/**
|
|
4583
|
-
* Error event - agent error occurred
|
|
4584
|
-
*/
|
|
4585
|
-
interface ErrorEvent {
|
|
4586
|
-
type: 'error';
|
|
4587
|
-
sessionId: string;
|
|
4588
|
-
error: string;
|
|
4589
|
-
code?: string;
|
|
4590
|
-
title?: string;
|
|
4591
|
-
details?: string;
|
|
4592
|
-
original?: string;
|
|
4593
|
-
/** Timestamp from main process for consistent ordering */
|
|
4594
|
-
timestamp?: number;
|
|
4595
|
-
}
|
|
4596
|
-
/**
|
|
4597
|
-
* Permission request event
|
|
4598
|
-
* Matches SessionEvent shape from @weft/protocol
|
|
4599
|
-
*/
|
|
4600
|
-
interface PermissionRequestEvent {
|
|
4601
|
-
type: 'permission_request';
|
|
4602
|
-
sessionId: string;
|
|
4603
|
-
request: PermissionRequest;
|
|
4604
|
-
}
|
|
4605
|
-
/**
|
|
4606
|
-
* Sources changed event
|
|
4607
|
-
*/
|
|
4608
|
-
interface SourcesChangedEvent {
|
|
4609
|
-
type: 'sources_changed';
|
|
4610
|
-
sessionId: string;
|
|
4611
|
-
enabledSourceSlugs: string[];
|
|
4612
|
-
}
|
|
4613
|
-
/**
|
|
4614
|
-
* Labels changed event
|
|
4615
|
-
*/
|
|
4616
|
-
interface LabelsChangedEvent {
|
|
4617
|
-
type: 'labels_changed';
|
|
4618
|
-
sessionId: string;
|
|
4619
|
-
labels: string[];
|
|
4620
|
-
}
|
|
4621
|
-
/**
|
|
4622
|
-
* Todo state changed event (external metadata change or agent tool)
|
|
4623
|
-
*/
|
|
4624
|
-
interface SessionStatusChangedEvent {
|
|
4625
|
-
type: 'session_status_changed';
|
|
4626
|
-
sessionId: string;
|
|
4627
|
-
sessionStatus?: string;
|
|
4628
|
-
}
|
|
4629
|
-
/**
|
|
4630
|
-
* Session flagged/unflagged events (external metadata change)
|
|
4631
|
-
*/
|
|
4632
|
-
interface SessionFlaggedEvent {
|
|
4633
|
-
type: 'session_flagged';
|
|
4634
|
-
sessionId: string;
|
|
4635
|
-
}
|
|
4636
|
-
interface SessionUnflaggedEvent {
|
|
4637
|
-
type: 'session_unflagged';
|
|
4638
|
-
sessionId: string;
|
|
4639
|
-
}
|
|
4640
|
-
/**
|
|
4641
|
-
* Session archived/unarchived events (external metadata change)
|
|
4642
|
-
*/
|
|
4643
|
-
interface SessionArchivedEvent {
|
|
4644
|
-
type: 'session_archived';
|
|
4645
|
-
sessionId: string;
|
|
4646
|
-
}
|
|
4647
|
-
interface SessionUnarchivedEvent {
|
|
4648
|
-
type: 'session_unarchived';
|
|
4649
|
-
sessionId: string;
|
|
4650
|
-
}
|
|
4651
|
-
/**
|
|
4652
|
-
* Session name changed event (external metadata change)
|
|
4653
|
-
*/
|
|
4654
|
-
interface NameChangedEvent {
|
|
4655
|
-
type: 'name_changed';
|
|
4656
|
-
sessionId: string;
|
|
4657
|
-
name?: string;
|
|
4658
|
-
}
|
|
4659
|
-
/**
|
|
4660
|
-
* Plan submitted event
|
|
4661
|
-
*/
|
|
4662
|
-
interface PlanSubmittedEvent {
|
|
4663
|
-
type: 'plan_submitted';
|
|
4664
|
-
sessionId: string;
|
|
4665
|
-
message: Message;
|
|
4666
|
-
}
|
|
4667
|
-
/**
|
|
4668
|
-
* Typed error event
|
|
4669
|
-
*/
|
|
4670
|
-
interface TypedErrorEvent {
|
|
4671
|
-
type: 'typed_error';
|
|
4672
|
-
sessionId: string;
|
|
4673
|
-
error: TypedError;
|
|
4674
|
-
/** Timestamp from main process for consistent ordering */
|
|
4675
|
-
timestamp?: number;
|
|
4676
|
-
}
|
|
4677
|
-
/**
|
|
4678
|
-
* Status event
|
|
4679
|
-
*/
|
|
4680
|
-
interface StatusEvent {
|
|
4681
|
-
type: 'status';
|
|
4682
|
-
sessionId: string;
|
|
4683
|
-
message: string;
|
|
4684
|
-
statusType?: 'compacting';
|
|
4685
|
-
/** Timestamp from main process for consistent ordering */
|
|
4686
|
-
timestamp?: number;
|
|
4687
|
-
}
|
|
4688
|
-
/**
|
|
4689
|
-
* Info event
|
|
4690
|
-
*/
|
|
4691
|
-
interface InfoEvent {
|
|
4692
|
-
type: 'info';
|
|
4693
|
-
sessionId: string;
|
|
4694
|
-
message: string;
|
|
4695
|
-
statusType?: 'compaction_complete';
|
|
4696
|
-
level?: 'info' | 'warning' | 'error' | 'success';
|
|
4697
|
-
/** Timestamp from main process for consistent ordering */
|
|
4698
|
-
timestamp?: number;
|
|
4699
|
-
}
|
|
4700
|
-
/**
|
|
4701
|
-
* Interrupted event
|
|
4702
|
-
*/
|
|
4703
|
-
interface InterruptedEvent {
|
|
4704
|
-
type: 'interrupted';
|
|
4705
|
-
sessionId: string;
|
|
4706
|
-
message?: Message;
|
|
4707
|
-
/** Messages that were queued but not processed — should be restored to input field */
|
|
4708
|
-
queuedMessages?: string[];
|
|
4709
|
-
}
|
|
4710
|
-
/**
|
|
4711
|
-
* Title generated event
|
|
4712
|
-
*/
|
|
4713
|
-
interface TitleGeneratedEvent {
|
|
4714
|
-
type: 'title_generated';
|
|
4715
|
-
sessionId: string;
|
|
4716
|
-
title: string;
|
|
4717
|
-
preview?: string;
|
|
4718
|
-
}
|
|
4719
|
-
/**
|
|
4720
|
-
* Title regenerating event - indicates title regeneration has started/finished
|
|
4721
|
-
* Used to show shimmer effect on title during regeneration
|
|
4722
|
-
* @deprecated Use AsyncOperationEvent instead
|
|
4723
|
-
*/
|
|
4724
|
-
interface TitleRegeneratingEvent {
|
|
4725
|
-
type: 'title_regenerating';
|
|
4726
|
-
sessionId: string;
|
|
4727
|
-
isRegenerating: boolean;
|
|
4728
|
-
}
|
|
4729
|
-
/**
|
|
4730
|
-
* Generic async operation state event
|
|
4731
|
-
* Used to show shimmer effect during any async operation (sharing, updating, revoking, title regeneration)
|
|
4732
|
-
*/
|
|
4733
|
-
interface AsyncOperationEvent {
|
|
4734
|
-
type: 'async_operation';
|
|
4735
|
-
sessionId: string;
|
|
4736
|
-
isOngoing: boolean;
|
|
4737
|
-
}
|
|
4738
|
-
/**
|
|
4739
|
-
* Working directory changed event (user-initiated via UI)
|
|
4740
|
-
*/
|
|
4741
|
-
interface WorkingDirectoryChangedEvent {
|
|
4742
|
-
type: 'working_directory_changed';
|
|
4743
|
-
sessionId: string;
|
|
4744
|
-
workingDirectory: string;
|
|
4745
|
-
}
|
|
4746
|
-
/**
|
|
4747
|
-
* Working directory error event - server rejected the path (cross-platform, not found, etc.)
|
|
4748
|
-
*/
|
|
4749
|
-
interface WorkingDirectoryErrorEvent {
|
|
4750
|
-
type: 'working_directory_error';
|
|
4751
|
-
sessionId: string;
|
|
4752
|
-
error: string;
|
|
4753
|
-
}
|
|
4754
|
-
/**
|
|
4755
|
-
* Permission mode changed event
|
|
4756
|
-
*/
|
|
4757
|
-
interface PermissionModeChangedEvent {
|
|
4758
|
-
type: 'permission_mode_changed';
|
|
4759
|
-
sessionId: string;
|
|
4760
|
-
permissionMode: PermissionMode;
|
|
4761
|
-
previousPermissionMode?: PermissionMode;
|
|
4762
|
-
transitionDisplay?: string;
|
|
4763
|
-
modeVersion?: number;
|
|
4764
|
-
changedAt?: string;
|
|
4765
|
-
changedBy?: 'user' | 'system' | 'restore' | 'automation' | 'unknown';
|
|
4766
|
-
}
|
|
4767
|
-
/**
|
|
4768
|
-
* Session model changed event
|
|
4769
|
-
*/
|
|
4770
|
-
interface SessionModelChangedEvent {
|
|
4771
|
-
type: 'session_model_changed';
|
|
4772
|
-
sessionId: string;
|
|
4773
|
-
model: string | null;
|
|
4774
|
-
}
|
|
4775
|
-
/**
|
|
4776
|
-
* LLM connection changed event - syncs session.llmConnection to renderer
|
|
4777
|
-
*/
|
|
4778
|
-
interface LLMConnectionChangedEvent {
|
|
4779
|
-
type: 'connection_changed';
|
|
4780
|
-
sessionId: string;
|
|
4781
|
-
connectionSlug: string;
|
|
4782
|
-
supportsBranching?: boolean;
|
|
4783
|
-
}
|
|
4784
|
-
/**
|
|
4785
|
-
* Credential request event - prompts user for credentials
|
|
4786
|
-
*/
|
|
4787
|
-
interface CredentialRequestEvent {
|
|
4788
|
-
type: 'credential_request';
|
|
4789
|
-
sessionId: string;
|
|
4790
|
-
request: CredentialRequest;
|
|
4791
|
-
}
|
|
4792
|
-
/**
|
|
4793
|
-
* Task backgrounded event - background agent started
|
|
4794
|
-
*/
|
|
4795
|
-
interface TaskBackgroundedEvent {
|
|
4796
|
-
type: 'task_backgrounded';
|
|
4797
|
-
sessionId: string;
|
|
4798
|
-
toolUseId: string;
|
|
4799
|
-
taskId: string;
|
|
4800
|
-
intent?: string;
|
|
4801
|
-
turnId?: string;
|
|
4802
|
-
}
|
|
4803
|
-
/**
|
|
4804
|
-
* Shell backgrounded event - background bash shell started
|
|
4805
|
-
*/
|
|
4806
|
-
interface ShellBackgroundedEvent {
|
|
4807
|
-
type: 'shell_backgrounded';
|
|
4808
|
-
sessionId: string;
|
|
4809
|
-
toolUseId: string;
|
|
4810
|
-
shellId: string;
|
|
4811
|
-
intent?: string;
|
|
4812
|
-
turnId?: string;
|
|
4813
|
-
}
|
|
4814
|
-
/**
|
|
4815
|
-
* Task progress event - live progress updates for background tasks
|
|
4816
|
-
*/
|
|
4817
|
-
interface TaskProgressEvent {
|
|
4818
|
-
type: 'task_progress';
|
|
4819
|
-
sessionId: string;
|
|
4820
|
-
toolUseId: string;
|
|
4821
|
-
elapsedSeconds: number;
|
|
4822
|
-
turnId?: string;
|
|
4823
|
-
}
|
|
4824
|
-
/**
|
|
4825
|
-
* Task completed event - background task finished execution
|
|
4826
|
-
* Updates the tool message status and result when a background task completes.
|
|
4827
|
-
*/
|
|
4828
|
-
interface TaskCompletedEvent {
|
|
4829
|
-
type: 'task_completed';
|
|
4830
|
-
sessionId: string;
|
|
4831
|
-
taskId: string;
|
|
4832
|
-
status: 'completed' | 'failed' | 'stopped';
|
|
4833
|
-
outputFile?: string;
|
|
4834
|
-
summary?: string;
|
|
4835
|
-
turnId?: string;
|
|
4836
|
-
}
|
|
4837
|
-
/**
|
|
4838
|
-
* User message event - backend confirmation of optimistic user message
|
|
4839
|
-
* Used for optimistic UI: frontend shows message immediately,
|
|
4840
|
-
* backend confirms/updates status via this event
|
|
4841
|
-
*/
|
|
4842
|
-
interface UserMessageEvent {
|
|
4843
|
-
type: 'user_message';
|
|
4844
|
-
sessionId: string;
|
|
4845
|
-
message: Message;
|
|
4846
|
-
status: 'accepted' | 'queued' | 'processing';
|
|
4847
|
-
/** Frontend's optimistic message ID for reliable matching */
|
|
4848
|
-
optimisticMessageId?: string;
|
|
4849
|
-
}
|
|
4850
|
-
/**
|
|
4851
|
-
* Message annotation update event
|
|
4852
|
-
*/
|
|
4853
|
-
interface MessageAnnotationsUpdatedEvent {
|
|
4854
|
-
type: 'message_annotations_updated';
|
|
4855
|
-
sessionId: string;
|
|
4856
|
-
messageId: string;
|
|
4857
|
-
annotations: NonNullable<Message['annotations']>;
|
|
4858
|
-
}
|
|
4859
|
-
/**
|
|
4860
|
-
* Session shared event - session was shared to viewer
|
|
4861
|
-
*/
|
|
4862
|
-
interface SessionSharedEvent {
|
|
4863
|
-
type: 'session_shared';
|
|
4864
|
-
sessionId: string;
|
|
4865
|
-
sharedUrl: string;
|
|
4866
|
-
}
|
|
4867
|
-
/**
|
|
4868
|
-
* Session unshared event - session share was revoked
|
|
4869
|
-
*/
|
|
4870
|
-
interface SessionUnsharedEvent {
|
|
4871
|
-
type: 'session_unshared';
|
|
4872
|
-
sessionId: string;
|
|
4873
|
-
}
|
|
4874
|
-
/**
|
|
4875
|
-
* Auth request event - unified auth flow (credential or OAuth)
|
|
4876
|
-
* Adds auth-request message to session and displays inline auth UI
|
|
4877
|
-
*/
|
|
4878
|
-
interface AuthRequestEvent {
|
|
4879
|
-
type: 'auth_request';
|
|
4880
|
-
sessionId: string;
|
|
4881
|
-
message: Message;
|
|
4882
|
-
request: AuthRequest;
|
|
4883
|
-
}
|
|
4884
|
-
/**
|
|
4885
|
-
* Auth completed event - auth request was completed (success, failure, or cancelled)
|
|
4886
|
-
* Updates the auth-request message status
|
|
4887
|
-
*/
|
|
4888
|
-
interface AuthCompletedEvent {
|
|
4889
|
-
type: 'auth_completed';
|
|
4890
|
-
sessionId: string;
|
|
4891
|
-
requestId: string;
|
|
4892
|
-
success: boolean;
|
|
4893
|
-
cancelled?: boolean;
|
|
4894
|
-
error?: string;
|
|
4895
|
-
}
|
|
4896
|
-
/**
|
|
4897
|
-
* Source activated event - a source was auto-activated mid-turn
|
|
4898
|
-
* Caller should re-send the original message to retry with the now-active source
|
|
4899
|
-
*/
|
|
4900
|
-
interface SourceActivatedEvent {
|
|
4901
|
-
type: 'source_activated';
|
|
4902
|
-
sessionId: string;
|
|
4903
|
-
sourceSlug: string;
|
|
4904
|
-
originalMessage: string;
|
|
4905
|
-
}
|
|
4906
|
-
/**
|
|
4907
|
-
* Usage update event - real-time context usage during processing
|
|
4908
|
-
* Allows UI to show growing context as agent processes, not just on complete
|
|
4909
|
-
*/
|
|
4910
|
-
interface UsageUpdateEvent {
|
|
4911
|
-
type: 'usage_update';
|
|
4912
|
-
sessionId: string;
|
|
4913
|
-
tokenUsage: {
|
|
4914
|
-
inputTokens: number;
|
|
4915
|
-
contextWindow?: number;
|
|
4916
|
-
};
|
|
4917
|
-
}
|
|
4918
|
-
/**
|
|
4919
|
-
* Union of all agent events
|
|
4920
|
-
*/
|
|
4921
|
-
type ChatEvent = TextDeltaEvent | TextCompleteEvent | ToolStartEvent | ToolDeltaEvent | ToolResultEvent | CompleteEvent | ErrorEvent | TypedErrorEvent | PermissionRequestEvent | CredentialRequestEvent | SourcesChangedEvent | LabelsChangedEvent | SessionStatusChangedEvent | SessionFlaggedEvent | SessionUnflaggedEvent | SessionArchivedEvent | SessionUnarchivedEvent | NameChangedEvent | PlanSubmittedEvent | StatusEvent | InfoEvent | InterruptedEvent | TitleGeneratedEvent | TitleRegeneratingEvent | AsyncOperationEvent | WorkingDirectoryChangedEvent | WorkingDirectoryErrorEvent | PermissionModeChangedEvent | SessionModelChangedEvent | LLMConnectionChangedEvent | TaskBackgroundedEvent | ShellBackgroundedEvent | TaskProgressEvent | TaskCompletedEvent | UserMessageEvent | MessageAnnotationsUpdatedEvent | SessionSharedEvent | SessionUnsharedEvent | AuthRequestEvent | AuthCompletedEvent | SourceActivatedEvent | UsageUpdateEvent;
|
|
4922
|
-
/**
|
|
4923
|
-
* Side effects that need to be handled outside the pure processor
|
|
4924
|
-
*/
|
|
4925
|
-
type Effect = {
|
|
4926
|
-
type: 'permission_request';
|
|
4927
|
-
request: PermissionRequest;
|
|
4928
|
-
} | {
|
|
4929
|
-
type: 'credential_request';
|
|
4930
|
-
request: CredentialRequest;
|
|
4931
|
-
} | {
|
|
4932
|
-
type: 'generate_title';
|
|
4933
|
-
sessionId: string;
|
|
4934
|
-
userMessage: string;
|
|
4935
|
-
} | {
|
|
4936
|
-
type: 'permission_mode_changed';
|
|
4937
|
-
sessionId: string;
|
|
4938
|
-
permissionMode: PermissionMode;
|
|
4939
|
-
previousPermissionMode?: PermissionMode;
|
|
4940
|
-
transitionDisplay?: string;
|
|
4941
|
-
modeVersion?: number;
|
|
4942
|
-
changedAt?: string;
|
|
4943
|
-
changedBy?: 'user' | 'system' | 'restore' | 'automation' | 'unknown';
|
|
4944
|
-
} | {
|
|
4945
|
-
type: 'auto_retry';
|
|
4946
|
-
sessionId: string;
|
|
4947
|
-
originalMessage: string;
|
|
4948
|
-
sourceSlug: string;
|
|
4949
|
-
} | {
|
|
4950
|
-
type: 'restore_input';
|
|
4951
|
-
text: string;
|
|
4952
|
-
} | {
|
|
4953
|
-
type: 'toast_error';
|
|
4954
|
-
message: string;
|
|
4955
|
-
};
|
|
4956
|
-
/**
|
|
4957
|
-
* Result of processing an event
|
|
4958
|
-
*/
|
|
4959
|
-
interface ProcessResult {
|
|
4960
|
-
state: SessionState;
|
|
4961
|
-
/** Side effects to execute (permissions, etc.) */
|
|
4962
|
-
effects: Effect[];
|
|
4963
|
-
}
|
|
4964
|
-
|
|
4965
|
-
/**
|
|
4966
|
-
* Event Processor
|
|
4967
|
-
*
|
|
4968
|
-
* Central pure function that processes all agent events.
|
|
4969
|
-
* Guarantees consistent state transitions and always returns new references.
|
|
4970
|
-
*
|
|
4971
|
-
* Benefits:
|
|
4972
|
-
* - Single source of truth for event handling
|
|
4973
|
-
* - Pure functions - easy to test
|
|
4974
|
-
* - No race conditions - single update path
|
|
4975
|
-
* - Always new references - atom sync always works
|
|
4976
|
-
* - Message lookup by ID - never position-based
|
|
4977
|
-
*/
|
|
4978
|
-
|
|
4979
|
-
/**
|
|
4980
|
-
* Process an agent event, returning new state and any side effects
|
|
4981
|
-
*
|
|
4982
|
-
* This is a PURE FUNCTION - no side effects, always returns new state.
|
|
4983
|
-
* Guaranteed to return a new session reference (no referential equality issues).
|
|
4984
|
-
*
|
|
4985
|
-
* @param state - Current session state (session + streaming)
|
|
4986
|
-
* @param event - Agent event to process
|
|
4987
|
-
* @returns New state and any side effects to execute
|
|
4988
|
-
*/
|
|
4989
|
-
declare function processEvent(state: SessionState, event: ChatEvent): ProcessResult;
|
|
4990
|
-
|
|
4991
|
-
/**
|
|
4992
|
-
* Map a core AgentEvent to the processor's session-scoped event format.
|
|
4993
|
-
*
|
|
4994
|
-
* Core AgentEvent is the raw SDK/runtime format. The processor expects
|
|
4995
|
-
* session-scoped events with its own field names. Keeping this as a pure
|
|
4996
|
-
* function makes local-runtime, tests, and React hooks share one mapping.
|
|
4997
|
-
*/
|
|
4998
|
-
declare function mapCoreEventToProcessorEvent(coreEvent: AgentEvent, sessionId: string): ChatEvent;
|
|
4999
|
-
declare function mapTimelineEnvelopeToProcessorEvent(envelope: TimelineEnvelope): ChatEvent;
|
|
5000
|
-
|
|
5001
|
-
/**
|
|
5002
|
-
* Message Operation Helpers
|
|
5003
|
-
*
|
|
5004
|
-
* Pure utility functions for finding and updating messages.
|
|
5005
|
-
* All lookups are by ID (turnId, toolUseId) - NEVER by position.
|
|
5006
|
-
*/
|
|
5007
|
-
|
|
5008
|
-
/**
|
|
5009
|
-
* Generate a unique message ID
|
|
5010
|
-
* Delegates to core's generateMessageId for uniqueness
|
|
5011
|
-
*/
|
|
5012
|
-
declare function generateMessageId(): string;
|
|
5013
|
-
/**
|
|
5014
|
-
* Find streaming assistant message by turnId
|
|
5015
|
-
* Falls back to last streaming assistant if no turnId
|
|
5016
|
-
*/
|
|
5017
|
-
declare function findStreamingMessage(messages: Message[], turnId?: string): number;
|
|
5018
|
-
/**
|
|
5019
|
-
* Find assistant message by turnId (streaming or not)
|
|
5020
|
-
*/
|
|
5021
|
-
declare function findAssistantMessage(messages: Message[], turnId?: string): number;
|
|
5022
|
-
/**
|
|
5023
|
-
* Find tool message by toolUseId
|
|
5024
|
-
*/
|
|
5025
|
-
declare function findToolMessage(messages: Message[], toolUseId: string): number;
|
|
5026
|
-
/**
|
|
5027
|
-
* Update message at index, returning new session
|
|
5028
|
-
* Always creates new references (immutable update)
|
|
5029
|
-
* @param updateTimestamp - If true, also update lastMessageAt
|
|
5030
|
-
*/
|
|
5031
|
-
declare function updateMessageAt(session: Session, index: number, updates: Partial<Message>, updateTimestamp?: boolean): Session;
|
|
5032
|
-
/**
|
|
5033
|
-
* Append message to session, returning new session
|
|
5034
|
-
* @param updateTimestamp - If false, don't update lastMessageAt (for intermediate/tool messages)
|
|
5035
|
-
*/
|
|
5036
|
-
declare function appendMessage(session: Session, message: Message, updateTimestamp?: boolean): Session;
|
|
5037
|
-
|
|
5038
|
-
/**
|
|
5039
|
-
* Event Source Interface
|
|
5040
|
-
*
|
|
5041
|
-
* Generic abstraction for receiving SessionEvent streams.
|
|
5042
|
-
* Replaces Electron IPC (window.electronAPI.onSessionEvent) with
|
|
5043
|
-
* a provider-agnostic interface that works in any runtime:
|
|
5044
|
-
* - WebSocket (browser/server)
|
|
5045
|
-
* - HTTP SSE (server)
|
|
5046
|
-
* - stdin/stdout (CLI)
|
|
5047
|
-
* - In-process (testing)
|
|
5048
|
-
*/
|
|
5049
|
-
|
|
5050
|
-
/**
|
|
5051
|
-
* Event source callback — receives events from the source.
|
|
5052
|
-
*/
|
|
5053
|
-
type EventSourceCallback = (event: AgentEvent) => void;
|
|
5054
|
-
/**
|
|
5055
|
-
* Error callback — receives errors from the source.
|
|
5056
|
-
*/
|
|
5057
|
-
type EventSourceErrorCallback = (error: Error) => void;
|
|
5058
|
-
/**
|
|
5059
|
-
* Close callback — called when the source is disconnected.
|
|
5060
|
-
*/
|
|
5061
|
-
type EventSourceCloseCallback = () => void;
|
|
5062
|
-
/**
|
|
5063
|
-
* Generic event source interface.
|
|
5064
|
-
* Implementations provide events from different transports.
|
|
5065
|
-
*/
|
|
5066
|
-
interface EventSource {
|
|
5067
|
-
/**
|
|
5068
|
-
* Start receiving events.
|
|
5069
|
-
* @param onEvent - Callback for each AgentEvent
|
|
5070
|
-
* @param onError - Callback for transport errors
|
|
5071
|
-
* @param onClose - Callback when source disconnects
|
|
5072
|
-
*/
|
|
5073
|
-
connect(onEvent: EventSourceCallback, onError?: EventSourceErrorCallback, onClose?: EventSourceCloseCallback): void;
|
|
5074
|
-
/**
|
|
5075
|
-
* Stop receiving events and clean up resources.
|
|
5076
|
-
*/
|
|
5077
|
-
disconnect(): void;
|
|
5078
|
-
/**
|
|
5079
|
-
* Check if the source is currently connected.
|
|
5080
|
-
*/
|
|
5081
|
-
isConnected(): boolean;
|
|
5082
|
-
}
|
|
5083
|
-
/**
|
|
5084
|
-
* WebSocket-based EventSource implementation.
|
|
5085
|
-
* Receives SessionEvent messages over a WebSocket connection.
|
|
5086
|
-
*/
|
|
5087
|
-
declare class WebSocketEventSource implements EventSource {
|
|
5088
|
-
private ws;
|
|
5089
|
-
private connected;
|
|
5090
|
-
private url;
|
|
5091
|
-
private protocols?;
|
|
5092
|
-
constructor(url: string, protocols?: string | string[]);
|
|
5093
|
-
connect(onEvent: EventSourceCallback, onError?: EventSourceErrorCallback, onClose?: EventSourceCloseCallback): void;
|
|
5094
|
-
disconnect(): void;
|
|
5095
|
-
isConnected(): boolean;
|
|
5096
|
-
}
|
|
5097
|
-
/**
|
|
5098
|
-
* SSE (Server-Sent Events) EventSource implementation.
|
|
5099
|
-
* Receives SessionEvent messages over an HTTP SSE connection.
|
|
5100
|
-
*/
|
|
5101
|
-
declare class SSEEventSource implements EventSource {
|
|
5102
|
-
private source;
|
|
5103
|
-
private connected;
|
|
5104
|
-
private url;
|
|
5105
|
-
constructor(url: string);
|
|
5106
|
-
connect(onEvent: EventSourceCallback, onError?: EventSourceErrorCallback, onClose?: EventSourceCloseCallback): void;
|
|
5107
|
-
disconnect(): void;
|
|
5108
|
-
isConnected(): boolean;
|
|
5109
|
-
}
|
|
5110
|
-
/**
|
|
5111
|
-
* In-process EventSource for testing.
|
|
5112
|
-
* Events are pushed directly via enqueue().
|
|
5113
|
-
*/
|
|
5114
|
-
declare class InProcessEventSource implements EventSource {
|
|
5115
|
-
private listeners;
|
|
5116
|
-
private connected;
|
|
5117
|
-
connect(onEvent: EventSourceCallback, onError?: EventSourceErrorCallback, onClose?: EventSourceCloseCallback): void;
|
|
5118
|
-
disconnect(): void;
|
|
5119
|
-
isConnected(): boolean;
|
|
5120
|
-
/**
|
|
5121
|
-
* Push an event directly to the connected listener.
|
|
5122
|
-
* Useful for testing and in-process scenarios.
|
|
5123
|
-
*/
|
|
5124
|
-
enqueue(event: AgentEvent): void;
|
|
5125
|
-
/**
|
|
5126
|
-
* Simulate an error.
|
|
5127
|
-
*/
|
|
5128
|
-
simulateError(error: Error): void;
|
|
5129
|
-
/**
|
|
5130
|
-
* Simulate a disconnect.
|
|
5131
|
-
*/
|
|
5132
|
-
simulateClose(): void;
|
|
5133
|
-
}
|
|
5134
|
-
|
|
5135
|
-
/**
|
|
5136
|
-
* Event Processor Hook
|
|
5137
|
-
*
|
|
5138
|
-
* Provides the event processor for use in React apps.
|
|
5139
|
-
* Manages streaming state per session and returns processed events.
|
|
5140
|
-
*
|
|
5141
|
-
* Accepts an EventSource (WebSocket, SSE, in-process) instead of
|
|
5142
|
-
* Electron IPC (window.electronAPI). Uses React useState/useRef
|
|
5143
|
-
* instead of Jotai atoms for state management.
|
|
5144
|
-
*/
|
|
5145
|
-
|
|
5146
|
-
interface UseEventProcessorOptions {
|
|
5147
|
-
/** EventSource to receive agent events from */
|
|
5148
|
-
eventSource: EventSource;
|
|
5149
|
-
/** Session ID to associate with incoming events */
|
|
5150
|
-
sessionId: string;
|
|
5151
|
-
/** Workspace ID for creating new sessions */
|
|
5152
|
-
workspaceId: string;
|
|
5153
|
-
/** Workspace name for creating new sessions */
|
|
5154
|
-
workspaceName?: string;
|
|
5155
|
-
/** Callback for side effects (permissions, toasts, etc.) */
|
|
5156
|
-
onEffect?: (effect: Effect) => void;
|
|
5157
|
-
/** Callback for errors from the event source */
|
|
5158
|
-
onError?: (error: Error) => void;
|
|
5159
|
-
/** Callback when event source disconnects */
|
|
5160
|
-
onClose?: () => void;
|
|
5161
|
-
}
|
|
5162
|
-
interface UseEventProcessorResult {
|
|
5163
|
-
/** Current session state (messages, processing status, etc.) */
|
|
5164
|
-
session: Session | null;
|
|
5165
|
-
/** Current streaming state for the session */
|
|
5166
|
-
streamingState: StreamingState | null;
|
|
5167
|
-
/**
|
|
5168
|
-
* Process an agent event and return the updated session + any side effects
|
|
5169
|
-
*
|
|
5170
|
-
* @param event - The core AgentEvent to process
|
|
5171
|
-
* @returns Updated session and any side effects to execute
|
|
5172
|
-
*/
|
|
5173
|
-
processAgentEvent: (event: AgentEvent) => {
|
|
5174
|
-
session: Session;
|
|
5175
|
-
effects: Effect[];
|
|
5176
|
-
};
|
|
5177
|
-
/**
|
|
5178
|
-
* Clear streaming state for the session (e.g., on error or complete)
|
|
5179
|
-
*/
|
|
5180
|
-
clearStreamingState: () => void;
|
|
5181
|
-
/**
|
|
5182
|
-
* Get current streaming state (for debugging/testing)
|
|
5183
|
-
*/
|
|
5184
|
-
getStreamingState: () => StreamingState | null;
|
|
5185
|
-
/**
|
|
5186
|
-
* Whether the event source is currently connected
|
|
5187
|
-
*/
|
|
5188
|
-
isConnected: boolean;
|
|
5189
|
-
}
|
|
5190
|
-
/**
|
|
5191
|
-
* Hook that provides the event processor connected to an EventSource.
|
|
5192
|
-
*
|
|
5193
|
-
* Manages streaming state per session using React useRef (not Jotai atoms).
|
|
5194
|
-
* All event processing goes through pure functions.
|
|
5195
|
-
*
|
|
5196
|
-
* Connects to the EventSource on mount and disconnects on unmount.
|
|
5197
|
-
*/
|
|
5198
|
-
declare function useEventProcessor(options: UseEventProcessorOptions): UseEventProcessorResult;
|
|
5199
|
-
|
|
5200
|
-
export { ActivityDetailsPanel, ActivityInspector, type ActivityItem, type ActivityStatus, AnnotationIslandMenu, type AnnotationIslandMenuProps, type AnnotationOverlayChip, type AnnotationOverlayGeometryResult, AnnotationOverlayLayer, type AnnotationOverlayLayerProps, type AnnotationOverlayRect, type AssistantTurn, AssistantTurnCard, type AuthRequestTurn, type ChatEvent, ChatTranscript, type ChatTranscriptProps, CodeBlock, CollapsibleMarkdownProvider, type Effect, type EventSource, type EventSourceCallback, type EventSourceCloseCallback, type EventSourceErrorCallback, InProcessEventSource, type InlineActivityItem, InlineCode, InlineExecution, type InlineExecutionProps, type InlineExecutionStatus, type IslandTransitionConfig, Markdown, type MarkdownProps, MemoizedMarkdown, PendingIndicator, type PendingIndicatorProps, PermissionModeMenu, PermissionRequestCard, type PermissionRequestCardProps, type PlatformActions, PlatformProvider, type PointerSnapshot, type ProcessResult, type RenderMode, ResponseCard, type ResponseCardProps, type ResponseContent, SIZE_CONFIG, SSEEventSource, type Session, type SessionState, SessionViewer, type SessionViewerMode, type SessionViewerProps, type StreamingState, SystemMessage, type SystemMessageProps, type SystemMessageType, type SystemTurn, type TextSegment, type TodoItem, type Turn, TurnCard, type TurnCardProps, UserMessageBubble, type UserMessageBubbleProps, type UserTurn, WebSocketEventSource, appendMessage, buildAnnotationChipEntryTransition, buildSelectionEntryTransition, collectTextSegments, computeAnnotationOverlayGeometry, createSelectionPreviewAnnotation, createTextSelectionAnnotation, findAssistantMessage, findStreamingMessage, findToolMessage, generateMessageId, getAssistantTurnUiKey, getCanonicalText, groupMessagesByTurn, hasExistingTextRangeAnnotation, mapCoreEventToProcessorEvent, mapTimelineEnvelopeToProcessorEvent, processEvent, resolveNodeOffset, shouldShowStreamingContent, updateMessageAt, useEventProcessor };
|
|
5201
|
-
|
|
5202
|
-
// -- @weft/ui/lib/en-fallback.d.ts --
|
|
5203
|
-
/**
|
|
5204
|
-
* English fallback translations for UI components.
|
|
5205
|
-
*
|
|
5206
|
-
* Used by:
|
|
5207
|
-
* - `TurnCard.tsx` `t()` wrapper — when i18next is uninitialized or has no resource for a key
|
|
5208
|
-
* - `apps/demo/src/i18n-init.ts` — as the primary `en` resource bundle
|
|
5209
|
-
*
|
|
5210
|
-
* Single source of truth — add new keys here, both consumers stay synchronized.
|
|
5211
|
-
*/
|
|
5212
|
-
declare const EN_FALLBACK: Record<string, string>;
|
|
5213
|
-
|
|
5214
|
-
export { EN_FALLBACK };
|
|
5215
|
-
|
|
5216
|
-
// ── inlined from @weft/local-chat ──
|
|
5217
|
-
// -- @weft/local-chat/index.d.ts --
|
|
5218
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5219
|
-
|
|
5220
|
-
interface LocalChatAuthDetection {
|
|
5221
|
-
provider: string;
|
|
5222
|
-
configured: boolean;
|
|
5223
|
-
source?: string;
|
|
5224
|
-
error?: string;
|
|
5225
|
-
}
|
|
5226
|
-
interface LocalChatRuntimeState {
|
|
5227
|
-
status: 'idle' | 'preflighting' | 'running' | 'ready' | 'failed' | string;
|
|
5228
|
-
}
|
|
5229
|
-
interface LocalChatEventSource {
|
|
5230
|
-
connect(onEvent: (event: AgentEvent) => void, onError?: (error: Error) => void, onClose?: () => void): void;
|
|
5231
|
-
disconnect(): void;
|
|
5232
|
-
isConnected(): boolean;
|
|
5233
|
-
}
|
|
5234
|
-
interface LocalChatCommandSink {
|
|
5235
|
-
sendMessage(message: string): Promise<void>;
|
|
5236
|
-
abort(reason?: string): Promise<void>;
|
|
5237
|
-
respondToPermission(requestId: string, allowed: boolean, remember?: boolean): Promise<void>;
|
|
5238
|
-
}
|
|
5239
|
-
interface LocalChatSessionRuntime {
|
|
5240
|
-
sessionId: string;
|
|
5241
|
-
provider: string;
|
|
5242
|
-
events: LocalChatEventSource;
|
|
5243
|
-
commands: LocalChatCommandSink;
|
|
5244
|
-
preflight(): Promise<LocalChatAuthDetection>;
|
|
5245
|
-
getState(): LocalChatRuntimeState;
|
|
5246
|
-
}
|
|
5247
|
-
interface AgentChatSessionModel {
|
|
5248
|
-
session: Session | null;
|
|
5249
|
-
turns: Turn[];
|
|
5250
|
-
isRunning: boolean;
|
|
5251
|
-
auth: LocalChatAuthDetection | null;
|
|
5252
|
-
error: Error | null;
|
|
5253
|
-
sendMessage(message: string): Promise<void>;
|
|
5254
|
-
abort(): Promise<void>;
|
|
5255
|
-
respondToPermission(requestId: string, allowed: boolean, remember?: boolean): Promise<void>;
|
|
5256
|
-
}
|
|
5257
|
-
interface UseAgentChatSessionOptions {
|
|
5258
|
-
runtime: LocalChatSessionRuntime;
|
|
5259
|
-
workspaceId?: string;
|
|
5260
|
-
workspaceName?: string;
|
|
5261
|
-
}
|
|
5262
|
-
interface TimelineChatPanelModel {
|
|
5263
|
-
session: Session;
|
|
5264
|
-
turns: Turn[];
|
|
5265
|
-
}
|
|
5266
|
-
type TimelineDetailKind = 'permission' | 'runtime' | 'source' | 'skill' | 'automation' | 'host' | 'tool';
|
|
5267
|
-
interface TimelineDetailItem {
|
|
5268
|
-
id: string;
|
|
5269
|
-
kind: TimelineDetailKind;
|
|
5270
|
-
title: string;
|
|
5271
|
-
summary?: string;
|
|
5272
|
-
status?: string;
|
|
5273
|
-
timestamp: number;
|
|
5274
|
-
detail: unknown;
|
|
5275
|
-
envelope: TimelineEnvelope;
|
|
5276
|
-
}
|
|
5277
|
-
interface TimelineAgentChatSessionModel extends TimelineChatPanelModel {
|
|
5278
|
-
timeline: TimelineEnvelope[];
|
|
5279
|
-
isRunning: boolean;
|
|
5280
|
-
isConnected: boolean;
|
|
5281
|
-
isReconnecting: boolean;
|
|
5282
|
-
hasGap: boolean;
|
|
5283
|
-
capabilityReport: RuntimeCapabilityReport | null;
|
|
5284
|
-
error: Error | null;
|
|
5285
|
-
sendMessage(message: string, options?: SendMessageOptions): Promise<void>;
|
|
5286
|
-
abort(): Promise<void>;
|
|
5287
|
-
respondToPermission(requestId: string, allowed: boolean, remember?: boolean): Promise<void>;
|
|
5288
|
-
}
|
|
5289
|
-
interface UseTimelineAgentChatSessionOptions {
|
|
5290
|
-
runtime: AgentRuntime;
|
|
5291
|
-
workspaceId?: string;
|
|
5292
|
-
workspaceName?: string;
|
|
5293
|
-
}
|
|
5294
|
-
declare function createAgentChatPanelModel(args: {
|
|
5295
|
-
session: Session | null;
|
|
5296
|
-
runtime: LocalChatSessionRuntime;
|
|
5297
|
-
auth?: LocalChatAuthDetection | null;
|
|
5298
|
-
error?: Error | null;
|
|
5299
|
-
}): Pick<AgentChatSessionModel, 'turns' | 'isRunning' | 'auth' | 'error'>;
|
|
5300
|
-
declare function createAgentChatPanelModelFromTimeline(args: {
|
|
5301
|
-
timeline: TimelineEnvelope[];
|
|
5302
|
-
sessionId: string;
|
|
5303
|
-
workspaceId: string;
|
|
5304
|
-
workspaceName?: string;
|
|
5305
|
-
}): TimelineChatPanelModel;
|
|
5306
|
-
declare function createTimelineAgentChatPanelModel(args: {
|
|
5307
|
-
timeline: TimelineEnvelope[];
|
|
5308
|
-
sessionId: string;
|
|
5309
|
-
workspaceId: string;
|
|
5310
|
-
workspaceName?: string;
|
|
5311
|
-
runtimeState: AgentRuntimeState;
|
|
5312
|
-
capabilityReport: RuntimeCapabilityReport | null;
|
|
5313
|
-
error: Error | null;
|
|
5314
|
-
}): Pick<TimelineAgentChatSessionModel, 'session' | 'turns' | 'isRunning' | 'capabilityReport' | 'error'>;
|
|
5315
|
-
declare function createTimelineDetailItems(timeline: TimelineEnvelope[]): TimelineDetailItem[];
|
|
5316
|
-
declare function useAgentChatSession(options: UseAgentChatSessionOptions): AgentChatSessionModel;
|
|
5317
|
-
declare function useTimelineAgentChatSession(options: UseTimelineAgentChatSessionOptions): TimelineAgentChatSessionModel;
|
|
5318
|
-
|
|
5319
|
-
interface AgentChatPanelProps {
|
|
5320
|
-
runtime: LocalChatSessionRuntime;
|
|
5321
|
-
workspaceId?: string;
|
|
5322
|
-
workspaceName?: string;
|
|
5323
|
-
platformActions?: PlatformActions;
|
|
5324
|
-
placeholder?: string;
|
|
5325
|
-
className?: string;
|
|
5326
|
-
}
|
|
5327
|
-
declare function AgentChatPanel({ runtime, workspaceId, workspaceName, platformActions, placeholder, className, }: AgentChatPanelProps): react_jsx_runtime.JSX.Element;
|
|
5328
|
-
|
|
5329
|
-
interface TimelineAgentChatPanelProps {
|
|
5330
|
-
/** Agent runtime instance from runtime-core */
|
|
5331
|
-
runtime: AgentRuntime;
|
|
5332
|
-
/** Workspace identifier */
|
|
5333
|
-
workspaceId?: string;
|
|
5334
|
-
/** Workspace display name */
|
|
5335
|
-
workspaceName?: string;
|
|
5336
|
-
/** Platform actions for file/URL handling */
|
|
5337
|
-
platformActions?: PlatformActions;
|
|
5338
|
-
/** Placeholder text for the input area */
|
|
5339
|
-
placeholder?: string;
|
|
5340
|
-
/** Whether to show the runtime status bar */
|
|
5341
|
-
showStatusBar?: boolean;
|
|
5342
|
-
/** Whether to show the runtime detail sidebar panel */
|
|
5343
|
-
showDetailPanel?: boolean;
|
|
5344
|
-
/** Additional className */
|
|
5345
|
-
className?: string;
|
|
5346
|
-
}
|
|
5347
|
-
declare function TimelineAgentChatPanel({ runtime, workspaceId, workspaceName, platformActions, placeholder, showStatusBar, showDetailPanel, className, }: TimelineAgentChatPanelProps): react_jsx_runtime.JSX.Element;
|
|
5348
|
-
|
|
5349
|
-
/**
|
|
5350
|
-
* Find the active (unresolved) permission request from timeline envelopes.
|
|
5351
|
-
*
|
|
5352
|
-
* Walks the timeline backwards to find the most recent permission_requested
|
|
5353
|
-
* envelope that has not been resolved by a matching permission_resolved.
|
|
5354
|
-
*/
|
|
5355
|
-
declare function findActivePermissionRequest(timeline: TimelineEnvelope[]): {
|
|
5356
|
-
requestId: string;
|
|
5357
|
-
toolName: string;
|
|
5358
|
-
input?: Record<string, unknown>;
|
|
5359
|
-
reason?: string;
|
|
5360
|
-
scope?: {
|
|
5361
|
-
type: string;
|
|
5362
|
-
label?: string;
|
|
5363
|
-
};
|
|
5364
|
-
} | null;
|
|
5365
|
-
|
|
5366
|
-
/**
|
|
5367
|
-
* Convert a processor Session (returned by useAgentChatSession) into a
|
|
5368
|
-
* StoredSession that SessionViewer can render.
|
|
5369
|
-
*
|
|
5370
|
-
* Consumers embedding AgentChatPanel don't need this — it's called internally.
|
|
5371
|
-
* This utility is exported for consumers who use useAgentChatSession directly
|
|
5372
|
-
* and build their own panel around SessionViewer.
|
|
5373
|
-
*/
|
|
5374
|
-
declare function toStoredSession(session: Session, fallbackWorkspaceId?: string): StoredSession;
|
|
5375
|
-
/**
|
|
5376
|
-
* Build an empty StoredSession placeholder for the initial state
|
|
5377
|
-
* before the event processor has received any events.
|
|
5378
|
-
*/
|
|
5379
|
-
declare function createEmptyStoredSession(sessionId: string, workspaceId?: string, workspaceName?: string): StoredSession;
|
|
5380
|
-
|
|
5381
|
-
export { AgentChatPanel, type AgentChatPanelProps, type AgentChatSessionModel, type LocalChatAuthDetection, type LocalChatCommandSink, type LocalChatEventSource, type LocalChatRuntimeState, type LocalChatSessionRuntime, TimelineAgentChatPanel, type TimelineAgentChatPanelProps, type TimelineAgentChatSessionModel, type TimelineChatPanelModel, type TimelineDetailItem, type TimelineDetailKind, type UseAgentChatSessionOptions, type UseTimelineAgentChatSessionOptions, createAgentChatPanelModel, createAgentChatPanelModelFromTimeline, createEmptyStoredSession, createTimelineAgentChatPanelModel, createTimelineDetailItems, findActivePermissionRequest, toStoredSession, useAgentChatSession, useTimelineAgentChatSession };
|