@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.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/README.md +2 -0
- package/dist/{app-server-policy-BSaO2JIT.js → app-server-policy-zcBDc1JU.js} +1 -1
- package/dist/attempt-client-cleanup-DMLXUfa8.js +735 -0
- package/dist/{notification-correlation-CU6_AnOb.js → binding-connection-I5Bo-AsX.js} +3 -37
- package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-qgZmzy_4.js} +50 -49
- package/dist/{capabilities-BFDTVYr4.js → capabilities-CybGI1oz.js} +8 -2
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-C336eRVS.js → command-formatters-B1AEz8ZA.js} +18 -18
- package/dist/{command-handlers-DAHUSry9.js → command-handlers-Db8pu_ds.js} +484 -95
- package/dist/{compact-D_uvHurS.js → compact-LspQaGfl.js} +213 -199
- package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
- package/dist/doctor-contract-api.js +40 -43
- package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-BVdyWkUD.js} +2597 -1221
- package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-DIIhAtOZ.js} +20 -15
- package/dist/{event-projector-assistant-message-DTgnPPVF.js → event-projector-assistant-message-BwxV4d6N.js} +11 -23
- package/dist/{attempt-notifications-AP-a-Q5k.js → event-projector-usage-e5huIQWu.js} +113 -29
- package/dist/harness.js +80 -14
- package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
- package/dist/index.js +591 -240
- package/dist/isolated-completion-C58NbL40.js +75 -0
- package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
- package/dist/media-understanding-provider.js +5 -5
- package/dist/{models-BBMKU4jA.js → models-BFlpn1Ex.js} +12 -17
- package/dist/native-subagent-monitor-DyTGmTUx.js +3111 -0
- package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-C3H2CVp6.js} +5 -5
- package/dist/plugin-marketplace-discovery-CzrGJdCR.js +385 -0
- package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-CNJPj4_b.js} +105 -5
- package/dist/protocol-validators-B4F7L8Rf.js +2346 -0
- package/dist/{rate-limits-CU-gVCCS.js → rate-limits-DZXmOL8-.js} +17 -35
- package/dist/{request-qKh331yu.js → request-BRl5_UfX.js} +3 -3
- package/dist/{run-attempt-CY9WlDLc.js → run-attempt-P8BdxC1I.js} +4837 -9047
- package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BVSPdd6g.js} +8 -23
- package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-Cmwc9eIk.js} +6 -13
- package/dist/{session-binding-BXpo9ymA.js → session-binding-DPxIvMgE.js} +246 -265
- package/dist/{session-catalog-DyOgR4WH.js → session-catalog-xwNi_SDM.js} +159 -109
- package/dist/{session-cli-2PZaFLRh.js → session-cli-7hgXZDV7.js} +1 -1
- package/dist/session-retirement-DoMMJFKm.js +36 -0
- package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-CrIFX06J.js} +1 -1
- package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-BRWBO4MO.js} +21 -13
- package/dist/{shared-client-DTbvH-XV.js → shared-client-kIBbGjk4.js} +587 -223
- package/dist/{side-question-_ulBk1AL.js → side-question-9HAL26l9.js} +101 -52
- package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-Bu1BTDXr.js} +694 -753
- package/dist/thread-ownership-6kOQHlyC.js +92 -0
- package/dist/thread-resume-CPrJNQVM.js +30 -0
- package/dist/transcript-mirror-B9gGgnJS.js +570 -0
- package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DIImwDVS.js} +11 -0
- package/dist/upstream-prompt-provenance-ClRBije0.js +41 -0
- package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-CE-_LdnP.js} +5 -5
- package/dist/{usage-CQ6GhD5-.js → usage-CHlV0e-o.js} +3 -3
- package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DRw2Vl42.js} +8 -9
- package/openclaw.plugin.json +18 -3
- package/package.json +5 -5
- package/dist/conversation-control-xsIeXbo4.js +0 -287
- package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
- package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { K as releaseCodexAppServerLiveThread, W as isCodexAppServerLiveThreadClaimed, d as retainSharedCodexAppServerClientByInstanceId, q as retainCodexAppServerLiveThread } from "./shared-client-kIBbGjk4.js";
|
|
2
|
+
import { a as closeCodexStartupClientBestEffort, d as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DMLXUfa8.js";
|
|
3
|
+
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
4
|
+
//#region extensions/codex/src/app-server/thread-ownership.ts
|
|
5
|
+
const nativeThreadOwners = new KeyedAsyncQueue();
|
|
6
|
+
/** Codex subscriptions belong to a physical connection, not the native thread ID alone. */
|
|
7
|
+
function isSameCodexAppServerThreadOwner(current, expected) {
|
|
8
|
+
return current !== void 0 && expected !== void 0 && current.threadId === expected.threadId && current.clientId === expected.clientId;
|
|
9
|
+
}
|
|
10
|
+
/** Fences native subscription and commit together; Codex subscriptions are not reference-counted. */
|
|
11
|
+
async function withExclusiveCodexAppServerThread(params) {
|
|
12
|
+
return await nativeThreadOwners.enqueue(`thread:${params.threadId}`, async () => {
|
|
13
|
+
if (await params.bindingStore.hasOtherThreadOwner(params.threadId, params.identity)) throw new Error(`Codex thread ${params.threadId} is owned by another OpenClaw session or conversation.`);
|
|
14
|
+
return await params.run();
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
/** Serializes bound turns and retirement so detach cannot unsubscribe an active turn. */
|
|
18
|
+
async function withCodexConversationThreadActivity(bindingId, run) {
|
|
19
|
+
return await nativeThreadOwners.enqueue(`conversation:${bindingId}`, run);
|
|
20
|
+
}
|
|
21
|
+
/** Publishes one owned persistent subscription into the shared bounded idle registry. */
|
|
22
|
+
async function retainCodexAppServerBindingSubscription(client, threadId, ownership) {
|
|
23
|
+
return await retainCodexAppServerLiveThread(client, threadId, ownership?.release ?? (async (releasedThreadId) => {
|
|
24
|
+
if (!await unsubscribeCodexThreadBestEffort(client, {
|
|
25
|
+
threadId: releasedThreadId,
|
|
26
|
+
timeoutMs: 5e3
|
|
27
|
+
})) {
|
|
28
|
+
await closeCodexStartupClientBestEffort(client);
|
|
29
|
+
throw new CodexAppServerUnsafeSubscriptionError(`Codex thread subscription could not be released: ${releasedThreadId}`);
|
|
30
|
+
}
|
|
31
|
+
}), ownership?.configFingerprint, ownership?.serviceTier);
|
|
32
|
+
}
|
|
33
|
+
/** Rolls back the exact subscription Codex created before its binding was committed. */
|
|
34
|
+
async function rollbackCodexAppServerBindingSubscription(client, threadId, retained) {
|
|
35
|
+
if (retained && await releaseCodexAppServerLiveThread(client, threadId)) return;
|
|
36
|
+
if (isCodexAppServerLiveThreadClaimed(client, threadId)) return;
|
|
37
|
+
if (!await unsubscribeCodexThreadBestEffort(client, {
|
|
38
|
+
threadId,
|
|
39
|
+
timeoutMs: 5e3
|
|
40
|
+
})) await closeCodexStartupClientBestEffort(client);
|
|
41
|
+
}
|
|
42
|
+
/** Releases only the physical client and native thread recorded by the displaced binding owner. */
|
|
43
|
+
async function releaseCodexAppServerBindingSubscription(binding, options = {}) {
|
|
44
|
+
const clientLease = retainSharedCodexAppServerClientByInstanceId(binding.clientId);
|
|
45
|
+
if (!clientLease) return;
|
|
46
|
+
try {
|
|
47
|
+
if (await releaseCodexAppServerLiveThread(clientLease.client, binding.threadId)) return;
|
|
48
|
+
if (isCodexAppServerLiveThreadClaimed(clientLease.client, binding.threadId)) throw new Error(`Codex thread ${binding.threadId} has an active run; stop it before changing its owner.`);
|
|
49
|
+
if (!options.allowUntracked) return;
|
|
50
|
+
if (!await unsubscribeCodexThreadBestEffort(clientLease.client, {
|
|
51
|
+
threadId: binding.threadId,
|
|
52
|
+
timeoutMs: 5e3
|
|
53
|
+
})) {
|
|
54
|
+
await closeCodexStartupClientBestEffort(clientLease.client);
|
|
55
|
+
throw new CodexAppServerUnsafeSubscriptionError(`Codex retired thread subscription could not be released: ${binding.threadId}`);
|
|
56
|
+
}
|
|
57
|
+
} finally {
|
|
58
|
+
clientLease.release();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
/** Clears and releases one exact conversation generation without touching its replacement. */
|
|
62
|
+
async function retireCodexConversationThreadBinding(params) {
|
|
63
|
+
const expected = await params.bindingStore.read(params.identity);
|
|
64
|
+
if (!expected || params.expectedThreadId && expected.threadId !== params.expectedThreadId) return false;
|
|
65
|
+
return await params.bindingStore.withLease(params.identity, async () => {
|
|
66
|
+
const current = await params.bindingStore.read(params.identity);
|
|
67
|
+
if (current?.threadId !== expected.threadId || params.expectedStartId && current.conversationStartId !== params.expectedStartId) return false;
|
|
68
|
+
await releaseCodexAppServerBindingSubscription(current, { allowUntracked: params.allowUntracked });
|
|
69
|
+
const cleared = await params.bindingStore.mutate(params.identity, {
|
|
70
|
+
kind: "clear",
|
|
71
|
+
threadId: current.threadId
|
|
72
|
+
});
|
|
73
|
+
if (!cleared || !params.afterClear) return cleared;
|
|
74
|
+
try {
|
|
75
|
+
await params.afterClear();
|
|
76
|
+
return true;
|
|
77
|
+
} catch (error) {
|
|
78
|
+
try {
|
|
79
|
+
if (!await params.bindingStore.mutate(params.identity, {
|
|
80
|
+
kind: "set",
|
|
81
|
+
binding: current,
|
|
82
|
+
if: { kind: "absent" }
|
|
83
|
+
})) throw new Error("the previous Codex binding generation could not be restored", { cause: error });
|
|
84
|
+
} catch (restorationError) {
|
|
85
|
+
throw new AggregateError([error, restorationError], `Codex conversation detachment failed and native thread ${current.threadId} could not be restored; run /codex resume ${current.threadId} to recover it`, { cause: restorationError });
|
|
86
|
+
}
|
|
87
|
+
throw error;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
92
|
+
export { rollbackCodexAppServerBindingSubscription as a, retireCodexConversationThreadBinding as i, releaseCodexAppServerBindingSubscription as n, withCodexConversationThreadActivity as o, retainCodexAppServerBindingSubscription as r, withExclusiveCodexAppServerThread as s, isSameCodexAppServerThreadOwner as t };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { F as isCodexAppServerPrewriteRequestCancellationError, s as isCodexAppServerStartSelectionChangedError, z as CodexAppServerRpcError } from "./shared-client-kIBbGjk4.js";
|
|
2
|
+
import { i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-DMLXUfa8.js";
|
|
3
|
+
import { i as assertCodexThreadResumeResponse } from "./protocol-validators-B4F7L8Rf.js";
|
|
4
|
+
//#region extensions/codex/src/app-server/thread-resume.ts
|
|
5
|
+
/** Owns Codex thread/resume subscription safety. */
|
|
6
|
+
/** Resumes one thread and retires the physical client when acceptance is indeterminate. */
|
|
7
|
+
async function resumeCodexAppServerThread(params) {
|
|
8
|
+
const threadId = params.request.threadId;
|
|
9
|
+
let response;
|
|
10
|
+
try {
|
|
11
|
+
response = assertCodexThreadResumeResponse(await params.client.request("thread/resume", params.request, {
|
|
12
|
+
...params.timeoutMs !== void 0 ? { timeoutMs: params.timeoutMs } : {},
|
|
13
|
+
...params.signal ? { signal: params.signal } : {}
|
|
14
|
+
}));
|
|
15
|
+
assertCodexThreadResumeSubscription(threadId, response.thread.id);
|
|
16
|
+
} catch (error) {
|
|
17
|
+
if (isCodexAppServerStartSelectionChangedError(error) || isCodexAppServerPrewriteRequestCancellationError(error)) throw error;
|
|
18
|
+
if (error instanceof CodexAppServerRpcError) throw error;
|
|
19
|
+
try {
|
|
20
|
+
await params.abandonClient();
|
|
21
|
+
} catch (abandonError) {
|
|
22
|
+
throw new CodexAppServerUnsafeSubscriptionError(`Codex thread/resume client could not be retired for ${threadId}`, { cause: abandonError });
|
|
23
|
+
}
|
|
24
|
+
if (error instanceof CodexAppServerUnsafeSubscriptionError) throw error;
|
|
25
|
+
throw new CodexAppServerUnsafeSubscriptionError(error instanceof Error ? error.message : `Codex thread/resume outcome is indeterminate for ${threadId}`, { cause: error });
|
|
26
|
+
}
|
|
27
|
+
return response;
|
|
28
|
+
}
|
|
29
|
+
//#endregion
|
|
30
|
+
export { resumeCodexAppServerThread as t };
|