@stv/page-test 1.0.0 → 1.0.2

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.
@@ -1,6 +1,6 @@
1
1
  (function() {
2
2
  var __vite_style__ = document.createElement("style");
3
- __vite_style__.textContent = "._wrapper_1ooyb_1 {\n position: fixed;\n inset: 0;\n z-index: 2147483641; /* 确保在所有元素之上,除了 panel */\n cursor: wait;\n overflow: hidden;\n\n display: none;\n}\n\n._wrapper_1ooyb_1._visible_1ooyb_11 {\n display: block;\n}\n/* AI 光标样式 */\n._cursor_1dgwb_2 {\n position: absolute;\n width: var(--cursor-size, 75px);\n height: var(--cursor-size, 75px);\n pointer-events: none;\n z-index: 10000;\n}\n\n._cursorBorder_1dgwb_10 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));\n mask-image: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e\");\n mask-size: 100% 100%;\n mask-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorFilling_1dgwb_25 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e\");\n background-size: 100% 100%;\n background-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorRipple_1dgwb_39 {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n margin-left: -50%;\n margin-top: -50%;\n\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n inset: 0;\n border: 4px solid rgba(57, 182, 255, 1);\n border-radius: 50%;\n }\n}\n\n._cursor_1dgwb_2._clicking_1dgwb_57 ._cursorRipple_1dgwb_39::after {\n animation: _cursor-ripple_1dgwb_1 300ms ease-out forwards;\n}\n\n@keyframes _cursor-ripple_1dgwb_1 {\n 0% {\n transform: scale(0);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n._wrapper_1oczf_1 {\n position: fixed;\n bottom: 500px;\n left: 50%;\n transform: translateX(-50%) translateY(20px);\n opacity: 0;\n z-index: 2147483642; /* 比 SimulatorMask 高一层 */\n box-sizing: border-box;\n\n overflow: visible;\n\n * {\n box-sizing: border-box;\n }\n\n --width: 360px;\n --height: 40px;\n --border-radius: 12px;\n\n --side-space: 12px; /* 控制栏两侧的间距 */\n --history-width: calc(var(--width) - var(--side-space) * 2);\n\n --color-1: rgb(57, 182, 255);\n --color-2: rgb(189, 69, 251);\n --color-3: rgb(255, 87, 51);\n --color-4: rgb(255, 214, 0);\n\n width: var(--width);\n height: var(--height);\n\n transition: all 0.3s ease-in-out;\n\n /* 响应式设计 */\n @media (max-width: 480px) {\n width: calc(100vw - 40px);\n --width: calc(100vw - 40px);\n }\n\n ._background_1oczf_39 {\n position: absolute;\n inset: -2px -8px;\n border-radius: calc(var(--border-radius) + 4px);\n filter: blur(16px);\n overflow: hidden;\n /* mix-blend-mode: lighten; */\n /* display: none; */\n\n &::before {\n content: '';\n z-index: -1;\n pointer-events: none;\n position: absolute;\n width: 100%;\n height: 100%;\n /* left: -100%; */\n left: 0;\n top: 0;\n\n background-image: linear-gradient(\n to bottom left,\n var(--color-1),\n var(--color-2),\n var(--color-1)\n );\n animation: _mask-running_1oczf_1 2s linear infinite;\n }\n &::after {\n content: '';\n z-index: -1;\n pointer-events: none;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n\n background-image: linear-gradient(\n to bottom left,\n var(--color-2),\n var(--color-1),\n var(--color-2)\n );\n animation: _mask-running_1oczf_1 2s linear infinite;\n animation-delay: 1s;\n }\n }\n}\n\n@keyframes _mask-running_1oczf_1 {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n/* 控制栏 */\n._header_1oczf_99 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n user-select: none;\n\n position: absolute;\n inset: 0;\n\n cursor: pointer;\n flex-shrink: 0; /* 防止 header 被压缩 */\n\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(10px);\n border-radius: var(--border-radius);\n background-clip: padding-box;\n\n box-shadow:\n 0 0 0px 2px rgba(255, 255, 255, 0.4),\n 0 0 5px 1px rgba(255, 255, 255, 0.3);\n\n ._statusSection_1oczf_121 {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-height: 24px; /* 确保垂直居中 */\n\n ._indicator_1oczf_128 {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.5);\n flex-shrink: 0;\n animation: none; /* 默认无动画 */\n\n /* 运行状态 - 有动画 */\n &._thinking_1oczf_137 {\n background: rgb(57, 182, 255);\n animation: _pulse_1oczf_1 0.8s ease-in-out infinite;\n }\n\n &._tool_executing_1oczf_142 {\n background: rgb(189, 69, 251);\n animation: _pulse_1oczf_1 0.6s ease-in-out infinite;\n }\n\n &._retry_1oczf_147 {\n background: rgb(255, 214, 0);\n animation: _retryPulse_1oczf_1 1s ease-in-out infinite;\n }\n\n /* 静止状态 - 无动画 */\n &._completed_1oczf_153,\n &._input_1oczf_154,\n &._output_1oczf_155 {\n background: rgb(34, 197, 94);\n animation: none;\n }\n\n &._error_1oczf_160 {\n background: rgb(239, 68, 68);\n animation: none;\n }\n }\n\n ._statusText_1oczf_166 {\n color: white;\n font-size: 12px;\n line-height: 1;\n font-weight: 500;\n transition: all 0.3s ease-in-out;\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n min-height: 24px; /* 确保垂直居中 */\n\n &._fadeOut_1oczf_178 {\n animation: _statusTextFadeOut_1oczf_1 0.3s ease forwards;\n }\n\n &._fadeIn_1oczf_182 {\n animation: _statusTextFadeIn_1oczf_1 0.3s ease forwards;\n }\n }\n }\n\n ._controls_1oczf_188 {\n display: flex;\n align-items: center;\n gap: 4px;\n\n ._controlButton_1oczf_193 {\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.1);\n color: white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n line-height: 1;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n }\n\n ._recordingButton_1oczf_212 {\n position: relative;\n transition: all 0.2s ease;\n\n &._recording_1oczf_212 {\n color: rgb(239, 68, 68);\n animation: _recordingPulse_1oczf_1 1.5s ease-in-out infinite;\n }\n }\n\n ._eventCounter_1oczf_222 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.7);\n min-width: 16px;\n text-align: center;\n padding: 0 4px;\n }\n\n ._stopButton_1oczf_230 {\n background: rgba(239, 68, 68, 0.2);\n color: rgb(255, 41, 41);\n font-weight: 600;\n\n &:hover {\n background: rgba(239, 68, 68, 0.3);\n }\n }\n }\n}\n\n@keyframes _statusTextFadeIn_1oczf_1 {\n 0% {\n opacity: 0;\n transform: translateY(5px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes _statusTextFadeOut_1oczf_1 {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-5px);\n }\n}\n\n._historySectionWrapper_1oczf_264 {\n position: absolute;\n width: var(--history-width);\n bottom: var(--height);\n left: var(--side-space);\n z-index: -2;\n\n padding-top: 0px;\n visibility: collapse;\n overflow: hidden;\n\n transition: all 0.2s;\n\n background: rgba(2, 0, 20, 0.5);\n /* background: rgba(186, 186, 186, 0.2); */\n backdrop-filter: blur(10px);\n\n text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);\n\n border-top-left-radius: calc(var(--border-radius) + 4px);\n border-top-right-radius: calc(var(--border-radius) + 4px);\n\n /* border: 2px solid rgba(255, 255, 255, 0.8); */\n border: 2px solid rgba(255, 255, 255, 0.4);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);\n\n /* @media (prefers-color-scheme: dark) {\n box-shadow:\n 0 8px 32px 0 rgba(0, 0, 0, 0.85),\n 0 2px 12px 0 rgba(57, 182, 255, 0.1);\n } */\n\n ._expanded_1oczf_296 & {\n padding-top: 8px;\n visibility: visible;\n }\n\n ._historySection_1oczf_264 {\n position: relative;\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n max-height: 0;\n padding-inline: 8px;\n\n transition: max-height 0.2s;\n\n ._expanded_1oczf_296 & {\n max-height: min(500px, calc(100vh - 200px - var(--height)));\n }\n\n ._historyItem_1oczf_315 {\n /* backdrop-filter: blur(10px); */\n padding: 8px 10px;\n margin-bottom: 6px;\n background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));\n border-radius: 8px;\n border-left: 2px solid rgba(57, 182, 255, 0.5);\n font-size: 12px;\n color: white;\n /* color: black; */\n line-height: 1.3;\n position: relative;\n overflow: hidden;\n\n /* 微妙的内阴影 */\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.1),\n 0 1px 3px rgba(0, 0, 0, 0.1);\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);\n }\n\n &:hover {\n background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));\n /* transform: translateY(-1px); */\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.15),\n 0 2px 4px rgba(0, 0, 0, 0.15);\n }\n\n &:last-child {\n margin-bottom: 10px;\n }\n\n &._completed_1oczf_153,\n &._input_1oczf_154,\n &._output_1oczf_155 {\n border-left-color: rgb(34, 197, 94);\n background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));\n }\n\n &._error_1oczf_160 {\n border-left-color: rgb(239, 68, 68);\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));\n }\n\n &._retry_1oczf_147 {\n border-left-color: rgb(255, 214, 0);\n background: linear-gradient(135deg, rgba(255, 214, 0, 0.1), rgba(255, 214, 0, 0.05));\n }\n\n &._observation_1oczf_373 {\n border-left-color: rgb(147, 51, 234);\n background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(147, 51, 234, 0.05));\n }\n\n &._question_1oczf_378 {\n border-left-color: rgb(255, 159, 67);\n background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(255, 159, 67, 0.08));\n }\n\n /* 突出显示 done 成功结果 */\n &._doneSuccess_1oczf_384 {\n background: linear-gradient(\n 135deg,\n rgba(34, 197, 94, 0.25),\n rgba(34, 197, 94, 0.15),\n rgba(34, 197, 94, 0.08)\n );\n border: none;\n border-left: 4px solid rgb(34, 197, 94);\n box-shadow:\n 0 4px 12px rgba(34, 197, 94, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2),\n 0 0 20px rgba(34, 197, 94, 0.1);\n font-weight: 600;\n color: rgb(220, 252, 231);\n padding: 10px 12px;\n margin-bottom: 8px;\n border-radius: 8px;\n position: relative;\n overflow: hidden;\n\n &::before {\n background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);\n }\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n width: 100%;\n height: 100%;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);\n animation: _shimmer_1oczf_1 2s ease-in-out infinite;\n }\n\n ._historyContent_1oczf_420 {\n ._statusIcon_1oczf_421 {\n font-size: 16px;\n animation: _celebrate_1oczf_1 0.8s ease-in-out;\n filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.5));\n }\n }\n }\n\n /* 突出显示 done 失败结果 */\n &._doneError_1oczf_430 {\n background: linear-gradient(\n 135deg,\n rgba(239, 68, 68, 0.25),\n rgba(239, 68, 68, 0.15),\n rgba(239, 68, 68, 0.08)\n );\n border: none;\n border-left: 4px solid rgb(239, 68, 68);\n box-shadow:\n 0 4px 12px rgba(239, 68, 68, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2),\n 0 0 20px rgba(239, 68, 68, 0.1);\n font-weight: 600;\n color: rgb(254, 226, 226);\n padding: 10px 12px;\n margin-bottom: 8px;\n border-radius: 8px;\n position: relative;\n overflow: hidden;\n\n &::before {\n background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.4), transparent);\n }\n\n ._historyContent_1oczf_420 {\n ._statusIcon_1oczf_421 {\n font-size: 16px;\n filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.5));\n }\n }\n }\n\n ._historyContent_1oczf_420 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n\n word-break: break-all;\n white-space: pre-wrap;\n\n /* overflow-x: auto; */\n\n ._statusIcon_1oczf_421 {\n font-size: 12px;\n flex-shrink: 0;\n line-height: 1;\n transition: all 0.3s ease;\n }\n\n ._reflectionLines_1oczf_480 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n }\n\n ._historyMeta_1oczf_487 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.6);\n /* color: rgb(61, 61, 61); */\n margin-top: 8px;\n line-height: 1;\n }\n }\n }\n}\n\n/* 动画关键帧 - 更快的闪烁 */\n@keyframes _pulse_1oczf_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.4;\n transform: scale(1.3);\n }\n}\n\n/* 重试动画 - 旋转脉冲 */\n@keyframes _retryPulse_1oczf_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1) rotate(0deg);\n }\n 25% {\n opacity: 0.6;\n transform: scale(1.2) rotate(90deg);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.1) rotate(180deg);\n }\n 75% {\n opacity: 0.6;\n transform: scale(1.2) rotate(270deg);\n }\n}\n\n/* 庆祝动画 */\n@keyframes _celebrate_1oczf_1 {\n 0%,\n 100% {\n transform: scale(1);\n }\n 25% {\n transform: scale(1.2) rotate(-5deg);\n }\n 75% {\n transform: scale(1.2) rotate(5deg);\n }\n}\n\n/* done 卡片的光泽效果 */\n@keyframes _shimmer_1oczf_1 {\n 0% {\n left: -100%;\n }\n 100% {\n left: 100%;\n }\n}\n\n/* 输入区域样式 */\n._inputSectionWrapper_1oczf_557 {\n position: absolute;\n width: var(--history-width);\n top: var(--height);\n left: var(--side-space);\n z-index: -1;\n\n visibility: visible;\n overflow: hidden;\n\n height: 48px;\n\n transition: all 0.2s;\n\n background: rgba(186, 186, 186, 0.2);\n backdrop-filter: blur(10px);\n\n border-bottom-left-radius: calc(var(--border-radius) + 4px);\n border-bottom-right-radius: calc(var(--border-radius) + 4px);\n\n border: 2px solid rgba(255, 255, 255, 0.3);\n box-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);\n\n &._hidden_1oczf_580 {\n visibility: collapse;\n height: 0;\n }\n\n ._inputSection_1oczf_557 {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 8px;\n\n ._taskInput_1oczf_591 {\n flex: 1;\n background: rgba(255, 255, 255, 0.4);\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 10px;\n padding-inline: 10px;\n color: rgb(20, 20, 20);\n font-size: 12px;\n height: 28px;\n line-height: 1;\n outline: none;\n transition: all 0.2s ease;\n\n /* text-shadow: 0 0 2px rgba(255, 255, 255, 0.8); */\n\n /* border-color: rgba(57, 182, 255, 0.3); */\n\n &::placeholder {\n color: rgb(53, 53, 53);\n }\n\n &:focus {\n background: rgba(255, 255, 255, 0.8);\n border-color: rgba(57, 182, 255, 0.6);\n box-shadow: 0 0 0 2px rgba(57, 182, 255, 0.2);\n }\n }\n }\n}\n\n/* Recording functionality */\n@keyframes _recordingPulse_1oczf_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n}\n\n._exportOverlay_1oczf_634 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_1oczf_1 0.2s ease;\n}\n\n@keyframes _overlayFadeIn_1oczf_1 {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n._exportDialog_1oczf_655 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_1oczf_1 0.3s ease;\n}\n\n@keyframes _dialogSlideIn_1oczf_1 {\n from {\n opacity: 0;\n transform: translateY(20px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n\n._exportDialogHeader_1oczf_677 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n\n h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n }\n\n ._closeButton_1oczf_691 {\n background: none;\n border: none;\n color: rgba(255, 255, 255, 0.6);\n font-size: 24px;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.2s;\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n }\n }\n}\n\n._exportDialogContent_1oczf_713 {\n padding: 24px;\n\n p {\n margin: 0 0 20px 0;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n }\n}\n\n._exportOptions_1oczf_723 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 12px;\n}\n\n._exportOptionButton_1oczf_729 {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 20px 16px;\n background: rgba(255, 255, 255, 0.05);\n border: 2px solid rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n border-color: rgba(57, 182, 255, 0.5);\n transform: translateY(-2px);\n }\n\n &:active {\n transform: translateY(0);\n }\n}\n\n._exportOptionIcon_1oczf_752 {\n font-size: 28px;\n opacity: 0.9;\n}\n\n._exportOptionLabel_1oczf_757 {\n font-size: 13px;\n font-weight: 500;\n color: white;\n}\n/* Recording-specific styles for RecordingPanel */\n/* These styles are extracted from @page-agent/ui/panel/Panel.module.css */\n\n._recordingButton_1yqua_4 {\n position: relative;\n transition: all 0.2s ease;\n}\n\n/* Placeholder - moved below controlButton definition for proper cascade */\n\n._eventCounter_1yqua_11 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.7);\n min-width: 16px;\n text-align: center;\n padding: 0 4px;\n}\n\n@keyframes _recordingPulse_1yqua_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n}\n\n._exportOverlay_1yqua_31 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_1yqua_1 0.2s ease;\n}\n\n@keyframes _overlayFadeIn_1yqua_1 {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n._exportDialog_1yqua_52 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_1yqua_1 0.3s ease;\n}\n\n@keyframes _dialogSlideIn_1yqua_1 {\n from {\n opacity: 0;\n transform: translateY(20px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n\n._exportDialogHeader_1yqua_74 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._exportDialogHeader_1yqua_74 h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._closeButton_1yqua_89 {\n background: none;\n border: none;\n color: rgba(255, 255, 255, 0.6);\n font-size: 24px;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n transition: all 0.2s;\n}\n\n._closeButton_1yqua_89:hover {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n}\n\n._exportDialogContent_1yqua_110 {\n padding: 24px;\n}\n\n._exportDialogContent_1yqua_110 p {\n margin: 0 0 20px 0;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n}\n\n._exportOptions_1yqua_120 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 12px;\n}\n\n._exportOptionButton_1yqua_126 {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 20px 16px;\n background: rgba(255, 255, 255, 0.05);\n border: 2px solid rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n cursor: pointer;\n transition: all 0.2s;\n color: white;\n font-family: inherit;\n}\n\n._exportOptionButton_1yqua_126:hover {\n background: rgba(255, 255, 255, 0.1);\n border-color: rgba(255, 255, 255, 0.2);\n transform: translateY(-2px);\n}\n\n._exportOptionIcon_1yqua_147 {\n font-size: 28px;\n opacity: 0.9;\n}\n\n._exportOptionLabel_1yqua_152 {\n font-size: 13px;\n font-weight: 500;\n color: white;\n}\n\n/* Need to re-export controlButton and controls styles from Panel for the recording button to work */\n._controlButton_1yqua_159 {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n border-radius: 8px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n height: 36px;\n font-size: 14px;\n}\n\n._controlButton_1yqua_159:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n._controls_1yqua_179 {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n/* Recording state - use !important to ensure priority over base styles */\n._recordingButton_1yqua_4._recording_1yqua_4 {\n color: rgb(34, 197, 94) !important;\n animation: _recordingPulse_1yqua_1 1.5s ease-in-out infinite;\n}\n\n/* ========== Phase 4: Task Cards ========== */\n\n._taskCard_1yqua_193 {\n background: rgba(30, 41, 59, 0.8);\n backdrop-filter: blur(12px);\n border: 1px solid rgba(148, 163, 184, 0.1);\n border-radius: 12px;\n padding: 16px;\n margin-bottom: 12px;\n transition: all 0.2s ease;\n}\n\n._taskCard_1yqua_193:hover {\n border-color: rgba(59, 130, 246, 0.3);\n transform: translateY(-2px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n}\n\n._taskCardHeader_1yqua_209 {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 12px;\n}\n\n._taskIcon_1yqua_216 {\n font-size: 24px;\n}\n\n._taskName_1yqua_220 {\n flex: 1;\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: white;\n}\n\n._confidenceBadge_1yqua_228 {\n background: linear-gradient(135deg, #10b981, #059669);\n color: white;\n padding: 2px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 600;\n}\n\n._taskStats_1yqua_237 {\n display: flex;\n gap: 16px;\n margin-bottom: 12px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n}\n\n._taskParameters_1yqua_245 {\n margin-bottom: 16px;\n padding: 12px;\n background: rgba(0, 0, 0, 0.2);\n border-radius: 8px;\n}\n\n._taskParameters_1yqua_245 h4 {\n margin: 0 0 8px 0;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._parameterItem_1yqua_258 {\n display: flex;\n gap: 8px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n margin-bottom: 4px;\n}\n\n._paramKey_1yqua_266 {\n font-weight: 600;\n color: rgba(255, 255, 255, 0.9);\n}\n\n._paramValue_1yqua_271 {\n color: rgba(255, 255, 255, 0.7);\n}\n\n._taskActions_1yqua_275 {\n display: flex;\n gap: 8px;\n}\n\n._actionButton_1yqua_280 {\n flex: 1;\n padding: 8px 16px;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n._btnPrimary_1yqua_290 {\n background: linear-gradient(135deg, #3b82f6, #2563eb);\n color: white;\n border: none;\n}\n\n._btnPrimary_1yqua_290:hover {\n background: linear-gradient(135deg, #2563eb, #1d4ed8);\n transform: translateY(-1px);\n}\n\n._btnSecondary_1yqua_301 {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n border: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n._btnSecondary_1yqua_301:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n/* ========== Phase 4: Task History ========== */\n\n._historyHeader_1yqua_313 {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n}\n\n._historyHeader_1yqua_313 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._searchInput_1yqua_327 {\n flex: 1;\n padding: 8px 12px;\n background: rgba(255, 255, 255, 0.1);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 8px;\n color: white;\n font-size: 14px;\n}\n\n._searchInput_1yqua_327::placeholder {\n color: rgba(255, 255, 255, 0.5);\n}\n\n._filterTabs_1yqua_341 {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n}\n\n._filterTab_1yqua_341 {\n padding: 6px 12px;\n background: rgba(255, 255, 255, 0.1);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n._filterTab_1yqua_341:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n._filterTab_1yqua_341._active_1yqua_362 {\n background: rgba(59, 130, 246, 0.3);\n border-color: rgba(59, 130, 246, 0.5);\n color: white;\n}\n\n._taskList_1yqua_368 {\n display: flex;\n flex-direction: column;\n gap: 12px;\n max-height: 400px;\n overflow-y: auto;\n}\n\n._emptyState_1yqua_376 {\n text-align: center;\n padding: 32px;\n color: rgba(255, 255, 255, 0.5);\n font-size: 14px;\n}\n\n/* ========== Phase 4: Replay Panel ========== */\n\n._replayPanel_1yqua_385 {\n background: rgba(30, 41, 59, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 600px;\n width: 90%;\n max-height: 80vh;\n overflow-y: auto;\n}\n\n._replayHeader_1yqua_397 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._replayIcon_1yqua_405 {\n font-size: 24px;\n}\n\n._replayHeader_1yqua_397 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._replayStatus_1yqua_416 {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n}\n\n._replayStatus_1yqua_416._success_1yqua_421 {\n color: #10b981;\n}\n\n._replayStatus_1yqua_416._failed_1yqua_425 {\n color: #ef4444;\n}\n\n/* Event List */\n\n._eventList_1yqua_431 {\n padding: 16px;\n max-height: 300px;\n overflow-y: auto;\n}\n\n._eventItem_1yqua_437 {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px;\n border-radius: 6px;\n margin-bottom: 4px;\n font-size: 13px;\n color: rgba(255, 255, 255, 0.8);\n transition: all 0.2s;\n}\n\n._eventItem_1yqua_437._statusPending_1yqua_449 {\n background: rgba(255, 255, 255, 0.05);\n}\n\n._eventItem_1yqua_437._statusRunning_1yqua_453 {\n background: rgba(59, 130, 246, 0.2);\n animation: _pulse_1yqua_1 1s infinite;\n}\n\n._eventItem_1yqua_437._statusSuccess_1yqua_458 {\n background: rgba(16, 185, 129, 0.2);\n}\n\n._eventItem_1yqua_437._statusFailed_1yqua_462 {\n background: rgba(239, 68, 68, 0.2);\n}\n\n._eventStatusIcon_1yqua_466 {\n font-size: 16px;\n width: 20px;\n text-align: center;\n}\n\n._eventDescription_1yqua_472 {\n flex: 1;\n}\n\n._eventDuration_1yqua_476 {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.5);\n}\n\n@keyframes _pulse_1yqua_1 {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n}\n\n/* ========== Phase 4: Error Handler ========== */\n\n._errorDialog_1yqua_493 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(239, 68, 68, 0.3);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n}\n\n._errorHeader_1yqua_503 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._errorIcon_1yqua_511 {\n font-size: 24px;\n}\n\n._errorHeader_1yqua_503 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._errorDetails_1yqua_522 {\n padding: 20px;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n}\n\n._errorDetails_1yqua_522 p {\n margin: 0 0 12px 0;\n}\n\n._errorDetails_1yqua_522 strong {\n color: white;\n}\n\n._errorCauses_1yqua_536 {\n padding: 0 20px 20px;\n}\n\n._errorCauses_1yqua_536 h4 {\n margin: 0 0 12px 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._errorCauses_1yqua_536 ul {\n margin: 0;\n padding-left: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 13px;\n}\n\n._errorCauses_1yqua_536 li {\n margin-bottom: 6px;\n}\n\n._errorActions_1yqua_557 {\n display: flex;\n gap: 8px;\n padding: 20px;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n/* ========== Phase 4: Replay Report ========== */\n\n._replayReport_1yqua_566 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n}\n\n._replayReport_1yqua_566._success_1yqua_421 {\n border-color: rgba(16, 185, 129, 0.3);\n}\n\n._replayReport_1yqua_566._failure_1yqua_580 {\n border-color: rgba(239, 68, 68, 0.3);\n}\n\n._reportHeader_1yqua_584 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._reportIcon_1yqua_592 {\n font-size: 24px;\n}\n\n._reportHeader_1yqua_584 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._reportStats_1yqua_603 {\n display: flex;\n justify-content: space-around;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._statItem_1yqua_610 {\n text-align: center;\n}\n\n._statLabel_1yqua_614 {\n display: block;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n margin-bottom: 4px;\n}\n\n._statValue_1yqua_621 {\n display: block;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._reportDetails_1yqua_628 {\n padding: 20px;\n max-height: 200px;\n overflow-y: auto;\n}\n\n._reportDetails_1yqua_628 h4 {\n margin: 0 0 12px 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._eventResult_1yqua_640 {\n padding: 8px;\n margin-bottom: 4px;\n border-radius: 6px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._eventResult_1yqua_640._statusSuccess_1yqua_458 {\n background: rgba(16, 185, 129, 0.2);\n}\n\n._eventResult_1yqua_640._statusFailed_1yqua_462 {\n background: rgba(239, 68, 68, 0.2);\n}\n\n._reportActions_1yqua_656 {\n display: flex;\n gap: 8px;\n padding: 20px;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n/* ========== Phase 4: Loading States ========== */\n\n._loadingContent_1yqua_665 {\n text-align: center;\n padding: 32px;\n color: white;\n}\n\n._loadingSpinner_1yqua_671 {\n width: 40px;\n height: 40px;\n margin: 0 auto 16px;\n border: 3px solid rgba(255, 255, 255, 0.2);\n border-top-color: white;\n border-radius: 50%;\n animation: _spin_1yqua_1 1s linear infinite;\n}\n\n@keyframes _spin_1yqua_1 {\n to {\n transform: rotate(360deg);\n }\n}\n\n._loadingContent_1yqua_665 p {\n margin: 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n/* ========== Phase 4: Task Card Dialog ========== */\n\n._taskCardDialog_1yqua_695 {\n padding: 20px;\n}\n\n/* ========== Settings ========== */\n\n._settingsOverlay_1yqua_701 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_1yqua_1 0.2s ease;\n}\n\n._settingsDialog_1yqua_713 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_1yqua_1 0.3s ease;\n}\n\n._settingsDialogHeader_1yqua_724 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._settingsDialogHeader_1yqua_724 h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._settingsDialogContent_1yqua_739 {\n padding: 24px;\n}\n\n._settingsField_1yqua_743 {\n margin-bottom: 20px;\n}\n\n._settingsLabel_1yqua_747 {\n display: block;\n margin-bottom: 8px;\n font-size: 13px;\n font-weight: 500;\n color: rgba(255, 255, 255, 0.9);\n}\n\n._settingsInput_1yqua_755 {\n width: 100%;\n padding: 10px 12px;\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.15);\n border-radius: 8px;\n color: white;\n font-size: 14px;\n font-family: inherit;\n box-sizing: border-box;\n transition: all 0.2s;\n}\n\n._settingsInput_1yqua_755::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n\n._settingsInput_1yqua_755:focus {\n outline: none;\n background: rgba(255, 255, 255, 0.08);\n border-color: rgba(59, 130, 246, 0.5);\n}\n\n._settingsInput_1yqua_755[type='password'] {\n -webkit-text-security: disc;\n}\n/*$vite$:1*/";
3
+ __vite_style__.textContent = "._wrapper_g3ap9_1 {\n position: fixed;\n inset: 0;\n z-index: 2147483641; /* 确保在所有元素之上,除了 panel */\n cursor: wait;\n overflow: hidden;\n\n display: none;\n}\n\n._wrapper_g3ap9_1._visible_g3ap9_11 {\n display: block;\n}\n/* AI 光标样式 */\n._cursor_15yuh_2 {\n position: absolute;\n width: var(--cursor-size, 75px);\n height: var(--cursor-size, 75px);\n pointer-events: none;\n z-index: 10000;\n}\n\n._cursorBorder_15yuh_10 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: linear-gradient(45deg, rgb(57, 182, 255), rgb(189, 69, 251));\n mask-image: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%20fill='none'%3e%3cg%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='none'%20stroke='%23000000'%20stroke-width='6'%20stroke-miterlimit='10'%20style='stroke:%20light-dark(rgb(0,%200,%200),%20rgb(255,%20255,%20255));'/%3e%3c/g%3e%3c/svg%3e\");\n mask-size: 100% 100%;\n mask-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorFilling_15yuh_25 {\n position: absolute;\n width: 100%;\n height: 100%;\n background: url(\"data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20100%20100'%3e%3cdefs%3e%3c/defs%3e%3cg%20xmlns='http://www.w3.org/2000/svg'%20style='filter:%20drop-shadow(light-dark(rgba(0,%200,%200,%200.4),%20rgba(237,%20237,%20237,%200.4))%203px%204px%204px);'%3e%3cpath%20d='M%2015%2042%20L%2015%2036.99%20Q%2015%2031.99%2023.7%2031.99%20L%2028.05%2031.99%20Q%2032.41%2031.99%2032.41%2021.99%20L%2032.41%2017%20Q%2032.41%2012%2041.09%2016.95%20L%2076.31%2037.05%20Q%2085%2042%2076.31%2046.95%20L%2041.09%2067.05%20Q%2032.41%2072%2032.41%2062.01%20L%2032.41%2057.01%20Q%2032.41%2052.01%2023.7%2052.01%20L%2019.35%2052.01%20Q%2015%2052.01%2015%2047.01%20Z'%20fill='%23ffffff'%20stroke='none'%20style='fill:%20%23ffffff;'/%3e%3c/g%3e%3c/svg%3e\");\n background-size: 100% 100%;\n background-repeat: no-repeat;\n\n transform-origin: center;\n transform: rotate(-135deg) scale(1.2);\n margin-left: -10px;\n margin-top: -18px;\n}\n\n._cursorRipple_15yuh_39 {\n position: absolute;\n width: 100%;\n height: 100%;\n pointer-events: none;\n margin-left: -50%;\n margin-top: -50%;\n\n &::after {\n content: '';\n opacity: 0;\n position: absolute;\n inset: 0;\n border: 4px solid rgba(57, 182, 255, 1);\n border-radius: 50%;\n }\n}\n\n._cursor_15yuh_2._clicking_15yuh_57 ._cursorRipple_15yuh_39::after {\n animation: _cursor-ripple_15yuh_1 300ms ease-out forwards;\n}\n\n@keyframes _cursor-ripple_15yuh_1 {\n 0% {\n transform: scale(0);\n opacity: 1;\n }\n 100% {\n transform: scale(2);\n opacity: 0;\n }\n}\n._wrapper_dinc2_1 {\n position: fixed;\n bottom: 500px;\n left: 50%;\n transform: translateX(-50%) translateY(20px);\n opacity: 0;\n z-index: 2147483642; /* 比 SimulatorMask 高一层 */\n box-sizing: border-box;\n\n overflow: visible;\n\n * {\n box-sizing: border-box;\n }\n\n --width: 360px;\n --height: 40px;\n --border-radius: 12px;\n\n --side-space: 12px; /* 控制栏两侧的间距 */\n --history-width: calc(var(--width) - var(--side-space) * 2);\n\n --color-1: rgb(57, 182, 255);\n --color-2: rgb(189, 69, 251);\n --color-3: rgb(255, 87, 51);\n --color-4: rgb(255, 214, 0);\n\n width: var(--width);\n height: var(--height);\n\n transition: all 0.3s ease-in-out;\n\n /* 响应式设计 */\n @media (max-width: 480px) {\n width: calc(100vw - 40px);\n --width: calc(100vw - 40px);\n }\n\n ._background_dinc2_39 {\n position: absolute;\n inset: -2px -8px;\n border-radius: calc(var(--border-radius) + 4px);\n filter: blur(16px);\n overflow: hidden;\n /* mix-blend-mode: lighten; */\n /* display: none; */\n\n &::before {\n content: '';\n z-index: -1;\n pointer-events: none;\n position: absolute;\n width: 100%;\n height: 100%;\n /* left: -100%; */\n left: 0;\n top: 0;\n\n background-image: linear-gradient(\n to bottom left,\n var(--color-1),\n var(--color-2),\n var(--color-1)\n );\n animation: _mask-running_dinc2_1 2s linear infinite;\n }\n &::after {\n content: '';\n z-index: -1;\n pointer-events: none;\n position: absolute;\n width: 100%;\n height: 100%;\n left: 0;\n top: 0;\n\n background-image: linear-gradient(\n to bottom left,\n var(--color-2),\n var(--color-1),\n var(--color-2)\n );\n animation: _mask-running_dinc2_1 2s linear infinite;\n animation-delay: 1s;\n }\n }\n}\n\n@keyframes _mask-running_dinc2_1 {\n from {\n transform: translateX(-100%);\n }\n to {\n transform: translateX(100%);\n }\n}\n\n/* 控制栏 */\n._header_dinc2_99 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 8px 12px;\n user-select: none;\n\n position: absolute;\n inset: 0;\n\n cursor: pointer;\n flex-shrink: 0; /* 防止 header 被压缩 */\n\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(10px);\n border-radius: var(--border-radius);\n background-clip: padding-box;\n\n box-shadow:\n 0 0 0px 2px rgba(255, 255, 255, 0.4),\n 0 0 5px 1px rgba(255, 255, 255, 0.3);\n\n ._statusSection_dinc2_121 {\n display: flex;\n align-items: center;\n gap: 8px;\n flex: 1;\n min-height: 24px; /* 确保垂直居中 */\n\n ._indicator_dinc2_128 {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.5);\n flex-shrink: 0;\n animation: none; /* 默认无动画 */\n\n /* 运行状态 - 有动画 */\n &._thinking_dinc2_137 {\n background: rgb(57, 182, 255);\n animation: _pulse_dinc2_1 0.8s ease-in-out infinite;\n }\n\n &._tool_executing_dinc2_142 {\n background: rgb(189, 69, 251);\n animation: _pulse_dinc2_1 0.6s ease-in-out infinite;\n }\n\n &._retry_dinc2_147 {\n background: rgb(255, 214, 0);\n animation: _retryPulse_dinc2_1 1s ease-in-out infinite;\n }\n\n /* 静止状态 - 无动画 */\n &._completed_dinc2_153,\n &._input_dinc2_154,\n &._output_dinc2_155 {\n background: rgb(34, 197, 94);\n animation: none;\n }\n\n &._error_dinc2_160 {\n background: rgb(239, 68, 68);\n animation: none;\n }\n }\n\n ._statusText_dinc2_166 {\n color: white;\n font-size: 12px;\n line-height: 1;\n font-weight: 500;\n transition: all 0.3s ease-in-out;\n position: relative;\n overflow: hidden;\n display: flex;\n align-items: center;\n min-height: 24px; /* 确保垂直居中 */\n\n &._fadeOut_dinc2_178 {\n animation: _statusTextFadeOut_dinc2_1 0.3s ease forwards;\n }\n\n &._fadeIn_dinc2_182 {\n animation: _statusTextFadeIn_dinc2_1 0.3s ease forwards;\n }\n }\n }\n\n ._controls_dinc2_188 {\n display: flex;\n align-items: center;\n gap: 4px;\n\n ._controlButton_dinc2_193 {\n width: 24px;\n height: 24px;\n border: none;\n border-radius: 4px;\n background: rgba(255, 255, 255, 0.1);\n color: white;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 12px;\n line-height: 1;\n\n &:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n }\n\n ._recordingButton_dinc2_212 {\n position: relative;\n transition: all 0.2s ease;\n\n &._recording_dinc2_212 {\n color: rgb(239, 68, 68);\n animation: _recordingPulse_dinc2_1 1.5s ease-in-out infinite;\n }\n }\n\n ._eventCounter_dinc2_222 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.7);\n min-width: 16px;\n text-align: center;\n padding: 0 4px;\n }\n\n ._stopButton_dinc2_230 {\n background: rgba(239, 68, 68, 0.2);\n color: rgb(255, 41, 41);\n font-weight: 600;\n\n &:hover {\n background: rgba(239, 68, 68, 0.3);\n }\n }\n }\n}\n\n@keyframes _statusTextFadeIn_dinc2_1 {\n 0% {\n opacity: 0;\n transform: translateY(5px);\n }\n 100% {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@keyframes _statusTextFadeOut_dinc2_1 {\n 0% {\n opacity: 1;\n transform: translateY(0);\n }\n 100% {\n opacity: 0;\n transform: translateY(-5px);\n }\n}\n\n._historySectionWrapper_dinc2_264 {\n position: absolute;\n width: var(--history-width);\n bottom: var(--height);\n left: var(--side-space);\n z-index: -2;\n\n padding-top: 0px;\n visibility: collapse;\n overflow: hidden;\n\n transition: all 0.2s;\n\n background: rgba(2, 0, 20, 0.5);\n /* background: rgba(186, 186, 186, 0.2); */\n backdrop-filter: blur(10px);\n\n text-shadow: 0 0 1px rgba(0, 0, 0, 0.2);\n\n border-top-left-radius: calc(var(--border-radius) + 4px);\n border-top-right-radius: calc(var(--border-radius) + 4px);\n\n /* border: 2px solid rgba(255, 255, 255, 0.8); */\n border: 2px solid rgba(255, 255, 255, 0.4);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);\n\n /* @media (prefers-color-scheme: dark) {\n box-shadow:\n 0 8px 32px 0 rgba(0, 0, 0, 0.85),\n 0 2px 12px 0 rgba(57, 182, 255, 0.1);\n } */\n\n ._expanded_dinc2_296 & {\n padding-top: 8px;\n visibility: visible;\n }\n\n ._historySection_dinc2_264 {\n position: relative;\n overflow-y: auto;\n overscroll-behavior: contain;\n scrollbar-width: none;\n max-height: 0;\n padding-inline: 8px;\n\n transition: max-height 0.2s;\n\n ._expanded_dinc2_296 & {\n max-height: min(500px, calc(100vh - 200px - var(--height)));\n }\n\n ._historyItem_dinc2_315 {\n /* backdrop-filter: blur(10px); */\n padding: 8px 10px;\n margin-bottom: 6px;\n background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));\n border-radius: 8px;\n border-left: 2px solid rgba(57, 182, 255, 0.5);\n font-size: 12px;\n color: white;\n /* color: black; */\n line-height: 1.3;\n position: relative;\n overflow: hidden;\n\n /* 微妙的内阴影 */\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.1),\n 0 1px 3px rgba(0, 0, 0, 0.1);\n\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n height: 1px;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);\n }\n\n &:hover {\n background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));\n /* transform: translateY(-1px); */\n box-shadow:\n inset 0 1px 0 rgba(255, 255, 255, 0.15),\n 0 2px 4px rgba(0, 0, 0, 0.15);\n }\n\n &:last-child {\n margin-bottom: 10px;\n }\n\n &._completed_dinc2_153,\n &._input_dinc2_154,\n &._output_dinc2_155 {\n border-left-color: rgb(34, 197, 94);\n background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.05));\n }\n\n &._error_dinc2_160 {\n border-left-color: rgb(239, 68, 68);\n background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));\n }\n\n &._retry_dinc2_147 {\n border-left-color: rgb(255, 214, 0);\n background: linear-gradient(135deg, rgba(255, 214, 0, 0.1), rgba(255, 214, 0, 0.05));\n }\n\n &._observation_dinc2_373 {\n border-left-color: rgb(147, 51, 234);\n background: linear-gradient(135deg, rgba(147, 51, 234, 0.1), rgba(147, 51, 234, 0.05));\n }\n\n &._question_dinc2_378 {\n border-left-color: rgb(255, 159, 67);\n background: linear-gradient(135deg, rgba(255, 159, 67, 0.15), rgba(255, 159, 67, 0.08));\n }\n\n /* 突出显示 done 成功结果 */\n &._doneSuccess_dinc2_384 {\n background: linear-gradient(\n 135deg,\n rgba(34, 197, 94, 0.25),\n rgba(34, 197, 94, 0.15),\n rgba(34, 197, 94, 0.08)\n );\n border: none;\n border-left: 4px solid rgb(34, 197, 94);\n box-shadow:\n 0 4px 12px rgba(34, 197, 94, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2),\n 0 0 20px rgba(34, 197, 94, 0.1);\n font-weight: 600;\n color: rgb(220, 252, 231);\n padding: 10px 12px;\n margin-bottom: 8px;\n border-radius: 8px;\n position: relative;\n overflow: hidden;\n\n &::before {\n background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.4), transparent);\n }\n\n &::after {\n content: '';\n position: absolute;\n top: 0;\n left: -100%;\n width: 100%;\n height: 100%;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);\n animation: _shimmer_dinc2_1 2s ease-in-out infinite;\n }\n\n ._historyContent_dinc2_420 {\n ._statusIcon_dinc2_421 {\n font-size: 16px;\n animation: _celebrate_dinc2_1 0.8s ease-in-out;\n filter: drop-shadow(0 2px 4px rgba(34, 197, 94, 0.5));\n }\n }\n }\n\n /* 突出显示 done 失败结果 */\n &._doneError_dinc2_430 {\n background: linear-gradient(\n 135deg,\n rgba(239, 68, 68, 0.25),\n rgba(239, 68, 68, 0.15),\n rgba(239, 68, 68, 0.08)\n );\n border: none;\n border-left: 4px solid rgb(239, 68, 68);\n box-shadow:\n 0 4px 12px rgba(239, 68, 68, 0.3),\n inset 0 1px 0 rgba(255, 255, 255, 0.2),\n 0 0 20px rgba(239, 68, 68, 0.1);\n font-weight: 600;\n color: rgb(254, 226, 226);\n padding: 10px 12px;\n margin-bottom: 8px;\n border-radius: 8px;\n position: relative;\n overflow: hidden;\n\n &::before {\n background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.4), transparent);\n }\n\n ._historyContent_dinc2_420 {\n ._statusIcon_dinc2_421 {\n font-size: 16px;\n filter: drop-shadow(0 2px 4px rgba(239, 68, 68, 0.5));\n }\n }\n }\n\n ._historyContent_dinc2_420 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n\n word-break: break-all;\n white-space: pre-wrap;\n\n /* overflow-x: auto; */\n\n ._statusIcon_dinc2_421 {\n font-size: 12px;\n flex-shrink: 0;\n line-height: 1;\n transition: all 0.3s ease;\n }\n\n ._reflectionLines_dinc2_480 {\n display: flex;\n flex-direction: column;\n gap: 4px;\n }\n }\n\n ._historyMeta_dinc2_487 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.6);\n /* color: rgb(61, 61, 61); */\n margin-top: 8px;\n line-height: 1;\n }\n }\n }\n}\n\n/* 动画关键帧 - 更快的闪烁 */\n@keyframes _pulse_dinc2_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.4;\n transform: scale(1.3);\n }\n}\n\n/* 重试动画 - 旋转脉冲 */\n@keyframes _retryPulse_dinc2_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1) rotate(0deg);\n }\n 25% {\n opacity: 0.6;\n transform: scale(1.2) rotate(90deg);\n }\n 50% {\n opacity: 0.8;\n transform: scale(1.1) rotate(180deg);\n }\n 75% {\n opacity: 0.6;\n transform: scale(1.2) rotate(270deg);\n }\n}\n\n/* 庆祝动画 */\n@keyframes _celebrate_dinc2_1 {\n 0%,\n 100% {\n transform: scale(1);\n }\n 25% {\n transform: scale(1.2) rotate(-5deg);\n }\n 75% {\n transform: scale(1.2) rotate(5deg);\n }\n}\n\n/* done 卡片的光泽效果 */\n@keyframes _shimmer_dinc2_1 {\n 0% {\n left: -100%;\n }\n 100% {\n left: 100%;\n }\n}\n\n/* 输入区域样式 */\n._inputSectionWrapper_dinc2_557 {\n position: absolute;\n width: var(--history-width);\n top: var(--height);\n left: var(--side-space);\n z-index: -1;\n\n visibility: visible;\n overflow: hidden;\n\n height: 48px;\n\n transition: all 0.2s;\n\n background: rgba(186, 186, 186, 0.2);\n backdrop-filter: blur(10px);\n\n border-bottom-left-radius: calc(var(--border-radius) + 4px);\n border-bottom-right-radius: calc(var(--border-radius) + 4px);\n\n border: 2px solid rgba(255, 255, 255, 0.3);\n box-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);\n\n &._hidden_dinc2_580 {\n visibility: collapse;\n height: 0;\n }\n\n ._inputSection_dinc2_557 {\n display: flex;\n align-items: center;\n gap: 4px;\n padding: 8px 8px;\n\n ._taskInput_dinc2_591 {\n flex: 1;\n background: rgba(255, 255, 255, 0.4);\n border: 1px solid rgba(255, 255, 255, 0.3);\n border-radius: 10px;\n padding-inline: 10px;\n color: rgb(20, 20, 20);\n font-size: 12px;\n height: 28px;\n line-height: 1;\n outline: none;\n transition: all 0.2s ease;\n\n /* text-shadow: 0 0 2px rgba(255, 255, 255, 0.8); */\n\n /* border-color: rgba(57, 182, 255, 0.3); */\n\n &::placeholder {\n color: rgb(53, 53, 53);\n }\n\n &:focus {\n background: rgba(255, 255, 255, 0.8);\n border-color: rgba(57, 182, 255, 0.6);\n box-shadow: 0 0 0 2px rgba(57, 182, 255, 0.2);\n }\n }\n }\n}\n\n/* Recording functionality */\n@keyframes _recordingPulse_dinc2_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n}\n\n._exportOverlay_dinc2_634 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_dinc2_1 0.2s ease;\n}\n\n@keyframes _overlayFadeIn_dinc2_1 {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n._exportDialog_dinc2_655 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_dinc2_1 0.3s ease;\n}\n\n@keyframes _dialogSlideIn_dinc2_1 {\n from {\n opacity: 0;\n transform: translateY(20px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n\n._exportDialogHeader_dinc2_677 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n\n h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n }\n\n ._closeButton_dinc2_691 {\n background: none;\n border: none;\n color: rgba(255, 255, 255, 0.6);\n font-size: 24px;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 4px;\n transition: all 0.2s;\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n }\n }\n}\n\n._exportDialogContent_dinc2_713 {\n padding: 24px;\n\n p {\n margin: 0 0 20px 0;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n }\n}\n\n._exportOptions_dinc2_723 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 12px;\n}\n\n._exportOptionButton_dinc2_729 {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 20px 16px;\n background: rgba(255, 255, 255, 0.05);\n border: 2px solid rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n cursor: pointer;\n transition: all 0.2s;\n\n &:hover {\n background: rgba(255, 255, 255, 0.1);\n border-color: rgba(57, 182, 255, 0.5);\n transform: translateY(-2px);\n }\n\n &:active {\n transform: translateY(0);\n }\n}\n\n._exportOptionIcon_dinc2_752 {\n font-size: 28px;\n opacity: 0.9;\n}\n\n._exportOptionLabel_dinc2_757 {\n font-size: 13px;\n font-weight: 500;\n color: white;\n}\n._draggable_15flz_1 {\n /* Support dynamic positioning via CSS variables */\n left: var(--drag-left, 50%);\n top: var(--drag-top, auto);\n bottom: var(--drag-bottom, 500px);\n}\n\n._draggable_15flz_1._is-dragging_15flz_8 {\n cursor: grabbing;\n user-select: none;\n transition: none !important;\n z-index: 2147483643;\n box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);\n}\n\n._dragHandle_15flz_16 {\n cursor: grab;\n touch-action: none;\n}\n\n._dragHandle_15flz_16._is-dragging_15flz_8 {\n cursor: grabbing;\n}\n/* Recording-specific styles for RecordingPanel */\n/* These styles are extracted from @page-agent/ui/panel/Panel.module.css */\n\n._recordingButton_1hion_4 {\n position: relative;\n transition: all 0.2s ease;\n}\n\n/* Placeholder - moved below controlButton definition for proper cascade */\n\n._eventCounter_1hion_11 {\n font-size: 10px;\n color: rgba(255, 255, 255, 0.7);\n min-width: 16px;\n text-align: center;\n padding: 0 4px;\n}\n\n@keyframes _recordingPulse_1hion_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.7;\n transform: scale(1.1);\n }\n}\n\n._exportOverlay_1hion_31 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_1hion_1 0.2s ease;\n}\n\n@keyframes _overlayFadeIn_1hion_1 {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n._exportDialog_1hion_52 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_1hion_1 0.3s ease;\n}\n\n@keyframes _dialogSlideIn_1hion_1 {\n from {\n opacity: 0;\n transform: translateY(20px) scale(0.95);\n }\n to {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n}\n\n._exportDialogHeader_1hion_74 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._exportDialogHeader_1hion_74 h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._closeButton_1hion_89 {\n background: none;\n border: none;\n color: rgba(255, 255, 255, 0.6);\n font-size: 24px;\n cursor: pointer;\n padding: 0;\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 8px;\n transition: all 0.2s;\n}\n\n._closeButton_1hion_89:hover {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n}\n\n._exportDialogContent_1hion_110 {\n padding: 24px;\n}\n\n._exportDialogContent_1hion_110 p {\n margin: 0 0 20px 0;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n}\n\n._exportOptions_1hion_120 {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 12px;\n}\n\n._exportOptionButton_1hion_126 {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 20px 16px;\n background: rgba(255, 255, 255, 0.05);\n border: 2px solid rgba(255, 255, 255, 0.1);\n border-radius: 12px;\n cursor: pointer;\n transition: all 0.2s;\n color: white;\n font-family: inherit;\n}\n\n._exportOptionButton_1hion_126:hover {\n background: rgba(255, 255, 255, 0.1);\n border-color: rgba(255, 255, 255, 0.2);\n transform: translateY(-2px);\n}\n\n._exportOptionIcon_1hion_147 {\n font-size: 28px;\n opacity: 0.9;\n}\n\n._exportOptionLabel_1hion_152 {\n font-size: 13px;\n font-weight: 500;\n color: white;\n}\n\n/* Need to re-export controlButton and controls styles from Panel for the recording button to work */\n._controlButton_1hion_159 {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n cursor: pointer;\n padding: 8px;\n border-radius: 8px;\n transition: all 0.2s;\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 36px;\n height: 36px;\n font-size: 14px;\n}\n\n._controlButton_1hion_159:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n._controls_1hion_179 {\n display: flex;\n gap: 8px;\n align-items: center;\n}\n\n/* Recording state - use !important to ensure priority over base styles */\n._recordingButton_1hion_4._recording_1hion_4 {\n color: rgb(34, 197, 94) !important;\n animation: _recordingPulse_1hion_1 1.5s ease-in-out infinite;\n}\n\n/* ========== Phase 4: Task Cards ========== */\n\n._taskCard_1hion_193 {\n background: rgba(30, 41, 59, 0.8);\n backdrop-filter: blur(12px);\n border: 1px solid rgba(148, 163, 184, 0.1);\n border-radius: 12px;\n padding: 16px;\n margin-bottom: 12px;\n transition: all 0.2s ease;\n}\n\n._taskCard_1hion_193:hover {\n border-color: rgba(59, 130, 246, 0.3);\n transform: translateY(-2px);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);\n}\n\n._taskCardHeader_1hion_209 {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 12px;\n}\n\n._taskIcon_1hion_216 {\n font-size: 24px;\n}\n\n._taskName_1hion_220 {\n flex: 1;\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: white;\n}\n\n._confidenceBadge_1hion_228 {\n background: linear-gradient(135deg, #10b981, #059669);\n color: white;\n padding: 2px 8px;\n border-radius: 12px;\n font-size: 12px;\n font-weight: 600;\n}\n\n._taskStats_1hion_237 {\n display: flex;\n gap: 16px;\n margin-bottom: 12px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n}\n\n._taskParameters_1hion_245 {\n margin-bottom: 16px;\n padding: 12px;\n background: rgba(0, 0, 0, 0.2);\n border-radius: 8px;\n}\n\n._taskParameters_1hion_245 h4 {\n margin: 0 0 8px 0;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._parameterItem_1hion_258 {\n display: flex;\n gap: 8px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n margin-bottom: 4px;\n}\n\n._paramKey_1hion_266 {\n font-weight: 600;\n color: rgba(255, 255, 255, 0.9);\n}\n\n._paramValue_1hion_271 {\n color: rgba(255, 255, 255, 0.7);\n}\n\n._taskActions_1hion_275 {\n display: flex;\n gap: 8px;\n}\n\n._actionButton_1hion_280 {\n flex: 1;\n padding: 8px 16px;\n border-radius: 6px;\n font-size: 13px;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n._btnPrimary_1hion_290 {\n background: linear-gradient(135deg, #3b82f6, #2563eb);\n color: white;\n border: none;\n}\n\n._btnPrimary_1hion_290:hover {\n background: linear-gradient(135deg, #2563eb, #1d4ed8);\n transform: translateY(-1px);\n}\n\n._btnSecondary_1hion_301 {\n background: rgba(255, 255, 255, 0.1);\n color: white;\n border: 1px solid rgba(255, 255, 255, 0.2);\n}\n\n._btnSecondary_1hion_301:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n/* ========== Phase 4: Task History ========== */\n\n._historyHeader_1hion_313 {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n}\n\n._historyHeader_1hion_313 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._searchInput_1hion_327 {\n flex: 1;\n padding: 8px 12px;\n background: rgba(255, 255, 255, 0.1);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 8px;\n color: white;\n font-size: 14px;\n}\n\n._searchInput_1hion_327::placeholder {\n color: rgba(255, 255, 255, 0.5);\n}\n\n._filterTabs_1hion_341 {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n}\n\n._filterTab_1hion_341 {\n padding: 6px 12px;\n background: rgba(255, 255, 255, 0.1);\n border: 1px solid rgba(255, 255, 255, 0.2);\n border-radius: 6px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 12px;\n cursor: pointer;\n transition: all 0.2s;\n}\n\n._filterTab_1hion_341:hover {\n background: rgba(255, 255, 255, 0.2);\n}\n\n._filterTab_1hion_341._active_1hion_362 {\n background: rgba(59, 130, 246, 0.3);\n border-color: rgba(59, 130, 246, 0.5);\n color: white;\n}\n\n._taskList_1hion_368 {\n display: flex;\n flex-direction: column;\n gap: 12px;\n max-height: 400px;\n overflow-y: auto;\n}\n\n._emptyState_1hion_376 {\n text-align: center;\n padding: 32px;\n color: rgba(255, 255, 255, 0.5);\n font-size: 14px;\n}\n\n/* ========== Phase 4: Replay Panel ========== */\n\n._replayPanel_1hion_385 {\n background: rgba(30, 41, 59, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 600px;\n width: 90%;\n max-height: 80vh;\n overflow-y: auto;\n}\n\n._replayHeader_1hion_397 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._replayIcon_1hion_405 {\n font-size: 24px;\n}\n\n._replayHeader_1hion_397 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._replayStatus_1hion_416 {\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n}\n\n._replayStatus_1hion_416._success_1hion_421 {\n color: #10b981;\n}\n\n._replayStatus_1hion_416._failed_1hion_425 {\n color: #ef4444;\n}\n\n/* Event List */\n\n._eventList_1hion_431 {\n padding: 16px;\n max-height: 300px;\n overflow-y: auto;\n}\n\n._eventItem_1hion_437 {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 8px;\n border-radius: 6px;\n margin-bottom: 4px;\n font-size: 13px;\n color: rgba(255, 255, 255, 0.8);\n transition: all 0.2s;\n}\n\n._eventItem_1hion_437._statusPending_1hion_449 {\n background: rgba(255, 255, 255, 0.05);\n}\n\n._eventItem_1hion_437._statusRunning_1hion_453 {\n background: rgba(59, 130, 246, 0.2);\n animation: _pulse_1hion_1 1s infinite;\n}\n\n._eventItem_1hion_437._statusSuccess_1hion_458 {\n background: rgba(16, 185, 129, 0.2);\n}\n\n._eventItem_1hion_437._statusFailed_1hion_462 {\n background: rgba(239, 68, 68, 0.2);\n}\n\n._eventStatusIcon_1hion_466 {\n font-size: 16px;\n width: 20px;\n text-align: center;\n}\n\n._eventDescription_1hion_472 {\n flex: 1;\n}\n\n._eventDuration_1hion_476 {\n font-size: 11px;\n color: rgba(255, 255, 255, 0.5);\n}\n\n@keyframes _pulse_1hion_1 {\n 0%,\n 100% {\n opacity: 1;\n }\n 50% {\n opacity: 0.8;\n }\n}\n\n/* ========== Phase 4: Error Handler ========== */\n\n._errorDialog_1hion_493 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(239, 68, 68, 0.3);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n}\n\n._errorHeader_1hion_503 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._errorIcon_1hion_511 {\n font-size: 24px;\n}\n\n._errorHeader_1hion_503 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._errorDetails_1hion_522 {\n padding: 20px;\n color: rgba(255, 255, 255, 0.8);\n font-size: 14px;\n}\n\n._errorDetails_1hion_522 p {\n margin: 0 0 12px 0;\n}\n\n._errorDetails_1hion_522 strong {\n color: white;\n}\n\n._errorCauses_1hion_536 {\n padding: 0 20px 20px;\n}\n\n._errorCauses_1hion_536 h4 {\n margin: 0 0 12px 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._errorCauses_1hion_536 ul {\n margin: 0;\n padding-left: 20px;\n color: rgba(255, 255, 255, 0.7);\n font-size: 13px;\n}\n\n._errorCauses_1hion_536 li {\n margin-bottom: 6px;\n}\n\n._errorActions_1hion_557 {\n display: flex;\n gap: 8px;\n padding: 20px;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n/* ========== Phase 4: Replay Report ========== */\n\n._replayReport_1hion_566 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n}\n\n._replayReport_1hion_566._success_1hion_421 {\n border-color: rgba(16, 185, 129, 0.3);\n}\n\n._replayReport_1hion_566._failure_1hion_580 {\n border-color: rgba(239, 68, 68, 0.3);\n}\n\n._reportHeader_1hion_584 {\n display: flex;\n align-items: center;\n gap: 12px;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._reportIcon_1hion_592 {\n font-size: 24px;\n}\n\n._reportHeader_1hion_584 h3 {\n flex: 1;\n margin: 0;\n font-size: 18px;\n color: white;\n}\n\n._reportStats_1hion_603 {\n display: flex;\n justify-content: space-around;\n padding: 20px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._statItem_1hion_610 {\n text-align: center;\n}\n\n._statLabel_1hion_614 {\n display: block;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.7);\n margin-bottom: 4px;\n}\n\n._statValue_1hion_621 {\n display: block;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._reportDetails_1hion_628 {\n padding: 20px;\n max-height: 200px;\n overflow-y: auto;\n}\n\n._reportDetails_1hion_628 h4 {\n margin: 0 0 12px 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._eventResult_1hion_640 {\n padding: 8px;\n margin-bottom: 4px;\n border-radius: 6px;\n font-size: 12px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n._eventResult_1hion_640._statusSuccess_1hion_458 {\n background: rgba(16, 185, 129, 0.2);\n}\n\n._eventResult_1hion_640._statusFailed_1hion_462 {\n background: rgba(239, 68, 68, 0.2);\n}\n\n._reportActions_1hion_656 {\n display: flex;\n gap: 8px;\n padding: 20px;\n border-top: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n/* ========== Phase 4: Loading States ========== */\n\n._loadingContent_1hion_665 {\n text-align: center;\n padding: 32px;\n color: white;\n}\n\n._loadingSpinner_1hion_671 {\n width: 40px;\n height: 40px;\n margin: 0 auto 16px;\n border: 3px solid rgba(255, 255, 255, 0.2);\n border-top-color: white;\n border-radius: 50%;\n animation: _spin_1hion_1 1s linear infinite;\n}\n\n@keyframes _spin_1hion_1 {\n to {\n transform: rotate(360deg);\n }\n}\n\n._loadingContent_1hion_665 p {\n margin: 0;\n font-size: 14px;\n color: rgba(255, 255, 255, 0.8);\n}\n\n/* ========== Phase 4: Task Card Dialog ========== */\n\n._taskCardDialog_1hion_695 {\n padding: 20px;\n}\n\n/* ========== Settings ========== */\n\n._settingsOverlay_1hion_701 {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n backdrop-filter: blur(4px);\n z-index: 2147483647;\n display: flex;\n align-items: center;\n justify-content: center;\n animation: _overlayFadeIn_1hion_1 0.2s ease;\n}\n\n._settingsDialog_1hion_713 {\n background: rgba(30, 30, 30, 0.95);\n backdrop-filter: blur(20px);\n border: 1px solid rgba(255, 255, 255, 0.1);\n border-radius: 16px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);\n max-width: 480px;\n width: 90%;\n animation: _dialogSlideIn_1hion_1 0.3s ease;\n}\n\n._settingsDialogHeader_1hion_724 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 20px 24px;\n border-bottom: 1px solid rgba(255, 255, 255, 0.1);\n}\n\n._settingsDialogHeader_1hion_724 h3 {\n margin: 0;\n font-size: 18px;\n font-weight: 600;\n color: white;\n}\n\n._settingsDialogContent_1hion_739 {\n padding: 24px;\n}\n\n._settingsField_1hion_743 {\n margin-bottom: 20px;\n}\n\n._settingsLabel_1hion_747 {\n display: block;\n margin-bottom: 8px;\n font-size: 13px;\n font-weight: 500;\n color: rgba(255, 255, 255, 0.9);\n}\n\n._settingsInput_1hion_755 {\n width: 100%;\n padding: 10px 12px;\n background: rgba(255, 255, 255, 0.05);\n border: 1px solid rgba(255, 255, 255, 0.15);\n border-radius: 8px;\n color: white;\n font-size: 14px;\n font-family: inherit;\n box-sizing: border-box;\n transition: all 0.2s;\n}\n\n._settingsInput_1hion_755::placeholder {\n color: rgba(255, 255, 255, 0.4);\n}\n\n._settingsInput_1hion_755:focus {\n outline: none;\n background: rgba(255, 255, 255, 0.08);\n border-color: rgba(59, 130, 246, 0.5);\n}\n\n._settingsInput_1hion_755[type='password'] {\n -webkit-text-security: disc;\n}\n\n/* ========== Test Mode UI - Design System Styles ========== */\n\n/* CSS Variables for design system consistency */\n:root {\n --color-primary: #58a6ff;\n --color-primary-hover: #79c0ff;\n --color-primary-pressed: #388bfd;\n --color-text-inverse: #0d1117;\n --color-text-primary: #e6edf3;\n --color-text-secondary: #8b949e;\n --color-border-default: #30363d;\n --color-border-emphasis: #484f58;\n --color-success: #3fb950;\n --color-danger: #f85149;\n --color-surface: #161b22;\n --font-mono:\n 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Menlo', 'Consolas', 'Liberation Mono',\n monospace;\n --font-sans:\n 'Inter', 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial,\n sans-serif;\n}\n\n/* Primary Button (Run) */\n._testButton_1hion_806 {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n height: 32px;\n padding: 0 16px;\n border: none;\n border-radius: 6px;\n font-family: var(--font-sans);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition:\n background 0.3s ease,\n transform 0.15s ease;\n position: relative;\n flex-shrink: 0;\n gap: 6px;\n}\n\n._testButtonPrimary_1hion_826 {\n background: var(--color-primary);\n color: var(--color-text-inverse);\n}\n\n._testButtonPrimary_1hion_826:hover:not(:disabled) {\n background: var(--color-primary-hover);\n transform: translateY(-0.5px);\n}\n\n._testButtonPrimary_1hion_826:active:not(:disabled) {\n background: var(--color-primary-pressed);\n transform: translateY(0);\n}\n\n._testButtonPrimary_1hion_826:disabled {\n background: rgba(56, 139, 253, 0.3);\n color: rgba(13, 17, 23, 0.5);\n cursor: not-allowed;\n}\n\n/* Loading state — standalone class for CSS module export */\n._testButtonLoading_1hion_848 {\n background: var(--color-primary);\n cursor: wait;\n}\n\n/* Success state — standalone class for CSS module export */\n._testButtonSuccess_1hion_854 {\n background: var(--color-success);\n transition: background 0.3s ease;\n cursor: default;\n}\n\n/* Error state — standalone class for CSS module export */\n._testButtonError_1hion_861 {\n background: var(--color-danger);\n color: white;\n animation: _testBtnShake_1hion_1 0.3s ease;\n cursor: default;\n}\n\n@keyframes _testBtnShake_1hion_1 {\n 0%,\n 100% {\n transform: translateX(0);\n }\n 20% {\n transform: translateX(-3px);\n }\n 40% {\n transform: translateX(3px);\n }\n 60% {\n transform: translateX(-2px);\n }\n 80% {\n transform: translateX(2px);\n }\n}\n\n/* Secondary Button (Save/Export) */\n._testButtonSecondary_1hion_888 {\n background: transparent;\n color: var(--color-text-primary);\n border: 1px solid var(--color-border-default);\n padding: 0 15px;\n font-weight: 500;\n}\n\n._testButtonSecondary_1hion_888:hover {\n background: rgba(255, 255, 255, 0.05);\n border-color: var(--color-border-emphasis);\n color: var(--color-text-primary);\n}\n\n._testButtonSecondary_1hion_888:active {\n background: rgba(255, 255, 255, 0.08);\n border-color: var(--color-border-emphasis);\n color: var(--color-text-primary);\n}\n\n/* DSL Editor (YAML) */\n._dslEditor_1hion_909 {\n width: 100%;\n min-height: 180px;\n background: var(--color-surface);\n color: var(--color-text-primary);\n border: 1px solid var(--color-border-default);\n border-radius: 6px;\n padding: 12px;\n font-family: var(--font-mono);\n font-size: 13px;\n line-height: 1.65;\n resize: vertical;\n box-sizing: border-box;\n transition: border-color 0.15s ease;\n}\n\n._dslEditor_1hion_909:focus {\n outline: none;\n border-color: var(--color-primary);\n}\n\n._dslEditor_1hion_909::placeholder {\n color: var(--color-text-secondary);\n}\n\n/* ========== Result Status Indicator ========== */\n._resultStatus_1hion_935 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);\n color: var(--color-text-tertiary, #6e7681);\n margin-left: auto;\n min-height: 18px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 160px;\n transition: color 0.2s ease;\n}\n\n._resultStatusRunning_1hion_951 {\n color: var(--color-warning, #d29922);\n}\n\n._resultStatusSuccess_1hion_955 {\n color: var(--color-success, #3fb950);\n}\n\n._resultStatusError_1hion_959 {\n color: var(--color-danger, #f85149);\n}\n/*$vite$:1*/";
4
4
  document.head.appendChild(__vite_style__);
5
5
  //#region \0rolldown/runtime.js
6
6
  var __create = Object.create;
@@ -35,872 +35,1252 @@
35
35
  enumerable: true
36
36
  }) : target, mod));
37
37
  //#endregion
38
- //#region ../../node_modules/zod/v4/core/core.js
39
- var _a$1;
40
- function $constructor(name, initializer, params) {
41
- function init(inst, def) {
42
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
43
- value: {
44
- def,
45
- constr: _,
46
- traits: /* @__PURE__ */ new Set()
47
- },
48
- enumerable: false
49
- });
50
- if (inst._zod.traits.has(name)) return;
51
- inst._zod.traits.add(name);
52
- initializer(inst, def);
53
- const proto = _.prototype;
54
- const keys = Object.keys(proto);
55
- for (let i = 0; i < keys.length; i++) {
56
- const k = keys[i];
57
- if (!(k in inst)) inst[k] = proto[k].bind(inst);
58
- }
59
- }
60
- const Parent = params?.Parent ?? Object;
61
- class Definition extends Parent {}
62
- Object.defineProperty(Definition, "name", { value: name });
63
- function _(def) {
64
- var _a;
65
- const inst = params?.Parent ? new Definition() : this;
66
- init(inst, def);
67
- (_a = inst._zod).deferred ?? (_a.deferred = []);
68
- for (const fn of inst._zod.deferred) fn();
69
- return inst;
38
+ //#region ../llms/src/errors.ts
39
+ /**
40
+ * Error types and error handling for LLM invocations
41
+ */
42
+ var InvokeErrorTypes = {
43
+ NETWORK_ERROR: "network_error",
44
+ RATE_LIMIT: "rate_limit",
45
+ SERVER_ERROR: "server_error",
46
+ NO_TOOL_CALL: "no_tool_call",
47
+ INVALID_TOOL_ARGS: "invalid_tool_args",
48
+ TOOL_EXECUTION_ERROR: "tool_execution_error",
49
+ UNKNOWN: "unknown",
50
+ CONFIG_ERROR: "config_error",
51
+ AUTH_ERROR: "auth_error",
52
+ CONTEXT_LENGTH: "context_length",
53
+ CONTENT_FILTER: "content_filter"
54
+ };
55
+ var InvokeError = class extends Error {
56
+ type;
57
+ retryable;
58
+ statusCode;
59
+ rawError;
60
+ rawResponse;
61
+ constructor(type, message, rawError, rawResponse) {
62
+ super(message);
63
+ this.name = "InvokeError";
64
+ this.type = type;
65
+ this.retryable = this.isRetryable(type, rawError);
66
+ this.rawError = rawError;
67
+ this.rawResponse = rawResponse;
70
68
  }
71
- Object.defineProperty(_, "init", { value: init });
72
- Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
73
- if (params?.Parent && inst instanceof params.Parent) return true;
74
- return inst?._zod?.traits?.has(name);
75
- } });
76
- Object.defineProperty(_, "name", { value: name });
77
- return _;
78
- }
79
- var $ZodAsyncError = class extends Error {
80
- constructor() {
81
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
69
+ isRetryable(type, rawError) {
70
+ if (rawError?.name === "AbortError") return false;
71
+ return [
72
+ InvokeErrorTypes.NETWORK_ERROR,
73
+ InvokeErrorTypes.RATE_LIMIT,
74
+ InvokeErrorTypes.SERVER_ERROR,
75
+ InvokeErrorTypes.NO_TOOL_CALL,
76
+ InvokeErrorTypes.INVALID_TOOL_ARGS,
77
+ InvokeErrorTypes.TOOL_EXECUTION_ERROR,
78
+ InvokeErrorTypes.UNKNOWN
79
+ ].includes(type);
82
80
  }
83
81
  };
84
- var $ZodEncodeError = class extends Error {
85
- constructor(name) {
86
- super(`Encountered unidirectional transform during encode: ${name}`);
87
- this.name = "ZodEncodeError";
82
+ //#endregion
83
+ //#region ../../node_modules/chalk/source/vendor/ansi-styles/index.js
84
+ var ANSI_BACKGROUND_OFFSET = 10;
85
+ var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
86
+ var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
87
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
88
+ var styles$1 = {
89
+ modifier: {
90
+ reset: [0, 0],
91
+ bold: [1, 22],
92
+ dim: [2, 22],
93
+ italic: [3, 23],
94
+ underline: [4, 24],
95
+ overline: [53, 55],
96
+ inverse: [7, 27],
97
+ hidden: [8, 28],
98
+ strikethrough: [9, 29]
99
+ },
100
+ color: {
101
+ black: [30, 39],
102
+ red: [31, 39],
103
+ green: [32, 39],
104
+ yellow: [33, 39],
105
+ blue: [34, 39],
106
+ magenta: [35, 39],
107
+ cyan: [36, 39],
108
+ white: [37, 39],
109
+ blackBright: [90, 39],
110
+ gray: [90, 39],
111
+ grey: [90, 39],
112
+ redBright: [91, 39],
113
+ greenBright: [92, 39],
114
+ yellowBright: [93, 39],
115
+ blueBright: [94, 39],
116
+ magentaBright: [95, 39],
117
+ cyanBright: [96, 39],
118
+ whiteBright: [97, 39]
119
+ },
120
+ bgColor: {
121
+ bgBlack: [40, 49],
122
+ bgRed: [41, 49],
123
+ bgGreen: [42, 49],
124
+ bgYellow: [43, 49],
125
+ bgBlue: [44, 49],
126
+ bgMagenta: [45, 49],
127
+ bgCyan: [46, 49],
128
+ bgWhite: [47, 49],
129
+ bgBlackBright: [100, 49],
130
+ bgGray: [100, 49],
131
+ bgGrey: [100, 49],
132
+ bgRedBright: [101, 49],
133
+ bgGreenBright: [102, 49],
134
+ bgYellowBright: [103, 49],
135
+ bgBlueBright: [104, 49],
136
+ bgMagentaBright: [105, 49],
137
+ bgCyanBright: [106, 49],
138
+ bgWhiteBright: [107, 49]
88
139
  }
89
140
  };
90
- (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
91
- var globalConfig = globalThis.__zod_globalConfig;
92
- function config(newConfig) {
93
- if (newConfig) Object.assign(globalConfig, newConfig);
94
- return globalConfig;
95
- }
96
- //#endregion
97
- //#region ../../node_modules/zod/v4/core/util.js
98
- function getEnumValues(entries) {
99
- const numericValues = Object.values(entries).filter((v) => typeof v === "number");
100
- return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
101
- }
102
- function jsonStringifyReplacer(_, value) {
103
- if (typeof value === "bigint") return value.toString();
104
- return value;
105
- }
106
- function cached(getter) {
107
- return { get value() {
108
- {
109
- const value = getter();
110
- Object.defineProperty(this, "value", { value });
111
- return value;
141
+ var modifierNames = Object.keys(styles$1.modifier);
142
+ var foregroundColorNames = Object.keys(styles$1.color);
143
+ var backgroundColorNames = Object.keys(styles$1.bgColor);
144
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
145
+ function assembleStyles() {
146
+ const codes = /* @__PURE__ */ new Map();
147
+ for (const [groupName, group] of Object.entries(styles$1)) {
148
+ for (const [styleName, style] of Object.entries(group)) {
149
+ styles$1[styleName] = {
150
+ open: `\u001B[${style[0]}m`,
151
+ close: `\u001B[${style[1]}m`
152
+ };
153
+ group[styleName] = styles$1[styleName];
154
+ codes.set(style[0], style[1]);
112
155
  }
113
- throw new Error("cached value already set");
114
- } };
115
- }
116
- function nullish(input) {
117
- return input === null || input === void 0;
118
- }
119
- function cleanRegex(source) {
120
- const start = source.startsWith("^") ? 1 : 0;
121
- const end = source.endsWith("$") ? source.length - 1 : source.length;
122
- return source.slice(start, end);
123
- }
124
- function floatSafeRemainder(val, step) {
125
- const ratio = val / step;
126
- const roundedRatio = Math.round(ratio);
127
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
128
- if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
129
- return ratio - roundedRatio;
130
- }
131
- var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
132
- function defineLazy(object, key, getter) {
133
- let value = void 0;
134
- Object.defineProperty(object, key, {
135
- get() {
136
- if (value === EVALUATING) return;
137
- if (value === void 0) {
138
- value = EVALUATING;
139
- value = getter();
140
- }
141
- return value;
142
- },
143
- set(v) {
144
- Object.defineProperty(object, key, { value: v });
145
- },
146
- configurable: true
147
- });
148
- }
149
- function assignProp(target, prop, value) {
150
- Object.defineProperty(target, prop, {
151
- value,
152
- writable: true,
153
- enumerable: true,
154
- configurable: true
155
- });
156
- }
157
- function mergeDefs(...defs) {
158
- const mergedDescriptors = {};
159
- for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
160
- return Object.defineProperties({}, mergedDescriptors);
161
- }
162
- function esc(str) {
163
- return JSON.stringify(str);
164
- }
165
- function slugify(input) {
166
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
167
- }
168
- var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
169
- function isObject$1(data) {
170
- return typeof data === "object" && data !== null && !Array.isArray(data);
171
- }
172
- var allowsEval = /* @__PURE__ */ cached(() => {
173
- if (globalConfig.jitless) return false;
174
- if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
175
- try {
176
- new Function("");
177
- return true;
178
- } catch (_) {
179
- return false;
156
+ Object.defineProperty(styles$1, groupName, {
157
+ value: group,
158
+ enumerable: false
159
+ });
180
160
  }
181
- });
182
- function isPlainObject(o) {
183
- if (isObject$1(o) === false) return false;
184
- const ctor = o.constructor;
185
- if (ctor === void 0) return true;
186
- if (typeof ctor !== "function") return true;
187
- const prot = ctor.prototype;
188
- if (isObject$1(prot) === false) return false;
189
- if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
190
- return true;
191
- }
192
- function shallowClone(o) {
193
- if (isPlainObject(o)) return { ...o };
194
- if (Array.isArray(o)) return [...o];
195
- if (o instanceof Map) return new Map(o);
196
- if (o instanceof Set) return new Set(o);
197
- return o;
198
- }
199
- var propertyKeyTypes = /* @__PURE__ */ new Set([
200
- "string",
201
- "number",
202
- "symbol"
203
- ]);
204
- function escapeRegex(str) {
205
- return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
206
- }
207
- function clone(inst, def, params) {
208
- const cl = new inst._zod.constr(def ?? inst._zod.def);
209
- if (!def || params?.parent) cl._zod.parent = inst;
210
- return cl;
211
- }
212
- function normalizeParams(_params) {
213
- const params = _params;
214
- if (!params) return {};
215
- if (typeof params === "string") return { error: () => params };
216
- if (params?.message !== void 0) {
217
- if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
218
- params.error = params.message;
219
- }
220
- delete params.message;
221
- if (typeof params.error === "string") return {
222
- ...params,
223
- error: () => params.error
224
- };
225
- return params;
226
- }
227
- function optionalKeys(shape) {
228
- return Object.keys(shape).filter((k) => {
229
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
161
+ Object.defineProperty(styles$1, "codes", {
162
+ value: codes,
163
+ enumerable: false
230
164
  });
231
- }
232
- var NUMBER_FORMAT_RANGES = {
233
- safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
234
- int32: [-2147483648, 2147483647],
235
- uint32: [0, 4294967295],
236
- float32: [-34028234663852886e22, 34028234663852886e22],
237
- float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
238
- };
239
- function pick(schema, mask) {
240
- const currDef = schema._zod.def;
241
- const checks = currDef.checks;
242
- if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
243
- return clone(schema, mergeDefs(schema._zod.def, {
244
- get shape() {
245
- const newShape = {};
246
- for (const key in mask) {
247
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
248
- if (!mask[key]) continue;
249
- newShape[key] = currDef.shape[key];
250
- }
251
- assignProp(this, "shape", newShape);
252
- return newShape;
165
+ styles$1.color.close = "\x1B[39m";
166
+ styles$1.bgColor.close = "\x1B[49m";
167
+ styles$1.color.ansi = wrapAnsi16();
168
+ styles$1.color.ansi256 = wrapAnsi256();
169
+ styles$1.color.ansi16m = wrapAnsi16m();
170
+ styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
171
+ styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
172
+ styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
173
+ Object.defineProperties(styles$1, {
174
+ rgbToAnsi256: {
175
+ value(red, green, blue) {
176
+ if (red === green && green === blue) {
177
+ if (red < 8) return 16;
178
+ if (red > 248) return 231;
179
+ return Math.round((red - 8) / 247 * 24) + 232;
180
+ }
181
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
182
+ },
183
+ enumerable: false
253
184
  },
254
- checks: []
255
- }));
256
- }
257
- function omit(schema, mask) {
258
- const currDef = schema._zod.def;
259
- const checks = currDef.checks;
260
- if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
261
- return clone(schema, mergeDefs(schema._zod.def, {
262
- get shape() {
263
- const newShape = { ...schema._zod.def.shape };
264
- for (const key in mask) {
265
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
266
- if (!mask[key]) continue;
267
- delete newShape[key];
268
- }
269
- assignProp(this, "shape", newShape);
270
- return newShape;
185
+ hexToRgb: {
186
+ value(hex) {
187
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
188
+ if (!matches) return [
189
+ 0,
190
+ 0,
191
+ 0
192
+ ];
193
+ let [colorString] = matches;
194
+ if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
195
+ const integer = Number.parseInt(colorString, 16);
196
+ return [
197
+ integer >> 16 & 255,
198
+ integer >> 8 & 255,
199
+ integer & 255
200
+ ];
201
+ },
202
+ enumerable: false
271
203
  },
272
- checks: []
273
- }));
274
- }
275
- function extend$1(schema, shape) {
276
- if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
277
- const checks = schema._zod.def.checks;
278
- if (checks && checks.length > 0) {
279
- const existingShape = schema._zod.def.shape;
280
- for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
281
- }
282
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
283
- const _shape = {
284
- ...schema._zod.def.shape,
285
- ...shape
286
- };
287
- assignProp(this, "shape", _shape);
288
- return _shape;
289
- } }));
290
- }
291
- function safeExtend(schema, shape) {
292
- if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
293
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
294
- const _shape = {
295
- ...schema._zod.def.shape,
296
- ...shape
297
- };
298
- assignProp(this, "shape", _shape);
299
- return _shape;
300
- } }));
301
- }
302
- function merge$1(a, b) {
303
- if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
304
- return clone(a, mergeDefs(a._zod.def, {
305
- get shape() {
306
- const _shape = {
307
- ...a._zod.def.shape,
308
- ...b._zod.def.shape
309
- };
310
- assignProp(this, "shape", _shape);
311
- return _shape;
204
+ hexToAnsi256: {
205
+ value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
206
+ enumerable: false
312
207
  },
313
- get catchall() {
314
- return b._zod.def.catchall;
208
+ ansi256ToAnsi: {
209
+ value(code) {
210
+ if (code < 8) return 30 + code;
211
+ if (code < 16) return 90 + (code - 8);
212
+ let red;
213
+ let green;
214
+ let blue;
215
+ if (code >= 232) {
216
+ red = ((code - 232) * 10 + 8) / 255;
217
+ green = red;
218
+ blue = red;
219
+ } else {
220
+ code -= 16;
221
+ const remainder = code % 36;
222
+ red = Math.floor(code / 36) / 5;
223
+ green = Math.floor(remainder / 6) / 5;
224
+ blue = remainder % 6 / 5;
225
+ }
226
+ const value = Math.max(red, green, blue) * 2;
227
+ if (value === 0) return 30;
228
+ let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
229
+ if (value === 2) result += 60;
230
+ return result;
231
+ },
232
+ enumerable: false
315
233
  },
316
- checks: b._zod.def.checks ?? []
317
- }));
318
- }
319
- function partial(Class, schema, mask) {
320
- const checks = schema._zod.def.checks;
321
- if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
322
- return clone(schema, mergeDefs(schema._zod.def, {
323
- get shape() {
324
- const oldShape = schema._zod.def.shape;
325
- const shape = { ...oldShape };
326
- if (mask) for (const key in mask) {
327
- if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
328
- if (!mask[key]) continue;
329
- shape[key] = Class ? new Class({
330
- type: "optional",
331
- innerType: oldShape[key]
332
- }) : oldShape[key];
333
- }
334
- else for (const key in oldShape) shape[key] = Class ? new Class({
335
- type: "optional",
336
- innerType: oldShape[key]
337
- }) : oldShape[key];
338
- assignProp(this, "shape", shape);
339
- return shape;
234
+ rgbToAnsi: {
235
+ value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
236
+ enumerable: false
340
237
  },
341
- checks: []
342
- }));
343
- }
344
- function required(Class, schema, mask) {
345
- return clone(schema, mergeDefs(schema._zod.def, { get shape() {
346
- const oldShape = schema._zod.def.shape;
347
- const shape = { ...oldShape };
348
- if (mask) for (const key in mask) {
349
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
350
- if (!mask[key]) continue;
351
- shape[key] = new Class({
352
- type: "nonoptional",
353
- innerType: oldShape[key]
354
- });
238
+ hexToAnsi: {
239
+ value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
240
+ enumerable: false
355
241
  }
356
- else for (const key in oldShape) shape[key] = new Class({
357
- type: "nonoptional",
358
- innerType: oldShape[key]
359
- });
360
- assignProp(this, "shape", shape);
361
- return shape;
362
- } }));
363
- }
364
- function aborted(x, startIndex = 0) {
365
- if (x.aborted === true) return true;
366
- for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
367
- return false;
368
- }
369
- function explicitlyAborted(x, startIndex = 0) {
370
- if (x.aborted === true) return true;
371
- for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
372
- return false;
373
- }
374
- function prefixIssues(path, issues) {
375
- return issues.map((iss) => {
376
- var _a;
377
- (_a = iss).path ?? (_a.path = []);
378
- iss.path.unshift(path);
379
- return iss;
380
- });
381
- }
382
- function unwrapMessage(message) {
383
- return typeof message === "string" ? message : message?.message;
384
- }
385
- function finalizeIssue(iss, ctx, config) {
386
- const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
387
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
388
- rest.path ?? (rest.path = []);
389
- rest.message = message;
390
- if (ctx?.reportInput) rest.input = _input;
391
- return rest;
392
- }
393
- function getLengthableOrigin(input) {
394
- if (Array.isArray(input)) return "array";
395
- if (typeof input === "string") return "string";
396
- return "unknown";
397
- }
398
- function issue(...args) {
399
- const [iss, input, inst] = args;
400
- if (typeof iss === "string") return {
401
- message: iss,
402
- code: "custom",
403
- input,
404
- inst
405
- };
406
- return { ...iss };
242
+ });
243
+ return styles$1;
407
244
  }
245
+ var ansiStyles = assembleStyles();
408
246
  //#endregion
409
- //#region ../../node_modules/zod/v4/core/errors.js
410
- var initializer$1 = (inst, def) => {
411
- inst.name = "$ZodError";
412
- Object.defineProperty(inst, "_zod", {
413
- value: inst._zod,
414
- enumerable: false
415
- });
416
- Object.defineProperty(inst, "issues", {
417
- value: def,
418
- enumerable: false
419
- });
420
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
421
- Object.defineProperty(inst, "toString", {
422
- value: () => inst.message,
423
- enumerable: false
424
- });
425
- };
426
- var $ZodError = $constructor("$ZodError", initializer$1);
427
- var $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
428
- function flattenError(error, mapper = (issue) => issue.message) {
429
- const fieldErrors = {};
430
- const formErrors = [];
431
- for (const sub of error.issues) if (sub.path.length > 0) {
432
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
433
- fieldErrors[sub.path[0]].push(mapper(sub));
434
- } else formErrors.push(mapper(sub));
435
- return {
436
- formErrors,
437
- fieldErrors
438
- };
439
- }
440
- function formatError$1(error, mapper = (issue) => issue.message) {
441
- const fieldErrors = { _errors: [] };
442
- const processError = (error, path = []) => {
443
- for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
444
- else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
445
- else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
446
- else {
447
- const fullpath = [...path, ...issue.path];
448
- if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
449
- else {
450
- let curr = fieldErrors;
451
- let i = 0;
452
- while (i < fullpath.length) {
453
- const el = fullpath[i];
454
- if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
455
- else {
456
- curr[el] = curr[el] || { _errors: [] };
457
- curr[el]._errors.push(mapper(issue));
458
- }
459
- curr = curr[el];
460
- i++;
461
- }
462
- }
463
- }
464
- };
465
- processError(error);
466
- return fieldErrors;
467
- }
468
- /** Format a ZodError as a human-readable string in the following form.
469
- *
470
- * From
471
- *
472
- * ```ts
473
- * ZodError {
474
- * issues: [
475
- * {
476
- * expected: 'string',
477
- * code: 'invalid_type',
478
- * path: [ 'username' ],
479
- * message: 'Invalid input: expected string'
480
- * },
481
- * {
482
- * expected: 'number',
483
- * code: 'invalid_type',
484
- * path: [ 'favoriteNumbers', 1 ],
485
- * message: 'Invalid input: expected number'
486
- * }
487
- * ];
488
- * }
489
- * ```
490
- *
491
- * to
492
- *
493
- * ```
494
- * username
495
- * ✖ Expected number, received string at "username
496
- * favoriteNumbers[0]
497
- * ✖ Invalid input: expected number
498
- * ```
499
- */
500
- function toDotPath(_path) {
501
- const segs = [];
502
- const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
503
- for (const seg of path) if (typeof seg === "number") segs.push(`[${seg}]`);
504
- else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
505
- else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`);
506
- else {
507
- if (segs.length) segs.push(".");
508
- segs.push(seg);
247
+ //#region ../../node_modules/chalk/source/vendor/supports-color/browser.js
248
+ var level = (() => {
249
+ if (!("navigator" in globalThis)) return 0;
250
+ if (globalThis.navigator.userAgentData) {
251
+ const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
252
+ if (brand && brand.version > 93) return 3;
509
253
  }
510
- return segs.join("");
254
+ if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
255
+ return 0;
256
+ })();
257
+ var colorSupport = level !== 0 && {
258
+ level,
259
+ hasBasic: true,
260
+ has256: level >= 2,
261
+ has16m: level >= 3
262
+ };
263
+ var supportsColor = {
264
+ stdout: colorSupport,
265
+ stderr: colorSupport
266
+ };
267
+ //#endregion
268
+ //#region ../../node_modules/chalk/source/utilities.js
269
+ function stringReplaceAll(string, substring, replacer) {
270
+ let index = string.indexOf(substring);
271
+ if (index === -1) return string;
272
+ const substringLength = substring.length;
273
+ let endIndex = 0;
274
+ let returnValue = "";
275
+ do {
276
+ returnValue += string.slice(endIndex, index) + substring + replacer;
277
+ endIndex = index + substringLength;
278
+ index = string.indexOf(substring, endIndex);
279
+ } while (index !== -1);
280
+ returnValue += string.slice(endIndex);
281
+ return returnValue;
511
282
  }
512
- function prettifyError(error) {
513
- const lines = [];
514
- const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
515
- for (const issue of issues) {
516
- lines.push(`✖ ${issue.message}`);
517
- if (issue.path?.length) lines.push(` → at ${toDotPath(issue.path)}`);
518
- }
519
- return lines.join("\n");
283
+ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
284
+ let endIndex = 0;
285
+ let returnValue = "";
286
+ do {
287
+ const gotCR = string[index - 1] === "\r";
288
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
289
+ endIndex = index + 1;
290
+ index = string.indexOf("\n", endIndex);
291
+ } while (index !== -1);
292
+ returnValue += string.slice(endIndex);
293
+ return returnValue;
520
294
  }
521
295
  //#endregion
522
- //#region ../../node_modules/zod/v4/core/parse.js
523
- var _parse = (_Err) => (schema, value, _ctx, _params) => {
524
- const ctx = _ctx ? {
525
- ..._ctx,
526
- async: false
527
- } : { async: false };
528
- const result = schema._zod.run({
529
- value,
530
- issues: []
531
- }, ctx);
532
- if (result instanceof Promise) throw new $ZodAsyncError();
533
- if (result.issues.length) {
534
- const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
535
- captureStackTrace(e, _params?.callee);
536
- throw e;
537
- }
538
- return result.value;
296
+ //#region ../../node_modules/chalk/source/index.js
297
+ var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
298
+ var GENERATOR = Symbol("GENERATOR");
299
+ var STYLER = Symbol("STYLER");
300
+ var IS_EMPTY = Symbol("IS_EMPTY");
301
+ var levelMapping = [
302
+ "ansi",
303
+ "ansi",
304
+ "ansi256",
305
+ "ansi16m"
306
+ ];
307
+ var styles = Object.create(null);
308
+ var applyOptions = (object, options = {}) => {
309
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
310
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
311
+ object.level = options.level === void 0 ? colorLevel : options.level;
539
312
  };
540
- var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
541
- const ctx = _ctx ? {
542
- ..._ctx,
543
- async: true
544
- } : { async: true };
545
- let result = schema._zod.run({
546
- value,
547
- issues: []
548
- }, ctx);
549
- if (result instanceof Promise) result = await result;
550
- if (result.issues.length) {
551
- const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
552
- captureStackTrace(e, params?.callee);
553
- throw e;
554
- }
555
- return result.value;
313
+ var chalkFactory = (options) => {
314
+ const chalk = (...strings) => strings.join(" ");
315
+ applyOptions(chalk, options);
316
+ Object.setPrototypeOf(chalk, createChalk.prototype);
317
+ return chalk;
556
318
  };
557
- var _safeParse = (_Err) => (schema, value, _ctx) => {
558
- const ctx = _ctx ? {
559
- ..._ctx,
560
- async: false
561
- } : { async: false };
562
- const result = schema._zod.run({
563
- value,
564
- issues: []
565
- }, ctx);
566
- if (result instanceof Promise) throw new $ZodAsyncError();
567
- return result.issues.length ? {
568
- success: false,
569
- error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
570
- } : {
571
- success: true,
572
- data: result.value
573
- };
319
+ function createChalk(options) {
320
+ return chalkFactory(options);
321
+ }
322
+ Object.setPrototypeOf(createChalk.prototype, Function.prototype);
323
+ for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
324
+ const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
325
+ Object.defineProperty(this, styleName, { value: builder });
326
+ return builder;
327
+ } };
328
+ styles.visible = { get() {
329
+ const builder = createBuilder(this, this[STYLER], true);
330
+ Object.defineProperty(this, "visible", { value: builder });
331
+ return builder;
332
+ } };
333
+ var getModelAnsi = (model, level, type, ...arguments_) => {
334
+ if (model === "rgb") {
335
+ if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
336
+ if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
337
+ return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
338
+ }
339
+ if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
340
+ return ansiStyles[type][model](...arguments_);
574
341
  };
575
- var safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
576
- var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
577
- const ctx = _ctx ? {
578
- ..._ctx,
579
- async: true
580
- } : { async: true };
581
- let result = schema._zod.run({
582
- value,
583
- issues: []
584
- }, ctx);
585
- if (result instanceof Promise) result = await result;
586
- return result.issues.length ? {
587
- success: false,
588
- error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
589
- } : {
590
- success: true,
591
- data: result.value
342
+ for (const model of [
343
+ "rgb",
344
+ "hex",
345
+ "ansi256"
346
+ ]) {
347
+ styles[model] = { get() {
348
+ const { level } = this;
349
+ return function(...arguments_) {
350
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
351
+ return createBuilder(this, styler, this[IS_EMPTY]);
352
+ };
353
+ } };
354
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
355
+ styles[bgModel] = { get() {
356
+ const { level } = this;
357
+ return function(...arguments_) {
358
+ const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
359
+ return createBuilder(this, styler, this[IS_EMPTY]);
360
+ };
361
+ } };
362
+ }
363
+ var proto = Object.defineProperties(() => {}, {
364
+ ...styles,
365
+ level: {
366
+ enumerable: true,
367
+ get() {
368
+ return this[GENERATOR].level;
369
+ },
370
+ set(level) {
371
+ this[GENERATOR].level = level;
372
+ }
373
+ }
374
+ });
375
+ var createStyler = (open, close, parent) => {
376
+ let openAll;
377
+ let closeAll;
378
+ if (parent === void 0) {
379
+ openAll = open;
380
+ closeAll = close;
381
+ } else {
382
+ openAll = parent.openAll + open;
383
+ closeAll = close + parent.closeAll;
384
+ }
385
+ return {
386
+ open,
387
+ close,
388
+ openAll,
389
+ closeAll,
390
+ parent
592
391
  };
593
392
  };
594
- var safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
595
- var _encode = (_Err) => (schema, value, _ctx) => {
596
- const ctx = _ctx ? {
597
- ..._ctx,
598
- direction: "backward"
599
- } : { direction: "backward" };
600
- return _parse(_Err)(schema, value, ctx);
601
- };
602
- var _decode = (_Err) => (schema, value, _ctx) => {
603
- return _parse(_Err)(schema, value, _ctx);
604
- };
605
- var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
606
- const ctx = _ctx ? {
607
- ..._ctx,
608
- direction: "backward"
609
- } : { direction: "backward" };
610
- return _parseAsync(_Err)(schema, value, ctx);
611
- };
612
- var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
613
- return _parseAsync(_Err)(schema, value, _ctx);
614
- };
615
- var _safeEncode = (_Err) => (schema, value, _ctx) => {
616
- const ctx = _ctx ? {
617
- ..._ctx,
618
- direction: "backward"
619
- } : { direction: "backward" };
620
- return _safeParse(_Err)(schema, value, ctx);
621
- };
622
- var _safeDecode = (_Err) => (schema, value, _ctx) => {
623
- return _safeParse(_Err)(schema, value, _ctx);
624
- };
625
- var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
626
- const ctx = _ctx ? {
627
- ..._ctx,
628
- direction: "backward"
629
- } : { direction: "backward" };
630
- return _safeParseAsync(_Err)(schema, value, ctx);
393
+ var createBuilder = (self, _styler, _isEmpty) => {
394
+ const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
395
+ Object.setPrototypeOf(builder, proto);
396
+ builder[GENERATOR] = self;
397
+ builder[STYLER] = _styler;
398
+ builder[IS_EMPTY] = _isEmpty;
399
+ return builder;
631
400
  };
632
- var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
633
- return _safeParseAsync(_Err)(schema, value, _ctx);
401
+ var applyStyle = (self, string) => {
402
+ if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
403
+ let styler = self[STYLER];
404
+ if (styler === void 0) return string;
405
+ const { openAll, closeAll } = styler;
406
+ if (string.includes("\x1B")) while (styler !== void 0) {
407
+ string = stringReplaceAll(string, styler.close, styler.open);
408
+ styler = styler.parent;
409
+ }
410
+ const lfIndex = string.indexOf("\n");
411
+ if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
412
+ return openAll + string + closeAll;
634
413
  };
414
+ Object.defineProperties(createChalk.prototype, styles);
415
+ var chalk = createChalk();
416
+ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
635
417
  //#endregion
636
- //#region ../../node_modules/zod/v4/core/regexes.js
637
- /**
638
- * @deprecated CUID v1 is deprecated by its authors due to information leakage
639
- * (timestamps embedded in the id). Use {@link cuid2} instead.
640
- * See https://github.com/paralleldrive/cuid.
641
- */
642
- var cuid = /^[cC][0-9a-z]{6,}$/;
643
- var cuid2 = /^[0-9a-z]+$/;
644
- var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
645
- var xid = /^[0-9a-vA-V]{20}$/;
646
- var ksuid = /^[A-Za-z0-9]{27}$/;
647
- var nanoid = /^[a-zA-Z0-9_-]{21}$/;
648
- /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
649
- var duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
650
- /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
651
- var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
652
- /** Returns a regex for validating an RFC 9562/4122 UUID.
653
- *
654
- * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
655
- var uuid = (version) => {
656
- if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
657
- return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
418
+ //#region ../../node_modules/zod/v4/core/core.js
419
+ var _a$1;
420
+ function $constructor(name, initializer, params) {
421
+ function init(inst, def) {
422
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
423
+ value: {
424
+ def,
425
+ constr: _,
426
+ traits: /* @__PURE__ */ new Set()
427
+ },
428
+ enumerable: false
429
+ });
430
+ if (inst._zod.traits.has(name)) return;
431
+ inst._zod.traits.add(name);
432
+ initializer(inst, def);
433
+ const proto = _.prototype;
434
+ const keys = Object.keys(proto);
435
+ for (let i = 0; i < keys.length; i++) {
436
+ const k = keys[i];
437
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
438
+ }
439
+ }
440
+ const Parent = params?.Parent ?? Object;
441
+ class Definition extends Parent {}
442
+ Object.defineProperty(Definition, "name", { value: name });
443
+ function _(def) {
444
+ var _a;
445
+ const inst = params?.Parent ? new Definition() : this;
446
+ init(inst, def);
447
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
448
+ for (const fn of inst._zod.deferred) fn();
449
+ return inst;
450
+ }
451
+ Object.defineProperty(_, "init", { value: init });
452
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
453
+ if (params?.Parent && inst instanceof params.Parent) return true;
454
+ return inst?._zod?.traits?.has(name);
455
+ } });
456
+ Object.defineProperty(_, "name", { value: name });
457
+ return _;
458
+ }
459
+ var $ZodAsyncError = class extends Error {
460
+ constructor() {
461
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
462
+ }
658
463
  };
659
- /** Practical email validation */
660
- var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
661
- var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
662
- function emoji() {
663
- return new RegExp(_emoji$1, "u");
464
+ var $ZodEncodeError = class extends Error {
465
+ constructor(name) {
466
+ super(`Encountered unidirectional transform during encode: ${name}`);
467
+ this.name = "ZodEncodeError";
468
+ }
469
+ };
470
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
471
+ var globalConfig = globalThis.__zod_globalConfig;
472
+ function config(newConfig) {
473
+ if (newConfig) Object.assign(globalConfig, newConfig);
474
+ return globalConfig;
664
475
  }
665
- var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
666
- var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
667
- var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
668
- var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
669
- var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
670
- var base64url = /^[A-Za-z0-9_-]*$/;
671
- var httpProtocol = /^https?$/;
672
- var e164 = /^\+[1-9]\d{6,14}$/;
673
- var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
674
- var date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
675
- function timeSource(args) {
676
- const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
677
- return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
476
+ //#endregion
477
+ //#region ../../node_modules/zod/v4/core/util.js
478
+ function getEnumValues(entries) {
479
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
480
+ return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
678
481
  }
679
- function time$1(args) {
680
- return new RegExp(`^${timeSource(args)}$`);
482
+ function jsonStringifyReplacer(_, value) {
483
+ if (typeof value === "bigint") return value.toString();
484
+ return value;
681
485
  }
682
- function datetime$1(args) {
683
- const time = timeSource({ precision: args.precision });
684
- const opts = ["Z"];
685
- if (args.local) opts.push("");
686
- if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
687
- const timeRegex = `${time}(?:${opts.join("|")})`;
688
- return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
486
+ function cached(getter) {
487
+ return { get value() {
488
+ {
489
+ const value = getter();
490
+ Object.defineProperty(this, "value", { value });
491
+ return value;
492
+ }
493
+ throw new Error("cached value already set");
494
+ } };
689
495
  }
690
- var string$1 = (params) => {
691
- const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
692
- return new RegExp(`^${regex}$`);
693
- };
694
- var integer = /^-?\d+$/;
695
- var number$1 = /^-?\d+(?:\.\d+)?$/;
696
- var boolean$1 = /^(?:true|false)$/i;
697
- var lowercase = /^[^A-Z]*$/;
698
- var uppercase = /^[^a-z]*$/;
699
- //#endregion
700
- //#region ../../node_modules/zod/v4/core/checks.js
701
- var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
702
- var _a;
703
- inst._zod ?? (inst._zod = {});
704
- inst._zod.def = def;
705
- (_a = inst._zod).onattach ?? (_a.onattach = []);
706
- });
707
- var numericOriginMap = {
708
- number: "number",
709
- bigint: "bigint",
710
- object: "date"
711
- };
712
- var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
713
- $ZodCheck.init(inst, def);
714
- const origin = numericOriginMap[typeof def.value];
715
- inst._zod.onattach.push((inst) => {
716
- const bag = inst._zod.bag;
717
- const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
718
- if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
719
- else bag.exclusiveMaximum = def.value;
496
+ function nullish(input) {
497
+ return input === null || input === void 0;
498
+ }
499
+ function cleanRegex(source) {
500
+ const start = source.startsWith("^") ? 1 : 0;
501
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
502
+ return source.slice(start, end);
503
+ }
504
+ function floatSafeRemainder(val, step) {
505
+ const ratio = val / step;
506
+ const roundedRatio = Math.round(ratio);
507
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
508
+ if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
509
+ return ratio - roundedRatio;
510
+ }
511
+ var EVALUATING = /* @__PURE__ */ Symbol("evaluating");
512
+ function defineLazy(object, key, getter) {
513
+ let value = void 0;
514
+ Object.defineProperty(object, key, {
515
+ get() {
516
+ if (value === EVALUATING) return;
517
+ if (value === void 0) {
518
+ value = EVALUATING;
519
+ value = getter();
520
+ }
521
+ return value;
522
+ },
523
+ set(v) {
524
+ Object.defineProperty(object, key, { value: v });
525
+ },
526
+ configurable: true
720
527
  });
721
- inst._zod.check = (payload) => {
722
- if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
723
- payload.issues.push({
724
- origin,
725
- code: "too_big",
726
- maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
727
- input: payload.value,
728
- inclusive: def.inclusive,
729
- inst,
730
- continue: !def.abort
731
- });
732
- };
733
- });
734
- var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
735
- $ZodCheck.init(inst, def);
736
- const origin = numericOriginMap[typeof def.value];
737
- inst._zod.onattach.push((inst) => {
738
- const bag = inst._zod.bag;
739
- const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
740
- if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
741
- else bag.exclusiveMinimum = def.value;
528
+ }
529
+ function assignProp(target, prop, value) {
530
+ Object.defineProperty(target, prop, {
531
+ value,
532
+ writable: true,
533
+ enumerable: true,
534
+ configurable: true
742
535
  });
743
- inst._zod.check = (payload) => {
744
- if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
745
- payload.issues.push({
746
- origin,
747
- code: "too_small",
748
- minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
749
- input: payload.value,
750
- inclusive: def.inclusive,
751
- inst,
752
- continue: !def.abort
753
- });
754
- };
536
+ }
537
+ function mergeDefs(...defs) {
538
+ const mergedDescriptors = {};
539
+ for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
540
+ return Object.defineProperties({}, mergedDescriptors);
541
+ }
542
+ function esc(str) {
543
+ return JSON.stringify(str);
544
+ }
545
+ function slugify(input) {
546
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
547
+ }
548
+ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
549
+ function isObject$1(data) {
550
+ return typeof data === "object" && data !== null && !Array.isArray(data);
551
+ }
552
+ var allowsEval = /* @__PURE__ */ cached(() => {
553
+ if (globalConfig.jitless) return false;
554
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
555
+ try {
556
+ new Function("");
557
+ return true;
558
+ } catch (_) {
559
+ return false;
560
+ }
755
561
  });
756
- var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
757
- $ZodCheck.init(inst, def);
758
- inst._zod.onattach.push((inst) => {
759
- var _a;
760
- (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
761
- });
762
- inst._zod.check = (payload) => {
763
- if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
764
- if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
765
- payload.issues.push({
766
- origin: typeof payload.value,
767
- code: "not_multiple_of",
768
- divisor: def.value,
769
- input: payload.value,
770
- inst,
771
- continue: !def.abort
772
- });
562
+ function isPlainObject(o) {
563
+ if (isObject$1(o) === false) return false;
564
+ const ctor = o.constructor;
565
+ if (ctor === void 0) return true;
566
+ if (typeof ctor !== "function") return true;
567
+ const prot = ctor.prototype;
568
+ if (isObject$1(prot) === false) return false;
569
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
570
+ return true;
571
+ }
572
+ function shallowClone(o) {
573
+ if (isPlainObject(o)) return { ...o };
574
+ if (Array.isArray(o)) return [...o];
575
+ if (o instanceof Map) return new Map(o);
576
+ if (o instanceof Set) return new Set(o);
577
+ return o;
578
+ }
579
+ var propertyKeyTypes = /* @__PURE__ */ new Set([
580
+ "string",
581
+ "number",
582
+ "symbol"
583
+ ]);
584
+ function escapeRegex(str) {
585
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
586
+ }
587
+ function clone(inst, def, params) {
588
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
589
+ if (!def || params?.parent) cl._zod.parent = inst;
590
+ return cl;
591
+ }
592
+ function normalizeParams(_params) {
593
+ const params = _params;
594
+ if (!params) return {};
595
+ if (typeof params === "string") return { error: () => params };
596
+ if (params?.message !== void 0) {
597
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
598
+ params.error = params.message;
599
+ }
600
+ delete params.message;
601
+ if (typeof params.error === "string") return {
602
+ ...params,
603
+ error: () => params.error
773
604
  };
774
- });
775
- var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
776
- $ZodCheck.init(inst, def);
777
- def.format = def.format || "float64";
778
- const isInt = def.format?.includes("int");
779
- const origin = isInt ? "int" : "number";
780
- const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
781
- inst._zod.onattach.push((inst) => {
782
- const bag = inst._zod.bag;
783
- bag.format = def.format;
784
- bag.minimum = minimum;
785
- bag.maximum = maximum;
786
- if (isInt) bag.pattern = integer;
605
+ return params;
606
+ }
607
+ function optionalKeys(shape) {
608
+ return Object.keys(shape).filter((k) => {
609
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
787
610
  });
788
- inst._zod.check = (payload) => {
789
- const input = payload.value;
790
- if (isInt) {
791
- if (!Number.isInteger(input)) {
792
- payload.issues.push({
793
- expected: origin,
794
- format: def.format,
795
- code: "invalid_type",
796
- continue: false,
797
- input,
798
- inst
799
- });
800
- return;
611
+ }
612
+ var NUMBER_FORMAT_RANGES = {
613
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
614
+ int32: [-2147483648, 2147483647],
615
+ uint32: [0, 4294967295],
616
+ float32: [-34028234663852886e22, 34028234663852886e22],
617
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
618
+ };
619
+ function pick(schema, mask) {
620
+ const currDef = schema._zod.def;
621
+ const checks = currDef.checks;
622
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
623
+ return clone(schema, mergeDefs(schema._zod.def, {
624
+ get shape() {
625
+ const newShape = {};
626
+ for (const key in mask) {
627
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
628
+ if (!mask[key]) continue;
629
+ newShape[key] = currDef.shape[key];
801
630
  }
802
- if (!Number.isSafeInteger(input)) {
803
- if (input > 0) payload.issues.push({
804
- input,
805
- code: "too_big",
806
- maximum: Number.MAX_SAFE_INTEGER,
807
- note: "Integers must be within the safe integer range.",
808
- inst,
809
- origin,
810
- inclusive: true,
811
- continue: !def.abort
812
- });
813
- else payload.issues.push({
814
- input,
815
- code: "too_small",
816
- minimum: Number.MIN_SAFE_INTEGER,
817
- note: "Integers must be within the safe integer range.",
818
- inst,
819
- origin,
820
- inclusive: true,
821
- continue: !def.abort
822
- });
823
- return;
631
+ assignProp(this, "shape", newShape);
632
+ return newShape;
633
+ },
634
+ checks: []
635
+ }));
636
+ }
637
+ function omit(schema, mask) {
638
+ const currDef = schema._zod.def;
639
+ const checks = currDef.checks;
640
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
641
+ return clone(schema, mergeDefs(schema._zod.def, {
642
+ get shape() {
643
+ const newShape = { ...schema._zod.def.shape };
644
+ for (const key in mask) {
645
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
646
+ if (!mask[key]) continue;
647
+ delete newShape[key];
648
+ }
649
+ assignProp(this, "shape", newShape);
650
+ return newShape;
651
+ },
652
+ checks: []
653
+ }));
654
+ }
655
+ function extend$1(schema, shape) {
656
+ if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
657
+ const checks = schema._zod.def.checks;
658
+ if (checks && checks.length > 0) {
659
+ const existingShape = schema._zod.def.shape;
660
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
661
+ }
662
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
663
+ const _shape = {
664
+ ...schema._zod.def.shape,
665
+ ...shape
666
+ };
667
+ assignProp(this, "shape", _shape);
668
+ return _shape;
669
+ } }));
670
+ }
671
+ function safeExtend(schema, shape) {
672
+ if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
673
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
674
+ const _shape = {
675
+ ...schema._zod.def.shape,
676
+ ...shape
677
+ };
678
+ assignProp(this, "shape", _shape);
679
+ return _shape;
680
+ } }));
681
+ }
682
+ function merge$1(a, b) {
683
+ if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
684
+ return clone(a, mergeDefs(a._zod.def, {
685
+ get shape() {
686
+ const _shape = {
687
+ ...a._zod.def.shape,
688
+ ...b._zod.def.shape
689
+ };
690
+ assignProp(this, "shape", _shape);
691
+ return _shape;
692
+ },
693
+ get catchall() {
694
+ return b._zod.def.catchall;
695
+ },
696
+ checks: b._zod.def.checks ?? []
697
+ }));
698
+ }
699
+ function partial(Class, schema, mask) {
700
+ const checks = schema._zod.def.checks;
701
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
702
+ return clone(schema, mergeDefs(schema._zod.def, {
703
+ get shape() {
704
+ const oldShape = schema._zod.def.shape;
705
+ const shape = { ...oldShape };
706
+ if (mask) for (const key in mask) {
707
+ if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
708
+ if (!mask[key]) continue;
709
+ shape[key] = Class ? new Class({
710
+ type: "optional",
711
+ innerType: oldShape[key]
712
+ }) : oldShape[key];
824
713
  }
714
+ else for (const key in oldShape) shape[key] = Class ? new Class({
715
+ type: "optional",
716
+ innerType: oldShape[key]
717
+ }) : oldShape[key];
718
+ assignProp(this, "shape", shape);
719
+ return shape;
720
+ },
721
+ checks: []
722
+ }));
723
+ }
724
+ function required(Class, schema, mask) {
725
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
726
+ const oldShape = schema._zod.def.shape;
727
+ const shape = { ...oldShape };
728
+ if (mask) for (const key in mask) {
729
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
730
+ if (!mask[key]) continue;
731
+ shape[key] = new Class({
732
+ type: "nonoptional",
733
+ innerType: oldShape[key]
734
+ });
825
735
  }
826
- if (input < minimum) payload.issues.push({
827
- origin: "number",
828
- input,
829
- code: "too_small",
830
- minimum,
831
- inclusive: true,
832
- inst,
833
- continue: !def.abort
834
- });
835
- if (input > maximum) payload.issues.push({
836
- origin: "number",
837
- input,
838
- code: "too_big",
839
- maximum,
840
- inclusive: true,
841
- inst,
842
- continue: !def.abort
736
+ else for (const key in oldShape) shape[key] = new Class({
737
+ type: "nonoptional",
738
+ innerType: oldShape[key]
843
739
  });
844
- };
845
- });
846
- var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
847
- var _a;
848
- $ZodCheck.init(inst, def);
849
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
850
- const val = payload.value;
851
- return !nullish(val) && val.length !== void 0;
852
- });
853
- inst._zod.onattach.push((inst) => {
854
- const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
855
- if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
740
+ assignProp(this, "shape", shape);
741
+ return shape;
742
+ } }));
743
+ }
744
+ function aborted(x, startIndex = 0) {
745
+ if (x.aborted === true) return true;
746
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
747
+ return false;
748
+ }
749
+ function explicitlyAborted(x, startIndex = 0) {
750
+ if (x.aborted === true) return true;
751
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
752
+ return false;
753
+ }
754
+ function prefixIssues(path, issues) {
755
+ return issues.map((iss) => {
756
+ var _a;
757
+ (_a = iss).path ?? (_a.path = []);
758
+ iss.path.unshift(path);
759
+ return iss;
856
760
  });
857
- inst._zod.check = (payload) => {
858
- const input = payload.value;
859
- if (input.length <= def.maximum) return;
860
- const origin = getLengthableOrigin(input);
861
- payload.issues.push({
862
- origin,
863
- code: "too_big",
864
- maximum: def.maximum,
865
- inclusive: true,
866
- input,
867
- inst,
868
- continue: !def.abort
869
- });
761
+ }
762
+ function unwrapMessage(message) {
763
+ return typeof message === "string" ? message : message?.message;
764
+ }
765
+ function finalizeIssue(iss, ctx, config) {
766
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
767
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
768
+ rest.path ?? (rest.path = []);
769
+ rest.message = message;
770
+ if (ctx?.reportInput) rest.input = _input;
771
+ return rest;
772
+ }
773
+ function getLengthableOrigin(input) {
774
+ if (Array.isArray(input)) return "array";
775
+ if (typeof input === "string") return "string";
776
+ return "unknown";
777
+ }
778
+ function issue(...args) {
779
+ const [iss, input, inst] = args;
780
+ if (typeof iss === "string") return {
781
+ message: iss,
782
+ code: "custom",
783
+ input,
784
+ inst
870
785
  };
871
- });
872
- var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
873
- var _a;
874
- $ZodCheck.init(inst, def);
875
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
876
- const val = payload.value;
877
- return !nullish(val) && val.length !== void 0;
786
+ return { ...iss };
787
+ }
788
+ //#endregion
789
+ //#region ../../node_modules/zod/v4/core/errors.js
790
+ var initializer$1 = (inst, def) => {
791
+ inst.name = "$ZodError";
792
+ Object.defineProperty(inst, "_zod", {
793
+ value: inst._zod,
794
+ enumerable: false
878
795
  });
879
- inst._zod.onattach.push((inst) => {
880
- const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
881
- if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
796
+ Object.defineProperty(inst, "issues", {
797
+ value: def,
798
+ enumerable: false
882
799
  });
883
- inst._zod.check = (payload) => {
884
- const input = payload.value;
885
- if (input.length >= def.minimum) return;
886
- const origin = getLengthableOrigin(input);
887
- payload.issues.push({
888
- origin,
889
- code: "too_small",
890
- minimum: def.minimum,
891
- inclusive: true,
892
- input,
893
- inst,
894
- continue: !def.abort
895
- });
896
- };
897
- });
898
- var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
899
- var _a;
900
- $ZodCheck.init(inst, def);
901
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
902
- const val = payload.value;
903
- return !nullish(val) && val.length !== void 0;
800
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
801
+ Object.defineProperty(inst, "toString", {
802
+ value: () => inst.message,
803
+ enumerable: false
804
+ });
805
+ };
806
+ var $ZodError = $constructor("$ZodError", initializer$1);
807
+ var $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
808
+ function flattenError(error, mapper = (issue) => issue.message) {
809
+ const fieldErrors = {};
810
+ const formErrors = [];
811
+ for (const sub of error.issues) if (sub.path.length > 0) {
812
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
813
+ fieldErrors[sub.path[0]].push(mapper(sub));
814
+ } else formErrors.push(mapper(sub));
815
+ return {
816
+ formErrors,
817
+ fieldErrors
818
+ };
819
+ }
820
+ function formatError$1(error, mapper = (issue) => issue.message) {
821
+ const fieldErrors = { _errors: [] };
822
+ const processError = (error, path = []) => {
823
+ for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
824
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
825
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
826
+ else {
827
+ const fullpath = [...path, ...issue.path];
828
+ if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
829
+ else {
830
+ let curr = fieldErrors;
831
+ let i = 0;
832
+ while (i < fullpath.length) {
833
+ const el = fullpath[i];
834
+ if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
835
+ else {
836
+ curr[el] = curr[el] || { _errors: [] };
837
+ curr[el]._errors.push(mapper(issue));
838
+ }
839
+ curr = curr[el];
840
+ i++;
841
+ }
842
+ }
843
+ }
844
+ };
845
+ processError(error);
846
+ return fieldErrors;
847
+ }
848
+ /** Format a ZodError as a human-readable string in the following form.
849
+ *
850
+ * From
851
+ *
852
+ * ```ts
853
+ * ZodError {
854
+ * issues: [
855
+ * {
856
+ * expected: 'string',
857
+ * code: 'invalid_type',
858
+ * path: [ 'username' ],
859
+ * message: 'Invalid input: expected string'
860
+ * },
861
+ * {
862
+ * expected: 'number',
863
+ * code: 'invalid_type',
864
+ * path: [ 'favoriteNumbers', 1 ],
865
+ * message: 'Invalid input: expected number'
866
+ * }
867
+ * ];
868
+ * }
869
+ * ```
870
+ *
871
+ * to
872
+ *
873
+ * ```
874
+ * username
875
+ * ✖ Expected number, received string at "username
876
+ * favoriteNumbers[0]
877
+ * ✖ Invalid input: expected number
878
+ * ```
879
+ */
880
+ function toDotPath(_path) {
881
+ const segs = [];
882
+ const path = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
883
+ for (const seg of path) if (typeof seg === "number") segs.push(`[${seg}]`);
884
+ else if (typeof seg === "symbol") segs.push(`[${JSON.stringify(String(seg))}]`);
885
+ else if (/[^\w$]/.test(seg)) segs.push(`[${JSON.stringify(seg)}]`);
886
+ else {
887
+ if (segs.length) segs.push(".");
888
+ segs.push(seg);
889
+ }
890
+ return segs.join("");
891
+ }
892
+ function prettifyError(error) {
893
+ const lines = [];
894
+ const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);
895
+ for (const issue of issues) {
896
+ lines.push(`✖ ${issue.message}`);
897
+ if (issue.path?.length) lines.push(` → at ${toDotPath(issue.path)}`);
898
+ }
899
+ return lines.join("\n");
900
+ }
901
+ //#endregion
902
+ //#region ../../node_modules/zod/v4/core/parse.js
903
+ var _parse = (_Err) => (schema, value, _ctx, _params) => {
904
+ const ctx = _ctx ? {
905
+ ..._ctx,
906
+ async: false
907
+ } : { async: false };
908
+ const result = schema._zod.run({
909
+ value,
910
+ issues: []
911
+ }, ctx);
912
+ if (result instanceof Promise) throw new $ZodAsyncError();
913
+ if (result.issues.length) {
914
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
915
+ captureStackTrace(e, _params?.callee);
916
+ throw e;
917
+ }
918
+ return result.value;
919
+ };
920
+ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
921
+ const ctx = _ctx ? {
922
+ ..._ctx,
923
+ async: true
924
+ } : { async: true };
925
+ let result = schema._zod.run({
926
+ value,
927
+ issues: []
928
+ }, ctx);
929
+ if (result instanceof Promise) result = await result;
930
+ if (result.issues.length) {
931
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
932
+ captureStackTrace(e, params?.callee);
933
+ throw e;
934
+ }
935
+ return result.value;
936
+ };
937
+ var _safeParse = (_Err) => (schema, value, _ctx) => {
938
+ const ctx = _ctx ? {
939
+ ..._ctx,
940
+ async: false
941
+ } : { async: false };
942
+ const result = schema._zod.run({
943
+ value,
944
+ issues: []
945
+ }, ctx);
946
+ if (result instanceof Promise) throw new $ZodAsyncError();
947
+ return result.issues.length ? {
948
+ success: false,
949
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
950
+ } : {
951
+ success: true,
952
+ data: result.value
953
+ };
954
+ };
955
+ var safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
956
+ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
957
+ const ctx = _ctx ? {
958
+ ..._ctx,
959
+ async: true
960
+ } : { async: true };
961
+ let result = schema._zod.run({
962
+ value,
963
+ issues: []
964
+ }, ctx);
965
+ if (result instanceof Promise) result = await result;
966
+ return result.issues.length ? {
967
+ success: false,
968
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
969
+ } : {
970
+ success: true,
971
+ data: result.value
972
+ };
973
+ };
974
+ var safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
975
+ var _encode = (_Err) => (schema, value, _ctx) => {
976
+ const ctx = _ctx ? {
977
+ ..._ctx,
978
+ direction: "backward"
979
+ } : { direction: "backward" };
980
+ return _parse(_Err)(schema, value, ctx);
981
+ };
982
+ var _decode = (_Err) => (schema, value, _ctx) => {
983
+ return _parse(_Err)(schema, value, _ctx);
984
+ };
985
+ var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
986
+ const ctx = _ctx ? {
987
+ ..._ctx,
988
+ direction: "backward"
989
+ } : { direction: "backward" };
990
+ return _parseAsync(_Err)(schema, value, ctx);
991
+ };
992
+ var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
993
+ return _parseAsync(_Err)(schema, value, _ctx);
994
+ };
995
+ var _safeEncode = (_Err) => (schema, value, _ctx) => {
996
+ const ctx = _ctx ? {
997
+ ..._ctx,
998
+ direction: "backward"
999
+ } : { direction: "backward" };
1000
+ return _safeParse(_Err)(schema, value, ctx);
1001
+ };
1002
+ var _safeDecode = (_Err) => (schema, value, _ctx) => {
1003
+ return _safeParse(_Err)(schema, value, _ctx);
1004
+ };
1005
+ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
1006
+ const ctx = _ctx ? {
1007
+ ..._ctx,
1008
+ direction: "backward"
1009
+ } : { direction: "backward" };
1010
+ return _safeParseAsync(_Err)(schema, value, ctx);
1011
+ };
1012
+ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
1013
+ return _safeParseAsync(_Err)(schema, value, _ctx);
1014
+ };
1015
+ //#endregion
1016
+ //#region ../../node_modules/zod/v4/core/regexes.js
1017
+ /**
1018
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1019
+ * (timestamps embedded in the id). Use {@link cuid2} instead.
1020
+ * See https://github.com/paralleldrive/cuid.
1021
+ */
1022
+ var cuid = /^[cC][0-9a-z]{6,}$/;
1023
+ var cuid2 = /^[0-9a-z]+$/;
1024
+ var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
1025
+ var xid = /^[0-9a-vA-V]{20}$/;
1026
+ var ksuid = /^[A-Za-z0-9]{27}$/;
1027
+ var nanoid = /^[a-zA-Z0-9_-]{21}$/;
1028
+ /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
1029
+ var duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
1030
+ /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
1031
+ var guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
1032
+ /** Returns a regex for validating an RFC 9562/4122 UUID.
1033
+ *
1034
+ * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
1035
+ var uuid = (version) => {
1036
+ if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
1037
+ return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
1038
+ };
1039
+ /** Practical email validation */
1040
+ var email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
1041
+ var _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
1042
+ function emoji() {
1043
+ return new RegExp(_emoji$1, "u");
1044
+ }
1045
+ var ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
1046
+ var ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
1047
+ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
1048
+ var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
1049
+ var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
1050
+ var base64url = /^[A-Za-z0-9_-]*$/;
1051
+ var httpProtocol = /^https?$/;
1052
+ var e164 = /^\+[1-9]\d{6,14}$/;
1053
+ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
1054
+ var date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
1055
+ function timeSource(args) {
1056
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
1057
+ return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
1058
+ }
1059
+ function time$1(args) {
1060
+ return new RegExp(`^${timeSource(args)}$`);
1061
+ }
1062
+ function datetime$1(args) {
1063
+ const time = timeSource({ precision: args.precision });
1064
+ const opts = ["Z"];
1065
+ if (args.local) opts.push("");
1066
+ if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
1067
+ const timeRegex = `${time}(?:${opts.join("|")})`;
1068
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
1069
+ }
1070
+ var string$1 = (params) => {
1071
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
1072
+ return new RegExp(`^${regex}$`);
1073
+ };
1074
+ var integer = /^-?\d+$/;
1075
+ var number$1 = /^-?\d+(?:\.\d+)?$/;
1076
+ var boolean$1 = /^(?:true|false)$/i;
1077
+ var lowercase = /^[^A-Z]*$/;
1078
+ var uppercase = /^[^a-z]*$/;
1079
+ //#endregion
1080
+ //#region ../../node_modules/zod/v4/core/checks.js
1081
+ var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
1082
+ var _a;
1083
+ inst._zod ?? (inst._zod = {});
1084
+ inst._zod.def = def;
1085
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
1086
+ });
1087
+ var numericOriginMap = {
1088
+ number: "number",
1089
+ bigint: "bigint",
1090
+ object: "date"
1091
+ };
1092
+ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
1093
+ $ZodCheck.init(inst, def);
1094
+ const origin = numericOriginMap[typeof def.value];
1095
+ inst._zod.onattach.push((inst) => {
1096
+ const bag = inst._zod.bag;
1097
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
1098
+ if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
1099
+ else bag.exclusiveMaximum = def.value;
1100
+ });
1101
+ inst._zod.check = (payload) => {
1102
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
1103
+ payload.issues.push({
1104
+ origin,
1105
+ code: "too_big",
1106
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
1107
+ input: payload.value,
1108
+ inclusive: def.inclusive,
1109
+ inst,
1110
+ continue: !def.abort
1111
+ });
1112
+ };
1113
+ });
1114
+ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
1115
+ $ZodCheck.init(inst, def);
1116
+ const origin = numericOriginMap[typeof def.value];
1117
+ inst._zod.onattach.push((inst) => {
1118
+ const bag = inst._zod.bag;
1119
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
1120
+ if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
1121
+ else bag.exclusiveMinimum = def.value;
1122
+ });
1123
+ inst._zod.check = (payload) => {
1124
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
1125
+ payload.issues.push({
1126
+ origin,
1127
+ code: "too_small",
1128
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
1129
+ input: payload.value,
1130
+ inclusive: def.inclusive,
1131
+ inst,
1132
+ continue: !def.abort
1133
+ });
1134
+ };
1135
+ });
1136
+ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
1137
+ $ZodCheck.init(inst, def);
1138
+ inst._zod.onattach.push((inst) => {
1139
+ var _a;
1140
+ (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
1141
+ });
1142
+ inst._zod.check = (payload) => {
1143
+ if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
1144
+ if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
1145
+ payload.issues.push({
1146
+ origin: typeof payload.value,
1147
+ code: "not_multiple_of",
1148
+ divisor: def.value,
1149
+ input: payload.value,
1150
+ inst,
1151
+ continue: !def.abort
1152
+ });
1153
+ };
1154
+ });
1155
+ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
1156
+ $ZodCheck.init(inst, def);
1157
+ def.format = def.format || "float64";
1158
+ const isInt = def.format?.includes("int");
1159
+ const origin = isInt ? "int" : "number";
1160
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
1161
+ inst._zod.onattach.push((inst) => {
1162
+ const bag = inst._zod.bag;
1163
+ bag.format = def.format;
1164
+ bag.minimum = minimum;
1165
+ bag.maximum = maximum;
1166
+ if (isInt) bag.pattern = integer;
1167
+ });
1168
+ inst._zod.check = (payload) => {
1169
+ const input = payload.value;
1170
+ if (isInt) {
1171
+ if (!Number.isInteger(input)) {
1172
+ payload.issues.push({
1173
+ expected: origin,
1174
+ format: def.format,
1175
+ code: "invalid_type",
1176
+ continue: false,
1177
+ input,
1178
+ inst
1179
+ });
1180
+ return;
1181
+ }
1182
+ if (!Number.isSafeInteger(input)) {
1183
+ if (input > 0) payload.issues.push({
1184
+ input,
1185
+ code: "too_big",
1186
+ maximum: Number.MAX_SAFE_INTEGER,
1187
+ note: "Integers must be within the safe integer range.",
1188
+ inst,
1189
+ origin,
1190
+ inclusive: true,
1191
+ continue: !def.abort
1192
+ });
1193
+ else payload.issues.push({
1194
+ input,
1195
+ code: "too_small",
1196
+ minimum: Number.MIN_SAFE_INTEGER,
1197
+ note: "Integers must be within the safe integer range.",
1198
+ inst,
1199
+ origin,
1200
+ inclusive: true,
1201
+ continue: !def.abort
1202
+ });
1203
+ return;
1204
+ }
1205
+ }
1206
+ if (input < minimum) payload.issues.push({
1207
+ origin: "number",
1208
+ input,
1209
+ code: "too_small",
1210
+ minimum,
1211
+ inclusive: true,
1212
+ inst,
1213
+ continue: !def.abort
1214
+ });
1215
+ if (input > maximum) payload.issues.push({
1216
+ origin: "number",
1217
+ input,
1218
+ code: "too_big",
1219
+ maximum,
1220
+ inclusive: true,
1221
+ inst,
1222
+ continue: !def.abort
1223
+ });
1224
+ };
1225
+ });
1226
+ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1227
+ var _a;
1228
+ $ZodCheck.init(inst, def);
1229
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1230
+ const val = payload.value;
1231
+ return !nullish(val) && val.length !== void 0;
1232
+ });
1233
+ inst._zod.onattach.push((inst) => {
1234
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1235
+ if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
1236
+ });
1237
+ inst._zod.check = (payload) => {
1238
+ const input = payload.value;
1239
+ if (input.length <= def.maximum) return;
1240
+ const origin = getLengthableOrigin(input);
1241
+ payload.issues.push({
1242
+ origin,
1243
+ code: "too_big",
1244
+ maximum: def.maximum,
1245
+ inclusive: true,
1246
+ input,
1247
+ inst,
1248
+ continue: !def.abort
1249
+ });
1250
+ };
1251
+ });
1252
+ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1253
+ var _a;
1254
+ $ZodCheck.init(inst, def);
1255
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1256
+ const val = payload.value;
1257
+ return !nullish(val) && val.length !== void 0;
1258
+ });
1259
+ inst._zod.onattach.push((inst) => {
1260
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1261
+ if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
1262
+ });
1263
+ inst._zod.check = (payload) => {
1264
+ const input = payload.value;
1265
+ if (input.length >= def.minimum) return;
1266
+ const origin = getLengthableOrigin(input);
1267
+ payload.issues.push({
1268
+ origin,
1269
+ code: "too_small",
1270
+ minimum: def.minimum,
1271
+ inclusive: true,
1272
+ input,
1273
+ inst,
1274
+ continue: !def.abort
1275
+ });
1276
+ };
1277
+ });
1278
+ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1279
+ var _a;
1280
+ $ZodCheck.init(inst, def);
1281
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1282
+ const val = payload.value;
1283
+ return !nullish(val) && val.length !== void 0;
904
1284
  });
905
1285
  inst._zod.onattach.push((inst) => {
906
1286
  const bag = inst._zod.bag;
@@ -4183,646 +4563,266 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4183
4563
  partial(...args) {
4184
4564
  return partial(ZodOptional, this, args[0]);
4185
4565
  },
4186
- required(...args) {
4187
- return required(ZodNonOptional, this, args[0]);
4188
- }
4189
- });
4190
- });
4191
- function object(shape, params) {
4192
- return new ZodObject({
4193
- type: "object",
4194
- shape: shape ?? {},
4195
- ...normalizeParams(params)
4196
- });
4197
- }
4198
- var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4199
- $ZodUnion.init(inst, def);
4200
- ZodType.init(inst, def);
4201
- inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
4202
- inst.options = def.options;
4203
- });
4204
- function union(options, params) {
4205
- return new ZodUnion({
4206
- type: "union",
4207
- options,
4208
- ...normalizeParams(params)
4209
- });
4210
- }
4211
- var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
4212
- $ZodIntersection.init(inst, def);
4213
- ZodType.init(inst, def);
4214
- inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
4215
- });
4216
- function intersection(left, right) {
4217
- return new ZodIntersection({
4218
- type: "intersection",
4219
- left,
4220
- right
4221
- });
4222
- }
4223
- var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4224
- $ZodRecord.init(inst, def);
4225
- ZodType.init(inst, def);
4226
- inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
4227
- inst.keyType = def.keyType;
4228
- inst.valueType = def.valueType;
4229
- });
4230
- function record(keyType, valueType, params) {
4231
- if (!valueType || !valueType._zod) return new ZodRecord({
4232
- type: "record",
4233
- keyType: string(),
4234
- valueType: keyType,
4235
- ...normalizeParams(valueType)
4236
- });
4237
- return new ZodRecord({
4238
- type: "record",
4239
- keyType,
4240
- valueType,
4241
- ...normalizeParams(params)
4242
- });
4243
- }
4244
- var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
4245
- $ZodEnum.init(inst, def);
4246
- ZodType.init(inst, def);
4247
- inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
4248
- inst.enum = def.entries;
4249
- inst.options = Object.values(def.entries);
4250
- const keys = new Set(Object.keys(def.entries));
4251
- inst.extract = (values, params) => {
4252
- const newEntries = {};
4253
- for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
4254
- else throw new Error(`Key ${value} not found in enum`);
4255
- return new ZodEnum({
4256
- ...def,
4257
- checks: [],
4258
- ...normalizeParams(params),
4259
- entries: newEntries
4260
- });
4261
- };
4262
- inst.exclude = (values, params) => {
4263
- const newEntries = { ...def.entries };
4264
- for (const value of values) if (keys.has(value)) delete newEntries[value];
4265
- else throw new Error(`Key ${value} not found in enum`);
4266
- return new ZodEnum({
4267
- ...def,
4268
- checks: [],
4269
- ...normalizeParams(params),
4270
- entries: newEntries
4271
- });
4272
- };
4273
- });
4274
- function _enum(values, params) {
4275
- return new ZodEnum({
4276
- type: "enum",
4277
- entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
4278
- ...normalizeParams(params)
4279
- });
4280
- }
4281
- var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
4282
- $ZodTransform.init(inst, def);
4283
- ZodType.init(inst, def);
4284
- inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
4285
- inst._zod.parse = (payload, _ctx) => {
4286
- if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
4287
- payload.addIssue = (issue$1) => {
4288
- if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
4289
- else {
4290
- const _issue = issue$1;
4291
- if (_issue.fatal) _issue.continue = false;
4292
- _issue.code ?? (_issue.code = "custom");
4293
- _issue.input ?? (_issue.input = payload.value);
4294
- _issue.inst ?? (_issue.inst = inst);
4295
- payload.issues.push(issue(_issue));
4296
- }
4297
- };
4298
- const output = def.transform(payload.value, payload);
4299
- if (output instanceof Promise) return output.then((output) => {
4300
- payload.value = output;
4301
- payload.fallback = true;
4302
- return payload;
4303
- });
4304
- payload.value = output;
4305
- payload.fallback = true;
4306
- return payload;
4307
- };
4308
- });
4309
- function transform(fn) {
4310
- return new ZodTransform({
4311
- type: "transform",
4312
- transform: fn
4313
- });
4314
- }
4315
- var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
4316
- $ZodOptional.init(inst, def);
4317
- ZodType.init(inst, def);
4318
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4319
- inst.unwrap = () => inst._zod.def.innerType;
4320
- });
4321
- function optional(innerType) {
4322
- return new ZodOptional({
4323
- type: "optional",
4324
- innerType
4325
- });
4326
- }
4327
- var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
4328
- $ZodExactOptional.init(inst, def);
4329
- ZodType.init(inst, def);
4330
- inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4331
- inst.unwrap = () => inst._zod.def.innerType;
4332
- });
4333
- function exactOptional(innerType) {
4334
- return new ZodExactOptional({
4335
- type: "optional",
4336
- innerType
4337
- });
4338
- }
4339
- var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
4340
- $ZodNullable.init(inst, def);
4341
- ZodType.init(inst, def);
4342
- inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
4343
- inst.unwrap = () => inst._zod.def.innerType;
4344
- });
4345
- function nullable(innerType) {
4346
- return new ZodNullable({
4347
- type: "nullable",
4348
- innerType
4349
- });
4350
- }
4351
- var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
4352
- $ZodDefault.init(inst, def);
4353
- ZodType.init(inst, def);
4354
- inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
4355
- inst.unwrap = () => inst._zod.def.innerType;
4356
- inst.removeDefault = inst.unwrap;
4357
- });
4358
- function _default$1(innerType, defaultValue) {
4359
- return new ZodDefault({
4360
- type: "default",
4361
- innerType,
4362
- get defaultValue() {
4363
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
4364
- }
4365
- });
4366
- }
4367
- var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
4368
- $ZodPrefault.init(inst, def);
4369
- ZodType.init(inst, def);
4370
- inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
4371
- inst.unwrap = () => inst._zod.def.innerType;
4372
- });
4373
- function prefault(innerType, defaultValue) {
4374
- return new ZodPrefault({
4375
- type: "prefault",
4376
- innerType,
4377
- get defaultValue() {
4378
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
4566
+ required(...args) {
4567
+ return required(ZodNonOptional, this, args[0]);
4379
4568
  }
4380
4569
  });
4381
- }
4382
- var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
4383
- $ZodNonOptional.init(inst, def);
4384
- ZodType.init(inst, def);
4385
- inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
4386
- inst.unwrap = () => inst._zod.def.innerType;
4387
4570
  });
4388
- function nonoptional(innerType, params) {
4389
- return new ZodNonOptional({
4390
- type: "nonoptional",
4391
- innerType,
4571
+ function object(shape, params) {
4572
+ return new ZodObject({
4573
+ type: "object",
4574
+ shape: shape ?? {},
4392
4575
  ...normalizeParams(params)
4393
4576
  });
4394
4577
  }
4395
- var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
4396
- $ZodCatch.init(inst, def);
4578
+ var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4579
+ $ZodUnion.init(inst, def);
4397
4580
  ZodType.init(inst, def);
4398
- inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
4399
- inst.unwrap = () => inst._zod.def.innerType;
4400
- inst.removeCatch = inst.unwrap;
4581
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
4582
+ inst.options = def.options;
4401
4583
  });
4402
- function _catch(innerType, catchValue) {
4403
- return new ZodCatch({
4404
- type: "catch",
4405
- innerType,
4406
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
4584
+ function union(options, params) {
4585
+ return new ZodUnion({
4586
+ type: "union",
4587
+ options,
4588
+ ...normalizeParams(params)
4407
4589
  });
4408
4590
  }
4409
- var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
4410
- $ZodPipe.init(inst, def);
4591
+ var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
4592
+ $ZodIntersection.init(inst, def);
4411
4593
  ZodType.init(inst, def);
4412
- inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
4413
- inst.in = def.in;
4414
- inst.out = def.out;
4594
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
4415
4595
  });
4416
- function pipe(in_, out) {
4417
- return new ZodPipe({
4418
- type: "pipe",
4419
- in: in_,
4420
- out
4596
+ function intersection(left, right) {
4597
+ return new ZodIntersection({
4598
+ type: "intersection",
4599
+ left,
4600
+ right
4421
4601
  });
4422
4602
  }
4423
- var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4424
- $ZodReadonly.init(inst, def);
4603
+ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4604
+ $ZodRecord.init(inst, def);
4425
4605
  ZodType.init(inst, def);
4426
- inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
4427
- inst.unwrap = () => inst._zod.def.innerType;
4606
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
4607
+ inst.keyType = def.keyType;
4608
+ inst.valueType = def.valueType;
4428
4609
  });
4429
- function readonly(innerType) {
4430
- return new ZodReadonly({
4431
- type: "readonly",
4432
- innerType
4610
+ function record(keyType, valueType, params) {
4611
+ if (!valueType || !valueType._zod) return new ZodRecord({
4612
+ type: "record",
4613
+ keyType: string(),
4614
+ valueType: keyType,
4615
+ ...normalizeParams(valueType)
4616
+ });
4617
+ return new ZodRecord({
4618
+ type: "record",
4619
+ keyType,
4620
+ valueType,
4621
+ ...normalizeParams(params)
4433
4622
  });
4434
4623
  }
4435
- var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4436
- $ZodCustom.init(inst, def);
4624
+ var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
4625
+ $ZodEnum.init(inst, def);
4437
4626
  ZodType.init(inst, def);
4438
- inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
4627
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
4628
+ inst.enum = def.entries;
4629
+ inst.options = Object.values(def.entries);
4630
+ const keys = new Set(Object.keys(def.entries));
4631
+ inst.extract = (values, params) => {
4632
+ const newEntries = {};
4633
+ for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
4634
+ else throw new Error(`Key ${value} not found in enum`);
4635
+ return new ZodEnum({
4636
+ ...def,
4637
+ checks: [],
4638
+ ...normalizeParams(params),
4639
+ entries: newEntries
4640
+ });
4641
+ };
4642
+ inst.exclude = (values, params) => {
4643
+ const newEntries = { ...def.entries };
4644
+ for (const value of values) if (keys.has(value)) delete newEntries[value];
4645
+ else throw new Error(`Key ${value} not found in enum`);
4646
+ return new ZodEnum({
4647
+ ...def,
4648
+ checks: [],
4649
+ ...normalizeParams(params),
4650
+ entries: newEntries
4651
+ });
4652
+ };
4439
4653
  });
4440
- function refine(fn, _params = {}) {
4441
- return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
4442
- }
4443
- function superRefine(fn, params) {
4444
- return /* @__PURE__ */ _superRefine(fn, params);
4654
+ function _enum(values, params) {
4655
+ return new ZodEnum({
4656
+ type: "enum",
4657
+ entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
4658
+ ...normalizeParams(params)
4659
+ });
4445
4660
  }
4446
- //#endregion
4447
- //#region ../llms/src/errors.ts
4448
- /**
4449
- * Error types and error handling for LLM invocations
4450
- */
4451
- var InvokeErrorTypes = {
4452
- NETWORK_ERROR: "network_error",
4453
- RATE_LIMIT: "rate_limit",
4454
- SERVER_ERROR: "server_error",
4455
- NO_TOOL_CALL: "no_tool_call",
4456
- INVALID_TOOL_ARGS: "invalid_tool_args",
4457
- TOOL_EXECUTION_ERROR: "tool_execution_error",
4458
- UNKNOWN: "unknown",
4459
- CONFIG_ERROR: "config_error",
4460
- AUTH_ERROR: "auth_error",
4461
- CONTEXT_LENGTH: "context_length",
4462
- CONTENT_FILTER: "content_filter"
4463
- };
4464
- var InvokeError = class extends Error {
4465
- type;
4466
- retryable;
4467
- statusCode;
4468
- rawError;
4469
- rawResponse;
4470
- constructor(type, message, rawError, rawResponse) {
4471
- super(message);
4472
- this.name = "InvokeError";
4473
- this.type = type;
4474
- this.retryable = this.isRetryable(type, rawError);
4475
- this.rawError = rawError;
4476
- this.rawResponse = rawResponse;
4477
- }
4478
- isRetryable(type, rawError) {
4479
- if (rawError?.name === "AbortError") return false;
4480
- return [
4481
- InvokeErrorTypes.NETWORK_ERROR,
4482
- InvokeErrorTypes.RATE_LIMIT,
4483
- InvokeErrorTypes.SERVER_ERROR,
4484
- InvokeErrorTypes.NO_TOOL_CALL,
4485
- InvokeErrorTypes.INVALID_TOOL_ARGS,
4486
- InvokeErrorTypes.TOOL_EXECUTION_ERROR,
4487
- InvokeErrorTypes.UNKNOWN
4488
- ].includes(type);
4489
- }
4490
- };
4491
- //#endregion
4492
- //#region ../../node_modules/chalk/source/vendor/ansi-styles/index.js
4493
- var ANSI_BACKGROUND_OFFSET = 10;
4494
- var wrapAnsi16 = (offset = 0) => (code) => `\u001B[${code + offset}m`;
4495
- var wrapAnsi256 = (offset = 0) => (code) => `\u001B[${38 + offset};5;${code}m`;
4496
- var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\u001B[${38 + offset};2;${red};${green};${blue}m`;
4497
- var styles$1 = {
4498
- modifier: {
4499
- reset: [0, 0],
4500
- bold: [1, 22],
4501
- dim: [2, 22],
4502
- italic: [3, 23],
4503
- underline: [4, 24],
4504
- overline: [53, 55],
4505
- inverse: [7, 27],
4506
- hidden: [8, 28],
4507
- strikethrough: [9, 29]
4508
- },
4509
- color: {
4510
- black: [30, 39],
4511
- red: [31, 39],
4512
- green: [32, 39],
4513
- yellow: [33, 39],
4514
- blue: [34, 39],
4515
- magenta: [35, 39],
4516
- cyan: [36, 39],
4517
- white: [37, 39],
4518
- blackBright: [90, 39],
4519
- gray: [90, 39],
4520
- grey: [90, 39],
4521
- redBright: [91, 39],
4522
- greenBright: [92, 39],
4523
- yellowBright: [93, 39],
4524
- blueBright: [94, 39],
4525
- magentaBright: [95, 39],
4526
- cyanBright: [96, 39],
4527
- whiteBright: [97, 39]
4528
- },
4529
- bgColor: {
4530
- bgBlack: [40, 49],
4531
- bgRed: [41, 49],
4532
- bgGreen: [42, 49],
4533
- bgYellow: [43, 49],
4534
- bgBlue: [44, 49],
4535
- bgMagenta: [45, 49],
4536
- bgCyan: [46, 49],
4537
- bgWhite: [47, 49],
4538
- bgBlackBright: [100, 49],
4539
- bgGray: [100, 49],
4540
- bgGrey: [100, 49],
4541
- bgRedBright: [101, 49],
4542
- bgGreenBright: [102, 49],
4543
- bgYellowBright: [103, 49],
4544
- bgBlueBright: [104, 49],
4545
- bgMagentaBright: [105, 49],
4546
- bgCyanBright: [106, 49],
4547
- bgWhiteBright: [107, 49]
4548
- }
4549
- };
4550
- var modifierNames = Object.keys(styles$1.modifier);
4551
- var foregroundColorNames = Object.keys(styles$1.color);
4552
- var backgroundColorNames = Object.keys(styles$1.bgColor);
4553
- var colorNames = [...foregroundColorNames, ...backgroundColorNames];
4554
- function assembleStyles() {
4555
- const codes = /* @__PURE__ */ new Map();
4556
- for (const [groupName, group] of Object.entries(styles$1)) {
4557
- for (const [styleName, style] of Object.entries(group)) {
4558
- styles$1[styleName] = {
4559
- open: `\u001B[${style[0]}m`,
4560
- close: `\u001B[${style[1]}m`
4561
- };
4562
- group[styleName] = styles$1[styleName];
4563
- codes.set(style[0], style[1]);
4564
- }
4565
- Object.defineProperty(styles$1, groupName, {
4566
- value: group,
4567
- enumerable: false
4661
+ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
4662
+ $ZodTransform.init(inst, def);
4663
+ ZodType.init(inst, def);
4664
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
4665
+ inst._zod.parse = (payload, _ctx) => {
4666
+ if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
4667
+ payload.addIssue = (issue$1) => {
4668
+ if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
4669
+ else {
4670
+ const _issue = issue$1;
4671
+ if (_issue.fatal) _issue.continue = false;
4672
+ _issue.code ?? (_issue.code = "custom");
4673
+ _issue.input ?? (_issue.input = payload.value);
4674
+ _issue.inst ?? (_issue.inst = inst);
4675
+ payload.issues.push(issue(_issue));
4676
+ }
4677
+ };
4678
+ const output = def.transform(payload.value, payload);
4679
+ if (output instanceof Promise) return output.then((output) => {
4680
+ payload.value = output;
4681
+ payload.fallback = true;
4682
+ return payload;
4568
4683
  });
4569
- }
4570
- Object.defineProperty(styles$1, "codes", {
4571
- value: codes,
4572
- enumerable: false
4573
- });
4574
- styles$1.color.close = "\x1B[39m";
4575
- styles$1.bgColor.close = "\x1B[49m";
4576
- styles$1.color.ansi = wrapAnsi16();
4577
- styles$1.color.ansi256 = wrapAnsi256();
4578
- styles$1.color.ansi16m = wrapAnsi16m();
4579
- styles$1.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
4580
- styles$1.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
4581
- styles$1.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
4582
- Object.defineProperties(styles$1, {
4583
- rgbToAnsi256: {
4584
- value(red, green, blue) {
4585
- if (red === green && green === blue) {
4586
- if (red < 8) return 16;
4587
- if (red > 248) return 231;
4588
- return Math.round((red - 8) / 247 * 24) + 232;
4589
- }
4590
- return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
4591
- },
4592
- enumerable: false
4593
- },
4594
- hexToRgb: {
4595
- value(hex) {
4596
- const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
4597
- if (!matches) return [
4598
- 0,
4599
- 0,
4600
- 0
4601
- ];
4602
- let [colorString] = matches;
4603
- if (colorString.length === 3) colorString = [...colorString].map((character) => character + character).join("");
4604
- const integer = Number.parseInt(colorString, 16);
4605
- return [
4606
- integer >> 16 & 255,
4607
- integer >> 8 & 255,
4608
- integer & 255
4609
- ];
4610
- },
4611
- enumerable: false
4612
- },
4613
- hexToAnsi256: {
4614
- value: (hex) => styles$1.rgbToAnsi256(...styles$1.hexToRgb(hex)),
4615
- enumerable: false
4616
- },
4617
- ansi256ToAnsi: {
4618
- value(code) {
4619
- if (code < 8) return 30 + code;
4620
- if (code < 16) return 90 + (code - 8);
4621
- let red;
4622
- let green;
4623
- let blue;
4624
- if (code >= 232) {
4625
- red = ((code - 232) * 10 + 8) / 255;
4626
- green = red;
4627
- blue = red;
4628
- } else {
4629
- code -= 16;
4630
- const remainder = code % 36;
4631
- red = Math.floor(code / 36) / 5;
4632
- green = Math.floor(remainder / 6) / 5;
4633
- blue = remainder % 6 / 5;
4634
- }
4635
- const value = Math.max(red, green, blue) * 2;
4636
- if (value === 0) return 30;
4637
- let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
4638
- if (value === 2) result += 60;
4639
- return result;
4640
- },
4641
- enumerable: false
4642
- },
4643
- rgbToAnsi: {
4644
- value: (red, green, blue) => styles$1.ansi256ToAnsi(styles$1.rgbToAnsi256(red, green, blue)),
4645
- enumerable: false
4646
- },
4647
- hexToAnsi: {
4648
- value: (hex) => styles$1.ansi256ToAnsi(styles$1.hexToAnsi256(hex)),
4649
- enumerable: false
4650
- }
4684
+ payload.value = output;
4685
+ payload.fallback = true;
4686
+ return payload;
4687
+ };
4688
+ });
4689
+ function transform(fn) {
4690
+ return new ZodTransform({
4691
+ type: "transform",
4692
+ transform: fn
4651
4693
  });
4652
- return styles$1;
4653
4694
  }
4654
- var ansiStyles = assembleStyles();
4655
- //#endregion
4656
- //#region ../../node_modules/chalk/source/vendor/supports-color/browser.js
4657
- var level = (() => {
4658
- if (!("navigator" in globalThis)) return 0;
4659
- if (globalThis.navigator.userAgentData) {
4660
- const brand = navigator.userAgentData.brands.find(({ brand }) => brand === "Chromium");
4661
- if (brand && brand.version > 93) return 3;
4662
- }
4663
- if (/\b(Chrome|Chromium)\//.test(globalThis.navigator.userAgent)) return 1;
4664
- return 0;
4665
- })();
4666
- var colorSupport = level !== 0 && {
4667
- level,
4668
- hasBasic: true,
4669
- has256: level >= 2,
4670
- has16m: level >= 3
4671
- };
4672
- var supportsColor = {
4673
- stdout: colorSupport,
4674
- stderr: colorSupport
4675
- };
4676
- //#endregion
4677
- //#region ../../node_modules/chalk/source/utilities.js
4678
- function stringReplaceAll(string, substring, replacer) {
4679
- let index = string.indexOf(substring);
4680
- if (index === -1) return string;
4681
- const substringLength = substring.length;
4682
- let endIndex = 0;
4683
- let returnValue = "";
4684
- do {
4685
- returnValue += string.slice(endIndex, index) + substring + replacer;
4686
- endIndex = index + substringLength;
4687
- index = string.indexOf(substring, endIndex);
4688
- } while (index !== -1);
4689
- returnValue += string.slice(endIndex);
4690
- return returnValue;
4695
+ var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
4696
+ $ZodOptional.init(inst, def);
4697
+ ZodType.init(inst, def);
4698
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4699
+ inst.unwrap = () => inst._zod.def.innerType;
4700
+ });
4701
+ function optional(innerType) {
4702
+ return new ZodOptional({
4703
+ type: "optional",
4704
+ innerType
4705
+ });
4691
4706
  }
4692
- function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
4693
- let endIndex = 0;
4694
- let returnValue = "";
4695
- do {
4696
- const gotCR = string[index - 1] === "\r";
4697
- returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
4698
- endIndex = index + 1;
4699
- index = string.indexOf("\n", endIndex);
4700
- } while (index !== -1);
4701
- returnValue += string.slice(endIndex);
4702
- return returnValue;
4707
+ var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
4708
+ $ZodExactOptional.init(inst, def);
4709
+ ZodType.init(inst, def);
4710
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
4711
+ inst.unwrap = () => inst._zod.def.innerType;
4712
+ });
4713
+ function exactOptional(innerType) {
4714
+ return new ZodExactOptional({
4715
+ type: "optional",
4716
+ innerType
4717
+ });
4703
4718
  }
4704
- //#endregion
4705
- //#region ../../node_modules/chalk/source/index.js
4706
- var { stdout: stdoutColor, stderr: stderrColor } = supportsColor;
4707
- var GENERATOR = Symbol("GENERATOR");
4708
- var STYLER = Symbol("STYLER");
4709
- var IS_EMPTY = Symbol("IS_EMPTY");
4710
- var levelMapping = [
4711
- "ansi",
4712
- "ansi",
4713
- "ansi256",
4714
- "ansi16m"
4715
- ];
4716
- var styles = Object.create(null);
4717
- var applyOptions = (object, options = {}) => {
4718
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) throw new Error("The `level` option should be an integer from 0 to 3");
4719
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
4720
- object.level = options.level === void 0 ? colorLevel : options.level;
4721
- };
4722
- var chalkFactory = (options) => {
4723
- const chalk = (...strings) => strings.join(" ");
4724
- applyOptions(chalk, options);
4725
- Object.setPrototypeOf(chalk, createChalk.prototype);
4726
- return chalk;
4727
- };
4728
- function createChalk(options) {
4729
- return chalkFactory(options);
4719
+ var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
4720
+ $ZodNullable.init(inst, def);
4721
+ ZodType.init(inst, def);
4722
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
4723
+ inst.unwrap = () => inst._zod.def.innerType;
4724
+ });
4725
+ function nullable(innerType) {
4726
+ return new ZodNullable({
4727
+ type: "nullable",
4728
+ innerType
4729
+ });
4730
4730
  }
4731
- Object.setPrototypeOf(createChalk.prototype, Function.prototype);
4732
- for (const [styleName, style] of Object.entries(ansiStyles)) styles[styleName] = { get() {
4733
- const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
4734
- Object.defineProperty(this, styleName, { value: builder });
4735
- return builder;
4736
- } };
4737
- styles.visible = { get() {
4738
- const builder = createBuilder(this, this[STYLER], true);
4739
- Object.defineProperty(this, "visible", { value: builder });
4740
- return builder;
4741
- } };
4742
- var getModelAnsi = (model, level, type, ...arguments_) => {
4743
- if (model === "rgb") {
4744
- if (level === "ansi16m") return ansiStyles[type].ansi16m(...arguments_);
4745
- if (level === "ansi256") return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
4746
- return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
4747
- }
4748
- if (model === "hex") return getModelAnsi("rgb", level, type, ...ansiStyles.hexToRgb(...arguments_));
4749
- return ansiStyles[type][model](...arguments_);
4750
- };
4751
- for (const model of [
4752
- "rgb",
4753
- "hex",
4754
- "ansi256"
4755
- ]) {
4756
- styles[model] = { get() {
4757
- const { level } = this;
4758
- return function(...arguments_) {
4759
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansiStyles.color.close, this[STYLER]);
4760
- return createBuilder(this, styler, this[IS_EMPTY]);
4761
- };
4762
- } };
4763
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
4764
- styles[bgModel] = { get() {
4765
- const { level } = this;
4766
- return function(...arguments_) {
4767
- const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
4768
- return createBuilder(this, styler, this[IS_EMPTY]);
4769
- };
4770
- } };
4731
+ var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
4732
+ $ZodDefault.init(inst, def);
4733
+ ZodType.init(inst, def);
4734
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
4735
+ inst.unwrap = () => inst._zod.def.innerType;
4736
+ inst.removeDefault = inst.unwrap;
4737
+ });
4738
+ function _default$1(innerType, defaultValue) {
4739
+ return new ZodDefault({
4740
+ type: "default",
4741
+ innerType,
4742
+ get defaultValue() {
4743
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
4744
+ }
4745
+ });
4771
4746
  }
4772
- var proto = Object.defineProperties(() => {}, {
4773
- ...styles,
4774
- level: {
4775
- enumerable: true,
4776
- get() {
4777
- return this[GENERATOR].level;
4778
- },
4779
- set(level) {
4780
- this[GENERATOR].level = level;
4747
+ var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
4748
+ $ZodPrefault.init(inst, def);
4749
+ ZodType.init(inst, def);
4750
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
4751
+ inst.unwrap = () => inst._zod.def.innerType;
4752
+ });
4753
+ function prefault(innerType, defaultValue) {
4754
+ return new ZodPrefault({
4755
+ type: "prefault",
4756
+ innerType,
4757
+ get defaultValue() {
4758
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
4781
4759
  }
4782
- }
4760
+ });
4761
+ }
4762
+ var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
4763
+ $ZodNonOptional.init(inst, def);
4764
+ ZodType.init(inst, def);
4765
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
4766
+ inst.unwrap = () => inst._zod.def.innerType;
4783
4767
  });
4784
- var createStyler = (open, close, parent) => {
4785
- let openAll;
4786
- let closeAll;
4787
- if (parent === void 0) {
4788
- openAll = open;
4789
- closeAll = close;
4790
- } else {
4791
- openAll = parent.openAll + open;
4792
- closeAll = close + parent.closeAll;
4793
- }
4794
- return {
4795
- open,
4796
- close,
4797
- openAll,
4798
- closeAll,
4799
- parent
4800
- };
4801
- };
4802
- var createBuilder = (self, _styler, _isEmpty) => {
4803
- const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
4804
- Object.setPrototypeOf(builder, proto);
4805
- builder[GENERATOR] = self;
4806
- builder[STYLER] = _styler;
4807
- builder[IS_EMPTY] = _isEmpty;
4808
- return builder;
4809
- };
4810
- var applyStyle = (self, string) => {
4811
- if (self.level <= 0 || !string) return self[IS_EMPTY] ? "" : string;
4812
- let styler = self[STYLER];
4813
- if (styler === void 0) return string;
4814
- const { openAll, closeAll } = styler;
4815
- if (string.includes("\x1B")) while (styler !== void 0) {
4816
- string = stringReplaceAll(string, styler.close, styler.open);
4817
- styler = styler.parent;
4818
- }
4819
- const lfIndex = string.indexOf("\n");
4820
- if (lfIndex !== -1) string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
4821
- return openAll + string + closeAll;
4822
- };
4823
- Object.defineProperties(createChalk.prototype, styles);
4824
- var chalk = createChalk();
4825
- var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
4768
+ function nonoptional(innerType, params) {
4769
+ return new ZodNonOptional({
4770
+ type: "nonoptional",
4771
+ innerType,
4772
+ ...normalizeParams(params)
4773
+ });
4774
+ }
4775
+ var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
4776
+ $ZodCatch.init(inst, def);
4777
+ ZodType.init(inst, def);
4778
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
4779
+ inst.unwrap = () => inst._zod.def.innerType;
4780
+ inst.removeCatch = inst.unwrap;
4781
+ });
4782
+ function _catch(innerType, catchValue) {
4783
+ return new ZodCatch({
4784
+ type: "catch",
4785
+ innerType,
4786
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
4787
+ });
4788
+ }
4789
+ var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
4790
+ $ZodPipe.init(inst, def);
4791
+ ZodType.init(inst, def);
4792
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
4793
+ inst.in = def.in;
4794
+ inst.out = def.out;
4795
+ });
4796
+ function pipe(in_, out) {
4797
+ return new ZodPipe({
4798
+ type: "pipe",
4799
+ in: in_,
4800
+ out
4801
+ });
4802
+ }
4803
+ var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4804
+ $ZodReadonly.init(inst, def);
4805
+ ZodType.init(inst, def);
4806
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
4807
+ inst.unwrap = () => inst._zod.def.innerType;
4808
+ });
4809
+ function readonly(innerType) {
4810
+ return new ZodReadonly({
4811
+ type: "readonly",
4812
+ innerType
4813
+ });
4814
+ }
4815
+ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4816
+ $ZodCustom.init(inst, def);
4817
+ ZodType.init(inst, def);
4818
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
4819
+ });
4820
+ function refine(fn, _params = {}) {
4821
+ return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
4822
+ }
4823
+ function superRefine(fn, params) {
4824
+ return /* @__PURE__ */ _superRefine(fn, params);
4825
+ }
4826
4826
  //#endregion
4827
4827
  //#region ../llms/src/utils.ts
4828
4828
  /**
@@ -4951,10 +4951,127 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4951
4951
  return normalizedName;
4952
4952
  }
4953
4953
  //#endregion
4954
- //#region ../llms/src/OpenAIClient.ts
4954
+ //#region ../llms/src/utils/toolErrors.ts
4955
+ /**
4956
+ * 将 Zod 验证路径转换为可读字符串
4957
+ *
4958
+ * @example
4959
+ * formatValidationPath(['action', 'wait_for_condition', 'prompt'])
4960
+ * // => 'action.wait_for_condition.prompt'
4961
+ *
4962
+ * formatValidationPath(['todos', 0, 'activeForm'])
4963
+ * // => 'todos[0].activeForm'
4964
+ */
4965
+ function formatValidationPath(path) {
4966
+ if (path.length === 0) return "";
4967
+ return path.reduce((acc, segment, index) => {
4968
+ const segmentStr = String(segment);
4969
+ if (typeof segment === "number") return `${acc}[${segmentStr}]`;
4970
+ return index === 0 ? segmentStr : `${acc}.${segmentStr}`;
4971
+ }, "");
4972
+ }
4973
+ /**
4974
+ * 格式化 Zod 验证错误为 LLM 友好的消息
4975
+ *
4976
+ * 分类处理三种主要错误类型:
4977
+ * 1. 缺少必需参数
4978
+ * 2. 意外的参数
4979
+ * 3. 类型不匹配
4980
+ * 4. action 字段格式错误(针对本项目问题)
4981
+ *
4982
+ * @param toolName - 工具名称
4983
+ * @param error - Zod 验证错误
4984
+ * @returns 格式化的错误消息
4985
+ */
4986
+ function formatZodValidationError(toolName, error) {
4987
+ const missingParams = error.issues.filter((err) => err.code === "invalid_type" && (err.message.includes("required") || err.message.includes("undefined"))).map((err) => formatValidationPath(err.path));
4988
+ const unexpectedParams = error.issues.filter((err) => err.code === "unrecognized_keys").flatMap((err) => err.keys || []);
4989
+ const typeMismatchParams = error.issues.filter((err) => err.code === "invalid_type" && !err.message.includes("required") && !err.message.includes("undefined")).map((err) => {
4990
+ const receivedMatch = /received (\w+)/.exec(err.message);
4991
+ const received = receivedMatch ? receivedMatch[1] : "unknown";
4992
+ return {
4993
+ param: formatValidationPath(err.path),
4994
+ expected: err.expected || "unknown",
4995
+ received
4996
+ };
4997
+ });
4998
+ const actionStringIssues = error.issues.filter((err) => {
4999
+ return formatValidationPath(err.path) === "action" && typeof err.received === "string";
5000
+ }).map((err) => {
5001
+ const received = err.received;
5002
+ return {
5003
+ param: formatValidationPath(err.path),
5004
+ expected: "object",
5005
+ received: typeof received,
5006
+ hint: `Expected format: {"action": {"tool_name": {...}}}`
5007
+ };
5008
+ });
5009
+ const actionStructureIssues = error.issues.filter((err) => {
5010
+ return formatValidationPath(err.path).startsWith("action.") && err.code === "invalid_type";
5011
+ }).map((err) => {
5012
+ const receivedMatch = /received (\w+)/.exec(err.message);
5013
+ const received = receivedMatch ? receivedMatch[1] : "unknown";
5014
+ return {
5015
+ param: formatValidationPath(err.path),
5016
+ expected: err.expected || "unknown",
5017
+ received
5018
+ };
5019
+ });
5020
+ const errorParts = [];
5021
+ if (missingParams.length > 0) {
5022
+ const missingText = missingParams.length === 1 ? `Missing required parameter: \`${missingParams[0]}\`` : `Missing required parameters: ${missingParams.map((p) => `\`${p}\``).join(", ")}`;
5023
+ errorParts.push(missingText);
5024
+ }
5025
+ if (unexpectedParams.length > 0) {
5026
+ const unexpectedText = unexpectedParams.length === 1 ? `Unexpected parameter: \`${unexpectedParams[0]}\`` : `Unexpected parameters: ${unexpectedParams.map((p) => `\`${p}\``).join(", ")}`;
5027
+ errorParts.push(unexpectedText);
5028
+ }
5029
+ if (typeMismatchParams.length > 0) {
5030
+ const typeErrors = typeMismatchParams.map(({ param, expected, received }) => `Parameter \`${param}\` expected \`${expected}\` but got \`${received}\``);
5031
+ errorParts.push(...typeErrors);
5032
+ }
5033
+ if (actionStringIssues.length > 0) {
5034
+ const issue = actionStringIssues[0];
5035
+ errorParts.push(`Parameter \`${issue.param}\` expected \`${issue.expected}\` but got \`${issue.received}\`. ${issue.hint}`);
5036
+ }
5037
+ if (actionStructureIssues.length > 0) {
5038
+ const structureErrors = actionStructureIssues.map(({ param, expected, received }) => `Parameter \`${param}\` expected \`${expected}\` but got \`${received}\``);
5039
+ errorParts.push(...structureErrors);
5040
+ }
5041
+ if (errorParts.length > 0) return `${toolName} failed due to the following ${errorParts.length === 1 ? "issue" : "issues"}:\n${errorParts.map((e) => ` • ${e}`).join("\n")}`;
5042
+ return `${toolName} validation failed: ${error.message}`;
5043
+ }
4955
5044
  /**
4956
- * OpenAI Client implementation
5045
+ * 获取工具使用示例
5046
+ *
5047
+ * 为常见工具提供正确使用示例,帮助 LLM 理解正确的格式
4957
5048
  */
5049
+ function getToolExample(toolName) {
5050
+ const example = {
5051
+ wait_for_condition: { wait_for_condition: {
5052
+ prompt: "描述要等待的条件,如'页面已加载完成'",
5053
+ timeout: 1e4
5054
+ } },
5055
+ click_element_by_index: { click_element_by_index: { index: 16 } },
5056
+ input_text: { input_text: {
5057
+ index: 26,
5058
+ text: "输入的文本"
5059
+ } },
5060
+ done: { done: {
5061
+ text: "任务完成描述",
5062
+ success: true
5063
+ } },
5064
+ assert: { assert: { prompt: "要断言的条件,如'输入框值显示为200'" } },
5065
+ scroll: { scroll: {
5066
+ down: true,
5067
+ numPages: 1
5068
+ } }
5069
+ }[toolName];
5070
+ if (example) return JSON.stringify(example, null, 2);
5071
+ return `{ "${toolName}": { /* parameters */ } }`;
5072
+ }
5073
+ //#endregion
5074
+ //#region ../llms/src/OpenAIClient.ts
4958
5075
  /**
4959
5076
  * Client for OpenAI compatible APIs
4960
5077
  */
@@ -5039,8 +5156,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5039
5156
  }
5040
5157
  const validation = tool.inputSchema.safeParse(parsedArgs);
5041
5158
  if (!validation.success) {
5042
- console.error(prettifyError(validation.error));
5043
- throw new InvokeError(InvokeErrorTypes.INVALID_TOOL_ARGS, "Tool arguments validation failed", validation.error, data);
5159
+ const fullErrorMessage = `${formatZodValidationError(toolCallName, validation.error)}\n\nExample:\n${getToolExample(toolCallName)}`;
5160
+ console.error("[TRACE] VALIDATION FAILED for tool:", toolCallName);
5161
+ console.error("[TRACE] Parsed args:", parsedArgs);
5162
+ console.error("[TRACE]", fullErrorMessage);
5163
+ throw new InvokeError(InvokeErrorTypes.INVALID_TOOL_ARGS, fullErrorMessage, validation.error, data);
5044
5164
  }
5045
5165
  const toolInput = validation.data;
5046
5166
  let toolResult;
@@ -5140,7 +5260,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5140
5260
  }
5141
5261
  //#endregion
5142
5262
  //#region ../core/src/prompts/system_prompt.md?raw
5143
- var system_prompt_default = "You are an AI agent designed to operate in an iterative loop to automate browser tasks. Your ultimate goal is accomplishing the task provided in <user_request>.\n\n<intro>\nYou excel at following tasks:\n1. Navigating complex websites and extracting precise information\n2. Automating form submissions and interactive web actions\n3. Gathering and saving information \n4. Operate effectively in an agent loop\n5. Efficiently performing diverse web tasks\n</intro>\n\n<language_settings>\n- Default working language: **English**\n- Use the language that user is using. Return in user's language.\n</language_settings>\n\n<input>\nAt every step, your input will consist of: \n1. <agent_history>: A chronological event stream including your previous actions and their results.\n2. <agent_state>: Current <user_request> and <step_info>.\n3. <browser_state>: Current URL, interactive elements indexed for actions, and visible page content.\n</input>\n\n<agent_history>\nAgent history will be given as a list of step information as follows:\n\n<step_{step_number}>:\nEvaluation of Previous Step: Assessment of last action\nMemory: Your memory of this step\nNext Goal: Your goal for this step\nAction Results: Your actions and their results\n</step_{step_number}>\n\nand system messages wrapped in <sys> tag.\n</agent_history>\n\n<user_request>\nUSER REQUEST: This is your ultimate objective and always remains visible.\n- This has the highest priority. Make the user happy.\n- If the user request is very specific - then carefully follow each step and dont skip or hallucinate steps.\n- If the task is open ended you can plan yourself how to get it done.\n</user_request>\n\n<browser_state>\n1. Browser State will be given as:\n\nCurrent URL: URL of the page you are currently viewing.\nInteractive Elements: All interactive elements will be provided in format as [index]<type>text</type> where\n- index: Numeric identifier for interaction\n- type: HTML element type (button, input, etc.)\n- text: Element description\n\nExamples:\n[33]<div>User form</div>\n\\t*[35]<button aria-label='Submit form'>Submit</button>\n\nNote that:\n- Only elements with numeric indexes in [] are interactive\n- (stacked) indentation (with \\t) is important and means that the element is a (html) child of the element above (with a lower index)\n- Elements tagged with `*[` are the new clickable elements that appeared on the website since the last step - if url has not changed.\n- Pure text elements without [] are not interactive.\n</browser_state>\n\n<browser_rules>\nStrictly follow these rules while using the browser and navigating the web:\n- Only interact with elements that have a numeric [index] assigned.\n- Only use indexes that are explicitly provided.\n- If the page changes after, for example, an input text action, analyze if you need to interact with new elements, e.g. selecting the right option from the list.\n- By default, only elements in the visible viewport are listed. Use scrolling actions if you suspect relevant content is offscreen which you need to interact with. Scroll ONLY if there are more pixels below or above the page.\n- You can scroll by a specific number of pages using the num_pages parameter (e.g., 0.5 for half page, 2.0 for two pages).\n- All the elements that are scrollable are marked with `data-scrollable` attribute. Including the scrollable distance in every directions. You can scroll *the element* in case some area are overflowed.\n- If a captcha appears, tell user you can not solve captcha. Finish the task and ask user to solve it.\n- If expected elements are missing, try scrolling, or navigating back.\n- If the page is not fully loaded, use the `wait` action.\n- Do not repeat one action for more than 3 times unless some conditions changed.\n- If you fill an input field and your action sequence is interrupted, most often something changed e.g. suggestions popped up under the field.\n- If the <user_request> includes specific page information such as product type, rating, price, location, etc., try to apply filters to be more efficient.\n- The <user_request> is the ultimate goal. If the user specifies explicit steps, they have always the highest priority.\n- If you input_text into a field, you might need to press enter, click the search button, or select from dropdown for completion.\n- Don't login into a page if you don't have to. Don't login if you don't have the credentials. \n- There are 2 types of tasks always first think which type of request you are dealing with:\n1. Very specific step by step instructions:\n- Follow them as very precise and don't skip steps. Try to complete everything as requested.\n2. Open ended tasks. Plan yourself, be creative in achieving them.\n- If you get stuck e.g. with logins or captcha in open-ended tasks you can re-evaluate the task and try alternative ways, e.g. sometimes accidentally login pops up, even though there some part of the page is accessible or you get some information via web search.\n</browser_rules>\n\n<capability>\n- You can only handle single page app. Do not jump out of current page.\n- Do not click on link if it will open in a new page (e.g., <a target=\"_blank\">)\n- It is ok to fail the task.\n - User can be wrong. If the request of user is not achievable, inappropriate or you do not have enough information or tools to achieve it. Tell user to make a better request.\n - Webpage can be broken. All webpages or apps have bugs. Some bug will make it hard for your job. It's encouraged to tell user the problem of current page. Your feedbacks (including failing) are valuable for user.\n - Trying too hard can be harmful. Repeating some action back and forth or pushing for a complex procedure with little knowledge can cause unwanted results and harmful side-effects. User would rather you complete the task with a fail.\n- If you do not have knowledge for the current webpage or task. You must require user to give specific instructions and detailed steps.\n</capability>\n\n<task_completion_rules>\nYou must call the `done` action in one of three cases:\n- When you have fully completed the USER REQUEST.\n- When you reach the final allowed step (`max_steps`), even if the task is incomplete.\n- When you feel stuck or unable to solve user request. Or user request is not clear or contains inappropriate content.\n- If it is ABSOLUTELY IMPOSSIBLE to continue.\n\nThe `done` action is your opportunity to terminate and share your findings with the user.\n- Set `success` to `true` only if the full USER REQUEST has been completed with no missing components.\n- If any part of the request is missing, incomplete, or uncertain, set `success` to `false`.\n- You can use the `text` field of the `done` action to communicate your findings and to provide a coherent reply to the user and fulfill the USER REQUEST.\n- You are ONLY ALLOWED to call `done` as a single action. Don't call it together with other actions.\n- If the user asks for specified format, such as \"return JSON with following structure\", \"return a list of format...\", MAKE sure to use the right format in your answer.\n- If the user asks for a structured output, your `done` action's schema may be modified. Take this schema into account when solving the task!\n</task_completion_rules>\n\n<reasoning_rules>\nExhibit the following reasoning patterns to successfully achieve the <user_request>:\n\n- Reason about <agent_history> to track progress and context toward <user_request>.\n- Analyze the most recent \"Next Goal\" and \"Action Result\" in <agent_history> and clearly state what you previously tried to achieve.\n- Analyze all relevant items in <agent_history> and <browser_state> to understand your state.\n- Explicitly judge success/failure/uncertainty of the last action. Never assume an action succeeded just because it appears to be executed in your last step in <agent_history>. If the expected change is missing, mark the last action as failed (or uncertain) and plan a recovery.\n- Analyze whether you are stuck, e.g. when you repeat the same actions multiple times without any progress. Then consider alternative approaches e.g. scrolling for more context or ask user for help.\n- Ask user for help if you have any difficulty. Keep user in the loop.\n- If you see information relevant to <user_request>, plan saving the information to memory.\n- Always reason about the <user_request>. Make sure to carefully analyze the specific steps and information required. E.g. specific filters, specific form fields, specific information to search. Make sure to always compare the current trajectory with the user request and think carefully if thats how the user requested it.\n</reasoning_rules>\n\n<examples>\nHere are examples of good output patterns. Use them as reference but never copy them directly.\n\n<evaluation_examples>\n\"evaluation_previous_goal\": \"Successfully navigated to the product page and found the target information. Verdict: Success\"\n\"evaluation_previous_goal\": \"Clicked the login button and user authentication form appeared. Verdict: Success\"\n</evaluation_examples>\n\n<memory_examples>\n\"memory\": \"Found many pending reports that need to be analyzed in the main page. Successfully processed the first 2 reports on quarterly sales data and moving on to inventory analysis and customer feedback reports.\"\n</memory_examples>\n\n<next_goal_examples>\n\"next_goal\": \"Click on the 'Add to Cart' button to proceed with the purchase flow.\"\n</next_goal_examples>\n</examples>\n\n<output>\n{\n \"evaluation_previous_goal\": \"Concise one-sentence analysis of your last action. Clearly state success, failure, or uncertain.\",\n \"memory\": \"1-3 concise sentences of specific memory of this step and overall progress. You should put here everything that will help you track progress in future steps. Like counting pages visited, items found, etc.\",\n \"next_goal\": \"State the next immediate goal and action to achieve it, in one clear sentence.\",\n \"action\":{\n \"Action name\": {// Action parameters}\n }\n}\n</output>\n";
5263
+ var system_prompt_default = "You are an AI agent designed to operate in an iterative loop to automate browser tasks. Your ultimate goal is accomplishing the task provided in <user_request>.\n\n<intro>\nYou excel at following tasks:\n1. Navigating complex websites and extracting precise information\n2. Automating form submissions and interactive web actions\n3. Gathering and saving information \n4. Operate effectively in an agent loop\n5. Efficiently performing diverse web tasks\n</intro>\n\n<language_settings>\n- Default working language: **English**\n- Use the language that user is using. Return in user's language.\n</language_settings>\n\n<input>\nAt every step, your input will consist of: \n1. <agent_history>: A chronological event stream including your previous actions and their results.\n2. <agent_state>: Current <user_request> and <step_info>.\n3. <browser_state>: Current URL, interactive elements indexed for actions, and visible page content.\n</input>\n\n<agent_history>\nAgent history will be given as a list of step information as follows:\n\n<step_{step_number}>:\nEvaluation of Previous Step: Assessment of last action\nMemory: Your memory of this step\nNext Goal: Your goal for this step\nAction Results: Your actions and their results\n</step_{step_number}>\n\nand system messages wrapped in <sys> tag.\n</agent_history>\n\n<user_request>\nUSER REQUEST: This is your ultimate objective and always remains visible.\n- This has the highest priority. Make the user happy.\n- If the user request is very specific - then carefully follow each step and dont skip or hallucinate steps.\n- If the task is open ended you can plan yourself how to get it done.\n</user_request>\n\n<browser_state>\n1. Browser State will be given as:\n\nCurrent URL: URL of the page you are currently viewing.\nInteractive Elements: All interactive elements will be provided in format as [index]<type>text</type> where\n- index: Numeric identifier for interaction\n- type: HTML element type (button, input, etc.)\n- text: Element description\n\nExamples:\n[33]<div>User form</div>\n\\t*[35]<button aria-label='Submit form'>Submit</button>\n\nNote that:\n- Only elements with numeric indexes in [] are interactive\n- (stacked) indentation (with \\t) is important and means that the element is a (html) child of the element above (with a lower index)\n- Elements tagged with `*[` are the new clickable elements that appeared on the website since the last step - if url has not changed.\n- Pure text elements without [] are not interactive.\n</browser_state>\n\n<browser_rules>\nStrictly follow these rules while using the browser and navigating the web:\n- Only interact with elements that have a numeric [index] assigned.\n- Only use indexes that are explicitly provided.\n- If the page changes after, for example, an input text action, analyze if you need to interact with new elements, e.g. selecting the right option from the list.\n- By default, only elements in the visible viewport are listed. Use scrolling actions if you suspect relevant content is offscreen which you need to interact with. Scroll ONLY if there are more pixels below or above the page.\n- You can scroll by a specific number of pages using the num_pages parameter (e.g., 0.5 for half page, 2.0 for two pages).\n- All the elements that are scrollable are marked with `data-scrollable` attribute. Including the scrollable distance in every directions. You can scroll *the element* in case some area are overflowed.\n- If a captcha appears, tell user you can not solve captcha. Finish the task and ask user to solve it.\n- If expected elements are missing, try scrolling, or navigating back.\n- If the page is not fully loaded, use the `wait` action.\n- Do not repeat one action for more than 3 times unless some conditions changed.\n- If you fill an input field and your action sequence is interrupted, most often something changed e.g. suggestions popped up under the field.\n- If the <user_request> includes specific page information such as product type, rating, price, location, etc., try to apply filters to be more efficient.\n- The <user_request> is the ultimate goal. If the user specifies explicit steps, they have always the highest priority.\n- If you input_text into a field, you might need to press enter, click the search button, or select from dropdown for completion.\n- Don't login into a page if you don't have to. Don't login if you don't have the credentials. \n- There are 2 types of tasks always first think which type of request you are dealing with:\n1. Very specific step by step instructions:\n- Follow them as very precise and don't skip steps. Try to complete everything as requested.\n2. Open ended tasks. Plan yourself, be creative in achieving them.\n- If you get stuck e.g. with logins or captcha in open-ended tasks you can re-evaluate the task and try alternative ways, e.g. sometimes accidentally login pops up, even though there some part of the page is accessible or you get some information via web search.\n</browser_rules>\n\n<capability>\n- You can only handle single page app. Do not jump out of current page.\n- Do not click on link if it will open in a new page (e.g., <a target=\"_blank\">)\n- It is ok to fail the task.\n - User can be wrong. If the request of user is not achievable, inappropriate or you do not have enough information or tools to achieve it. Tell user to make a better request.\n - Webpage can be broken. All webpages or apps have bugs. Some bug will make it hard for your job. It's encouraged to tell user the problem of current page. Your feedbacks (including failing) are valuable for user.\n - Trying too hard can be harmful. Repeating some action back and forth or pushing for a complex procedure with little knowledge can cause unwanted results and harmful side-effects. User would rather you complete the task with a fail.\n- If you do not have knowledge for the current webpage or task. You must require user to give specific instructions and detailed steps.\n</capability>\n\n<task_completion_rules>\nYou must call the `done` action in one of three cases:\n- When you have fully completed the USER REQUEST.\n- When you reach the final allowed step (`max_steps`), even if the task is incomplete.\n- When you feel stuck or unable to solve user request. Or user request is not clear or contains inappropriate content.\n- If it is ABSOLUTELY IMPOSSIBLE to continue.\n\nThe `done` action is your opportunity to terminate and share your findings with the user.\n- Set `success` to `true` only if the full USER REQUEST has been completed with no missing components.\n- If any part of the request is missing, incomplete, or uncertain, set `success` to `false`.\n- You can use the `text` field of the `done` action to communicate your findings and to provide a coherent reply to the user and fulfill the USER REQUEST.\n- You are ONLY ALLOWED to call `done` as a single action. Don't call it together with other actions.\n- If the user asks for specified format, such as \"return JSON with following structure\", \"return a list of format...\", MAKE sure to use the right format in your answer.\n- If the user asks for a structured output, your `done` action's schema may be modified. Take this schema into account when solving the task!\n</task_completion_rules>\n\n<reasoning_rules>\nExhibit the following reasoning patterns to successfully achieve the <user_request>:\n\n- Reason about <agent_history> to track progress and context toward <user_request>.\n- Analyze the most recent \"Next Goal\" and \"Action Result\" in <agent_history> and clearly state what you previously tried to achieve.\n- Analyze all relevant items in <agent_history> and <browser_state> to understand your state.\n- Explicitly judge success/failure/uncertainty of the last action. Never assume an action succeeded just because it appears to be executed in your last step in <agent_history>. If the expected change is missing, mark the last action as failed (or uncertain) and plan a recovery.\n- Analyze whether you are stuck, e.g. when you repeat the same actions multiple times without any progress. Then consider alternative approaches e.g. scrolling for more context or ask user for help.\n- Ask user for help if you have any difficulty. Keep user in the loop.\n- If you see information relevant to <user_request>, plan saving the information to memory.\n- Always reason about the <user_request>. Make sure to carefully analyze the specific steps and information required. E.g. specific filters, specific form fields, specific information to search. Make sure to always compare the current trajectory with the user request and think carefully if thats how the user requested it.\n</reasoning_rules>\n\n<examples>\nHere are examples of good output patterns. Use them as reference but never copy them directly.\n\n<evaluation_examples>\n\"evaluation_previous_goal\": \"Successfully navigated to the product page and found the target information. Verdict: Success\"\n\"evaluation_previous_goal\": \"Clicked the login button and user authentication form appeared. Verdict: Success\"\n</evaluation_examples>\n\n<memory_examples>\n\"memory\": \"Found many pending reports that need to be analyzed in the main page. Successfully processed the first 2 reports on quarterly sales data and moving on to inventory analysis and customer feedback reports.\"\n</memory_examples>\n\n<next_goal_examples>\n\"next_goal\": \"Click on the 'Add to Cart' button to proceed with the purchase flow.\"\n</next_goal_examples>\n</examples>\n\n<output>\n{\n \"evaluation_previous_goal\": \"Concise one-sentence analysis of your last action. Clearly state success, failure, or uncertain.\",\n \"memory\": \"1-3 concise sentences of specific memory of this step and overall progress. You should put here everything that will help you track progress in future steps. Like counting pages visited, items found, etc.\",\n \"next_goal\": \"State the next immediate goal and action to achieve it, in one clear sentence.\",\n \"action\":{\n \"Action name\": {// Action parameters}\n }\n}\n</output>\n";
5144
5264
  //#endregion
5145
5265
  //#region ../core/src/utils/autoFixer.ts
5146
5266
  var log = console.log.bind(console, chalk.yellow("[autoFixer]"));
@@ -5157,6 +5277,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5157
5277
  * - etc.
5158
5278
  */
5159
5279
  function normalizeResponse(response, tools) {
5280
+ console.log("[TRACE] ========== LLM Response (Raw) ==========");
5281
+ console.log("[TRACE] Full response:", JSON.stringify(response, null, 2));
5282
+ console.log("[TRACE] ========================================");
5283
+ console.log("[TRACE] normalizeResponse called");
5160
5284
  let resolvedArguments;
5161
5285
  const choice = response.choices?.[0];
5162
5286
  if (!choice) throw new Error("No choices in response");
@@ -5164,6 +5288,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5164
5288
  if (!message) throw new Error("No message in choice");
5165
5289
  const toolCall = message.tool_calls?.[0];
5166
5290
  if (toolCall?.function?.arguments) {
5291
+ console.log("[TRACE] toolCall.function.arguments type:", typeof toolCall.function.arguments);
5292
+ console.log("[TRACE] toolCall.function.arguments (first 200 chars):", typeof toolCall.function.arguments === "string" ? toolCall.function.arguments.substring(0, 200) : JSON.stringify(toolCall.function.arguments).substring(0, 200));
5167
5293
  resolvedArguments = safeJsonParse(toolCall.function.arguments);
5168
5294
  if (toolCall.function.name && toolCall.function.name !== "AgentOutput") {
5169
5295
  log(`#1: fixing tool_call`);
@@ -5187,11 +5313,60 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5187
5313
  }
5188
5314
  } else throw new Error("No tool_call and the message content does not contain valid JSON");
5189
5315
  } else throw new Error("No tool_call nor message content is present");
5190
- resolvedArguments = safeJsonParse(resolvedArguments);
5191
- if (resolvedArguments.action) resolvedArguments.action = safeJsonParse(resolvedArguments.action);
5316
+ console.log("[TRACE] Before stringification fix, resolvedArguments type:", typeof resolvedArguments);
5317
+ let parseCount = 0;
5318
+ const MAX_PARSE_DEPTH = 5;
5319
+ while (typeof resolvedArguments === "string" && parseCount < MAX_PARSE_DEPTH) {
5320
+ console.log(`[TRACE] Stringification layer ${parseCount + 1} detected, parsing...`);
5321
+ const beforeParse = resolvedArguments;
5322
+ resolvedArguments = safeJsonParse(resolvedArguments);
5323
+ parseCount++;
5324
+ if (resolvedArguments === beforeParse) {
5325
+ console.warn("[TRACE] Parse produced no change, stopping to prevent infinite loop");
5326
+ break;
5327
+ }
5328
+ }
5329
+ console.log(`[TRACE] After ${parseCount} parse(s), final type:`, typeof resolvedArguments);
5330
+ console.log("[TRACE] Has action field:", !!resolvedArguments?.action);
5331
+ if (typeof resolvedArguments !== "object" || resolvedArguments === null) {
5332
+ console.error("[TRACE] Failed to resolve to object after", parseCount, "parse attempts");
5333
+ console.error("[TRACE] Final resolvedArguments:", resolvedArguments);
5334
+ throw new InvokeError(InvokeErrorTypes.INVALID_TOOL_ARGS, `Unable to parse tool arguments: expected object after ${parseCount} JSON.parse attempts, got ${typeof resolvedArguments}`);
5335
+ }
5336
+ if (resolvedArguments.action) {
5337
+ console.log("[TRACE] Parsing action field, type:", typeof resolvedArguments.action);
5338
+ let actionParseCount = 0;
5339
+ const MAX_PARSE_DEPTH = 5;
5340
+ while (typeof resolvedArguments.action === "string" && actionParseCount < MAX_PARSE_DEPTH) {
5341
+ console.log(`[TRACE] Action field stringification layer ${actionParseCount + 1} detected, parsing...`);
5342
+ const beforeParse = resolvedArguments.action;
5343
+ resolvedArguments.action = safeJsonParse(resolvedArguments.action);
5344
+ actionParseCount++;
5345
+ if (resolvedArguments.action === beforeParse) {
5346
+ console.warn("[TRACE] Action parse produced no change, stopping to prevent infinite loop");
5347
+ break;
5348
+ }
5349
+ }
5350
+ console.log(`[TRACE] After ${actionParseCount} parse(s), action type:`, typeof resolvedArguments.action);
5351
+ }
5192
5352
  if (resolvedArguments.action && tools) resolvedArguments.action = validateAction(resolvedArguments.action, tools);
5353
+ console.log("[TRACE] Before case #5 check, resolvedArguments:", JSON.stringify(resolvedArguments));
5354
+ console.log("[TRACE] Case #5 check - has action?", !!resolvedArguments?.action);
5355
+ if (resolvedArguments.action && typeof resolvedArguments.action === "string") {
5356
+ console.log("[TRACE] AutoFixer: Action is string, trying to detect tool type");
5357
+ const actionStr = resolvedArguments.action;
5358
+ if (resolvedArguments.timeout && (actionStr.includes("刷新") || actionStr.includes("加载") || actionStr.includes("等待"))) {
5359
+ console.log("[TRACE] AutoFixer: Detected wait_for_condition pattern, fixing structure");
5360
+ resolvedArguments.action = { wait_for_condition: {
5361
+ prompt: actionStr,
5362
+ timeout: resolvedArguments.timeout
5363
+ } };
5364
+ delete resolvedArguments.timeout;
5365
+ }
5366
+ }
5193
5367
  if (!resolvedArguments.action) {
5194
5368
  log(`#5: fixing tool_call`);
5369
+ console.log("[TRACE] AutoFixer case #5 triggered - no action found, creating wait action");
5195
5370
  resolvedArguments.action = { wait: { seconds: 1 } };
5196
5371
  }
5197
5372
  return {
@@ -5246,8 +5421,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
5246
5421
  */
5247
5422
  function safeJsonParse(input) {
5248
5423
  if (typeof input === "string") try {
5249
- return JSON.parse(input.trim());
5250
- } catch {
5424
+ const parsed = JSON.parse(input.trim());
5425
+ console.log("[TRACE] safeJsonParse SUCCESS: string ->", typeof parsed);
5426
+ return parsed;
5427
+ } catch (error) {
5428
+ console.error("[TRACE] safeJsonParse FAILED:", error);
5429
+ console.error("[TRACE] Input string (first 200 chars):", input.substring(0, 200));
5251
5430
  return input;
5252
5431
  }
5253
5432
  return input;
@@ -8044,10 +8223,12 @@ IMPORTANT: If an assertion fails, immediately call the 'done' tool with success=
8044
8223
  const macroTool = { AgentOutput: this.#packMacroTool() };
8045
8224
  console.log(chalk.blue.bold("🧠 Thinking..."));
8046
8225
  this.#emitActivity({ type: "thinking" });
8226
+ console.log("[TRACE] Before LLM invoke, step:", step, "aborted:", this.#abortController.signal.aborted);
8047
8227
  const result = await this.#llm.invoke(messages, macroTool, this.#abortController.signal, {
8048
8228
  toolChoiceName: "AgentOutput",
8049
8229
  normalizeResponse: (res) => normalizeResponse(res, this.tools)
8050
8230
  });
8231
+ console.log("[TRACE] After LLM invoke success, actionName:", Object.keys(result.toolResult.input.action)[0]);
8051
8232
  const macroResult = result.toolResult;
8052
8233
  const input = macroResult.input;
8053
8234
  const output = macroResult.output;
@@ -8078,16 +8259,20 @@ IMPORTANT: If an assertion fails, immediately call the 'done' tool with success=
8078
8259
  const success = action.input?.success ?? false;
8079
8260
  const text = action.input?.text || "no text provided";
8080
8261
  console.log(chalk.green.bold("Task completed"), success, text);
8262
+ console.log("[TRACE] Done tool detected, calling #onDone");
8081
8263
  this.#onDone(success);
8082
8264
  const result = {
8083
8265
  success,
8084
8266
  data: text,
8085
8267
  history: this.history
8086
8268
  };
8269
+ console.log("[TRACE] Before calling onAfterTask");
8087
8270
  await onAfterTask?.(this, result);
8271
+ console.log("[TRACE] Before returning result from done handler");
8088
8272
  return result;
8089
8273
  }
8090
8274
  } catch (error) {
8275
+ console.log("[TRACE] ERROR caught in main loop, step:", step, "error:", error);
8091
8276
  console.groupEnd();
8092
8277
  const isAbortError = error?.rawError?.name === "AbortError";
8093
8278
  console.error("Task failed", error);
@@ -8154,6 +8339,7 @@ IMPORTANT: If an assertion fails, immediately call the 'done' tool with success=
8154
8339
  action: actionSchema
8155
8340
  }),
8156
8341
  execute: async (input) => {
8342
+ console.log("[TRACE] MacroTool execute called, actionName:", Object.keys(input.action)[0], "aborted:", this.#abortController.signal.aborted);
8157
8343
  if (this.#abortController.signal.aborted) throw new Error("AbortError");
8158
8344
  console.log(chalk.blue.bold("MacroTool input"), input);
8159
8345
  const action = input.action;
@@ -8340,10 +8526,13 @@ ${pageState}`
8340
8526
  }], queryTool, this.#abortController.signal, { toolChoiceName: "QueryOutput" })).toolResult.data;
8341
8527
  }
8342
8528
  #onDone(success = true) {
8529
+ console.log("[TRACE] #onDone called, success:", success, "aborted before:", this.#abortController.signal.aborted);
8343
8530
  this.pageController.cleanUpHighlights();
8344
8531
  this.pageController.hideMask();
8345
8532
  this.#setStatus(success ? "completed" : "error");
8533
+ console.log("[TRACE] Before aborting controller");
8346
8534
  this.#abortController.abort();
8535
+ console.log("[TRACE] After aborting controller, aborted:", this.#abortController.signal.aborted);
8347
8536
  }
8348
8537
  dispose() {
8349
8538
  console.log("Disposing PageAgent...");
@@ -10789,8 +10978,8 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
10789
10978
  //#region ../page-controller/src/mask/SimulatorMask.module.css
10790
10979
  var wrapper$1, visible, SimulatorMask_module_default;
10791
10980
  var init_SimulatorMask_module = __esmMin((() => {
10792
- wrapper$1 = "_wrapper_1ooyb_1";
10793
- visible = "_visible_1ooyb_11";
10981
+ wrapper$1 = "_wrapper_g3ap9_1";
10982
+ visible = "_visible_g3ap9_11";
10794
10983
  SimulatorMask_module_default = {
10795
10984
  wrapper: wrapper$1,
10796
10985
  visible
@@ -10800,18 +10989,18 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
10800
10989
  //#region ../page-controller/src/mask/cursor.module.css
10801
10990
  var cursor, cursorBorder, cursorFilling, cursorRipple, clicking, cursor_module_default;
10802
10991
  var init_cursor_module = __esmMin((() => {
10803
- cursor = "_cursor_1dgwb_2";
10804
- cursorBorder = "_cursorBorder_1dgwb_10";
10805
- cursorFilling = "_cursorFilling_1dgwb_25";
10806
- cursorRipple = "_cursorRipple_1dgwb_39";
10807
- clicking = "_clicking_1dgwb_57";
10992
+ cursor = "_cursor_15yuh_2";
10993
+ cursorBorder = "_cursorBorder_15yuh_10";
10994
+ cursorFilling = "_cursorFilling_15yuh_25";
10995
+ cursorRipple = "_cursorRipple_15yuh_39";
10996
+ clicking = "_clicking_15yuh_57";
10808
10997
  cursor_module_default = {
10809
10998
  cursor,
10810
10999
  cursorBorder,
10811
11000
  cursorFilling,
10812
11001
  cursorRipple,
10813
11002
  clicking,
10814
- "cursor-ripple": "_cursor-ripple_1dgwb_1"
11003
+ "cursor-ripple": "_cursor-ripple_15yuh_1"
10815
11004
  };
10816
11005
  }));
10817
11006
  //#endregion
@@ -12920,36 +13109,36 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
12920
13109
  lines.push("import { test, expect } from '@playwright/test'");
12921
13110
  lines.push("");
12922
13111
  lines.push("test('user recording', async ({ page }) => {");
12923
- lines.push(` // Navigate to starting page`);
12924
- lines.push(` await page.goto('${data.session.url}')`);
12925
- lines.push(` await page.waitForLoadState('networkidle')`);
13112
+ lines.push(` // Navigate to starting page`);
13113
+ lines.push(` await page.goto('${data.session.url}')`);
13114
+ lines.push(` await page.waitForLoadState('networkidle')`);
12926
13115
  lines.push("");
12927
- lines.push(` // Recorded actions (${data.session.eventCount} events)`);
13116
+ lines.push(` // Recorded actions (${data.session.eventCount} events)`);
12928
13117
  lines.push("");
12929
13118
  for (const event of data.events) switch (event.type) {
12930
13119
  case "navigation":
12931
13120
  if (event.url && event.url !== data.session.url) {
12932
- lines.push(` // Navigate to ${event.url}`);
12933
- lines.push(` await page.goto('${event.url}')`);
12934
- lines.push(` await page.waitForLoadState('networkidle')`);
13121
+ lines.push(` // Navigate to ${event.url}`);
13122
+ lines.push(` await page.goto('${event.url}')`);
13123
+ lines.push(` await page.waitForLoadState('networkidle')`);
12935
13124
  lines.push("");
12936
13125
  }
12937
13126
  break;
12938
13127
  case "click":
12939
13128
  if (event.elementInfo) {
12940
13129
  const selector = getBestSelector(event.elementInfo);
12941
- lines.push(` // Click: ${event.elementInfo.textContent || event.elementInfo.tagName}`);
12942
- lines.push(` await page.click('${selector}')`);
12943
- lines.push(` await page.waitForTimeout(100) // Wait for UI updates`);
13130
+ lines.push(` // Click: ${event.elementInfo.textContent || event.elementInfo.tagName}`);
13131
+ lines.push(` await page.click('${selector}')`);
13132
+ lines.push(` await page.waitForTimeout(100) // Wait for UI updates`);
12944
13133
  lines.push("");
12945
13134
  }
12946
13135
  break;
12947
13136
  case "input":
12948
13137
  if (event.elementInfo && event.value !== void 0) {
12949
13138
  const selector = getBestSelector(event.elementInfo);
12950
- lines.push(` // Input: ${event.elementInfo.tagName}`);
12951
- lines.push(` await page.fill('${selector}', '${event.value}')`);
12952
- lines.push(` await page.waitForTimeout(100) // Wait for input processing`);
13139
+ lines.push(` // Input: ${event.elementInfo.tagName}`);
13140
+ lines.push(` await page.fill('${selector}', '${event.value}')`);
13141
+ lines.push(` await page.waitForTimeout(100) // Wait for input processing`);
12953
13142
  lines.push("");
12954
13143
  }
12955
13144
  break;
@@ -12957,23 +13146,23 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
12957
13146
  if (event.metadata?.scrollAmount) {
12958
13147
  const amount = event.metadata.scrollAmount;
12959
13148
  const direction = event.metadata.scrollDirection || "down";
12960
- lines.push(` // Scroll ${direction} by ${amount}px`);
12961
- lines.push(` await page.evaluate(() => window.scrollBy(0, ${amount}))`);
12962
- lines.push(` await page.waitForTimeout(100) // Wait for scroll to complete`);
13149
+ lines.push(` // Scroll ${direction} by ${amount}px`);
13150
+ lines.push(` await page.evaluate(() => window.scrollBy(0, ${amount}))`);
13151
+ lines.push(` await page.waitForTimeout(100) // Wait for scroll to complete`);
12963
13152
  lines.push("");
12964
13153
  }
12965
13154
  break;
12966
13155
  case "keydown":
12967
13156
  if (event.metadata?.key) {
12968
- lines.push(` // Press key: ${event.metadata.key}`);
12969
- lines.push(` await page.keyboard.press('${event.metadata.key}')`);
12970
- lines.push(` await page.waitForTimeout(50)`);
13157
+ lines.push(` // Press key: ${event.metadata.key}`);
13158
+ lines.push(` await page.keyboard.press('${event.metadata.key}')`);
13159
+ lines.push(` await page.waitForTimeout(50)`);
12971
13160
  lines.push("");
12972
13161
  }
12973
13162
  break;
12974
13163
  }
12975
- lines.push(` // Test completed successfully`);
12976
- lines.push(` // Total events: ${data.session.eventCount}`);
13164
+ lines.push(` // Test completed successfully`);
13165
+ lines.push(` // Total events: ${data.session.eventCount}`);
12977
13166
  lines.push("})");
12978
13167
  return lines.join("\n");
12979
13168
  },
@@ -12986,29 +13175,29 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
12986
13175
  lines.push("import { test, expect } from '@playwright/test'");
12987
13176
  lines.push("");
12988
13177
  lines.push("test('user recording with retry', async ({ page }) => {");
12989
- lines.push(` await page.goto('${data.session.url}')`);
12990
- lines.push(` await page.waitForLoadState('networkidle')`);
13178
+ lines.push(` await page.goto('${data.session.url}')`);
13179
+ lines.push(` await page.waitForLoadState('networkidle')`);
12991
13180
  lines.push("");
12992
- lines.push(` // Configure retry logic`);
12993
- lines.push(` const maxRetries = 3`);
12994
- lines.push(` const retryDelay = 500`);
13181
+ lines.push(` // Configure retry logic`);
13182
+ lines.push(` const maxRetries = 3`);
13183
+ lines.push(` const retryDelay = 500`);
12995
13184
  lines.push("");
12996
13185
  for (const event of data.events) if (event.type === "click" && event.elementInfo) {
12997
13186
  const selector = getBestSelector(event.elementInfo);
12998
- lines.push(` // Click with retry`);
12999
- lines.push(` for (let attempt = 1; attempt <= maxRetries; attempt++) {`);
13000
- lines.push(` try {`);
13001
- lines.push(` await page.click('${selector}', { timeout: 5000 })`);
13002
- lines.push(` break // Success, exit retry loop`);
13003
- lines.push(` } catch (error) {`);
13004
- lines.push(` if (attempt === maxRetries) throw error`);
13005
- lines.push(` await page.waitForTimeout(retryDelay)`);
13006
- lines.push(` }`);
13007
- lines.push(` }`);
13187
+ lines.push(` // Click with retry`);
13188
+ lines.push(` for (let attempt = 1; attempt <= maxRetries; attempt++) {`);
13189
+ lines.push(` try {`);
13190
+ lines.push(` await page.click('${selector}', { timeout: 5000 })`);
13191
+ lines.push(` break // Success, exit retry loop`);
13192
+ lines.push(` } catch (error) {`);
13193
+ lines.push(` if (attempt === maxRetries) throw error`);
13194
+ lines.push(` await page.waitForTimeout(retryDelay)`);
13195
+ lines.push(` }`);
13196
+ lines.push(` }`);
13008
13197
  lines.push("");
13009
13198
  } else if (event.type === "input" && event.elementInfo && event.value !== void 0) {
13010
13199
  const selector = getBestSelector(event.elementInfo);
13011
- lines.push(` await page.fill('${selector}', '${event.value}')`);
13200
+ lines.push(` await page.fill('${selector}', '${event.value}')`);
13012
13201
  lines.push("");
13013
13202
  }
13014
13203
  lines.push("})");
@@ -13560,14 +13749,14 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
13560
13749
  this.overlayContainer = document.createElement("div");
13561
13750
  this.overlayContainer.id = "pageagent-feedback-overlay";
13562
13751
  this.overlayContainer.style.cssText = `
13563
- position: fixed;
13564
- top: 0;
13565
- left: 0;
13566
- width: 100%;
13567
- height: 100%;
13568
- pointer-events: none;
13569
- z-index: 999999;
13570
- `;
13752
+ position: fixed;
13753
+ top: 0;
13754
+ left: 0;
13755
+ width: 100%;
13756
+ height: 100%;
13757
+ pointer-events: none;
13758
+ z-index: 999999;
13759
+ `;
13571
13760
  document.body.appendChild(this.overlayContainer);
13572
13761
  if (this.config.showProgress) this.createProgressBar();
13573
13762
  if (this.config.showStatus) this.createStatusIndicator();
@@ -13578,15 +13767,15 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
13578
13767
  createProgressBar() {
13579
13768
  this.progressBar = document.createElement("div");
13580
13769
  this.progressBar.style.cssText = `
13581
- position: fixed;
13582
- top: 0;
13583
- left: 0;
13584
- height: 3px;
13585
- background: linear-gradient(90deg, #4CAF50, #8BC34A);
13586
- transition: width 0.3s ease;
13587
- z-index: 999999;
13588
- box-shadow: 0 2px 4px rgba(0,0,0,0.2);
13589
- `;
13770
+ position: fixed;
13771
+ top: 0;
13772
+ left: 0;
13773
+ height: 3px;
13774
+ background: linear-gradient(90deg, #4CAF50, #8BC34A);
13775
+ transition: width 0.3s ease;
13776
+ z-index: 999999;
13777
+ box-shadow: 0 2px 4px rgba(0,0,0,0.2);
13778
+ `;
13590
13779
  this.progressBar.style.width = "0%";
13591
13780
  this.overlayContainer.appendChild(this.progressBar);
13592
13781
  }
@@ -13596,19 +13785,19 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
13596
13785
  createStatusIndicator() {
13597
13786
  this.statusIndicator = document.createElement("div");
13598
13787
  this.statusIndicator.style.cssText = `
13599
- position: fixed;
13600
- bottom: 20px;
13601
- right: 20px;
13602
- background: rgba(0, 0, 0, 0.8);
13603
- color: white;
13604
- padding: 10px 15px;
13605
- border-radius: 5px;
13606
- font-family: monospace;
13607
- font-size: 12px;
13608
- z-index: 999999;
13609
- box-shadow: 0 2px 8px rgba(0,0,0,0.3);
13610
- transition: all 0.3s ease;
13611
- `;
13788
+ position: fixed;
13789
+ bottom: 20px;
13790
+ right: 20px;
13791
+ background: rgba(0, 0, 0, 0.8);
13792
+ color: white;
13793
+ padding: 10px 15px;
13794
+ border-radius: 5px;
13795
+ font-family: monospace;
13796
+ font-size: 12px;
13797
+ z-index: 999999;
13798
+ box-shadow: 0 2px 8px rgba(0,0,0,0.3);
13799
+ transition: all 0.3s ease;
13800
+ `;
13612
13801
  this.statusIndicator.textContent = "Ready";
13613
13802
  this.overlayContainer.appendChild(this.statusIndicator);
13614
13803
  }
@@ -13621,19 +13810,19 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
13621
13810
  const highlight = document.createElement("div");
13622
13811
  const color = this.getColorForStatus(status);
13623
13812
  highlight.style.cssText = `
13624
- position: absolute;
13625
- left: ${rect.left}px;
13626
- top: ${rect.top}px;
13627
- width: ${rect.width}px;
13628
- height: ${rect.height}px;
13629
- border: 3px solid ${color};
13630
- background: ${color}22;
13631
- box-shadow: 0 0 10px ${color};
13632
- border-radius: 4px;
13633
- pointer-events: none;
13634
- animation: pulse 0.5s ease-in-out;
13635
- transition: all 0.3s ease;
13636
- `;
13813
+ position: absolute;
13814
+ left: ${rect.left}px;
13815
+ top: ${rect.top}px;
13816
+ width: ${rect.width}px;
13817
+ height: ${rect.height}px;
13818
+ border: 3px solid ${color};
13819
+ background: ${color}22;
13820
+ box-shadow: 0 0 10px ${color};
13821
+ border-radius: 4px;
13822
+ pointer-events: none;
13823
+ animation: pulse 0.5s ease-in-out;
13824
+ transition: all 0.3s ease;
13825
+ `;
13637
13826
  this.overlayContainer.appendChild(highlight);
13638
13827
  setTimeout(() => {
13639
13828
  highlight.style.opacity = "0";
@@ -13702,11 +13891,11 @@ gl_Position = vec4(aPosition, 0.0, 1.0);
13702
13891
  const style = document.createElement("style");
13703
13892
  style.id = "pageagent-feedback-styles";
13704
13893
  style.textContent = `
13705
- @keyframes pulse {
13706
- 0%, 100% { opacity: 0.6; transform: scale(1); }
13707
- 50% { opacity: 1; transform: scale(1.02); }
13708
- }
13709
- `;
13894
+ @keyframes pulse {
13895
+ 0%, 100% { opacity: 0.6; transform: scale(1); }
13896
+ 50% { opacity: 1; transform: scale(1.02); }
13897
+ }
13898
+ `;
13710
13899
  document.head.appendChild(style);
13711
13900
  }
13712
13901
  };
@@ -14147,34 +14336,34 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14147
14336
  const style = document.createElement("style");
14148
14337
  style.id = styleId;
14149
14338
  style.textContent = `
14150
- @keyframes replay-pulse {
14151
- 0%, 100% {
14152
- opacity: 1;
14153
- transform: scale(1);
14154
- }
14155
- 50% {
14156
- opacity: 0.8;
14157
- transform: scale(1.02);
14158
- }
14159
- }
14339
+ @keyframes replay-pulse {
14340
+ 0%, 100% {
14341
+ opacity: 1;
14342
+ transform: scale(1);
14343
+ }
14344
+ 50% {
14345
+ opacity: 0.8;
14346
+ transform: scale(1.02);
14347
+ }
14348
+ }
14160
14349
 
14161
- @keyframes replay-error {
14162
- 0%, 100% {
14163
- opacity: 1;
14164
- }
14165
- 50% {
14166
- opacity: 0.5;
14167
- }
14168
- }
14350
+ @keyframes replay-error {
14351
+ 0%, 100% {
14352
+ opacity: 1;
14353
+ }
14354
+ 50% {
14355
+ opacity: 0.5;
14356
+ }
14357
+ }
14169
14358
 
14170
- .replay-highlight {
14171
- animation: replay-pulse 1s infinite;
14172
- }
14359
+ .replay-highlight {
14360
+ animation: replay-pulse 1s infinite;
14361
+ }
14173
14362
 
14174
- .replay-highlight-error {
14175
- animation: replay-error 0.5s ease-in-out 3;
14176
- }
14177
- `;
14363
+ .replay-highlight-error {
14364
+ animation: replay-error 0.5s ease-in-out 3;
14365
+ }
14366
+ `;
14178
14367
  document.head.appendChild(style);
14179
14368
  }
14180
14369
  /**
@@ -14258,18 +14447,18 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14258
14447
  const box = document.createElement("div");
14259
14448
  box.className = "replay-highlight";
14260
14449
  box.style.cssText = `
14261
- position: fixed;
14262
- left: ${rect.left}px;
14263
- top: ${rect.top}px;
14264
- width: ${rect.width}px;
14265
- height: ${rect.height}px;
14266
- border: ${this.config.borderWidth}px solid ${this.config.highlightColor};
14267
- border-radius: 4px;
14268
- box-shadow: 0 0 20px ${this.config.highlightColor}80;
14269
- pointer-events: none;
14270
- z-index: ${this.config.zIndex};
14271
- animation: replay-pulse ${this.config.animationDuration}ms infinite;
14272
- `;
14450
+ position: fixed;
14451
+ left: ${rect.left}px;
14452
+ top: ${rect.top}px;
14453
+ width: ${rect.width}px;
14454
+ height: ${rect.height}px;
14455
+ border: ${this.config.borderWidth}px solid ${this.config.highlightColor};
14456
+ border-radius: 4px;
14457
+ box-shadow: 0 0 20px ${this.config.highlightColor}80;
14458
+ pointer-events: none;
14459
+ z-index: ${this.config.zIndex};
14460
+ animation: replay-pulse ${this.config.animationDuration}ms infinite;
14461
+ `;
14273
14462
  if (this.config.showBadge) {
14274
14463
  const badge = this.#createBadge(action, rect);
14275
14464
  box.appendChild(badge);
@@ -14284,18 +14473,18 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14284
14473
  const box = document.createElement("div");
14285
14474
  box.className = "replay-highlight";
14286
14475
  box.style.cssText = `
14287
- position: fixed;
14288
- left: ${rect.x}px;
14289
- top: ${rect.y}px;
14290
- width: ${rect.width}px;
14291
- height: ${rect.height}px;
14292
- border: ${this.config.borderWidth}px solid ${this.config.highlightColor};
14293
- border-radius: 4px;
14294
- box-shadow: 0 0 20px ${this.config.highlightColor}80;
14295
- pointer-events: none;
14296
- z-index: ${this.config.zIndex};
14297
- animation: replay-pulse ${this.config.animationDuration}ms infinite;
14298
- `;
14476
+ position: fixed;
14477
+ left: ${rect.x}px;
14478
+ top: ${rect.y}px;
14479
+ width: ${rect.width}px;
14480
+ height: ${rect.height}px;
14481
+ border: ${this.config.borderWidth}px solid ${this.config.highlightColor};
14482
+ border-radius: 4px;
14483
+ box-shadow: 0 0 20px ${this.config.highlightColor}80;
14484
+ pointer-events: none;
14485
+ z-index: ${this.config.zIndex};
14486
+ animation: replay-pulse ${this.config.animationDuration}ms infinite;
14487
+ `;
14299
14488
  if (this.config.showBadge) {
14300
14489
  const badge = this.#createBadge(action, rect);
14301
14490
  box.appendChild(badge);
@@ -14310,31 +14499,31 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14310
14499
  const box = document.createElement("div");
14311
14500
  box.className = "replay-highlight-error";
14312
14501
  box.style.cssText = `
14313
- position: fixed;
14314
- left: ${rect.left - 5}px;
14315
- top: ${rect.top - 5}px;
14316
- width: ${rect.width + 10}px;
14317
- height: ${rect.height + 10}px;
14318
- border: 3px solid #ef4444;
14319
- border-radius: 4px;
14320
- box-shadow: 0 0 20px #ef444480;
14321
- pointer-events: none;
14322
- z-index: ${this.config.zIndex};
14323
- animation: replay-error 0.5s ease-in-out 3;
14324
- `;
14502
+ position: fixed;
14503
+ left: ${rect.left - 5}px;
14504
+ top: ${rect.top - 5}px;
14505
+ width: ${rect.width + 10}px;
14506
+ height: ${rect.height + 10}px;
14507
+ border: 3px solid #ef4444;
14508
+ border-radius: 4px;
14509
+ box-shadow: 0 0 20px #ef444480;
14510
+ pointer-events: none;
14511
+ z-index: ${this.config.zIndex};
14512
+ animation: replay-error 0.5s ease-in-out 3;
14513
+ `;
14325
14514
  const tooltip = document.createElement("div");
14326
14515
  tooltip.style.cssText = `
14327
- position: absolute;
14328
- bottom: 100%;
14329
- left: 0;
14330
- background: #ef4444;
14331
- color: white;
14332
- padding: 8px 12px;
14333
- border-radius: 4px;
14334
- font-size: 12px;
14335
- white-space: nowrap;
14336
- margin-bottom: 8px;
14337
- `;
14516
+ position: absolute;
14517
+ bottom: 100%;
14518
+ left: 0;
14519
+ background: #ef4444;
14520
+ color: white;
14521
+ padding: 8px 12px;
14522
+ border-radius: 4px;
14523
+ font-size: 12px;
14524
+ white-space: nowrap;
14525
+ margin-bottom: 8px;
14526
+ `;
14338
14527
  tooltip.textContent = message;
14339
14528
  box.appendChild(tooltip);
14340
14529
  return box;
@@ -14347,18 +14536,18 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14347
14536
  badge.className = "replay-action-badge";
14348
14537
  badge.textContent = this.#getActionLabel(action);
14349
14538
  badge.style.cssText = `
14350
- position: absolute;
14351
- top: -28px;
14352
- left: 0;
14353
- background: ${this.config.highlightColor};
14354
- color: white;
14355
- padding: 4px 8px;
14356
- border-radius: 4px;
14357
- font-size: 12px;
14358
- font-weight: 600;
14359
- white-space: nowrap;
14360
- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
14361
- `;
14539
+ position: absolute;
14540
+ top: -28px;
14541
+ left: 0;
14542
+ background: ${this.config.highlightColor};
14543
+ color: white;
14544
+ padding: 4px 8px;
14545
+ border-radius: 4px;
14546
+ font-size: 12px;
14547
+ font-weight: 600;
14548
+ white-space: nowrap;
14549
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
14550
+ `;
14362
14551
  return badge;
14363
14552
  }
14364
14553
  /**
@@ -14588,64 +14777,64 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14588
14777
  }
14589
14778
  //#endregion
14590
14779
  //#region ../ui/src/panel/Panel.module.css
14591
- var wrapper = "_wrapper_1oczf_1";
14592
- var background = "_background_1oczf_39";
14593
- var header = "_header_1oczf_99";
14594
- var pulse$1 = "_pulse_1oczf_1";
14595
- var retryPulse = "_retryPulse_1oczf_1";
14596
- var statusTextFadeOut = "_statusTextFadeOut_1oczf_1";
14597
- var statusTextFadeIn = "_statusTextFadeIn_1oczf_1";
14598
- var recordingPulse$1 = "_recordingPulse_1oczf_1";
14599
- var statusSection = "_statusSection_1oczf_121";
14600
- var indicator = "_indicator_1oczf_128";
14601
- var thinking = "_thinking_1oczf_137";
14602
- var tool_executing = "_tool_executing_1oczf_142";
14603
- var retry = "_retry_1oczf_147";
14604
- var completed = "_completed_1oczf_153";
14605
- var input = "_input_1oczf_154";
14606
- var output = "_output_1oczf_155";
14607
- var error = "_error_1oczf_160";
14608
- var statusText = "_statusText_1oczf_166";
14609
- var fadeOut = "_fadeOut_1oczf_178";
14610
- var fadeIn = "_fadeIn_1oczf_182";
14611
- var controls$1 = "_controls_1oczf_188";
14612
- var controlButton$1 = "_controlButton_1oczf_193";
14613
- var recordingButton$1 = "_recordingButton_1oczf_212";
14614
- var recording$1 = "_recording_1oczf_212";
14615
- var eventCounter$1 = "_eventCounter_1oczf_222";
14616
- var stopButton = "_stopButton_1oczf_230";
14617
- var historySectionWrapper = "_historySectionWrapper_1oczf_264";
14618
- var shimmer = "_shimmer_1oczf_1";
14619
- var celebrate = "_celebrate_1oczf_1";
14620
- var expanded = "_expanded_1oczf_296";
14621
- var historySection = "_historySection_1oczf_264";
14622
- var historyItem = "_historyItem_1oczf_315";
14623
- var observation = "_observation_1oczf_373";
14624
- var question = "_question_1oczf_378";
14625
- var doneSuccess = "_doneSuccess_1oczf_384";
14626
- var historyContent = "_historyContent_1oczf_420";
14627
- var statusIcon = "_statusIcon_1oczf_421";
14628
- var doneError = "_doneError_1oczf_430";
14629
- var reflectionLines = "_reflectionLines_1oczf_480";
14630
- var historyMeta = "_historyMeta_1oczf_487";
14631
- var inputSectionWrapper = "_inputSectionWrapper_1oczf_557";
14632
- var hidden = "_hidden_1oczf_580";
14633
- var inputSection = "_inputSection_1oczf_557";
14634
- var taskInput = "_taskInput_1oczf_591";
14635
- var exportOverlay$1 = "_exportOverlay_1oczf_634";
14636
- var overlayFadeIn$1 = "_overlayFadeIn_1oczf_1";
14637
- var exportDialog$1 = "_exportDialog_1oczf_655";
14638
- var dialogSlideIn$1 = "_dialogSlideIn_1oczf_1";
14639
- var exportDialogHeader$1 = "_exportDialogHeader_1oczf_677";
14640
- var closeButton$1 = "_closeButton_1oczf_691";
14641
- var exportDialogContent$1 = "_exportDialogContent_1oczf_713";
14642
- var exportOptions$1 = "_exportOptions_1oczf_723";
14643
- var exportOptionButton$1 = "_exportOptionButton_1oczf_729";
14644
- var exportOptionIcon$1 = "_exportOptionIcon_1oczf_752";
14645
- var exportOptionLabel$1 = "_exportOptionLabel_1oczf_757";
14780
+ var wrapper = "_wrapper_dinc2_1";
14781
+ var background = "_background_dinc2_39";
14782
+ var header = "_header_dinc2_99";
14783
+ var pulse$1 = "_pulse_dinc2_1";
14784
+ var retryPulse = "_retryPulse_dinc2_1";
14785
+ var statusTextFadeOut = "_statusTextFadeOut_dinc2_1";
14786
+ var statusTextFadeIn = "_statusTextFadeIn_dinc2_1";
14787
+ var recordingPulse$1 = "_recordingPulse_dinc2_1";
14788
+ var statusSection = "_statusSection_dinc2_121";
14789
+ var indicator = "_indicator_dinc2_128";
14790
+ var thinking = "_thinking_dinc2_137";
14791
+ var tool_executing = "_tool_executing_dinc2_142";
14792
+ var retry = "_retry_dinc2_147";
14793
+ var completed = "_completed_dinc2_153";
14794
+ var input = "_input_dinc2_154";
14795
+ var output = "_output_dinc2_155";
14796
+ var error = "_error_dinc2_160";
14797
+ var statusText = "_statusText_dinc2_166";
14798
+ var fadeOut = "_fadeOut_dinc2_178";
14799
+ var fadeIn = "_fadeIn_dinc2_182";
14800
+ var controls$1 = "_controls_dinc2_188";
14801
+ var controlButton$1 = "_controlButton_dinc2_193";
14802
+ var recordingButton$1 = "_recordingButton_dinc2_212";
14803
+ var recording$1 = "_recording_dinc2_212";
14804
+ var eventCounter$1 = "_eventCounter_dinc2_222";
14805
+ var stopButton = "_stopButton_dinc2_230";
14806
+ var historySectionWrapper = "_historySectionWrapper_dinc2_264";
14807
+ var shimmer = "_shimmer_dinc2_1";
14808
+ var celebrate = "_celebrate_dinc2_1";
14809
+ var expanded = "_expanded_dinc2_296";
14810
+ var historySection = "_historySection_dinc2_264";
14811
+ var historyItem = "_historyItem_dinc2_315";
14812
+ var observation = "_observation_dinc2_373";
14813
+ var question = "_question_dinc2_378";
14814
+ var doneSuccess = "_doneSuccess_dinc2_384";
14815
+ var historyContent = "_historyContent_dinc2_420";
14816
+ var statusIcon = "_statusIcon_dinc2_421";
14817
+ var doneError = "_doneError_dinc2_430";
14818
+ var reflectionLines = "_reflectionLines_dinc2_480";
14819
+ var historyMeta = "_historyMeta_dinc2_487";
14820
+ var inputSectionWrapper = "_inputSectionWrapper_dinc2_557";
14821
+ var hidden = "_hidden_dinc2_580";
14822
+ var inputSection = "_inputSection_dinc2_557";
14823
+ var taskInput = "_taskInput_dinc2_591";
14824
+ var exportOverlay$1 = "_exportOverlay_dinc2_634";
14825
+ var overlayFadeIn$1 = "_overlayFadeIn_dinc2_1";
14826
+ var exportDialog$1 = "_exportDialog_dinc2_655";
14827
+ var dialogSlideIn$1 = "_dialogSlideIn_dinc2_1";
14828
+ var exportDialogHeader$1 = "_exportDialogHeader_dinc2_677";
14829
+ var closeButton$1 = "_closeButton_dinc2_691";
14830
+ var exportDialogContent$1 = "_exportDialogContent_dinc2_713";
14831
+ var exportOptions$1 = "_exportOptions_dinc2_723";
14832
+ var exportOptionButton$1 = "_exportOptionButton_dinc2_729";
14833
+ var exportOptionIcon$1 = "_exportOptionIcon_dinc2_752";
14834
+ var exportOptionLabel$1 = "_exportOptionLabel_dinc2_757";
14646
14835
  var Panel_module_default = {
14647
14836
  wrapper,
14648
- "mask-running": "_mask-running_1oczf_1",
14837
+ "mask-running": "_mask-running_dinc2_1",
14649
14838
  background,
14650
14839
  header,
14651
14840
  pulse: pulse$1,
@@ -14711,14 +14900,14 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14711
14900
  const typeClass = type ? Panel_module_default[type] : "";
14712
14901
  const contentHtml = Array.isArray(content) ? `<div class="${Panel_module_default.reflectionLines}">${content.map((line) => `<span>${escapeHtml(line)}</span>`).join("")}</div>` : `<span>${escapeHtml(content)}</span>`;
14713
14902
  return `
14714
- <div class="${Panel_module_default.historyItem} ${typeClass}">
14715
- <div class="${Panel_module_default.historyContent}">
14716
- <span class="${Panel_module_default.statusIcon}">${icon}</span>
14717
- ${contentHtml}
14718
- </div>
14719
- ${meta ? `<div class="${Panel_module_default.historyMeta}">${meta}</div>` : ""}
14720
- </div>
14721
- `;
14903
+ <div class="${Panel_module_default.historyItem} ${typeClass}">
14904
+ <div class="${Panel_module_default.historyContent}">
14905
+ <span class="${Panel_module_default.statusIcon}">${icon}</span>
14906
+ ${contentHtml}
14907
+ </div>
14908
+ ${meta ? `<div class="${Panel_module_default.historyMeta}">${meta}</div>` : ""}
14909
+ </div>
14910
+ `;
14722
14911
  }
14723
14912
  /** Create reflection lines from reflection object */
14724
14913
  function createReflectionLines(reflection) {
@@ -14729,6 +14918,173 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14729
14918
  return lines;
14730
14919
  }
14731
14920
  //#endregion
14921
+ //#region ../ui/src/panel/drag.module.css
14922
+ var draggable = "_draggable_15flz_1";
14923
+ var dragHandle = "_dragHandle_15flz_16";
14924
+ var drag_module_default = {
14925
+ draggable,
14926
+ "is-dragging": "_is-dragging_15flz_8",
14927
+ dragHandle
14928
+ };
14929
+ //#endregion
14930
+ //#region ../ui/src/panel/drag.ts
14931
+ var Draggable = class {
14932
+ element;
14933
+ dragHandle;
14934
+ storageKey;
14935
+ onClick;
14936
+ isDragging = false;
14937
+ dragOffset = {
14938
+ x: 0,
14939
+ y: 0
14940
+ };
14941
+ position = {
14942
+ x: 0,
14943
+ y: 0
14944
+ };
14945
+ hasCustomPosition = false;
14946
+ dragStartPos = {
14947
+ x: 0,
14948
+ y: 0
14949
+ };
14950
+ dragDistance = 0;
14951
+ boundHandlers = {
14952
+ pointerDown: this.handlePointerDown.bind(this),
14953
+ pointerMove: this.handlePointerMove.bind(this),
14954
+ pointerUp: this.handlePointerUp.bind(this),
14955
+ pointerCancel: this.handlePointerUp.bind(this)
14956
+ };
14957
+ constructor(config) {
14958
+ this.element = config.element;
14959
+ this.dragHandle = config.dragHandle;
14960
+ this.storageKey = config.storageKey ?? "draggable-position";
14961
+ this.onClick = config.onClick;
14962
+ this.init();
14963
+ }
14964
+ init() {
14965
+ this.applyStyles();
14966
+ this.loadPosition();
14967
+ this.setupEventListeners();
14968
+ }
14969
+ applyStyles() {
14970
+ this.element.classList.add(drag_module_default.draggable);
14971
+ this.dragHandle.classList.add(drag_module_default.dragHandle);
14972
+ }
14973
+ setupEventListeners() {
14974
+ this.dragHandle.addEventListener("pointerdown", this.boundHandlers.pointerDown, { capture: true });
14975
+ }
14976
+ handlePointerDown(e) {
14977
+ if (e.button !== 0 && e.pointerType !== "touch") return;
14978
+ const target = e.target;
14979
+ if (target.closest("button")) return;
14980
+ e.preventDefault();
14981
+ e.stopPropagation();
14982
+ this.isDragging = true;
14983
+ const rect = this.element.getBoundingClientRect();
14984
+ this.dragOffset = {
14985
+ x: e.clientX - rect.left,
14986
+ y: e.clientY - rect.top
14987
+ };
14988
+ this.dragStartPos = {
14989
+ x: e.clientX,
14990
+ y: e.clientY
14991
+ };
14992
+ this.dragDistance = 0;
14993
+ target.setPointerCapture(e.pointerId);
14994
+ this.element.classList.add(drag_module_default.isDragging);
14995
+ this.dragHandle.classList.add(drag_module_default.isDragging);
14996
+ document.addEventListener("pointermove", this.boundHandlers.pointerMove);
14997
+ document.addEventListener("pointerup", this.boundHandlers.pointerUp);
14998
+ document.addEventListener("pointercancel", this.boundHandlers.pointerCancel);
14999
+ }
15000
+ handlePointerMove(e) {
15001
+ if (!this.isDragging) return;
15002
+ e.preventDefault();
15003
+ const dx = e.clientX - this.dragStartPos.x;
15004
+ const dy = e.clientY - this.dragStartPos.y;
15005
+ this.dragDistance = Math.sqrt(dx * dx + dy * dy);
15006
+ let newX = e.clientX - this.dragOffset.x;
15007
+ let newY = e.clientY - this.dragOffset.y;
15008
+ const rect = this.element.getBoundingClientRect();
15009
+ const viewport = {
15010
+ width: window.innerWidth,
15011
+ height: window.innerHeight
15012
+ };
15013
+ newX = Math.max(0, Math.min(newX, viewport.width - rect.width));
15014
+ newY = Math.max(0, Math.min(newY, viewport.height - rect.height));
15015
+ this.position = {
15016
+ x: newX,
15017
+ y: newY
15018
+ };
15019
+ this.applyPosition();
15020
+ }
15021
+ handlePointerUp(e) {
15022
+ if (!this.isDragging) return;
15023
+ this.isDragging = false;
15024
+ this.hasCustomPosition = true;
15025
+ e.target.releasePointerCapture(e.pointerId);
15026
+ this.element.classList.remove(drag_module_default.isDragging);
15027
+ this.dragHandle.classList.remove(drag_module_default.isDragging);
15028
+ document.removeEventListener("pointermove", this.boundHandlers.pointerMove);
15029
+ document.removeEventListener("pointerup", this.boundHandlers.pointerUp);
15030
+ document.removeEventListener("pointercancel", this.boundHandlers.pointerCancel);
15031
+ if (this.dragDistance < 5) this.onClick?.();
15032
+ else this.savePosition();
15033
+ }
15034
+ applyPosition() {
15035
+ if (this.hasCustomPosition) {
15036
+ this.element.style.left = `${this.position.x}px`;
15037
+ this.element.style.top = `${this.position.y}px`;
15038
+ this.element.style.bottom = "auto";
15039
+ this.element.style.transform = "none";
15040
+ }
15041
+ }
15042
+ savePosition() {
15043
+ try {
15044
+ localStorage.setItem(this.storageKey, JSON.stringify({
15045
+ x: this.position.x,
15046
+ y: this.position.y,
15047
+ viewport: {
15048
+ width: window.innerWidth,
15049
+ height: window.innerHeight
15050
+ }
15051
+ }));
15052
+ } catch {}
15053
+ }
15054
+ loadPosition() {
15055
+ try {
15056
+ const saved = localStorage.getItem(this.storageKey);
15057
+ if (!saved) return;
15058
+ const data = JSON.parse(saved);
15059
+ if (!data || typeof data.x !== "number" || typeof data.y !== "number") return;
15060
+ if (data.viewport) {
15061
+ const scaleX = window.innerWidth / data.viewport.width;
15062
+ const scaleY = window.innerHeight / data.viewport.height;
15063
+ if (scaleX > .5 && scaleX < 2 && scaleY > .5 && scaleY < 2) {
15064
+ data.x *= scaleX;
15065
+ data.y *= scaleY;
15066
+ }
15067
+ }
15068
+ if (data.x >= 0 && data.x <= window.innerWidth - 360 && data.y >= 0 && data.y <= window.innerHeight - 40) {
15069
+ this.position = {
15070
+ x: data.x,
15071
+ y: data.y
15072
+ };
15073
+ this.hasCustomPosition = true;
15074
+ this.applyPosition();
15075
+ }
15076
+ } catch {}
15077
+ }
15078
+ dispose() {
15079
+ this.dragHandle.removeEventListener("pointerdown", this.boundHandlers.pointerDown, { capture: true });
15080
+ document.removeEventListener("pointermove", this.boundHandlers.pointerMove);
15081
+ document.removeEventListener("pointerup", this.boundHandlers.pointerUp);
15082
+ document.removeEventListener("pointercancel", this.boundHandlers.pointerCancel);
15083
+ this.element.classList.remove(drag_module_default.draggable, drag_module_default.isDragging);
15084
+ this.dragHandle.classList.remove(drag_module_default.dragHandle, drag_module_default.isDragging);
15085
+ }
15086
+ };
15087
+ //#endregion
14732
15088
  //#region ../ui/src/panel/Panel.ts
14733
15089
  /**
14734
15090
  * Agent control panel
@@ -14758,6 +15114,7 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14758
15114
  #headerUpdateTimer = null;
14759
15115
  #pendingHeaderText = null;
14760
15116
  #isAnimating = false;
15117
+ #draggable = null;
14761
15118
  #onStatusChange = () => this.#handleStatusChange();
14762
15119
  #onHistoryChange = () => this.#handleHistoryChange();
14763
15120
  #onActivity = (e) => this.#handleActivity(e.detail);
@@ -14789,6 +15146,12 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14789
15146
  this.#agent.addEventListener("dispose", this.#onAgentDispose);
14790
15147
  this.#setupEventListeners();
14791
15148
  this.#startHeaderUpdateLoop();
15149
+ this.#draggable = new Draggable({
15150
+ element: this.wrapper,
15151
+ dragHandle: this.wrapper.querySelector(`.${Panel_module_default.header}`),
15152
+ storageKey: "page-agent-panel-position",
15153
+ onClick: () => this.#toggle()
15154
+ });
14792
15155
  this.#showInputArea();
14793
15156
  this.hide();
14794
15157
  }
@@ -14901,6 +15264,7 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14901
15264
  this.#agent.removeEventListener("dispose", this.#onAgentDispose);
14902
15265
  this.#isWaitingForUserAnswer = false;
14903
15266
  this.#stopHeaderUpdateLoop();
15267
+ this.#draggable?.dispose();
14904
15268
  this.wrapper.remove();
14905
15269
  }
14906
15270
  #getToolExecutingText(toolName, args) {
@@ -14981,41 +15345,41 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
14981
15345
  wrapper.setAttribute("data-browser-use-ignore", "true");
14982
15346
  wrapper.setAttribute("data-page-agent-ignore", "true");
14983
15347
  wrapper.innerHTML = `
14984
- <div class="${Panel_module_default.background}"></div>
14985
- <div class="${Panel_module_default.historySectionWrapper}">
14986
- <div class="${Panel_module_default.historySection}">
14987
- <div class="${Panel_module_default.historyItem}">
14988
- <div class="${Panel_module_default.historyContent}">
14989
- <span class="${Panel_module_default.statusIcon}">🧠</span>
14990
- <span>${this.#i18n.t("ui.panel.waitingPlaceholder")}</span>
14991
- </div>
14992
- </div>
14993
- </div>
14994
- </div>
14995
- <div class="${Panel_module_default.header}">
14996
- <div class="${Panel_module_default.statusSection}">
14997
- <div class="${Panel_module_default.indicator} ${Panel_module_default.thinking}"></div>
14998
- <div class="${Panel_module_default.statusText}">${this.#i18n.t("ui.panel.ready")}</div>
14999
- </div>
15000
- <div class="${Panel_module_default.controls}">
15001
- <button class="${Panel_module_default.controlButton} ${Panel_module_default.expandButton}" title="${this.#i18n.t("ui.panel.expand")}">
15002
-
15003
- </button>
15004
- <button class="${Panel_module_default.controlButton} ${Panel_module_default.stopButton}" title="${this.#i18n.t("ui.panel.close")}">
15005
- X
15006
- </button>
15007
- </div>
15008
- </div>
15009
- <div class="${Panel_module_default.inputSectionWrapper} ${Panel_module_default.hidden}">
15010
- <div class="${Panel_module_default.inputSection}">
15011
- <input
15012
- type="text"
15013
- class="${Panel_module_default.taskInput}"
15014
- maxlength="${taskInputMaxLength}"
15015
- />
15016
- </div>
15017
- </div>
15018
- `;
15348
+ <div class="${Panel_module_default.background}"></div>
15349
+ <div class="${Panel_module_default.historySectionWrapper}">
15350
+ <div class="${Panel_module_default.historySection}">
15351
+ <div class="${Panel_module_default.historyItem}">
15352
+ <div class="${Panel_module_default.historyContent}">
15353
+ <span class="${Panel_module_default.statusIcon}">🧠</span>
15354
+ <span>${this.#i18n.t("ui.panel.waitingPlaceholder")}</span>
15355
+ </div>
15356
+ </div>
15357
+ </div>
15358
+ </div>
15359
+ <div class="${Panel_module_default.header}">
15360
+ <div class="${Panel_module_default.statusSection}">
15361
+ <div class="${Panel_module_default.indicator} ${Panel_module_default.thinking}"></div>
15362
+ <div class="${Panel_module_default.statusText}">${this.#i18n.t("ui.panel.ready")}</div>
15363
+ </div>
15364
+ <div class="${Panel_module_default.controls}">
15365
+ <button class="${Panel_module_default.controlButton} ${Panel_module_default.expandButton}" title="${this.#i18n.t("ui.panel.expand")}">
15366
+
15367
+ </button>
15368
+ <button class="${Panel_module_default.controlButton} ${Panel_module_default.stopButton}" title="${this.#i18n.t("ui.panel.close")}">
15369
+ X
15370
+ </button>
15371
+ </div>
15372
+ </div>
15373
+ <div class="${Panel_module_default.inputSectionWrapper} ${Panel_module_default.hidden}">
15374
+ <div class="${Panel_module_default.inputSection}">
15375
+ <input
15376
+ type="text"
15377
+ class="${Panel_module_default.taskInput}"
15378
+ maxlength="${taskInputMaxLength}"
15379
+ />
15380
+ </div>
15381
+ </div>
15382
+ `;
15019
15383
  document.body.appendChild(wrapper);
15020
15384
  return wrapper;
15021
15385
  }
@@ -15226,88 +15590,100 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15226
15590
  //#endregion
15227
15591
  //#region src/RecordingPanel.module.css
15228
15592
  init_src();
15229
- var recordingButton = "_recordingButton_1yqua_4";
15230
- var eventCounter = "_eventCounter_1yqua_11";
15231
- var exportOverlay = "_exportOverlay_1yqua_31";
15232
- var overlayFadeIn = "_overlayFadeIn_1yqua_1";
15233
- var exportDialog = "_exportDialog_1yqua_52";
15234
- var dialogSlideIn = "_dialogSlideIn_1yqua_1";
15235
- var exportDialogHeader = "_exportDialogHeader_1yqua_74";
15236
- var closeButton = "_closeButton_1yqua_89";
15237
- var exportDialogContent = "_exportDialogContent_1yqua_110";
15238
- var exportOptions = "_exportOptions_1yqua_120";
15239
- var exportOptionButton = "_exportOptionButton_1yqua_126";
15240
- var exportOptionIcon = "_exportOptionIcon_1yqua_147";
15241
- var exportOptionLabel = "_exportOptionLabel_1yqua_152";
15242
- var controlButton = "_controlButton_1yqua_159";
15243
- var controls = "_controls_1yqua_179";
15244
- var recording = "_recording_1yqua_4";
15245
- var recordingPulse = "_recordingPulse_1yqua_1";
15246
- var taskCard = "_taskCard_1yqua_193";
15247
- var taskCardHeader = "_taskCardHeader_1yqua_209";
15248
- var taskIcon = "_taskIcon_1yqua_216";
15249
- var taskName = "_taskName_1yqua_220";
15250
- var confidenceBadge = "_confidenceBadge_1yqua_228";
15251
- var taskStats = "_taskStats_1yqua_237";
15252
- var taskParameters = "_taskParameters_1yqua_245";
15253
- var parameterItem = "_parameterItem_1yqua_258";
15254
- var paramKey = "_paramKey_1yqua_266";
15255
- var paramValue = "_paramValue_1yqua_271";
15256
- var taskActions = "_taskActions_1yqua_275";
15257
- var actionButton = "_actionButton_1yqua_280";
15258
- var btnPrimary = "_btnPrimary_1yqua_290";
15259
- var btnSecondary = "_btnSecondary_1yqua_301";
15260
- var historyHeader = "_historyHeader_1yqua_313";
15261
- var searchInput = "_searchInput_1yqua_327";
15262
- var filterTabs = "_filterTabs_1yqua_341";
15263
- var filterTab = "_filterTab_1yqua_341";
15264
- var active = "_active_1yqua_362";
15265
- var taskList = "_taskList_1yqua_368";
15266
- var emptyState = "_emptyState_1yqua_376";
15267
- var replayPanel = "_replayPanel_1yqua_385";
15268
- var replayHeader = "_replayHeader_1yqua_397";
15269
- var replayIcon = "_replayIcon_1yqua_405";
15270
- var replayStatus = "_replayStatus_1yqua_416";
15271
- var success = "_success_1yqua_421";
15272
- var failed = "_failed_1yqua_425";
15273
- var eventList = "_eventList_1yqua_431";
15274
- var eventItem = "_eventItem_1yqua_437";
15275
- var statusPending = "_statusPending_1yqua_449";
15276
- var statusRunning = "_statusRunning_1yqua_453";
15277
- var pulse = "_pulse_1yqua_1";
15278
- var statusSuccess = "_statusSuccess_1yqua_458";
15279
- var statusFailed = "_statusFailed_1yqua_462";
15280
- var eventStatusIcon = "_eventStatusIcon_1yqua_466";
15281
- var eventDescription = "_eventDescription_1yqua_472";
15282
- var eventDuration = "_eventDuration_1yqua_476";
15283
- var errorDialog = "_errorDialog_1yqua_493";
15284
- var errorHeader = "_errorHeader_1yqua_503";
15285
- var errorIcon = "_errorIcon_1yqua_511";
15286
- var errorDetails = "_errorDetails_1yqua_522";
15287
- var errorCauses = "_errorCauses_1yqua_536";
15288
- var errorActions = "_errorActions_1yqua_557";
15289
- var replayReport = "_replayReport_1yqua_566";
15290
- var failure = "_failure_1yqua_580";
15291
- var reportHeader = "_reportHeader_1yqua_584";
15292
- var reportIcon = "_reportIcon_1yqua_592";
15293
- var reportStats = "_reportStats_1yqua_603";
15294
- var statItem = "_statItem_1yqua_610";
15295
- var statLabel = "_statLabel_1yqua_614";
15296
- var statValue = "_statValue_1yqua_621";
15297
- var reportDetails = "_reportDetails_1yqua_628";
15298
- var eventResult = "_eventResult_1yqua_640";
15299
- var reportActions = "_reportActions_1yqua_656";
15300
- var loadingContent = "_loadingContent_1yqua_665";
15301
- var loadingSpinner = "_loadingSpinner_1yqua_671";
15302
- var spin = "_spin_1yqua_1";
15303
- var taskCardDialog = "_taskCardDialog_1yqua_695";
15304
- var settingsOverlay = "_settingsOverlay_1yqua_701";
15305
- var settingsDialog = "_settingsDialog_1yqua_713";
15306
- var settingsDialogHeader = "_settingsDialogHeader_1yqua_724";
15307
- var settingsDialogContent = "_settingsDialogContent_1yqua_739";
15308
- var settingsField = "_settingsField_1yqua_743";
15309
- var settingsLabel = "_settingsLabel_1yqua_747";
15310
- var settingsInput = "_settingsInput_1yqua_755";
15593
+ var recordingButton = "_recordingButton_1hion_4";
15594
+ var eventCounter = "_eventCounter_1hion_11";
15595
+ var exportOverlay = "_exportOverlay_1hion_31";
15596
+ var overlayFadeIn = "_overlayFadeIn_1hion_1";
15597
+ var exportDialog = "_exportDialog_1hion_52";
15598
+ var dialogSlideIn = "_dialogSlideIn_1hion_1";
15599
+ var exportDialogHeader = "_exportDialogHeader_1hion_74";
15600
+ var closeButton = "_closeButton_1hion_89";
15601
+ var exportDialogContent = "_exportDialogContent_1hion_110";
15602
+ var exportOptions = "_exportOptions_1hion_120";
15603
+ var exportOptionButton = "_exportOptionButton_1hion_126";
15604
+ var exportOptionIcon = "_exportOptionIcon_1hion_147";
15605
+ var exportOptionLabel = "_exportOptionLabel_1hion_152";
15606
+ var controlButton = "_controlButton_1hion_159";
15607
+ var controls = "_controls_1hion_179";
15608
+ var recording = "_recording_1hion_4";
15609
+ var recordingPulse = "_recordingPulse_1hion_1";
15610
+ var taskCard = "_taskCard_1hion_193";
15611
+ var taskCardHeader = "_taskCardHeader_1hion_209";
15612
+ var taskIcon = "_taskIcon_1hion_216";
15613
+ var taskName = "_taskName_1hion_220";
15614
+ var confidenceBadge = "_confidenceBadge_1hion_228";
15615
+ var taskStats = "_taskStats_1hion_237";
15616
+ var taskParameters = "_taskParameters_1hion_245";
15617
+ var parameterItem = "_parameterItem_1hion_258";
15618
+ var paramKey = "_paramKey_1hion_266";
15619
+ var paramValue = "_paramValue_1hion_271";
15620
+ var taskActions = "_taskActions_1hion_275";
15621
+ var actionButton = "_actionButton_1hion_280";
15622
+ var btnPrimary = "_btnPrimary_1hion_290";
15623
+ var btnSecondary = "_btnSecondary_1hion_301";
15624
+ var historyHeader = "_historyHeader_1hion_313";
15625
+ var searchInput = "_searchInput_1hion_327";
15626
+ var filterTabs = "_filterTabs_1hion_341";
15627
+ var filterTab = "_filterTab_1hion_341";
15628
+ var active = "_active_1hion_362";
15629
+ var taskList = "_taskList_1hion_368";
15630
+ var emptyState = "_emptyState_1hion_376";
15631
+ var replayPanel = "_replayPanel_1hion_385";
15632
+ var replayHeader = "_replayHeader_1hion_397";
15633
+ var replayIcon = "_replayIcon_1hion_405";
15634
+ var replayStatus = "_replayStatus_1hion_416";
15635
+ var success = "_success_1hion_421";
15636
+ var failed = "_failed_1hion_425";
15637
+ var eventList = "_eventList_1hion_431";
15638
+ var eventItem = "_eventItem_1hion_437";
15639
+ var statusPending = "_statusPending_1hion_449";
15640
+ var statusRunning = "_statusRunning_1hion_453";
15641
+ var pulse = "_pulse_1hion_1";
15642
+ var statusSuccess = "_statusSuccess_1hion_458";
15643
+ var statusFailed = "_statusFailed_1hion_462";
15644
+ var eventStatusIcon = "_eventStatusIcon_1hion_466";
15645
+ var eventDescription = "_eventDescription_1hion_472";
15646
+ var eventDuration = "_eventDuration_1hion_476";
15647
+ var errorDialog = "_errorDialog_1hion_493";
15648
+ var errorHeader = "_errorHeader_1hion_503";
15649
+ var errorIcon = "_errorIcon_1hion_511";
15650
+ var errorDetails = "_errorDetails_1hion_522";
15651
+ var errorCauses = "_errorCauses_1hion_536";
15652
+ var errorActions = "_errorActions_1hion_557";
15653
+ var replayReport = "_replayReport_1hion_566";
15654
+ var failure = "_failure_1hion_580";
15655
+ var reportHeader = "_reportHeader_1hion_584";
15656
+ var reportIcon = "_reportIcon_1hion_592";
15657
+ var reportStats = "_reportStats_1hion_603";
15658
+ var statItem = "_statItem_1hion_610";
15659
+ var statLabel = "_statLabel_1hion_614";
15660
+ var statValue = "_statValue_1hion_621";
15661
+ var reportDetails = "_reportDetails_1hion_628";
15662
+ var eventResult = "_eventResult_1hion_640";
15663
+ var reportActions = "_reportActions_1hion_656";
15664
+ var loadingContent = "_loadingContent_1hion_665";
15665
+ var loadingSpinner = "_loadingSpinner_1hion_671";
15666
+ var spin = "_spin_1hion_1";
15667
+ var taskCardDialog = "_taskCardDialog_1hion_695";
15668
+ var settingsOverlay = "_settingsOverlay_1hion_701";
15669
+ var settingsDialog = "_settingsDialog_1hion_713";
15670
+ var settingsDialogHeader = "_settingsDialogHeader_1hion_724";
15671
+ var settingsDialogContent = "_settingsDialogContent_1hion_739";
15672
+ var settingsField = "_settingsField_1hion_743";
15673
+ var settingsLabel = "_settingsLabel_1hion_747";
15674
+ var settingsInput = "_settingsInput_1hion_755";
15675
+ var testButton = "_testButton_1hion_806";
15676
+ var testButtonPrimary = "_testButtonPrimary_1hion_826";
15677
+ var testButtonLoading = "_testButtonLoading_1hion_848";
15678
+ var testButtonSuccess = "_testButtonSuccess_1hion_854";
15679
+ var testButtonError = "_testButtonError_1hion_861";
15680
+ var testBtnShake = "_testBtnShake_1hion_1";
15681
+ var testButtonSecondary = "_testButtonSecondary_1hion_888";
15682
+ var dslEditor = "_dslEditor_1hion_909";
15683
+ var resultStatus = "_resultStatus_1hion_935";
15684
+ var resultStatusRunning = "_resultStatusRunning_1hion_951";
15685
+ var resultStatusSuccess = "_resultStatusSuccess_1hion_955";
15686
+ var resultStatusError = "_resultStatusError_1hion_959";
15311
15687
  var RecordingPanel_module_default = {
15312
15688
  recordingButton,
15313
15689
  eventCounter,
@@ -15390,7 +15766,19 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15390
15766
  settingsDialogContent,
15391
15767
  settingsField,
15392
15768
  settingsLabel,
15393
- settingsInput
15769
+ settingsInput,
15770
+ testButton,
15771
+ testButtonPrimary,
15772
+ testButtonLoading,
15773
+ testButtonSuccess,
15774
+ testButtonError,
15775
+ testBtnShake,
15776
+ testButtonSecondary,
15777
+ dslEditor,
15778
+ resultStatus,
15779
+ resultStatusRunning,
15780
+ resultStatusSuccess,
15781
+ resultStatusError
15394
15782
  };
15395
15783
  //#endregion
15396
15784
  //#region src/TaskCard.ts
@@ -15788,7 +16176,10 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15788
16176
  #testModeButton;
15789
16177
  #testContainer;
15790
16178
  #dslEditor;
15791
- #isTestMode = false;
16179
+ #runButton;
16180
+ #resultStatus;
16181
+ #runButtonState = "default";
16182
+ #isTestMode = true;
15792
16183
  #settingsButton;
15793
16184
  constructor(agent, config) {
15794
16185
  super(agent, {
@@ -15804,8 +16195,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15804
16195
  onEdit: (task) => this.#handleEdit(task)
15805
16196
  });
15806
16197
  this.#setupRecordingUI();
15807
- this.#setupTestModeUI();
15808
16198
  this.#setupSettingsUI();
16199
+ this.#showTestPanel();
16200
+ if (this.#testModeButton) this.#testModeButton.style.color = "rgb(59, 130, 246)";
15809
16201
  }
15810
16202
  /**
15811
16203
  * Setup recording UI elements
@@ -15866,41 +16258,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15866
16258
  /**
15867
16259
  * Setup test mode toggle button in header controls
15868
16260
  */
15869
- #setupTestModeUI() {
15870
- const header = this.wrapper.children[2];
15871
- if (!header) return;
15872
- const controls = header.children[1];
15873
- if (!controls) return;
15874
- const buttons = controls.querySelectorAll("button");
15875
- if (buttons.length < 1) return;
15876
- const existingButton = buttons[0];
15877
- const baseClass = Array.from(existingButton.classList).find((c) => c.includes("controlButton") || c.includes("expandButton")) || existingButton.className;
15878
- this.#testModeButton = document.createElement("button");
15879
- this.#testModeButton.className = baseClass;
15880
- this.#testModeButton.textContent = "T";
15881
- this.#testModeButton.title = "Toggle test mode";
15882
- this.#testModeButton.setAttribute("data-page-agent-ignore", "true");
15883
- this.#testModeButton.setAttribute("data-browser-use-ignore", "true");
15884
- this.#testModeButton.style.fontWeight = "bold";
15885
- this.#testModeButton.addEventListener("click", (e) => {
15886
- e.stopPropagation();
15887
- this.#toggleTestMode();
15888
- });
15889
- controls.insertBefore(this.#testModeButton, controls.firstChild);
15890
- }
15891
16261
  /**
15892
16262
  * Toggle between automation and test mode
15893
16263
  */
15894
- #toggleTestMode() {
15895
- this.#isTestMode = !this.#isTestMode;
15896
- if (this.#isTestMode) {
15897
- this.#testModeButton.style.color = "rgb(59, 130, 246)";
15898
- this.#showTestPanel();
15899
- } else {
15900
- this.#testModeButton.style.color = "";
15901
- this.#hideTestPanel();
15902
- }
15903
- }
15904
16264
  /**
15905
16265
  * Show test panel by injecting DSL editor into the panel
15906
16266
  */
@@ -15919,21 +16279,22 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15919
16279
  container.appendChild(editorLabel);
15920
16280
  this.#dslEditor = document.createElement("textarea");
15921
16281
  this.#dslEditor.setAttribute("data-page-agent-ignore", "true");
16282
+ this.#dslEditor.className = RecordingPanel_module_default.dslEditor;
15922
16283
  this.#dslEditor.placeholder = "web:\n url: https://example.com\ntasks:\n - name: My test\n flow:\n - ai: do something\n - aiAssert: result should be X";
15923
- this.#dslEditor.style.cssText = "width: 100%; min-height: 180px; background: rgba(15,15,15,0.85); color: #f5f5f5; border: 1px solid rgba(255,255,255,0.15); border-radius: 8px; padding: 12px; font-family: \"SF Mono\", \"Monaco\", \"Menlo\", \"Consolas\", monospace; font-size: 13px; line-height: 1.6; resize: vertical; box-sizing: border-box;";
15924
16284
  container.appendChild(this.#dslEditor);
15925
16285
  const placeholderStyle = document.createElement("style");
15926
16286
  placeholderStyle.textContent = `
15927
- [data-page-agent-ignore="true"]::placeholder {
15928
- color: rgba(255, 255, 255, 0.4) !important;
15929
- }
15930
- `;
16287
+ [data-page-agent-ignore="true"]::placeholder {
16288
+ color: rgba(255, 255, 255, 0.4) !important;
16289
+ }
16290
+ `;
15931
16291
  document.head.appendChild(placeholderStyle);
15932
16292
  const btnRow = document.createElement("div");
15933
- btnRow.style.cssText = "display: flex; gap: 6px;";
15934
- btnRow.appendChild(this.#createTestBtn("Run", () => this.#handleTestRun()));
15935
- btnRow.appendChild(this.#createTestBtn("Save", () => this.#handleTestSave()));
15936
- btnRow.appendChild(this.#createTestBtn("Export", () => this.#handleTestExport()));
16293
+ btnRow.style.cssText = "display: flex; gap: 8px; align-items: center; min-height: 32px;";
16294
+ btnRow.appendChild(this.#createRunButton());
16295
+ this.#resultStatus = document.createElement("span");
16296
+ this.#resultStatus.className = RecordingPanel_module_default.resultStatus;
16297
+ btnRow.appendChild(this.#resultStatus);
15937
16298
  container.appendChild(btnRow);
15938
16299
  this.#testContainer = container;
15939
16300
  this.wrapper.insertBefore(container, inputSection);
@@ -15951,55 +16312,81 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
15951
16312
  if (historyWrapper) historyWrapper.style.display = "";
15952
16313
  if (inputSection) inputSection.style.display = "";
15953
16314
  }
15954
- #createTestBtn(text, onClick) {
16315
+ #createRunButton() {
15955
16316
  const btn = document.createElement("button");
15956
16317
  btn.setAttribute("data-page-agent-ignore", "true");
15957
- btn.textContent = text;
15958
- btn.style.cssText = "padding: 4px 12px; background: rgba(59,130,246,0.7); color: white; border: none; border-radius: 4px; font-size: 11px; cursor: pointer;";
15959
- btn.addEventListener("mouseenter", () => {
15960
- btn.style.background = "rgba(59,130,246,1)";
15961
- });
15962
- btn.addEventListener("mouseleave", () => {
15963
- btn.style.background = "rgba(59,130,246,0.7)";
15964
- });
16318
+ btn.className = `${RecordingPanel_module_default.testButton} ${RecordingPanel_module_default.testButtonPrimary}`;
16319
+ btn.innerHTML = "<span style=\"font-size:12px;line-height:1\">▶</span><span> Run</span>";
16320
+ btn.title = "Run (执行测试)";
15965
16321
  btn.addEventListener("click", (e) => {
15966
16322
  e.stopPropagation();
15967
- onClick();
16323
+ this.#handleTestRun();
15968
16324
  });
16325
+ this.#runButton = btn;
15969
16326
  return btn;
15970
16327
  }
16328
+ #setRunButtonState(state) {
16329
+ if (!this.#runButton || !this.#resultStatus) return;
16330
+ this.#runButton.classList.remove(RecordingPanel_module_default.testButtonLoading, RecordingPanel_module_default.testButtonSuccess, RecordingPanel_module_default.testButtonError);
16331
+ this.#runButtonState = state;
16332
+ switch (state) {
16333
+ case "default":
16334
+ this.#runButton.disabled = false;
16335
+ this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1\">▶</span><span> Run</span>";
16336
+ this.#runButton.title = "Run (执行测试)";
16337
+ this.#resultStatus.className = RecordingPanel_module_default.resultStatus;
16338
+ this.#resultStatus.textContent = "";
16339
+ break;
16340
+ case "loading":
16341
+ this.#runButton.disabled = true;
16342
+ this.#runButton.classList.add(RecordingPanel_module_default.testButtonLoading);
16343
+ this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1\">◉</span><span> Running…</span>";
16344
+ this.#runButton.title = "Running…";
16345
+ this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusRunning}`;
16346
+ this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">◉</span> Running…";
16347
+ break;
16348
+ case "success":
16349
+ this.#runButton.disabled = true;
16350
+ this.#runButton.classList.add(RecordingPanel_module_default.testButtonSuccess);
16351
+ this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1;font-weight:700\">✓</span><span> Done</span>";
16352
+ this.#runButton.title = "Success";
16353
+ this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusSuccess}`;
16354
+ this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">✓</span> All tasks passed";
16355
+ break;
16356
+ case "error":
16357
+ this.#runButton.disabled = true;
16358
+ this.#runButton.classList.add(RecordingPanel_module_default.testButtonError);
16359
+ this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1;font-weight:700\">✕</span><span> Failed</span>";
16360
+ this.#runButton.title = "Failed";
16361
+ this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusError}`;
16362
+ this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">✕</span> Task failed";
16363
+ break;
16364
+ }
16365
+ }
15971
16366
  async #handleTestRun() {
15972
- if (!this.#dslEditor || !this.#config.onRunTest) return;
16367
+ if (!this.#dslEditor || !this.#config.onRunTest || !this.#runButton) return;
16368
+ if (this.#runButtonState !== "default") return;
15973
16369
  const dsl = this.#dslEditor.value.trim();
15974
16370
  if (!dsl) return;
15975
16371
  const parsed = parseTestSpec(dsl);
15976
16372
  if (!parsed.success) {
15977
16373
  console.error("Parse error:", parsed.errors);
16374
+ this.#setRunButtonState("error");
16375
+ if (this.#resultStatus) this.#resultStatus.textContent = "✕ YAML parse error";
15978
16376
  return;
15979
16377
  }
16378
+ this.#setRunButtonState("loading");
15980
16379
  try {
15981
16380
  await this.#config.onRunTest(dsl);
16381
+ this.#setRunButtonState("success");
15982
16382
  } catch (error) {
15983
16383
  console.error("Test failed:", error);
16384
+ this.#setRunButtonState("error");
16385
+ if (this.#resultStatus) this.#resultStatus.textContent = `\u2715 ${error instanceof Error ? error.message : "Test failed"}`;
15984
16386
  }
15985
- }
15986
- #handleTestSave() {
15987
- if (!this.#dslEditor) return;
15988
- const dsl = this.#dslEditor.value.trim();
15989
- if (!dsl) return;
15990
- const parsed = parseTestSpec(dsl);
15991
- if (!parsed.success || !parsed.spec) return;
15992
- const name = parsed.spec.tasks.map((t) => t.name).join(" / ") || "Untitled";
15993
- const saved = JSON.parse(localStorage.getItem("page-agent-test-specs") || "[]");
15994
- saved.push({
15995
- name,
15996
- dsl
15997
- });
15998
- localStorage.setItem("page-agent-test-specs", JSON.stringify(saved));
15999
- console.log("Saved:", name);
16000
- }
16001
- #handleTestExport() {
16002
- console.log("Export functionality disabled: test result display removed");
16387
+ setTimeout(() => {
16388
+ this.#setRunButtonState("default");
16389
+ }, 2e3);
16003
16390
  }
16004
16391
  #updateRecordingUI(isRecording) {
16005
16392
  if (!this.#recordingButton) return;
@@ -16114,9 +16501,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
16114
16501
  const content = document.createElement("div");
16115
16502
  content.className = RecordingPanel_module_default.loadingContent;
16116
16503
  content.innerHTML = `
16117
- <div class="${RecordingPanel_module_default.loadingSpinner}"></div>
16118
- <p>${message}</p>
16119
- `;
16504
+ <div class="${RecordingPanel_module_default.loadingSpinner}"></div>
16505
+ <p>${message}</p>
16506
+ `;
16120
16507
  overlay.appendChild(content);
16121
16508
  document.body.appendChild(overlay);
16122
16509
  this.#currentOverlay = overlay;
@@ -16184,29 +16571,29 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
16184
16571
  const header = document.createElement("div");
16185
16572
  header.className = RecordingPanel_module_default.exportDialogHeader;
16186
16573
  header.innerHTML = `
16187
- <h3>${this.#i18n.t("ui.panel.exportRecording")}</h3>
16188
- <button class="${RecordingPanel_module_default.closeButton}">×</button>
16189
- `;
16574
+ <h3>${this.#i18n.t("ui.panel.exportRecording")}</h3>
16575
+ <button class="${RecordingPanel_module_default.closeButton}">×</button>
16576
+ `;
16190
16577
  dialog.appendChild(header);
16191
16578
  const content = document.createElement("div");
16192
16579
  content.className = RecordingPanel_module_default.exportDialogContent;
16193
16580
  content.innerHTML = `
16194
- <p>${this.#i18n.t("ui.panel.recordedEvents", { count: events.length })}</p>
16195
- <div class="${RecordingPanel_module_default.exportOptions}">
16196
- <button data-format="json" class="${RecordingPanel_module_default.exportOptionButton}">
16197
- <div class="${RecordingPanel_module_default.exportOptionIcon}">{}</div>
16198
- <div class="${RecordingPanel_module_default.exportOptionLabel}">JSON</div>
16199
- </button>
16200
- <button data-format="markdown" class="${RecordingPanel_module_default.exportOptionButton}">
16201
- <div class="${RecordingPanel_module_default.exportOptionIcon}">M↓</div>
16202
- <div class="${RecordingPanel_module_default.exportOptionLabel}">Markdown</div>
16203
- </button>
16204
- <button data-format="playwright" class="${RecordingPanel_module_default.exportOptionButton}">
16205
- <div class="${RecordingPanel_module_default.exportOptionIcon}">🎭</div>
16206
- <div class="${RecordingPanel_module_default.exportOptionLabel}">Playwright</div>
16207
- </button>
16208
- </div>
16209
- `;
16581
+ <p>${this.#i18n.t("ui.panel.recordedEvents", { count: events.length })}</p>
16582
+ <div class="${RecordingPanel_module_default.exportOptions}">
16583
+ <button data-format="json" class="${RecordingPanel_module_default.exportOptionButton}">
16584
+ <div class="${RecordingPanel_module_default.exportOptionIcon}">{}</div>
16585
+ <div class="${RecordingPanel_module_default.exportOptionLabel}">JSON</div>
16586
+ </button>
16587
+ <button data-format="markdown" class="${RecordingPanel_module_default.exportOptionButton}">
16588
+ <div class="${RecordingPanel_module_default.exportOptionIcon}">M↓</div>
16589
+ <div class="${RecordingPanel_module_default.exportOptionLabel}">Markdown</div>
16590
+ </button>
16591
+ <button data-format="playwright" class="${RecordingPanel_module_default.exportOptionButton}">
16592
+ <div class="${RecordingPanel_module_default.exportOptionIcon}">🎭</div>
16593
+ <div class="${RecordingPanel_module_default.exportOptionLabel}">Playwright</div>
16594
+ </button>
16595
+ </div>
16596
+ `;
16210
16597
  dialog.appendChild(content);
16211
16598
  overlay.appendChild(dialog);
16212
16599
  document.body.appendChild(overlay);
@@ -16300,39 +16687,39 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
16300
16687
  const header = document.createElement("div");
16301
16688
  header.className = RecordingPanel_module_default.settingsDialogHeader || RecordingPanel_module_default.exportDialogHeader;
16302
16689
  header.innerHTML = `
16303
- <h3>Settings</h3>
16304
- <button class="${RecordingPanel_module_default.closeButton}">×</button>
16305
- `;
16690
+ <h3>Settings</h3>
16691
+ <button class="${RecordingPanel_module_default.closeButton}">×</button>
16692
+ `;
16306
16693
  dialog.appendChild(header);
16307
16694
  const content = document.createElement("div");
16308
16695
  content.className = RecordingPanel_module_default.settingsDialogContent || RecordingPanel_module_default.exportDialogContent;
16309
16696
  const currentConfig = this.#loadConfigFromStorage();
16310
16697
  content.innerHTML = `
16311
- <div class="${RecordingPanel_module_default.settingsField}">
16312
- <label class="${RecordingPanel_module_default.settingsLabel}">Model</label>
16313
- <input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-model"
16314
- value="${this.#escapeHtml(currentConfig?.model || "")}"
16315
- placeholder="deepseek-v4-flash" />
16316
- </div>
16317
- <div class="${RecordingPanel_module_default.settingsField}">
16318
- <label class="${RecordingPanel_module_default.settingsLabel}">API Base URL</label>
16319
- <input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-baseurl"
16320
- value="${this.#escapeHtml(currentConfig?.baseURL || "")}"
16321
- placeholder="https://api.deepseek.com" />
16322
- </div>
16323
- <div class="${RecordingPanel_module_default.settingsField}">
16324
- <label class="${RecordingPanel_module_default.settingsLabel}">API Key (optional)</label>
16325
- <input type="password" class="${RecordingPanel_module_default.settingsInput}" id="settings-apikey"
16326
- value="${this.#escapeHtml(currentConfig?.apiKey || "")}"
16327
- placeholder="••••••••" />
16328
- </div>
16329
- `;
16698
+ <div class="${RecordingPanel_module_default.settingsField}">
16699
+ <label class="${RecordingPanel_module_default.settingsLabel}">Model</label>
16700
+ <input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-model"
16701
+ value="${this.#escapeHtml(currentConfig?.model || "")}"
16702
+ placeholder="deepseek-v4-flash" />
16703
+ </div>
16704
+ <div class="${RecordingPanel_module_default.settingsField}">
16705
+ <label class="${RecordingPanel_module_default.settingsLabel}">API Base URL</label>
16706
+ <input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-baseurl"
16707
+ value="${this.#escapeHtml(currentConfig?.baseURL || "")}"
16708
+ placeholder="https://api.deepseek.com" />
16709
+ </div>
16710
+ <div class="${RecordingPanel_module_default.settingsField}">
16711
+ <label class="${RecordingPanel_module_default.settingsLabel}">API Key (optional)</label>
16712
+ <input type="password" class="${RecordingPanel_module_default.settingsInput}" id="settings-apikey"
16713
+ value="${this.#escapeHtml(currentConfig?.apiKey || "")}"
16714
+ placeholder="••••••••" />
16715
+ </div>
16716
+ `;
16330
16717
  const buttonRow = document.createElement("div");
16331
16718
  buttonRow.style.cssText = "display: flex; gap: 8px; justify-content: flex-end; padding: 20px;";
16332
16719
  buttonRow.innerHTML = `
16333
- <button id="settings-cancel" class="${RecordingPanel_module_default.btnSecondary}">Cancel</button>
16334
- <button id="settings-save" class="${RecordingPanel_module_default.btnPrimary}">Save</button>
16335
- `;
16720
+ <button id="settings-cancel" class="${RecordingPanel_module_default.btnSecondary}">Cancel</button>
16721
+ <button id="settings-save" class="${RecordingPanel_module_default.btnPrimary}">Save</button>
16722
+ `;
16336
16723
  dialog.appendChild(content);
16337
16724
  dialog.appendChild(buttonRow);
16338
16725
  overlay.appendChild(dialog);
@@ -16584,4 +16971,4 @@ tasks:
16584
16971
  //#endregion
16585
16972
  })();
16586
16973
 
16587
- //# sourceMappingURL=page-agent.demo.js.map
16974
+ //# sourceMappingURL=page-test.demo.js.map