@jrkropp/codex-js-react 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/LICENSE +201 -0
- package/NOTICE +29 -0
- package/README.md +55 -0
- package/dist/components/chat-runtime.d.ts +58 -0
- package/dist/components/codex-chat-layout.d.ts +23 -0
- package/dist/components/codex-chat-render-state.d.ts +158 -0
- package/dist/components/codex-chat-view.d.ts +58 -0
- package/dist/components/codex-chat.d.ts +11 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/primitives.d.ts +13 -0
- package/dist/hooks/chat-lifecycle.d.ts +73 -0
- package/dist/hooks/index.d.ts +5 -0
- package/dist/hooks/lifecycle.d.ts +41 -0
- package/dist/hooks/thread-reader.d.ts +3 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +9773 -0
- package/dist/internal/chat-ui/components/ChatMarkdown.d.ts +7 -0
- package/dist/internal/chat-ui/components/ComposerPromptEditor.d.ts +34 -0
- package/dist/internal/chat-ui/components/chat/ChangedFilesTree.d.ts +5 -0
- package/dist/internal/chat-ui/components/chat/ChangedFilesTree.logic.d.ts +33 -0
- package/dist/internal/chat-ui/components/chat/ChatComposer.d.ts +103 -0
- package/dist/internal/chat-ui/components/chat/ChatView.d.ts +23 -0
- package/dist/internal/chat-ui/components/chat/CompactComposerControlsMenu.d.ts +16 -0
- package/dist/internal/chat-ui/components/chat/ComposerBannerStack.d.ts +20 -0
- package/dist/internal/chat-ui/components/chat/ComposerCommandMenu.d.ts +35 -0
- package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalActions.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalPanel.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/ComposerPendingTerminalContexts.d.ts +18 -0
- package/dist/internal/chat-ui/components/chat/ComposerPendingUserInputPanel.d.ts +12 -0
- package/dist/internal/chat-ui/components/chat/ComposerPlanFollowUpBanner.d.ts +3 -0
- package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.d.ts +17 -0
- package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.logic.d.ts +13 -0
- package/dist/internal/chat-ui/components/chat/ComposerRealtimeConversationControl.d.ts +7 -0
- package/dist/internal/chat-ui/components/chat/ContextWindowMeter.d.ts +4 -0
- package/dist/internal/chat-ui/components/chat/ExpandedImageDialog.d.ts +5 -0
- package/dist/internal/chat-ui/components/chat/MessagesTimeline.d.ts +16 -0
- package/dist/internal/chat-ui/components/chat/MessagesTimeline.logic.d.ts +113 -0
- package/dist/internal/chat-ui/components/chat/ModelListRow.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/ModelPickerContent.d.ts +15 -0
- package/dist/internal/chat-ui/components/chat/ModelPickerSidebar.d.ts +8 -0
- package/dist/internal/chat-ui/components/chat/ProposedPlanCard.d.ts +3 -0
- package/dist/internal/chat-ui/components/chat/ProviderInstanceIcon.d.ts +12 -0
- package/dist/internal/chat-ui/components/chat/ProviderModelPicker.d.ts +14 -0
- package/dist/internal/chat-ui/components/chat/ProviderStatusBanner.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/TerminalContextInlineChip.d.ts +7 -0
- package/dist/internal/chat-ui/components/chat/TraitsPicker.d.ts +7 -0
- package/dist/internal/chat-ui/components/chat/composer-draft.client.d.ts +50 -0
- package/dist/internal/chat-ui/components/chat/composer-editor-mentions.d.ts +15 -0
- package/dist/internal/chat-ui/components/chat/composer-footer-layout.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/composer-image-attachments.d.ts +46 -0
- package/dist/internal/chat-ui/components/chat/composer-logic.d.ts +15 -0
- package/dist/internal/chat-ui/components/chat/composer-mention-targets.d.ts +12 -0
- package/dist/internal/chat-ui/components/chat/composer-realtime-conversation.logic.d.ts +26 -0
- package/dist/internal/chat-ui/components/chat/composer-send-state.logic.d.ts +17 -0
- package/dist/internal/chat-ui/components/chat/composerMenuHighlight.d.ts +8 -0
- package/dist/internal/chat-ui/components/chat/composerProviderState.d.ts +33 -0
- package/dist/internal/chat-ui/components/chat/composerSlashCommandSearch.d.ts +6 -0
- package/dist/internal/chat-ui/components/chat/index.d.ts +54 -0
- package/dist/internal/chat-ui/components/chat/mention-bindings.d.ts +26 -0
- package/dist/internal/chat-ui/components/chat/mention-codec.d.ts +22 -0
- package/dist/internal/chat-ui/components/chat/mention-syntax.d.ts +9 -0
- package/dist/internal/chat-ui/components/chat/modelPickerSearch.d.ts +16 -0
- package/dist/internal/chat-ui/components/chat/proposed-plan.d.ts +17 -0
- package/dist/internal/chat-ui/components/chat/providerIconUtils.d.ts +15 -0
- package/dist/internal/chat-ui/components/composerInlineChip.d.ts +5 -0
- package/dist/internal/chat-ui/components/ui/alert.d.ts +10 -0
- package/dist/internal/chat-ui/components/ui/badge.d.ts +10 -0
- package/dist/internal/chat-ui/components/ui/button.d.ts +10 -0
- package/dist/internal/chat-ui/components/ui/command.d.ts +18 -0
- package/dist/internal/chat-ui/components/ui/dialog.d.ts +17 -0
- package/dist/internal/chat-ui/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/internal/chat-ui/components/ui/input.d.ts +3 -0
- package/dist/internal/chat-ui/components/ui/popover.d.ts +10 -0
- package/dist/internal/chat-ui/components/ui/separator.d.ts +4 -0
- package/dist/internal/chat-ui/components/ui/tooltip.d.ts +8 -0
- package/dist/internal/chat-ui/index.d.ts +2 -0
- package/dist/internal/chat-ui/lib/contextWindow.d.ts +27 -0
- package/dist/internal/chat-ui/lib/modelSelection.d.ts +36 -0
- package/dist/internal/chat-ui/lib/searchRanking.d.ts +27 -0
- package/dist/internal/chat-ui/lib/utils.d.ts +2 -0
- package/dist/internal/chat-ui/pendingUserInput.d.ts +37 -0
- package/dist/shadcn/hooks/use-mobile.d.ts +1 -0
- package/dist/shadcn/index.d.ts +13 -0
- package/dist/shadcn/index.js +1256 -0
- package/dist/shadcn/lib/utils.d.ts +2 -0
- package/dist/shadcn/ui/button.d.ts +10 -0
- package/dist/shadcn/ui/collapsible.d.ts +5 -0
- package/dist/shadcn/ui/command.d.ts +18 -0
- package/dist/shadcn/ui/dialog.d.ts +17 -0
- package/dist/shadcn/ui/input.d.ts +3 -0
- package/dist/shadcn/ui/scroll-area.d.ts +8 -0
- package/dist/shadcn/ui/separator.d.ts +4 -0
- package/dist/shadcn/ui/sheet.d.ts +14 -0
- package/dist/shadcn/ui/sidebar.d.ts +69 -0
- package/dist/shadcn/ui/skeleton.d.ts +2 -0
- package/dist/shadcn/ui/tooltip.d.ts +7 -0
- package/dist/styles.css +2 -0
- package/package.json +77 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type ComposerPromptSnapshot } from "./chat/composer-editor-mentions.js";
|
|
2
|
+
import { type ComposerTrigger } from "./chat/composer-logic.js";
|
|
3
|
+
import { type MentionBinding } from "./chat/mention-bindings.js";
|
|
4
|
+
import { type ComposerMentionTarget } from "./chat/composer-mention-targets.js";
|
|
5
|
+
export type ComposerPromptEditorHandle = {
|
|
6
|
+
clear: () => void;
|
|
7
|
+
focusAt: (cursor: number) => void;
|
|
8
|
+
focusAtEnd: () => void;
|
|
9
|
+
insertTextAtCursor: (text: string, options?: {
|
|
10
|
+
source?: "manual" | "realtime";
|
|
11
|
+
}) => void;
|
|
12
|
+
insertMention: (mention: ComposerMentionTarget, trigger: ComposerTrigger | null) => void;
|
|
13
|
+
insertRecordingMeterPlaceholder: (text: string) => string;
|
|
14
|
+
readSnapshot: () => ComposerPromptSnapshot;
|
|
15
|
+
removeRecordingMeterPlaceholder: (id: string) => void;
|
|
16
|
+
replaceRecordingMeterPlaceholder: (id: string, text: string) => void;
|
|
17
|
+
setTextContentWithMentionBindings: (input: {
|
|
18
|
+
mentionBindings?: MentionBinding[];
|
|
19
|
+
text: string;
|
|
20
|
+
}) => void;
|
|
21
|
+
updateRecordingMeterInPlace: (id: string, text: string) => boolean;
|
|
22
|
+
};
|
|
23
|
+
type ComposerPromptEditorProps = {
|
|
24
|
+
ariaLabel?: string;
|
|
25
|
+
className?: string;
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
onCommandKey?: (key: "ArrowDown" | "ArrowUp" | "Enter" | "Tab", event: KeyboardEvent) => boolean;
|
|
29
|
+
onSnapshotChange?: (snapshot: ComposerPromptSnapshot) => void;
|
|
30
|
+
onSubmit?: () => void;
|
|
31
|
+
onTriggerChange?: (trigger: ComposerTrigger | null) => void;
|
|
32
|
+
};
|
|
33
|
+
export declare const ComposerPromptEditor: import("react").ForwardRefExoticComponent<ComposerPromptEditorProps & import("react").RefAttributes<ComposerPromptEditorHandle>>;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { CoreTurnItem as TurnItem } from "@jrkropp/codex-js/client";
|
|
2
|
+
type FileChangeTurnItem = Extract<TurnItem, {
|
|
3
|
+
type: "FileChange";
|
|
4
|
+
}>;
|
|
5
|
+
type FileChange = FileChangeTurnItem["changes"][string];
|
|
6
|
+
export type TimelineChangedFile = {
|
|
7
|
+
additions: number;
|
|
8
|
+
changeType: FileChange["type"];
|
|
9
|
+
deletions: number;
|
|
10
|
+
path: string;
|
|
11
|
+
};
|
|
12
|
+
export type TimelineChangedFileStat = {
|
|
13
|
+
additions: number;
|
|
14
|
+
deletions: number;
|
|
15
|
+
};
|
|
16
|
+
export type TimelineChangedFileTreeNode = {
|
|
17
|
+
children: TimelineChangedFileTreeNode[];
|
|
18
|
+
kind: "directory";
|
|
19
|
+
name: string;
|
|
20
|
+
path: string;
|
|
21
|
+
stat: TimelineChangedFileStat;
|
|
22
|
+
} | {
|
|
23
|
+
file: TimelineChangedFile;
|
|
24
|
+
kind: "file";
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
stat: TimelineChangedFileStat;
|
|
28
|
+
};
|
|
29
|
+
export declare function changedFilesForFileChangeTurnItem(item: FileChangeTurnItem): TimelineChangedFile[];
|
|
30
|
+
export declare function summarizeChangedFileStats(files: readonly TimelineChangedFile[]): TimelineChangedFileStat;
|
|
31
|
+
export declare function hasNonZeroChangedFileStat(stat: TimelineChangedFileStat): boolean;
|
|
32
|
+
export declare function buildChangedFilesTree(files: readonly TimelineChangedFile[]): TimelineChangedFileTreeNode[];
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type MutableRefObject } from "react";
|
|
2
|
+
import type { CoreUserInput as UserInput } from "@jrkropp/codex-js/client";
|
|
3
|
+
import type { CodexModelOption, CodexReasoningEffort } from "../../lib/modelSelection.js";
|
|
4
|
+
import type { ToolRequestUserInputResponse } from "@jrkropp/codex-js/client";
|
|
5
|
+
import { type PendingUserInput } from "../../pendingUserInput.js";
|
|
6
|
+
import { type ComposerSlashCommand } from "./composer-logic.js";
|
|
7
|
+
import type { MentionBinding } from "./mention-bindings.js";
|
|
8
|
+
import { type ComposerMentionTarget } from "./composer-mention-targets.js";
|
|
9
|
+
import type { ContextWindowSnapshot } from "../../lib/contextWindow.js";
|
|
10
|
+
import type { RealtimeConversationUiState } from "./composer-realtime-conversation.logic.js";
|
|
11
|
+
import { type ComposerDraftKey } from "./composer-draft.client.js";
|
|
12
|
+
export type ChatComposerSubmitPayload = {
|
|
13
|
+
files: File[];
|
|
14
|
+
effort: CodexReasoningEffort;
|
|
15
|
+
items: UserInput[];
|
|
16
|
+
mentionBindings: MentionBinding[];
|
|
17
|
+
model: string;
|
|
18
|
+
text: string;
|
|
19
|
+
};
|
|
20
|
+
export type ChatComposerInteractionMode = "default" | "plan";
|
|
21
|
+
export type ChatComposerRuntimeMode = "approval-required" | "auto-accept-edits" | "full-access";
|
|
22
|
+
export type ChatComposerCommand = {
|
|
23
|
+
description: string;
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
group?: string;
|
|
26
|
+
label?: string;
|
|
27
|
+
name: ComposerSlashCommand;
|
|
28
|
+
unavailableReason?: string;
|
|
29
|
+
};
|
|
30
|
+
export type ChatComposerSkill = {
|
|
31
|
+
description?: string;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
label?: string;
|
|
34
|
+
name: string;
|
|
35
|
+
unavailableReason?: string;
|
|
36
|
+
};
|
|
37
|
+
export type ChatComposerHandle = {
|
|
38
|
+
clear: () => void;
|
|
39
|
+
focusAt: (cursor: number) => void;
|
|
40
|
+
focusAtEnd: () => void;
|
|
41
|
+
getSendContext: () => ChatComposerSubmitPayload;
|
|
42
|
+
insertTextAtCursor: (text: string, options?: {
|
|
43
|
+
source?: "manual" | "realtime";
|
|
44
|
+
}) => void;
|
|
45
|
+
insertRecordingMeterPlaceholder: (text: string) => string;
|
|
46
|
+
readSnapshot: () => {
|
|
47
|
+
cursor: number;
|
|
48
|
+
expandedCursor: number;
|
|
49
|
+
value: string;
|
|
50
|
+
};
|
|
51
|
+
removeRecordingMeterPlaceholder: (id: string) => void;
|
|
52
|
+
replaceRecordingMeterPlaceholder: (id: string, text: string) => void;
|
|
53
|
+
resetCursorState: (options?: {
|
|
54
|
+
cursor?: number;
|
|
55
|
+
detectTrigger?: boolean;
|
|
56
|
+
prompt?: string;
|
|
57
|
+
}) => void;
|
|
58
|
+
setDraft: (draft: {
|
|
59
|
+
mentionBindings?: MentionBinding[];
|
|
60
|
+
message: string;
|
|
61
|
+
}) => void;
|
|
62
|
+
submit: () => void;
|
|
63
|
+
updateRecordingMeterInPlace: (id: string, text: string) => boolean;
|
|
64
|
+
};
|
|
65
|
+
export declare const ChatComposer: import("react").ForwardRefExoticComponent<{
|
|
66
|
+
className?: string;
|
|
67
|
+
disabled?: boolean;
|
|
68
|
+
draftKey: ComposerDraftKey;
|
|
69
|
+
editorAriaLabel?: string;
|
|
70
|
+
isConnecting?: boolean;
|
|
71
|
+
isEnvironmentUnavailable?: boolean;
|
|
72
|
+
isRunning?: boolean;
|
|
73
|
+
isSending?: boolean;
|
|
74
|
+
interactionMode?: ChatComposerInteractionMode;
|
|
75
|
+
contextWindow?: ContextWindowSnapshot | null;
|
|
76
|
+
mentionRefs: ComposerMentionTarget[];
|
|
77
|
+
modelOptions?: readonly CodexModelOption[];
|
|
78
|
+
pendingUserInput?: PendingUserInput | null;
|
|
79
|
+
pendingRequestDisabled?: boolean;
|
|
80
|
+
placeholder?: string;
|
|
81
|
+
planFollowUpTitle?: string | null;
|
|
82
|
+
planSidebarLabel?: string;
|
|
83
|
+
planSidebarOpen?: boolean;
|
|
84
|
+
realtimeConversation?: RealtimeConversationUiState | null;
|
|
85
|
+
runtimeMode?: ChatComposerRuntimeMode;
|
|
86
|
+
showPlanFollowUpPrompt?: boolean;
|
|
87
|
+
showInteractionModeToggle?: boolean;
|
|
88
|
+
showPlanToggle?: boolean;
|
|
89
|
+
composerCommands?: readonly ChatComposerCommand[];
|
|
90
|
+
composerSkills?: readonly ChatComposerSkill[];
|
|
91
|
+
onCommand?: (command: ComposerSlashCommand) => void;
|
|
92
|
+
onComposerError?: (message: string) => void;
|
|
93
|
+
onImplementPlanInNewThread?: () => void;
|
|
94
|
+
onRuntimeModeChange?: (mode: ChatComposerRuntimeMode) => void;
|
|
95
|
+
onToggleInteractionMode?: () => void;
|
|
96
|
+
onTogglePlanSidebar?: () => void;
|
|
97
|
+
onPendingRequestDismiss?: () => void;
|
|
98
|
+
onPendingRequestSubmit?: (response: ToolRequestUserInputResponse) => boolean | void;
|
|
99
|
+
onInterrupt: () => void;
|
|
100
|
+
scheduleStickToBottom?: () => void;
|
|
101
|
+
shouldAutoScrollRef?: MutableRefObject<boolean>;
|
|
102
|
+
onSend: () => void | Promise<void>;
|
|
103
|
+
} & import("react").RefAttributes<ChatComposerHandle>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type LegendListRef } from "@legendapp/list/react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import { type ComposerBannerStackItem } from "./ComposerBannerStack.js";
|
|
4
|
+
import { type MessagesTimelineProps } from "./MessagesTimeline.js";
|
|
5
|
+
export type ChatViewRenderComposerControls = {
|
|
6
|
+
prepareForOptimisticAppend: () => Promise<void>;
|
|
7
|
+
scheduleStickToBottom: () => void;
|
|
8
|
+
};
|
|
9
|
+
export type ChatViewProps = {
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
bannerItems?: readonly ComposerBannerStackItem[];
|
|
12
|
+
className?: string;
|
|
13
|
+
composer: ReactNode;
|
|
14
|
+
headerLeading?: ReactNode;
|
|
15
|
+
listRef: React.RefObject<LegendListRef | null>;
|
|
16
|
+
subtitle?: ReactNode;
|
|
17
|
+
threadKey: string;
|
|
18
|
+
timeline: Omit<MessagesTimelineProps, "listRef" | "onImageExpand" | "onIsAtEndChange">;
|
|
19
|
+
title: ReactNode;
|
|
20
|
+
onControlsChange?: (controls: ChatViewRenderComposerControls | null) => void;
|
|
21
|
+
onIsAtEndChange?: (isAtEnd: boolean) => void;
|
|
22
|
+
};
|
|
23
|
+
export declare const ChatView: import("react").NamedExoticComponent<ChatViewProps>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CodexReasoningEffort } from "../../lib/modelSelection.js";
|
|
2
|
+
import type { ChatComposerInteractionMode, ChatComposerRuntimeMode } from "./ChatComposer.js";
|
|
3
|
+
export declare const CompactComposerControlsMenu: import("react").NamedExoticComponent<{
|
|
4
|
+
activePlan?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
effort: CodexReasoningEffort;
|
|
7
|
+
interactionMode?: ChatComposerInteractionMode;
|
|
8
|
+
onEffortChange: (effort: CodexReasoningEffort) => void;
|
|
9
|
+
onRuntimeModeChange?: (mode: ChatComposerRuntimeMode) => void;
|
|
10
|
+
onToggleInteractionMode?: () => void;
|
|
11
|
+
onTogglePlanSidebar?: () => void;
|
|
12
|
+
planSidebarLabel?: string;
|
|
13
|
+
planSidebarOpen?: boolean;
|
|
14
|
+
runtimeMode?: ChatComposerRuntimeMode;
|
|
15
|
+
showInteractionModeToggle?: boolean;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type ComposerBannerStackItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
description?: ReactNode;
|
|
6
|
+
action?: {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
};
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
dismissLabel?: string;
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
onDismiss?: () => void;
|
|
14
|
+
variant?: "error" | "info" | "success" | "warning";
|
|
15
|
+
tone?: "default" | "destructive";
|
|
16
|
+
};
|
|
17
|
+
export declare function ComposerBannerStack({ className, items, }: {
|
|
18
|
+
className?: string;
|
|
19
|
+
items: readonly ComposerBannerStackItem[];
|
|
20
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComposerSlashCommand, ComposerTriggerKind } from "./composer-logic.js";
|
|
2
|
+
import type { ComposerMentionTarget } from "./composer-mention-targets.js";
|
|
3
|
+
export type ComposerCommandItem = {
|
|
4
|
+
description: string;
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
mention: ComposerMentionTarget;
|
|
8
|
+
path: string;
|
|
9
|
+
type: "path";
|
|
10
|
+
} | {
|
|
11
|
+
command: ComposerSlashCommand;
|
|
12
|
+
description: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
id: string;
|
|
15
|
+
label: string;
|
|
16
|
+
type: "slash-command";
|
|
17
|
+
unavailableReason?: string;
|
|
18
|
+
} | {
|
|
19
|
+
description: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
id: string;
|
|
22
|
+
label: string;
|
|
23
|
+
name: string;
|
|
24
|
+
type: "skill";
|
|
25
|
+
unavailableReason?: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const ComposerCommandMenu: import("react").NamedExoticComponent<{
|
|
28
|
+
activeItemId: string | null;
|
|
29
|
+
emptyStateText?: string;
|
|
30
|
+
isLoading?: boolean;
|
|
31
|
+
items: ComposerCommandItem[];
|
|
32
|
+
triggerKind: ComposerTriggerKind | null;
|
|
33
|
+
onHighlightedItemChange: (itemId: string | null) => void;
|
|
34
|
+
onSelect: (item: ComposerCommandItem) => void;
|
|
35
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ApprovalRequestId = string;
|
|
2
|
+
export type ProviderApprovalDecision = "accept" | "acceptForSession" | "cancel" | "decline";
|
|
3
|
+
interface ComposerPendingApprovalActionsProps {
|
|
4
|
+
isResponding: boolean;
|
|
5
|
+
requestId: ApprovalRequestId;
|
|
6
|
+
onRespondToApproval: (requestId: ApprovalRequestId, decision: ProviderApprovalDecision) => Promise<void>;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComposerPendingApprovalActions: import("react").NamedExoticComponent<ComposerPendingApprovalActionsProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type PendingApproval = {
|
|
2
|
+
requestKind: "command" | "file-change" | "file-read";
|
|
3
|
+
};
|
|
4
|
+
interface ComposerPendingApprovalPanelProps {
|
|
5
|
+
approval: PendingApproval;
|
|
6
|
+
pendingCount: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const ComposerPendingApprovalPanel: import("react").NamedExoticComponent<ComposerPendingApprovalPanelProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface TerminalContextDraft {
|
|
2
|
+
expiresAt?: number | null;
|
|
3
|
+
id: string;
|
|
4
|
+
label?: string | null;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
interface ComposerPendingTerminalContextsProps {
|
|
8
|
+
className?: string;
|
|
9
|
+
contexts: ReadonlyArray<TerminalContextDraft>;
|
|
10
|
+
}
|
|
11
|
+
interface ComposerPendingTerminalContextChipProps {
|
|
12
|
+
context: TerminalContextDraft;
|
|
13
|
+
}
|
|
14
|
+
export declare function formatTerminalContextLabel(context: TerminalContextDraft): string;
|
|
15
|
+
export declare function isTerminalContextExpired(context: TerminalContextDraft): boolean;
|
|
16
|
+
export declare function ComposerPendingTerminalContextChip({ context, }: ComposerPendingTerminalContextChipProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function ComposerPendingTerminalContexts({ className, contexts, }: ComposerPendingTerminalContextsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PendingUserInput, PendingUserInputDraftAnswer } from "../../pendingUserInput.js";
|
|
2
|
+
export { buildRequestUserInputResponse, derivePendingUserInputProgress, setPendingUserInputCustomAnswer, togglePendingUserInputOptionSelection, type PendingUserInputDraftAnswer, type PendingUserInputProgress, } from "../../pendingUserInput.js";
|
|
3
|
+
export declare function ComposerPendingUserInputPanel({ answers, disabled, isResponding, questionIndex, request, onAdvance, onDismiss, onToggleOption, }: {
|
|
4
|
+
answers: Record<string, PendingUserInputDraftAnswer>;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
isResponding?: boolean;
|
|
7
|
+
questionIndex: number;
|
|
8
|
+
request: PendingUserInput | null;
|
|
9
|
+
onAdvance: () => void;
|
|
10
|
+
onDismiss: () => void;
|
|
11
|
+
onToggleOption: (questionId: string, optionLabel: string) => void;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type PendingActionState } from "./ComposerPrimaryActions.logic.js";
|
|
2
|
+
export declare const ComposerPrimaryActions: import("react").NamedExoticComponent<{
|
|
3
|
+
compact: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
hasSendableContent: boolean;
|
|
6
|
+
isConnecting?: boolean;
|
|
7
|
+
isEnvironmentUnavailable?: boolean;
|
|
8
|
+
isRunning: boolean;
|
|
9
|
+
isSending: boolean;
|
|
10
|
+
pendingAction: PendingActionState | null;
|
|
11
|
+
promptHasText?: boolean;
|
|
12
|
+
preserveComposerFocusOnPointerDown?: boolean;
|
|
13
|
+
showPlanFollowUpPrompt?: boolean;
|
|
14
|
+
onInterrupt: () => void;
|
|
15
|
+
onImplementPlanInNewThread?: () => void;
|
|
16
|
+
onPreviousPendingQuestion: () => void;
|
|
17
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PendingActionState {
|
|
2
|
+
questionIndex: number;
|
|
3
|
+
isLastQuestion: boolean;
|
|
4
|
+
canAdvance: boolean;
|
|
5
|
+
isResponding: boolean;
|
|
6
|
+
isComplete: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function formatPendingPrimaryActionLabel(input: {
|
|
9
|
+
compact: boolean;
|
|
10
|
+
isLastQuestion: boolean;
|
|
11
|
+
isResponding: boolean;
|
|
12
|
+
questionIndex: number;
|
|
13
|
+
}): "Submitting..." | "Submit" | "Next" | "Next question" | "Submit answers" | "Submit answer";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type RealtimeConversationUiState } from "./composer-realtime-conversation.logic.js";
|
|
2
|
+
export declare const ComposerRealtimeConversationControl: import("react").NamedExoticComponent<{
|
|
3
|
+
compact: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
preserveComposerFocusOnPointerDown?: boolean;
|
|
6
|
+
realtimeConversation: RealtimeConversationUiState;
|
|
7
|
+
}>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type LegendListRef } from "@legendapp/list/react";
|
|
2
|
+
import type { CoreUserMessageTurnItem as UserMessageTurnItem, ThreadHistoryTurn as Turn } from "@jrkropp/codex-js/client";
|
|
3
|
+
import type { ExpandedImagePreview } from "./composer-image-attachments.js";
|
|
4
|
+
export type MessagesTimelineProps = {
|
|
5
|
+
activeTurnStartedAt: string | null;
|
|
6
|
+
errors: string[];
|
|
7
|
+
isWorking: boolean;
|
|
8
|
+
listRef: React.RefObject<LegendListRef | null>;
|
|
9
|
+
onImageExpand: (preview: ExpandedImagePreview) => void;
|
|
10
|
+
onIsAtEndChange: (isAtEnd: boolean) => void;
|
|
11
|
+
optimisticUserMessages: readonly UserMessageTurnItem[];
|
|
12
|
+
runtimeError: string | null;
|
|
13
|
+
turns: readonly Turn[];
|
|
14
|
+
warnings: string[];
|
|
15
|
+
};
|
|
16
|
+
export declare const MessagesTimeline: import("react").NamedExoticComponent<MessagesTimelineProps>;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import type { CoreTurnItem as TurnItem, CoreUserInput as UserInput, CoreUserMessageTurnItem as UserMessageTurnItem, ThreadHistoryTurn as Turn } from "@jrkropp/codex-js/client";
|
|
2
|
+
import { type TimelineChangedFile } from "./ChangedFilesTree.logic.js";
|
|
3
|
+
export declare const TIMELINE_WORKING_ROW_ID = "working-indicator-row";
|
|
4
|
+
export declare const MAX_VISIBLE_WORK_LOG_ENTRIES = 6;
|
|
5
|
+
type TimelineMessageItem = Extract<TurnItem, {
|
|
6
|
+
type: "AgentMessage" | "UserMessage";
|
|
7
|
+
}>;
|
|
8
|
+
type TimelineProposedPlanItem = Extract<TurnItem, {
|
|
9
|
+
type: "Plan";
|
|
10
|
+
}>;
|
|
11
|
+
type TimelineWorkTurnItem = Exclude<TurnItem, TimelineMessageItem | TimelineProposedPlanItem>;
|
|
12
|
+
export type TimelineWorkEntryTone = "error" | "info" | "thinking" | "tool";
|
|
13
|
+
export type TimelineWorkEntry = {
|
|
14
|
+
changedFiles: string[];
|
|
15
|
+
id: string;
|
|
16
|
+
item: TimelineWorkTurnItem;
|
|
17
|
+
itemType: TimelineWorkTurnItem["type"];
|
|
18
|
+
label: string;
|
|
19
|
+
preview: string | null;
|
|
20
|
+
status: string | null;
|
|
21
|
+
title: string | null;
|
|
22
|
+
tone: TimelineWorkEntryTone;
|
|
23
|
+
};
|
|
24
|
+
export type MessagesTimelineRow = {
|
|
25
|
+
kind: "empty";
|
|
26
|
+
id: "empty";
|
|
27
|
+
} | {
|
|
28
|
+
kind: "message";
|
|
29
|
+
completedAt: string | null;
|
|
30
|
+
createdAt: string | null;
|
|
31
|
+
durationStart: string | null;
|
|
32
|
+
id: string;
|
|
33
|
+
item: TimelineMessageItem;
|
|
34
|
+
role: "assistant" | "user";
|
|
35
|
+
changedFiles: TimelineChangedFile[];
|
|
36
|
+
showAssistantCopyButton: boolean;
|
|
37
|
+
showCompletionDivider: boolean;
|
|
38
|
+
turnId: string | null;
|
|
39
|
+
} | {
|
|
40
|
+
kind: "proposed-plan";
|
|
41
|
+
createdAt: string | null;
|
|
42
|
+
id: string;
|
|
43
|
+
item: TimelineProposedPlanItem;
|
|
44
|
+
turnId: string | null;
|
|
45
|
+
} | {
|
|
46
|
+
kind: "work";
|
|
47
|
+
createdAt: string | null;
|
|
48
|
+
groupedEntries: TimelineWorkEntry[];
|
|
49
|
+
id: string;
|
|
50
|
+
turnId: string | null;
|
|
51
|
+
} | {
|
|
52
|
+
kind: "working";
|
|
53
|
+
id: typeof TIMELINE_WORKING_ROW_ID;
|
|
54
|
+
createdAt: string | null;
|
|
55
|
+
} | {
|
|
56
|
+
kind: "warning";
|
|
57
|
+
id: string;
|
|
58
|
+
message: string;
|
|
59
|
+
} | {
|
|
60
|
+
kind: "error";
|
|
61
|
+
id: string;
|
|
62
|
+
message: string;
|
|
63
|
+
};
|
|
64
|
+
export type StableMessagesTimelineRowsState = {
|
|
65
|
+
byId: Map<string, MessagesTimelineRow>;
|
|
66
|
+
result: MessagesTimelineRow[];
|
|
67
|
+
};
|
|
68
|
+
export declare function deriveMessagesTimelineRows(input: {
|
|
69
|
+
turns: readonly Turn[];
|
|
70
|
+
optimisticUserMessages?: readonly UserMessageTurnItem[];
|
|
71
|
+
isWorking?: boolean;
|
|
72
|
+
activeTurnStartedAt?: string | null;
|
|
73
|
+
running?: boolean;
|
|
74
|
+
hasPendingRequest?: boolean;
|
|
75
|
+
warnings: string[];
|
|
76
|
+
errors: string[];
|
|
77
|
+
runtimeError: string | null;
|
|
78
|
+
}): MessagesTimelineRow[];
|
|
79
|
+
export declare function computeStableMessagesTimelineRows(rows: MessagesTimelineRow[], previous: StableMessagesTimelineRowsState): StableMessagesTimelineRowsState;
|
|
80
|
+
export declare function shouldShowWorkingRow(input: {
|
|
81
|
+
isWorking?: boolean;
|
|
82
|
+
items?: TurnItem[];
|
|
83
|
+
turns?: readonly Turn[];
|
|
84
|
+
running?: boolean;
|
|
85
|
+
hasPendingRequest?: boolean;
|
|
86
|
+
}): boolean;
|
|
87
|
+
export declare function buildOptimisticUserMessageTurnItem(input: {
|
|
88
|
+
id: string;
|
|
89
|
+
imageUrls?: readonly string[];
|
|
90
|
+
items: readonly UserInput[];
|
|
91
|
+
}): UserMessageTurnItem;
|
|
92
|
+
export declare function mergeOptimisticUserMessageTurnItems(items: readonly TurnItem[], optimisticMessages: readonly UserMessageTurnItem[]): TurnItem[];
|
|
93
|
+
export declare function resolveAssistantMessageCopyState(input: {
|
|
94
|
+
showCopyButton: boolean;
|
|
95
|
+
streaming: boolean;
|
|
96
|
+
text: string | null;
|
|
97
|
+
}): {
|
|
98
|
+
text: string | null;
|
|
99
|
+
visible: boolean;
|
|
100
|
+
};
|
|
101
|
+
export declare function timelineWorkEntryForTurnItem(item: TurnItem): TimelineWorkEntry | null;
|
|
102
|
+
export declare function visibleTimelineWorkEntries(input: {
|
|
103
|
+
entries: readonly TimelineWorkEntry[];
|
|
104
|
+
expanded?: boolean;
|
|
105
|
+
maxVisible?: number;
|
|
106
|
+
}): {
|
|
107
|
+
entries: TimelineWorkEntry[];
|
|
108
|
+
hiddenCount: number;
|
|
109
|
+
};
|
|
110
|
+
export declare function messagesTimelineFingerprint(rows: readonly MessagesTimelineRow[]): string;
|
|
111
|
+
export declare function turnItemTextForCopy(item: TurnItem): string | null;
|
|
112
|
+
export declare function isAssistantCredentialError(message: string): boolean;
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CodexModelOption } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare const ModelListRow: import("react").NamedExoticComponent<{
|
|
3
|
+
index: number;
|
|
4
|
+
isFavorite: boolean;
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
model: CodexModelOption;
|
|
7
|
+
onSelect: () => void;
|
|
8
|
+
onToggleFavorite: () => void;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CodexModelOption, type ProviderInstanceEntry } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare const ModelPickerContent: import("react").NamedExoticComponent<{
|
|
3
|
+
favoriteModels: readonly string[];
|
|
4
|
+
instanceEntries?: ReadonlyArray<ProviderInstanceEntry>;
|
|
5
|
+
model: string;
|
|
6
|
+
modelOptions: readonly CodexModelOption[];
|
|
7
|
+
onModelChange: (model: string) => void;
|
|
8
|
+
onRequestClose?: () => void;
|
|
9
|
+
onToggleFavorite: (model: string) => void;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function filterCodexModelPickerOptions(input: {
|
|
12
|
+
favoriteModels: ReadonlySet<string>;
|
|
13
|
+
modelOptions: readonly CodexModelOption[];
|
|
14
|
+
query: string;
|
|
15
|
+
}): CodexModelOption[];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProviderInstanceEntry, ProviderInstanceId } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare const ModelPickerSidebar: import("react").NamedExoticComponent<{
|
|
3
|
+
instanceEntries: ReadonlyArray<ProviderInstanceEntry>;
|
|
4
|
+
onSelectInstance: (instanceId: ProviderInstanceId | "favorites") => void;
|
|
5
|
+
selectedInstanceId: ProviderInstanceId | "favorites";
|
|
6
|
+
showComingSoon?: boolean;
|
|
7
|
+
showFavorites?: boolean;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ProviderDriverKind } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare function providerInstanceInitials(label: string): string;
|
|
3
|
+
export declare const ProviderInstanceIcon: import("react").NamedExoticComponent<{
|
|
4
|
+
accentColor?: string | undefined;
|
|
5
|
+
badgeClassName?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
displayName: string;
|
|
8
|
+
driverKind: ProviderDriverKind;
|
|
9
|
+
iconClassName?: string;
|
|
10
|
+
showBadge?: boolean;
|
|
11
|
+
statusDotClassName?: string;
|
|
12
|
+
}>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type CodexModelOption, type ProviderInstanceEntry } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare const ProviderModelPicker: import("react").NamedExoticComponent<{
|
|
3
|
+
className?: string;
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
favoriteModels: readonly string[];
|
|
7
|
+
instanceEntries?: ReadonlyArray<ProviderInstanceEntry>;
|
|
8
|
+
model: string;
|
|
9
|
+
modelOptions?: readonly CodexModelOption[];
|
|
10
|
+
open?: boolean;
|
|
11
|
+
onFavoriteModelsChange: (models: string[]) => void;
|
|
12
|
+
onModelChange: (model: string) => void;
|
|
13
|
+
onOpenChange?: (open: boolean) => void;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ProviderStatus = {
|
|
2
|
+
displayName?: string | null;
|
|
3
|
+
driver?: string | null;
|
|
4
|
+
message?: string | null;
|
|
5
|
+
status: "disabled" | "error" | "limited" | "ready" | "warning";
|
|
6
|
+
};
|
|
7
|
+
export declare const ProviderStatusBanner: import("react").NamedExoticComponent<{
|
|
8
|
+
status: ProviderStatus | null;
|
|
9
|
+
}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type CodexReasoningEffort } from "../../lib/modelSelection.js";
|
|
2
|
+
export declare const TraitsPicker: import("react").NamedExoticComponent<{
|
|
3
|
+
className?: string;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
effort: CodexReasoningEffort;
|
|
6
|
+
onEffortChange: (effort: CodexReasoningEffort) => void;
|
|
7
|
+
}>;
|