@openclaw/codex 2026.9.1-beta.1 → 2026.9.2
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/api.js +8 -9
- package/dist/{attempt-client-cleanup-bfsmcQ6m.js → attempt-client-cleanup-Bp1ZOnk2.js} +105 -75
- package/dist/attempt-context-CSazkWns.js +634 -0
- package/dist/{auth-binding-B4FfbcCg.js → auth-binding-Ds_QVm-X.js} +18 -3
- package/dist/{bounded-turn-B7iBUcuP.js → bounded-turn-DxGJRYbY.js} +53 -57
- package/dist/{capabilities-BRMh0aIq.js → capabilities-B1mgvpP8.js} +2 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-DEsIufkt.js → command-formatters-DSbGMXA0.js} +5 -4
- package/dist/{command-handlers-D_-1_qRp.js → command-handlers-DOJvGv6-.js} +243 -148
- package/dist/{compact-BglNFZrQ.js → compact-Y_xBqrHN.js} +109 -65
- package/dist/{config-giW8X0QA.js → config-CyapYSji.js} +328 -374
- package/dist/config-utils-C57JiJrU.js +69 -0
- package/dist/{context-compaction-activity-BOeJf7yo.js → context-compaction-activity-CMla5FPJ.js} +4 -1
- package/dist/{conversation-binding-data-CW2GuupV.js → conversation-binding-data-BiodpIzq.js} +2 -1
- package/dist/doctor-contract-api.js +144 -14
- package/dist/{dynamic-tools-Dnlfa--w.js → dynamic-tools-BwpvTxaX.js} +1119 -1135
- package/dist/{effective-mcp-catalog-CTeGrnfO.js → effective-mcp-catalog-CY9Jn4bA.js} +4 -3
- package/dist/{event-projector-assistant-message-C5-Ds8mA.js → event-projector-assistant-message-B9kp6iGC.js} +15 -6
- package/dist/event-projector-usage-ZqEVbAEY.js +212 -0
- package/dist/{harness-Csz0F-DK.js → harness-Czh2Sdoc.js} +65 -52
- package/dist/harness.js +1 -1
- package/dist/{image-payload-sanitizer-CnfoUPCE.js → image-payload-sanitizer-tupAr-2o.js} +29 -15
- package/dist/index.js +495 -457
- package/dist/{isolated-completion-Cv6FqygM.js → isolated-completion-CRh-51AK.js} +9 -21
- package/dist/{managed-binary-DFYK4DWq.js → managed-binary-DcpnJF9x.js} +117 -80
- package/dist/media-understanding-provider.js +1 -1
- package/dist/model-catalog-DT5vo6qo.js +101 -0
- package/dist/{models-TS3HBU-q.js → models-CcrgSMQR.js} +26 -29
- package/dist/{native-subagent-monitor-4Mfq2HDs.js → native-subagent-monitor-B3bvQGcg.js} +63 -122
- package/dist/{node-exec-server.runtime-BpWqJO1V.js → node-exec-server.runtime-nfbUOtUB.js} +10 -7
- package/dist/{plugin-approval-roundtrip-bUm777tR.js → plugin-approval-roundtrip-aQVdyL5g.js} +30 -3
- package/dist/{plugin-marketplace-discovery-B9DvaAG-.js → plugin-marketplace-discovery-B7gHXJ3d.js} +44 -30
- package/dist/{plugin-metadata-cache-CTCT3w5L.js → plugin-metadata-cache-BwCLTY_U.js} +6 -6
- package/dist/provider-capabilities-BpG9Ltc5.js +101 -0
- package/dist/{rate-limits-C5_D8Gmb.js → rate-limits-Fx_l4eNa.js} +3 -2
- package/dist/{sandbox-guard-kuWTn9C5.js → request-C8H22rPi.js} +195 -2
- package/dist/{run-attempt-DYc0QCBF.js → run-attempt-BzthFQSM.js} +1616 -2634
- package/dist/{runtime-artifact-BvyT1uyd.js → runtime-artifact-Bh_gf6-t.js} +22 -15
- package/dist/{session-binding-Bcynfd-_.js → session-binding-4Ki04sW-.js} +282 -399
- package/dist/session-binding-record-CyaXZvTe.js +270 -0
- package/dist/{session-catalog-DaLKVtpH.js → session-catalog-B47uwekb.js} +812 -504
- package/dist/{session-cli-DMc4oS2w.js → session-cli-BjLhpmS1.js} +1 -1
- package/dist/session-history-DWmMqiqW.js +93 -0
- package/dist/session-history-read-LHldwvyh.js +36 -0
- package/dist/session-history-worker-runtime.js +48 -0
- package/dist/session-history.worker-zZVcx0ME.js +267 -0
- package/dist/session-history.worker.js +2 -0
- package/dist/session-initialization-BCFVnLL4.js +75 -0
- package/dist/{session-permission-policy-BrNH1bjy.js → session-permission-policy-BaueHmSj.js} +2 -2
- package/dist/session-retirement-DNdmYdFc.js +97 -0
- package/dist/{session-upstream-marker-BIkusb95.js → session-upstream-marker-DReTpGz6.js} +20 -4
- package/dist/settled-turn-context-BOM3Y1pl.js +45 -0
- package/dist/settled-turn-finalizer-BI-b1sry.js +115 -0
- package/dist/{shared-client-DKz23hHY.js → shared-client-CKhX2kFt.js} +3659 -847
- package/dist/{side-question-DjA_jsNe.js → side-question-B6DWAw1A.js} +168 -81
- package/dist/{thread-lifecycle-L7oEkTlq.js → thread-lifecycle-DPK30jad.js} +2412 -2145
- package/dist/{thread-ownership-DZeuKH1j.js → thread-ownership-CbucAmmp.js} +27 -16
- package/dist/thread-policy-CTalhWFy.js +105 -0
- package/dist/{plugin-app-cache-key-C1CAdfcP.js → thread-resume-BLgqkUc1.js} +61 -9
- package/dist/{transcript-mirror-DsCMWBca.js → transcript-mirror-_njEB84z.js} +114 -110
- package/dist/transcript-mirror-attestation-Byl34PC-.js +76 -0
- package/dist/transport-stdio-CzTngV0j.js +728 -0
- package/dist/{upstream-prompt-provenance-CFmsKwr9.js → upstream-prompt-provenance-LphB8slG.js} +8 -4
- package/dist/upstream-session-fork-1fwbNKzQ.js +886 -0
- package/dist/{usage-ROIaW3wo.js → usage-i9fv5-4m.js} +3 -3
- package/dist/{web-search-provider.runtime-ClaNPV7N.js → web-search-provider.runtime-DKQn67A7.js} +3 -3
- package/openclaw.plugin.json +1 -30
- package/package.json +6 -6
- package/dist/binding-connection-BMvPX73o.js +0 -45
- package/dist/command-rpc-CCeCkf_v.js +0 -90
- package/dist/event-projector-usage-Bk1I90Bg.js +0 -328
- package/dist/incognito-session-ET_ufDH-.js +0 -2
- package/dist/model-catalog-i9rNBthX.js +0 -48
- package/dist/protocol-validators-VeJxxJ0U.js +0 -2421
- package/dist/request-DXXGHko0.js +0 -157
- package/dist/session-catalog-home-id-BNwAJ9D7.js +0 -18
- package/dist/session-retirement-CcNC3YSY.js +0 -36
- package/dist/settled-turn-finalizer-Dc3ApjU4.js +0 -328
- package/dist/thread-resume-BE9qNEW0.js +0 -30
- package/dist/transport-stdio-DhoGy33Z.js +0 -99
- package/dist/upstream-session-fork-DlaHxSLC.js +0 -326
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { g as CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN, i as normalizeCodexServiceTier } from "./config-utils-C57JiJrU.js";
|
|
2
|
+
import { createHash } from "node:crypto";
|
|
3
|
+
import { resolveSessionAgentIdsStrict } from "openclaw/plugin-sdk/agent-scope-runtime";
|
|
4
|
+
import { getSessionEntry, resolveStorePath } from "openclaw/plugin-sdk/session-store-runtime";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region extensions/codex/src/app-server/session-binding-record.ts
|
|
7
|
+
/** Canonical binding codec and synchronous generation-aware reads; no lifecycle or auth loading. */
|
|
8
|
+
/** Resolves the same agent scope OpenClaw uses for transcript/session ownership. */
|
|
9
|
+
function sessionBindingIdentity(params) {
|
|
10
|
+
const { sessionAgentId } = resolveSessionAgentIdsStrict(params);
|
|
11
|
+
const sessionKey = params.sessionKey?.trim();
|
|
12
|
+
return {
|
|
13
|
+
kind: "session",
|
|
14
|
+
agentId: sessionAgentId,
|
|
15
|
+
sessionId: params.sessionId,
|
|
16
|
+
...sessionKey ? { sessionKey } : {}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const optionalStringSchema = z.string().optional().catch(void 0);
|
|
20
|
+
const optionalBooleanSchema = z.boolean().optional().catch(void 0);
|
|
21
|
+
const optionalNonBlankStringSchema = z.string().refine((value) => Boolean(value.trim())).optional().catch(void 0);
|
|
22
|
+
const optionalTimestampSchema = z.string().refine((value) => Number.isFinite(Date.parse(value))).optional().catch(void 0);
|
|
23
|
+
const pendingSupervisionBranchSchema = z.object({
|
|
24
|
+
sourceThreadId: z.string().trim().min(1),
|
|
25
|
+
connectionFingerprint: z.string().trim().min(1).optional(),
|
|
26
|
+
lastTurnId: z.string().trim().min(1).optional(),
|
|
27
|
+
cleanupThreadIds: z.array(z.string().trim().min(1)).max(2).optional()
|
|
28
|
+
}).strict().superRefine((pending, context) => {
|
|
29
|
+
const cleanupThreadIds = pending.cleanupThreadIds ?? [];
|
|
30
|
+
if (new Set(cleanupThreadIds).size !== cleanupThreadIds.length) context.addIssue({
|
|
31
|
+
code: "custom",
|
|
32
|
+
message: "pending supervision cleanup thread ids must be unique"
|
|
33
|
+
});
|
|
34
|
+
if (cleanupThreadIds.includes(pending.sourceThreadId)) context.addIssue({
|
|
35
|
+
code: "custom",
|
|
36
|
+
message: "pending supervision cleanup cannot target its source"
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
const contextEngineProjectionSchema = z.object({
|
|
40
|
+
schemaVersion: z.literal(1),
|
|
41
|
+
mode: z.literal("thread_bootstrap"),
|
|
42
|
+
epoch: z.string().refine((value) => Boolean(value.trim())),
|
|
43
|
+
fingerprint: optionalStringSchema
|
|
44
|
+
}).strict();
|
|
45
|
+
const contextEngineSchema = z.object({
|
|
46
|
+
schemaVersion: z.literal(1),
|
|
47
|
+
engineId: z.string(),
|
|
48
|
+
policyFingerprint: z.string(),
|
|
49
|
+
projection: contextEngineProjectionSchema.optional().catch(void 0)
|
|
50
|
+
}).strict();
|
|
51
|
+
const destructiveApprovalModeSchema = z.enum([
|
|
52
|
+
"allow",
|
|
53
|
+
"deny",
|
|
54
|
+
"auto",
|
|
55
|
+
"ask"
|
|
56
|
+
]).optional().catch(void 0);
|
|
57
|
+
const accountAppPolicyEntrySchema = z.object({
|
|
58
|
+
source: z.literal("account"),
|
|
59
|
+
appName: z.string(),
|
|
60
|
+
allowDestructiveActions: z.boolean(),
|
|
61
|
+
allowOpenWorld: z.boolean().optional(),
|
|
62
|
+
destructiveApprovalMode: destructiveApprovalModeSchema,
|
|
63
|
+
mcpServerNames: z.array(z.string())
|
|
64
|
+
}).strict();
|
|
65
|
+
const pluginAppPolicyEntrySchema = z.object({
|
|
66
|
+
source: z.literal("plugin").optional(),
|
|
67
|
+
configKey: z.string(),
|
|
68
|
+
marketplaceName: z.string().regex(CODEX_PLUGIN_MARKETPLACE_NAME_PATTERN),
|
|
69
|
+
pluginName: z.string(),
|
|
70
|
+
allowDestructiveActions: z.boolean(),
|
|
71
|
+
allowOpenWorld: z.boolean().optional(),
|
|
72
|
+
destructiveApprovalMode: destructiveApprovalModeSchema,
|
|
73
|
+
mcpServerNames: z.array(z.string())
|
|
74
|
+
}).strict();
|
|
75
|
+
const pluginAppPolicyContextSchema = z.object({
|
|
76
|
+
fingerprint: z.string(),
|
|
77
|
+
apps: z.record(z.string(), z.union([accountAppPolicyEntrySchema, pluginAppPolicyEntrySchema])),
|
|
78
|
+
pluginAppIds: z.record(z.string(), z.array(z.string())).default({})
|
|
79
|
+
}).strict();
|
|
80
|
+
const threadBindingSchema = z.object({
|
|
81
|
+
threadId: z.string().refine((value) => Boolean(value.trim())),
|
|
82
|
+
clientId: optionalStringSchema,
|
|
83
|
+
cwd: z.string(),
|
|
84
|
+
rolloutPath: optionalNonBlankStringSchema,
|
|
85
|
+
connectionScope: z.literal("supervision").optional(),
|
|
86
|
+
supervisionSourceThreadId: z.string().trim().min(1).optional(),
|
|
87
|
+
authProfileId: optionalStringSchema,
|
|
88
|
+
agentWorkspaceDeveloperInstructions: optionalNonBlankStringSchema,
|
|
89
|
+
model: optionalStringSchema,
|
|
90
|
+
preserveNativeModel: z.literal(true).optional().catch(void 0),
|
|
91
|
+
pendingSupervisionBranch: pendingSupervisionBranchSchema.optional(),
|
|
92
|
+
pendingResumeConfiguration: z.literal(true).optional(),
|
|
93
|
+
modelProvider: z.string().transform((value) => value.trim()).pipe(z.string().min(1)).optional().catch(void 0),
|
|
94
|
+
approvalPolicy: z.preprocess((value) => value === "on-failure" ? "on-request" : value, z.enum([
|
|
95
|
+
"never",
|
|
96
|
+
"on-request",
|
|
97
|
+
"untrusted"
|
|
98
|
+
]).optional()).catch(void 0),
|
|
99
|
+
sandbox: z.enum([
|
|
100
|
+
"read-only",
|
|
101
|
+
"workspace-write",
|
|
102
|
+
"danger-full-access"
|
|
103
|
+
]).optional().catch(void 0),
|
|
104
|
+
serviceTier: z.preprocess(normalizeCodexServiceTier, z.custom((value) => typeof value === "string").optional()).optional().catch(void 0),
|
|
105
|
+
networkProxyProfileName: optionalStringSchema,
|
|
106
|
+
networkProxyConfigFingerprint: optionalStringSchema,
|
|
107
|
+
dynamicToolsFingerprint: optionalStringSchema,
|
|
108
|
+
dynamicToolsContainDeferred: optionalBooleanSchema,
|
|
109
|
+
webSearchThreadConfigFingerprint: optionalStringSchema,
|
|
110
|
+
nativeSkillIsolationFingerprint: optionalStringSchema,
|
|
111
|
+
userMcpServersFingerprint: optionalStringSchema,
|
|
112
|
+
mcpServersFingerprint: optionalStringSchema,
|
|
113
|
+
configuredMcpOwnershipVersion: z.literal(1).optional().catch(void 0),
|
|
114
|
+
ringZeroConfigFingerprint: optionalStringSchema,
|
|
115
|
+
ringZeroClientInstanceId: optionalStringSchema,
|
|
116
|
+
/** Durable fact preventing a later unrestricted turn from widening this thread. */
|
|
117
|
+
nativeToolPolicyRestricted: z.literal(true).optional().catch(void 0),
|
|
118
|
+
nativeHookRelayGeneration: optionalNonBlankStringSchema,
|
|
119
|
+
appServerRuntimeFingerprint: optionalStringSchema,
|
|
120
|
+
pluginAppsFingerprint: optionalStringSchema,
|
|
121
|
+
pluginAppsInputFingerprint: optionalStringSchema,
|
|
122
|
+
pluginAppPolicyContext: pluginAppPolicyContextSchema.optional().catch(void 0),
|
|
123
|
+
contextEngine: contextEngineSchema.optional().catch(void 0),
|
|
124
|
+
environmentSelectionFingerprint: optionalStringSchema,
|
|
125
|
+
conversationStartId: optionalStringSchema,
|
|
126
|
+
conversationSourceTransferComplete: z.literal(true).optional().catch(void 0),
|
|
127
|
+
historyCoveredThrough: optionalTimestampSchema,
|
|
128
|
+
continuityCalibration: z.object({
|
|
129
|
+
promptChars: z.number().int().positive(),
|
|
130
|
+
inputTokens: z.number().int().positive()
|
|
131
|
+
}).optional().catch(void 0)
|
|
132
|
+
}).superRefine((binding, context) => {
|
|
133
|
+
if (binding.connectionScope === "supervision") {
|
|
134
|
+
if (!binding.supervisionSourceThreadId) context.addIssue({
|
|
135
|
+
code: "custom",
|
|
136
|
+
message: "supervision connection ownership requires its native source thread id"
|
|
137
|
+
});
|
|
138
|
+
if (binding.preserveNativeModel !== true) context.addIssue({
|
|
139
|
+
code: "custom",
|
|
140
|
+
message: "supervision connection ownership requires native model ownership"
|
|
141
|
+
});
|
|
142
|
+
if (binding.conversationSourceTransferComplete !== true) context.addIssue({
|
|
143
|
+
code: "custom",
|
|
144
|
+
message: "supervision connection ownership requires a completed source transfer"
|
|
145
|
+
});
|
|
146
|
+
if (!binding.pendingSupervisionBranch && (!binding.model?.trim() || !binding.modelProvider)) context.addIssue({
|
|
147
|
+
code: "custom",
|
|
148
|
+
message: "materialized supervision bindings require a native model and provider"
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (binding.supervisionSourceThreadId && binding.connectionScope !== "supervision") context.addIssue({
|
|
152
|
+
code: "custom",
|
|
153
|
+
message: "a supervision source thread id requires supervision connection ownership"
|
|
154
|
+
});
|
|
155
|
+
if (!binding.pendingSupervisionBranch) return;
|
|
156
|
+
if (binding.threadId !== binding.pendingSupervisionBranch.sourceThreadId) context.addIssue({
|
|
157
|
+
code: "custom",
|
|
158
|
+
message: "pending supervision source must match the provisional thread binding"
|
|
159
|
+
});
|
|
160
|
+
if (binding.supervisionSourceThreadId !== binding.pendingSupervisionBranch.sourceThreadId) context.addIssue({
|
|
161
|
+
code: "custom",
|
|
162
|
+
message: "pending supervision source must match its durable source identity"
|
|
163
|
+
});
|
|
164
|
+
if (binding.preserveNativeModel !== true) context.addIssue({
|
|
165
|
+
code: "custom",
|
|
166
|
+
message: "pending supervision bindings must defer model selection to Codex App Server"
|
|
167
|
+
});
|
|
168
|
+
if (binding.connectionScope !== "supervision") context.addIssue({
|
|
169
|
+
code: "custom",
|
|
170
|
+
message: "pending supervision bindings require supervision connection ownership"
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
const bindingLeaseSchema = z.object({
|
|
174
|
+
token: z.string().refine((value) => Boolean(value.trim())),
|
|
175
|
+
expiresAt: z.number().finite()
|
|
176
|
+
});
|
|
177
|
+
const storedSessionIdSchema = z.string().transform((value) => value.trim()).pipe(z.string().min(1)).optional().catch(void 0);
|
|
178
|
+
const storedBindingSchema = z.discriminatedUnion("state", [z.object({
|
|
179
|
+
version: z.literal(1),
|
|
180
|
+
state: z.literal("active"),
|
|
181
|
+
binding: threadBindingSchema,
|
|
182
|
+
sessionId: storedSessionIdSchema,
|
|
183
|
+
lease: bindingLeaseSchema.optional().catch(void 0)
|
|
184
|
+
}), z.object({
|
|
185
|
+
version: z.literal(1),
|
|
186
|
+
state: z.literal("cleared"),
|
|
187
|
+
sessionId: storedSessionIdSchema,
|
|
188
|
+
lease: bindingLeaseSchema.optional().catch(void 0),
|
|
189
|
+
retired: z.literal(true).optional().catch(void 0)
|
|
190
|
+
})]);
|
|
191
|
+
/** Stable plugin-state key for one current binding owner. */
|
|
192
|
+
function bindingStoreKey(identity) {
|
|
193
|
+
if (identity.kind === "session") {
|
|
194
|
+
const rawAgentId = identity.agentId.trim();
|
|
195
|
+
const sessionId = identity.sessionId.trim();
|
|
196
|
+
if (!rawAgentId) throw new Error("Codex app-server binding requires an agent id");
|
|
197
|
+
if (!sessionId) throw new Error("Codex app-server binding requires a session id");
|
|
198
|
+
const agentId = resolveSessionAgentIdsStrict({ agentId: rawAgentId }).sessionAgentId;
|
|
199
|
+
const sessionKey = identity.sessionKey?.trim();
|
|
200
|
+
if (sessionKey) return `session-key:${agentId}:${createHash("sha256").update(sessionKey).digest("base64url")}`;
|
|
201
|
+
return `session:${agentId}:${sessionId}`;
|
|
202
|
+
}
|
|
203
|
+
const bindingId = identity.bindingId.trim();
|
|
204
|
+
if (!bindingId) throw new Error("Codex app-server conversation binding requires a binding id");
|
|
205
|
+
return `conversation:${bindingId}`;
|
|
206
|
+
}
|
|
207
|
+
function readStoredCodexAppServerBinding(value) {
|
|
208
|
+
const result = storedBindingSchema.safeParse(value);
|
|
209
|
+
if (!result.success) return;
|
|
210
|
+
return stripUndefinedValue(result.data);
|
|
211
|
+
}
|
|
212
|
+
function ownsStoredSessionGeneration(identity, current) {
|
|
213
|
+
return identity.kind !== "session" || !current?.sessionId || current.sessionId === identity.sessionId;
|
|
214
|
+
}
|
|
215
|
+
function validateBindingForWrite(binding) {
|
|
216
|
+
const validated = readCodexAppServerThreadBinding(binding);
|
|
217
|
+
if (!validated) throw new Error("Invalid Codex app-server thread binding");
|
|
218
|
+
return stripUndefinedBinding(validated);
|
|
219
|
+
}
|
|
220
|
+
/** Parses stored or shipped sidecar data into the current domain value. */
|
|
221
|
+
function readCodexAppServerThreadBinding(value) {
|
|
222
|
+
const result = threadBindingSchema.safeParse(value);
|
|
223
|
+
if (!result.success) return;
|
|
224
|
+
return result.data;
|
|
225
|
+
}
|
|
226
|
+
function stripUndefinedBinding(binding) {
|
|
227
|
+
return stripUndefinedValue(binding);
|
|
228
|
+
}
|
|
229
|
+
function stripUndefinedValue(value) {
|
|
230
|
+
if (Array.isArray(value)) return value.map(stripUndefinedValue);
|
|
231
|
+
if (!value || typeof value !== "object") return value;
|
|
232
|
+
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== void 0).map(([key, entry]) => [key, stripUndefinedValue(entry)]));
|
|
233
|
+
}
|
|
234
|
+
function readCodexBindingTimestamp(value) {
|
|
235
|
+
return optionalTimestampSchema.parse(value);
|
|
236
|
+
}
|
|
237
|
+
/** The same physical-generation check serves execution and read-only projections. */
|
|
238
|
+
function readCurrentCodexAppServerBinding(state, identity) {
|
|
239
|
+
const key = bindingStoreKey(identity);
|
|
240
|
+
const raw = state.lookup(key);
|
|
241
|
+
const stored = readStoredCodexAppServerBinding(raw);
|
|
242
|
+
if (raw !== void 0 && !stored) throw new Error(`Invalid Codex app-server binding row: ${key}`);
|
|
243
|
+
return stored?.state === "active" && ownsStoredSessionGeneration(identity, stored) ? stored.binding : void 0;
|
|
244
|
+
}
|
|
245
|
+
/** Host lineage is recorded in the same transaction as its successor generation. */
|
|
246
|
+
function readCodexBindingSessionEntry(params) {
|
|
247
|
+
const { identity } = params;
|
|
248
|
+
return identity.sessionKey?.trim() ? getSessionEntry({
|
|
249
|
+
agentId: identity.agentId,
|
|
250
|
+
sessionKey: identity.sessionKey.trim(),
|
|
251
|
+
storePath: params.storePath?.trim() || resolveStorePath(params.config?.session?.store, { agentId: identity.agentId }),
|
|
252
|
+
hydrateSkillPromptRefs: false,
|
|
253
|
+
readConsistency: "latest"
|
|
254
|
+
}) : void 0;
|
|
255
|
+
}
|
|
256
|
+
/** Synchronous model selection recognizes the predecessor; admission rewrites its fence. */
|
|
257
|
+
function readCodexSessionOwnershipBinding(params) {
|
|
258
|
+
const binding = params.bindingStore.read(params.identity);
|
|
259
|
+
if (binding || params.identity.kind !== "session") return binding;
|
|
260
|
+
const entry = readCodexBindingSessionEntry({
|
|
261
|
+
...params,
|
|
262
|
+
identity: params.identity
|
|
263
|
+
});
|
|
264
|
+
return entry?.sessionId === params.identity.sessionId && entry.previousSessionId ? params.bindingStore.read({
|
|
265
|
+
...params.identity,
|
|
266
|
+
sessionId: entry.previousSessionId
|
|
267
|
+
}) : void 0;
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
270
|
+
export { readCodexBindingTimestamp as a, readStoredCodexAppServerBinding as c, validateBindingForWrite as d, readCodexBindingSessionEntry as i, sessionBindingIdentity as l, ownsStoredSessionGeneration as n, readCodexSessionOwnershipBinding as o, readCodexAppServerThreadBinding as r, readCurrentCodexAppServerBinding as s, bindingStoreKey as t, stripUndefinedBinding as u };
|