@openclaw/codex 2026.9.8 → 2026.10.1-beta.1
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 +8 -0
- package/dist/.setup/{account-usage-runtime-G348lY1q.mjs → account-usage-runtime-C4GFoef_.mjs} +5 -5
- package/dist/.setup/app-server-policy-Bg4FZw1f.mjs +23 -0
- package/dist/.setup/{apply-Cqb-YoCS.mjs → apply-D02fLpgN.mjs} +48 -39
- package/dist/.setup/attempt-client-cleanup-yLjGwbwT.mjs +155 -0
- package/dist/.setup/{attempt-workspace-context-BJ5Z_olH.mjs → attempt-workspace-context-CbSzT6V2.mjs} +11 -15
- package/dist/.setup/{auth-binding-BLWz7stm.mjs → auth-binding-BoMwpuPN.mjs} +17 -25
- package/dist/.setup/{auth-cache-key-Dnps4W4_.mjs → auth-cache-key-CEd9QlIs.mjs} +244 -82
- package/dist/.setup/{auth-profile-B0okYl2D.mjs → auth-profile-CgHQ8Vot.mjs} +2 -1
- package/dist/.setup/{auth-profile-selection-DFu9e167.mjs → auth-profile-selection-hr8ocLtz.mjs} +5 -7
- package/dist/.setup/{binding-connection-DTtN1KrX.mjs → binding-connection-C-08ez1w.mjs} +2 -2
- package/dist/.setup/{binding-connection.runtime-6TpgD1M6.mjs → binding-connection.runtime-Dn2p-fdy.mjs} +3 -3
- package/dist/.setup/{bounded-turn-BNunZPtz.mjs → bounded-turn-DlHlNTyS.mjs} +14 -13
- package/dist/.setup/{bounded-turn-isolation-B8K_ylqk.mjs → bounded-turn-isolation-DklXNk3k.mjs} +4 -4
- package/dist/.setup/{build-state-DIQ5O_-S.mjs → build-state-CIi3Ckqu.mjs} +1 -1
- package/dist/.setup/{capabilities-B3WEZl4e.mjs → capabilities-kQntafj_.mjs} +1 -1
- package/dist/.setup/{client-qyUBJlGZ.mjs → client-CBzEVDyb.mjs} +438 -160
- package/dist/.setup/{client-catalog-response-DRvx_wCC.mjs → client-catalog-response-CmvIiDdj.mjs} +57 -25
- package/dist/.setup/command-authorization-AikPDtcc.mjs +15 -0
- package/dist/.setup/{command-dispatch-Btrs1D6f.mjs → command-dispatch-BE_RdMou.mjs} +3 -3
- package/dist/.setup/{command-formatters-R3ckE3Co.mjs → command-formatters-DV3DHhdr.mjs} +7 -5
- package/dist/.setup/{command-handlers-DvlCHJch.mjs → command-handlers-DNoRq5Ps.mjs} +82 -144
- package/dist/.setup/{command-rpc-skzRq4wD.mjs → command-rpc-B6xsq2dB.mjs} +23 -31
- package/dist/.setup/{compact-8ttks5U5.mjs → compact-BLSAd-ru.mjs} +117 -65
- package/dist/.setup/{plugin-metadata-cache-BRwtRct9.mjs → computer-use-DpolvQHw.mjs} +65 -202
- package/dist/.setup/{config-DKhXquav.mjs → config-0Gxk3_eq.mjs} +5 -6
- package/dist/.setup/{config-options-CzyWLTJt.mjs → config-options-HG_Rr3W_.mjs} +13 -23
- package/dist/.setup/{config-parsing-b088LyhT.mjs → config-parsing-BQq-CHTF.mjs} +41 -4
- package/dist/.setup/{config-runtime-C0NbLms1.mjs → config-runtime-cUYrqu_a.mjs} +2 -2
- package/dist/.setup/{config-security-CE-FcGw9.mjs → config-security-KAPScztc.mjs} +20 -36
- package/dist/.setup/{context-engine-projection-PezSESth.mjs → context-engine-projection-CsgYSQhW.mjs} +11 -14
- package/dist/.setup/{conversation-binding-74LaGGH-.mjs → conversation-binding-CgSSD1Qz.mjs} +36 -48
- package/dist/.setup/{conversation-binding-data-C746z5Pn.mjs → conversation-binding-data-DJ4ix-W5.mjs} +1 -1
- package/dist/.setup/{conversation-control-OrN6zuaY.mjs → conversation-control-tCg763cI.mjs} +19 -21
- package/dist/.setup/{cyber-failover-XV0nNRZu.mjs → cyber-failover-Bb1J6hS1.mjs} +1 -1
- package/dist/.setup/{cyber-failover-notice-RNpGpTyP.mjs → cyber-failover-notice-XR03ef31.mjs} +1 -1
- package/dist/.setup/doctor-start-options-DPW9JxIE.mjs +63 -0
- package/dist/.setup/dynamic-tool-build-CVrx02cH.mjs +463 -0
- package/dist/.setup/{dynamic-tools-Db2sY5cZ.mjs → dynamic-tools-DdsymYGQ.mjs} +238 -878
- package/dist/.setup/{effective-mcp-catalog-Bi6-SQ7i.mjs → effective-mcp-catalog-BysTBZCW.mjs} +83 -11
- package/dist/.setup/{elicitation-input-DPoK8F7w.mjs → elicitation-input-r9axtppm.mjs} +4 -2
- package/dist/.setup/{ephemeral-turn-DiCS1ijR.mjs → ephemeral-turn-oPKxs3ia.mjs} +2 -2
- package/dist/.setup/{event-projector-assistant-message-MV_1dj-3.mjs → event-projector-assistant-message-YCL2wspu.mjs} +2 -2
- package/dist/.setup/{event-projector-values-DJSz8BTk.mjs → event-projector-values-DTqZHizf.mjs} +2 -12
- package/dist/.setup/{inference-dispatch-CMZtjQyz.mjs → inference-dispatch-B5UKEUyC.mjs} +12 -21
- package/dist/.setup/{inference-proxy-DhcXOgUE.mjs → inference-proxy-DUO5E2QQ.mjs} +6 -5
- package/dist/.setup/{isolated-completion-D80IXfQF.mjs → isolated-completion-D5gbKm6k.mjs} +8 -8
- package/dist/.setup/{managed-binary-kiWRhNRE.mjs → managed-binary-C1VFoVPf.mjs} +31 -38
- package/dist/.setup/mcp-app-session-preparation-CdqsXwZX.mjs +223 -0
- package/dist/.setup/mcp-tool-metadata-j10HhfTC.mjs +43 -0
- package/dist/.setup/{model-catalog-DiC0Tkha.mjs → model-catalog-Dj_uvusa.mjs} +7 -7
- package/dist/.setup/{models-DfLmPV0k.mjs → models-Du_i5G_t.mjs} +10 -7
- package/dist/.setup/{native-auth-CuG53tu4.mjs → native-auth-Cjb9y7IZ.mjs} +5 -6
- package/dist/.setup/{native-execution-policy-BxZJy5mP.mjs → native-execution-policy-ClzpdG3D.mjs} +1 -12
- package/dist/.setup/native-mcp-app-DV7VbfzF.mjs +310 -0
- package/dist/.setup/{native-subagent-monitor-BwkQXf9e.mjs → native-subagent-monitor-CCEFO6qK.mjs} +235 -318
- package/dist/.setup/{native-subagent-pending-assignments-DwkCzLvD.mjs → native-subagent-pending-assignments-BDqhOdJp.mjs} +0 -4
- package/dist/.setup/{native-task-assignments-DMQ0g3hu.mjs → native-task-assignments-C6KVqiN1.mjs} +9 -8
- package/dist/.setup/{node-cli-sessions-HC4W6FLI.mjs → node-cli-sessions-B5oNDkUS.mjs} +11 -17
- package/dist/.setup/{node-exec-server.runtime-BgBfWQqo.mjs → node-exec-server.runtime-0xSEjKYt.mjs} +2 -2
- package/dist/.setup/{plan-DPdMk1Oy.mjs → plan-CUHSIOep.mjs} +67 -89
- package/dist/.setup/{plugin-activation-cNHRfaxU.mjs → plugin-activation-BcyBv8PG.mjs} +4 -4
- package/dist/.setup/{plugin-app-cache-key-BL9B5H0L.mjs → plugin-app-cache-key-BW8rd98k.mjs} +11 -15
- package/dist/.setup/plugin-approval-roundtrip-uAR-oQfr.mjs +109 -0
- package/dist/.setup/{plugin-inventory-Cky2XJUw.mjs → plugin-inventory-Bf0_piTw.mjs} +29 -51
- package/dist/.setup/{plugin-marketplace-discovery-D_dV9FXa.mjs → plugin-marketplace-discovery-SQPhSuic.mjs} +2 -16
- package/dist/.setup/plugin-metadata-cache-DWnB7VMj.mjs +84 -0
- package/dist/.setup/plugin-thread-config-deadline-CdRzGJt4.mjs +124 -0
- package/dist/.setup/{provider-D6F_7p1I.mjs → provider-BP8ZaZqn.mjs} +4 -4
- package/dist/.setup/provider-capabilities-Z5ZbBxqP.mjs +50 -0
- package/dist/.setup/{rate-limits-B7-X2TgG.mjs → rate-limits-CMPy24F5.mjs} +1 -5
- package/dist/.setup/{request-BZOfsSXW.mjs → request-BH3FvYUE.mjs} +189 -49
- package/dist/.setup/rpc-error-hmWM21RB.mjs +57 -0
- package/dist/.setup/{run-attempt-dYJhjZrp.mjs → run-attempt-CgvFoW7R.mjs} +553 -727
- package/dist/.setup/{run-attempt-lifecycle-C-6O3Exn.mjs → run-attempt-lifecycle-BuZgVbDA.mjs} +19 -3
- package/dist/.setup/{runtime-artifact-DDQ-HGXf.mjs → runtime-artifact-CUTOOnKw.mjs} +5 -6
- package/dist/.setup/{runtime-artifact-connection-D68qQn1m.mjs → runtime-artifact-connection-CADz3_BY.mjs} +5 -4
- package/dist/.setup/{sandbox-guard-DjCz2eOw.mjs → sandbox-guard-WqE8yPge.mjs} +3 -3
- package/dist/.setup/service-tier-normalization-Cei89SW6.mjs +15 -0
- package/dist/.setup/{session-binding-DGCYAfvD.mjs → session-binding-Ce7BqiPN.mjs} +92 -102
- package/dist/.setup/session-binding-meta-Lkm5Lpf4.mjs +15 -0
- package/dist/.setup/session-binding-record-BZB8RgcF.mjs +179 -0
- package/dist/.setup/session-binding-record-codec-z4ZpDn6E.mjs +216 -0
- package/dist/.setup/{session-binding-sidecars-jo6H8dFr.mjs → session-binding-sidecars-BrdV95Fg.mjs} +8 -2
- package/dist/.setup/{session-catalog-adoption-BU_pHWG7.mjs → session-catalog-adoption-CPIP4S_y.mjs} +34 -18
- package/dist/.setup/{session-catalog-archive-spHfihri.mjs → session-catalog-archive-DcgwvSbF.mjs} +24 -29
- package/dist/.setup/{session-catalog-events-BMCFMZw-.mjs → session-catalog-events-KIXOoSnQ.mjs} +5 -5
- package/dist/.setup/{session-catalog-index-DwJjnF5k.mjs → session-catalog-index-DPICGlxr.mjs} +361 -72
- package/dist/.setup/{session-catalog-index-order-BcQpHks3.mjs → session-catalog-index-order-nhyO0wdW.mjs} +1 -1
- package/dist/.setup/{session-catalog-limits-DDxOsQeC.mjs → session-catalog-limits-DEU36Qlo.mjs} +1 -1
- package/dist/.setup/{session-catalog-index-state-TeO7EyO-.mjs → session-catalog-list-request-tXephOB4.mjs} +180 -6
- package/dist/.setup/{session-catalog-native-projection-CuaFZuQE.mjs → session-catalog-native-projection-CTBd4EUm.mjs} +7 -6
- package/dist/.setup/{session-catalog-node-adoption-DgXvSGu0.mjs → session-catalog-node-adoption-7-WEQTB1.mjs} +12 -2
- package/dist/.setup/{session-catalog-node-continue-DjKXHBbi.mjs → session-catalog-node-continue-DLWBwAAO.mjs} +11 -15
- package/dist/.setup/{session-catalog-node-lookup-CtAXI5W5.mjs → session-catalog-node-lookup-Uufckwcm.mjs} +2 -2
- package/dist/.setup/{session-catalog-parsing-CPGaPYr-.mjs → session-catalog-parsing-B-qWJh2x.mjs} +70 -28
- package/dist/.setup/{session-catalog-projection-CGfzfP93.mjs → session-catalog-projection-CE0_Hffi.mjs} +6 -122
- package/dist/.setup/{session-catalog-provenance-DoAvktcj.mjs → session-catalog-provenance-CmsOE5mh.mjs} +6 -1
- package/dist/.setup/{session-cli-DlmBHYIe.mjs → session-cli-kH4vuGod.mjs} +1 -2
- package/dist/.setup/{session-history-D83lJWHG.mjs → session-history-BogBHKLk.mjs} +1 -1
- package/dist/.setup/{session-history-import-WhX-X33a.mjs → session-history-import-NWKPa4ZO.mjs} +4 -4
- package/dist/.setup/{session-history-read-Ov3StuL4.mjs → session-history-read-CNN8zwbD.mjs} +8 -19
- package/dist/.setup/{session-history.worker-MnPKncqP.mjs → session-history.worker-Cq_4DYgN.mjs} +3 -3
- package/dist/.setup/{session-initialization-6aveB9qb.mjs → session-initialization-D6dtFQkE.mjs} +2 -2
- package/dist/.setup/{session-permission-policy-Ci_fVX6y.mjs → session-permission-policy-BxIUJ0Zd.mjs} +8 -37
- package/dist/.setup/{session-retirement-LlYWBKTJ.mjs → session-retirement-aC60o6P3.mjs} +14 -15
- package/dist/.setup/{settled-turn-context-D4yj4rxf.mjs → settled-turn-context-BZsMjkIO.mjs} +13 -6
- package/dist/.setup/{settled-turn-finalizer-DW9W3gza.mjs → settled-turn-finalizer-CDxCejjC.mjs} +8 -8
- package/dist/.setup/{shared-client-CJCTeFpQ.mjs → shared-client-DJJ3ljH2.mjs} +291 -272
- package/dist/.setup/{provider-capabilities-DG5qbsUZ.mjs → shell-dynamic-tools-Do9lIAT1.mjs} +16 -55
- package/dist/.setup/{side-question-BLeGj7TQ.mjs → side-question-B7T0_GEC.mjs} +99 -91
- package/dist/.setup/{source-CJis_1EF.mjs → source-DH70LqN0.mjs} +24 -40
- package/dist/.setup/{thread-lifecycle-_bAbjedG.mjs → thread-lifecycle-DkcoX9q-.mjs} +262 -305
- package/dist/.setup/{thread-ownership-B6pPt21M.mjs → thread-ownership-0aRHD9iK.mjs} +10 -8
- package/dist/.setup/{thread-policy-gNPzzpVp.mjs → thread-policy-CXZV97TS.mjs} +22 -21
- package/dist/.setup/{thread-requests-OWGOiDaV.mjs → thread-requests-COrRJcZb.mjs} +107 -98
- package/dist/.setup/{thread-resume-GOry0AYh.mjs → thread-resume-rx7J68Rx.mjs} +10 -18
- package/dist/.setup/{transcript-history-projection-DRSifI-1.mjs → transcript-history-projection-B9a7HwUV.mjs} +11 -16
- package/dist/.setup/{transcript-mirror-kxmCYsuF.mjs → transcript-mirror-BfLRARNL.mjs} +64 -67
- package/dist/.setup/{transport-stdio-Bdegpn2V.mjs → transport-stdio-a0HDa2Mj.mjs} +27 -8
- package/dist/.setup/{transport-websocket-BTBE-LD9.mjs → transport-websocket-zqJ0Cmtn.mjs} +3 -8
- package/dist/.setup/{attempt-client-cleanup-B-S7ngS_.mjs → turn-router-CX1-EoCp.mjs} +75 -170
- package/dist/.setup/{upstream-session-fork-gkdRj2yH.mjs → upstream-session-fork-LYlaQnbt.mjs} +35 -46
- package/dist/.setup/{usage-CApUvLOV.mjs → usage-Dmx7B0W2.mjs} +4 -4
- package/dist/.setup/{usage-limit-error-wSMQkbpV.mjs → usage-limit-error-M8jVnITZ.mjs} +4 -4
- package/dist/.setup/{web-search-provider.runtime-UKgeiBUG.mjs → web-search-provider.runtime-CsVmqbFm.mjs} +4 -20
- package/dist/.setup/websocket-data-XlRvt8Ys.mjs +6 -0
- package/dist/.setup/workspace-write-sandbox-probe-DmUHLrrl.mjs +118 -0
- package/dist/api.js +34 -54
- package/dist/catalog-page.worker.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/doctor-contract-api.js +15 -27
- package/dist/harness.js +37 -22
- package/dist/index.js +2880 -276
- package/dist/media-understanding-provider.js +2 -2
- package/dist/migration-provider-api.js +1 -1
- package/dist/native-session-binding-api.js +2 -0
- package/dist/provider-discovery.js +1 -1
- package/dist/session-history-worker-runtime.js +33 -4
- package/dist/session-history.worker.js +1 -1
- package/openclaw.plugin.json +3 -3
- package/package.json +6 -6
- package/dist/.setup/config-utils-D0CXecki.mjs +0 -57
- package/dist/.setup/incognito-session-DWYapfwf.mjs +0 -2
- package/dist/.setup/managed-thread-store-BMqgThVL.mjs +0 -100
- package/dist/.setup/rpc-error-BlD2vuzn.mjs +0 -31
- package/dist/.setup/session-binding-meta-B7aEMU7g.mjs +0 -6
- package/dist/.setup/session-binding-record-Oe9L-CNY.mjs +0 -375
- package/dist/.setup/session-catalog-BFafIiF6.mjs +0 -2599
- package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +0 -170
- package/dist/.setup/shared-client-lifecycle-7xgtlo15.mjs +0 -153
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as publishCodexCatalogResume } from "./session-catalog-events-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as assertCodexThreadResumeSubscription, p as unsubscribeCodexThreadBestEffort, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-B-S7ngS_.mjs";
|
|
1
|
+
import { i as CodexAppServerScopedRequestRejectedError, o as isCodexAppServerOverloadError, r as CodexAppServerRpcError } from "./rpc-error-hmWM21RB.mjs";
|
|
2
|
+
import { r as publishCodexCatalogResume } from "./session-catalog-events-KIXOoSnQ.mjs";
|
|
3
|
+
import { L as forgetCodexWorkspaceReferences, ft as isCodexAppServerStartupError, u as isCodexAppServerStartSelectionChangedError } from "./shared-client-DJJ3ljH2.mjs";
|
|
4
|
+
import { h as assertCodexThreadResumeResponse, s as isCodexAppServerPrewriteRequestCancellationError } from "./client-CBzEVDyb.mjs";
|
|
5
|
+
import { f as unsubscribeCodexThreadBestEffort, i as assertCodexThreadResumeSubscription, r as CodexAppServerUnsafeSubscriptionError } from "./attempt-client-cleanup-yLjGwbwT.mjs";
|
|
7
6
|
import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
8
7
|
//#region extensions/codex/src/app-server/thread-resume.ts
|
|
9
8
|
/** Owns Codex thread/resume subscription safety. */
|
|
@@ -11,30 +10,23 @@ import { sanitizeTerminalText } from "openclaw/plugin-sdk/text-chunking";
|
|
|
11
10
|
async function resumeCodexAppServerThread(params) {
|
|
12
11
|
const threadId = params.request.threadId;
|
|
13
12
|
let response;
|
|
14
|
-
let ownershipRejected = false;
|
|
15
|
-
const assertCurrent = params.assertCurrent && (() => {
|
|
16
|
-
try {
|
|
17
|
-
params.assertCurrent?.();
|
|
18
|
-
} catch (error) {
|
|
19
|
-
ownershipRejected = true;
|
|
20
|
-
throw error;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
13
|
try {
|
|
24
14
|
response = assertCodexThreadResumeResponse(await (params.requestResume ? params.requestResume(params.request) : params.client.request("thread/resume", params.request, {
|
|
25
15
|
...params.timeoutMs !== void 0 ? { timeoutMs: params.timeoutMs } : {},
|
|
26
16
|
...params.signal ? { signal: params.signal } : {},
|
|
27
|
-
assertCurrent
|
|
17
|
+
assertCurrent: params.assertCurrent,
|
|
18
|
+
withCurrent: params.withCurrent
|
|
28
19
|
})));
|
|
29
20
|
assertCodexThreadResumeSubscription(threadId, response.thread.id);
|
|
30
21
|
forgetCodexWorkspaceReferences(params.client, threadId);
|
|
31
22
|
} catch (error) {
|
|
32
|
-
if (
|
|
23
|
+
if (isCodexAppServerStartSelectionChangedError(error) || isCodexAppServerStartupError(error) || error instanceof CodexAppServerScopedRequestRejectedError || isCodexAppServerPrewriteRequestCancellationError(error) || isCodexAppServerOverloadError(error)) throw error;
|
|
33
24
|
if (error instanceof CodexAppServerRpcError) {
|
|
34
25
|
if (await unsubscribeCodexThreadBestEffort(params.client, {
|
|
35
26
|
threadId,
|
|
36
27
|
timeoutMs: 5e3,
|
|
37
|
-
assertCurrent: params.assertCurrent
|
|
28
|
+
assertCurrent: params.assertCurrent,
|
|
29
|
+
withCurrent: params.withCurrent
|
|
38
30
|
}).catch(() => false)) {
|
|
39
31
|
params.onSubscriptionReleased?.();
|
|
40
32
|
throw error;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as readCodexAsyncQuestions } from "./async-questions-DdhOCwGi.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { i as readCodexProviderRefusal, t as codexProviderRefusalDiagnostics } from "./event-projector-values-DTqZHizf.mjs";
|
|
3
3
|
import { t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-fXkKbPVC.mjs";
|
|
4
|
-
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
|
+
import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { truncateUtf8Prefix } from "openclaw/plugin-sdk/text-utility-runtime";
|
|
6
6
|
import { Buffer } from "node:buffer";
|
|
7
7
|
//#region extensions/codex/src/app-server/transcript-history-projection.ts
|
|
@@ -24,14 +24,6 @@ const CODEX_HISTORY_ZERO_USAGE = {
|
|
|
24
24
|
total: 0
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
function historyAssistantFields(provider) {
|
|
28
|
-
return {
|
|
29
|
-
api: "openai-chatgpt-responses",
|
|
30
|
-
provider,
|
|
31
|
-
model: "native-history",
|
|
32
|
-
usage: CODEX_HISTORY_ZERO_USAGE
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
27
|
function projectCodexHistoryMessage(message, text) {
|
|
36
28
|
const phase = message.role === "assistant" && "phase" in message && (message.phase === "commentary" || message.phase === "final_answer") ? message.phase : void 0;
|
|
37
29
|
return {
|
|
@@ -49,8 +41,7 @@ function projectCodexHistoryMessage(message, text) {
|
|
|
49
41
|
};
|
|
50
42
|
}
|
|
51
43
|
function normalizeImportedHistoryText(value) {
|
|
52
|
-
|
|
53
|
-
const text = value.trim();
|
|
44
|
+
const text = normalizeOptionalString(value);
|
|
54
45
|
if (!text) return;
|
|
55
46
|
if (Buffer.byteLength(text, "utf8") <= CODEX_HISTORY_IMPORT_MAX_MESSAGE_BYTES) return text;
|
|
56
47
|
const suffixBytes = Buffer.byteLength(CODEX_HISTORY_TRUNCATION_SUFFIX, "utf8");
|
|
@@ -60,9 +51,8 @@ function normalizeImportedHistoryText(value) {
|
|
|
60
51
|
function projectCodexUserItemText(item) {
|
|
61
52
|
if (!Array.isArray(item.content)) return;
|
|
62
53
|
const parts = [];
|
|
63
|
-
for (const
|
|
64
|
-
if (!
|
|
65
|
-
const input = value;
|
|
54
|
+
for (const input of item.content) {
|
|
55
|
+
if (!isRecord(input)) continue;
|
|
66
56
|
if (input.type === "text") {
|
|
67
57
|
const text = normalizeImportedHistoryText(input.text);
|
|
68
58
|
if (text) parts.push(text);
|
|
@@ -91,7 +81,12 @@ function selectTurnsThroughBoundary(thread, throughTurnId) {
|
|
|
91
81
|
}
|
|
92
82
|
function projectCodexThreadHistory(params) {
|
|
93
83
|
const projected = [];
|
|
94
|
-
const assistantFields =
|
|
84
|
+
const assistantFields = {
|
|
85
|
+
api: "openai-chatgpt-responses",
|
|
86
|
+
provider: normalizeOptionalString(params.modelProvider) ?? normalizeOptionalString(params.thread.modelProvider) ?? CODEX_HISTORY_ASSISTANT_PROVIDER,
|
|
87
|
+
model: "native-history",
|
|
88
|
+
usage: CODEX_HISTORY_ZERO_USAGE
|
|
89
|
+
};
|
|
95
90
|
const threadTimestamp = typeof params.thread.createdAt === "number" && Number.isFinite(params.thread.createdAt) ? params.thread.createdAt * 1e3 : params.importedAt;
|
|
96
91
|
let itemOffset = 0;
|
|
97
92
|
for (const turn of params.turns) {
|
|
@@ -1,12 +1,67 @@
|
|
|
1
1
|
import { t as readCodexAsyncQuestions } from "./async-questions-DdhOCwGi.mjs";
|
|
2
2
|
import { i as readUpstreamUserText, n as attachUpstreamUserText, r as readMirrorIdentity, t as attachCodexMirrorIdentity } from "./upstream-prompt-provenance-fXkKbPVC.mjs";
|
|
3
|
-
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-
|
|
3
|
+
import { t as projectBoundedCodexThreadHistory } from "./transcript-history-projection-B9a7HwUV.mjs";
|
|
4
4
|
import { a as fingerprintCodexMirrorSourceMessage, c as readCodexMirrorSourceFingerprint, i as buildCodexMirrorDedupeIdentity, n as attachCodexMirrorAttestation, r as attachCodexMirrorRunId, s as isMirroredAgentMessage, t as applyCodexTranscriptTaint } from "./transcript-mirror-attestation-YSegaktH.mjs";
|
|
5
|
-
import { t as __exportAll } from "./session-binding-sidecars-
|
|
5
|
+
import { t as __exportAll } from "./session-binding-sidecars-BrdV95Fg.mjs";
|
|
6
6
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
7
7
|
import { deliverAgentHarnessUserInputPrompt, embeddedAgentLog, formatErrorMessage, projectAgentHarnessTranscriptMessageForDisplay, restorePreparedUserTurnOperationalMetaForRuntime, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
|
|
8
8
|
import { withCodexSessionTranscriptMirrorWriteLock } from "openclaw/plugin-sdk/codex-session-transcript-runtime";
|
|
9
9
|
import { publishSessionTranscriptUpdateByIdentity } from "openclaw/plugin-sdk/session-transcript-runtime";
|
|
10
|
+
//#region extensions/codex/src/app-server/user-prompt-message.ts
|
|
11
|
+
function buildSenderLabel(params) {
|
|
12
|
+
const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
|
|
13
|
+
if (!label) return;
|
|
14
|
+
return !params.senderId || label.includes(params.senderId) ? label : `${label} (${params.senderId})`;
|
|
15
|
+
}
|
|
16
|
+
function buildFromPrepared(params, preparedUserMessage) {
|
|
17
|
+
const senderId = normalizeOptionalString(params.senderId);
|
|
18
|
+
const senderName = normalizeOptionalString(params.senderName);
|
|
19
|
+
const senderUsername = normalizeOptionalString(params.senderUsername);
|
|
20
|
+
const senderE164 = normalizeOptionalString(params.senderE164);
|
|
21
|
+
const senderLabel = buildSenderLabel({
|
|
22
|
+
senderId,
|
|
23
|
+
senderName,
|
|
24
|
+
senderUsername,
|
|
25
|
+
senderE164
|
|
26
|
+
});
|
|
27
|
+
const sourceChannel = normalizeOptionalString(params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider);
|
|
28
|
+
return {
|
|
29
|
+
role: "user",
|
|
30
|
+
timestamp: Date.now(),
|
|
31
|
+
...params.inputProvenance ? { provenance: params.inputProvenance } : {},
|
|
32
|
+
...sourceChannel ? { sourceChannel } : {},
|
|
33
|
+
...senderId ? { senderId } : {},
|
|
34
|
+
...senderName ? { senderName } : {},
|
|
35
|
+
...senderUsername ? { senderUsername } : {},
|
|
36
|
+
...senderE164 ? { senderE164 } : {},
|
|
37
|
+
...senderLabel ? { senderLabel } : {},
|
|
38
|
+
...preparedUserMessage ?? { content: params.transcriptPrompt ?? params.prompt }
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function buildCodexUserPromptMessage(params) {
|
|
42
|
+
return buildFromPrepared(params, params.userTurnTranscriptRecorder?.message);
|
|
43
|
+
}
|
|
44
|
+
function promptSnapshot(params, turnId, upstreamUserText) {
|
|
45
|
+
if (params.suppressNextUserMessagePersistence) return [];
|
|
46
|
+
const message = attachCodexMirrorIdentity(buildCodexUserPromptMessage(params), `${turnId}:prompt`);
|
|
47
|
+
return [upstreamUserText ? attachUpstreamUserText(message, upstreamUserText) : message];
|
|
48
|
+
}
|
|
49
|
+
async function buildResolvedCodexUserPromptMessage(params) {
|
|
50
|
+
return buildFromPrepared(params, await params.userTurnTranscriptRecorder?.resolveMessage() ?? params.userTurnTranscriptRecorder?.message);
|
|
51
|
+
}
|
|
52
|
+
async function resolveFinalCodexMirrorMessages(params) {
|
|
53
|
+
if (params.params.suppressNextUserMessagePersistence || !params.params.userTurnTranscriptRecorder) return params.messagesSnapshot;
|
|
54
|
+
const previousPrompt = params.messagesSnapshot.find((message) => message.role === "user");
|
|
55
|
+
const resolvedBase = attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`);
|
|
56
|
+
const upstreamUserText = readUpstreamUserText(previousPrompt);
|
|
57
|
+
const resolvedPrompt = upstreamUserText ? attachUpstreamUserText(resolvedBase, upstreamUserText) : resolvedBase;
|
|
58
|
+
const firstUserIndex = params.messagesSnapshot.findIndex((message) => message.role === "user");
|
|
59
|
+
if (firstUserIndex === -1) return [resolvedPrompt, ...params.messagesSnapshot];
|
|
60
|
+
const messages = params.messagesSnapshot.slice();
|
|
61
|
+
messages[firstUserIndex] = resolvedPrompt;
|
|
62
|
+
return messages;
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
10
65
|
//#region extensions/codex/src/app-server/transcript-mirror-write.ts
|
|
11
66
|
function readMirroredAssistantText(message) {
|
|
12
67
|
return message?.role === "assistant" ? message.content.flatMap((part) => part.type === "text" ? [part.text] : []).join("\n") || void 0 : void 0;
|
|
@@ -100,10 +155,10 @@ async function mirror(params) {
|
|
|
100
155
|
runtimeMessage: nextMessage,
|
|
101
156
|
preparedMessage: preparedUserMessage
|
|
102
157
|
});
|
|
103
|
-
let messageToAppend =
|
|
158
|
+
let messageToAppend = {
|
|
104
159
|
...attachCodexMirrorAttestation(restoredMessage, sourceFingerprint),
|
|
105
|
-
idempotencyKey
|
|
106
|
-
}
|
|
160
|
+
...idempotencyKey ? { idempotencyKey } : {}
|
|
161
|
+
};
|
|
107
162
|
if (mirrorIdentity) messageToAppend = attachCodexMirrorIdentity(messageToAppend, mirrorIdentity);
|
|
108
163
|
if (ownsRun && params.runId) messageToAppend = attachCodexMirrorRunId(messageToAppend, params.runId, ownsTerminal, terminalOwner?.settlementWarning);
|
|
109
164
|
if (message.role === "assistant" && message.openclawAsyncDelivery) {
|
|
@@ -195,68 +250,12 @@ function resolveCodexMirrorTranscriptTarget(params) {
|
|
|
195
250
|
};
|
|
196
251
|
}
|
|
197
252
|
//#endregion
|
|
198
|
-
//#region extensions/codex/src/app-server/user-prompt-message.ts
|
|
199
|
-
function buildSenderLabel(params) {
|
|
200
|
-
const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
|
|
201
|
-
if (!label) return;
|
|
202
|
-
return !params.senderId || label.includes(params.senderId) ? label : `${label} (${params.senderId})`;
|
|
203
|
-
}
|
|
204
|
-
function buildFromPrepared(params, preparedUserMessage) {
|
|
205
|
-
const senderId = normalizeOptionalString(params.senderId);
|
|
206
|
-
const senderName = normalizeOptionalString(params.senderName);
|
|
207
|
-
const senderUsername = normalizeOptionalString(params.senderUsername);
|
|
208
|
-
const senderE164 = normalizeOptionalString(params.senderE164);
|
|
209
|
-
const senderLabel = buildSenderLabel({
|
|
210
|
-
senderId,
|
|
211
|
-
senderName,
|
|
212
|
-
senderUsername,
|
|
213
|
-
senderE164
|
|
214
|
-
});
|
|
215
|
-
const sourceChannel = normalizeOptionalString(params.inputProvenance?.sourceChannel ?? params.messageChannel ?? params.messageProvider);
|
|
216
|
-
return {
|
|
217
|
-
role: "user",
|
|
218
|
-
timestamp: Date.now(),
|
|
219
|
-
...params.inputProvenance ? { provenance: params.inputProvenance } : {},
|
|
220
|
-
...sourceChannel ? { sourceChannel } : {},
|
|
221
|
-
...senderId ? { senderId } : {},
|
|
222
|
-
...senderName ? { senderName } : {},
|
|
223
|
-
...senderUsername ? { senderUsername } : {},
|
|
224
|
-
...senderE164 ? { senderE164 } : {},
|
|
225
|
-
...senderLabel ? { senderLabel } : {},
|
|
226
|
-
...preparedUserMessage ?? { content: params.transcriptPrompt ?? params.prompt }
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
function buildCodexUserPromptMessage(params) {
|
|
230
|
-
return buildFromPrepared(params, params.userTurnTranscriptRecorder?.message);
|
|
231
|
-
}
|
|
232
|
-
function promptSnapshot(params, turnId, upstreamUserText) {
|
|
233
|
-
if (params.suppressNextUserMessagePersistence) return [];
|
|
234
|
-
const message = attachCodexMirrorIdentity(buildCodexUserPromptMessage(params), `${turnId}:prompt`);
|
|
235
|
-
return [upstreamUserText ? attachUpstreamUserText(message, upstreamUserText) : message];
|
|
236
|
-
}
|
|
237
|
-
async function buildResolvedCodexUserPromptMessage(params) {
|
|
238
|
-
return buildFromPrepared(params, await params.userTurnTranscriptRecorder?.resolveMessage() ?? params.userTurnTranscriptRecorder?.message);
|
|
239
|
-
}
|
|
240
|
-
async function resolveFinalCodexMirrorMessages(params) {
|
|
241
|
-
if (params.params.suppressNextUserMessagePersistence || !params.params.userTurnTranscriptRecorder) return params.messagesSnapshot;
|
|
242
|
-
const previousPrompt = params.messagesSnapshot.find((message) => message.role === "user");
|
|
243
|
-
const resolvedBase = attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`);
|
|
244
|
-
const upstreamUserText = readUpstreamUserText(previousPrompt);
|
|
245
|
-
const resolvedPrompt = upstreamUserText ? attachUpstreamUserText(resolvedBase, upstreamUserText) : resolvedBase;
|
|
246
|
-
const firstUserIndex = params.messagesSnapshot.findIndex((message) => message.role === "user");
|
|
247
|
-
if (firstUserIndex === -1) return [resolvedPrompt, ...params.messagesSnapshot];
|
|
248
|
-
const messages = params.messagesSnapshot.slice();
|
|
249
|
-
messages[firstUserIndex] = resolvedPrompt;
|
|
250
|
-
return messages;
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
253
|
//#region extensions/codex/src/app-server/transcript-mirror.ts
|
|
254
254
|
var transcript_mirror_exports = /* @__PURE__ */ __exportAll({
|
|
255
255
|
codexTranscriptMirrorRuntime: () => codexTranscriptMirrorRuntime,
|
|
256
256
|
createCodexAppServerUserMessagePersistenceNotifier: () => createCodexAppServerUserMessagePersistenceNotifier,
|
|
257
257
|
importCodexThreadHistoryToTranscript: () => importCodexThreadHistoryToTranscript,
|
|
258
|
-
mirrorPromptAtTurnStartBestEffort: () => mirrorPromptAtTurnStartBestEffort
|
|
259
|
-
projectBoundedCodexThreadHistory: () => projectBoundedCodexThreadHistory
|
|
258
|
+
mirrorPromptAtTurnStartBestEffort: () => mirrorPromptAtTurnStartBestEffort
|
|
260
259
|
});
|
|
261
260
|
/** Imports a bounded, user-visible Codex history tail into a new OpenClaw transcript. */
|
|
262
261
|
async function importCodexThreadHistoryToTranscript(params) {
|
|
@@ -464,8 +463,9 @@ async function deliverAsyncMessageBestEffort(params) {
|
|
|
464
463
|
if (!params.params.onBlockReply) return "retry";
|
|
465
464
|
text = params.text;
|
|
466
465
|
}
|
|
467
|
-
|
|
468
|
-
|
|
466
|
+
const onBlockReply = params.params.onBlockReply;
|
|
467
|
+
if (onBlockReply && text !== void 0) try {
|
|
468
|
+
await deliverAgentHarnessUserInputPrompt({ onBlockReply: (payload) => onBlockReply(payload, { deliveryIntentId }) }, [], { intro: text });
|
|
469
469
|
} catch (error) {
|
|
470
470
|
embeddedAgentLog.warn(target ? "failed to deliver persisted codex async agent message" : "failed to deliver codex async agent message", {
|
|
471
471
|
error: formatErrorMessage(error),
|
|
@@ -483,8 +483,5 @@ const codexTranscriptMirrorRuntime = {
|
|
|
483
483
|
mirror,
|
|
484
484
|
mirrorBestEffort
|
|
485
485
|
};
|
|
486
|
-
async function deliverAsyncBlockReply(onBlockReply, text, deliveryIntentId) {
|
|
487
|
-
await deliverAgentHarnessUserInputPrompt({ onBlockReply: (payload) => onBlockReply(payload, { deliveryIntentId }) }, [], { intro: text });
|
|
488
|
-
}
|
|
489
486
|
//#endregion
|
|
490
487
|
export { transcript_mirror_exports as a, promptSnapshot as c, mirrorPromptAtTurnStartBestEffort as i, createCodexAppServerUserMessagePersistenceNotifier as n, buildCodexUserPromptMessage as o, importCodexThreadHistoryToTranscript as r, buildResolvedCodexUserPromptMessage as s, codexTranscriptMirrorRuntime as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as normalizeCodexAppServerArgs } from "./launch-args-DbFCehO7.mjs";
|
|
2
|
-
import { i as resolveManagedCodexNativeCommand } from "./managed-binary-
|
|
2
|
+
import { i as resolveManagedCodexNativeCommand } from "./managed-binary-C1VFoVPf.mjs";
|
|
3
3
|
import { i as recordCodexAppServerSpawnFailure, r as getCodexAppServerSpawnFailure } from "./spawn-error-CL3n6MAa.mjs";
|
|
4
4
|
import { createHash, randomUUID } from "node:crypto";
|
|
5
5
|
import { stripVTControlCharacters } from "node:util";
|
|
6
6
|
import { embeddedAgentLog } from "openclaw/plugin-sdk/agent-harness-registration";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import { materializeWindowsSpawnProgram, resolveWindowsSpawnProgram } from "openclaw/plugin-sdk/windows-spawn";
|
|
9
|
+
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
9
10
|
import { closeSync, constants, openSync, readSync } from "node:fs";
|
|
10
11
|
import path from "node:path";
|
|
11
12
|
import { readFile, readdir } from "node:fs/promises";
|
|
12
|
-
import { resolveGlobalSingleton } from "openclaw/plugin-sdk/global-singleton";
|
|
13
13
|
import { once } from "node:events";
|
|
14
14
|
import { KeyedAsyncQueue } from "openclaw/plugin-sdk/keyed-async-queue";
|
|
15
15
|
import { resolveStateDir } from "openclaw/plugin-sdk/state-paths";
|
|
@@ -541,6 +541,11 @@ const registrationSchema = z.object({
|
|
|
541
541
|
child: childIdentity
|
|
542
542
|
}).strict();
|
|
543
543
|
const registrationCleanup = /* @__PURE__ */ new WeakMap();
|
|
544
|
+
const registeredTransportIdentities = /* @__PURE__ */ new WeakMap();
|
|
545
|
+
/** Registration-time direct transport identity, not descendant identity or current liveness. */
|
|
546
|
+
function getCodexAppServerRegisteredTransportIdentity(child) {
|
|
547
|
+
return registeredTransportIdentities.get(child);
|
|
548
|
+
}
|
|
544
549
|
const processReaper = resolveGlobalSingleton(Symbol.for("openclaw.codexAppServerProcessReaper"), () => new KeyedAsyncQueue());
|
|
545
550
|
/** Join bookkeeping after the transport owner has observed physical exit. */
|
|
546
551
|
async function waitForCodexAppServerProcessRegistrationCleanup(child) {
|
|
@@ -654,26 +659,39 @@ async function prepareCodexAppServerProcessRegistration() {
|
|
|
654
659
|
await cleanup;
|
|
655
660
|
throw new Error("Cannot register the Codex child process: the child exited during registration. Retry.");
|
|
656
661
|
}
|
|
662
|
+
registeredTransportIdentities.set(child, Object.freeze({
|
|
663
|
+
pid: value.child.pid,
|
|
664
|
+
startedAt: value.child.startedAt
|
|
665
|
+
}));
|
|
657
666
|
};
|
|
658
667
|
}
|
|
659
668
|
//#endregion
|
|
660
669
|
//#region extensions/codex/src/app-server/managed-launcher-failure.ts
|
|
661
|
-
/** The official npm launcher prints
|
|
670
|
+
/** The official npm launcher prints the native spawn error and exits before initialization. */
|
|
662
671
|
function observeManagedCodexLauncherFailure(child, nativeCommand) {
|
|
663
672
|
let prefix = "";
|
|
664
673
|
let launchCode;
|
|
665
|
-
const
|
|
674
|
+
const complete = () => {
|
|
666
675
|
child.stderr.off("data", onData);
|
|
667
676
|
child.off("exit", onExit);
|
|
677
|
+
child.off("close", complete);
|
|
668
678
|
prefix = "";
|
|
669
|
-
}
|
|
679
|
+
};
|
|
680
|
+
const startupFailure = { complete };
|
|
670
681
|
const onData = (chunk) => {
|
|
671
682
|
if (launchCode || prefix.length >= 16384) return;
|
|
672
683
|
prefix = (prefix + stripVTControlCharacters(chunk.toString())).slice(0, 16384);
|
|
673
684
|
if (/\bError: spawn\b/u.test(prefix) && /syscall: ['"]spawn(?: [^'"\r\n]*)?['"]/u.test(prefix)) launchCode = /\bcode: ['"](ENOENT|EACCES|EBADARCH|Unknown system error -86)['"]/u.exec(prefix)?.[1];
|
|
674
685
|
else if (/Error: Missing optional dependency @openai\/codex-[\w-]+\. Reinstall Codex:/u.test(prefix)) launchCode = "ENOENT";
|
|
686
|
+
else {
|
|
687
|
+
const bunError = /^(ENOENT|EACCES|EBADARCH|Unknown system error -86): [^\r\n]*, (?:posix_spawn|spawn) (['"])([^\r\n]*)\2\r?$/mu.exec(prefix);
|
|
688
|
+
const syscall = /^\s+syscall: (['"])([^\r\n]*)\1,\r?$/mu.exec(prefix)?.[2];
|
|
689
|
+
if (bunError?.[3] === nativeCommand && syscall === `spawn ${nativeCommand}`) launchCode = bunError[1];
|
|
690
|
+
}
|
|
691
|
+
if (child.exitCode !== null) onExit(child.exitCode);
|
|
675
692
|
};
|
|
676
693
|
const onExit = (code) => {
|
|
694
|
+
if (code === 1 && !launchCode) return;
|
|
677
695
|
startupFailure.complete();
|
|
678
696
|
if (code !== 1 || !launchCode) return;
|
|
679
697
|
const described = recordCodexAppServerSpawnFailure(Object.assign(/* @__PURE__ */ new Error(`spawn ${launchCode}`), {
|
|
@@ -684,6 +702,7 @@ function observeManagedCodexLauncherFailure(child, nativeCommand) {
|
|
|
684
702
|
};
|
|
685
703
|
child.stderr.on("data", onData);
|
|
686
704
|
child.once("exit", onExit);
|
|
705
|
+
child.once("close", complete);
|
|
687
706
|
Object.assign(child, { startupFailure });
|
|
688
707
|
}
|
|
689
708
|
//#endregion
|
|
@@ -822,7 +841,6 @@ const RUNTIME_INJECTION_ENVIRONMENT_KEYS = /* @__PURE__ */ new Set([
|
|
|
822
841
|
"LD_LIBRARY_PATH",
|
|
823
842
|
"LD_PRELOAD"
|
|
824
843
|
]);
|
|
825
|
-
const QA_PARENT_PID_ENV = "OPENCLAW_QA_PARENT_PID";
|
|
826
844
|
/** Resolves the concrete command/argv/shell settings used to spawn Codex app-server. */
|
|
827
845
|
function resolveCodexAppServerSpawnInvocation(options, env) {
|
|
828
846
|
if (options.commandSource === "managed") throw new Error("Managed Codex app-server start options must be resolved before spawn.");
|
|
@@ -872,6 +890,7 @@ function copySafeEnvironmentEntries(target, source) {
|
|
|
872
890
|
}
|
|
873
891
|
/** Spawns the Codex app-server process and returns the shared transport interface. */
|
|
874
892
|
async function createStdioTransport(options, baseEnv = process.env, assertCurrent, onSpawn) {
|
|
893
|
+
const isHostedGateway = baseEnv.OPENCLAW_GATEWAY_HOST_LIFELINE?.trim() === "stdin";
|
|
875
894
|
const env = resolveCodexAppServerSpawnEnv(options, baseEnv);
|
|
876
895
|
const invocation = resolveCodexAppServerSpawnInvocation(options, env);
|
|
877
896
|
const nativeCommand = options.commandSource === "resolved-managed" ? resolveManagedCodexNativeCommand(options.command, { pathExists: () => true }) : void 0;
|
|
@@ -898,7 +917,7 @@ async function createStdioTransport(options, baseEnv = process.env, assertCurren
|
|
|
898
917
|
child = spawn(invocation.command, invocation.argv, {
|
|
899
918
|
...options.cwd !== void 0 ? { cwd: options.cwd } : {},
|
|
900
919
|
env,
|
|
901
|
-
detached: process.platform !== "win32" && !
|
|
920
|
+
detached: process.platform !== "win32" && !isHostedGateway,
|
|
902
921
|
shell: invocation.shell,
|
|
903
922
|
stdio: [
|
|
904
923
|
"pipe",
|
|
@@ -923,4 +942,4 @@ async function createStdioTransport(options, baseEnv = process.env, assertCurren
|
|
|
923
942
|
}
|
|
924
943
|
}
|
|
925
944
|
//#endregion
|
|
926
|
-
export { closeCodexAppServerTransportAndWait as a, closeCodexAppServerTransport as i, resolveCodexAppServerSpawnEnv as n, hasCodexAppServerNaturalExit as o, resolveCodexAppServerSpawnInvocation as r, createCodexAppServerProcessReaperService as s, createStdioTransport as t };
|
|
945
|
+
export { closeCodexAppServerTransportAndWait as a, getCodexAppServerRegisteredTransportIdentity as c, closeCodexAppServerTransport as i, resolveCodexAppServerSpawnEnv as n, hasCodexAppServerNaturalExit as o, resolveCodexAppServerSpawnInvocation as r, createCodexAppServerProcessReaperService as s, createStdioTransport as t };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as resolveCodexAppServerUserHomeDir } from "./auth-start-options-BPIPeEX8.mjs";
|
|
2
|
-
import "./config-
|
|
2
|
+
import "./config-0Gxk3_eq.mjs";
|
|
3
|
+
import { t as codexWebSocketDataToBuffer } from "./websocket-data-XlRvt8Ys.mjs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { EventEmitter } from "node:events";
|
|
5
6
|
import net from "node:net";
|
|
@@ -137,7 +138,7 @@ function createWebSocketTransport(options) {
|
|
|
137
138
|
});
|
|
138
139
|
socket.on("message", (data) => {
|
|
139
140
|
if (options.transport === "websocket") recordConnectionActivity();
|
|
140
|
-
const frame =
|
|
141
|
+
const frame = codexWebSocketDataToBuffer(data);
|
|
141
142
|
const writable = stdout.write(frame);
|
|
142
143
|
const delimited = frame.at(-1) === 10 || stdout.write(Buffer.from("\n"));
|
|
143
144
|
if (!writable || !delimited) socket.pause();
|
|
@@ -201,11 +202,5 @@ function resolveCodexAppServerUnixSocketPath(options) {
|
|
|
201
202
|
if (!url.startsWith("unix://")) throw new Error("codex app-server unix transport requires a unix:// URL");
|
|
202
203
|
return url.slice(7) || path.join(resolveCodexAppServerUserHomeDir(options.env ?? process.env), "app-server-control", "app-server-control.sock");
|
|
203
204
|
}
|
|
204
|
-
function websocketFrameToBuffer(data) {
|
|
205
|
-
if (typeof data === "string") return Buffer.from(data);
|
|
206
|
-
if (Buffer.isBuffer(data)) return data;
|
|
207
|
-
if (Array.isArray(data)) return Buffer.concat(data);
|
|
208
|
-
return Buffer.from(data);
|
|
209
|
-
}
|
|
210
205
|
//#endregion
|
|
211
206
|
export { isCodexWebSocketOpenFailure as n, resolveCodexAppServerUnixSocketPath as r, createWebSocketTransport as t };
|