cx-viewer 1.0.3 → 1.0.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.
- package/README.md +49 -20
- package/build.js +15 -0
- package/cli.js +102 -18
- package/concepts/ar/BodyDiffJSON.md +1 -1
- package/concepts/ar/BodyFields.md +30 -33
- package/concepts/ar/GlobalSettings.md +165 -167
- package/concepts/ar/MainAgent.md +3 -4
- package/concepts/ar/ProxySwitch.md +3 -3
- package/concepts/ar/QRCode.md +1 -1
- package/concepts/ar/ResponseFields.md +29 -41
- package/concepts/ar/SubAgent-Search.md +12 -12
- package/concepts/ar/Teammate.md +16 -16
- package/concepts/ar/ToolsFirst.md +42 -48
- package/concepts/ar/TranslateContextPollution.md +9 -9
- package/concepts/ar/UltraPlan.md +38 -38
- package/concepts/da/BodyDiffJSON.md +2 -2
- package/concepts/da/BodyFields.md +30 -33
- package/concepts/da/GlobalSettings.md +165 -167
- package/concepts/da/MainAgent.md +3 -4
- package/concepts/da/ProxySwitch.md +3 -3
- package/concepts/da/QRCode.md +1 -1
- package/concepts/da/ResponseFields.md +29 -41
- package/concepts/da/SubAgent-Search.md +11 -11
- package/concepts/da/Teammate.md +16 -16
- package/concepts/da/ToolsFirst.md +42 -48
- package/concepts/da/TranslateContextPollution.md +9 -9
- package/concepts/da/UltraPlan.md +38 -38
- package/concepts/de/BodyDiffJSON.md +2 -2
- package/concepts/de/BodyFields.md +30 -33
- package/concepts/de/GlobalSettings.md +165 -167
- package/concepts/de/MainAgent.md +3 -4
- package/concepts/de/ProxySwitch.md +3 -3
- package/concepts/de/QRCode.md +1 -1
- package/concepts/de/ResponseFields.md +29 -41
- package/concepts/de/SubAgent-Search.md +11 -11
- package/concepts/de/Teammate.md +15 -15
- package/concepts/de/ToolsFirst.md +41 -47
- package/concepts/de/TranslateContextPollution.md +9 -9
- package/concepts/de/UltraPlan.md +38 -38
- package/concepts/en/BodyDiffJSON.md +5 -5
- package/concepts/en/BodyFields.md +17 -20
- package/concepts/en/GlobalSettings.md +49 -51
- package/concepts/en/MainAgent.md +8 -8
- package/concepts/en/ProxySwitch.md +3 -3
- package/concepts/en/QRCode.md +6 -6
- package/concepts/en/ResponseFields.md +7 -19
- package/concepts/en/SubAgent-Search.md +2 -2
- package/concepts/en/Teammate.md +4 -4
- package/concepts/en/Tool-apply_patch.md +11 -0
- package/concepts/en/Tool-create_goal.md +8 -0
- package/concepts/en/Tool-exec.md +88 -0
- package/concepts/en/Tool-followup_task.md +10 -0
- package/concepts/en/Tool-get_goal.md +5 -0
- package/concepts/en/Tool-image_generation.md +5 -0
- package/concepts/en/Tool-interrupt_agent.md +9 -0
- package/concepts/en/Tool-list_agents.md +9 -0
- package/concepts/en/Tool-list_mcp_resource_templates.md +8 -0
- package/concepts/en/Tool-list_mcp_resources.md +8 -0
- package/concepts/en/Tool-read_mcp_resource.md +10 -0
- package/concepts/en/Tool-request_user_input.md +9 -0
- package/concepts/en/Tool-send_message.md +10 -0
- package/concepts/en/Tool-shell_command.md +12 -0
- package/concepts/en/Tool-spawn_agent.md +11 -0
- package/concepts/en/Tool-tool_search.md +12 -0
- package/concepts/en/Tool-update_goal.md +9 -0
- package/concepts/en/Tool-update_plan.md +9 -0
- package/concepts/en/Tool-view_image.md +10 -0
- package/concepts/en/Tool-wait.md +12 -0
- package/concepts/en/Tool-wait_agent.md +9 -0
- package/concepts/en/Tool-web_search.md +11 -0
- package/concepts/en/Tools.md +29 -58
- package/concepts/en/ToolsFirst.md +24 -30
- package/concepts/en/TranslateContextPollution.md +10 -38
- package/concepts/en/UltraPlan.md +7 -7
- package/concepts/es/BodyDiffJSON.md +1 -1
- package/concepts/es/BodyFields.md +35 -38
- package/concepts/es/GlobalSettings.md +165 -167
- package/concepts/es/MainAgent.md +3 -4
- package/concepts/es/ProxySwitch.md +3 -3
- package/concepts/es/QRCode.md +1 -1
- package/concepts/es/ResponseFields.md +28 -40
- package/concepts/es/SubAgent-Search.md +12 -12
- package/concepts/es/Teammate.md +17 -17
- package/concepts/es/ToolsFirst.md +41 -47
- package/concepts/es/TranslateContextPollution.md +9 -9
- package/concepts/es/UltraPlan.md +38 -38
- package/concepts/fr/BodyDiffJSON.md +2 -2
- package/concepts/fr/BodyFields.md +35 -38
- package/concepts/fr/GlobalSettings.md +165 -167
- package/concepts/fr/MainAgent.md +3 -4
- package/concepts/fr/ProxySwitch.md +3 -3
- package/concepts/fr/QRCode.md +1 -1
- package/concepts/fr/ResponseFields.md +25 -37
- package/concepts/fr/SubAgent-Search.md +12 -12
- package/concepts/fr/Teammate.md +16 -16
- package/concepts/fr/ToolsFirst.md +40 -46
- package/concepts/fr/TranslateContextPollution.md +9 -9
- package/concepts/fr/UltraPlan.md +38 -38
- package/concepts/it/BodyDiffJSON.md +2 -2
- package/concepts/it/BodyFields.md +35 -38
- package/concepts/it/GlobalSettings.md +165 -167
- package/concepts/it/MainAgent.md +3 -4
- package/concepts/it/ProxySwitch.md +3 -3
- package/concepts/it/QRCode.md +1 -1
- package/concepts/it/ResponseFields.md +28 -40
- package/concepts/it/SubAgent-Search.md +12 -12
- package/concepts/it/Teammate.md +17 -17
- package/concepts/it/ToolsFirst.md +41 -47
- package/concepts/it/TranslateContextPollution.md +9 -9
- package/concepts/it/UltraPlan.md +38 -38
- package/concepts/ja/BodyDiffJSON.md +1 -1
- package/concepts/ja/BodyFields.md +30 -33
- package/concepts/ja/GlobalSettings.md +165 -167
- package/concepts/ja/MainAgent.md +3 -4
- package/concepts/ja/ProxySwitch.md +3 -3
- package/concepts/ja/QRCode.md +1 -1
- package/concepts/ja/ResponseFields.md +29 -41
- package/concepts/ja/SubAgent-Search.md +12 -12
- package/concepts/ja/Teammate.md +17 -17
- package/concepts/ja/ToolsFirst.md +41 -47
- package/concepts/ja/TranslateContextPollution.md +9 -9
- package/concepts/ja/UltraPlan.md +38 -38
- package/concepts/ko/BodyDiffJSON.md +1 -1
- package/concepts/ko/BodyFields.md +30 -33
- package/concepts/ko/GlobalSettings.md +165 -167
- package/concepts/ko/MainAgent.md +3 -4
- package/concepts/ko/ProxySwitch.md +3 -3
- package/concepts/ko/QRCode.md +1 -1
- package/concepts/ko/ResponseFields.md +29 -41
- package/concepts/ko/SubAgent-Search.md +12 -12
- package/concepts/ko/Teammate.md +17 -17
- package/concepts/ko/ToolsFirst.md +41 -47
- package/concepts/ko/TranslateContextPollution.md +9 -9
- package/concepts/ko/UltraPlan.md +38 -38
- package/concepts/no/BodyDiffJSON.md +2 -2
- package/concepts/no/BodyFields.md +30 -33
- package/concepts/no/GlobalSettings.md +165 -167
- package/concepts/no/MainAgent.md +3 -4
- package/concepts/no/ProxySwitch.md +3 -3
- package/concepts/no/QRCode.md +1 -1
- package/concepts/no/ResponseFields.md +29 -41
- package/concepts/no/SubAgent-Search.md +12 -12
- package/concepts/no/Teammate.md +17 -17
- package/concepts/no/ToolsFirst.md +42 -48
- package/concepts/no/TranslateContextPollution.md +9 -9
- package/concepts/no/UltraPlan.md +38 -38
- package/concepts/pl/BodyDiffJSON.md +2 -2
- package/concepts/pl/BodyFields.md +30 -33
- package/concepts/pl/GlobalSettings.md +165 -167
- package/concepts/pl/MainAgent.md +3 -4
- package/concepts/pl/ProxySwitch.md +3 -3
- package/concepts/pl/QRCode.md +1 -1
- package/concepts/pl/ResponseFields.md +29 -41
- package/concepts/pl/SubAgent-Search.md +12 -12
- package/concepts/pl/Teammate.md +17 -17
- package/concepts/pl/ToolsFirst.md +42 -48
- package/concepts/pl/TranslateContextPollution.md +9 -9
- package/concepts/pl/UltraPlan.md +38 -38
- package/concepts/pt-BR/BodyDiffJSON.md +2 -2
- package/concepts/pt-BR/BodyFields.md +30 -33
- package/concepts/pt-BR/GlobalSettings.md +165 -167
- package/concepts/pt-BR/MainAgent.md +3 -4
- package/concepts/pt-BR/ProxySwitch.md +3 -3
- package/concepts/pt-BR/QRCode.md +1 -1
- package/concepts/pt-BR/ResponseFields.md +29 -41
- package/concepts/pt-BR/SubAgent-Search.md +12 -12
- package/concepts/pt-BR/Teammate.md +17 -17
- package/concepts/pt-BR/ToolsFirst.md +41 -47
- package/concepts/pt-BR/TranslateContextPollution.md +9 -9
- package/concepts/pt-BR/UltraPlan.md +38 -38
- package/concepts/ru/BodyDiffJSON.md +1 -1
- package/concepts/ru/BodyFields.md +30 -33
- package/concepts/ru/GlobalSettings.md +165 -167
- package/concepts/ru/MainAgent.md +3 -4
- package/concepts/ru/ProxySwitch.md +3 -3
- package/concepts/ru/QRCode.md +1 -1
- package/concepts/ru/ResponseFields.md +29 -41
- package/concepts/ru/SubAgent-Search.md +12 -12
- package/concepts/ru/Teammate.md +17 -17
- package/concepts/ru/ToolsFirst.md +41 -47
- package/concepts/ru/TranslateContextPollution.md +9 -9
- package/concepts/ru/UltraPlan.md +38 -38
- package/concepts/th/BodyDiffJSON.md +1 -1
- package/concepts/th/BodyFields.md +30 -33
- package/concepts/th/GlobalSettings.md +165 -167
- package/concepts/th/MainAgent.md +3 -4
- package/concepts/th/ProxySwitch.md +3 -3
- package/concepts/th/QRCode.md +1 -1
- package/concepts/th/ResponseFields.md +29 -41
- package/concepts/th/SubAgent-Search.md +12 -12
- package/concepts/th/Teammate.md +17 -17
- package/concepts/th/ToolsFirst.md +42 -48
- package/concepts/th/TranslateContextPollution.md +9 -9
- package/concepts/th/UltraPlan.md +38 -38
- package/concepts/tr/BodyDiffJSON.md +1 -1
- package/concepts/tr/BodyFields.md +30 -33
- package/concepts/tr/GlobalSettings.md +165 -167
- package/concepts/tr/MainAgent.md +3 -4
- package/concepts/tr/ProxySwitch.md +3 -3
- package/concepts/tr/QRCode.md +1 -1
- package/concepts/tr/ResponseFields.md +29 -41
- package/concepts/tr/SubAgent-Search.md +12 -12
- package/concepts/tr/Teammate.md +16 -16
- package/concepts/tr/ToolsFirst.md +42 -48
- package/concepts/tr/TranslateContextPollution.md +9 -9
- package/concepts/tr/UltraPlan.md +38 -38
- package/concepts/uk/BodyDiffJSON.md +1 -1
- package/concepts/uk/BodyFields.md +30 -33
- package/concepts/uk/GlobalSettings.md +165 -167
- package/concepts/uk/MainAgent.md +3 -4
- package/concepts/uk/ProxySwitch.md +3 -3
- package/concepts/uk/QRCode.md +1 -1
- package/concepts/uk/ResponseFields.md +29 -41
- package/concepts/uk/SubAgent-Search.md +12 -12
- package/concepts/uk/Teammate.md +17 -17
- package/concepts/uk/ToolsFirst.md +42 -48
- package/concepts/uk/TranslateContextPollution.md +9 -9
- package/concepts/uk/UltraPlan.md +38 -38
- package/concepts/zh/BodyDiffJSON.md +4 -4
- package/concepts/zh/BodyFields.md +17 -20
- package/concepts/zh/GlobalSettings.md +26 -28
- package/concepts/zh/MainAgent.md +6 -6
- package/concepts/zh/ProxySwitch.md +1 -1
- package/concepts/zh/ResponseFields.md +7 -18
- package/concepts/zh/SubAgent-Search.md +2 -2
- package/concepts/zh/Teammate.md +4 -4
- package/concepts/zh/Tool-apply_patch.md +11 -0
- package/concepts/zh/Tool-create_goal.md +8 -0
- package/concepts/zh/Tool-exec.md +88 -0
- package/concepts/zh/Tool-followup_task.md +10 -0
- package/concepts/zh/Tool-get_goal.md +5 -0
- package/concepts/zh/Tool-image_generation.md +5 -0
- package/concepts/zh/Tool-interrupt_agent.md +9 -0
- package/concepts/zh/Tool-list_agents.md +9 -0
- package/concepts/zh/Tool-list_mcp_resource_templates.md +8 -0
- package/concepts/zh/Tool-list_mcp_resources.md +8 -0
- package/concepts/zh/Tool-read_mcp_resource.md +10 -0
- package/concepts/zh/Tool-request_user_input.md +9 -0
- package/concepts/zh/Tool-send_message.md +10 -0
- package/concepts/zh/Tool-shell_command.md +12 -0
- package/concepts/zh/Tool-spawn_agent.md +11 -0
- package/concepts/zh/Tool-tool_search.md +12 -0
- package/concepts/zh/Tool-update_goal.md +9 -0
- package/concepts/zh/Tool-update_plan.md +9 -0
- package/concepts/zh/Tool-view_image.md +10 -0
- package/concepts/zh/Tool-wait.md +12 -0
- package/concepts/zh/Tool-wait_agent.md +9 -0
- package/concepts/zh/Tool-web_search.md +11 -0
- package/concepts/zh/Tools.md +29 -58
- package/concepts/zh/ToolsFirst.md +21 -27
- package/concepts/zh/TranslateContextPollution.md +10 -38
- package/concepts/zh/UltraPlan.md +7 -7
- package/concepts/zh-TW/BodyFields.md +27 -30
- package/concepts/zh-TW/GlobalSettings.md +26 -28
- package/concepts/zh-TW/MainAgent.md +0 -1
- package/concepts/zh-TW/ProxySwitch.md +22 -22
- package/concepts/zh-TW/ResponseFields.md +29 -40
- package/concepts/zh-TW/SubAgent-Search.md +12 -12
- package/concepts/zh-TW/Teammate.md +16 -16
- package/concepts/zh-TW/ToolsFirst.md +41 -47
- package/concepts/zh-TW/UltraPlan.md +38 -38
- package/dist/assets/App-BZ9oclBj.js +2 -0
- package/dist/assets/App-rWON7PuS.css +1 -0
- package/dist/assets/MdxEditorPanel-B4lZ7Z_A.js +1 -0
- package/dist/assets/MdxEditorPanel-Da_ceLFo.css +1 -0
- package/dist/assets/Mobile-B5V_-6Hc.css +1 -0
- package/dist/assets/Mobile-C7Hy-TIM.js +1 -0
- package/dist/assets/abnfDiagram-VRR7QNED-DYYppIQV.js +1 -0
- package/dist/assets/apl-B8ZmNFqK.js +1 -0
- package/dist/assets/arc-BT3um7r4.js +1 -0
- package/dist/assets/architectureDiagram-ZJ3FMSHR-uweBqnh-.js +1 -0
- package/dist/assets/asciiarmor-CIte6N-S.js +1 -0
- package/dist/assets/asn1-Ax1-z1nk.js +1 -0
- package/dist/assets/asterisk-CLHf-iRz.js +1 -0
- package/dist/assets/blockDiagram-677ZJIJ3-DzeI4GyV.js +1 -0
- package/dist/assets/brainfuck-CdLnmYpe.js +1 -0
- package/dist/assets/c4Diagram-LMCZKHZV-DBI0K7wS.js +1 -0
- package/dist/assets/channel-BrN6yx0e.js +1 -0
- package/dist/assets/chunk-2Q5K7J3B-DK9JA8Ct.js +1 -0
- package/dist/assets/chunk-32BRIVSS-VNg3Ylzs.js +1 -0
- package/dist/assets/chunk-5VM5RSS4-DFhufY9o.js +1 -0
- package/dist/assets/chunk-EX3LRPZG-B93MHNBT.js +1 -0
- package/dist/assets/chunk-JWPE2WC7-C54OW1iN.js +1 -0
- package/dist/assets/chunk-MOJQB5TN-lKhWWIDe.js +1 -0
- package/dist/assets/chunk-RYQCIY6F-BK2jDXwB.js +1 -0
- package/dist/assets/chunk-V7JOEXUC-aLHBmfOc.js +1 -0
- package/dist/assets/chunk-VR4S4FIN-Bomuor1h.js +1 -0
- package/dist/assets/chunk-XXDRQBXY-BPj05P7g.js +1 -0
- package/dist/assets/classDiagram-OUVF2IWQ-COm0X4uJ.js +1 -0
- package/dist/assets/classDiagram-v2-EOCWNBFH-COm0X4uJ.js +1 -0
- package/dist/assets/clike-BDgEuk0n.js +1 -0
- package/dist/assets/clojure-CrPxgQZl.js +1 -0
- package/dist/assets/cmake-BknZiLBu.js +1 -0
- package/dist/assets/cobol-DN1mHbgw.js +1 -0
- package/dist/assets/coffeescript-DTAwRC7M.js +1 -0
- package/dist/assets/commonlisp-B4DJ--Bo.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DU44QHSb.js +1 -0
- package/dist/assets/crystal-DoipYOOv.js +1 -0
- package/dist/assets/css-BeQRP3p5.js +1 -0
- package/dist/assets/cynefin-VYW2F7L2-C0dowxsF.js +15 -0
- package/dist/assets/cynefinDiagram-TSTJHNR4-C6vNWPUV.js +1 -0
- package/dist/assets/cypher-BzELKutH.js +1 -0
- package/dist/assets/cytoscape.esm-D0POlJZ1.js +9 -0
- package/dist/assets/d-Mh2Rawoc.js +1 -0
- package/dist/assets/dagre-VKFMJZFB-aLG4uEb-.js +1 -0
- package/dist/assets/defaultLocale-DZ7E7S9R.js +1 -0
- package/dist/assets/diagram-FQU43EPY-D5C8GfdU.js +1 -0
- package/dist/assets/diagram-G47NLZAW-C9tRw_xi.js +1 -0
- package/dist/assets/diagram-NH7WQ7WH-AYxTxwJ2.js +1 -0
- package/dist/assets/diagram-OA4YK3LP-BuBE5n9n.js +1 -0
- package/dist/assets/diagram-WEI45ONY-Cda7zYeO.js +1 -0
- package/dist/assets/diff-B1OtBbfz.js +1 -0
- package/dist/assets/dockerfile-Du7niAGi.js +1 -0
- package/dist/assets/dtd-So5hjSa8.js +1 -0
- package/dist/assets/dylan-Co15g-RX.js +1 -0
- package/dist/assets/ebnf-DWrAnno4.js +1 -0
- package/dist/assets/ebnfDiagram-CCIWWBDH-DC_OGyoh.js +1 -0
- package/dist/assets/ecl-8tbf0rUT.js +1 -0
- package/dist/assets/eiffel-BXtlUtEg.js +1 -0
- package/dist/assets/elm-BwiUluiH.js +1 -0
- package/dist/assets/erDiagram-Q63AITRT-D2G21PVY.js +1 -0
- package/dist/assets/erlang-CrHBLi-m.js +1 -0
- package/dist/assets/factor-C7nC06Ta.js +1 -0
- package/dist/assets/fcl-DKWfryFT.js +1 -0
- package/dist/assets/flowDiagram-23GEKE2U-CEQPYHrk.js +1 -0
- package/dist/assets/forth-Cg8ASoTj.js +1 -0
- package/dist/assets/fortran-BHf_qfFx.js +1 -0
- package/dist/assets/ganttDiagram-NO4QXBWP-JStxUtFR.js +1 -0
- package/dist/assets/gas-cj_2N_z1.js +1 -0
- package/dist/assets/gherkin-BiuTaH40.js +1 -0
- package/dist/assets/gitGraphDiagram-IHSO6WYX-BiojPH-V.js +1 -0
- package/dist/assets/graph-CnJdn47S.js +1 -0
- package/dist/assets/groovy-Bq8cXYUU.js +1 -0
- package/dist/assets/haskell-1ANuaeie.js +1 -0
- package/dist/assets/haxe-BUNSvWf_.js +1 -0
- package/dist/assets/html2canvas.esm-HFdlUwfn.js +20 -0
- package/dist/assets/http-DPC2IRQA.js +1 -0
- package/dist/assets/idl-DDbIciu_.js +1 -0
- package/dist/assets/index-BEyKG3O5.css +1 -0
- package/dist/assets/index-BduJoLQ5.js +1 -0
- package/dist/assets/index-BqwR8F0v.js +1 -0
- package/dist/assets/index-BsycQyrv.js +1 -0
- package/dist/assets/index-CFSDxZyA.js +1 -0
- package/dist/assets/index-CunNLTHc.js +1 -0
- package/dist/assets/index-OGkDFNTK.js +1 -0
- package/dist/assets/index-oxOyrL07.js +2 -0
- package/dist/assets/index-wvaycTGT.js +1 -0
- package/dist/assets/infoDiagram-FWYZ7A6U-Csl_aBIC.js +1 -0
- package/dist/assets/init-DMZMl1PR.js +1 -0
- package/dist/assets/ishikawaDiagram-FXEZZL3T-CjgGuMwr.js +1 -0
- package/dist/assets/javascript-Cet1BUca.js +1 -0
- package/dist/assets/journeyDiagram-5HDEW3XC-DUOy1PCq.js +1 -0
- package/dist/assets/jszip.min-BxIXdRg4.js +12 -0
- package/dist/assets/julia-CdxLCr68.js +1 -0
- package/dist/assets/kanban-definition-HUTT4EX6-Cx7GSrSj.js +1 -0
- package/dist/assets/katex-CfXf84Fz.js +1 -0
- package/dist/assets/layout-CCUE9ZRw.js +1 -0
- package/dist/assets/linear-GeBi6jJp.js +1 -0
- package/dist/assets/livescript-Bw1Vw7Ae.js +1 -0
- package/dist/assets/lua-DM1wbcnc.js +1 -0
- package/dist/assets/map-DQeg2hXV.js +1 -0
- package/dist/assets/mathematica-BXSv1_O1.js +1 -0
- package/dist/assets/mbox-CWY0keg3.js +1 -0
- package/dist/assets/mermaid.core-Cy9iVxov.js +7 -0
- package/dist/assets/mindmap-definition-LN4V7U3C-CUVxVkK5.js +1 -0
- package/dist/assets/mirc-CMLrLVMT.js +1 -0
- package/dist/assets/mllike-naqhAFf1.js +1 -0
- package/dist/assets/modelica-BvadsaHY.js +1 -0
- package/dist/assets/mscgen-DOr-Q10p.js +1 -0
- package/dist/assets/mumps-DKTl5Nyj.js +1 -0
- package/dist/assets/nginx-DWR90-d1.js +1 -0
- package/dist/assets/nsis-ooFGduGn.js +1 -0
- package/dist/assets/ntriples-q5jkU4X1.js +1 -0
- package/dist/assets/octave-Deu9Ci7_.js +1 -0
- package/dist/assets/orbiting-BCD4Vuij.svg +7 -0
- package/dist/assets/ordinal-DA-_8pMy.js +1 -0
- package/dist/assets/oz-cTQm1aoB.js +1 -0
- package/dist/assets/pascal-Oh3VmczP.js +1 -0
- package/dist/assets/pegDiagram-2B236MQR-BCF1byLY.js +1 -0
- package/dist/assets/perl-BddWF1HQ.js +1 -0
- package/dist/assets/pieDiagram-ENE6RG2P-D2cZTo8-.js +1 -0
- package/dist/assets/pig-g5ZQNIDr.js +1 -0
- package/dist/assets/powershell-CNmQNFVJ.js +1 -0
- package/dist/assets/properties-B41DXfv6.js +1 -0
- package/dist/assets/protobuf-eEBl31OJ.js +1 -0
- package/dist/assets/pug-DRSo4eCK.js +1 -0
- package/dist/assets/puppet-ClfRubAD.js +1 -0
- package/dist/assets/python-BSflc812.js +1 -0
- package/dist/assets/q-BBDx3N9Y.js +1 -0
- package/dist/assets/quadrantDiagram-ABIIQ3AL-Bwsn2--F.js +1 -0
- package/dist/assets/r-CByC1eO8.js +1 -0
- package/dist/assets/railroadDiagram-RFXS5EU6-CLGLpWHs.js +1 -0
- package/dist/assets/requirementDiagram-TGXJPOKE-BfmBYwZl.js +1 -0
- package/dist/assets/rpm-8t935XkD.js +1 -0
- package/dist/assets/ruby-CAgbkLZh.js +1 -0
- package/dist/assets/sankeyDiagram-HTMAVEWB-CqZhbyFn.js +1 -0
- package/dist/assets/sas-C-JWcRvo.js +1 -0
- package/dist/assets/scheme-D7o9RjUX.js +1 -0
- package/dist/assets/seqResourceLoaders-Bkh2Rb9i.js +2 -0
- package/dist/assets/seqResourceLoaders-Do7Kqg3B.css +41 -0
- package/dist/assets/sequenceDiagram-DBY2YBRQ-CcOdXkN2.js +1 -0
- package/dist/assets/shell-BXA79DV6.js +1 -0
- package/dist/assets/shimmer-BBDejmDf.svg +7 -0
- package/dist/assets/sieve-DNwyl0rd.js +1 -0
- package/dist/assets/simple-mode-CoQRusFX.js +1 -0
- package/dist/assets/sizeCapture-X5ZJPWSS-B4OVmPqu.js +1 -0
- package/dist/assets/smalltalk-DggktV6S.js +1 -0
- package/dist/assets/solr-D7NRuIPM.js +1 -0
- package/dist/assets/sparql-Cr71deJQ.js +1 -0
- package/dist/assets/spreadsheet-BMD3tYqw.js +1 -0
- package/dist/assets/sql-CbOjXfBR.js +1 -0
- package/dist/assets/stateDiagram-2N3HPSRC-Dysun0oO.js +1 -0
- package/dist/assets/stateDiagram-v2-6OUMAXLB-BFet8xAz.js +1 -0
- package/dist/assets/stex-iDPIkRmr.js +1 -0
- package/dist/assets/stylus-nWZizI-c.js +1 -0
- package/dist/assets/swift-DOhLK5SG.js +1 -0
- package/dist/assets/swimlanes-5IMT3BWC-_30OXwXy.js +2 -0
- package/dist/assets/swimlanesDiagram-G3AALYLV-C19viY0G.js +1 -0
- package/dist/assets/tcl-CQhJd1WY.js +1 -0
- package/dist/assets/textile-D9XqfVtL.js +1 -0
- package/dist/assets/tiddlywiki-DfOYgVky.js +1 -0
- package/dist/assets/tiki-a0_YLWvV.js +1 -0
- package/dist/assets/timeline-definition-FHXFAJF6-X1Xk3onD.js +1 -0
- package/dist/assets/toml-ekl3F1YB.js +1 -0
- package/dist/assets/troff-Bh_pcXF1.js +1 -0
- package/dist/assets/ttcn-M6363IRW.js +1 -0
- package/dist/assets/ttcn-cfg-7I2DgJEN.js +1 -0
- package/dist/assets/turtle-B5jdxH6D.js +1 -0
- package/dist/assets/vb-DM-xPmVv.js +1 -0
- package/dist/assets/vbscript-B0qu41Yc.js +1 -0
- package/dist/assets/velocity-FCgsuVHf.js +1 -0
- package/dist/assets/vendor-antd-Bzi1WuBb.js +17 -0
- package/dist/assets/vendor-codemirror-CKTrJd47.js +1 -0
- package/dist/assets/vendor-highlight-IFTJ9nxW.js +1 -0
- package/dist/assets/vendor-markdown-BN3QLsBu.js +3 -0
- package/dist/assets/vendor-mdxeditor-4PbKH6K7.js +2 -0
- package/dist/assets/vendor-qrcode-Bnjm0rcu.js +6 -0
- package/dist/assets/vendor-react-l0sNRNKZ.js +1 -0
- package/dist/assets/vendor-virtuoso-2P4SowHC.js +1 -0
- package/dist/assets/vendor-xterm-DckPrCx1.js +37 -0
- package/dist/assets/vennDiagram-L72KCM5P-D3fQnGq7.js +1 -0
- package/dist/assets/verilog-nrfFvR12.js +1 -0
- package/dist/assets/vhdl-WlDXtV-W.js +1 -0
- package/dist/assets/wardleyDiagram-EHGQE667-CRhqI6-g.js +1 -0
- package/dist/assets/webidl-RIQoSXDx.js +1 -0
- package/dist/assets/xquery-BN45G3lJ.js +1 -0
- package/dist/assets/xychartDiagram-FW5EYKEG-Cmtgmmtg.js +1 -0
- package/dist/assets/yacas-U6gaIVhD.js +1 -0
- package/dist/assets/z80-CFe5BHbK.js +1 -0
- package/dist/index.html +25 -6
- package/dist/voice-packs/default/A_choice_for_your_consideration_sir.MP3 +0 -0
- package/dist/voice-packs/default/It_is_done_sir.MP3 +0 -0
- package/dist/voice-packs/default/The_plan_awaits_your_approval_sir.MP3 +0 -0
- package/dist/voice-packs/default/pack.json +24 -0
- package/dist/voice-packs/sanguo/ask.MP3 +0 -0
- package/dist/voice-packs/sanguo/end.MP3 +0 -0
- package/dist/voice-packs/sanguo/pack.json +24 -0
- package/dist/voice-packs/sanguo/plan.MP3 +0 -0
- package/electron/diag.js +110 -0
- package/electron/main.js +1432 -0
- package/electron/menu-model.js +107 -0
- package/electron/tab-bar.html +575 -0
- package/electron/tab-content-preload.js +66 -0
- package/electron/tab-preload.js +24 -0
- package/electron/tab-worker.js +142 -0
- package/electron/window-state.js +60 -0
- package/electron/workspace-preload.js +19 -0
- package/findcx.js +4 -0
- package/i18n.js +3 -423
- package/index.html +30 -0
- package/interceptor.js +144 -70
- package/jsconfig.json +25 -0
- package/lib/approval-reviewer.js +23 -0
- package/lib/appserver-bridge.js +1753 -237
- package/lib/ask-bridge.js +5 -5
- package/lib/cli-args.js +1 -0
- package/lib/codex-config.js +157 -18
- package/lib/context-watcher.js +6 -65
- package/lib/delta-reconstructor.js +74 -52
- package/lib/ensure-hooks.js +37 -30
- package/lib/interceptor-core.js +490 -43
- package/lib/log-watcher.js +3 -8
- package/lib/main-agent-entry.js +68 -0
- package/lib/openai-body.js +95 -0
- package/lib/otel-adapter.js +3 -2
- package/lib/otel-receiver.js +1 -2
- package/lib/perm-bridge.js +84 -44
- package/lib/proxy-env.js +45 -1
- package/lib/sdk-adapter.js +241 -51
- package/lib/sdk-manager.js +523 -370
- package/lib/skills-api.js +364 -0
- package/lib/stats-worker.js +21 -21
- package/lib/token-usage.js +29 -0
- package/lib/updater.js +3 -7
- package/package.json +27 -6
- package/plugins/.gitkeep +0 -0
- package/plugins/README.md +8 -0
- package/proxy.js +187 -241
- package/pty-manager.js +17 -1
- package/public/favicon.ico +0 -0
- package/public/voice-packs/default/A_choice_for_your_consideration_sir.MP3 +0 -0
- package/public/voice-packs/default/It_is_done_sir.MP3 +0 -0
- package/public/voice-packs/default/The_plan_awaits_your_approval_sir.MP3 +0 -0
- package/public/voice-packs/default/pack.json +24 -0
- package/public/voice-packs/sanguo/ask.MP3 +0 -0
- package/public/voice-packs/sanguo/end.MP3 +0 -0
- package/public/voice-packs/sanguo/pack.json +24 -0
- package/public/voice-packs/sanguo/plan.MP3 +0 -0
- package/scripts/check-no-control-bytes.js +130 -0
- package/scripts/check-sign-config.sh +85 -0
- package/scripts/gen-default-voicepack.js +176 -0
- package/scripts/mac-sign.sh +47 -0
- package/scripts/npm-pack-dry-run.mjs +20 -0
- package/server/lib/approval-modal-prefs.js +72 -0
- package/server/lib/context-rules.js +70 -0
- package/server/lib/delta-reconstructor.js +403 -0
- package/server/lib/tools-xml-formatter.js +91 -0
- package/server/lib/voice-pack-events.js +79 -0
- package/server.js +420 -86
- package/src/App.jsx +638 -0
- package/src/App.module.css +1088 -0
- package/src/AppBase.jsx +2803 -0
- package/src/Mobile.jsx +1348 -0
- package/src/components/approval/ApprovalModal.jsx +319 -0
- package/src/components/approval/ApprovalModal.module.css +160 -0
- package/src/components/approval/ToolApprovalPanel.jsx +111 -0
- package/src/components/approval/ToolApprovalPanel.module.css +250 -0
- package/src/components/chat/ApprovalPortalContext.js +26 -0
- package/src/components/chat/AskQuestionForm.jsx +279 -0
- package/src/components/chat/AskTimeoutCountdown.jsx +113 -0
- package/src/components/chat/ChatInputBar.jsx +584 -0
- package/src/components/chat/ChatInputBar.module.css +656 -0
- package/src/components/chat/ChatMessage.jsx +1587 -0
- package/src/components/chat/ChatMessage.module.css +1560 -0
- package/src/components/chat/ChatView.jsx +3533 -0
- package/src/components/chat/ChatView.module.css +418 -0
- package/src/components/chat/DiffView.jsx +111 -0
- package/src/components/chat/DiffView.module.css +141 -0
- package/src/components/chat/RoleFilterBar.jsx +35 -0
- package/src/components/chat/RoleFilterBar.module.css +62 -0
- package/src/components/chat/controllers/askFlowController.js +789 -0
- package/src/components/chat/controllers/permissionController.js +84 -0
- package/src/components/chat/controllers/ptyPromptController.js +166 -0
- package/src/components/chat/controllers/scrollHighlightController.js +50 -0
- package/src/components/chat/controllers/splitDragController.js +135 -0
- package/src/components/chat/controllers/toolFileChangeController.js +216 -0
- package/src/components/chat/interactionOwnership.js +106 -0
- package/src/components/chat/uploadDeferLogic.js +46 -0
- package/src/components/common/ConceptHelp.jsx +97 -0
- package/src/components/common/ConceptHelp.module.css +151 -0
- package/src/components/common/ConfirmRemoveButton.jsx +78 -0
- package/src/components/common/CountryFlag.jsx +105 -0
- package/src/components/common/CountryFlag.module.css +36 -0
- package/src/components/common/DingTalkIcon.jsx +20 -0
- package/src/components/common/DiscordIcon.jsx +21 -0
- package/src/components/common/FeishuIcon.jsx +23 -0
- package/src/components/common/HoverPreviewTip.jsx +62 -0
- package/src/components/common/HoverPreviewTip.module.css +21 -0
- package/src/components/common/ImageLightbox.jsx +244 -0
- package/src/components/common/ImageLightbox.module.css +120 -0
- package/src/components/common/MemoryDetailModal.jsx +75 -0
- package/src/components/common/OpenFolderIcon.jsx +53 -0
- package/src/components/common/OpenFolderIcon.module.css +7 -0
- package/src/components/common/PanelResizer.jsx +48 -0
- package/src/components/common/PanelResizer.module.css +11 -0
- package/src/components/common/QuickAutoApproveRows.jsx +66 -0
- package/src/components/common/RefreshIcon.jsx +50 -0
- package/src/components/common/RefreshIcon.module.css +26 -0
- package/src/components/common/SnapLineOverlay.jsx +47 -0
- package/src/components/common/SnapLineOverlay.module.css +31 -0
- package/src/components/common/ToolsHelp.jsx +113 -0
- package/src/components/common/ToolsHelp.module.css +85 -0
- package/src/components/common/WeComIcon.jsx +22 -0
- package/src/components/common/quickMenuIcons.jsx +99 -0
- package/src/components/common/sharedChrome.module.css +274 -0
- package/src/components/dashboard/AppHeader.jsx +2085 -0
- package/src/components/dashboard/AppHeader.module.css +676 -0
- package/src/components/dashboard/CachePopoverContent.jsx +538 -0
- package/src/components/dashboard/CachePopoverContent.module.css +191 -0
- package/src/components/dashboard/ContextTab.jsx +769 -0
- package/src/components/dashboard/ContextTab.module.css +565 -0
- package/src/components/dashboard/DetailPanel.jsx +813 -0
- package/src/components/dashboard/DetailPanel.module.css +513 -0
- package/src/components/dashboard/LiveTagPopover.jsx +89 -0
- package/src/components/dashboard/LiveTagPopover.module.css +67 -0
- package/src/components/dashboard/RequestList.jsx +146 -0
- package/src/components/dashboard/RequestList.module.css +146 -0
- package/src/components/dashboard/TeamSessionPanel.jsx +584 -0
- package/src/components/dashboard/TeamSessionPanel.module.css +457 -0
- package/src/components/dashboard/UsageWindowPill.jsx +166 -0
- package/src/components/dashboard/UsageWindowPill.module.css +140 -0
- package/src/components/dashboard/WorkflowRunsPanel.jsx +108 -0
- package/src/components/dashboard/WorkflowRunsPanel.module.css +72 -0
- package/src/components/dashboard/WorkspaceList.jsx +410 -0
- package/src/components/dashboard/WorkspaceList.module.css +254 -0
- package/src/components/files/FileContentView.jsx +1013 -0
- package/src/components/files/FileContentView.module.css +418 -0
- package/src/components/files/FileExplorer.jsx +937 -0
- package/src/components/files/FileExplorer.module.css +173 -0
- package/src/components/files/MdxEditorPanel.base.css +9 -0
- package/src/components/files/MdxEditorPanel.jsx +181 -0
- package/src/components/files/MdxEditorPanel.module.css +917 -0
- package/src/components/git/DiffMiniMap.jsx +98 -0
- package/src/components/git/DiffMiniMap.module.css +17 -0
- package/src/components/git/FullFileDiffView.jsx +265 -0
- package/src/components/git/FullFileDiffView.module.css +176 -0
- package/src/components/git/GitChanges.jsx +461 -0
- package/src/components/git/GitChanges.module.css +337 -0
- package/src/components/git/GitDiffView.jsx +161 -0
- package/src/components/git/GitDiffView.module.css +205 -0
- package/src/components/mobile/MobileDrawerCloseButton.jsx +18 -0
- package/src/components/mobile/MobileFileExplorer.jsx +231 -0
- package/src/components/mobile/MobileFileExplorer.module.css +171 -0
- package/src/components/mobile/MobileGitDiff.jsx +293 -0
- package/src/components/mobile/MobileGitDiff.module.css +317 -0
- package/src/components/mobile/MobileStats.jsx +211 -0
- package/src/components/mobile/MobileStats.module.css +75 -0
- package/src/components/settings/ImAppendSystemModal.jsx +104 -0
- package/src/components/settings/ImConversationModal.jsx +328 -0
- package/src/components/settings/ImConversationModal.module.css +49 -0
- package/src/components/settings/ImPlatformSettings.jsx +453 -0
- package/src/components/settings/ImPlatformSettings.module.css +110 -0
- package/src/components/settings/ImSkillsModal.jsx +94 -0
- package/src/components/settings/ImStatusChip.jsx +80 -0
- package/src/components/settings/ImStatusChip.module.css +36 -0
- package/src/components/settings/MessagingModal.jsx +65 -0
- package/src/components/settings/MessagingModal.module.css +95 -0
- package/src/components/settings/ModelPromptTabs.jsx +118 -0
- package/src/components/settings/PluginModal.jsx +423 -0
- package/src/components/settings/PluginModal.module.css +136 -0
- package/src/components/settings/PreferencesForm.jsx +104 -0
- package/src/components/settings/PreferencesForm.module.css +27 -0
- package/src/components/settings/ProcessModal.jsx +175 -0
- package/src/components/settings/ProcessModal.module.css +21 -0
- package/src/components/settings/ProjectAliasEditor.jsx +138 -0
- package/src/components/settings/ProjectAliasEditor.module.css +87 -0
- package/src/components/settings/ProjectPrefsManagerModal.jsx +123 -0
- package/src/components/settings/ProjectPrefsManagerModal.module.css +52 -0
- package/src/components/settings/ProxyModal.jsx +286 -0
- package/src/components/settings/ProxyModal.module.css +141 -0
- package/src/components/settings/SkillsManagerModal.jsx +143 -0
- package/src/components/settings/SkillsManagerModal.module.css +143 -0
- package/src/components/settings/SystemTextModal.jsx +312 -0
- package/src/components/settings/SystemTextModal.module.css +331 -0
- package/src/components/settings/VoicePackSettings.jsx +319 -0
- package/src/components/settings/VoicePackSettings.module.css +151 -0
- package/src/components/settings/imPlatforms.js +177 -0
- package/src/components/terminal/CustomUltraplanEditModal.jsx +227 -0
- package/src/components/terminal/CustomUltraplanEditModal.module.css +189 -0
- package/src/components/terminal/PresetExpertPickerModal.jsx +116 -0
- package/src/components/terminal/PresetExpertPickerModal.module.css +90 -0
- package/src/components/terminal/PresetModal.jsx +118 -0
- package/src/components/terminal/ScratchTerminal.jsx +359 -0
- package/src/components/terminal/TerminalPanel.jsx +2021 -0
- package/src/components/terminal/TerminalPanel.module.css +872 -0
- package/src/components/terminal/TerminalWsContext.jsx +226 -0
- package/src/components/terminal/UltraPlanModal.jsx +328 -0
- package/src/components/terminal/UltraPlanModal.module.css +527 -0
- package/src/components/terminal/UltraplanExpertManagerModal.jsx +114 -0
- package/src/components/terminal/UltraplanExpertManagerModal.module.css +91 -0
- package/src/components/terminal/UltraplanPanel.jsx +307 -0
- package/src/components/terminal/UltraplanPanel.module.css +540 -0
- package/src/components/terminal/terminalThemes.js +33 -0
- package/src/components/viewers/ImageViewer.jsx +288 -0
- package/src/components/viewers/ImageViewer.module.css +203 -0
- package/src/components/viewers/JsonViewer.jsx +40 -0
- package/src/components/viewers/JsonViewer.module.css +9 -0
- package/src/components/viewers/LogTable.jsx +131 -0
- package/src/components/viewers/MarkdownBlock.jsx +112 -0
- package/src/components/viewers/MarkdownBlock.module.css +157 -0
- package/src/components/viewers/ToolResultView.jsx +389 -0
- package/src/components/viewers/ToolResultView.module.css +108 -0
- package/src/components/viewers/WebResultsView.jsx +74 -0
- package/src/components/viewers/WebResultsView.module.css +85 -0
- package/src/components/viewers/WorkflowLiveHud.jsx +153 -0
- package/src/components/viewers/WorkflowLiveHud.module.css +256 -0
- package/src/components/viewers/WorkflowPanel.jsx +243 -0
- package/src/components/viewers/WorkflowPanel.module.css +265 -0
- package/src/components/viewers/WorkflowTimeline.jsx +83 -0
- package/src/components/viewers/WorkflowTimeline.module.css +116 -0
- package/src/contexts/SettingsContext.jsx +140 -0
- package/src/env.js +54 -0
- package/src/global.css +607 -0
- package/src/hooks/useMarkdownExport.js +146 -0
- package/src/hooks/useMermaidRender.js +193 -0
- package/src/hooks/useProjectAlias.js +29 -0
- package/src/hooks/useSessionStoragePersistedSet.js +41 -0
- package/src/i18n/mdxTranslations.js +472 -0
- package/src/i18n.js +12409 -0
- package/src/img/ccv-logo.png +0 -0
- package/src/img/codex/entrance.svg +7 -0
- package/src/img/codex/exit.svg +7 -0
- package/src/img/codex/orbiting.svg +7 -0
- package/src/img/codex/shimmer.svg +7 -0
- package/src/img/codex/thinking.svg +7 -0
- package/src/img/codex/tickle.svg +7 -0
- package/src/img/codex/waiting.svg +7 -0
- package/src/img/codex/writing.svg +7 -0
- package/src/img/default-avatar.svg +1 -0
- package/src/img/default-model-avatar.svg +1 -0
- package/src/img/loading-pet.gif +0 -0
- package/src/img/model-codex.svg +2 -0
- package/src/img/model-deepseek.svg +2 -0
- package/src/img/model-gemini.svg +2 -0
- package/src/img/model-glm.svg +2 -0
- package/src/img/model-kimi.svg +2 -0
- package/src/img/model-minimax.svg +2 -0
- package/src/img/model-openai.svg +2 -0
- package/src/img/model-qwen.svg +2 -0
- package/src/img/teammates/DESIGN.md +165 -0
- package/src/img/teammates/analyst.svg +32 -0
- package/src/img/teammates/auditor.svg +28 -0
- package/src/img/teammates/builder.svg +33 -0
- package/src/img/teammates/default.svg +25 -0
- package/src/img/teammates/designer.svg +25 -0
- package/src/img/teammates/executor.svg +31 -0
- package/src/img/teammates/expert.svg +30 -0
- package/src/img/teammates/explorer.svg +30 -0
- package/src/img/teammates/implementer.svg +34 -0
- package/src/img/teammates/investigator.svg +29 -0
- package/src/img/teammates/marvel/analyst.svg +26 -0
- package/src/img/teammates/marvel/auditor.svg +28 -0
- package/src/img/teammates/marvel/builder.svg +15 -0
- package/src/img/teammates/marvel/default.svg +25 -0
- package/src/img/teammates/marvel/designer.svg +21 -0
- package/src/img/teammates/marvel/executor.svg +25 -0
- package/src/img/teammates/marvel/expert.svg +31 -0
- package/src/img/teammates/marvel/explorer.svg +22 -0
- package/src/img/teammates/marvel/implementer.svg +30 -0
- package/src/img/teammates/marvel/investigator.svg +21 -0
- package/src/img/teammates/marvel/researcher.svg +30 -0
- package/src/img/teammates/marvel/reviewer.svg +21 -0
- package/src/img/teammates/marvel/scanner.svg +23 -0
- package/src/img/teammates/marvel/security.svg +30 -0
- package/src/img/teammates/marvel/tracer.svg +19 -0
- package/src/img/teammates/marvel/translator.svg +24 -0
- package/src/img/teammates/marvel/worker.svg +16 -0
- package/src/img/teammates/researcher.svg +35 -0
- package/src/img/teammates/reviewer.svg +23 -0
- package/src/img/teammates/scanner.svg +31 -0
- package/src/img/teammates/security.svg +31 -0
- package/src/img/teammates/tracer.svg +30 -0
- package/src/img/teammates/translator.svg +32 -0
- package/src/img/teammates/worker.svg +29 -0
- package/src/main.jsx +30 -0
- package/src/tokenInterceptor.js +60 -0
- package/src/utils/apiUrl.js +26 -0
- package/src/utils/approvalReviewerOptions.js +27 -0
- package/src/utils/askFallback.js +21 -0
- package/src/utils/askOptionDesc.js +55 -0
- package/src/utils/askPortalMatcher.js +54 -0
- package/src/utils/autoApproveOptions.js +23 -0
- package/src/utils/avatarAnimationPostPass.js +46 -0
- package/src/utils/builtinPresets.js +18 -0
- package/src/utils/clearCheckpoint.js +154 -0
- package/src/utils/commandValidator.js +45 -0
- package/src/utils/contentFilter.js +675 -0
- package/src/utils/contextRaw.js +17 -0
- package/src/utils/contextSidebarNavigation.js +16 -0
- package/src/utils/conversationEntryNormalize.js +497 -0
- package/src/utils/displayScaleHelper.js +47 -0
- package/src/utils/entry-slim.js +594 -0
- package/src/utils/entryCache.js +179 -0
- package/src/utils/errorReport.js +40 -0
- package/src/utils/fileExpandedPathsStorage.js +70 -0
- package/src/utils/fileIcons.jsx +36 -0
- package/src/utils/fileOpen.js +37 -0
- package/src/utils/formatters.js +48 -0
- package/src/utils/gitApi.js +50 -0
- package/src/utils/gitTreeBuilder.js +19 -0
- package/src/utils/helpers.js +462 -0
- package/src/utils/identityHeal.js +83 -0
- package/src/utils/imOrigin.js +24 -0
- package/src/utils/imTr.js +7 -0
- package/src/utils/imageCompress.js +83 -0
- package/src/utils/imageDownscale.js +28 -0
- package/src/utils/imageResize.js +112 -0
- package/src/utils/ingestPipeline.js +47 -0
- package/src/utils/lazyWithReload.js +53 -0
- package/src/utils/markdown.js +30 -0
- package/src/utils/markdownIncremental.js +39 -0
- package/src/utils/markdownProfiler.js +113 -0
- package/src/utils/mdExtensionDetect.js +64 -0
- package/src/utils/memoryLinkParser.js +44 -0
- package/src/utils/modalMask.js +15 -0
- package/src/utils/monotime.js +6 -0
- package/src/utils/pinnedMenu.js +55 -0
- package/src/utils/presetShortcuts.js +14 -0
- package/src/utils/projectAlias.js +135 -0
- package/src/utils/promptClassifier.js +111 -0
- package/src/utils/promptDetect.js +196 -0
- package/src/utils/promptNav.js +60 -0
- package/src/utils/ptyChunkBuilder.js +251 -0
- package/src/utils/quickMenuHoverIntent.js +35 -0
- package/src/utils/rateLimitParser.js +249 -0
- package/src/utils/readResultPool.js +106 -0
- package/src/utils/refreshCachedItemProp.js +32 -0
- package/src/utils/requestTools.js +19 -0
- package/src/utils/requestType.js +284 -0
- package/src/utils/resizeCalc.js +21 -0
- package/src/utils/resolveLocalized.js +17 -0
- package/src/utils/seqResourceLoaders.js +79 -0
- package/src/utils/sessionManager.js +694 -0
- package/src/utils/sessionMerge.js +290 -0
- package/src/utils/skillModalController.js +111 -0
- package/src/utils/skillsParser.js +116 -0
- package/src/utils/slashCommandLabels.js +80 -0
- package/src/utils/splitDragCalc.js +73 -0
- package/src/utils/stickyBottomController.js +643 -0
- package/src/utils/svgSanitize.js +48 -0
- package/src/utils/systemTags.js +47 -0
- package/src/utils/tCodex.js +20 -0
- package/src/utils/teamModalBuilder.js +347 -0
- package/src/utils/teamSessionParser.js +186 -0
- package/src/utils/teammateAvatars.js +194 -0
- package/src/utils/teammateDetector.js +106 -0
- package/src/utils/termDiag.js +114 -0
- package/src/utils/terminalClipboard.js +117 -0
- package/src/utils/terminalWriteQueue.js +398 -0
- package/src/utils/thinkingMerge.js +49 -0
- package/src/utils/tokenUsage.js +1 -0
- package/src/utils/toolCatalog.js +31 -0
- package/src/utils/toolNameAliases.js +13 -0
- package/src/utils/toolResultBuilder.js +312 -0
- package/src/utils/toolResultClassifier.js +16 -0
- package/src/utils/toolResultCore.js +161 -0
- package/src/utils/toolsDiff.js +44 -0
- package/src/utils/toolsXmlFormatter.js +3 -0
- package/src/utils/ultraplanController.js +109 -0
- package/src/utils/ultraplanExperts.js +86 -0
- package/src/utils/ultraplanTemplates.js +152 -0
- package/src/utils/userImageRefs.js +49 -0
- package/src/utils/voicePackPlayer.js +233 -0
- package/src/utils/webResultGrouping.js +111 -0
- package/src/utils/workflowFormat.js +52 -0
- package/src/utils/workflowRuns.js +118 -0
- package/src/utils/workflowStore.js +94 -0
- package/vite.config.js +106 -0
- package/concepts/ar/CacheRebuild.md +0 -36
- package/concepts/ar/KVCacheContent.md +0 -49
- package/concepts/ar/Tool-Agent.md +0 -125
- package/concepts/ar/Tool-AskUserQuestion.md +0 -75
- package/concepts/ar/Tool-Bash.md +0 -167
- package/concepts/ar/Tool-Edit.md +0 -46
- package/concepts/ar/Tool-EnterPlanMode.md +0 -128
- package/concepts/ar/Tool-EnterWorktree.md +0 -56
- package/concepts/ar/Tool-ExitPlanMode.md +0 -62
- package/concepts/ar/Tool-Glob.md +0 -39
- package/concepts/ar/Tool-Grep.md +0 -57
- package/concepts/ar/Tool-NotebookEdit.md +0 -33
- package/concepts/ar/Tool-Read.md +0 -56
- package/concepts/ar/Tool-SendMessage.md +0 -41
- package/concepts/ar/Tool-Skill.md +0 -56
- package/concepts/ar/Tool-Task.md +0 -51
- package/concepts/ar/Tool-TaskCreate.md +0 -78
- package/concepts/ar/Tool-TaskGet.md +0 -56
- package/concepts/ar/Tool-TaskList.md +0 -56
- package/concepts/ar/Tool-TaskOutput.md +0 -40
- package/concepts/ar/Tool-TaskStop.md +0 -32
- package/concepts/ar/Tool-TaskUpdate.md +0 -123
- package/concepts/ar/Tool-TeamCreate.md +0 -38
- package/concepts/ar/Tool-TeamDelete.md +0 -30
- package/concepts/ar/Tool-WebFetch.md +0 -55
- package/concepts/ar/Tool-WebSearch.md +0 -58
- package/concepts/ar/Tool-Write.md +0 -39
- package/concepts/ar/Tool-executeCode.md +0 -41
- package/concepts/ar/Tool-getDiagnostics.md +0 -32
- package/concepts/ar/Tools.md +0 -67
- package/concepts/da/CacheRebuild.md +0 -36
- package/concepts/da/KVCacheContent.md +0 -49
- package/concepts/da/Tool-Agent.md +0 -125
- package/concepts/da/Tool-AskUserQuestion.md +0 -75
- package/concepts/da/Tool-Bash.md +0 -167
- package/concepts/da/Tool-Edit.md +0 -46
- package/concepts/da/Tool-EnterPlanMode.md +0 -128
- package/concepts/da/Tool-EnterWorktree.md +0 -56
- package/concepts/da/Tool-ExitPlanMode.md +0 -62
- package/concepts/da/Tool-Glob.md +0 -39
- package/concepts/da/Tool-Grep.md +0 -57
- package/concepts/da/Tool-NotebookEdit.md +0 -33
- package/concepts/da/Tool-Read.md +0 -56
- package/concepts/da/Tool-SendMessage.md +0 -41
- package/concepts/da/Tool-Skill.md +0 -56
- package/concepts/da/Tool-Task.md +0 -51
- package/concepts/da/Tool-TaskCreate.md +0 -78
- package/concepts/da/Tool-TaskGet.md +0 -56
- package/concepts/da/Tool-TaskList.md +0 -56
- package/concepts/da/Tool-TaskOutput.md +0 -40
- package/concepts/da/Tool-TaskStop.md +0 -32
- package/concepts/da/Tool-TaskUpdate.md +0 -123
- package/concepts/da/Tool-TeamCreate.md +0 -38
- package/concepts/da/Tool-TeamDelete.md +0 -30
- package/concepts/da/Tool-WebFetch.md +0 -55
- package/concepts/da/Tool-WebSearch.md +0 -58
- package/concepts/da/Tool-Write.md +0 -39
- package/concepts/da/Tool-executeCode.md +0 -41
- package/concepts/da/Tool-getDiagnostics.md +0 -32
- package/concepts/da/Tools.md +0 -67
- package/concepts/de/CacheRebuild.md +0 -36
- package/concepts/de/KVCacheContent.md +0 -49
- package/concepts/de/Tool-Agent.md +0 -125
- package/concepts/de/Tool-AskUserQuestion.md +0 -75
- package/concepts/de/Tool-Bash.md +0 -167
- package/concepts/de/Tool-Edit.md +0 -46
- package/concepts/de/Tool-EnterPlanMode.md +0 -128
- package/concepts/de/Tool-EnterWorktree.md +0 -56
- package/concepts/de/Tool-ExitPlanMode.md +0 -62
- package/concepts/de/Tool-Glob.md +0 -39
- package/concepts/de/Tool-Grep.md +0 -57
- package/concepts/de/Tool-NotebookEdit.md +0 -33
- package/concepts/de/Tool-Read.md +0 -56
- package/concepts/de/Tool-SendMessage.md +0 -41
- package/concepts/de/Tool-Skill.md +0 -56
- package/concepts/de/Tool-Task.md +0 -51
- package/concepts/de/Tool-TaskCreate.md +0 -78
- package/concepts/de/Tool-TaskGet.md +0 -56
- package/concepts/de/Tool-TaskList.md +0 -56
- package/concepts/de/Tool-TaskOutput.md +0 -40
- package/concepts/de/Tool-TaskStop.md +0 -32
- package/concepts/de/Tool-TaskUpdate.md +0 -123
- package/concepts/de/Tool-TeamCreate.md +0 -38
- package/concepts/de/Tool-TeamDelete.md +0 -30
- package/concepts/de/Tool-WebFetch.md +0 -55
- package/concepts/de/Tool-WebSearch.md +0 -58
- package/concepts/de/Tool-Write.md +0 -39
- package/concepts/de/Tool-executeCode.md +0 -41
- package/concepts/de/Tool-getDiagnostics.md +0 -32
- package/concepts/de/Tools.md +0 -67
- package/concepts/en/CacheRebuild.md +0 -36
- package/concepts/en/KVCacheContent.md +0 -49
- package/concepts/en/Tool-Agent.md +0 -125
- package/concepts/en/Tool-AskUserQuestion.md +0 -75
- package/concepts/en/Tool-Bash.md +0 -167
- package/concepts/en/Tool-Edit.md +0 -46
- package/concepts/en/Tool-EnterPlanMode.md +0 -128
- package/concepts/en/Tool-EnterWorktree.md +0 -56
- package/concepts/en/Tool-ExitPlanMode.md +0 -62
- package/concepts/en/Tool-Glob.md +0 -39
- package/concepts/en/Tool-Grep.md +0 -57
- package/concepts/en/Tool-NotebookEdit.md +0 -33
- package/concepts/en/Tool-Read.md +0 -56
- package/concepts/en/Tool-SendMessage.md +0 -41
- package/concepts/en/Tool-Skill.md +0 -56
- package/concepts/en/Tool-Task.md +0 -51
- package/concepts/en/Tool-TaskCreate.md +0 -78
- package/concepts/en/Tool-TaskGet.md +0 -56
- package/concepts/en/Tool-TaskList.md +0 -56
- package/concepts/en/Tool-TaskOutput.md +0 -40
- package/concepts/en/Tool-TaskStop.md +0 -32
- package/concepts/en/Tool-TaskUpdate.md +0 -123
- package/concepts/en/Tool-TeamCreate.md +0 -38
- package/concepts/en/Tool-TeamDelete.md +0 -30
- package/concepts/en/Tool-WebFetch.md +0 -55
- package/concepts/en/Tool-WebSearch.md +0 -58
- package/concepts/en/Tool-Write.md +0 -39
- package/concepts/en/Tool-executeCode.md +0 -41
- package/concepts/en/Tool-getDiagnostics.md +0 -32
- package/concepts/es/CacheRebuild.md +0 -36
- package/concepts/es/KVCacheContent.md +0 -49
- package/concepts/es/Tool-Agent.md +0 -125
- package/concepts/es/Tool-AskUserQuestion.md +0 -75
- package/concepts/es/Tool-Bash.md +0 -167
- package/concepts/es/Tool-Edit.md +0 -46
- package/concepts/es/Tool-EnterPlanMode.md +0 -128
- package/concepts/es/Tool-EnterWorktree.md +0 -56
- package/concepts/es/Tool-ExitPlanMode.md +0 -62
- package/concepts/es/Tool-Glob.md +0 -39
- package/concepts/es/Tool-Grep.md +0 -57
- package/concepts/es/Tool-NotebookEdit.md +0 -33
- package/concepts/es/Tool-Read.md +0 -56
- package/concepts/es/Tool-SendMessage.md +0 -41
- package/concepts/es/Tool-Skill.md +0 -56
- package/concepts/es/Tool-Task.md +0 -51
- package/concepts/es/Tool-TaskCreate.md +0 -78
- package/concepts/es/Tool-TaskGet.md +0 -56
- package/concepts/es/Tool-TaskList.md +0 -56
- package/concepts/es/Tool-TaskOutput.md +0 -40
- package/concepts/es/Tool-TaskStop.md +0 -32
- package/concepts/es/Tool-TaskUpdate.md +0 -123
- package/concepts/es/Tool-TeamCreate.md +0 -38
- package/concepts/es/Tool-TeamDelete.md +0 -30
- package/concepts/es/Tool-WebFetch.md +0 -55
- package/concepts/es/Tool-WebSearch.md +0 -58
- package/concepts/es/Tool-Write.md +0 -39
- package/concepts/es/Tool-executeCode.md +0 -41
- package/concepts/es/Tool-getDiagnostics.md +0 -32
- package/concepts/es/Tools.md +0 -67
- package/concepts/fr/CacheRebuild.md +0 -36
- package/concepts/fr/KVCacheContent.md +0 -49
- package/concepts/fr/Tool-Agent.md +0 -125
- package/concepts/fr/Tool-AskUserQuestion.md +0 -75
- package/concepts/fr/Tool-Bash.md +0 -167
- package/concepts/fr/Tool-Edit.md +0 -46
- package/concepts/fr/Tool-EnterPlanMode.md +0 -128
- package/concepts/fr/Tool-EnterWorktree.md +0 -56
- package/concepts/fr/Tool-ExitPlanMode.md +0 -62
- package/concepts/fr/Tool-Glob.md +0 -39
- package/concepts/fr/Tool-Grep.md +0 -57
- package/concepts/fr/Tool-NotebookEdit.md +0 -33
- package/concepts/fr/Tool-Read.md +0 -56
- package/concepts/fr/Tool-SendMessage.md +0 -41
- package/concepts/fr/Tool-Skill.md +0 -56
- package/concepts/fr/Tool-Task.md +0 -51
- package/concepts/fr/Tool-TaskCreate.md +0 -78
- package/concepts/fr/Tool-TaskGet.md +0 -56
- package/concepts/fr/Tool-TaskList.md +0 -56
- package/concepts/fr/Tool-TaskOutput.md +0 -40
- package/concepts/fr/Tool-TaskStop.md +0 -32
- package/concepts/fr/Tool-TaskUpdate.md +0 -123
- package/concepts/fr/Tool-TeamCreate.md +0 -38
- package/concepts/fr/Tool-TeamDelete.md +0 -30
- package/concepts/fr/Tool-WebFetch.md +0 -55
- package/concepts/fr/Tool-WebSearch.md +0 -58
- package/concepts/fr/Tool-Write.md +0 -39
- package/concepts/fr/Tool-executeCode.md +0 -41
- package/concepts/fr/Tool-getDiagnostics.md +0 -32
- package/concepts/fr/Tools.md +0 -67
- package/concepts/it/CacheRebuild.md +0 -36
- package/concepts/it/KVCacheContent.md +0 -49
- package/concepts/it/Tool-Agent.md +0 -125
- package/concepts/it/Tool-AskUserQuestion.md +0 -75
- package/concepts/it/Tool-Bash.md +0 -167
- package/concepts/it/Tool-Edit.md +0 -46
- package/concepts/it/Tool-EnterPlanMode.md +0 -128
- package/concepts/it/Tool-EnterWorktree.md +0 -56
- package/concepts/it/Tool-ExitPlanMode.md +0 -62
- package/concepts/it/Tool-Glob.md +0 -39
- package/concepts/it/Tool-Grep.md +0 -57
- package/concepts/it/Tool-NotebookEdit.md +0 -33
- package/concepts/it/Tool-Read.md +0 -56
- package/concepts/it/Tool-SendMessage.md +0 -41
- package/concepts/it/Tool-Skill.md +0 -56
- package/concepts/it/Tool-Task.md +0 -51
- package/concepts/it/Tool-TaskCreate.md +0 -78
- package/concepts/it/Tool-TaskGet.md +0 -56
- package/concepts/it/Tool-TaskList.md +0 -56
- package/concepts/it/Tool-TaskOutput.md +0 -40
- package/concepts/it/Tool-TaskStop.md +0 -32
- package/concepts/it/Tool-TaskUpdate.md +0 -123
- package/concepts/it/Tool-TeamCreate.md +0 -38
- package/concepts/it/Tool-TeamDelete.md +0 -30
- package/concepts/it/Tool-WebFetch.md +0 -55
- package/concepts/it/Tool-WebSearch.md +0 -58
- package/concepts/it/Tool-Write.md +0 -39
- package/concepts/it/Tool-executeCode.md +0 -41
- package/concepts/it/Tool-getDiagnostics.md +0 -32
- package/concepts/it/Tools.md +0 -67
- package/concepts/ja/CacheRebuild.md +0 -36
- package/concepts/ja/KVCacheContent.md +0 -49
- package/concepts/ja/Tool-Agent.md +0 -125
- package/concepts/ja/Tool-AskUserQuestion.md +0 -75
- package/concepts/ja/Tool-Bash.md +0 -167
- package/concepts/ja/Tool-Edit.md +0 -46
- package/concepts/ja/Tool-EnterPlanMode.md +0 -128
- package/concepts/ja/Tool-EnterWorktree.md +0 -56
- package/concepts/ja/Tool-ExitPlanMode.md +0 -62
- package/concepts/ja/Tool-Glob.md +0 -39
- package/concepts/ja/Tool-Grep.md +0 -57
- package/concepts/ja/Tool-NotebookEdit.md +0 -33
- package/concepts/ja/Tool-Read.md +0 -56
- package/concepts/ja/Tool-SendMessage.md +0 -41
- package/concepts/ja/Tool-Skill.md +0 -56
- package/concepts/ja/Tool-Task.md +0 -51
- package/concepts/ja/Tool-TaskCreate.md +0 -78
- package/concepts/ja/Tool-TaskGet.md +0 -56
- package/concepts/ja/Tool-TaskList.md +0 -56
- package/concepts/ja/Tool-TaskOutput.md +0 -40
- package/concepts/ja/Tool-TaskStop.md +0 -32
- package/concepts/ja/Tool-TaskUpdate.md +0 -123
- package/concepts/ja/Tool-TeamCreate.md +0 -38
- package/concepts/ja/Tool-TeamDelete.md +0 -30
- package/concepts/ja/Tool-WebFetch.md +0 -55
- package/concepts/ja/Tool-WebSearch.md +0 -58
- package/concepts/ja/Tool-Write.md +0 -39
- package/concepts/ja/Tool-executeCode.md +0 -41
- package/concepts/ja/Tool-getDiagnostics.md +0 -32
- package/concepts/ja/Tools.md +0 -67
- package/concepts/ko/CacheRebuild.md +0 -36
- package/concepts/ko/KVCacheContent.md +0 -49
- package/concepts/ko/Tool-Agent.md +0 -125
- package/concepts/ko/Tool-AskUserQuestion.md +0 -75
- package/concepts/ko/Tool-Bash.md +0 -167
- package/concepts/ko/Tool-Edit.md +0 -46
- package/concepts/ko/Tool-EnterPlanMode.md +0 -128
- package/concepts/ko/Tool-EnterWorktree.md +0 -56
- package/concepts/ko/Tool-ExitPlanMode.md +0 -62
- package/concepts/ko/Tool-Glob.md +0 -39
- package/concepts/ko/Tool-Grep.md +0 -57
- package/concepts/ko/Tool-NotebookEdit.md +0 -33
- package/concepts/ko/Tool-Read.md +0 -56
- package/concepts/ko/Tool-SendMessage.md +0 -41
- package/concepts/ko/Tool-Skill.md +0 -56
- package/concepts/ko/Tool-Task.md +0 -51
- package/concepts/ko/Tool-TaskCreate.md +0 -78
- package/concepts/ko/Tool-TaskGet.md +0 -56
- package/concepts/ko/Tool-TaskList.md +0 -56
- package/concepts/ko/Tool-TaskOutput.md +0 -40
- package/concepts/ko/Tool-TaskStop.md +0 -32
- package/concepts/ko/Tool-TaskUpdate.md +0 -123
- package/concepts/ko/Tool-TeamCreate.md +0 -38
- package/concepts/ko/Tool-TeamDelete.md +0 -30
- package/concepts/ko/Tool-WebFetch.md +0 -55
- package/concepts/ko/Tool-WebSearch.md +0 -58
- package/concepts/ko/Tool-Write.md +0 -39
- package/concepts/ko/Tool-executeCode.md +0 -41
- package/concepts/ko/Tool-getDiagnostics.md +0 -32
- package/concepts/ko/Tools.md +0 -67
- package/concepts/no/CacheRebuild.md +0 -36
- package/concepts/no/KVCacheContent.md +0 -49
- package/concepts/no/Tool-Agent.md +0 -125
- package/concepts/no/Tool-AskUserQuestion.md +0 -75
- package/concepts/no/Tool-Bash.md +0 -167
- package/concepts/no/Tool-Edit.md +0 -46
- package/concepts/no/Tool-EnterPlanMode.md +0 -128
- package/concepts/no/Tool-EnterWorktree.md +0 -56
- package/concepts/no/Tool-ExitPlanMode.md +0 -62
- package/concepts/no/Tool-Glob.md +0 -39
- package/concepts/no/Tool-Grep.md +0 -57
- package/concepts/no/Tool-NotebookEdit.md +0 -33
- package/concepts/no/Tool-Read.md +0 -56
- package/concepts/no/Tool-SendMessage.md +0 -41
- package/concepts/no/Tool-Skill.md +0 -56
- package/concepts/no/Tool-Task.md +0 -51
- package/concepts/no/Tool-TaskCreate.md +0 -78
- package/concepts/no/Tool-TaskGet.md +0 -56
- package/concepts/no/Tool-TaskList.md +0 -56
- package/concepts/no/Tool-TaskOutput.md +0 -40
- package/concepts/no/Tool-TaskStop.md +0 -32
- package/concepts/no/Tool-TaskUpdate.md +0 -123
- package/concepts/no/Tool-TeamCreate.md +0 -38
- package/concepts/no/Tool-TeamDelete.md +0 -30
- package/concepts/no/Tool-WebFetch.md +0 -55
- package/concepts/no/Tool-WebSearch.md +0 -58
- package/concepts/no/Tool-Write.md +0 -39
- package/concepts/no/Tool-executeCode.md +0 -41
- package/concepts/no/Tool-getDiagnostics.md +0 -32
- package/concepts/no/Tools.md +0 -67
- package/concepts/pl/CacheRebuild.md +0 -36
- package/concepts/pl/KVCacheContent.md +0 -49
- package/concepts/pl/Tool-Agent.md +0 -125
- package/concepts/pl/Tool-AskUserQuestion.md +0 -75
- package/concepts/pl/Tool-Bash.md +0 -167
- package/concepts/pl/Tool-Edit.md +0 -46
- package/concepts/pl/Tool-EnterPlanMode.md +0 -128
- package/concepts/pl/Tool-EnterWorktree.md +0 -56
- package/concepts/pl/Tool-ExitPlanMode.md +0 -62
- package/concepts/pl/Tool-Glob.md +0 -39
- package/concepts/pl/Tool-Grep.md +0 -57
- package/concepts/pl/Tool-NotebookEdit.md +0 -33
- package/concepts/pl/Tool-Read.md +0 -56
- package/concepts/pl/Tool-SendMessage.md +0 -41
- package/concepts/pl/Tool-Skill.md +0 -56
- package/concepts/pl/Tool-Task.md +0 -51
- package/concepts/pl/Tool-TaskCreate.md +0 -78
- package/concepts/pl/Tool-TaskGet.md +0 -56
- package/concepts/pl/Tool-TaskList.md +0 -56
- package/concepts/pl/Tool-TaskOutput.md +0 -40
- package/concepts/pl/Tool-TaskStop.md +0 -32
- package/concepts/pl/Tool-TaskUpdate.md +0 -123
- package/concepts/pl/Tool-TeamCreate.md +0 -38
- package/concepts/pl/Tool-TeamDelete.md +0 -30
- package/concepts/pl/Tool-WebFetch.md +0 -55
- package/concepts/pl/Tool-WebSearch.md +0 -58
- package/concepts/pl/Tool-Write.md +0 -39
- package/concepts/pl/Tool-executeCode.md +0 -41
- package/concepts/pl/Tool-getDiagnostics.md +0 -32
- package/concepts/pl/Tools.md +0 -67
- package/concepts/pt-BR/CacheRebuild.md +0 -36
- package/concepts/pt-BR/KVCacheContent.md +0 -49
- package/concepts/pt-BR/Tool-Agent.md +0 -125
- package/concepts/pt-BR/Tool-AskUserQuestion.md +0 -75
- package/concepts/pt-BR/Tool-Bash.md +0 -167
- package/concepts/pt-BR/Tool-Edit.md +0 -46
- package/concepts/pt-BR/Tool-EnterPlanMode.md +0 -128
- package/concepts/pt-BR/Tool-EnterWorktree.md +0 -56
- package/concepts/pt-BR/Tool-ExitPlanMode.md +0 -62
- package/concepts/pt-BR/Tool-Glob.md +0 -39
- package/concepts/pt-BR/Tool-Grep.md +0 -57
- package/concepts/pt-BR/Tool-NotebookEdit.md +0 -33
- package/concepts/pt-BR/Tool-Read.md +0 -56
- package/concepts/pt-BR/Tool-SendMessage.md +0 -41
- package/concepts/pt-BR/Tool-Skill.md +0 -56
- package/concepts/pt-BR/Tool-Task.md +0 -51
- package/concepts/pt-BR/Tool-TaskCreate.md +0 -78
- package/concepts/pt-BR/Tool-TaskGet.md +0 -56
- package/concepts/pt-BR/Tool-TaskList.md +0 -56
- package/concepts/pt-BR/Tool-TaskOutput.md +0 -40
- package/concepts/pt-BR/Tool-TaskStop.md +0 -32
- package/concepts/pt-BR/Tool-TaskUpdate.md +0 -123
- package/concepts/pt-BR/Tool-TeamCreate.md +0 -38
- package/concepts/pt-BR/Tool-TeamDelete.md +0 -30
- package/concepts/pt-BR/Tool-WebFetch.md +0 -55
- package/concepts/pt-BR/Tool-WebSearch.md +0 -58
- package/concepts/pt-BR/Tool-Write.md +0 -39
- package/concepts/pt-BR/Tool-executeCode.md +0 -41
- package/concepts/pt-BR/Tool-getDiagnostics.md +0 -32
- package/concepts/pt-BR/Tools.md +0 -67
- package/concepts/ru/CacheRebuild.md +0 -36
- package/concepts/ru/KVCacheContent.md +0 -49
- package/concepts/ru/Tool-Agent.md +0 -125
- package/concepts/ru/Tool-AskUserQuestion.md +0 -75
- package/concepts/ru/Tool-Bash.md +0 -167
- package/concepts/ru/Tool-Edit.md +0 -46
- package/concepts/ru/Tool-EnterPlanMode.md +0 -128
- package/concepts/ru/Tool-EnterWorktree.md +0 -56
- package/concepts/ru/Tool-ExitPlanMode.md +0 -62
- package/concepts/ru/Tool-Glob.md +0 -39
- package/concepts/ru/Tool-Grep.md +0 -57
- package/concepts/ru/Tool-NotebookEdit.md +0 -33
- package/concepts/ru/Tool-Read.md +0 -56
- package/concepts/ru/Tool-SendMessage.md +0 -41
- package/concepts/ru/Tool-Skill.md +0 -56
- package/concepts/ru/Tool-Task.md +0 -51
- package/concepts/ru/Tool-TaskCreate.md +0 -78
- package/concepts/ru/Tool-TaskGet.md +0 -56
- package/concepts/ru/Tool-TaskList.md +0 -56
- package/concepts/ru/Tool-TaskOutput.md +0 -40
- package/concepts/ru/Tool-TaskStop.md +0 -32
- package/concepts/ru/Tool-TaskUpdate.md +0 -123
- package/concepts/ru/Tool-TeamCreate.md +0 -38
- package/concepts/ru/Tool-TeamDelete.md +0 -30
- package/concepts/ru/Tool-WebFetch.md +0 -55
- package/concepts/ru/Tool-WebSearch.md +0 -58
- package/concepts/ru/Tool-Write.md +0 -39
- package/concepts/ru/Tool-executeCode.md +0 -41
- package/concepts/ru/Tool-getDiagnostics.md +0 -32
- package/concepts/ru/Tools.md +0 -67
- package/concepts/th/CacheRebuild.md +0 -36
- package/concepts/th/KVCacheContent.md +0 -49
- package/concepts/th/Tool-Agent.md +0 -125
- package/concepts/th/Tool-AskUserQuestion.md +0 -75
- package/concepts/th/Tool-Bash.md +0 -167
- package/concepts/th/Tool-Edit.md +0 -46
- package/concepts/th/Tool-EnterPlanMode.md +0 -128
- package/concepts/th/Tool-EnterWorktree.md +0 -56
- package/concepts/th/Tool-ExitPlanMode.md +0 -62
- package/concepts/th/Tool-Glob.md +0 -39
- package/concepts/th/Tool-Grep.md +0 -57
- package/concepts/th/Tool-NotebookEdit.md +0 -33
- package/concepts/th/Tool-Read.md +0 -56
- package/concepts/th/Tool-SendMessage.md +0 -41
- package/concepts/th/Tool-Skill.md +0 -56
- package/concepts/th/Tool-Task.md +0 -51
- package/concepts/th/Tool-TaskCreate.md +0 -78
- package/concepts/th/Tool-TaskGet.md +0 -56
- package/concepts/th/Tool-TaskList.md +0 -56
- package/concepts/th/Tool-TaskOutput.md +0 -40
- package/concepts/th/Tool-TaskStop.md +0 -32
- package/concepts/th/Tool-TaskUpdate.md +0 -123
- package/concepts/th/Tool-TeamCreate.md +0 -38
- package/concepts/th/Tool-TeamDelete.md +0 -30
- package/concepts/th/Tool-WebFetch.md +0 -55
- package/concepts/th/Tool-WebSearch.md +0 -58
- package/concepts/th/Tool-Write.md +0 -39
- package/concepts/th/Tool-executeCode.md +0 -41
- package/concepts/th/Tool-getDiagnostics.md +0 -32
- package/concepts/th/Tools.md +0 -67
- package/concepts/tr/CacheRebuild.md +0 -36
- package/concepts/tr/KVCacheContent.md +0 -49
- package/concepts/tr/Tool-Agent.md +0 -125
- package/concepts/tr/Tool-AskUserQuestion.md +0 -75
- package/concepts/tr/Tool-Bash.md +0 -167
- package/concepts/tr/Tool-Edit.md +0 -46
- package/concepts/tr/Tool-EnterPlanMode.md +0 -128
- package/concepts/tr/Tool-EnterWorktree.md +0 -56
- package/concepts/tr/Tool-ExitPlanMode.md +0 -62
- package/concepts/tr/Tool-Glob.md +0 -39
- package/concepts/tr/Tool-Grep.md +0 -57
- package/concepts/tr/Tool-NotebookEdit.md +0 -33
- package/concepts/tr/Tool-Read.md +0 -56
- package/concepts/tr/Tool-SendMessage.md +0 -41
- package/concepts/tr/Tool-Skill.md +0 -56
- package/concepts/tr/Tool-Task.md +0 -51
- package/concepts/tr/Tool-TaskCreate.md +0 -78
- package/concepts/tr/Tool-TaskGet.md +0 -56
- package/concepts/tr/Tool-TaskList.md +0 -56
- package/concepts/tr/Tool-TaskOutput.md +0 -40
- package/concepts/tr/Tool-TaskStop.md +0 -32
- package/concepts/tr/Tool-TaskUpdate.md +0 -123
- package/concepts/tr/Tool-TeamCreate.md +0 -38
- package/concepts/tr/Tool-TeamDelete.md +0 -30
- package/concepts/tr/Tool-WebFetch.md +0 -55
- package/concepts/tr/Tool-WebSearch.md +0 -58
- package/concepts/tr/Tool-Write.md +0 -39
- package/concepts/tr/Tool-executeCode.md +0 -41
- package/concepts/tr/Tool-getDiagnostics.md +0 -32
- package/concepts/tr/Tools.md +0 -67
- package/concepts/uk/CacheRebuild.md +0 -36
- package/concepts/uk/KVCacheContent.md +0 -49
- package/concepts/uk/Tool-Agent.md +0 -125
- package/concepts/uk/Tool-AskUserQuestion.md +0 -75
- package/concepts/uk/Tool-Bash.md +0 -167
- package/concepts/uk/Tool-Edit.md +0 -46
- package/concepts/uk/Tool-EnterPlanMode.md +0 -128
- package/concepts/uk/Tool-EnterWorktree.md +0 -56
- package/concepts/uk/Tool-ExitPlanMode.md +0 -62
- package/concepts/uk/Tool-Glob.md +0 -39
- package/concepts/uk/Tool-Grep.md +0 -57
- package/concepts/uk/Tool-NotebookEdit.md +0 -33
- package/concepts/uk/Tool-Read.md +0 -56
- package/concepts/uk/Tool-SendMessage.md +0 -41
- package/concepts/uk/Tool-Skill.md +0 -56
- package/concepts/uk/Tool-Task.md +0 -51
- package/concepts/uk/Tool-TaskCreate.md +0 -78
- package/concepts/uk/Tool-TaskGet.md +0 -56
- package/concepts/uk/Tool-TaskList.md +0 -56
- package/concepts/uk/Tool-TaskOutput.md +0 -40
- package/concepts/uk/Tool-TaskStop.md +0 -32
- package/concepts/uk/Tool-TaskUpdate.md +0 -123
- package/concepts/uk/Tool-TeamCreate.md +0 -38
- package/concepts/uk/Tool-TeamDelete.md +0 -30
- package/concepts/uk/Tool-WebFetch.md +0 -55
- package/concepts/uk/Tool-WebSearch.md +0 -58
- package/concepts/uk/Tool-Write.md +0 -39
- package/concepts/uk/Tool-executeCode.md +0 -41
- package/concepts/uk/Tool-getDiagnostics.md +0 -32
- package/concepts/uk/Tools.md +0 -67
- package/concepts/zh/CacheRebuild.md +0 -36
- package/concepts/zh/KVCacheContent.md +0 -49
- package/concepts/zh/Tool-Agent.md +0 -125
- package/concepts/zh/Tool-AskUserQuestion.md +0 -75
- package/concepts/zh/Tool-Bash.md +0 -167
- package/concepts/zh/Tool-Edit.md +0 -46
- package/concepts/zh/Tool-EnterPlanMode.md +0 -128
- package/concepts/zh/Tool-EnterWorktree.md +0 -56
- package/concepts/zh/Tool-ExitPlanMode.md +0 -62
- package/concepts/zh/Tool-Glob.md +0 -39
- package/concepts/zh/Tool-Grep.md +0 -57
- package/concepts/zh/Tool-NotebookEdit.md +0 -33
- package/concepts/zh/Tool-Read.md +0 -56
- package/concepts/zh/Tool-SendMessage.md +0 -41
- package/concepts/zh/Tool-Skill.md +0 -56
- package/concepts/zh/Tool-Task.md +0 -51
- package/concepts/zh/Tool-TaskCreate.md +0 -78
- package/concepts/zh/Tool-TaskGet.md +0 -56
- package/concepts/zh/Tool-TaskList.md +0 -56
- package/concepts/zh/Tool-TaskOutput.md +0 -40
- package/concepts/zh/Tool-TaskStop.md +0 -32
- package/concepts/zh/Tool-TaskUpdate.md +0 -123
- package/concepts/zh/Tool-TeamCreate.md +0 -38
- package/concepts/zh/Tool-TeamDelete.md +0 -30
- package/concepts/zh/Tool-WebFetch.md +0 -55
- package/concepts/zh/Tool-WebSearch.md +0 -58
- package/concepts/zh/Tool-Write.md +0 -39
- package/concepts/zh/Tool-executeCode.md +0 -41
- package/concepts/zh/Tool-getDiagnostics.md +0 -32
- package/concepts/zh-TW/CacheRebuild.md +0 -36
- package/concepts/zh-TW/KVCacheContent.md +0 -49
- package/concepts/zh-TW/Tool-Agent.md +0 -125
- package/concepts/zh-TW/Tool-AskUserQuestion.md +0 -75
- package/concepts/zh-TW/Tool-Bash.md +0 -167
- package/concepts/zh-TW/Tool-Edit.md +0 -46
- package/concepts/zh-TW/Tool-EnterPlanMode.md +0 -128
- package/concepts/zh-TW/Tool-EnterWorktree.md +0 -56
- package/concepts/zh-TW/Tool-ExitPlanMode.md +0 -62
- package/concepts/zh-TW/Tool-Glob.md +0 -39
- package/concepts/zh-TW/Tool-Grep.md +0 -57
- package/concepts/zh-TW/Tool-NotebookEdit.md +0 -33
- package/concepts/zh-TW/Tool-Read.md +0 -56
- package/concepts/zh-TW/Tool-SendMessage.md +0 -41
- package/concepts/zh-TW/Tool-Skill.md +0 -56
- package/concepts/zh-TW/Tool-Task.md +0 -51
- package/concepts/zh-TW/Tool-TaskCreate.md +0 -78
- package/concepts/zh-TW/Tool-TaskGet.md +0 -56
- package/concepts/zh-TW/Tool-TaskList.md +0 -56
- package/concepts/zh-TW/Tool-TaskOutput.md +0 -40
- package/concepts/zh-TW/Tool-TaskStop.md +0 -32
- package/concepts/zh-TW/Tool-TaskUpdate.md +0 -123
- package/concepts/zh-TW/Tool-TeamCreate.md +0 -38
- package/concepts/zh-TW/Tool-TeamDelete.md +0 -30
- package/concepts/zh-TW/Tool-WebFetch.md +0 -55
- package/concepts/zh-TW/Tool-WebSearch.md +0 -58
- package/concepts/zh-TW/Tool-Write.md +0 -39
- package/concepts/zh-TW/Tool-executeCode.md +0 -41
- package/concepts/zh-TW/Tool-getDiagnostics.md +0 -32
- package/concepts/zh-TW/Tools.md +0 -67
- package/dist/assets/App-BN2YmKSu.js +0 -41
- package/dist/assets/App-fG2r3jFq.css +0 -1
- package/dist/assets/AppHeader-BqUGBbBx.css +0 -41
- package/dist/assets/AppHeader.module-CvH9GQQ2.js +0 -1250
- package/dist/assets/Mobile-BnDkLcBv.css +0 -1
- package/dist/assets/Mobile-CbC8YD3O.js +0 -10
- package/dist/assets/_baseUniq-B2ddYY2A.js +0 -1
- package/dist/assets/arc-DFPOHgcd.js +0 -1
- package/dist/assets/architectureDiagram-Q4EWVU46-1tuXixQv.js +0 -36
- package/dist/assets/blockDiagram-DXYQGD6D-BfVKQPAV.js +0 -132
- package/dist/assets/c4Diagram-AHTNJAMY-Bua8O4-1.js +0 -10
- package/dist/assets/channel-Cf9uPxYW.js +0 -1
- package/dist/assets/chunk-4BX2VUAB-YOIkSNn_.js +0 -1
- package/dist/assets/chunk-4TB4RGXK-CjZt-To5.js +0 -206
- package/dist/assets/chunk-55IACEB6-BAEfMF5S.js +0 -1
- package/dist/assets/chunk-EDXVE4YY-BUYDmLXU.js +0 -1
- package/dist/assets/chunk-FMBD7UC4-Cw_LDap-.js +0 -15
- package/dist/assets/chunk-OYMX7WX6-PlfZFFxd.js +0 -231
- package/dist/assets/chunk-QZHKN3VN-C2ReFZl_.js +0 -1
- package/dist/assets/chunk-YZCP3GAM-B7IVGkPB.js +0 -1
- package/dist/assets/classDiagram-6PBFFD2Q-DdwVeNLZ.js +0 -1
- package/dist/assets/classDiagram-v2-HSJHXN6E-DdwVeNLZ.js +0 -1
- package/dist/assets/clone-C8Lz0121.js +0 -1
- package/dist/assets/cose-bilkent-S5V4N54A-M6rBKf0y.js +0 -1
- package/dist/assets/cytoscape.esm-DxGcaOPV.js +0 -331
- package/dist/assets/dagre-KV5264BT-UPacTWnL.js +0 -4
- package/dist/assets/defaultLocale-DX6XiGOO.js +0 -1
- package/dist/assets/diagram-5BDNPKRD-Cjjtnh0e.js +0 -10
- package/dist/assets/diagram-G4DWMVQ6-CjXILMP0.js +0 -24
- package/dist/assets/diagram-MMDJMWI5-C_-XZ9gc.js +0 -43
- package/dist/assets/diagram-TYMM5635-Dxe2GxUR.js +0 -24
- package/dist/assets/erDiagram-SMLLAGMA-1w-wtgMd.js +0 -85
- package/dist/assets/flowDiagram-DWJPFMVM-B9naMGCj.js +0 -162
- package/dist/assets/ganttDiagram-T4ZO3ILL-BPZBdhPv.js +0 -292
- package/dist/assets/gitGraphDiagram-UUTBAWPF-_P9PdiGG.js +0 -106
- package/dist/assets/graph-CjOY8lRz.js +0 -1
- package/dist/assets/html2canvas.esm-QH1iLAAe.js +0 -22
- package/dist/assets/index-BcCW9op4.js +0 -41
- package/dist/assets/index-DCtZ2KSX.css +0 -1
- package/dist/assets/infoDiagram-42DDH7IO-Ch8SOTtq.js +0 -2
- package/dist/assets/init-Gi6I4Gst.js +0 -1
- package/dist/assets/ishikawaDiagram-UXIWVN3A-XLscQrJT.js +0 -70
- package/dist/assets/journeyDiagram-VCZTEJTY-C3FQ_QPk.js +0 -139
- package/dist/assets/kanban-definition-6JOO6SKY-DIQDTOi3.js +0 -89
- package/dist/assets/katex-DkKDou_j.js +0 -257
- package/dist/assets/layout-DO9W0X_b.js +0 -1
- package/dist/assets/linear-ClCJqwn1.js +0 -1
- package/dist/assets/mermaid.core-BW02B1TS.js +0 -308
- package/dist/assets/min-BuzClhio.js +0 -1
- package/dist/assets/mindmap-definition-QFDTVHPH-DuCaTeZu.js +0 -96
- package/dist/assets/ordinal-Cboi1Yqb.js +0 -1
- package/dist/assets/pieDiagram-DEJITSTG-BZoZ6CI1.js +0 -30
- package/dist/assets/quadrantDiagram-34T5L4WZ-DFNwvtmc.js +0 -7
- package/dist/assets/requirementDiagram-MS252O5E-DPG-7raV.js +0 -84
- package/dist/assets/sankeyDiagram-XADWPNL6-Bp92e1ie.js +0 -10
- package/dist/assets/sequenceDiagram-FGHM5R23-C6ADwqJY.js +0 -157
- package/dist/assets/stateDiagram-FHFEXIEX-BfrwZGmF.js +0 -1
- package/dist/assets/stateDiagram-v2-QKLJ7IA2-4gBW7EPI.js +0 -1
- package/dist/assets/timeline-definition-GMOUNBTQ-Bb-TxYx2.js +0 -120
- package/dist/assets/vennDiagram-DHZGUBPP-DTRiNXJu.js +0 -34
- package/dist/assets/wardley-RL74JXVD-C8j_kjXS.js +0 -162
- package/dist/assets/wardleyDiagram-NUSXRM2D-CvICMc3N.js +0 -20
- package/dist/assets/xychartDiagram-5P7HB3ND-DI0bBGwq.js +0 -7
- package/lib/kv-cache-analyzer.js +0 -164
package/lib/sdk-manager.js
CHANGED
|
@@ -1,472 +1,453 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* sdk-manager.js
|
|
2
|
+
* sdk-manager.js - Codex SDK session lifecycle manager.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* - canUseTool callback for AskUserQuestion + permission approval
|
|
7
|
-
* - Streaming status tracking
|
|
8
|
-
* - Multi-turn conversation via session resume
|
|
9
|
-
* - Completed-entry fallback when a turn only exposes final assistant text via stream events
|
|
4
|
+
* Uses the official @openai/codex-sdk event stream:
|
|
5
|
+
* Codex -> Thread -> runStreamed() -> thread/item/turn events.
|
|
10
6
|
*/
|
|
11
7
|
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
import {
|
|
9
|
+
DEFAULT_CODEX_TOOLS,
|
|
10
|
+
buildStreamingStatus,
|
|
11
|
+
isSdkToolItem,
|
|
12
|
+
sdkItemToAssistantBlock,
|
|
13
|
+
sdkItemToToolUseBlock,
|
|
14
|
+
sdkToJSONLEntry,
|
|
15
|
+
sdkToolName,
|
|
16
|
+
sdkToolOutput,
|
|
17
|
+
} from './sdk-adapter.js';
|
|
18
|
+
import { startProxy, stopProxy } from '../proxy.js';
|
|
19
|
+
|
|
20
|
+
let _Codex = null;
|
|
21
|
+
let _sdkImportError = null;
|
|
15
22
|
try {
|
|
16
|
-
const sdk = await import('@openai/codex');
|
|
17
|
-
|
|
23
|
+
const sdk = await import('@openai/codex-sdk');
|
|
24
|
+
_Codex = sdk.Codex;
|
|
18
25
|
} catch (err) {
|
|
26
|
+
_sdkImportError = err;
|
|
19
27
|
console.warn('[SDK] Codex SDK not available:', err.message);
|
|
20
28
|
}
|
|
21
29
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// Session state
|
|
30
|
+
let _codex = null;
|
|
31
|
+
let _thread = null;
|
|
26
32
|
let _sessionId = null;
|
|
27
33
|
let _model = null;
|
|
28
34
|
let _cwd = null;
|
|
29
35
|
let _projectName = null;
|
|
30
|
-
let
|
|
31
|
-
let
|
|
32
|
-
let
|
|
33
|
-
let
|
|
34
|
-
let _sdkTools = null; // real tools list from SDKSystemMessage
|
|
36
|
+
let _codexPath = null;
|
|
37
|
+
let _codexOptions = {};
|
|
38
|
+
let _threadOptions = {};
|
|
39
|
+
let _initialPrompt = null;
|
|
35
40
|
|
|
36
|
-
|
|
41
|
+
let _accumulatedMessages = [];
|
|
42
|
+
let _queryBusy = false;
|
|
43
|
+
let _messageQueue = [];
|
|
44
|
+
let _abortController = null;
|
|
37
45
|
let _turnTimestamp = null;
|
|
38
|
-
|
|
39
|
-
// Streaming accumulation state
|
|
40
|
-
let _streamingContent = [];
|
|
41
|
-
let _currentBlockData = null;
|
|
46
|
+
let _turnStartTime = null;
|
|
42
47
|
let _streamingRequestId = null;
|
|
48
|
+
let _streamingChunkCount = 0;
|
|
43
49
|
let _streamThrottleTimer = null;
|
|
44
|
-
let
|
|
45
|
-
let
|
|
50
|
+
let _pendingAssistantContent = [];
|
|
51
|
+
let _currentItems = new Map();
|
|
52
|
+
let _itemOrder = [];
|
|
53
|
+
let _completedToolIds = new Set();
|
|
46
54
|
let _finalEntryEmittedThisTurn = false;
|
|
47
55
|
|
|
48
|
-
// Callbacks registered by server.js
|
|
49
56
|
let _onEntry = null;
|
|
50
57
|
let _onStreamingStatus = null;
|
|
58
|
+
let _onStreamProgress = null;
|
|
51
59
|
let _broadcastWs = null;
|
|
60
|
+
let _sdkProxyPort = null;
|
|
61
|
+
let _sdkProxyPromise = null;
|
|
52
62
|
|
|
53
|
-
// Pending canUseTool promises: id → { resolve }
|
|
54
63
|
const _pendingApprovals = new Map();
|
|
55
64
|
|
|
56
|
-
// Message queue for messages sent while a query is running
|
|
57
|
-
let _messageQueue = [];
|
|
58
|
-
|
|
59
65
|
export function isSdkAvailable() {
|
|
60
|
-
return typeof
|
|
66
|
+
return typeof _Codex === 'function';
|
|
61
67
|
}
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export function
|
|
69
|
+
export function getSdkUnavailableReason() {
|
|
70
|
+
return _sdkImportError?.message || null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function getInitialPrompt() {
|
|
74
|
+
return _initialPrompt;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function initSdkSession(cwd, projectName, {
|
|
78
|
+
onEntry,
|
|
79
|
+
onStreamingStatus,
|
|
80
|
+
onStreamProgress,
|
|
81
|
+
broadcastWs,
|
|
82
|
+
permissionMode,
|
|
83
|
+
codexPath,
|
|
84
|
+
codexArgs = [],
|
|
85
|
+
} = {}) {
|
|
68
86
|
_cwd = cwd;
|
|
69
87
|
_projectName = projectName;
|
|
70
88
|
_onEntry = onEntry;
|
|
71
89
|
_onStreamingStatus = onStreamingStatus;
|
|
90
|
+
_onStreamProgress = onStreamProgress;
|
|
72
91
|
_broadcastWs = broadcastWs;
|
|
73
|
-
|
|
74
|
-
|
|
92
|
+
_codexPath = codexPath || null;
|
|
93
|
+
|
|
94
|
+
const parsed = parseSdkCodexArgs(codexArgs);
|
|
95
|
+
_codexOptions = parsed.codexOptions;
|
|
96
|
+
_threadOptions = {
|
|
97
|
+
workingDirectory: cwd,
|
|
98
|
+
skipGitRepoCheck: true,
|
|
99
|
+
...parsed.threadOptions,
|
|
100
|
+
};
|
|
101
|
+
if (permissionMode === 'bypassPermissions') {
|
|
102
|
+
_threadOptions.approvalPolicy = 'never';
|
|
103
|
+
_threadOptions.sandboxMode = 'danger-full-access';
|
|
104
|
+
}
|
|
105
|
+
_model = _threadOptions.model || null;
|
|
106
|
+
_initialPrompt = parsed.initialPrompt || null;
|
|
107
|
+
|
|
108
|
+
_resetFullState({ keepConfig: true });
|
|
109
|
+
_sessionId = parsed.resumeThreadId || null;
|
|
110
|
+
|
|
111
|
+
// 启动本地代理以拦截 SDK 模式下的真实 API 调用
|
|
112
|
+
if (_sdkProxyPort === null && !_sdkProxyPromise) {
|
|
113
|
+
const proxyPromise = startProxy().then(port => {
|
|
114
|
+
if (_sdkProxyPromise !== proxyPromise) {
|
|
115
|
+
stopProxy();
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
_sdkProxyPort = port;
|
|
119
|
+
return port;
|
|
120
|
+
}).catch(err => {
|
|
121
|
+
console.warn('[SDK] Failed to start proxy:', err.message);
|
|
122
|
+
}).finally(() => {
|
|
123
|
+
if (_sdkProxyPromise === proxyPromise) _sdkProxyPromise = null;
|
|
124
|
+
});
|
|
125
|
+
_sdkProxyPromise = proxyPromise;
|
|
126
|
+
}
|
|
75
127
|
}
|
|
76
128
|
|
|
77
|
-
/**
|
|
78
|
-
* Send a user message. Starts a new query (or resumes existing session).
|
|
79
|
-
* Queues the message if a query is already running.
|
|
80
|
-
*/
|
|
81
129
|
export async function sendUserMessage(text) {
|
|
82
|
-
if (!
|
|
130
|
+
if (!_Codex) throw new Error(`Codex SDK not available${_sdkImportError ? `: ${_sdkImportError.message}` : ''}`);
|
|
131
|
+
if (!text || !String(text).trim()) return;
|
|
83
132
|
|
|
84
|
-
// If a query is already running, queue this message and return
|
|
85
133
|
if (_queryBusy) {
|
|
86
|
-
_messageQueue.push(text);
|
|
134
|
+
_messageQueue.push(String(text));
|
|
87
135
|
return;
|
|
88
136
|
}
|
|
89
137
|
|
|
90
138
|
_queryBusy = true;
|
|
91
|
-
|
|
92
139
|
try {
|
|
93
|
-
await
|
|
94
|
-
|
|
95
|
-
// Process any queued messages
|
|
140
|
+
await _executeTurn(String(text));
|
|
96
141
|
while (_messageQueue.length > 0) {
|
|
97
142
|
const next = _messageQueue.shift();
|
|
98
|
-
await
|
|
143
|
+
await _executeTurn(next);
|
|
99
144
|
}
|
|
100
145
|
} finally {
|
|
101
146
|
_queryBusy = false;
|
|
102
147
|
}
|
|
103
148
|
}
|
|
104
149
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
*/
|
|
108
|
-
async function _executeQuery(text) {
|
|
109
|
-
// Generate stable timestamp for this turn — all entries share it for dedup
|
|
150
|
+
async function _executeTurn(text) {
|
|
151
|
+
_resetTurnState();
|
|
110
152
|
_turnTimestamp = new Date().toISOString();
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
_pendingFinalRequestMessages = null;
|
|
114
|
-
_finalEntryEmittedThisTurn = false;
|
|
153
|
+
_turnStartTime = Date.now();
|
|
154
|
+
_streamingRequestId = `sdk_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
115
155
|
|
|
116
|
-
// Accumulate user message BEFORE creating entries (this is the request)
|
|
117
156
|
_accumulatedMessages.push({ role: 'user', content: text });
|
|
118
157
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
158
|
+
if (!_codex) {
|
|
159
|
+
_codex = new _Codex({
|
|
160
|
+
..._codexOptions,
|
|
161
|
+
...(_codexPath ? { codexPathOverride: _codexPath } : {}),
|
|
162
|
+
env: {
|
|
163
|
+
...process.env,
|
|
164
|
+
CXV_SDK_MODE: '1',
|
|
165
|
+
CXV_PROJECT_DIR: _cwd,
|
|
166
|
+
...(_sdkProxyPort ? { OPENAI_BASE_URL: `http://127.0.0.1:${_sdkProxyPort}` } : {}),
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (!_thread) {
|
|
171
|
+
_thread = _sessionId
|
|
172
|
+
? _codex.resumeThread(_sessionId, _threadOptions)
|
|
173
|
+
: _codex.startThread(_threadOptions);
|
|
129
174
|
}
|
|
130
175
|
|
|
131
|
-
|
|
176
|
+
_abortController = new AbortController();
|
|
177
|
+
_sendStreamingStatus(true);
|
|
132
178
|
|
|
133
179
|
try {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
_processMessage(msg);
|
|
180
|
+
const streamed = await _thread.runStreamed(text, { signal: _abortController.signal });
|
|
181
|
+
for await (const event of streamed.events) {
|
|
182
|
+
_processEvent(event);
|
|
138
183
|
}
|
|
139
184
|
} catch (err) {
|
|
140
|
-
if (err
|
|
141
|
-
|
|
185
|
+
if (err?.name === 'AbortError') {
|
|
186
|
+
_emitErrorEntry('Turn interrupted');
|
|
187
|
+
} else {
|
|
188
|
+
console.error('[SDK] runStreamed error:', err.message);
|
|
189
|
+
_emitErrorEntry(err.message || String(err));
|
|
142
190
|
}
|
|
143
191
|
} finally {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
192
|
+
_flushStreamProgress();
|
|
193
|
+
_clearStreamThrottle();
|
|
194
|
+
_abortController = null;
|
|
195
|
+
_sendStreamingStatus(false);
|
|
147
196
|
}
|
|
148
197
|
}
|
|
149
198
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if (msg.session_id) _sessionId = msg.session_id;
|
|
157
|
-
if (msg.model) _model = msg.model;
|
|
158
|
-
// Capture real tools from init message (tools is string[], convert to {name} format)
|
|
159
|
-
if (msg.subtype === 'init') {
|
|
160
|
-
if (Array.isArray(msg.tools)) _sdkTools = msg.tools.map(name => ({ name }));
|
|
161
|
-
}
|
|
162
|
-
// Handle compact boundary: reset accumulated messages since SDK compacted internally
|
|
163
|
-
if (msg.subtype === 'compact_boundary') {
|
|
164
|
-
_accumulatedMessages = [];
|
|
165
|
-
}
|
|
199
|
+
function _processEvent(event) {
|
|
200
|
+
if (!event || typeof event !== 'object') return;
|
|
201
|
+
|
|
202
|
+
switch (event.type) {
|
|
203
|
+
case 'thread.started':
|
|
204
|
+
_sessionId = event.thread_id || _sessionId;
|
|
166
205
|
break;
|
|
167
206
|
|
|
168
|
-
case '
|
|
169
|
-
|
|
170
|
-
if (!msg.parent_tool_use_id && msg.message) {
|
|
171
|
-
_resetStreamingState();
|
|
172
|
-
_pendingFinalContent = null;
|
|
173
|
-
_pendingFinalRequestMessages = null;
|
|
174
|
-
|
|
175
|
-
// Snapshot messages BEFORE adding assistant (body.messages = request history, unfiltered)
|
|
176
|
-
const requestMessages = [..._accumulatedMessages];
|
|
177
|
-
|
|
178
|
-
// Accumulate the assistant response for future turns
|
|
179
|
-
// Merge with previous if both are assistant (same API turn, multiple content blocks)
|
|
180
|
-
const lastMsg = _accumulatedMessages[_accumulatedMessages.length - 1];
|
|
181
|
-
if (lastMsg && lastMsg.role === 'assistant' && Array.isArray(lastMsg.content) && Array.isArray(msg.message.content)) {
|
|
182
|
-
lastMsg.content = [...lastMsg.content, ...msg.message.content];
|
|
183
|
-
} else {
|
|
184
|
-
_accumulatedMessages.push({ role: 'assistant', content: msg.message.content });
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
// Only filter interactive tools from the RESPONSE content (Last Response rendering),
|
|
188
|
-
// NOT from body.messages (history) — filtering history creates orphaned tool_results
|
|
189
|
-
const filteredContent = _filterInteractiveContent(msg.message.content);
|
|
190
|
-
const displayMsg = { ...msg, message: { ...msg.message, content: filteredContent } };
|
|
191
|
-
|
|
192
|
-
// Convert to JSONL entry with stable turn timestamp and real SDK metadata
|
|
193
|
-
const entry = sdkToJSONLEntry(displayMsg, requestMessages, _model, _projectName, {
|
|
194
|
-
timestamp: _turnTimestamp,
|
|
195
|
-
tools: _sdkTools,
|
|
196
|
-
});
|
|
197
|
-
if (_onEntry) _onEntry(entry);
|
|
198
|
-
_finalEntryEmittedThisTurn = true;
|
|
199
|
-
}
|
|
200
|
-
if (msg.session_id) _sessionId = msg.session_id;
|
|
207
|
+
case 'turn.started':
|
|
208
|
+
_sendStreamingStatus(true);
|
|
201
209
|
break;
|
|
202
210
|
|
|
203
|
-
case '
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
const lastUserMsg = _accumulatedMessages[_accumulatedMessages.length - 1];
|
|
208
|
-
if (lastUserMsg && lastUserMsg.role === 'user' && Array.isArray(lastUserMsg.content) && Array.isArray(msg.message.content)) {
|
|
209
|
-
lastUserMsg.content = [...lastUserMsg.content, ...msg.message.content];
|
|
210
|
-
} else {
|
|
211
|
-
_accumulatedMessages.push({ role: 'user', content: msg.message.content });
|
|
212
|
-
}
|
|
213
|
-
}
|
|
211
|
+
case 'item.started':
|
|
212
|
+
case 'item.updated':
|
|
213
|
+
_upsertItem(event.item);
|
|
214
|
+
_scheduleStreamProgress();
|
|
214
215
|
break;
|
|
215
216
|
|
|
216
|
-
case '
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
if (!msg.parent_tool_use_id) {
|
|
221
|
-
_processStreamEvent(msg.event);
|
|
222
|
-
}
|
|
217
|
+
case 'item.completed':
|
|
218
|
+
_upsertItem(event.item);
|
|
219
|
+
_handleCompletedItem(event.item);
|
|
220
|
+
_scheduleStreamProgress();
|
|
223
221
|
break;
|
|
224
222
|
|
|
225
|
-
case '
|
|
226
|
-
|
|
227
|
-
_emitCompletedEntryFromStream();
|
|
228
|
-
}
|
|
229
|
-
if (msg.session_id) _sessionId = msg.session_id;
|
|
230
|
-
if (_onStreamingStatus) _onStreamingStatus(buildStreamingStatus(false));
|
|
223
|
+
case 'turn.completed':
|
|
224
|
+
_emitCompletedEntry(event.usage);
|
|
231
225
|
break;
|
|
232
226
|
|
|
233
|
-
|
|
227
|
+
case 'turn.failed':
|
|
228
|
+
_emitErrorEntry(event.error?.message || 'Codex turn failed');
|
|
229
|
+
break;
|
|
230
|
+
|
|
231
|
+
case 'error':
|
|
232
|
+
_emitErrorEntry(event.message || 'Codex SDK error');
|
|
234
233
|
break;
|
|
235
234
|
}
|
|
236
235
|
}
|
|
237
236
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
? content.filter(b => b.type !== 'tool_use' || !INTERACTIVE_TOOLS.has(b.name))
|
|
244
|
-
: content;
|
|
237
|
+
function _upsertItem(item) {
|
|
238
|
+
if (!item || typeof item !== 'object') return;
|
|
239
|
+
const id = item.id || `${item.type || 'item'}_${_itemOrder.length}`;
|
|
240
|
+
if (!_currentItems.has(id)) _itemOrder.push(id);
|
|
241
|
+
_currentItems.set(id, { ...item, id });
|
|
245
242
|
}
|
|
246
243
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
if (!event) return;
|
|
253
|
-
const type = event.type;
|
|
254
|
-
|
|
255
|
-
if (type === 'message_start') {
|
|
256
|
-
_streamingContent = [];
|
|
257
|
-
_currentBlockData = null;
|
|
258
|
-
} else if (type === 'content_block_start') {
|
|
259
|
-
const block = event.content_block;
|
|
260
|
-
if (!block) return;
|
|
261
|
-
if (block.type === 'text') {
|
|
262
|
-
_currentBlockData = { type: 'text', text: block.text || '' };
|
|
263
|
-
} else if (block.type === 'thinking') {
|
|
264
|
-
_currentBlockData = { type: 'thinking', thinking: block.thinking || '' };
|
|
265
|
-
} else if (block.type === 'tool_use') {
|
|
266
|
-
if (INTERACTIVE_TOOLS.has(block.name)) {
|
|
267
|
-
_currentBlockData = null;
|
|
268
|
-
} else {
|
|
269
|
-
_currentBlockData = { type: 'tool_use', id: block.id, name: block.name, input: {} };
|
|
270
|
-
}
|
|
271
|
-
} else {
|
|
272
|
-
_currentBlockData = null;
|
|
273
|
-
}
|
|
274
|
-
} else if (type === 'content_block_delta') {
|
|
275
|
-
const delta = event.delta;
|
|
276
|
-
if (!delta || !_currentBlockData) return;
|
|
277
|
-
if (delta.type === 'text_delta' && _currentBlockData.type === 'text') {
|
|
278
|
-
_currentBlockData.text += delta.text || '';
|
|
279
|
-
_pushStreamingEntry();
|
|
280
|
-
} else if (delta.type === 'thinking_delta' && _currentBlockData.type === 'thinking') {
|
|
281
|
-
_currentBlockData.thinking += delta.thinking || '';
|
|
282
|
-
} else if (delta.type === 'input_json_delta' && _currentBlockData.type === 'tool_use') {
|
|
283
|
-
if (!_currentBlockData._rawInput) _currentBlockData._rawInput = '';
|
|
284
|
-
_currentBlockData._rawInput += delta.partial_json || '';
|
|
285
|
-
}
|
|
286
|
-
} else if (type === 'content_block_stop') {
|
|
287
|
-
if (_currentBlockData) {
|
|
288
|
-
if (_currentBlockData.type === 'tool_use' && _currentBlockData._rawInput) {
|
|
289
|
-
try { _currentBlockData.input = JSON.parse(_currentBlockData._rawInput); } catch {}
|
|
290
|
-
delete _currentBlockData._rawInput;
|
|
291
|
-
}
|
|
292
|
-
_streamingContent.push(_currentBlockData);
|
|
293
|
-
_currentBlockData = null;
|
|
294
|
-
_pushStreamingEntry();
|
|
295
|
-
}
|
|
296
|
-
} else if (type === 'message_stop') {
|
|
297
|
-
if (_streamingContent.length > 0) {
|
|
298
|
-
_pendingFinalContent = [..._streamingContent];
|
|
299
|
-
_pendingFinalRequestMessages = [..._accumulatedMessages];
|
|
300
|
-
}
|
|
301
|
-
_resetStreamingState();
|
|
244
|
+
function _handleCompletedItem(item) {
|
|
245
|
+
if (!item || typeof item !== 'object') return;
|
|
246
|
+
if (isSdkToolItem(item)) {
|
|
247
|
+
_completeToolItem(item);
|
|
248
|
+
return;
|
|
302
249
|
}
|
|
250
|
+
|
|
251
|
+
const block = sdkItemToAssistantBlock(item);
|
|
252
|
+
if (!block) return;
|
|
253
|
+
|
|
254
|
+
// Replace older block for the same item if an item.completed arrives after
|
|
255
|
+
// repeated item.updated events. Only completed items enter durable history.
|
|
256
|
+
const id = item.id || '';
|
|
257
|
+
_pendingAssistantContent = _pendingAssistantContent.filter(b => b._sdkItemId !== id);
|
|
258
|
+
_pendingAssistantContent.push({ ...block, _sdkItemId: id });
|
|
303
259
|
}
|
|
304
260
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
261
|
+
function _completeToolItem(item) {
|
|
262
|
+
const id = item.id || `${item.type || 'tool'}_${Date.now()}`;
|
|
263
|
+
if (_completedToolIds.has(id)) return;
|
|
264
|
+
_completedToolIds.add(id);
|
|
265
|
+
|
|
266
|
+
const toolUse = sdkItemToToolUseBlock({ ...item, id });
|
|
267
|
+
if (!toolUse) return;
|
|
268
|
+
|
|
269
|
+
_pendingAssistantContent.push(toolUse);
|
|
270
|
+
_flushPendingAssistantContent();
|
|
271
|
+
|
|
272
|
+
const output = sdkToolOutput(item);
|
|
273
|
+
_accumulatedMessages.push({
|
|
274
|
+
role: 'user',
|
|
275
|
+
content: [{
|
|
276
|
+
type: 'tool_result',
|
|
277
|
+
tool_use_id: toolUse.id,
|
|
278
|
+
content: typeof output === 'string' ? output : JSON.stringify(output, null, 2),
|
|
279
|
+
is_error: item.status === 'failed' || !!item.error,
|
|
280
|
+
}],
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
_emitToolEntry(item, toolUse, output);
|
|
314
284
|
}
|
|
315
285
|
|
|
316
|
-
function
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
const clone = { ..._currentBlockData };
|
|
321
|
-
if (clone._rawInput) delete clone._rawInput;
|
|
322
|
-
content.push(clone);
|
|
286
|
+
function _flushPendingAssistantContent() {
|
|
287
|
+
const content = _stripInternalFields(_pendingAssistantContent);
|
|
288
|
+
if (content.length > 0) {
|
|
289
|
+
_accumulatedMessages.push({ role: 'assistant', content });
|
|
323
290
|
}
|
|
324
|
-
|
|
291
|
+
_pendingAssistantContent = [];
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
function _emitCompletedEntry(usage) {
|
|
295
|
+
if (_finalEntryEmittedThisTurn) return;
|
|
296
|
+
const finalContent = _stripInternalFields(_pendingAssistantContent);
|
|
297
|
+
const messagesSnapshot = cloneJson(_accumulatedMessages);
|
|
325
298
|
|
|
326
|
-
const
|
|
299
|
+
const assistantMsg = {
|
|
327
300
|
message: {
|
|
328
301
|
id: _streamingRequestId,
|
|
329
302
|
type: 'message',
|
|
330
303
|
role: 'assistant',
|
|
331
304
|
model: _model,
|
|
332
|
-
content,
|
|
333
|
-
|
|
334
|
-
usage: { input_tokens: 0, output_tokens: 0 },
|
|
305
|
+
content: finalContent,
|
|
306
|
+
usage,
|
|
335
307
|
},
|
|
336
308
|
};
|
|
337
|
-
|
|
338
|
-
const entry = sdkToJSONLEntry(
|
|
339
|
-
inProgress: true,
|
|
340
|
-
tools: _sdkTools,
|
|
341
|
-
requestId: _streamingRequestId,
|
|
309
|
+
|
|
310
|
+
const entry = sdkToJSONLEntry(assistantMsg, messagesSnapshot, _model, _projectName, {
|
|
342
311
|
timestamp: _turnTimestamp,
|
|
312
|
+
requestId: _streamingRequestId,
|
|
313
|
+
threadId: _sessionId || _thread?.id || null,
|
|
314
|
+
cwd: _cwd,
|
|
315
|
+
tools: DEFAULT_CODEX_TOOLS,
|
|
316
|
+
duration: _turnStartTime ? Date.now() - _turnStartTime : 0,
|
|
317
|
+
metadata: { source: 'codex-sdk' },
|
|
343
318
|
});
|
|
344
|
-
_onEntry(entry);
|
|
345
|
-
}
|
|
346
319
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (_streamThrottleTimer) {
|
|
351
|
-
clearTimeout(_streamThrottleTimer);
|
|
352
|
-
_streamThrottleTimer = null;
|
|
320
|
+
if (_onEntry) _onEntry(entry);
|
|
321
|
+
if (finalContent.length > 0) {
|
|
322
|
+
_accumulatedMessages.push({ role: 'assistant', content: finalContent });
|
|
353
323
|
}
|
|
324
|
+
_pendingAssistantContent = [];
|
|
325
|
+
_finalEntryEmittedThisTurn = true;
|
|
354
326
|
}
|
|
355
327
|
|
|
356
|
-
function
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
const content = _filterInteractiveContent(_pendingFinalContent);
|
|
361
|
-
const syntheticMsg = {
|
|
328
|
+
function _emitErrorEntry(message) {
|
|
329
|
+
if (_finalEntryEmittedThisTurn || !_onEntry) return;
|
|
330
|
+
const content = message ? [{ type: 'text', text: `Error: ${message}` }] : [];
|
|
331
|
+
const assistantMsg = {
|
|
362
332
|
message: {
|
|
363
|
-
id: _streamingRequestId
|
|
333
|
+
id: _streamingRequestId || `sdk_${Date.now()}`,
|
|
364
334
|
type: 'message',
|
|
365
335
|
role: 'assistant',
|
|
366
336
|
model: _model,
|
|
367
337
|
content,
|
|
368
|
-
|
|
369
|
-
usage:
|
|
338
|
+
error: { message },
|
|
339
|
+
usage: null,
|
|
370
340
|
},
|
|
371
341
|
};
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
342
|
+
const entry = sdkToJSONLEntry(assistantMsg, cloneJson(_accumulatedMessages), _model, _projectName, {
|
|
343
|
+
timestamp: _turnTimestamp || new Date().toISOString(),
|
|
344
|
+
threadId: _sessionId || _thread?.id || null,
|
|
345
|
+
cwd: _cwd,
|
|
346
|
+
status: 500,
|
|
347
|
+
statusText: 'Error',
|
|
348
|
+
stopReason: 'error',
|
|
349
|
+
duration: _turnStartTime ? Date.now() - _turnStartTime : 0,
|
|
350
|
+
metadata: { source: 'codex-sdk' },
|
|
376
351
|
});
|
|
377
352
|
_onEntry(entry);
|
|
378
353
|
_finalEntryEmittedThisTurn = true;
|
|
379
|
-
|
|
380
|
-
const lastMsg = _accumulatedMessages[_accumulatedMessages.length - 1];
|
|
381
|
-
if (lastMsg && lastMsg.role === 'assistant' && Array.isArray(lastMsg.content)) {
|
|
382
|
-
lastMsg.content = [...lastMsg.content, ...content];
|
|
383
|
-
} else {
|
|
384
|
-
_accumulatedMessages.push({ role: 'assistant', content });
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
_pendingFinalContent = null;
|
|
388
|
-
_pendingFinalRequestMessages = null;
|
|
389
354
|
}
|
|
390
355
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
356
|
+
function _emitToolEntry(item, toolUse, output) {
|
|
357
|
+
if (!_onEntry) return;
|
|
358
|
+
const name = sdkToolName(item);
|
|
359
|
+
_onEntry({
|
|
360
|
+
timestamp: new Date().toISOString(),
|
|
361
|
+
project: _projectName || 'sdk',
|
|
362
|
+
url: `codex://sdk/tool/${encodeURIComponent(name)}`,
|
|
363
|
+
method: 'TOOL',
|
|
364
|
+
headers: {},
|
|
365
|
+
body: {
|
|
366
|
+
tool_name: name,
|
|
367
|
+
tool_input: toolUse.input || {},
|
|
368
|
+
_callId: toolUse.id,
|
|
369
|
+
_threadId: _sessionId || _thread?.id || null,
|
|
370
|
+
_itemType: item.type,
|
|
371
|
+
status: item.status,
|
|
372
|
+
raw_item: cloneJson(item),
|
|
373
|
+
},
|
|
374
|
+
response: {
|
|
375
|
+
status: item.status === 'failed' || item.error ? 500 : 200,
|
|
376
|
+
statusText: item.status === 'failed' || item.error ? 'Error' : 'OK',
|
|
377
|
+
headers: {},
|
|
378
|
+
body: {
|
|
379
|
+
output,
|
|
380
|
+
status: item.status,
|
|
381
|
+
},
|
|
382
|
+
},
|
|
383
|
+
duration: 0,
|
|
384
|
+
isStream: false,
|
|
385
|
+
mainAgent: false,
|
|
386
|
+
subAgent: false,
|
|
387
|
+
_sdkSource: true,
|
|
388
|
+
});
|
|
389
|
+
}
|
|
396
390
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
}
|
|
405
|
-
if (typeof result === 'object' && result.approve === false) {
|
|
406
|
-
return { behavior: 'deny', message: result.feedback || 'User rejected the plan' };
|
|
407
|
-
}
|
|
408
|
-
return { behavior: 'allow', updatedInput: input };
|
|
409
|
-
}
|
|
391
|
+
function _scheduleStreamProgress() {
|
|
392
|
+
if (_streamThrottleTimer) return;
|
|
393
|
+
_streamThrottleTimer = setTimeout(() => {
|
|
394
|
+
_streamThrottleTimer = null;
|
|
395
|
+
_flushStreamProgress();
|
|
396
|
+
}, 80);
|
|
397
|
+
}
|
|
410
398
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
399
|
+
function _flushStreamProgress() {
|
|
400
|
+
if (!_onStreamProgress || !_turnTimestamp) return;
|
|
401
|
+
const content = _streamContentFromItems();
|
|
402
|
+
if (!content.length) return;
|
|
403
|
+
_streamingChunkCount += 1;
|
|
404
|
+
_onStreamProgress({
|
|
405
|
+
timestamp: _turnTimestamp,
|
|
406
|
+
url: `codex://sdk/${encodeURIComponent(_sessionId || _thread?.id || _model || 'thread')}`,
|
|
407
|
+
content,
|
|
408
|
+
model: _model,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
421
411
|
|
|
422
|
-
|
|
423
|
-
const
|
|
424
|
-
|
|
425
|
-
|
|
412
|
+
function _streamContentFromItems() {
|
|
413
|
+
const blocks = [];
|
|
414
|
+
for (const id of _itemOrder) {
|
|
415
|
+
const item = _currentItems.get(id);
|
|
416
|
+
const block = sdkItemToAssistantBlock(item);
|
|
417
|
+
if (!block) continue;
|
|
418
|
+
if (block.type === 'text' && !block.text?.trim()) continue;
|
|
419
|
+
if (block.type === 'thinking' && !block.thinking?.trim()) continue;
|
|
420
|
+
blocks.push(block);
|
|
426
421
|
}
|
|
422
|
+
return _stripInternalFields(blocks);
|
|
423
|
+
}
|
|
427
424
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
425
|
+
function _sendStreamingStatus(active) {
|
|
426
|
+
if (_onStreamingStatus) {
|
|
427
|
+
_onStreamingStatus(buildStreamingStatus(active, {
|
|
428
|
+
model: _model,
|
|
429
|
+
startTime: _turnStartTime,
|
|
430
|
+
chunksReceived: _streamingChunkCount,
|
|
431
|
+
}));
|
|
432
432
|
}
|
|
433
|
+
}
|
|
433
434
|
|
|
434
|
-
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
const decision = typeof result === 'object' ? result.decision : result;
|
|
439
|
-
const allowSession = typeof result === 'object' && result.allowSession;
|
|
440
|
-
if (decision === 'deny') {
|
|
441
|
-
return { behavior: 'deny', message: 'User denied via cx-viewer' };
|
|
442
|
-
}
|
|
443
|
-
const response = { behavior: 'allow', updatedInput: input };
|
|
444
|
-
if (allowSession && Array.isArray(suggestions) && suggestions.length > 0) {
|
|
445
|
-
response.updatedPermissions = suggestions;
|
|
435
|
+
function _clearStreamThrottle() {
|
|
436
|
+
if (_streamThrottleTimer) {
|
|
437
|
+
clearTimeout(_streamThrottleTimer);
|
|
438
|
+
_streamThrottleTimer = null;
|
|
446
439
|
}
|
|
447
|
-
return response;
|
|
448
440
|
}
|
|
449
441
|
|
|
450
|
-
function
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
resolve: (value) => {
|
|
458
|
-
clearTimeout(timer);
|
|
459
|
-
_pendingApprovals.delete(id);
|
|
460
|
-
resolve(value);
|
|
461
|
-
},
|
|
462
|
-
});
|
|
463
|
-
});
|
|
442
|
+
export function interruptTurn() {
|
|
443
|
+
_messageQueue = [];
|
|
444
|
+
if (_abortController) {
|
|
445
|
+
try { _abortController.abort(); } catch {}
|
|
446
|
+
return true;
|
|
447
|
+
}
|
|
448
|
+
return false;
|
|
464
449
|
}
|
|
465
450
|
|
|
466
|
-
/**
|
|
467
|
-
* Resolve a pending canUseTool approval.
|
|
468
|
-
* Called by server.js when a WS message arrives.
|
|
469
|
-
*/
|
|
470
451
|
export function resolveApproval(id, value) {
|
|
471
452
|
const pending = _pendingApprovals.get(id);
|
|
472
453
|
if (pending) {
|
|
@@ -476,44 +457,216 @@ export function resolveApproval(id, value) {
|
|
|
476
457
|
return false;
|
|
477
458
|
}
|
|
478
459
|
|
|
479
|
-
/**
|
|
480
|
-
* Stop the active SDK session.
|
|
481
|
-
*/
|
|
482
460
|
export function stopSession() {
|
|
483
|
-
|
|
484
|
-
if (
|
|
485
|
-
|
|
461
|
+
interruptTurn();
|
|
462
|
+
if (_sdkProxyPort !== null || _sdkProxyPromise) {
|
|
463
|
+
const pendingProxy = _sdkProxyPromise;
|
|
464
|
+
_sdkProxyPromise = null;
|
|
465
|
+
stopProxy();
|
|
466
|
+
_sdkProxyPort = null;
|
|
467
|
+
if (pendingProxy) {
|
|
468
|
+
pendingProxy.then(() => stopProxy()).catch(() => {});
|
|
469
|
+
}
|
|
486
470
|
}
|
|
487
|
-
_resetFullState();
|
|
471
|
+
_resetFullState({ keepConfig: false });
|
|
488
472
|
}
|
|
489
473
|
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
474
|
+
export function getSessionId() {
|
|
475
|
+
return _sessionId;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
function _resetTurnState() {
|
|
479
|
+
_turnTimestamp = null;
|
|
480
|
+
_turnStartTime = null;
|
|
481
|
+
_streamingRequestId = null;
|
|
482
|
+
_streamingChunkCount = 0;
|
|
483
|
+
_pendingAssistantContent = [];
|
|
484
|
+
_currentItems = new Map();
|
|
485
|
+
_itemOrder = [];
|
|
486
|
+
_completedToolIds = new Set();
|
|
487
|
+
_finalEntryEmittedThisTurn = false;
|
|
488
|
+
_clearStreamThrottle();
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function _resetFullState({ keepConfig } = {}) {
|
|
492
|
+
interruptTurn();
|
|
493
|
+
_codex = null;
|
|
494
|
+
_thread = null;
|
|
495
495
|
_sessionId = null;
|
|
496
|
-
_model = null;
|
|
497
|
-
_sdkTools = null;
|
|
496
|
+
_model = keepConfig ? (_threadOptions.model || null) : null;
|
|
498
497
|
_queryBusy = false;
|
|
499
|
-
_accumulatedMessages = [];
|
|
500
|
-
_turnTimestamp = null;
|
|
501
498
|
_messageQueue = [];
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
_finalEntryEmittedThisTurn = false;
|
|
505
|
-
_resetStreamingState();
|
|
506
|
-
_streamingRequestId = null;
|
|
507
|
-
// Reject all pending approvals
|
|
499
|
+
_accumulatedMessages = [];
|
|
500
|
+
_resetTurnState();
|
|
508
501
|
for (const [, pending] of _pendingApprovals) {
|
|
509
502
|
pending.resolve(null);
|
|
510
503
|
}
|
|
511
504
|
_pendingApprovals.clear();
|
|
512
505
|
}
|
|
513
506
|
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
507
|
+
function cloneJson(value) {
|
|
508
|
+
if (value == null) return value;
|
|
509
|
+
try {
|
|
510
|
+
return JSON.parse(JSON.stringify(value));
|
|
511
|
+
} catch {
|
|
512
|
+
return value;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
function _stripInternalFields(blocks) {
|
|
517
|
+
return (blocks || []).map(block => {
|
|
518
|
+
if (!block || typeof block !== 'object') return block;
|
|
519
|
+
const { _sdkItemId, ...rest } = block;
|
|
520
|
+
return rest;
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function parseSdkCodexArgs(args = []) {
|
|
525
|
+
const threadOptions = {};
|
|
526
|
+
const codexOptions = {};
|
|
527
|
+
const config = {};
|
|
528
|
+
const additionalDirectories = [];
|
|
529
|
+
const promptParts = [];
|
|
530
|
+
let resumeThreadId = null;
|
|
531
|
+
|
|
532
|
+
const setConfig = (path, value) => {
|
|
533
|
+
const keys = String(path || '').split('.').filter(Boolean);
|
|
534
|
+
if (keys.length === 0) return;
|
|
535
|
+
const parsedValue = parseConfigValue(value);
|
|
536
|
+
if (keys.length === 1 && keys[0] === 'model' && typeof parsedValue === 'string') {
|
|
537
|
+
threadOptions.model = parsedValue;
|
|
538
|
+
}
|
|
539
|
+
let target = config;
|
|
540
|
+
for (let i = 0; i < keys.length - 1; i++) {
|
|
541
|
+
const key = keys[i];
|
|
542
|
+
if (!target[key] || typeof target[key] !== 'object' || Array.isArray(target[key])) {
|
|
543
|
+
target[key] = {};
|
|
544
|
+
}
|
|
545
|
+
target = target[key];
|
|
546
|
+
}
|
|
547
|
+
target[keys[keys.length - 1]] = parsedValue;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
const takeValue = (argv, index, inline) => {
|
|
551
|
+
if (inline !== undefined) return { value: inline, nextIndex: index };
|
|
552
|
+
return { value: argv[index + 1], nextIndex: index + 1 };
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
for (let i = 0; i < args.length; i++) {
|
|
556
|
+
const arg = args[i];
|
|
557
|
+
if (!arg) continue;
|
|
558
|
+
|
|
559
|
+
if (arg === 'exec' || arg === 'review') {
|
|
560
|
+
promptParts.push(...args.slice(i + 1));
|
|
561
|
+
break;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
if (arg === 'resume') {
|
|
565
|
+
const maybeId = args[i + 1];
|
|
566
|
+
if (maybeId && maybeId !== '--last' && !maybeId.startsWith('-')) {
|
|
567
|
+
resumeThreadId = maybeId;
|
|
568
|
+
i += 1;
|
|
569
|
+
}
|
|
570
|
+
continue;
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
if (arg === '--last') {
|
|
574
|
+
continue;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
const [flag, inline] = arg.includes('=') ? arg.split(/=(.*)/s, 2) : [arg, undefined];
|
|
578
|
+
|
|
579
|
+
if (flag === '-m' || flag === '--model') {
|
|
580
|
+
const taken = takeValue(args, i, inline);
|
|
581
|
+
if (taken.value) threadOptions.model = taken.value;
|
|
582
|
+
i = taken.nextIndex;
|
|
583
|
+
continue;
|
|
584
|
+
}
|
|
585
|
+
if (flag === '-C' || flag === '--cd') {
|
|
586
|
+
const taken = takeValue(args, i, inline);
|
|
587
|
+
if (taken.value) threadOptions.workingDirectory = taken.value;
|
|
588
|
+
i = taken.nextIndex;
|
|
589
|
+
continue;
|
|
590
|
+
}
|
|
591
|
+
if (flag === '-s' || flag === '--sandbox') {
|
|
592
|
+
const taken = takeValue(args, i, inline);
|
|
593
|
+
if (taken.value) threadOptions.sandboxMode = taken.value;
|
|
594
|
+
i = taken.nextIndex;
|
|
595
|
+
continue;
|
|
596
|
+
}
|
|
597
|
+
if (flag === '-a' || flag === '--ask-for-approval') {
|
|
598
|
+
const taken = takeValue(args, i, inline);
|
|
599
|
+
if (taken.value) threadOptions.approvalPolicy = normalizeApprovalPolicy(taken.value);
|
|
600
|
+
i = taken.nextIndex;
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
if (flag === '--add-dir') {
|
|
604
|
+
const taken = takeValue(args, i, inline);
|
|
605
|
+
if (taken.value) additionalDirectories.push(taken.value);
|
|
606
|
+
i = taken.nextIndex;
|
|
607
|
+
continue;
|
|
608
|
+
}
|
|
609
|
+
if (flag === '-c' || flag === '--config') {
|
|
610
|
+
const taken = takeValue(args, i, inline);
|
|
611
|
+
if (taken.value && String(taken.value).includes('=')) {
|
|
612
|
+
const [key, value] = String(taken.value).split(/=(.*)/s, 2);
|
|
613
|
+
setConfig(key, value);
|
|
614
|
+
}
|
|
615
|
+
i = taken.nextIndex;
|
|
616
|
+
continue;
|
|
617
|
+
}
|
|
618
|
+
if (arg === '--search') {
|
|
619
|
+
threadOptions.webSearchMode = 'live';
|
|
620
|
+
continue;
|
|
621
|
+
}
|
|
622
|
+
if (arg === '--skip-git-repo-check') {
|
|
623
|
+
threadOptions.skipGitRepoCheck = true;
|
|
624
|
+
continue;
|
|
625
|
+
}
|
|
626
|
+
if (arg === '--dangerously-bypass-approvals-and-sandbox') {
|
|
627
|
+
threadOptions.approvalPolicy = 'never';
|
|
628
|
+
threadOptions.sandboxMode = 'danger-full-access';
|
|
629
|
+
continue;
|
|
630
|
+
}
|
|
631
|
+
if (arg === '--full-auto') {
|
|
632
|
+
threadOptions.approvalPolicy = 'on-failure';
|
|
633
|
+
threadOptions.sandboxMode = 'workspace-write';
|
|
634
|
+
continue;
|
|
635
|
+
}
|
|
636
|
+
if (arg.startsWith('-')) {
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
promptParts.push(arg);
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
if (additionalDirectories.length > 0) {
|
|
643
|
+
threadOptions.additionalDirectories = additionalDirectories;
|
|
644
|
+
}
|
|
645
|
+
if (Object.keys(config).length > 0) {
|
|
646
|
+
codexOptions.config = config;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
return {
|
|
650
|
+
threadOptions,
|
|
651
|
+
codexOptions,
|
|
652
|
+
resumeThreadId,
|
|
653
|
+
initialPrompt: promptParts.join(' ').trim(),
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
function normalizeApprovalPolicy(value) {
|
|
658
|
+
if (value === 'on_request') return 'on-request';
|
|
659
|
+
if (value === 'on_failure') return 'on-failure';
|
|
660
|
+
return value;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
function parseConfigValue(raw) {
|
|
664
|
+
const value = String(raw ?? '').trim();
|
|
665
|
+
if (value === 'true') return true;
|
|
666
|
+
if (value === 'false') return false;
|
|
667
|
+
if (/^-?\d+(\.\d+)?$/.test(value)) return Number(value);
|
|
668
|
+
if ((value.startsWith('"') && value.endsWith('"')) || (value.startsWith("'") && value.endsWith("'"))) {
|
|
669
|
+
return value.slice(1, -1);
|
|
670
|
+
}
|
|
671
|
+
return value;
|
|
519
672
|
}
|