@openclaw/codex 2026.9.5 → 2026.9.7

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.
Files changed (174) hide show
  1. package/README.md +2 -0
  2. package/assets/icon.png +0 -0
  3. package/dist/.setup/{account-usage-runtime-C2MOIvfq.mjs → account-usage-runtime-DFhbh1zz.mjs} +6 -6
  4. package/dist/.setup/{apply-CJ0ZfmBG.mjs → apply-D3GcSoSa.mjs} +35 -55
  5. package/dist/.setup/{attempt-client-cleanup-BpYKdTA0.mjs → attempt-client-cleanup-DOP-cW5j.mjs} +179 -73
  6. package/dist/.setup/attempt-workspace-context-C5HigshI.mjs +164 -0
  7. package/dist/.setup/{auth-binding-DhLWa_7K.mjs → auth-binding-BLWz7stm.mjs} +14 -1
  8. package/dist/.setup/{auth-cache-key-QirmgiCo.mjs → auth-cache-key-Dbvq-QgB.mjs} +41 -111
  9. package/dist/.setup/{auth-profile-WqZtZfXN.mjs → auth-profile-B0okYl2D.mjs} +1 -2
  10. package/dist/.setup/auth-profile-health-oHizqgye.mjs +53 -0
  11. package/dist/.setup/auth-profile-recovery-BREezV0L.mjs +14 -0
  12. package/dist/.setup/auth-start-options-BPIPeEX8.mjs +44 -0
  13. package/dist/.setup/{binding-connection-Bm38niE8.mjs → binding-connection-DTtN1KrX.mjs} +2 -2
  14. package/dist/.setup/{binding-connection.runtime-CnRMC0ta.mjs → binding-connection.runtime-6TpgD1M6.mjs} +5 -5
  15. package/dist/.setup/{bounded-turn-BtlZcivC.mjs → bounded-turn-CbjoN2OW.mjs} +140 -37
  16. package/dist/.setup/bounded-turn-isolation-B8K_ylqk.mjs +14 -0
  17. package/dist/.setup/{build-state-Xx9ybZqa.mjs → build-state-Da1_z0kd.mjs} +1 -1
  18. package/dist/.setup/{capabilities-_vXcZGSx.mjs → capabilities-B3WEZl4e.mjs} +2 -10
  19. package/dist/.setup/{client-vXs2929Q.mjs → client-N0JpgSzF.mjs} +635 -872
  20. package/dist/.setup/client-catalog-response-5HHLdcde.mjs +285 -0
  21. package/dist/.setup/{command-dispatch-naHIZwwF.mjs → command-dispatch-BeAoaovI.mjs} +9 -8
  22. package/dist/.setup/{command-formatters-CGEkdawF.mjs → command-formatters-R3ckE3Co.mjs} +36 -64
  23. package/dist/.setup/{command-handlers-BtAJEW1X.mjs → command-handlers-ylTMS00z.mjs} +301 -488
  24. package/dist/.setup/{command-rpc-DHFpn4le.mjs → command-rpc-CGJGUQ6Y.mjs} +40 -28
  25. package/dist/.setup/compact-C2WamavS.mjs +776 -0
  26. package/dist/.setup/{config-CedDWjM-.mjs → config-DKhXquav.mjs} +26 -28
  27. package/dist/.setup/{config-options-BsanJ8QG.mjs → config-options-CzyWLTJt.mjs} +68 -65
  28. package/dist/.setup/{config-parsing-CcB9iPoq.mjs → config-parsing-b088LyhT.mjs} +57 -60
  29. package/dist/.setup/{config-runtime-CeAhl_h4.mjs → config-runtime-C0NbLms1.mjs} +2 -2
  30. package/dist/.setup/{config-security-BRQ2mgW9.mjs → config-security-CE-FcGw9.mjs} +51 -215
  31. package/dist/.setup/{config-utils-DujwEnhg.mjs → config-utils-D0CXecki.mjs} +3 -13
  32. package/dist/.setup/context-engine-projection-PezSESth.mjs +387 -0
  33. package/dist/.setup/{conversation-binding-DhzrpTM6.mjs → conversation-binding-3Min8qvP.mjs} +71 -105
  34. package/dist/.setup/{conversation-binding-data-CrcyZk6O.mjs → conversation-binding-data-C746z5Pn.mjs} +8 -12
  35. package/dist/.setup/{conversation-control-DN53ns41.mjs → conversation-control-CEP8X5JC.mjs} +30 -69
  36. package/dist/.setup/{cyber-failover-DYwbmf1o.mjs → cyber-failover-XV0nNRZu.mjs} +1 -1
  37. package/dist/.setup/{cyber-failover-notice-e9G3J9-e.mjs → cyber-failover-notice-RNpGpTyP.mjs} +1 -1
  38. package/dist/.setup/{dynamic-tools-D16lOp67.mjs → dynamic-tools-DzlsLUuS.mjs} +3136 -3167
  39. package/dist/.setup/{effective-mcp-catalog-K6kLCN8X.mjs → effective-mcp-catalog-CxUtC-xG.mjs} +8 -17
  40. package/dist/.setup/{ephemeral-turn-R1gA8Sn6.mjs → ephemeral-turn-CDsPJOa2.mjs} +9 -6
  41. package/dist/.setup/event-projector-assistant-message-CigreO4K.mjs +69 -0
  42. package/dist/.setup/{event-projector-usage-C7Ntzs-f.mjs → event-projector-usage-03R0I2dM.mjs} +4 -26
  43. package/dist/.setup/event-projector-values-DJSz8BTk.mjs +106 -0
  44. package/dist/.setup/incognito-session-DWYapfwf.mjs +2 -0
  45. package/dist/.setup/{inference-context-fulhZuz8.mjs → inference-context-D-9gWlTR.mjs} +16 -18
  46. package/dist/.setup/inference-dispatch-CMZtjQyz.mjs +359 -0
  47. package/dist/.setup/inference-metadata-CgIf7sOx.mjs +81 -0
  48. package/dist/.setup/inference-proxy-DhcXOgUE.mjs +561 -0
  49. package/dist/.setup/{isolated-completion-B6srt48J.mjs → isolated-completion-Dm3PzxJk.mjs} +15 -11
  50. package/dist/.setup/launch-args-DbFCehO7.mjs +196 -0
  51. package/dist/.setup/{managed-binary-DP6Rib3P.mjs → managed-binary-kiWRhNRE.mjs} +16 -9
  52. package/dist/.setup/{model-catalog-DkvUuBey.mjs → model-catalog-PAuZgJC6.mjs} +14 -14
  53. package/dist/.setup/model-runtime-BdqzOMkU.mjs +11 -0
  54. package/dist/.setup/{models-BDFgm_G-.mjs → models-DHXZtVVk.mjs} +9 -18
  55. package/dist/.setup/{native-auth-BLZGqFjw.mjs → native-auth-CuG53tu4.mjs} +5 -5
  56. package/dist/.setup/{native-execution-policy-YBMHSzC4.mjs → native-execution-policy-BxZJy5mP.mjs} +6 -31
  57. package/dist/.setup/{native-subagent-monitor-B1hxzIOy.mjs → native-subagent-monitor-Dpsmf2wz.mjs} +4422 -3808
  58. package/dist/.setup/native-subagent-pending-assignments-DwkCzLvD.mjs +203 -0
  59. package/dist/.setup/native-task-assignments-DMQ0g3hu.mjs +194 -0
  60. package/dist/.setup/{node-cli-sessions-Cl8b2ZF3.mjs → node-cli-sessions-HC4W6FLI.mjs} +99 -111
  61. package/dist/.setup/node-exec-server.runtime-BgBfWQqo.mjs +244 -0
  62. package/dist/.setup/{plan-xD7WKYTM.mjs → plan-Y-QIvrKB.mjs} +118 -163
  63. package/dist/.setup/{plugin-activation-r8nq5Jzp.mjs → plugin-activation-cNHRfaxU.mjs} +10 -47
  64. package/dist/.setup/{plugin-app-cache-key-BOxKP7db.mjs → plugin-app-cache-key-BL9B5H0L.mjs} +9 -42
  65. package/dist/.setup/{plugin-inventory-DUle8DLz.mjs → plugin-inventory-Cky2XJUw.mjs} +32 -23
  66. package/dist/.setup/{plugin-marketplace-discovery-P-Vndfqq.mjs → plugin-marketplace-discovery-D_dV9FXa.mjs} +22 -25
  67. package/dist/.setup/{plugin-metadata-cache-DsS5buNa.mjs → plugin-metadata-cache-DsjsL1dr.mjs} +328 -318
  68. package/dist/.setup/protocol-CANUwXJ3.mjs +17 -0
  69. package/dist/.setup/provider-DH8NSzGt.mjs +51 -0
  70. package/dist/.setup/{provider-capabilities-B8J4Dy-O.mjs → provider-capabilities-CAxoF-X1.mjs} +35 -12
  71. package/dist/.setup/{rate-limits-DOEGYRNs.mjs → rate-limits-B7-X2TgG.mjs} +123 -166
  72. package/dist/.setup/{request-BioXJLYa.mjs → request-BHZ1nz8d.mjs} +25 -16
  73. package/dist/.setup/responses-oauth-twnuTaAa.mjs +93 -0
  74. package/dist/.setup/rpc-error-BlD2vuzn.mjs +31 -0
  75. package/dist/.setup/{run-attempt-rlA07pUv.mjs → run-attempt-D8RZUOzY.mjs} +2046 -1454
  76. package/dist/.setup/{run-attempt-lifecycle-B7JbY4-F.mjs → run-attempt-lifecycle-C-6O3Exn.mjs} +10 -24
  77. package/dist/.setup/{runtime-artifact-Dy38Z5iU.mjs → runtime-artifact-DDQ-HGXf.mjs} +43 -47
  78. package/dist/.setup/runtime-artifact-connection-D68qQn1m.mjs +78 -0
  79. package/dist/.setup/sandbox-guard-DjCz2eOw.mjs +126 -0
  80. package/dist/.setup/scope-DOC1Xjc8.mjs +6 -0
  81. package/dist/.setup/session-binding-DGCYAfvD.mjs +443 -0
  82. package/dist/.setup/{session-binding-record-TH3xA0zj.mjs → session-binding-record-Oe9L-CNY.mjs} +73 -132
  83. package/dist/.setup/{session-binding-sidecars-CKYEcfNn.mjs → session-binding-sidecars-jo6H8dFr.mjs} +242 -60
  84. package/dist/.setup/{session-catalog-fUdWDx-U.mjs → session-catalog-4sCdv5qx.mjs} +598 -452
  85. package/dist/.setup/{session-catalog-adoption-CR_whkEW.mjs → session-catalog-adoption-BU_pHWG7.mjs} +59 -26
  86. package/dist/.setup/{session-catalog-archive-CwZaPacf.mjs → session-catalog-archive-spHfihri.mjs} +7 -7
  87. package/dist/.setup/session-catalog-events-DePDzzjc.mjs +139 -0
  88. package/dist/.setup/session-catalog-home-id-vlih0B_g.mjs +22 -0
  89. package/dist/.setup/{session-catalog-index-B141u15s.mjs → session-catalog-index-CZvDzC6z.mjs} +286 -182
  90. package/dist/.setup/{session-catalog-index-order-Cc5BzlQr.mjs → session-catalog-index-order-BcQpHks3.mjs} +2 -2
  91. package/dist/.setup/{session-catalog-index-state-BAuDztHN.mjs → session-catalog-index-state-TeO7EyO-.mjs} +6 -2
  92. package/dist/.setup/session-catalog-limits-DDxOsQeC.mjs +14 -0
  93. package/dist/.setup/session-catalog-list-request-CvtxrYSe.mjs +170 -0
  94. package/dist/.setup/session-catalog-native-projection-DjhwGL6x.mjs +178 -0
  95. package/dist/.setup/{session-catalog-node-adoption-BVRsYOSh.mjs → session-catalog-node-adoption-DgXvSGu0.mjs} +30 -35
  96. package/dist/.setup/{session-catalog-node-continue-Dowv8osw.mjs → session-catalog-node-continue-DjKXHBbi.mjs} +25 -18
  97. package/dist/.setup/session-catalog-node-lookup-CtAXI5W5.mjs +56 -0
  98. package/dist/.setup/{session-catalog-native-projection-ChV3cCtm.mjs → session-catalog-parsing-CPGaPYr-.mjs} +14 -180
  99. package/dist/.setup/{session-catalog-projection-C1Bj9Jl-.mjs → session-catalog-projection-Cr5qP5Dj.mjs} +15 -5
  100. package/dist/.setup/session-catalog-provenance-DoAvktcj.mjs +95 -0
  101. package/dist/.setup/{session-cli-DIj-IE-E.mjs → session-cli-Cn_nCqfq.mjs} +11 -24
  102. package/dist/.setup/{session-history-C--SrLI8.mjs → session-history-D83lJWHG.mjs} +16 -23
  103. package/dist/.setup/{session-history-import-JHXT5Xfi.mjs → session-history-import-WhX-X33a.mjs} +7 -10
  104. package/dist/.setup/session-history-read-Ov3StuL4.mjs +133 -0
  105. package/dist/.setup/{session-history.worker-CpNj7H_P.mjs → session-history.worker-MnPKncqP.mjs} +14 -23
  106. package/dist/.setup/session-initialization-6aveB9qb.mjs +22 -0
  107. package/dist/.setup/{session-permission-policy-DhurXY0l.mjs → session-permission-policy-Ci_fVX6y.mjs} +4 -8
  108. package/dist/.setup/{session-retirement-CU87AOg9.mjs → session-retirement-qMTxkNx2.mjs} +31 -12
  109. package/dist/.setup/{settled-turn-context-fmwouT5I.mjs → settled-turn-context-D4yj4rxf.mjs} +1 -1
  110. package/dist/.setup/{settled-turn-finalizer-CiY2bLFK.mjs → settled-turn-finalizer-BsvEabkw.mjs} +17 -13
  111. package/dist/.setup/{shared-client-BpTtuLQ5.mjs → shared-client-DqyTMYug.mjs} +826 -485
  112. package/dist/.setup/shared-client-lifecycle-DJIgqgMw.mjs +153 -0
  113. package/dist/.setup/{side-question-DSCZyoBD.mjs → side-question-C4kCmQy1.mjs} +206 -334
  114. package/dist/.setup/{source-Bjp4UQij.mjs → source-CS_7GFJZ.mjs} +82 -139
  115. package/dist/.setup/spawn-error-CL3n6MAa.mjs +57 -0
  116. package/dist/.setup/{thread-archive-guard-jmecf6OJ.mjs → thread-archive-guard-C9frICzX.mjs} +10 -3
  117. package/dist/.setup/thread-lifecycle-DPflntEJ.mjs +2362 -0
  118. package/dist/.setup/{incognito-session-uhrBF6wJ.mjs → thread-ownership-queue-Dp24d7-F.mjs} +1 -2
  119. package/dist/.setup/{thread-ownership-skomxnIt.mjs → thread-ownership-roNP0l1c.mjs} +47 -10
  120. package/dist/.setup/thread-policy-DTd-DtkX.mjs +109 -0
  121. package/dist/.setup/thread-requests-B_bRnMGN.mjs +2102 -0
  122. package/dist/.setup/{thread-resume-BkNpj9Pz.mjs → thread-resume-CdDaoc7T.mjs} +6 -6
  123. package/dist/.setup/timeout-CXOfNoaX.mjs +46 -0
  124. package/dist/.setup/transcript-history-projection-DRSifI-1.mjs +201 -0
  125. package/dist/.setup/{transcript-mirror-attestation-CzM-94NC.mjs → transcript-mirror-attestation-YSegaktH.mjs} +3 -4
  126. package/dist/.setup/{transcript-mirror-D4qp_leP.mjs → transcript-mirror-kxmCYsuF.mjs} +224 -206
  127. package/dist/.setup/{transport-stdio-Cmx94Oiy.mjs → transport-stdio-Bdegpn2V.mjs} +138 -75
  128. package/dist/.setup/transport-websocket-BTBE-LD9.mjs +211 -0
  129. package/dist/.setup/{upstream-prompt-provenance-LphB8slG.mjs → upstream-prompt-provenance-fXkKbPVC.mjs} +3 -9
  130. package/dist/.setup/{upstream-session-fork-D3UKxgVD.mjs → upstream-session-fork-CBeVjBpT.mjs} +48 -40
  131. package/dist/.setup/{usage-BOgBEKso.mjs → usage-BMzNxeR_.mjs} +5 -4
  132. package/dist/.setup/{usage-limit-error-C0ow7DOc.mjs → usage-limit-error-QXerDo3i.mjs} +5 -20
  133. package/dist/.setup/{web-search-provider.runtime-CTGuJt6i.mjs → web-search-provider.runtime-P77OUeoo.mjs} +10 -20
  134. package/dist/api.js +25 -16
  135. package/dist/catalog-page-worker-entrypoint.js +12 -0
  136. package/dist/catalog-page.worker.js +9 -0
  137. package/dist/cli-metadata.js +1 -1
  138. package/dist/doctor-contract-api.js +50 -8
  139. package/dist/harness.js +344 -1
  140. package/dist/index.js +345 -346
  141. package/dist/media-understanding-provider.js +9 -22
  142. package/dist/migration-provider-api.js +1 -1
  143. package/dist/provider-discovery.js +1 -1
  144. package/dist/session-history-worker-runtime.js +16 -33
  145. package/dist/session-history.worker.js +1 -1
  146. package/openclaw.plugin.json +14 -2
  147. package/package.json +11 -7
  148. package/dist/.setup/attempt-context-VXVwTCfS.mjs +0 -636
  149. package/dist/.setup/compact-C3i3qlzj.mjs +0 -687
  150. package/dist/.setup/event-projector-assistant-message-DNUR1s0A.mjs +0 -105
  151. package/dist/.setup/event-projector-items-DyTQ_XqL.mjs +0 -200
  152. package/dist/.setup/harness-rxaaoN-o.mjs +0 -349
  153. package/dist/.setup/history-rejection-B4nOXNXF.mjs +0 -13
  154. package/dist/.setup/image-payload-sanitizer-tupAr-2o.mjs +0 -79
  155. package/dist/.setup/inference-proxy-CC15HuSi.mjs +0 -311
  156. package/dist/.setup/launch-args-DnMak49W.mjs +0 -111
  157. package/dist/.setup/local-runtime-attribution-B_2mnqhb.mjs +0 -19
  158. package/dist/.setup/native-subagent-history-YXaL6dMd.mjs +0 -135
  159. package/dist/.setup/native-subagent-task-ids-DsuOonKv.mjs +0 -411
  160. package/dist/.setup/node-exec-server.runtime-BaViBKNz.mjs +0 -226
  161. package/dist/.setup/plugin-approval-roundtrip-CjfzafAZ.mjs +0 -122
  162. package/dist/.setup/provider-fFh_-VR3.mjs +0 -50
  163. package/dist/.setup/rolldown-runtime-8H4AJuhK.mjs +0 -14
  164. package/dist/.setup/sandbox-guard-BBP-RbTf.mjs +0 -166
  165. package/dist/.setup/session-binding-_0W_fHRr.mjs +0 -721
  166. package/dist/.setup/session-catalog-events-jMcYfQyd.mjs +0 -250
  167. package/dist/.setup/session-history-read-B3ZfSUbF.mjs +0 -50
  168. package/dist/.setup/session-initialization-DH1z6fXn.mjs +0 -75
  169. package/dist/.setup/thread-history-page-BTx-4xsg.mjs +0 -83
  170. package/dist/.setup/thread-lifecycle-Cik28qWn.mjs +0 -4904
  171. package/dist/.setup/thread-policy-Cjs4B8xf.mjs +0 -54
  172. package/dist/.setup/timeout-DZF05XrR.mjs +0 -63
  173. package/dist/.setup/transcript-history-projection-DHNBDhCU.mjs +0 -243
  174. package/dist/.setup/version-CoqzXPgK.mjs +0 -12
@@ -1,105 +0,0 @@
1
- import { t as resolveCodexLocalRuntimeAttribution } from "./local-runtime-attribution-B_2mnqhb.mjs";
2
- import { formatErrorMessage } from "openclaw/plugin-sdk/agent-harness-runtime";
3
- //#region extensions/codex/src/app-server/event-projector-assistant-message.ts
4
- const ZERO_USAGE = {
5
- input: 0,
6
- output: 0,
7
- cacheRead: 0,
8
- cacheWrite: 0,
9
- totalTokens: 0,
10
- cost: {
11
- input: 0,
12
- output: 0,
13
- cacheRead: 0,
14
- cacheWrite: 0,
15
- total: 0
16
- }
17
- };
18
- function createAssistantMessage(params, text, options) {
19
- return createAttributedCodexAssistantMessage({
20
- ...resolveCodexLocalRuntimeAttribution(params),
21
- modelId: params.modelId
22
- }, text, options);
23
- }
24
- /** Creates a Codex assistant row when a bounded call already owns attribution. */
25
- function createAttributedCodexAssistantMessage(attribution, text, options) {
26
- const usage = options.tokenUsage ? {
27
- input: options.tokenUsage.input ?? 0,
28
- output: options.tokenUsage.output ?? 0,
29
- cacheRead: options.tokenUsage.cacheRead ?? 0,
30
- cacheWrite: options.tokenUsage.cacheWrite ?? 0,
31
- ...options.tokenUsage.reasoningTokens !== void 0 ? { reasoningTokens: options.tokenUsage.reasoningTokens } : {},
32
- ...options.tokenUsage.contextUsage ? { contextUsage: options.tokenUsage.contextUsage } : {},
33
- totalTokens: options.tokenUsage.total ?? (options.tokenUsage.input ?? 0) + (options.tokenUsage.output ?? 0) + (options.tokenUsage.cacheRead ?? 0) + (options.tokenUsage.cacheWrite ?? 0),
34
- cost: ZERO_USAGE.cost
35
- } : ZERO_USAGE;
36
- const refusal = options.providerRefusal;
37
- return {
38
- role: "assistant",
39
- content: [{
40
- type: "text",
41
- text
42
- }],
43
- api: attribution.api ?? "openai-chatgpt-responses",
44
- provider: attribution.provider,
45
- model: attribution.modelId,
46
- usage,
47
- stopReason: options.aborted ? "aborted" : options.promptError || refusal ? "error" : "stop",
48
- errorMessage: refusal?.message ?? (options.promptError ? formatErrorMessage(options.promptError) : void 0),
49
- ...refusal ? { diagnostics: [{
50
- type: "provider_refusal",
51
- timestamp: Date.now(),
52
- details: {
53
- provider: "openai",
54
- category: refusal.category
55
- }
56
- }] } : {},
57
- timestamp: Date.now()
58
- };
59
- }
60
- function createAssistantCommentaryMessage(params, text, itemId, timestamp) {
61
- return {
62
- ...createNonterminalAssistantMessage(params, [{
63
- type: "text",
64
- text
65
- }], timestamp),
66
- openclawStreamFallback: {
67
- replacementText: text,
68
- source: "segment",
69
- itemId
70
- }
71
- };
72
- }
73
- function createAssistantAsyncMessage(params, text, itemId, timestamp, questions) {
74
- return {
75
- ...createNonterminalAssistantMessage(params, [{
76
- type: "text",
77
- text
78
- }], timestamp),
79
- openclawAsyncDelivery: {
80
- itemId,
81
- ...questions ? { questions } : {}
82
- }
83
- };
84
- }
85
- function createAssistantReasoningMessage(params, text) {
86
- return createNonterminalAssistantMessage(params, [{
87
- type: "thinking",
88
- thinking: text
89
- }]);
90
- }
91
- function createNonterminalAssistantMessage(params, content, timestamp) {
92
- const attribution = resolveCodexLocalRuntimeAttribution(params);
93
- return {
94
- role: "assistant",
95
- content,
96
- api: attribution.api ?? "openai-chatgpt-responses",
97
- provider: attribution.provider,
98
- model: params.modelId,
99
- usage: ZERO_USAGE,
100
- stopReason: "stop",
101
- timestamp: timestamp ?? Date.now()
102
- };
103
- }
104
- //#endregion
105
- export { createAttributedCodexAssistantMessage as a, createAssistantReasoningMessage as i, createAssistantCommentaryMessage as n, createAssistantMessage as r, createAssistantAsyncMessage as t };
@@ -1,200 +0,0 @@
1
- import { m as isJsonObject } from "./config-security-BRQ2mgW9.mjs";
2
- import { asFiniteNumber, normalizeOptionalString as normalizeOptionalString$1, readStringField } from "openclaw/plugin-sdk/string-coerce-runtime";
3
- //#region extensions/codex/src/app-server/event-projector-values.ts
4
- const BIO_POLICY_SAFETY_ACCESS_BLOCK_PREFIX = "This content was flagged for possible biological risk.";
5
- /** Project only Codex's explicit refusal contracts; other policy errors retain their own paths. */
6
- function readCodexProviderRefusal(message, codexErrorInfo) {
7
- if (!message) return;
8
- if (codexErrorInfo === "cyberPolicy") return {
9
- category: "cyber",
10
- message
11
- };
12
- if (codexErrorInfo === "misalignmentPolicyViolation") return {
13
- category: "misalignment",
14
- message
15
- };
16
- return message.startsWith(BIO_POLICY_SAFETY_ACCESS_BLOCK_PREFIX) ? {
17
- category: "bio",
18
- message
19
- } : void 0;
20
- }
21
- function readNonEmptyString(record, key) {
22
- return normalizeOptionalString$1(record[key]);
23
- }
24
- function readNonEmptyStringArray(record, key) {
25
- const value = record[key];
26
- if (!Array.isArray(value)) return [];
27
- const entries = [];
28
- for (const entry of value) {
29
- const normalized = normalizeOptionalString$1(entry);
30
- if (normalized) entries.push(normalized);
31
- }
32
- return entries;
33
- }
34
- function readNullableString(record, key) {
35
- const value = record[key];
36
- if (value === null) return null;
37
- return typeof value === "string" ? value : void 0;
38
- }
39
- function readNonNegativeInteger(record, key) {
40
- const value = asFiniteNumber(record[key]);
41
- return value !== void 0 && Number.isInteger(value) && value >= 0 ? value : void 0;
42
- }
43
- function readCodexErrorNotificationMessage(record) {
44
- const error = record.error;
45
- return isJsonObject(error) ? readStringField(error, "message") : void 0;
46
- }
47
- function readHookOutputEntries(value) {
48
- if (!Array.isArray(value)) return [];
49
- return value.flatMap((entry) => {
50
- if (!isJsonObject(entry)) return [];
51
- const text = readStringField(entry, "text");
52
- if (!text) return [];
53
- const kind = readStringField(entry, "kind");
54
- return [{
55
- ...kind ? { kind } : {},
56
- text
57
- }];
58
- });
59
- }
60
- function splitPlanText(text) {
61
- return text.split(/\r?\n/).map((line) => line.trim().replace(/^[-*]\s+/, "")).filter((line) => line.length > 0);
62
- }
63
- function extractRawAssistantText(item) {
64
- const parts = (Array.isArray(item.content) ? item.content : []).flatMap((entry) => {
65
- if (!isJsonObject(entry)) return [];
66
- const type = readStringField(entry, "type");
67
- if (type !== "output_text" && type !== "text") return [];
68
- const value = readStringField(entry, "text");
69
- return value === void 0 ? [] : [value];
70
- });
71
- return parts.length > 0 ? parts.join("").trim() : void 0;
72
- }
73
- function readItemString(item, key) {
74
- const value = item[key];
75
- return typeof value === "string" ? value : void 0;
76
- }
77
- function readItem(value) {
78
- if (!isJsonObject(value)) return;
79
- const type = typeof value.type === "string" ? value.type : void 0;
80
- const id = typeof value.id === "string" ? value.id : void 0;
81
- if (!type || !id) return;
82
- return value;
83
- }
84
- //#endregion
85
- //#region extensions/codex/src/app-server/event-projector-items.ts
86
- function matchesCodexSnapshotTurn(item, turnId) {
87
- const itemTurnId = readItemString(item, "turnId");
88
- return itemTurnId === void 0 || itemTurnId === turnId;
89
- }
90
- function itemKind(item) {
91
- switch (item.type) {
92
- case "dynamicToolCall":
93
- case "mcpToolCall": return "tool";
94
- case "commandExecution": return "command";
95
- case "fileChange": return "patch";
96
- case "webSearch": return "search";
97
- case "reasoning":
98
- case "contextCompaction": return "analysis";
99
- default: return;
100
- }
101
- }
102
- function itemTitle(item) {
103
- switch (item.type) {
104
- case "commandExecution": return "Command";
105
- case "fileChange": return "File change";
106
- case "mcpToolCall": return "MCP tool";
107
- case "dynamicToolCall": return "Tool";
108
- case "webSearch": return "Web search";
109
- case "contextCompaction": return "Context compaction";
110
- case "reasoning": return "Reasoning";
111
- default: return item.type;
112
- }
113
- }
114
- function itemStatus(item) {
115
- const status = readItemString(item, "status");
116
- if (status === "failed" || status === "error") return "failed";
117
- if (status === "declined") return "blocked";
118
- if (status === "inProgress" || status === "in_progress" || status === "running") return "running";
119
- return "completed";
120
- }
121
- function unknownItemStatus(item) {
122
- const status = readItemString(item, "status");
123
- switch (status) {
124
- case void 0:
125
- case "completed":
126
- case "failed":
127
- case "error":
128
- case "declined":
129
- case "inProgress":
130
- case "in_progress":
131
- case "running": return;
132
- default: return status;
133
- }
134
- }
135
- function auditNativeToolTerminalStatus(item) {
136
- if (item.type === "imageView" || item.type === "sleep") return "completed";
137
- const status = readItemString(item, "status");
138
- if (status === "completed") return "completed";
139
- if (status === "failed" || status === "error") return "failed";
140
- if (status === "declined") return "blocked";
141
- return "unknown";
142
- }
143
- function auditNativeToolUnfinishedStatus(item) {
144
- return item.type === "webSearch" || item.type === "imageGeneration" ? "unknown" : "failed";
145
- }
146
- function isNonSuccessItemStatus(status) {
147
- return status === "failed" || status === "blocked";
148
- }
149
- function itemName(item) {
150
- if (item.type === "dynamicToolCall" && typeof item.tool === "string") return item.tool;
151
- if (item.type === "mcpToolCall" && typeof item.tool === "string") {
152
- const server = typeof item.server === "string" ? item.server : void 0;
153
- return server ? `${server}.${item.tool}` : item.tool;
154
- }
155
- if (item.type === "commandExecution") return "bash";
156
- if (item.type === "fileChange") return "apply_patch";
157
- if (item.type === "webSearch") return "web_search";
158
- }
159
- function auditNativeToolName(item) {
160
- if (item.type === "dynamicToolCall") return;
161
- const progressName = itemName(item);
162
- if (progressName) return progressName;
163
- if (item.type === "collabAgentToolCall") return typeof item.tool === "string" && item.tool.trim() ? `collab.${item.tool.trim()}` : "collab_agent";
164
- if (item.type === "imageGeneration") return "image_generation";
165
- if (item.type === "imageView") return "image_view";
166
- if (item.type === "sleep") return "sleep";
167
- }
168
- function isSideEffectingNativeToolItem(item) {
169
- return itemStatus(item) !== "blocked" && (isMutatingNativeToolItem(item) || item.type === "mcpToolCall");
170
- }
171
- function shouldSynthesizeToolProgressForItem(item) {
172
- switch (item.type) {
173
- case "commandExecution":
174
- case "fileChange":
175
- case "webSearch":
176
- case "mcpToolCall": return true;
177
- default: return false;
178
- }
179
- }
180
- function shouldRecordNativeToolTranscript(item) {
181
- return shouldSynthesizeToolProgressForItem(item);
182
- }
183
- function isMutatingNativeToolItem(item) {
184
- if (item.type === "commandExecution") return true;
185
- return item.type === "fileChange" || item.type === "collabAgentToolCall" || item.type === "imageGeneration";
186
- }
187
- function shouldClearTerminalPresentationForNativeItem(item) {
188
- switch (item.type) {
189
- case "collabAgentToolCall":
190
- case "commandExecution":
191
- case "fileChange":
192
- case "imageGeneration":
193
- case "imageView":
194
- case "mcpToolCall":
195
- case "webSearch": return true;
196
- default: return false;
197
- }
198
- }
199
- //#endregion
200
- export { readNonEmptyString as C, splitPlanText as D, readNullableString as E, readItemString as S, readNonNegativeInteger as T, normalizeOptionalString$1 as _, isNonSuccessItemStatus as a, readHookOutputEntries as b, itemName as c, matchesCodexSnapshotTurn as d, shouldClearTerminalPresentationForNativeItem as f, extractRawAssistantText as g, unknownItemStatus as h, isMutatingNativeToolItem as i, itemStatus as l, shouldSynthesizeToolProgressForItem as m, auditNativeToolTerminalStatus as n, isSideEffectingNativeToolItem as o, shouldRecordNativeToolTranscript as p, auditNativeToolUnfinishedStatus as r, itemKind as s, auditNativeToolName as t, itemTitle as u, readCodexErrorNotificationMessage as v, readNonEmptyStringArray as w, readItem as x, readCodexProviderRefusal as y };
@@ -1,349 +0,0 @@
1
- import { CODEX_NATIVE_TOOL_REQUIREMENTS } from "../native-tool-policy.js";
2
- import { p as sessionBindingIdentity } from "./session-binding-record-TH3xA0zj.mjs";
3
- import { t as codexBuildSymbol } from "./build-state-Xx9ybZqa.mjs";
4
- import { resolvePluginConfigObject } from "openclaw/plugin-sdk/plugin-config-runtime";
5
- import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
6
- //#region extensions/codex/src/app-server/model-runtime.ts
7
- const CODEX_APP_SERVER_RUNTIME_MODEL_PARAM = "codexAppServerRuntimeModel";
8
- function buildCodexRuntimeModelParams(catalogId, runtimeModelId) {
9
- return catalogId === runtimeModelId ? void 0 : { [CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]: runtimeModelId };
10
- }
11
- function readCodexRuntimeModelId(model, fallbackId) {
12
- return normalizeOptionalString(model?.params?.[CODEX_APP_SERVER_RUNTIME_MODEL_PARAM]) ?? model?.id ?? fallbackId;
13
- }
14
- //#endregion
15
- //#region extensions/codex/harness.ts
16
- const DEFAULT_CODEX_HARNESS_PROVIDER_IDS = /* @__PURE__ */ new Set(["codex", "openai"]);
17
- const SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER = codexBuildSymbol("openclaw.codexAppServerClientDisposer");
18
- const CODEX_TOOL_POLICY_SAFE_DENY_NAMES = [
19
- "web_fetch",
20
- "x_search",
21
- "memory_search",
22
- "memory_get",
23
- "dashboard",
24
- "canvas",
25
- "show_widget",
26
- "message",
27
- "heartbeat_respond",
28
- "automations",
29
- "gateway",
30
- "skill_workshop",
31
- "image_generate",
32
- "music_generate",
33
- "video_generate",
34
- "tts"
35
- ];
36
- const CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES = [
37
- "bootstrap",
38
- "assemble-before-prompt",
39
- "after-turn",
40
- "maintain",
41
- "compact",
42
- "runtime-llm-complete",
43
- "thread-bootstrap-projection"
44
- ];
45
- async function disposeSharedCodexAppServerClients() {
46
- const dispose = globalThis[SHARED_CODEX_APP_SERVER_CLIENT_DISPOSER];
47
- await dispose?.();
48
- }
49
- /**
50
- * Creates the Codex app-server harness used for attempts, side questions,
51
- * compaction, reset, and disposal.
52
- */
53
- function createCodexAppServerAgentHarness(options) {
54
- const harnessRuntimeId = options?.id ?? "codex";
55
- const normalizedHarnessRuntimeId = harnessRuntimeId.trim().toLowerCase();
56
- const providerIds = new Set([...options?.providerIds ?? DEFAULT_CODEX_HARNESS_PROVIDER_IDS].map((id) => id.trim().toLowerCase()));
57
- const sessionCatalogControlFactory = options.sessionCatalogControlFactory;
58
- const sessionRuntime = options.runtime;
59
- let modelCatalog;
60
- let disposed = false;
61
- const resolveAttemptPluginConfig = (config) => resolvePluginConfigObject(config, "codex") ?? options.resolvePluginConfig?.() ?? options.pluginConfig;
62
- return {
63
- id: harnessRuntimeId,
64
- label: options?.label ?? "Codex agent harness",
65
- autoSelection: { providerIds: [...providerIds] },
66
- cloudPlacement: {
67
- mode: "remote-exec",
68
- devicePlacement: {
69
- requiredNodeCommands: ["codex.exec-server.stdio.v1"],
70
- consumesWorkerSlot: false
71
- }
72
- },
73
- delegatedExecutionPluginIds: ["voice-call"],
74
- contextEngineHostCapabilities: CODEX_APP_SERVER_CONTEXT_ENGINE_HOST_CAPABILITIES,
75
- conversationToolPolicySupport: "exact",
76
- conversationToolPolicySafeDenyTools: CODEX_TOOL_POLICY_SAFE_DENY_NAMES,
77
- conversationToolPolicyNativeTools: CODEX_NATIVE_TOOL_REQUIREMENTS,
78
- deliveryDefaults: { visibleReplies: "message_tool" },
79
- authBootstrap: "harness",
80
- resolveSessionRuntimeOwnership: (params) => {
81
- const assertCurrent = () => {
82
- params.assertCurrent();
83
- if (disposed) throw new Error("Codex agent harness is disposed");
84
- };
85
- assertCurrent();
86
- const identity = sessionBindingIdentity(params);
87
- let binding = options.bindingStore.read(identity);
88
- if (!binding) {
89
- const previousSessionId = params.readPreviousSessionId?.();
90
- binding = previousSessionId ? options.bindingStore.read({
91
- ...identity,
92
- sessionId: previousSessionId
93
- }) : void 0;
94
- }
95
- assertCurrent();
96
- return binding?.preserveNativeModel === true ? {
97
- model: "native",
98
- auth: binding.connectionScope === "supervision" ? "native" : "host",
99
- ...binding.model?.trim() && binding.modelProvider ? { modelRef: {
100
- provider: binding.modelProvider,
101
- model: binding.model
102
- } } : {}
103
- } : void 0;
104
- },
105
- ...sessionCatalogControlFactory && sessionRuntime ? { sessionFork: {
106
- upstreamKinds: ["codex-app-server"],
107
- fork: async (params) => {
108
- const { forkCodexUpstreamSession } = await import("./upstream-session-fork-D3UKxgVD.mjs");
109
- return await forkCodexUpstreamSession(params, {
110
- bindingStore: options.bindingStore,
111
- controlFactory: sessionCatalogControlFactory,
112
- harnessRuntimeId,
113
- resolveConfig: options.resolveConfig,
114
- runtime: sessionRuntime
115
- });
116
- }
117
- } } : {},
118
- taskHistory: {
119
- taskKinds: ["codex-native"],
120
- read: async (params) => {
121
- const { readCodexNativeSubagentHistory } = await import("./native-subagent-history-YXaL6dMd.mjs");
122
- const assertCurrent = () => {
123
- params.assertCurrent();
124
- if (disposed) throw new Error("Agent harness is disposed");
125
- };
126
- return readCodexNativeSubagentHistory({
127
- ...params,
128
- assertCurrent
129
- }, {
130
- bindingStore: options.bindingStore,
131
- pluginConfig: resolveAttemptPluginConfig(params.cfg)
132
- });
133
- }
134
- },
135
- authBinding: { fingerprint: async (params) => {
136
- const { fingerprintCodexAppServerAuthBinding } = await import("./auth-binding-DhLWa_7K.mjs").then((n) => n.t);
137
- return fingerprintCodexAppServerAuthBinding(params);
138
- } },
139
- runtimeArtifact: { validate: async (binding) => {
140
- const { validateCodexAppServerRuntimeArtifact } = await import("./runtime-artifact-Dy38Z5iU.mjs");
141
- return validateCodexAppServerRuntimeArtifact(binding);
142
- } },
143
- fetchUsageSnapshot: async (ctx) => {
144
- const { fetchCodexAppServerUsageSnapshot } = await import("./usage-BOgBEKso.mjs");
145
- return await fetchCodexAppServerUsageSnapshot(ctx, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
146
- },
147
- loadModelCatalog: async (params) => {
148
- const { createCodexAppServerModelCatalog } = await import("./model-catalog-DkvUuBey.mjs");
149
- if (disposed) return [];
150
- modelCatalog ??= createCodexAppServerModelCatalog(harnessRuntimeId);
151
- return await modelCatalog.load(params, resolveAttemptPluginConfig(params.config));
152
- },
153
- readModelCatalogReadiness: (params) => modelCatalog?.read(params, resolveAttemptPluginConfig(params.config)),
154
- loadMcpToolCatalog: async (params) => {
155
- const { loadCodexEffectiveMcpCatalog } = await import("./effective-mcp-catalog-K6kLCN8X.mjs");
156
- return await loadCodexEffectiveMcpCatalog(params, { bindingStore: options.bindingStore });
157
- },
158
- supports: (ctx) => {
159
- const provider = ctx.provider.trim().toLowerCase();
160
- if (!providerIds.has(provider)) return {
161
- supported: false,
162
- reason: `provider is not one of: ${[...providerIds].toSorted().join(", ")}`
163
- };
164
- if (ctx.modelProvider?.requestTransportOverrides === "present") return {
165
- supported: false,
166
- reason: "Codex cannot reproduce authored request transport overrides",
167
- fallbackRuntime: "openclaw"
168
- };
169
- const preparedAuth = ctx.modelProvider?.preparedAuth;
170
- const runtimePolicy = ctx.modelProvider?.runtimePolicy;
171
- const nativeAccountOwnsUnobservedModel = provider === "openai" && ctx.requestedRuntime === "codex" && Boolean(ctx.modelId?.trim()) && (preparedAuth === void 0 || preparedAuth.source === "harness") && preparedAuth?.mode === void 0 && preparedAuth?.requirement === void 0 && ctx.modelProvider?.api === void 0 && ctx.modelProvider?.baseUrl === void 0 && ctx.modelProvider?.azureApiVersion === void 0 && ctx.modelProvider?.request === void 0;
172
- if (runtimePolicy) {
173
- if (!runtimePolicy.compatibleIds.some((id) => id.trim().toLowerCase() === normalizedHarnessRuntimeId)) return {
174
- supported: false,
175
- reason: "Codex cannot reproduce the prepared provider route"
176
- };
177
- } else if (ctx.modelProvider && provider !== "codex" && !nativeAccountOwnsUnobservedModel) return {
178
- supported: false,
179
- reason: "provider route compatibility with Codex is not declared"
180
- };
181
- if (preparedAuth?.requirement === "subscription") {
182
- if (!(preparedAuth.source === "profile" && (preparedAuth.mode === "oauth" || preparedAuth.mode === "token"))) return {
183
- supported: false,
184
- reason: "Codex subscription auth requires a prepared OAuth or token profile"
185
- };
186
- } else if (preparedAuth?.requirement === "api-key") {
187
- if (!(preparedAuth.source !== "none" && preparedAuth.source !== "harness" && (preparedAuth.mode === "api-key" || preparedAuth.mode === "api_key"))) return {
188
- supported: false,
189
- reason: "Codex Platform auth requires a prepared API key"
190
- };
191
- }
192
- return {
193
- supported: true,
194
- priority: 100
195
- };
196
- },
197
- runAttempt: async (params) => {
198
- const { runCodexAppServerAttempt } = await import("./run-attempt-rlA07pUv.mjs");
199
- const { planCodexCyberEscalation, readCodexCyberAttemptVerdict, recordCodexCyberTargetUnavailable, reserveCodexCyberProbe, resolveCodexCyberFailoverConfig } = await import("./cyber-failover-DYwbmf1o.mjs");
200
- const { emitCodexCyberNotice } = await import("./cyber-failover-notice-e9G3J9-e.mjs");
201
- const pluginConfig = resolveAttemptPluginConfig(params.config);
202
- const attemptModel = readCodexRuntimeModelId(params.model, params.modelId);
203
- const runAttemptOnModel = (model, isRetry = false) => runCodexAppServerAttempt(isRetry ? {
204
- ...params,
205
- suppressNextUserMessagePersistence: true
206
- } : params, {
207
- bindingStore: options.bindingStore,
208
- pluginConfig,
209
- runtime: sessionRuntime,
210
- runtimeModelId: model,
211
- nativeHookRelay: { enabled: true }
212
- });
213
- const cyberFailover = resolveCodexCyberFailoverConfig(pluginConfig);
214
- const workspace = {
215
- agentId: params.agentId,
216
- authProfileId: params.authProfileId
217
- };
218
- const result = await runAttemptOnModel(attemptModel);
219
- const refusal = readCodexCyberAttemptVerdict(result);
220
- if (!refusal.cyberRefused) return result;
221
- const plan = planCodexCyberEscalation({
222
- config: cyberFailover,
223
- currentModel: attemptModel,
224
- replaySafe: refusal.replaySafe,
225
- workspace
226
- });
227
- if (plan.kind !== "escalate") {
228
- if (plan.reason === "target_unavailable") await emitCodexCyberNotice(params, {
229
- state: "unavailable",
230
- model: attemptModel,
231
- fallbackModel: cyberFailover.model
232
- });
233
- return result;
234
- }
235
- const releaseProbe = reserveCodexCyberProbe({
236
- model: plan.model,
237
- workspace
238
- });
239
- let escalated;
240
- try {
241
- escalated = await runAttemptOnModel(plan.model, true);
242
- } finally {
243
- releaseProbe();
244
- }
245
- const outcome = readCodexCyberAttemptVerdict(escalated);
246
- if (outcome.unavailable) recordCodexCyberTargetUnavailable({
247
- model: plan.model,
248
- workspace,
249
- cooloffMs: cyberFailover.cooloffMs
250
- });
251
- if (outcome.answered || outcome.unavailable) await emitCodexCyberNotice(params, {
252
- state: outcome.answered ? "escalated" : "unavailable",
253
- model: attemptModel,
254
- fallbackModel: plan.model
255
- });
256
- if (outcome.unavailable && outcome.replaySafe && escalated.terminal.kind === "failed" && escalated.toolMetas.length === 0) return result;
257
- return escalated;
258
- },
259
- runIsolatedCompletionV2: async (params) => {
260
- if (params.authorization.owner === "host") {
261
- const { runHostPreparedIsolatedCompletion } = await import("openclaw/plugin-sdk/simple-completion-runtime");
262
- return runHostPreparedIsolatedCompletion(params);
263
- }
264
- const { runCodexIsolatedCompletion } = await import("./isolated-completion-B6srt48J.mjs");
265
- return runCodexIsolatedCompletion(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
266
- },
267
- runIsolatedCompletion: async (params) => {
268
- const { runHostPreparedIsolatedCompletion } = await import("openclaw/plugin-sdk/simple-completion-runtime");
269
- return runHostPreparedIsolatedCompletion({
270
- ...params,
271
- authorization: {
272
- owner: "host",
273
- model: params.model,
274
- auth: params.auth,
275
- sourceAuthFingerprint: params.sourceAuthFingerprint
276
- }
277
- });
278
- },
279
- finalizeSettledTurn: async (params) => {
280
- const { runCodexSettledTurnFinalization } = await import("./settled-turn-finalizer-CiY2bLFK.mjs");
281
- return runCodexSettledTurnFinalization(params, { pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig });
282
- },
283
- runSideQuestion: async (params) => {
284
- const { runCodexAppServerSideQuestion } = await import("./side-question-DSCZyoBD.mjs");
285
- return runCodexAppServerSideQuestion(params, {
286
- bindingStore: options.bindingStore,
287
- pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig,
288
- runtime: sessionRuntime,
289
- runtimeModelId: readCodexRuntimeModelId(params.runtimeModel, params.model),
290
- nativeHookRelay: { enabled: true }
291
- });
292
- },
293
- compact: async (params) => {
294
- const { maybeCompactCodexAppServerSession } = await import("./compact-C3i3qlzj.mjs");
295
- return maybeCompactCodexAppServerSession(params, {
296
- bindingStore: options.bindingStore,
297
- pluginConfig: options?.resolvePluginConfig?.() ?? options?.pluginConfig
298
- });
299
- },
300
- withSessionDeletion: async (params, run) => {
301
- const { withCodexAppServerSessionDeletion } = await import("./session-retirement-CU87AOg9.mjs");
302
- params.assertCurrent();
303
- return withCodexAppServerSessionDeletion(options.bindingStore, params, run);
304
- },
305
- reset: async (params) => {
306
- if (params.sessionId && params.reason !== "deleted") {
307
- const [{ reclaimCurrentCodexSessionGeneration }, { retireCodexAppServerSessionGeneration }] = await Promise.all([import("./session-binding-_0W_fHRr.mjs").then((n) => n.c), import("./session-retirement-CU87AOg9.mjs")]);
308
- const identity = sessionBindingIdentity({
309
- agentId: params.agentId,
310
- sessionId: params.sessionId,
311
- sessionKey: params.sessionKey
312
- });
313
- const resetGeneration = () => retireCodexAppServerSessionGeneration({
314
- bindingStore: options.bindingStore,
315
- identity,
316
- mode: "reset"
317
- });
318
- let reset = await resetGeneration();
319
- if (reset === "conflict") {
320
- if (await reclaimCurrentCodexSessionGeneration({
321
- bindingStore: options.bindingStore,
322
- identity,
323
- config: options.resolveConfig?.()
324
- })) reset = await resetGeneration();
325
- }
326
- if (reset === "conflict") throw new Error(`Codex binding generation changed before session ${params.sessionId} could reset`);
327
- }
328
- },
329
- dispose: async () => {
330
- disposed = true;
331
- modelCatalog?.dispose();
332
- await disposeSharedCodexAppServerClients();
333
- }
334
- };
335
- }
336
- /** Creates the private native-compaction bridge registered in host-owned capability state. */
337
- function createCodexAppServerNativeCompaction(options) {
338
- return async (params) => {
339
- const { maybeCompactCodexAppServerSession } = await import("./compact-C3i3qlzj.mjs");
340
- return maybeCompactCodexAppServerSession(params, {
341
- bindingStore: options.bindingStore,
342
- pluginConfig: options.resolvePluginConfig?.() ?? options.pluginConfig,
343
- allowNonManualNativeRequest: true,
344
- nativeCompactionRequest: params.nativeCompactionRequest
345
- });
346
- };
347
- }
348
- //#endregion
349
- export { createCodexAppServerNativeCompaction as n, buildCodexRuntimeModelParams as r, createCodexAppServerAgentHarness as t };
@@ -1,13 +0,0 @@
1
- //#region extensions/codex/src/app-server/history-rejection.ts
2
- /** Only an owning rejection site can supply a diagnostic; exception text is never evidence. */
3
- var CodexHistoryRejection = class extends Error {
4
- constructor(reason) {
5
- super(`Codex history rejected: ${reason}`);
6
- this.reason = reason;
7
- }
8
- };
9
- function codexHistoryRejectionReason(error) {
10
- return error instanceof CodexHistoryRejection ? error.reason : "history_read_failed";
11
- }
12
- //#endregion
13
- export { codexHistoryRejectionReason as n, CodexHistoryRejection as t };