axon-code 2.4.0 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/snapshot.d.ts +24 -0
- package/dist/auth/snapshot.d.ts.map +1 -0
- package/dist/auth/snapshot.js +144 -0
- package/dist/auth/snapshot.js.map +1 -0
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/config/axon-md-parser.d.ts.map +1 -1
- package/dist/config/axon-md-parser.js +21 -4
- package/dist/config/axon-md-parser.js.map +1 -1
- package/dist/config/index.d.ts +39 -21
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +14 -2
- package/dist/config/index.js.map +1 -1
- package/dist/context/enhanced.d.ts.map +1 -1
- package/dist/context/enhanced.js +5 -0
- package/dist/context/enhanced.js.map +1 -1
- package/dist/core/client.d.ts +7 -2
- package/dist/core/client.d.ts.map +1 -1
- package/dist/core/client.js +50 -18
- package/dist/core/client.js.map +1 -1
- package/dist/core/loop.d.ts +47 -8
- package/dist/core/loop.d.ts.map +1 -1
- package/dist/core/loop.js +333 -149
- package/dist/core/loop.js.map +1 -1
- package/dist/core/max-tokens.d.ts +24 -0
- package/dist/core/max-tokens.d.ts.map +1 -0
- package/dist/core/max-tokens.js +69 -0
- package/dist/core/max-tokens.js.map +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +7 -14
- package/dist/core/session.js.map +1 -1
- package/dist/daemon/config.d.ts +6 -6
- package/dist/daemon/executor.d.ts.map +1 -1
- package/dist/daemon/executor.js +24 -30
- package/dist/daemon/executor.js.map +1 -1
- package/dist/goals/goal-store.d.ts +1 -1
- package/dist/goals/goal-store.d.ts.map +1 -1
- package/dist/goals/goal-store.js.map +1 -1
- package/dist/hooks/auto-verify.d.ts +86 -0
- package/dist/hooks/auto-verify.d.ts.map +1 -0
- package/dist/hooks/auto-verify.js +297 -0
- package/dist/hooks/auto-verify.js.map +1 -0
- package/dist/mcp/config.d.ts +16 -16
- package/dist/media/index.d.ts +2 -1
- package/dist/media/index.d.ts.map +1 -1
- package/dist/media/index.js +5 -3
- package/dist/media/index.js.map +1 -1
- package/dist/media/office-visual.d.ts +66 -0
- package/dist/media/office-visual.d.ts.map +1 -0
- package/dist/media/office-visual.js +409 -0
- package/dist/media/office-visual.js.map +1 -0
- package/dist/media/office.d.ts +17 -0
- package/dist/media/office.d.ts.map +1 -1
- package/dist/media/office.js +227 -2
- package/dist/media/office.js.map +1 -1
- package/dist/memory/long-term-store.d.ts +6 -0
- package/dist/memory/long-term-store.d.ts.map +1 -1
- package/dist/memory/long-term-store.js +66 -48
- package/dist/memory/long-term-store.js.map +1 -1
- package/dist/memory/memory-search.d.ts +9 -3
- package/dist/memory/memory-search.d.ts.map +1 -1
- package/dist/memory/memory-search.js +58 -12
- package/dist/memory/memory-search.js.map +1 -1
- package/dist/memory/memory-sync.d.ts +7 -0
- package/dist/memory/memory-sync.d.ts.map +1 -1
- package/dist/memory/memory-sync.js +92 -0
- package/dist/memory/memory-sync.js.map +1 -1
- package/dist/memory/notebook.d.ts +7 -0
- package/dist/memory/notebook.d.ts.map +1 -1
- package/dist/memory/notebook.js +624 -24
- package/dist/memory/notebook.js.map +1 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/models/config.js +7 -4
- package/dist/models/config.js.map +1 -1
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/model-limits.d.ts +13 -0
- package/dist/models/model-limits.d.ts.map +1 -0
- package/dist/models/model-limits.js +79 -0
- package/dist/models/model-limits.js.map +1 -0
- package/dist/network/discovery.d.ts +2 -0
- package/dist/network/discovery.d.ts.map +1 -1
- package/dist/network/discovery.js +10 -5
- package/dist/network/discovery.js.map +1 -1
- package/dist/network/global-proxy.d.ts +7 -0
- package/dist/network/global-proxy.d.ts.map +1 -1
- package/dist/network/global-proxy.js +67 -0
- package/dist/network/global-proxy.js.map +1 -1
- package/dist/network/index.d.ts +6 -1
- package/dist/network/index.d.ts.map +1 -1
- package/dist/network/index.js +16 -11
- package/dist/network/index.js.map +1 -1
- package/dist/network/transport.d.ts +41 -4
- package/dist/network/transport.d.ts.map +1 -1
- package/dist/network/transport.js +234 -61
- package/dist/network/transport.js.map +1 -1
- package/dist/network/types.d.ts +19 -1
- package/dist/network/types.d.ts.map +1 -1
- package/dist/network/types.js.map +1 -1
- package/dist/notifications/cmux.d.ts +115 -0
- package/dist/notifications/cmux.d.ts.map +1 -0
- package/dist/notifications/cmux.js +436 -0
- package/dist/notifications/cmux.js.map +1 -0
- package/dist/prompt/attachments.d.ts +8 -0
- package/dist/prompt/attachments.d.ts.map +1 -1
- package/dist/prompt/attachments.js +74 -2
- package/dist/prompt/attachments.js.map +1 -1
- package/dist/prompt/builder.js +1 -1
- package/dist/prompt/builder.js.map +1 -1
- package/dist/prompt/cache.d.ts +1 -6
- package/dist/prompt/cache.d.ts.map +1 -1
- package/dist/prompt/cache.js +37 -7
- package/dist/prompt/cache.js.map +1 -1
- package/dist/prompt/templates.d.ts +1 -1
- package/dist/prompt/templates.d.ts.map +1 -1
- package/dist/prompt/templates.js +4 -3
- package/dist/prompt/templates.js.map +1 -1
- package/dist/prompt/types.d.ts +3 -1
- package/dist/prompt/types.d.ts.map +1 -1
- package/dist/prompt/types.js.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/server.js +32 -11
- package/dist/proxy/server.js.map +1 -1
- package/dist/search/ripgrep.d.ts.map +1 -1
- package/dist/search/ripgrep.js +11 -0
- package/dist/search/ripgrep.js.map +1 -1
- package/dist/session/index.d.ts +3 -0
- package/dist/session/index.d.ts.map +1 -1
- package/dist/session/index.js +1 -0
- package/dist/session/index.js.map +1 -1
- package/dist/skills/builtin/algorithmic-art/LICENSE.txt +202 -0
- package/dist/skills/builtin/algorithmic-art/SKILL.md +405 -0
- package/dist/skills/builtin/algorithmic-art/templates/generator_template.js +223 -0
- package/dist/skills/builtin/algorithmic-art/templates/viewer.html +599 -0
- package/dist/skills/builtin/analyze-logs/SKILL.md +75 -0
- package/dist/skills/builtin/audit-official/SKILL.md +81 -0
- package/dist/skills/builtin/brand-guidelines/LICENSE.txt +202 -0
- package/dist/skills/builtin/brand-guidelines/SKILL.md +73 -0
- package/dist/skills/builtin/build-portable/SKILL.md +53 -0
- package/dist/skills/builtin/canvas-design/SKILL.md +130 -0
- package/dist/skills/builtin/changelog/SKILL.md +65 -0
- package/dist/skills/builtin/code-review/SKILL.md +75 -0
- package/dist/skills/builtin/doc-coauthoring/SKILL.md +375 -0
- package/dist/skills/builtin/doctor/SKILL.md +166 -0
- package/dist/skills/builtin/docx/LICENSE.txt +30 -0
- package/dist/skills/builtin/docx/SKILL.md +590 -0
- package/dist/skills/builtin/docx/scripts/__init__.py +1 -0
- package/dist/skills/builtin/docx/scripts/accept_changes.py +135 -0
- package/dist/skills/builtin/docx/scripts/comment.py +318 -0
- package/dist/skills/builtin/docx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/builtin/docx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/builtin/docx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/builtin/docx/scripts/office/pack.py +159 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/builtin/docx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/builtin/docx/scripts/office/soffice.py +183 -0
- package/dist/skills/builtin/docx/scripts/office/unpack.py +132 -0
- package/dist/skills/builtin/docx/scripts/office/validate.py +111 -0
- package/dist/skills/builtin/docx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/builtin/docx/scripts/office/validators/base.py +847 -0
- package/dist/skills/builtin/docx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/builtin/docx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/builtin/docx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/builtin/docx/scripts/templates/comments.xml +3 -0
- package/dist/skills/builtin/docx/scripts/templates/commentsExtended.xml +3 -0
- package/dist/skills/builtin/docx/scripts/templates/commentsExtensible.xml +3 -0
- package/dist/skills/builtin/docx/scripts/templates/commentsIds.xml +3 -0
- package/dist/skills/builtin/docx/scripts/templates/people.xml +3 -0
- package/dist/skills/builtin/frontend-design/LICENSE.txt +177 -0
- package/dist/skills/builtin/frontend-design/SKILL.md +42 -0
- package/dist/skills/builtin/i18n-check/SKILL.md +56 -0
- package/dist/skills/builtin/internal-comms/LICENSE.txt +202 -0
- package/dist/skills/builtin/internal-comms/SKILL.md +32 -0
- package/dist/skills/builtin/internal-comms/examples/3p-updates.md +47 -0
- package/dist/skills/builtin/internal-comms/examples/company-newsletter.md +65 -0
- package/dist/skills/builtin/internal-comms/examples/faq-answers.md +30 -0
- package/dist/skills/builtin/internal-comms/examples/general-comms.md +16 -0
- package/dist/skills/builtin/mcp-builder/LICENSE.txt +202 -0
- package/dist/skills/builtin/mcp-builder/SKILL.md +236 -0
- package/dist/skills/builtin/mcp-builder/reference/evaluation.md +602 -0
- package/dist/skills/builtin/mcp-builder/reference/mcp_best_practices.md +249 -0
- package/dist/skills/builtin/mcp-builder/reference/node_mcp_server.md +970 -0
- package/dist/skills/builtin/mcp-builder/reference/python_mcp_server.md +719 -0
- package/dist/skills/builtin/mcp-builder/scripts/connections.py +151 -0
- package/dist/skills/builtin/mcp-builder/scripts/evaluation.py +373 -0
- package/dist/skills/builtin/mcp-builder/scripts/example_evaluation.xml +22 -0
- package/dist/skills/builtin/mcp-builder/scripts/requirements.txt +2 -0
- package/dist/skills/builtin/pdf/LICENSE.txt +30 -0
- package/dist/skills/builtin/pdf/SKILL.md +314 -0
- package/dist/skills/builtin/pdf/forms.md +294 -0
- package/dist/skills/builtin/pdf/reference.md +612 -0
- package/dist/skills/builtin/pdf/scripts/check_bounding_boxes.py +65 -0
- package/dist/skills/builtin/pdf/scripts/check_fillable_fields.py +11 -0
- package/dist/skills/builtin/pdf/scripts/convert_pdf_to_images.py +33 -0
- package/dist/skills/builtin/pdf/scripts/create_validation_image.py +37 -0
- package/dist/skills/builtin/pdf/scripts/extract_form_field_info.py +122 -0
- package/dist/skills/builtin/pdf/scripts/extract_form_structure.py +115 -0
- package/dist/skills/builtin/pdf/scripts/fill_fillable_fields.py +98 -0
- package/dist/skills/builtin/pdf/scripts/fill_pdf_form_with_annotations.py +107 -0
- package/dist/skills/builtin/pptx/LICENSE.txt +30 -0
- package/dist/skills/builtin/pptx/SKILL.md +232 -0
- package/dist/skills/builtin/pptx/editing.md +205 -0
- package/dist/skills/builtin/pptx/pptxgenjs.md +420 -0
- package/dist/skills/builtin/pptx/scripts/__init__.py +0 -0
- package/dist/skills/builtin/pptx/scripts/add_slide.py +195 -0
- package/dist/skills/builtin/pptx/scripts/clean.py +286 -0
- package/dist/skills/builtin/pptx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/builtin/pptx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/builtin/pptx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/builtin/pptx/scripts/office/pack.py +159 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/builtin/pptx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/builtin/pptx/scripts/office/soffice.py +183 -0
- package/dist/skills/builtin/pptx/scripts/office/unpack.py +132 -0
- package/dist/skills/builtin/pptx/scripts/office/validate.py +111 -0
- package/dist/skills/builtin/pptx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/builtin/pptx/scripts/office/validators/base.py +847 -0
- package/dist/skills/builtin/pptx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/builtin/pptx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/builtin/pptx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/builtin/pptx/scripts/thumbnail.py +289 -0
- package/dist/skills/builtin/promo-video/SKILL.md +124 -0
- package/dist/skills/builtin/promote/SKILL.md +77 -0
- package/dist/skills/builtin/skill-creator/LICENSE.txt +202 -0
- package/dist/skills/builtin/skill-creator/SKILL.md +598 -0
- package/dist/skills/builtin/skill-creator/agents/analyzer.md +274 -0
- package/dist/skills/builtin/skill-creator/agents/comparator.md +202 -0
- package/dist/skills/builtin/skill-creator/agents/grader.md +223 -0
- package/dist/skills/builtin/skill-creator/assets/eval_review.html +146 -0
- package/dist/skills/builtin/skill-creator/eval-viewer/generate_review.py +471 -0
- package/dist/skills/builtin/skill-creator/eval-viewer/viewer.html +1325 -0
- package/dist/skills/builtin/skill-creator/references/schemas.md +430 -0
- package/dist/skills/builtin/skill-creator/scripts/__init__.py +0 -0
- package/dist/skills/builtin/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/dist/skills/builtin/skill-creator/scripts/generate_report.py +326 -0
- package/dist/skills/builtin/skill-creator/scripts/improve_description.py +248 -0
- package/dist/skills/builtin/skill-creator/scripts/package_skill.py +136 -0
- package/dist/skills/builtin/skill-creator/scripts/quick_validate.py +103 -0
- package/dist/skills/builtin/skill-creator/scripts/run_eval.py +310 -0
- package/dist/skills/builtin/skill-creator/scripts/run_loop.py +332 -0
- package/dist/skills/builtin/skill-creator/scripts/utils.py +47 -0
- package/dist/skills/builtin/slack-gif-creator/LICENSE.txt +202 -0
- package/dist/skills/builtin/slack-gif-creator/SKILL.md +254 -0
- package/dist/skills/builtin/slack-gif-creator/core/easing.py +234 -0
- package/dist/skills/builtin/slack-gif-creator/core/frame_composer.py +176 -0
- package/dist/skills/builtin/slack-gif-creator/core/gif_builder.py +269 -0
- package/dist/skills/builtin/slack-gif-creator/core/validators.py +136 -0
- package/dist/skills/builtin/slack-gif-creator/requirements.txt +4 -0
- package/dist/skills/builtin/sync-version/SKILL.md +39 -0
- package/dist/skills/builtin/theme-factory/LICENSE.txt +202 -0
- package/dist/skills/builtin/theme-factory/SKILL.md +59 -0
- package/dist/skills/builtin/theme-factory/theme-showcase.pdf +0 -0
- package/dist/skills/builtin/theme-factory/themes/arctic-frost.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/botanical-garden.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/desert-rose.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/forest-canopy.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/golden-hour.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/midnight-galaxy.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/modern-minimalist.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/ocean-depths.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/sunset-boulevard.md +19 -0
- package/dist/skills/builtin/theme-factory/themes/tech-innovation.md +19 -0
- package/dist/skills/builtin/web-artifacts-builder/LICENSE.txt +202 -0
- package/dist/skills/builtin/web-artifacts-builder/SKILL.md +74 -0
- package/dist/skills/builtin/web-artifacts-builder/scripts/bundle-artifact.sh +54 -0
- package/dist/skills/builtin/web-artifacts-builder/scripts/init-artifact.sh +322 -0
- package/dist/skills/builtin/web-artifacts-builder/scripts/shadcn-components.tar.gz +0 -0
- package/dist/skills/builtin/webapp-testing/LICENSE.txt +202 -0
- package/dist/skills/builtin/webapp-testing/SKILL.md +96 -0
- package/dist/skills/builtin/webapp-testing/examples/console_logging.py +35 -0
- package/dist/skills/builtin/webapp-testing/examples/element_discovery.py +40 -0
- package/dist/skills/builtin/webapp-testing/examples/static_html_automation.py +33 -0
- package/dist/skills/builtin/webapp-testing/scripts/with_server.py +106 -0
- package/dist/skills/builtin/xlsx/LICENSE.txt +30 -0
- package/dist/skills/builtin/xlsx/SKILL.md +292 -0
- package/dist/skills/builtin/xlsx/scripts/office/helpers/__init__.py +0 -0
- package/dist/skills/builtin/xlsx/scripts/office/helpers/merge_runs.py +199 -0
- package/dist/skills/builtin/xlsx/scripts/office/helpers/simplify_redlines.py +197 -0
- package/dist/skills/builtin/xlsx/scripts/office/pack.py +159 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +1499 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +146 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +1085 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +11 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-main.xsd +3081 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +23 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +185 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +287 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/pml.xsd +1676 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +28 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +144 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +174 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +25 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +18 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +59 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +56 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +195 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-math.xsd +582 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +25 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/sml.xsd +4439 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-main.xsd +570 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +509 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +12 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +108 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +96 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/wml.xsd +3646 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ISO-IEC29500-4_2016/xml.xsd +116 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-contentTypes.xsd +42 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-coreProperties.xsd +50 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-digSig.xsd +49 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/ecma/fouth-edition/opc-relationships.xsd +33 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/mce/mc.xsd +75 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-2010.xsd +560 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-2012.xsd +67 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-2018.xsd +14 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-cex-2018.xsd +20 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-cid-2016.xsd +13 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-sdtdatahash-2020.xsd +4 -0
- package/dist/skills/builtin/xlsx/scripts/office/schemas/microsoft/wml-symex-2015.xsd +8 -0
- package/dist/skills/builtin/xlsx/scripts/office/soffice.py +183 -0
- package/dist/skills/builtin/xlsx/scripts/office/unpack.py +132 -0
- package/dist/skills/builtin/xlsx/scripts/office/validate.py +111 -0
- package/dist/skills/builtin/xlsx/scripts/office/validators/__init__.py +15 -0
- package/dist/skills/builtin/xlsx/scripts/office/validators/base.py +847 -0
- package/dist/skills/builtin/xlsx/scripts/office/validators/docx.py +446 -0
- package/dist/skills/builtin/xlsx/scripts/office/validators/pptx.py +275 -0
- package/dist/skills/builtin/xlsx/scripts/office/validators/redlining.py +247 -0
- package/dist/skills/builtin/xlsx/scripts/recalc.py +184 -0
- package/dist/tools/agent.d.ts +8 -0
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/agent.js +66 -2
- package/dist/tools/agent.js.map +1 -1
- package/dist/tools/base.d.ts +16 -0
- package/dist/tools/base.d.ts.map +1 -1
- package/dist/tools/base.js +32 -0
- package/dist/tools/base.js.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/bash.js +8 -0
- package/dist/tools/bash.js.map +1 -1
- package/dist/tools/file.d.ts +3 -1
- package/dist/tools/file.d.ts.map +1 -1
- package/dist/tools/file.js +176 -117
- package/dist/tools/file.js.map +1 -1
- package/dist/tools/generate-design.d.ts +5 -1
- package/dist/tools/generate-design.d.ts.map +1 -1
- package/dist/tools/generate-design.js +25 -3
- package/dist/tools/generate-design.js.map +1 -1
- package/dist/tools/goal.d.ts +1 -1
- package/dist/tools/goal.d.ts.map +1 -1
- package/dist/tools/goal.js +18 -9
- package/dist/tools/goal.js.map +1 -1
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +74 -5
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/mcp.d.ts.map +1 -1
- package/dist/tools/mcp.js +5 -0
- package/dist/tools/mcp.js.map +1 -1
- package/dist/tools/memory-search.d.ts +1 -1
- package/dist/tools/memory-search.d.ts.map +1 -1
- package/dist/tools/memory-search.js +1 -1
- package/dist/tools/memory-search.js.map +1 -1
- package/dist/tools/network-agent.js +2 -1
- package/dist/tools/network-agent.js.map +1 -1
- package/dist/tools/notebook-write.d.ts.map +1 -1
- package/dist/tools/notebook-write.js +3 -1
- package/dist/tools/notebook-write.js.map +1 -1
- package/dist/tools/schedule.d.ts.map +1 -1
- package/dist/tools/schedule.js +2 -26
- package/dist/tools/schedule.js.map +1 -1
- package/dist/tools/skill.d.ts +1 -7
- package/dist/tools/skill.d.ts.map +1 -1
- package/dist/tools/skill.js +225 -61
- package/dist/tools/skill.js.map +1 -1
- package/dist/types/messages.d.ts +1 -5
- package/dist/types/messages.d.ts.map +1 -1
- package/dist/web/server/api-manager.d.ts +9 -4
- package/dist/web/server/api-manager.d.ts.map +1 -1
- package/dist/web/server/api-manager.js +173 -63
- package/dist/web/server/api-manager.js.map +1 -1
- package/dist/web/server/app-manager.d.ts +71 -0
- package/dist/web/server/app-manager.d.ts.map +1 -0
- package/dist/web/server/app-manager.js +364 -0
- package/dist/web/server/app-manager.js.map +1 -0
- package/dist/web/server/channels/bridge.d.ts.map +1 -1
- package/dist/web/server/channels/bridge.js +2 -1
- package/dist/web/server/channels/bridge.js.map +1 -1
- package/dist/web/server/codex-auth-manager.d.ts +43 -0
- package/dist/web/server/codex-auth-manager.d.ts.map +1 -0
- package/dist/web/server/codex-auth-manager.js +429 -0
- package/dist/web/server/codex-auth-manager.js.map +1 -0
- package/dist/web/server/conversation.d.ts +34 -5
- package/dist/web/server/conversation.d.ts.map +1 -1
- package/dist/web/server/conversation.js +435 -142
- package/dist/web/server/conversation.js.map +1 -1
- package/dist/web/server/image-attachments.d.ts +23 -0
- package/dist/web/server/image-attachments.d.ts.map +1 -0
- package/dist/web/server/image-attachments.js +93 -0
- package/dist/web/server/image-attachments.js.map +1 -0
- package/dist/web/server/index.d.ts.map +1 -1
- package/dist/web/server/index.js +28 -0
- package/dist/web/server/index.js.map +1 -1
- package/dist/web/server/routes/__tests__/app-api.test.d.ts +5 -0
- package/dist/web/server/routes/__tests__/app-api.test.d.ts.map +1 -0
- package/dist/web/server/routes/__tests__/app-api.test.js +48 -0
- package/dist/web/server/routes/__tests__/app-api.test.js.map +1 -0
- package/dist/web/server/routes/__tests__/tunnel-api.test.d.ts +2 -0
- package/dist/web/server/routes/__tests__/tunnel-api.test.d.ts.map +1 -0
- package/dist/web/server/routes/__tests__/tunnel-api.test.js +96 -0
- package/dist/web/server/routes/__tests__/tunnel-api.test.js.map +1 -0
- package/dist/web/server/routes/ai-editor.d.ts.map +1 -1
- package/dist/web/server/routes/ai-editor.js +9 -45
- package/dist/web/server/routes/ai-editor.js.map +1 -1
- package/dist/web/server/routes/ai-hover.d.ts.map +1 -1
- package/dist/web/server/routes/ai-hover.js +6 -23
- package/dist/web/server/routes/ai-hover.js.map +1 -1
- package/dist/web/server/routes/api.d.ts.map +1 -1
- package/dist/web/server/routes/api.js +27 -23
- package/dist/web/server/routes/api.js.map +1 -1
- package/dist/web/server/routes/app-api.d.ts +8 -0
- package/dist/web/server/routes/app-api.d.ts.map +1 -0
- package/dist/web/server/routes/app-api.js +191 -0
- package/dist/web/server/routes/app-api.js.map +1 -0
- package/dist/web/server/routes/auth.d.ts.map +1 -1
- package/dist/web/server/routes/auth.js +306 -5
- package/dist/web/server/routes/auth.js.map +1 -1
- package/dist/web/server/routes/autocomplete-api.d.ts.map +1 -1
- package/dist/web/server/routes/autocomplete-api.js +5 -43
- package/dist/web/server/routes/autocomplete-api.js.map +1 -1
- package/dist/web/server/routes/axon-cloud.d.ts.map +1 -1
- package/dist/web/server/routes/axon-cloud.js +352 -1
- package/dist/web/server/routes/axon-cloud.js.map +1 -1
- package/dist/web/server/routes/config-api.d.ts.map +1 -1
- package/dist/web/server/routes/config-api.js +12 -20
- package/dist/web/server/routes/config-api.js.map +1 -1
- package/dist/web/server/routes/download-proxy.d.ts.map +1 -1
- package/dist/web/server/routes/download-proxy.js +234 -12
- package/dist/web/server/routes/download-proxy.js.map +1 -1
- package/dist/web/server/routes/network-api.d.ts +1 -0
- package/dist/web/server/routes/network-api.d.ts.map +1 -1
- package/dist/web/server/routes/network-api.js +36 -11
- package/dist/web/server/routes/network-api.js.map +1 -1
- package/dist/web/server/routes/port-forward.d.ts.map +1 -1
- package/dist/web/server/routes/port-forward.js +3 -2
- package/dist/web/server/routes/port-forward.js.map +1 -1
- package/dist/web/server/routes/schedule-api.d.ts.map +1 -1
- package/dist/web/server/routes/schedule-api.js +5 -1
- package/dist/web/server/routes/schedule-api.js.map +1 -1
- package/dist/web/server/routes/tunnel-api.d.ts +14 -0
- package/dist/web/server/routes/tunnel-api.d.ts.map +1 -0
- package/dist/web/server/routes/tunnel-api.js +52 -0
- package/dist/web/server/routes/tunnel-api.js.map +1 -0
- package/dist/web/server/runtime/api-connection-test.d.ts +18 -0
- package/dist/web/server/runtime/api-connection-test.d.ts.map +1 -0
- package/dist/web/server/runtime/api-connection-test.js +62 -0
- package/dist/web/server/runtime/api-connection-test.js.map +1 -0
- package/dist/web/server/runtime/codex-client.d.ts +35 -0
- package/dist/web/server/runtime/codex-client.d.ts.map +1 -0
- package/dist/web/server/runtime/codex-client.js +1202 -0
- package/dist/web/server/runtime/codex-client.js.map +1 -0
- package/dist/web/server/runtime/factory.d.ts +3 -0
- package/dist/web/server/runtime/factory.d.ts.map +1 -0
- package/dist/web/server/runtime/factory.js +16 -0
- package/dist/web/server/runtime/factory.js.map +1 -0
- package/dist/web/server/runtime/runtime-model-catalog.d.ts +10 -0
- package/dist/web/server/runtime/runtime-model-catalog.d.ts.map +1 -0
- package/dist/web/server/runtime/runtime-model-catalog.js +85 -0
- package/dist/web/server/runtime/runtime-model-catalog.js.map +1 -0
- package/dist/web/server/runtime/runtime-model-list.d.ts +24 -0
- package/dist/web/server/runtime/runtime-model-list.d.ts.map +1 -0
- package/dist/web/server/runtime/runtime-model-list.js +43 -0
- package/dist/web/server/runtime/runtime-model-list.js.map +1 -0
- package/dist/web/server/runtime/runtime-selection.d.ts +17 -0
- package/dist/web/server/runtime/runtime-selection.d.ts.map +1 -0
- package/dist/web/server/runtime/runtime-selection.js +35 -0
- package/dist/web/server/runtime/runtime-selection.js.map +1 -0
- package/dist/web/server/runtime/tool-input-normalizer.d.ts +3 -0
- package/dist/web/server/runtime/tool-input-normalizer.d.ts.map +1 -0
- package/dist/web/server/runtime/tool-input-normalizer.js +52 -0
- package/dist/web/server/runtime/tool-input-normalizer.js.map +1 -0
- package/dist/web/server/runtime/types.d.ts +102 -0
- package/dist/web/server/runtime/types.d.ts.map +1 -0
- package/dist/web/server/runtime/types.js +2 -0
- package/dist/web/server/runtime/types.js.map +1 -0
- package/dist/web/server/runtime/utility-client.d.ts +5 -0
- package/dist/web/server/runtime/utility-client.d.ts.map +1 -0
- package/dist/web/server/runtime/utility-client.js +68 -0
- package/dist/web/server/runtime/utility-client.js.map +1 -0
- package/dist/web/server/services/axon-cloud-service.d.ts +24 -0
- package/dist/web/server/services/axon-cloud-service.d.ts.map +1 -1
- package/dist/web/server/services/axon-cloud-service.js +93 -0
- package/dist/web/server/services/axon-cloud-service.js.map +1 -1
- package/dist/web/server/services/config-service.d.ts +8 -2
- package/dist/web/server/services/config-service.d.ts.map +1 -1
- package/dist/web/server/services/config-service.js +51 -0
- package/dist/web/server/services/config-service.js.map +1 -1
- package/dist/web/server/services/gemini-image-service.d.ts +20 -1
- package/dist/web/server/services/gemini-image-service.d.ts.map +1 -1
- package/dist/web/server/services/gemini-image-service.js +121 -13
- package/dist/web/server/services/gemini-image-service.js.map +1 -1
- package/dist/web/server/session-manager.d.ts +10 -0
- package/dist/web/server/session-manager.d.ts.map +1 -1
- package/dist/web/server/session-manager.js +39 -0
- package/dist/web/server/session-manager.js.map +1 -1
- package/dist/web/server/slash-commands.d.ts.map +1 -1
- package/dist/web/server/slash-commands.js +127 -25
- package/dist/web/server/slash-commands.js.map +1 -1
- package/dist/web/server/task-manager.d.ts +4 -15
- package/dist/web/server/task-manager.d.ts.map +1 -1
- package/dist/web/server/task-manager.js +11 -4
- package/dist/web/server/task-manager.js.map +1 -1
- package/dist/web/server/tunnel.d.ts +47 -0
- package/dist/web/server/tunnel.d.ts.map +1 -0
- package/dist/web/server/tunnel.js +165 -0
- package/dist/web/server/tunnel.js.map +1 -0
- package/dist/web/server/user-interaction.d.ts +10 -0
- package/dist/web/server/user-interaction.d.ts.map +1 -1
- package/dist/web/server/user-interaction.js +28 -0
- package/dist/web/server/user-interaction.js.map +1 -1
- package/dist/web/server/web-auth.d.ts +35 -3
- package/dist/web/server/web-auth.d.ts.map +1 -1
- package/dist/web/server/web-auth.js +302 -29
- package/dist/web/server/web-auth.js.map +1 -1
- package/dist/web/server/web-scheduler.d.ts.map +1 -1
- package/dist/web/server/web-scheduler.js +9 -0
- package/dist/web/server/web-scheduler.js.map +1 -1
- package/dist/web/server/websocket-git-handlers.d.ts.map +1 -1
- package/dist/web/server/websocket-git-handlers.js +5 -29
- package/dist/web/server/websocket-git-handlers.js.map +1 -1
- package/dist/web/server/websocket.d.ts.map +1 -1
- package/dist/web/server/websocket.js +246 -70
- package/dist/web/server/websocket.js.map +1 -1
- package/dist/web/shared/auth-summary.d.ts +28 -0
- package/dist/web/shared/auth-summary.d.ts.map +1 -0
- package/dist/web/shared/auth-summary.js +56 -0
- package/dist/web/shared/auth-summary.js.map +1 -0
- package/dist/web/shared/model-catalog.d.ts +31 -0
- package/dist/web/shared/model-catalog.d.ts.map +1 -0
- package/dist/web/shared/model-catalog.js +365 -0
- package/dist/web/shared/model-catalog.js.map +1 -0
- package/dist/web/shared/model-preferences.d.ts +5 -0
- package/dist/web/shared/model-preferences.d.ts.map +1 -0
- package/dist/web/shared/model-preferences.js +13 -0
- package/dist/web/shared/model-preferences.js.map +1 -0
- package/dist/web/shared/runtime-capabilities.d.ts +37 -0
- package/dist/web/shared/runtime-capabilities.d.ts.map +1 -0
- package/dist/web/shared/runtime-capabilities.js +101 -0
- package/dist/web/shared/runtime-capabilities.js.map +1 -0
- package/dist/web/shared/setup-runtime.d.ts +50 -0
- package/dist/web/shared/setup-runtime.d.ts.map +1 -0
- package/dist/web/shared/setup-runtime.js +214 -0
- package/dist/web/shared/setup-runtime.js.map +1 -0
- package/dist/web/shared/thinking-config.d.ts +20 -0
- package/dist/web/shared/thinking-config.d.ts.map +1 -0
- package/dist/web/shared/thinking-config.js +104 -0
- package/dist/web/shared/thinking-config.js.map +1 -0
- package/dist/web/shared/types.d.ts +30 -2
- package/dist/web/shared/types.d.ts.map +1 -1
- package/dist/web/shared/types.js.map +1 -1
- package/electron/main.cjs +15 -3
- package/package.json +6 -2
- package/src/web/client/dist/assets/index-B2M5Nr-5.js +736 -0
- package/src/web/client/dist/assets/index-COEqamS-.css +32 -0
- package/src/web/client/dist/icons/icon-192.png +0 -0
- package/src/web/client/dist/icons/icon-512.png +0 -0
- package/src/web/client/dist/index.html +31 -0
- package/src/web/client/dist/logo.png +0 -0
- package/src/web/client/dist/manifest.webmanifest +25 -0
- package/src/web/client/dist/sw.js +78 -0
|
@@ -26,8 +26,12 @@ import { TerminalManager } from './terminal-manager.js';
|
|
|
26
26
|
import { logger } from '../../utils/logger.js';
|
|
27
27
|
// 错误感知
|
|
28
28
|
import { errorWatcher } from '../../utils/error-watcher.js';
|
|
29
|
+
import { buildImageAttachmentPathHints, saveBase64AttachmentToTempFile, } from './image-attachments.js';
|
|
30
|
+
import { getDefaultWebModelForBackend, normalizeWebRuntimeModelForBackend, } from '../shared/model-catalog.js';
|
|
29
31
|
// Git WebSocket 处理函数
|
|
30
32
|
import { handleGitGetStatus, handleGitGetLog, handleGitGetBranches, handleGitGetStashes, handleGitStage, handleGitUnstage, handleGitCommit, handleGitPush, handleGitPull, handleGitCheckout, handleGitStashAndCheckout, handleGitForceCheckout, handleGitCreateBranch, handleGitDeleteBranch, handleGitStashSave, handleGitStashPop, handleGitStashDrop, handleGitStashApply, handleGitGetDiff, handleGitGetCommitDetail, handleGitGetCommitFileDiff, handleGitSmartCommit, handleGitSmartReview, handleGitSmartCommitAndReview, handleGitExplainCommit, handleGitMerge, handleGitRebase, handleGitMergeAbort, handleGitRebaseContinue, handleGitRebaseAbort, handleGitReset, handleGitDiscardFile, handleGitStageAll, handleGitUnstageAll, handleGitDiscardAll, handleGitAmendCommit, handleGitRevertCommit, handleGitCherryPick, handleGitGetTags, handleGitCreateTag, handleGitDeleteTag, handleGitPushTags, handleGitGetRemotes, handleGitAddRemote, handleGitRemoveRemote, handleGitFetch, handleGitSearchCommits, handleGitGetFileHistory, handleGitGetBlame, handleGitCompareBranches, handleGitGetMergeStatus, handleGitGetConflicts, handleGitResolveLock, } from './websocket-git-handlers.js';
|
|
33
|
+
// cmux 终端集成(macOS 原生 AI 终端 https://github.com/manaflow-ai/cmux)
|
|
34
|
+
import { getCmuxBridge } from '../../notifications/cmux.js';
|
|
31
35
|
// ============================================================================
|
|
32
36
|
// 工具分类函数 - 用于 Web UI 状态反馈
|
|
33
37
|
// ============================================================================
|
|
@@ -63,6 +67,19 @@ const activeE2EState = new Map();
|
|
|
63
67
|
const activeLeadAgentState = new Map();
|
|
64
68
|
// 背压阈值:单连接缓冲区超过此字节数则视为慢客户端(参考 OpenClaw server-broadcast.ts)
|
|
65
69
|
const MAX_BUFFERED_BYTES = 10 * 1024 * 1024; // 10MB
|
|
70
|
+
function getDefaultChatModel(runtimeBackend = webAuth.getRuntimeBackend()) {
|
|
71
|
+
return getDefaultWebModelForBackend(runtimeBackend, webAuth.getDefaultModelByBackend()[runtimeBackend]);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 会话操作互斥锁:确保修改 client.sessionId 的操作不会并发执行
|
|
75
|
+
* 使用 Promise 链模式:每个操作 await 上一个操作完成后才开始
|
|
76
|
+
*/
|
|
77
|
+
function withSessionMutex(client, fn) {
|
|
78
|
+
const prev = client.sessionMutex || Promise.resolve();
|
|
79
|
+
let resolve;
|
|
80
|
+
client.sessionMutex = new Promise(r => { resolve = r; });
|
|
81
|
+
return prev.then(() => fn()).finally(() => resolve());
|
|
82
|
+
}
|
|
66
83
|
// 全局检查点管理器实例(惰性初始化,避免模块加载时的副作用日志)
|
|
67
84
|
let _checkpointManager = null;
|
|
68
85
|
function getCheckpointManager() {
|
|
@@ -1026,11 +1043,14 @@ export function setupWebSocket(wss, conversationManager) {
|
|
|
1026
1043
|
wss.on('connection', (ws) => {
|
|
1027
1044
|
const clientId = randomUUID();
|
|
1028
1045
|
const sessionId = randomUUID();
|
|
1046
|
+
const runtimeBackend = webAuth.getRuntimeBackend();
|
|
1047
|
+
const defaultModel = getDefaultChatModel(runtimeBackend);
|
|
1029
1048
|
const client = {
|
|
1030
1049
|
id: clientId,
|
|
1031
1050
|
ws,
|
|
1032
1051
|
sessionId,
|
|
1033
|
-
model:
|
|
1052
|
+
model: defaultModel,
|
|
1053
|
+
runtimeBackend,
|
|
1034
1054
|
isAlive: true,
|
|
1035
1055
|
swarmSubscriptions: new Set(),
|
|
1036
1056
|
permissionMode: 'bypassPermissions',
|
|
@@ -1042,7 +1062,8 @@ export function setupWebSocket(wss, conversationManager) {
|
|
|
1042
1062
|
type: 'connected',
|
|
1043
1063
|
payload: {
|
|
1044
1064
|
sessionId,
|
|
1045
|
-
model:
|
|
1065
|
+
model: defaultModel,
|
|
1066
|
+
runtimeBackend,
|
|
1046
1067
|
serverStartTime,
|
|
1047
1068
|
},
|
|
1048
1069
|
});
|
|
@@ -1192,15 +1213,27 @@ async function handleClientMessage(client, message, conversationManager, swarmSu
|
|
|
1192
1213
|
});
|
|
1193
1214
|
break;
|
|
1194
1215
|
}
|
|
1195
|
-
case 'chat':
|
|
1196
|
-
//
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
client.
|
|
1216
|
+
case 'chat': {
|
|
1217
|
+
// 使用会话互斥锁保护 session 初始化阶段(读取/修改 client.sessionId)
|
|
1218
|
+
// 但不锁住整个流式响应,否则 session_new/session_switch 会被阻塞到 AI 回复完成
|
|
1219
|
+
const chatContext = await withSessionMutex(client, async () => {
|
|
1220
|
+
// 确保会话关联 WebSocket
|
|
1221
|
+
conversationManager.setWebSocket(client.sessionId, ws);
|
|
1222
|
+
// 如果消息中包含 projectPath,更新 client.projectPath
|
|
1223
|
+
if (message.payload.projectPath !== undefined) {
|
|
1224
|
+
client.projectPath = message.payload.projectPath;
|
|
1225
|
+
}
|
|
1226
|
+
// prepareChatSession: 初始化会话并返回闭包需要的上下文
|
|
1227
|
+
// 这里完成所有需要互斥保护的操作:读取 sessionId、创建持久化会话、更新 client.sessionId
|
|
1228
|
+
const ctx = await prepareChatSession(client, message.payload.content, message.payload.attachments || message.payload.images, conversationManager, message.payload.thinkingConfig);
|
|
1229
|
+
return ctx;
|
|
1230
|
+
});
|
|
1231
|
+
// Phase 2: 在锁外执行流式 chat(chatContext 中的 chatSessionId 已是闭包安全值)
|
|
1232
|
+
if (chatContext) {
|
|
1233
|
+
await executeChatStreaming(chatContext, conversationManager, message.payload.messageId);
|
|
1201
1234
|
}
|
|
1202
|
-
await handleChatMessage(client, message.payload.content, message.payload.attachments || message.payload.images, conversationManager, message.payload.messageId);
|
|
1203
1235
|
break;
|
|
1236
|
+
}
|
|
1204
1237
|
case 'cancel':
|
|
1205
1238
|
conversationManager.cancel(client.sessionId);
|
|
1206
1239
|
sendMessage(ws, {
|
|
@@ -1223,8 +1256,8 @@ async function handleClientMessage(client, message, conversationManager, swarmSu
|
|
|
1223
1256
|
});
|
|
1224
1257
|
break;
|
|
1225
1258
|
case 'set_model':
|
|
1226
|
-
client.model = message.payload.model;
|
|
1227
|
-
conversationManager.setModel(client.sessionId,
|
|
1259
|
+
client.model = normalizeWebRuntimeModelForBackend(client.runtimeBackend, message.payload.model, webAuth.getDefaultModelByBackend()[client.runtimeBackend]);
|
|
1260
|
+
conversationManager.setModel(client.sessionId, client.model);
|
|
1228
1261
|
break;
|
|
1229
1262
|
case 'set_language':
|
|
1230
1263
|
try {
|
|
@@ -1279,15 +1312,15 @@ async function handleClientMessage(client, message, conversationManager, swarmSu
|
|
|
1279
1312
|
await handleSessionList(client, message.payload, conversationManager);
|
|
1280
1313
|
break;
|
|
1281
1314
|
case 'session_create':
|
|
1282
|
-
await handleSessionCreate(client, message.payload, conversationManager);
|
|
1315
|
+
await withSessionMutex(client, () => handleSessionCreate(client, message.payload, conversationManager));
|
|
1283
1316
|
break;
|
|
1284
1317
|
case 'session_new':
|
|
1285
1318
|
// 官方规范:创建新的临时会话(不立即持久化)
|
|
1286
1319
|
// 会话只有在发送第一条消息后才会真正创建
|
|
1287
|
-
await handleSessionNew(client, message.payload, conversationManager);
|
|
1320
|
+
await withSessionMutex(client, () => handleSessionNew(client, message.payload, conversationManager));
|
|
1288
1321
|
break;
|
|
1289
1322
|
case 'session_switch':
|
|
1290
|
-
await handleSessionSwitch(client, message.payload.sessionId, conversationManager);
|
|
1323
|
+
await withSessionMutex(client, () => handleSessionSwitch(client, message.payload.sessionId, conversationManager));
|
|
1291
1324
|
break;
|
|
1292
1325
|
case 'session_delete':
|
|
1293
1326
|
await handleSessionDelete(client, message.payload.sessionId, conversationManager);
|
|
@@ -1882,9 +1915,10 @@ async function handleClientMessage(client, message, conversationManager, swarmSu
|
|
|
1882
1915
|
}
|
|
1883
1916
|
}
|
|
1884
1917
|
/**
|
|
1885
|
-
*
|
|
1918
|
+
* Phase 1: 在互斥锁内执行 — 初始化会话并返回流式 chat 所需的上下文
|
|
1919
|
+
* 所有读取/修改 client.sessionId 的操作在此完成
|
|
1886
1920
|
*/
|
|
1887
|
-
async function
|
|
1921
|
+
async function prepareChatSession(client, content, attachments, conversationManager, thinkingConfig) {
|
|
1888
1922
|
const { ws, model, projectPath } = client;
|
|
1889
1923
|
let { sessionId } = client;
|
|
1890
1924
|
console.log(`[WebSocket] handleChatMessage - sessionId: ${sessionId}, projectPath: ${projectPath || 'undefined'}`);
|
|
@@ -1894,12 +1928,12 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
1894
1928
|
type: 'error',
|
|
1895
1929
|
payload: { message: 'API Key not configured. Please configure an API Key in settings or log in via OAuth before sending messages.' },
|
|
1896
1930
|
});
|
|
1897
|
-
return;
|
|
1931
|
+
return null;
|
|
1898
1932
|
}
|
|
1899
1933
|
// 检查是否为斜杠命令
|
|
1900
1934
|
if (isSlashCommand(content)) {
|
|
1901
|
-
await handleSlashCommand(client, content, conversationManager);
|
|
1902
|
-
return;
|
|
1935
|
+
await handleSlashCommand(client, content, conversationManager, thinkingConfig);
|
|
1936
|
+
return null;
|
|
1903
1937
|
}
|
|
1904
1938
|
// 确保会话存在于 sessionManager 中(处理临时会话 ID 的情况)
|
|
1905
1939
|
const sessionManager = conversationManager.getSessionManager();
|
|
@@ -1908,14 +1942,17 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
1908
1942
|
if (!existingSession) {
|
|
1909
1943
|
// 当前 sessionId 是临时的(WebSocket 连接时生成的),需要创建持久化会话
|
|
1910
1944
|
// 官方规范:使用第一条消息的前50个字符作为会话标题
|
|
1945
|
+
const temporarySessionId = sessionId;
|
|
1911
1946
|
const firstPrompt = content.substring(0, 50);
|
|
1912
1947
|
console.log(`[WebSocket] Temporary session ${sessionId}, creating persistent session, title: ${firstPrompt}, projectPath: ${client.projectPath || 'global'}`);
|
|
1913
1948
|
const newSession = sessionManager.createSession({
|
|
1914
1949
|
name: firstPrompt, // 使用 firstPrompt 作为会话标题
|
|
1915
1950
|
model: model,
|
|
1951
|
+
runtimeBackend: client.runtimeBackend,
|
|
1916
1952
|
tags: ['webui'],
|
|
1917
1953
|
projectPath: client.projectPath, // 传递项目路径
|
|
1918
1954
|
});
|
|
1955
|
+
sessionManager.registerTemporarySessionId(newSession.metadata.id, temporarySessionId);
|
|
1919
1956
|
// 更新 client 的 sessionId
|
|
1920
1957
|
client.sessionId = newSession.metadata.id;
|
|
1921
1958
|
sessionId = newSession.metadata.id;
|
|
@@ -1928,6 +1965,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
1928
1965
|
sessionId: newSession.metadata.id,
|
|
1929
1966
|
name: newSession.metadata.name,
|
|
1930
1967
|
model: newSession.metadata.model,
|
|
1968
|
+
runtimeBackend: client.runtimeBackend,
|
|
1931
1969
|
createdAt: newSession.metadata.createdAt,
|
|
1932
1970
|
},
|
|
1933
1971
|
});
|
|
@@ -1945,22 +1983,43 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
1945
1983
|
console.log(`[WebSocket] Updating session title to firstPrompt: ${firstPrompt}`);
|
|
1946
1984
|
}
|
|
1947
1985
|
}
|
|
1948
|
-
|
|
1949
|
-
// 处理附件:图片直接传递给 Claude API,其他文件保存为临时文件传路径
|
|
1986
|
+
// 处理附件:图片传递给模型视觉输入,同时也落盘为稳定的临时文件引用
|
|
1950
1987
|
let mediaAttachments;
|
|
1951
1988
|
let fileAttachments;
|
|
1952
1989
|
let enhancedContent = content;
|
|
1953
1990
|
if (attachments && Array.isArray(attachments)) {
|
|
1954
1991
|
if (attachments.length > 0 && typeof attachments[0] === 'object') {
|
|
1955
1992
|
const typedAttachments = attachments;
|
|
1956
|
-
//
|
|
1993
|
+
// 提取图片附件(视觉输入 + 稳定临时文件路径)
|
|
1957
1994
|
mediaAttachments = typedAttachments
|
|
1958
1995
|
.filter(att => att.type === 'image')
|
|
1959
|
-
.map(att =>
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1996
|
+
.map(att => {
|
|
1997
|
+
const imageAttachment = {
|
|
1998
|
+
name: att.name,
|
|
1999
|
+
data: att.data,
|
|
2000
|
+
mimeType: att.mimeType || 'image/png',
|
|
2001
|
+
type: 'image',
|
|
2002
|
+
};
|
|
2003
|
+
try {
|
|
2004
|
+
imageAttachment.filePath = saveBase64AttachmentToTempFile(att.name, att.data);
|
|
2005
|
+
console.log('[WebSocket] Image attachment saved to temp file: ' + imageAttachment.filePath);
|
|
2006
|
+
}
|
|
2007
|
+
catch (error) {
|
|
2008
|
+
console.warn(`[WebSocket] Failed to persist image attachment ${att.name}:`, error);
|
|
2009
|
+
}
|
|
2010
|
+
return imageAttachment;
|
|
2011
|
+
});
|
|
2012
|
+
const imagePathHints = buildImageAttachmentPathHints(mediaAttachments);
|
|
2013
|
+
if (imagePathHints.length > 0) {
|
|
2014
|
+
enhancedContent = `Uploaded image files:\n${imagePathHints.join('\n')}\nUse the exact local image path above if you call ImageGen for one of these uploads.${enhancedContent ? `\n\n${enhancedContent}` : ''}`;
|
|
2015
|
+
}
|
|
2016
|
+
// 将图片编辑偏好显式注入到本轮文本上下文,降低模型忽略附件元数据的概率
|
|
2017
|
+
const imageEditHints = typedAttachments
|
|
2018
|
+
.filter(att => att.type === 'image' && att.imageEditStrength)
|
|
2019
|
+
.map(att => `- ${att.name}: preferred image edit strength = ${att.imageEditStrength}`);
|
|
2020
|
+
if (imageEditHints.length > 0) {
|
|
2021
|
+
enhancedContent = `Image attachment edit preferences:\n${imageEditHints.join('\n')}${enhancedContent ? `\n\n${enhancedContent}` : ''}`;
|
|
2022
|
+
}
|
|
1964
2023
|
// 所有非图片附件统一保存为临时文件(包括 pdf/docx/xlsx/pptx/text/file 等任意格式)
|
|
1965
2024
|
fileAttachments = typedAttachments
|
|
1966
2025
|
.filter(att => att.type !== 'image')
|
|
@@ -1972,11 +2031,26 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
1972
2031
|
}
|
|
1973
2032
|
else {
|
|
1974
2033
|
// 旧格式:直接是 base64 字符串数组(默认图片 png)
|
|
1975
|
-
mediaAttachments = attachments.map(data =>
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
2034
|
+
mediaAttachments = attachments.map((data, index) => {
|
|
2035
|
+
const imageAttachment = {
|
|
2036
|
+
name: `uploaded-image-${index + 1}.png`,
|
|
2037
|
+
data,
|
|
2038
|
+
mimeType: 'image/png',
|
|
2039
|
+
type: 'image',
|
|
2040
|
+
};
|
|
2041
|
+
try {
|
|
2042
|
+
imageAttachment.filePath = saveBase64AttachmentToTempFile(imageAttachment.name, data);
|
|
2043
|
+
console.log('[WebSocket] Legacy image attachment saved to temp file: ' + imageAttachment.filePath);
|
|
2044
|
+
}
|
|
2045
|
+
catch (error) {
|
|
2046
|
+
console.warn(`[WebSocket] Failed to persist legacy image attachment ${imageAttachment.name}:`, error);
|
|
2047
|
+
}
|
|
2048
|
+
return imageAttachment;
|
|
2049
|
+
});
|
|
2050
|
+
const imagePathHints = buildImageAttachmentPathHints(mediaAttachments);
|
|
2051
|
+
if (imagePathHints.length > 0) {
|
|
2052
|
+
enhancedContent = `Uploaded image files:\n${imagePathHints.join('\n')}\nUse the exact local image path above if you call ImageGen for one of these uploads.${enhancedContent ? `\n\n${enhancedContent}` : ''}`;
|
|
2053
|
+
}
|
|
1980
2054
|
}
|
|
1981
2055
|
}
|
|
1982
2056
|
// 处理非图片文件附件:保存到临时目录,将文件路径告知模型
|
|
@@ -2007,6 +2081,26 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2007
2081
|
const getActiveWs = () => {
|
|
2008
2082
|
return conversationManager.getWebSocket(chatSessionId) || ws;
|
|
2009
2083
|
};
|
|
2084
|
+
return {
|
|
2085
|
+
chatSessionId,
|
|
2086
|
+
model,
|
|
2087
|
+
projectPath: client.projectPath,
|
|
2088
|
+
ws,
|
|
2089
|
+
enhancedContent,
|
|
2090
|
+
mediaAttachments,
|
|
2091
|
+
permissionMode: client.permissionMode,
|
|
2092
|
+
runtimeBackend: client.runtimeBackend,
|
|
2093
|
+
thinkingConfig,
|
|
2094
|
+
getActiveWs,
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Phase 2: 在互斥锁外执行 — 实际的流式 AI 对话
|
|
2099
|
+
* 使用 chatSessionId 闭包值,不再读写 client.sessionId
|
|
2100
|
+
*/
|
|
2101
|
+
async function executeChatStreaming(ctx, conversationManager, userMessageId) {
|
|
2102
|
+
const { chatSessionId, model, enhancedContent, mediaAttachments, thinkingConfig, getActiveWs } = ctx;
|
|
2103
|
+
const messageId = randomUUID();
|
|
2010
2104
|
// 始终发送流式消息到 WebSocket,不做服务端门控
|
|
2011
2105
|
// 客户端已有基于 sessionId 的会话隔离过滤(useMessageHandler),
|
|
2012
2106
|
// 服务端门控(isActiveSession)会导致用户切换会话或刷新页面时消息永久丢失,
|
|
@@ -2019,6 +2113,9 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2019
2113
|
type: 'status',
|
|
2020
2114
|
payload: { status: 'thinking', sessionId: chatSessionId },
|
|
2021
2115
|
});
|
|
2116
|
+
// cmux 集成:通知 cmux 终端 Agent 开始思考
|
|
2117
|
+
const cmux = getCmuxBridge();
|
|
2118
|
+
cmux.onThinking();
|
|
2022
2119
|
try {
|
|
2023
2120
|
// 调用对话管理器,传入流式回调(媒体附件包含 mimeType 和类型)
|
|
2024
2121
|
// 所有回调使用 getActiveWs() 动态获取 WebSocket,确保刷新后消息仍能送达
|
|
@@ -2057,6 +2154,13 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2057
2154
|
type: 'status',
|
|
2058
2155
|
payload: { status: 'tool_executing', message: `Executing ${toolName}...`, sessionId: chatSessionId },
|
|
2059
2156
|
});
|
|
2157
|
+
cmux.onToolStart(toolName);
|
|
2158
|
+
},
|
|
2159
|
+
onToolUseInputReady: (toolUseId, input) => {
|
|
2160
|
+
sendMessage(getActiveWs(), {
|
|
2161
|
+
type: 'tool_use_input_ready',
|
|
2162
|
+
payload: { toolUseId, input, sessionId: chatSessionId },
|
|
2163
|
+
});
|
|
2060
2164
|
},
|
|
2061
2165
|
onToolUseDelta: (toolUseId, partialJson) => {
|
|
2062
2166
|
sendMessage(getActiveWs(), {
|
|
@@ -2083,6 +2187,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2083
2187
|
type: 'permission_request',
|
|
2084
2188
|
payload: { ...request, sessionId: chatSessionId },
|
|
2085
2189
|
});
|
|
2190
|
+
cmux.onPermissionRequest(request.toolName || 'Unknown', request.description || 'execute');
|
|
2086
2191
|
},
|
|
2087
2192
|
onComplete: async (stopReason, usage) => {
|
|
2088
2193
|
// 保存会话到磁盘(确保 messageCount 正确更新)
|
|
@@ -2112,6 +2217,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2112
2217
|
type: 'status',
|
|
2113
2218
|
payload: { status: 'idle', sessionId: chatSessionId },
|
|
2114
2219
|
});
|
|
2220
|
+
cmux.onComplete();
|
|
2115
2221
|
},
|
|
2116
2222
|
onError: (error) => {
|
|
2117
2223
|
// 页面刷新恢复:错误时也需要重发 history 确保客户端状态一致
|
|
@@ -2130,6 +2236,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2130
2236
|
type: 'status',
|
|
2131
2237
|
payload: { status: 'idle', sessionId: chatSessionId },
|
|
2132
2238
|
});
|
|
2239
|
+
cmux.onError(error.message);
|
|
2133
2240
|
},
|
|
2134
2241
|
onContextUpdate: (usage) => {
|
|
2135
2242
|
sendMessage(getActiveWs(), {
|
|
@@ -2160,7 +2267,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2160
2267
|
});
|
|
2161
2268
|
}
|
|
2162
2269
|
},
|
|
2163
|
-
},
|
|
2270
|
+
}, ctx.projectPath, getActiveWs(), ctx.permissionMode, userMessageId, thinkingConfig); // 传入动态 ws、权限模式和前端消息 ID,确保跨会话持久化
|
|
2164
2271
|
}
|
|
2165
2272
|
catch (error) {
|
|
2166
2273
|
console.error('[WebSocket] Chat handling error:', error);
|
|
@@ -2177,7 +2284,7 @@ async function handleChatMessage(client, content, attachments, conversationManag
|
|
|
2177
2284
|
/**
|
|
2178
2285
|
* 处理斜杠命令
|
|
2179
2286
|
*/
|
|
2180
|
-
async function handleSlashCommand(client, command, conversationManager) {
|
|
2287
|
+
async function handleSlashCommand(client, command, conversationManager, thinkingConfig) {
|
|
2181
2288
|
const { ws, sessionId, model, projectPath } = client;
|
|
2182
2289
|
try {
|
|
2183
2290
|
// 获取当前工作目录(优先使用项目路径)
|
|
@@ -2221,7 +2328,9 @@ async function handleSlashCommand(client, command, conversationManager) {
|
|
|
2221
2328
|
}
|
|
2222
2329
|
// 如果命令返回 chatPrompt,将其作为聊天消息发送给 AI(用于 /init 等命令)
|
|
2223
2330
|
if (result.success && result.data?.chatPrompt) {
|
|
2224
|
-
await
|
|
2331
|
+
const ctx = await withSessionMutex(client, () => prepareChatSession(client, result.data.chatPrompt, undefined, conversationManager, thinkingConfig));
|
|
2332
|
+
if (ctx)
|
|
2333
|
+
await executeChatStreaming(ctx, conversationManager);
|
|
2225
2334
|
return;
|
|
2226
2335
|
}
|
|
2227
2336
|
// 如果内置命令未找到,尝试作为 skill 执行
|
|
@@ -2246,7 +2355,9 @@ async function handleSlashCommand(client, command, conversationManager) {
|
|
|
2246
2355
|
}
|
|
2247
2356
|
const messageContent = `[Skill: ${skill.skillName}]\n\n${skillContent}`;
|
|
2248
2357
|
console.log(`[WebSocket] Executing skill ${skill.skillName}, content length: ${skillContent.length}`);
|
|
2249
|
-
await
|
|
2358
|
+
const skillCtx = await withSessionMutex(client, () => prepareChatSession(client, messageContent, undefined, conversationManager, thinkingConfig));
|
|
2359
|
+
if (skillCtx)
|
|
2360
|
+
await executeChatStreaming(skillCtx, conversationManager);
|
|
2250
2361
|
return;
|
|
2251
2362
|
}
|
|
2252
2363
|
}
|
|
@@ -2326,6 +2437,7 @@ async function handleSessionList(client, payload, conversationManager) {
|
|
|
2326
2437
|
updatedAt: s.updatedAt,
|
|
2327
2438
|
messageCount: s.messageCount,
|
|
2328
2439
|
model: s.model,
|
|
2440
|
+
runtimeBackend: s.runtimeBackend,
|
|
2329
2441
|
cost: s.cost,
|
|
2330
2442
|
tokenUsage: s.tokenUsage,
|
|
2331
2443
|
tags: s.tags,
|
|
@@ -2357,22 +2469,27 @@ async function handleSessionCreate(client, payload, conversationManager) {
|
|
|
2357
2469
|
try {
|
|
2358
2470
|
const { name, model, tags, projectPath } = payload;
|
|
2359
2471
|
const sessionManager = conversationManager.getSessionManager();
|
|
2472
|
+
const runtimeBackend = payload?.runtimeBackend || client.runtimeBackend || webAuth.getRuntimeBackend();
|
|
2473
|
+
const effectiveModel = normalizeWebRuntimeModelForBackend(runtimeBackend, model || client.model || getDefaultChatModel(runtimeBackend), webAuth.getDefaultModelByBackend()[runtimeBackend]);
|
|
2360
2474
|
const newSession = sessionManager.createSession({
|
|
2361
2475
|
name: name || `WebUI Session - ${new Date().toLocaleString('en-US')}`,
|
|
2362
|
-
model:
|
|
2476
|
+
model: effectiveModel,
|
|
2477
|
+
runtimeBackend,
|
|
2363
2478
|
tags: tags || ['webui'],
|
|
2364
2479
|
projectPath,
|
|
2365
2480
|
});
|
|
2366
2481
|
// 更新客户端会话状态
|
|
2367
2482
|
client.sessionId = newSession.metadata.id;
|
|
2368
|
-
client.model =
|
|
2483
|
+
client.model = effectiveModel;
|
|
2484
|
+
client.runtimeBackend = runtimeBackend;
|
|
2369
2485
|
client.projectPath = projectPath;
|
|
2370
2486
|
sendMessage(ws, {
|
|
2371
2487
|
type: 'session_created',
|
|
2372
2488
|
payload: {
|
|
2373
2489
|
sessionId: newSession.metadata.id,
|
|
2374
2490
|
name: newSession.metadata.name,
|
|
2375
|
-
model:
|
|
2491
|
+
model: effectiveModel,
|
|
2492
|
+
runtimeBackend,
|
|
2376
2493
|
createdAt: newSession.metadata.createdAt,
|
|
2377
2494
|
projectPath: newSession.metadata.projectPath,
|
|
2378
2495
|
},
|
|
@@ -2400,11 +2517,13 @@ async function handleSessionNew(client, payload, conversationManager) {
|
|
|
2400
2517
|
await conversationManager.persistSession(client.sessionId);
|
|
2401
2518
|
// 生成新的临时 sessionId(使用 crypto 生成 UUID)
|
|
2402
2519
|
const tempSessionId = randomUUID();
|
|
2403
|
-
const
|
|
2520
|
+
const runtimeBackend = payload?.runtimeBackend || client.runtimeBackend || webAuth.getRuntimeBackend();
|
|
2521
|
+
const model = normalizeWebRuntimeModelForBackend(runtimeBackend, payload?.model || client.model || getDefaultChatModel(runtimeBackend), webAuth.getDefaultModelByBackend()[runtimeBackend]);
|
|
2404
2522
|
const projectPath = payload?.projectPath;
|
|
2405
2523
|
// 更新 client 的 sessionId、model 和 projectPath
|
|
2406
2524
|
client.sessionId = tempSessionId;
|
|
2407
2525
|
client.model = model;
|
|
2526
|
+
client.runtimeBackend = runtimeBackend;
|
|
2408
2527
|
client.projectPath = projectPath;
|
|
2409
2528
|
// 清空内存中的会话状态(如果存在)
|
|
2410
2529
|
// 不创建持久化会话,等待用户发送第一条消息时再创建
|
|
@@ -2415,6 +2534,7 @@ async function handleSessionNew(client, payload, conversationManager) {
|
|
|
2415
2534
|
payload: {
|
|
2416
2535
|
sessionId: tempSessionId,
|
|
2417
2536
|
model: model,
|
|
2537
|
+
runtimeBackend,
|
|
2418
2538
|
projectPath,
|
|
2419
2539
|
},
|
|
2420
2540
|
});
|
|
@@ -2429,39 +2549,68 @@ async function handleSessionNew(client, payload, conversationManager) {
|
|
|
2429
2549
|
});
|
|
2430
2550
|
}
|
|
2431
2551
|
}
|
|
2552
|
+
function resolveSessionRestoreTargetId(conversationManager, requestedSessionId) {
|
|
2553
|
+
const resolvedSessionId = conversationManager.getSessionManager().findSessionIdByTemporarySessionId(requestedSessionId);
|
|
2554
|
+
if (resolvedSessionId && resolvedSessionId !== requestedSessionId) {
|
|
2555
|
+
console.log(`[WebSocket] Resolved temporary session ${requestedSessionId} -> ${resolvedSessionId}`);
|
|
2556
|
+
return resolvedSessionId;
|
|
2557
|
+
}
|
|
2558
|
+
return requestedSessionId;
|
|
2559
|
+
}
|
|
2432
2560
|
/**
|
|
2433
2561
|
* 处理切换会话请求
|
|
2434
2562
|
*/
|
|
2435
2563
|
async function handleSessionSwitch(client, sessionId, conversationManager) {
|
|
2436
2564
|
const { ws } = client;
|
|
2437
2565
|
try {
|
|
2566
|
+
let targetSessionId = sessionId;
|
|
2438
2567
|
// 提前更新 ws:如果目标会话已在内存中(正在处理),立即将其 ws 指向新连接
|
|
2439
2568
|
// 这样在 await resumeSession() 期间,流式回调就能通过 getActiveWs() 获取到新 ws,
|
|
2440
2569
|
// 避免消息发送到已关闭的旧连接而丢失
|
|
2441
|
-
conversationManager.setWebSocket(
|
|
2570
|
+
conversationManager.setWebSocket(targetSessionId, ws);
|
|
2442
2571
|
// 保存当前会话
|
|
2443
2572
|
await conversationManager.persistSession(client.sessionId);
|
|
2444
2573
|
// 恢复目标会话(传入客户端权限模式,确保 YOLO 等模式跨会话持久化)
|
|
2445
|
-
|
|
2574
|
+
let success = await conversationManager.resumeSession(targetSessionId, client.permissionMode);
|
|
2575
|
+
if (!success) {
|
|
2576
|
+
const resolvedSessionId = resolveSessionRestoreTargetId(conversationManager, targetSessionId);
|
|
2577
|
+
if (resolvedSessionId !== targetSessionId) {
|
|
2578
|
+
targetSessionId = resolvedSessionId;
|
|
2579
|
+
conversationManager.setWebSocket(targetSessionId, ws);
|
|
2580
|
+
success = await conversationManager.resumeSession(targetSessionId, client.permissionMode);
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2446
2583
|
if (success) {
|
|
2447
2584
|
// 更新客户端会话ID
|
|
2448
|
-
client.sessionId =
|
|
2585
|
+
client.sessionId = targetSessionId;
|
|
2449
2586
|
// 恢复后再次更新 ws(resumeSession 可能从磁盘新建了 SessionState)
|
|
2450
|
-
conversationManager.setWebSocket(
|
|
2587
|
+
conversationManager.setWebSocket(targetSessionId, ws);
|
|
2451
2588
|
// 更新客户端项目路径(优化:从内存中的 SessionState 获取,避免重复读磁盘)
|
|
2452
|
-
const projectPath = conversationManager.getSessionProjectPath(
|
|
2589
|
+
const projectPath = conversationManager.getSessionProjectPath(targetSessionId);
|
|
2453
2590
|
if (projectPath) {
|
|
2454
2591
|
client.projectPath = projectPath;
|
|
2455
2592
|
}
|
|
2456
2593
|
// 获取会话历史(使用 getLiveHistory:处理中时从 messages 实时构建,确保工具调用中间 turn 不丢失)
|
|
2457
|
-
const history = conversationManager.getLiveHistory(
|
|
2458
|
-
console.log(`[WebSocket] handleSessionSwitch: sessionId=${
|
|
2594
|
+
const history = conversationManager.getLiveHistory(targetSessionId);
|
|
2595
|
+
console.log(`[WebSocket] handleSessionSwitch: sessionId=${targetSessionId}, history.length=${history.length}, isProcessing=${conversationManager.isSessionProcessing(targetSessionId)}`);
|
|
2596
|
+
const sessionName = conversationManager.getSessionName(targetSessionId);
|
|
2597
|
+
const sessionRuntimeBackend = conversationManager.getSessionRuntimeBackend(targetSessionId) || webAuth.getRuntimeBackend();
|
|
2598
|
+
const sessionModel = conversationManager.getSessionModel(targetSessionId) || getDefaultChatModel(sessionRuntimeBackend);
|
|
2599
|
+
client.model = sessionModel;
|
|
2600
|
+
client.runtimeBackend = sessionRuntimeBackend;
|
|
2459
2601
|
sendMessage(ws, {
|
|
2460
2602
|
type: 'session_switched',
|
|
2461
|
-
payload: {
|
|
2603
|
+
payload: {
|
|
2604
|
+
sessionId: targetSessionId,
|
|
2605
|
+
sessionName,
|
|
2606
|
+
projectPath: client.projectPath,
|
|
2607
|
+
history,
|
|
2608
|
+
model: sessionModel,
|
|
2609
|
+
runtimeBackend: sessionRuntimeBackend,
|
|
2610
|
+
},
|
|
2462
2611
|
});
|
|
2463
2612
|
// 同步权限配置到客户端(刷新后客户端 permissionMode 会重置为 'default',需要从服务端恢复)
|
|
2464
|
-
const permConfig = conversationManager.getPermissionConfig(
|
|
2613
|
+
const permConfig = conversationManager.getPermissionConfig(targetSessionId);
|
|
2465
2614
|
if (permConfig) {
|
|
2466
2615
|
sendMessage(ws, {
|
|
2467
2616
|
type: 'permission_config_update',
|
|
@@ -2475,33 +2624,33 @@ async function handleSessionSwitch(client, sessionId, conversationManager) {
|
|
|
2475
2624
|
}
|
|
2476
2625
|
// 如果会话正在处理中(如页面刷新),恢复流式状态
|
|
2477
2626
|
// 补发 message_start + 已累积的内容,让客户端立即显示已生成的内容
|
|
2478
|
-
const isProcessing = conversationManager.isSessionProcessing(
|
|
2627
|
+
const isProcessing = conversationManager.isSessionProcessing(targetSessionId);
|
|
2479
2628
|
if (isProcessing) {
|
|
2480
2629
|
const resumeMessageId = `resume-${Date.now()}`;
|
|
2481
2630
|
// 补发 message_start,客户端收到后会创建 currentMessageRef
|
|
2482
2631
|
sendMessage(ws, {
|
|
2483
2632
|
type: 'message_start',
|
|
2484
|
-
payload: { messageId: resumeMessageId, sessionId },
|
|
2633
|
+
payload: { messageId: resumeMessageId, sessionId: targetSessionId },
|
|
2485
2634
|
});
|
|
2486
2635
|
// 获取已累积的流式中间内容,补发给客户端
|
|
2487
2636
|
// 这样用户刷新后能立即看到 API 已经生成的内容,而不是空气泡
|
|
2488
|
-
const streamingContent = conversationManager.getStreamingContent(
|
|
2637
|
+
const streamingContent = conversationManager.getStreamingContent(targetSessionId);
|
|
2489
2638
|
if (streamingContent) {
|
|
2490
2639
|
// 补发 thinking 内容(如果有)
|
|
2491
2640
|
if (streamingContent.thinkingText) {
|
|
2492
2641
|
sendMessage(ws, {
|
|
2493
2642
|
type: 'thinking_start',
|
|
2494
|
-
payload: { messageId: resumeMessageId, sessionId },
|
|
2643
|
+
payload: { messageId: resumeMessageId, sessionId: targetSessionId },
|
|
2495
2644
|
});
|
|
2496
2645
|
sendMessage(ws, {
|
|
2497
2646
|
type: 'thinking_delta',
|
|
2498
|
-
payload: { messageId: resumeMessageId, text: streamingContent.thinkingText, sessionId },
|
|
2647
|
+
payload: { messageId: resumeMessageId, text: streamingContent.thinkingText, sessionId: targetSessionId },
|
|
2499
2648
|
});
|
|
2500
2649
|
// 如果已有 text 内容,说明 thinking 已经结束
|
|
2501
2650
|
if (streamingContent.textContent) {
|
|
2502
2651
|
sendMessage(ws, {
|
|
2503
2652
|
type: 'thinking_complete',
|
|
2504
|
-
payload: { messageId: resumeMessageId, sessionId },
|
|
2653
|
+
payload: { messageId: resumeMessageId, sessionId: targetSessionId },
|
|
2505
2654
|
});
|
|
2506
2655
|
}
|
|
2507
2656
|
}
|
|
@@ -2509,39 +2658,40 @@ async function handleSessionSwitch(client, sessionId, conversationManager) {
|
|
|
2509
2658
|
if (streamingContent.textContent) {
|
|
2510
2659
|
sendMessage(ws, {
|
|
2511
2660
|
type: 'text_delta',
|
|
2512
|
-
payload: { messageId: resumeMessageId, text: streamingContent.textContent, sessionId },
|
|
2661
|
+
payload: { messageId: resumeMessageId, text: streamingContent.textContent, sessionId: targetSessionId },
|
|
2513
2662
|
});
|
|
2514
2663
|
}
|
|
2515
2664
|
}
|
|
2516
2665
|
sendMessage(ws, {
|
|
2517
2666
|
type: 'status',
|
|
2518
|
-
payload: { status: 'streaming', message: 'Processing conversation...', sessionId },
|
|
2667
|
+
payload: { status: 'streaming', message: 'Processing conversation...', sessionId: targetSessionId },
|
|
2519
2668
|
});
|
|
2520
2669
|
// 重发待处理的权限请求和用户问题
|
|
2521
2670
|
// 会话正在处理中且被阻塞在等待用户响应时,切换回来后需要重新弹出对话框
|
|
2522
|
-
const pendingPermissions = conversationManager.getPendingPermissionRequests(
|
|
2671
|
+
const pendingPermissions = conversationManager.getPendingPermissionRequests(targetSessionId);
|
|
2523
2672
|
for (const req of pendingPermissions) {
|
|
2524
2673
|
sendMessage(ws, {
|
|
2525
2674
|
type: 'permission_request',
|
|
2526
|
-
payload: { ...req, sessionId },
|
|
2675
|
+
payload: { ...req, sessionId: targetSessionId },
|
|
2527
2676
|
});
|
|
2528
2677
|
console.log(`[WebSocket] Resending pending permission request: ${req.tool} (${req.requestId})`);
|
|
2529
2678
|
}
|
|
2530
|
-
const pendingQuestions = conversationManager.
|
|
2679
|
+
const pendingQuestions = conversationManager.getUndeliveredPendingUserQuestions(targetSessionId);
|
|
2531
2680
|
for (const q of pendingQuestions) {
|
|
2532
2681
|
sendMessage(ws, {
|
|
2533
2682
|
type: 'user_question',
|
|
2534
|
-
payload: { ...q, sessionId },
|
|
2683
|
+
payload: { ...q, sessionId: targetSessionId },
|
|
2535
2684
|
});
|
|
2685
|
+
conversationManager.markPendingUserQuestionDelivered(targetSessionId, q.requestId);
|
|
2536
2686
|
console.log(`[WebSocket] Resending pending user question: ${q.header} (${q.requestId})`);
|
|
2537
2687
|
}
|
|
2538
2688
|
}
|
|
2539
|
-
else if (conversationManager.needsContinuation(
|
|
2689
|
+
else if (conversationManager.needsContinuation(targetSessionId)) {
|
|
2540
2690
|
// SelfEvolve 重启等场景:工具结果已保存但模型还没来得及继续回复
|
|
2541
2691
|
// 自动触发对话继续,让模型接着上次中断的地方回复
|
|
2542
|
-
console.log(`[WebSocket] Session ${
|
|
2692
|
+
console.log(`[WebSocket] Session ${targetSessionId} needs continuation (last message is tool_result), auto-triggering`);
|
|
2543
2693
|
const continueMessageId = randomUUID();
|
|
2544
|
-
const chatSessionId =
|
|
2694
|
+
const chatSessionId = targetSessionId;
|
|
2545
2695
|
const getActiveWs = () => {
|
|
2546
2696
|
return conversationManager.getWebSocket(chatSessionId) || ws;
|
|
2547
2697
|
};
|
|
@@ -2589,6 +2739,12 @@ async function handleSessionSwitch(client, sessionId, conversationManager) {
|
|
|
2589
2739
|
payload: { status: 'tool_executing', message: `Executing ${toolName}...`, sessionId: chatSessionId },
|
|
2590
2740
|
});
|
|
2591
2741
|
},
|
|
2742
|
+
onToolUseInputReady: (toolUseId, input) => {
|
|
2743
|
+
sendMessage(getActiveWs(), {
|
|
2744
|
+
type: 'tool_use_input_ready',
|
|
2745
|
+
payload: { toolUseId, input, sessionId: chatSessionId },
|
|
2746
|
+
});
|
|
2747
|
+
},
|
|
2592
2748
|
onToolUseDelta: (toolUseId, partialJson) => {
|
|
2593
2749
|
sendMessage(getActiveWs(), {
|
|
2594
2750
|
type: 'tool_use_delta',
|
|
@@ -2682,9 +2838,17 @@ async function handleSessionSwitch(client, sessionId, conversationManager) {
|
|
|
2682
2838
|
// IM 会话尚未创建(首条消息还在处理中),预先切换过去
|
|
2683
2839
|
// chat() 运行时会在内存中创建该会话,流式消息会正常显示
|
|
2684
2840
|
client.sessionId = sessionId;
|
|
2841
|
+
client.runtimeBackend = webAuth.getRuntimeBackend();
|
|
2842
|
+
client.model = getDefaultChatModel(client.runtimeBackend);
|
|
2685
2843
|
sendMessage(ws, {
|
|
2686
2844
|
type: 'session_switched',
|
|
2687
|
-
payload: {
|
|
2845
|
+
payload: {
|
|
2846
|
+
sessionId,
|
|
2847
|
+
projectPath: client.projectPath,
|
|
2848
|
+
history: [],
|
|
2849
|
+
model: client.model,
|
|
2850
|
+
runtimeBackend: client.runtimeBackend,
|
|
2851
|
+
},
|
|
2688
2852
|
});
|
|
2689
2853
|
}
|
|
2690
2854
|
else {
|
|
@@ -2838,15 +3002,27 @@ async function handleSessionImport(client, content, format, conversationManager)
|
|
|
2838
3002
|
async function handleSessionResume(client, sessionId, conversationManager) {
|
|
2839
3003
|
const { ws } = client;
|
|
2840
3004
|
try {
|
|
2841
|
-
|
|
3005
|
+
let targetSessionId = sessionId;
|
|
3006
|
+
let success = await conversationManager.resumeSession(targetSessionId, client.permissionMode);
|
|
3007
|
+
if (!success) {
|
|
3008
|
+
const resolvedSessionId = resolveSessionRestoreTargetId(conversationManager, targetSessionId);
|
|
3009
|
+
if (resolvedSessionId !== targetSessionId) {
|
|
3010
|
+
targetSessionId = resolvedSessionId;
|
|
3011
|
+
success = await conversationManager.resumeSession(targetSessionId, client.permissionMode);
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
2842
3014
|
if (success) {
|
|
2843
|
-
client.sessionId =
|
|
3015
|
+
client.sessionId = targetSessionId;
|
|
2844
3016
|
// 重要:更新会话的 WebSocket 连接,确保 UserInteractionHandler 和 TaskManager 使用新连接
|
|
2845
|
-
conversationManager.setWebSocket(
|
|
2846
|
-
const history = conversationManager.getHistory(
|
|
3017
|
+
conversationManager.setWebSocket(targetSessionId, ws);
|
|
3018
|
+
const history = conversationManager.getHistory(targetSessionId);
|
|
3019
|
+
const sessionRuntimeBackend = conversationManager.getSessionRuntimeBackend(targetSessionId) || webAuth.getRuntimeBackend();
|
|
3020
|
+
const sessionModel = conversationManager.getSessionModel(targetSessionId) || getDefaultChatModel(sessionRuntimeBackend);
|
|
3021
|
+
client.model = sessionModel;
|
|
3022
|
+
client.runtimeBackend = sessionRuntimeBackend;
|
|
2847
3023
|
sendMessage(ws, {
|
|
2848
3024
|
type: 'session_switched',
|
|
2849
|
-
payload: { sessionId, history },
|
|
3025
|
+
payload: { sessionId: targetSessionId, history, model: sessionModel, runtimeBackend: sessionRuntimeBackend },
|
|
2850
3026
|
});
|
|
2851
3027
|
}
|
|
2852
3028
|
else {
|