@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.
Files changed (99) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +29 -0
  4. package/README.md +55 -0
  5. package/dist/components/chat-runtime.d.ts +58 -0
  6. package/dist/components/codex-chat-layout.d.ts +23 -0
  7. package/dist/components/codex-chat-render-state.d.ts +158 -0
  8. package/dist/components/codex-chat-view.d.ts +58 -0
  9. package/dist/components/codex-chat.d.ts +11 -0
  10. package/dist/components/index.d.ts +11 -0
  11. package/dist/components/primitives.d.ts +13 -0
  12. package/dist/hooks/chat-lifecycle.d.ts +73 -0
  13. package/dist/hooks/index.d.ts +5 -0
  14. package/dist/hooks/lifecycle.d.ts +41 -0
  15. package/dist/hooks/thread-reader.d.ts +3 -0
  16. package/dist/index.d.ts +2 -0
  17. package/dist/index.js +9773 -0
  18. package/dist/internal/chat-ui/components/ChatMarkdown.d.ts +7 -0
  19. package/dist/internal/chat-ui/components/ComposerPromptEditor.d.ts +34 -0
  20. package/dist/internal/chat-ui/components/chat/ChangedFilesTree.d.ts +5 -0
  21. package/dist/internal/chat-ui/components/chat/ChangedFilesTree.logic.d.ts +33 -0
  22. package/dist/internal/chat-ui/components/chat/ChatComposer.d.ts +103 -0
  23. package/dist/internal/chat-ui/components/chat/ChatView.d.ts +23 -0
  24. package/dist/internal/chat-ui/components/chat/CompactComposerControlsMenu.d.ts +16 -0
  25. package/dist/internal/chat-ui/components/chat/ComposerBannerStack.d.ts +20 -0
  26. package/dist/internal/chat-ui/components/chat/ComposerCommandMenu.d.ts +35 -0
  27. package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalActions.d.ts +9 -0
  28. package/dist/internal/chat-ui/components/chat/ComposerPendingApprovalPanel.d.ts +9 -0
  29. package/dist/internal/chat-ui/components/chat/ComposerPendingTerminalContexts.d.ts +18 -0
  30. package/dist/internal/chat-ui/components/chat/ComposerPendingUserInputPanel.d.ts +12 -0
  31. package/dist/internal/chat-ui/components/chat/ComposerPlanFollowUpBanner.d.ts +3 -0
  32. package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.d.ts +17 -0
  33. package/dist/internal/chat-ui/components/chat/ComposerPrimaryActions.logic.d.ts +13 -0
  34. package/dist/internal/chat-ui/components/chat/ComposerRealtimeConversationControl.d.ts +7 -0
  35. package/dist/internal/chat-ui/components/chat/ContextWindowMeter.d.ts +4 -0
  36. package/dist/internal/chat-ui/components/chat/ExpandedImageDialog.d.ts +5 -0
  37. package/dist/internal/chat-ui/components/chat/MessagesTimeline.d.ts +16 -0
  38. package/dist/internal/chat-ui/components/chat/MessagesTimeline.logic.d.ts +113 -0
  39. package/dist/internal/chat-ui/components/chat/ModelListRow.d.ts +9 -0
  40. package/dist/internal/chat-ui/components/chat/ModelPickerContent.d.ts +15 -0
  41. package/dist/internal/chat-ui/components/chat/ModelPickerSidebar.d.ts +8 -0
  42. package/dist/internal/chat-ui/components/chat/ProposedPlanCard.d.ts +3 -0
  43. package/dist/internal/chat-ui/components/chat/ProviderInstanceIcon.d.ts +12 -0
  44. package/dist/internal/chat-ui/components/chat/ProviderModelPicker.d.ts +14 -0
  45. package/dist/internal/chat-ui/components/chat/ProviderStatusBanner.d.ts +9 -0
  46. package/dist/internal/chat-ui/components/chat/TerminalContextInlineChip.d.ts +7 -0
  47. package/dist/internal/chat-ui/components/chat/TraitsPicker.d.ts +7 -0
  48. package/dist/internal/chat-ui/components/chat/composer-draft.client.d.ts +50 -0
  49. package/dist/internal/chat-ui/components/chat/composer-editor-mentions.d.ts +15 -0
  50. package/dist/internal/chat-ui/components/chat/composer-footer-layout.d.ts +9 -0
  51. package/dist/internal/chat-ui/components/chat/composer-image-attachments.d.ts +46 -0
  52. package/dist/internal/chat-ui/components/chat/composer-logic.d.ts +15 -0
  53. package/dist/internal/chat-ui/components/chat/composer-mention-targets.d.ts +12 -0
  54. package/dist/internal/chat-ui/components/chat/composer-realtime-conversation.logic.d.ts +26 -0
  55. package/dist/internal/chat-ui/components/chat/composer-send-state.logic.d.ts +17 -0
  56. package/dist/internal/chat-ui/components/chat/composerMenuHighlight.d.ts +8 -0
  57. package/dist/internal/chat-ui/components/chat/composerProviderState.d.ts +33 -0
  58. package/dist/internal/chat-ui/components/chat/composerSlashCommandSearch.d.ts +6 -0
  59. package/dist/internal/chat-ui/components/chat/index.d.ts +54 -0
  60. package/dist/internal/chat-ui/components/chat/mention-bindings.d.ts +26 -0
  61. package/dist/internal/chat-ui/components/chat/mention-codec.d.ts +22 -0
  62. package/dist/internal/chat-ui/components/chat/mention-syntax.d.ts +9 -0
  63. package/dist/internal/chat-ui/components/chat/modelPickerSearch.d.ts +16 -0
  64. package/dist/internal/chat-ui/components/chat/proposed-plan.d.ts +17 -0
  65. package/dist/internal/chat-ui/components/chat/providerIconUtils.d.ts +15 -0
  66. package/dist/internal/chat-ui/components/composerInlineChip.d.ts +5 -0
  67. package/dist/internal/chat-ui/components/ui/alert.d.ts +10 -0
  68. package/dist/internal/chat-ui/components/ui/badge.d.ts +10 -0
  69. package/dist/internal/chat-ui/components/ui/button.d.ts +10 -0
  70. package/dist/internal/chat-ui/components/ui/command.d.ts +18 -0
  71. package/dist/internal/chat-ui/components/ui/dialog.d.ts +17 -0
  72. package/dist/internal/chat-ui/components/ui/dropdown-menu.d.ts +29 -0
  73. package/dist/internal/chat-ui/components/ui/input.d.ts +3 -0
  74. package/dist/internal/chat-ui/components/ui/popover.d.ts +10 -0
  75. package/dist/internal/chat-ui/components/ui/separator.d.ts +4 -0
  76. package/dist/internal/chat-ui/components/ui/tooltip.d.ts +8 -0
  77. package/dist/internal/chat-ui/index.d.ts +2 -0
  78. package/dist/internal/chat-ui/lib/contextWindow.d.ts +27 -0
  79. package/dist/internal/chat-ui/lib/modelSelection.d.ts +36 -0
  80. package/dist/internal/chat-ui/lib/searchRanking.d.ts +27 -0
  81. package/dist/internal/chat-ui/lib/utils.d.ts +2 -0
  82. package/dist/internal/chat-ui/pendingUserInput.d.ts +37 -0
  83. package/dist/shadcn/hooks/use-mobile.d.ts +1 -0
  84. package/dist/shadcn/index.d.ts +13 -0
  85. package/dist/shadcn/index.js +1256 -0
  86. package/dist/shadcn/lib/utils.d.ts +2 -0
  87. package/dist/shadcn/ui/button.d.ts +10 -0
  88. package/dist/shadcn/ui/collapsible.d.ts +5 -0
  89. package/dist/shadcn/ui/command.d.ts +18 -0
  90. package/dist/shadcn/ui/dialog.d.ts +17 -0
  91. package/dist/shadcn/ui/input.d.ts +3 -0
  92. package/dist/shadcn/ui/scroll-area.d.ts +8 -0
  93. package/dist/shadcn/ui/separator.d.ts +4 -0
  94. package/dist/shadcn/ui/sheet.d.ts +14 -0
  95. package/dist/shadcn/ui/sidebar.d.ts +69 -0
  96. package/dist/shadcn/ui/skeleton.d.ts +2 -0
  97. package/dist/shadcn/ui/tooltip.d.ts +7 -0
  98. package/dist/styles.css +2 -0
  99. package/package.json +77 -0
@@ -0,0 +1,50 @@
1
+ import { type CodexReasoningEffort } from "../../lib/modelSelection.js";
2
+ import { type ComposerImageAttachment, type PersistedComposerDraftImageAttachment } from "./composer-image-attachments.js";
3
+ export interface ComposerDraftState {
4
+ prompt: string;
5
+ model: string | null;
6
+ effort: CodexReasoningEffort | null;
7
+ images: ComposerImageAttachment[];
8
+ persistedImages: PersistedComposerDraftImageAttachment[];
9
+ }
10
+ export type ComposerDraftKey = string;
11
+ export type PersistedComposerDraftState = Omit<ComposerDraftState, "images">;
12
+ type ComposerDraftStoreState = {
13
+ draftsByKey: Record<string, ComposerDraftState>;
14
+ favoriteModels: string[];
15
+ stickyEffort: CodexReasoningEffort | null;
16
+ stickyModel: string | null;
17
+ addImages: (key: ComposerDraftKey, images: ComposerImageAttachment[]) => void;
18
+ clearComposerContent: (key: ComposerDraftKey) => void;
19
+ clearDraft: (key: ComposerDraftKey) => void;
20
+ ensureDraft: (key: ComposerDraftKey) => ComposerDraftState;
21
+ getDraft: (key: ComposerDraftKey) => ComposerDraftState;
22
+ removeImage: (key: ComposerDraftKey, imageId: string) => void;
23
+ setEffort: (key: ComposerDraftKey, effort: CodexReasoningEffort | null) => void;
24
+ setFavoriteModels: (models: string[]) => void;
25
+ setModel: (key: ComposerDraftKey, model: string | null) => void;
26
+ setPrompt: (key: ComposerDraftKey, prompt: string) => void;
27
+ syncPersistedImages: (key: ComposerDraftKey, images: PersistedComposerDraftImageAttachment[]) => void;
28
+ };
29
+ export declare function assistantComposerDraftKey(input: {
30
+ scope: string;
31
+ threadId: string | null;
32
+ }): ComposerDraftKey;
33
+ export declare function readLegacyComposerDraft(key: ComposerDraftKey, storage?: Storage | null): PersistedComposerDraftState | null;
34
+ export declare function resolveDraftModel(draft: Pick<ComposerDraftState, "model">): string;
35
+ export declare function resolveDraftEffort(draft: Pick<ComposerDraftState, "effort">, model?: string): CodexReasoningEffort;
36
+ export declare const useComposerDraftStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ComposerDraftStoreState>, "setState" | "persist"> & {
37
+ setState(partial: ComposerDraftStoreState | Partial<ComposerDraftStoreState> | ((state: ComposerDraftStoreState) => ComposerDraftStoreState | Partial<ComposerDraftStoreState>), replace?: false | undefined): unknown;
38
+ setState(state: ComposerDraftStoreState | ((state: ComposerDraftStoreState) => ComposerDraftStoreState), replace: true): unknown;
39
+ persist: {
40
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ComposerDraftStoreState, unknown, unknown>>) => void;
41
+ clearStorage: () => void;
42
+ rehydrate: () => Promise<void> | void;
43
+ hasHydrated: () => boolean;
44
+ onHydrate: (fn: (state: ComposerDraftStoreState) => void) => () => void;
45
+ onFinishHydration: (fn: (state: ComposerDraftStoreState) => void) => () => void;
46
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<ComposerDraftStoreState, unknown, unknown>>;
47
+ };
48
+ }>;
49
+ export declare function useComposerThreadDraft(key: ComposerDraftKey): ComposerDraftState;
50
+ export {};
@@ -0,0 +1,15 @@
1
+ import type { CoreUserInput as UserInput } from "@jrkropp/codex-js/client";
2
+ import { type MentionBinding } from "./mention-bindings.js";
3
+ import { linkedMentionTextElements } from "./mention-codec.js";
4
+ export type ComposerPromptSnapshot = {
5
+ mentionBindings: MentionBinding[];
6
+ text: string;
7
+ textElements: ReturnType<typeof linkedMentionTextElements>;
8
+ };
9
+ export declare function createComposerPromptSnapshot(text: string, mentionBindings?: readonly MentionBinding[]): ComposerPromptSnapshot;
10
+ export type PrefilledComposerState = {
11
+ mentionBindings?: MentionBinding[];
12
+ message: string;
13
+ };
14
+ export declare function prefillComposerState(input: PrefilledComposerState): ComposerPromptSnapshot;
15
+ export declare function composerSnapshotUserInputItems(snapshot: ComposerPromptSnapshot): UserInput[];
@@ -0,0 +1,9 @@
1
+ export declare const COMPOSER_FOOTER_COMPACT_BREAKPOINT_PX = 620;
2
+ export declare const COMPOSER_FOOTER_WIDE_ACTIONS_COMPACT_BREAKPOINT_PX = 780;
3
+ export declare const COMPOSER_PRIMARY_ACTIONS_COMPACT_BREAKPOINT_PX = 780;
4
+ export declare function shouldUseCompactComposerFooter(width: number | null, options?: {
5
+ hasWideActions?: boolean;
6
+ }): boolean;
7
+ export declare function shouldUseCompactComposerPrimaryActions(width: number | null, options?: {
8
+ hasWideActions?: boolean;
9
+ }): boolean;
@@ -0,0 +1,46 @@
1
+ export interface ComposerImageAttachment {
2
+ id: string;
3
+ file: File;
4
+ name: string;
5
+ type: string;
6
+ size: number;
7
+ previewUrl: string | null;
8
+ }
9
+ export interface ExpandedImageItem {
10
+ src: string;
11
+ name: string;
12
+ }
13
+ export interface ExpandedImagePreview {
14
+ images: ExpandedImageItem[];
15
+ index: number;
16
+ }
17
+ export interface PersistedComposerDraftImageAttachment {
18
+ id: string;
19
+ name: string;
20
+ type: string;
21
+ size: number;
22
+ dataUrl: string;
23
+ }
24
+ export interface ComposerImageValidationResult {
25
+ accepted: File[];
26
+ error: string | null;
27
+ }
28
+ export declare const WORKSPACE_CHAT_MAX_IMAGE_ATTACHMENTS = 8;
29
+ export declare const WORKSPACE_CHAT_MAX_IMAGE_BYTES: number;
30
+ export declare function isAcceptedComposerImageFile(file: File): boolean;
31
+ export declare function validateComposerImageFiles(input: {
32
+ currentCount?: number;
33
+ files: Iterable<File>;
34
+ maxCount?: number;
35
+ maxSizeBytes?: number;
36
+ }): ComposerImageValidationResult;
37
+ export declare function createComposerImageAttachments(files: Iterable<File>, options?: {
38
+ createId?: () => string;
39
+ createObjectURL?: (file: File) => string;
40
+ }): ComposerImageAttachment[];
41
+ export declare function persistComposerDraftAttachments(attachments: Iterable<ComposerImageAttachment>, readFileAsDataUrl?: (file: File) => Promise<string>): Promise<PersistedComposerDraftImageAttachment[]>;
42
+ export declare function restoreComposerDraftAttachments(attachments: Iterable<PersistedComposerDraftImageAttachment>, options?: {
43
+ createObjectURL?: (file: File) => string;
44
+ }): ComposerImageAttachment[];
45
+ export declare function revokeComposerImageAttachments(attachments: Iterable<ComposerImageAttachment>, revokeObjectURL?: (url: string) => void): void;
46
+ export declare function buildExpandedImagePreview(attachments: ReadonlyArray<ComposerImageAttachment>, selectedAttachmentId: string): ExpandedImagePreview | null;
@@ -0,0 +1,15 @@
1
+ export type ComposerTriggerKind = "path" | "skill" | "slash-command";
2
+ export type BuiltInComposerSlashCommand = "default" | "model" | "plan";
3
+ export type ComposerSlashCommand = BuiltInComposerSlashCommand | (string & {});
4
+ export type ComposerTrigger = {
5
+ kind: ComposerTriggerKind;
6
+ query: string;
7
+ rangeEnd: number;
8
+ rangeStart: number;
9
+ };
10
+ export declare function detectComposerTrigger(text: string, cursorInput: number): ComposerTrigger | null;
11
+ export declare function replaceTextRange(text: string, rangeStart: number, rangeEnd: number, replacement: string): {
12
+ cursor: number;
13
+ text: string;
14
+ };
15
+ export declare function parseStandaloneComposerSlashCommand(text: string): ComposerSlashCommand | null;
@@ -0,0 +1,12 @@
1
+ import type { MentionBinding } from "./mention-bindings.js";
2
+ export type ComposerMentionTarget = {
3
+ binding: MentionBinding;
4
+ displayName: string;
5
+ label: string;
6
+ mention: string;
7
+ path: string;
8
+ };
9
+ export declare function searchComposerMentionTargets(input: {
10
+ query: string;
11
+ targets: readonly ComposerMentionTarget[];
12
+ }): ComposerMentionTarget[];
@@ -0,0 +1,26 @@
1
+ export type RealtimeConversationPhase = "Inactive" | "Starting" | "Active" | "Stopping";
2
+ export type RealtimeConversationUiState = {
3
+ disabled?: boolean;
4
+ error?: string | null;
5
+ phase: RealtimeConversationPhase;
6
+ realtimeSessionId?: string | null;
7
+ requestedClose: boolean;
8
+ transport: "webrtc";
9
+ onStart: () => void;
10
+ onStop: () => void;
11
+ };
12
+ export type RealtimeConversationControlState = {
13
+ action: "start" | "stop";
14
+ isActive: boolean;
15
+ isBusy: boolean;
16
+ label: string;
17
+ title: string;
18
+ };
19
+ export declare function isRealtimeConversationLive(phase: RealtimeConversationPhase): boolean;
20
+ export declare function getRealtimeConversationControlState(realtimeConversation: Pick<RealtimeConversationUiState, "error" | "phase" | "requestedClose">): RealtimeConversationControlState;
21
+ export declare class RecordingMeterState {
22
+ private readonly history;
23
+ private env;
24
+ private noiseEma;
25
+ nextText(peak: number): string;
26
+ }
@@ -0,0 +1,17 @@
1
+ export interface ComposerSendState {
2
+ hasSendableContent: boolean;
3
+ isConnecting: boolean;
4
+ isEnvironmentUnavailable: boolean;
5
+ isRunning: boolean;
6
+ isSendBusy: boolean;
7
+ sendDisabled: boolean;
8
+ stopDisabled: boolean;
9
+ }
10
+ export declare function deriveComposerSendState(input: {
11
+ disabled: boolean;
12
+ hasSendableContent: boolean;
13
+ isConnecting: boolean;
14
+ isEnvironmentUnavailable: boolean;
15
+ isRunning: boolean;
16
+ isSending: boolean;
17
+ }): ComposerSendState;
@@ -0,0 +1,8 @@
1
+ export declare function resolveComposerMenuActiveItemId(input: {
2
+ currentSearchKey: string | null;
3
+ highlightedItemId: string | null;
4
+ highlightedSearchKey: string | null;
5
+ items: ReadonlyArray<{
6
+ id: string;
7
+ }>;
8
+ }): string | null;
@@ -0,0 +1,33 @@
1
+ import type { ReactNode } from "react";
2
+ import { type CodexModelOption, type CodexReasoningEffort, type ProviderDriverKind } from "../../lib/modelSelection.js";
3
+ export type ProviderOptionSelection = {
4
+ name: string;
5
+ value: string;
6
+ };
7
+ export type ComposerProviderStateInput = {
8
+ model: string;
9
+ modelOptions: ReadonlyArray<ProviderOptionSelection> | null | undefined;
10
+ models: ReadonlyArray<CodexModelOption>;
11
+ prompt: string;
12
+ provider: ProviderDriverKind;
13
+ };
14
+ export type ComposerProviderState = {
15
+ composerFrameClassName?: string;
16
+ composerSurfaceClassName?: string;
17
+ modelPickerIconClassName?: string;
18
+ modelOptionsForDispatch: ReadonlyArray<ProviderOptionSelection> | undefined;
19
+ promptEffort: string | null;
20
+ provider: ProviderDriverKind;
21
+ };
22
+ type TraitsRenderInput = {
23
+ model: string;
24
+ modelOptions: ReadonlyArray<ProviderOptionSelection> | undefined;
25
+ models: ReadonlyArray<CodexModelOption>;
26
+ onEffortChange?: (effort: CodexReasoningEffort) => void;
27
+ prompt: string;
28
+ provider: ProviderDriverKind;
29
+ };
30
+ export declare function getComposerProviderState(input: ComposerProviderStateInput): ComposerProviderState;
31
+ export declare function renderProviderTraitsMenuContent(_input: TraitsRenderInput): ReactNode;
32
+ export declare function renderProviderTraitsPicker(input: TraitsRenderInput): ReactNode;
33
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { ComposerCommandItem } from "./ComposerCommandMenu.js";
2
+ type SlashCommandItem = Extract<ComposerCommandItem, {
3
+ type: "slash-command";
4
+ }>;
5
+ export declare function searchSlashCommandItems(items: ReadonlyArray<SlashCommandItem>, query: string): SlashCommandItem[];
6
+ export {};
@@ -0,0 +1,54 @@
1
+ export { AssistantChangedFilesSection } from "./ChangedFilesTree.js";
2
+ export * from "./ChangedFilesTree.logic.js";
3
+ export { ChatComposer, type ChatComposerHandle } from "./ChatComposer.js";
4
+ export type { ChatComposerCommand, ChatComposerInteractionMode, ChatComposerRuntimeMode, ChatComposerSkill, ChatComposerSubmitPayload, } from "./ChatComposer.js";
5
+ export { ChatView } from "./ChatView.js";
6
+ export type { ChatViewProps, ChatViewRenderComposerControls, } from "./ChatView.js";
7
+ export { ChatMarkdown } from "../ChatMarkdown.js";
8
+ export { CompactComposerControlsMenu } from "./CompactComposerControlsMenu.js";
9
+ export { ComposerBannerStack } from "./ComposerBannerStack.js";
10
+ export type { ComposerBannerStackItem } from "./ComposerBannerStack.js";
11
+ export { ComposerCommandMenu } from "./ComposerCommandMenu.js";
12
+ export type { ComposerCommandItem } from "./ComposerCommandMenu.js";
13
+ export { ComposerPendingApprovalActions, type ApprovalRequestId, type ProviderApprovalDecision, } from "./ComposerPendingApprovalActions.js";
14
+ export { ComposerPendingApprovalPanel, type PendingApproval, } from "./ComposerPendingApprovalPanel.js";
15
+ export { ComposerPendingTerminalContexts, ComposerPendingTerminalContextChip, formatTerminalContextLabel, isTerminalContextExpired, type TerminalContextDraft, } from "./ComposerPendingTerminalContexts.js";
16
+ export * from "./composer-draft.client.js";
17
+ export * from "./composer-editor-mentions.js";
18
+ export * from "./composer-footer-layout.js";
19
+ export * from "./composer-image-attachments.js";
20
+ export * from "./composer-logic.js";
21
+ export * from "./composer-mention-targets.js";
22
+ export * from "../composerInlineChip.js";
23
+ export * from "../../pendingUserInput.js";
24
+ export { ComposerPendingUserInputPanel } from "./ComposerPendingUserInputPanel.js";
25
+ export { buildRequestUserInputResponse, derivePendingUserInputProgress, setPendingUserInputCustomAnswer, togglePendingUserInputOptionSelection, } from "./ComposerPendingUserInputPanel.js";
26
+ export { ComposerPrimaryActions } from "./ComposerPrimaryActions.js";
27
+ export { formatPendingPrimaryActionLabel } from "./ComposerPrimaryActions.logic.js";
28
+ export type { PendingActionState } from "./ComposerPrimaryActions.logic.js";
29
+ export { ComposerPlanFollowUpBanner } from "./ComposerPlanFollowUpBanner.js";
30
+ export * from "./composerMenuHighlight.js";
31
+ export { getComposerProviderState, renderProviderTraitsMenuContent, renderProviderTraitsPicker, } from "./composerProviderState.js";
32
+ export type { ComposerProviderState, ComposerProviderStateInput, ProviderOptionSelection, } from "./composerProviderState.js";
33
+ export { ComposerRealtimeConversationControl } from "./ComposerRealtimeConversationControl.js";
34
+ export * from "./composer-realtime-conversation.logic.js";
35
+ export { ComposerPromptEditor } from "../ComposerPromptEditor.js";
36
+ export type { ComposerPromptEditorHandle } from "../ComposerPromptEditor.js";
37
+ export * from "./composer-send-state.logic.js";
38
+ export * from "./composerSlashCommandSearch.js";
39
+ export { ExpandedImageDialog } from "./ExpandedImageDialog.js";
40
+ export * from "./mention-bindings.js";
41
+ export * from "./mention-codec.js";
42
+ export * from "./mention-syntax.js";
43
+ export { MessagesTimeline } from "./MessagesTimeline.js";
44
+ export * from "./MessagesTimeline.logic.js";
45
+ export { ModelListRow } from "./ModelListRow.js";
46
+ export { ModelPickerContent } from "./ModelPickerContent.js";
47
+ export { filterCodexModelPickerOptions } from "./ModelPickerContent.js";
48
+ export * from "./modelPickerSearch.js";
49
+ export { ProposedPlanCard } from "./ProposedPlanCard.js";
50
+ export * from "./proposed-plan.js";
51
+ export { ProviderStatusBanner, type ProviderStatus } from "./ProviderStatusBanner.js";
52
+ export { ProviderModelPicker } from "./ProviderModelPicker.js";
53
+ export { TerminalContextInlineChip } from "./TerminalContextInlineChip.js";
54
+ export { TraitsPicker } from "./TraitsPicker.js";
@@ -0,0 +1,26 @@
1
+ export type MentionBinding = {
2
+ mention: string;
3
+ path: string;
4
+ };
5
+ export type MentionBindingRange = {
6
+ binding: MentionBinding;
7
+ range: {
8
+ end: number;
9
+ start: number;
10
+ };
11
+ };
12
+ export declare function normalizeMentionBindingsForText(text: string, bindings: readonly MentionBinding[]): MentionBinding[];
13
+ export declare function mentionBindingRangesForText(text: string, bindings: readonly MentionBinding[]): MentionBindingRange[];
14
+ export declare function mentionBindingsAfterReplacement(input: {
15
+ currentBindings: readonly MentionBinding[];
16
+ insertedBinding: MentionBinding;
17
+ nextText: string;
18
+ replacement: string;
19
+ rangeEnd: number;
20
+ rangeStart: number;
21
+ text: string;
22
+ }): MentionBinding[];
23
+ export declare function findNextMentionTokenRange(text: string, token: string, from: number): {
24
+ end: number;
25
+ start: number;
26
+ } | null;
@@ -0,0 +1,22 @@
1
+ import type { CoreTextElement as TextElement } from "@jrkropp/codex-js/client";
2
+ import { type MentionBinding } from "./mention-bindings.js";
3
+ export type LinkedMention = {
4
+ mention: string;
5
+ path: string;
6
+ };
7
+ export type DecodedHistoryText = {
8
+ mentions: LinkedMention[];
9
+ text: string;
10
+ };
11
+ export type LinkedMentionRange = {
12
+ end: number;
13
+ mention: string;
14
+ path: string;
15
+ placeholder: string;
16
+ start: number;
17
+ };
18
+ export declare function encodeHistoryMentions(text: string, bindings: readonly MentionBinding[]): string;
19
+ export declare function decodeHistoryMentions(text: string): DecodedHistoryText;
20
+ export declare function findLinkedMentions(text: string): LinkedMentionRange[];
21
+ export declare function parseLinkedToolMention(text: string, start: number): LinkedMentionRange | null;
22
+ export declare function linkedMentionTextElements(text: string): TextElement[];
@@ -0,0 +1,9 @@
1
+ export declare const PROJECT_MENTION_SIGIL = "@";
2
+ export declare const LEGACY_PROJECT_MENTION_SIGIL = "$";
3
+ export declare const SKILL_MENTION_SIGIL = "$";
4
+ export declare const TOOL_MENTION_SIGIL = "@";
5
+ export declare const PLUGIN_TEXT_MENTION_SIGIL = "@";
6
+ export declare function isMentionNameChar(byte: number): boolean;
7
+ export declare function mentionToken(name: string): string;
8
+ export declare function legacyMentionToken(name: string): string;
9
+ export declare function skillToken(name: string): string;
@@ -0,0 +1,16 @@
1
+ type ModelPickerSearchableModel = {
2
+ /** Driver kind, indexed so "codex" still matches a Codex Personal instance. */
3
+ driverKind: string;
4
+ /**
5
+ * Instance display name. Indexed as a search field so typing the
6
+ * user-authored provider name matches its models directly.
7
+ */
8
+ providerDisplayName: string;
9
+ name: string;
10
+ shortName?: string;
11
+ subProvider?: string;
12
+ isFavorite?: boolean;
13
+ };
14
+ export declare function buildModelPickerSearchText(model: ModelPickerSearchableModel): string;
15
+ export declare function scoreModelPickerSearch(model: ModelPickerSearchableModel, query: string): number | null;
16
+ export {};
@@ -0,0 +1,17 @@
1
+ export declare function proposedPlanTitle(planMarkdown: string): string | null;
2
+ export declare function stripDisplayedPlanMarkdown(planMarkdown: string): string;
3
+ export declare function buildCollapsedProposedPlanPreviewMarkdown(planMarkdown: string, options?: {
4
+ maxLines?: number;
5
+ }): string;
6
+ export declare function buildPlanImplementationPrompt(planMarkdown: string): string;
7
+ export declare function resolvePlanFollowUpSubmission(input: {
8
+ draftText: string;
9
+ planMarkdown: string;
10
+ }): {
11
+ interactionMode: "default" | "plan";
12
+ text: string;
13
+ };
14
+ export declare function buildPlanImplementationThreadTitle(planMarkdown: string): string;
15
+ export declare function buildProposedPlanMarkdownFilename(planMarkdown: string): string;
16
+ export declare function normalizePlanMarkdownForExport(planMarkdown: string): string;
17
+ export declare function downloadPlanAsTextFile(filename: string, contents: string): void;
@@ -0,0 +1,15 @@
1
+ import type { ComponentProps } from "react";
2
+ import type { ProviderDriverKind } from "../../lib/modelSelection.js";
3
+ export type ModelEsque = {
4
+ name: string;
5
+ shortName?: string | undefined;
6
+ slug: string;
7
+ subProvider?: string | undefined;
8
+ };
9
+ export declare function OpenAIProviderIcon({ className, ...props }: ComponentProps<"svg">): import("react/jsx-runtime").JSX.Element;
10
+ export declare const PROVIDER_ICON_BY_PROVIDER: Partial<Record<ProviderDriverKind, typeof OpenAIProviderIcon>>;
11
+ export declare function getDisplayModelName(model: ModelEsque, options?: {
12
+ preferShortName?: boolean;
13
+ }): string;
14
+ export declare function getTriggerDisplayModelName(model: ModelEsque): string;
15
+ export declare function getTriggerDisplayModelLabel(model: ModelEsque): string;
@@ -0,0 +1,5 @@
1
+ export declare const COMPOSER_INLINE_CHIP_CLASS_NAME = "inline-flex max-w-full select-none items-center gap-1 rounded-md border border-border/70 bg-accent/40 px-1.5 py-px font-medium text-[12px] leading-[1.1] text-foreground align-middle";
2
+ export declare const COMPOSER_INLINE_CHIP_ICON_CLASS_NAME = "size-3.5 shrink-0 opacity-85";
3
+ export declare const COMPOSER_INLINE_CHIP_LABEL_CLASS_NAME = "truncate select-none leading-tight";
4
+ export declare const COMPOSER_INLINE_SKILL_CHIP_CLASS_NAME = "inline-flex max-w-full select-none items-center gap-1 rounded-md border border-fuchsia-500/25 bg-fuchsia-500/12 px-1.5 py-px font-medium text-[12px] leading-[1.1] text-fuchsia-700 align-middle dark:text-fuchsia-300";
5
+ export declare const COMPOSER_INLINE_CHIP_DISMISS_BUTTON_CLASS_NAME = "ml-0.5 inline-flex size-3.5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground/72 transition-colors hover:bg-foreground/6 hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const alertVariants: (props?: ({
4
+ variant?: "default" | "destructive" | null | undefined;
5
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
6
+ declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): import("react/jsx-runtime").JSX.Element;
7
+ declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function AlertDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
9
+ declare function AlertAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
10
+ export { Alert, AlertTitle, AlertDescription, AlertAction };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const badgeVariants: (props?: ({
4
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
5
+ size?: "default" | "sm" | "lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Badge({ className, variant, size, asChild, ...props }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Badge, badgeVariants };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { type VariantProps } from "class-variance-authority";
3
+ declare const buttonVariants: (props?: ({
4
+ variant?: "default" | "outline" | "secondary" | "ghost" | "destructive" | "link" | null | undefined;
5
+ size?: "default" | "xs" | "sm" | "lg" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
6
+ } & import("class-variance-authority/types").ClassProp) | undefined) => string;
7
+ declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
8
+ asChild?: boolean;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export { Button, buttonVariants };
@@ -0,0 +1,18 @@
1
+ import * as React from "react";
2
+ import { Command as CommandPrimitive } from "cmdk";
3
+ import { Dialog } from "./dialog.js";
4
+ declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): import("react/jsx-runtime").JSX.Element;
5
+ declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: React.ComponentProps<typeof Dialog> & {
6
+ title?: string;
7
+ description?: string;
8
+ className?: string;
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): import("react/jsx-runtime").JSX.Element;
12
+ declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): import("react/jsx-runtime").JSX.Element;
13
+ declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): import("react/jsx-runtime").JSX.Element;
14
+ declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
15
+ declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
16
+ declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): import("react/jsx-runtime").JSX.Element;
17
+ declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
18
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, };
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { Dialog as DialogPrimitive } from "radix-ui";
3
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
9
+ showCloseButton?: boolean;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
12
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
13
+ showCloseButton?: boolean;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): import("react/jsx-runtime").JSX.Element;
16
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): import("react/jsx-runtime").JSX.Element;
17
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
3
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): import("react/jsx-runtime").JSX.Element;
5
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): import("react/jsx-runtime").JSX.Element;
8
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
9
+ inset?: boolean;
10
+ variant?: "default" | "destructive";
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
13
+ inset?: boolean;
14
+ }): import("react/jsx-runtime").JSX.Element;
15
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): import("react/jsx-runtime").JSX.Element;
16
+ declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
17
+ inset?: boolean;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
20
+ inset?: boolean;
21
+ }): import("react/jsx-runtime").JSX.Element;
22
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): import("react/jsx-runtime").JSX.Element;
23
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): import("react/jsx-runtime").JSX.Element;
24
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): import("react/jsx-runtime").JSX.Element;
25
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
26
+ inset?: boolean;
27
+ }): import("react/jsx-runtime").JSX.Element;
28
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): import("react/jsx-runtime").JSX.Element;
29
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
@@ -0,0 +1,3 @@
1
+ import * as React from "react";
2
+ declare function Input({ className, type, ...props }: React.ComponentProps<"input">): import("react/jsx-runtime").JSX.Element;
3
+ export { Input };
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ import { Popover as PopoverPrimitive } from "radix-ui";
3
+ declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
+ declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
+ declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
7
+ declare function PopoverHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
8
+ declare function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">): import("react/jsx-runtime").JSX.Element;
9
+ declare function PopoverDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
10
+ export { Popover, PopoverAnchor, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, };
@@ -0,0 +1,4 @@
1
+ import * as React from "react";
2
+ import { Separator as SeparatorPrimitive } from "radix-ui";
3
+ declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
+ export { Separator };
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import { Tooltip as TooltipPrimitive } from "radix-ui";
3
+ declare function TooltipProvider({ delayDuration, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>): import("react/jsx-runtime").JSX.Element;
4
+ declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
5
+ declare function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
6
+ declare function TooltipContent({ className, sideOffset, children, ...props }: React.ComponentProps<typeof TooltipPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
7
+ declare const TooltipPopup: typeof TooltipContent;
8
+ export { Tooltip, TooltipContent, TooltipPopup, TooltipProvider, TooltipTrigger };
@@ -0,0 +1,2 @@
1
+ export * from "./components/chat/index.js";
2
+ export * from "./lib/modelSelection.js";
@@ -0,0 +1,27 @@
1
+ import type { ThreadTokenUsage } from "@jrkropp/codex-js/client";
2
+ export type ContextWindowSnapshot = {
3
+ cachedInputTokens: number | null;
4
+ compactsAutomatically: boolean;
5
+ durationMs: number | null;
6
+ inputTokens: number | null;
7
+ lastCachedInputTokens: number | null;
8
+ lastInputTokens: number | null;
9
+ lastOutputTokens: number | null;
10
+ lastReasoningOutputTokens: number | null;
11
+ lastUsedTokens: number | null;
12
+ maxTokens: number | null;
13
+ outputTokens: number | null;
14
+ reasoningOutputTokens: number | null;
15
+ remainingPercentage: number | null;
16
+ remainingTokens: number | null;
17
+ toolUses: number | null;
18
+ totalProcessedTokens: number | null;
19
+ updatedAt: string;
20
+ usedPercentage: number | null;
21
+ usedTokens: number;
22
+ };
23
+ export declare function deriveContextWindowSnapshotFromTokenUsage(input: {
24
+ tokenUsage: ThreadTokenUsage | null | undefined;
25
+ updatedAt?: string | null;
26
+ }): ContextWindowSnapshot | null;
27
+ export declare function formatContextWindowTokens(value: number | null): string;