@openclaw/codex 2026.5.10-beta.3 → 2026.5.10-beta.4
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/dist/{client-factory-BHbKz0nI.js → client-factory-D2P0KD6r.js} +1 -1
- package/dist/{request-Bj4IRDU9.js → command-formatters-Ttwc_kgX.js} +87 -51
- package/dist/{command-handlers-BPaLMsgL.js → command-handlers-iLF1EI-b.js} +303 -12
- package/dist/{compact-CMIpm-H_.js → compact-BJ1UYEyA.js} +2 -2
- package/dist/{rate-limit-cache-BFTJlMhx.js → computer-use-CVLaKaW3.js} +2 -25
- package/dist/{conversation-binding-zeuTIuN2.js → conversation-binding-D4XZ-tvV.js} +4 -3
- package/dist/harness.js +8 -4
- package/dist/index.js +5 -4
- package/dist/media-understanding-provider.js +3 -3
- package/dist/{models-lvthKXfT.js → models-Bg-Qf5s-.js} +2 -2
- package/dist/{protocol-validators-CeCyJaWj.js → protocol-validators-CSY0BFBo.js} +4 -1
- package/dist/provider.js +1 -1
- package/dist/rate-limit-cache-dvhq-4pi.js +24 -0
- package/dist/request-BCAfJvSg.js +41 -0
- package/dist/{run-attempt-COMElKgN.js → run-attempt-DZvighJE.js} +297 -1039
- package/dist/{session-binding-BAaJ-7s-.js → session-binding-UFKjHkKJ.js} +12 -3
- package/dist/{shared-client-BRX9tReb.js → shared-client-K13b0L1X.js} +76 -11
- package/dist/side-question-Dh_g53P9.js +548 -0
- package/dist/test-api.js +1 -1
- package/dist/{thread-lifecycle-DRyCVHhL.js → thread-lifecycle-i42nWiSS.js} +5 -5
- package/dist/vision-tools-Bo0P6gwM.js +1008 -0
- package/package.json +5 -5
- /package/dist/{plugin-activation-Dn14PX1W.js → plugin-activation-C0soz2YD.js} +0 -0
|
@@ -163,10 +163,19 @@ function normalizeCodexAppServerBindingModelProvider(params) {
|
|
|
163
163
|
function resolveCodexAppServerAuthProfileCredential(lookup) {
|
|
164
164
|
const authProfileId = lookup.authProfileId?.trim();
|
|
165
165
|
if (!authProfileId) return;
|
|
166
|
-
return (lookup.authProfileStore ?? loadCodexAppServerAuthProfileStore(
|
|
166
|
+
return (lookup.authProfileStore ?? loadCodexAppServerAuthProfileStore({
|
|
167
|
+
agentDir: lookup.agentDir,
|
|
168
|
+
authProfileId,
|
|
169
|
+
config: lookup.config
|
|
170
|
+
})).profiles[authProfileId];
|
|
167
171
|
}
|
|
168
|
-
function loadCodexAppServerAuthProfileStore(
|
|
169
|
-
return ensureAuthProfileStore(agentDir?.trim() || resolveDefaultAgentDir(config ?? {}), {
|
|
172
|
+
function loadCodexAppServerAuthProfileStore(params) {
|
|
173
|
+
return ensureAuthProfileStore(params.agentDir?.trim() || resolveDefaultAgentDir(params.config ?? {}), {
|
|
174
|
+
allowKeychainPrompt: false,
|
|
175
|
+
config: params.config,
|
|
176
|
+
externalCliProviderIds: [CODEX_APP_SERVER_NATIVE_AUTH_PROVIDER],
|
|
177
|
+
externalCliProfileIds: [params.authProfileId]
|
|
178
|
+
});
|
|
170
179
|
}
|
|
171
180
|
function isCodexAppServerNativeAuthProvider(params) {
|
|
172
181
|
const provider = params.provider?.trim();
|
|
@@ -6,11 +6,12 @@ import { createHash } from "node:crypto";
|
|
|
6
6
|
import { constants, readFileSync } from "node:fs";
|
|
7
7
|
import fs, { access } from "node:fs/promises";
|
|
8
8
|
import path from "node:path";
|
|
9
|
-
import { ensureAuthProfileStore, loadAuthProfileStoreForSecretsRuntime, resolveApiKeyForProfile, resolveAuthProfileOrder, resolveDefaultAgentDir, resolvePersistedAuthProfileOwnerAgentDir, resolveProviderIdForAuth, saveAuthProfileStore } from "openclaw/plugin-sdk/agent-runtime";
|
|
9
|
+
import { ensureAuthProfileStore, ensureAuthProfileStoreWithoutExternalProfiles, loadAuthProfileStoreForSecretsRuntime, refreshOAuthCredentialForRuntime, resolveApiKeyForProfile, resolveAuthProfileOrder, resolveDefaultAgentDir, resolvePersistedAuthProfileOwnerAgentDir, resolveProviderIdForAuth, saveAuthProfileStore } from "openclaw/plugin-sdk/agent-runtime";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { withTimeout } from "openclaw/plugin-sdk/security-runtime";
|
|
12
12
|
//#region extensions/codex/src/app-server/auth-bridge.ts
|
|
13
13
|
const CODEX_APP_SERVER_AUTH_PROVIDER = "openai-codex";
|
|
14
|
+
const OPENAI_PROVIDER = "openai";
|
|
14
15
|
const OPENAI_CODEX_DEFAULT_PROFILE_ID = "openai-codex:default";
|
|
15
16
|
const CODEX_HOME_ENV_VAR = "CODEX_HOME";
|
|
16
17
|
const HOME_ENV_VAR = "HOME";
|
|
@@ -21,7 +22,11 @@ const CODEX_APP_SERVER_ISOLATION_ENV_VARS = [CODEX_HOME_ENV_VAR, HOME_ENV_VAR];
|
|
|
21
22
|
async function bridgeCodexAppServerStartOptions(params) {
|
|
22
23
|
if (params.startOptions.transport !== "stdio") return params.startOptions;
|
|
23
24
|
const isolatedStartOptions = await withAgentCodexHomeEnvironment(params.startOptions, params.agentDir);
|
|
24
|
-
const store =
|
|
25
|
+
const store = ensureCodexAppServerAuthProfileStore({
|
|
26
|
+
agentDir: params.agentDir,
|
|
27
|
+
authProfileId: params.authProfileId,
|
|
28
|
+
config: params.config
|
|
29
|
+
});
|
|
25
30
|
return shouldClearOpenAiApiKeyForCodexAuthProfile({
|
|
26
31
|
store,
|
|
27
32
|
authProfileId: resolveCodexAppServerAuthProfileId({
|
|
@@ -42,16 +47,53 @@ function resolveCodexAppServerAuthProfileId(params) {
|
|
|
42
47
|
})[0]?.trim();
|
|
43
48
|
}
|
|
44
49
|
function resolveCodexAppServerAuthProfileIdForAgent(params) {
|
|
45
|
-
const store =
|
|
50
|
+
const store = ensureCodexAppServerAuthProfileStore({
|
|
51
|
+
agentDir: params.agentDir?.trim() || resolveDefaultAgentDir(params.config ?? {}),
|
|
52
|
+
authProfileId: params.authProfileId,
|
|
53
|
+
config: params.config
|
|
54
|
+
});
|
|
46
55
|
return resolveCodexAppServerAuthProfileId({
|
|
47
56
|
authProfileId: params.authProfileId,
|
|
48
57
|
store,
|
|
49
58
|
config: params.config
|
|
50
59
|
});
|
|
51
60
|
}
|
|
61
|
+
function ensureCodexAppServerAuthProfileStore(params) {
|
|
62
|
+
return ensureAuthProfileStore(params.agentDir, {
|
|
63
|
+
allowKeychainPrompt: false,
|
|
64
|
+
config: params.config,
|
|
65
|
+
externalCliProviderIds: [CODEX_APP_SERVER_AUTH_PROVIDER],
|
|
66
|
+
...params.authProfileId ? { externalCliProfileIds: [params.authProfileId] } : {}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function resolveCodexAppServerAuthProfileStore(params) {
|
|
70
|
+
const overlaidStore = ensureCodexAppServerAuthProfileStore({
|
|
71
|
+
agentDir: params.agentDir,
|
|
72
|
+
authProfileId: params.authProfileId,
|
|
73
|
+
config: params.config
|
|
74
|
+
});
|
|
75
|
+
if (!params.authProfileStore) return overlaidStore;
|
|
76
|
+
const order = params.authProfileStore.order || overlaidStore.order ? {
|
|
77
|
+
...overlaidStore.order,
|
|
78
|
+
...params.authProfileStore.order
|
|
79
|
+
} : void 0;
|
|
80
|
+
return {
|
|
81
|
+
...params.authProfileStore,
|
|
82
|
+
...order ? { order } : {},
|
|
83
|
+
profiles: {
|
|
84
|
+
...overlaidStore.profiles,
|
|
85
|
+
...params.authProfileStore.profiles
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}
|
|
52
89
|
async function resolveCodexAppServerAuthAccountCacheKey(params) {
|
|
53
90
|
const agentDir = params.agentDir?.trim() || resolveDefaultAgentDir(params.config ?? {});
|
|
54
|
-
const store =
|
|
91
|
+
const store = resolveCodexAppServerAuthProfileStore({
|
|
92
|
+
agentDir,
|
|
93
|
+
authProfileId: params.authProfileId,
|
|
94
|
+
authProfileStore: params.authProfileStore,
|
|
95
|
+
config: params.config
|
|
96
|
+
});
|
|
55
97
|
const profileId = resolveCodexAppServerAuthProfileId({
|
|
56
98
|
authProfileId: params.authProfileId,
|
|
57
99
|
store,
|
|
@@ -59,7 +101,7 @@ async function resolveCodexAppServerAuthAccountCacheKey(params) {
|
|
|
59
101
|
});
|
|
60
102
|
if (!profileId) return;
|
|
61
103
|
const credential = store.profiles[profileId];
|
|
62
|
-
if (!credential || !
|
|
104
|
+
if (!credential || !isCodexAppServerAuthProfileCredential(credential, params.config)) return;
|
|
63
105
|
if (credential.type === "api_key") {
|
|
64
106
|
const apiKey = (await resolveApiKeyForProfile({
|
|
65
107
|
store,
|
|
@@ -165,7 +207,11 @@ async function refreshCodexAppServerAuthTokens(params) {
|
|
|
165
207
|
};
|
|
166
208
|
}
|
|
167
209
|
async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
|
|
168
|
-
const store =
|
|
210
|
+
const store = ensureCodexAppServerAuthProfileStore({
|
|
211
|
+
agentDir: params.agentDir,
|
|
212
|
+
authProfileId: params.authProfileId,
|
|
213
|
+
config: params.config
|
|
214
|
+
});
|
|
169
215
|
const profileId = resolveCodexAppServerAuthProfileId({
|
|
170
216
|
authProfileId: params.authProfileId,
|
|
171
217
|
store,
|
|
@@ -174,7 +220,7 @@ async function resolveCodexAppServerAuthProfileLoginParamsInternal(params) {
|
|
|
174
220
|
if (!profileId) return;
|
|
175
221
|
const credential = store.profiles[profileId];
|
|
176
222
|
if (!credential) throw new Error(`Codex app-server auth profile "${profileId}" was not found.`);
|
|
177
|
-
if (!
|
|
223
|
+
if (!isCodexAppServerAuthProfileCredential(credential, params.config)) throw new Error(`Codex app-server auth profile "${profileId}" must be OpenAI Codex auth or an OpenAI API-key backup.`);
|
|
178
224
|
const loginParams = await resolveLoginParamsForCredential(profileId, credential, {
|
|
179
225
|
agentDir: params.agentDir,
|
|
180
226
|
forceOAuthRefresh: params.forceOAuthRefresh === true,
|
|
@@ -227,10 +273,23 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
|
|
|
227
273
|
agentDir: params.agentDir,
|
|
228
274
|
profileId
|
|
229
275
|
});
|
|
230
|
-
const store =
|
|
276
|
+
const store = ensureCodexAppServerAuthProfileStore({
|
|
277
|
+
agentDir: ownerAgentDir,
|
|
278
|
+
authProfileId: profileId,
|
|
279
|
+
config: params.config
|
|
280
|
+
});
|
|
281
|
+
const persistedCredential = ensureAuthProfileStoreWithoutExternalProfiles(ownerAgentDir, { allowKeychainPrompt: false }).profiles[profileId];
|
|
282
|
+
const persistedOAuthCredential = persistedCredential?.type === "oauth" && isCodexAppServerAuthProvider(persistedCredential.provider, params.config) ? persistedCredential : void 0;
|
|
231
283
|
const ownerCredential = store.profiles[profileId];
|
|
232
|
-
const
|
|
233
|
-
|
|
284
|
+
const overlaidOAuthCredential = ownerCredential?.type === "oauth" && isCodexAppServerAuthProvider(ownerCredential.provider, params.config) ? ownerCredential : void 0;
|
|
285
|
+
const credentialForOwner = persistedOAuthCredential ?? overlaidOAuthCredential ?? credential;
|
|
286
|
+
if (params.forceRefresh && !persistedOAuthCredential && overlaidOAuthCredential) {
|
|
287
|
+
const refreshedRuntimeCredential = await refreshOAuthCredentialForRuntime({ credential: overlaidOAuthCredential });
|
|
288
|
+
if (!refreshedRuntimeCredential?.access?.trim()) throw new Error(`Codex app-server auth profile "${profileId}" could not refresh.`);
|
|
289
|
+
store.profiles[profileId] = refreshedRuntimeCredential;
|
|
290
|
+
return refreshedRuntimeCredential;
|
|
291
|
+
}
|
|
292
|
+
if (params.forceRefresh && persistedOAuthCredential) {
|
|
234
293
|
store.profiles[profileId] = {
|
|
235
294
|
...credentialForOwner,
|
|
236
295
|
expires: 0
|
|
@@ -253,6 +312,12 @@ async function resolveOAuthCredentialForCodexAppServer(profileId, credential, pa
|
|
|
253
312
|
function isCodexAppServerAuthProvider(provider, config) {
|
|
254
313
|
return resolveProviderIdForAuth(provider, { config }) === CODEX_APP_SERVER_AUTH_PROVIDER;
|
|
255
314
|
}
|
|
315
|
+
function isOpenAIApiKeyBackupCredential(credential, config) {
|
|
316
|
+
return credential.type === "api_key" && resolveProviderIdForAuth(credential.provider, { config }) === OPENAI_PROVIDER;
|
|
317
|
+
}
|
|
318
|
+
function isCodexAppServerAuthProfileCredential(credential, config) {
|
|
319
|
+
return isCodexAppServerAuthProvider(credential.provider, config) || isOpenAIApiKeyBackupCredential(credential, config);
|
|
320
|
+
}
|
|
256
321
|
function shouldClearOpenAiApiKeyForCodexAuthProfile(params) {
|
|
257
322
|
const profileId = params.authProfileId?.trim();
|
|
258
323
|
return isCodexSubscriptionCredential(profileId ? params.store.profiles[profileId] : params.store.profiles[OPENAI_CODEX_DEFAULT_PROFILE_ID], params.config);
|
|
@@ -531,4 +596,4 @@ function clearSharedClientIfCurrent(client) {
|
|
|
531
596
|
state.key = void 0;
|
|
532
597
|
}
|
|
533
598
|
//#endregion
|
|
534
|
-
export {
|
|
599
|
+
export { withTimeout$1 as a, resolveCodexAppServerAuthProfileId as c, resolveCodexAppServerHomeDir as d, shared_client_exports as i, resolveCodexAppServerAuthProfileIdForAgent as l, createIsolatedCodexAppServerClient as n, refreshCodexAppServerAuthTokens as o, getSharedCodexAppServerClient as r, resolveCodexAppServerAuthAccountCacheKey as s, clearSharedCodexAppServerClientIfCurrent as t, resolveCodexAppServerEnvApiKeyCacheKey as u };
|