@jrkropp/codex-js 0.1.1 → 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.
Files changed (132) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/ClientNotification-B6-FhXQf.d.ts +5 -0
  3. package/dist/{DynamicToolCallResponse-D2OVpa4p.d.ts → DynamicToolCallResponse-82DFjES2.d.ts} +1 -1
  4. package/dist/DynamicToolSpec-CfnhqAYK.d.ts +29 -0
  5. package/dist/PermissionsRequestApprovalResponse-DxzPPDRb.d.ts +55 -0
  6. package/dist/ProviderStatusBanner-BlP6lzwE.d.ts +441 -0
  7. package/dist/ServerRequest-B5cKVJjr.d.ts +2181 -0
  8. package/dist/{session-BO6EZNK7.d.ts → ThreadResumeResponse-DvmE1juU.d.ts} +3 -290
  9. package/dist/ToolRequestUserInputQuestion-CeZa5X1J.d.ts +23 -0
  10. package/dist/{ToolRequestUserInputResponse-Bxjlpgho.d.ts → ToolRequestUserInputResponse-zcPLwbiK.d.ts} +1 -1
  11. package/dist/TurnSteerResponse-0kBCfplh.d.ts +209 -0
  12. package/dist/WebSearchToolConfig-D3ep0625.d.ts +18 -0
  13. package/dist/chat-runtime-B6azJyKo.d.ts +381 -0
  14. package/dist/chunk-2DZRMCI2.js +1258 -0
  15. package/dist/chunk-2DZRMCI2.js.map +1 -0
  16. package/dist/chunk-4DPLJPB5.js +396 -0
  17. package/dist/chunk-4DPLJPB5.js.map +1 -0
  18. package/dist/chunk-5JMJ6OI5.js +3 -0
  19. package/dist/chunk-5JMJ6OI5.js.map +1 -0
  20. package/dist/chunk-6ZMJ34KE.js +1153 -0
  21. package/dist/chunk-6ZMJ34KE.js.map +1 -0
  22. package/dist/chunk-CGBS37IU.js +128 -0
  23. package/dist/chunk-CGBS37IU.js.map +1 -0
  24. package/dist/chunk-DCMKA2A6.js +18 -0
  25. package/dist/chunk-DCMKA2A6.js.map +1 -0
  26. package/dist/chunk-DYLHN3HG.js +937 -0
  27. package/dist/chunk-DYLHN3HG.js.map +1 -0
  28. package/dist/chunk-ILXA6HLX.js +1973 -0
  29. package/dist/chunk-ILXA6HLX.js.map +1 -0
  30. package/dist/{chunk-TZBLUZ2X.js → chunk-LWQNX4LI.js} +7811 -12696
  31. package/dist/chunk-LWQNX4LI.js.map +1 -0
  32. package/dist/{chunk-FFASNDXU.js → chunk-NCI4MAWZ.js} +317 -1967
  33. package/dist/chunk-NCI4MAWZ.js.map +1 -0
  34. package/dist/chunk-O44XP7LH.js +214 -0
  35. package/dist/chunk-O44XP7LH.js.map +1 -0
  36. package/dist/chunk-PST3ZWX2.js +555 -0
  37. package/dist/chunk-PST3ZWX2.js.map +1 -0
  38. package/dist/chunk-SYPHCDRD.js +1133 -0
  39. package/dist/chunk-SYPHCDRD.js.map +1 -0
  40. package/dist/chunk-V4BMZWBM.js +2401 -0
  41. package/dist/chunk-V4BMZWBM.js.map +1 -0
  42. package/dist/chunk-YHVCFD2D.js +117 -0
  43. package/dist/chunk-YHVCFD2D.js.map +1 -0
  44. package/dist/chunk-Z63UPBS3.js +152 -0
  45. package/dist/chunk-Z63UPBS3.js.map +1 -0
  46. package/dist/client/index.d.ts +16 -111
  47. package/dist/client/index.js +13 -1
  48. package/dist/codex-rs/app-server/index.d.ts +161 -0
  49. package/dist/codex-rs/app-server/index.js +13 -0
  50. package/dist/codex-rs/app-server/index.js.map +1 -0
  51. package/dist/codex-rs/app-server-protocol/index.d.ts +1722 -0
  52. package/dist/codex-rs/app-server-protocol/index.js +6 -0
  53. package/dist/codex-rs/app-server-protocol/index.js.map +1 -0
  54. package/dist/codex-rs/app-server-protocol/protocol.d.ts +19 -0
  55. package/dist/codex-rs/app-server-protocol/protocol.js +4 -0
  56. package/dist/codex-rs/app-server-protocol/protocol.js.map +1 -0
  57. package/dist/codex-rs/codex-api/index.d.ts +104 -0
  58. package/dist/codex-rs/codex-api/index.js +11 -0
  59. package/dist/codex-rs/codex-api/index.js.map +1 -0
  60. package/dist/codex-rs/config/index.d.ts +88 -0
  61. package/dist/codex-rs/config/index.js +4 -0
  62. package/dist/codex-rs/config/index.js.map +1 -0
  63. package/dist/codex-rs/core/config/index.d.ts +61 -0
  64. package/dist/codex-rs/core/config/index.js +5 -0
  65. package/dist/codex-rs/core/config/index.js.map +1 -0
  66. package/dist/codex-rs/core/index.d.ts +1393 -0
  67. package/dist/codex-rs/core/index.js +11 -0
  68. package/dist/codex-rs/core/index.js.map +1 -0
  69. package/dist/codex-rs/model-provider/index.d.ts +2 -0
  70. package/dist/codex-rs/model-provider/index.js +4 -0
  71. package/dist/codex-rs/model-provider/index.js.map +1 -0
  72. package/dist/codex-rs/models-manager/index.d.ts +2 -0
  73. package/dist/codex-rs/models-manager/index.js +4 -0
  74. package/dist/codex-rs/models-manager/index.js.map +1 -0
  75. package/dist/codex-rs/parity.d.ts +26 -0
  76. package/dist/codex-rs/parity.js +3 -0
  77. package/dist/codex-rs/parity.js.map +1 -0
  78. package/dist/codex-rs/thread-store/index.d.ts +5 -0
  79. package/dist/codex-rs/thread-store/index.js +4 -0
  80. package/dist/codex-rs/thread-store/index.js.map +1 -0
  81. package/dist/codex-rs/unsupported.d.ts +15 -0
  82. package/dist/codex-rs/unsupported.js +22 -0
  83. package/dist/codex-rs/unsupported.js.map +1 -0
  84. package/dist/codex-rs/utils/output-truncation.d.ts +21 -0
  85. package/dist/codex-rs/utils/output-truncation.js +4 -0
  86. package/dist/codex-rs/utils/output-truncation.js.map +1 -0
  87. package/dist/codex-rs/utils/string.d.ts +7 -0
  88. package/dist/codex-rs/utils/string.js +3 -0
  89. package/dist/codex-rs/utils/string.js.map +1 -0
  90. package/dist/common-CTyph5x8.d.ts +40 -0
  91. package/dist/event-mapping-CbISdQ1D.d.ts +43 -0
  92. package/dist/history-CfM-4V7b.d.ts +1654 -0
  93. package/dist/index-77U_Oc-a.d.ts +63 -0
  94. package/dist/index-CoDZosq0.d.ts +261 -0
  95. package/dist/index.d.ts +18 -8
  96. package/dist/index.js +16 -2
  97. package/dist/lib-nXlaKiS-.d.ts +48 -0
  98. package/dist/live-thread-BMvlflzM.d.ts +30 -0
  99. package/dist/merge-B_AWVmnI.d.ts +24 -0
  100. package/dist/mod-DYVLSWO4.d.ts +91 -0
  101. package/dist/plan-mode-Cv6KWb_S.d.ts +14 -0
  102. package/dist/proposed-plan-DpN1ma0Y.d.ts +53 -0
  103. package/dist/protocol-mpBcYHrm.d.ts +1655 -0
  104. package/dist/react/index.d.ts +20 -53
  105. package/dist/react/index.js +16 -2
  106. package/dist/{remote-DMPfepa9.d.ts → remote-ClZbq9KN.d.ts} +3 -1
  107. package/dist/rendered-thread-AOxw3V5b.d.ts +29 -0
  108. package/dist/responses_websocket-BhxSgCzK.d.ts +183 -0
  109. package/dist/runtime-Cm6ml53h.d.ts +528 -0
  110. package/dist/server/index.d.ts +29 -1999
  111. package/dist/server/index.js +13 -1
  112. package/dist/session-BRYzi8OT.d.ts +46 -0
  113. package/dist/shadcn/index.d.ts +1 -1
  114. package/dist/{sidebar-DT2XoitN.d.ts → sidebar-DMMij22z.d.ts} +1 -1
  115. package/dist/spec_plan_types-CmsJ-Tfn.d.ts +260 -0
  116. package/dist/{store-H2cQxdpe.d.ts → store-AGRxhgQ3.d.ts} +2 -1
  117. package/dist/t3code/apps/web/components/chat.d.ts +508 -0
  118. package/dist/t3code/apps/web/components/chat.js +12 -0
  119. package/dist/t3code/apps/web/components/chat.js.map +1 -0
  120. package/dist/t3code/apps/web/index.d.ts +12 -0
  121. package/dist/t3code/apps/web/index.js +13 -0
  122. package/dist/t3code/apps/web/index.js.map +1 -0
  123. package/dist/testing/index.d.ts +9 -91
  124. package/dist/testing/index.js +13 -1
  125. package/dist/thread-history-builder-zW0zeqcS.d.ts +58 -0
  126. package/dist/thread_event_store-C0zYzukG.d.ts +77 -0
  127. package/dist/types-BTeabLYr.d.ts +126 -0
  128. package/package.json +152 -88
  129. package/dist/chat-runtime-CMli5dzJ.d.ts +0 -748
  130. package/dist/chunk-FFASNDXU.js.map +0 -1
  131. package/dist/chunk-TZBLUZ2X.js.map +0 -1
  132. package/dist/thread_event_store-BIS0qzhi.d.ts +0 -3843
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @jrkropp/codex-js
2
2
 
3
+ ## 0.1.3
4
+
5
+ Expose deliberate low-level Codex and T3 mirror subpaths so host adapters can migrate off the vendored workspace package.
6
+
7
+ ## 0.1.2
8
+
9
+ Expose the complete Codex runtime surface from the public server subpath for host adapters.
10
+
3
11
  ## 0.1.1
4
12
 
5
13
  Initial visible public extraction of the unofficial TypeScript Codex runtime.
@@ -0,0 +1,5 @@
1
+ type ClientNotification = {
2
+ "method": "initialized";
3
+ };
4
+
5
+ export type { ClientNotification as C };
@@ -1,4 +1,4 @@
1
- import { D as DynamicToolCallOutputContentItem } from './thread_event_store-BIS0qzhi.js';
1
+ import { e as DynamicToolCallOutputContentItem } from './ServerRequest-B5cKVJjr.js';
2
2
 
3
3
  type DynamicToolCallResponse = {
4
4
  contentItems: Array<DynamicToolCallOutputContentItem>;
@@ -0,0 +1,29 @@
1
+ import { a as ModeKind } from './TurnSteerResponse-0kBCfplh.js';
2
+ import { f as ReasoningEffort, J as JsonValue } from './ServerRequest-B5cKVJjr.js';
3
+
4
+ /**
5
+ * Settings for a collaboration mode.
6
+ */
7
+ type Settings = {
8
+ model: string;
9
+ reasoning_effort: ReasoningEffort | null;
10
+ developer_instructions: string | null;
11
+ };
12
+
13
+ /**
14
+ * Collaboration mode for a Codex session.
15
+ */
16
+ type CollaborationMode = {
17
+ mode: ModeKind;
18
+ settings: Settings;
19
+ };
20
+
21
+ type DynamicToolSpec = {
22
+ namespace?: string;
23
+ name: string;
24
+ description: string;
25
+ inputSchema: JsonValue;
26
+ deferLoading?: boolean;
27
+ };
28
+
29
+ export type { CollaborationMode as C, DynamicToolSpec as D, Settings as S };
@@ -0,0 +1,55 @@
1
+ import { E as ExecPolicyAmendment, N as NetworkPolicyAmendment, A as AdditionalNetworkPermissions, g as AdditionalFileSystemPermissions, J as JsonValue } from './ServerRequest-B5cKVJjr.js';
2
+
3
+ type CommandExecutionApprovalDecision = "accept" | "acceptForSession" | {
4
+ "acceptWithExecpolicyAmendment": {
5
+ execpolicy_amendment: ExecPolicyAmendment;
6
+ };
7
+ } | {
8
+ "applyNetworkPolicyAmendment": {
9
+ network_policy_amendment: NetworkPolicyAmendment;
10
+ };
11
+ } | "decline" | "cancel";
12
+
13
+ type CommandExecutionRequestApprovalResponse = {
14
+ decision: CommandExecutionApprovalDecision;
15
+ };
16
+
17
+ type FileChangeApprovalDecision = "accept" | "acceptForSession" | "decline" | "cancel";
18
+
19
+ type FileChangeRequestApprovalResponse = {
20
+ decision: FileChangeApprovalDecision;
21
+ };
22
+
23
+ type GrantedPermissionProfile = {
24
+ network?: AdditionalNetworkPermissions;
25
+ fileSystem?: AdditionalFileSystemPermissions;
26
+ };
27
+
28
+ type McpServerElicitationAction = "accept" | "decline" | "cancel";
29
+
30
+ type McpServerElicitationRequestResponse = {
31
+ action: McpServerElicitationAction;
32
+ /**
33
+ * Structured user input for accepted elicitations, mirroring RMCP `CreateElicitationResult`.
34
+ *
35
+ * This is nullable because decline/cancel responses have no content.
36
+ */
37
+ content: JsonValue | null;
38
+ /**
39
+ * Optional client metadata for form-mode action handling.
40
+ */
41
+ _meta: JsonValue | null;
42
+ };
43
+
44
+ type PermissionGrantScope = "turn" | "session";
45
+
46
+ type PermissionsRequestApprovalResponse = {
47
+ permissions: GrantedPermissionProfile;
48
+ scope: PermissionGrantScope;
49
+ /**
50
+ * Review every subsequent command in this turn before normal sandboxed execution.
51
+ */
52
+ strictAutoReview?: boolean;
53
+ };
54
+
55
+ export type { CommandExecutionRequestApprovalResponse as C, FileChangeRequestApprovalResponse as F, GrantedPermissionProfile as G, McpServerElicitationRequestResponse as M, PermissionsRequestApprovalResponse as P, CommandExecutionApprovalDecision as a, FileChangeApprovalDecision as b, McpServerElicitationAction as c, PermissionGrantScope as d };
@@ -0,0 +1,441 @@
1
+ import * as React$1 from 'react';
2
+ import { MutableRefObject, ReactNode } from 'react';
3
+ import { U as UserInput, a4 as UserMessageTurnItem } from './protocol-mpBcYHrm.js';
4
+ import { T as ToolRequestUserInputResponse } from './ToolRequestUserInputResponse-zcPLwbiK.js';
5
+ import { R as RequestId, T as ToolRequestUserInputQuestion } from './ToolRequestUserInputQuestion-CeZa5X1J.js';
6
+ import * as zustand_middleware from 'zustand/middleware';
7
+ import * as zustand from 'zustand';
8
+ import { LegendListRef } from '@legendapp/list/react';
9
+ import * as react_jsx_runtime from 'react/jsx-runtime';
10
+ import { a as Turn } from './thread-history-builder-zW0zeqcS.js';
11
+
12
+ type CodexModelOption = {
13
+ slug: string;
14
+ name: string;
15
+ shortName?: string;
16
+ subProvider?: string;
17
+ description: string;
18
+ };
19
+ type ProviderDriverKind = "codex" | (string & {});
20
+ type ProviderInstanceId = string;
21
+ type ProviderInstanceEntry = {
22
+ accentColor?: string;
23
+ continuationGroupKey?: string;
24
+ displayName: string;
25
+ driverKind: ProviderDriverKind;
26
+ instanceId: ProviderInstanceId;
27
+ isAvailable: boolean;
28
+ snapshot: {
29
+ message?: string | null;
30
+ };
31
+ status: "ready" | "warning" | "error" | "disabled" | "loading";
32
+ };
33
+ type CodexReasoningEffort = "low" | "medium" | "high" | "xhigh";
34
+ type CodexReasoningEffortOption = {
35
+ value: CodexReasoningEffort;
36
+ label: string;
37
+ description: string;
38
+ };
39
+ declare const defaultCodexModel = "gpt-5.5";
40
+ declare const defaultCodexReasoningEffort: CodexReasoningEffort;
41
+ declare const codexModelOptions: readonly CodexModelOption[];
42
+ declare const defaultCodexProviderInstance: ProviderInstanceEntry;
43
+ declare const codexReasoningEffortOptions: readonly CodexReasoningEffortOption[];
44
+ declare function resolveCodexModelOption(model: string): CodexModelOption;
45
+ declare function resolveCodexReasoningEffortOption(effort: string): CodexReasoningEffortOption;
46
+ declare function isCodexReasoningEffort(value: string): value is CodexReasoningEffort;
47
+ declare function resolveCodexReasoningEffortForModel(model: string, effort: string | null | undefined): CodexReasoningEffort;
48
+
49
+ type PendingUserInputQuestion = Omit<ToolRequestUserInputQuestion, "options"> & {
50
+ options: NonNullable<ToolRequestUserInputQuestion["options"]>;
51
+ };
52
+ type PendingUserInput = {
53
+ requestId: RequestId;
54
+ threadId: string;
55
+ turnId: string;
56
+ itemId: string;
57
+ questions: readonly PendingUserInputQuestion[];
58
+ };
59
+ interface PendingUserInputDraftAnswer {
60
+ selectedOptionLabels?: string[];
61
+ customAnswer?: string;
62
+ }
63
+ interface PendingUserInputProgress {
64
+ activeDraft: PendingUserInputDraftAnswer | undefined;
65
+ activeQuestion: PendingUserInputQuestion | null;
66
+ answeredQuestionCount: number;
67
+ canAdvance: boolean;
68
+ customAnswer: string;
69
+ isComplete: boolean;
70
+ isLastQuestion: boolean;
71
+ questionIndex: number;
72
+ resolvedAnswer: string[] | null;
73
+ selectedOptionLabels: string[];
74
+ usingCustomAnswer: boolean;
75
+ }
76
+ declare function normalizePendingUserInputQuestion(question: ToolRequestUserInputQuestion): PendingUserInputQuestion;
77
+ declare function derivePendingUserInputProgress(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>, questionIndex: number): PendingUserInputProgress;
78
+ declare function togglePendingUserInputOptionSelection(optionLabel: string): PendingUserInputDraftAnswer;
79
+ declare function setPendingUserInputCustomAnswer(draft: PendingUserInputDraftAnswer | undefined, customAnswer: string): PendingUserInputDraftAnswer;
80
+ declare function buildRequestUserInputResponse(request: PendingUserInput, draftAnswers: Record<string, PendingUserInputDraftAnswer>): ToolRequestUserInputResponse;
81
+ declare function buildPendingUserInputAnswers(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>): Record<string, string[]> | null;
82
+ declare function countAnsweredPendingUserInputQuestions(questions: ReadonlyArray<PendingUserInputQuestion>, draftAnswers: Record<string, PendingUserInputDraftAnswer>): number;
83
+ declare function resolvePendingUserInputAnswer(question: PendingUserInputQuestion, draft: PendingUserInputDraftAnswer | undefined): string[] | null;
84
+
85
+ type ComposerTriggerKind = "path" | "skill" | "slash-command";
86
+ type BuiltInComposerSlashCommand = "default" | "model" | "plan";
87
+ type ComposerSlashCommand = BuiltInComposerSlashCommand | (string & {});
88
+ type ComposerTrigger = {
89
+ kind: ComposerTriggerKind;
90
+ query: string;
91
+ rangeEnd: number;
92
+ rangeStart: number;
93
+ };
94
+ declare function detectComposerTrigger(text: string, cursorInput: number): ComposerTrigger | null;
95
+ declare function replaceTextRange(text: string, rangeStart: number, rangeEnd: number, replacement: string): {
96
+ cursor: number;
97
+ text: string;
98
+ };
99
+ declare function parseStandaloneComposerSlashCommand(text: string): ComposerSlashCommand | null;
100
+
101
+ type MentionBinding = {
102
+ mention: string;
103
+ path: string;
104
+ };
105
+ type MentionBindingRange = {
106
+ binding: MentionBinding;
107
+ range: {
108
+ end: number;
109
+ start: number;
110
+ };
111
+ };
112
+ declare function normalizeMentionBindingsForText(text: string, bindings: readonly MentionBinding[]): MentionBinding[];
113
+ declare function mentionBindingRangesForText(text: string, bindings: readonly MentionBinding[]): MentionBindingRange[];
114
+ declare function mentionBindingsAfterReplacement(input: {
115
+ currentBindings: readonly MentionBinding[];
116
+ insertedBinding: MentionBinding;
117
+ nextText: string;
118
+ replacement: string;
119
+ rangeEnd: number;
120
+ rangeStart: number;
121
+ text: string;
122
+ }): MentionBinding[];
123
+ declare function findNextMentionTokenRange(text: string, token: string, from: number): {
124
+ end: number;
125
+ start: number;
126
+ } | null;
127
+
128
+ type ComposerMentionTarget = {
129
+ binding: MentionBinding;
130
+ displayName: string;
131
+ label: string;
132
+ mention: string;
133
+ path: string;
134
+ };
135
+ declare function searchComposerMentionTargets(input: {
136
+ query: string;
137
+ targets: readonly ComposerMentionTarget[];
138
+ }): ComposerMentionTarget[];
139
+
140
+ type ContextWindowSnapshot = {
141
+ cachedInputTokens: number | null;
142
+ compactsAutomatically: boolean;
143
+ durationMs: number | null;
144
+ inputTokens: number | null;
145
+ lastCachedInputTokens: number | null;
146
+ lastInputTokens: number | null;
147
+ lastOutputTokens: number | null;
148
+ lastReasoningOutputTokens: number | null;
149
+ lastUsedTokens: number | null;
150
+ maxTokens: number | null;
151
+ outputTokens: number | null;
152
+ reasoningOutputTokens: number | null;
153
+ remainingPercentage: number | null;
154
+ remainingTokens: number | null;
155
+ toolUses: number | null;
156
+ totalProcessedTokens: number | null;
157
+ updatedAt: string;
158
+ usedPercentage: number | null;
159
+ usedTokens: number;
160
+ };
161
+
162
+ type RealtimeConversationPhase = "Inactive" | "Starting" | "Active" | "Stopping";
163
+ type RealtimeConversationUiState = {
164
+ disabled?: boolean;
165
+ error?: string | null;
166
+ phase: RealtimeConversationPhase;
167
+ realtimeSessionId?: string | null;
168
+ requestedClose: boolean;
169
+ transport: "webrtc";
170
+ onStart: () => void;
171
+ onStop: () => void;
172
+ };
173
+ type RealtimeConversationControlState = {
174
+ action: "start" | "stop";
175
+ isActive: boolean;
176
+ isBusy: boolean;
177
+ label: string;
178
+ title: string;
179
+ };
180
+ declare function isRealtimeConversationLive(phase: RealtimeConversationPhase): boolean;
181
+ declare function getRealtimeConversationControlState(realtimeConversation: Pick<RealtimeConversationUiState, "error" | "phase" | "requestedClose">): RealtimeConversationControlState;
182
+ declare class RecordingMeterState {
183
+ private readonly history;
184
+ private env;
185
+ private noiseEma;
186
+ nextText(peak: number): string;
187
+ }
188
+
189
+ interface ComposerImageAttachment {
190
+ id: string;
191
+ file: File;
192
+ name: string;
193
+ type: string;
194
+ size: number;
195
+ previewUrl: string | null;
196
+ }
197
+ interface ExpandedImageItem {
198
+ src: string;
199
+ name: string;
200
+ }
201
+ interface ExpandedImagePreview {
202
+ images: ExpandedImageItem[];
203
+ index: number;
204
+ }
205
+ interface PersistedComposerDraftImageAttachment {
206
+ id: string;
207
+ name: string;
208
+ type: string;
209
+ size: number;
210
+ dataUrl: string;
211
+ }
212
+ interface ComposerImageValidationResult {
213
+ accepted: File[];
214
+ error: string | null;
215
+ }
216
+ declare const WORKSPACE_CHAT_MAX_IMAGE_ATTACHMENTS = 8;
217
+ declare const WORKSPACE_CHAT_MAX_IMAGE_BYTES: number;
218
+ declare function isAcceptedComposerImageFile(file: File): boolean;
219
+ declare function validateComposerImageFiles(input: {
220
+ currentCount?: number;
221
+ files: Iterable<File>;
222
+ maxCount?: number;
223
+ maxSizeBytes?: number;
224
+ }): ComposerImageValidationResult;
225
+ declare function createComposerImageAttachments(files: Iterable<File>, options?: {
226
+ createId?: () => string;
227
+ createObjectURL?: (file: File) => string;
228
+ }): ComposerImageAttachment[];
229
+ declare function persistComposerDraftAttachments(attachments: Iterable<ComposerImageAttachment>, readFileAsDataUrl?: (file: File) => Promise<string>): Promise<PersistedComposerDraftImageAttachment[]>;
230
+ declare function restoreComposerDraftAttachments(attachments: Iterable<PersistedComposerDraftImageAttachment>, options?: {
231
+ createObjectURL?: (file: File) => string;
232
+ }): ComposerImageAttachment[];
233
+ declare function revokeComposerImageAttachments(attachments: Iterable<ComposerImageAttachment>, revokeObjectURL?: (url: string) => void): void;
234
+ declare function buildExpandedImagePreview(attachments: ReadonlyArray<ComposerImageAttachment>, selectedAttachmentId: string): ExpandedImagePreview | null;
235
+
236
+ interface ComposerDraftState {
237
+ prompt: string;
238
+ model: string | null;
239
+ effort: CodexReasoningEffort | null;
240
+ images: ComposerImageAttachment[];
241
+ persistedImages: PersistedComposerDraftImageAttachment[];
242
+ }
243
+ type ComposerDraftKey = string;
244
+ type PersistedComposerDraftState = Omit<ComposerDraftState, "images">;
245
+ type ComposerDraftStoreState = {
246
+ draftsByKey: Record<string, ComposerDraftState>;
247
+ favoriteModels: string[];
248
+ stickyEffort: CodexReasoningEffort | null;
249
+ stickyModel: string | null;
250
+ addImages: (key: ComposerDraftKey, images: ComposerImageAttachment[]) => void;
251
+ clearComposerContent: (key: ComposerDraftKey) => void;
252
+ clearDraft: (key: ComposerDraftKey) => void;
253
+ ensureDraft: (key: ComposerDraftKey) => ComposerDraftState;
254
+ getDraft: (key: ComposerDraftKey) => ComposerDraftState;
255
+ removeImage: (key: ComposerDraftKey, imageId: string) => void;
256
+ setEffort: (key: ComposerDraftKey, effort: CodexReasoningEffort | null) => void;
257
+ setFavoriteModels: (models: string[]) => void;
258
+ setModel: (key: ComposerDraftKey, model: string | null) => void;
259
+ setPrompt: (key: ComposerDraftKey, prompt: string) => void;
260
+ syncPersistedImages: (key: ComposerDraftKey, images: PersistedComposerDraftImageAttachment[]) => void;
261
+ };
262
+ declare function assistantComposerDraftKey(input: {
263
+ scope: string;
264
+ threadId: string | null;
265
+ }): ComposerDraftKey;
266
+ declare function readLegacyComposerDraft(key: ComposerDraftKey, storage?: Storage | null): PersistedComposerDraftState | null;
267
+ declare function resolveDraftModel(draft: Pick<ComposerDraftState, "model">): string;
268
+ declare function resolveDraftEffort(draft: Pick<ComposerDraftState, "effort">, model?: string): CodexReasoningEffort;
269
+ declare const useComposerDraftStore: zustand.UseBoundStore<Omit<zustand.StoreApi<ComposerDraftStoreState>, "setState" | "persist"> & {
270
+ setState(partial: ComposerDraftStoreState | Partial<ComposerDraftStoreState> | ((state: ComposerDraftStoreState) => ComposerDraftStoreState | Partial<ComposerDraftStoreState>), replace?: false | undefined): unknown;
271
+ setState(state: ComposerDraftStoreState | ((state: ComposerDraftStoreState) => ComposerDraftStoreState), replace: true): unknown;
272
+ persist: {
273
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<ComposerDraftStoreState, unknown, unknown>>) => void;
274
+ clearStorage: () => void;
275
+ rehydrate: () => Promise<void> | void;
276
+ hasHydrated: () => boolean;
277
+ onHydrate: (fn: (state: ComposerDraftStoreState) => void) => () => void;
278
+ onFinishHydration: (fn: (state: ComposerDraftStoreState) => void) => () => void;
279
+ getOptions: () => Partial<zustand_middleware.PersistOptions<ComposerDraftStoreState, unknown, unknown>>;
280
+ };
281
+ }>;
282
+ declare function useComposerThreadDraft(key: ComposerDraftKey): ComposerDraftState;
283
+
284
+ type ChatComposerSubmitPayload = {
285
+ files: File[];
286
+ effort: CodexReasoningEffort;
287
+ items: UserInput[];
288
+ mentionBindings: MentionBinding[];
289
+ model: string;
290
+ text: string;
291
+ };
292
+ type ChatComposerInteractionMode = "default" | "plan";
293
+ type ChatComposerRuntimeMode = "approval-required" | "auto-accept-edits" | "full-access";
294
+ type ChatComposerCommand = {
295
+ description: string;
296
+ disabled?: boolean;
297
+ group?: string;
298
+ label?: string;
299
+ name: ComposerSlashCommand;
300
+ unavailableReason?: string;
301
+ };
302
+ type ChatComposerSkill = {
303
+ description?: string;
304
+ disabled?: boolean;
305
+ label?: string;
306
+ name: string;
307
+ unavailableReason?: string;
308
+ };
309
+ type ChatComposerHandle = {
310
+ clear: () => void;
311
+ focusAt: (cursor: number) => void;
312
+ focusAtEnd: () => void;
313
+ getSendContext: () => ChatComposerSubmitPayload;
314
+ insertTextAtCursor: (text: string, options?: {
315
+ source?: "manual" | "realtime";
316
+ }) => void;
317
+ insertRecordingMeterPlaceholder: (text: string) => string;
318
+ readSnapshot: () => {
319
+ cursor: number;
320
+ expandedCursor: number;
321
+ value: string;
322
+ };
323
+ removeRecordingMeterPlaceholder: (id: string) => void;
324
+ replaceRecordingMeterPlaceholder: (id: string, text: string) => void;
325
+ resetCursorState: (options?: {
326
+ cursor?: number;
327
+ detectTrigger?: boolean;
328
+ prompt?: string;
329
+ }) => void;
330
+ setDraft: (draft: {
331
+ mentionBindings?: MentionBinding[];
332
+ message: string;
333
+ }) => void;
334
+ submit: () => void;
335
+ updateRecordingMeterInPlace: (id: string, text: string) => boolean;
336
+ };
337
+ declare const ChatComposer: React$1.ForwardRefExoticComponent<{
338
+ className?: string;
339
+ disabled?: boolean;
340
+ draftKey: ComposerDraftKey;
341
+ editorAriaLabel?: string;
342
+ isConnecting?: boolean;
343
+ isEnvironmentUnavailable?: boolean;
344
+ isRunning?: boolean;
345
+ isSending?: boolean;
346
+ interactionMode?: ChatComposerInteractionMode;
347
+ contextWindow?: ContextWindowSnapshot | null;
348
+ mentionRefs: ComposerMentionTarget[];
349
+ modelOptions?: readonly CodexModelOption[];
350
+ pendingUserInput?: PendingUserInput | null;
351
+ pendingRequestDisabled?: boolean;
352
+ placeholder?: string;
353
+ planFollowUpTitle?: string | null;
354
+ planSidebarLabel?: string;
355
+ planSidebarOpen?: boolean;
356
+ realtimeConversation?: RealtimeConversationUiState | null;
357
+ runtimeMode?: ChatComposerRuntimeMode;
358
+ showPlanFollowUpPrompt?: boolean;
359
+ showInteractionModeToggle?: boolean;
360
+ showPlanToggle?: boolean;
361
+ composerCommands?: readonly ChatComposerCommand[];
362
+ composerSkills?: readonly ChatComposerSkill[];
363
+ onCommand?: (command: ComposerSlashCommand) => void;
364
+ onComposerError?: (message: string) => void;
365
+ onImplementPlanInNewThread?: () => void;
366
+ onRuntimeModeChange?: (mode: ChatComposerRuntimeMode) => void;
367
+ onToggleInteractionMode?: () => void;
368
+ onTogglePlanSidebar?: () => void;
369
+ onPendingRequestDismiss?: () => void;
370
+ onPendingRequestSubmit?: (response: ToolRequestUserInputResponse) => boolean | void;
371
+ onInterrupt: () => void;
372
+ scheduleStickToBottom?: () => void;
373
+ shouldAutoScrollRef?: MutableRefObject<boolean>;
374
+ onSend: () => void | Promise<void>;
375
+ } & React$1.RefAttributes<ChatComposerHandle>>;
376
+
377
+ type ComposerBannerStackItem = {
378
+ id: string;
379
+ title: ReactNode;
380
+ description?: ReactNode;
381
+ action?: {
382
+ label: string;
383
+ onClick: () => void;
384
+ };
385
+ actions?: ReactNode;
386
+ dismissLabel?: string;
387
+ icon?: ReactNode;
388
+ onDismiss?: () => void;
389
+ variant?: "error" | "info" | "success" | "warning";
390
+ tone?: "default" | "destructive";
391
+ };
392
+ declare function ComposerBannerStack({ className, items, }: {
393
+ className?: string;
394
+ items: readonly ComposerBannerStackItem[];
395
+ }): react_jsx_runtime.JSX.Element | null;
396
+
397
+ type MessagesTimelineProps = {
398
+ activeTurnStartedAt: string | null;
399
+ errors: string[];
400
+ isWorking: boolean;
401
+ listRef: React.RefObject<LegendListRef | null>;
402
+ onImageExpand: (preview: ExpandedImagePreview) => void;
403
+ onIsAtEndChange: (isAtEnd: boolean) => void;
404
+ optimisticUserMessages: readonly UserMessageTurnItem[];
405
+ runtimeError: string | null;
406
+ turns: readonly Turn[];
407
+ warnings: string[];
408
+ };
409
+ declare const MessagesTimeline: React$1.NamedExoticComponent<MessagesTimelineProps>;
410
+
411
+ type ChatViewRenderComposerControls = {
412
+ prepareForOptimisticAppend: () => Promise<void>;
413
+ scheduleStickToBottom: () => void;
414
+ };
415
+ type ChatViewProps = {
416
+ actions?: ReactNode;
417
+ bannerItems?: readonly ComposerBannerStackItem[];
418
+ className?: string;
419
+ composer: ReactNode;
420
+ headerLeading?: ReactNode;
421
+ listRef: React.RefObject<LegendListRef | null>;
422
+ subtitle?: ReactNode;
423
+ threadKey: string;
424
+ timeline: Omit<MessagesTimelineProps, "listRef" | "onImageExpand" | "onIsAtEndChange">;
425
+ title: ReactNode;
426
+ onControlsChange?: (controls: ChatViewRenderComposerControls | null) => void;
427
+ onIsAtEndChange?: (isAtEnd: boolean) => void;
428
+ };
429
+ declare const ChatView: React$1.NamedExoticComponent<ChatViewProps>;
430
+
431
+ type ProviderStatus = {
432
+ displayName?: string | null;
433
+ driver?: string | null;
434
+ message?: string | null;
435
+ status: "disabled" | "error" | "limited" | "ready" | "warning";
436
+ };
437
+ declare const ProviderStatusBanner: React$1.NamedExoticComponent<{
438
+ status: ProviderStatus | null;
439
+ }>;
440
+
441
+ export { ChatComposer as $, isAcceptedComposerImageFile as A, isCodexReasoningEffort as B, type ChatComposerHandle as C, isRealtimeConversationLive as D, type ExpandedImagePreview as E, mentionBindingRangesForText as F, mentionBindingsAfterReplacement as G, normalizeMentionBindingsForText as H, persistComposerDraftAttachments as I, resolveCodexModelOption as J, resolveCodexReasoningEffortForModel as K, resolveCodexReasoningEffortOption as L, type MentionBinding as M, resolveDraftEffort as N, resolveDraftModel as O, type PersistedComposerDraftImageAttachment as P, restoreComposerDraftAttachments as Q, type RealtimeConversationControlState as R, revokeComposerImageAttachments as S, useComposerDraftStore as T, useComposerThreadDraft as U, validateComposerImageFiles as V, WORKSPACE_CHAT_MAX_IMAGE_ATTACHMENTS as W, type PendingUserInput as X, type ContextWindowSnapshot as Y, type MessagesTimelineProps as Z, type ChatViewProps as _, type ChatComposerSubmitPayload as a, type ChatComposerRuntimeMode as a0, type ProviderStatus as a1, type ComposerBannerStackItem as a2, type ChatComposerInteractionMode as a3, type ComposerMentionTarget as a4, type ComposerSlashCommand as a5, type ComposerTriggerKind as a6, type PendingUserInputDraftAnswer as a7, type ComposerTrigger as a8, type BuiltInComposerSlashCommand as a9, type ChatComposerCommand as aa, type ChatComposerSkill as ab, ChatView as ac, ComposerBannerStack as ad, type ExpandedImageItem as ae, MessagesTimeline as af, type PendingUserInputProgress as ag, type PendingUserInputQuestion as ah, type PersistedComposerDraftState as ai, ProviderStatusBanner as aj, buildPendingUserInputAnswers as ak, buildRequestUserInputResponse as al, countAnsweredPendingUserInputQuestions as am, derivePendingUserInputProgress as an, detectComposerTrigger as ao, findNextMentionTokenRange as ap, normalizePendingUserInputQuestion as aq, parseStandaloneComposerSlashCommand as ar, readLegacyComposerDraft as as, replaceTextRange as at, resolvePendingUserInputAnswer as au, searchComposerMentionTargets as av, setPendingUserInputCustomAnswer as aw, togglePendingUserInputOptionSelection as ax, type ChatViewRenderComposerControls as b, type CodexModelOption as c, type CodexReasoningEffort as d, type CodexReasoningEffortOption as e, type ComposerDraftKey as f, type ComposerDraftState as g, type ComposerImageAttachment as h, type ComposerImageValidationResult as i, type MentionBindingRange as j, type ProviderDriverKind as k, type ProviderInstanceEntry as l, type ProviderInstanceId as m, type RealtimeConversationPhase as n, type RealtimeConversationUiState as o, RecordingMeterState as p, WORKSPACE_CHAT_MAX_IMAGE_BYTES as q, assistantComposerDraftKey as r, buildExpandedImagePreview as s, codexModelOptions as t, codexReasoningEffortOptions as u, createComposerImageAttachments as v, defaultCodexModel as w, defaultCodexProviderInstance as x, defaultCodexReasoningEffort as y, getRealtimeConversationControlState as z };