@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,36 @@
1
+ export type CodexModelOption = {
2
+ slug: string;
3
+ name: string;
4
+ shortName?: string;
5
+ subProvider?: string;
6
+ description: string;
7
+ };
8
+ export type ProviderDriverKind = "codex" | (string & {});
9
+ export type ProviderInstanceId = string;
10
+ export type ProviderInstanceEntry = {
11
+ accentColor?: string;
12
+ continuationGroupKey?: string;
13
+ displayName: string;
14
+ driverKind: ProviderDriverKind;
15
+ instanceId: ProviderInstanceId;
16
+ isAvailable: boolean;
17
+ snapshot: {
18
+ message?: string | null;
19
+ };
20
+ status: "ready" | "warning" | "error" | "disabled" | "loading";
21
+ };
22
+ export type CodexReasoningEffort = "low" | "medium" | "high" | "xhigh";
23
+ export type CodexReasoningEffortOption = {
24
+ value: CodexReasoningEffort;
25
+ label: string;
26
+ description: string;
27
+ };
28
+ export declare const defaultCodexModel = "gpt-5.5";
29
+ export declare const defaultCodexReasoningEffort: CodexReasoningEffort;
30
+ export declare const codexModelOptions: readonly CodexModelOption[];
31
+ export declare const defaultCodexProviderInstance: ProviderInstanceEntry;
32
+ export declare const codexReasoningEffortOptions: readonly CodexReasoningEffortOption[];
33
+ export declare function resolveCodexModelOption(model: string): CodexModelOption;
34
+ export declare function resolveCodexReasoningEffortOption(effort: string): CodexReasoningEffortOption;
35
+ export declare function isCodexReasoningEffort(value: string): value is CodexReasoningEffort;
36
+ export declare function resolveCodexReasoningEffortForModel(model: string, effort: string | null | undefined): CodexReasoningEffort;
@@ -0,0 +1,27 @@
1
+ export type RankedSearchResult<T> = {
2
+ item: T;
3
+ score: number;
4
+ tieBreaker: string;
5
+ };
6
+ export declare function normalizeSearchQuery(input: string, options?: {
7
+ trimLeadingPattern?: RegExp;
8
+ }): string;
9
+ export declare function scoreSubsequenceMatch(value: string, query: string): number | null;
10
+ /**
11
+ * Scores how well `value` matches `query` using tiered match strategies.
12
+ *
13
+ * Expects pre-normalized inputs: both `value` and `query` must already be
14
+ * trimmed and lowercased via `normalizeSearchQuery`.
15
+ */
16
+ export declare function scoreQueryMatch(input: {
17
+ value: string;
18
+ query: string;
19
+ exactBase: number;
20
+ prefixBase?: number;
21
+ boundaryBase?: number;
22
+ includesBase?: number;
23
+ fuzzyBase?: number;
24
+ boundaryMarkers?: readonly string[];
25
+ }): number | null;
26
+ export declare function compareRankedSearchResults<T>(left: RankedSearchResult<T>, right: RankedSearchResult<T>): number;
27
+ export declare function insertRankedSearchResult<T>(rankedEntries: RankedSearchResult<T>[], candidate: RankedSearchResult<T>, limit: number): void;
@@ -0,0 +1,2 @@
1
+ import { type ClassValue } from "clsx";
2
+ export declare function cn(...inputs: ClassValue[]): string;
@@ -0,0 +1,37 @@
1
+ import type { RequestId } from "@jrkropp/codex-js/client";
2
+ import type { ToolRequestUserInputQuestion, ToolRequestUserInputResponse } from "@jrkropp/codex-js/client";
3
+ export type PendingUserInputQuestion = Omit<ToolRequestUserInputQuestion, "options"> & {
4
+ options: NonNullable<ToolRequestUserInputQuestion["options"]>;
5
+ };
6
+ export type PendingUserInput = {
7
+ requestId: RequestId;
8
+ threadId: string;
9
+ turnId: string;
10
+ itemId: string;
11
+ questions: readonly PendingUserInputQuestion[];
12
+ };
13
+ export interface PendingUserInputDraftAnswer {
14
+ selectedOptionLabels?: string[];
15
+ customAnswer?: string;
16
+ }
17
+ export interface PendingUserInputProgress {
18
+ activeDraft: PendingUserInputDraftAnswer | undefined;
19
+ activeQuestion: PendingUserInputQuestion | null;
20
+ answeredQuestionCount: number;
21
+ canAdvance: boolean;
22
+ customAnswer: string;
23
+ isComplete: boolean;
24
+ isLastQuestion: boolean;
25
+ questionIndex: number;
26
+ resolvedAnswer: string[] | null;
27
+ selectedOptionLabels: string[];
28
+ usingCustomAnswer: boolean;
29
+ }
30
+ export declare function normalizePendingUserInputQuestion(question: ToolRequestUserInputQuestion): PendingUserInputQuestion;
31
+ export declare function derivePendingUserInputProgress(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>, questionIndex: number): PendingUserInputProgress;
32
+ export declare function togglePendingUserInputOptionSelection(optionLabel: string): PendingUserInputDraftAnswer;
33
+ export declare function setPendingUserInputCustomAnswer(draft: PendingUserInputDraftAnswer | undefined, customAnswer: string): PendingUserInputDraftAnswer;
34
+ export declare function buildRequestUserInputResponse(request: PendingUserInput, draftAnswers: Record<string, PendingUserInputDraftAnswer>): ToolRequestUserInputResponse;
35
+ export declare function buildPendingUserInputAnswers(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>): Record<string, string[]> | null;
36
+ export declare function countAnsweredPendingUserInputQuestions(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>): number;
37
+ export declare function resolvePendingUserInputAnswer(question: PendingUserInputQuestion, draft: PendingUserInputDraftAnswer | undefined): string[] | null;
@@ -0,0 +1 @@
1
+ export declare function useIsMobile(): boolean;
@@ -0,0 +1,13 @@
1
+ export { Button, buttonVariants } from "./ui/button.js";
2
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "./ui/collapsible.js";
3
+ export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, } from "./ui/command.js";
4
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, } from "./ui/dialog.js";
5
+ export { Input } from "./ui/input.js";
6
+ export { ScrollArea, ScrollBar } from "./ui/scroll-area.js";
7
+ export { Separator } from "./ui/separator.js";
8
+ export { Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, } from "./ui/sheet.js";
9
+ export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar, } from "./ui/sidebar.js";
10
+ export { Skeleton } from "./ui/skeleton.js";
11
+ export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, } from "./ui/tooltip.js";
12
+ export { useIsMobile } from "./hooks/use-mobile.js";
13
+ export { cn } from "./lib/utils.js";