@openclaw/codex 2026.7.2-beta.7 → 2026.8.1-beta.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/README.md +2 -0
- package/dist/api.js +147 -0
- package/dist/app-server-policy-bg5QPSVP.js +25 -0
- package/dist/attempt-client-cleanup-URjUlCHg.js +735 -0
- package/dist/binding-connection-DAvZwp96.js +45 -0
- package/dist/{bounded-turn-D2ZAgZVz.js → bounded-turn-4BjrZEwW.js} +63 -56
- package/dist/{capabilities-BFDTVYr4.js → capabilities-CH3K57v4.js} +8 -2
- package/dist/cli-metadata.js +1 -1
- package/dist/{command-formatters-C336eRVS.js → command-formatters-D0nZ3qtd.js} +18 -18
- package/dist/{command-handlers-DAHUSry9.js → command-handlers-DC86lgT4.js} +507 -101
- package/dist/command-rpc-xUIIonsO.js +90 -0
- package/dist/{compact-D_uvHurS.js → compact-COqgBRny.js} +234 -214
- package/dist/{session-binding-BXpo9ymA.js → config-CpNeo5AE.js} +284 -1163
- package/dist/context-compaction-activity-BOeJf7yo.js +58 -0
- package/dist/{conversation-binding-data-BHRpYbX3.js → conversation-binding-data-CW2GuupV.js} +6 -10
- package/dist/doctor-contract-api.js +48 -50
- package/dist/{dynamic-tools-D2gYkSBO.js → dynamic-tools-fJZhl4CE.js} +3442 -1433
- package/dist/{effective-mcp-catalog-Bbd98Inw.js → effective-mcp-catalog-4YKn51aG.js} +20 -15
- package/dist/elicitation-input-DMkeki8d.js +71 -0
- 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-CLwNEJqW.js} +113 -29
- package/dist/harness-DoKQcF8n.js +258 -0
- package/dist/harness.js +2 -160
- package/dist/image-payload-sanitizer-CnfoUPCE.js +65 -0
- package/dist/index.js +730 -256
- package/dist/isolated-completion-DPMtlH9r.js +75 -0
- package/dist/local-runtime-attribution-B_2mnqhb.js +19 -0
- package/dist/managed-binary-By4FZC6i.js +212 -0
- package/dist/media-understanding-provider.js +5 -5
- package/dist/model-catalog-CmGoqVKB.js +48 -0
- package/dist/{models-BBMKU4jA.js → models-CZw1wClT.js} +12 -17
- package/dist/native-subagent-monitor-GGq3RnOo.js +3225 -0
- package/dist/node-exec-server.runtime-Bsu1LdFZ.js +192 -0
- package/dist/{plugin-app-cache-key-DztPafOA.js → plugin-app-cache-key-DMNQ8Zi8.js} +18 -6
- package/dist/plugin-approval-roundtrip-C75Yiiwc.js +95 -0
- package/dist/plugin-marketplace-discovery-CSWDkMrP.js +399 -0
- package/dist/{computer-use-CYEc8U3w.js → plugin-metadata-cache-BXH5NF-4.js} +109 -6
- package/dist/protocol-validators-VAVyEnDp.js +2399 -0
- package/dist/{rate-limits-CU-gVCCS.js → rate-limits-BI1dMHDG.js} +17 -35
- package/dist/{request-qKh331yu.js → request-DSK0W6YI.js} +3 -3
- package/dist/{run-attempt-CY9WlDLc.js → run-attempt-BV3HzuCf.js} +3416 -7194
- package/dist/{runtime-artifact-CmtG_t1L.js → runtime-artifact-BvyT1uyd.js} +11 -29
- package/dist/{sandbox-guard-NuhpXmPB.js → sandbox-guard-C1qEeZ5C.js} +29 -30
- package/dist/session-binding-BTrLf9Qm.js +874 -0
- package/dist/{session-catalog-DyOgR4WH.js → session-catalog-ezP_UcRM.js} +1584 -1289
- package/dist/session-catalog-home-id-BNwAJ9D7.js +18 -0
- package/dist/{session-cli-2PZaFLRh.js → session-cli-B1hKvfkI.js} +20 -7
- package/dist/session-retirement-CE4iMiLh.js +36 -0
- package/dist/{session-upstream-marker-B6U7tLw5.js → session-upstream-marker-D_2npHlA.js} +1 -1
- package/dist/{settled-turn-finalizer-CXY2Z9dT.js → settled-turn-finalizer-Dx1onIqg.js} +40 -28
- package/dist/{shared-client-DTbvH-XV.js → shared-client-Dw-rzii0.js} +1315 -469
- package/dist/{side-question-_ulBk1AL.js → side-question-DbXkJZzg.js} +140 -69
- package/dist/{thread-lifecycle-DF53ogiA.js → thread-lifecycle-DKdrnTMX.js} +927 -768
- package/dist/thread-ownership-i2NBwDUL.js +92 -0
- package/dist/thread-resume-CdJk2Ehf.js +30 -0
- package/dist/transcript-mirror-BU0_LKAL.js +588 -0
- package/dist/{transport-stdio-DXgGZ7Ib.js → transport-stdio-DhoGy33Z.js} +13 -2
- package/dist/upstream-prompt-provenance-CFmsKwr9.js +39 -0
- package/dist/{upstream-session-fork-Dy4Xvuoj.js → upstream-session-fork-BDVJCLAD.js} +14 -8
- package/dist/{usage-CQ6GhD5-.js → usage-9dKJCgcy.js} +3 -3
- package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DCdx4DGu.js} +8 -9
- package/openclaw.plugin.json +49 -4
- package/package.json +6 -5
- package/dist/app-server-policy-BSaO2JIT.js +0 -49
- package/dist/conversation-control-xsIeXbo4.js +0 -287
- package/dist/event-projector-usage-Xp4AlR2k.js +0 -86
- package/dist/notification-correlation-CU6_AnOb.js +0 -67
- package/dist/transcript-mirror-DzsdNCf5.js +0 -6924
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { d as sessionBindingIdentity } from "./session-binding-
|
|
2
|
-
import {
|
|
1
|
+
import { d as sessionBindingIdentity } from "./session-binding-BTrLf9Qm.js";
|
|
2
|
+
import { r as assertCodexThreadForkResponse } from "./protocol-validators-VAVyEnDp.js";
|
|
3
3
|
import { t as isIncognitoSessionKey } from "./incognito-session-ET_ufDH-.js";
|
|
4
|
-
import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-
|
|
5
|
-
import { isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
import { i as createImportedCodexSession, n as codexUpstreamBaseline, t as codexLastTerminalTurnId } from "./session-upstream-marker-D_2npHlA.js";
|
|
5
|
+
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
6
6
|
import { readVisibleSessionTranscriptMessageEntries } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
7
7
|
import { deleteSessionUpstreamLink, upsertSessionUpstreamLink } from "openclaw/plugin-sdk/session-catalog";
|
|
8
8
|
//#region extensions/codex/src/app-server/upstream-fork-boundary.ts
|
|
@@ -167,11 +167,18 @@ function readConnectionFingerprint(ref) {
|
|
|
167
167
|
return typeof ref.connectionFingerprint === "string" && ref.connectionFingerprint.trim() ? ref.connectionFingerprint : void 0;
|
|
168
168
|
}
|
|
169
169
|
function normalizeTurnId(value) {
|
|
170
|
-
return
|
|
170
|
+
return normalizeOptionalString(value);
|
|
171
171
|
}
|
|
172
172
|
async function forkCodexUpstreamSession(params, options) {
|
|
173
173
|
try {
|
|
174
|
-
|
|
174
|
+
const sourceFingerprint = params.upstream.kind === "codex-app-server" ? readConnectionFingerprint(params.upstream.ref) : void 0;
|
|
175
|
+
const requestControl = sourceFingerprint ? options.controlFactory.forUpstream(params.source.agentId, sourceFingerprint) : void 0;
|
|
176
|
+
if (!sourceFingerprint || !requestControl) return {
|
|
177
|
+
status: "failed",
|
|
178
|
+
code: "upstream-unavailable",
|
|
179
|
+
message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
|
|
180
|
+
};
|
|
181
|
+
return await requestControl.withPinnedConnection(async (control) => {
|
|
175
182
|
const incognito = isIncognitoSessionKey(params.targetKey);
|
|
176
183
|
const clientId = control.clientId?.trim();
|
|
177
184
|
if (incognito && !clientId) throw new Error("Incognito Codex forks require the live pinned app-server client");
|
|
@@ -185,8 +192,7 @@ async function forkCodexUpstreamSession(params, options) {
|
|
|
185
192
|
if (linked) deleteSessionUpstreamLink(params.targetKey, params.source.agentId);
|
|
186
193
|
await control.archiveThread(forkedThreadId).catch(() => void 0);
|
|
187
194
|
};
|
|
188
|
-
|
|
189
|
-
if (params.upstream.kind !== "codex-app-server" || !sourceFingerprint || sourceFingerprint !== control.connectionFingerprint) return {
|
|
195
|
+
if (sourceFingerprint !== control.connectionFingerprint) return {
|
|
190
196
|
status: "failed",
|
|
191
197
|
code: "upstream-unavailable",
|
|
192
198
|
message: "This Codex thread is not available on the current connection. Reconnect to its host and try again."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-
|
|
3
|
-
import { t as readCodexAppServerUsage } from "./request-
|
|
1
|
+
import { i as resolveCodexAppServerRuntimeOptions } from "./config-CpNeo5AE.js";
|
|
2
|
+
import { t as buildCodexAppServerUsageSnapshot } from "./rate-limits-BI1dMHDG.js";
|
|
3
|
+
import { t as readCodexAppServerUsage } from "./request-DSK0W6YI.js";
|
|
4
4
|
import { CODEX_APP_SERVER_AUTH_MARKER } from "openclaw/plugin-sdk/agent-runtime";
|
|
5
5
|
//#region extensions/codex/src/app-server/usage.ts
|
|
6
6
|
/** Handles the synthetic usage credential for a Codex-backed OpenAI route. */
|
package/dist/{web-search-provider.runtime-CCFhg2z5.js → web-search-provider.runtime-DCdx4DGu.js}
RENAMED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-
|
|
1
|
+
import { ut as isJsonObject } from "./shared-client-Dw-rzii0.js";
|
|
2
|
+
import { d as buildCodexNativeWebSearchThreadConfig } from "./thread-lifecycle-DKdrnTMX.js";
|
|
3
|
+
import { t as runBoundedCodexAppServerTurn } from "./bounded-turn-4BjrZEwW.js";
|
|
4
|
+
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
5
|
import { readStringParam, resolveSearchTimeoutSeconds, wrapWebContent } from "openclaw/plugin-sdk/provider-web-search";
|
|
5
6
|
//#region extensions/codex/src/web-search-provider.runtime.ts
|
|
6
7
|
async function executeCodexWebSearchProviderTool(ctx, args, executionContext, options) {
|
|
@@ -9,6 +10,7 @@ async function executeCodexWebSearchProviderTool(ctx, args, executionContext, op
|
|
|
9
10
|
const result = await runBoundedCodexAppServerTurn({
|
|
10
11
|
config: ctx.config,
|
|
11
12
|
model: { mode: "live-default" },
|
|
13
|
+
modelProvider: "openai",
|
|
12
14
|
timeoutMs: resolveSearchTimeoutSeconds(ctx.searchConfig) * 1e3,
|
|
13
15
|
signal: executionContext?.signal,
|
|
14
16
|
agentDir: ctx.agentDir,
|
|
@@ -45,7 +47,7 @@ function summarizeCodexWebSearchItem(item) {
|
|
|
45
47
|
const action = isJsonObject(item.action) ? item.action : void 0;
|
|
46
48
|
const actionType = readNonEmptyString(action, "type");
|
|
47
49
|
const queries = actionType === "search" ? readNonEmptyStringArray(action, "queries") : [];
|
|
48
|
-
const query =
|
|
50
|
+
const query = normalizeOptionalString(item.query) ?? (actionType === "search" ? readNonEmptyString(action, "query") : void 0) ?? queries[0];
|
|
49
51
|
const url = readNonEmptyString(action, "url");
|
|
50
52
|
const pattern = readNonEmptyString(action, "pattern");
|
|
51
53
|
return {
|
|
@@ -57,18 +59,15 @@ function summarizeCodexWebSearchItem(item) {
|
|
|
57
59
|
};
|
|
58
60
|
}
|
|
59
61
|
function readNonEmptyString(record, key) {
|
|
60
|
-
return record ?
|
|
62
|
+
return record ? normalizeOptionalString(record[key]) : void 0;
|
|
61
63
|
}
|
|
62
64
|
function readNonEmptyStringArray(record, key) {
|
|
63
65
|
const value = record?.[key];
|
|
64
66
|
if (!Array.isArray(value)) return [];
|
|
65
67
|
return value.flatMap((entry) => {
|
|
66
|
-
const normalized =
|
|
68
|
+
const normalized = normalizeOptionalString(entry);
|
|
67
69
|
return normalized ? [normalized] : [];
|
|
68
70
|
});
|
|
69
71
|
}
|
|
70
|
-
function normalizeNonEmptyString(value) {
|
|
71
|
-
return typeof value === "string" ? value.trim() || void 0 : void 0;
|
|
72
|
-
}
|
|
73
72
|
//#endregion
|
|
74
73
|
export { executeCodexWebSearchProviderTool };
|
package/openclaw.plugin.json
CHANGED
|
@@ -1,12 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "codex",
|
|
3
|
+
"doctorContract": {
|
|
4
|
+
"configRepair": true,
|
|
5
|
+
"stateMigrations": true
|
|
6
|
+
},
|
|
7
|
+
"sessionRouteStateOwners": [
|
|
8
|
+
{
|
|
9
|
+
"id": "codex",
|
|
10
|
+
"label": "Codex",
|
|
11
|
+
"providerIds": ["codex", "codex-cli", "openai-codex"],
|
|
12
|
+
"runtimeIds": ["codex", "codex-cli"],
|
|
13
|
+
"cliSessionKeys": ["codex-cli"],
|
|
14
|
+
"authProfilePrefixes": ["codex:", "codex-cli:", "openai-codex:"]
|
|
15
|
+
}
|
|
16
|
+
],
|
|
3
17
|
"name": "Codex",
|
|
4
18
|
"description": "Codex app-server harness and native session catalog.",
|
|
19
|
+
"cliCommands": [
|
|
20
|
+
{
|
|
21
|
+
"name": "codex",
|
|
22
|
+
"description": "Inspect and branch from Codex sessions through the Gateway",
|
|
23
|
+
"hasSubcommands": true
|
|
24
|
+
}
|
|
25
|
+
],
|
|
5
26
|
"contracts": {
|
|
6
27
|
"mediaUnderstandingProviders": ["codex"],
|
|
7
28
|
"migrationProviders": ["codex"],
|
|
8
29
|
"tools": [
|
|
9
30
|
"codex_threads",
|
|
31
|
+
"codex_plugins",
|
|
10
32
|
"codex_endpoint_probe",
|
|
11
33
|
"codex_sessions_list",
|
|
12
34
|
"codex_session_read",
|
|
@@ -28,7 +50,9 @@
|
|
|
28
50
|
"onAgentHarnesses": ["codex"],
|
|
29
51
|
"onCommands": ["codex"],
|
|
30
52
|
"onConfigPaths": [
|
|
53
|
+
"plugins.entries.codex.config.appServer.transport",
|
|
31
54
|
"plugins.entries.codex.config.sessionCatalog.enabled",
|
|
55
|
+
"plugins.entries.codex.config.sessionCatalog.homes",
|
|
32
56
|
"plugins.entries.codex.config.supervision.enabled"
|
|
33
57
|
]
|
|
34
58
|
},
|
|
@@ -57,7 +81,24 @@
|
|
|
57
81
|
"type": "object",
|
|
58
82
|
"additionalProperties": false,
|
|
59
83
|
"properties": {
|
|
60
|
-
"enabled": { "type": "boolean", "default": true }
|
|
84
|
+
"enabled": { "type": "boolean", "default": true },
|
|
85
|
+
"homes": {
|
|
86
|
+
"type": "array",
|
|
87
|
+
"items": {
|
|
88
|
+
"anyOf": [
|
|
89
|
+
{ "type": "string", "minLength": 1, "pattern": "\\S" },
|
|
90
|
+
{
|
|
91
|
+
"type": "object",
|
|
92
|
+
"additionalProperties": false,
|
|
93
|
+
"required": ["path"],
|
|
94
|
+
"properties": {
|
|
95
|
+
"path": { "type": "string", "minLength": 1, "pattern": "\\S" },
|
|
96
|
+
"label": { "type": "string", "minLength": 1, "pattern": "\\S" }
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
}
|
|
61
102
|
}
|
|
62
103
|
},
|
|
63
104
|
"discovery": {
|
|
@@ -167,7 +208,7 @@
|
|
|
167
208
|
},
|
|
168
209
|
"marketplaceName": {
|
|
169
210
|
"type": "string",
|
|
170
|
-
"
|
|
211
|
+
"pattern": "^[A-Za-z0-9_-]+$"
|
|
171
212
|
},
|
|
172
213
|
"pluginName": {
|
|
173
214
|
"type": "string"
|
|
@@ -235,8 +276,7 @@
|
|
|
235
276
|
},
|
|
236
277
|
"homeScope": {
|
|
237
278
|
"type": "string",
|
|
238
|
-
"enum": ["agent", "user"]
|
|
239
|
-
"default": "agent"
|
|
279
|
+
"enum": ["agent", "user"]
|
|
240
280
|
},
|
|
241
281
|
"command": { "type": "string" },
|
|
242
282
|
"args": {
|
|
@@ -377,6 +417,11 @@
|
|
|
377
417
|
"label": "Discover Codex Sessions",
|
|
378
418
|
"help": "List native Codex sessions in the sidebar from this Gateway and eligible paired nodes."
|
|
379
419
|
},
|
|
420
|
+
"sessionCatalog.homes": {
|
|
421
|
+
"label": "Additional Codex Homes",
|
|
422
|
+
"help": "Existing local Codex home directories to include in native session discovery. String paths use the canonical directory basename as their label; object entries can override it with label. Paths are canonicalized and deduplicated. Requires appServer.transport=stdio and a Gateway restart.",
|
|
423
|
+
"advanced": true
|
|
424
|
+
},
|
|
380
425
|
"codexDynamicToolsLoading": {
|
|
381
426
|
"label": "Dynamic Tools Loading",
|
|
382
427
|
"help": "Use searchable to defer OpenClaw dynamic tools behind Codex tool search, or direct to expose them in the initial context.",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/codex",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.8.1-beta.3",
|
|
4
4
|
"description": "OpenClaw Codex app-server harness and native session supervision plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@openai/codex": "0.
|
|
11
|
+
"@openai/codex": "0.149.1",
|
|
12
|
+
"semver": "7.8.5",
|
|
12
13
|
"smol-toml": "1.7.1",
|
|
13
14
|
"typebox": "1.3.6",
|
|
14
15
|
"ws": "8.21.1",
|
|
@@ -35,10 +36,10 @@
|
|
|
35
36
|
]
|
|
36
37
|
},
|
|
37
38
|
"compat": {
|
|
38
|
-
"pluginApi": ">=2026.
|
|
39
|
+
"pluginApi": ">=2026.8.1-beta.3"
|
|
39
40
|
},
|
|
40
41
|
"build": {
|
|
41
|
-
"openclawVersion": "2026.
|
|
42
|
+
"openclawVersion": "2026.8.1-beta.3"
|
|
42
43
|
},
|
|
43
44
|
"release": {
|
|
44
45
|
"publishToClawHub": true,
|
|
@@ -58,7 +59,7 @@
|
|
|
58
59
|
"README.md"
|
|
59
60
|
],
|
|
60
61
|
"peerDependencies": {
|
|
61
|
-
"openclaw": ">=2026.
|
|
62
|
+
"openclaw": ">=2026.8.1-beta.3"
|
|
62
63
|
},
|
|
63
64
|
"peerDependenciesMeta": {
|
|
64
65
|
"openclaw": {
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { C as canUseCodexModelBackedApprovalsReviewerForModel } from "./session-binding-BXpo9ymA.js";
|
|
2
|
-
//#region extensions/codex/src/app-server/app-server-policy.ts
|
|
3
|
-
/**
|
|
4
|
-
* Policy promotion for Codex app-server runs that can safely use OpenClaw tool
|
|
5
|
-
* approvals.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Promotes implicit `never` approval policy to `untrusted` only when runtime
|
|
9
|
-
* requirements allow OpenClaw to handle tool approvals.
|
|
10
|
-
*/
|
|
11
|
-
function resolveCodexAppServerForOpenClawToolPolicy(params) {
|
|
12
|
-
if (!params.shouldPromote || !params.canUseUntrustedApprovalPolicy || params.appServer.approvalPolicy !== "never") return params.appServer;
|
|
13
|
-
const explicitMode = params.execPolicy?.mode === "full" || params.pluginConfig.appServer?.mode !== void 0 || isCodexAppServerPolicyMode(params.env.OPENCLAW_CODEX_APP_SERVER_MODE);
|
|
14
|
-
const explicitApprovalPolicy = params.pluginConfig.appServer?.approvalPolicy !== void 0 || isConfiguredCodexAppServerApprovalPolicy(params.env.OPENCLAW_CODEX_APP_SERVER_APPROVAL_POLICY) || params.appServer.approvalPolicySource === "requirements";
|
|
15
|
-
if (explicitMode || explicitApprovalPolicy) return params.appServer;
|
|
16
|
-
return {
|
|
17
|
-
...params.appServer,
|
|
18
|
-
approvalPolicy: "untrusted"
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
function resolveCodexAppServerForModelProvider(params) {
|
|
22
|
-
const explicitProvider = normalizeModelBackedReviewerProvider(params.provider);
|
|
23
|
-
if (!isCodexModelBackedApprovalsReviewer(params.appServer.approvalsReviewer) || canUseCodexModelBackedApprovalsReviewerForModel({
|
|
24
|
-
modelProvider: explicitProvider,
|
|
25
|
-
model: params.model,
|
|
26
|
-
config: params.config,
|
|
27
|
-
env: params.env,
|
|
28
|
-
agentDir: params.agentDir,
|
|
29
|
-
codexConfigToml: params.codexConfigToml
|
|
30
|
-
})) return params.appServer;
|
|
31
|
-
return {
|
|
32
|
-
...params.appServer,
|
|
33
|
-
approvalsReviewer: "user"
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function isCodexAppServerPolicyMode(value) {
|
|
37
|
-
return value === "guardian" || value === "yolo";
|
|
38
|
-
}
|
|
39
|
-
function isConfiguredCodexAppServerApprovalPolicy(value) {
|
|
40
|
-
return value === "never" || value === "on-request" || value === "on-failure" || value === "untrusted";
|
|
41
|
-
}
|
|
42
|
-
function isCodexModelBackedApprovalsReviewer(value) {
|
|
43
|
-
return value === "auto_review" || value === "guardian_subagent";
|
|
44
|
-
}
|
|
45
|
-
function normalizeModelBackedReviewerProvider(provider) {
|
|
46
|
-
return provider?.trim().toLowerCase() || void 0;
|
|
47
|
-
}
|
|
48
|
-
//#endregion
|
|
49
|
-
export { resolveCodexAppServerForOpenClawToolPolicy as n, resolveCodexAppServerForModelProvider as t };
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import { a as getLeasedSharedCodexAppServerClient, c as releaseCodexAppServerClientLease, h as withLeasedCodexAppServerClientStartSelectionRetry, l as releaseLeasedSharedCodexAppServerClient } from "./shared-client-DTbvH-XV.js";
|
|
2
|
-
import { T as resolveCodexModelBackedReviewerPolicyContext, g as resolveCodexAppServerRuntimeOptions, j as isCodexFastServiceTier, o as isCodexAppServerNativeAuthProfile, r as bindingStoreKey, s as normalizeCodexAppServerBindingModelProvider } from "./session-binding-BXpo9ymA.js";
|
|
3
|
-
import { S as resolveCodexBindingModelProviderFallback, b as resolveCodexAppServerRequestModelSelection } from "./thread-lifecycle-DF53ogiA.js";
|
|
4
|
-
import { t as CODEX_CONTROL_METHODS } from "./capabilities-BFDTVYr4.js";
|
|
5
|
-
import { r as formatCodexDisplayText } from "./command-formatters-C336eRVS.js";
|
|
6
|
-
import { a as resolveCodexBindingAppServerConnection } from "./notification-correlation-CU6_AnOb.js";
|
|
7
|
-
import { ModelSelectionLockedError } from "openclaw/plugin-sdk/model-session-runtime";
|
|
8
|
-
//#region extensions/codex/src/command-authorization.ts
|
|
9
|
-
const CODEX_NATIVE_EXECUTION_AUTH_ERROR = "Only an owner or operator.admin can control Codex native execution.";
|
|
10
|
-
function canMutateCodexHost(ctx) {
|
|
11
|
-
return ctx.senderIsOwner === true || ctx.gatewayClientScopes?.includes("operator.admin") === true;
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
//#region extensions/codex/src/conversation-control.ts
|
|
15
|
-
const CODEX_CONVERSATION_CONTROL_STATE = Symbol.for("openclaw.codex.conversationControl");
|
|
16
|
-
function getActiveTurns() {
|
|
17
|
-
const globalState = globalThis;
|
|
18
|
-
globalState[CODEX_CONVERSATION_CONTROL_STATE] ??= /* @__PURE__ */ new Map();
|
|
19
|
-
return globalState[CODEX_CONVERSATION_CONTROL_STATE];
|
|
20
|
-
}
|
|
21
|
-
function trackCodexConversationActiveTurn(active) {
|
|
22
|
-
const activeTurns = getActiveTurns();
|
|
23
|
-
const key = bindingStoreKey(active.identity);
|
|
24
|
-
activeTurns.set(key, active);
|
|
25
|
-
return () => {
|
|
26
|
-
if (activeTurns.get(key)?.turnId === active.turnId) activeTurns.delete(key);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
function readCodexConversationActiveTurn(identity) {
|
|
30
|
-
return getActiveTurns().get(bindingStoreKey(identity));
|
|
31
|
-
}
|
|
32
|
-
async function stopCodexConversationTurn(params) {
|
|
33
|
-
const active = readCodexConversationActiveTurn(params.identity);
|
|
34
|
-
if (!active) return {
|
|
35
|
-
stopped: false,
|
|
36
|
-
message: "No active Codex run to stop."
|
|
37
|
-
};
|
|
38
|
-
const lookup = buildBindingLookup(params);
|
|
39
|
-
const binding = await params.bindingStore.read(params.identity);
|
|
40
|
-
if (binding?.threadId !== active.threadId) return {
|
|
41
|
-
stopped: false,
|
|
42
|
-
message: "The active Codex run no longer matches this session binding."
|
|
43
|
-
};
|
|
44
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
45
|
-
binding,
|
|
46
|
-
authProfileId: binding?.authProfileId,
|
|
47
|
-
pluginConfig: params.pluginConfig
|
|
48
|
-
});
|
|
49
|
-
const runtime = connection.appServer;
|
|
50
|
-
const client = active.client ?? await getLeasedSharedCodexAppServerClient({
|
|
51
|
-
startOptions: runtime.start,
|
|
52
|
-
timeoutMs: runtime.requestTimeoutMs,
|
|
53
|
-
authProfileId: connection.clientAuthProfileId,
|
|
54
|
-
...lookup
|
|
55
|
-
});
|
|
56
|
-
try {
|
|
57
|
-
await client.request("turn/interrupt", {
|
|
58
|
-
threadId: active.threadId,
|
|
59
|
-
turnId: active.turnId
|
|
60
|
-
}, { timeoutMs: runtime.requestTimeoutMs });
|
|
61
|
-
} finally {
|
|
62
|
-
if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
stopped: true,
|
|
66
|
-
message: "Codex stop requested."
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
async function steerCodexConversationTurn(params) {
|
|
70
|
-
const active = readCodexConversationActiveTurn(params.identity);
|
|
71
|
-
const text = params.message.trim();
|
|
72
|
-
if (!text) return {
|
|
73
|
-
steered: false,
|
|
74
|
-
message: "Usage: /codex steer <message>"
|
|
75
|
-
};
|
|
76
|
-
if (!active) return {
|
|
77
|
-
steered: false,
|
|
78
|
-
message: "No active Codex run to steer."
|
|
79
|
-
};
|
|
80
|
-
const lookup = buildBindingLookup(params);
|
|
81
|
-
const binding = await params.bindingStore.read(params.identity);
|
|
82
|
-
if (binding?.threadId !== active.threadId) return {
|
|
83
|
-
steered: false,
|
|
84
|
-
message: "The active Codex run no longer matches this session binding."
|
|
85
|
-
};
|
|
86
|
-
const connection = resolveCodexBindingAppServerConnection({
|
|
87
|
-
binding,
|
|
88
|
-
authProfileId: binding?.authProfileId,
|
|
89
|
-
pluginConfig: params.pluginConfig
|
|
90
|
-
});
|
|
91
|
-
const runtime = connection.appServer;
|
|
92
|
-
const client = active.client ?? await getLeasedSharedCodexAppServerClient({
|
|
93
|
-
startOptions: runtime.start,
|
|
94
|
-
timeoutMs: runtime.requestTimeoutMs,
|
|
95
|
-
authProfileId: connection.clientAuthProfileId,
|
|
96
|
-
...lookup
|
|
97
|
-
});
|
|
98
|
-
try {
|
|
99
|
-
await client.request("turn/steer", {
|
|
100
|
-
threadId: active.threadId,
|
|
101
|
-
expectedTurnId: active.turnId,
|
|
102
|
-
input: [{
|
|
103
|
-
type: "text",
|
|
104
|
-
text,
|
|
105
|
-
text_elements: []
|
|
106
|
-
}]
|
|
107
|
-
}, { timeoutMs: runtime.requestTimeoutMs });
|
|
108
|
-
} finally {
|
|
109
|
-
if (!active.client) releaseLeasedSharedCodexAppServerClient(client);
|
|
110
|
-
}
|
|
111
|
-
return {
|
|
112
|
-
steered: true,
|
|
113
|
-
message: "Sent steer message to Codex."
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
async function setCodexConversationModel(params) {
|
|
117
|
-
const model = params.model.trim();
|
|
118
|
-
if (!model) return "Usage: /codex model <model>";
|
|
119
|
-
const lookup = buildBindingLookup(params);
|
|
120
|
-
const binding = await requireThreadBinding(params.bindingStore, params.identity);
|
|
121
|
-
if (binding.connectionScope === "supervision") throw new ModelSelectionLockedError();
|
|
122
|
-
const reviewerPolicyContext = resolveCodexModelBackedReviewerPolicyContext({
|
|
123
|
-
provider: "codex",
|
|
124
|
-
model,
|
|
125
|
-
bindingModelProvider: binding.modelProvider,
|
|
126
|
-
bindingModel: binding.model,
|
|
127
|
-
nativeAuthProfile: isCodexAppServerNativeAuthProfile({
|
|
128
|
-
authProfileId: binding.authProfileId,
|
|
129
|
-
...lookup
|
|
130
|
-
})
|
|
131
|
-
});
|
|
132
|
-
const runtime = resolveCodexAppServerRuntimeOptions({
|
|
133
|
-
pluginConfig: params.pluginConfig,
|
|
134
|
-
modelProvider: reviewerPolicyContext.modelProvider,
|
|
135
|
-
model: reviewerPolicyContext.model,
|
|
136
|
-
config: params.config,
|
|
137
|
-
agentDir: params.agentDir
|
|
138
|
-
});
|
|
139
|
-
const modelSelection = resolveCodexAppServerRequestModelSelection({
|
|
140
|
-
model,
|
|
141
|
-
modelProvider: resolveConversationControlModelProvider({
|
|
142
|
-
authProfileId: binding.authProfileId,
|
|
143
|
-
bindingModel: binding.model,
|
|
144
|
-
bindingModelProvider: binding.modelProvider,
|
|
145
|
-
currentModel: model,
|
|
146
|
-
...lookup
|
|
147
|
-
}),
|
|
148
|
-
authProfileId: binding.authProfileId,
|
|
149
|
-
...lookup
|
|
150
|
-
});
|
|
151
|
-
const resumed = await resumeThreadWithOverrides({
|
|
152
|
-
runtime,
|
|
153
|
-
threadId: binding.threadId,
|
|
154
|
-
authProfileId: binding.authProfileId,
|
|
155
|
-
...lookup,
|
|
156
|
-
model: modelSelection.model,
|
|
157
|
-
modelProvider: modelSelection.modelProvider
|
|
158
|
-
});
|
|
159
|
-
const response = resumed.response;
|
|
160
|
-
const nextModel = response.model ?? modelSelection.model;
|
|
161
|
-
const nextModelProvider = normalizeCodexAppServerBindingModelProvider({
|
|
162
|
-
authProfileId: binding.authProfileId,
|
|
163
|
-
modelProvider: response.modelProvider ?? modelSelection.modelProvider,
|
|
164
|
-
...lookup
|
|
165
|
-
});
|
|
166
|
-
const modelChanged = nextModel !== binding.model || nextModelProvider !== binding.modelProvider;
|
|
167
|
-
await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, {
|
|
168
|
-
clientId: resumed.clientId,
|
|
169
|
-
cwd: response.thread.cwd ?? binding.cwd,
|
|
170
|
-
model: nextModel,
|
|
171
|
-
modelProvider: nextModelProvider,
|
|
172
|
-
...modelChanged && binding.contextEngine?.projection ? { contextEngine: {
|
|
173
|
-
...binding.contextEngine,
|
|
174
|
-
projection: void 0
|
|
175
|
-
} } : {},
|
|
176
|
-
approvalPolicy: binding.approvalPolicy,
|
|
177
|
-
sandbox: binding.sandbox,
|
|
178
|
-
serviceTier: binding.serviceTier ?? runtime.serviceTier ?? void 0
|
|
179
|
-
});
|
|
180
|
-
return `Codex model set to ${formatCodexDisplayText(response.model ?? model)}.`;
|
|
181
|
-
}
|
|
182
|
-
async function setCodexConversationFastMode(params) {
|
|
183
|
-
const binding = await requireThreadBinding(params.bindingStore, params.identity);
|
|
184
|
-
if (params.enabled == null) return `Codex fast mode: ${isCodexFastServiceTier(binding.serviceTier) ? "on" : "off"}.`;
|
|
185
|
-
const serviceTier = params.enabled ? "priority" : "flex";
|
|
186
|
-
await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, { serviceTier });
|
|
187
|
-
return `Codex fast mode ${params.enabled ? "enabled" : "disabled"}.`;
|
|
188
|
-
}
|
|
189
|
-
async function setCodexConversationPermissions(params) {
|
|
190
|
-
const binding = await requireThreadBinding(params.bindingStore, params.identity);
|
|
191
|
-
if (!params.mode) return `Codex permissions: ${formatPermissionsMode(binding)}.`;
|
|
192
|
-
const policy = permissionsForMode(params.mode);
|
|
193
|
-
await patchThreadBinding(params.bindingStore, params.identity, binding.threadId, {
|
|
194
|
-
approvalPolicy: policy.approvalPolicy,
|
|
195
|
-
sandbox: policy.sandbox
|
|
196
|
-
});
|
|
197
|
-
return `Codex permissions set to ${params.mode === "yolo" ? "full access" : "default"}.`;
|
|
198
|
-
}
|
|
199
|
-
function parseCodexFastModeArg(arg) {
|
|
200
|
-
const normalized = arg?.trim().toLowerCase();
|
|
201
|
-
if (!normalized || normalized === "status") return;
|
|
202
|
-
if (normalized === "on" || normalized === "true" || normalized === "fast") return true;
|
|
203
|
-
if (normalized === "off" || normalized === "false" || normalized === "flex") return false;
|
|
204
|
-
}
|
|
205
|
-
function parseCodexPermissionsModeArg(arg) {
|
|
206
|
-
const normalized = arg?.trim().toLowerCase();
|
|
207
|
-
if (!normalized || normalized === "status") return;
|
|
208
|
-
if (normalized === "yolo" || normalized === "full" || normalized === "full-access") return "yolo";
|
|
209
|
-
if (normalized === "default" || normalized === "guardian") return "default";
|
|
210
|
-
}
|
|
211
|
-
function formatPermissionsMode(binding) {
|
|
212
|
-
return binding.approvalPolicy === "never" && binding.sandbox === "danger-full-access" ? "full access" : "default";
|
|
213
|
-
}
|
|
214
|
-
async function requireThreadBinding(bindingStore, identity) {
|
|
215
|
-
const binding = await bindingStore.read(identity);
|
|
216
|
-
if (!binding?.threadId) throw new Error("No Codex thread is attached to this OpenClaw session yet.");
|
|
217
|
-
return binding;
|
|
218
|
-
}
|
|
219
|
-
async function patchThreadBinding(bindingStore, identity, threadId, patch) {
|
|
220
|
-
if (!await bindingStore.mutate(identity, {
|
|
221
|
-
kind: "patch",
|
|
222
|
-
threadId,
|
|
223
|
-
patch
|
|
224
|
-
})) throw new Error("Codex thread binding changed while applying the control update.");
|
|
225
|
-
}
|
|
226
|
-
async function resumeThreadWithOverrides(params) {
|
|
227
|
-
const runtime = params.runtime;
|
|
228
|
-
const clientOptions = {
|
|
229
|
-
startOptions: runtime.start,
|
|
230
|
-
timeoutMs: runtime.requestTimeoutMs,
|
|
231
|
-
authProfileId: params.authProfileId,
|
|
232
|
-
...buildBindingLookup(params)
|
|
233
|
-
};
|
|
234
|
-
let client = await getLeasedSharedCodexAppServerClient(clientOptions);
|
|
235
|
-
const clientLease = { client };
|
|
236
|
-
try {
|
|
237
|
-
return {
|
|
238
|
-
response: await withLeasedCodexAppServerClientStartSelectionRetry({
|
|
239
|
-
lease: clientLease,
|
|
240
|
-
options: clientOptions,
|
|
241
|
-
run: async (requestClient, requestOptions) => await requestClient.request(CODEX_CONTROL_METHODS.resumeThread, {
|
|
242
|
-
threadId: params.threadId,
|
|
243
|
-
...params.model ? { model: params.model } : {},
|
|
244
|
-
...params.modelProvider ? { modelProvider: params.modelProvider } : {},
|
|
245
|
-
approvalPolicy: params.approvalPolicy ?? runtime.approvalPolicy,
|
|
246
|
-
sandbox: params.sandbox ?? runtime.sandbox,
|
|
247
|
-
approvalsReviewer: runtime.approvalsReviewer,
|
|
248
|
-
...params.serviceTier ? { serviceTier: params.serviceTier } : {}
|
|
249
|
-
}, requestOptions),
|
|
250
|
-
onClientChange: (nextClient) => {
|
|
251
|
-
client = nextClient;
|
|
252
|
-
}
|
|
253
|
-
}),
|
|
254
|
-
clientId: client.getInstanceId()
|
|
255
|
-
};
|
|
256
|
-
} finally {
|
|
257
|
-
releaseCodexAppServerClientLease(clientLease);
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
function buildBindingLookup(params) {
|
|
261
|
-
const agentDir = params.agentDir?.trim();
|
|
262
|
-
return {
|
|
263
|
-
...agentDir ? { agentDir } : {},
|
|
264
|
-
...params.config ? { config: params.config } : {}
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
function resolveConversationControlModelProvider(params) {
|
|
268
|
-
const modelProvider = resolveCodexBindingModelProviderFallback({
|
|
269
|
-
currentModel: params.currentModel,
|
|
270
|
-
bindingModel: params.bindingModel,
|
|
271
|
-
bindingModelProvider: params.bindingModelProvider
|
|
272
|
-
})?.trim();
|
|
273
|
-
if (!modelProvider || modelProvider.toLowerCase() === "codex") return;
|
|
274
|
-
if (isCodexAppServerNativeAuthProfile(params) && modelProvider.toLowerCase() === "openai") return;
|
|
275
|
-
return modelProvider.toLowerCase() === "openai" ? "openai" : modelProvider;
|
|
276
|
-
}
|
|
277
|
-
function permissionsForMode(mode) {
|
|
278
|
-
return mode === "yolo" ? {
|
|
279
|
-
approvalPolicy: "never",
|
|
280
|
-
sandbox: "danger-full-access"
|
|
281
|
-
} : {
|
|
282
|
-
approvalPolicy: "on-request",
|
|
283
|
-
sandbox: "workspace-write"
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
//#endregion
|
|
287
|
-
export { setCodexConversationFastMode as a, steerCodexConversationTurn as c, CODEX_NATIVE_EXECUTION_AUTH_ERROR as d, canMutateCodexHost as f, readCodexConversationActiveTurn as i, stopCodexConversationTurn as l, parseCodexFastModeArg as n, setCodexConversationModel as o, parseCodexPermissionsModeArg as r, setCodexConversationPermissions as s, formatPermissionsMode as t, trackCodexConversationActiveTurn as u };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { W as isJsonObject } from "./shared-client-DTbvH-XV.js";
|
|
2
|
-
import { at as readNonNegativeInteger, ct as readString, st as readNumber } from "./thread-lifecycle-DF53ogiA.js";
|
|
3
|
-
import { normalizeUsage } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
4
|
-
//#region extensions/codex/src/app-server/event-projector-usage.ts
|
|
5
|
-
function readTokenCount(record, key) {
|
|
6
|
-
const value = readNonNegativeInteger(record, key);
|
|
7
|
-
return value !== void 0 && Number.isSafeInteger(value) ? value : void 0;
|
|
8
|
-
}
|
|
9
|
-
function readCodexThreadTokenUsage(params) {
|
|
10
|
-
const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
|
|
11
|
-
const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
|
|
12
|
-
return last ? normalizeCodexThreadTokenUsage(last) : void 0;
|
|
13
|
-
}
|
|
14
|
-
function readCodexThreadContextSnapshot(params) {
|
|
15
|
-
const tokenUsage = isJsonObject(params.tokenUsage) ? params.tokenUsage : void 0;
|
|
16
|
-
const last = tokenUsage && isJsonObject(tokenUsage.last) ? tokenUsage.last : void 0;
|
|
17
|
-
const modelContextWindow = tokenUsage ? readTokenCount(tokenUsage, "modelContextWindow") : void 0;
|
|
18
|
-
const promptTokens = last ? readTokenCount(last, "inputTokens") : void 0;
|
|
19
|
-
return {
|
|
20
|
-
...modelContextWindow && modelContextWindow > 0 ? { modelContextWindow } : {},
|
|
21
|
-
...promptTokens !== void 0 ? { promptTokens } : {}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function projectCodexThreadUsageUpdate(params, currentUsage, applyUsage, emitContext) {
|
|
25
|
-
applyUsage(readCodexThreadTokenUsage(params) ?? currentUsage);
|
|
26
|
-
const context = readCodexThreadContextSnapshot(params);
|
|
27
|
-
if (context.modelContextWindow !== void 0 || context.promptTokens !== void 0) emitContext(context);
|
|
28
|
-
}
|
|
29
|
-
function normalizeCodexThreadTokenUsage(record) {
|
|
30
|
-
const inputTokens = readNumber(record, "inputTokens");
|
|
31
|
-
const cacheRead = readNumber(record, "cachedInputTokens");
|
|
32
|
-
const usage = normalizeUsage({
|
|
33
|
-
input: inputTokens !== void 0 && cacheRead !== void 0 ? Math.max(0, inputTokens - cacheRead) : inputTokens,
|
|
34
|
-
output: readNumber(record, "outputTokens"),
|
|
35
|
-
cacheRead,
|
|
36
|
-
total: readNumber(record, "totalTokens")
|
|
37
|
-
});
|
|
38
|
-
return usage ? {
|
|
39
|
-
...usage,
|
|
40
|
-
contextUsage: { state: "unavailable" }
|
|
41
|
-
} : void 0;
|
|
42
|
-
}
|
|
43
|
-
function normalizeCodexResponseTokenUsage(record) {
|
|
44
|
-
const totalTokens = readTokenCount(record, "totalTokens");
|
|
45
|
-
const inputTokens = readTokenCount(record, "inputTokens");
|
|
46
|
-
const cacheRead = readTokenCount(record, "cachedInputTokens");
|
|
47
|
-
const output = readTokenCount(record, "outputTokens");
|
|
48
|
-
const reasoningOutput = readTokenCount(record, "reasoningOutputTokens");
|
|
49
|
-
const cacheWrite = record.cacheWriteInputTokens === void 0 ? 0 : readTokenCount(record, "cacheWriteInputTokens");
|
|
50
|
-
if (totalTokens === void 0 || inputTokens === void 0 || cacheRead === void 0 || cacheWrite === void 0 || output === void 0 || reasoningOutput === void 0 || cacheRead + cacheWrite > inputTokens || totalTokens !== inputTokens + output) return;
|
|
51
|
-
const usage = normalizeUsage({
|
|
52
|
-
input: inputTokens - cacheRead - cacheWrite,
|
|
53
|
-
output,
|
|
54
|
-
cacheRead,
|
|
55
|
-
cacheWrite,
|
|
56
|
-
total: totalTokens
|
|
57
|
-
});
|
|
58
|
-
if (!usage) return;
|
|
59
|
-
return {
|
|
60
|
-
...usage,
|
|
61
|
-
contextUsage: {
|
|
62
|
-
state: "available",
|
|
63
|
-
promptTokens: inputTokens,
|
|
64
|
-
totalTokens
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
var CodexResponseCompletionProjection = class {
|
|
69
|
-
constructor() {
|
|
70
|
-
this.responseIds = /* @__PURE__ */ new Set();
|
|
71
|
-
}
|
|
72
|
-
get modelIterations() {
|
|
73
|
-
return this.responseIds.size;
|
|
74
|
-
}
|
|
75
|
-
clear() {
|
|
76
|
-
this.usage = void 0;
|
|
77
|
-
}
|
|
78
|
-
record(params) {
|
|
79
|
-
const responseId = readString(params, "responseId");
|
|
80
|
-
if (responseId) this.responseIds.add(responseId);
|
|
81
|
-
const usage = isJsonObject(params.usage) ? params.usage : void 0;
|
|
82
|
-
this.usage = usage ? normalizeCodexResponseTokenUsage(usage) : void 0;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
//#endregion
|
|
86
|
-
export { normalizeCodexResponseTokenUsage as n, projectCodexThreadUsageUpdate as r, CodexResponseCompletionProjection as t };
|