@openclaw/codex 2026.7.1-beta.2 → 2026.7.1-beta.5
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/{app-server-policy-B7hqD3Xj.js → app-server-policy-BUk0GLMy.js} +5 -5
- package/dist/{attempt-notifications-tqyQ_Tdn.js → attempt-notifications-BGsEIIDI.js} +5 -40
- package/dist/{command-handlers-C9K-KRU-.js → command-handlers-UVniG5Hl.js} +267 -232
- package/dist/command-rpc-BjgEPh19.js +784 -0
- package/dist/compact-CZzbcygx.js +603 -0
- package/dist/{computer-use-CpurU-G9.js → computer-use-DDeySrnb.js} +3 -3
- package/dist/{config-C_whBx3M.js → config-CYEDnLJ2.js} +36 -15
- package/dist/conversation-binding-data-BHRpYbX3.js +121 -0
- package/dist/doctor-contract-api.js +439 -22
- package/dist/harness.js +29 -10
- package/dist/index.js +1117 -19
- package/dist/{media-understanding-provider-BOeoBhEw.js → media-understanding-provider-DgqRvU2_.js} +13 -8
- package/dist/media-understanding-provider.js +1 -1
- package/dist/{models-DpzY1xpp.js → models-DDmO1zwd.js} +2 -2
- package/dist/notification-correlation-Bo7KB3ks.js +35 -0
- package/dist/{plugin-app-cache-key-BrZUG9jj.js → plugin-app-cache-key-o-AHbdaf.js} +8 -4
- package/dist/{protocol-dh-ETiNd.js → protocol-2POPqAY4.js} +2 -1
- package/dist/{protocol-validators-CJiWigAJ.js → protocol-validators-dZQ-UTOa.js} +116 -59
- package/dist/{provider-capabilities-wqedK49Z.js → provider-capabilities-gTCwjfmh.js} +2916 -114
- package/dist/{provider-nmtMDcGH.js → provider-cc_62eQE.js} +19 -10
- package/dist/provider.js +2 -2
- package/dist/{request-BQuSQF29.js → request-BcJyl8KL.js} +2 -2
- package/dist/{run-attempt-DikbXia_.js → run-attempt-8SPLiDlT.js} +907 -3002
- package/dist/{sandbox-guard-pTY2COoC.js → sandbox-guard-DA2TQfZW.js} +3 -3
- package/dist/session-binding-Dc03iwRF.js +595 -0
- package/dist/session-binding-meta-B7aEMU7g.js +6 -0
- package/dist/{shared-client-rR6TDJA3.js → shared-client-4ICy3U6d.js} +892 -103
- package/dist/{side-question-Ca9wqmd0.js → side-question-DkjXvYv7.js} +132 -140
- package/dist/{thread-lifecycle-D6R40plk.js → thread-lifecycle-BskXnNP-.js} +609 -444
- package/dist/{web-search-provider.runtime-B6eZEFmd.js → web-search-provider.runtime-B5F42P7x.js} +3 -3
- package/npm-shrinkwrap.json +34 -34
- package/openclaw.plugin.json +20 -0
- package/package.json +9 -6
- package/dist/client-IcTBKEqA.js +0 -732
- package/dist/client-factory-DfFu9JH_.js +0 -15
- package/dist/compact-CILptrPS.js +0 -278
- package/dist/conversation-binding-DOJtUxOy.js +0 -1570
- package/dist/rate-limit-cache-C7qmZ0Jh.js +0 -26
- package/dist/session-binding-Cm0Gg7Z1.js +0 -339
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { resolvePositiveTimerTimeoutMs } from "openclaw/plugin-sdk/number-runtime";
|
|
3
|
-
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
3
|
import { createHash, createHmac, randomBytes } from "node:crypto";
|
|
5
4
|
import { readFileSync } from "node:fs";
|
|
6
|
-
import { hostname } from "node:os";
|
|
5
|
+
import { homedir, hostname } from "node:os";
|
|
7
6
|
import { resolveProviderIdForAuth } from "openclaw/plugin-sdk/agent-runtime";
|
|
8
7
|
import { resolveExecApprovalsFromFile } from "openclaw/plugin-sdk/exec-approvals-runtime";
|
|
9
8
|
import { normalizeAgentId } from "openclaw/plugin-sdk/routing";
|
|
10
9
|
import { buildSecretInputSchema, normalizeResolvedSecretInputString } from "openclaw/plugin-sdk/secret-input";
|
|
10
|
+
import { normalizeTrimmedStringList } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
11
11
|
import { detectWindowsSpawnCommandInlineArgs } from "openclaw/plugin-sdk/windows-spawn";
|
|
12
12
|
import { z } from "zod";
|
|
13
13
|
//#region extensions/codex/src/app-server/config.ts
|
|
@@ -27,14 +27,14 @@ const DEFAULT_CODEX_COMPUTER_USE_MCP_SERVER_NAME = "computer-use";
|
|
|
27
27
|
const DEFAULT_CODEX_COMPUTER_USE_MARKETPLACE_DISCOVERY_TIMEOUT_MS = 6e4;
|
|
28
28
|
const DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX = "openclaw-network";
|
|
29
29
|
const codexAppServerTransportSchema = z.enum(["stdio", "websocket"]);
|
|
30
|
+
const codexAppServerHomeScopeSchema = z.enum(["agent", "user"]);
|
|
30
31
|
const SecretInputSchema = buildSecretInputSchema();
|
|
31
32
|
const codexAppServerPolicyModeSchema = z.enum(["yolo", "guardian"]);
|
|
32
|
-
const codexAppServerApprovalPolicySchema = z.enum([
|
|
33
|
+
const codexAppServerApprovalPolicySchema = z.preprocess((value) => value === "on-failure" ? "on-request" : value, z.enum([
|
|
33
34
|
"never",
|
|
34
35
|
"on-request",
|
|
35
|
-
"on-failure",
|
|
36
36
|
"untrusted"
|
|
37
|
-
]);
|
|
37
|
+
]));
|
|
38
38
|
const codexAppServerSandboxSchema = z.enum([
|
|
39
39
|
"read-only",
|
|
40
40
|
"workspace-write",
|
|
@@ -80,6 +80,7 @@ const codexPluginEntryConfigSchema = z.object({
|
|
|
80
80
|
}).strict();
|
|
81
81
|
const codexPluginsConfigSchema = z.object({
|
|
82
82
|
enabled: z.boolean().optional(),
|
|
83
|
+
allow_all_plugins: z.boolean().optional(),
|
|
83
84
|
allow_destructive_actions: codexPluginDestructivePolicySchema.optional(),
|
|
84
85
|
plugins: z.record(z.string(), codexPluginEntryConfigSchema).optional()
|
|
85
86
|
}).strict();
|
|
@@ -104,6 +105,7 @@ const codexPluginConfigSchema = z.object({
|
|
|
104
105
|
appServer: z.object({
|
|
105
106
|
mode: codexAppServerPolicyModeSchema.optional(),
|
|
106
107
|
transport: codexAppServerTransportSchema.optional(),
|
|
108
|
+
homeScope: codexAppServerHomeScopeSchema.optional(),
|
|
107
109
|
command: z.string().optional(),
|
|
108
110
|
args: z.union([z.array(z.string()), z.string()]).optional(),
|
|
109
111
|
url: z.string().optional(),
|
|
@@ -165,6 +167,7 @@ function resolveCodexPluginsPolicy(pluginConfig) {
|
|
|
165
167
|
return {
|
|
166
168
|
configured,
|
|
167
169
|
enabled,
|
|
170
|
+
allowAllPlugins: enabled && config?.allow_all_plugins === true,
|
|
168
171
|
allowDestructiveActions: destructivePolicy.allowDestructiveActions,
|
|
169
172
|
destructiveApprovalMode: destructivePolicy.destructiveApprovalMode,
|
|
170
173
|
pluginPolicies
|
|
@@ -184,6 +187,7 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
184
187
|
const env = params.env ?? process.env;
|
|
185
188
|
const config = readCodexPluginConfig(params.pluginConfig).appServer ?? {};
|
|
186
189
|
const transport = resolveTransport(config.transport);
|
|
190
|
+
const homeScope = config.homeScope === "user" ? "user" : "agent";
|
|
187
191
|
const configCommand = readNonEmptyString(config.command);
|
|
188
192
|
const envCommand = readNonEmptyString(env.OPENCLAW_CODEX_APP_SERVER_BIN);
|
|
189
193
|
const command = configCommand ?? envCommand ?? "codex";
|
|
@@ -222,7 +226,8 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
222
226
|
config: params.config,
|
|
223
227
|
env,
|
|
224
228
|
agentDir: params.agentDir,
|
|
225
|
-
codexConfigToml: params.codexConfigToml
|
|
229
|
+
codexConfigToml: params.codexConfigToml,
|
|
230
|
+
homeScope
|
|
226
231
|
});
|
|
227
232
|
const forceUserReviewer = !canUseModelBackedReviewer && (explicitApprovalsReviewer === "auto_review" || explicitApprovalsReviewer === "guardian_subagent" || explicitPolicyMode === "guardian" && explicitApprovalsReviewer !== "user") || execMode !== void 0 && execMode !== "full" && (execMode !== "auto" || !canUseModelBackedReviewer);
|
|
228
233
|
const forceGuardianReviewer = execMode === "auto" && canUseModelBackedReviewer;
|
|
@@ -259,6 +264,7 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
259
264
|
const serviceTier = normalizeCodexServiceTier(config.serviceTier);
|
|
260
265
|
const resolvedSandbox = forcedPolicy?.sandbox ?? configuredSandbox ?? defaultPolicy?.sandbox ?? (policyMode === "guardian" ? "workspace-write" : "danger-full-access");
|
|
261
266
|
if (transport === "websocket" && !url) throw new Error("plugins.entries.codex.config.appServer.url is required when appServer.transport is websocket");
|
|
267
|
+
if (transport === "websocket" && homeScope === "user") throw new Error("plugins.entries.codex.config.appServer.homeScope=user requires appServer.transport=stdio");
|
|
262
268
|
assertCodexAppServerConnectionClassConfig({
|
|
263
269
|
connectionClass,
|
|
264
270
|
authToken,
|
|
@@ -271,6 +277,7 @@ function resolveCodexAppServerRuntimeOptions(params = {}) {
|
|
|
271
277
|
return {
|
|
272
278
|
start: {
|
|
273
279
|
transport,
|
|
280
|
+
homeScope,
|
|
274
281
|
command,
|
|
275
282
|
commandSource,
|
|
276
283
|
args: args.length > 0 ? args : [
|
|
@@ -435,10 +442,11 @@ function resolveCodexAppServerNetworkProxy(config, sandbox) {
|
|
|
435
442
|
function resolveNetworkProxyPermissionProfileName(config, profile) {
|
|
436
443
|
const explicitProfileName = readNonEmptyString(config.profileName);
|
|
437
444
|
if (explicitProfileName) return explicitProfileName;
|
|
438
|
-
|
|
445
|
+
const suffix = createHash("sha256").update(stableStringifyJson({
|
|
439
446
|
version: 1,
|
|
440
447
|
profile
|
|
441
|
-
})).digest("hex").slice(0, 16)
|
|
448
|
+
})).digest("hex").slice(0, 16);
|
|
449
|
+
return `${DEFAULT_CODEX_APP_SERVER_NETWORK_PROXY_PROFILE_PREFIX}-${suffix}`;
|
|
442
450
|
}
|
|
443
451
|
function fingerprintCodexAppServerNetworkProxyConfigPatch(configPatch) {
|
|
444
452
|
return createHash("sha256").update(stableStringifyJson(configPatch)).digest("hex");
|
|
@@ -463,12 +471,16 @@ function withMcpElicitationsApprovalPolicy(policy) {
|
|
|
463
471
|
if (policy === "never") return { granular: {
|
|
464
472
|
mcp_elicitations: true,
|
|
465
473
|
rules: false,
|
|
466
|
-
sandbox_approval: false
|
|
474
|
+
sandbox_approval: false,
|
|
475
|
+
request_permissions: false,
|
|
476
|
+
skill_approval: false
|
|
467
477
|
} };
|
|
468
478
|
return { granular: {
|
|
469
479
|
mcp_elicitations: true,
|
|
470
480
|
rules: true,
|
|
471
|
-
sandbox_approval: true
|
|
481
|
+
sandbox_approval: true,
|
|
482
|
+
request_permissions: true,
|
|
483
|
+
skill_approval: true
|
|
472
484
|
} };
|
|
473
485
|
}
|
|
474
486
|
function resolveTransport(value) {
|
|
@@ -700,7 +712,9 @@ function globPatternMatches(value, pattern) {
|
|
|
700
712
|
return new RegExp(regex).test(value);
|
|
701
713
|
}
|
|
702
714
|
function normalizeRequirementsApprovalPolicy(value) {
|
|
703
|
-
|
|
715
|
+
const normalized = value.trim().toLowerCase();
|
|
716
|
+
if (normalized === "on-failure") return "on-request";
|
|
717
|
+
return resolveApprovalPolicy(normalized);
|
|
704
718
|
}
|
|
705
719
|
function normalizeRequirementsApprovalsReviewer(value) {
|
|
706
720
|
return resolveApprovalsReviewer(value.trim().toLowerCase());
|
|
@@ -708,7 +722,6 @@ function normalizeRequirementsApprovalsReviewer(value) {
|
|
|
708
722
|
function selectGuardianApprovalPolicy(allowedApprovalPolicies, execModeRequiringPromptingApprovals) {
|
|
709
723
|
if (allowedApprovalPolicies === void 0 || allowedApprovalPolicies.has("on-request")) return "on-request";
|
|
710
724
|
if (execModeRequiringPromptingApprovals) throw new Error(`tools.exec.mode=${execModeRequiringPromptingApprovals} requires Codex app-server prompting approvals`);
|
|
711
|
-
if (allowedApprovalPolicies.has("on-failure")) return "on-failure";
|
|
712
725
|
if (allowedApprovalPolicies.has("untrusted")) return "untrusted";
|
|
713
726
|
if (allowedApprovalPolicies.has("never")) return "never";
|
|
714
727
|
return "on-request";
|
|
@@ -733,7 +746,8 @@ function isTrustedCodexModelBackedApprovalsReviewerProvider(provider, params) {
|
|
|
733
746
|
env: params.env,
|
|
734
747
|
model: params.model,
|
|
735
748
|
agentDir: params.agentDir,
|
|
736
|
-
codexConfigToml: params.codexConfigToml
|
|
749
|
+
codexConfigToml: params.codexConfigToml,
|
|
750
|
+
homeScope: params.homeScope
|
|
737
751
|
});
|
|
738
752
|
}
|
|
739
753
|
function readCodexBaseUrlOverridesForModelBackedReview(params) {
|
|
@@ -766,10 +780,16 @@ function readCodexAppServerConfigToml(params) {
|
|
|
766
780
|
}
|
|
767
781
|
}
|
|
768
782
|
function resolveCodexAppServerConfigPath(params) {
|
|
783
|
+
if (params.homeScope === "user") return path.join(resolveCodexAppServerUserHomeDir(params.env), CODEX_CONFIG_TOML_FILENAME);
|
|
769
784
|
const agentDir = readNonEmptyString(params.agentDir);
|
|
770
785
|
const codexHome = agentDir ? path.join(path.resolve(agentDir), CODEX_APP_SERVER_HOME_DIRNAME) : void 0;
|
|
771
786
|
return codexHome ? path.join(codexHome, CODEX_CONFIG_TOML_FILENAME) : void 0;
|
|
772
787
|
}
|
|
788
|
+
/** Resolves the native user Codex home used by Desktop and the CLI. */
|
|
789
|
+
function resolveCodexAppServerUserHomeDir(env = process.env, homedir$1 = homedir) {
|
|
790
|
+
const configured = readNonEmptyString(env.CODEX_HOME);
|
|
791
|
+
return path.resolve(configured ?? path.join(homedir$1(), ".codex"));
|
|
792
|
+
}
|
|
773
793
|
function readErrorCode(error) {
|
|
774
794
|
return error && typeof error === "object" && "code" in error ? String(error.code) : void 0;
|
|
775
795
|
}
|
|
@@ -860,7 +880,8 @@ function selectGuardianSandbox(allowedSandboxModes) {
|
|
|
860
880
|
return "workspace-write";
|
|
861
881
|
}
|
|
862
882
|
function resolveApprovalPolicy(value) {
|
|
863
|
-
|
|
883
|
+
if (value === "on-failure") return "on-request";
|
|
884
|
+
return value === "on-request" || value === "untrusted" || value === "never" ? value : void 0;
|
|
864
885
|
}
|
|
865
886
|
function resolveSandbox(value) {
|
|
866
887
|
return value === "read-only" || value === "workspace-write" || value === "danger-full-access" ? value : void 0;
|
|
@@ -1114,4 +1135,4 @@ function splitShellWords(value) {
|
|
|
1114
1135
|
return words;
|
|
1115
1136
|
}
|
|
1116
1137
|
//#endregion
|
|
1117
|
-
export {
|
|
1138
|
+
export { shouldAutoApproveCodexAppServerApprovals as _, isCodexAppServerApprovalPolicyAllowedByRequirements as a, isTrustedCodexModelBackedOpenAIProvider as c, resolveCodexAppServerRuntimeOptions as d, resolveCodexAppServerUserHomeDir as f, resolveOpenClawExecPolicyForCodexAppServer as g, resolveCodexPluginsPolicy as h, codexSandboxPolicyForTurn as i, normalizeCodexServiceTier as l, resolveCodexModelBackedReviewerPolicyContext as m, canUseCodexModelBackedApprovalsReviewerForModel as n, isCodexFastServiceTier as o, resolveCodexComputerUseConfig as p, codexAppServerStartOptionsKey as r, isCodexSandboxExecServerEnabled as s, CODEX_PLUGINS_MARKETPLACE_NAME as t, readCodexPluginConfig as u, withMcpElicitationsApprovalPolicy as v };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-8H4AJuhK.js";
|
|
2
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
3
|
+
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
import process from "node:process";
|
|
5
|
+
//#region extensions/codex/src/conversation-binding-data.ts
|
|
6
|
+
var conversation_binding_data_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
createCodexCliNodeConversationBindingData: () => createCodexCliNodeConversationBindingData,
|
|
8
|
+
createCodexConversationBindingData: () => createCodexConversationBindingData,
|
|
9
|
+
legacyCodexConversationBindingId: () => legacyCodexConversationBindingId,
|
|
10
|
+
readCodexConversationBindingData: () => readCodexConversationBindingData,
|
|
11
|
+
readCodexConversationBindingDataRecord: () => readCodexConversationBindingDataRecord,
|
|
12
|
+
resolveCodexDefaultWorkspaceDir: () => resolveCodexDefaultWorkspaceDir
|
|
13
|
+
});
|
|
14
|
+
const APP_SERVER_BINDING_DATA_VERSION = 2;
|
|
15
|
+
const CLI_BINDING_DATA_VERSION = 1;
|
|
16
|
+
function createCodexConversationBindingData(params) {
|
|
17
|
+
const agentId = params.agentId?.trim();
|
|
18
|
+
const agentDir = params.agentDir?.trim();
|
|
19
|
+
const source = readConversationSource(params.source);
|
|
20
|
+
const start = readConversationStart(params.start);
|
|
21
|
+
return {
|
|
22
|
+
kind: "codex-app-server-session",
|
|
23
|
+
version: APP_SERVER_BINDING_DATA_VERSION,
|
|
24
|
+
bindingId: params.bindingId?.trim() || randomUUID(),
|
|
25
|
+
workspaceDir: params.workspaceDir,
|
|
26
|
+
...agentId ? { agentId } : {},
|
|
27
|
+
...agentDir ? { agentDir } : {},
|
|
28
|
+
...source ? { source } : {},
|
|
29
|
+
...start ? { start } : {}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function createCodexCliNodeConversationBindingData(params) {
|
|
33
|
+
const agentId = params.agentId?.trim();
|
|
34
|
+
const cwd = params.cwd?.trim();
|
|
35
|
+
return {
|
|
36
|
+
kind: "codex-cli-node-session",
|
|
37
|
+
version: CLI_BINDING_DATA_VERSION,
|
|
38
|
+
nodeId: params.nodeId,
|
|
39
|
+
sessionId: params.sessionId,
|
|
40
|
+
...agentId ? { agentId } : {},
|
|
41
|
+
...cwd ? { cwd } : {}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function readCodexConversationBindingData(binding) {
|
|
45
|
+
const data = binding?.data;
|
|
46
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return;
|
|
47
|
+
return readCodexConversationBindingDataRecord(data);
|
|
48
|
+
}
|
|
49
|
+
function readCodexConversationBindingDataRecord(data) {
|
|
50
|
+
if (data.kind === "codex-cli-node-session") {
|
|
51
|
+
if (data.version !== CLI_BINDING_DATA_VERSION || typeof data.nodeId !== "string" || !data.nodeId.trim() || typeof data.sessionId !== "string" || !data.sessionId.trim()) return;
|
|
52
|
+
return {
|
|
53
|
+
kind: "codex-cli-node-session",
|
|
54
|
+
version: CLI_BINDING_DATA_VERSION,
|
|
55
|
+
nodeId: data.nodeId.trim(),
|
|
56
|
+
sessionId: data.sessionId.trim(),
|
|
57
|
+
agentId: typeof data.agentId === "string" && data.agentId.trim() ? data.agentId.trim() : void 0,
|
|
58
|
+
cwd: typeof data.cwd === "string" && data.cwd.trim() ? data.cwd.trim() : void 0
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (data.kind !== "codex-app-server-session") return;
|
|
62
|
+
const bindingId = data.version === APP_SERVER_BINDING_DATA_VERSION && typeof data.bindingId === "string" && data.bindingId.trim() ? data.bindingId.trim() : data.version === 1 && typeof data.sessionFile === "string" && data.sessionFile.trim() ? legacyCodexConversationBindingId(data.sessionFile) : void 0;
|
|
63
|
+
if (!bindingId) return;
|
|
64
|
+
const start = readConversationStart(asOptionalRecord(data.start));
|
|
65
|
+
const source = readConversationSource(asOptionalRecord(data.source));
|
|
66
|
+
const legacyBinding = data.version === 1;
|
|
67
|
+
return {
|
|
68
|
+
kind: "codex-app-server-session",
|
|
69
|
+
version: APP_SERVER_BINDING_DATA_VERSION,
|
|
70
|
+
bindingId,
|
|
71
|
+
workspaceDir: typeof data.workspaceDir === "string" && data.workspaceDir.trim() ? data.workspaceDir : process.cwd(),
|
|
72
|
+
agentId: typeof data.agentId === "string" && data.agentId.trim() ? data.agentId.trim() : void 0,
|
|
73
|
+
agentDir: typeof data.agentDir === "string" && data.agentDir.trim() ? data.agentDir.trim() : void 0,
|
|
74
|
+
...source ? { source } : {},
|
|
75
|
+
...start ? { start } : {},
|
|
76
|
+
...legacyBinding ? { legacyBinding: true } : {}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function readConversationSource(value) {
|
|
80
|
+
const agentId = readString(value, "agentId");
|
|
81
|
+
const sessionId = readString(value, "sessionId");
|
|
82
|
+
const threadId = readString(value, "threadId");
|
|
83
|
+
const sessionKey = readString(value, "sessionKey");
|
|
84
|
+
if (!agentId || !sessionId || !threadId) return;
|
|
85
|
+
return {
|
|
86
|
+
agentId,
|
|
87
|
+
sessionId,
|
|
88
|
+
threadId,
|
|
89
|
+
...sessionKey ? { sessionKey } : {}
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/** Doctor/runtime v1 decoder key for shipped conversation bindings that stored a file locator. */
|
|
93
|
+
function legacyCodexConversationBindingId(sessionFile) {
|
|
94
|
+
return `legacy-${createHash("sha256").update(sessionFile).digest("base64url")}`;
|
|
95
|
+
}
|
|
96
|
+
function resolveCodexDefaultWorkspaceDir(pluginConfig) {
|
|
97
|
+
return readString(asOptionalRecord(asOptionalRecord(pluginConfig)?.appServer), "defaultWorkspaceDir") ?? process.cwd();
|
|
98
|
+
}
|
|
99
|
+
function readString(record, key) {
|
|
100
|
+
const value = record?.[key];
|
|
101
|
+
return typeof value === "string" && value.trim() ? value.trim() : void 0;
|
|
102
|
+
}
|
|
103
|
+
function readConversationStart(value) {
|
|
104
|
+
const read = (key) => {
|
|
105
|
+
const candidate = value?.[key];
|
|
106
|
+
return typeof candidate === "string" && candidate.trim() ? candidate.trim() : void 0;
|
|
107
|
+
};
|
|
108
|
+
const start = {
|
|
109
|
+
id: read("id"),
|
|
110
|
+
threadId: read("threadId"),
|
|
111
|
+
model: read("model"),
|
|
112
|
+
modelProvider: read("modelProvider"),
|
|
113
|
+
authProfileId: read("authProfileId")
|
|
114
|
+
};
|
|
115
|
+
return start.id ? {
|
|
116
|
+
...start,
|
|
117
|
+
id: start.id
|
|
118
|
+
} : void 0;
|
|
119
|
+
}
|
|
120
|
+
//#endregion
|
|
121
|
+
export { readCodexConversationBindingDataRecord as a, readCodexConversationBindingData as i, createCodexCliNodeConversationBindingData as n, resolveCodexDefaultWorkspaceDir as o, createCodexConversationBindingData as r, conversation_binding_data_exports as t };
|