@nostop/page 0.1.0-rc.5 → 0.1.0-rc.6
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/esm/page-agent.js +549 -167
- package/dist/esm/page-agent.js.map +1 -1
- package/dist/iife/page-agent.demo.js +17 -14
- package/package.json +1 -1
package/dist/esm/page-agent.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function() { try { if (typeof document != "undefined") { var elementStyle = document.createElement("style"); elementStyle.appendChild(document.createTextNode("/* Page Agent panel. Design from the modern renderer; dark by default, light when the system asks for it. */\n\n._wrapper_1e3bu_3 {\n overscroll-behavior: contain;\n --pa-fg: #f4f3ee;\n --pa-muted: #aaa9a1;\n --pa-accent: #fa8d45;\n --pa-surface: #191918;\n --pa-raised: #20201e;\n --pa-line: rgba(244, 243, 238, 0.12);\n --pa-ok: #b1d8b8;\n --pa-warn: #ead39a;\n --pa-err: #ffb9a9;\n --pa-radius: 18px;\n --pa-c-keyword: #fa8d45;\n --pa-c-string: #b1d8b8;\n --pa-c-number: #ead39a;\n --pa-c-key: #9ec5f0;\n --pa-c-bool: #ffb9a9;\n --pa-c-comment: #7d7c75;\n --pa-c-name: #f4f3ee;\n --pa-c-punct: #aaa9a1;\n\n position: fixed;\n bottom: 100px;\n left: 0;\n right: 0;\n margin: 0 auto;\n transform: translateY(20px);\n opacity: 0;\n z-index: 2147483642;\n box-sizing: border-box;\n /* 100% of the fixed containing block — avoids the classic 100vw horizontal overflow on mobile. */\n width: min(414px, calc(100% - 24px));\n max-height: min(640px, calc(100svh - 120px));\n display: none;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--pa-line);\n border-radius: var(--pa-radius);\n background: var(--pa-surface);\n color: var(--pa-fg);\n box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);\n font:\n 13px/1.4 system-ui,\n -apple-system,\n 'Segoe UI',\n sans-serif;\n transition:\n opacity 0.2s ease,\n transform 0.2s ease,\n box-shadow 0.3s ease,\n width 0.2s ease;\n}\n\n@media (min-width: 481px) {\n ._wrapper_1e3bu_3[data-mode='skills-studio'] {\n width: min(560px, calc(100vw - 24px));\n }\n}\n\n._wrapper_1e3bu_3 *,\n._wrapper_1e3bu_3 *::before,\n._wrapper_1e3bu_3 *::after {\n box-sizing: border-box;\n}\n\n._wrapper_1e3bu_3[data-state='running'] {\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--pa-accent) 55%, transparent),\n 0 16px 40px rgba(0, 0, 0, 0.35);\n}\n\n._wrapper_1e3bu_3[data-state='waiting'] {\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--pa-accent) 80%, transparent),\n 0 16px 40px rgba(0, 0, 0, 0.35);\n}\n\n._wrapper_1e3bu_3._collapsed_1e3bu_80 ._feedWrap_1e3bu_80 {\n display: none;\n}\n\n/* Follow bar (mobile peek strip). Hidden unless data-follow=\"bar\" on narrow viewports. */\n._followBar_1e3bu_85 {\n display: none;\n flex: none;\n align-items: center;\n gap: 8px;\n min-height: 56px;\n padding: 8px 10px;\n padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));\n}\n\n._followBarBody_1e3bu_95 {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n._followBarStatus_1e3bu_110 {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._followBarLens_1e3bu_120 {\n width: 28px;\n height: 28px;\n}\n\n._followBarLens_1e3bu_120 svg {\n width: 14px;\n height: 14px;\n}\n\n._voiceActions_1e3bu_130 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n/* Voice stop is for the mobile expanded voice layout; desktop keeps Stop in the header. */\n._voiceActions_1e3bu_130 [data-role='voice-stop'] {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n/* Header */\n\n._header_1e3bu_148 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n height: 52px;\n padding: 0 12px 0 14px;\n border-bottom: 1px solid var(--pa-line);\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n._brand_1e3bu_161:has(img) {\n background: transparent;\n}\n\n._brand_1e3bu_161 img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: inherit;\n}\n\n._brand_1e3bu_161 {\n flex: none;\n width: 30px;\n height: 30px;\n display: grid;\n place-items: center;\n border-radius: 10px;\n background: var(--pa-accent);\n color: #20150e;\n font-weight: 800;\n font-size: 16px;\n}\n\n._titleBlock_1e3bu_185 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n}\n\n._title_1e3bu_185 {\n font-size: 12px;\n font-weight: 650;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._status_1e3bu_200 {\n font-size: 10.5px;\n color: var(--pa-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._controls_1e3bu_208 {\n flex: none;\n display: flex;\n gap: 2px;\n}\n\n._iconButton_1e3bu_214 {\n display: grid;\n place-items: center;\n min-width: 28px;\n min-height: 28px;\n padding: 0;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n._iconButton_1e3bu_214:hover {\n background: rgba(255, 255, 255, 0.08);\n}\n\n._stopButton_1e3bu_232 {\n color: #ff8a80;\n}\n\n/* Feed */\n\n._feedWrap_1e3bu_80 {\n position: relative;\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 120px;\n max-height: 380px;\n}\n\n._feed_1e3bu_80 {\n position: relative;\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px 18px 14px 14px;\n scroll-behavior: auto;\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, var(--pa-muted) 40%, transparent) transparent;\n}\n\n/* Right-edge rail: viewport thumb plus one marker per turn, question and result. Click a marker to jump. */\n._rail_1e3bu_263 {\n position: absolute;\n top: 8px;\n bottom: 8px;\n right: 0;\n width: 16px;\n opacity: 0.55;\n transition: opacity 0.2s ease;\n}\n\n._rail_1e3bu_263::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 6px;\n width: 2px;\n border-radius: 2px;\n background: var(--pa-line);\n}\n\n._feedWrap_1e3bu_80:hover ._rail_1e3bu_263,\n._feedWrap_1e3bu_80:focus-within ._rail_1e3bu_263 {\n opacity: 1;\n}\n\n._feedWrap_1e3bu_80:hover ._rail_1e3bu_263,\n._feedWrap_1e3bu_80:focus-within ._rail_1e3bu_263 {\n opacity: 1;\n}\n\n._railThumb_1e3bu_294 {\n position: absolute;\n right: 6px;\n width: 2px;\n border-radius: 2px;\n background: var(--pa-muted);\n transition: top 0.12s ease;\n}\n\n._railMark_1e3bu_303 {\n position: absolute;\n right: 2px;\n height: 3px;\n width: 10px;\n margin-top: -1px;\n padding: 0;\n border: 0;\n border-radius: 3px;\n background: var(--pa-muted);\n opacity: 0.7;\n cursor: pointer;\n transition:\n width 0.15s ease,\n opacity 0.15s ease,\n background-color 0.15s ease;\n}\n\n._railMark_1e3bu_303[data-kind='turn'] {\n width: 14px;\n}\n\n._railMark_1e3bu_303[data-kind='question'],\n._railMark_1e3bu_303[data-kind='result'] {\n width: 6px;\n height: 6px;\n right: 4px;\n margin-top: -2px;\n border-radius: 50%;\n}\n\n._railMark_1e3bu_303[data-kind='question'] {\n background: var(--pa-accent);\n opacity: 1;\n}\n\n._railMark_1e3bu_303[data-kind='result'] {\n background: var(--pa-ok);\n opacity: 1;\n}\n\n._railMark_1e3bu_303[data-active='true'] {\n width: 18px;\n opacity: 1;\n background: var(--pa-fg);\n}\n\n._railMark_1e3bu_303[data-pinned='true'] {\n background: var(--pa-accent);\n opacity: 1;\n}\n\n._railMark_1e3bu_303:hover {\n width: 18px;\n opacity: 1;\n}\n\n._railMark_1e3bu_303[data-kind='question'] {\n background: var(--pa-accent);\n}\n\n._railMark_1e3bu_303[data-kind='turn'] {\n background: var(--pa-muted);\n}\n\n._railMark_1e3bu_303[data-kind='result'] {\n background: var(--pa-ok);\n}\n\n/* Divider between finished tasks and the current one. */\n._divider_1e3bu_373 {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 6px 0;\n color: var(--pa-muted);\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n}\n\n._divider_1e3bu_373::before,\n._divider_1e3bu_373::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--pa-line);\n}\n\n/* Hover card for a rail tick. */\n._peek_1e3bu_393 {\n position: absolute;\n right: 26px;\n z-index: 6;\n width: min(260px, calc(100% - 56px));\n padding: 10px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-surface);\n box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);\n animation: _peekIn_1e3bu_1 0.16s ease-out both;\n}\n\n._peek_1e3bu_393[hidden] {\n display: none !important;\n}\n\n@keyframes _peekIn_1e3bu_1 {\n from {\n opacity: 0;\n transform: translateX(6px);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n._peekHead_1e3bu_421 {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n._peekHead_1e3bu_421 strong {\n flex: 1;\n min-width: 0;\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._peekText_1e3bu_436 {\n margin: 6px 0 0;\n max-height: 4.2em;\n overflow: hidden;\n color: var(--pa-muted);\n font-size: 11.5px;\n line-height: 1.4;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);\n mask-image: linear-gradient(to bottom, #000 60%, transparent);\n}\n\n._pin_1e3bu_449 {\n flex: none;\n display: grid;\n place-items: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--pa-muted);\n cursor: pointer;\n}\n\n._pin_1e3bu_449:hover {\n background: rgba(255, 255, 255, 0.08);\n color: var(--pa-fg);\n}\n\n._pin_1e3bu_449[aria-pressed='true'] {\n color: var(--pa-accent);\n}\n\n._pin_1e3bu_449[aria-pressed='true'] svg {\n fill: currentColor;\n}\n\n._pin_1e3bu_449 svg {\n width: 14px;\n height: 14px;\n}\n\n/* Jump pill: appears while reading above, shows how many new events arrived. */\n._jump_1e3bu_482 {\n position: absolute;\n left: 50%;\n bottom: 10px;\n transform: translateX(-50%);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px 6px 9px;\n border: 0;\n border-radius: 999px;\n background: var(--pa-fg);\n color: var(--pa-surface);\n font-size: 11px;\n font-weight: 600;\n white-space: nowrap;\n box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n animation: _jumpIn_1e3bu_1 0.22s ease-out both;\n}\n\n._jump_1e3bu_482 svg {\n width: 14px;\n height: 14px;\n}\n\n._jump_1e3bu_482[hidden] {\n display: none !important;\n}\n\n@keyframes _jumpIn_1e3bu_1 {\n from {\n opacity: 0;\n transform: translate(-50%, 6px);\n }\n to {\n opacity: 1;\n transform: translate(-50%, 0);\n }\n}\n\n._empty_1e3bu_523 {\n margin: auto;\n padding: 24px 8px;\n text-align: center;\n color: var(--pa-muted);\n font-size: 13px;\n}\n\n._enter_1e3bu_531 {\n animation: _enter_1e3bu_531 0.2s ease-out both;\n}\n\n@keyframes _enter_1e3bu_531 {\n from {\n opacity: 0;\n transform: translateY(4px);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n._bubble_1e3bu_546 {\n align-self: flex-end;\n max-width: 85%;\n padding: 8px 12px;\n border-radius: 14px 14px 4px 14px;\n background: var(--pa-raised);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._line_1e3bu_556 {\n font-size: 12px;\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._reflection_1e3bu_563 {\n padding-left: 8px;\n border-left: 2px solid var(--pa-line);\n}\n\n._observation_1e3bu_568 {\n font-size: 12px;\n}\n\n._warning_1e3bu_572 {\n color: var(--pa-warn);\n}\n\n._live_1e3bu_576 {\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--pa-accent);\n}\n\n._live_1e3bu_576::before {\n content: '';\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--pa-accent);\n animation: _pulse_1e3bu_1 1.6s ease-in-out infinite;\n}\n\n@keyframes _pulse_1e3bu_1 {\n 0%,\n 100% {\n opacity: 0.35;\n }\n 50% {\n opacity: 1;\n }\n}\n\n/* Tool cards */\n\n._tool_1e3bu_605 {\n padding: 9px 11px;\n border: 1px solid var(--pa-line);\n border-radius: 11px;\n background: var(--pa-raised);\n font-size: 12px;\n}\n\n._tool_1e3bu_605[data-status='running'] {\n border-color: color-mix(in srgb, var(--pa-accent) 50%, transparent);\n}\n\n._tool_1e3bu_605[data-status='error'] {\n border-color: color-mix(in srgb, var(--pa-err) 55%, transparent);\n color: var(--pa-err);\n}\n\n._toolHead_1e3bu_622 {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n._toolDot_1e3bu_628 {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--pa-ok);\n}\n\n._toolLabel_1e3bu_636 {\n font-weight: 600;\n overflow-wrap: anywhere;\n}\n\n._toolDetail_1e3bu_641 {\n margin-top: 5px;\n padding-left: 15px;\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._spinner_1e3bu_649 {\n flex: none;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--pa-accent);\n border-right-color: transparent;\n border-radius: 50%;\n animation: _spin_1e3bu_649 0.9s linear infinite;\n}\n\n@keyframes _spin_1e3bu_649 {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Question and result cards */\n\n._question_1e3bu_667 {\n padding: 2px 0 2px 12px;\n border-left: 2px solid var(--pa-accent);\n}\n\n._questionTag_1e3bu_672 {\n display: block;\n margin-bottom: 4px;\n color: var(--pa-accent);\n font-size: 11px;\n font-weight: 650;\n}\n\n._questionText_1e3bu_680 {\n margin: 0;\n font-size: 14px;\n}\n\n._result_1e3bu_685 {\n padding: 11px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-raised);\n font-size: 12px;\n}\n\n._result_1e3bu_685 strong {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n}\n\n._result_1e3bu_685[data-kind='done'] strong {\n color: var(--pa-ok);\n}\n\n._result_1e3bu_685[data-kind='notDone'] strong,\n._result_1e3bu_685[data-kind='stopped'] strong {\n color: var(--pa-warn);\n}\n\n._result_1e3bu_685[data-kind='error'] strong {\n color: var(--pa-err);\n}\n\n._resultText_1e3bu_712 {\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n/* Composer (text input and voice toggle share this area) */\n\n._composer_1e3bu_720 {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._answerContext_1e3bu_729 {\n font-size: 11px;\n color: var(--pa-accent);\n font-weight: 650;\n}\n\n._box_1e3bu_735 {\n display: flex;\n align-items: flex-end;\n gap: 6px;\n padding: 6px 6px 6px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 16px;\n background: var(--pa-raised);\n}\n\n._box_1e3bu_735:focus-within {\n outline: 2px solid var(--pa-accent);\n outline-offset: 2px;\n}\n\n._box_1e3bu_735 textarea {\n flex: 1;\n min-width: 0;\n min-height: 28px;\n max-height: 120px;\n resize: none;\n border: 0;\n outline: none;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 1.4;\n padding: 5px 0;\n}\n\n._box_1e3bu_735 textarea:disabled {\n opacity: 0.6;\n}\n\n._box_1e3bu_735 textarea::placeholder {\n color: var(--pa-muted);\n}\n\n._actions_1e3bu_774 {\n flex: none;\n display: flex;\n gap: 4px;\n}\n\n._attachList_1e3bu_780 {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n}\n\n._attachChip_1e3bu_787 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n max-width: 100%;\n padding: 2px 4px 2px 8px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.08);\n font-size: 12px;\n line-height: 1.3;\n}\n\n._attachName_1e3bu_799 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 180px;\n}\n\n._attachRemove_1e3bu_806 {\n display: grid;\n place-items: center;\n padding: 0;\n width: 20px;\n height: 20px;\n border: 0;\n border-radius: 50%;\n background: transparent;\n color: inherit;\n cursor: pointer;\n opacity: 0.7;\n}\n\n._attachRemove_1e3bu_806:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n}\n\n._attachRemove_1e3bu_806 svg {\n width: 12px;\n height: 12px;\n}\n\n._attachError_1e3bu_830 {\n color: #f5a3a3;\n font-size: 12px;\n line-height: 1.3;\n}\n\n._roundButton_1e3bu_836 {\n display: grid;\n place-items: center;\n padding: 0;\n width: 30px;\n height: 30px;\n border: 0;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.08);\n color: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n._roundButton_1e3bu_836[aria-pressed='true'] {\n background: color-mix(in srgb, var(--pa-accent) 35%, transparent);\n}\n\n._send_1e3bu_854 {\n background: var(--pa-accent);\n color: #20150e;\n font-weight: 800;\n}\n\n._roundButton_1e3bu_836:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Skills Studio (replaces feed + composer while authoring skills) */\n\n._studio_1e3bu_867 {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._studioHeader_1e3bu_877 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n._studioTitle_1e3bu_884 {\n font-size: 14px;\n font-weight: 700;\n}\n\n._studioTabs_1e3bu_889 {\n display: flex;\n gap: 4px;\n}\n\n._studioTab_1e3bu_889 {\n flex: 1;\n padding: 6px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: transparent;\n color: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioTab_1e3bu_889[aria-selected='true'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n}\n\n._studioBody_1e3bu_911 {\n flex: 1;\n min-height: 0;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n._studioHint_1e3bu_920 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 12px;\n line-height: 1.4;\n}\n\n._studioToolbar_1e3bu_927 {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n._studioToolButton_1e3bu_933 {\n flex: none;\n padding: 6px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: var(--pa-raised);\n color: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioToolButton_1e3bu_933:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n._studioToolButton_1e3bu_933[data-variant='accent'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n}\n\n._studioToolButton_1e3bu_933[data-variant='danger'] {\n color: var(--pa-err);\n}\n\n._studioStatus_1e3bu_959 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 11px;\n line-height: 1.4;\n white-space: pre-wrap;\n}\n\n._studioStatus_1e3bu_959[data-tone='ok'] {\n color: var(--pa-ok);\n}\n\n._studioStatus_1e3bu_959[data-tone='warn'] {\n color: var(--pa-warn);\n}\n\n._studioStatus_1e3bu_959[data-tone='err'] {\n color: var(--pa-err);\n}\n\n._studioAsk_1e3bu_979 {\n width: 100%;\n min-height: 72px;\n resize: vertical;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-raised);\n color: inherit;\n font: inherit;\n line-height: 1.4;\n}\n\n._studioAsk_1e3bu_979:focus {\n outline: 2px solid var(--pa-accent);\n outline-offset: 2px;\n}\n\n._studioSteps_1e3bu_997,\n._studioCatalog_1e3bu_998 {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-size: 12px;\n line-height: 1.45;\n}\n\n._studioStep_1e3bu_997,\n._studioCatalogRow_1e3bu_1010 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: rgba(255, 255, 255, 0.04);\n}\n\n._studioCatalogRow_1e3bu_1010 {\n padding: 6px 8px;\n gap: 6px;\n}\n\n._studioWatchers_1e3bu_1025 {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: color-mix(in srgb, var(--pa-raised) 85%, transparent);\n}\n\n._studioWatchersHead_1e3bu_1035 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n._studioWatchersTitle_1e3bu_1042 {\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n color: var(--pa-muted);\n}\n\n._studioWatchersEmpty_1e3bu_1050 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 11px;\n}\n\n._studioWatchersList_1e3bu_1056 {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n._studioWatcherChip_1e3bu_1065 {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: 100%;\n padding: 4px 6px 4px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.06);\n font-size: 11px;\n line-height: 1.3;\n}\n\n._studioWatcherLabel_1e3bu_1078 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 600;\n}\n\n._studioWatcherMeta_1e3bu_1086 {\n color: var(--pa-muted);\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n._studioWatcherChip_1e3bu_1065 button {\n padding: 2px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 999px;\n background: transparent;\n color: inherit;\n font-size: 10px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioWatcherChip_1e3bu_1065 button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n._studioStepBody_1e3bu_1109,\n._studioCatalogBody_1e3bu_1110 {\n flex: 1;\n min-width: 0;\n}\n\n._studioStepKind_1e3bu_1115 {\n display: inline-block;\n margin-right: 6px;\n padding: 1px 6px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--pa-accent) 22%, transparent);\n font-size: 10px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n._studioStepMeta_1e3bu_1127,\n._studioCatalogMeta_1e3bu_1128 {\n color: var(--pa-muted);\n font-size: 11px;\n}\n\n._studioStepActions_1e3bu_1133,\n._studioCatalogActions_1e3bu_1134 {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n}\n\n._studioStepActions_1e3bu_1133 button,\n._studioCatalogActions_1e3bu_1134 button {\n padding: 4px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font-size: 11px;\n cursor: pointer;\n}\n\n._studioCatalogActions_1e3bu_1134 button[data-variant='accent'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n font-weight: 700;\n}\n\n._studioStepActions_1e3bu_1133 button:disabled,\n._studioCatalogActions_1e3bu_1134 button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n@media (min-width: 768px) {\n ._wrapper_1e3bu_3[data-mode='skills-studio'] ._studioToolbar_1e3bu_927 {\n gap: 8px;\n }\n\n ._wrapper_1e3bu_3[data-mode='skills-studio'] ._studioToolButton_1e3bu_933 {\n padding: 7px 12px;\n }\n\n ._wrapper_1e3bu_3[data-mode='skills-studio'] ._studioCatalog_1e3bu_998 {\n gap: 5px;\n }\n}\n\n._studioPreviewLabel_1e3bu_1177 {\n margin: 0;\n font-size: 11px;\n font-weight: 700;\n color: var(--pa-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n._studioPreview_1e3bu_1177 {\n margin: 0;\n max-height: 180px;\n overflow: auto;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: var(--pa-raised);\n font:\n 11px/1.45 ui-monospace,\n SFMono-Regular,\n Menlo,\n Consolas,\n monospace;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n/* Voice stage (replaces the composer while voice is selected) */\n\n._voice_1e3bu_130 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._voiceMeta_1e3bu_1215 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n._lens_1e3bu_1223 {\n flex: none;\n display: grid;\n place-items: center;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n color: var(--pa-muted);\n background: var(--pa-raised);\n border: 1px solid var(--pa-line);\n transition:\n border-color 0.3s ease,\n color 0.3s ease,\n opacity 0.3s ease;\n}\n\n._lens_1e3bu_1223 svg {\n width: 15px;\n height: 15px;\n}\n\n/* Microphone state: active breathes in accent, muted is dimmed, blocked or unavailable is red. */\n._lens_1e3bu_1223[data-state='active'] {\n color: var(--pa-accent);\n border-color: var(--pa-accent);\n animation: _breathe_1e3bu_1 2.8s ease-in-out infinite;\n}\n\n._lens_1e3bu_1223[data-state='muted'] {\n opacity: 0.5;\n}\n\n._lens_1e3bu_1223[data-state='denied'],\n._lens_1e3bu_1223[data-state='unsupported'] {\n color: var(--pa-err);\n border-color: var(--pa-err);\n}\n\n@keyframes _breathe_1e3bu_1 {\n 50% {\n transform: scale(1.06);\n }\n}\n\n._voiceText_1e3bu_1267 {\n min-width: 0;\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._micDevice_1e3bu_1276 {\n min-width: 0;\n max-width: 100%;\n align-self: start;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--pa-muted);\n font: inherit;\n font-size: 10.5px;\n font-weight: 500;\n line-height: 1.3;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n\n._micDevice_1e3bu_1276:disabled {\n cursor: default;\n opacity: 0.7;\n}\n\n._micDevice_1e3bu_1276:not(:disabled):hover {\n color: var(--pa-accent);\n}\n\n._textButton_1e3bu_1305 {\n flex: none;\n white-space: nowrap;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 9px;\n background: var(--pa-raised);\n color: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n/* Pressed toggles (agent cursor visible, microphone on) read as on: tinted background and accent icon. */\n._iconButton_1e3bu_214[aria-pressed='true'] {\n background: color-mix(in srgb, var(--pa-accent) 22%, transparent);\n color: var(--pa-accent);\n}\n\n/* Floating button shown while the panel is closed. Snaps to a corner after dragging. */\n._fab_1e3bu_1324 {\n position: fixed;\n z-index: 2147483642;\n display: grid;\n place-items: center;\n width: 46px;\n height: 46px;\n padding: 0;\n border: 1px solid var(--pa-line);\n border-radius: 50%;\n background: var(--pa-surface);\n color: var(--pa-accent);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n touch-action: none;\n user-select: none;\n transition:\n transform 0.2s ease,\n box-shadow 0.2s ease;\n}\n\n._fab_1e3bu_1324:hover {\n transform: scale(1.06);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);\n}\n\n._fab_1e3bu_1324[hidden] {\n display: none !important;\n}\n\n._fab_1e3bu_1324 img {\n width: 26px;\n height: 26px;\n object-fit: contain;\n border-radius: 6px;\n pointer-events: none;\n}\n\n._fab_1e3bu_1324 svg {\n width: 20px;\n height: 20px;\n pointer-events: none;\n}\n\n._fabLeft_1e3bu_1368::after {\n left: 0;\n right: auto;\n}\n\n/* Icon hints: a short label on hover or keyboard focus. */\n._tip_1e3bu_1374:not(._fab_1e3bu_1324) {\n position: relative;\n}\n\n._tip_1e3bu_1374::after {\n content: attr(data-tip);\n position: absolute;\n top: calc(100% + 6px);\n right: 0;\n z-index: 10;\n padding: 4px 8px;\n border-radius: 6px;\n background: var(--pa-fg);\n color: var(--pa-surface);\n font-size: 11px;\n font-weight: 550;\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n._tipUp_1e3bu_1397::after {\n top: auto;\n bottom: calc(100% + 6px);\n}\n\n._tip_1e3bu_1374:hover::after,\n._tip_1e3bu_1374:focus-visible::after {\n opacity: 1;\n}\n\n._iconButton_1e3bu_214 svg,\n._roundButton_1e3bu_836 svg {\n display: block;\n}\n\n/* Light theme */\n\n@media (prefers-color-scheme: light) {\n ._wrapper_1e3bu_3 {\n --pa-fg: #171716;\n --pa-muted: #61615b;\n --pa-accent: #c25a16;\n --pa-surface: #ffffff;\n --pa-raised: #f1f0ec;\n --pa-line: rgba(23, 23, 22, 0.12);\n --pa-ok: #1f6b3a;\n --pa-warn: #7a5a00;\n --pa-err: #a33a2a;\n --pa-c-keyword: #c25a16;\n --pa-c-string: #1f6b3a;\n --pa-c-number: #7a5a00;\n --pa-c-key: #1f4f8a;\n --pa-c-bool: #a33a2a;\n --pa-c-comment: #7a796f;\n --pa-c-name: #171716;\n --pa-c-punct: #61615b;\n box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);\n }\n ._stopButton_1e3bu_232 {\n color: #a33a2a;\n }\n ._iconButton_1e3bu_214:hover {\n background: rgba(0, 0, 0, 0.06);\n }\n ._roundButton_1e3bu_836 {\n background: rgba(0, 0, 0, 0.06);\n }\n ._attachChip_1e3bu_787 {\n background: rgba(0, 0, 0, 0.06);\n }\n ._attachRemove_1e3bu_806:hover {\n background: rgba(0, 0, 0, 0.08);\n }\n ._attachError_1e3bu_830 {\n color: #b42318;\n }\n ._send_1e3bu_854 {\n color: #ffffff;\n }\n ._brand_1e3bu_161 {\n color: #ffffff;\n }\n}\n\n/* Mobile: follow modes (expanded / bar / fab), larger hit areas, no sticky hover tips. */\n\n@media (max-width: 480px) {\n ._wrapper_1e3bu_3 {\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n width: auto;\n max-height: min(560px, calc(100svh - env(safe-area-inset-top, 0px) - 12px));\n border-radius: 18px 18px 0 0;\n border-bottom: 0;\n padding-bottom: env(safe-area-inset-bottom, 0px);\n background: color-mix(in srgb, var(--pa-surface) 92%, transparent);\n backdrop-filter: blur(18px);\n -webkit-backdrop-filter: blur(18px);\n }\n\n ._wrapper_1e3bu_3[data-follow='bar'] {\n left: 8px;\n right: 8px;\n bottom: max(10px, env(safe-area-inset-bottom, 0px));\n max-height: none;\n border-radius: 16px;\n border: 1px solid var(--pa-line);\n padding-bottom: 0;\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);\n }\n\n ._wrapper_1e3bu_3[data-follow='bar'] ._header_1e3bu_148,\n ._wrapper_1e3bu_3[data-follow='bar'] ._feedWrap_1e3bu_80,\n ._wrapper_1e3bu_3[data-follow='bar'] ._composer_1e3bu_720,\n ._wrapper_1e3bu_3[data-follow='bar'] ._voice_1e3bu_130,\n ._wrapper_1e3bu_3[data-follow='bar'] ._studio_1e3bu_867 {\n display: none !important;\n }\n\n ._wrapper_1e3bu_3[data-follow='bar'] ._followBar_1e3bu_85 {\n display: flex;\n }\n\n ._header_1e3bu_148 {\n height: 48px;\n gap: 6px;\n padding: 0 8px 0 12px;\n }\n\n ._brand_1e3bu_161 {\n width: 26px;\n height: 26px;\n border-radius: 8px;\n font-size: 13px;\n }\n\n ._title_1e3bu_185 {\n font-size: 13px;\n }\n\n ._status_1e3bu_200 {\n font-size: 10.5px;\n }\n\n /* Compact visuals with an expanded hit area (~44px) via ::before. */\n ._controls_1e3bu_208 {\n gap: 6px;\n }\n\n ._iconButton_1e3bu_214 {\n position: relative;\n min-width: 32px;\n min-height: 32px;\n width: 32px;\n height: 32px;\n border-radius: 9px;\n }\n\n ._iconButton_1e3bu_214::before {\n content: '';\n position: absolute;\n inset: -6px;\n }\n\n ._feed_1e3bu_80 {\n padding: 8px 10px 8px 8px;\n gap: 6px;\n }\n\n ._feedWrap_1e3bu_80 {\n min-height: 72px;\n max-height: 240px;\n }\n\n ._composer_1e3bu_720 {\n padding: 8px 8px 10px;\n }\n\n ._box_1e3bu_735 {\n padding: 4px 4px 4px 10px;\n border-radius: 14px;\n }\n\n ._actions_1e3bu_774 {\n gap: 8px;\n }\n\n ._roundButton_1e3bu_836 {\n position: relative;\n width: 40px;\n height: 40px;\n }\n\n ._roundButton_1e3bu_836::before {\n content: '';\n position: absolute;\n inset: -4px;\n }\n\n /* Voice expanded: large lens, status, device, Mute + Stop row. */\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voice_1e3bu_130 {\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 16px 14px 18px;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._lens_1e3bu_1223 {\n width: 72px;\n height: 72px;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._lens_1e3bu_1223 svg {\n width: 28px;\n height: 28px;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voiceMeta_1e3bu_1215 {\n align-items: center;\n text-align: center;\n width: 100%;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voiceText_1e3bu_1267 {\n font-size: 15px;\n white-space: normal;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._micDevice_1e3bu_1276 {\n align-self: center;\n text-align: center;\n font-size: 12px;\n min-height: 28px;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1e3bu_130 {\n gap: 12px;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1e3bu_130 [data-role='voice-stop'] {\n display: grid;\n }\n\n ._wrapper_1e3bu_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1e3bu_130 [data-role='back'] {\n display: none;\n }\n\n ._voice_1e3bu_130 {\n gap: 8px;\n padding: 8px 10px 10px;\n }\n\n ._lens_1e3bu_1223 {\n width: 26px;\n height: 26px;\n }\n\n ._micDevice_1e3bu_1276 {\n min-height: 32px;\n padding: 6px 0;\n font-size: 11px;\n }\n\n ._followBar_1e3bu_85 {\n min-height: 60px;\n padding: 10px 12px;\n padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));\n }\n\n ._followBar_1e3bu_85 ._roundButton_1e3bu_836 {\n width: 40px;\n height: 40px;\n }\n\n /* Skills Studio: wrap toolbars, full-width preview, no horizontal overflow. */\n ._studio_1e3bu_867 {\n overflow-x: hidden;\n padding: 10px 10px 14px;\n gap: 8px;\n }\n\n ._studioTabs_1e3bu_889 {\n flex-wrap: wrap;\n gap: 6px;\n }\n\n ._studioTab_1e3bu_889 {\n flex: 1 1 auto;\n min-width: calc(33% - 6px);\n padding: 10px 8px;\n font-size: 12px;\n }\n\n ._studioToolbar_1e3bu_927 {\n gap: 8px;\n }\n\n ._studioToolButton_1e3bu_933 {\n flex: 1 1 auto;\n min-height: 40px;\n padding: 8px 12px;\n font-size: 13px;\n }\n\n ._studioStep_1e3bu_997,\n ._studioCatalogRow_1e3bu_1010 {\n flex-wrap: wrap;\n padding: 10px 12px;\n gap: 10px;\n }\n\n ._studioStepActions_1e3bu_1133,\n ._studioCatalogActions_1e3bu_1134 {\n width: 100%;\n justify-content: flex-start;\n gap: 6px;\n }\n\n ._studioStepActions_1e3bu_1133 button,\n ._studioCatalogActions_1e3bu_1134 button {\n min-height: 36px;\n padding: 6px 10px;\n font-size: 12px;\n }\n\n ._studioPreview_1e3bu_1177 {\n max-height: none;\n width: 100%;\n overflow-x: auto;\n }\n\n ._studioAsk_1e3bu_979 {\n min-height: 88px;\n }\n\n ._fab_1e3bu_1324 {\n width: 56px;\n height: 56px;\n bottom: max(16px, env(safe-area-inset-bottom, 0px));\n right: max(16px, env(safe-area-inset-right, 0px));\n background: color-mix(in srgb, var(--pa-surface) 88%, transparent);\n backdrop-filter: blur(14px);\n -webkit-backdrop-filter: blur(14px);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);\n }\n\n ._fab_1e3bu_1324 img {\n width: 28px;\n height: 28px;\n }\n\n ._fab_1e3bu_1324 svg {\n width: 24px;\n height: 24px;\n }\n\n ._tip_1e3bu_1374::after {\n display: none;\n }\n}\n\n@media (hover: none) {\n ._tip_1e3bu_1374::after {\n display: none;\n }\n}\n\n/* Desktop (≥768px): keep binary collapse; never show the mobile follow strip. */\n@media (min-width: 768px) {\n ._followBar_1e3bu_85 {\n display: none !important;\n }\n}\n\n/* Reduced motion: keep the state text; drop the animation */\n\n@media (prefers-reduced-motion: reduce) {\n ._wrapper_1e3bu_3,\n ._enter_1e3bu_531,\n ._live_1e3bu_576::before,\n ._lens_1e3bu_1223,\n ._spinner_1e3bu_649 {\n animation: none !important;\n transition: none !important;\n }\n}\n\n/* Script card: compact. Each block shows a preview that fades out; a click opens it, a second click closes it. */\n._code_1e3bu_1767 {\n padding: 6px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 9px;\n background: var(--pa-raised);\n font-size: 11px;\n line-height: 1.3;\n}\n\n._code_1e3bu_1767[data-status='running'] {\n border-color: color-mix(in srgb, var(--pa-accent) 50%, transparent);\n}\n\n._code_1e3bu_1767[data-status='error'],\n._code_1e3bu_1767[data-status='refused'] {\n border-color: color-mix(in srgb, var(--pa-err) 55%, transparent);\n}\n\n._codeHead_1e3bu_1785 {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n._codeTitle_1e3bu_1792 {\n font-weight: 600;\n color: var(--pa-accent);\n}\n\n._codeMeta_1e3bu_1797 {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--pa-muted);\n font-size: 10px;\n}\n\n._codeStatus_1e3bu_1807 {\n font-size: 10px;\n color: var(--pa-muted);\n}\n\n._code_1e3bu_1767[data-status='error'] ._codeStatus_1e3bu_1807,\n._code_1e3bu_1767[data-status='refused'] ._codeStatus_1e3bu_1807 {\n color: var(--pa-err);\n}\n\n._codeBadge_1e3bu_1817 {\n padding: 0 5px;\n margin-right: 4px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--pa-accent) 18%, transparent);\n color: var(--pa-accent);\n font-size: 9px;\n font-weight: 600;\n}\n\n._codeSection_1e3bu_1827 {\n margin-top: 4px;\n min-width: 0;\n}\n\n._codeLabel_1e3bu_1832 {\n display: block;\n margin-bottom: 2px;\n font-size: 9px;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n color: var(--pa-muted);\n}\n\n._clip_1e3bu_1841 {\n position: relative;\n min-width: 0;\n}\n\n._codeBlock_1e3bu_1846,\n._resultBlock_1e3bu_1847 {\n margin: 0;\n padding: 4px 6px;\n border-radius: 6px;\n background: var(--pa-surface);\n border: 1px solid var(--pa-line);\n font:\n 10px/1.35 ui-monospace,\n SFMono-Regular,\n Menlo,\n Consolas,\n monospace;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n color: var(--pa-c-name);\n}\n\n._clipBody_1e3bu_1864 {\n position: relative;\n max-height: 4.1em;\n overflow: hidden;\n cursor: pointer;\n}\n\n._clip_1e3bu_1841[data-open='true'] ._clipBody_1e3bu_1864 {\n max-height: 14em;\n overflow: auto;\n}\n\n._clip_1e3bu_1841[data-clipped='true'][data-open='false'] ._clipBody_1e3bu_1864::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1.5em;\n background: linear-gradient(to bottom, transparent, var(--pa-surface));\n pointer-events: none;\n}\n\n._clipToggle_1e3bu_1887 {\n margin-top: 2px;\n padding: 0;\n border: 0;\n background: none;\n color: var(--pa-muted);\n font: inherit;\n font-size: 10px;\n cursor: pointer;\n}\n\n._clipToggle_1e3bu_1887:hover {\n color: var(--pa-fg);\n}\n\n._resultBlock_1e3bu_1847[data-ok='false'] {\n color: var(--pa-err);\n}\n\n._tkComment_1e3bu_1906 {\n color: var(--pa-c-comment);\n font-style: italic;\n}\n\n._tkString_1e3bu_1911 {\n color: var(--pa-c-string);\n}\n\n._tkNumber_1e3bu_1915 {\n color: var(--pa-c-number);\n}\n\n._tkKeyword_1e3bu_1919 {\n color: var(--pa-c-keyword);\n}\n\n._tkName_1e3bu_1923 {\n color: var(--pa-c-name);\n}\n\n._tkPunct_1e3bu_1927 {\n color: var(--pa-c-punct);\n}\n\n._tkKey_1e3bu_1919 {\n color: var(--pa-c-key);\n}\n\n._tkBool_1e3bu_1935 {\n color: var(--pa-c-bool);\n}\n\n/* REVERSIBLE (2026-11-17, card scale): tool cards and script cards at 75% of their size, with their contents.\n Remove this block to return to full size. */\n._tool_1e3bu_605,\n._code_1e3bu_1767 {\n zoom: 0.75;\n}\n\n/* REVERSIBLE (2026-11-17, card folding): folded cards. Each card starts folded; its head shows the state. */\n._foldHead_1e3bu_1947 {\n cursor: pointer;\n user-select: none;\n}\n\n._foldHead_1e3bu_1947::after {\n content: '';\n flex: none;\n width: 6px;\n height: 6px;\n margin-left: auto;\n border-right: 1.5px solid var(--pa-muted);\n border-bottom: 1.5px solid var(--pa-muted);\n transform: rotate(45deg);\n transition: transform 0.22s ease;\n}\n\n._foldHead_1e3bu_1947:focus-visible {\n outline: 1px solid var(--pa-accent);\n outline-offset: 2px;\n border-radius: 4px;\n}\n\n._foldBody_1e3bu_1970 {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.24s ease;\n}\n\n._foldInner_1e3bu_1976 {\n min-height: 0;\n overflow: hidden;\n}\n\n._fold_1e3bu_1947[data-open='true'] > ._foldBody_1e3bu_1970,\n[data-open='true'] > ._foldBody_1e3bu_1970 {\n grid-template-rows: 1fr;\n}\n\n[data-open='true'] > ._foldHead_1e3bu_1947::after {\n transform: rotate(-135deg);\n}\n\n._toolState_1e3bu_1990 {\n margin-left: auto;\n font-size: 10px;\n color: var(--pa-muted);\n}\n\n._tool_1e3bu_605[data-status='done'] ._toolState_1e3bu_1990 {\n color: var(--pa-ok);\n}\n\n._tool_1e3bu_605[data-status='error'] ._toolState_1e3bu_1990 {\n color: var(--pa-err);\n}\n\n._codeRunning_1e3bu_2004,\n._codeDot_1e3bu_2005 {\n flex: none;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--pa-accent);\n}\n\n._codeDot_1e3bu_2005 {\n background: var(--pa-ok);\n animation: _pop_1e3bu_1 0.32s ease-out both;\n}\n\n._codeRunning_1e3bu_2004 {\n animation: _pulse_1e3bu_1 1.2s ease-in-out infinite;\n}\n\n._toolDot_1e3bu_628 {\n animation: _pop_1e3bu_1 0.32s ease-out both;\n}\n\n@keyframes _pop_1e3bu_1 {\n from {\n transform: scale(0.3);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes _pulse_1e3bu_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.35;\n transform: scale(0.7);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n ._foldBody_1e3bu_1970,\n ._foldHead_1e3bu_1947::after {\n transition: none;\n }\n ._codeDot_1e3bu_2005,\n ._codeRunning_1e3bu_2004,\n ._toolDot_1e3bu_628 {\n animation: none;\n }\n}\n\n/* REVERSIBLE (2026-11-17, tool visuals): each tool has its own tone: a left stripe, a tinted icon chip and a short summary. */\n._tool_1e3bu_605,\n._code_1e3bu_1767 {\n --tone: var(--pa-muted);\n border-left: 2px solid var(--tone);\n}\n\n._tool_1e3bu_605[data-tone='js'],\n._code_1e3bu_1767[data-tone='js'] {\n --tone: #b58cff;\n}\n\n._tool_1e3bu_605[data-tone='task'] {\n --tone: var(--pa-accent);\n}\n\n._tool_1e3bu_605[data-tone='move'] {\n --tone: #7cb8ff;\n}\n\n._tool_1e3bu_605[data-tone='act'] {\n --tone: #7fd9a4;\n}\n\n._tool_1e3bu_605[data-tone='time'] {\n --tone: var(--pa-muted);\n}\n\n._tool_1e3bu_605[data-tone='done'] {\n --tone: var(--pa-ok);\n}\n\n._tool_1e3bu_605[data-tone='ask'] {\n --tone: var(--pa-warn);\n}\n\n._tool_1e3bu_605[data-tone='generic'] {\n --tone: var(--pa-muted);\n}\n\n._toolChip_1e3bu_2101 {\n flex: none;\n display: grid;\n place-items: center;\n width: 18px;\n height: 18px;\n border-radius: 6px;\n background: color-mix(in srgb, var(--tone) 18%, transparent);\n color: var(--tone);\n}\n\n._toolSummary_1e3bu_2112 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--pa-muted);\n font-size: 10px;\n}\n\n._toolLabel_1e3bu_636 {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n._toolState_1e3bu_1990 {\n margin-left: auto;\n}")); document.head.appendChild(elementStyle); } } catch (e) { console.error("vite-plugin-css-injected-by-js", e); }})();
|
|
1
|
+
(function() { try { if (typeof document != "undefined") { var elementStyle = document.createElement("style"); elementStyle.appendChild(document.createTextNode("/* Page Agent panel. Design from the modern renderer; dark by default, light when the system asks for it. */\n\n._wrapper_1jypc_3 {\n overscroll-behavior: contain;\n --pa-fg: #f4f3ee;\n --pa-muted: #aaa9a1;\n --pa-accent: #fa8d45;\n --pa-surface: #191918;\n --pa-raised: #20201e;\n --pa-line: rgba(244, 243, 238, 0.12);\n --pa-ok: #b1d8b8;\n --pa-warn: #ead39a;\n --pa-err: #ffb9a9;\n --pa-radius: 18px;\n --pa-c-keyword: #fa8d45;\n --pa-c-string: #b1d8b8;\n --pa-c-number: #ead39a;\n --pa-c-key: #9ec5f0;\n --pa-c-bool: #ffb9a9;\n --pa-c-comment: #7d7c75;\n --pa-c-name: #f4f3ee;\n --pa-c-punct: #aaa9a1;\n\n position: fixed;\n bottom: 100px;\n left: 0;\n right: 0;\n margin: 0 auto;\n transform: translateY(20px);\n opacity: 0;\n z-index: 2147483642;\n box-sizing: border-box;\n /* 100% of the fixed containing block — avoids the classic 100vw horizontal overflow on mobile. */\n width: min(414px, calc(100% - 24px));\n max-height: min(640px, calc(100svh - 120px));\n display: none;\n flex-direction: column;\n overflow: hidden;\n border: 1px solid var(--pa-line);\n border-radius: var(--pa-radius);\n background: var(--pa-surface);\n color: var(--pa-fg);\n box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);\n font:\n 13px/1.4 system-ui,\n -apple-system,\n 'Segoe UI',\n sans-serif;\n transition:\n opacity 0.2s ease,\n transform 0.2s ease,\n box-shadow 0.3s ease,\n width 0.2s ease;\n}\n\n@media (min-width: 481px) {\n ._wrapper_1jypc_3[data-mode='skills-studio'] {\n width: min(560px, calc(100vw - 24px));\n }\n}\n\n._wrapper_1jypc_3 *,\n._wrapper_1jypc_3 *::before,\n._wrapper_1jypc_3 *::after {\n box-sizing: border-box;\n}\n\n._wrapper_1jypc_3[data-state='running'] {\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--pa-accent) 55%, transparent),\n 0 16px 40px rgba(0, 0, 0, 0.35);\n}\n\n._wrapper_1jypc_3[data-state='waiting'] {\n box-shadow:\n 0 0 0 1px color-mix(in srgb, var(--pa-accent) 80%, transparent),\n 0 16px 40px rgba(0, 0, 0, 0.35);\n}\n\n._wrapper_1jypc_3._collapsed_1jypc_80 ._feedWrap_1jypc_80 {\n display: none;\n}\n\n/* Follow bar (mobile peek strip). Hidden unless data-follow=\"bar\" on narrow viewports. */\n._followBar_1jypc_85 {\n display: none;\n flex: none;\n align-items: center;\n gap: 8px;\n min-height: 56px;\n padding: 8px 10px;\n padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));\n}\n\n._followBarBody_1jypc_95 {\n flex: 1;\n min-width: 0;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 0;\n border: 0;\n background: transparent;\n color: inherit;\n font: inherit;\n text-align: left;\n cursor: pointer;\n}\n\n._followBarStatus_1jypc_110 {\n flex: 1;\n min-width: 0;\n font-size: 13px;\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._followBarLens_1jypc_120 {\n width: 28px;\n height: 28px;\n}\n\n._followBarLens_1jypc_120 svg {\n width: 14px;\n height: 14px;\n}\n\n._voiceActions_1jypc_130 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n/* Voice stop is for the mobile expanded voice layout; desktop keeps Stop in the header. */\n._voiceActions_1jypc_130 [data-role='voice-stop'] {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n/* Header */\n\n._header_1jypc_148 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n height: 52px;\n padding: 0 12px 0 14px;\n border-bottom: 1px solid var(--pa-line);\n cursor: grab;\n touch-action: none;\n user-select: none;\n}\n\n._brand_1jypc_161:has(img) {\n background: transparent;\n}\n\n._brand_1jypc_161 img {\n width: 100%;\n height: 100%;\n object-fit: contain;\n border-radius: inherit;\n}\n\n._brand_1jypc_161 {\n flex: none;\n width: 30px;\n height: 30px;\n display: grid;\n place-items: center;\n border-radius: 10px;\n background: var(--pa-accent);\n color: #20150e;\n font-weight: 800;\n font-size: 16px;\n}\n\n._titleBlock_1jypc_185 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n}\n\n._title_1jypc_185 {\n font-size: 12px;\n font-weight: 650;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._status_1jypc_200 {\n font-size: 10.5px;\n color: var(--pa-muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._controls_1jypc_208 {\n flex: none;\n display: flex;\n gap: 2px;\n}\n\n._iconButton_1jypc_214 {\n display: grid;\n place-items: center;\n min-width: 28px;\n min-height: 28px;\n padding: 0;\n border: 0;\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n._iconButton_1jypc_214:hover {\n background: rgba(255, 255, 255, 0.08);\n}\n\n._stopButton_1jypc_232 {\n color: #ff8a80;\n}\n\n/* Feed */\n\n._feedWrap_1jypc_80 {\n position: relative;\n flex: 1;\n display: flex;\n flex-direction: column;\n min-height: 120px;\n max-height: 380px;\n}\n\n._feed_1jypc_80 {\n position: relative;\n flex: 1;\n min-height: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px 18px 14px 14px;\n scroll-behavior: auto;\n scrollbar-width: thin;\n scrollbar-color: color-mix(in srgb, var(--pa-muted) 40%, transparent) transparent;\n}\n\n/* Right-edge rail: viewport thumb plus one marker per turn, question and result. Click a marker to jump. */\n._rail_1jypc_263 {\n position: absolute;\n top: 8px;\n bottom: 8px;\n right: 0;\n width: 16px;\n opacity: 0.55;\n transition: opacity 0.2s ease;\n}\n\n._rail_1jypc_263::before {\n content: '';\n position: absolute;\n top: 0;\n bottom: 0;\n right: 6px;\n width: 2px;\n border-radius: 2px;\n background: var(--pa-line);\n}\n\n._feedWrap_1jypc_80:hover ._rail_1jypc_263,\n._feedWrap_1jypc_80:focus-within ._rail_1jypc_263 {\n opacity: 1;\n}\n\n._feedWrap_1jypc_80:hover ._rail_1jypc_263,\n._feedWrap_1jypc_80:focus-within ._rail_1jypc_263 {\n opacity: 1;\n}\n\n._railThumb_1jypc_294 {\n position: absolute;\n right: 6px;\n width: 2px;\n border-radius: 2px;\n background: var(--pa-muted);\n transition: top 0.12s ease;\n}\n\n._railMark_1jypc_303 {\n position: absolute;\n right: 2px;\n height: 3px;\n width: 10px;\n margin-top: -1px;\n padding: 0;\n border: 0;\n border-radius: 3px;\n background: var(--pa-muted);\n opacity: 0.7;\n cursor: pointer;\n transition:\n width 0.15s ease,\n opacity 0.15s ease,\n background-color 0.15s ease;\n}\n\n._railMark_1jypc_303[data-kind='turn'] {\n width: 14px;\n}\n\n._railMark_1jypc_303[data-kind='question'],\n._railMark_1jypc_303[data-kind='result'] {\n width: 6px;\n height: 6px;\n right: 4px;\n margin-top: -2px;\n border-radius: 50%;\n}\n\n._railMark_1jypc_303[data-kind='question'] {\n background: var(--pa-accent);\n opacity: 1;\n}\n\n._railMark_1jypc_303[data-kind='result'] {\n background: var(--pa-ok);\n opacity: 1;\n}\n\n._railMark_1jypc_303[data-active='true'] {\n width: 18px;\n opacity: 1;\n background: var(--pa-fg);\n}\n\n._railMark_1jypc_303[data-pinned='true'] {\n background: var(--pa-accent);\n opacity: 1;\n}\n\n._railMark_1jypc_303:hover {\n width: 18px;\n opacity: 1;\n}\n\n._railMark_1jypc_303[data-kind='question'] {\n background: var(--pa-accent);\n}\n\n._railMark_1jypc_303[data-kind='turn'] {\n background: var(--pa-muted);\n}\n\n._railMark_1jypc_303[data-kind='result'] {\n background: var(--pa-ok);\n}\n\n/* Divider between finished tasks and the current one. */\n._divider_1jypc_373 {\n display: flex;\n align-items: center;\n gap: 10px;\n margin: 6px 0;\n color: var(--pa-muted);\n font-size: 10.5px;\n text-transform: uppercase;\n letter-spacing: 0.06em;\n}\n\n._divider_1jypc_373::before,\n._divider_1jypc_373::after {\n content: '';\n flex: 1;\n height: 1px;\n background: var(--pa-line);\n}\n\n/* Hover card for a rail tick. */\n._peek_1jypc_393 {\n position: absolute;\n right: 26px;\n z-index: 6;\n width: min(260px, calc(100% - 56px));\n padding: 10px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-surface);\n box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);\n animation: _peekIn_1jypc_1 0.16s ease-out both;\n}\n\n._peek_1jypc_393[hidden] {\n display: none !important;\n}\n\n@keyframes _peekIn_1jypc_1 {\n from {\n opacity: 0;\n transform: translateX(6px);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n._peekHead_1jypc_421 {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n._peekHead_1jypc_421 strong {\n flex: 1;\n min-width: 0;\n font-size: 12px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._peekText_1jypc_436 {\n margin: 6px 0 0;\n max-height: 4.2em;\n overflow: hidden;\n color: var(--pa-muted);\n font-size: 11.5px;\n line-height: 1.4;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent);\n mask-image: linear-gradient(to bottom, #000 60%, transparent);\n}\n\n._pin_1jypc_449 {\n flex: none;\n display: grid;\n place-items: center;\n width: 26px;\n height: 26px;\n padding: 0;\n border: 0;\n border-radius: 7px;\n background: transparent;\n color: var(--pa-muted);\n cursor: pointer;\n}\n\n._pin_1jypc_449:hover {\n background: rgba(255, 255, 255, 0.08);\n color: var(--pa-fg);\n}\n\n._pin_1jypc_449[aria-pressed='true'] {\n color: var(--pa-accent);\n}\n\n._pin_1jypc_449[aria-pressed='true'] svg {\n fill: currentColor;\n}\n\n._pin_1jypc_449 svg {\n width: 14px;\n height: 14px;\n}\n\n/* Jump pill: appears while reading above, shows how many new events arrived. */\n._jump_1jypc_482 {\n position: absolute;\n left: 50%;\n bottom: 10px;\n transform: translateX(-50%);\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 6px 12px 6px 9px;\n border: 0;\n border-radius: 999px;\n background: var(--pa-fg);\n color: var(--pa-surface);\n font-size: 11px;\n font-weight: 600;\n white-space: nowrap;\n box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);\n cursor: pointer;\n animation: _jumpIn_1jypc_1 0.22s ease-out both;\n}\n\n._jump_1jypc_482 svg {\n width: 14px;\n height: 14px;\n}\n\n._jump_1jypc_482[hidden] {\n display: none !important;\n}\n\n@keyframes _jumpIn_1jypc_1 {\n from {\n opacity: 0;\n transform: translate(-50%, 6px);\n }\n to {\n opacity: 1;\n transform: translate(-50%, 0);\n }\n}\n\n._empty_1jypc_523 {\n margin: auto;\n padding: 24px 8px;\n text-align: center;\n color: var(--pa-muted);\n font-size: 13px;\n}\n\n._enter_1jypc_531 {\n animation: _enter_1jypc_531 0.2s ease-out both;\n}\n\n@keyframes _enter_1jypc_531 {\n from {\n opacity: 0;\n transform: translateY(4px);\n }\n to {\n opacity: 1;\n transform: none;\n }\n}\n\n._bubble_1jypc_546 {\n align-self: flex-end;\n max-width: 85%;\n padding: 8px 12px;\n border-radius: 14px 14px 4px 14px;\n background: var(--pa-raised);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._line_1jypc_556 {\n font-size: 12px;\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._reflection_1jypc_563 {\n padding-left: 8px;\n border-left: 2px solid var(--pa-line);\n}\n\n._observation_1jypc_568 {\n font-size: 12px;\n}\n\n._warning_1jypc_572 {\n color: var(--pa-warn);\n}\n\n._live_1jypc_576 {\n display: flex;\n align-items: center;\n gap: 8px;\n color: var(--pa-accent);\n}\n\n._live_1jypc_576::before {\n content: '';\n flex: none;\n width: 8px;\n height: 8px;\n border-radius: 50%;\n background: var(--pa-accent);\n animation: _pulse_1jypc_1 1.6s ease-in-out infinite;\n}\n\n@keyframes _pulse_1jypc_1 {\n 0%,\n 100% {\n opacity: 0.35;\n }\n 50% {\n opacity: 1;\n }\n}\n\n/* Tool cards */\n\n._tool_1jypc_605 {\n padding: 9px 11px;\n border: 1px solid var(--pa-line);\n border-radius: 11px;\n background: var(--pa-raised);\n font-size: 12px;\n}\n\n._tool_1jypc_605[data-status='running'] {\n border-color: color-mix(in srgb, var(--pa-accent) 50%, transparent);\n}\n\n._tool_1jypc_605[data-status='error'] {\n border-color: color-mix(in srgb, var(--pa-err) 55%, transparent);\n color: var(--pa-err);\n}\n\n._toolHead_1jypc_622 {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n._toolDot_1jypc_628 {\n flex: none;\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background: var(--pa-ok);\n}\n\n._toolLabel_1jypc_636 {\n font-weight: 600;\n overflow-wrap: anywhere;\n}\n\n._toolDetail_1jypc_641 {\n margin-top: 5px;\n padding-left: 15px;\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n._spinner_1jypc_649 {\n flex: none;\n width: 11px;\n height: 11px;\n border: 1.5px solid var(--pa-accent);\n border-right-color: transparent;\n border-radius: 50%;\n animation: _spin_1jypc_649 0.9s linear infinite;\n}\n\n@keyframes _spin_1jypc_649 {\n to {\n transform: rotate(360deg);\n }\n}\n\n/* Question and result cards */\n\n._question_1jypc_667 {\n padding: 2px 0 2px 12px;\n border-left: 2px solid var(--pa-accent);\n}\n\n._questionTag_1jypc_672 {\n display: block;\n margin-bottom: 4px;\n color: var(--pa-accent);\n font-size: 11px;\n font-weight: 650;\n}\n\n._questionText_1jypc_680 {\n margin: 0;\n font-size: 14px;\n}\n\n._result_1jypc_685 {\n padding: 11px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-raised);\n font-size: 12px;\n}\n\n._result_1jypc_685 strong {\n display: block;\n margin-bottom: 4px;\n font-size: 13px;\n}\n\n._result_1jypc_685[data-kind='done'] strong {\n color: var(--pa-ok);\n}\n\n._result_1jypc_685[data-kind='notDone'] strong,\n._result_1jypc_685[data-kind='stopped'] strong {\n color: var(--pa-warn);\n}\n\n._result_1jypc_685[data-kind='error'] strong {\n color: var(--pa-err);\n}\n\n._resultText_1jypc_712 {\n color: var(--pa-muted);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n\n/* Composer (text input and voice toggle share this area) */\n\n._composer_1jypc_720 {\n flex: none;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._answerContext_1jypc_729 {\n display: flex;\n flex-direction: column;\n gap: 8px;\n font-size: 11px;\n color: var(--pa-accent);\n font-weight: 650;\n}\n\n._choiceRow_1jypc_738 {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n._choiceChip_1jypc_744 {\n appearance: none;\n border: 1px solid var(--pa-line);\n background: var(--pa-raised);\n color: inherit;\n border-radius: 999px;\n padding: 6px 12px;\n font: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n min-height: 32px;\n}\n\n._choiceChip_1jypc_744:hover {\n border-color: var(--pa-accent);\n}\n\n._choiceChip_1jypc_744[data-selected='true'],\n._choiceChip_1jypc_744[aria-pressed='true'] {\n border-color: var(--pa-accent);\n background: color-mix(in srgb, var(--pa-accent) 16%, var(--pa-raised));\n color: var(--pa-accent);\n}\n\n._choiceConfirm_1jypc_769 {\n appearance: none;\n border: 0;\n background: var(--pa-accent);\n color: #fff;\n border-radius: 999px;\n padding: 6px 14px;\n font: inherit;\n font-size: 12px;\n font-weight: 700;\n cursor: pointer;\n min-height: 32px;\n}\n\n._choiceConfirm_1jypc_769:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n\n._box_1jypc_788 {\n display: flex;\n align-items: flex-end;\n gap: 6px;\n padding: 6px 6px 6px 12px;\n border: 1px solid var(--pa-line);\n border-radius: 16px;\n background: var(--pa-raised);\n}\n\n._box_1jypc_788:focus-within {\n outline: 2px solid var(--pa-accent);\n outline-offset: 2px;\n}\n\n._box_1jypc_788 textarea {\n flex: 1;\n min-width: 0;\n min-height: 28px;\n max-height: 120px;\n resize: none;\n border: 0;\n outline: none;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 13px;\n line-height: 1.4;\n padding: 5px 0;\n}\n\n._box_1jypc_788 textarea:disabled {\n opacity: 0.6;\n}\n\n._box_1jypc_788 textarea::placeholder {\n color: var(--pa-muted);\n}\n\n._actions_1jypc_827 {\n flex: none;\n display: flex;\n gap: 4px;\n}\n\n._attachList_1jypc_833 {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n align-items: center;\n}\n\n._attachChip_1jypc_840 {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n max-width: 100%;\n padding: 2px 4px 2px 8px;\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.08);\n font-size: 12px;\n line-height: 1.3;\n}\n\n._attachName_1jypc_852 {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n max-width: 180px;\n}\n\n._attachRemove_1jypc_859 {\n display: grid;\n place-items: center;\n padding: 0;\n width: 20px;\n height: 20px;\n border: 0;\n border-radius: 50%;\n background: transparent;\n color: inherit;\n cursor: pointer;\n opacity: 0.7;\n}\n\n._attachRemove_1jypc_859:hover {\n opacity: 1;\n background: rgba(255, 255, 255, 0.1);\n}\n\n._attachRemove_1jypc_859 svg {\n width: 12px;\n height: 12px;\n}\n\n._attachError_1jypc_883 {\n color: #f5a3a3;\n font-size: 12px;\n line-height: 1.3;\n}\n\n._roundButton_1jypc_889 {\n display: grid;\n place-items: center;\n padding: 0;\n width: 30px;\n height: 30px;\n border: 0;\n border-radius: 50%;\n background: rgba(255, 255, 255, 0.08);\n color: inherit;\n font-size: 14px;\n cursor: pointer;\n}\n\n._roundButton_1jypc_889[aria-pressed='true'] {\n background: color-mix(in srgb, var(--pa-accent) 35%, transparent);\n}\n\n._send_1jypc_907 {\n background: var(--pa-accent);\n color: #20150e;\n font-weight: 800;\n}\n\n._roundButton_1jypc_889:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n/* Skills Studio (replaces feed + composer while authoring skills) */\n\n._studio_1jypc_920 {\n flex: 1;\n min-height: 0;\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 10px 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._studioHeader_1jypc_930 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n._studioTitle_1jypc_937 {\n font-size: 14px;\n font-weight: 700;\n}\n\n._studioTabs_1jypc_942 {\n display: flex;\n gap: 4px;\n}\n\n._studioTab_1jypc_942 {\n flex: 1;\n padding: 6px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: transparent;\n color: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioTab_1jypc_942[aria-selected='true'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n}\n\n._studioBody_1jypc_964 {\n flex: 1;\n min-height: 0;\n overflow: auto;\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n._studioHint_1jypc_973 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 12px;\n line-height: 1.4;\n}\n\n._studioToolbar_1jypc_980 {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n._studioToolButton_1jypc_986 {\n flex: none;\n padding: 6px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: var(--pa-raised);\n color: inherit;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioToolButton_1jypc_986:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n._studioToolButton_1jypc_986[data-variant='accent'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n}\n\n._studioToolButton_1jypc_986[data-variant='danger'] {\n color: var(--pa-err);\n}\n\n._studioStatus_1jypc_1012 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 11px;\n line-height: 1.4;\n white-space: pre-wrap;\n}\n\n._studioStatus_1jypc_1012[data-tone='ok'] {\n color: var(--pa-ok);\n}\n\n._studioStatus_1jypc_1012[data-tone='warn'] {\n color: var(--pa-warn);\n}\n\n._studioStatus_1jypc_1012[data-tone='err'] {\n color: var(--pa-err);\n}\n\n._studioAsk_1jypc_1032 {\n width: 100%;\n min-height: 72px;\n resize: vertical;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: var(--pa-raised);\n color: inherit;\n font: inherit;\n line-height: 1.4;\n}\n\n._studioAsk_1jypc_1032:focus {\n outline: 2px solid var(--pa-accent);\n outline-offset: 2px;\n}\n\n._studioSteps_1jypc_1050,\n._studioCatalog_1jypc_1051 {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 6px;\n font-size: 12px;\n line-height: 1.45;\n}\n\n._studioStep_1jypc_1050,\n._studioCatalogRow_1jypc_1063 {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: rgba(255, 255, 255, 0.04);\n}\n\n._studioCatalogRow_1jypc_1063 {\n padding: 6px 8px;\n gap: 6px;\n}\n\n._studioWatchers_1jypc_1078 {\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 8px;\n border: 1px solid var(--pa-line);\n border-radius: 12px;\n background: color-mix(in srgb, var(--pa-raised) 85%, transparent);\n}\n\n._studioWatchersHead_1jypc_1088 {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n\n._studioWatchersTitle_1jypc_1095 {\n font-size: 11px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n color: var(--pa-muted);\n}\n\n._studioWatchersEmpty_1jypc_1103 {\n margin: 0;\n color: var(--pa-muted);\n font-size: 11px;\n}\n\n._studioWatchersList_1jypc_1109 {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n\n._studioWatcherChip_1jypc_1118 {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n max-width: 100%;\n padding: 4px 6px 4px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 999px;\n background: rgba(255, 255, 255, 0.06);\n font-size: 11px;\n line-height: 1.3;\n}\n\n._studioWatcherLabel_1jypc_1131 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-weight: 600;\n}\n\n._studioWatcherMeta_1jypc_1139 {\n color: var(--pa-muted);\n font-size: 10px;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n}\n\n._studioWatcherChip_1jypc_1118 button {\n padding: 2px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 999px;\n background: transparent;\n color: inherit;\n font-size: 10px;\n font-weight: 600;\n cursor: pointer;\n}\n\n._studioWatcherChip_1jypc_1118 button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n._studioStepBody_1jypc_1162,\n._studioCatalogBody_1jypc_1163 {\n flex: 1;\n min-width: 0;\n}\n\n._studioStepKind_1jypc_1168 {\n display: inline-block;\n margin-right: 6px;\n padding: 1px 6px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--pa-accent) 22%, transparent);\n font-size: 10px;\n font-weight: 700;\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n._studioStepMeta_1jypc_1180,\n._studioCatalogMeta_1jypc_1181 {\n color: var(--pa-muted);\n font-size: 11px;\n}\n\n._studioStepActions_1jypc_1186,\n._studioCatalogActions_1jypc_1187 {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n}\n\n._studioStepActions_1jypc_1186 button,\n._studioCatalogActions_1jypc_1187 button {\n padding: 4px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 8px;\n background: transparent;\n color: inherit;\n font-size: 11px;\n cursor: pointer;\n}\n\n._studioCatalogActions_1jypc_1187 button[data-variant='accent'] {\n background: color-mix(in srgb, var(--pa-accent) 28%, transparent);\n border-color: color-mix(in srgb, var(--pa-accent) 55%, var(--pa-line));\n font-weight: 700;\n}\n\n._studioStepActions_1jypc_1186 button:disabled,\n._studioCatalogActions_1jypc_1187 button:disabled {\n opacity: 0.45;\n cursor: default;\n}\n\n@media (min-width: 768px) {\n ._wrapper_1jypc_3[data-mode='skills-studio'] ._studioToolbar_1jypc_980 {\n gap: 8px;\n }\n\n ._wrapper_1jypc_3[data-mode='skills-studio'] ._studioToolButton_1jypc_986 {\n padding: 7px 12px;\n }\n\n ._wrapper_1jypc_3[data-mode='skills-studio'] ._studioCatalog_1jypc_1051 {\n gap: 5px;\n }\n}\n\n._studioPreviewLabel_1jypc_1230 {\n margin: 0;\n font-size: 11px;\n font-weight: 700;\n color: var(--pa-muted);\n text-transform: uppercase;\n letter-spacing: 0.04em;\n}\n\n._studioPreview_1jypc_1230 {\n margin: 0;\n max-height: 180px;\n overflow: auto;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 10px;\n background: var(--pa-raised);\n font:\n 11px/1.45 ui-monospace,\n SFMono-Regular,\n Menlo,\n Consolas,\n monospace;\n white-space: pre-wrap;\n word-break: break-word;\n}\n\n/* Voice stage (replaces the composer while voice is selected) */\n\n._voice_1jypc_130 {\n flex: none;\n display: flex;\n align-items: center;\n gap: 10px;\n padding: 12px 12px;\n border-top: 1px solid var(--pa-line);\n}\n\n._voiceMeta_1jypc_1268 {\n flex: 1;\n min-width: 0;\n display: flex;\n flex-direction: column;\n gap: 2px;\n}\n\n._lens_1jypc_1276 {\n flex: none;\n display: grid;\n place-items: center;\n width: 30px;\n height: 30px;\n border-radius: 50%;\n color: var(--pa-muted);\n background: var(--pa-raised);\n border: 1px solid var(--pa-line);\n transition:\n border-color 0.3s ease,\n color 0.3s ease,\n opacity 0.3s ease;\n}\n\n._lens_1jypc_1276 svg {\n width: 15px;\n height: 15px;\n}\n\n/* Microphone state: active breathes in accent, muted is dimmed, blocked or unavailable is red. */\n._lens_1jypc_1276[data-state='active'] {\n color: var(--pa-accent);\n border-color: var(--pa-accent);\n animation: _breathe_1jypc_1 2.8s ease-in-out infinite;\n}\n\n._lens_1jypc_1276[data-state='muted'] {\n opacity: 0.5;\n}\n\n._lens_1jypc_1276[data-state='denied'],\n._lens_1jypc_1276[data-state='unsupported'] {\n color: var(--pa-err);\n border-color: var(--pa-err);\n}\n\n@keyframes _breathe_1jypc_1 {\n 50% {\n transform: scale(1.06);\n }\n}\n\n._voiceText_1jypc_1320 {\n min-width: 0;\n font-size: 12px;\n font-weight: 600;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n._micDevice_1jypc_1329 {\n min-width: 0;\n max-width: 100%;\n align-self: start;\n padding: 0;\n border: 0;\n border-radius: 4px;\n background: transparent;\n color: var(--pa-muted);\n font: inherit;\n font-size: 10.5px;\n font-weight: 500;\n line-height: 1.3;\n text-align: left;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n\n._micDevice_1jypc_1329:disabled {\n cursor: default;\n opacity: 0.7;\n}\n\n._micDevice_1jypc_1329:not(:disabled):hover {\n color: var(--pa-accent);\n}\n\n._textButton_1jypc_1358 {\n flex: none;\n white-space: nowrap;\n padding: 8px 10px;\n border: 1px solid var(--pa-line);\n border-radius: 9px;\n background: var(--pa-raised);\n color: inherit;\n font-size: 12px;\n cursor: pointer;\n}\n\n/* Pressed toggles (agent cursor visible, microphone on) read as on: tinted background and accent icon. */\n._iconButton_1jypc_214[aria-pressed='true'] {\n background: color-mix(in srgb, var(--pa-accent) 22%, transparent);\n color: var(--pa-accent);\n}\n\n/* Floating button shown while the panel is closed. Snaps to a corner after dragging. */\n._fab_1jypc_1377 {\n position: fixed;\n z-index: 2147483642;\n display: grid;\n place-items: center;\n width: 46px;\n height: 46px;\n padding: 0;\n border: 1px solid var(--pa-line);\n border-radius: 50%;\n background: var(--pa-surface);\n color: var(--pa-accent);\n box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);\n cursor: grab;\n touch-action: none;\n user-select: none;\n transition:\n transform 0.2s ease,\n box-shadow 0.2s ease;\n}\n\n._fab_1jypc_1377:hover {\n transform: scale(1.06);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);\n}\n\n._fab_1jypc_1377[hidden] {\n display: none !important;\n}\n\n._fab_1jypc_1377 img {\n width: 26px;\n height: 26px;\n object-fit: contain;\n border-radius: 6px;\n pointer-events: none;\n}\n\n._fab_1jypc_1377 svg {\n width: 20px;\n height: 20px;\n pointer-events: none;\n}\n\n._fabLeft_1jypc_1421::after {\n left: 0;\n right: auto;\n}\n\n/* Icon hints: a short label on hover or keyboard focus. */\n._tip_1jypc_1427:not(._fab_1jypc_1377) {\n position: relative;\n}\n\n._tip_1jypc_1427::after {\n content: attr(data-tip);\n position: absolute;\n top: calc(100% + 6px);\n right: 0;\n z-index: 10;\n padding: 4px 8px;\n border-radius: 6px;\n background: var(--pa-fg);\n color: var(--pa-surface);\n font-size: 11px;\n font-weight: 550;\n line-height: 1.3;\n white-space: nowrap;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n}\n\n._tipUp_1jypc_1450::after {\n top: auto;\n bottom: calc(100% + 6px);\n}\n\n._tip_1jypc_1427:hover::after,\n._tip_1jypc_1427:focus-visible::after {\n opacity: 1;\n}\n\n._iconButton_1jypc_214 svg,\n._roundButton_1jypc_889 svg {\n display: block;\n}\n\n/* Light theme */\n\n@media (prefers-color-scheme: light) {\n ._wrapper_1jypc_3 {\n --pa-fg: #171716;\n --pa-muted: #61615b;\n --pa-accent: #c25a16;\n --pa-surface: #ffffff;\n --pa-raised: #f1f0ec;\n --pa-line: rgba(23, 23, 22, 0.12);\n --pa-ok: #1f6b3a;\n --pa-warn: #7a5a00;\n --pa-err: #a33a2a;\n --pa-c-keyword: #c25a16;\n --pa-c-string: #1f6b3a;\n --pa-c-number: #7a5a00;\n --pa-c-key: #1f4f8a;\n --pa-c-bool: #a33a2a;\n --pa-c-comment: #7a796f;\n --pa-c-name: #171716;\n --pa-c-punct: #61615b;\n box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);\n }\n ._stopButton_1jypc_232 {\n color: #a33a2a;\n }\n ._iconButton_1jypc_214:hover {\n background: rgba(0, 0, 0, 0.06);\n }\n ._roundButton_1jypc_889 {\n background: rgba(0, 0, 0, 0.06);\n }\n ._attachChip_1jypc_840 {\n background: rgba(0, 0, 0, 0.06);\n }\n ._attachRemove_1jypc_859:hover {\n background: rgba(0, 0, 0, 0.08);\n }\n ._attachError_1jypc_883 {\n color: #b42318;\n }\n ._send_1jypc_907 {\n color: #ffffff;\n }\n ._brand_1jypc_161 {\n color: #ffffff;\n }\n}\n\n/* Mobile: follow modes (expanded / bar / fab), larger hit areas, no sticky hover tips. */\n\n@media (max-width: 480px) {\n ._wrapper_1jypc_3 {\n left: 0;\n right: 0;\n bottom: 0;\n margin: 0;\n width: auto;\n max-height: min(560px, calc(100svh - env(safe-area-inset-top, 0px) - 12px));\n border-radius: 18px 18px 0 0;\n border-bottom: 0;\n padding-bottom: env(safe-area-inset-bottom, 0px);\n background: color-mix(in srgb, var(--pa-surface) 92%, transparent);\n backdrop-filter: blur(18px);\n -webkit-backdrop-filter: blur(18px);\n }\n\n ._wrapper_1jypc_3[data-follow='bar'] {\n left: 8px;\n right: 8px;\n bottom: max(10px, env(safe-area-inset-bottom, 0px));\n max-height: none;\n border-radius: 16px;\n border: 1px solid var(--pa-line);\n padding-bottom: 0;\n box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);\n }\n\n ._wrapper_1jypc_3[data-follow='bar'] ._header_1jypc_148,\n ._wrapper_1jypc_3[data-follow='bar'] ._feedWrap_1jypc_80,\n ._wrapper_1jypc_3[data-follow='bar'] ._composer_1jypc_720,\n ._wrapper_1jypc_3[data-follow='bar'] ._voice_1jypc_130,\n ._wrapper_1jypc_3[data-follow='bar'] ._studio_1jypc_920 {\n display: none !important;\n }\n\n ._wrapper_1jypc_3[data-follow='bar'] ._followBar_1jypc_85 {\n display: flex;\n }\n\n ._header_1jypc_148 {\n height: 48px;\n gap: 6px;\n padding: 0 8px 0 12px;\n }\n\n ._brand_1jypc_161 {\n width: 26px;\n height: 26px;\n border-radius: 8px;\n font-size: 13px;\n }\n\n ._title_1jypc_185 {\n font-size: 13px;\n }\n\n ._status_1jypc_200 {\n font-size: 10.5px;\n }\n\n /* Compact visuals with an expanded hit area (~44px) via ::before. */\n ._controls_1jypc_208 {\n gap: 6px;\n }\n\n ._iconButton_1jypc_214 {\n position: relative;\n min-width: 32px;\n min-height: 32px;\n width: 32px;\n height: 32px;\n border-radius: 9px;\n }\n\n ._iconButton_1jypc_214::before {\n content: '';\n position: absolute;\n inset: -6px;\n }\n\n ._feed_1jypc_80 {\n padding: 8px 10px 8px 8px;\n gap: 6px;\n }\n\n ._feedWrap_1jypc_80 {\n min-height: 72px;\n max-height: 240px;\n }\n\n ._composer_1jypc_720 {\n padding: 8px 8px 10px;\n }\n\n ._box_1jypc_788 {\n padding: 4px 4px 4px 10px;\n border-radius: 14px;\n }\n\n ._actions_1jypc_827 {\n gap: 8px;\n }\n\n ._roundButton_1jypc_889 {\n position: relative;\n width: 40px;\n height: 40px;\n }\n\n ._roundButton_1jypc_889::before {\n content: '';\n position: absolute;\n inset: -4px;\n }\n\n /* Voice expanded: large lens, status, device, Mute + Stop row. */\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voice_1jypc_130 {\n flex-direction: column;\n align-items: center;\n gap: 12px;\n padding: 16px 14px 18px;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._lens_1jypc_1276 {\n width: 72px;\n height: 72px;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._lens_1jypc_1276 svg {\n width: 28px;\n height: 28px;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voiceMeta_1jypc_1268 {\n align-items: center;\n text-align: center;\n width: 100%;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voiceText_1jypc_1320 {\n font-size: 15px;\n white-space: normal;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._micDevice_1jypc_1329 {\n align-self: center;\n text-align: center;\n font-size: 12px;\n min-height: 28px;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1jypc_130 {\n gap: 12px;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1jypc_130 [data-role='voice-stop'] {\n display: grid;\n }\n\n ._wrapper_1jypc_3[data-mode='voice'][data-follow='expanded'] ._voiceActions_1jypc_130 [data-role='back'] {\n display: none;\n }\n\n ._voice_1jypc_130 {\n gap: 8px;\n padding: 8px 10px 10px;\n }\n\n ._lens_1jypc_1276 {\n width: 26px;\n height: 26px;\n }\n\n ._micDevice_1jypc_1329 {\n min-height: 32px;\n padding: 6px 0;\n font-size: 11px;\n }\n\n ._followBar_1jypc_85 {\n min-height: 60px;\n padding: 10px 12px;\n padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));\n }\n\n ._followBar_1jypc_85 ._roundButton_1jypc_889 {\n width: 40px;\n height: 40px;\n }\n\n /* Skills Studio: wrap toolbars, full-width preview, no horizontal overflow. */\n ._studio_1jypc_920 {\n overflow-x: hidden;\n padding: 10px 10px 14px;\n gap: 8px;\n }\n\n ._studioTabs_1jypc_942 {\n flex-wrap: wrap;\n gap: 6px;\n }\n\n ._studioTab_1jypc_942 {\n flex: 1 1 auto;\n min-width: calc(33% - 6px);\n padding: 10px 8px;\n font-size: 12px;\n }\n\n ._studioToolbar_1jypc_980 {\n gap: 8px;\n }\n\n ._studioToolButton_1jypc_986 {\n flex: 1 1 auto;\n min-height: 40px;\n padding: 8px 12px;\n font-size: 13px;\n }\n\n ._studioStep_1jypc_1050,\n ._studioCatalogRow_1jypc_1063 {\n flex-wrap: wrap;\n padding: 10px 12px;\n gap: 10px;\n }\n\n ._studioStepActions_1jypc_1186,\n ._studioCatalogActions_1jypc_1187 {\n width: 100%;\n justify-content: flex-start;\n gap: 6px;\n }\n\n ._studioStepActions_1jypc_1186 button,\n ._studioCatalogActions_1jypc_1187 button {\n min-height: 36px;\n padding: 6px 10px;\n font-size: 12px;\n }\n\n ._studioPreview_1jypc_1230 {\n max-height: none;\n width: 100%;\n overflow-x: auto;\n }\n\n ._studioAsk_1jypc_1032 {\n min-height: 88px;\n }\n\n ._fab_1jypc_1377 {\n width: 56px;\n height: 56px;\n bottom: max(16px, env(safe-area-inset-bottom, 0px));\n right: max(16px, env(safe-area-inset-right, 0px));\n background: color-mix(in srgb, var(--pa-surface) 88%, transparent);\n backdrop-filter: blur(14px);\n -webkit-backdrop-filter: blur(14px);\n box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);\n }\n\n ._fab_1jypc_1377 img {\n width: 28px;\n height: 28px;\n }\n\n ._fab_1jypc_1377 svg {\n width: 24px;\n height: 24px;\n }\n\n ._tip_1jypc_1427::after {\n display: none;\n }\n}\n\n@media (hover: none) {\n ._tip_1jypc_1427::after {\n display: none;\n }\n}\n\n/* Desktop (≥768px): keep binary collapse; never show the mobile follow strip. */\n@media (min-width: 768px) {\n ._followBar_1jypc_85 {\n display: none !important;\n }\n}\n\n/* Reduced motion: keep the state text; drop the animation */\n\n@media (prefers-reduced-motion: reduce) {\n ._wrapper_1jypc_3,\n ._enter_1jypc_531,\n ._live_1jypc_576::before,\n ._lens_1jypc_1276,\n ._spinner_1jypc_649 {\n animation: none !important;\n transition: none !important;\n }\n}\n\n/* Script card: compact. Each block shows a preview that fades out; a click opens it, a second click closes it. */\n._code_1jypc_1820 {\n padding: 6px 8px;\n border: 1px solid var(--pa-line);\n border-radius: 9px;\n background: var(--pa-raised);\n font-size: 11px;\n line-height: 1.3;\n}\n\n._code_1jypc_1820[data-status='running'] {\n border-color: color-mix(in srgb, var(--pa-accent) 50%, transparent);\n}\n\n._code_1jypc_1820[data-status='error'],\n._code_1jypc_1820[data-status='refused'] {\n border-color: color-mix(in srgb, var(--pa-err) 55%, transparent);\n}\n\n._codeHead_1jypc_1838 {\n display: flex;\n align-items: center;\n gap: 6px;\n min-width: 0;\n}\n\n._codeTitle_1jypc_1845 {\n font-weight: 600;\n color: var(--pa-accent);\n}\n\n._codeMeta_1jypc_1850 {\n flex: 1;\n min-width: 0;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n color: var(--pa-muted);\n font-size: 10px;\n}\n\n._codeStatus_1jypc_1860 {\n font-size: 10px;\n color: var(--pa-muted);\n}\n\n._code_1jypc_1820[data-status='error'] ._codeStatus_1jypc_1860,\n._code_1jypc_1820[data-status='refused'] ._codeStatus_1jypc_1860 {\n color: var(--pa-err);\n}\n\n._codeBadge_1jypc_1870 {\n padding: 0 5px;\n margin-right: 4px;\n border-radius: 999px;\n background: color-mix(in srgb, var(--pa-accent) 18%, transparent);\n color: var(--pa-accent);\n font-size: 9px;\n font-weight: 600;\n}\n\n._codeSection_1jypc_1880 {\n margin-top: 4px;\n min-width: 0;\n}\n\n._codeLabel_1jypc_1885 {\n display: block;\n margin-bottom: 2px;\n font-size: 9px;\n letter-spacing: 0.05em;\n text-transform: uppercase;\n color: var(--pa-muted);\n}\n\n._clip_1jypc_1894 {\n position: relative;\n min-width: 0;\n}\n\n._codeBlock_1jypc_1899,\n._resultBlock_1jypc_1900 {\n margin: 0;\n padding: 4px 6px;\n border-radius: 6px;\n background: var(--pa-surface);\n border: 1px solid var(--pa-line);\n font:\n 10px/1.35 ui-monospace,\n SFMono-Regular,\n Menlo,\n Consolas,\n monospace;\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n color: var(--pa-c-name);\n}\n\n._clipBody_1jypc_1917 {\n position: relative;\n max-height: 4.1em;\n overflow: hidden;\n cursor: pointer;\n}\n\n._clip_1jypc_1894[data-open='true'] ._clipBody_1jypc_1917 {\n max-height: 14em;\n overflow: auto;\n}\n\n._clip_1jypc_1894[data-clipped='true'][data-open='false'] ._clipBody_1jypc_1917::after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 1.5em;\n background: linear-gradient(to bottom, transparent, var(--pa-surface));\n pointer-events: none;\n}\n\n._clipToggle_1jypc_1940 {\n margin-top: 2px;\n padding: 0;\n border: 0;\n background: none;\n color: var(--pa-muted);\n font: inherit;\n font-size: 10px;\n cursor: pointer;\n}\n\n._clipToggle_1jypc_1940:hover {\n color: var(--pa-fg);\n}\n\n._resultBlock_1jypc_1900[data-ok='false'] {\n color: var(--pa-err);\n}\n\n._tkComment_1jypc_1959 {\n color: var(--pa-c-comment);\n font-style: italic;\n}\n\n._tkString_1jypc_1964 {\n color: var(--pa-c-string);\n}\n\n._tkNumber_1jypc_1968 {\n color: var(--pa-c-number);\n}\n\n._tkKeyword_1jypc_1972 {\n color: var(--pa-c-keyword);\n}\n\n._tkName_1jypc_1976 {\n color: var(--pa-c-name);\n}\n\n._tkPunct_1jypc_1980 {\n color: var(--pa-c-punct);\n}\n\n._tkKey_1jypc_1972 {\n color: var(--pa-c-key);\n}\n\n._tkBool_1jypc_1988 {\n color: var(--pa-c-bool);\n}\n\n/* REVERSIBLE (2026-11-17, card scale): tool cards and script cards at 75% of their size, with their contents.\n Remove this block to return to full size. */\n._tool_1jypc_605,\n._code_1jypc_1820 {\n zoom: 0.75;\n}\n\n/* REVERSIBLE (2026-11-17, card folding): folded cards. Each card starts folded; its head shows the state. */\n._foldHead_1jypc_2000 {\n cursor: pointer;\n user-select: none;\n}\n\n._foldHead_1jypc_2000::after {\n content: '';\n flex: none;\n width: 6px;\n height: 6px;\n margin-left: auto;\n border-right: 1.5px solid var(--pa-muted);\n border-bottom: 1.5px solid var(--pa-muted);\n transform: rotate(45deg);\n transition: transform 0.22s ease;\n}\n\n._foldHead_1jypc_2000:focus-visible {\n outline: 1px solid var(--pa-accent);\n outline-offset: 2px;\n border-radius: 4px;\n}\n\n._foldBody_1jypc_2023 {\n display: grid;\n grid-template-rows: 0fr;\n transition: grid-template-rows 0.24s ease;\n}\n\n._foldInner_1jypc_2029 {\n min-height: 0;\n overflow: hidden;\n}\n\n._fold_1jypc_2000[data-open='true'] > ._foldBody_1jypc_2023,\n[data-open='true'] > ._foldBody_1jypc_2023 {\n grid-template-rows: 1fr;\n}\n\n[data-open='true'] > ._foldHead_1jypc_2000::after {\n transform: rotate(-135deg);\n}\n\n._toolState_1jypc_2043 {\n margin-left: auto;\n font-size: 10px;\n color: var(--pa-muted);\n}\n\n._tool_1jypc_605[data-status='done'] ._toolState_1jypc_2043 {\n color: var(--pa-ok);\n}\n\n._tool_1jypc_605[data-status='error'] ._toolState_1jypc_2043 {\n color: var(--pa-err);\n}\n\n._codeRunning_1jypc_2057,\n._codeDot_1jypc_2058 {\n flex: none;\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: var(--pa-accent);\n}\n\n._codeDot_1jypc_2058 {\n background: var(--pa-ok);\n animation: _pop_1jypc_1 0.32s ease-out both;\n}\n\n._codeRunning_1jypc_2057 {\n animation: _pulse_1jypc_1 1.2s ease-in-out infinite;\n}\n\n._toolDot_1jypc_628 {\n animation: _pop_1jypc_1 0.32s ease-out both;\n}\n\n@keyframes _pop_1jypc_1 {\n from {\n transform: scale(0.3);\n opacity: 0;\n }\n to {\n transform: scale(1);\n opacity: 1;\n }\n}\n\n@keyframes _pulse_1jypc_1 {\n 0%,\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n 50% {\n opacity: 0.35;\n transform: scale(0.7);\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n ._foldBody_1jypc_2023,\n ._foldHead_1jypc_2000::after {\n transition: none;\n }\n ._codeDot_1jypc_2058,\n ._codeRunning_1jypc_2057,\n ._toolDot_1jypc_628 {\n animation: none;\n }\n}\n\n/* REVERSIBLE (2026-11-17, tool visuals): each tool has its own tone: a left stripe, a tinted icon chip and a short summary. */\n._tool_1jypc_605,\n._code_1jypc_1820 {\n --tone: var(--pa-muted);\n border-left: 2px solid var(--tone);\n}\n\n._tool_1jypc_605[data-tone='js'],\n._code_1jypc_1820[data-tone='js'] {\n --tone: #b58cff;\n}\n\n._tool_1jypc_605[data-tone='task'] {\n --tone: var(--pa-accent);\n}\n\n._tool_1jypc_605[data-tone='move'] {\n --tone: #7cb8ff;\n}\n\n._tool_1jypc_605[data-tone='act'] {\n --tone: #7fd9a4;\n}\n\n._tool_1jypc_605[data-tone='time'] {\n --tone: var(--pa-muted);\n}\n\n._tool_1jypc_605[data-tone='done'] {\n --tone: var(--pa-ok);\n}\n\n._tool_1jypc_605[data-tone='ask'] {\n --tone: var(--pa-warn);\n}\n\n._tool_1jypc_605[data-tone='generic'] {\n --tone: var(--pa-muted);\n}\n\n._toolChip_1jypc_2154 {\n flex: none;\n display: grid;\n place-items: center;\n width: 18px;\n height: 18px;\n border-radius: 6px;\n background: color-mix(in srgb, var(--tone) 18%, transparent);\n color: var(--tone);\n}\n\n._toolSummary_1jypc_2165 {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: var(--pa-muted);\n font-size: 10px;\n}\n\n._toolLabel_1jypc_636 {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n min-width: 0;\n}\n\n._toolState_1jypc_2043 {\n margin-left: auto;\n}")); document.head.appendChild(elementStyle); } } catch (e) { console.error("vite-plugin-css-injected-by-js", e); }})();
|
|
2
2
|
import * as z from "zod/v4";
|
|
3
3
|
import chalk from "chalk";
|
|
4
4
|
//#region \0rolldown/runtime.js
|
|
@@ -442,7 +442,7 @@ function parseLLMConfig(config) {
|
|
|
442
442
|
}
|
|
443
443
|
//#endregion
|
|
444
444
|
//#region ../core/src/prompts/system_prompt.md?raw
|
|
445
|
-
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 don't 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- Check the observation scope: a full-page tree can include elements outside the viewport. A viewport annotation describes geometry, not whether the user can see an unobscured element. When asked to navigate to or show an element, measure its position, scroll if needed, and verify its position again before reporting success. For reading or summarizing, content in the full-page tree can be used without scrolling.\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 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\n<!-- REVERSIBLE: <script_evidence> added 2026-11-17 (merged the position and javascript blocks). To revert, delete this block and its entry in docs/ALMA.md. -->\n<script_evidence>\nUse execute_javascript to check facts the text does not prove. Procedure: measure, compare, decide, cite.\n1. Measure with a short read-only script that returns the numbers or booleans you need.\n2. Compare them. If the comparison is false, the goal is not met: measure again or act.\n3. Done text: cite the measured values in plain language. Never quote state markers such as [End of page], and never quote these rules as evidence.\n Only numbers returned by a tool in this task may appear as evidence. If no measurement was returned, say so.\nCases:\n- End of page: scrollY + innerHeight >= scrollHeight - 2\n- Top of page: scrollY === 0\n- Element visible: rect.top < innerHeight && rect.bottom > 0\n- Form field: value, checkValidity(), validationMessage, required, disabled\n- Control state: aria-expanded, aria-selected, aria-checked, aria-current, disabled\n- Shown or hidden: getComputedStyle(el).display, visibility, opacity\n- Count: querySelectorAll(selector).length against the number requested\n- Text in a container: container.textContent.includes(...), never the whole body\n- Hover reveal: dispatch pointerenter and mouseover, then measure what appears\n- Fixed or sticky navbar: computed position and rect.top after scrolling\n- Dialog open: dialog.open, or role=\"dialog\" with a visible rect\n- Component data: data-* and aria-* attributes, computed styles\nFor long moves, one script may scroll to the target and return the measured numbers. Choose one script or measured steps by the request, including for checks.\nRead and move only. Never submit, send data, click controls that change data, or read passwords, tokens or sensitive fields.\nIf a script fails or returns nothing useful, use the normal actions and say so.\n<\/script_evidence>\n\n<!-- REVERSIBLE: <task_intake> and <script_use_case> added 2026-11-17. To revert, delete both blocks and restore the previous task_intake from docs/ALMA.md. -->\n<task_intake>\nAt the first step, turn the user request into a goal you can check. Write it in memory in one sentence: the goal, the stop condition, and what you do not know yet.\n- Use the site rules and the page data. Do not invent names, addresses, numbers, sections or results.\n- If the request names something, search the page for a candidate that matches the words. One clear candidate: use it. Several or none: ask the user with ask_user.\n- If a fact is neither on the page nor in the rules, say you did not find it.\n- Investigate with read-only checks. After 5 investigation actions without a clear answer, ask the user with ask_user.\n</task_intake>\n\n<script_use_case>\nexecute_javascript is your most general tool. It can explore the page in detail and do things the common tools cannot. Use it when one script does the job better than several steps.\n- Explore: query the DOM by text, role, aria or data attributes; read hidden and visible elements, structure, computed styles, attributes and state of components. Scripts may be concise or complex, as the question needs.\n- Navigate: go to a target in one script with window.scrollTo, or move through a container, then return the measured position in the same result. Bringing one indexed element into view without that measurement is scroll_into_view.\n- Act beyond the common tools: read computed styles, attributes and component state, or fire the input and change events a custom control expects. Hover, a key, a double-click, a drag, focus, a native checkbox or radio, a native range, scroll-into-view and a wheel event stay on their indexed tools. Do this only for the action the user asked for.\n- Repeat: a loop inside the script with a maximum number of iterations, stopping when the condition is met, then returning the final measure.\nUse the common tools for single steps that need an indexed element from the page state (click_element_by_index, input_text, select_dropdown_option, drag_element, hover_element, press_key, double_click_element, focus_element, set_checked, set_range, scroll_into_view, wheel), for plain scrolling, for waiting, and for questions to the user (ask_user).\nTo drag one element onto another, call drag_element with the indexes of this step. Do not write a DragEvent script for that. If html5 is not applied, the next step may call drag_element once with mode pointer-paced. Neither result proves the page accepted the drag.\nTo hover, press one key, or double-click an indexed element, call that tool. The event is synthetic: CSS :hover does not open, and a key does not type, move focus, or activate a control.\nTo focus an indexed element, call focus_element. The message says whether it was focused right after.\nTo set a native checkbox or radio, call set_checked. To set a native range, call set_range. The message says whether the control held that state right after. It does not show that a form was saved.\nTo bring an indexed element into view, call scroll_into_view. The message gives the window scroll before and after. Nested scrollers are not measured.\nTo send a wheel event a component listens for, call wheel. It does not scroll. Use scroll to move the page.\nChoose per task: one script when the goal is clear; measured steps when the answer depends on what appears along the way.\nEvery task ends with a measurement that proves the stop condition. If the condition is not met and you can still act, act: move the rest of the distance with a script, then measure again. \"Pages below\" in the page state tells you how far is left.\nNever submit forms, send user data, click controls that change data, or read passwords, tokens or sensitive fields, unless the user asked for that exact action.\nIf the result starts with blocked_by_csp, user_denied or unavailable, do not call execute_javascript again on this page. The user cannot allow that script on the page. Use the indexed tools.\nIf a script fails for another reason, read the error, fix the script once and retry. Then use the common tools.\nFinish with notDone only when you are blocked, and list what you tried.\n<\/script_use_case>\n\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";
|
|
445
|
+
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 don't 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- Check the observation scope: a full-page tree can include elements outside the viewport. A viewport annotation describes geometry, not whether the user can see an unobscured element. When asked to navigate to or show an element, measure its position, scroll if needed, and verify its position again before reporting success. For reading or summarizing, content in the full-page tree can be used without scrolling.\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 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\n<!-- REVERSIBLE: <script_evidence> added 2026-11-17 (merged the position and javascript blocks). To revert, delete this block and its entry in docs/ALMA.md. -->\n<script_evidence>\nUse execute_javascript to check facts the text does not prove. Procedure: measure, compare, decide, cite.\n1. Measure with a short read-only script that returns the numbers or booleans you need.\n2. Compare them. If the comparison is false, the goal is not met: measure again or act.\n3. Done text: cite the measured values in plain language. Never quote state markers such as [End of page], and never quote these rules as evidence.\n Only numbers returned by a tool in this task may appear as evidence. If no measurement was returned, say so.\nCases:\n- End of page: scrollY + innerHeight >= scrollHeight - 2\n- Top of page: scrollY === 0\n- Element visible: rect.top < innerHeight && rect.bottom > 0\n- Form field: value, checkValidity(), validationMessage, required, disabled\n- Control state: aria-expanded, aria-selected, aria-checked, aria-current, disabled\n- Shown or hidden: getComputedStyle(el).display, visibility, opacity\n- Count: querySelectorAll(selector).length against the number requested\n- Text in a container: container.textContent.includes(...), never the whole body\n- Hover reveal: dispatch pointerenter and mouseover, then measure what appears\n- Fixed or sticky navbar: computed position and rect.top after scrolling\n- Dialog open: dialog.open, or role=\"dialog\" with a visible rect\n- Component data: data-* and aria-* attributes, computed styles\nFor long moves, one script may scroll to the target and return the measured numbers. Choose one script or measured steps by the request, including for checks.\nRead and move only. Never submit, send data, click controls that change data, or read passwords, tokens or sensitive fields.\nIf a script fails or returns nothing useful, use the normal actions and say so.\n<\/script_evidence>\n\n<!-- REVERSIBLE: <task_intake> and <script_use_case> added 2026-11-17. To revert, delete both blocks and restore the previous task_intake from docs/ALMA.md. -->\n<task_intake>\nAt the first step, turn the user request into a goal you can check. Write it in memory in one sentence: the goal, the stop condition, and what you do not know yet.\n- Use the site rules and the page data. Do not invent names, addresses, numbers, sections or results.\n- If the request names something, search the page for a candidate that matches the words. One clear candidate: use it. Several or none: ask the user with ask_user (kind=choice when the candidates are a short list).\n- If a fact is neither on the page nor in the rules, say you did not find it.\n- Investigate with read-only checks (get_context for large pages). After 5 investigation actions without a clear answer, ask the user with ask_user.\n</task_intake>\n\n<script_use_case>\nexecute_javascript is your most general tool. It can explore the page in detail and do things the common tools cannot. Use it when one script does the job better than several steps.\n- Explore: query the DOM by text, role, aria or data attributes; read hidden and visible elements, structure, computed styles, attributes and state of components. Scripts may be concise or complex, as the question needs.\n- Navigate: go to a target in one script with window.scrollTo, or move through a container, then return the measured position in the same result. Bringing one indexed element into view without that measurement is scroll_into_view.\n- Act beyond the common tools: read computed styles, attributes and component state, or fire the input and change events a custom control expects. Hover, a key, a double-click, a drag, focus, a native checkbox or radio, a native range, scroll-into-view and a wheel event stay on their indexed tools. Do this only for the action the user asked for.\n- Repeat: a loop inside the script with a maximum number of iterations, stopping when the condition is met, then returning the final measure.\nUse the common tools for single steps that need an indexed element from the page state (click_element_by_index, input_text, select_dropdown_option, drag_element, hover_element, press_key, double_click_element, focus_element, set_checked, set_range, scroll_into_view, wheel), for plain scrolling, for waiting, for reading a vertical slice of a large page (get_context with y_min/y_max), and for questions to the user (ask_user). Prefer ask_user kind=choice or kind=multi when the answer is a closed set of options.\nWhen <browser_state> is too long or you only need one band of the page, call get_context(y_min, y_max) to skim that slice. Document Y is page coordinates (0 at the top of the document). Omit both Y bounds to read the current viewport band. Use query to filter by role/name. With bind_indexes true, indexes in the slice replace the previous ones for the next actions.\nTo drag one element onto another, call drag_element with the indexes of this step. Do not write a DragEvent script for that. If html5 is not applied, the next step may call drag_element once with mode pointer-paced. Neither result proves the page accepted the drag.\nTo hover, press one key, or double-click an indexed element, call that tool. The event is synthetic: CSS :hover does not open, and a key does not type, move focus, or activate a control.\nTo focus an indexed element, call focus_element. The message says whether it was focused right after.\nTo set a native checkbox or radio, call set_checked. To set a native range, call set_range. The message says whether the control held that state right after. It does not show that a form was saved.\nTo bring an indexed element into view, call scroll_into_view. The message gives the window scroll before and after. Nested scrollers are not measured.\nTo send a wheel event a component listens for, call wheel. It does not scroll. Use scroll to move the page.\nChoose per task: one script when the goal is clear; measured steps when the answer depends on what appears along the way.\nEvery task ends with a measurement that proves the stop condition. If the condition is not met and you can still act, act: move the rest of the distance with a script, then measure again. \"Pages below\" in the page state tells you how far is left.\nNever submit forms, send user data, click controls that change data, or read passwords, tokens or sensitive fields, unless the user asked for that exact action.\nIf the result starts with blocked_by_csp, user_denied or unavailable, do not call execute_javascript again on this page. The user cannot allow that script on the page. Use the indexed tools.\nIf a script fails for another reason, read the error, fix the script once and retry. Then use the common tools.\nFinish with notDone only when you are blocked, and list what you tried.\n<\/script_use_case>\n\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";
|
|
446
446
|
//#endregion
|
|
447
447
|
//#region ../core/src/skills/files.ts
|
|
448
448
|
/** Soft cap so panel attaches stay in memory without blowing the tab. */
|
|
@@ -777,12 +777,43 @@ tools.set("wait", tool({
|
|
|
777
777
|
return `✅ Waited for ${(secondsSinceLastUpdate + actualWaitTime).toFixed(2)} seconds.`;
|
|
778
778
|
}
|
|
779
779
|
}));
|
|
780
|
+
tools.set("get_context", tool({
|
|
781
|
+
description: "Read a vertical slice of the page accessibility tree by document Y (page coordinates in CSS pixels). Use when browser_state is too large or you need only one band. y_min/y_max are inclusive overlap bounds; omit both to read the current viewport band. query filters role/name/description. bind_indexes=true (default) replaces action indexes with this slice for the next actions; set false for a read-only skim.",
|
|
782
|
+
inputSchema: z.object({
|
|
783
|
+
y_min: z.number().min(0).optional(),
|
|
784
|
+
y_max: z.number().min(0).optional(),
|
|
785
|
+
max_lines: z.number().int().min(10).max(200).default(80),
|
|
786
|
+
query: z.string().optional(),
|
|
787
|
+
bind_indexes: z.boolean().default(true)
|
|
788
|
+
}),
|
|
789
|
+
execute: async function(input) {
|
|
790
|
+
return (await this.pageController.getContext({
|
|
791
|
+
yMin: input.y_min,
|
|
792
|
+
yMax: input.y_max,
|
|
793
|
+
maxLines: input.max_lines,
|
|
794
|
+
query: input.query,
|
|
795
|
+
bindIndexes: input.bind_indexes
|
|
796
|
+
})).message;
|
|
797
|
+
}
|
|
798
|
+
}));
|
|
780
799
|
tools.set("ask_user", tool({
|
|
781
|
-
description: "Ask the user a question and wait for their answer. Use
|
|
782
|
-
inputSchema: z.object({
|
|
800
|
+
description: "Ask the user a question and wait for their answer. Use kind=text for free text, kind=choice for one option, kind=multi for several options. For choice/multi, pass 2+ distinct choices. Prefer choice/multi when the answer is a closed set.",
|
|
801
|
+
inputSchema: z.object({
|
|
802
|
+
question: z.string(),
|
|
803
|
+
kind: z.enum([
|
|
804
|
+
"text",
|
|
805
|
+
"choice",
|
|
806
|
+
"multi"
|
|
807
|
+
]).default("text"),
|
|
808
|
+
choices: z.array(z.string()).max(12).optional()
|
|
809
|
+
}),
|
|
783
810
|
execute: async function(input, { signal }) {
|
|
784
811
|
if (!this.onAskUser) throw new Error("ask_user tool requires onAskUser callback to be set");
|
|
785
|
-
return `User answered: ${await this.onAskUser(input.question, {
|
|
812
|
+
return `User answered: ${await this.onAskUser(input.question, {
|
|
813
|
+
signal,
|
|
814
|
+
kind: input.kind,
|
|
815
|
+
choices: input.choices
|
|
816
|
+
})}`;
|
|
786
817
|
}
|
|
787
818
|
}));
|
|
788
819
|
tools.set("click_element_by_index", tool({
|
|
@@ -4516,9 +4547,15 @@ var AccessibilityController = class {
|
|
|
4516
4547
|
const capture = await this.#observation(session);
|
|
4517
4548
|
const doc = session.document;
|
|
4518
4549
|
const maxLines = options.maxLines ?? this.#options.observationMaxLines ?? 400;
|
|
4550
|
+
const indexLabels = options.indexLabels !== false;
|
|
4551
|
+
const query = options.query?.trim().toLowerCase() || "";
|
|
4552
|
+
const hasYRange = options.yMin !== void 0 || options.yMax !== void 0;
|
|
4553
|
+
const yMin = options.yMin ?? Number.NEGATIVE_INFINITY;
|
|
4554
|
+
const yMax = options.yMax ?? Number.POSITIVE_INFINITY;
|
|
4519
4555
|
const domNodes = /* @__PURE__ */ new Map();
|
|
4520
4556
|
for (const node of capture.nodes) domNodes.set(node.id, !doc ? null : node.domPath === "" ? doc : resolveDomPath(doc, node.domPath));
|
|
4521
4557
|
const view = doc?.defaultView;
|
|
4558
|
+
const scrollY = view?.scrollY ?? 0;
|
|
4522
4559
|
const viewportAnnotation = (node) => {
|
|
4523
4560
|
const domNode = domNodes.get(node.id);
|
|
4524
4561
|
if (!view || !domNode || domNode.nodeType !== 1) return null;
|
|
@@ -4541,6 +4578,27 @@ var AccessibilityController = class {
|
|
|
4541
4578
|
return null;
|
|
4542
4579
|
}
|
|
4543
4580
|
};
|
|
4581
|
+
const documentBand = (node) => {
|
|
4582
|
+
const domNode = domNodes.get(node.id);
|
|
4583
|
+
if (!view || !domNode || domNode === doc) return null;
|
|
4584
|
+
const element = domNode.nodeType === 1 ? domNode : domNode.parentElement;
|
|
4585
|
+
if (!element) return null;
|
|
4586
|
+
try {
|
|
4587
|
+
const rect = element.getBoundingClientRect();
|
|
4588
|
+
if (![
|
|
4589
|
+
rect.top,
|
|
4590
|
+
rect.bottom,
|
|
4591
|
+
rect.width,
|
|
4592
|
+
rect.height
|
|
4593
|
+
].every(Number.isFinite) || rect.width <= 0 || rect.height <= 0) return null;
|
|
4594
|
+
return {
|
|
4595
|
+
top: rect.top + scrollY,
|
|
4596
|
+
bottom: rect.bottom + scrollY
|
|
4597
|
+
};
|
|
4598
|
+
} catch {
|
|
4599
|
+
return null;
|
|
4600
|
+
}
|
|
4601
|
+
};
|
|
4544
4602
|
const inViewport = (margin) => (node) => {
|
|
4545
4603
|
const domNode = domNodes.get(node.id);
|
|
4546
4604
|
if (!view || !domNode || domNode === doc) return true;
|
|
@@ -4549,18 +4607,36 @@ var AccessibilityController = class {
|
|
|
4549
4607
|
const rect = element.getBoundingClientRect();
|
|
4550
4608
|
return rect.bottom >= -margin && rect.top <= view.innerHeight + margin && rect.right >= -margin && rect.left <= view.innerWidth + margin;
|
|
4551
4609
|
};
|
|
4610
|
+
const matchesQuery = (node) => {
|
|
4611
|
+
if (!query) return true;
|
|
4612
|
+
const value = typeof node.value === "string" || typeof node.value === "number" ? String(node.value) : "";
|
|
4613
|
+
return [
|
|
4614
|
+
node.role,
|
|
4615
|
+
node.name,
|
|
4616
|
+
node.description,
|
|
4617
|
+
value
|
|
4618
|
+
].join(" ").toLowerCase().includes(query);
|
|
4619
|
+
};
|
|
4620
|
+
const inDocumentY = (node) => {
|
|
4621
|
+
if (!hasYRange) return true;
|
|
4622
|
+
const band = documentBand(node);
|
|
4623
|
+
if (!band) return true;
|
|
4624
|
+
return band.bottom >= yMin && band.top <= yMax;
|
|
4625
|
+
};
|
|
4552
4626
|
const format = (filter) => {
|
|
4553
4627
|
const ids = [];
|
|
4554
4628
|
const labels = [];
|
|
4629
|
+
const combined = filter || hasYRange || query ? (node) => (filter ? filter(node) : true) && inDocumentY(node) && matchesQuery(node) : void 0;
|
|
4555
4630
|
return {
|
|
4556
4631
|
...formatTree(capture.nodes, {
|
|
4557
4632
|
...OBSERVATION_FORMAT,
|
|
4558
4633
|
maxLines,
|
|
4559
|
-
filter,
|
|
4634
|
+
filter: combined,
|
|
4560
4635
|
annotation: viewportAnnotation,
|
|
4561
4636
|
idLabel: (node) => {
|
|
4562
4637
|
if (domNodes.get(node.id)?.nodeType !== 1) return null;
|
|
4563
4638
|
labels.push(`${node.role} ${JSON.stringify(clip$1(node.name))}`);
|
|
4639
|
+
if (!indexLabels) return null;
|
|
4564
4640
|
return String(ids.push(node.id) - 1);
|
|
4565
4641
|
}
|
|
4566
4642
|
}),
|
|
@@ -4569,9 +4645,10 @@ var AccessibilityController = class {
|
|
|
4569
4645
|
};
|
|
4570
4646
|
};
|
|
4571
4647
|
const expansion = options.viewportExpansion ?? -1;
|
|
4572
|
-
|
|
4648
|
+
const sliceMode = hasYRange || Boolean(query);
|
|
4649
|
+
let viewportOnly = expansion !== -1 && !sliceMode;
|
|
4573
4650
|
let result = format(viewportOnly ? inViewport(expansion) : void 0);
|
|
4574
|
-
if (!viewportOnly && result.hiddenNodes > 0) {
|
|
4651
|
+
if (!viewportOnly && !sliceMode && result.hiddenNodes > 0) {
|
|
4575
4652
|
viewportOnly = true;
|
|
4576
4653
|
result = format(inViewport(0));
|
|
4577
4654
|
}
|
|
@@ -7004,6 +7081,80 @@ var PageController = class extends EventTarget {
|
|
|
7004
7081
|
};
|
|
7005
7082
|
}
|
|
7006
7083
|
/**
|
|
7084
|
+
* Read a vertical slice of the accessibility tree by document Y (page coordinates).
|
|
7085
|
+
* Use it to skim large pages in pieces. When `bindIndexes` is true, the returned `[index]`
|
|
7086
|
+
* handles replace the current action indexes for this step. When false, the text is read-only
|
|
7087
|
+
* (no indexes) and the agent's current indexes stay as they are.
|
|
7088
|
+
*/
|
|
7089
|
+
async getContext(options = {}) {
|
|
7090
|
+
const page = getPageInfo();
|
|
7091
|
+
const bindIndexes = options.bindIndexes === true;
|
|
7092
|
+
const maxLines = Math.max(10, Math.min(options.maxLines ?? 80, 200));
|
|
7093
|
+
const hasY = options.yMin !== void 0 || options.yMax !== void 0;
|
|
7094
|
+
const yMin = hasY ? Math.max(0, options.yMin ?? 0) : Math.max(0, Math.floor(page.scroll_y));
|
|
7095
|
+
const yMax = hasY ? Math.max(yMin, options.yMax ?? page.page_height) : Math.max(yMin + 1, Math.floor(page.scroll_y + page.viewport_height));
|
|
7096
|
+
if (!this.usesAccessibility()) return {
|
|
7097
|
+
text: "",
|
|
7098
|
+
yMin,
|
|
7099
|
+
yMax,
|
|
7100
|
+
pageHeight: page.page_height,
|
|
7101
|
+
scrollY: page.scroll_y,
|
|
7102
|
+
viewportHeight: page.viewport_height,
|
|
7103
|
+
shownNodes: 0,
|
|
7104
|
+
totalNodes: 0,
|
|
7105
|
+
hiddenNodes: 0,
|
|
7106
|
+
filteredNodes: 0,
|
|
7107
|
+
boundIndexes: false,
|
|
7108
|
+
message: "get_context needs observation: accessibility. The current mode is the element list; scroll and read browser_state instead."
|
|
7109
|
+
};
|
|
7110
|
+
await this.mask?.startProgress();
|
|
7111
|
+
const started = performance.now();
|
|
7112
|
+
try {
|
|
7113
|
+
const observation = await this.accessibility.observeIndexed({
|
|
7114
|
+
maxLines,
|
|
7115
|
+
viewportExpansion: -1,
|
|
7116
|
+
yMin,
|
|
7117
|
+
yMax,
|
|
7118
|
+
query: options.query,
|
|
7119
|
+
indexLabels: bindIndexes
|
|
7120
|
+
});
|
|
7121
|
+
if (bindIndexes) {
|
|
7122
|
+
const indexed = await this.withSurfaceIndexes(observation);
|
|
7123
|
+
this.axObservation = indexed;
|
|
7124
|
+
this.simplifiedHTML = indexed.text;
|
|
7125
|
+
this.indexSource = "accessibility";
|
|
7126
|
+
this.selectorMap.clear();
|
|
7127
|
+
this.elementTextMap = new Map(indexed.labels.map((label, index) => [index, label]));
|
|
7128
|
+
this.lastTimeUpdate = Date.now();
|
|
7129
|
+
this.lastTreeReadMs = Math.round(performance.now() - started);
|
|
7130
|
+
this.isIndexed = true;
|
|
7131
|
+
}
|
|
7132
|
+
const header = [
|
|
7133
|
+
`Context slice y=${Math.round(yMin)}..${Math.round(yMax)} of page_height=${Math.round(page.page_height)} (scrollY=${Math.round(page.scroll_y)}, viewport=${Math.round(page.viewport_height)}).`,
|
|
7134
|
+
options.query ? `Query: ${JSON.stringify(options.query)}.` : null,
|
|
7135
|
+
bindIndexes ? "Indexes in this slice replace the previous action indexes for this step." : "Read-only: no action indexes. Current agent indexes are unchanged.",
|
|
7136
|
+
`Nodes shown ${observation.shownNodes}/${observation.totalNodes}; hidden ${observation.hiddenNodes}; filtered ${observation.filteredNodes}.`
|
|
7137
|
+
].filter(Boolean).join(" ");
|
|
7138
|
+
const text = observation.text.trim() ? `${header}\n\n${observation.text}` : header;
|
|
7139
|
+
return {
|
|
7140
|
+
text,
|
|
7141
|
+
yMin,
|
|
7142
|
+
yMax,
|
|
7143
|
+
pageHeight: page.page_height,
|
|
7144
|
+
scrollY: page.scroll_y,
|
|
7145
|
+
viewportHeight: page.viewport_height,
|
|
7146
|
+
shownNodes: observation.shownNodes,
|
|
7147
|
+
totalNodes: observation.totalNodes,
|
|
7148
|
+
hiddenNodes: observation.hiddenNodes,
|
|
7149
|
+
filteredNodes: observation.filteredNodes,
|
|
7150
|
+
boundIndexes: bindIndexes,
|
|
7151
|
+
message: text
|
|
7152
|
+
};
|
|
7153
|
+
} finally {
|
|
7154
|
+
this.mask?.stopProgress();
|
|
7155
|
+
}
|
|
7156
|
+
}
|
|
7157
|
+
/**
|
|
7007
7158
|
* Get structured browser state for LLM consumption.
|
|
7008
7159
|
* Automatically calls updateTree() to refresh the DOM state.
|
|
7009
7160
|
*/
|
|
@@ -7657,6 +7808,11 @@ var enUS = { ui: {
|
|
|
7657
7808
|
resultError: "Task failed",
|
|
7658
7809
|
questionTitle: "Question",
|
|
7659
7810
|
answerTitle: "Your answer",
|
|
7811
|
+
answerTitleChoice: "Choose one",
|
|
7812
|
+
answerTitleMulti: "Choose all that apply",
|
|
7813
|
+
answerConfirmMulti: "Confirm selection",
|
|
7814
|
+
composerAnswerChoice: "Tap an option above…",
|
|
7815
|
+
composerAnswerMulti: "Select options, then confirm…",
|
|
7660
7816
|
memory: "Memory",
|
|
7661
7817
|
nextGoal: "Next goal",
|
|
7662
7818
|
evaluation: "Last step",
|
|
@@ -7823,6 +7979,11 @@ var ptBR = { ui: {
|
|
|
7823
7979
|
resultError: "Tarefa falhou",
|
|
7824
7980
|
questionTitle: "Pergunta",
|
|
7825
7981
|
answerTitle: "Sua resposta",
|
|
7982
|
+
answerTitleChoice: "Escolha uma",
|
|
7983
|
+
answerTitleMulti: "Escolha todas que se aplicam",
|
|
7984
|
+
answerConfirmMulti: "Confirmar seleção",
|
|
7985
|
+
composerAnswerChoice: "Toque em uma opção acima…",
|
|
7986
|
+
composerAnswerMulti: "Selecione as opções e confirme…",
|
|
7826
7987
|
memory: "Memória",
|
|
7827
7988
|
nextGoal: "Próximo objetivo",
|
|
7828
7989
|
evaluation: "Último passo",
|
|
@@ -7901,6 +8062,8 @@ var TRANSCRIPTION_MODEL = "gpt-4o-mini-transcribe";
|
|
|
7901
8062
|
var REALTIME_VOICE = "marin";
|
|
7902
8063
|
var RUN_TASK = "run_task";
|
|
7903
8064
|
var EXECUTE_JS = "execute_javascript";
|
|
8065
|
+
var ANSWER_QUESTION = "answer_question";
|
|
8066
|
+
var GET_CONTEXT = "get_context";
|
|
7904
8067
|
/** Hands a multi-step task or a judgment about the page to the agent. */
|
|
7905
8068
|
var RUN_TASK_TOOL = {
|
|
7906
8069
|
type: "function",
|
|
@@ -7919,7 +8082,7 @@ var RUN_TASK_TOOL = {
|
|
|
7919
8082
|
var EXECUTE_JS_TOOL = {
|
|
7920
8083
|
type: "function",
|
|
7921
8084
|
name: EXECUTE_JS,
|
|
7922
|
-
description: "Runs JavaScript in this page and returns its result. The variable `agent` is the page-agent instance (`agent.pageController`, `agent.tools`). Use it to read the page, measure positions, or act on an element, without starting an agent task. `await agent.pageController.getState()` reads the page only when needed. Write one script for the whole job, and return a small object with the values you need.",
|
|
8085
|
+
description: "Runs JavaScript in this page and returns its result. The variable `agent` is the page-agent instance (`agent.pageController`, `agent.tools`). Use it to read the page, measure positions, or act on an element, without starting an agent task. Prefer get_context for a vertical tree slice. `await agent.pageController.getState()` reads the page only when needed. Write one script for the whole job, and return a small object with the values you need.",
|
|
7923
8086
|
parameters: {
|
|
7924
8087
|
type: "object",
|
|
7925
8088
|
properties: { script: {
|
|
@@ -7929,6 +8092,48 @@ var EXECUTE_JS_TOOL = {
|
|
|
7929
8092
|
required: ["script"]
|
|
7930
8093
|
}
|
|
7931
8094
|
};
|
|
8095
|
+
/** Sends the user's spoken answer to a pending agent ask_user. */
|
|
8096
|
+
var ANSWER_QUESTION_TOOL = {
|
|
8097
|
+
type: "function",
|
|
8098
|
+
name: ANSWER_QUESTION,
|
|
8099
|
+
description: "Send the user's answer to the agent's pending question. Use this only after the agent asked something (report kind question). Pass the answer exactly as the user said it, or the chosen option label(s).",
|
|
8100
|
+
parameters: {
|
|
8101
|
+
type: "object",
|
|
8102
|
+
properties: { answer: {
|
|
8103
|
+
type: "string",
|
|
8104
|
+
description: "The user's answer, exactly as spoken or the chosen option text."
|
|
8105
|
+
} },
|
|
8106
|
+
required: ["answer"]
|
|
8107
|
+
}
|
|
8108
|
+
};
|
|
8109
|
+
/** Read-only vertical slice of the accessibility tree. */
|
|
8110
|
+
var GET_CONTEXT_TOOL = {
|
|
8111
|
+
type: "function",
|
|
8112
|
+
name: GET_CONTEXT,
|
|
8113
|
+
description: "Read a vertical slice of the page accessibility tree by document Y (page coordinates). Use to skim large pages. Omit y_min/y_max to read the current viewport band. query filters role/name. Read-only for voice: does not change agent action indexes.",
|
|
8114
|
+
parameters: {
|
|
8115
|
+
type: "object",
|
|
8116
|
+
properties: {
|
|
8117
|
+
y_min: {
|
|
8118
|
+
type: "number",
|
|
8119
|
+
description: "Document Y start in CSS pixels."
|
|
8120
|
+
},
|
|
8121
|
+
y_max: {
|
|
8122
|
+
type: "number",
|
|
8123
|
+
description: "Document Y end in CSS pixels."
|
|
8124
|
+
},
|
|
8125
|
+
max_lines: {
|
|
8126
|
+
type: "number",
|
|
8127
|
+
description: "Max tree lines (10–200). Default 60."
|
|
8128
|
+
},
|
|
8129
|
+
query: {
|
|
8130
|
+
type: "string",
|
|
8131
|
+
description: "Optional case-insensitive filter on role/name."
|
|
8132
|
+
}
|
|
8133
|
+
},
|
|
8134
|
+
required: []
|
|
8135
|
+
}
|
|
8136
|
+
};
|
|
7932
8137
|
/**
|
|
7933
8138
|
* Session configuration sent when the call is created. The model answers conversation by itself and uses its
|
|
7934
8139
|
* two tools for the page. Speech interrupts the model (barge-in) through server-side turn detection.
|
|
@@ -7939,7 +8144,12 @@ function callSessionConfig(settings) {
|
|
|
7939
8144
|
model: REALTIME_MODEL,
|
|
7940
8145
|
instructions: settings.instructions,
|
|
7941
8146
|
output_modalities: ["audio"],
|
|
7942
|
-
tools: [
|
|
8147
|
+
tools: [
|
|
8148
|
+
RUN_TASK_TOOL,
|
|
8149
|
+
ANSWER_QUESTION_TOOL,
|
|
8150
|
+
GET_CONTEXT_TOOL,
|
|
8151
|
+
EXECUTE_JS_TOOL
|
|
8152
|
+
],
|
|
7943
8153
|
tool_choice: "auto",
|
|
7944
8154
|
audio: {
|
|
7945
8155
|
input: {
|
|
@@ -7970,7 +8180,7 @@ function currentTimeLine(now = /* @__PURE__ */ new Date()) {
|
|
|
7970
8180
|
}).format(now)} (${zone}).`;
|
|
7971
8181
|
}
|
|
7972
8182
|
var KIND_LABEL = {
|
|
7973
|
-
question: "The agent needs an answer from the user",
|
|
8183
|
+
question: "The agent needs an answer from the user. Speak the question. When the user answers, call answer_question with their answer exactly. Do not call run_task for that answer",
|
|
7974
8184
|
done: "The task was completed",
|
|
7975
8185
|
"not-done": "The task was not completed",
|
|
7976
8186
|
stopped: "The task was stopped",
|
|
@@ -8082,7 +8292,12 @@ function toGeminiSchema(schema) {
|
|
|
8082
8292
|
}
|
|
8083
8293
|
/** The two tools, declared with the same names, descriptions and parameters as for OpenAI. */
|
|
8084
8294
|
function geminiTools() {
|
|
8085
|
-
return [{ functionDeclarations: [
|
|
8295
|
+
return [{ functionDeclarations: [
|
|
8296
|
+
RUN_TASK_TOOL,
|
|
8297
|
+
ANSWER_QUESTION_TOOL,
|
|
8298
|
+
GET_CONTEXT_TOOL,
|
|
8299
|
+
EXECUTE_JS_TOOL
|
|
8300
|
+
].map((tool) => ({
|
|
8086
8301
|
name: tool.name,
|
|
8087
8302
|
description: tool.description,
|
|
8088
8303
|
parameters: toGeminiSchema(tool.parameters)
|
|
@@ -8559,7 +8774,7 @@ var RealtimeClient = class {
|
|
|
8559
8774
|
};
|
|
8560
8775
|
//#endregion
|
|
8561
8776
|
//#region ../ui/src/voice/prompts/voice.md?raw
|
|
8562
|
-
var voice_default = "You are the voice of a web assistant that works on the website the user is looking at. You talk with the user; the page agent carries out page tasks.\n\n- Reply in the language set by the panel, in short sentences.\n- Answer greetings, small talk and anything you can answer without the page. Do not use a tool for them.\n- Before you call a tool, say nothing. After a tool result, say only its result in one short sentence.\n- To
|
|
8777
|
+
var voice_default = "You are the voice of a web assistant that works on the website the user is looking at. You talk with the user; the page agent carries out page tasks.\n\n- Reply in the language set by the panel, in short sentences.\n- Answer greetings, small talk and anything you can answer without the page. Do not use a tool for them.\n- Before you call a tool, say nothing. After a tool result, say only its result in one short sentence.\n- To skim the page tree in pieces, call get_context with optional y_min/y_max (document Y in CSS pixels) or query. Omit both Y bounds to read the current viewport band.\n- To check or change the page yourself with a script, write ONE execute_javascript script that does the whole job. Prefer get_context for reading. `await agent.pageController.getState()` reads the page only when it was never read or the last read is older than 10 seconds.\n- For any task that changes the page or needs several steps, call run_task with the user's request exactly as the user said it. Do not rewrite it, do not add context, do not interpret it. The agent understands the request and asks the user when it needs more.\n- Never call agent.execute yourself.\n- When the agent asks a question (report kind question), speak that question. When the user answers, call answer_question with their answer exactly (or the chosen option label). Do not call run_task for that answer.\n- After run_task starts, do not use execute_javascript on the page until the agent reports a result. get_context and answer_question remain allowed. Tell the user the task started; do not say it finished.\n- If a tool says the agent is busy, say so and suggest trying again when the task ends.\n- If the user asks to stop, tell them to press the stop button in the panel.\n- When the agent reports a result, say it in one sentence, without technical details, element indexes or markers such as [End of page].\n- Never say an action was done or a check passed unless a tool result or the agent reported it.\n";
|
|
8563
8778
|
//#endregion
|
|
8564
8779
|
//#region ../ui/src/voice/voice-prompt.ts
|
|
8565
8780
|
/**
|
|
@@ -8585,6 +8800,10 @@ function resolveVoicePrompt(custom, override = false) {
|
|
|
8585
8800
|
var BUSY_OUTPUT = "O agente está ocupado com outra tarefa. Avise o usuário e não repita o pedido agora.";
|
|
8586
8801
|
/** Result given to the model when the task was started. */
|
|
8587
8802
|
var STARTED_OUTPUT = "Tarefa iniciada no agente. Confirme ao usuário em uma frase.";
|
|
8803
|
+
/** Result when answer_question is used without a pending ask. */
|
|
8804
|
+
var NO_PENDING_QUESTION_OUTPUT = "Não há pergunta pendente do agente. Se o usuário pediu uma tarefa, use run_task.";
|
|
8805
|
+
/** Result when the answer was delivered to the agent. */
|
|
8806
|
+
var ANSWERED_OUTPUT = "Resposta enviada ao agente. Confirme ao usuário em uma frase.";
|
|
8588
8807
|
/** Errors about cancelling a response that is not running are harmless and must not end the call. */
|
|
8589
8808
|
function isHarmlessCancelError(message) {
|
|
8590
8809
|
return /cancel/i.test(message);
|
|
@@ -8725,12 +8944,32 @@ var VoiceSession = class {
|
|
|
8725
8944
|
}
|
|
8726
8945
|
}
|
|
8727
8946
|
#handleToolCall(name, callId, args) {
|
|
8947
|
+
if (name === "answer_question") {
|
|
8948
|
+
const answer = typeof args.answer === "string" ? args.answer.trim() : "";
|
|
8949
|
+
if (!answer) return;
|
|
8950
|
+
const delivered = this.#options.onAnswer?.(answer) ?? false;
|
|
8951
|
+
this.#answer(callId, delivered ? ANSWERED_OUTPUT : NO_PENDING_QUESTION_OUTPUT);
|
|
8952
|
+
return;
|
|
8953
|
+
}
|
|
8728
8954
|
if (name === "run_task") {
|
|
8729
8955
|
const task = typeof args.task === "string" ? args.task.trim() : "";
|
|
8730
8956
|
if (!task) return;
|
|
8957
|
+
if (this.#options.isWaitingForAnswer?.()) {
|
|
8958
|
+
const delivered = this.#options.onAnswer?.(task) ?? this.#options.onTask(task);
|
|
8959
|
+
this.#answer(callId, delivered ? ANSWERED_OUTPUT : NO_PENDING_QUESTION_OUTPUT);
|
|
8960
|
+
return;
|
|
8961
|
+
}
|
|
8731
8962
|
this.#answer(callId, this.#options.onTask(task) ? STARTED_OUTPUT : BUSY_OUTPUT);
|
|
8732
8963
|
return;
|
|
8733
8964
|
}
|
|
8965
|
+
if (name === "get_context") {
|
|
8966
|
+
if (!this.#options.onGetContext) {
|
|
8967
|
+
this.#answer(callId, "get_context is not available in this session.");
|
|
8968
|
+
return;
|
|
8969
|
+
}
|
|
8970
|
+
this.#runGetContext(callId, args);
|
|
8971
|
+
return;
|
|
8972
|
+
}
|
|
8734
8973
|
if (name === "execute_javascript") {
|
|
8735
8974
|
const script = typeof args.script === "string" ? args.script : "";
|
|
8736
8975
|
if (!this.#options.onScript) {
|
|
@@ -8744,6 +8983,25 @@ var VoiceSession = class {
|
|
|
8744
8983
|
this.#runScript(callId, script);
|
|
8745
8984
|
}
|
|
8746
8985
|
}
|
|
8986
|
+
async #runGetContext(callId, args) {
|
|
8987
|
+
const client = this.#client;
|
|
8988
|
+
const run = this.#options.onGetContext;
|
|
8989
|
+
if (!client || !run) return;
|
|
8990
|
+
const num = (value) => typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
8991
|
+
let output;
|
|
8992
|
+
try {
|
|
8993
|
+
output = await run({
|
|
8994
|
+
yMin: num(args.y_min),
|
|
8995
|
+
yMax: num(args.y_max),
|
|
8996
|
+
maxLines: num(args.max_lines),
|
|
8997
|
+
query: typeof args.query === "string" ? args.query : void 0
|
|
8998
|
+
});
|
|
8999
|
+
} catch (error) {
|
|
9000
|
+
output = `get_context failed: ${error instanceof Error ? error.message : "unknown error"}`;
|
|
9001
|
+
}
|
|
9002
|
+
if (this.#client !== client) return;
|
|
9003
|
+
this.#answer(callId, output.slice(0, 2500));
|
|
9004
|
+
}
|
|
8747
9005
|
/** Sends the result of a tool call back to the model, then the model speaks again. */
|
|
8748
9006
|
#answer(callId, output) {
|
|
8749
9007
|
for (const message of toolResultCommands(callId, output)) this.#client?.send(message);
|
|
@@ -8794,140 +9052,143 @@ function truncate(text, maxLength) {
|
|
|
8794
9052
|
}
|
|
8795
9053
|
//#endregion
|
|
8796
9054
|
//#region ../ui/src/panel/Panel.module.css
|
|
8797
|
-
var wrapper = "
|
|
8798
|
-
var collapsed = "
|
|
8799
|
-
var feedWrap = "
|
|
8800
|
-
var followBar = "
|
|
8801
|
-
var followBarBody = "
|
|
8802
|
-
var followBarStatus = "
|
|
8803
|
-
var followBarLens = "
|
|
8804
|
-
var voiceActions = "
|
|
8805
|
-
var header = "
|
|
8806
|
-
var brand = "
|
|
8807
|
-
var titleBlock = "
|
|
8808
|
-
var title = "
|
|
8809
|
-
var status = "
|
|
8810
|
-
var controls = "
|
|
8811
|
-
var iconButton = "
|
|
8812
|
-
var stopButton = "
|
|
8813
|
-
var feed = "
|
|
8814
|
-
var rail = "
|
|
8815
|
-
var railThumb = "
|
|
8816
|
-
var railMark = "
|
|
8817
|
-
var divider = "
|
|
8818
|
-
var peek = "
|
|
8819
|
-
var peekIn = "
|
|
8820
|
-
var peekHead = "
|
|
8821
|
-
var peekText = "
|
|
8822
|
-
var pin = "
|
|
8823
|
-
var jump = "
|
|
8824
|
-
var jumpIn = "
|
|
8825
|
-
var empty = "
|
|
8826
|
-
var enter = "
|
|
8827
|
-
var bubble = "
|
|
8828
|
-
var line$1 = "
|
|
8829
|
-
var reflection = "
|
|
8830
|
-
var observation = "
|
|
8831
|
-
var warning = "
|
|
8832
|
-
var live = "
|
|
8833
|
-
var pulse = "
|
|
8834
|
-
var tool$1 = "
|
|
8835
|
-
var toolHead = "
|
|
8836
|
-
var toolDot = "
|
|
8837
|
-
var toolLabel$1 = "
|
|
8838
|
-
var toolDetail = "
|
|
8839
|
-
var spinner$1 = "
|
|
8840
|
-
var spin = "
|
|
8841
|
-
var question = "
|
|
8842
|
-
var questionTag = "
|
|
8843
|
-
var questionText = "
|
|
8844
|
-
var result = "
|
|
8845
|
-
var resultText = "
|
|
8846
|
-
var composer = "
|
|
8847
|
-
var answerContext = "
|
|
8848
|
-
var
|
|
8849
|
-
var
|
|
8850
|
-
var
|
|
8851
|
-
var
|
|
8852
|
-
var
|
|
8853
|
-
var
|
|
8854
|
-
var
|
|
8855
|
-
var
|
|
8856
|
-
var
|
|
8857
|
-
var
|
|
8858
|
-
var
|
|
8859
|
-
var
|
|
8860
|
-
var
|
|
8861
|
-
var
|
|
8862
|
-
var
|
|
8863
|
-
var
|
|
8864
|
-
var
|
|
8865
|
-
var
|
|
8866
|
-
var
|
|
8867
|
-
var
|
|
8868
|
-
var
|
|
8869
|
-
var
|
|
8870
|
-
var
|
|
8871
|
-
var
|
|
8872
|
-
var
|
|
8873
|
-
var
|
|
8874
|
-
var
|
|
8875
|
-
var
|
|
8876
|
-
var
|
|
8877
|
-
var
|
|
8878
|
-
var
|
|
8879
|
-
var
|
|
8880
|
-
var
|
|
8881
|
-
var
|
|
8882
|
-
var
|
|
8883
|
-
var
|
|
8884
|
-
var
|
|
8885
|
-
var
|
|
8886
|
-
var
|
|
8887
|
-
var
|
|
8888
|
-
var
|
|
8889
|
-
var
|
|
8890
|
-
var
|
|
8891
|
-
var
|
|
8892
|
-
var
|
|
8893
|
-
var
|
|
8894
|
-
var
|
|
8895
|
-
var
|
|
8896
|
-
var
|
|
8897
|
-
var
|
|
8898
|
-
var
|
|
8899
|
-
var
|
|
8900
|
-
var
|
|
8901
|
-
var
|
|
8902
|
-
var
|
|
8903
|
-
var
|
|
8904
|
-
var
|
|
8905
|
-
var
|
|
8906
|
-
var
|
|
8907
|
-
var
|
|
8908
|
-
var
|
|
8909
|
-
var
|
|
8910
|
-
var
|
|
8911
|
-
var
|
|
8912
|
-
var
|
|
8913
|
-
var
|
|
8914
|
-
var
|
|
8915
|
-
var
|
|
8916
|
-
var
|
|
8917
|
-
var
|
|
8918
|
-
var
|
|
8919
|
-
var
|
|
8920
|
-
var
|
|
8921
|
-
var
|
|
8922
|
-
var
|
|
8923
|
-
var
|
|
8924
|
-
var
|
|
8925
|
-
var
|
|
8926
|
-
var
|
|
8927
|
-
var
|
|
8928
|
-
var
|
|
8929
|
-
var
|
|
8930
|
-
var
|
|
9055
|
+
var wrapper = "_wrapper_1jypc_3";
|
|
9056
|
+
var collapsed = "_collapsed_1jypc_80";
|
|
9057
|
+
var feedWrap = "_feedWrap_1jypc_80";
|
|
9058
|
+
var followBar = "_followBar_1jypc_85";
|
|
9059
|
+
var followBarBody = "_followBarBody_1jypc_95";
|
|
9060
|
+
var followBarStatus = "_followBarStatus_1jypc_110";
|
|
9061
|
+
var followBarLens = "_followBarLens_1jypc_120";
|
|
9062
|
+
var voiceActions = "_voiceActions_1jypc_130";
|
|
9063
|
+
var header = "_header_1jypc_148";
|
|
9064
|
+
var brand = "_brand_1jypc_161";
|
|
9065
|
+
var titleBlock = "_titleBlock_1jypc_185";
|
|
9066
|
+
var title = "_title_1jypc_185";
|
|
9067
|
+
var status = "_status_1jypc_200";
|
|
9068
|
+
var controls = "_controls_1jypc_208";
|
|
9069
|
+
var iconButton = "_iconButton_1jypc_214";
|
|
9070
|
+
var stopButton = "_stopButton_1jypc_232";
|
|
9071
|
+
var feed = "_feed_1jypc_80";
|
|
9072
|
+
var rail = "_rail_1jypc_263";
|
|
9073
|
+
var railThumb = "_railThumb_1jypc_294";
|
|
9074
|
+
var railMark = "_railMark_1jypc_303";
|
|
9075
|
+
var divider = "_divider_1jypc_373";
|
|
9076
|
+
var peek = "_peek_1jypc_393";
|
|
9077
|
+
var peekIn = "_peekIn_1jypc_1";
|
|
9078
|
+
var peekHead = "_peekHead_1jypc_421";
|
|
9079
|
+
var peekText = "_peekText_1jypc_436";
|
|
9080
|
+
var pin = "_pin_1jypc_449";
|
|
9081
|
+
var jump = "_jump_1jypc_482";
|
|
9082
|
+
var jumpIn = "_jumpIn_1jypc_1";
|
|
9083
|
+
var empty = "_empty_1jypc_523";
|
|
9084
|
+
var enter = "_enter_1jypc_531";
|
|
9085
|
+
var bubble = "_bubble_1jypc_546";
|
|
9086
|
+
var line$1 = "_line_1jypc_556";
|
|
9087
|
+
var reflection = "_reflection_1jypc_563";
|
|
9088
|
+
var observation = "_observation_1jypc_568";
|
|
9089
|
+
var warning = "_warning_1jypc_572";
|
|
9090
|
+
var live = "_live_1jypc_576";
|
|
9091
|
+
var pulse = "_pulse_1jypc_1";
|
|
9092
|
+
var tool$1 = "_tool_1jypc_605";
|
|
9093
|
+
var toolHead = "_toolHead_1jypc_622";
|
|
9094
|
+
var toolDot = "_toolDot_1jypc_628";
|
|
9095
|
+
var toolLabel$1 = "_toolLabel_1jypc_636";
|
|
9096
|
+
var toolDetail = "_toolDetail_1jypc_641";
|
|
9097
|
+
var spinner$1 = "_spinner_1jypc_649";
|
|
9098
|
+
var spin = "_spin_1jypc_649";
|
|
9099
|
+
var question = "_question_1jypc_667";
|
|
9100
|
+
var questionTag = "_questionTag_1jypc_672";
|
|
9101
|
+
var questionText = "_questionText_1jypc_680";
|
|
9102
|
+
var result = "_result_1jypc_685";
|
|
9103
|
+
var resultText = "_resultText_1jypc_712";
|
|
9104
|
+
var composer = "_composer_1jypc_720";
|
|
9105
|
+
var answerContext = "_answerContext_1jypc_729";
|
|
9106
|
+
var choiceRow = "_choiceRow_1jypc_738";
|
|
9107
|
+
var choiceChip = "_choiceChip_1jypc_744";
|
|
9108
|
+
var choiceConfirm = "_choiceConfirm_1jypc_769";
|
|
9109
|
+
var box = "_box_1jypc_788";
|
|
9110
|
+
var actions = "_actions_1jypc_827";
|
|
9111
|
+
var attachList = "_attachList_1jypc_833";
|
|
9112
|
+
var attachChip = "_attachChip_1jypc_840";
|
|
9113
|
+
var attachName = "_attachName_1jypc_852";
|
|
9114
|
+
var attachRemove = "_attachRemove_1jypc_859";
|
|
9115
|
+
var attachError = "_attachError_1jypc_883";
|
|
9116
|
+
var roundButton = "_roundButton_1jypc_889";
|
|
9117
|
+
var send = "_send_1jypc_907";
|
|
9118
|
+
var studio = "_studio_1jypc_920";
|
|
9119
|
+
var studioHeader = "_studioHeader_1jypc_930";
|
|
9120
|
+
var studioTitle = "_studioTitle_1jypc_937";
|
|
9121
|
+
var studioTabs = "_studioTabs_1jypc_942";
|
|
9122
|
+
var studioTab = "_studioTab_1jypc_942";
|
|
9123
|
+
var studioBody = "_studioBody_1jypc_964";
|
|
9124
|
+
var studioHint = "_studioHint_1jypc_973";
|
|
9125
|
+
var studioToolbar = "_studioToolbar_1jypc_980";
|
|
9126
|
+
var studioToolButton = "_studioToolButton_1jypc_986";
|
|
9127
|
+
var studioStatus = "_studioStatus_1jypc_1012";
|
|
9128
|
+
var studioAsk = "_studioAsk_1jypc_1032";
|
|
9129
|
+
var studioSteps = "_studioSteps_1jypc_1050";
|
|
9130
|
+
var studioCatalog = "_studioCatalog_1jypc_1051";
|
|
9131
|
+
var studioStep = "_studioStep_1jypc_1050";
|
|
9132
|
+
var studioCatalogRow = "_studioCatalogRow_1jypc_1063";
|
|
9133
|
+
var studioWatchers = "_studioWatchers_1jypc_1078";
|
|
9134
|
+
var studioWatchersHead = "_studioWatchersHead_1jypc_1088";
|
|
9135
|
+
var studioWatchersTitle = "_studioWatchersTitle_1jypc_1095";
|
|
9136
|
+
var studioWatchersEmpty = "_studioWatchersEmpty_1jypc_1103";
|
|
9137
|
+
var studioWatchersList = "_studioWatchersList_1jypc_1109";
|
|
9138
|
+
var studioWatcherChip = "_studioWatcherChip_1jypc_1118";
|
|
9139
|
+
var studioWatcherLabel = "_studioWatcherLabel_1jypc_1131";
|
|
9140
|
+
var studioWatcherMeta = "_studioWatcherMeta_1jypc_1139";
|
|
9141
|
+
var studioStepBody = "_studioStepBody_1jypc_1162";
|
|
9142
|
+
var studioCatalogBody = "_studioCatalogBody_1jypc_1163";
|
|
9143
|
+
var studioStepKind = "_studioStepKind_1jypc_1168";
|
|
9144
|
+
var studioStepMeta = "_studioStepMeta_1jypc_1180";
|
|
9145
|
+
var studioCatalogMeta = "_studioCatalogMeta_1jypc_1181";
|
|
9146
|
+
var studioStepActions = "_studioStepActions_1jypc_1186";
|
|
9147
|
+
var studioCatalogActions = "_studioCatalogActions_1jypc_1187";
|
|
9148
|
+
var studioPreviewLabel = "_studioPreviewLabel_1jypc_1230";
|
|
9149
|
+
var studioPreview = "_studioPreview_1jypc_1230";
|
|
9150
|
+
var voice = "_voice_1jypc_130";
|
|
9151
|
+
var voiceMeta = "_voiceMeta_1jypc_1268";
|
|
9152
|
+
var lens = "_lens_1jypc_1276";
|
|
9153
|
+
var breathe = "_breathe_1jypc_1";
|
|
9154
|
+
var voiceText = "_voiceText_1jypc_1320";
|
|
9155
|
+
var micDevice = "_micDevice_1jypc_1329";
|
|
9156
|
+
var textButton = "_textButton_1jypc_1358";
|
|
9157
|
+
var fab = "_fab_1jypc_1377";
|
|
9158
|
+
var fabLeft = "_fabLeft_1jypc_1421";
|
|
9159
|
+
var tip = "_tip_1jypc_1427";
|
|
9160
|
+
var tipUp = "_tipUp_1jypc_1450";
|
|
9161
|
+
var code = "_code_1jypc_1820";
|
|
9162
|
+
var codeHead = "_codeHead_1jypc_1838";
|
|
9163
|
+
var codeTitle = "_codeTitle_1jypc_1845";
|
|
9164
|
+
var codeMeta = "_codeMeta_1jypc_1850";
|
|
9165
|
+
var codeStatus = "_codeStatus_1jypc_1860";
|
|
9166
|
+
var codeBadge = "_codeBadge_1jypc_1870";
|
|
9167
|
+
var codeSection = "_codeSection_1jypc_1880";
|
|
9168
|
+
var codeLabel = "_codeLabel_1jypc_1885";
|
|
9169
|
+
var clip = "_clip_1jypc_1894";
|
|
9170
|
+
var codeBlock$1 = "_codeBlock_1jypc_1899";
|
|
9171
|
+
var resultBlock = "_resultBlock_1jypc_1900";
|
|
9172
|
+
var clipBody = "_clipBody_1jypc_1917";
|
|
9173
|
+
var clipToggle = "_clipToggle_1jypc_1940";
|
|
9174
|
+
var tkComment = "_tkComment_1jypc_1959";
|
|
9175
|
+
var tkString = "_tkString_1jypc_1964";
|
|
9176
|
+
var tkNumber = "_tkNumber_1jypc_1968";
|
|
9177
|
+
var tkKeyword = "_tkKeyword_1jypc_1972";
|
|
9178
|
+
var tkName = "_tkName_1jypc_1976";
|
|
9179
|
+
var tkPunct = "_tkPunct_1jypc_1980";
|
|
9180
|
+
var tkKey = "_tkKey_1jypc_1972";
|
|
9181
|
+
var tkBool = "_tkBool_1jypc_1988";
|
|
9182
|
+
var foldHead = "_foldHead_1jypc_2000";
|
|
9183
|
+
var foldBody = "_foldBody_1jypc_2023";
|
|
9184
|
+
var foldInner = "_foldInner_1jypc_2029";
|
|
9185
|
+
var fold = "_fold_1jypc_2000";
|
|
9186
|
+
var toolState = "_toolState_1jypc_2043";
|
|
9187
|
+
var codeRunning = "_codeRunning_1jypc_2057";
|
|
9188
|
+
var codeDot = "_codeDot_1jypc_2058";
|
|
9189
|
+
var pop = "_pop_1jypc_1";
|
|
9190
|
+
var toolChip = "_toolChip_1jypc_2154";
|
|
9191
|
+
var toolSummary = "_toolSummary_1jypc_2165";
|
|
8931
9192
|
var Panel_module_default = {
|
|
8932
9193
|
wrapper,
|
|
8933
9194
|
collapsed,
|
|
@@ -8980,6 +9241,9 @@ var Panel_module_default = {
|
|
|
8980
9241
|
resultText,
|
|
8981
9242
|
composer,
|
|
8982
9243
|
answerContext,
|
|
9244
|
+
choiceRow,
|
|
9245
|
+
choiceChip,
|
|
9246
|
+
choiceConfirm,
|
|
8983
9247
|
box,
|
|
8984
9248
|
actions,
|
|
8985
9249
|
attachList,
|
|
@@ -9478,6 +9742,15 @@ function toolVisual(name, input, output) {
|
|
|
9478
9742
|
tone: "ask",
|
|
9479
9743
|
summary: truncate(textOf(args.question), 32)
|
|
9480
9744
|
};
|
|
9745
|
+
case "get_context": {
|
|
9746
|
+
const yMin = textOf(args.y_min);
|
|
9747
|
+
const yMax = textOf(args.y_max);
|
|
9748
|
+
return {
|
|
9749
|
+
icon: "list",
|
|
9750
|
+
tone: "generic",
|
|
9751
|
+
summary: truncate(yMin || yMax ? `${yMin || "0"}–${yMax || "…"}` : "viewport", 24)
|
|
9752
|
+
};
|
|
9753
|
+
}
|
|
9481
9754
|
default: return {
|
|
9482
9755
|
icon: "spark",
|
|
9483
9756
|
tone: "generic",
|
|
@@ -10100,6 +10373,7 @@ var Panel = class {
|
|
|
10100
10373
|
#outcomeSpoken = false;
|
|
10101
10374
|
#live = null;
|
|
10102
10375
|
#question = null;
|
|
10376
|
+
#choiceRow = null;
|
|
10103
10377
|
#fab;
|
|
10104
10378
|
#rail;
|
|
10105
10379
|
#thumb;
|
|
@@ -10167,7 +10441,7 @@ var Panel = class {
|
|
|
10167
10441
|
this.#recovery = null;
|
|
10168
10442
|
console.warn("[page-agent] Conversation recovery unavailable", error);
|
|
10169
10443
|
}
|
|
10170
|
-
this.#agent.onAskUser = (question, options) => this.#askUser(question, options
|
|
10444
|
+
this.#agent.onAskUser = (question, options) => this.#askUser(question, options);
|
|
10171
10445
|
this.#wrapper = this.#createWrapper();
|
|
10172
10446
|
this.#feed = this.#wrapper.querySelector("[data-role=\"feed\"]");
|
|
10173
10447
|
if (typeof ResizeObserver !== "undefined") new ResizeObserver(() => {
|
|
@@ -10555,26 +10829,97 @@ var Panel = class {
|
|
|
10555
10829
|
* Ask the user a question on behalf of the agent. Rejects when `signal` aborts
|
|
10556
10830
|
* (task stopped or disposed), so the agent loop can settle.
|
|
10557
10831
|
*/
|
|
10558
|
-
#askUser(question,
|
|
10832
|
+
#askUser(question, options) {
|
|
10559
10833
|
return new Promise((resolve, reject) => {
|
|
10834
|
+
const choices = (options?.choices ?? []).map((c) => c.trim()).filter(Boolean);
|
|
10835
|
+
let kind = options?.kind ?? "text";
|
|
10836
|
+
if ((kind === "choice" || kind === "multi") && choices.length < 2) kind = "text";
|
|
10560
10837
|
this.#question = {
|
|
10561
|
-
text: question,
|
|
10838
|
+
text: question.trim(),
|
|
10839
|
+
kind,
|
|
10840
|
+
choices,
|
|
10841
|
+
selected: /* @__PURE__ */ new Set(),
|
|
10562
10842
|
resolve
|
|
10563
10843
|
};
|
|
10564
10844
|
this.#setCollapsed(false);
|
|
10565
10845
|
this.#render();
|
|
10846
|
+
const choiceLine = kind === "text" || choices.length === 0 ? "" : `\nOptions (${kind}): ${choices.map((c, i) => `${i + 1}. ${c}`).join("; ")}`;
|
|
10566
10847
|
this.#voice.report({
|
|
10567
10848
|
kind: "question",
|
|
10568
|
-
text: question
|
|
10849
|
+
text: `${question.trim()}${choiceLine}`
|
|
10569
10850
|
});
|
|
10570
|
-
this.#textarea.focus();
|
|
10571
|
-
signal?.addEventListener("abort", () => {
|
|
10851
|
+
if (kind === "text") this.#textarea.focus();
|
|
10852
|
+
options?.signal?.addEventListener("abort", () => {
|
|
10572
10853
|
this.#question = null;
|
|
10573
10854
|
this.#render();
|
|
10574
|
-
reject(signal.reason);
|
|
10855
|
+
reject(options.signal.reason);
|
|
10575
10856
|
}, { once: true });
|
|
10576
10857
|
});
|
|
10577
10858
|
}
|
|
10859
|
+
/** Resolve a pending ask from text, voice, or a choice chip. */
|
|
10860
|
+
#resolveQuestion(answer) {
|
|
10861
|
+
if (!this.#question) return false;
|
|
10862
|
+
const value = answer.trim();
|
|
10863
|
+
if (!value) return false;
|
|
10864
|
+
const { resolve } = this.#question;
|
|
10865
|
+
this.#question = null;
|
|
10866
|
+
this.#choiceRow?.remove();
|
|
10867
|
+
this.#choiceRow = null;
|
|
10868
|
+
resolve(value);
|
|
10869
|
+
this.#render();
|
|
10870
|
+
return true;
|
|
10871
|
+
}
|
|
10872
|
+
/** Choice / multi-choice chips under the ask prompt. */
|
|
10873
|
+
#renderChoiceChips() {
|
|
10874
|
+
const q = this.#question;
|
|
10875
|
+
if (!q || q.kind !== "choice" && q.kind !== "multi" || q.choices.length === 0) {
|
|
10876
|
+
this.#choiceRow?.remove();
|
|
10877
|
+
this.#choiceRow = null;
|
|
10878
|
+
return;
|
|
10879
|
+
}
|
|
10880
|
+
const t = this.#i18n.t.bind(this.#i18n);
|
|
10881
|
+
let row = this.#choiceRow;
|
|
10882
|
+
if (!row) {
|
|
10883
|
+
row = document.createElement("div");
|
|
10884
|
+
row.className = Panel_module_default.choiceRow;
|
|
10885
|
+
row.dataset.role = "choice-row";
|
|
10886
|
+
this.#answerContext.append(row);
|
|
10887
|
+
this.#choiceRow = row;
|
|
10888
|
+
}
|
|
10889
|
+
row.replaceChildren();
|
|
10890
|
+
for (const choice of q.choices) {
|
|
10891
|
+
const btn = document.createElement("button");
|
|
10892
|
+
btn.type = "button";
|
|
10893
|
+
btn.className = Panel_module_default.choiceChip;
|
|
10894
|
+
btn.textContent = choice;
|
|
10895
|
+
const selected = q.selected.has(choice);
|
|
10896
|
+
btn.setAttribute("aria-pressed", String(selected));
|
|
10897
|
+
if (selected) btn.dataset.selected = "true";
|
|
10898
|
+
btn.addEventListener("click", () => {
|
|
10899
|
+
if (!this.#question) return;
|
|
10900
|
+
if (this.#question.kind === "choice") {
|
|
10901
|
+
this.#resolveQuestion(choice);
|
|
10902
|
+
return;
|
|
10903
|
+
}
|
|
10904
|
+
if (this.#question.selected.has(choice)) this.#question.selected.delete(choice);
|
|
10905
|
+
else this.#question.selected.add(choice);
|
|
10906
|
+
this.#render();
|
|
10907
|
+
});
|
|
10908
|
+
row.append(btn);
|
|
10909
|
+
}
|
|
10910
|
+
if (q.kind === "multi") {
|
|
10911
|
+
const confirm = document.createElement("button");
|
|
10912
|
+
confirm.type = "button";
|
|
10913
|
+
confirm.className = Panel_module_default.choiceConfirm;
|
|
10914
|
+
confirm.textContent = t("ui.panel.answerConfirmMulti");
|
|
10915
|
+
confirm.disabled = q.selected.size === 0;
|
|
10916
|
+
confirm.addEventListener("click", () => {
|
|
10917
|
+
if (!this.#question || this.#question.selected.size === 0) return;
|
|
10918
|
+
this.#resolveQuestion([...this.#question.selected].join("; "));
|
|
10919
|
+
});
|
|
10920
|
+
row.append(confirm);
|
|
10921
|
+
}
|
|
10922
|
+
}
|
|
10578
10923
|
#submit() {
|
|
10579
10924
|
const value = this.#textarea.value.trim();
|
|
10580
10925
|
if (!value) return;
|
|
@@ -10584,13 +10929,7 @@ var Panel = class {
|
|
|
10584
10929
|
}
|
|
10585
10930
|
/** Sends a task or answers a pending question. The text field and voice both use this path. */
|
|
10586
10931
|
#send(value) {
|
|
10587
|
-
if (this.#question)
|
|
10588
|
-
const { resolve } = this.#question;
|
|
10589
|
-
this.#question = null;
|
|
10590
|
-
resolve(value);
|
|
10591
|
-
this.#render();
|
|
10592
|
-
return true;
|
|
10593
|
-
}
|
|
10932
|
+
if (this.#question) return this.#resolveQuestion(value);
|
|
10594
10933
|
if (this.#agent.status === "running") return false;
|
|
10595
10934
|
this.#archiveCurrent();
|
|
10596
10935
|
this.#anchorTurn = true;
|
|
@@ -10647,6 +10986,16 @@ var Panel = class {
|
|
|
10647
10986
|
this.#render();
|
|
10648
10987
|
return output;
|
|
10649
10988
|
}
|
|
10989
|
+
/** Read-only context slice for the voice; allowed while the agent is running. */
|
|
10990
|
+
async #runVoiceGetContext(args) {
|
|
10991
|
+
const run = this.#config.getContext;
|
|
10992
|
+
if (!run) return "get_context is not available in this session.";
|
|
10993
|
+
try {
|
|
10994
|
+
return await run(args);
|
|
10995
|
+
} catch (error) {
|
|
10996
|
+
return `get_context failed: ${error instanceof Error ? error.message : "unknown error"}`;
|
|
10997
|
+
}
|
|
10998
|
+
}
|
|
10650
10999
|
/**
|
|
10651
11000
|
* The voice session. The voice model hands a task to the agent through run_task; a task that the agent
|
|
10652
11001
|
* cannot take now (already running) is answered back to the model by the session.
|
|
@@ -10662,6 +11011,9 @@ var Panel = class {
|
|
|
10662
11011
|
createClient: (callbacks) => this.#config.voice?.provider === "gemini" ? new GeminiLiveClient(callbacks) : new RealtimeClient(callbacks),
|
|
10663
11012
|
onTask: (task) => this.#send(task),
|
|
10664
11013
|
onScript: (script) => this.#runVoiceScript(script),
|
|
11014
|
+
isWaitingForAnswer: () => this.#question !== null,
|
|
11015
|
+
onAnswer: (answer) => this.#resolveQuestion(answer),
|
|
11016
|
+
onGetContext: (args) => this.#runVoiceGetContext(args),
|
|
10665
11017
|
onChange: () => this.#render()
|
|
10666
11018
|
});
|
|
10667
11019
|
}
|
|
@@ -10744,7 +11096,12 @@ var Panel = class {
|
|
|
10744
11096
|
this.#agent.history.length,
|
|
10745
11097
|
this.#agent.history.at(-1) ?? null,
|
|
10746
11098
|
this.#agent.status === "running" ? this.#live : null,
|
|
10747
|
-
this.#question
|
|
11099
|
+
this.#question ? {
|
|
11100
|
+
text: this.#question.text,
|
|
11101
|
+
kind: this.#question.kind,
|
|
11102
|
+
choices: this.#question.choices,
|
|
11103
|
+
selected: [...this.#question.selected]
|
|
11104
|
+
} : null,
|
|
10748
11105
|
this.#question ? null : this.#resultKind(),
|
|
10749
11106
|
this.#voiceRuns.list,
|
|
10750
11107
|
this.#archive.length,
|
|
@@ -10777,10 +11134,24 @@ var Panel = class {
|
|
|
10777
11134
|
this.#renderFollowBar();
|
|
10778
11135
|
this.#renderSkillsStudio();
|
|
10779
11136
|
this.#answerContext.hidden = !answering;
|
|
10780
|
-
|
|
10781
|
-
|
|
10782
|
-
|
|
10783
|
-
|
|
11137
|
+
if (answering && this.#question) {
|
|
11138
|
+
const q = this.#question;
|
|
11139
|
+
const title = q.kind === "multi" ? t("ui.panel.answerTitleMulti") : q.kind === "choice" ? t("ui.panel.answerTitleChoice") : t("ui.panel.answerTitle");
|
|
11140
|
+
this.#choiceRow = null;
|
|
11141
|
+
this.#answerContext.replaceChildren();
|
|
11142
|
+
const label = document.createElement("div");
|
|
11143
|
+
label.textContent = `${title}: ${q.text}`;
|
|
11144
|
+
this.#answerContext.append(label);
|
|
11145
|
+
this.#renderChoiceChips();
|
|
11146
|
+
} else {
|
|
11147
|
+
this.#answerContext.textContent = "";
|
|
11148
|
+
this.#choiceRow?.remove();
|
|
11149
|
+
this.#choiceRow = null;
|
|
11150
|
+
}
|
|
11151
|
+
const choiceOnly = answering && this.#question !== null && this.#question.kind === "choice";
|
|
11152
|
+
this.#textarea.disabled = running && !answering || choiceOnly;
|
|
11153
|
+
this.#textarea.placeholder = answering ? this.#question?.kind === "multi" ? t("ui.panel.composerAnswerMulti") : this.#question?.kind === "choice" ? t("ui.panel.composerAnswerChoice") : t("ui.panel.composerAnswer") : running ? t("ui.panel.composerRunning") : t("ui.panel.composerPlaceholder");
|
|
11154
|
+
this.#sendButton.disabled = running && !answering || choiceOnly;
|
|
10784
11155
|
setButton(this.#sendButton, "send", t("ui.panel.send"));
|
|
10785
11156
|
setButton(this.#exportButton, "download", t("ui.panel.exportLog"));
|
|
10786
11157
|
this.#exportButton.hidden = this.#archive.length === 0 && this.#agent.history.length === 0;
|
|
@@ -11970,7 +12341,8 @@ var PageAgent = class extends PageAgentCore {
|
|
|
11970
12341
|
promptForNextTask: config.promptForNextTask,
|
|
11971
12342
|
name: config.name,
|
|
11972
12343
|
voice: config.voice,
|
|
11973
|
-
runScript: (script) => this.#runScript(script)
|
|
12344
|
+
runScript: (script) => this.#runScript(script),
|
|
12345
|
+
getContext: (args) => this.#getContext(args)
|
|
11974
12346
|
});
|
|
11975
12347
|
}
|
|
11976
12348
|
/** Runs a script in the page with this agent in scope, through the same tool the executor uses. */
|
|
@@ -11988,6 +12360,16 @@ var PageAgent = class extends PageAgentCore {
|
|
|
11988
12360
|
const run = tool.execute.call(this, { script }, { signal: controller.signal });
|
|
11989
12361
|
return Promise.race([run, limit]).finally(() => clearTimeout(timer));
|
|
11990
12362
|
}
|
|
12363
|
+
/** Read-only context slice for the voice tool (does not rebind agent indexes). */
|
|
12364
|
+
async #getContext(args) {
|
|
12365
|
+
return (await this.pageController.getContext({
|
|
12366
|
+
yMin: args.yMin,
|
|
12367
|
+
yMax: args.yMax,
|
|
12368
|
+
maxLines: args.maxLines ?? 60,
|
|
12369
|
+
query: args.query,
|
|
12370
|
+
bindIndexes: false
|
|
12371
|
+
})).message;
|
|
12372
|
+
}
|
|
11991
12373
|
};
|
|
11992
12374
|
//#endregion
|
|
11993
12375
|
export { AxError, DEFAULT_REMOTE_CACHE_TTL_MS, MAX_AGENT_SKILLS, MAX_SKILL_DOCUMENT_BYTES, MAX_TASK_FILE_BYTES, PageAgent, PageAgentCore, SKILL_COMMAND_PATTERN, SKILL_COMMAND_TIMEOUT_MS, SKILL_ID_PATTERN, SKILL_JS_FENCE, SKILL_STORAGE_KEY, SkillHost, SkillParseError, SkillRemoteError, createBrowserSkillStorage, createMemorySkillStorage, createSkillCommandAbort, createSkillFileStore, createSkillRecorder, createTestSkillHost, evaluateSkillCommands, extractSkillJs, parseFrontmatterYaml, parseSkillDocument, readTaskFileBlob, skillToolName, splitFrontmatter, synthesizeFromSteps, tool };
|