@openclaw/codex 2026.7.2-beta.3 → 2026.7.2-beta.4

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 (38) hide show
  1. package/dist/{app-server-policy-DUMF2Xyr.js → app-server-policy-BO3jYBkv.js} +1 -1
  2. package/dist/{attempt-notifications-Ecjyzufe.js → attempt-notifications-DdmnBMUp.js} +1 -1
  3. package/dist/{media-understanding-provider-IPNNQre6.js → bounded-turn-CaQL96kg.js} +43 -183
  4. package/dist/capabilities-CLICvTxf.js +36 -0
  5. package/dist/cli-metadata.js +1 -1
  6. package/dist/{command-formatters-NCTL7A2q.js → command-formatters-DgADqnHa.js} +3 -37
  7. package/dist/{command-handlers-DtFbZiba.js → command-handlers-l_lVPNlB.js} +12 -11
  8. package/dist/{compact-Kgy26gIM.js → compact-CC5KhBzX.js} +5 -4
  9. package/dist/{computer-use-C7x4ZaqR.js → computer-use-Ip1-QGa-.js} +4 -4
  10. package/dist/{conversation-control-B0s3aIjT.js → conversation-control-sNPsbTCP.js} +6 -5
  11. package/dist/doctor-contract-api.js +1 -1
  12. package/dist/{dynamic-tools-D_vSVmv9.js → dynamic-tools-CQI3UwqY.js} +105 -2670
  13. package/dist/event-projector-assistant-message-DTgnPPVF.js +101 -0
  14. package/dist/event-projector-usage-D6tE7_qD.js +69 -0
  15. package/dist/harness.js +25 -6
  16. package/dist/incognito-session-ET_ufDH-.js +2 -0
  17. package/dist/index.js +60 -26
  18. package/dist/media-understanding-provider.js +168 -1
  19. package/dist/{models-DD5zBdX5.js → models-BNeMlHgg.js} +2 -2
  20. package/dist/{notification-correlation-C8DVQ_Bq.js → notification-correlation-BGLixv5_.js} +3 -3
  21. package/dist/{plugin-app-cache-key-DJbhLYSK.js → plugin-app-cache-key-CvzvmBRz.js} +2 -2
  22. package/dist/{rate-limits-CqhWQ2R9.js → rate-limits-D0IJT-a6.js} +1 -1
  23. package/dist/{request-9yf9pZjf.js → request-BTccUTD3.js} +1 -1
  24. package/dist/{run-attempt-BIoO8ISr.js → run-attempt--858NXDl.js} +2653 -109
  25. package/dist/{session-binding-Bmt20HfB.js → session-binding-ZSMX1omP.js} +7 -2
  26. package/dist/{session-catalog-CA7R-hX2.js → session-catalog-DsKaezgR.js} +82 -80
  27. package/dist/{session-cli-Bxk3-Wqz.js → session-cli-CYJTfRLG.js} +1 -1
  28. package/dist/session-upstream-marker-D7XlI9us.js +82 -0
  29. package/dist/settled-turn-finalizer-DHltNgtF.js +303 -0
  30. package/dist/{shared-client-CSXLtCLE.js → shared-client-wmgNFNYp.js} +33 -13
  31. package/dist/{side-question-DtzquMOb.js → side-question-BfFZCsJ-.js} +21 -15
  32. package/dist/{thread-lifecycle-CQ_9mAa1.js → thread-lifecycle-cqrOlJkq.js} +120 -26
  33. package/dist/{transcript-mirror-D9rTxx2P.js → transcript-mirror-2p7kl6e4.js} +433 -145
  34. package/dist/upstream-session-fork-vPjwkT1i.js +320 -0
  35. package/dist/{usage-CuPpFgTc.js → usage-DM_I3mPT.js} +3 -3
  36. package/dist/{web-search-provider.runtime-_x5XTeqh.js → web-search-provider.runtime-Bx6HAc_k.js} +3 -3
  37. package/npm-shrinkwrap.json +38 -38
  38. package/package.json +7 -7
@@ -1,7 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { isRecord, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
3
+ import { embeddedAgentLog, formatErrorMessage, projectAgentHarnessTranscriptMessageForDisplay, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
3
4
  import { Compile } from "typebox/compile";
4
- import { embeddedAgentLog, formatErrorMessage, runAgentHarnessBeforeMessageWriteHook } from "openclaw/plugin-sdk/agent-harness-runtime";
5
5
  import { Buffer } from "node:buffer";
6
6
  import { publishSessionTranscriptUpdateByIdentity, withSessionTranscriptWriteLock } from "openclaw/plugin-sdk/session-transcript-runtime";
7
7
  //#region extensions/codex/src/app-server/protocol-generated/json/DynamicToolCallParams.json
@@ -161,15 +161,23 @@ var ModelListResponse_default = {
161
161
  definitions: {
162
162
  "InputModality": {
163
163
  "description": "Canonical user-input modality tags advertised by a model.",
164
- "oneOf": [{
165
- "description": "Plain text turns and tool payloads.",
166
- "enum": ["text"],
167
- "type": "string"
168
- }, {
169
- "description": "Image attachments included in user turns.",
170
- "enum": ["image"],
171
- "type": "string"
172
- }]
164
+ "oneOf": [
165
+ {
166
+ "description": "Plain text turns and tool payloads.",
167
+ "enum": ["text"],
168
+ "type": "string"
169
+ },
170
+ {
171
+ "description": "Image attachments included in user turns.",
172
+ "enum": ["image"],
173
+ "type": "string"
174
+ },
175
+ {
176
+ "description": "Audio attachments included in user turns.",
177
+ "enum": ["audio"],
178
+ "type": "string"
179
+ }
180
+ ]
173
181
  },
174
182
  "Model": {
175
183
  "properties": {
@@ -577,31 +585,47 @@ var ThreadResumeResponse_default = {
577
585
  ],
578
586
  "type": "string"
579
587
  },
580
- "DynamicToolCallOutputContentItem": { "oneOf": [{
581
- "properties": {
582
- "text": { "type": "string" },
583
- "type": {
584
- "enum": ["inputText"],
585
- "title": "InputTextDynamicToolCallOutputContentItemType",
586
- "type": "string"
587
- }
588
+ "DynamicToolCallOutputContentItem": { "oneOf": [
589
+ {
590
+ "properties": {
591
+ "text": { "type": "string" },
592
+ "type": {
593
+ "enum": ["inputText"],
594
+ "title": "InputTextDynamicToolCallOutputContentItemType",
595
+ "type": "string"
596
+ }
597
+ },
598
+ "required": ["text", "type"],
599
+ "title": "InputTextDynamicToolCallOutputContentItem",
600
+ "type": "object"
588
601
  },
589
- "required": ["text", "type"],
590
- "title": "InputTextDynamicToolCallOutputContentItem",
591
- "type": "object"
592
- }, {
593
- "properties": {
594
- "imageUrl": { "type": "string" },
595
- "type": {
596
- "enum": ["inputImage"],
597
- "title": "InputImageDynamicToolCallOutputContentItemType",
598
- "type": "string"
599
- }
602
+ {
603
+ "properties": {
604
+ "imageUrl": { "type": "string" },
605
+ "type": {
606
+ "enum": ["inputImage"],
607
+ "title": "InputImageDynamicToolCallOutputContentItemType",
608
+ "type": "string"
609
+ }
610
+ },
611
+ "required": ["imageUrl", "type"],
612
+ "title": "InputImageDynamicToolCallOutputContentItem",
613
+ "type": "object"
600
614
  },
601
- "required": ["imageUrl", "type"],
602
- "title": "InputImageDynamicToolCallOutputContentItem",
603
- "type": "object"
604
- }] },
615
+ {
616
+ "properties": {
617
+ "audioUrl": { "type": "string" },
618
+ "type": {
619
+ "enum": ["inputAudio"],
620
+ "title": "InputAudioDynamicToolCallOutputContentItemType",
621
+ "type": "string"
622
+ }
623
+ },
624
+ "required": ["audioUrl", "type"],
625
+ "title": "InputAudioDynamicToolCallOutputContentItem",
626
+ "type": "object"
627
+ }
628
+ ] },
605
629
  "DynamicToolCallStatus": {
606
630
  "enum": [
607
631
  "inProgress",
@@ -655,8 +679,7 @@ var ThreadResumeResponse_default = {
655
679
  "appName": { "type": ["string", "null"] },
656
680
  "connectorId": { "type": "string" },
657
681
  "linkId": { "type": ["string", "null"] },
658
- "resourceUri": { "type": ["string", "null"] },
659
- "templateId": { "type": ["string", "null"] }
682
+ "resourceUri": { "type": ["string", "null"] }
660
683
  },
661
684
  "required": ["connectorId"],
662
685
  "type": "object"
@@ -982,6 +1005,10 @@ var ThreadResumeResponse_default = {
982
1005
  "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.",
983
1006
  "type": ["string", "null"]
984
1007
  },
1008
+ "canAcceptDirectInput": {
1009
+ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread.",
1010
+ "type": ["boolean", "null"]
1011
+ },
985
1012
  "cliVersion": {
986
1013
  "description": "Version of the CLI that created the thread.",
987
1014
  "type": "string"
@@ -1447,6 +1474,12 @@ var ThreadResumeResponse_default = {
1447
1474
  "action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
1448
1475
  "id": { "type": "string" },
1449
1476
  "query": { "type": "string" },
1477
+ "results": {
1478
+ "default": null,
1479
+ "description": "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.",
1480
+ "items": true,
1481
+ "type": ["array", "null"]
1482
+ },
1450
1483
  "type": {
1451
1484
  "enum": ["webSearch"],
1452
1485
  "title": "WebSearchThreadItemType",
@@ -1480,6 +1513,7 @@ var ThreadResumeResponse_default = {
1480
1513
  "type": "object"
1481
1514
  },
1482
1515
  {
1516
+ "description": "Display item emitted by the interruptible `clock.sleep` tool.",
1483
1517
  "properties": {
1484
1518
  "durationMs": {
1485
1519
  "format": "uint64",
@@ -1770,6 +1804,32 @@ var ThreadResumeResponse_default = {
1770
1804
  "title": "LocalImageUserInput",
1771
1805
  "type": "object"
1772
1806
  },
1807
+ {
1808
+ "properties": {
1809
+ "type": {
1810
+ "enum": ["audio"],
1811
+ "title": "AudioUserInputType",
1812
+ "type": "string"
1813
+ },
1814
+ "url": { "type": "string" }
1815
+ },
1816
+ "required": ["type", "url"],
1817
+ "title": "AudioUserInput",
1818
+ "type": "object"
1819
+ },
1820
+ {
1821
+ "properties": {
1822
+ "path": { "type": "string" },
1823
+ "type": {
1824
+ "enum": ["localAudio"],
1825
+ "title": "LocalAudioUserInputType",
1826
+ "type": "string"
1827
+ }
1828
+ },
1829
+ "required": ["path", "type"],
1830
+ "title": "LocalAudioUserInput",
1831
+ "type": "object"
1832
+ },
1773
1833
  {
1774
1834
  "properties": {
1775
1835
  "name": { "type": "string" },
@@ -1887,6 +1947,11 @@ var ThreadResumeResponse_default = {
1887
1947
  "items": { "$ref": "#/definitions/LegacyAppPathString" },
1888
1948
  "type": "array"
1889
1949
  },
1950
+ "itemsBackwardsCursor": {
1951
+ "default": null,
1952
+ "description": "Opaque head cursor for hydrating paginated items backwards.\n\nPass this as `cursor` to `thread/items/list` with `sortDirection: \"desc\"`. The first page includes the cursor's head item.",
1953
+ "type": ["string", "null"]
1954
+ },
1890
1955
  "model": { "type": "string" },
1891
1956
  "modelProvider": { "type": "string" },
1892
1957
  "multiAgentMode": {
@@ -1906,7 +1971,12 @@ var ThreadResumeResponse_default = {
1906
1971
  "description": "Legacy sandbox policy retained for compatibility. Experimental clients should prefer `activePermissionProfile` for profile provenance."
1907
1972
  },
1908
1973
  "serviceTier": { "type": ["string", "null"] },
1909
- "thread": { "$ref": "#/definitions/Thread" }
1974
+ "thread": { "$ref": "#/definitions/Thread" },
1975
+ "turnsBackwardsCursor": {
1976
+ "default": null,
1977
+ "description": "Opaque head cursor for hydrating paginated turns backwards.\n\nPass this as `cursor` to `thread/turns/list` with `sortDirection: \"desc\"`. The first page includes the cursor's head turn.",
1978
+ "type": ["string", "null"]
1979
+ }
1910
1980
  },
1911
1981
  required: [
1912
1982
  "approvalPolicy",
@@ -2216,31 +2286,47 @@ var ThreadStartResponse_default = {
2216
2286
  ],
2217
2287
  "type": "string"
2218
2288
  },
2219
- "DynamicToolCallOutputContentItem": { "oneOf": [{
2220
- "properties": {
2221
- "text": { "type": "string" },
2222
- "type": {
2223
- "enum": ["inputText"],
2224
- "title": "InputTextDynamicToolCallOutputContentItemType",
2225
- "type": "string"
2226
- }
2289
+ "DynamicToolCallOutputContentItem": { "oneOf": [
2290
+ {
2291
+ "properties": {
2292
+ "text": { "type": "string" },
2293
+ "type": {
2294
+ "enum": ["inputText"],
2295
+ "title": "InputTextDynamicToolCallOutputContentItemType",
2296
+ "type": "string"
2297
+ }
2298
+ },
2299
+ "required": ["text", "type"],
2300
+ "title": "InputTextDynamicToolCallOutputContentItem",
2301
+ "type": "object"
2227
2302
  },
2228
- "required": ["text", "type"],
2229
- "title": "InputTextDynamicToolCallOutputContentItem",
2230
- "type": "object"
2231
- }, {
2232
- "properties": {
2233
- "imageUrl": { "type": "string" },
2234
- "type": {
2235
- "enum": ["inputImage"],
2236
- "title": "InputImageDynamicToolCallOutputContentItemType",
2237
- "type": "string"
2238
- }
2303
+ {
2304
+ "properties": {
2305
+ "imageUrl": { "type": "string" },
2306
+ "type": {
2307
+ "enum": ["inputImage"],
2308
+ "title": "InputImageDynamicToolCallOutputContentItemType",
2309
+ "type": "string"
2310
+ }
2311
+ },
2312
+ "required": ["imageUrl", "type"],
2313
+ "title": "InputImageDynamicToolCallOutputContentItem",
2314
+ "type": "object"
2239
2315
  },
2240
- "required": ["imageUrl", "type"],
2241
- "title": "InputImageDynamicToolCallOutputContentItem",
2242
- "type": "object"
2243
- }] },
2316
+ {
2317
+ "properties": {
2318
+ "audioUrl": { "type": "string" },
2319
+ "type": {
2320
+ "enum": ["inputAudio"],
2321
+ "title": "InputAudioDynamicToolCallOutputContentItemType",
2322
+ "type": "string"
2323
+ }
2324
+ },
2325
+ "required": ["audioUrl", "type"],
2326
+ "title": "InputAudioDynamicToolCallOutputContentItem",
2327
+ "type": "object"
2328
+ }
2329
+ ] },
2244
2330
  "DynamicToolCallStatus": {
2245
2331
  "enum": [
2246
2332
  "inProgress",
@@ -2294,8 +2380,7 @@ var ThreadStartResponse_default = {
2294
2380
  "appName": { "type": ["string", "null"] },
2295
2381
  "connectorId": { "type": "string" },
2296
2382
  "linkId": { "type": ["string", "null"] },
2297
- "resourceUri": { "type": ["string", "null"] },
2298
- "templateId": { "type": ["string", "null"] }
2383
+ "resourceUri": { "type": ["string", "null"] }
2299
2384
  },
2300
2385
  "required": ["connectorId"],
2301
2386
  "type": "object"
@@ -2621,6 +2706,10 @@ var ThreadStartResponse_default = {
2621
2706
  "description": "Optional role (agent_role) assigned to an AgentControl-spawned sub-agent.",
2622
2707
  "type": ["string", "null"]
2623
2708
  },
2709
+ "canAcceptDirectInput": {
2710
+ "description": "Whether the app server accepts direct turn input for this loaded thread. `None` means the capability is unavailable, such as for an unloaded stored thread.",
2711
+ "type": ["boolean", "null"]
2712
+ },
2624
2713
  "cliVersion": {
2625
2714
  "description": "Version of the CLI that created the thread.",
2626
2715
  "type": "string"
@@ -3086,6 +3175,12 @@ var ThreadStartResponse_default = {
3086
3175
  "action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
3087
3176
  "id": { "type": "string" },
3088
3177
  "query": { "type": "string" },
3178
+ "results": {
3179
+ "default": null,
3180
+ "description": "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.",
3181
+ "items": true,
3182
+ "type": ["array", "null"]
3183
+ },
3089
3184
  "type": {
3090
3185
  "enum": ["webSearch"],
3091
3186
  "title": "WebSearchThreadItemType",
@@ -3119,6 +3214,7 @@ var ThreadStartResponse_default = {
3119
3214
  "type": "object"
3120
3215
  },
3121
3216
  {
3217
+ "description": "Display item emitted by the interruptible `clock.sleep` tool.",
3122
3218
  "properties": {
3123
3219
  "durationMs": {
3124
3220
  "format": "uint64",
@@ -3397,6 +3493,32 @@ var ThreadStartResponse_default = {
3397
3493
  "title": "LocalImageUserInput",
3398
3494
  "type": "object"
3399
3495
  },
3496
+ {
3497
+ "properties": {
3498
+ "type": {
3499
+ "enum": ["audio"],
3500
+ "title": "AudioUserInputType",
3501
+ "type": "string"
3502
+ },
3503
+ "url": { "type": "string" }
3504
+ },
3505
+ "required": ["type", "url"],
3506
+ "title": "AudioUserInput",
3507
+ "type": "object"
3508
+ },
3509
+ {
3510
+ "properties": {
3511
+ "path": { "type": "string" },
3512
+ "type": {
3513
+ "enum": ["localAudio"],
3514
+ "title": "LocalAudioUserInputType",
3515
+ "type": "string"
3516
+ }
3517
+ },
3518
+ "required": ["path", "type"],
3519
+ "title": "LocalAudioUserInput",
3520
+ "type": "object"
3521
+ },
3400
3522
  {
3401
3523
  "properties": {
3402
3524
  "name": { "type": "string" },
@@ -3779,31 +3901,47 @@ var TurnCompletedNotification_default = {
3779
3901
  ],
3780
3902
  "type": "string"
3781
3903
  },
3782
- "DynamicToolCallOutputContentItem": { "oneOf": [{
3783
- "properties": {
3784
- "text": { "type": "string" },
3785
- "type": {
3786
- "enum": ["inputText"],
3787
- "title": "InputTextDynamicToolCallOutputContentItemType",
3788
- "type": "string"
3789
- }
3904
+ "DynamicToolCallOutputContentItem": { "oneOf": [
3905
+ {
3906
+ "properties": {
3907
+ "text": { "type": "string" },
3908
+ "type": {
3909
+ "enum": ["inputText"],
3910
+ "title": "InputTextDynamicToolCallOutputContentItemType",
3911
+ "type": "string"
3912
+ }
3913
+ },
3914
+ "required": ["text", "type"],
3915
+ "title": "InputTextDynamicToolCallOutputContentItem",
3916
+ "type": "object"
3790
3917
  },
3791
- "required": ["text", "type"],
3792
- "title": "InputTextDynamicToolCallOutputContentItem",
3793
- "type": "object"
3794
- }, {
3795
- "properties": {
3796
- "imageUrl": { "type": "string" },
3797
- "type": {
3798
- "enum": ["inputImage"],
3799
- "title": "InputImageDynamicToolCallOutputContentItemType",
3800
- "type": "string"
3801
- }
3918
+ {
3919
+ "properties": {
3920
+ "imageUrl": { "type": "string" },
3921
+ "type": {
3922
+ "enum": ["inputImage"],
3923
+ "title": "InputImageDynamicToolCallOutputContentItemType",
3924
+ "type": "string"
3925
+ }
3926
+ },
3927
+ "required": ["imageUrl", "type"],
3928
+ "title": "InputImageDynamicToolCallOutputContentItem",
3929
+ "type": "object"
3802
3930
  },
3803
- "required": ["imageUrl", "type"],
3804
- "title": "InputImageDynamicToolCallOutputContentItem",
3805
- "type": "object"
3806
- }] },
3931
+ {
3932
+ "properties": {
3933
+ "audioUrl": { "type": "string" },
3934
+ "type": {
3935
+ "enum": ["inputAudio"],
3936
+ "title": "InputAudioDynamicToolCallOutputContentItemType",
3937
+ "type": "string"
3938
+ }
3939
+ },
3940
+ "required": ["audioUrl", "type"],
3941
+ "title": "InputAudioDynamicToolCallOutputContentItem",
3942
+ "type": "object"
3943
+ }
3944
+ ] },
3807
3945
  "DynamicToolCallStatus": {
3808
3946
  "enum": [
3809
3947
  "inProgress",
@@ -3849,8 +3987,7 @@ var TurnCompletedNotification_default = {
3849
3987
  "appName": { "type": ["string", "null"] },
3850
3988
  "connectorId": { "type": "string" },
3851
3989
  "linkId": { "type": ["string", "null"] },
3852
- "resourceUri": { "type": ["string", "null"] },
3853
- "templateId": { "type": ["string", "null"] }
3990
+ "resourceUri": { "type": ["string", "null"] }
3854
3991
  },
3855
3992
  "required": ["connectorId"],
3856
3993
  "type": "object"
@@ -4350,6 +4487,12 @@ var TurnCompletedNotification_default = {
4350
4487
  "action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
4351
4488
  "id": { "type": "string" },
4352
4489
  "query": { "type": "string" },
4490
+ "results": {
4491
+ "default": null,
4492
+ "description": "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.",
4493
+ "items": true,
4494
+ "type": ["array", "null"]
4495
+ },
4353
4496
  "type": {
4354
4497
  "enum": ["webSearch"],
4355
4498
  "title": "WebSearchThreadItemType",
@@ -4383,6 +4526,7 @@ var TurnCompletedNotification_default = {
4383
4526
  "type": "object"
4384
4527
  },
4385
4528
  {
4529
+ "description": "Display item emitted by the interruptible `clock.sleep` tool.",
4386
4530
  "properties": {
4387
4531
  "durationMs": {
4388
4532
  "format": "uint64",
@@ -4612,6 +4756,32 @@ var TurnCompletedNotification_default = {
4612
4756
  "title": "LocalImageUserInput",
4613
4757
  "type": "object"
4614
4758
  },
4759
+ {
4760
+ "properties": {
4761
+ "type": {
4762
+ "enum": ["audio"],
4763
+ "title": "AudioUserInputType",
4764
+ "type": "string"
4765
+ },
4766
+ "url": { "type": "string" }
4767
+ },
4768
+ "required": ["type", "url"],
4769
+ "title": "AudioUserInput",
4770
+ "type": "object"
4771
+ },
4772
+ {
4773
+ "properties": {
4774
+ "path": { "type": "string" },
4775
+ "type": {
4776
+ "enum": ["localAudio"],
4777
+ "title": "LocalAudioUserInputType",
4778
+ "type": "string"
4779
+ }
4780
+ },
4781
+ "required": ["path", "type"],
4782
+ "title": "LocalAudioUserInput",
4783
+ "type": "object"
4784
+ },
4615
4785
  {
4616
4786
  "properties": {
4617
4787
  "name": { "type": "string" },
@@ -4951,31 +5121,47 @@ var TurnStartResponse_default = {
4951
5121
  ],
4952
5122
  "type": "string"
4953
5123
  },
4954
- "DynamicToolCallOutputContentItem": { "oneOf": [{
4955
- "properties": {
4956
- "text": { "type": "string" },
4957
- "type": {
4958
- "enum": ["inputText"],
4959
- "title": "InputTextDynamicToolCallOutputContentItemType",
4960
- "type": "string"
4961
- }
5124
+ "DynamicToolCallOutputContentItem": { "oneOf": [
5125
+ {
5126
+ "properties": {
5127
+ "text": { "type": "string" },
5128
+ "type": {
5129
+ "enum": ["inputText"],
5130
+ "title": "InputTextDynamicToolCallOutputContentItemType",
5131
+ "type": "string"
5132
+ }
5133
+ },
5134
+ "required": ["text", "type"],
5135
+ "title": "InputTextDynamicToolCallOutputContentItem",
5136
+ "type": "object"
4962
5137
  },
4963
- "required": ["text", "type"],
4964
- "title": "InputTextDynamicToolCallOutputContentItem",
4965
- "type": "object"
4966
- }, {
4967
- "properties": {
4968
- "imageUrl": { "type": "string" },
4969
- "type": {
4970
- "enum": ["inputImage"],
4971
- "title": "InputImageDynamicToolCallOutputContentItemType",
4972
- "type": "string"
4973
- }
5138
+ {
5139
+ "properties": {
5140
+ "imageUrl": { "type": "string" },
5141
+ "type": {
5142
+ "enum": ["inputImage"],
5143
+ "title": "InputImageDynamicToolCallOutputContentItemType",
5144
+ "type": "string"
5145
+ }
5146
+ },
5147
+ "required": ["imageUrl", "type"],
5148
+ "title": "InputImageDynamicToolCallOutputContentItem",
5149
+ "type": "object"
4974
5150
  },
4975
- "required": ["imageUrl", "type"],
4976
- "title": "InputImageDynamicToolCallOutputContentItem",
4977
- "type": "object"
4978
- }] },
5151
+ {
5152
+ "properties": {
5153
+ "audioUrl": { "type": "string" },
5154
+ "type": {
5155
+ "enum": ["inputAudio"],
5156
+ "title": "InputAudioDynamicToolCallOutputContentItemType",
5157
+ "type": "string"
5158
+ }
5159
+ },
5160
+ "required": ["audioUrl", "type"],
5161
+ "title": "InputAudioDynamicToolCallOutputContentItem",
5162
+ "type": "object"
5163
+ }
5164
+ ] },
4979
5165
  "DynamicToolCallStatus": {
4980
5166
  "enum": [
4981
5167
  "inProgress",
@@ -5021,8 +5207,7 @@ var TurnStartResponse_default = {
5021
5207
  "appName": { "type": ["string", "null"] },
5022
5208
  "connectorId": { "type": "string" },
5023
5209
  "linkId": { "type": ["string", "null"] },
5024
- "resourceUri": { "type": ["string", "null"] },
5025
- "templateId": { "type": ["string", "null"] }
5210
+ "resourceUri": { "type": ["string", "null"] }
5026
5211
  },
5027
5212
  "required": ["connectorId"],
5028
5213
  "type": "object"
@@ -5522,6 +5707,12 @@ var TurnStartResponse_default = {
5522
5707
  "action": { "anyOf": [{ "$ref": "#/definitions/WebSearchAction" }, { "type": "null" }] },
5523
5708
  "id": { "type": "string" },
5524
5709
  "query": { "type": "string" },
5710
+ "results": {
5711
+ "default": null,
5712
+ "description": "Structured search results returned out-of-band by standalone web search.\n\nThese stay as opaque JSON at the extension/app-server boundary so new result fields and result types can pass through without a Codex release.",
5713
+ "items": true,
5714
+ "type": ["array", "null"]
5715
+ },
5525
5716
  "type": {
5526
5717
  "enum": ["webSearch"],
5527
5718
  "title": "WebSearchThreadItemType",
@@ -5555,6 +5746,7 @@ var TurnStartResponse_default = {
5555
5746
  "type": "object"
5556
5747
  },
5557
5748
  {
5749
+ "description": "Display item emitted by the interruptible `clock.sleep` tool.",
5558
5750
  "properties": {
5559
5751
  "durationMs": {
5560
5752
  "format": "uint64",
@@ -5784,6 +5976,32 @@ var TurnStartResponse_default = {
5784
5976
  "title": "LocalImageUserInput",
5785
5977
  "type": "object"
5786
5978
  },
5979
+ {
5980
+ "properties": {
5981
+ "type": {
5982
+ "enum": ["audio"],
5983
+ "title": "AudioUserInputType",
5984
+ "type": "string"
5985
+ },
5986
+ "url": { "type": "string" }
5987
+ },
5988
+ "required": ["type", "url"],
5989
+ "title": "AudioUserInput",
5990
+ "type": "object"
5991
+ },
5992
+ {
5993
+ "properties": {
5994
+ "path": { "type": "string" },
5995
+ "type": {
5996
+ "enum": ["localAudio"],
5997
+ "title": "LocalAudioUserInputType",
5998
+ "type": "string"
5999
+ }
6000
+ },
6001
+ "required": ["path", "type"],
6002
+ "title": "LocalAudioUserInput",
6003
+ "type": "object"
6004
+ },
5787
6005
  {
5788
6006
  "properties": {
5789
6007
  "name": { "type": "string" },
@@ -6015,6 +6233,11 @@ function assertCodexThreadForkResponse(value) {
6015
6233
  const normalized = normalizeWithDefaults(ThreadStartResponse_default, value);
6016
6234
  return assertCodexShape(validateThreadStartResponse, normalized, "thread/fork response");
6017
6235
  }
6236
+ /** Asserts the experimental beforeTurnId request field before it crosses the app-server boundary. */
6237
+ function assertCodexThreadForkParams(value) {
6238
+ if (!isRecord(value) || typeof value.threadId !== "string" || !value.threadId.trim() || value.beforeTurnId !== void 0 && value.beforeTurnId !== null && typeof value.beforeTurnId !== "string") throw new Error("Invalid Codex app-server thread/fork params");
6239
+ return value;
6240
+ }
6018
6241
  /** Asserts and normalizes a Codex thread/resume response. */
6019
6242
  function assertCodexThreadResumeResponse(value) {
6020
6243
  const normalized = normalizeWithDefaults(ThreadResumeResponse_default, value);
@@ -6155,6 +6378,46 @@ function readUpstreamUserText(message) {
6155
6378
  return typeof text === "string" && text ? text : void 0;
6156
6379
  }
6157
6380
  //#endregion
6381
+ //#region extensions/codex/src/app-server/transcript-mirror-attestation.ts
6382
+ const MIRROR_ORIGIN_META_KEY = "mirrorOrigin";
6383
+ const MIRROR_SOURCE_FINGERPRINT_META_KEY = "mirrorSourceFingerprint";
6384
+ const CODEX_APP_SERVER_MIRROR_ORIGIN = "codex-app-server";
6385
+ function attachCodexMirrorAttestation(message, sourceFingerprint) {
6386
+ const record = message;
6387
+ const existing = record["__openclaw"];
6388
+ const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
6389
+ return {
6390
+ ...record,
6391
+ __openclaw: {
6392
+ ...baseMeta,
6393
+ [MIRROR_ORIGIN_META_KEY]: CODEX_APP_SERVER_MIRROR_ORIGIN,
6394
+ ...sourceFingerprint ? { [MIRROR_SOURCE_FINGERPRINT_META_KEY]: sourceFingerprint } : {}
6395
+ }
6396
+ };
6397
+ }
6398
+ function readCodexMirrorSourceFingerprint(message) {
6399
+ const meta = message["__openclaw"];
6400
+ if (!meta || typeof meta !== "object" || Array.isArray(meta)) return;
6401
+ const value = meta[MIRROR_SOURCE_FINGERPRINT_META_KEY];
6402
+ return typeof value === "string" && value ? value : void 0;
6403
+ }
6404
+ function serializeCodexMirrorSourceEvidence(message) {
6405
+ const record = message;
6406
+ return JSON.stringify({
6407
+ role: message.role,
6408
+ content: record.content,
6409
+ ...message.role === "user" ? { upstreamUserText: readUpstreamUserText(message) } : {},
6410
+ ...message.role === "toolResult" ? {
6411
+ toolCallId: record.toolCallId,
6412
+ toolName: record.toolName,
6413
+ isError: record.isError === true
6414
+ } : {}
6415
+ });
6416
+ }
6417
+ function fingerprintCodexMirrorSourceMessage(message) {
6418
+ return createHash("sha256").update(serializeCodexMirrorSourceEvidence(message)).digest("hex").slice(0, 32);
6419
+ }
6420
+ //#endregion
6158
6421
  //#region extensions/codex/src/app-server/user-prompt-message.ts
6159
6422
  function buildSenderLabel(params) {
6160
6423
  const label = params.senderName ?? params.senderUsername ?? params.senderE164 ?? params.senderId;
@@ -6201,8 +6464,9 @@ async function buildResolvedCodexUserPromptMessage(params) {
6201
6464
  }
6202
6465
  //#endregion
6203
6466
  //#region extensions/codex/src/app-server/transcript-mirror.ts
6204
- const MIRROR_ORIGIN_META_KEY = "mirrorOrigin";
6205
- const CODEX_APP_SERVER_MIRROR_ORIGIN = "codex-app-server";
6467
+ function isMirroredAgentMessage(message) {
6468
+ return message.role === "user" || message.role === "assistant" || message.role === "toolResult";
6469
+ }
6206
6470
  const CODEX_HISTORY_IMPORT_MAX_MESSAGES = 200;
6207
6471
  const CODEX_HISTORY_IMPORT_MAX_BYTES = 512 * 1024;
6208
6472
  const CODEX_HISTORY_IMPORT_MAX_MESSAGE_BYTES = 64 * 1024;
@@ -6372,18 +6636,6 @@ async function importCodexThreadHistoryToTranscript(params) {
6372
6636
  omittedMessages: projection.omittedMessages
6373
6637
  };
6374
6638
  }
6375
- function attachCodexMirrorOrigin(message) {
6376
- const record = message;
6377
- const existing = record["__openclaw"];
6378
- const baseMeta = existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {};
6379
- return {
6380
- ...record,
6381
- __openclaw: {
6382
- ...baseMeta,
6383
- [MIRROR_ORIGIN_META_KEY]: CODEX_APP_SERVER_MIRROR_ORIGIN
6384
- }
6385
- };
6386
- }
6387
6639
  async function mirrorBestEffort(params) {
6388
6640
  try {
6389
6641
  const messages = await resolveFinalCodexMirrorMessages({
@@ -6406,10 +6658,29 @@ async function mirrorBestEffort(params) {
6406
6658
  } catch (error) {
6407
6659
  embeddedAgentLog.warn("failed to notify codex app-server user-message persistence", { error: formatErrorMessage(error) });
6408
6660
  }
6409
- return mirrorResult.assistantMirrorIdentitiesOwned.includes(`${params.turnId}:assistant`);
6661
+ const expectedFingerprints = new Map(messages.flatMap((message) => {
6662
+ if (!isMirroredAgentMessage(message)) return [];
6663
+ const identity = readMirrorIdentity(message);
6664
+ return identity ? [[identity, fingerprintCodexMirrorSourceMessage(message)]] : [];
6665
+ }));
6666
+ const mirroredMessages = mirrorResult.messagesPresent.filter((message) => {
6667
+ const identity = readMirrorIdentity(message);
6668
+ return identity !== void 0 && readCodexMirrorSourceFingerprint(message) === expectedFingerprints.get(identity);
6669
+ });
6670
+ const assistantMirrorIdentity = `${params.turnId}:assistant`;
6671
+ const assistantTranscriptOwned = mirrorResult.assistantMirrorIdentitiesOwned.includes(assistantMirrorIdentity);
6672
+ const assistantTranscriptIdempotencyKey = normalizeOptionalString((assistantTranscriptOwned ? mirroredMessages.find((message) => readMirrorIdentity(message) === assistantMirrorIdentity) : void 0)?.idempotencyKey);
6673
+ return {
6674
+ assistantTranscriptOwned,
6675
+ ...assistantTranscriptIdempotencyKey ? { assistantTranscriptIdempotencyKey } : {},
6676
+ mirroredMessages
6677
+ };
6410
6678
  } catch (error) {
6411
6679
  embeddedAgentLog.warn("failed to mirror codex app-server transcript", { error });
6412
- return false;
6680
+ return {
6681
+ assistantTranscriptOwned: false,
6682
+ mirroredMessages: []
6683
+ };
6413
6684
  }
6414
6685
  }
6415
6686
  async function resolveFinalCodexMirrorMessages(params) {
@@ -6441,7 +6712,10 @@ async function mirrorPromptAtTurnStartBestEffort(params) {
6441
6712
  if (params.params.suppressNextUserMessagePersistence) return;
6442
6713
  try {
6443
6714
  const mirrorPromise = (async () => {
6444
- const userPromptMessage = attachUpstreamUserText(attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`), params.upstreamUserText);
6715
+ const userPromptMessage = projectAgentHarnessTranscriptMessageForDisplay({
6716
+ hidden: params.params.trigger === "memory",
6717
+ message: attachUpstreamUserText(attachCodexMirrorIdentity(await buildResolvedCodexUserPromptMessage(params.params), `${params.turnId}:prompt`), params.upstreamUserText)
6718
+ });
6445
6719
  const mirrorResult = await mirror({
6446
6720
  agentId: params.agentId,
6447
6721
  sessionKey: params.sessionKey,
@@ -6473,35 +6747,40 @@ function buildMirrorDedupeIdentity(message) {
6473
6747
  return `${message.role}:${fingerprintMirrorMessageContent(message)}`;
6474
6748
  }
6475
6749
  async function mirror(params) {
6476
- const messages = params.messages.filter((message) => message.role === "user" || message.role === "assistant" || message.role === "toolResult");
6750
+ const messages = params.messages.filter(isMirroredAgentMessage);
6477
6751
  if (messages.length === 0) return {
6478
6752
  assistantMirrorIdentitiesOwned: [],
6753
+ messagesPresent: [],
6479
6754
  userMessagesPresent: []
6480
6755
  };
6481
6756
  const transcriptTarget = resolveCodexMirrorTranscriptTarget(params);
6482
- const { appendedUpdates, assistantMirrorIdentitiesOwned, userMessagesPresent } = await withSessionTranscriptWriteLock({
6757
+ const { appendedUpdates, assistantMirrorIdentitiesOwned, messagesPresent, userMessagesPresent } = await withSessionTranscriptWriteLock({
6483
6758
  ...transcriptTarget,
6484
6759
  config: params.config
6485
6760
  }, async (transcript) => {
6486
6761
  const nextAppendedUpdates = [];
6487
6762
  const nextAssistantMirrorIdentitiesOwned = /* @__PURE__ */ new Set();
6763
+ const nextMessagesPresent = [];
6488
6764
  const nextUserMessagesPresent = [];
6489
6765
  const mirrorState = readTranscriptMirrorState(await transcript.readEvents());
6490
6766
  let nextMessageSeq = mirrorState.messageCount;
6491
6767
  for (const message of messages) {
6492
6768
  const dedupeIdentity = buildMirrorDedupeIdentity(message);
6769
+ const sourceFingerprint = fingerprintCodexMirrorSourceMessage(message);
6493
6770
  const idempotencyKey = (message.role === "user" ? normalizeOptionalString(message.idempotencyKey) : void 0) ?? (params.idempotencyScope ? `${params.idempotencyScope}:${dedupeIdentity}` : void 0);
6494
6771
  const transcriptMessage = {
6495
- ...attachCodexMirrorOrigin(message),
6772
+ ...attachCodexMirrorAttestation(message, sourceFingerprint),
6496
6773
  ...idempotencyKey ? { idempotencyKey } : {}
6497
6774
  };
6498
6775
  if (idempotencyKey && mirrorState.idempotencyKeys.has(idempotencyKey)) {
6499
- const persistedUserMessage = mirrorState.userMessagesByIdempotencyKey.get(idempotencyKey);
6776
+ const persistedMessage = mirrorState.messagesByIdempotencyKey.get(idempotencyKey);
6777
+ if (persistedMessage) nextMessagesPresent.push(persistedMessage);
6778
+ const persistedUserMessage = persistedMessage?.role === "user" ? persistedMessage : void 0;
6500
6779
  if (persistedUserMessage) nextUserMessagesPresent.push(persistedUserMessage);
6501
6780
  if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
6502
6781
  continue;
6503
6782
  }
6504
- const nextMessage = runAgentHarnessBeforeMessageWriteHook({
6783
+ const nextMessage = params.skipBeforeMessageWriteHooks ? transcriptMessage : runAgentHarnessBeforeMessageWriteHook({
6505
6784
  message: transcriptMessage,
6506
6785
  agentId: params.agentId,
6507
6786
  sessionKey: params.sessionKey
@@ -6510,10 +6789,16 @@ async function mirror(params) {
6510
6789
  if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
6511
6790
  continue;
6512
6791
  }
6513
- const messageToAppend = idempotencyKey ? {
6514
- ...attachCodexMirrorOrigin(nextMessage),
6792
+ let messageToAppend = idempotencyKey ? {
6793
+ ...attachCodexMirrorAttestation(nextMessage, sourceFingerprint),
6515
6794
  idempotencyKey
6516
- } : attachCodexMirrorOrigin(nextMessage);
6795
+ } : attachCodexMirrorAttestation(nextMessage, sourceFingerprint);
6796
+ const mirrorIdentity = readMirrorIdentity(message);
6797
+ if (mirrorIdentity) messageToAppend = attachCodexMirrorIdentity(messageToAppend, mirrorIdentity);
6798
+ messageToAppend = projectAgentHarnessTranscriptMessageForDisplay({
6799
+ hidden: message.display === false,
6800
+ message: messageToAppend
6801
+ });
6517
6802
  const appended = await transcript.appendMessage({
6518
6803
  message: messageToAppend,
6519
6804
  idempotencyLookup: idempotencyKey ? "caller-checked" : "scan",
@@ -6521,11 +6806,12 @@ async function mirror(params) {
6521
6806
  });
6522
6807
  if (!appended) continue;
6523
6808
  const { messageId, message: appendedMessage } = appended;
6524
- if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
6525
- if (appendedMessage.role === "user") {
6526
- nextUserMessagesPresent.push(appendedMessage);
6527
- if (idempotencyKey) mirrorState.userMessagesByIdempotencyKey.set(idempotencyKey, appendedMessage);
6809
+ if (isMirroredAgentMessage(appendedMessage)) {
6810
+ nextMessagesPresent.push(appendedMessage);
6811
+ if (idempotencyKey) mirrorState.messagesByIdempotencyKey.set(idempotencyKey, appendedMessage);
6528
6812
  }
6813
+ if (message.role === "assistant") nextAssistantMirrorIdentitiesOwned.add(dedupeIdentity);
6814
+ if (appendedMessage.role === "user") nextUserMessagesPresent.push(appendedMessage);
6529
6815
  nextMessageSeq += 1;
6530
6816
  nextAppendedUpdates.push({
6531
6817
  messageId,
@@ -6537,6 +6823,7 @@ async function mirror(params) {
6537
6823
  return {
6538
6824
  appendedUpdates: nextAppendedUpdates,
6539
6825
  assistantMirrorIdentitiesOwned: [...nextAssistantMirrorIdentitiesOwned],
6826
+ messagesPresent: nextMessagesPresent,
6540
6827
  userMessagesPresent: nextUserMessagesPresent
6541
6828
  };
6542
6829
  });
@@ -6556,6 +6843,7 @@ async function mirror(params) {
6556
6843
  }
6557
6844
  return {
6558
6845
  assistantMirrorIdentitiesOwned,
6846
+ messagesPresent,
6559
6847
  userMessagesPresent
6560
6848
  };
6561
6849
  }
@@ -6576,7 +6864,7 @@ function resolveCodexMirrorTranscriptTarget(params) {
6576
6864
  }
6577
6865
  function readTranscriptMirrorState(events) {
6578
6866
  const idempotencyKeys = /* @__PURE__ */ new Set();
6579
- const userMessagesByIdempotencyKey = /* @__PURE__ */ new Map();
6867
+ const messagesByIdempotencyKey = /* @__PURE__ */ new Map();
6580
6868
  let messageCount = 0;
6581
6869
  for (const event of events) {
6582
6870
  if (!event || typeof event !== "object" || Array.isArray(event)) continue;
@@ -6584,14 +6872,14 @@ function readTranscriptMirrorState(events) {
6584
6872
  if (parsed.type === "message") messageCount += 1;
6585
6873
  if (typeof parsed.message?.idempotencyKey === "string") {
6586
6874
  idempotencyKeys.add(parsed.message.idempotencyKey);
6587
- if (parsed.message.role === "user") userMessagesByIdempotencyKey.set(parsed.message.idempotencyKey, parsed.message);
6875
+ if (isMirroredAgentMessage(parsed.message)) messagesByIdempotencyKey.set(parsed.message.idempotencyKey, parsed.message);
6588
6876
  }
6589
6877
  }
6590
6878
  return {
6591
6879
  idempotencyKeys,
6592
- messageCount,
6593
- userMessagesByIdempotencyKey
6880
+ messagesByIdempotencyKey,
6881
+ messageCount
6594
6882
  };
6595
6883
  }
6596
6884
  //#endregion
6597
- export { readCodexTurnCompletedNotification as _, projectBoundedCodexThreadHistory as a, attachCodexMirrorIdentity as c, assertCodexThreadStartResponse as d, assertCodexTurnStartResponse as f, readCodexTurn as g, readCodexModelListResponse as h, mirrorPromptAtTurnStartBestEffort as i, assertCodexThreadForkResponse as l, readCodexErrorNotification as m, createCodexAppServerUserMessagePersistenceNotifier as n, buildCodexUserPromptMessage as o, readCodexDynamicToolCallParams as p, importCodexThreadHistoryToTranscript as r, promptSnapshot as s, codexTranscriptMirrorRuntime as t, assertCodexThreadResumeResponse as u };
6885
+ export { readCodexTurnCompletedNotification as C, readCodexTurn as S, assertCodexThreadStartResponse as _, projectBoundedCodexThreadHistory as a, readCodexErrorNotification as b, fingerprintCodexMirrorSourceMessage as c, attachCodexMirrorIdentity as d, readMirrorIdentity as f, assertCodexThreadResumeResponse as g, assertCodexThreadForkResponse as h, mirrorPromptAtTurnStartBestEffort as i, readCodexMirrorSourceFingerprint as l, assertCodexThreadForkParams as m, createCodexAppServerUserMessagePersistenceNotifier as n, buildCodexUserPromptMessage as o, readUpstreamUserText as p, importCodexThreadHistoryToTranscript as r, promptSnapshot as s, codexTranscriptMirrorRuntime as t, serializeCodexMirrorSourceEvidence as u, assertCodexTurnStartResponse as v, readCodexModelListResponse as x, readCodexDynamicToolCallParams as y };