dsh-codex-connect 0.1.0-alpha.4.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/INSTALL.md +72 -0
- package/LICENSE +202 -0
- package/MIGRATION.md +12 -0
- package/NOTICE +15 -0
- package/README.i18n.yaml +6 -0
- package/README.md +110 -0
- package/README.zh.md +93 -0
- package/cordis.patch.yml +8 -0
- package/docs/design.i18n.yaml +4 -0
- package/docs/design.md +29 -0
- package/docs/design.zh.md +25 -0
- package/lib/bin.d.ts +6 -0
- package/lib/bin.js +145 -0
- package/lib/client.js +1086 -0
- package/lib/index.d.ts +333 -0
- package/lib/index.js +2 -0
- package/lib/invariant.d.ts +14 -0
- package/lib/invariant.js +15 -0
- package/lib/src-ILOioCkA.js +1484 -0
- package/package.json +145 -0
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { AuthInteraction, Credential, CredentialInfo, CredentialStore } from "@earendil-works/pi-ai";
|
|
3
|
+
import "@deepseek-ai/dsh-tools";
|
|
4
|
+
import { WebSearchProvider, WebSearchRequest, WebSearchResult } from "@deepseek-ai/dsh-web";
|
|
5
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
6
|
+
//#region src/view-image.d.ts
|
|
7
|
+
/** Stable Codex tool name. */
|
|
8
|
+
declare const VIEW_IMAGE_TOOL_NAME = "view_image";
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/doctor.d.ts
|
|
11
|
+
/** Inputs that are safe to obtain without booting OAuth. */
|
|
12
|
+
interface OpenAICodexDiagnosticOptions {
|
|
13
|
+
/** Credential pathname to inspect through metadata only. */
|
|
14
|
+
credentialPath?: string;
|
|
15
|
+
/** Provider ids already registered in the active Harness context. */
|
|
16
|
+
providerIds?: readonly string[];
|
|
17
|
+
/** Whether the optional standalone search provider is enabled. */
|
|
18
|
+
enableSearch?: boolean;
|
|
19
|
+
/** Whether the optional image tool is enabled. */
|
|
20
|
+
enableImageTool?: boolean;
|
|
21
|
+
}
|
|
22
|
+
interface OpenAICodexDiagnosticReport {
|
|
23
|
+
package: 'dsh-codex-connect';
|
|
24
|
+
version: string;
|
|
25
|
+
node: string;
|
|
26
|
+
credentialFile: {
|
|
27
|
+
path: string;
|
|
28
|
+
state: 'missing' | 'owner-only' | 'permissions-too-broad' | 'not-a-regular-file' | 'unreadable-metadata';
|
|
29
|
+
mode?: string;
|
|
30
|
+
};
|
|
31
|
+
capabilities: {
|
|
32
|
+
modelProvider: true;
|
|
33
|
+
search: boolean;
|
|
34
|
+
imageTool: boolean;
|
|
35
|
+
changesHarnessDefaultModel: false;
|
|
36
|
+
changesHarnessSearchRoute: false;
|
|
37
|
+
};
|
|
38
|
+
providerConflict: boolean;
|
|
39
|
+
hints: string[];
|
|
40
|
+
}
|
|
41
|
+
/** Actionable message for legacy/manual `openai-codex` adapter collisions. */
|
|
42
|
+
declare function openAICodexConflictMessage(): string;
|
|
43
|
+
/** Fail before the generic registry error so the collision has a migration hint. */
|
|
44
|
+
declare function assertNoOpenAICodexProviderConflict(providerIds: readonly string[]): void;
|
|
45
|
+
/**
|
|
46
|
+
* Inspect only process and filesystem metadata. This function never opens the
|
|
47
|
+
* OAuth document, refreshes a token, or starts an authorization flow.
|
|
48
|
+
*/
|
|
49
|
+
declare function diagnoseOpenAICodex(options?: OpenAICodexDiagnosticOptions): Promise<OpenAICodexDiagnosticReport>;
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/store.d.ts
|
|
52
|
+
/** Provider route and pi-ai provider id owned by this bundle. */
|
|
53
|
+
declare const OPENAI_CODEX_PROVIDER = "openai-codex";
|
|
54
|
+
/** Basename of the OAuth document inside the Harness home. */
|
|
55
|
+
declare const OPENAI_CODEX_AUTH_FILENAME = ".openai-codex-auth.json";
|
|
56
|
+
/**
|
|
57
|
+
* Resolve the default OAuth document path.
|
|
58
|
+
* @param dshHome - optional Harness-home override.
|
|
59
|
+
* @returns the absolute owner-only document path.
|
|
60
|
+
*/
|
|
61
|
+
declare function openAICodexAuthPath(dshHome?: string): string;
|
|
62
|
+
/** File-backed pi-ai store scoped to the single OpenAI Codex provider. */
|
|
63
|
+
declare class OpenAICodexCredentialStore implements CredentialStore {
|
|
64
|
+
/** Absolute credential document path. */
|
|
65
|
+
readonly filename: string;
|
|
66
|
+
/**
|
|
67
|
+
* @param filename - explicit document path, defaulting under `$DSH_HOME`.
|
|
68
|
+
*/
|
|
69
|
+
constructor(filename?: string);
|
|
70
|
+
/** Read and validate the current document without acquiring the writer lock. */
|
|
71
|
+
private readCurrent;
|
|
72
|
+
/** @inheritdoc */
|
|
73
|
+
read(providerId: string): Promise<Credential | undefined>;
|
|
74
|
+
/** @inheritdoc */
|
|
75
|
+
list(): Promise<readonly CredentialInfo[]>;
|
|
76
|
+
/** @inheritdoc */
|
|
77
|
+
modify(providerId: string, fn: (current: Credential | undefined) => Promise<Credential | undefined>): Promise<Credential | undefined>;
|
|
78
|
+
/** @inheritdoc */
|
|
79
|
+
delete(providerId: string): Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/usage.d.ts
|
|
83
|
+
/** Fixed endpoint used by the official Codex client for ChatGPT rate limits. */
|
|
84
|
+
declare const OPENAI_CODEX_USAGE_URL = "https://chatgpt.com/backend-api/wham/usage";
|
|
85
|
+
/** One quota window expressed as remaining capacity for direct UI rendering. */
|
|
86
|
+
interface OpenAICodexRateLimitWindow {
|
|
87
|
+
/** Percent still available in this window. */
|
|
88
|
+
readonly remainingPercent: number;
|
|
89
|
+
/** Server-declared rolling-window length in seconds. */
|
|
90
|
+
readonly windowSeconds: number;
|
|
91
|
+
}
|
|
92
|
+
/** One separately metered Codex quota bucket. */
|
|
93
|
+
interface OpenAICodexRateLimit {
|
|
94
|
+
/** Stable server feature id. */
|
|
95
|
+
readonly id: string;
|
|
96
|
+
/** Optional server-provided display name. */
|
|
97
|
+
readonly name?: string;
|
|
98
|
+
/** Available rolling windows for this bucket. */
|
|
99
|
+
readonly windows: readonly OpenAICodexRateLimitWindow[];
|
|
100
|
+
}
|
|
101
|
+
/** Optional exact prepaid-credit balance returned by ChatGPT. */
|
|
102
|
+
interface OpenAICodexCredits {
|
|
103
|
+
/** Whether the balance is unmetered. */
|
|
104
|
+
readonly unlimited: boolean;
|
|
105
|
+
/** Exact provider-formatted balance when finite and disclosed. */
|
|
106
|
+
readonly balance?: string;
|
|
107
|
+
}
|
|
108
|
+
/** Optional exact workspace member spend limit returned by ChatGPT. */
|
|
109
|
+
interface OpenAICodexIndividualLimit {
|
|
110
|
+
/** Exact configured limit. */
|
|
111
|
+
readonly limit: string;
|
|
112
|
+
/** Exact amount consumed. */
|
|
113
|
+
readonly used: string;
|
|
114
|
+
/** Exact amount still available. */
|
|
115
|
+
readonly remaining: string;
|
|
116
|
+
/** Percent still available for progress rendering. */
|
|
117
|
+
readonly remainingPercent: number;
|
|
118
|
+
}
|
|
119
|
+
/** Secret-free quota projection returned to the browser. */
|
|
120
|
+
interface OpenAICodexUsage {
|
|
121
|
+
/** Rolling Codex rate-limit buckets. */
|
|
122
|
+
readonly rateLimits: readonly OpenAICodexRateLimit[];
|
|
123
|
+
/** Exact prepaid-credit balance when supported for this account. */
|
|
124
|
+
readonly credits?: OpenAICodexCredits;
|
|
125
|
+
/** Exact workspace member limit when supported for this account. */
|
|
126
|
+
readonly individualLimit?: OpenAICodexIndividualLimit;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Convert the provider response into the small secret-free object sent to the browser.
|
|
130
|
+
* @param value - opaque JSON returned by the ChatGPT usage endpoint.
|
|
131
|
+
* @returns core and additionally metered quota buckets with remaining percentages.
|
|
132
|
+
*/
|
|
133
|
+
declare function parseOpenAICodexUsage(value: unknown): OpenAICodexUsage;
|
|
134
|
+
/**
|
|
135
|
+
* Read current quota without issuing a model request. OAuth is refreshed through
|
|
136
|
+
* the same provider-native credential lifecycle used by normal Codex turns.
|
|
137
|
+
* @param store - plugin-owned OAuth credential store.
|
|
138
|
+
* @returns current rate-limit buckets safe to expose to the local browser page.
|
|
139
|
+
*/
|
|
140
|
+
declare function readOpenAICodexRateLimits(store: OpenAICodexCredentialStore): Promise<OpenAICodexUsage>;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/settings-contract.d.ts
|
|
143
|
+
/** Node-free settings contract shared by the Host plugin and browser card. */
|
|
144
|
+
/** Stable Harness settings namespace owned by this plugin. */
|
|
145
|
+
declare const OPENAI_CODEX_SETTINGS_NAMESPACE = "llm-openai-codex";
|
|
146
|
+
/** Search modes accepted by the Codex standalone search endpoint. */
|
|
147
|
+
type OpenAICodexSearchMode = 'cached' | 'indexed' | 'live';
|
|
148
|
+
/** Search-context sizes accepted by the Codex standalone search endpoint. */
|
|
149
|
+
type OpenAICodexSearchContextSize = 'low' | 'medium' | 'high';
|
|
150
|
+
/** Default model used by the standalone search endpoint. */
|
|
151
|
+
declare const DEFAULT_OPENAI_CODEX_SEARCH_MODEL = "gpt-5.6-sol";
|
|
152
|
+
/** Default search mode, matching the official local Codex client. */
|
|
153
|
+
declare const DEFAULT_OPENAI_CODEX_SEARCH_MODE: OpenAICodexSearchMode;
|
|
154
|
+
/** Default provider search-context size. */
|
|
155
|
+
declare const DEFAULT_OPENAI_CODEX_SEARCH_CONTEXT_SIZE: OpenAICodexSearchContextSize;
|
|
156
|
+
/** Default output budget for the standalone search response. */
|
|
157
|
+
declare const DEFAULT_OPENAI_CODEX_SEARCH_MAX_OUTPUT_TOKENS = 10000;
|
|
158
|
+
/** Fully resolved user-editable section presented by Plugin configuration. */
|
|
159
|
+
interface OpenAICodexSettingsConfig {
|
|
160
|
+
enableSearch: boolean;
|
|
161
|
+
enableImageTool: boolean;
|
|
162
|
+
searchModel: string;
|
|
163
|
+
searchMode: OpenAICodexSearchMode;
|
|
164
|
+
searchContextSize: OpenAICodexSearchContextSize;
|
|
165
|
+
searchMaxOutputTokens: number;
|
|
166
|
+
}
|
|
167
|
+
declare const DEFAULT_OPENAI_CODEX_SETTINGS: Readonly<OpenAICodexSettingsConfig>;
|
|
168
|
+
/** Fill the schema defaults even when called without Cordis validation. */
|
|
169
|
+
declare function resolveOpenAICodexSettings(value: Partial<OpenAICodexSettingsConfig>): OpenAICodexSettingsConfig;
|
|
170
|
+
/** Narrow the redacted settings wire payload before it enters React state. */
|
|
171
|
+
declare function decodeOpenAICodexSettings(value: unknown): OpenAICodexSettingsConfig | undefined;
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/search.d.ts
|
|
174
|
+
/** Stable dsh web-provider id selected by the bundle patch. */
|
|
175
|
+
declare const OPENAI_CODEX_SEARCH_PROVIDER = "openai-codex";
|
|
176
|
+
/** Trusted first-party Codex base; OAuth credentials never cross to a configured origin. */
|
|
177
|
+
declare const OPENAI_CODEX_BASE_URL = "https://chatgpt.com/backend-api/codex";
|
|
178
|
+
/** Standalone search endpoint used by the official Codex client. */
|
|
179
|
+
declare const OPENAI_CODEX_SEARCH_URL = "https://chatgpt.com/backend-api/codex/alpha/search";
|
|
180
|
+
interface SearchRequestBody {
|
|
181
|
+
readonly id: string;
|
|
182
|
+
readonly model: string;
|
|
183
|
+
readonly input: readonly [{
|
|
184
|
+
readonly type: 'message';
|
|
185
|
+
readonly role: 'user';
|
|
186
|
+
readonly content: readonly [{
|
|
187
|
+
readonly type: 'input_text';
|
|
188
|
+
readonly text: string;
|
|
189
|
+
}];
|
|
190
|
+
}];
|
|
191
|
+
readonly commands: {
|
|
192
|
+
readonly search_query: readonly [{
|
|
193
|
+
readonly q: string;
|
|
194
|
+
}];
|
|
195
|
+
};
|
|
196
|
+
readonly settings: {
|
|
197
|
+
readonly search_context_size: OpenAICodexSearchContextSize;
|
|
198
|
+
readonly allowed_callers: readonly ['direct'];
|
|
199
|
+
readonly external_web_access: boolean | 'indexed';
|
|
200
|
+
};
|
|
201
|
+
readonly max_output_tokens: number;
|
|
202
|
+
}
|
|
203
|
+
/** Exact secret-free request recorded before a standalone search dispatch. */
|
|
204
|
+
interface OpenAICodexSearchRequestRecord {
|
|
205
|
+
/** Fixed first-party endpoint. */
|
|
206
|
+
readonly endpoint: typeof OPENAI_CODEX_SEARCH_URL;
|
|
207
|
+
/** Exact JSON body sent to the provider. */
|
|
208
|
+
readonly body: SearchRequestBody;
|
|
209
|
+
}
|
|
210
|
+
/** Fully resolved provider options. */
|
|
211
|
+
interface OpenAICodexSearchProviderOptions {
|
|
212
|
+
/** Shared persistent OAuth store. */
|
|
213
|
+
readonly credentials: OpenAICodexCredentialStore;
|
|
214
|
+
/** Model sent to the standalone search endpoint. */
|
|
215
|
+
readonly model: string;
|
|
216
|
+
/** Cached, indexed, or live external-web policy. */
|
|
217
|
+
readonly mode: OpenAICodexSearchMode;
|
|
218
|
+
/** Provider-side search context size. */
|
|
219
|
+
readonly contextSize: OpenAICodexSearchContextSize;
|
|
220
|
+
/** Upper bound on the standalone endpoint's generated output. */
|
|
221
|
+
readonly maxOutputTokens: number;
|
|
222
|
+
/** Resolve the request identity, normally the initiating session id. */
|
|
223
|
+
readonly resolveRequestId: () => string;
|
|
224
|
+
/** Record the exact secret-free request before dispatch. */
|
|
225
|
+
readonly recordRequest?: (request: OpenAICodexSearchRequestRecord) => void;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Map the standalone endpoint's forward-compatible result DTOs into the dsh
|
|
229
|
+
* web result. Unknown DTO types and fields are ignored; malformed envelope
|
|
230
|
+
* fields fail at the network boundary.
|
|
231
|
+
* @param value - parsed response JSON.
|
|
232
|
+
* @returns normalized answer and citeable sources.
|
|
233
|
+
*/
|
|
234
|
+
declare function mapOpenAICodexSearchResponse(value: unknown): WebSearchResult;
|
|
235
|
+
/** OpenAI Codex standalone-search provider using the same refreshable OAuth store as the LLM route. */
|
|
236
|
+
declare class OpenAICodexSearchProvider implements WebSearchProvider {
|
|
237
|
+
private readonly options;
|
|
238
|
+
readonly id = "openai-codex";
|
|
239
|
+
private readonly models;
|
|
240
|
+
/**
|
|
241
|
+
* @param options - fixed trusted endpoint policy and deployment tunables.
|
|
242
|
+
*/
|
|
243
|
+
constructor(options: OpenAICodexSearchProviderOptions);
|
|
244
|
+
/** The local configuration is usable; credential presence is resolved per request. */
|
|
245
|
+
available(): boolean;
|
|
246
|
+
/** @inheritdoc */
|
|
247
|
+
search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>;
|
|
248
|
+
}
|
|
249
|
+
//#endregion
|
|
250
|
+
//#region src/search-event.d.ts
|
|
251
|
+
/** Dedicated log event written before an OpenAI Codex search dispatch. */
|
|
252
|
+
declare const OPENAI_CODEX_SEARCH_MODEL_REQUEST_EVENT = "web/openai-codex-search-llm-request";
|
|
253
|
+
declare module '@deepseek-ai/dsh-session/types' {
|
|
254
|
+
interface SessionEventMap {
|
|
255
|
+
/** Exact secret-free OpenAI Codex standalone-search request. */
|
|
256
|
+
'web/openai-codex-search-llm-request': OpenAICodexSearchRequestRecord;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Register the plugin-owned event in the running Harness vocabulary. The
|
|
261
|
+
* public DSH build exports its known-event collection as read-only because
|
|
262
|
+
* core code must not mutate it accidentally; the runtime value is the Set
|
|
263
|
+
* deliberately consulted on every persistence read. Registration remains for
|
|
264
|
+
* the process lifetime so sessions written before an HMR cycle stay readable.
|
|
265
|
+
*/
|
|
266
|
+
declare function installOpenAICodexSearchEvent(): void;
|
|
267
|
+
/**
|
|
268
|
+
* Append one resolved request to the initiating agent's session. Searches
|
|
269
|
+
* outside an agent turn have no owning session and therefore produce no log.
|
|
270
|
+
* @param ctx - plugin context carrying the optional active-agent service.
|
|
271
|
+
* @param request - exact request after defaults, excluding credentials.
|
|
272
|
+
*/
|
|
273
|
+
declare function recordOpenAICodexSearchRequest(ctx: Context, request: OpenAICodexSearchRequestRecord): void;
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region src/auth.d.ts
|
|
276
|
+
/** Non-secret login state shown by the launcher. */
|
|
277
|
+
interface OpenAICodexAuthStatus {
|
|
278
|
+
/** Whether a stored OAuth credential exists. */
|
|
279
|
+
authenticated: boolean;
|
|
280
|
+
/** Access-token expiry time; refresh is automatic on the next request. */
|
|
281
|
+
expiresAt?: Date;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Complete provider-native OAuth and persist the resulting credential.
|
|
285
|
+
* @param interaction - terminal or UI callbacks for the provider flow.
|
|
286
|
+
* @param store - credential store, defaulting under `$DSH_HOME`.
|
|
287
|
+
*/
|
|
288
|
+
declare function loginOpenAICodex(interaction: AuthInteraction, store?: OpenAICodexCredentialStore): Promise<void>;
|
|
289
|
+
/**
|
|
290
|
+
* Remove the stored OpenAI Codex credential.
|
|
291
|
+
* @param store - credential store, defaulting under `$DSH_HOME`.
|
|
292
|
+
*/
|
|
293
|
+
declare function logoutOpenAICodex(store?: OpenAICodexCredentialStore): Promise<void>;
|
|
294
|
+
/**
|
|
295
|
+
* Read non-secret OpenAI Codex login state without refreshing the token.
|
|
296
|
+
* @param store - credential store, defaulting under `$DSH_HOME`.
|
|
297
|
+
* @returns stored login state and expiry.
|
|
298
|
+
*/
|
|
299
|
+
declare function openAICodexAuthStatus(store?: OpenAICodexCredentialStore): Promise<OpenAICodexAuthStatus>;
|
|
300
|
+
//#endregion
|
|
301
|
+
//#region src/index.d.ts
|
|
302
|
+
/** Stable Cordis plugin name. */
|
|
303
|
+
declare const name = "llm-openai-codex";
|
|
304
|
+
/** The model registry required before the provider can register. */
|
|
305
|
+
declare const inject: string[];
|
|
306
|
+
/** Branded Host settings namespace used by the configurable-provider directory. */
|
|
307
|
+
declare const OPENAI_CODEX_SETTINGS_NS: import("@deepseek-ai/dsh-settings").SettingsNamespace;
|
|
308
|
+
/** Composite model and standalone-search configuration. */
|
|
309
|
+
interface Config {
|
|
310
|
+
/** Register the optional standalone Codex search provider. */
|
|
311
|
+
enableSearch?: boolean;
|
|
312
|
+
/** Register the optional image-loading tool. */
|
|
313
|
+
enableImageTool?: boolean;
|
|
314
|
+
/** Model used for auxiliary standalone searches. */
|
|
315
|
+
searchModel?: string;
|
|
316
|
+
/** Cached, indexed, or live web access. */
|
|
317
|
+
searchMode?: OpenAICodexSearchMode;
|
|
318
|
+
/** Amount of search context returned by the provider. */
|
|
319
|
+
searchContextSize?: OpenAICodexSearchContextSize;
|
|
320
|
+
/** Maximum generated tokens returned by the standalone search endpoint. */
|
|
321
|
+
searchMaxOutputTokens?: number;
|
|
322
|
+
}
|
|
323
|
+
declare const Config: z<Config>;
|
|
324
|
+
/**
|
|
325
|
+
* Register the `openai-codex` LLM route with one provider-native OAuth store.
|
|
326
|
+
* Search and image tooling are added only when their config flags are true.
|
|
327
|
+
* Selecting this route as the Harness default remains a separate profile choice.
|
|
328
|
+
* @param ctx - plugin context carrying the LLM registry plus optional services.
|
|
329
|
+
* @param config - capability gates and standalone-search tuning.
|
|
330
|
+
*/
|
|
331
|
+
declare function apply(ctx: Context, config: Config): void;
|
|
332
|
+
//#endregion
|
|
333
|
+
export { Config, DEFAULT_OPENAI_CODEX_SEARCH_CONTEXT_SIZE, DEFAULT_OPENAI_CODEX_SEARCH_MAX_OUTPUT_TOKENS, DEFAULT_OPENAI_CODEX_SEARCH_MODE, DEFAULT_OPENAI_CODEX_SEARCH_MODEL, DEFAULT_OPENAI_CODEX_SETTINGS, OPENAI_CODEX_AUTH_FILENAME, OPENAI_CODEX_BASE_URL, OPENAI_CODEX_PROVIDER, OPENAI_CODEX_SEARCH_MODEL_REQUEST_EVENT, OPENAI_CODEX_SEARCH_PROVIDER, OPENAI_CODEX_SEARCH_URL, OPENAI_CODEX_SETTINGS_NAMESPACE, OPENAI_CODEX_SETTINGS_NS, OPENAI_CODEX_USAGE_URL, type OpenAICodexAuthStatus, OpenAICodexCredentialStore, type OpenAICodexCredits, type OpenAICodexDiagnosticOptions, type OpenAICodexDiagnosticReport, type OpenAICodexIndividualLimit, type OpenAICodexRateLimit, type OpenAICodexRateLimitWindow, type OpenAICodexSearchContextSize, type OpenAICodexSearchMode, OpenAICodexSearchProvider, type OpenAICodexSearchProviderOptions, type OpenAICodexSearchRequestRecord, type OpenAICodexSettingsConfig, type OpenAICodexUsage, VIEW_IMAGE_TOOL_NAME, apply, assertNoOpenAICodexProviderConflict, decodeOpenAICodexSettings, diagnoseOpenAICodex, inject, installOpenAICodexSearchEvent, loginOpenAICodex, logoutOpenAICodex, mapOpenAICodexSearchResponse, name, openAICodexAuthPath, openAICodexAuthStatus, openAICodexConflictMessage, parseOpenAICodexUsage, readOpenAICodexRateLimits, recordOpenAICodexSearchRequest, resolveOpenAICodexSettings };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as logoutOpenAICodex, C as assertNoOpenAICodexProviderConflict, D as parseOpenAICodexUsage, E as OPENAI_CODEX_USAGE_URL, F as openAICodexAuthPath, M as OPENAI_CODEX_AUTH_FILENAME, N as OPENAI_CODEX_PROVIDER, O as readOpenAICodexRateLimits, P as OpenAICodexCredentialStore, S as VIEW_IMAGE_TOOL_NAME, T as openAICodexConflictMessage, _ as decodeOpenAICodexSettings, a as name, b as installOpenAICodexSearchEvent, c as OPENAI_CODEX_SEARCH_URL, d as DEFAULT_OPENAI_CODEX_SEARCH_CONTEXT_SIZE, f as DEFAULT_OPENAI_CODEX_SEARCH_MAX_OUTPUT_TOKENS, g as OPENAI_CODEX_SETTINGS_NAMESPACE, h as DEFAULT_OPENAI_CODEX_SETTINGS, i as inject, j as openAICodexAuthStatus, k as loginOpenAICodex, l as OpenAICodexSearchProvider, m as DEFAULT_OPENAI_CODEX_SEARCH_MODEL, n as OPENAI_CODEX_SETTINGS_NS, o as OPENAI_CODEX_BASE_URL, p as DEFAULT_OPENAI_CODEX_SEARCH_MODE, r as apply, s as OPENAI_CODEX_SEARCH_PROVIDER, t as Config, u as mapOpenAICodexSearchResponse, v as resolveOpenAICodexSettings, w as diagnoseOpenAICodex, x as recordOpenAICodexSearchRequest, y as OPENAI_CODEX_SEARCH_MODEL_REQUEST_EVENT } from "./src-ILOioCkA.js";
|
|
2
|
+
export { Config, DEFAULT_OPENAI_CODEX_SEARCH_CONTEXT_SIZE, DEFAULT_OPENAI_CODEX_SEARCH_MAX_OUTPUT_TOKENS, DEFAULT_OPENAI_CODEX_SEARCH_MODE, DEFAULT_OPENAI_CODEX_SEARCH_MODEL, DEFAULT_OPENAI_CODEX_SETTINGS, OPENAI_CODEX_AUTH_FILENAME, OPENAI_CODEX_BASE_URL, OPENAI_CODEX_PROVIDER, OPENAI_CODEX_SEARCH_MODEL_REQUEST_EVENT, OPENAI_CODEX_SEARCH_PROVIDER, OPENAI_CODEX_SEARCH_URL, OPENAI_CODEX_SETTINGS_NAMESPACE, OPENAI_CODEX_SETTINGS_NS, OPENAI_CODEX_USAGE_URL, OpenAICodexCredentialStore, OpenAICodexSearchProvider, VIEW_IMAGE_TOOL_NAME, apply, assertNoOpenAICodexProviderConflict, decodeOpenAICodexSettings, diagnoseOpenAICodex, inject, installOpenAICodexSearchEvent, loginOpenAICodex, logoutOpenAICodex, mapOpenAICodexSearchResponse, name, openAICodexAuthPath, openAICodexAuthStatus, openAICodexConflictMessage, parseOpenAICodexUsage, readOpenAICodexRateLimits, recordOpenAICodexSearchRequest, resolveOpenAICodexSettings };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
2
|
+
//#region src/invariant.d.ts
|
|
3
|
+
/** Cordis companion plugin name. */
|
|
4
|
+
declare const name = "openai-codex-invariant";
|
|
5
|
+
/** Service required before the companion can register. */
|
|
6
|
+
declare const inject: string[];
|
|
7
|
+
/**
|
|
8
|
+
* Register this package's invariant companion.
|
|
9
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
10
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
11
|
+
*/
|
|
12
|
+
declare const apply: (ctx: Context) => Promise<() => void>;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { apply, inject, name };
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/invariant.ts
|
|
2
|
+
const PACKAGE_NAME = "dsh-codex-connect";
|
|
3
|
+
/** Cordis companion plugin name. */
|
|
4
|
+
const name = "openai-codex-invariant";
|
|
5
|
+
/** Service required before the companion can register. */
|
|
6
|
+
const inject = ["invariants"];
|
|
7
|
+
const install = () => {};
|
|
8
|
+
/**
|
|
9
|
+
* Register this package's invariant companion.
|
|
10
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
11
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
12
|
+
*/
|
|
13
|
+
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
14
|
+
//#endregion
|
|
15
|
+
export { apply, inject, name };
|