pi-web-ui 0.2.6 → 0.2.7
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-web-ui",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Web chat interface for the pi coding agent, powered by the pi SDK (@earendil-works/pi-coding-agent) — one-command run, Docker/systemd/launchd deployable",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
* The original design remains. The terminal itself
|
|
30
30
|
* has been extended to include xterm CSI codes, among
|
|
31
31
|
* other features.
|
|
32
|
-
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:root{--bg: #0d0e12;--bg-elev: #14161c;--bg-elev2: #1a1d26;--border: #262a35;--border-soft: #1e2230;--text: #e6e8ef;--text-dim: #9aa1b4;--text-faint: #6b7284;--accent: #8b5cf6;--accent-soft: rgba(139, 92, 246, .14);--green: #34d399;--green-soft: rgba(52, 211, 153, .12);--red: #f87171;--red-soft: rgba(248, 113, 113, .12);--amber: #fbbf24;--mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.6}.app{display:flex;flex-direction:column;height:100%}.layout{flex:1;display:flex;min-height:0}.main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}.panel{display:flex;flex-direction:column;width:240px;flex-shrink:0;min-height:0;background:var(--bg-elev);border-right:1px solid var(--border)}.panel-right{border-right:none;border-left:1px solid var(--border)}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px 8px;border-bottom:1px solid var(--border-soft);flex-shrink:0}.panel-title{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text-faint)}.panel-new,.panel-refresh{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:6px;background:var(--bg-elev2);color:var(--text-dim);cursor:pointer;padding:3px 8px;font-size:12px}.panel-new:hover,.panel-refresh:hover{color:var(--text);border-color:var(--accent)}.panel-body{flex:1;overflow-y:auto;padding:6px}.panel-footer{padding:8px 12px;border-top:1px solid var(--border-soft);flex-shrink:0}.panel-cwd{flex:1;font-size:10.5px;color:var(--text-faint);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cwd-bar{display:flex;align-items:center;gap:6px;width:100%;border:none;background:transparent;padding:0;cursor:pointer;text-align:left}.cwd-bar:hover .panel-cwd{color:var(--text)}.cwd-label{flex-shrink:0;font-size:10.5px;color:var(--text-faint)}.cwd-edit{flex-shrink:0;font-size:11px;color:var(--text-faint);opacity:0;transition:opacity .1s}.cwd-bar:hover .cwd-edit{opacity:1}.cwd-input{width:100%;border:1px solid var(--accent);border-radius:6px;background:var(--bg-elev2);color:var(--text);font-family:var(--mono);font-size:11px;padding:4px 6px;outline:none}.panel-widgets{flex-shrink:0;max-height:40%;overflow-y:auto;padding:8px;border-top:1px solid var(--border-soft);background:#00000026}.widget{border:1px solid var(--border-soft);border-radius:8px;background:var(--bg-elev2);margin-bottom:6px;overflow:hidden}.widget:last-child{margin-bottom:0}.widget-title{padding:4px 10px;font-size:10.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-faint);border-bottom:1px solid var(--border-soft)}.widget-lines{margin:0;padding:6px 10px;font-family:var(--mono);font-size:11px;line-height:1.5;color:var(--text-dim);white-space:pre;overflow-x:auto}.cwd-edit-wrap{position:relative}.path-completions{position:absolute;bottom:calc(100% + 6px);left:0;right:0;max-height:260px;overflow-y:auto;overflow-x:hidden;margin:0;padding:4px;list-style:none;background:var(--bg-elev2);border:1px solid var(--border);border-radius:8px;box-shadow:0 10px 30px #00000080;z-index:60}.pc-item{display:flex;align-items:flex-start;gap:8px;width:100%;padding:5px 8px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);font-size:12px;text-align:left;cursor:pointer}.pc-item:hover,.pc-item.sel{background:var(--accent-soft);color:var(--text)}.pc-icon{flex-shrink:0;margin-top:1px;color:var(--text-faint)}.pc-item.sel .pc-icon{color:var(--accent)}.pc-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pc-name{font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pc-path{font-size:10.5px;line-height:1.4;color:var(--text-faint);font-family:var(--mono);word-break:break-all;overflow-wrap:anywhere}.panel-empty{padding:16px 8px;text-align:center;font-size:12px;color:var(--text-faint)}.session-item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:none;border-radius:8px;background:transparent;color:var(--text-dim);font-size:12.5px;text-align:left;cursor:pointer;margin-bottom:2px}.session-item:hover{background:var(--bg-elev2);color:var(--text)}.session-item.active{background:var(--accent-soft);color:var(--text);border:1px solid rgba(139,92,246,.3);padding:7px 9px}.session-icon{flex-shrink:0;color:var(--text-faint)}.session-item.active .session-icon{color:var(--accent)}.session-info{flex:1;min-width:0;display:flex;flex-direction:column}.session-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-sub{font-size:11px;color:var(--text-faint)}.session-src{margin-left:6px;font-size:9.5px;padding:0 5px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint);text-transform:uppercase;letter-spacing:.4px;vertical-align:1px}.session-time{font-size:10.5px;color:var(--text-faint);flex-shrink:0}.panel-crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px 8px;border-bottom:1px solid var(--border-soft);flex-shrink:0;font-size:12px}.crumb{border:none;background:transparent;color:var(--text-faint);cursor:pointer;padding:2px 4px;border-radius:4px;font-size:12px;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crumb:hover{color:var(--text);background:var(--bg-elev2)}.crumb.active{color:var(--accent)}.crumb-seg{display:inline-flex;align-items:center;color:var(--text-faint)}.file-item{display:flex;align-items:center;gap:7px;width:100%;padding:5px 8px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);font-size:12.5px;text-align:left;cursor:pointer}.file-item.dir{cursor:default}.file-dir-main{flex:1;min-width:0;display:flex;align-items:center;gap:7px;border:none;background:transparent;color:inherit;font-size:inherit;text-align:left;cursor:pointer;padding:0}.file-item:hover{background:var(--bg-elev2);color:var(--text)}.file-icon{flex-shrink:0;color:var(--text-faint)}.file-item.dir .file-icon{color:#fbbf24}.file-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-attach{position:relative;display:none;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:5px;cursor:pointer;flex-shrink:0}.file-item:hover .file-attach{display:inline-flex}.file-attach:after{content:attr(data-tip);position:absolute;bottom:calc(100% + 8px);right:0;background:#232733;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:4px 9px;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40;box-shadow:0 4px 14px #00000073}.file-attach:before{content:"";position:absolute;bottom:calc(100% + 3px);right:6px;border:5px solid transparent;border-top-color:#232733;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40}.file-attach:hover:after,.file-attach:hover:before{opacity:1}.chip[data-tip]{position:relative}.chip[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 8px);right:0;background:#232733;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:4px 9px;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40;box-shadow:0 4px 14px #00000073}.chip[data-tip]:hover:after{opacity:1}.file-attach.inline{background:var(--accent-soft);color:var(--accent)}.file-attach.inline:hover{background:var(--accent);color:#fff}.file-attach.ref{background:#fbbf241f;color:var(--amber)}.file-attach.ref:hover{background:var(--amber);color:#1a1a1a}.attach-row{max-width:860px;margin:0 auto 6px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}.attach-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid rgba(139,92,246,.4);border-radius:999px;background:var(--accent-soft);color:var(--text);font-size:12px;max-width:320px}.attach-chip.reference{border-color:#fbbf2466;background:#fbbf241a}.attach-remove{border:none;background:transparent;color:var(--text-dim);cursor:pointer;font-size:14px;line-height:1;padding:0 2px}.attach-remove:hover{color:var(--red)}.attach-hint{font-size:11.5px;color:var(--text-faint)}.attachcard{margin:6px 0;border:1px dashed rgba(139,92,246,.45);border-radius:8px;background:var(--accent-soft);overflow:hidden}.attachcard-head{display:flex;align-items:center;gap:8px;width:100%;padding:7px 12px;border:none;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer;text-align:left}.attachcard-head:hover{background:#8b5cf614}.attachcard-icon{flex-shrink:0}.attachcard-name{font-weight:600;font-family:var(--mono);font-size:12px}.attachcard-path{color:var(--text-faint);font-size:11px;font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.attachcard-meta{margin-left:auto;color:var(--text-faint);font-size:11px;flex-shrink:0}.attachcard-mode{margin-left:auto;font-size:11px;flex-shrink:0;padding:1px 8px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint)}.attachcard-mode.inline{color:var(--green);border-color:#34d39959}.attachcard-mode.ref{color:var(--amber);border-color:#fbbf2466}.attachcard-refnote{padding:8px 12px;border-top:1px dashed rgba(251,191,36,.3);font-size:11.5px;color:var(--text-faint)}.attachcard-content{margin:0;padding:10px 12px;border-top:1px dashed rgba(139,92,246,.3);font-family:var(--mono);font-size:12px;line-height:1.55;color:var(--text-dim);white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto;background:#0003}.attachcard-image img{max-width:100%;max-height:320px;border-radius:0 0 8px 8px;display:block}.view-pane{flex:1;display:flex;min-width:0;min-height:0}.view-pane.hidden{display:none}.view-switch{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:999px;overflow:hidden;background:var(--bg-elev2);flex-shrink:0}.view-switch button{display:inline-flex;align-items:center;gap:5px;border:none;background:transparent;color:var(--text-dim);font-size:12.5px;padding:4px 12px;cursor:pointer;transition:background .15s,color .15s}.view-switch button:hover{color:var(--text)}.view-switch button.active{background:var(--accent-soft);color:var(--accent)}.view-switch button+button{border-left:1px solid var(--border)}.terminal-view{flex:1;display:flex;min-height:0;min-width:0}.term-side{display:flex;flex-direction:column;width:250px;flex-shrink:0;min-height:0;background:var(--bg-elev)}.term-commands{border-right:1px solid var(--border)}.term-tabs{width:200px;border-left:1px solid var(--border)}.term-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;background:#0b0d12}.term-xterm{flex:1;min-height:0;padding:10px 8px 8px}.term-xterm.hidden{display:none}.term-xterm .xterm{height:100%}.term-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--text-faint)}.term-empty-icon{font-size:34px;opacity:.5}.term-empty-title{font-size:15px;color:var(--text-dim)}.term-empty-sub{font-size:12px}.panel-header-actions{display:flex;align-items:center;gap:6px}.cmd-item{display:flex;align-items:center;gap:4px;padding:6px;border-radius:8px;margin-bottom:2px}.cmd-item:hover{background:var(--bg-elev2)}.cmd-run{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:24px;height:24px;border:none;border-radius:6px;background:var(--accent-soft);color:var(--accent);cursor:pointer}.cmd-run:hover{background:var(--accent);color:#fff}.cmd-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;text-align:left;background:transparent;border:none;color:var(--text-dim);cursor:pointer;padding:1px 4px}.cmd-name{font-size:12.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-command{font-family:var(--mono);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-cwd{font-size:10px;color:var(--text-faint);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-act{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:22px;height:22px;border:none;border-radius:5px;background:transparent;color:var(--text-faint);cursor:pointer;opacity:0;transition:opacity .1s;font-size:11px}.cmd-item:hover .cmd-act{opacity:1}.cmd-act:hover{color:var(--text);background:var(--bg-elev)}.cmd-act.del:hover{color:var(--red)}.cmd-act.del.confirm{opacity:1;color:var(--red);background:var(--red-soft);border:1px solid rgba(248,113,113,.4);width:auto;padding:0 7px}.cmd-form{display:flex;flex-direction:column;gap:4px;padding:6px 4px}.cmd-form label{font-size:11px;color:var(--text-faint);margin-top:4px}.cmd-input{width:100%;border:1px solid var(--border);border-radius:6px;background:var(--bg-elev2);color:var(--text);font-family:var(--mono);font-size:12px;padding:5px 8px;outline:none}.cmd-input:focus{border-color:var(--accent)}.cmd-hint{color:var(--text-faint);font-size:10.5px}.cmd-form-actions{display:flex;gap:6px;justify-content:flex-end;margin-top:8px}.cmd-file{display:flex;align-items:center;gap:5px;font-size:10.5px;color:var(--text-faint);font-family:var(--mono);min-width:0}.cmd-file-icon{flex-shrink:0}.cmd-file-path{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-file-hint{margin-top:3px;font-size:10.5px;color:var(--text-faint)}.term-tab{display:flex;align-items:center;gap:2px;padding:4px 6px;border-radius:8px;margin-bottom:2px}.term-tab:hover{background:var(--bg-elev2)}.term-tab.active{background:var(--accent-soft);border:1px solid rgba(139,92,246,.3);padding:3px 5px}.term-tab-main{flex:1;min-width:0;display:flex;align-items:center;gap:6px;background:transparent;border:none;color:var(--text-dim);cursor:pointer;text-align:left;padding:2px}.term-tab-main:hover,.term-tab.active .term-tab-main{color:var(--text)}.term-tab-dot{flex-shrink:0;width:7px;height:7px;border-radius:50%}.term-tab-dot.run{background:var(--green);box-shadow:0 0 5px var(--green)}.term-tab-dot.exit{background:var(--text-faint)}.term-tab-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px}.term-tab-exit{color:var(--text-faint);font-size:11px}.term-tab-close{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;border:none;border-radius:5px;background:transparent;color:var(--text-faint);cursor:pointer;opacity:0;transition:opacity .1s}.term-tab:hover .term-tab-close,.term-tab.active .term-tab-close{opacity:1}.term-tab-close:hover{color:var(--red);background:var(--red-soft)}.statusbar{flex-shrink:0;display:flex;align-items:center;gap:8px;padding:5px 16px;border-top:1px solid var(--border);background:var(--bg-elev);font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.status-dot.ok{background:var(--green);box-shadow:0 0 5px var(--green)}.status-dot.busy{background:var(--amber)}.status-item{display:inline-flex;align-items:center;gap:6px;color:var(--text-dim)}.status-sep{color:var(--border)}.ctx-bar{display:inline-block;width:46px;height:5px;border-radius:3px;background:var(--bg-elev2);border:1px solid var(--border-soft);overflow:hidden;vertical-align:middle}.ctx-bar-fill{display:block;height:100%;border-radius:2px;transition:width .3s ease}.ctx-bar.ok .ctx-bar-fill{background:var(--green)}.ctx-bar.mid .ctx-bar-fill{background:var(--amber)}.ctx-bar.warn .ctx-bar-fill{background:var(--red)}.status-item.working{color:var(--accent)}.working-spin{width:9px;height:9px;border-radius:50%;border:2px solid rgba(139,92,246,.25);border-top-color:var(--accent);animation:spin .8s linear infinite;flex-shrink:0}.status-queue{color:var(--amber)}@keyframes spin{to{transform:rotate(360deg)}}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--bg-elev);flex-shrink:0}.brand{display:flex;align-items:center;gap:8px;min-width:0}.brand-logo{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff;font-weight:700;font-size:16px}.brand-name{font-weight:600;letter-spacing:.2px}.conn-dot{width:8px;height:8px;border-radius:50%;margin-left:6px}.conn-dot.ok{background:var(--green);box-shadow:0 0 6px var(--green)}.conn-dot.busy{background:var(--amber)}.conn-dot.err{background:var(--red)}.conn-label{color:var(--text-faint);font-size:12px}.topbar-actions{display:flex;align-items:center;gap:8px;min-width:0}.chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--bg-elev2);color:var(--text);font-size:12.5px;cursor:pointer;transition:border-color .15s,background .15s;white-space:nowrap}.chip:hover{border-color:var(--accent);background:var(--accent-soft)}.chip-model{max-width:220px;overflow:hidden;text-overflow:ellipsis}.chip-sub{color:var(--text-faint);font-size:11px}.chip.newchat{color:var(--accent);border-color:#8b5cf666}.chip.newchat:hover{background:var(--accent-soft)}.dropdown{position:relative;display:inline-flex}.dd-caret{color:var(--text-faint);transition:transform .15s}.dd-caret.up{transform:rotate(180deg)}.dd-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:240px;max-width:340px;max-height:420px;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 40px #00000080;padding:6px;z-index:60}.dropdown.left .dd-menu{right:auto;left:0}.dd-header{padding:6px 10px 4px;font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text-faint)}.dd-loading{padding:10px;font-size:12px;color:var(--text-faint);text-align:center}.dd-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);font-size:13px;text-align:left;cursor:pointer}.dd-item:hover{background:var(--bg-elev);color:var(--text)}.dd-item.active{background:var(--accent-soft);color:var(--text)}.dd-item.active:after{content:"✓";color:var(--accent);font-size:12px}.dd-model-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-model-sub{flex-shrink:0;font-size:11px;color:var(--text-faint);font-family:var(--mono)}.dd-refresh{width:100%;margin-top:4px;padding:6px;border:none;border-top:1px solid var(--border-soft);background:transparent;color:var(--text-faint);font-size:12px;cursor:pointer}.dd-refresh:hover{color:var(--accent)}.notices{position:fixed;top:52px;left:50%;transform:translate(-50%);z-index:50;display:flex;flex-direction:column;gap:6px;align-items:center;pointer-events:none}.notice{pointer-events:auto;max-width:min(720px,90vw);padding:7px 14px;border-radius:8px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text);font-size:12.5px;box-shadow:0 6px 24px #00000073;cursor:pointer;text-align:center}.notice-error{border-color:#f8717180;color:#fca5a5}.notice-warning{border-color:#fbbf2480;color:#fcd34d}.messages-wrap{flex:1;position:relative;min-height:0;display:flex;flex-direction:column}.messages{flex:1;overflow-y:auto;padding:20px 0 12px}.msg{max-width:860px;margin:0 auto;padding:6px 20px 14px}.msg-meta{display:flex;align-items:baseline;gap:10px;margin-bottom:4px}.msg-role{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--text-faint)}.msg-model{font-size:11px;color:var(--accent);font-family:var(--mono)}.msg-customtype{font-size:11px;color:var(--amber)}.msg-time{font-size:11px;color:var(--text-faint);margin-left:auto}.msg-text{color:var(--text)}.msg-text p{margin:6px 0}.msg-text p:first-child{margin-top:0}.msg-text p:last-child{margin-bottom:0}.msg-text ul,.msg-text ol{padding-left:22px;margin:6px 0}.msg-text li{margin:2px 0}.msg-text blockquote{margin:8px 0;padding:2px 14px;border-left:3px solid var(--accent);color:var(--text-dim)}.msg-text table{border-collapse:collapse;margin:8px 0}.msg-text th,.msg-text td{border:1px solid var(--border);padding:4px 10px}.msg-text a{color:#a78bfa}.msg-text code{font-family:var(--mono);font-size:12.5px;background:var(--bg-elev2);border:1px solid var(--border-soft);border-radius:4px;padding:1px 5px}.codeblock{position:relative;margin:10px 0}.codeblock pre{background:#0b0d12!important;border:1px solid var(--border);border-radius:8px;padding:12px 14px;overflow-x:auto;margin:0}.codeblock code{background:transparent;border:none;padding:0;font-family:var(--mono);font-size:12.5px;line-height:1.55}.copy-btn{position:absolute;top:8px;right:8px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text-dim);cursor:pointer;opacity:0;transition:opacity .15s}.codeblock:hover .copy-btn{opacity:1}.copy-btn:hover{color:var(--text);border-color:var(--accent)}.trunc-note{margin-top:6px;font-size:11.5px;color:var(--text-faint);font-style:italic}.msg-image img{max-width:100%;max-height:420px;border-radius:8px;border:1px solid var(--border)}.thinking{margin:8px 0;border:1px solid var(--border-soft);border-radius:8px;background:#ffffff04}.thinking-toggle{display:flex;align-items:center;gap:7px;width:100%;padding:7px 12px;border:none;background:transparent;color:var(--text-dim);font-size:12.5px;cursor:pointer;text-align:left}.thinking-toggle:hover{color:var(--text)}.thinking-icon{color:var(--accent)}.thinking-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thinking-body{padding:4px 14px 12px;color:var(--text-dim);font-style:italic;font-size:13px;white-space:pre-wrap;border-top:1px solid var(--border-soft)}.thinking-live .thinking-toggle{color:var(--text)}.thinking-live-label{display:inline-flex;align-items:center}.thinking-live-label .dots:after{content:"";display:inline-block;width:1.2em;text-align:left;animation:thinking-dots 1.2s steps(4,end) infinite}@keyframes thinking-dots{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}}.thinking-wait{display:inline-flex;align-items:center;gap:5px;color:var(--text-dim);font-size:13px;padding:2px 0}.thinking-wait .dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);animation:stream-blink 1s steps(2,start) infinite}.stream-cursor{display:inline-block;width:8px;height:1.05em;margin-left:3px;vertical-align:text-bottom;border-radius:1px;background:var(--accent);animation:stream-blink 1s steps(2,start) infinite}@keyframes stream-blink{0%,49%{opacity:1}50%,to{opacity:0}}.toolcall{margin:8px 0;border:1px solid var(--border);border-radius:8px;background:var(--bg-elev);overflow:hidden}.toolcall-head{display:flex;align-items:center;gap:8px;padding:7px 12px;font-size:12.5px}.toolcall-icon{font-size:13px}.toolcall-name{font-family:var(--mono);font-weight:600;color:var(--text)}.toolcall-status{font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint)}.toolcall.run .toolcall-status{color:var(--amber);border-color:#fbbf2466}.toolcall.ok .toolcall-status{color:var(--green);border-color:#34d39959}.toolcall.err .toolcall-status{color:var(--red);border-color:#f8717166}.toolcall.err{border-color:#f8717159}.toolcall-spacer{flex:1}.toolcall-copy,.toolcall-toggle{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--text-faint);cursor:pointer;padding:3px;border-radius:5px}.toolcall-copy:hover,.toolcall-toggle:hover{color:var(--text);background:var(--bg-elev2)}.toolcall-body{border-top:1px solid var(--border-soft);padding:8px 12px 10px}.toolcall-args pre{margin:0;font-family:var(--mono);font-size:12px;color:var(--text-dim);white-space:pre;overflow:auto;max-height:200px;background:var(--bg-elev2);border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px}.termline{display:flex;align-items:center;gap:8px;background:#0b0d12;border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px;font-family:var(--mono);font-size:12.5px}.termline-icon{color:var(--green);flex-shrink:0}.termline code{word-break:break-all}.termline-timeout{margin-left:auto;color:var(--text-faint);font-size:11px;flex-shrink:0}.toolcall-output{margin-top:8px}.toolcall-output-label{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-faint);margin-bottom:4px}.toolcall-output pre{margin:0;max-height:320px;overflow:auto;background:#0b0d12;border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px;font-family:var(--mono);font-size:12px;line-height:1.5;color:#c9d1d9;white-space:pre;word-break:normal}.toolcall.err .toolcall-output pre{color:#f0a5a5}.toolcall-waiting{margin-top:8px;font-size:12px;color:var(--text-faint)}.cursor{display:inline-block;width:7px;height:13px;background:var(--accent);vertical-align:-2px;margin-left:4px;animation:blink 1s steps(2,start) infinite}@keyframes blink{50%{opacity:0}}.bashblock{margin:8px 0;border:1px solid var(--border);border-radius:8px;background:#0b0d12;overflow:hidden}.bashblock-command{display:flex;align-items:center;gap:8px;padding:7px 12px;font-family:var(--mono);font-size:12.5px;border-bottom:1px solid var(--border-soft)}.bashblock-prompt{color:var(--green);font-weight:700}.bashblock-exit{margin-left:auto;font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--border)}.bashblock-exit.ok{color:var(--green)}.bashblock-exit.err{color:var(--red)}.bashblock-output{margin:0;padding:10px 12px;font-family:var(--mono);font-size:12px;line-height:1.5;color:#c9d1d9;white-space:pre;overflow:auto;max-height:320px}.msg-user .msg-body{background:var(--accent-soft);border:1px solid rgba(139,92,246,.25);border-radius:12px;padding:10px 14px}.msg-error{color:var(--red);background:var(--red-soft);border:1px solid rgba(248,113,113,.35);border-radius:8px;padding:8px 12px;margin-bottom:8px;font-size:13px}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:70px 20px 30px;color:var(--text-dim)}.empty-logo-wrap{position:relative;margin-bottom:20px}.empty-logo{width:68px;height:68px;display:flex;align-items:center;justify-content:center;font-size:40px;font-weight:700;color:#fff;background:linear-gradient(135deg,#8b5cf6,#6366f1 60%,#4f46e5);border-radius:20px;box-shadow:0 16px 44px #8b5cf661,inset 0 1px #ffffff38}.empty-logo-wrap:before{content:"";position:absolute;top:-18px;right:-18px;bottom:-18px;left:-18px;border-radius:32px;background:radial-gradient(ellipse at center,rgba(139,92,246,.28),transparent 70%);z-index:-1}.empty-title{margin:0 0 6px;color:var(--text);font-size:22px;font-weight:650;letter-spacing:.3px}.empty-sub{margin:0 0 16px;font-size:13px;color:var(--text-faint)}.empty-cwd{display:inline-flex;align-items:center;gap:7px;max-width:min(560px,80vw);padding:4px 12px;border:1px solid var(--border-soft);border-radius:999px;background:var(--bg-elev);font-size:11.5px}.empty-cwd-label{color:var(--text-faint);flex-shrink:0}.empty-cwd-path{color:var(--text-dim);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty-examples{margin-top:34px;display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;width:min(560px,90vw)}.empty-example{display:flex;align-items:center;gap:10px;padding:11px 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg-elev);color:var(--text-dim);font-size:13px;text-align:left;cursor:pointer;transition:border-color .15s,background .15s,transform .12s,box-shadow .15s}.empty-example:hover{border-color:#8b5cf680;background:var(--accent-soft);color:var(--text);transform:translateY(-1px);box-shadow:0 8px 22px #8b5cf629}.empty-example-icon{font-size:17px;flex-shrink:0}.empty-example-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.streaming-wait,.boot-wait{text-align:center;color:var(--text-faint);padding:60px 20px;font-size:13px}.scroll-bottom{position:absolute;bottom:16px;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text-dim);font-size:12px;cursor:pointer;box-shadow:0 6px 20px #0006}.scroll-bottom:hover{color:var(--text);border-color:var(--accent)}.inputbar{flex-shrink:0;padding:10px 20px 12px;border-top:1px solid var(--border);background:var(--bg-elev)}.queue-hint{max-width:860px;margin:0 auto 6px;display:flex;gap:14px;font-size:12px;color:var(--amber)}.inputbox{max-width:860px;margin:0 auto;display:flex;align-items:flex-end;gap:8px;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;padding:8px 8px 8px 14px;transition:border-color .15s}.inputbox:focus-within{border-color:var(--accent)}.inputbox textarea{flex:1;resize:none;border:none;outline:none;background:transparent;color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.55;max-height:220px;padding:4px 0}.inputbox textarea::placeholder{color:var(--text-faint)}.inputbox textarea:disabled{opacity:.6}.inputbox-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border);border-radius:8px;padding:7px 12px;font-size:13px;cursor:pointer;transition:all .15s}.btn:disabled{opacity:.4;cursor:default}.btn.send{background:var(--accent);border-color:var(--accent);color:#fff}.btn.send:hover:not(:disabled){filter:brightness(1.12)}.btn.stop{background:var(--red-soft);border-color:#f8717166;color:#fca5a5}.btn.stop:hover{background:#f8717138}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#2a2f3d;border-radius:6px;border:2px solid var(--bg)}::-webkit-scrollbar-thumb:hover{background:#3a4152}::-webkit-scrollbar-track{background:transparent}@media(max-width:640px){.chip-model{max-width:120px}.brand-name,.conn-label{display:none}}.dialog-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;display:flex;align-items:center;justify-content:center;background:#0405089e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);padding:24px}.dialog{display:flex;flex-direction:column;gap:14px;width:100%;max-width:500px;max-height:82vh;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;padding:18px 20px}.dialog-title{font-size:14px;font-weight:700;color:var(--text);white-space:pre-wrap;word-break:break-word}.dialog-options{display:flex;flex-direction:column;gap:8px}.dialog-option{display:block;width:100%;text-align:left;border:1px solid var(--border);border-radius:8px;background:var(--bg-elev);color:var(--text);padding:9px 12px;font-size:13px;line-height:1.5;cursor:pointer;white-space:pre-wrap;word-break:break-word;transition:border-color .12s,background .12s}.dialog-option:hover,.dialog-option.sel{border-color:var(--accent);background:var(--accent-soft)}.dialog-hint{color:var(--text-faint);font-size:13px}.dialog-body{font-size:13px;color:var(--text-dim);white-space:pre-wrap;word-break:break-word}.dialog-input{width:100%;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;padding:9px 12px;outline:none}.dialog-input:focus{border-color:var(--accent)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover:not(:disabled){filter:brightness(1.12)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:300;display:flex;align-items:center;justify-content:center;background:#0405089e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);padding:24px}.modal{position:relative;display:flex;flex-direction:column;gap:14px;width:100%;max-width:460px;max-height:84vh;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;padding:20px 22px}.model-modal{max-width:640px}.modal-close{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);cursor:pointer}.modal-close:hover{color:var(--text);background:var(--bg-elev)}.modal-head{display:flex;align-items:center;gap:10px}.modal-head-icon{color:var(--accent);font-size:18px}.modal-head h2{font-size:16px;margin:0}.modal-desc{margin:0;color:var(--text-dim);font-size:13px;line-height:1.6}.modal-desc code{background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:4px;padding:1px 5px;font-size:12px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.setup-actions{display:flex;gap:10px;margin-top:6px}.setup-key-form{display:flex;flex-direction:column;gap:12px}.setup-done{color:var(--text);font-size:13px;line-height:1.6}.setup-failed{display:flex;flex-direction:column;gap:10px}.setup-detail{margin:0;max-height:140px;overflow-y:auto;white-space:pre-wrap;word-break:break-all;background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:8px;padding:10px 12px;font-size:12px;color:#fca5a5}.field{display:flex;flex-direction:column;gap:5px}.field-label{font-size:12px;color:var(--text-dim)}.field-label em{font-style:normal;opacity:.7}.field input,.field select{background:var(--bg-elev);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:8px 10px;font-size:13px;outline:none}.field input:focus,.field select:focus{border-color:var(--accent)}.field.check{flex-direction:row;align-items:center;gap:8px;font-size:13px;color:var(--text)}.field-hint{font-size:12px;color:var(--text-dim)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-section-title{font-size:12px;font-weight:700;color:var(--text-dim);text-transform:uppercase;letter-spacing:.06em;margin-top:4px}.section-hint{font-weight:400;text-transform:none;letter-spacing:0;opacity:.75}.auth-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:99px;font-size:11px;color:#6ee7a0;background:#34d3991f;border:1px solid rgba(52,211,153,.25);vertical-align:1px}.auth-badge.dim{color:var(--text-dim);background:var(--bg-elev);border-color:var(--border)}.key-input{background:var(--bg-elev);border:1px solid var(--border);border-radius:6px;color:var(--text);padding:6px 9px;font-size:12.5px;outline:none;width:190px}.key-input:focus{border-color:var(--accent)}.btn.sm{padding:6px 10px;font-size:12px}.provider-list{display:flex;flex-direction:column;gap:8px}.provider-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:8px;padding:10px 12px}.provider-info{display:flex;flex-direction:column;gap:2px;min-width:0}.provider-name{font-size:13.5px;font-weight:600;color:var(--text)}.provider-sub{font-size:12px;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.provider-actions{display:flex;gap:6px;flex-shrink:0}.iconbtn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--text-dim);cursor:pointer}.iconbtn:hover{color:var(--text);background:var(--bg-elev)}.iconbtn.danger{color:#fca5a5}.iconbtn.danger:hover{background:var(--red-soft)}.model-row{display:grid;grid-template-columns:1.4fr 1fr 110px auto 88px 88px 28px;gap:8px;align-items:center;margin-bottom:8px}.model-row input,.model-row select{background:var(--bg-elev);border:1px solid var(--border);border-radius:6px;color:var(--text);padding:6px 8px;font-size:12.5px;outline:none;min-width:0}.model-row input:focus,.model-row select:focus{border-color:var(--accent)}.model-row .check{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-dim);white-space:nowrap}@media(max-width:640px){.form-grid,.model-row{grid-template-columns:1fr}}.sound-menu{display:flex;flex-direction:column;gap:2px;width:300px}.sound-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:8px;cursor:pointer;transition:background .12s}.sound-row:hover{background:var(--bg-elev)}.sound-row.disabled{opacity:.45;pointer-events:none}.sound-row input[type=checkbox]{width:15px;height:15px;accent-color:var(--accent);cursor:pointer;flex-shrink:0}.sound-label{display:flex;align-items:center;gap:8px;min-width:0}.sound-master .sound-name{font-weight:700}.sound-icon{color:var(--accent);flex-shrink:0}.sound-name{font-size:13px;color:var(--text)}.sound-desc{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sound-right{display:flex;align-items:center;gap:8px;flex-shrink:0}.sound-preview{border:1px solid var(--border);border-radius:6px;background:var(--bg-elev);color:var(--text-dim);font-size:11px;padding:2px 8px;cursor:pointer;transition:border-color .12s,color .12s}.sound-preview:hover:not(:disabled){border-color:var(--accent);color:var(--text)}.sound-preview:disabled{opacity:.4;cursor:default}.sound-volume{display:flex;align-items:center;gap:10px;padding:8px 10px}.sound-volume.disabled{opacity:.45;pointer-events:none}.sound-volume input[type=range]{flex:1;accent-color:var(--accent);cursor:pointer}.sound-vol-num{font-size:11px;color:var(--text-faint);min-width:34px;text-align:right}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
32
|
+
*/.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{font-family:monospace;-webkit-user-select:text;user-select:text;white-space:pre}.xterm .xterm-accessibility-tree>div{transform-origin:left;width:fit-content}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}.xterm .xterm-scrollable-element>.scrollbar{cursor:default}.xterm .xterm-scrollable-element>.scrollbar>.scra{cursor:pointer;font-size:11px!important}.xterm .xterm-scrollable-element>.visible{opacity:1;background:#0000;transition:opacity .1s linear;z-index:11}.xterm .xterm-scrollable-element>.invisible{opacity:0;pointer-events:none}.xterm .xterm-scrollable-element>.invisible.fade{transition:opacity .8s linear}.xterm .xterm-scrollable-element>.shadow{position:absolute;display:none}.xterm .xterm-scrollable-element>.shadow.top{display:block;top:0;left:3px;height:3px;width:100%;box-shadow:var(--vscode-scrollbar-shadow, #000) 0 6px 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.left{display:block;top:3px;left:0;height:100%;width:3px;box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}.xterm .xterm-scrollable-element>.shadow.top-left-corner{display:block;top:0;left:0;height:3px;width:3px}.xterm .xterm-scrollable-element>.shadow.top.left{box-shadow:var(--vscode-scrollbar-shadow, #000) 6px 0 6px -6px inset}:root{--bg: #0d0e12;--bg-elev: #14161c;--bg-elev2: #1a1d26;--border: #262a35;--border-soft: #1e2230;--text: #e6e8ef;--text-dim: #9aa1b4;--text-faint: #6b7284;--accent: #8b5cf6;--accent-soft: rgba(139, 92, 246, .14);--green: #34d399;--green-soft: rgba(52, 211, 153, .12);--red: #f87171;--red-soft: rgba(248, 113, 113, .12);--amber: #fbbf24;--mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.6}.app{display:flex;flex-direction:column;height:100%}.layout{flex:1;display:flex;min-height:0}.main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0}.panel{display:flex;flex-direction:column;width:240px;flex-shrink:0;min-height:0;background:var(--bg-elev);border-right:1px solid var(--border)}.panel-right{border-right:none;border-left:1px solid var(--border)}.panel-header{display:flex;align-items:center;justify-content:space-between;padding:10px 12px 8px;border-bottom:1px solid var(--border-soft);flex-shrink:0}.panel-title{font-size:12px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text-faint)}.panel-new,.panel-refresh{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--border);border-radius:6px;background:var(--bg-elev2);color:var(--text-dim);cursor:pointer;padding:3px 8px;font-size:12px}.panel-new:hover,.panel-refresh:hover{color:var(--text);border-color:var(--accent)}.panel-body{flex:1;overflow-y:auto;padding:6px}.panel-footer{padding:8px 12px;border-top:1px solid var(--border-soft);flex-shrink:0}.panel-cwd{flex:1;font-size:10.5px;color:var(--text-faint);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cwd-bar{display:flex;align-items:center;gap:6px;width:100%;border:none;background:transparent;padding:0;cursor:pointer;text-align:left}.cwd-bar:hover .panel-cwd{color:var(--text)}.cwd-label{flex-shrink:0;font-size:10.5px;color:var(--text-faint)}.cwd-edit{flex-shrink:0;font-size:11px;color:var(--text-faint);opacity:0;transition:opacity .1s}.cwd-bar:hover .cwd-edit{opacity:1}.cwd-input{width:100%;border:1px solid var(--accent);border-radius:6px;background:var(--bg-elev2);color:var(--text);font-family:var(--mono);font-size:11px;padding:4px 6px;outline:none}.panel-widgets{flex-shrink:0;max-height:40%;overflow-y:auto;padding:8px;border-top:1px solid var(--border-soft);background:#00000026}.widget{border:1px solid var(--border-soft);border-radius:8px;background:var(--bg-elev2);margin-bottom:6px;overflow:hidden}.widget:last-child{margin-bottom:0}.widget-title{padding:4px 10px;font-size:10.5px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;color:var(--text-faint);border-bottom:1px solid var(--border-soft)}.widget-lines{margin:0;padding:6px 10px;font-family:var(--mono);font-size:11px;line-height:1.5;color:var(--text-dim);white-space:pre;overflow-x:auto}.cwd-edit-wrap{position:relative}.path-completions{position:absolute;bottom:calc(100% + 6px);left:0;right:0;max-height:260px;overflow-y:auto;overflow-x:hidden;margin:0;padding:4px;list-style:none;background:var(--bg-elev2);border:1px solid var(--border);border-radius:8px;box-shadow:0 10px 30px #00000080;z-index:60}.pc-item{display:flex;align-items:flex-start;gap:8px;width:100%;padding:5px 8px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);font-size:12px;text-align:left;cursor:pointer}.pc-item:hover,.pc-item.sel{background:var(--accent-soft);color:var(--text)}.pc-icon{flex-shrink:0;margin-top:1px;color:var(--text-faint)}.pc-item.sel .pc-icon{color:var(--accent)}.pc-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pc-name{font-family:var(--mono);font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pc-path{font-size:10.5px;line-height:1.4;color:var(--text-faint);font-family:var(--mono);word-break:break-all;overflow-wrap:anywhere}.panel-empty{padding:16px 8px;text-align:center;font-size:12px;color:var(--text-faint)}.session-item{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:none;border-radius:8px;background:transparent;color:var(--text-dim);font-size:12.5px;text-align:left;cursor:pointer;margin-bottom:2px}.session-item:hover{background:var(--bg-elev2);color:var(--text)}.session-item.active{background:var(--accent-soft);color:var(--text);border:1px solid rgba(139,92,246,.3);padding:7px 9px}.session-icon{flex-shrink:0;color:var(--text-faint)}.session-item.active .session-icon{color:var(--accent)}.session-info{flex:1;min-width:0;display:flex;flex-direction:column}.session-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-sub{font-size:11px;color:var(--text-faint)}.session-src{margin-left:6px;font-size:9.5px;padding:0 5px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint);text-transform:uppercase;letter-spacing:.4px;vertical-align:1px}.session-time{font-size:10.5px;color:var(--text-faint);flex-shrink:0}.panel-crumbs{display:flex;align-items:center;flex-wrap:wrap;gap:2px;padding:6px 8px;border-bottom:1px solid var(--border-soft);flex-shrink:0;font-size:12px}.crumb{border:none;background:transparent;color:var(--text-faint);cursor:pointer;padding:2px 4px;border-radius:4px;font-size:12px;max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.crumb:hover{color:var(--text);background:var(--bg-elev2)}.crumb.active{color:var(--accent)}.crumb-seg{display:inline-flex;align-items:center;color:var(--text-faint)}.file-item{display:flex;align-items:center;gap:7px;width:100%;padding:5px 8px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);font-size:12.5px;text-align:left;cursor:pointer}.file-item.dir{cursor:default}.file-dir-main{flex:1;min-width:0;display:flex;align-items:center;gap:7px;border:none;background:transparent;color:inherit;font-size:inherit;text-align:left;cursor:pointer;padding:0}.file-item:hover{background:var(--bg-elev2);color:var(--text)}.file-icon{flex-shrink:0;color:var(--text-faint)}.file-item.dir .file-icon{color:#fbbf24}.file-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-attach{position:relative;display:none;align-items:center;justify-content:center;width:22px;height:22px;border:none;border-radius:5px;cursor:pointer;flex-shrink:0}.file-item:hover .file-attach{display:inline-flex}.file-attach:after{content:attr(data-tip);position:absolute;bottom:calc(100% + 8px);right:0;background:#232733;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:4px 9px;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40;box-shadow:0 4px 14px #00000073}.file-attach:before{content:"";position:absolute;bottom:calc(100% + 3px);right:6px;border:5px solid transparent;border-top-color:#232733;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40}.file-attach:hover:after,.file-attach:hover:before{opacity:1}.chip[data-tip]{position:relative}.chip[data-tip]:after{content:attr(data-tip);position:absolute;top:calc(100% + 8px);right:0;background:#232733;color:var(--text);border:1px solid var(--border);border-radius:6px;padding:4px 9px;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;transition:opacity .09s ease;z-index:40;box-shadow:0 4px 14px #00000073}.chip[data-tip]:hover:after{opacity:1}.file-attach.inline{background:var(--accent-soft);color:var(--accent)}.file-attach.inline:hover{background:var(--accent);color:#fff}.file-attach.ref{background:#fbbf241f;color:var(--amber)}.file-attach.ref:hover{background:var(--amber);color:#1a1a1a}.attach-row{max-width:860px;margin:0 auto 6px;display:flex;flex-wrap:wrap;gap:6px;align-items:center}.attach-chip{display:inline-flex;align-items:center;gap:5px;padding:3px 10px;border:1px solid rgba(139,92,246,.4);border-radius:999px;background:var(--accent-soft);color:var(--text);font-size:12px;max-width:320px}.attach-chip.reference{border-color:#fbbf2466;background:#fbbf241a}.attach-remove{border:none;background:transparent;color:var(--text-dim);cursor:pointer;font-size:14px;line-height:1;padding:0 2px}.attach-remove:hover{color:var(--red)}.attach-hint{font-size:11.5px;color:var(--text-faint)}.attachcard{margin:6px 0;border:1px dashed rgba(139,92,246,.45);border-radius:8px;background:var(--accent-soft);overflow:hidden}.attachcard-head{display:flex;align-items:center;gap:8px;width:100%;padding:7px 12px;border:none;background:transparent;color:var(--text);font-size:12.5px;cursor:pointer;text-align:left}.attachcard-head:hover{background:#8b5cf614}.attachcard-icon{flex-shrink:0}.attachcard-name{font-weight:600;font-family:var(--mono);font-size:12px}.attachcard-path{color:var(--text-faint);font-size:11px;font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.attachcard-meta{margin-left:auto;color:var(--text-faint);font-size:11px;flex-shrink:0}.attachcard-mode{margin-left:auto;font-size:11px;flex-shrink:0;padding:1px 8px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint)}.attachcard-mode.inline{color:var(--green);border-color:#34d39959}.attachcard-mode.ref{color:var(--amber);border-color:#fbbf2466}.attachcard-refnote{padding:8px 12px;border-top:1px dashed rgba(251,191,36,.3);font-size:11.5px;color:var(--text-faint)}.attachcard-content{margin:0;padding:10px 12px;border-top:1px dashed rgba(139,92,246,.3);font-family:var(--mono);font-size:12px;line-height:1.55;color:var(--text-dim);white-space:pre-wrap;word-break:break-word;max-height:320px;overflow-y:auto;background:#0003}.attachcard-image img{max-width:100%;max-height:320px;border-radius:0 0 8px 8px;display:block}.view-pane{flex:1;display:flex;min-width:0;min-height:0}.view-pane.hidden{display:none}.view-switch{display:inline-flex;align-items:center;border:1px solid var(--border);border-radius:999px;overflow:hidden;background:var(--bg-elev2);flex-shrink:0}.view-switch button{display:inline-flex;align-items:center;gap:5px;border:none;background:transparent;color:var(--text-dim);font-size:12.5px;padding:4px 12px;cursor:pointer;transition:background .15s,color .15s}.view-switch button:hover{color:var(--text)}.view-switch button.active{background:var(--accent-soft);color:var(--accent)}.view-switch button+button{border-left:1px solid var(--border)}.terminal-view{flex:1;display:flex;min-height:0;min-width:0}.term-side{display:flex;flex-direction:column;width:250px;flex-shrink:0;min-height:0;background:var(--bg-elev)}.term-commands{border-right:1px solid var(--border)}.term-tabs{width:200px;border-left:1px solid var(--border)}.term-main{flex:1;display:flex;flex-direction:column;min-width:0;min-height:0;background:#0b0d12}.term-xterm{flex:1;min-height:0;padding:10px 8px 8px}.term-xterm.hidden{display:none}.term-xterm .xterm{height:100%}.term-empty{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;color:var(--text-faint)}.term-empty-icon{font-size:34px;opacity:.5}.term-empty-title{font-size:15px;color:var(--text-dim)}.term-empty-sub{font-size:12px}.panel-header-actions{display:flex;align-items:center;gap:6px}.cmd-item{display:flex;align-items:center;gap:4px;padding:6px;border-radius:8px;margin-bottom:2px}.cmd-item:hover{background:var(--bg-elev2)}.cmd-run{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:24px;height:24px;border:none;border-radius:6px;background:var(--accent-soft);color:var(--accent);cursor:pointer}.cmd-run:hover{background:var(--accent);color:#fff}.cmd-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px;text-align:left;background:transparent;border:none;color:var(--text-dim);cursor:pointer;padding:1px 4px}.cmd-name{font-size:12.5px;font-weight:600;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-command{font-family:var(--mono);font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-cwd{font-size:10px;color:var(--text-faint);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-act{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:22px;height:22px;border:none;border-radius:5px;background:transparent;color:var(--text-faint);cursor:pointer;opacity:0;transition:opacity .1s;font-size:11px}.cmd-item:hover .cmd-act{opacity:1}.cmd-act:hover{color:var(--text);background:var(--bg-elev)}.cmd-act.del:hover{color:var(--red)}.cmd-act.del.confirm{opacity:1;color:var(--red);background:var(--red-soft);border:1px solid rgba(248,113,113,.4);width:auto;padding:0 7px}.cmd-form{display:flex;flex-direction:column;gap:4px;padding:6px 4px}.cmd-form label{font-size:11px;color:var(--text-faint);margin-top:4px}.cmd-input{width:100%;border:1px solid var(--border);border-radius:6px;background:var(--bg-elev2);color:var(--text);font-family:var(--mono);font-size:12px;padding:5px 8px;outline:none}.cmd-input:focus{border-color:var(--accent)}.cmd-hint{color:var(--text-faint);font-size:10.5px}.cmd-form-actions{display:flex;gap:6px;justify-content:flex-end;margin-top:8px}.cmd-file{display:flex;align-items:center;gap:5px;font-size:10.5px;color:var(--text-faint);font-family:var(--mono);min-width:0}.cmd-file-icon{flex-shrink:0}.cmd-file-path{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmd-file-hint{margin-top:3px;font-size:10.5px;color:var(--text-faint)}.term-tab{display:flex;align-items:center;gap:2px;padding:4px 6px;border-radius:8px;margin-bottom:2px}.term-tab:hover{background:var(--bg-elev2)}.term-tab.active{background:var(--accent-soft);border:1px solid rgba(139,92,246,.3);padding:3px 5px}.term-tab-main{flex:1;min-width:0;display:flex;align-items:center;gap:6px;background:transparent;border:none;color:var(--text-dim);cursor:pointer;text-align:left;padding:2px}.term-tab-main:hover,.term-tab.active .term-tab-main{color:var(--text)}.term-tab-dot{flex-shrink:0;width:7px;height:7px;border-radius:50%}.term-tab-dot.run{background:var(--green);box-shadow:0 0 5px var(--green)}.term-tab-dot.exit{background:var(--text-faint)}.term-tab-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12.5px}.term-tab-exit{color:var(--text-faint);font-size:11px}.term-tab-close{display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;width:20px;height:20px;border:none;border-radius:5px;background:transparent;color:var(--text-faint);cursor:pointer;opacity:0;transition:opacity .1s}.term-tab:hover .term-tab-close,.term-tab.active .term-tab-close{opacity:1}.term-tab-close:hover{color:var(--red);background:var(--red-soft)}.statusbar{flex-shrink:0;display:flex;align-items:center;gap:8px;padding:5px 16px;border-top:1px solid var(--border);background:var(--bg-elev);font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden}.status-dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}.status-dot.ok{background:var(--green);box-shadow:0 0 5px var(--green)}.status-dot.busy{background:var(--amber)}.status-item{display:inline-flex;align-items:center;gap:6px;color:var(--text-dim)}.status-sep{color:var(--border)}.ctx-bar{display:inline-block;width:46px;height:5px;border-radius:3px;background:var(--bg-elev2);border:1px solid var(--border-soft);overflow:hidden;vertical-align:middle}.ctx-bar-fill{display:block;height:100%;border-radius:2px;transition:width .3s ease}.ctx-bar.ok .ctx-bar-fill{background:var(--green)}.ctx-bar.mid .ctx-bar-fill{background:var(--amber)}.ctx-bar.warn .ctx-bar-fill{background:var(--red)}.status-item.working{color:var(--accent)}.working-spin{width:9px;height:9px;border-radius:50%;border:2px solid rgba(139,92,246,.25);border-top-color:var(--accent);animation:spin .8s linear infinite;flex-shrink:0}.status-cwd{margin-left:auto;max-width:42%;overflow:hidden;text-overflow:ellipsis;color:var(--text-faint)}.status-cwd:hover{color:var(--text-dim)}.status-queue{color:var(--amber)}@keyframes spin{to{transform:rotate(360deg)}}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--bg-elev);flex-shrink:0}.brand{display:flex;align-items:center;gap:8px;min-width:0}.brand-logo{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:linear-gradient(135deg,#8b5cf6,#6366f1);color:#fff;font-weight:700;font-size:16px}.brand-name{font-weight:600;letter-spacing:.2px}.conn-dot{width:8px;height:8px;border-radius:50%;margin-left:6px}.conn-dot.ok{background:var(--green);box-shadow:0 0 6px var(--green)}.conn-dot.busy{background:var(--amber)}.conn-dot.err{background:var(--red)}.conn-label{color:var(--text-faint);font-size:12px}.topbar-actions{display:flex;align-items:center;gap:8px;min-width:0}.chip{display:inline-flex;align-items:center;gap:6px;padding:5px 10px;border:1px solid var(--border);border-radius:999px;background:var(--bg-elev2);color:var(--text);font-size:12.5px;cursor:pointer;transition:border-color .15s,background .15s;white-space:nowrap}.chip:hover{border-color:var(--accent);background:var(--accent-soft)}.chip-model{max-width:220px;overflow:hidden;text-overflow:ellipsis}.chip-sub{color:var(--text-faint);font-size:11px}.chip.newchat{color:var(--accent);border-color:#8b5cf666}.chip.newchat:hover{background:var(--accent-soft)}.dropdown{position:relative;display:inline-flex}.dd-caret{color:var(--text-faint);transition:transform .15s}.dd-caret.up{transform:rotate(180deg)}.dd-menu{position:absolute;top:calc(100% + 6px);right:0;min-width:240px;max-width:340px;max-height:420px;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:10px;box-shadow:0 12px 40px #00000080;padding:6px;z-index:60}.dropdown.left .dd-menu{right:auto;left:0}.dd-header{padding:6px 10px 4px;font-size:11px;font-weight:700;letter-spacing:.6px;text-transform:uppercase;color:var(--text-faint)}.dd-loading{padding:10px;font-size:12px;color:var(--text-faint);text-align:center}.dd-item{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:7px 10px;border:none;border-radius:7px;background:transparent;color:var(--text-dim);font-size:13px;text-align:left;cursor:pointer}.dd-item:hover{background:var(--bg-elev);color:var(--text)}.dd-item.active{background:var(--accent-soft);color:var(--text)}.dd-item.active:after{content:"✓";color:var(--accent);font-size:12px}.dd-model-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dd-model-sub{flex-shrink:0;font-size:11px;color:var(--text-faint);font-family:var(--mono)}.dd-refresh{width:100%;margin-top:4px;padding:6px;border:none;border-top:1px solid var(--border-soft);background:transparent;color:var(--text-faint);font-size:12px;cursor:pointer}.dd-refresh:hover{color:var(--accent)}.notices{position:fixed;top:52px;left:50%;transform:translate(-50%);z-index:50;display:flex;flex-direction:column;gap:6px;align-items:center;pointer-events:none}.notice{pointer-events:auto;max-width:min(720px,90vw);padding:7px 14px;border-radius:8px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text);font-size:12.5px;box-shadow:0 6px 24px #00000073;cursor:pointer;text-align:center}.notice-error{border-color:#f8717180;color:#fca5a5}.notice-warning{border-color:#fbbf2480;color:#fcd34d}.messages-wrap{flex:1;position:relative;min-height:0;display:flex;flex-direction:column}.messages{flex:1;overflow-y:auto;padding:20px 0 12px}.msg{max-width:860px;margin:0 auto;padding:6px 20px 14px}.msg-meta{display:flex;align-items:baseline;gap:10px;margin-bottom:4px}.msg-role{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.8px;color:var(--text-faint)}.msg-model{font-size:11px;color:var(--accent);font-family:var(--mono)}.msg-customtype{font-size:11px;color:var(--amber)}.msg-time{font-size:11px;color:var(--text-faint);margin-left:auto}.msg-text{color:var(--text)}.msg-text p{margin:6px 0}.msg-text p:first-child{margin-top:0}.msg-text p:last-child{margin-bottom:0}.msg-text ul,.msg-text ol{padding-left:22px;margin:6px 0}.msg-text li{margin:2px 0}.msg-text blockquote{margin:8px 0;padding:2px 14px;border-left:3px solid var(--accent);color:var(--text-dim)}.msg-text table{border-collapse:collapse;margin:8px 0}.msg-text th,.msg-text td{border:1px solid var(--border);padding:4px 10px}.msg-text a{color:#a78bfa}.msg-text code{font-family:var(--mono);font-size:12.5px;background:var(--bg-elev2);border:1px solid var(--border-soft);border-radius:4px;padding:1px 5px}.codeblock{position:relative;margin:10px 0}.codeblock pre{background:#0b0d12!important;border:1px solid var(--border);border-radius:8px;padding:12px 14px;overflow-x:auto;margin:0}.codeblock code{background:transparent;border:none;padding:0;font-family:var(--mono);font-size:12.5px;line-height:1.55}.copy-btn{position:absolute;top:8px;right:8px;z-index:2;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:6px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text-dim);cursor:pointer;opacity:0;transition:opacity .15s}.codeblock:hover .copy-btn{opacity:1}.copy-btn:hover{color:var(--text);border-color:var(--accent)}.trunc-note{margin-top:6px;font-size:11.5px;color:var(--text-faint);font-style:italic}.msg-image img{max-width:100%;max-height:420px;border-radius:8px;border:1px solid var(--border)}.thinking{margin:8px 0;border:1px solid var(--border-soft);border-radius:8px;background:#ffffff04}.thinking-toggle{display:flex;align-items:center;gap:7px;width:100%;padding:7px 12px;border:none;background:transparent;color:var(--text-dim);font-size:12.5px;cursor:pointer;text-align:left}.thinking-toggle:hover{color:var(--text)}.thinking-icon{color:var(--accent)}.thinking-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.thinking-body{padding:4px 14px 12px;color:var(--text-dim);font-style:italic;font-size:13px;white-space:pre-wrap;border-top:1px solid var(--border-soft)}.thinking-live .thinking-toggle{color:var(--text)}.thinking-live-label{display:inline-flex;align-items:center}.thinking-live-label .dots:after{content:"";display:inline-block;width:1.2em;text-align:left;animation:thinking-dots 1.2s steps(4,end) infinite}@keyframes thinking-dots{0%{content:""}25%{content:"."}50%{content:".."}75%{content:"..."}}.thinking-wait{display:inline-flex;align-items:center;gap:5px;color:var(--text-dim);font-size:13px;padding:2px 0}.thinking-wait .dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--accent);animation:stream-blink 1s steps(2,start) infinite}.stream-cursor{display:inline-block;width:8px;height:1.05em;margin-left:3px;vertical-align:text-bottom;border-radius:1px;background:var(--accent);animation:stream-blink 1s steps(2,start) infinite}@keyframes stream-blink{0%,49%{opacity:1}50%,to{opacity:0}}.toolcall{margin:8px 0;border:1px solid var(--border);border-radius:8px;background:var(--bg-elev);overflow:hidden}.toolcall-head{display:flex;align-items:center;gap:8px;padding:7px 12px;font-size:12.5px}.toolcall-icon{font-size:13px}.toolcall-name{font-family:var(--mono);font-weight:600;color:var(--text)}.toolcall-status{font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--border);color:var(--text-faint)}.toolcall.run .toolcall-status{color:var(--amber);border-color:#fbbf2466}.toolcall.ok .toolcall-status{color:var(--green);border-color:#34d39959}.toolcall.err .toolcall-status{color:var(--red);border-color:#f8717166}.toolcall.err{border-color:#f8717159}.toolcall-spacer{flex:1}.toolcall-copy,.toolcall-toggle{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--text-faint);cursor:pointer;padding:3px;border-radius:5px}.toolcall-copy:hover,.toolcall-toggle:hover{color:var(--text);background:var(--bg-elev2)}.toolcall-body{border-top:1px solid var(--border-soft);padding:8px 12px 10px}.toolcall-args pre{margin:0;font-family:var(--mono);font-size:12px;color:var(--text-dim);white-space:pre;overflow:auto;max-height:200px;background:var(--bg-elev2);border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px}.termline{display:flex;align-items:center;gap:8px;background:#0b0d12;border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px;font-family:var(--mono);font-size:12.5px}.termline-icon{color:var(--green);flex-shrink:0}.termline code{word-break:break-all}.termline-timeout{margin-left:auto;color:var(--text-faint);font-size:11px;flex-shrink:0}.toolcall-output{margin-top:8px}.toolcall-output-label{font-size:11px;text-transform:uppercase;letter-spacing:.6px;color:var(--text-faint);margin-bottom:4px}.toolcall-output pre{margin:0;max-height:320px;overflow:auto;background:#0b0d12;border:1px solid var(--border-soft);border-radius:6px;padding:8px 10px;font-family:var(--mono);font-size:12px;line-height:1.5;color:#c9d1d9;white-space:pre;word-break:normal}.toolcall.err .toolcall-output pre{color:#f0a5a5}.toolcall-waiting{margin-top:8px;font-size:12px;color:var(--text-faint)}.cursor{display:inline-block;width:7px;height:13px;background:var(--accent);vertical-align:-2px;margin-left:4px;animation:blink 1s steps(2,start) infinite}@keyframes blink{50%{opacity:0}}.bashblock{margin:8px 0;border:1px solid var(--border);border-radius:8px;background:#0b0d12;overflow:hidden}.bashblock-command{display:flex;align-items:center;gap:8px;padding:7px 12px;font-family:var(--mono);font-size:12.5px;border-bottom:1px solid var(--border-soft)}.bashblock-prompt{color:var(--green);font-weight:700}.bashblock-exit{margin-left:auto;font-size:11px;padding:1px 8px;border-radius:999px;border:1px solid var(--border)}.bashblock-exit.ok{color:var(--green)}.bashblock-exit.err{color:var(--red)}.bashblock-output{margin:0;padding:10px 12px;font-family:var(--mono);font-size:12px;line-height:1.5;color:#c9d1d9;white-space:pre;overflow:auto;max-height:320px}.msg-user .msg-body{background:var(--accent-soft);border:1px solid rgba(139,92,246,.25);border-radius:12px;padding:10px 14px}.msg-error{color:var(--red);background:var(--red-soft);border:1px solid rgba(248,113,113,.35);border-radius:8px;padding:8px 12px;margin-bottom:8px;font-size:13px}.empty-state{display:flex;flex-direction:column;align-items:center;text-align:center;padding:70px 20px 30px;color:var(--text-dim)}.empty-logo-wrap{position:relative;margin-bottom:20px}.empty-logo{width:68px;height:68px;display:flex;align-items:center;justify-content:center;font-size:40px;font-weight:700;color:#fff;background:linear-gradient(135deg,#8b5cf6,#6366f1 60%,#4f46e5);border-radius:20px;box-shadow:0 16px 44px #8b5cf661,inset 0 1px #ffffff38}.empty-logo-wrap:before{content:"";position:absolute;top:-18px;right:-18px;bottom:-18px;left:-18px;border-radius:32px;background:radial-gradient(ellipse at center,rgba(139,92,246,.28),transparent 70%);z-index:-1}.empty-title{margin:0 0 6px;color:var(--text);font-size:22px;font-weight:650;letter-spacing:.3px}.empty-sub{margin:0 0 16px;font-size:13px;color:var(--text-faint)}.empty-cwd{display:inline-flex;align-items:center;gap:7px;max-width:min(560px,80vw);padding:4px 12px;border:1px solid var(--border-soft);border-radius:999px;background:var(--bg-elev);font-size:11.5px}.empty-cwd-label{color:var(--text-faint);flex-shrink:0}.empty-cwd-path{color:var(--text-dim);font-family:var(--mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.empty-examples{margin-top:34px;display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px;width:min(560px,90vw)}.empty-example{display:flex;align-items:center;gap:10px;padding:11px 14px;border:1px solid var(--border);border-radius:12px;background:var(--bg-elev);color:var(--text-dim);font-size:13px;text-align:left;cursor:pointer;transition:border-color .15s,background .15s,transform .12s,box-shadow .15s}.empty-example:hover{border-color:#8b5cf680;background:var(--accent-soft);color:var(--text);transform:translateY(-1px);box-shadow:0 8px 22px #8b5cf629}.empty-example-icon{font-size:17px;flex-shrink:0}.empty-example-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.streaming-wait,.boot-wait{text-align:center;color:var(--text-faint);padding:60px 20px;font-size:13px}.scroll-bottom{position:absolute;bottom:16px;left:50%;transform:translate(-50%);display:inline-flex;align-items:center;gap:6px;padding:6px 14px;border-radius:999px;border:1px solid var(--border);background:var(--bg-elev2);color:var(--text-dim);font-size:12px;cursor:pointer;box-shadow:0 6px 20px #0006}.scroll-bottom:hover{color:var(--text);border-color:var(--accent)}.inputbar{flex-shrink:0;padding:10px 20px 12px;border-top:1px solid var(--border);background:var(--bg-elev)}.queue-hint{max-width:860px;margin:0 auto 6px;display:flex;gap:14px;font-size:12px;color:var(--amber)}.inputbox{max-width:860px;margin:0 auto;display:flex;align-items:flex-end;gap:8px;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;padding:8px 8px 8px 14px;transition:border-color .15s}.inputbox:focus-within{border-color:var(--accent)}.inputbox textarea{flex:1;resize:none;border:none;outline:none;background:transparent;color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.55;max-height:220px;padding:4px 0}.inputbox textarea::placeholder{color:var(--text-faint)}.inputbox textarea:disabled{opacity:.6}.inputbox-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--border);border-radius:8px;padding:7px 12px;font-size:13px;cursor:pointer;transition:all .15s}.btn:disabled{opacity:.4;cursor:default}.btn.send{background:var(--accent);border-color:var(--accent);color:#fff}.btn.send:hover:not(:disabled){filter:brightness(1.12)}.btn.stop{background:var(--red-soft);border-color:#f8717166;color:#fca5a5}.btn.stop:hover{background:#f8717138}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-thumb{background:#2a2f3d;border-radius:6px;border:2px solid var(--bg)}::-webkit-scrollbar-thumb:hover{background:#3a4152}::-webkit-scrollbar-track{background:transparent}@media(max-width:640px){.chip-model{max-width:120px}.brand-name,.conn-label{display:none}}.dialog-overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;display:flex;align-items:center;justify-content:center;background:#0405089e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);padding:24px}.dialog{display:flex;flex-direction:column;gap:14px;width:100%;max-width:500px;max-height:82vh;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;padding:18px 20px}.dialog-title{font-size:14px;font-weight:700;color:var(--text);white-space:pre-wrap;word-break:break-word}.dialog-options{display:flex;flex-direction:column;gap:8px}.dialog-option{display:block;width:100%;text-align:left;border:1px solid var(--border);border-radius:8px;background:var(--bg-elev);color:var(--text);padding:9px 12px;font-size:13px;line-height:1.5;cursor:pointer;white-space:pre-wrap;word-break:break-word;transition:border-color .12s,background .12s}.dialog-option:hover,.dialog-option.sel{border-color:var(--accent);background:var(--accent-soft)}.dialog-hint{color:var(--text-faint);font-size:13px}.dialog-body{font-size:13px;color:var(--text-dim);white-space:pre-wrap;word-break:break-word}.dialog-input{width:100%;border:1px solid var(--border);border-radius:8px;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;padding:9px 12px;outline:none}.dialog-input:focus{border-color:var(--accent)}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff}.btn.primary:hover:not(:disabled){filter:brightness(1.12)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:300;display:flex;align-items:center;justify-content:center;background:#0405089e;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);padding:24px}.modal{position:relative;display:flex;flex-direction:column;gap:14px;width:100%;max-width:460px;max-height:84vh;overflow-y:auto;background:var(--bg-elev2);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;padding:20px 22px}.model-modal{max-width:640px}.modal-close{position:absolute;top:12px;right:12px;display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:none;border-radius:6px;background:transparent;color:var(--text-dim);cursor:pointer}.modal-close:hover{color:var(--text);background:var(--bg-elev)}.modal-head{display:flex;align-items:center;gap:10px}.modal-head-icon{color:var(--accent);font-size:18px}.modal-head h2{font-size:16px;margin:0}.modal-desc{margin:0;color:var(--text-dim);font-size:13px;line-height:1.6}.modal-desc code{background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:4px;padding:1px 5px;font-size:12px}.modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:4px}.setup-actions{display:flex;gap:10px;margin-top:6px}.setup-key-form{display:flex;flex-direction:column;gap:12px}.setup-done{color:var(--text);font-size:13px;line-height:1.6}.setup-failed{display:flex;flex-direction:column;gap:10px}.setup-detail{margin:0;max-height:140px;overflow-y:auto;white-space:pre-wrap;word-break:break-all;background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:8px;padding:10px 12px;font-size:12px;color:#fca5a5}.field{display:flex;flex-direction:column;gap:5px}.field-label{font-size:12px;color:var(--text-dim)}.field-label em{font-style:normal;opacity:.7}.field input,.field select{background:var(--bg-elev);border:1px solid var(--border);border-radius:8px;color:var(--text);padding:8px 10px;font-size:13px;outline:none}.field input:focus,.field select:focus{border-color:var(--accent)}.field.check{flex-direction:row;align-items:center;gap:8px;font-size:13px;color:var(--text)}.field-hint{font-size:12px;color:var(--text-dim)}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.form-section-title{font-size:12px;font-weight:700;color:var(--text-dim);text-transform:uppercase;letter-spacing:.06em;margin-top:4px}.section-hint{font-weight:400;text-transform:none;letter-spacing:0;opacity:.75}.auth-badge{display:inline-block;margin-left:6px;padding:1px 7px;border-radius:99px;font-size:11px;color:#6ee7a0;background:#34d3991f;border:1px solid rgba(52,211,153,.25);vertical-align:1px}.auth-badge.dim{color:var(--text-dim);background:var(--bg-elev);border-color:var(--border)}.key-input{background:var(--bg-elev);border:1px solid var(--border);border-radius:6px;color:var(--text);padding:6px 9px;font-size:12.5px;outline:none;width:190px}.key-input:focus{border-color:var(--accent)}.btn.sm{padding:6px 10px;font-size:12px}.provider-list{display:flex;flex-direction:column;gap:8px}.provider-row{display:flex;align-items:center;justify-content:space-between;gap:10px;background:var(--bg-elev);border:1px solid var(--border-soft);border-radius:8px;padding:10px 12px}.provider-info{display:flex;flex-direction:column;gap:2px;min-width:0}.provider-name{font-size:13.5px;font-weight:600;color:var(--text)}.provider-sub{font-size:12px;color:var(--text-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.provider-actions{display:flex;gap:6px;flex-shrink:0}.iconbtn{display:flex;align-items:center;justify-content:center;width:28px;height:28px;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--text-dim);cursor:pointer}.iconbtn:hover{color:var(--text);background:var(--bg-elev)}.iconbtn.danger{color:#fca5a5}.iconbtn.danger:hover{background:var(--red-soft)}.model-row{display:grid;grid-template-columns:1.4fr 1fr 110px auto 88px 88px 28px;gap:8px;align-items:center;margin-bottom:8px}.model-row input,.model-row select{background:var(--bg-elev);border:1px solid var(--border);border-radius:6px;color:var(--text);padding:6px 8px;font-size:12.5px;outline:none;min-width:0}.model-row input:focus,.model-row select:focus{border-color:var(--accent)}.model-row .check{display:flex;align-items:center;gap:4px;font-size:12px;color:var(--text-dim);white-space:nowrap}@media(max-width:640px){.form-grid,.model-row{grid-template-columns:1fr}}.sound-menu{display:flex;flex-direction:column;gap:2px;width:300px}.sound-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;border-radius:8px;cursor:pointer;transition:background .12s}.sound-row:hover{background:var(--bg-elev)}.sound-row.disabled{opacity:.45;pointer-events:none}.sound-row input[type=checkbox]{width:15px;height:15px;accent-color:var(--accent);cursor:pointer;flex-shrink:0}.sound-label{display:flex;align-items:center;gap:8px;min-width:0}.sound-master .sound-name{font-weight:700}.sound-icon{color:var(--accent);flex-shrink:0}.sound-name{font-size:13px;color:var(--text)}.sound-desc{font-size:11px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sound-right{display:flex;align-items:center;gap:8px;flex-shrink:0}.sound-preview{border:1px solid var(--border);border-radius:6px;background:var(--bg-elev);color:var(--text-dim);font-size:11px;padding:2px 8px;cursor:pointer;transition:border-color .12s,color .12s}.sound-preview:hover:not(:disabled){border-color:var(--accent);color:var(--text)}.sound-preview:disabled{opacity:.4;cursor:default}.sound-volume{display:flex;align-items:center;gap:10px;padding:8px 10px}.sound-volume.disabled{opacity:.45;pointer-events:none}.sound-volume input[type=range]{flex:1;accent-color:var(--accent);cursor:pointer}.sound-vol-num{font-size:11px;color:var(--text-faint);min-width:34px;text-align:right}pre code.hljs{display:block;overflow-x:auto;padding:1em}code.hljs{padding:3px 5px}/*!
|
|
33
33
|
Theme: GitHub Dark
|
|
34
34
|
Description: Dark theme as seen on github.com
|
|
35
35
|
Author: github.com
|
|
@@ -75,7 +75,7 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Rt=ce,Ge=Ce),We===void
|
|
|
75
75
|
`,1;if(Pi>1e5&&Pi>Se.index*3)throw new Error("potential infinite loop, way more iterations than matches");return it+=De,De.length}const Vn=lr(ce);if(!Vn)throw Kn(mt.replace("{}",ce)),new Error('Unknown language: "'+ce+'"');const to=kn(Vn);let et="",Fe=Ge||to;const no={},At=new ve.__emitter(ve);Sa();let it="",Ii=0,Sr=0,Pi=0,ii=!1;try{if(Vn.__emitTokens)Vn.__emitTokens(Ce,At);else{for(Fe.matcher.considerAll();;){Pi++,ii?ii=!1:Fe.matcher.considerAll(),Fe.matcher.lastIndex=Sr;const fe=Fe.matcher.exec(Ce);if(!fe)break;const Se=Ce.substring(Sr,fe.index),De=ri(Se,fe);Sr=fe.index+De}ri(Ce.substring(Sr))}return At.finalize(),et=At.toHTML(),{language:ce,value:et,relevance:Ii,illegal:!1,_emitter:At,_top:Fe}}catch(fe){if(fe.message&&fe.message.includes("Illegal"))return{language:ce,value:nn(Ce),illegal:!0,relevance:0,_illegalBy:{message:fe.message,index:Sr,context:Ce.slice(Sr-100,Sr+100),mode:fe.mode,resultSoFar:et},_emitter:At};if(ht)return{language:ce,value:nn(Ce),illegal:!1,relevance:0,errorRaised:fe,_emitter:At,_top:Fe};throw fe}}function ei(ce){const Ce={value:nn(ce),illegal:!1,relevance:0,_top:be,_emitter:new ve.__emitter(ve)};return Ce._emitter.addText(ce),Ce}function Mi(ce,Ce){Ce=Ce||ve.languages||Object.keys(Q);const We=ei(ce),Ge=Ce.filter(lr).filter(ba).map(mn=>yr(mn,ce,!1));Ge.unshift(We);const Rt=Ge.sort((mn,gn)=>{if(mn.relevance!==gn.relevance)return gn.relevance-mn.relevance;if(mn.language&&gn.language){if(lr(mn.language).supersetOf===gn.language)return 1;if(lr(gn.language).supersetOf===mn.language)return-1}return 0}),[bt,br]=Rt,ps=bt;return ps.secondBest=br,ps}function _c(ce,Ce,We){const Ge=Ce&&pe[Ce]||We;ce.classList.add("hljs"),ce.classList.add(`language-${Ge}`)}function Zs(ce){let Ce=null;const We=Dt(ce);if(Te(We))return;if(Oi("before:highlightElement",{el:ce,language:We}),ce.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",ce);return}if(ce.children.length>0&&(ve.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(ce)),ve.throwUnescapedHTML))throw new qn("One of your code blocks includes unescaped HTML.",ce.innerHTML);Ce=ce;const Ge=Ce.textContent,Rt=We?ct(Ge,{language:We,ignoreIllegals:!0}):Mi(Ge);ce.innerHTML=Rt.value,ce.dataset.highlighted="yes",_c(ce,We,Rt.language),ce.result={language:Rt.language,re:Rt.relevance,relevance:Rt.relevance},Rt.secondBest&&(ce.secondBest={language:Rt.secondBest.language,relevance:Rt.secondBest.relevance}),Oi("after:highlightElement",{el:ce,result:Rt,text:Ge})}function vc(ce){ve=us(ve,ce)}const zr=()=>{ds(),X("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function ma(){ds(),X("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Qs=!1;function ds(){function ce(){ds()}if(document.readyState==="loading"){Qs||window.addEventListener("DOMContentLoaded",ce,!1),Qs=!0;return}document.querySelectorAll(ve.cssSelector).forEach(Zs)}function ga(ce,Ce){let We=null;try{We=Ce(M)}catch(Ge){if(Kn("Language definition for '{}' could not be registered.".replace("{}",ce)),ht)Kn(Ge);else throw Ge;We=be}We.name||(We.name=ce),Q[ce]=We,We.rawDefinition=Ce.bind(null,M),We.aliases&&ya(We.aliases,{languageName:ce})}function _a(ce){delete Q[ce];for(const Ce of Object.keys(pe))pe[Ce]===ce&&delete pe[Ce]}function va(){return Object.keys(Q)}function lr(ce){return ce=(ce||"").toLowerCase(),Q[ce]||Q[pe[ce]]}function ya(ce,{languageName:Ce}){typeof ce=="string"&&(ce=[ce]),ce.forEach(We=>{pe[We.toLowerCase()]=Ce})}function ba(ce){const Ce=lr(ce);return Ce&&!Ce.disableAutodetect}function yt(ce){ce["before:highlightBlock"]&&!ce["before:highlightElement"]&&(ce["before:highlightElement"]=Ce=>{ce["before:highlightBlock"](Object.assign({block:Ce.el},Ce))}),ce["after:highlightBlock"]&&!ce["after:highlightElement"]&&(ce["after:highlightElement"]=Ce=>{ce["after:highlightBlock"](Object.assign({block:Ce.el},Ce))})}function yc(ce){yt(ce),Ie.push(ce)}function Js(ce){const Ce=Ie.indexOf(ce);Ce!==-1&&Ie.splice(Ce,1)}function Oi(ce,Ce){const We=ce;Ie.forEach(function(Ge){Ge[We]&&Ge[We](Ce)})}function fs(ce){return X("10.7.0","highlightBlock will be removed entirely in v12.0"),X("10.7.0","Please use highlightElement now."),Zs(ce)}Object.assign(M,{highlight:ct,highlightAuto:Mi,highlightAll:ds,highlightElement:Zs,highlightBlock:fs,configure:vc,initHighlighting:zr,initHighlightingOnLoad:ma,registerLanguage:ga,unregisterLanguage:_a,listLanguages:va,getLanguage:lr,registerAliases:ya,autoDetection:ba,inherit:us,addPlugin:yc,removePlugin:Js}),M.debugMode=function(){ht=!1},M.safeMode=function(){ht=!0},M.versionString=Ut,M.regex={concat:x,lookahead:v,either:C,optional:b,anyNumberOfTimes:y};for(const ce in nt)typeof nt[ce]=="object"&&e(nt[ce]);return Object.assign(M,nt),M},Fr=Br({});return Fr.newInstance=()=>Br({}),xh=Fr,Fr.HighlightJS=Fr,Fr.default=Fr,xh}var FT=BT();const zT=sc(FT),Vg={},UT="hljs-";function HT(e){const t=zT.newInstance();return e&&a(e),{highlight:n,highlightAuto:i,listLanguages:o,register:a,registerAlias:l,registered:u};function n(d,h,g){const p=g||Vg,v=typeof p.prefix=="string"?p.prefix:UT;if(!t.getLanguage(d))throw new Error("Unknown language: `"+d+"` is not registered");t.configure({__emitter:$T,classPrefix:v});const y=t.highlight(h,{ignoreIllegals:!0,language:d});if(y.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:y.errorRaised});const b=y._emitter.root,x=b.data;return x.language=y.language,x.relevance=y.relevance,b}function i(d,h){const p=(h||Vg).subset||o();let v=-1,y=0,b;for(;++v<p.length;){const x=p[v];if(!t.getLanguage(x))continue;const k=n(x,d,h);k.data&&k.data.relevance!==void 0&&k.data.relevance>y&&(y=k.data.relevance,b=k)}return b||{type:"root",children:[],data:{language:void 0,relevance:y}}}function o(){return t.listLanguages()}function a(d,h){if(typeof d=="string")t.registerLanguage(d,h);else{let g;for(g in d)Object.hasOwn(d,g)&&t.registerLanguage(g,d[g])}}function l(d,h){if(typeof d=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:d});else{let g;for(g in d)if(Object.hasOwn(d,g)){const p=d[g];t.registerAliases(typeof p=="string"?p:[...p],{languageName:g})}}}function u(d){return!!t.getLanguage(d)}}class $T{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],i=n.children[n.children.length-1];i&&i.type==="text"?i.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const i=this.stack[this.stack.length-1],o=t.root.children;n?i.children.push({type:"element",tagName:"span",properties:{className:[n]},children:o}):i.children.push(...o)}openNode(t){const n=this,i=t.split(".").map(function(l,u){return u?l+"_".repeat(u):n.options.classPrefix+l}),o=this.stack[this.stack.length-1],a={type:"element",tagName:"span",properties:{className:i},children:[]};o.children.push(a),this.stack.push(a)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const jT={};function WT(e){const t=e||jT,n=t.aliases,i=t.detect||!1,o=t.languages||PT,a=t.plainText,l=t.prefix,u=t.subset;let d="hljs";const h=HT(o);if(n&&h.registerAlias(n),l){const g=l.indexOf("-");d=g===-1?l:l.slice(0,g)}return function(g,p){dc(g,"element",function(v,y,b){if(v.tagName!=="code"||!b||b.type!=="element"||b.tagName!=="pre")return;const x=KT(v);if(x===!1||!x&&!i||x&&a&&a.includes(x))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(d)||v.properties.className.unshift(d);const k=cN(v,{whitespace:"pre"});let C;try{C=x?h.highlight(x,k,{prefix:l}):h.highlightAuto(k,{prefix:l,subset:u})}catch(O){const L=O;if(x&&/Unknown language/.test(L.message)){p.message("Cannot highlight as `"+x+"`, it’s not registered",{ancestors:[b,v],cause:L,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw L}!x&&C.data&&C.data.language&&v.properties.className.push("language-"+C.data.language),C.children.length>0&&(v.children=C.children)})}}function KT(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let i;for(;++n<t.length;){const o=String(t[n]);if(o==="no-highlight"||o==="nohighlight")return!1;!i&&o.slice(0,5)==="lang-"&&(i=o.slice(5)),!i&&o.slice(0,9)==="language-"&&(i=o.slice(9))}return i}const qT=ie.memo(function({text:t}){const[n,i]=ie.useState(!1);return t?S.jsx("button",{type:"button",className:"copy-btn",title:"复制",onClick:()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1200)})},children:n?S.jsx(xw,{}):S.jsx(sv,{})}):null}),VT=ie.memo(function({text:t}){return S.jsx("div",{className:"md",children:S.jsx(jk,{remarkPlugins:[nN],rehypePlugins:[[WT,{detect:!0,ignoreMissing:!0}]],components:{pre:({children:n,...i})=>S.jsxs("div",{className:"codeblock",children:[S.jsx(qT,{text:Zh(n)}),S.jsx("pre",{...i,children:n})]})},children:t})})});function Zh(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Zh).join("");if(e&&typeof e=="object"&&"props"in e){const t=e.props;return Zh(t==null?void 0:t.children)}return""}function GT({thinking:e,streaming:t}){const[n,i]=ie.useState(t),o=e.split(`
|
|
76
76
|
`)[0].slice(0,80);return S.jsxs("div",{className:`thinking ${n?"open":""} ${t?"live":""}`,children:[S.jsxs("button",{type:"button",className:"thinking-toggle",onClick:()=>i(a=>!a),children:[n?S.jsx(ac,{}):S.jsx(oc,{}),S.jsx(zd,{className:"thinking-icon"}),S.jsx("span",{className:"thinking-label",children:t?S.jsxs("span",{className:"thinking-live-label",children:["思考中",S.jsx("span",{className:"dots"})]}):n?"思考":`思考:${o}`})]}),n&&S.jsx("div",{className:"thinking-body",children:e})]})}const YT={bash:"$",read:"📄",write:"✍️",edit:"✏️",grep:"🔍",find:"🧭",ls:"📂"};function XT(e){return YT[e]??"🛠"}const ZT=ie.memo(function({block:t,view:n}){var b;const[i,o]=ie.useState(!0),[a,l]=ie.useState(!1),u=!n.result&&n.streaming,d=n.result!==void 0,h=((b=n.result)==null?void 0:b.isError)??!1,g=n.result?n.result.content.map(x=>x.type==="text"?x.text:"").join(""):n.liveOutput??"",p=h?"err":d?"ok":u?"run":"idle",v=h?"出错":d?"完成":u?"执行中…":"排队中",y=()=>{t.argumentsText&&(navigator.clipboard.writeText(t.argumentsText),l(!0),setTimeout(()=>l(!1),1200))};return S.jsxs("div",{className:`toolcall ${p}`,children:[S.jsxs("div",{className:"toolcall-head",children:[S.jsx("span",{className:"toolcall-icon",children:XT(t.name)}),S.jsx("span",{className:"toolcall-name",children:t.name}),S.jsx("span",{className:"toolcall-status",children:v}),S.jsx("span",{className:"toolcall-spacer"}),S.jsx("button",{type:"button",className:"toolcall-copy",title:"复制参数",onClick:y,children:a?S.jsx(kw,{}):S.jsx(sv,{})}),S.jsx("button",{type:"button",className:"toolcall-toggle",onClick:()=>o(x=>!x),children:i?S.jsx(ac,{}):S.jsx(oc,{})})]}),i&&S.jsxs("div",{className:"toolcall-body",children:[t.argumentsText&&S.jsx("div",{className:"toolcall-args",children:t.name==="bash"&&t.argumentsText.startsWith("{")?S.jsx(QT,{args:t.argumentsText}):S.jsx("pre",{children:t.argumentsText})}),g.length>0&&S.jsxs("div",{className:"toolcall-output",children:[S.jsxs("div",{className:"toolcall-output-label",children:[h?"错误输出":"输出",u&&S.jsx("span",{className:"cursor"})]}),S.jsx("pre",{children:g})]}),u&&g.length===0&&S.jsxs("div",{className:"toolcall-waiting",children:[S.jsx("span",{className:"cursor"})," 等待输出…"]})]})]})});function QT({args:e}){let t=null;try{t=JSON.parse(e)}catch{return S.jsx("pre",{children:e})}return typeof t.command!="string"?S.jsx("pre",{children:e}):S.jsxs("div",{className:"termline",children:[S.jsx(Bd,{className:"termline-icon"}),S.jsx("code",{children:t.command}),typeof t.timeout=="number"&&S.jsxs("span",{className:"termline-timeout",children:["⏱ ",t.timeout,"s"]})]})}function JT(e){return e.type==="text"&&typeof e.text=="string"?e:null}function eR(e){return e.type==="thinking"&&typeof e.thinking=="string"?e:null}function tR(e){return e.type==="toolCall"&&typeof e.id=="string"&&typeof e.name=="string"?e:null}function nR(e){return e.type==="image"&&typeof e.dataUrl=="string"?e:null}function rR(e){return e.type==="bash"&&typeof e.command=="string"?e:null}const Gg=ie.memo(function({message:t,toolResults:n,liveOutputs:i,streaming:o,isLast:a}){if(t.role==="toolResult")return null;const l=t.role==="custom"&&t.customType==="file",u=o&&a&&t.content.length===0;return S.jsxs("div",{className:`msg msg-${t.role}`,"data-role":t.role,children:[S.jsxs("div",{className:"msg-meta",children:[S.jsx("span",{className:"msg-role",children:t.role==="custom"?t.customType==="file"?"附件":`插件 · ${t.customType??"未知"}`:aR(t.role)}),t.model&&S.jsx("span",{className:"msg-model",children:t.model}),t.timestamp&&S.jsx("span",{className:"msg-time",children:lR(t.timestamp)})]}),S.jsxs("div",{className:"msg-body",children:[t.errorMessage&&S.jsx("div",{className:"msg-error",children:t.errorMessage}),l?S.jsx(iR,{message:t}):t.content.map((d,h)=>S.jsx(oR,{block:d,toolResults:n,liveOutputs:i,streaming:o,isLast:a},`${t.id}-${h}`)),u&&S.jsxs("div",{className:"thinking-wait",children:["正在思考",S.jsx("span",{className:"dot"})]}),o&&a&&!u&&S.jsx("span",{className:"stream-cursor"})]})]})});function iR({message:e}){const[t,n]=ie.useState(!1),i=e.details??{},o=i.name??i.path??"附件",a=i.type==="folder",l=i.mode==="reference",u=e.content.filter(p=>p.type==="text").map(p=>p.text).join(`
|
|
77
77
|
`),d=sR(u),h=e.content.find(p=>p.type==="image"),g=d.split(`
|
|
78
|
-
`).length;return S.jsxs("div",{className:`attachcard ${l?"reference":""}`,children:[S.jsxs("button",{type:"button",className:"attachcard-head",onClick:()=>n(p=>!p),children:[S.jsx("span",{className:"attachcard-icon",children:a?"📁":"📎"}),S.jsx("span",{className:"attachcard-name",children:o}),i.path&&S.jsx("span",{className:"attachcard-path",children:i.path}),S.jsx("span",{className:`attachcard-mode ${l?"ref":"inline"}`,children:l?a?"文件夹 · 仅引用":`仅引用 · ${Yg(i.size)}`:h?"🖼 图片":`内联 · ${i.lines??g} 行`}),!l&&(t?S.jsx(ac,{}):S.jsx(oc,{}))]}),!l&&t&&(h!=null&&h.dataUrl?S.jsx("div",{className:"attachcard-image",children:S.jsx("img",{src:h.dataUrl,alt:o})}):S.jsx("pre",{className:"attachcard-content",children:d})),l&&S.jsx("div",{className:"attachcard-refnote",children:a?"文件夹,未展开内容 —— 智能体会按需浏览目录":`文件较大(${Yg(i.size)}),未展开内容 —— 智能体会按需读取`})]})}function Yg(e){return e===void 0?"":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function sR(e){const t=e.match(/^\s*<file path="[^"]*">\s*```\s*\n?([\s\S]*?)\n?```\s*<\/file>\s*$/);return t?t[1].trim():e.trim()}function oR({block:e,toolResults:t,liveOutputs:n,streaming:i,isLast:o}){const a=JT(e);if(a)return S.jsxs("div",{className:"msg-text",children:[S.jsx(VT,{text:a.text}),a.truncated&&S.jsx("div",{className:"trunc-note",children:"… 内容过长,当前视图已截断"})]});const l=eR(e);if(l)return S.jsx(GT,{thinking:l.thinking,streaming:i&&o});const u=tR(e);if(u){const g=t.get(u.id),p=n.get(u.id),v={result:g,liveOutput:p==null?void 0:p.text,streaming:i};return S.jsx(ZT,{block:u,view:v})}const d=nR(e);if(d&&d.dataUrl)return S.jsx("div",{className:"msg-image",children:S.jsx("img",{src:d.dataUrl,alt:"attachment"})});const h=rR(e);return h?S.jsxs("div",{className:"bashblock",children:[S.jsxs("div",{className:"bashblock-command",children:[S.jsx("span",{className:"bashblock-prompt",children:"$"}),S.jsx("code",{children:h.command}),h.exitCode!==void 0&&S.jsxs("span",{className:`bashblock-exit ${h.exitCode===0?"ok":"err"}`,children:["退出码 ",h.exitCode]}),h.cancelled&&S.jsx("span",{className:"bashblock-exit err",children:"已取消"})]}),h.output&&S.jsx("pre",{className:"bashblock-output",children:h.output}),h.truncated&&S.jsx("div",{className:"trunc-note",children:"… 输出过长,当前视图已截断"})]}):null}function aR(e){switch(e){case"user":return"你";case"assistant":return"pi";case"toolResult":return"工具";case"bashExecution":return"终端";case"branchSummary":return"分支摘要";case"compactionSummary":return"上下文已压缩";default:return e}}function lR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`${n}:${i}`}const Xg=new Map;function Zg(e){return e.content.some(t=>t.type==="toolCall")}const cR=[{icon:"🔍",text:"了解这个项目",prompt:"介绍一下这个项目:整体结构、主要模块和如何运行?"},{icon:"🐛",text:"排查一个问题",prompt:"帮我排查一个 bug,请先说明问题现象,我会补充细节。"},{icon:"🧪",text:"编写测试",prompt:"为项目的核心模块编写单元测试。"},{icon:"🧹",text:"代码审查",prompt:"审查最近改动的代码,指出潜在问题和改进建议。"}];function uR({state:e,liveOutputs:t}){const n=ie.useRef(null),[i,o]=ie.useState(!0),a=ie.useRef(!0),l=e.streamingMessage?[...e.messages,e.streamingMessage]:e.messages,u=ie.useMemo(()=>{const p=new Map;for(const v of e.messages)v.role==="toolResult"&&v.toolCallId&&p.set(v.toolCallId,v);return p},[e.messages]),d=l.length>0?l[l.length-1].id:null,h=ie.useCallback(()=>{const p=n.current;if(!p)return;const v=p.scrollHeight-p.scrollTop-p.clientHeight<80;a.current=v,o(v)},[]);ie.useEffect(()=>{const p=n.current;p&&a.current&&(p.scrollTop=p.scrollHeight)},[l,e.isStreaming,t]);const g=ie.useCallback(()=>{const p=n.current;p&&(p.scrollTop=p.scrollHeight),a.current=!0,o(!0)},[]);return S.jsxs("div",{className:"messages-wrap",children:[S.jsxs("div",{className:"messages",ref:n,onScroll:h,children:[e.messages.length===0&&!e.streamingMessage&&S.jsxs("div",{className:"empty-state",children:[S.jsx("div",{className:"empty-logo-wrap",children:S.jsx("div",{className:"empty-logo",children:"π"})}),S.jsx("h2",{className:"empty-title",children:"pi 编码智能体"}),S.jsx("p",{className:"empty-sub",children:"检查、编辑、运行 —— 随时待命"}),S.jsxs("div",{className:"empty-cwd",children:[S.jsx("span",{className:"empty-cwd-label",children:"目录"}),S.jsx("span",{className:"empty-cwd-path",children:e.cwd})]}),S.jsx("div",{className:"empty-examples",children:cR.map(p=>S.jsxs("button",{type:"button",className:"empty-example",title:"点击填入输入框",onClick:()=>window.dispatchEvent(new CustomEvent("pi-web:fill",{detail:p.prompt})),children:[S.jsx("span",{className:"empty-example-icon",children:p.icon}),S.jsx("span",{className:"empty-example-text",children:p.text})]},p.prompt))})]}),e.messages.map(p=>S.jsx(Gg,{message:p,toolResults:u,liveOutputs:Zg(p)?t:Xg,streaming:e.isStreaming,isLast:p.id===d},p.id)),e.streamingMessage&&S.jsx(Gg,{message:e.streamingMessage,toolResults:u,liveOutputs:Zg(e.streamingMessage)?t:Xg,streaming:!0,isLast:!0},e.streamingMessage.id),e.isStreaming&&l.length===0&&S.jsx("div",{className:"streaming-wait",children:"正在等待模型响应…"})]}),!i&&S.jsxs("button",{type:"button",className:"scroll-bottom",onClick:g,children:[S.jsx(Ew,{})," 回到底部"]})]})}function hR({chat:e,send:t,attachments:n,onRemoveAttachment:i,onSent:o}){const[a,l]=ie.useState(""),u=ie.useRef(null),d=e.state,h=(d==null?void 0:d.isStreaming)??!1,g=e.ready,p=d?d.queue.steering+d.queue.followUp:0;ie.useEffect(()=>{const b=x=>{var C;const k=x.detail;l(k),(C=u.current)==null||C.focus()};return window.addEventListener("pi-web:fill",b),()=>window.removeEventListener("pi-web:fill",b)},[]),ie.useEffect(()=>{const b=u.current;b&&(b.style.height="0px",b.style.height=`${Math.min(b.scrollHeight,220)}px`)},[a]);const v=()=>{var x;const b=a.trim();!b||!g||h||t({type:"prompt",text:b,attachments:n.map(k=>({path:k.path,mode:k.mode}))})&&(l(""),o(),(x=u.current)==null||x.focus())},y=b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),v())};return S.jsxs("div",{className:"inputbar",children:[n.length>0&&S.jsxs("div",{className:"attach-row",children:[n.map(b=>S.jsxs("span",{className:`attach-chip ${b.mode}`,title:b.isDir?`文件夹引用:${b.path}`:b.mode==="reference"?`仅引用:${b.path}`:`附加内容:${b.path}`,children:[b.isDir?"📁":b.mode==="reference"?"🔗":"📎"," ",b.name,S.jsx("button",{type:"button",className:"attach-remove",title:"移除附件",onClick:()=>i(b.path),children:"×"})]},b.path)),S.jsx("span",{className:"attach-hint",children:"将随下一条消息发送"})]}),h&&p>0&&d&&S.jsxs("div",{className:"queue-hint",children:[d.queue.followUp>0&&S.jsxs("span",{children:["⏳ ",d.queue.followUp," 条跟进消息排队中"]}),d.queue.steering>0&&S.jsxs("span",{children:["⏳ ",d.queue.steering," 条转向消息排队中"]})]}),S.jsxs("div",{className:"inputbox",children:[S.jsx("textarea",{ref:u,value:a,rows:1,placeholder:g?h?"智能体正在工作中…(消息可排队发送)":"给 pi 发送消息 — Enter 发送,Shift+Enter 换行":"正在连接服务器…",disabled:!g,onChange:b=>l(b.target.value),onKeyDown:y}),S.jsx("div",{className:"inputbox-actions",children:h?S.jsxs("button",{type:"button",className:"btn stop",title:"停止智能体",onClick:()=>t({type:"abort"}),children:[S.jsx(nv,{})," 停止"]}):S.jsx("button",{type:"button",className:"btn send",title:"发送(Enter)",disabled:!g||!a.trim(),onClick:v,children:S.jsx(yw,{})})})]})]})}function dR({chat:e}){const t=e.state;if(!t)return null;const n=t.stats,i=e.ready?"ok":"busy",o=e.ready?"已连接":"连接中…",a=n.contextUsage,l=a.tokens!==null&&a.percent!==null?`${Qg(a.tokens)} / ${Qg(a.contextWindow)}`:"—",u=a.percent??null,d=u===null?"":u>=80?"warn":u>=50?"mid":"ok",h=t.queue.steering+t.queue.followUp;return S.jsxs("footer",{className:"statusbar",children:[S.jsx("span",{className:`status-dot ${i}`,title:o}),S.jsx("span",{className:"status-item",children:o}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"上下文用量",children:["上下文",S.jsx("span",{className:`ctx-bar ${d}`,children:u!==null&&S.jsx("span",{className:"ctx-bar-fill",style:{width:`${Math.min(u,100)}%`}})}),l]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"累计成本",children:["$",fR(n.cost)]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"会话消息数",children:["消息 ",n.totalMessages]}),e.statuses.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsx("span",{className:"status-item ext-status",title:"插件状态",children:e.statuses.map(g=>g.text).join(" · ")})]}),t.isStreaming&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item working",children:[S.jsx("span",{className:"working-spin"}),"工作中",h>0&&S.jsxs("span",{className:"status-queue",children:["⏳ ",h," 排队"]})]})]})]})}function Qg(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}function fR(e){return e<=0?"0":e<1e-4?"<0.0001":e.toFixed(4).replace(/\.?0+$/,"")}function pR({dialog:e,send:t}){const[n,i]=ie.useState(""),[o,a]=ie.useState(0),l=h=>{t({type:"dialog_response",id:e.id,value:h})};ie.useEffect(()=>{i(""),a(0);const h=g=>{g.key==="Escape"&&l(null)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e.id]);const u=Array.isArray(e.args[0])?e.args[0]:[],d=typeof e.args[0]=="string"?e.args[0]:"";return S.jsx("div",{className:"dialog-overlay",onMouseDown:h=>{h.target===h.currentTarget&&l(null)},children:S.jsxs("div",{className:"dialog",children:[S.jsx("div",{className:"dialog-title",children:e.title||"插件请求"}),e.kind==="select"&&S.jsxs("div",{className:"dialog-options",children:[u.map((h,g)=>S.jsx("button",{type:"button",className:`dialog-option ${g===o?"sel":""}`,onMouseEnter:()=>a(g),onClick:()=>l(h),children:h},g)),u.length===0&&S.jsx("div",{className:"dialog-hint",children:"(无选项)"})]}),e.kind==="confirm"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("p",{children:d}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(!1),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(!0),children:"确定"})]})]}),e.kind==="input"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("input",{className:"dialog-input",value:n,placeholder:d||"输入内容",autoFocus:!0,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.nativeEvent.isComposing&&l(n)}}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(n),children:"确定"})]})]})]})})}/**
|
|
78
|
+
`).length;return S.jsxs("div",{className:`attachcard ${l?"reference":""}`,children:[S.jsxs("button",{type:"button",className:"attachcard-head",onClick:()=>n(p=>!p),children:[S.jsx("span",{className:"attachcard-icon",children:a?"📁":"📎"}),S.jsx("span",{className:"attachcard-name",children:o}),i.path&&S.jsx("span",{className:"attachcard-path",children:i.path}),S.jsx("span",{className:`attachcard-mode ${l?"ref":"inline"}`,children:l?a?"文件夹 · 仅引用":`仅引用 · ${Yg(i.size)}`:h?"🖼 图片":`内联 · ${i.lines??g} 行`}),!l&&(t?S.jsx(ac,{}):S.jsx(oc,{}))]}),!l&&t&&(h!=null&&h.dataUrl?S.jsx("div",{className:"attachcard-image",children:S.jsx("img",{src:h.dataUrl,alt:o})}):S.jsx("pre",{className:"attachcard-content",children:d})),l&&S.jsx("div",{className:"attachcard-refnote",children:a?"文件夹,未展开内容 —— 智能体会按需浏览目录":`文件较大(${Yg(i.size)}),未展开内容 —— 智能体会按需读取`})]})}function Yg(e){return e===void 0?"":e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.round(e/1024)} KB`:`${e} B`}function sR(e){const t=e.match(/^\s*<file path="[^"]*">\s*```\s*\n?([\s\S]*?)\n?```\s*<\/file>\s*$/);return t?t[1].trim():e.trim()}function oR({block:e,toolResults:t,liveOutputs:n,streaming:i,isLast:o}){const a=JT(e);if(a)return S.jsxs("div",{className:"msg-text",children:[S.jsx(VT,{text:a.text}),a.truncated&&S.jsx("div",{className:"trunc-note",children:"… 内容过长,当前视图已截断"})]});const l=eR(e);if(l)return S.jsx(GT,{thinking:l.thinking,streaming:i&&o});const u=tR(e);if(u){const g=t.get(u.id),p=n.get(u.id),v={result:g,liveOutput:p==null?void 0:p.text,streaming:i};return S.jsx(ZT,{block:u,view:v})}const d=nR(e);if(d&&d.dataUrl)return S.jsx("div",{className:"msg-image",children:S.jsx("img",{src:d.dataUrl,alt:"attachment"})});const h=rR(e);return h?S.jsxs("div",{className:"bashblock",children:[S.jsxs("div",{className:"bashblock-command",children:[S.jsx("span",{className:"bashblock-prompt",children:"$"}),S.jsx("code",{children:h.command}),h.exitCode!==void 0&&S.jsxs("span",{className:`bashblock-exit ${h.exitCode===0?"ok":"err"}`,children:["退出码 ",h.exitCode]}),h.cancelled&&S.jsx("span",{className:"bashblock-exit err",children:"已取消"})]}),h.output&&S.jsx("pre",{className:"bashblock-output",children:h.output}),h.truncated&&S.jsx("div",{className:"trunc-note",children:"… 输出过长,当前视图已截断"})]}):null}function aR(e){switch(e){case"user":return"你";case"assistant":return"pi";case"toolResult":return"工具";case"bashExecution":return"终端";case"branchSummary":return"分支摘要";case"compactionSummary":return"上下文已压缩";default:return e}}function lR(e){const t=new Date(e),n=String(t.getHours()).padStart(2,"0"),i=String(t.getMinutes()).padStart(2,"0");return`${n}:${i}`}const Xg=new Map;function Zg(e){return e.content.some(t=>t.type==="toolCall")}const cR=[{icon:"🔍",text:"了解这个项目",prompt:"介绍一下这个项目:整体结构、主要模块和如何运行?"},{icon:"🐛",text:"排查一个问题",prompt:"帮我排查一个 bug,请先说明问题现象,我会补充细节。"},{icon:"🧪",text:"编写测试",prompt:"为项目的核心模块编写单元测试。"},{icon:"🧹",text:"代码审查",prompt:"审查最近改动的代码,指出潜在问题和改进建议。"}];function uR({state:e,liveOutputs:t}){const n=ie.useRef(null),[i,o]=ie.useState(!0),a=ie.useRef(!0),l=e.streamingMessage?[...e.messages,e.streamingMessage]:e.messages,u=ie.useMemo(()=>{const p=new Map;for(const v of e.messages)v.role==="toolResult"&&v.toolCallId&&p.set(v.toolCallId,v);return p},[e.messages]),d=l.length>0?l[l.length-1].id:null,h=ie.useCallback(()=>{const p=n.current;if(!p)return;const v=p.scrollHeight-p.scrollTop-p.clientHeight<80;a.current=v,o(v)},[]);ie.useEffect(()=>{const p=n.current;p&&a.current&&(p.scrollTop=p.scrollHeight)},[l,e.isStreaming,t]);const g=ie.useCallback(()=>{const p=n.current;p&&(p.scrollTop=p.scrollHeight),a.current=!0,o(!0)},[]);return S.jsxs("div",{className:"messages-wrap",children:[S.jsxs("div",{className:"messages",ref:n,onScroll:h,children:[e.messages.length===0&&!e.streamingMessage&&S.jsxs("div",{className:"empty-state",children:[S.jsx("div",{className:"empty-logo-wrap",children:S.jsx("div",{className:"empty-logo",children:"π"})}),S.jsx("h2",{className:"empty-title",children:"pi 编码智能体"}),S.jsx("p",{className:"empty-sub",children:"检查、编辑、运行 —— 随时待命"}),S.jsxs("div",{className:"empty-cwd",children:[S.jsx("span",{className:"empty-cwd-label",children:"目录"}),S.jsx("span",{className:"empty-cwd-path",children:e.cwd})]}),S.jsx("div",{className:"empty-examples",children:cR.map(p=>S.jsxs("button",{type:"button",className:"empty-example",title:"点击填入输入框",onClick:()=>window.dispatchEvent(new CustomEvent("pi-web:fill",{detail:p.prompt})),children:[S.jsx("span",{className:"empty-example-icon",children:p.icon}),S.jsx("span",{className:"empty-example-text",children:p.text})]},p.prompt))})]}),e.messages.map(p=>S.jsx(Gg,{message:p,toolResults:u,liveOutputs:Zg(p)?t:Xg,streaming:e.isStreaming,isLast:p.id===d},p.id)),e.streamingMessage&&S.jsx(Gg,{message:e.streamingMessage,toolResults:u,liveOutputs:Zg(e.streamingMessage)?t:Xg,streaming:!0,isLast:!0},e.streamingMessage.id),e.isStreaming&&l.length===0&&S.jsx("div",{className:"streaming-wait",children:"正在等待模型响应…"})]}),!i&&S.jsxs("button",{type:"button",className:"scroll-bottom",onClick:g,children:[S.jsx(Ew,{})," 回到底部"]})]})}function hR({chat:e,send:t,attachments:n,onRemoveAttachment:i,onSent:o}){const[a,l]=ie.useState(""),u=ie.useRef(null),d=e.state,h=(d==null?void 0:d.isStreaming)??!1,g=e.ready,p=d?d.queue.steering+d.queue.followUp:0;ie.useEffect(()=>{const b=x=>{var C;const k=x.detail;l(k),(C=u.current)==null||C.focus()};return window.addEventListener("pi-web:fill",b),()=>window.removeEventListener("pi-web:fill",b)},[]),ie.useEffect(()=>{const b=u.current;b&&(b.style.height="0px",b.style.height=`${Math.min(b.scrollHeight,220)}px`)},[a]);const v=()=>{var x;const b=a.trim();!b||!g||h||t({type:"prompt",text:b,attachments:n.map(k=>({path:k.path,mode:k.mode}))})&&(l(""),o(),(x=u.current)==null||x.focus())},y=b=>{b.key==="Enter"&&!b.shiftKey&&!b.nativeEvent.isComposing&&(b.preventDefault(),v())};return S.jsxs("div",{className:"inputbar",children:[n.length>0&&S.jsxs("div",{className:"attach-row",children:[n.map(b=>S.jsxs("span",{className:`attach-chip ${b.mode}`,title:b.isDir?`文件夹引用:${b.path}`:b.mode==="reference"?`仅引用:${b.path}`:`附加内容:${b.path}`,children:[b.isDir?"📁":b.mode==="reference"?"🔗":"📎"," ",b.name,S.jsx("button",{type:"button",className:"attach-remove",title:"移除附件",onClick:()=>i(b.path),children:"×"})]},b.path)),S.jsx("span",{className:"attach-hint",children:"将随下一条消息发送"})]}),h&&p>0&&d&&S.jsxs("div",{className:"queue-hint",children:[d.queue.followUp>0&&S.jsxs("span",{children:["⏳ ",d.queue.followUp," 条跟进消息排队中"]}),d.queue.steering>0&&S.jsxs("span",{children:["⏳ ",d.queue.steering," 条转向消息排队中"]})]}),S.jsxs("div",{className:"inputbox",children:[S.jsx("textarea",{ref:u,value:a,rows:1,placeholder:g?h?"智能体正在工作中…(消息可排队发送)":"给 pi 发送消息 — Enter 发送,Shift+Enter 换行":"正在连接服务器…",disabled:!g,onChange:b=>l(b.target.value),onKeyDown:y}),S.jsx("div",{className:"inputbox-actions",children:h?S.jsxs("button",{type:"button",className:"btn stop",title:"停止智能体",onClick:()=>t({type:"abort"}),children:[S.jsx(nv,{})," 停止"]}):S.jsx("button",{type:"button",className:"btn send",title:"发送(Enter)",disabled:!g||!a.trim(),onClick:v,children:S.jsx(yw,{})})})]})]})}function dR({chat:e}){const t=e.state;if(!t)return null;const n=t.stats,i=e.ready?"ok":"busy",o=e.ready?"已连接":"连接中…",a=n.contextUsage,l=a.tokens!==null&&a.percent!==null?`${Qg(a.tokens)} / ${Qg(a.contextWindow)}`:"—",u=a.percent??null,d=u===null?"":u>=80?"warn":u>=50?"mid":"ok",h=t.queue.steering+t.queue.followUp;return S.jsxs("footer",{className:"statusbar",children:[S.jsx("span",{className:`status-dot ${i}`,title:o}),S.jsx("span",{className:"status-item",children:o}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"上下文用量",children:["上下文",S.jsx("span",{className:`ctx-bar ${d}`,children:u!==null&&S.jsx("span",{className:"ctx-bar-fill",style:{width:`${Math.min(u,100)}%`}})}),l]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"累计成本",children:["$",fR(n.cost)]}),S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item",title:"会话消息数",children:["消息 ",n.totalMessages]}),e.statuses.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsx("span",{className:"status-item ext-status",title:"插件状态",children:e.statuses.map(g=>g.text).join(" · ")})]}),t.isStreaming&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"status-sep",children:"·"}),S.jsxs("span",{className:"status-item working",children:[S.jsx("span",{className:"working-spin"}),"工作中",h>0&&S.jsxs("span",{className:"status-queue",children:["⏳ ",h," 排队"]})]})]}),S.jsxs("span",{className:"status-item status-cwd",title:`工作目录:${t.cwd}`,children:["📁 ",t.cwd]})]})}function Qg(e){return e>=1e3?`${(e/1e3).toFixed(1).replace(/\.0$/,"")}K`:String(e)}function fR(e){return e<=0?"0":e<1e-4?"<0.0001":e.toFixed(4).replace(/\.?0+$/,"")}function pR({dialog:e,send:t}){const[n,i]=ie.useState(""),[o,a]=ie.useState(0),l=h=>{t({type:"dialog_response",id:e.id,value:h})};ie.useEffect(()=>{i(""),a(0);const h=g=>{g.key==="Escape"&&l(null)};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e.id]);const u=Array.isArray(e.args[0])?e.args[0]:[],d=typeof e.args[0]=="string"?e.args[0]:"";return S.jsx("div",{className:"dialog-overlay",onMouseDown:h=>{h.target===h.currentTarget&&l(null)},children:S.jsxs("div",{className:"dialog",children:[S.jsx("div",{className:"dialog-title",children:e.title||"插件请求"}),e.kind==="select"&&S.jsxs("div",{className:"dialog-options",children:[u.map((h,g)=>S.jsx("button",{type:"button",className:`dialog-option ${g===o?"sel":""}`,onMouseEnter:()=>a(g),onClick:()=>l(h),children:h},g)),u.length===0&&S.jsx("div",{className:"dialog-hint",children:"(无选项)"})]}),e.kind==="confirm"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("p",{children:d}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(!1),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(!0),children:"确定"})]})]}),e.kind==="input"&&S.jsxs("div",{className:"dialog-body",children:[S.jsx("input",{className:"dialog-input",value:n,placeholder:d||"输入内容",autoFocus:!0,onChange:h=>i(h.target.value),onKeyDown:h=>{h.key==="Enter"&&!h.nativeEvent.isComposing&&l(n)}}),S.jsxs("div",{className:"dialog-actions",children:[S.jsx("button",{type:"button",className:"btn",onClick:()=>l(null),children:"取消"}),S.jsx("button",{type:"button",className:"btn primary",onClick:()=>l(n),children:"确定"})]})]})]})})}/**
|
|
79
79
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
80
80
|
* @license MIT
|
|
81
81
|
*
|
package/web/dist/index.html
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="color-scheme" content="dark" />
|
|
7
7
|
<title>pi-web-ui — pi 编码智能体</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DjRpXhtU.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DheL27G7.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
|
12
12
|
<div id="root"></div>
|