@jrkropp/codex-js 0.1.2 → 0.1.3
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 +4 -0
- package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
- package/dist/DynamicToolCallResponse-82DFjES2.d.ts +8 -0
- package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
- package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
- package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
- package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
- package/dist/{session-DPhHN7RZ.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -306
- package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
- package/dist/ToolRequestUserInputResponse-zcPLwbiK.d.ts +17 -0
- package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
- package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
- package/dist/chat-runtime-B6azJyKo.d.ts +381 -0
- package/dist/chunk-2DZRMCI2.js +1258 -0
- package/dist/chunk-2DZRMCI2.js.map +1 -0
- package/dist/chunk-4DPLJPB5.js +396 -0
- package/dist/chunk-4DPLJPB5.js.map +1 -0
- package/dist/chunk-5JMJ6OI5.js +3 -0
- package/dist/chunk-5JMJ6OI5.js.map +1 -0
- package/dist/chunk-6ZMJ34KE.js +1153 -0
- package/dist/chunk-6ZMJ34KE.js.map +1 -0
- package/dist/chunk-CGBS37IU.js +128 -0
- package/dist/chunk-CGBS37IU.js.map +1 -0
- package/dist/chunk-DCMKA2A6.js +18 -0
- package/dist/chunk-DCMKA2A6.js.map +1 -0
- package/dist/chunk-DYLHN3HG.js +937 -0
- package/dist/chunk-DYLHN3HG.js.map +1 -0
- package/dist/chunk-ILXA6HLX.js +1973 -0
- package/dist/chunk-ILXA6HLX.js.map +1 -0
- package/dist/{chunk-SVK6PLGO.js → chunk-LWQNX4LI.js} +12009 -18768
- package/dist/chunk-LWQNX4LI.js.map +1 -0
- package/dist/{chunk-JLDH4U5L.js → chunk-NCI4MAWZ.js} +317 -1967
- package/dist/chunk-NCI4MAWZ.js.map +1 -0
- package/dist/chunk-O44XP7LH.js +214 -0
- package/dist/chunk-O44XP7LH.js.map +1 -0
- package/dist/chunk-PST3ZWX2.js +555 -0
- package/dist/chunk-PST3ZWX2.js.map +1 -0
- package/dist/chunk-SYPHCDRD.js +1133 -0
- package/dist/chunk-SYPHCDRD.js.map +1 -0
- package/dist/chunk-V4BMZWBM.js +2401 -0
- package/dist/chunk-V4BMZWBM.js.map +1 -0
- package/dist/chunk-YHVCFD2D.js +117 -0
- package/dist/chunk-YHVCFD2D.js.map +1 -0
- package/dist/chunk-Z63UPBS3.js +152 -0
- package/dist/chunk-Z63UPBS3.js.map +1 -0
- package/dist/client/index.d.ts +16 -4
- package/dist/client/index.js +13 -1
- package/dist/codex-rs/app-server/index.d.ts +161 -0
- package/dist/codex-rs/app-server/index.js +13 -0
- package/dist/codex-rs/app-server/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
- package/dist/codex-rs/app-server-protocol/index.js +6 -0
- package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
- package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
- package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
- package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
- package/dist/codex-rs/codex-api/index.d.ts +104 -0
- package/dist/codex-rs/codex-api/index.js +11 -0
- package/dist/codex-rs/codex-api/index.js.map +1 -0
- package/dist/codex-rs/config/index.d.ts +88 -0
- package/dist/codex-rs/config/index.js +4 -0
- package/dist/codex-rs/config/index.js.map +1 -0
- package/dist/codex-rs/core/config/index.d.ts +61 -0
- package/dist/codex-rs/core/config/index.js +5 -0
- package/dist/codex-rs/core/config/index.js.map +1 -0
- package/dist/codex-rs/core/index.d.ts +1393 -0
- package/dist/codex-rs/core/index.js +11 -0
- package/dist/codex-rs/core/index.js.map +1 -0
- package/dist/codex-rs/model-provider/index.d.ts +2 -0
- package/dist/codex-rs/model-provider/index.js +4 -0
- package/dist/codex-rs/model-provider/index.js.map +1 -0
- package/dist/codex-rs/models-manager/index.d.ts +2 -0
- package/dist/codex-rs/models-manager/index.js +4 -0
- package/dist/codex-rs/models-manager/index.js.map +1 -0
- package/dist/codex-rs/parity.d.ts +26 -0
- package/dist/codex-rs/parity.js +3 -0
- package/dist/codex-rs/parity.js.map +1 -0
- package/dist/codex-rs/thread-store/index.d.ts +5 -0
- package/dist/codex-rs/thread-store/index.js +4 -0
- package/dist/codex-rs/thread-store/index.js.map +1 -0
- package/dist/codex-rs/unsupported.d.ts +15 -0
- package/dist/codex-rs/unsupported.js +22 -0
- package/dist/codex-rs/unsupported.js.map +1 -0
- package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
- package/dist/codex-rs/utils/output-truncation.js +4 -0
- package/dist/codex-rs/utils/output-truncation.js.map +1 -0
- package/dist/codex-rs/utils/string.d.ts +7 -0
- package/dist/codex-rs/utils/string.js +3 -0
- package/dist/codex-rs/utils/string.js.map +1 -0
- package/dist/common-CTyph5x8.d.ts +40 -0
- package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
- package/dist/history-CfM-4V7b.d.ts +1654 -0
- package/dist/index-77U_Oc-a.d.ts +63 -0
- package/dist/index-CoDZosq0.d.ts +261 -0
- package/dist/index.d.ts +18 -7
- package/dist/index.js +16 -2
- package/dist/lib-nXlaKiS-.d.ts +48 -0
- package/dist/live-thread-BMvlflzM.d.ts +30 -0
- package/dist/merge-B_AWVmnI.d.ts +24 -0
- package/dist/mod-DYVLSWO4.d.ts +91 -0
- package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
- package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
- package/dist/protocol-mpBcYHrm.d.ts +1655 -0
- package/dist/react/index.d.ts +20 -52
- package/dist/react/index.js +16 -2
- package/dist/{remote-_6TDvg-g.d.ts → remote-ClZbq9KN.d.ts} +3 -1
- package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
- package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
- package/dist/runtime-Cm6ml53h.d.ts +528 -0
- package/dist/server/index.d.ts +29 -2416
- package/dist/server/index.js +13 -1
- package/dist/session-BRYzi8OT.d.ts +46 -0
- package/dist/shadcn/index.d.ts +1 -1
- package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
- package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
- package/dist/{store-GYldc9EJ.d.ts → store-AGRxhgQ3.d.ts} +2 -1
- package/dist/t3code/apps/web/components/chat.d.ts +508 -0
- package/dist/t3code/apps/web/components/chat.js +12 -0
- package/dist/t3code/apps/web/components/chat.js.map +1 -0
- package/dist/t3code/apps/web/index.d.ts +12 -0
- package/dist/t3code/apps/web/index.js +13 -0
- package/dist/t3code/apps/web/index.js.map +1 -0
- package/dist/testing/index.d.ts +9 -91
- package/dist/testing/index.js +13 -1
- package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
- package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
- package/dist/types-BTeabLYr.d.ts +126 -0
- package/package.json +65 -1
- package/dist/chat-runtime-D7wu_KbX.d.ts +0 -747
- package/dist/chunk-JLDH4U5L.js.map +0 -1
- package/dist/chunk-SVK6PLGO.js.map +0 -1
- package/dist/index-CB9la6xE.d.ts +0 -112
- package/dist/thread_event_store-B9CoQUIA.d.ts +0 -3868
|
@@ -1,747 +0,0 @@
|
|
|
1
|
-
import * as React$1 from 'react';
|
|
2
|
-
import { MutableRefObject, ReactNode, ComponentPropsWithRef, RefObject, ReactElement, ComponentProps } from 'react';
|
|
3
|
-
import { LegendListRef } from '@legendapp/list/react';
|
|
4
|
-
import { j as RequestId, k as ToolRequestUserInputQuestion, l as UserInput, m as UserMessageTurnItem, n as Turn, T as ThreadId, o as CollaborationMode, p as ThreadEventSnapshot, d as StoredThread, a as ServerRequest, D as DynamicToolCallRequest, q as RequestPermissionsEvent, r as TurnItem } from './thread_event_store-B9CoQUIA.js';
|
|
5
|
-
import { T as ToolRequestUserInputResponse, a as ThreadStartParams, b as TurnStartParams, C as CodexAppServer, R as Result, J as JSONRPCErrorError } from './session-DPhHN7RZ.js';
|
|
6
|
-
import * as zustand_middleware from 'zustand/middleware';
|
|
7
|
-
import * as zustand from 'zustand';
|
|
8
|
-
import { a as Sidebar, t as SidebarProvider } from './sidebar-DT2XoitN.js';
|
|
9
|
-
import { T as ThreadStore } from './store-GYldc9EJ.js';
|
|
10
|
-
|
|
11
|
-
type ThreadReader = Pick<ThreadStore, "loadHistory" | "readThread">;
|
|
12
|
-
|
|
13
|
-
type CodexModelOption = {
|
|
14
|
-
slug: string;
|
|
15
|
-
name: string;
|
|
16
|
-
shortName?: string;
|
|
17
|
-
subProvider?: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
type ProviderDriverKind = "codex" | (string & {});
|
|
21
|
-
type ProviderInstanceId = string;
|
|
22
|
-
type ProviderInstanceEntry = {
|
|
23
|
-
accentColor?: string;
|
|
24
|
-
continuationGroupKey?: string;
|
|
25
|
-
displayName: string;
|
|
26
|
-
driverKind: ProviderDriverKind;
|
|
27
|
-
instanceId: ProviderInstanceId;
|
|
28
|
-
isAvailable: boolean;
|
|
29
|
-
snapshot: {
|
|
30
|
-
message?: string | null;
|
|
31
|
-
};
|
|
32
|
-
status: "ready" | "warning" | "error" | "disabled" | "loading";
|
|
33
|
-
};
|
|
34
|
-
type CodexReasoningEffort = "low" | "medium" | "high" | "xhigh";
|
|
35
|
-
type CodexReasoningEffortOption = {
|
|
36
|
-
value: CodexReasoningEffort;
|
|
37
|
-
label: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
declare const defaultCodexModel = "gpt-5.5";
|
|
41
|
-
declare const defaultCodexReasoningEffort: CodexReasoningEffort;
|
|
42
|
-
declare const codexModelOptions: readonly CodexModelOption[];
|
|
43
|
-
declare const defaultCodexProviderInstance: ProviderInstanceEntry;
|
|
44
|
-
declare const codexReasoningEffortOptions: readonly CodexReasoningEffortOption[];
|
|
45
|
-
declare function resolveCodexModelOption(model: string): CodexModelOption;
|
|
46
|
-
declare function resolveCodexReasoningEffortOption(effort: string): CodexReasoningEffortOption;
|
|
47
|
-
declare function isCodexReasoningEffort(value: string): value is CodexReasoningEffort;
|
|
48
|
-
declare function resolveCodexReasoningEffortForModel(model: string, effort: string | null | undefined): CodexReasoningEffort;
|
|
49
|
-
|
|
50
|
-
type PendingUserInputQuestion = Omit<ToolRequestUserInputQuestion, "options"> & {
|
|
51
|
-
options: NonNullable<ToolRequestUserInputQuestion["options"]>;
|
|
52
|
-
};
|
|
53
|
-
type PendingUserInput = {
|
|
54
|
-
requestId: RequestId;
|
|
55
|
-
threadId: string;
|
|
56
|
-
turnId: string;
|
|
57
|
-
itemId: string;
|
|
58
|
-
questions: readonly PendingUserInputQuestion[];
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
type BuiltInComposerSlashCommand = "default" | "model" | "plan";
|
|
62
|
-
type ComposerSlashCommand = BuiltInComposerSlashCommand | (string & {});
|
|
63
|
-
|
|
64
|
-
type MentionBinding = {
|
|
65
|
-
mention: string;
|
|
66
|
-
path: string;
|
|
67
|
-
};
|
|
68
|
-
type MentionBindingRange = {
|
|
69
|
-
binding: MentionBinding;
|
|
70
|
-
range: {
|
|
71
|
-
end: number;
|
|
72
|
-
start: number;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
declare function normalizeMentionBindingsForText(text: string, bindings: readonly MentionBinding[]): MentionBinding[];
|
|
76
|
-
declare function mentionBindingRangesForText(text: string, bindings: readonly MentionBinding[]): MentionBindingRange[];
|
|
77
|
-
declare function mentionBindingsAfterReplacement(input: {
|
|
78
|
-
currentBindings: readonly MentionBinding[];
|
|
79
|
-
insertedBinding: MentionBinding;
|
|
80
|
-
nextText: string;
|
|
81
|
-
replacement: string;
|
|
82
|
-
rangeEnd: number;
|
|
83
|
-
rangeStart: number;
|
|
84
|
-
text: string;
|
|
85
|
-
}): MentionBinding[];
|
|
86
|
-
|
|
87
|
-
type ComposerMentionTarget = {
|
|
88
|
-
binding: MentionBinding;
|
|
89
|
-
displayName: string;
|
|
90
|
-
label: string;
|
|
91
|
-
mention: string;
|
|
92
|
-
path: string;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
type ContextWindowSnapshot = {
|
|
96
|
-
cachedInputTokens: number | null;
|
|
97
|
-
compactsAutomatically: boolean;
|
|
98
|
-
durationMs: number | null;
|
|
99
|
-
inputTokens: number | null;
|
|
100
|
-
lastCachedInputTokens: number | null;
|
|
101
|
-
lastInputTokens: number | null;
|
|
102
|
-
lastOutputTokens: number | null;
|
|
103
|
-
lastReasoningOutputTokens: number | null;
|
|
104
|
-
lastUsedTokens: number | null;
|
|
105
|
-
maxTokens: number | null;
|
|
106
|
-
outputTokens: number | null;
|
|
107
|
-
reasoningOutputTokens: number | null;
|
|
108
|
-
remainingPercentage: number | null;
|
|
109
|
-
remainingTokens: number | null;
|
|
110
|
-
toolUses: number | null;
|
|
111
|
-
totalProcessedTokens: number | null;
|
|
112
|
-
updatedAt: string;
|
|
113
|
-
usedPercentage: number | null;
|
|
114
|
-
usedTokens: number;
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
type RealtimeConversationPhase = "Inactive" | "Starting" | "Active" | "Stopping";
|
|
118
|
-
type RealtimeConversationUiState = {
|
|
119
|
-
disabled?: boolean;
|
|
120
|
-
error?: string | null;
|
|
121
|
-
phase: RealtimeConversationPhase;
|
|
122
|
-
realtimeSessionId?: string | null;
|
|
123
|
-
requestedClose: boolean;
|
|
124
|
-
transport: "webrtc";
|
|
125
|
-
onStart: () => void;
|
|
126
|
-
onStop: () => void;
|
|
127
|
-
};
|
|
128
|
-
type RealtimeConversationControlState = {
|
|
129
|
-
action: "start" | "stop";
|
|
130
|
-
isActive: boolean;
|
|
131
|
-
isBusy: boolean;
|
|
132
|
-
label: string;
|
|
133
|
-
title: string;
|
|
134
|
-
};
|
|
135
|
-
declare function isRealtimeConversationLive(phase: RealtimeConversationPhase): boolean;
|
|
136
|
-
declare function getRealtimeConversationControlState(realtimeConversation: Pick<RealtimeConversationUiState, "error" | "phase" | "requestedClose">): RealtimeConversationControlState;
|
|
137
|
-
declare class RecordingMeterState {
|
|
138
|
-
private readonly history;
|
|
139
|
-
private env;
|
|
140
|
-
private noiseEma;
|
|
141
|
-
nextText(peak: number): string;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
interface ComposerImageAttachment {
|
|
145
|
-
id: string;
|
|
146
|
-
file: File;
|
|
147
|
-
name: string;
|
|
148
|
-
type: string;
|
|
149
|
-
size: number;
|
|
150
|
-
previewUrl: string | null;
|
|
151
|
-
}
|
|
152
|
-
interface ExpandedImageItem {
|
|
153
|
-
src: string;
|
|
154
|
-
name: string;
|
|
155
|
-
}
|
|
156
|
-
interface ExpandedImagePreview {
|
|
157
|
-
images: ExpandedImageItem[];
|
|
158
|
-
index: number;
|
|
159
|
-
}
|
|
160
|
-
interface PersistedComposerDraftImageAttachment {
|
|
161
|
-
id: string;
|
|
162
|
-
name: string;
|
|
163
|
-
type: string;
|
|
164
|
-
size: number;
|
|
165
|
-
dataUrl: string;
|
|
166
|
-
}
|
|
167
|
-
interface ComposerImageValidationResult {
|
|
168
|
-
accepted: File[];
|
|
169
|
-
error: string | null;
|
|
170
|
-
}
|
|
171
|
-
declare const WORKSPACE_CHAT_MAX_IMAGE_ATTACHMENTS = 8;
|
|
172
|
-
declare const WORKSPACE_CHAT_MAX_IMAGE_BYTES: number;
|
|
173
|
-
declare function isAcceptedComposerImageFile(file: File): boolean;
|
|
174
|
-
declare function validateComposerImageFiles(input: {
|
|
175
|
-
currentCount?: number;
|
|
176
|
-
files: Iterable<File>;
|
|
177
|
-
maxCount?: number;
|
|
178
|
-
maxSizeBytes?: number;
|
|
179
|
-
}): ComposerImageValidationResult;
|
|
180
|
-
declare function createComposerImageAttachments(files: Iterable<File>, options?: {
|
|
181
|
-
createId?: () => string;
|
|
182
|
-
createObjectURL?: (file: File) => string;
|
|
183
|
-
}): ComposerImageAttachment[];
|
|
184
|
-
declare function persistComposerDraftAttachments(attachments: Iterable<ComposerImageAttachment>, readFileAsDataUrl?: (file: File) => Promise<string>): Promise<PersistedComposerDraftImageAttachment[]>;
|
|
185
|
-
declare function restoreComposerDraftAttachments(attachments: Iterable<PersistedComposerDraftImageAttachment>, options?: {
|
|
186
|
-
createObjectURL?: (file: File) => string;
|
|
187
|
-
}): ComposerImageAttachment[];
|
|
188
|
-
declare function revokeComposerImageAttachments(attachments: Iterable<ComposerImageAttachment>, revokeObjectURL?: (url: string) => void): void;
|
|
189
|
-
declare function buildExpandedImagePreview(attachments: ReadonlyArray<ComposerImageAttachment>, selectedAttachmentId: string): ExpandedImagePreview | null;
|
|
190
|
-
|
|
191
|
-
interface ComposerDraftState {
|
|
192
|
-
prompt: string;
|
|
193
|
-
model: string | null;
|
|
194
|
-
effort: CodexReasoningEffort | null;
|
|
195
|
-
images: ComposerImageAttachment[];
|
|
196
|
-
persistedImages: PersistedComposerDraftImageAttachment[];
|
|
197
|
-
}
|
|
198
|
-
type ComposerDraftKey = string;
|
|
199
|
-
type ComposerDraftStoreState = {
|
|
200
|
-
draftsByKey: Record<string, ComposerDraftState>;
|
|
201
|
-
favoriteModels: string[];
|
|
202
|
-
stickyEffort: CodexReasoningEffort | null;
|
|
203
|
-
stickyModel: string | null;
|
|
204
|
-
addImages: (key: ComposerDraftKey, images: ComposerImageAttachment[]) => void;
|
|
205
|
-
clearComposerContent: (key: ComposerDraftKey) => void;
|
|
206
|
-
clearDraft: (key: ComposerDraftKey) => void;
|
|
207
|
-
ensureDraft: (key: ComposerDraftKey) => ComposerDraftState;
|
|
208
|
-
getDraft: (key: ComposerDraftKey) => ComposerDraftState;
|
|
209
|
-
removeImage: (key: ComposerDraftKey, imageId: string) => void;
|
|
210
|
-
setEffort: (key: ComposerDraftKey, effort: CodexReasoningEffort | null) => void;
|
|
211
|
-
setFavoriteModels: (models: string[]) => void;
|
|
212
|
-
setModel: (key: ComposerDraftKey, model: string | null) => void;
|
|
213
|
-
setPrompt: (key: ComposerDraftKey, prompt: string) => void;
|
|
214
|
-
syncPersistedImages: (key: ComposerDraftKey, images: PersistedComposerDraftImageAttachment[]) => void;
|
|
215
|
-
};
|
|
216
|
-
declare function assistantComposerDraftKey(input: {
|
|
217
|
-
scope: string;
|
|
218
|
-
threadId: string | null;
|
|
219
|
-
}): ComposerDraftKey;
|
|
220
|
-
declare function resolveDraftModel(draft: Pick<ComposerDraftState, "model">): string;
|
|
221
|
-
declare function resolveDraftEffort(draft: Pick<ComposerDraftState, "effort">, model?: string): CodexReasoningEffort;
|
|
222
|
-
declare const useComposerDraftStore: zustand.UseBoundStore<Omit<zustand.StoreApi<ComposerDraftStoreState>, "setState" | "persist"> & {
|
|
223
|
-
setState(partial: ComposerDraftStoreState | Partial<ComposerDraftStoreState> | ((state: ComposerDraftStoreState) => ComposerDraftStoreState | Partial<ComposerDraftStoreState>), replace?: false | undefined): unknown;
|
|
224
|
-
setState(state: ComposerDraftStoreState | ((state: ComposerDraftStoreState) => ComposerDraftStoreState), replace: true): unknown;
|
|
225
|
-
persist: {
|
|
226
|
-
setOptions: (options: Partial<zustand_middleware.PersistOptions<ComposerDraftStoreState, unknown, unknown>>) => void;
|
|
227
|
-
clearStorage: () => void;
|
|
228
|
-
rehydrate: () => Promise<void> | void;
|
|
229
|
-
hasHydrated: () => boolean;
|
|
230
|
-
onHydrate: (fn: (state: ComposerDraftStoreState) => void) => () => void;
|
|
231
|
-
onFinishHydration: (fn: (state: ComposerDraftStoreState) => void) => () => void;
|
|
232
|
-
getOptions: () => Partial<zustand_middleware.PersistOptions<ComposerDraftStoreState, unknown, unknown>>;
|
|
233
|
-
};
|
|
234
|
-
}>;
|
|
235
|
-
declare function useComposerThreadDraft(key: ComposerDraftKey): ComposerDraftState;
|
|
236
|
-
|
|
237
|
-
type ChatComposerSubmitPayload = {
|
|
238
|
-
files: File[];
|
|
239
|
-
effort: CodexReasoningEffort;
|
|
240
|
-
items: UserInput[];
|
|
241
|
-
mentionBindings: MentionBinding[];
|
|
242
|
-
model: string;
|
|
243
|
-
text: string;
|
|
244
|
-
};
|
|
245
|
-
type ChatComposerInteractionMode = "default" | "plan";
|
|
246
|
-
type ChatComposerRuntimeMode = "approval-required" | "auto-accept-edits" | "full-access";
|
|
247
|
-
type ChatComposerCommand = {
|
|
248
|
-
description: string;
|
|
249
|
-
disabled?: boolean;
|
|
250
|
-
group?: string;
|
|
251
|
-
label?: string;
|
|
252
|
-
name: ComposerSlashCommand;
|
|
253
|
-
unavailableReason?: string;
|
|
254
|
-
};
|
|
255
|
-
type ChatComposerSkill = {
|
|
256
|
-
description?: string;
|
|
257
|
-
disabled?: boolean;
|
|
258
|
-
label?: string;
|
|
259
|
-
name: string;
|
|
260
|
-
unavailableReason?: string;
|
|
261
|
-
};
|
|
262
|
-
type ChatComposerHandle = {
|
|
263
|
-
clear: () => void;
|
|
264
|
-
focusAt: (cursor: number) => void;
|
|
265
|
-
focusAtEnd: () => void;
|
|
266
|
-
getSendContext: () => ChatComposerSubmitPayload;
|
|
267
|
-
insertTextAtCursor: (text: string, options?: {
|
|
268
|
-
source?: "manual" | "realtime";
|
|
269
|
-
}) => void;
|
|
270
|
-
insertRecordingMeterPlaceholder: (text: string) => string;
|
|
271
|
-
readSnapshot: () => {
|
|
272
|
-
cursor: number;
|
|
273
|
-
expandedCursor: number;
|
|
274
|
-
value: string;
|
|
275
|
-
};
|
|
276
|
-
removeRecordingMeterPlaceholder: (id: string) => void;
|
|
277
|
-
replaceRecordingMeterPlaceholder: (id: string, text: string) => void;
|
|
278
|
-
resetCursorState: (options?: {
|
|
279
|
-
cursor?: number;
|
|
280
|
-
detectTrigger?: boolean;
|
|
281
|
-
prompt?: string;
|
|
282
|
-
}) => void;
|
|
283
|
-
setDraft: (draft: {
|
|
284
|
-
mentionBindings?: MentionBinding[];
|
|
285
|
-
message: string;
|
|
286
|
-
}) => void;
|
|
287
|
-
submit: () => void;
|
|
288
|
-
updateRecordingMeterInPlace: (id: string, text: string) => boolean;
|
|
289
|
-
};
|
|
290
|
-
declare const ChatComposer: React$1.ForwardRefExoticComponent<{
|
|
291
|
-
className?: string;
|
|
292
|
-
disabled?: boolean;
|
|
293
|
-
draftKey: ComposerDraftKey;
|
|
294
|
-
editorAriaLabel?: string;
|
|
295
|
-
isConnecting?: boolean;
|
|
296
|
-
isEnvironmentUnavailable?: boolean;
|
|
297
|
-
isRunning?: boolean;
|
|
298
|
-
isSending?: boolean;
|
|
299
|
-
interactionMode?: ChatComposerInteractionMode;
|
|
300
|
-
contextWindow?: ContextWindowSnapshot | null;
|
|
301
|
-
mentionRefs: ComposerMentionTarget[];
|
|
302
|
-
modelOptions?: readonly CodexModelOption[];
|
|
303
|
-
pendingUserInput?: PendingUserInput | null;
|
|
304
|
-
pendingRequestDisabled?: boolean;
|
|
305
|
-
placeholder?: string;
|
|
306
|
-
planFollowUpTitle?: string | null;
|
|
307
|
-
planSidebarLabel?: string;
|
|
308
|
-
planSidebarOpen?: boolean;
|
|
309
|
-
realtimeConversation?: RealtimeConversationUiState | null;
|
|
310
|
-
runtimeMode?: ChatComposerRuntimeMode;
|
|
311
|
-
showPlanFollowUpPrompt?: boolean;
|
|
312
|
-
showInteractionModeToggle?: boolean;
|
|
313
|
-
showPlanToggle?: boolean;
|
|
314
|
-
composerCommands?: readonly ChatComposerCommand[];
|
|
315
|
-
composerSkills?: readonly ChatComposerSkill[];
|
|
316
|
-
onCommand?: (command: ComposerSlashCommand) => void;
|
|
317
|
-
onComposerError?: (message: string) => void;
|
|
318
|
-
onImplementPlanInNewThread?: () => void;
|
|
319
|
-
onRuntimeModeChange?: (mode: ChatComposerRuntimeMode) => void;
|
|
320
|
-
onToggleInteractionMode?: () => void;
|
|
321
|
-
onTogglePlanSidebar?: () => void;
|
|
322
|
-
onPendingRequestDismiss?: () => void;
|
|
323
|
-
onPendingRequestSubmit?: (response: ToolRequestUserInputResponse) => boolean | void;
|
|
324
|
-
onInterrupt: () => void;
|
|
325
|
-
scheduleStickToBottom?: () => void;
|
|
326
|
-
shouldAutoScrollRef?: MutableRefObject<boolean>;
|
|
327
|
-
onSend: () => void | Promise<void>;
|
|
328
|
-
} & React$1.RefAttributes<ChatComposerHandle>>;
|
|
329
|
-
|
|
330
|
-
type ComposerBannerStackItem = {
|
|
331
|
-
id: string;
|
|
332
|
-
title: ReactNode;
|
|
333
|
-
description?: ReactNode;
|
|
334
|
-
action?: {
|
|
335
|
-
label: string;
|
|
336
|
-
onClick: () => void;
|
|
337
|
-
};
|
|
338
|
-
actions?: ReactNode;
|
|
339
|
-
dismissLabel?: string;
|
|
340
|
-
icon?: ReactNode;
|
|
341
|
-
onDismiss?: () => void;
|
|
342
|
-
variant?: "error" | "info" | "success" | "warning";
|
|
343
|
-
tone?: "default" | "destructive";
|
|
344
|
-
};
|
|
345
|
-
|
|
346
|
-
type MessagesTimelineProps = {
|
|
347
|
-
activeTurnStartedAt: string | null;
|
|
348
|
-
errors: string[];
|
|
349
|
-
isWorking: boolean;
|
|
350
|
-
listRef: React.RefObject<LegendListRef | null>;
|
|
351
|
-
onImageExpand: (preview: ExpandedImagePreview) => void;
|
|
352
|
-
onIsAtEndChange: (isAtEnd: boolean) => void;
|
|
353
|
-
optimisticUserMessages: readonly UserMessageTurnItem[];
|
|
354
|
-
runtimeError: string | null;
|
|
355
|
-
turns: readonly Turn[];
|
|
356
|
-
warnings: string[];
|
|
357
|
-
};
|
|
358
|
-
|
|
359
|
-
type ChatViewRenderComposerControls = {
|
|
360
|
-
prepareForOptimisticAppend: () => Promise<void>;
|
|
361
|
-
scheduleStickToBottom: () => void;
|
|
362
|
-
};
|
|
363
|
-
type ChatViewProps = {
|
|
364
|
-
actions?: ReactNode;
|
|
365
|
-
bannerItems?: readonly ComposerBannerStackItem[];
|
|
366
|
-
className?: string;
|
|
367
|
-
composer: ReactNode;
|
|
368
|
-
headerLeading?: ReactNode;
|
|
369
|
-
listRef: React.RefObject<LegendListRef | null>;
|
|
370
|
-
subtitle?: ReactNode;
|
|
371
|
-
threadKey: string;
|
|
372
|
-
timeline: Omit<MessagesTimelineProps, "listRef" | "onImageExpand" | "onIsAtEndChange">;
|
|
373
|
-
title: ReactNode;
|
|
374
|
-
onControlsChange?: (controls: ChatViewRenderComposerControls | null) => void;
|
|
375
|
-
onIsAtEndChange?: (isAtEnd: boolean) => void;
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
type ProviderStatus = {
|
|
379
|
-
displayName?: string | null;
|
|
380
|
-
driver?: string | null;
|
|
381
|
-
message?: string | null;
|
|
382
|
-
status: "disabled" | "error" | "limited" | "ready" | "warning";
|
|
383
|
-
};
|
|
384
|
-
|
|
385
|
-
type CodexChatLifecycleBuildThreadStartParamsInput = {
|
|
386
|
-
threadId: ThreadId;
|
|
387
|
-
};
|
|
388
|
-
type CodexChatLifecycleThreadStartParams = ThreadStartParams & {
|
|
389
|
-
threadId?: ThreadId | string;
|
|
390
|
-
};
|
|
391
|
-
type CodexChatLifecycleBuildTurnStartParamsInput = {
|
|
392
|
-
clientMessageId: string;
|
|
393
|
-
imageUrls: string[];
|
|
394
|
-
interactionMode?: "default" | "plan";
|
|
395
|
-
runtimeMode?: "approval-required" | "auto-accept-edits" | "full-access";
|
|
396
|
-
sendContext: ChatComposerSubmitPayload;
|
|
397
|
-
threadId: ThreadId;
|
|
398
|
-
};
|
|
399
|
-
type CodexChatLifecycleTurnStartParams = TurnStartParams & {
|
|
400
|
-
collaborationMode?: CollaborationMode;
|
|
401
|
-
collaboration_mode?: CollaborationMode;
|
|
402
|
-
clientMessageId?: string;
|
|
403
|
-
};
|
|
404
|
-
type CodexChatLifecycleSendControls = {
|
|
405
|
-
clearComposer: () => void;
|
|
406
|
-
prepareForOptimisticAppend: () => Promise<void>;
|
|
407
|
-
restoreComposer: (sendContext: ChatComposerSubmitPayload) => void;
|
|
408
|
-
};
|
|
409
|
-
type CodexChatLifecycleSendOptions = {
|
|
410
|
-
interactionMode?: "default" | "plan";
|
|
411
|
-
runtimeMode?: "approval-required" | "auto-accept-edits" | "full-access";
|
|
412
|
-
};
|
|
413
|
-
type CodexChatLifecycleOptions = {
|
|
414
|
-
buildThreadStartParams?: (input: CodexChatLifecycleBuildThreadStartParamsInput) => CodexChatLifecycleThreadStartParams;
|
|
415
|
-
buildTurnStartParams?: (input: CodexChatLifecycleBuildTurnStartParamsInput) => CodexChatLifecycleTurnStartParams;
|
|
416
|
-
connectOnMount?: boolean;
|
|
417
|
-
initialState?: ThreadEventSnapshot | null;
|
|
418
|
-
isRecoverableConnectionError?: (error: Error) => boolean;
|
|
419
|
-
onActiveThread?: (thread: StoredThread | null) => void;
|
|
420
|
-
onRuntimeError?: (error: Error) => void;
|
|
421
|
-
onServerRequest?: (request: ServerRequest) => void;
|
|
422
|
-
onState?: (state: ThreadEventSnapshot | null) => void;
|
|
423
|
-
onSubmittedUserMessage?: (state: ThreadEventSnapshot) => void;
|
|
424
|
-
onThreadListChanged?: () => void;
|
|
425
|
-
onThreadStarted?: (state: ThreadEventSnapshot) => void;
|
|
426
|
-
appServer: CodexAppServer;
|
|
427
|
-
threadReader?: ThreadReader;
|
|
428
|
-
threadId: ThreadId | string;
|
|
429
|
-
};
|
|
430
|
-
declare function createDefaultTurnStartParams({ clientMessageId, imageUrls, interactionMode, runtimeMode, sendContext, threadId, }: CodexChatLifecycleBuildTurnStartParamsInput): CodexChatLifecycleTurnStartParams;
|
|
431
|
-
type CodexChatLifecycle = {
|
|
432
|
-
activeThread: StoredThread | null;
|
|
433
|
-
activeWorkStartedAt: string | null;
|
|
434
|
-
assistantStreaming: boolean;
|
|
435
|
-
compact: () => Promise<boolean>;
|
|
436
|
-
connectionStatus: ThreadEventSnapshot["connectionStatus"] | "idle";
|
|
437
|
-
interrupt: () => Promise<boolean>;
|
|
438
|
-
isSendBusy: boolean;
|
|
439
|
-
isSending: boolean;
|
|
440
|
-
isWorking: boolean;
|
|
441
|
-
pendingPermissionRequestActive: boolean;
|
|
442
|
-
pendingUserInputActive: boolean;
|
|
443
|
-
reconnect: () => void;
|
|
444
|
-
runtimeError: string | null;
|
|
445
|
-
sendComposerMessage: (sendContext: ChatComposerSubmitPayload, controls: CodexChatLifecycleSendControls, options?: CodexChatLifecycleSendOptions) => Promise<void>;
|
|
446
|
-
resolveServerRequest: (requestId: RequestId, response: Result) => Promise<boolean>;
|
|
447
|
-
rejectServerRequest: (requestId: RequestId, error: JSONRPCErrorError) => Promise<boolean>;
|
|
448
|
-
threadSnapshot: ThreadEventSnapshot | null;
|
|
449
|
-
threadId: ThreadId;
|
|
450
|
-
turnRunning: boolean;
|
|
451
|
-
visibleOptimisticUserMessages: readonly UserMessageTurnItem[];
|
|
452
|
-
};
|
|
453
|
-
declare function useCodexChatLifecycle(options: CodexChatLifecycleOptions): CodexChatLifecycle;
|
|
454
|
-
|
|
455
|
-
type CodexChatInteractionMode = "default" | "plan";
|
|
456
|
-
type CodexChatProposedPlan = {
|
|
457
|
-
id: string;
|
|
458
|
-
planMarkdown: string;
|
|
459
|
-
title: string | null;
|
|
460
|
-
turnId: string;
|
|
461
|
-
};
|
|
462
|
-
type CodexChatPendingUserInputRequest = {
|
|
463
|
-
kind: "userInput";
|
|
464
|
-
itemId: string;
|
|
465
|
-
pendingUserInput: PendingUserInput;
|
|
466
|
-
request: Extract<ServerRequest, {
|
|
467
|
-
method: "item/tool/requestUserInput";
|
|
468
|
-
}>;
|
|
469
|
-
requestId: RequestId;
|
|
470
|
-
threadId: string;
|
|
471
|
-
turnId: string;
|
|
472
|
-
};
|
|
473
|
-
type CodexChatPendingPermissionRequest = {
|
|
474
|
-
kind: "permissions";
|
|
475
|
-
composerRequest: RequestPermissionsEvent;
|
|
476
|
-
request: Extract<ServerRequest, {
|
|
477
|
-
method: "item/permissions/requestApproval";
|
|
478
|
-
}>;
|
|
479
|
-
requestId: RequestId;
|
|
480
|
-
threadId: string;
|
|
481
|
-
turnId: string | null;
|
|
482
|
-
};
|
|
483
|
-
type CodexChatPendingDynamicToolCallRequest = {
|
|
484
|
-
kind: "dynamicToolCall";
|
|
485
|
-
compatRequest: DynamicToolCallRequest;
|
|
486
|
-
request: Extract<ServerRequest, {
|
|
487
|
-
method: "item/tool/call";
|
|
488
|
-
}>;
|
|
489
|
-
requestId: RequestId;
|
|
490
|
-
threadId: string;
|
|
491
|
-
turnId: string | null;
|
|
492
|
-
};
|
|
493
|
-
type CodexChatPendingMcpElicitationRequest = {
|
|
494
|
-
kind: "mcpElicitation";
|
|
495
|
-
request: Extract<ServerRequest, {
|
|
496
|
-
method: "mcpServer/elicitation/request";
|
|
497
|
-
}>;
|
|
498
|
-
requestId: RequestId;
|
|
499
|
-
threadId: string | null;
|
|
500
|
-
turnId: string | null;
|
|
501
|
-
};
|
|
502
|
-
type CodexChatPendingCommandApprovalRequest = {
|
|
503
|
-
kind: "commandApproval";
|
|
504
|
-
request: Extract<ServerRequest, {
|
|
505
|
-
method: "item/commandExecution/requestApproval";
|
|
506
|
-
}>;
|
|
507
|
-
requestId: RequestId;
|
|
508
|
-
threadId: string;
|
|
509
|
-
turnId: string | null;
|
|
510
|
-
};
|
|
511
|
-
type CodexChatPendingFileChangeApprovalRequest = {
|
|
512
|
-
kind: "fileChangeApproval";
|
|
513
|
-
request: Extract<ServerRequest, {
|
|
514
|
-
method: "item/fileChange/requestApproval";
|
|
515
|
-
}>;
|
|
516
|
-
requestId: RequestId;
|
|
517
|
-
threadId: string;
|
|
518
|
-
turnId: string | null;
|
|
519
|
-
};
|
|
520
|
-
type CodexChatPendingAuthRefreshRequest = {
|
|
521
|
-
kind: "chatgptAuthTokensRefresh";
|
|
522
|
-
request: Extract<ServerRequest, {
|
|
523
|
-
method: "account/chatgptAuthTokens/refresh";
|
|
524
|
-
}>;
|
|
525
|
-
requestId: RequestId;
|
|
526
|
-
threadId: null;
|
|
527
|
-
turnId: null;
|
|
528
|
-
};
|
|
529
|
-
type CodexChatPendingApplyPatchApprovalRequest = {
|
|
530
|
-
kind: "applyPatchApproval";
|
|
531
|
-
request: Extract<ServerRequest, {
|
|
532
|
-
method: "applyPatchApproval";
|
|
533
|
-
}>;
|
|
534
|
-
requestId: RequestId;
|
|
535
|
-
threadId: string;
|
|
536
|
-
turnId: null;
|
|
537
|
-
};
|
|
538
|
-
type CodexChatPendingExecCommandApprovalRequest = {
|
|
539
|
-
kind: "execCommandApproval";
|
|
540
|
-
request: Extract<ServerRequest, {
|
|
541
|
-
method: "execCommandApproval";
|
|
542
|
-
}>;
|
|
543
|
-
requestId: RequestId;
|
|
544
|
-
threadId: string;
|
|
545
|
-
turnId: null;
|
|
546
|
-
};
|
|
547
|
-
type CodexChatPendingRequest = CodexChatPendingApplyPatchApprovalRequest | CodexChatPendingAuthRefreshRequest | CodexChatPendingCommandApprovalRequest | CodexChatPendingDynamicToolCallRequest | CodexChatPendingExecCommandApprovalRequest | CodexChatPendingFileChangeApprovalRequest | CodexChatPendingMcpElicitationRequest | CodexChatPendingPermissionRequest | CodexChatPendingUserInputRequest;
|
|
548
|
-
type CodexChatRenderLifecycleState = {
|
|
549
|
-
activeWorkStartedAt: string | null;
|
|
550
|
-
isWorking: boolean;
|
|
551
|
-
runtimeError: string | null;
|
|
552
|
-
visibleOptimisticUserMessages: readonly UserMessageTurnItem[];
|
|
553
|
-
};
|
|
554
|
-
type CodexChatPendingRequestRenderContext = {
|
|
555
|
-
defaultNode: ReactNode;
|
|
556
|
-
reject: (message?: string | JSONRPCErrorError) => Promise<boolean>;
|
|
557
|
-
request: CodexChatPendingRequest;
|
|
558
|
-
resolve: (result: Result) => Promise<boolean>;
|
|
559
|
-
state: CodexChatRenderState;
|
|
560
|
-
};
|
|
561
|
-
type CodexChatPendingUserInputRenderContext = {
|
|
562
|
-
defaultNode: ReactNode;
|
|
563
|
-
reject: (message?: string | JSONRPCErrorError) => Promise<boolean>;
|
|
564
|
-
request: CodexChatPendingUserInputRequest;
|
|
565
|
-
resolve: (result: Result) => Promise<boolean>;
|
|
566
|
-
state: CodexChatRenderState;
|
|
567
|
-
};
|
|
568
|
-
type CodexChatRenderStateInput = {
|
|
569
|
-
interactionMode?: CodexChatInteractionMode;
|
|
570
|
-
lifecycle?: Partial<CodexChatRenderLifecycleState>;
|
|
571
|
-
snapshot: ThreadEventSnapshot | null;
|
|
572
|
-
};
|
|
573
|
-
type CodexChatRenderState = {
|
|
574
|
-
activeProposedPlan: CodexChatProposedPlan | null;
|
|
575
|
-
activeTurnStartedAt: string | null;
|
|
576
|
-
banners: CodexChatRenderBanner[];
|
|
577
|
-
composer: CodexChatComposerRenderState;
|
|
578
|
-
errors: string[];
|
|
579
|
-
interactionMode: CodexChatInteractionMode;
|
|
580
|
-
items: TurnItem[];
|
|
581
|
-
isWorking: boolean;
|
|
582
|
-
optimisticUserMessages: readonly UserMessageTurnItem[];
|
|
583
|
-
pending_dynamic_tool_call_requests: DynamicToolCallRequest[];
|
|
584
|
-
pendingRequests: readonly CodexChatPendingRequest[];
|
|
585
|
-
pendingPermissionRequest: CodexChatPendingPermissionRequest | null;
|
|
586
|
-
pendingUserInputRequest: CodexChatPendingUserInputRequest | null;
|
|
587
|
-
runtimeError: string | null;
|
|
588
|
-
running_turn_ids: string[];
|
|
589
|
-
showPlanFollowUpPrompt: boolean;
|
|
590
|
-
timeline: Omit<MessagesTimelineProps, "listRef" | "onImageExpand" | "onIsAtEndChange">;
|
|
591
|
-
turns: Turn[];
|
|
592
|
-
warnings: string[];
|
|
593
|
-
};
|
|
594
|
-
type CodexChatComposerRenderState = {
|
|
595
|
-
contextWindow: ContextWindowSnapshot | null;
|
|
596
|
-
pendingUserInput: PendingUserInput | null;
|
|
597
|
-
pendingUserInputAdapter: CodexChatPendingUserInputRequest | null;
|
|
598
|
-
};
|
|
599
|
-
type CodexChatRenderBanner = {
|
|
600
|
-
description?: string;
|
|
601
|
-
id: string;
|
|
602
|
-
request?: CodexChatPendingRequest;
|
|
603
|
-
title: string;
|
|
604
|
-
tone?: "destructive";
|
|
605
|
-
variant: "error" | "info" | "success" | "warning";
|
|
606
|
-
};
|
|
607
|
-
declare function createCodexChatRenderState({ interactionMode, lifecycle, snapshot, }: CodexChatRenderStateInput): CodexChatRenderState;
|
|
608
|
-
|
|
609
|
-
type CodexChatViewComposerProps = ComponentPropsWithRef<typeof ChatComposer>;
|
|
610
|
-
type CodexChatComposerCommand = NonNullable<CodexChatViewComposerProps["composerCommands"]>[number];
|
|
611
|
-
type CodexChatComposerCommandName = CodexChatComposerCommand["name"];
|
|
612
|
-
type CodexChatComposerSkill = NonNullable<CodexChatViewComposerProps["composerSkills"]>[number];
|
|
613
|
-
type CodexChatModelOption = NonNullable<CodexChatViewComposerProps["modelOptions"]>[number];
|
|
614
|
-
type CodexChatProviderStatus = ProviderStatus;
|
|
615
|
-
type CodexChatRuntimeMode = ChatComposerRuntimeMode;
|
|
616
|
-
type CodexChatViewManualProps = Omit<ChatViewProps, "composer"> & {
|
|
617
|
-
composer: CodexChatViewComposerProps;
|
|
618
|
-
lifecycle?: never;
|
|
619
|
-
};
|
|
620
|
-
type CodexChatViewLifecycleProps = Omit<ChatViewProps, "composer" | "listRef" | "onControlsChange" | "onIsAtEndChange" | "threadKey" | "timeline" | "title"> & {
|
|
621
|
-
composerCommands?: CodexChatViewComposerProps["composerCommands"];
|
|
622
|
-
composerSkills?: CodexChatViewComposerProps["composerSkills"];
|
|
623
|
-
composerDraftKey?: string;
|
|
624
|
-
composerRef?: RefObject<ChatComposerHandle | null>;
|
|
625
|
-
editorAriaLabel?: string;
|
|
626
|
-
isEnvironmentUnavailable?: boolean;
|
|
627
|
-
defaultInteractionMode?: CodexChatInteractionMode;
|
|
628
|
-
defaultRuntimeMode?: CodexChatRuntimeMode;
|
|
629
|
-
interactionMode?: CodexChatInteractionMode;
|
|
630
|
-
listRef?: RefObject<LegendListRef | null>;
|
|
631
|
-
lifecycle: CodexChatLifecycleOptions;
|
|
632
|
-
mentionRefs?: CodexChatViewComposerProps["mentionRefs"];
|
|
633
|
-
modelOptions?: CodexChatViewComposerProps["modelOptions"];
|
|
634
|
-
placeholder?: string;
|
|
635
|
-
providerStatus?: CodexChatProviderStatus | null;
|
|
636
|
-
realtimeConversation?: CodexChatViewComposerProps["realtimeConversation"];
|
|
637
|
-
renderBannerItems?: (state: CodexChatRenderState) => readonly ComposerBannerStackItem[];
|
|
638
|
-
renderPendingRequest?: (context: CodexChatPendingRequestRenderContext) => ReactNode;
|
|
639
|
-
renderPendingUserInput?: (context: CodexChatPendingUserInputRenderContext) => ReactNode;
|
|
640
|
-
renderTimelineExtras?: (context: {
|
|
641
|
-
state: CodexChatRenderState;
|
|
642
|
-
}) => ReactNode;
|
|
643
|
-
showInteractionModeToggle?: boolean;
|
|
644
|
-
runtimeMode?: CodexChatRuntimeMode;
|
|
645
|
-
showPlanToggle?: boolean;
|
|
646
|
-
planSidebarLabel?: string;
|
|
647
|
-
planSidebarOpen?: boolean;
|
|
648
|
-
onCommand?: CodexChatViewComposerProps["onCommand"];
|
|
649
|
-
onComposerError?: (message: string | null) => void;
|
|
650
|
-
onControlsChange?: (controls: ChatViewRenderComposerControls | null) => void;
|
|
651
|
-
onIsAtEndChange?: (isAtEnd: boolean) => void;
|
|
652
|
-
onImplementProposedPlan?: (plan: CodexChatProposedPlan) => void;
|
|
653
|
-
onInteractionModeChange?: (mode: CodexChatInteractionMode) => void;
|
|
654
|
-
onRuntimeModeChange?: (mode: CodexChatRuntimeMode) => void;
|
|
655
|
-
onTogglePlanSidebar?: () => void;
|
|
656
|
-
threadKey?: string;
|
|
657
|
-
title?: ReactNode;
|
|
658
|
-
};
|
|
659
|
-
type CodexChatViewProps = CodexChatViewLifecycleProps | CodexChatViewManualProps;
|
|
660
|
-
declare function CodexChatView(props: CodexChatViewProps): ReactElement;
|
|
661
|
-
|
|
662
|
-
type CodexChatLifecyclePassthroughProps = Pick<CodexChatLifecycleOptions, "buildThreadStartParams" | "buildTurnStartParams" | "connectOnMount" | "initialState" | "isRecoverableConnectionError" | "onActiveThread" | "onRuntimeError" | "onServerRequest" | "onState" | "onSubmittedUserMessage" | "onThreadListChanged" | "onThreadStarted">;
|
|
663
|
-
type CodexChatProps = Omit<CodexChatViewLifecycleProps, "lifecycle"> & CodexChatLifecyclePassthroughProps & {
|
|
664
|
-
appServer: CodexAppServer;
|
|
665
|
-
threadId: ThreadId | string;
|
|
666
|
-
threadReader?: ThreadReader;
|
|
667
|
-
};
|
|
668
|
-
declare function CodexChat({ appServer, buildThreadStartParams, buildTurnStartParams, connectOnMount, initialState, isRecoverableConnectionError, onActiveThread, onRuntimeError, onServerRequest, onState, onSubmittedUserMessage, onThreadListChanged, onThreadStarted, threadId, threadReader, ...viewProps }: CodexChatProps): React$1.FunctionComponentElement<CodexChatViewProps>;
|
|
669
|
-
|
|
670
|
-
type CodexChatSidebarProps = ComponentProps<typeof Sidebar>;
|
|
671
|
-
declare function CodexChatSidebar(props: CodexChatSidebarProps): React$1.FunctionComponentElement<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
672
|
-
side?: "left" | "right";
|
|
673
|
-
variant?: "sidebar" | "floating" | "inset";
|
|
674
|
-
collapsible?: "offcanvas" | "icon" | "none";
|
|
675
|
-
}>;
|
|
676
|
-
type CodexChatLayoutProps = {
|
|
677
|
-
children: ReactNode;
|
|
678
|
-
sidebar?: ReactNode;
|
|
679
|
-
side?: CodexChatSidebarProps["side"];
|
|
680
|
-
collapsible?: CodexChatSidebarProps["collapsible"];
|
|
681
|
-
defaultOpen?: ComponentProps<typeof SidebarProvider>["defaultOpen"];
|
|
682
|
-
open?: ComponentProps<typeof SidebarProvider>["open"];
|
|
683
|
-
onOpenChange?: ComponentProps<typeof SidebarProvider>["onOpenChange"];
|
|
684
|
-
className?: ComponentProps<typeof SidebarProvider>["className"];
|
|
685
|
-
};
|
|
686
|
-
declare function CodexChatLayout({ children, className, collapsible, defaultOpen, onOpenChange, open, side, sidebar, }: CodexChatLayoutProps): React$1.FunctionComponentElement<React$1.FragmentProps> | React$1.FunctionComponentElement<React$1.ClassAttributes<HTMLDivElement> & React$1.HTMLAttributes<HTMLDivElement> & {
|
|
687
|
-
defaultOpen?: boolean;
|
|
688
|
-
open?: boolean;
|
|
689
|
-
onOpenChange?: (open: boolean) => void;
|
|
690
|
-
}>;
|
|
691
|
-
|
|
692
|
-
type MessagePart = {
|
|
693
|
-
type: "text";
|
|
694
|
-
text: string;
|
|
695
|
-
} | {
|
|
696
|
-
type: "image";
|
|
697
|
-
url: string;
|
|
698
|
-
} | {
|
|
699
|
-
type: "file";
|
|
700
|
-
name?: string;
|
|
701
|
-
url: string;
|
|
702
|
-
} | {
|
|
703
|
-
type: "tool-call";
|
|
704
|
-
input: unknown;
|
|
705
|
-
name: string;
|
|
706
|
-
toolCallId: string;
|
|
707
|
-
} | {
|
|
708
|
-
type: "tool-result";
|
|
709
|
-
output: unknown;
|
|
710
|
-
toolCallId: string;
|
|
711
|
-
};
|
|
712
|
-
type ChatMessage = {
|
|
713
|
-
id: string;
|
|
714
|
-
metadata?: Record<string, unknown>;
|
|
715
|
-
parts: MessagePart[];
|
|
716
|
-
role: "assistant" | "system" | "user";
|
|
717
|
-
};
|
|
718
|
-
type ChatRuntimeStatus = "error" | "idle" | "loading" | "ready" | "streaming" | "submitting";
|
|
719
|
-
type SendMessageInput = {
|
|
720
|
-
files?: FileList | File[] | MessagePart[];
|
|
721
|
-
metadata?: Record<string, unknown>;
|
|
722
|
-
text?: string;
|
|
723
|
-
};
|
|
724
|
-
type ChatRuntime = {
|
|
725
|
-
error: Error | null;
|
|
726
|
-
messages: ChatMessage[];
|
|
727
|
-
sendMessage(input: SendMessageInput): Promise<void>;
|
|
728
|
-
setThread(threadId: ThreadId | string | null): void;
|
|
729
|
-
status: ChatRuntimeStatus;
|
|
730
|
-
stop(): Promise<void>;
|
|
731
|
-
threadId: ThreadId | string | null;
|
|
732
|
-
threadSnapshot: ThreadEventSnapshot | null;
|
|
733
|
-
threadState: CodexChatRenderState | null;
|
|
734
|
-
};
|
|
735
|
-
type CodexChatRuntimeOptions = {
|
|
736
|
-
appServer: CodexAppServer;
|
|
737
|
-
threadReader?: ThreadReader;
|
|
738
|
-
threadId?: ThreadId | string;
|
|
739
|
-
};
|
|
740
|
-
type CodexChatProviderProps = CodexChatRuntimeOptions & {
|
|
741
|
-
children?: ReactNode;
|
|
742
|
-
};
|
|
743
|
-
declare function CodexChatProvider({ appServer, children, threadReader, threadId, }: CodexChatProviderProps): React$1.FunctionComponentElement<React$1.ProviderProps<ChatRuntime | null>>;
|
|
744
|
-
declare function useCodexChatRuntime(): ChatRuntime;
|
|
745
|
-
declare function useCodexChat(options: CodexChatRuntimeOptions): ChatRuntime;
|
|
746
|
-
|
|
747
|
-
export { type SendMessageInput as $, type CodexChatRenderState as A, type CodexChatRuntimeMode as B, CodexChat as C, type CodexChatRuntimeOptions as D, type CodexChatViewComposerProps as E, type CodexChatViewLifecycleProps as F, type CodexChatViewManualProps as G, type ChatViewRenderComposerControls as H, type CodexModelOption as I, type CodexReasoningEffort as J, type CodexReasoningEffortOption as K, type ComposerDraftKey as L, type MentionBinding as M, type ComposerDraftState as N, type ComposerImageAttachment as O, type ComposerImageValidationResult as P, type ExpandedImagePreview as Q, type MentionBindingRange as R, type MessagePart as S, type PersistedComposerDraftImageAttachment as T, type ProviderDriverKind as U, type ProviderInstanceEntry as V, type ProviderInstanceId as W, type RealtimeConversationControlState as X, type RealtimeConversationPhase as Y, type RealtimeConversationUiState as Z, RecordingMeterState as _, CodexChatLayout as a, type ThreadReader as a0, WORKSPACE_CHAT_MAX_IMAGE_ATTACHMENTS as a1, WORKSPACE_CHAT_MAX_IMAGE_BYTES as a2, assistantComposerDraftKey as a3, buildExpandedImagePreview as a4, codexModelOptions as a5, codexReasoningEffortOptions as a6, createCodexChatRenderState as a7, createComposerImageAttachments as a8, createDefaultTurnStartParams as a9, defaultCodexModel as aa, defaultCodexProviderInstance as ab, defaultCodexReasoningEffort as ac, getRealtimeConversationControlState as ad, isAcceptedComposerImageFile as ae, isCodexReasoningEffort as af, isRealtimeConversationLive as ag, mentionBindingRangesForText as ah, mentionBindingsAfterReplacement as ai, normalizeMentionBindingsForText as aj, persistComposerDraftAttachments as ak, resolveCodexModelOption as al, resolveCodexReasoningEffortForModel as am, resolveCodexReasoningEffortOption as an, resolveDraftEffort as ao, resolveDraftModel as ap, restoreComposerDraftAttachments as aq, revokeComposerImageAttachments as ar, useCodexChat as as, useCodexChatLifecycle as at, useCodexChatRuntime as au, useComposerDraftStore as av, useComposerThreadDraft as aw, validateComposerImageFiles as ax, type CodexChatLayoutProps as b, type CodexChatProps as c, CodexChatProvider as d, type CodexChatProviderProps as e, CodexChatSidebar as f, type CodexChatSidebarProps as g, CodexChatView as h, type CodexChatViewProps as i, type ChatComposerHandle as j, type ChatComposerSubmitPayload as k, type ChatMessage as l, type ChatRuntime as m, type ChatRuntimeStatus as n, type CodexChatComposerCommand as o, type CodexChatComposerCommandName as p, type CodexChatComposerSkill as q, type CodexChatInteractionMode as r, type CodexChatLifecycle as s, type CodexChatLifecycleOptions as t, type CodexChatModelOption as u, type CodexChatPendingRequest as v, type CodexChatPendingRequestRenderContext as w, type CodexChatPendingUserInputRenderContext as x, type CodexChatProposedPlan as y, type CodexChatProviderStatus as z };
|