@stv/page-test 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/iife/{page-agent.demo.js → page-test.demo.js} +2150 -1938
- package/dist/iife/page-test.demo.js.map +1 -0
- package/package.json +1 -1
- package/dist/esm/PageAgent.d.ts +0 -102
- package/dist/esm/page-agent.js +0 -1229
- package/dist/esm/page-agent.js.map +0 -1
- package/dist/iife/page-agent.demo.js.map +0 -1
|
@@ -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/* 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
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
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
|
-
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
183
|
-
|
|
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
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
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
|
-
|
|
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
|
-
|
|
314
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
357
|
-
|
|
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/
|
|
410
|
-
var
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
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
|
-
|
|
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
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
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/
|
|
523
|
-
var
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
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
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
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
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
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
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
return
|
|
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
|
|
633
|
-
|
|
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/
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
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
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
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
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
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
|
|
680
|
-
return
|
|
482
|
+
function jsonStringifyReplacer(_, value) {
|
|
483
|
+
if (typeof value === "bigint") return value.toString();
|
|
484
|
+
return value;
|
|
681
485
|
}
|
|
682
|
-
function
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
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
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
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
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
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
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
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
|
-
|
|
757
|
-
$
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
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
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
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
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
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
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
-
|
|
827
|
-
|
|
828
|
-
|
|
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
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
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
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
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
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
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
|
-
|
|
880
|
-
|
|
881
|
-
|
|
796
|
+
Object.defineProperty(inst, "issues", {
|
|
797
|
+
value: def,
|
|
798
|
+
enumerable: false
|
|
882
799
|
});
|
|
883
|
-
inst.
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
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;
|
|
@@ -4164,665 +4544,285 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4164
4544
|
...this._zod.def,
|
|
4165
4545
|
catchall: void 0
|
|
4166
4546
|
});
|
|
4167
|
-
},
|
|
4168
|
-
extend(incoming) {
|
|
4169
|
-
return extend$1(this, incoming);
|
|
4170
|
-
},
|
|
4171
|
-
safeExtend(incoming) {
|
|
4172
|
-
return safeExtend(this, incoming);
|
|
4173
|
-
},
|
|
4174
|
-
merge(other) {
|
|
4175
|
-
return merge$1(this, other);
|
|
4176
|
-
},
|
|
4177
|
-
pick(mask) {
|
|
4178
|
-
return pick(this, mask);
|
|
4179
|
-
},
|
|
4180
|
-
omit(mask) {
|
|
4181
|
-
return omit(this, mask);
|
|
4182
|
-
},
|
|
4183
|
-
partial(...args) {
|
|
4184
|
-
return partial(ZodOptional, this, args[0]);
|
|
4185
|
-
},
|
|
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);
|
|
4547
|
+
},
|
|
4548
|
+
extend(incoming) {
|
|
4549
|
+
return extend$1(this, incoming);
|
|
4550
|
+
},
|
|
4551
|
+
safeExtend(incoming) {
|
|
4552
|
+
return safeExtend(this, incoming);
|
|
4553
|
+
},
|
|
4554
|
+
merge(other) {
|
|
4555
|
+
return merge$1(this, other);
|
|
4556
|
+
},
|
|
4557
|
+
pick(mask) {
|
|
4558
|
+
return pick(this, mask);
|
|
4559
|
+
},
|
|
4560
|
+
omit(mask) {
|
|
4561
|
+
return omit(this, mask);
|
|
4562
|
+
},
|
|
4563
|
+
partial(...args) {
|
|
4564
|
+
return partial(ZodOptional, this, args[0]);
|
|
4565
|
+
},
|
|
4566
|
+
required(...args) {
|
|
4567
|
+
return required(ZodNonOptional, this, args[0]);
|
|
4364
4568
|
}
|
|
4365
4569
|
});
|
|
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
4570
|
});
|
|
4373
|
-
function
|
|
4374
|
-
return new
|
|
4375
|
-
type: "
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
|
|
4379
|
-
}
|
|
4571
|
+
function object(shape, params) {
|
|
4572
|
+
return new ZodObject({
|
|
4573
|
+
type: "object",
|
|
4574
|
+
shape: shape ?? {},
|
|
4575
|
+
...normalizeParams(params)
|
|
4380
4576
|
});
|
|
4381
4577
|
}
|
|
4382
|
-
var
|
|
4383
|
-
$
|
|
4578
|
+
var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
|
|
4579
|
+
$ZodUnion.init(inst, def);
|
|
4384
4580
|
ZodType.init(inst, def);
|
|
4385
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
4386
|
-
inst.
|
|
4581
|
+
inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
|
|
4582
|
+
inst.options = def.options;
|
|
4387
4583
|
});
|
|
4388
|
-
function
|
|
4389
|
-
return new
|
|
4390
|
-
type: "
|
|
4391
|
-
|
|
4584
|
+
function union(options, params) {
|
|
4585
|
+
return new ZodUnion({
|
|
4586
|
+
type: "union",
|
|
4587
|
+
options,
|
|
4392
4588
|
...normalizeParams(params)
|
|
4393
4589
|
});
|
|
4394
4590
|
}
|
|
4395
|
-
var
|
|
4396
|
-
$
|
|
4591
|
+
var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
|
|
4592
|
+
$ZodIntersection.init(inst, def);
|
|
4397
4593
|
ZodType.init(inst, def);
|
|
4398
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
4399
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
4400
|
-
inst.removeCatch = inst.unwrap;
|
|
4594
|
+
inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
|
|
4401
4595
|
});
|
|
4402
|
-
function
|
|
4403
|
-
return new
|
|
4404
|
-
type: "
|
|
4405
|
-
|
|
4406
|
-
|
|
4596
|
+
function intersection(left, right) {
|
|
4597
|
+
return new ZodIntersection({
|
|
4598
|
+
type: "intersection",
|
|
4599
|
+
left,
|
|
4600
|
+
right
|
|
4407
4601
|
});
|
|
4408
4602
|
}
|
|
4409
|
-
var
|
|
4410
|
-
$
|
|
4603
|
+
var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
|
|
4604
|
+
$ZodRecord.init(inst, def);
|
|
4411
4605
|
ZodType.init(inst, def);
|
|
4412
|
-
inst._zod.processJSONSchema = (ctx, json, params) =>
|
|
4413
|
-
inst.
|
|
4414
|
-
inst.
|
|
4606
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
4607
|
+
inst.keyType = def.keyType;
|
|
4608
|
+
inst.valueType = def.valueType;
|
|
4415
4609
|
});
|
|
4416
|
-
function
|
|
4417
|
-
return new
|
|
4418
|
-
type: "
|
|
4419
|
-
|
|
4420
|
-
|
|
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)
|
|
4421
4616
|
});
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4427
|
-
inst.unwrap = () => inst._zod.def.innerType;
|
|
4428
|
-
});
|
|
4429
|
-
function readonly(innerType) {
|
|
4430
|
-
return new ZodReadonly({
|
|
4431
|
-
type: "readonly",
|
|
4432
|
-
innerType
|
|
4617
|
+
return new ZodRecord({
|
|
4618
|
+
type: "record",
|
|
4619
|
+
keyType,
|
|
4620
|
+
valueType,
|
|
4621
|
+
...normalizeParams(params)
|
|
4433
4622
|
});
|
|
4434
4623
|
}
|
|
4435
|
-
var
|
|
4436
|
-
$
|
|
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) =>
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4447
|
-
|
|
4448
|
-
|
|
4449
|
-
|
|
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
|
|
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
|
|
4568
4640
|
});
|
|
4569
|
-
}
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
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
|
+
};
|
|
4653
|
+
});
|
|
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)
|
|
4573
4659
|
});
|
|
4574
|
-
|
|
4575
|
-
|
|
4576
|
-
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
if (
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
|
|
4591
|
-
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4660
|
+
}
|
|
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;
|
|
4683
|
+
});
|
|
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
|
|
4693
|
+
});
|
|
4694
|
+
}
|
|
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
|
+
});
|
|
4706
|
+
}
|
|
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
|
+
});
|
|
4718
|
+
}
|
|
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
|
+
}
|
|
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);
|
|
4650
4744
|
}
|
|
4651
4745
|
});
|
|
4652
|
-
return styles$1;
|
|
4653
4746
|
}
|
|
4654
|
-
var
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4663
|
-
|
|
4664
|
-
|
|
4665
|
-
|
|
4666
|
-
|
|
4667
|
-
|
|
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;
|
|
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);
|
|
4759
|
+
}
|
|
4760
|
+
});
|
|
4691
4761
|
}
|
|
4692
|
-
|
|
4693
|
-
|
|
4694
|
-
|
|
4695
|
-
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
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;
|
|
4767
|
+
});
|
|
4768
|
+
function nonoptional(innerType, params) {
|
|
4769
|
+
return new ZodNonOptional({
|
|
4770
|
+
type: "nonoptional",
|
|
4771
|
+
innerType,
|
|
4772
|
+
...normalizeParams(params)
|
|
4773
|
+
});
|
|
4703
4774
|
}
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
|
|
4711
|
-
|
|
4712
|
-
|
|
4713
|
-
|
|
4714
|
-
|
|
4715
|
-
|
|
4716
|
-
|
|
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);
|
|
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
|
+
});
|
|
4730
4788
|
}
|
|
4731
|
-
|
|
4732
|
-
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
|
|
4736
|
-
|
|
4737
|
-
|
|
4738
|
-
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
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
|
-
} };
|
|
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
|
+
});
|
|
4771
4802
|
}
|
|
4772
|
-
var
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4776
|
-
|
|
4777
|
-
return this[GENERATOR].level;
|
|
4778
|
-
},
|
|
4779
|
-
set(level) {
|
|
4780
|
-
this[GENERATOR].level = level;
|
|
4781
|
-
}
|
|
4782
|
-
}
|
|
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;
|
|
4783
4808
|
});
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
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 });
|
|
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/
|
|
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
|
-
*
|
|
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
|
-
|
|
5043
|
-
|
|
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
|
|
5191
|
-
|
|
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
|
-
|
|
5250
|
-
|
|
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 = "
|
|
10793
|
-
visible = "
|
|
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 = "
|
|
10804
|
-
cursorBorder = "
|
|
10805
|
-
cursorFilling = "
|
|
10806
|
-
cursorRipple = "
|
|
10807
|
-
clicking = "
|
|
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-
|
|
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(`
|
|
12924
|
-
lines.push(`
|
|
12925
|
-
lines.push(`
|
|
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(`
|
|
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(`
|
|
12933
|
-
lines.push(`
|
|
12934
|
-
lines.push(`
|
|
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(`
|
|
12942
|
-
lines.push(`
|
|
12943
|
-
lines.push(`
|
|
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(`
|
|
12951
|
-
lines.push(`
|
|
12952
|
-
lines.push(`
|
|
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(`
|
|
12961
|
-
lines.push(`
|
|
12962
|
-
lines.push(`
|
|
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(`
|
|
12969
|
-
lines.push(`
|
|
12970
|
-
lines.push(`
|
|
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(`
|
|
12976
|
-
lines.push(`
|
|
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(`
|
|
12990
|
-
lines.push(`
|
|
13178
|
+
lines.push(` await page.goto('${data.session.url}')`);
|
|
13179
|
+
lines.push(` await page.waitForLoadState('networkidle')`);
|
|
12991
13180
|
lines.push("");
|
|
12992
|
-
lines.push(`
|
|
12993
|
-
lines.push(`
|
|
12994
|
-
lines.push(`
|
|
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(`
|
|
12999
|
-
lines.push(`
|
|
13000
|
-
lines.push(`
|
|
13001
|
-
lines.push(`
|
|
13002
|
-
lines.push(`
|
|
13003
|
-
lines.push(`
|
|
13004
|
-
lines.push(`
|
|
13005
|
-
lines.push(`
|
|
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(`
|
|
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
|
-
|
|
13564
|
-
|
|
13565
|
-
|
|
13566
|
-
|
|
13567
|
-
|
|
13568
|
-
|
|
13569
|
-
|
|
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
|
-
|
|
13582
|
-
|
|
13583
|
-
|
|
13584
|
-
|
|
13585
|
-
|
|
13586
|
-
|
|
13587
|
-
|
|
13588
|
-
|
|
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
|
-
|
|
13600
|
-
|
|
13601
|
-
|
|
13602
|
-
|
|
13603
|
-
|
|
13604
|
-
|
|
13605
|
-
|
|
13606
|
-
|
|
13607
|
-
|
|
13608
|
-
|
|
13609
|
-
|
|
13610
|
-
|
|
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
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
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
|
-
|
|
13706
|
-
|
|
13707
|
-
|
|
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
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
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
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14350
|
+
@keyframes replay-error {
|
|
14351
|
+
0%, 100% {
|
|
14352
|
+
opacity: 1;
|
|
14353
|
+
}
|
|
14354
|
+
50% {
|
|
14355
|
+
opacity: 0.5;
|
|
14356
|
+
}
|
|
14357
|
+
}
|
|
14169
14358
|
|
|
14170
|
-
|
|
14171
|
-
|
|
14172
|
-
|
|
14359
|
+
.replay-highlight {
|
|
14360
|
+
animation: replay-pulse 1s infinite;
|
|
14361
|
+
}
|
|
14173
14362
|
|
|
14174
|
-
|
|
14175
|
-
|
|
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
|
-
|
|
14262
|
-
|
|
14263
|
-
|
|
14264
|
-
|
|
14265
|
-
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
|
|
14270
|
-
|
|
14271
|
-
|
|
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
|
-
|
|
14288
|
-
|
|
14289
|
-
|
|
14290
|
-
|
|
14291
|
-
|
|
14292
|
-
|
|
14293
|
-
|
|
14294
|
-
|
|
14295
|
-
|
|
14296
|
-
|
|
14297
|
-
|
|
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
|
-
|
|
14314
|
-
|
|
14315
|
-
|
|
14316
|
-
|
|
14317
|
-
|
|
14318
|
-
|
|
14319
|
-
|
|
14320
|
-
|
|
14321
|
-
|
|
14322
|
-
|
|
14323
|
-
|
|
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
|
-
|
|
14328
|
-
|
|
14329
|
-
|
|
14330
|
-
|
|
14331
|
-
|
|
14332
|
-
|
|
14333
|
-
|
|
14334
|
-
|
|
14335
|
-
|
|
14336
|
-
|
|
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
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
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 = "
|
|
14592
|
-
var background = "
|
|
14593
|
-
var header = "
|
|
14594
|
-
var pulse$1 = "
|
|
14595
|
-
var retryPulse = "
|
|
14596
|
-
var statusTextFadeOut = "
|
|
14597
|
-
var statusTextFadeIn = "
|
|
14598
|
-
var recordingPulse$1 = "
|
|
14599
|
-
var statusSection = "
|
|
14600
|
-
var indicator = "
|
|
14601
|
-
var thinking = "
|
|
14602
|
-
var tool_executing = "
|
|
14603
|
-
var retry = "
|
|
14604
|
-
var completed = "
|
|
14605
|
-
var input = "
|
|
14606
|
-
var output = "
|
|
14607
|
-
var error = "
|
|
14608
|
-
var statusText = "
|
|
14609
|
-
var fadeOut = "
|
|
14610
|
-
var fadeIn = "
|
|
14611
|
-
var controls$1 = "
|
|
14612
|
-
var controlButton$1 = "
|
|
14613
|
-
var recordingButton$1 = "
|
|
14614
|
-
var recording$1 = "
|
|
14615
|
-
var eventCounter$1 = "
|
|
14616
|
-
var stopButton = "
|
|
14617
|
-
var historySectionWrapper = "
|
|
14618
|
-
var shimmer = "
|
|
14619
|
-
var celebrate = "
|
|
14620
|
-
var expanded = "
|
|
14621
|
-
var historySection = "
|
|
14622
|
-
var historyItem = "
|
|
14623
|
-
var observation = "
|
|
14624
|
-
var question = "
|
|
14625
|
-
var doneSuccess = "
|
|
14626
|
-
var historyContent = "
|
|
14627
|
-
var statusIcon = "
|
|
14628
|
-
var doneError = "
|
|
14629
|
-
var reflectionLines = "
|
|
14630
|
-
var historyMeta = "
|
|
14631
|
-
var inputSectionWrapper = "
|
|
14632
|
-
var hidden = "
|
|
14633
|
-
var inputSection = "
|
|
14634
|
-
var taskInput = "
|
|
14635
|
-
var exportOverlay$1 = "
|
|
14636
|
-
var overlayFadeIn$1 = "
|
|
14637
|
-
var exportDialog$1 = "
|
|
14638
|
-
var dialogSlideIn$1 = "
|
|
14639
|
-
var exportDialogHeader$1 = "
|
|
14640
|
-
var closeButton$1 = "
|
|
14641
|
-
var exportDialogContent$1 = "
|
|
14642
|
-
var exportOptions$1 = "
|
|
14643
|
-
var exportOptionButton$1 = "
|
|
14644
|
-
var exportOptionIcon$1 = "
|
|
14645
|
-
var exportOptionLabel$1 = "
|
|
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-
|
|
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
|
-
|
|
14715
|
-
|
|
14716
|
-
|
|
14717
|
-
|
|
14718
|
-
|
|
14719
|
-
|
|
14720
|
-
|
|
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) {
|
|
@@ -14981,41 +15170,41 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
14981
15170
|
wrapper.setAttribute("data-browser-use-ignore", "true");
|
|
14982
15171
|
wrapper.setAttribute("data-page-agent-ignore", "true");
|
|
14983
15172
|
wrapper.innerHTML = `
|
|
14984
|
-
|
|
14985
|
-
|
|
14986
|
-
|
|
14987
|
-
|
|
14988
|
-
|
|
14989
|
-
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
14994
|
-
|
|
14995
|
-
|
|
14996
|
-
|
|
14997
|
-
|
|
14998
|
-
|
|
14999
|
-
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15007
|
-
|
|
15008
|
-
|
|
15009
|
-
|
|
15010
|
-
|
|
15011
|
-
|
|
15012
|
-
|
|
15013
|
-
|
|
15014
|
-
|
|
15015
|
-
|
|
15016
|
-
|
|
15017
|
-
|
|
15018
|
-
|
|
15173
|
+
<div class="${Panel_module_default.background}"></div>
|
|
15174
|
+
<div class="${Panel_module_default.historySectionWrapper}">
|
|
15175
|
+
<div class="${Panel_module_default.historySection}">
|
|
15176
|
+
<div class="${Panel_module_default.historyItem}">
|
|
15177
|
+
<div class="${Panel_module_default.historyContent}">
|
|
15178
|
+
<span class="${Panel_module_default.statusIcon}">🧠</span>
|
|
15179
|
+
<span>${this.#i18n.t("ui.panel.waitingPlaceholder")}</span>
|
|
15180
|
+
</div>
|
|
15181
|
+
</div>
|
|
15182
|
+
</div>
|
|
15183
|
+
</div>
|
|
15184
|
+
<div class="${Panel_module_default.header}">
|
|
15185
|
+
<div class="${Panel_module_default.statusSection}">
|
|
15186
|
+
<div class="${Panel_module_default.indicator} ${Panel_module_default.thinking}"></div>
|
|
15187
|
+
<div class="${Panel_module_default.statusText}">${this.#i18n.t("ui.panel.ready")}</div>
|
|
15188
|
+
</div>
|
|
15189
|
+
<div class="${Panel_module_default.controls}">
|
|
15190
|
+
<button class="${Panel_module_default.controlButton} ${Panel_module_default.expandButton}" title="${this.#i18n.t("ui.panel.expand")}">
|
|
15191
|
+
▼
|
|
15192
|
+
</button>
|
|
15193
|
+
<button class="${Panel_module_default.controlButton} ${Panel_module_default.stopButton}" title="${this.#i18n.t("ui.panel.close")}">
|
|
15194
|
+
X
|
|
15195
|
+
</button>
|
|
15196
|
+
</div>
|
|
15197
|
+
</div>
|
|
15198
|
+
<div class="${Panel_module_default.inputSectionWrapper} ${Panel_module_default.hidden}">
|
|
15199
|
+
<div class="${Panel_module_default.inputSection}">
|
|
15200
|
+
<input
|
|
15201
|
+
type="text"
|
|
15202
|
+
class="${Panel_module_default.taskInput}"
|
|
15203
|
+
maxlength="${taskInputMaxLength}"
|
|
15204
|
+
/>
|
|
15205
|
+
</div>
|
|
15206
|
+
</div>
|
|
15207
|
+
`;
|
|
15019
15208
|
document.body.appendChild(wrapper);
|
|
15020
15209
|
return wrapper;
|
|
15021
15210
|
}
|
|
@@ -15226,88 +15415,100 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15226
15415
|
//#endregion
|
|
15227
15416
|
//#region src/RecordingPanel.module.css
|
|
15228
15417
|
init_src();
|
|
15229
|
-
var recordingButton = "
|
|
15230
|
-
var eventCounter = "
|
|
15231
|
-
var exportOverlay = "
|
|
15232
|
-
var overlayFadeIn = "
|
|
15233
|
-
var exportDialog = "
|
|
15234
|
-
var dialogSlideIn = "
|
|
15235
|
-
var exportDialogHeader = "
|
|
15236
|
-
var closeButton = "
|
|
15237
|
-
var exportDialogContent = "
|
|
15238
|
-
var exportOptions = "
|
|
15239
|
-
var exportOptionButton = "
|
|
15240
|
-
var exportOptionIcon = "
|
|
15241
|
-
var exportOptionLabel = "
|
|
15242
|
-
var controlButton = "
|
|
15243
|
-
var controls = "
|
|
15244
|
-
var recording = "
|
|
15245
|
-
var recordingPulse = "
|
|
15246
|
-
var taskCard = "
|
|
15247
|
-
var taskCardHeader = "
|
|
15248
|
-
var taskIcon = "
|
|
15249
|
-
var taskName = "
|
|
15250
|
-
var confidenceBadge = "
|
|
15251
|
-
var taskStats = "
|
|
15252
|
-
var taskParameters = "
|
|
15253
|
-
var parameterItem = "
|
|
15254
|
-
var paramKey = "
|
|
15255
|
-
var paramValue = "
|
|
15256
|
-
var taskActions = "
|
|
15257
|
-
var actionButton = "
|
|
15258
|
-
var btnPrimary = "
|
|
15259
|
-
var btnSecondary = "
|
|
15260
|
-
var historyHeader = "
|
|
15261
|
-
var searchInput = "
|
|
15262
|
-
var filterTabs = "
|
|
15263
|
-
var filterTab = "
|
|
15264
|
-
var active = "
|
|
15265
|
-
var taskList = "
|
|
15266
|
-
var emptyState = "
|
|
15267
|
-
var replayPanel = "
|
|
15268
|
-
var replayHeader = "
|
|
15269
|
-
var replayIcon = "
|
|
15270
|
-
var replayStatus = "
|
|
15271
|
-
var success = "
|
|
15272
|
-
var failed = "
|
|
15273
|
-
var eventList = "
|
|
15274
|
-
var eventItem = "
|
|
15275
|
-
var statusPending = "
|
|
15276
|
-
var statusRunning = "
|
|
15277
|
-
var pulse = "
|
|
15278
|
-
var statusSuccess = "
|
|
15279
|
-
var statusFailed = "
|
|
15280
|
-
var eventStatusIcon = "
|
|
15281
|
-
var eventDescription = "
|
|
15282
|
-
var eventDuration = "
|
|
15283
|
-
var errorDialog = "
|
|
15284
|
-
var errorHeader = "
|
|
15285
|
-
var errorIcon = "
|
|
15286
|
-
var errorDetails = "
|
|
15287
|
-
var errorCauses = "
|
|
15288
|
-
var errorActions = "
|
|
15289
|
-
var replayReport = "
|
|
15290
|
-
var failure = "
|
|
15291
|
-
var reportHeader = "
|
|
15292
|
-
var reportIcon = "
|
|
15293
|
-
var reportStats = "
|
|
15294
|
-
var statItem = "
|
|
15295
|
-
var statLabel = "
|
|
15296
|
-
var statValue = "
|
|
15297
|
-
var reportDetails = "
|
|
15298
|
-
var eventResult = "
|
|
15299
|
-
var reportActions = "
|
|
15300
|
-
var loadingContent = "
|
|
15301
|
-
var loadingSpinner = "
|
|
15302
|
-
var spin = "
|
|
15303
|
-
var taskCardDialog = "
|
|
15304
|
-
var settingsOverlay = "
|
|
15305
|
-
var settingsDialog = "
|
|
15306
|
-
var settingsDialogHeader = "
|
|
15307
|
-
var settingsDialogContent = "
|
|
15308
|
-
var settingsField = "
|
|
15309
|
-
var settingsLabel = "
|
|
15310
|
-
var settingsInput = "
|
|
15418
|
+
var recordingButton = "_recordingButton_1hion_4";
|
|
15419
|
+
var eventCounter = "_eventCounter_1hion_11";
|
|
15420
|
+
var exportOverlay = "_exportOverlay_1hion_31";
|
|
15421
|
+
var overlayFadeIn = "_overlayFadeIn_1hion_1";
|
|
15422
|
+
var exportDialog = "_exportDialog_1hion_52";
|
|
15423
|
+
var dialogSlideIn = "_dialogSlideIn_1hion_1";
|
|
15424
|
+
var exportDialogHeader = "_exportDialogHeader_1hion_74";
|
|
15425
|
+
var closeButton = "_closeButton_1hion_89";
|
|
15426
|
+
var exportDialogContent = "_exportDialogContent_1hion_110";
|
|
15427
|
+
var exportOptions = "_exportOptions_1hion_120";
|
|
15428
|
+
var exportOptionButton = "_exportOptionButton_1hion_126";
|
|
15429
|
+
var exportOptionIcon = "_exportOptionIcon_1hion_147";
|
|
15430
|
+
var exportOptionLabel = "_exportOptionLabel_1hion_152";
|
|
15431
|
+
var controlButton = "_controlButton_1hion_159";
|
|
15432
|
+
var controls = "_controls_1hion_179";
|
|
15433
|
+
var recording = "_recording_1hion_4";
|
|
15434
|
+
var recordingPulse = "_recordingPulse_1hion_1";
|
|
15435
|
+
var taskCard = "_taskCard_1hion_193";
|
|
15436
|
+
var taskCardHeader = "_taskCardHeader_1hion_209";
|
|
15437
|
+
var taskIcon = "_taskIcon_1hion_216";
|
|
15438
|
+
var taskName = "_taskName_1hion_220";
|
|
15439
|
+
var confidenceBadge = "_confidenceBadge_1hion_228";
|
|
15440
|
+
var taskStats = "_taskStats_1hion_237";
|
|
15441
|
+
var taskParameters = "_taskParameters_1hion_245";
|
|
15442
|
+
var parameterItem = "_parameterItem_1hion_258";
|
|
15443
|
+
var paramKey = "_paramKey_1hion_266";
|
|
15444
|
+
var paramValue = "_paramValue_1hion_271";
|
|
15445
|
+
var taskActions = "_taskActions_1hion_275";
|
|
15446
|
+
var actionButton = "_actionButton_1hion_280";
|
|
15447
|
+
var btnPrimary = "_btnPrimary_1hion_290";
|
|
15448
|
+
var btnSecondary = "_btnSecondary_1hion_301";
|
|
15449
|
+
var historyHeader = "_historyHeader_1hion_313";
|
|
15450
|
+
var searchInput = "_searchInput_1hion_327";
|
|
15451
|
+
var filterTabs = "_filterTabs_1hion_341";
|
|
15452
|
+
var filterTab = "_filterTab_1hion_341";
|
|
15453
|
+
var active = "_active_1hion_362";
|
|
15454
|
+
var taskList = "_taskList_1hion_368";
|
|
15455
|
+
var emptyState = "_emptyState_1hion_376";
|
|
15456
|
+
var replayPanel = "_replayPanel_1hion_385";
|
|
15457
|
+
var replayHeader = "_replayHeader_1hion_397";
|
|
15458
|
+
var replayIcon = "_replayIcon_1hion_405";
|
|
15459
|
+
var replayStatus = "_replayStatus_1hion_416";
|
|
15460
|
+
var success = "_success_1hion_421";
|
|
15461
|
+
var failed = "_failed_1hion_425";
|
|
15462
|
+
var eventList = "_eventList_1hion_431";
|
|
15463
|
+
var eventItem = "_eventItem_1hion_437";
|
|
15464
|
+
var statusPending = "_statusPending_1hion_449";
|
|
15465
|
+
var statusRunning = "_statusRunning_1hion_453";
|
|
15466
|
+
var pulse = "_pulse_1hion_1";
|
|
15467
|
+
var statusSuccess = "_statusSuccess_1hion_458";
|
|
15468
|
+
var statusFailed = "_statusFailed_1hion_462";
|
|
15469
|
+
var eventStatusIcon = "_eventStatusIcon_1hion_466";
|
|
15470
|
+
var eventDescription = "_eventDescription_1hion_472";
|
|
15471
|
+
var eventDuration = "_eventDuration_1hion_476";
|
|
15472
|
+
var errorDialog = "_errorDialog_1hion_493";
|
|
15473
|
+
var errorHeader = "_errorHeader_1hion_503";
|
|
15474
|
+
var errorIcon = "_errorIcon_1hion_511";
|
|
15475
|
+
var errorDetails = "_errorDetails_1hion_522";
|
|
15476
|
+
var errorCauses = "_errorCauses_1hion_536";
|
|
15477
|
+
var errorActions = "_errorActions_1hion_557";
|
|
15478
|
+
var replayReport = "_replayReport_1hion_566";
|
|
15479
|
+
var failure = "_failure_1hion_580";
|
|
15480
|
+
var reportHeader = "_reportHeader_1hion_584";
|
|
15481
|
+
var reportIcon = "_reportIcon_1hion_592";
|
|
15482
|
+
var reportStats = "_reportStats_1hion_603";
|
|
15483
|
+
var statItem = "_statItem_1hion_610";
|
|
15484
|
+
var statLabel = "_statLabel_1hion_614";
|
|
15485
|
+
var statValue = "_statValue_1hion_621";
|
|
15486
|
+
var reportDetails = "_reportDetails_1hion_628";
|
|
15487
|
+
var eventResult = "_eventResult_1hion_640";
|
|
15488
|
+
var reportActions = "_reportActions_1hion_656";
|
|
15489
|
+
var loadingContent = "_loadingContent_1hion_665";
|
|
15490
|
+
var loadingSpinner = "_loadingSpinner_1hion_671";
|
|
15491
|
+
var spin = "_spin_1hion_1";
|
|
15492
|
+
var taskCardDialog = "_taskCardDialog_1hion_695";
|
|
15493
|
+
var settingsOverlay = "_settingsOverlay_1hion_701";
|
|
15494
|
+
var settingsDialog = "_settingsDialog_1hion_713";
|
|
15495
|
+
var settingsDialogHeader = "_settingsDialogHeader_1hion_724";
|
|
15496
|
+
var settingsDialogContent = "_settingsDialogContent_1hion_739";
|
|
15497
|
+
var settingsField = "_settingsField_1hion_743";
|
|
15498
|
+
var settingsLabel = "_settingsLabel_1hion_747";
|
|
15499
|
+
var settingsInput = "_settingsInput_1hion_755";
|
|
15500
|
+
var testButton = "_testButton_1hion_806";
|
|
15501
|
+
var testButtonPrimary = "_testButtonPrimary_1hion_826";
|
|
15502
|
+
var testButtonLoading = "_testButtonLoading_1hion_848";
|
|
15503
|
+
var testButtonSuccess = "_testButtonSuccess_1hion_854";
|
|
15504
|
+
var testButtonError = "_testButtonError_1hion_861";
|
|
15505
|
+
var testBtnShake = "_testBtnShake_1hion_1";
|
|
15506
|
+
var testButtonSecondary = "_testButtonSecondary_1hion_888";
|
|
15507
|
+
var dslEditor = "_dslEditor_1hion_909";
|
|
15508
|
+
var resultStatus = "_resultStatus_1hion_935";
|
|
15509
|
+
var resultStatusRunning = "_resultStatusRunning_1hion_951";
|
|
15510
|
+
var resultStatusSuccess = "_resultStatusSuccess_1hion_955";
|
|
15511
|
+
var resultStatusError = "_resultStatusError_1hion_959";
|
|
15311
15512
|
var RecordingPanel_module_default = {
|
|
15312
15513
|
recordingButton,
|
|
15313
15514
|
eventCounter,
|
|
@@ -15390,7 +15591,19 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15390
15591
|
settingsDialogContent,
|
|
15391
15592
|
settingsField,
|
|
15392
15593
|
settingsLabel,
|
|
15393
|
-
settingsInput
|
|
15594
|
+
settingsInput,
|
|
15595
|
+
testButton,
|
|
15596
|
+
testButtonPrimary,
|
|
15597
|
+
testButtonLoading,
|
|
15598
|
+
testButtonSuccess,
|
|
15599
|
+
testButtonError,
|
|
15600
|
+
testBtnShake,
|
|
15601
|
+
testButtonSecondary,
|
|
15602
|
+
dslEditor,
|
|
15603
|
+
resultStatus,
|
|
15604
|
+
resultStatusRunning,
|
|
15605
|
+
resultStatusSuccess,
|
|
15606
|
+
resultStatusError
|
|
15394
15607
|
};
|
|
15395
15608
|
//#endregion
|
|
15396
15609
|
//#region src/TaskCard.ts
|
|
@@ -15788,7 +16001,10 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15788
16001
|
#testModeButton;
|
|
15789
16002
|
#testContainer;
|
|
15790
16003
|
#dslEditor;
|
|
15791
|
-
#
|
|
16004
|
+
#runButton;
|
|
16005
|
+
#resultStatus;
|
|
16006
|
+
#runButtonState = "default";
|
|
16007
|
+
#isTestMode = true;
|
|
15792
16008
|
#settingsButton;
|
|
15793
16009
|
constructor(agent, config) {
|
|
15794
16010
|
super(agent, {
|
|
@@ -15804,8 +16020,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15804
16020
|
onEdit: (task) => this.#handleEdit(task)
|
|
15805
16021
|
});
|
|
15806
16022
|
this.#setupRecordingUI();
|
|
15807
|
-
this.#setupTestModeUI();
|
|
15808
16023
|
this.#setupSettingsUI();
|
|
16024
|
+
this.#showTestPanel();
|
|
16025
|
+
if (this.#testModeButton) this.#testModeButton.style.color = "rgb(59, 130, 246)";
|
|
15809
16026
|
}
|
|
15810
16027
|
/**
|
|
15811
16028
|
* Setup recording UI elements
|
|
@@ -15866,41 +16083,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15866
16083
|
/**
|
|
15867
16084
|
* Setup test mode toggle button in header controls
|
|
15868
16085
|
*/
|
|
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
16086
|
/**
|
|
15892
16087
|
* Toggle between automation and test mode
|
|
15893
16088
|
*/
|
|
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
16089
|
/**
|
|
15905
16090
|
* Show test panel by injecting DSL editor into the panel
|
|
15906
16091
|
*/
|
|
@@ -15919,21 +16104,22 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15919
16104
|
container.appendChild(editorLabel);
|
|
15920
16105
|
this.#dslEditor = document.createElement("textarea");
|
|
15921
16106
|
this.#dslEditor.setAttribute("data-page-agent-ignore", "true");
|
|
16107
|
+
this.#dslEditor.className = RecordingPanel_module_default.dslEditor;
|
|
15922
16108
|
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
16109
|
container.appendChild(this.#dslEditor);
|
|
15925
16110
|
const placeholderStyle = document.createElement("style");
|
|
15926
16111
|
placeholderStyle.textContent = `
|
|
15927
|
-
|
|
15928
|
-
|
|
15929
|
-
|
|
15930
|
-
|
|
16112
|
+
[data-page-agent-ignore="true"]::placeholder {
|
|
16113
|
+
color: rgba(255, 255, 255, 0.4) !important;
|
|
16114
|
+
}
|
|
16115
|
+
`;
|
|
15931
16116
|
document.head.appendChild(placeholderStyle);
|
|
15932
16117
|
const btnRow = document.createElement("div");
|
|
15933
|
-
btnRow.style.cssText = "display: flex; gap:
|
|
15934
|
-
btnRow.appendChild(this.#
|
|
15935
|
-
|
|
15936
|
-
|
|
16118
|
+
btnRow.style.cssText = "display: flex; gap: 8px; align-items: center; min-height: 32px;";
|
|
16119
|
+
btnRow.appendChild(this.#createRunButton());
|
|
16120
|
+
this.#resultStatus = document.createElement("span");
|
|
16121
|
+
this.#resultStatus.className = RecordingPanel_module_default.resultStatus;
|
|
16122
|
+
btnRow.appendChild(this.#resultStatus);
|
|
15937
16123
|
container.appendChild(btnRow);
|
|
15938
16124
|
this.#testContainer = container;
|
|
15939
16125
|
this.wrapper.insertBefore(container, inputSection);
|
|
@@ -15951,55 +16137,81 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
15951
16137
|
if (historyWrapper) historyWrapper.style.display = "";
|
|
15952
16138
|
if (inputSection) inputSection.style.display = "";
|
|
15953
16139
|
}
|
|
15954
|
-
#
|
|
16140
|
+
#createRunButton() {
|
|
15955
16141
|
const btn = document.createElement("button");
|
|
15956
16142
|
btn.setAttribute("data-page-agent-ignore", "true");
|
|
15957
|
-
btn.
|
|
15958
|
-
btn.
|
|
15959
|
-
btn.
|
|
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
|
-
});
|
|
16143
|
+
btn.className = `${RecordingPanel_module_default.testButton} ${RecordingPanel_module_default.testButtonPrimary}`;
|
|
16144
|
+
btn.innerHTML = "<span style=\"font-size:12px;line-height:1\">▶</span><span> Run</span>";
|
|
16145
|
+
btn.title = "Run (执行测试)";
|
|
15965
16146
|
btn.addEventListener("click", (e) => {
|
|
15966
16147
|
e.stopPropagation();
|
|
15967
|
-
|
|
16148
|
+
this.#handleTestRun();
|
|
15968
16149
|
});
|
|
16150
|
+
this.#runButton = btn;
|
|
15969
16151
|
return btn;
|
|
15970
16152
|
}
|
|
16153
|
+
#setRunButtonState(state) {
|
|
16154
|
+
if (!this.#runButton || !this.#resultStatus) return;
|
|
16155
|
+
this.#runButton.classList.remove(RecordingPanel_module_default.testButtonLoading, RecordingPanel_module_default.testButtonSuccess, RecordingPanel_module_default.testButtonError);
|
|
16156
|
+
this.#runButtonState = state;
|
|
16157
|
+
switch (state) {
|
|
16158
|
+
case "default":
|
|
16159
|
+
this.#runButton.disabled = false;
|
|
16160
|
+
this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1\">▶</span><span> Run</span>";
|
|
16161
|
+
this.#runButton.title = "Run (执行测试)";
|
|
16162
|
+
this.#resultStatus.className = RecordingPanel_module_default.resultStatus;
|
|
16163
|
+
this.#resultStatus.textContent = "";
|
|
16164
|
+
break;
|
|
16165
|
+
case "loading":
|
|
16166
|
+
this.#runButton.disabled = true;
|
|
16167
|
+
this.#runButton.classList.add(RecordingPanel_module_default.testButtonLoading);
|
|
16168
|
+
this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1\">◉</span><span> Running…</span>";
|
|
16169
|
+
this.#runButton.title = "Running…";
|
|
16170
|
+
this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusRunning}`;
|
|
16171
|
+
this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">◉</span> Running…";
|
|
16172
|
+
break;
|
|
16173
|
+
case "success":
|
|
16174
|
+
this.#runButton.disabled = true;
|
|
16175
|
+
this.#runButton.classList.add(RecordingPanel_module_default.testButtonSuccess);
|
|
16176
|
+
this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1;font-weight:700\">✓</span><span> Done</span>";
|
|
16177
|
+
this.#runButton.title = "Success";
|
|
16178
|
+
this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusSuccess}`;
|
|
16179
|
+
this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">✓</span> All tasks passed";
|
|
16180
|
+
break;
|
|
16181
|
+
case "error":
|
|
16182
|
+
this.#runButton.disabled = true;
|
|
16183
|
+
this.#runButton.classList.add(RecordingPanel_module_default.testButtonError);
|
|
16184
|
+
this.#runButton.innerHTML = "<span style=\"font-size:12px;line-height:1;font-weight:700\">✕</span><span> Failed</span>";
|
|
16185
|
+
this.#runButton.title = "Failed";
|
|
16186
|
+
this.#resultStatus.className = `${RecordingPanel_module_default.resultStatus} ${RecordingPanel_module_default.resultStatusError}`;
|
|
16187
|
+
this.#resultStatus.innerHTML = "<span style=\"font-size:11px\">✕</span> Task failed";
|
|
16188
|
+
break;
|
|
16189
|
+
}
|
|
16190
|
+
}
|
|
15971
16191
|
async #handleTestRun() {
|
|
15972
|
-
if (!this.#dslEditor || !this.#config.onRunTest) return;
|
|
16192
|
+
if (!this.#dslEditor || !this.#config.onRunTest || !this.#runButton) return;
|
|
16193
|
+
if (this.#runButtonState !== "default") return;
|
|
15973
16194
|
const dsl = this.#dslEditor.value.trim();
|
|
15974
16195
|
if (!dsl) return;
|
|
15975
16196
|
const parsed = parseTestSpec(dsl);
|
|
15976
16197
|
if (!parsed.success) {
|
|
15977
16198
|
console.error("Parse error:", parsed.errors);
|
|
16199
|
+
this.#setRunButtonState("error");
|
|
16200
|
+
if (this.#resultStatus) this.#resultStatus.textContent = "✕ YAML parse error";
|
|
15978
16201
|
return;
|
|
15979
16202
|
}
|
|
16203
|
+
this.#setRunButtonState("loading");
|
|
15980
16204
|
try {
|
|
15981
16205
|
await this.#config.onRunTest(dsl);
|
|
16206
|
+
this.#setRunButtonState("success");
|
|
15982
16207
|
} catch (error) {
|
|
15983
16208
|
console.error("Test failed:", error);
|
|
16209
|
+
this.#setRunButtonState("error");
|
|
16210
|
+
if (this.#resultStatus) this.#resultStatus.textContent = `\u2715 ${error instanceof Error ? error.message : "Test failed"}`;
|
|
15984
16211
|
}
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
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");
|
|
16212
|
+
setTimeout(() => {
|
|
16213
|
+
this.#setRunButtonState("default");
|
|
16214
|
+
}, 2e3);
|
|
16003
16215
|
}
|
|
16004
16216
|
#updateRecordingUI(isRecording) {
|
|
16005
16217
|
if (!this.#recordingButton) return;
|
|
@@ -16114,9 +16326,9 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
16114
16326
|
const content = document.createElement("div");
|
|
16115
16327
|
content.className = RecordingPanel_module_default.loadingContent;
|
|
16116
16328
|
content.innerHTML = `
|
|
16117
|
-
|
|
16118
|
-
|
|
16119
|
-
|
|
16329
|
+
<div class="${RecordingPanel_module_default.loadingSpinner}"></div>
|
|
16330
|
+
<p>${message}</p>
|
|
16331
|
+
`;
|
|
16120
16332
|
overlay.appendChild(content);
|
|
16121
16333
|
document.body.appendChild(overlay);
|
|
16122
16334
|
this.#currentOverlay = overlay;
|
|
@@ -16184,29 +16396,29 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
16184
16396
|
const header = document.createElement("div");
|
|
16185
16397
|
header.className = RecordingPanel_module_default.exportDialogHeader;
|
|
16186
16398
|
header.innerHTML = `
|
|
16187
|
-
|
|
16188
|
-
|
|
16189
|
-
|
|
16399
|
+
<h3>${this.#i18n.t("ui.panel.exportRecording")}</h3>
|
|
16400
|
+
<button class="${RecordingPanel_module_default.closeButton}">×</button>
|
|
16401
|
+
`;
|
|
16190
16402
|
dialog.appendChild(header);
|
|
16191
16403
|
const content = document.createElement("div");
|
|
16192
16404
|
content.className = RecordingPanel_module_default.exportDialogContent;
|
|
16193
16405
|
content.innerHTML = `
|
|
16194
|
-
|
|
16195
|
-
|
|
16196
|
-
|
|
16197
|
-
|
|
16198
|
-
|
|
16199
|
-
|
|
16200
|
-
|
|
16201
|
-
|
|
16202
|
-
|
|
16203
|
-
|
|
16204
|
-
|
|
16205
|
-
|
|
16206
|
-
|
|
16207
|
-
|
|
16208
|
-
|
|
16209
|
-
|
|
16406
|
+
<p>${this.#i18n.t("ui.panel.recordedEvents", { count: events.length })}</p>
|
|
16407
|
+
<div class="${RecordingPanel_module_default.exportOptions}">
|
|
16408
|
+
<button data-format="json" class="${RecordingPanel_module_default.exportOptionButton}">
|
|
16409
|
+
<div class="${RecordingPanel_module_default.exportOptionIcon}">{}</div>
|
|
16410
|
+
<div class="${RecordingPanel_module_default.exportOptionLabel}">JSON</div>
|
|
16411
|
+
</button>
|
|
16412
|
+
<button data-format="markdown" class="${RecordingPanel_module_default.exportOptionButton}">
|
|
16413
|
+
<div class="${RecordingPanel_module_default.exportOptionIcon}">M↓</div>
|
|
16414
|
+
<div class="${RecordingPanel_module_default.exportOptionLabel}">Markdown</div>
|
|
16415
|
+
</button>
|
|
16416
|
+
<button data-format="playwright" class="${RecordingPanel_module_default.exportOptionButton}">
|
|
16417
|
+
<div class="${RecordingPanel_module_default.exportOptionIcon}">🎭</div>
|
|
16418
|
+
<div class="${RecordingPanel_module_default.exportOptionLabel}">Playwright</div>
|
|
16419
|
+
</button>
|
|
16420
|
+
</div>
|
|
16421
|
+
`;
|
|
16210
16422
|
dialog.appendChild(content);
|
|
16211
16423
|
overlay.appendChild(dialog);
|
|
16212
16424
|
document.body.appendChild(overlay);
|
|
@@ -16300,39 +16512,39 @@ Now analyze the action sequence above and return ONLY JSON (no markdown):
|
|
|
16300
16512
|
const header = document.createElement("div");
|
|
16301
16513
|
header.className = RecordingPanel_module_default.settingsDialogHeader || RecordingPanel_module_default.exportDialogHeader;
|
|
16302
16514
|
header.innerHTML = `
|
|
16303
|
-
|
|
16304
|
-
|
|
16305
|
-
|
|
16515
|
+
<h3>Settings</h3>
|
|
16516
|
+
<button class="${RecordingPanel_module_default.closeButton}">×</button>
|
|
16517
|
+
`;
|
|
16306
16518
|
dialog.appendChild(header);
|
|
16307
16519
|
const content = document.createElement("div");
|
|
16308
16520
|
content.className = RecordingPanel_module_default.settingsDialogContent || RecordingPanel_module_default.exportDialogContent;
|
|
16309
16521
|
const currentConfig = this.#loadConfigFromStorage();
|
|
16310
16522
|
content.innerHTML = `
|
|
16311
|
-
|
|
16312
|
-
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16329
|
-
|
|
16523
|
+
<div class="${RecordingPanel_module_default.settingsField}">
|
|
16524
|
+
<label class="${RecordingPanel_module_default.settingsLabel}">Model</label>
|
|
16525
|
+
<input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-model"
|
|
16526
|
+
value="${this.#escapeHtml(currentConfig?.model || "")}"
|
|
16527
|
+
placeholder="deepseek-v4-flash" />
|
|
16528
|
+
</div>
|
|
16529
|
+
<div class="${RecordingPanel_module_default.settingsField}">
|
|
16530
|
+
<label class="${RecordingPanel_module_default.settingsLabel}">API Base URL</label>
|
|
16531
|
+
<input type="text" class="${RecordingPanel_module_default.settingsInput}" id="settings-baseurl"
|
|
16532
|
+
value="${this.#escapeHtml(currentConfig?.baseURL || "")}"
|
|
16533
|
+
placeholder="https://api.deepseek.com" />
|
|
16534
|
+
</div>
|
|
16535
|
+
<div class="${RecordingPanel_module_default.settingsField}">
|
|
16536
|
+
<label class="${RecordingPanel_module_default.settingsLabel}">API Key (optional)</label>
|
|
16537
|
+
<input type="password" class="${RecordingPanel_module_default.settingsInput}" id="settings-apikey"
|
|
16538
|
+
value="${this.#escapeHtml(currentConfig?.apiKey || "")}"
|
|
16539
|
+
placeholder="••••••••" />
|
|
16540
|
+
</div>
|
|
16541
|
+
`;
|
|
16330
16542
|
const buttonRow = document.createElement("div");
|
|
16331
16543
|
buttonRow.style.cssText = "display: flex; gap: 8px; justify-content: flex-end; padding: 20px;";
|
|
16332
16544
|
buttonRow.innerHTML = `
|
|
16333
|
-
|
|
16334
|
-
|
|
16335
|
-
|
|
16545
|
+
<button id="settings-cancel" class="${RecordingPanel_module_default.btnSecondary}">Cancel</button>
|
|
16546
|
+
<button id="settings-save" class="${RecordingPanel_module_default.btnPrimary}">Save</button>
|
|
16547
|
+
`;
|
|
16336
16548
|
dialog.appendChild(content);
|
|
16337
16549
|
dialog.appendChild(buttonRow);
|
|
16338
16550
|
overlay.appendChild(dialog);
|
|
@@ -16584,4 +16796,4 @@ tasks:
|
|
|
16584
16796
|
//#endregion
|
|
16585
16797
|
})();
|
|
16586
16798
|
|
|
16587
|
-
//# sourceMappingURL=page-
|
|
16799
|
+
//# sourceMappingURL=page-test.demo.js.map
|