my-durable 0.0.34 → 0.0.35
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/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/{index-D6aUyqqF.css → index-CpTBG0M5.css} +1 -1
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/{index-DqUQknw8.js → index-W7_6LpLB.js} +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/GitPanel.vue +3 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
@import "https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&family=IBM+Plex+Mono:wght@400;500&display=swap";.git-chip-wrap[data-v-c0fb9e98]{align-items:center;display:inline-flex;position:relative}.git-chip[data-v-c0fb9e98]{gap:4px}.git-chip .branch[data-v-c0fb9e98]{text-overflow:ellipsis;white-space:nowrap;max-width:14ch;overflow:hidden}.dirty[data-v-c0fb9e98]{color:var(--warn,#e5a50a)}.ahead[data-v-c0fb9e98]{color:var(--ok,#2ea043)}.behind[data-v-c0fb9e98]{color:var(--info,#58a6ff)}.tunnel-status{flex-wrap:wrap;align-items:center;gap:.5rem;font-size:.75rem;display:inline-flex}.tunnel-status .axis{border:1px solid var(--border,#333);border-radius:999px;align-items:center;gap:.25rem;padding:.1rem .5rem;display:inline-flex}.tunnel-status .axis.transport{color:var(--fg,#eee)}.tunnel-status .axis.monitor.offline{color:var(--muted,#888)}.tunnel-status .axis.monitor.unauthorized,.tunnel-status .axis.monitor.mismatch,.tunnel-status .axis.monitor.incompatible{color:var(--warn,#e0b040)}.tunnel-status .axis.monitor.online{color:var(--ok,#6cc070)}.tunnel-status .axis.muted{color:var(--muted,#888);border-style:dashed}.tunnel-status .axis.url{color:var(--accent,#7ab8ff);text-decoration:none}.tunnel-status .live{color:var(--ok,#6cc070)}.token-manager{border:1px solid var(--border,#333);border-radius:8px;flex-direction:column;gap:.5rem;padding:.6rem .8rem;font-size:.8rem;display:flex}.token-manager header{align-items:center;gap:.4rem;display:flex}.token-manager h3{text-transform:uppercase;letter-spacing:.08em;margin:0;font-size:.8rem}.token-manager .pairing-status{border:1px solid var(--border,#333);border-radius:999px;margin-left:auto;padding:.05rem .5rem;font-size:.7rem}.token-manager .pairing-status.paired{color:var(--ok,#6cc070)}.token-manager .pairing-status.revoked{color:var(--warn,#e0b040)}.token-manager dl{grid-template-columns:auto 1fr;gap:.15rem .8rem;margin:0;display:grid}.token-manager dt{color:var(--muted,#888)}.token-manager dd{text-overflow:ellipsis;min-width:0;margin:0;overflow:hidden}.token-manager .credential-fingerprint{white-space:normal;overflow-wrap:anywhere}.token-manager .rotation-badge{color:var(--warn,#e0b040);align-items:center;gap:.35rem;margin:0;font-size:.75rem;display:flex}.token-manager .token-actions{flex-wrap:wrap;gap:.5rem;display:flex}.token-manager .spin{animation:1.2s linear infinite tm-spin}@keyframes tm-spin{to{transform:rotate(360deg)}}.git-pane[data-v-5b2b6dbb]{gap:4px;display:grid}.git-top[data-v-5b2b6dbb]{flex-wrap:wrap;gap:8px}.branch-wrap[data-v-5b2b6dbb]{position:relative}.branch-btn[data-v-5b2b6dbb]{border:1px solid var(--line);border-radius:6px;align-items:center;gap:7px;padding:6px 12px;display:inline-flex}.branch-btn strong[data-v-5b2b6dbb]{font-size:16px}.menu[data-v-5b2b6dbb]{z-index:40;background:var(--bg-2,#221a1c);border:1px solid var(--line);border-radius:8px;min-width:300px;max-height:280px;padding:4px;position:absolute;top:calc(100% + 6px);left:0;overflow:auto;box-shadow:0 10px 30px #00000080}.menu button[data-v-5b2b6dbb]{text-align:left;border-radius:6px;align-items:center;gap:10px;width:100%;padding:7px 10px;font-size:15px;display:flex}.menu button[data-v-5b2b6dbb]:hover,.menu button.cur[data-v-5b2b6dbb]{background:#403536}.menu .new-branch[data-v-5b2b6dbb]{border-top:1px solid var(--line);gap:6px;padding:8px;display:flex}.menu .new-branch input[data-v-5b2b6dbb]{flex:1;min-width:0}.auto-stash[data-v-5b2b6dbb]{opacity:.85;align-items:center;gap:8px;padding:8px 10px;font-size:14px;display:flex}.muted-line[data-v-5b2b6dbb]{opacity:.65;font-size:13px}.cap[data-v-5b2b6dbb]{padding:4px 0}.row[data-v-5b2b6dbb]{flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0;display:flex}.hintbox[data-v-5b2b6dbb]{border-radius:6px;flex-wrap:wrap;align-items:center;gap:10px;margin:4px 0;padding:6px 10px;display:flex}.hintbox.warn[data-v-5b2b6dbb]{border:1px solid var(--warn,#e5a50a);color:var(--warn,#e5a50a)}.merge-banner[data-v-5b2b6dbb]{border-radius:6px;padding:8px 10px}.files.conflicts[data-v-5b2b6dbb]{border-color:var(--warn,#e5a50a)}.conflict-head[data-v-5b2b6dbb]{color:var(--warn,#e5a50a)}.files[data-v-5b2b6dbb]{border:1px solid var(--line);border-radius:8px;max-height:260px;padding:4px 10px;overflow:auto}.file[data-v-5b2b6dbb]{justify-content:space-between;align-items:center;gap:6px;padding:3px 0;display:flex}.file.all[data-v-5b2b6dbb]{border-bottom:1px solid var(--line)}.file-label[data-v-5b2b6dbb]{cursor:pointer;flex:1;align-items:center;gap:8px;min-width:0;display:flex}.file .path[data-v-5b2b6dbb]{text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.file .xy[data-v-5b2b6dbb]{opacity:.7;font-size:12px}.nums[data-v-5b2b6dbb]{opacity:.8;color:var(--ok,#2ea043);white-space:nowrap;font-size:11px}.nums.bin[data-v-5b2b6dbb]{color:var(--warn,#e5a50a)}.dir-row[data-v-5b2b6dbb]{opacity:.8;align-items:center;gap:6px;width:100%;padding:3px 0;font-size:13px;display:flex}.dir-row .open[data-v-5b2b6dbb]{transform:rotate(90deg)}.file-acts[data-v-5b2b6dbb]{gap:2px;display:flex}.file-diff[data-v-5b2b6dbb]{border:1px solid var(--line);border-radius:8px;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0;padding:8px 10px;display:flex}.file-diff pre[data-v-5b2b6dbb]{width:100%;max-height:260px;margin:6px 0 0;font-size:12px;overflow:auto}.mode-chips[data-v-5b2b6dbb]{gap:2px;display:inline-flex}.mode-chips button[data-v-5b2b6dbb]{border:1px solid var(--line);border-radius:10px;padding:2px 8px;font-size:12px}.mode-chips button.on[data-v-5b2b6dbb]{background:#403536}textarea[data-v-5b2b6dbb]{resize:vertical;width:100%;min-height:76px;font:inherit;margin-top:8px}.commits[data-v-5b2b6dbb]{gap:3px;max-height:340px;display:grid;overflow:auto}.commit-row[data-v-5b2b6dbb]{white-space:nowrap;align-items:center;gap:8px;display:flex}.commit-row .lane[data-v-5b2b6dbb]{flex-shrink:0}.commit-row .hash[data-v-5b2b6dbb]{color:var(--ok,#2ea043);font-size:13px}.hash-btn svg[data-v-5b2b6dbb]{transition:transform .1s}.hash-btn svg.open[data-v-5b2b6dbb]{transform:rotate(90deg)}.commit-row .refs[data-v-5b2b6dbb]{color:var(--warn,#e5a50a);text-overflow:ellipsis;max-width:18ch;font-size:12px;overflow:hidden}.commit-row .subject[data-v-5b2b6dbb]{text-overflow:ellipsis;max-width:40%;font-size:14px;overflow:hidden}.commit-row .who[data-v-5b2b6dbb]{font-size:12px}.commit-files[data-v-5b2b6dbb]{border-left:2px solid var(--line);margin-left:16px;padding:2px 0 6px 34px}.cf[data-v-5b2b6dbb]{gap:10px;padding:1px 0;font-size:13px;display:flex}.cf-status[data-v-5b2b6dbb]{opacity:.8;width:2ch;font-size:11px}.cps[data-v-5b2b6dbb]{border:1px solid var(--line);border-radius:8px;margin-bottom:6px;padding:4px 10px}.cp-row[data-v-5b2b6dbb]{align-items:center;gap:10px;padding:2px 0;font-size:14px;display:flex}.cp-row code[data-v-5b2b6dbb]{color:var(--warn,#e5a50a)}.cp-subj[data-v-5b2b6dbb]{text-overflow:ellipsis;white-space:nowrap;max-width:40%;overflow:hidden}.wt[data-v-5b2b6dbb]{align-items:center;gap:8px;padding:2px 0;display:flex}.wt code[data-v-5b2b6dbb]{text-overflow:ellipsis;white-space:nowrap;max-width:40%;font-size:13px;overflow:hidden}.wt.main code[data-v-5b2b6dbb]{font-weight:650}.grow[data-v-5b2b6dbb]{flex:1}.tag-x[data-v-5b2b6dbb]{opacity:.7;margin-left:4px;display:inline-flex}.pr-row[data-v-5b2b6dbb]{white-space:nowrap;align-items:center;gap:8px;padding:2px 0;display:flex}.pr-row .tag.open[data-v-5b2b6dbb]{color:var(--ok,#2ea043)}.pr-checks[data-v-5b2b6dbb]{white-space:pre-wrap;background:#00000040;border-radius:6px;margin:4px 0;padding:8px;font-size:12px}.turns[data-v-5b2b6dbb]{max-height:180px;overflow:auto}.modal-veil[data-v-5b2b6dbb]{z-index:90;background:#0000008c;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal[data-v-5b2b6dbb]{background:var(--bg-2,#221a1c);border:1px solid var(--line);border-radius:10px;min-width:340px;max-width:520px;padding:16px 18px}.modal.danger[data-v-5b2b6dbb]{border-color:var(--warn,#e5a50a)}.modal h5[data-v-5b2b6dbb]{margin:0 0 6px;font-size:17px}.modal p[data-v-5b2b6dbb]{margin:0 0 10px;font-size:15px}.modal textarea[data-v-5b2b6dbb]{min-height:56px}.modal .danger[data-v-5b2b6dbb]{border-color:var(--warn,#e5a50a)}.op-out[data-v-5b2b6dbb]{background:#00000040;border-radius:6px;max-height:300px;margin-top:8px;padding:10px;font-size:12px;overflow:auto}h4[data-v-5b2b6dbb]{align-items:center;gap:8px;margin:0;font-size:16px;display:flex}.device-handoff[data-v-01884b7b]{border:1px solid var(--border);background:var(--panel);border-radius:12px;margin-bottom:14px;padding:14px 16px}header[data-v-01884b7b]{align-items:center;gap:8px;margin-bottom:6px;font-weight:650;display:flex}h3[data-v-01884b7b]{margin:0;font-size:14.5px}.what[data-v-01884b7b]{color:var(--muted);margin:0 0 10px;font-size:13px}code[data-v-01884b7b]{font-family:ui-monospace,monospace;font-size:12px}.row[data-v-01884b7b]{flex-wrap:wrap;align-items:end;gap:8px;display:flex}label[data-v-01884b7b]{color:var(--muted);gap:4px;font-size:12px;display:grid}input[data-v-01884b7b]{border:1px solid var(--border);background:var(--panel);width:90px;color:inherit;font:inherit;border-radius:8px;padding:7px 9px}.err[data-v-01884b7b]{color:var(--danger,#f28b82);margin:8px 0 0;font-size:12.5px}.target[data-v-01884b7b]{color:var(--muted);word-break:break-all;margin:10px 0 0;font-family:ui-monospace,monospace;font-size:12px}.pair-wizard .pair-steps{color:var(--muted,#888);gap:.5rem;margin:.25rem 0 .75rem;padding:0;font-size:.78rem;list-style:none;display:flex}.pair-wizard .pair-steps li{border:1px solid #0000;border-radius:999px;padding:.15rem .6rem}.pair-wizard .pair-steps li.on{color:var(--fg,#eee);border-color:currentColor}.pair-wizard .pair-grid{grid-template-columns:auto 1fr;align-items:start;gap:1rem;display:grid}.pair-wizard .pair-code{letter-spacing:.18em;font-size:1.7rem;font-family:var(--mono,monospace);margin-bottom:.35rem}.pair-wizard .pair-copy-actions{flex-wrap:wrap;gap:.4rem;display:flex}.pair-wizard .pair-qr svg{border:1px solid var(--border,#333);border-radius:6px}.pair-wizard .pair-side{flex-direction:column;gap:.6rem;min-width:0;display:flex}.pair-wizard .fp{word-break:break-all;background:var(--bg2,#222);border-radius:6px;padding:.4rem;font-size:.78rem;display:block}.pair-wizard .pair-confirm{align-items:center;gap:.45rem;font-size:.85rem;display:flex}.pair-wizard .pair-confirm.warn{color:var(--warn,#e0b040)}.pair-wizard .spin{animation:1.2s linear infinite pair-spin}@keyframes pair-spin{to{transform:rotate(360deg)}}.pair-pending{border:1px solid #2a3442;border-radius:12px;margin:0 0 18px;padding:14px 16px}.pair-pending h3{margin:0 0 10px;font-size:14px}.pair-pending ul{gap:10px;margin:0;padding:0;list-style:none;display:grid}.pair-pending li{border-bottom:1px solid #222b36;gap:4px;padding-bottom:10px;display:grid}.pair-pending li:last-child{border-bottom:0;padding-bottom:0}.pair-pending .who{flex-wrap:wrap;align-items:baseline;gap:8px;display:flex}.pair-pending .fp{word-break:break-all;color:#7ee2a8;font-family:ui-monospace,monospace;font-size:12px}.pair-pending .row{justify-content:space-between;align-items:center;gap:10px;display:flex}.pair-pending .phase{color:#8fa0b5;font-size:12px}:root{font-family:var(--font-body);color:var(--fg);background:var(--bg);font-synthesis:none;--bg:#151010;--tree:#181213;--chat:#161011;--panel:#1c1516;--card:#251a1b;--line-soft:#2a2021;--fg:#f2eeee;--faint:#8d7778;--primary:#b9283c;--primary-line:#df5363;--primary-hover:#cf354a;--on-primary:#fff;--ok:#6fcf97;--warn:#f2c94c;--err:#ff6b6b;--offline:#5a4a4b;--font-body:"DM Sans", "Segoe UI", sans-serif;--font-display:"Manrope", "Segoe UI", sans-serif;--font-mono:"IBM Plex Mono", ui-monospace, Menlo, monospace;--topbar-h:65px;--tree-w:300px;--insp-w:450px;--radius:10px;--radius-sm:6px;--ease:cubic-bezier(.2, .7, .3, 1);--secondary:#c9a87c;--muted:var(--secondary);--line:#332829;--accent:#ff8997;--surface:#1e1718;--font-title:var(--font-display);font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{color:inherit;background:0 0;border:0;justify-content:center;align-items:center;gap:7px;display:inline-flex}button:disabled{opacity:.8;cursor:not-allowed}button:not(:disabled):hover{filter:brightness(1.13)}button:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input,textarea,select{color:inherit;background:var(--chat);border:1px solid var(--line);border-radius:7px;outline:none;min-width:0;padding:10px 12px}input::placeholder,textarea::placeholder{color:var(--fg)}textarea{resize:vertical;line-height:1.6}select{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;cursor:pointer}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--font-title)}h2{font-size:16px;font-weight:650}pre,code{font-family:var(--font-mono)}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.7}small{font-size:16px}svg{flex-shrink:0}.shell{flex-direction:column;height:100dvh;display:flex;overflow:hidden}.topbar{height:var(--topbar-h);min-height:var(--topbar-h);border-bottom:1px solid var(--line);background:var(--panel);z-index:10;justify-content:space-between;align-items:center;padding:0 26px 0 17px;display:flex}.brand,.top-actions{align-items:center;gap:14px;display:flex}.brand strong{letter-spacing:-.5px;font-size:16px;font-family:var(--font-title);font-weight:750}.brandmark{flex-shrink:0;width:45px;height:25px;margin-left:3px;display:block}.brand-separator{color:var(--fg);margin:0 2px;font-weight:400}.muted{color:var(--muted)}.icon-button{width:29px;height:29px;color:var(--muted);border-radius:5px;padding:4px}.icon-button:hover{color:var(--fg);background:#ffffff08}.primary{background:var(--accent);color:var(--fg);border:1px solid var(--accent);white-space:nowrap;border-radius:7px;padding:12px 18px;font-weight:650;box-shadow:0 1px 2px #0002}.primary.small{padding:8px 12px;font-size:16px}.secondary{background:#2b2021;border:1px solid #443738;border-radius:6px;padding:8px 12px;font-size:16px;font-weight:500}.connection{color:var(--muted);align-items:center;gap:7px;font-size:16px;display:flex}.connection i,.live-dot{background:#756062;border-radius:100%;flex-shrink:0;width:5px;height:5px;display:inline-block}.connection .online,.live-dot{background:var(--accent);box-shadow:0 0 7px #cdadb018}.version{font-family:var(--font-mono);color:var(--fg);border:1px solid #3b3031;border-radius:4px;padding:4px 6px;font-size:16px}.workspace{flex:1;grid-template-columns:minmax(340px,34%) minmax(0,1fr);min-height:0;display:grid}.inspector{border-right:1px solid var(--line);background:var(--panel);flex-direction:column;min-height:0;display:flex}.session-heading{padding:25px 26px 21px}.eyebrow{letter-spacing:1.8px;color:var(--fg);font-size:16px;font-weight:600}.session-heading h1{color:var(--fg);letter-spacing:-.7px;overflow-wrap:anywhere;justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px;font-size:16px;font-weight:650;display:flex}.path{font-family:var(--font-mono);color:var(--fg);overflow-wrap:anywhere;align-items:center;gap:7px;font-size:16px;display:flex}.session-status{align-items:center;gap:9px;margin-top:19px;display:flex}.status-pill{color:var(--fg);background:#352728;border-radius:4px;align-items:center;gap:6px;padding:4px 8px;font-size:16px;line-height:1.3;display:flex}.status-pill i{background:currentColor;border-radius:50%;width:4px;height:4px}.status-pill.working{color:var(--accent);background:#412b2d}.working i{animation:1.5s infinite pulse}.saved{color:var(--fg);align-items:center;gap:5px;margin-left:auto;font-size:16px;display:flex}.background-pill{color:var(--fg);font-size:16px}.model-section{border-top:1px solid var(--line);padding:18px 26px 22px}.section-label{letter-spacing:1.3px;color:var(--fg);justify-content:space-between;margin-bottom:13px;font-size:16px;display:flex}.section-label span+span{letter-spacing:0;color:var(--fg)}.model-button{text-align:left;background:#251c1d;border:1px solid #423435;border-radius:8px;width:100%;padding:11px 13px}.model-button img,.model-list img{object-fit:contain;background:#f0e8e9;border-radius:6px;width:29px;height:29px;padding:3px}.model-button>div{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.model-button strong{text-overflow:ellipsis;white-space:nowrap;font-size:16px;overflow:hidden}.model-button small{color:var(--muted);font-size:16px}.thinking-row{color:var(--fg);justify-content:space-between;align-items:center;margin-top:10px;font-size:16px;display:flex}.thinking-row select{color:var(--fg);background:0 0;border:0;padding:4px 2px;font-size:16px}.metrics{grid-template-columns:1fr 1.3fr .5fr;margin-top:21px;display:grid}.metrics>div{flex-direction:column;gap:5px;display:flex}.metrics span{font-family:var(--font-title);letter-spacing:-.5px;font-size:19px;font-weight:500}.metrics small{color:var(--fg);font-size:16px}.stats-section{margin-top:24px}.stats-section .metrics{margin-top:14px}.usage-breakdown{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;margin-top:22px;font-size:16px}.usage-breakdown th,.usage-breakdown td{text-align:right;border-bottom:1px solid var(--line);padding:10px 0;font-weight:400}.usage-breakdown th{color:var(--secondary)}.usage-breakdown th:first-child{text-align:left}.usage-breakdown td{color:var(--fg)}.inspector-tabs{border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--tree);padding:0 16px;display:flex}.inspector-tabs button{color:var(--fg);border-bottom:2px solid #0000;flex:1;gap:6px;padding:15px 3px 13px;font-size:16px}.inspector-tabs button.active{color:var(--accent);border-bottom-color:var(--accent)}.count{background:#462f31;border-radius:4px;padding:1px 4px;font-size:16px}.inspector-body{scrollbar-width:thin;scrollbar-color:var(--line) transparent;flex:1;padding:23px 26px 32px;overflow:auto}.panel-heading{justify-content:space-between;align-items:center;gap:9px;display:flex}.panel-heading svg{color:var(--fg)}.tag{color:var(--fg);white-space:nowrap;background:#302526;border:1px solid #403536;border-radius:4px;padding:3px 5px;font-size:16px}.tag.completed{color:var(--accent)}.tag.waiting,.tag.aborted,.tag.rejected{color:var(--fg)}.hint{color:var(--fg);margin:8px 0 18px;font-size:16px;line-height:1.65}.field-label{letter-spacing:1px;color:var(--fg);margin-bottom:8px;font-size:16px;display:block}.inline-input{background:#181112;border:1px solid #3a2d2e;border-radius:7px;align-items:center;display:flex;overflow:hidden}.inline-input input{width:100%;box-shadow:none;background:0 0;border:0;padding:10px;font-size:16px}.inline-input .icon-button{margin-right:4px}.counter-card{background:#261b1c;border:1px solid #403031;border-radius:8px;justify-content:space-between;align-items:center;margin:16px 0;padding:17px 15px;display:flex}.app-state-json{white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid var(--line);background:#140e10;border-radius:8px;max-height:300px;margin:16px 0 24px;padding:16px;font-size:16px;line-height:1.6;overflow:auto}.state-field{min-width:0}.state-field:not(.state-root){border:1px solid var(--line);border-radius:8px;margin:10px 0;padding:12px}.state-field .state-field{background:#25191c40}.state-field-heading{align-items:center;gap:8px;margin-bottom:12px;display:flex}.state-field-heading strong{overflow-wrap:anywhere;flex:1;min-width:0;font-size:16px}.state-field-heading select{width:auto;max-width:120px;color:var(--secondary);padding:5px}.state-field-heading .icon-button{flex-shrink:0}.state-field textarea,.state-field input{width:100%;min-width:0;font-size:16px}.state-number{align-items:center;gap:8px;display:flex}.state-number input{text-align:center;appearance:textfield}.state-number input::-webkit-inner-spin-button{appearance:none}.state-number input::-webkit-outer-spin-button{appearance:none}.state-number button{flex-shrink:0;padding:10px}.state-boolean{align-items:center;gap:12px;display:flex}.state-boolean>span{color:var(--secondary)}.state-add{flex-wrap:wrap;gap:8px;margin-top:12px;display:flex}.state-add input{flex-basis:100%}.state-add select{flex:1;width:auto}.state-add-button{margin-top:8px}.counter-card .field-label{margin:0;font-size:16px}.counter-card strong{font-family:var(--font-title);color:var(--accent);margin-top:4px;font-size:32px;font-weight:500;line-height:1.1;display:block}.counter-card .secondary{color:var(--fg);background:#392a2b;border-color:#5a3c3f;padding:7px 9px;font-size:16px}.note{color:var(--fg);overflow-wrap:anywhere;align-items:flex-start;gap:8px;margin:0 0 10px;font-size:16px;line-height:1.6;display:flex}.note>span{background:#836669;border-radius:50%;flex-shrink:0;width:4px;height:4px;margin-top:7px}.notes{margin-bottom:14px}.raw{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}.raw summary{cursor:pointer;color:var(--fg);font-family:var(--font-mono);align-items:center;gap:7px;font-size:16px;list-style:none;display:flex}.raw summary:after{content:"+";color:var(--fg);margin-left:auto}.raw[open] summary:after{content:"−"}.raw summary span{color:var(--fg);margin-left:auto;font-size:16px}.raw pre{background:var(--chat);color:var(--fg);border:1px solid #35292a;border-radius:6px;max-height:340px;padding:11px;overflow:auto}.raw textarea{width:100%;font-size:16px}.raw button{margin-top:8px}.section-divider{border-top:1px solid var(--line);margin:25px 0 22px}.demo-action{text-align:left;border-bottom:1px solid #362829;align-items:center;gap:11px;width:100%;padding:12px 0;display:flex}.demo-action>span:nth-child(2){flex-direction:column;flex:1;gap:4px;display:flex}.demo-action strong{font-size:16px;font-weight:500}.demo-action small{color:var(--fg);font-size:16px}.demo-action>svg{color:var(--fg)}.demo-icon{width:32px;height:32px;color:var(--accent);background:#3b292b;border-radius:7px;justify-content:center;align-items:center;display:flex}.demo-icon.lavender{color:var(--fg);background:#3b292b}.job-card{background:#26191a;border:1px solid #453536;border-radius:7px;margin-top:16px;padding:13px}.job-title{justify-content:space-between;align-items:center;gap:5px;display:flex}.job-title strong{font-size:16px;font-weight:500}.progress{background:#403031;border-radius:4px;height:3px;margin:14px 0 8px;overflow:hidden}.progress>div{background:var(--accent);height:100%;transition:width .3s}.job-meta{font-family:var(--font-mono);color:var(--fg);justify-content:space-between;gap:6px;font-size:16px;display:flex}.approval{flex-wrap:wrap;gap:7px;margin-top:15px;display:flex}.approval>span{width:100%;color:var(--fg);margin-bottom:3px;font-size:16px}.approval button{padding:6px 10px;font-size:16px}.text-button{color:var(--accent);margin-top:12px;padding:0;font-size:16px}.danger{color:var(--fg)}.inspector-footer{height:39px;min-height:39px;color:var(--fg);border-top:1px solid #372728;align-items:center;gap:8px;padding:0 22px;font-size:16px;display:flex}.inspector-footer .icon-button{margin-left:auto}.chat-panel{background:var(--chat);flex-direction:column;min-height:0;display:flex;position:relative}.agent-stream-status{border-bottom:1px solid var(--warn);color:var(--warn);flex-wrap:wrap;align-items:center;gap:12px;padding:12px 24px;display:flex}.agent-stream-status>div{overflow-wrap:anywhere;flex:220px;min-width:0}.agent-stream-status p{margin:4px 0 0;font-size:13px}.chat-header{border-bottom:1px solid var(--line);background:#1c1415;justify-content:space-between;align-items:center;min-height:63px;padding:0 25px;display:flex}.conversation-select{color:var(--fg);align-items:center;gap:9px;min-width:0;display:flex}.conversation-select select{box-shadow:none;color:var(--fg);background:0 0;border:0;max-width:230px;padding:8px 3px;font-size:16px}.fork-label{white-space:nowrap;color:var(--fg);align-items:center;gap:3px;font-size:16px;display:flex}.chat-header-actions{align-items:center;gap:8px;display:flex}.relative{position:relative}.dropdown{z-index:20;background:var(--line-soft);border:1px solid #4b3b3c;border-radius:8px;min-width:205px;padding:6px;position:absolute;top:36px;right:0;box-shadow:0 10px 35px #0005}.dropdown button{width:100%;color:var(--fg);border-radius:5px;justify-content:flex-start;padding:10px 9px;font-size:16px;display:flex}.dropdown button:hover{background:#3c2d2e}.chat-scroll{scrollbar-width:thin;scrollbar-color:var(--line) transparent;scroll-behavior:smooth;flex:1;padding:32px clamp(24px,5vw,88px) 20px;overflow:auto}.chat-empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;min-height:100%;padding:30px 0 48px;display:flex}.agent-orb{background:radial-gradient(at top,#492d2f,#281a1b);border:1px solid #503a3c;border-radius:17px;justify-content:center;align-items:center;width:58px;height:58px;margin-bottom:26px;display:flex;position:relative;box-shadow:0 10px 50px #b07d820c}.agent-orb>img{width:45px;height:25px}.agent-orb>i{border:3px solid var(--chat);background:var(--accent);border-radius:50%;width:11px;height:11px;position:absolute;bottom:-1px;right:-2px}.chat-empty .eyebrow{letter-spacing:2.1px;font-size:16px}.chat-empty h2{letter-spacing:-.8px;margin:11px 0;font-size:27px;font-weight:500}.chat-empty p{color:var(--fg);font-size:16px;line-height:1.7}.starter-grid{grid-template-columns:1fr 1fr;gap:13px;width:100%;max-width:470px;margin-top:34px;display:grid}.starter-grid button{text-align:left;background:var(--tree);border:1px solid #3c2c2d;border-radius:8px;flex-direction:column;align-items:flex-start;gap:6px;padding:18px;display:flex;position:relative}.starter-grid button>svg:first-child{color:var(--fg);margin-bottom:13px}.starter-grid strong{font-size:16px;font-weight:500}.starter-grid span{color:var(--fg);font-size:16px}.starter-grid button>svg:last-child{color:var(--fg);position:absolute;top:16px;right:13px}.composer-region{background:linear-gradient(transparent, var(--chat) 15%);padding:18px clamp(20px,3vw,46px) 16px}.composer{background:#281c1d;border:1px solid #513d3f;border-radius:11px;box-shadow:0 6px 30px #0002}.composer textarea{resize:none;width:100%;min-height:80px;max-height:220px;box-shadow:none;background:0 0;border:0;padding:18px 20px 9px;font-size:16px;display:block}.composer-toolbar{justify-content:space-between;align-items:center;gap:7px;padding:9px 11px 12px 17px;display:flex}.composer-left,.composer-right{align-items:center;gap:12px;display:flex}.context-indicator{color:var(--fg);align-items:center;gap:5px;font-size:16px;display:flex}.composer-left select{color:var(--fg);background:0 0;border:0;padding:4px;font-size:16px}.interrupt{color:var(--fg);background:#452b2d24;border:1px solid #66414460;border-radius:5px;padding:6px 8px;font-size:16px}.send{background:var(--accent);width:33px;height:33px;color:var(--fg);border-radius:7px}.composer-footnote{color:var(--fg);justify-content:space-between;align-items:center;gap:12px;margin-top:11px;font-size:16px;display:flex}.composer-footnote>span:first-child{align-items:center;gap:6px;display:flex}.composer-footnote .live-dot{width:4px;height:4px}.entry{margin-bottom:26px;position:relative}.message-label{color:var(--fg);letter-spacing:1.3px;align-items:center;gap:8px;margin-bottom:10px;font-size:16px;display:flex}.message-label>span:not(.mini-pi):not(.streaming){font-family:var(--font-mono);letter-spacing:0;color:var(--fg);font-size:16px}.user-message{white-space:pre-wrap;color:var(--fg);font-size:16px;line-height:1.8}.pi-user{border-bottom:1px solid #392628;padding-bottom:20px}.mini-pi{flex-shrink:0;width:36px;height:20px}.markdown{color:var(--fg);overflow-wrap:anywhere;font-size:16px;line-height:1.85}.markdown p{margin:0 0 14px}.markdown p:last-child{margin-bottom:0}.markdown h1,.markdown h2,.markdown h3{color:var(--fg);margin:22px 0 12px;font-size:16px}.markdown ul,.markdown ol{margin:12px 0;padding-left:23px}.markdown li{margin:6px 0}.markdown strong{color:var(--fg);font-weight:600}.markdown code{color:var(--fg);background:#3a2628;border-radius:4px;padding:2px 5px;font-size:16px}.markdown pre{white-space:pre;background:#251819;border:1px solid #3d2b2d;border-radius:7px;margin:14px 0;padding:16px;overflow:auto}.markdown pre code{background:0 0;padding:0}.markdown a{color:var(--accent)}.markdown table{border-collapse:collapse;width:100%}.markdown td,.markdown th{border:1px solid var(--line);text-align:left;padding:8px}.fork-button{color:var(--fg);letter-spacing:0;opacity:1;white-space:nowrap;margin-left:auto;padding:3px 5px;font-size:16px;display:inline-flex}.entry:hover .fork-button,.fork-button:focus-visible{opacity:1}.event-line{color:var(--fg);align-items:center;gap:7px;padding:8px 0;font-size:16px;display:flex}.event-line>span{flex:1}.pi-tool-result{margin-top:-17px;margin-bottom:20px}.tool-call,.tool-result{color:var(--fg);background:#251819;border:1px solid #453032;border-radius:6px;margin:10px 0;font-size:16px;overflow:hidden}.tool-call summary,.tool-result summary{cursor:pointer;align-items:center;gap:9px;padding:10px 12px;list-style:none;display:flex}.tool-call summary:after,.tool-result summary:after{content:"⌄";color:var(--fg);margin-left:auto}.tool-call summary code{white-space:nowrap;text-overflow:ellipsis;color:var(--fg);font-size:16px;overflow:hidden}.tool-call pre,.tool-result pre{color:var(--fg);border-top:1px solid #412b2d;max-height:340px;margin:0;padding:11px;overflow:auto}.tool-result{background:#201415;border-color:#3b2b2c}.tool-result summary>span{color:var(--fg);font-size:16px}.tool-result.failed{color:var(--fg);border-color:#673f43}.tool-call.failed{border-color:#a44c58}.tool-status{color:var(--secondary);margin-left:auto}.tool-section-label{color:var(--secondary);border-top:1px solid #412b2d;align-items:center;gap:12px;padding:10px 12px;display:flex}.tool-section-label .fork-button{margin-left:auto}.thinking{color:var(--fg);margin:8px 0 16px;font-size:16px}.thinking summary{cursor:pointer}.thinking div{white-space:pre-wrap;color:var(--fg);border-left:1px solid #5a3a3d;margin-top:12px;padding-left:12px;font-size:16px;line-height:1.8}.message-error{color:var(--fg);overflow-wrap:anywhere;background:#39232550;border:1px solid #6b4245;border-radius:6px;margin-top:10px;padding:10px;font-size:16px;line-height:1.7}.streaming{letter-spacing:0;color:var(--accent);margin-left:auto;font-size:16px}.typing{gap:5px;padding:12px 0;display:flex}.typing i{background:#af7c81;border-radius:50%;width:5px;height:5px;animation:1.2s infinite pulse}.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}.live-tool{background:#2c1d1e;border:1px solid #624346;border-radius:6px;margin:10px 0;padding:11px}.live-tool>div{color:var(--fg);align-items:center;gap:8px;font-size:16px;display:flex}.live-tool>div>span{color:var(--fg);margin-left:auto;font-size:16px}.live-tool pre{max-height:150px;color:var(--fg);overflow:auto}.queue{background:#2e1f20;border:1px solid #4a3537;border-radius:7px;margin-bottom:10px;padding:5px 10px}.queue>div{color:var(--fg);align-items:center;gap:7px;font-size:16px;display:flex}.queue span{white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.history-banner{color:var(--fg);background:#33292a33;align-items:center;gap:7px;padding:8px 26px;font-size:16px;display:flex}.empty-panel{color:var(--fg);flex-direction:column;align-items:center;gap:12px;padding:30px 0;font-size:16px;display:flex}.empty-panel strong{color:var(--fg);font-weight:500}.task-card{background:#2a1b1c;border:1px solid #4d3537;border-radius:7px;margin:10px 0;padding:13px}.task-card.child{border-left:2px solid #84595d;margin-left:14px}.task-card>div:first-child{justify-content:space-between;align-items:center;gap:6px;display:flex}.task-card strong{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:16px;font-weight:400}.task-card p{color:var(--fg);margin:8px 0 11px;font-size:16px}.hook-card{background:#2a2525;border:1px solid #483c3d;border-radius:7px;margin-bottom:20px;padding:14px}.hook-card>div{color:var(--fg);align-items:center;gap:8px;display:flex}.hook-card strong{font-size:16px;font-weight:500}.hook-card p{color:var(--fg);margin-top:10px;font-size:16px;line-height:1.6}.switch{background:#544b4c;border-radius:12px;justify-content:flex-start;width:29px;height:17px;margin-left:auto;padding:2px}.switch>span{background:#dbcccd;border-radius:50%;width:13px;height:13px}.switch.on{background:var(--primary);justify-content:flex-end}.tool-row{border-bottom:1px solid #3a2a2b;padding:12px 0}.tool-row summary{cursor:pointer;color:var(--fg);align-items:center;gap:7px;list-style:none;display:flex}.tool-row strong{font-family:var(--font-mono);font-size:16px;font-weight:500}.tool-row .tag{margin-left:auto;font-size:16px}.tool-row p{color:var(--fg);white-space:pre-wrap;margin:12px 0;font-size:16px;line-height:1.75}.tool-row small{color:var(--fg);line-height:1.6}.tool-signature{border:1px solid var(--line);font-family:var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--fg);background:#120d0e;border-radius:8px;margin:0 0 12px;padding:12px 14px;font-size:14px;line-height:1.6}.tk-keyword{color:var(--accent)}.tk-function{color:#ffd38a}.tk-property{color:#9ed8cf}.tk-type{color:#8fb6ff}.tk-string{color:#e6b98f}.tk-number{color:#d4a5ff}.tk-comment{color:var(--faint);font-style:italic}.tk-punct{color:#b8a6a7}.prompt-chip{width:100%;color:var(--fg);text-align:left;border-bottom:1px solid var(--line);justify-content:space-between;padding:14px 0;font-size:16px;display:flex}.drawer-backdrop{z-index:40;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:#0007;position:fixed;inset:65px 0 0}.sessions-drawer{background:var(--card);border-right:1px solid #513d3f;flex-direction:column;width:326px;max-width:90vw;height:100%;padding:24px 18px;display:flex;box-shadow:20px 0 70px #0004}.sessions-drawer header{justify-content:space-between;align-items:center;margin-bottom:22px;padding:0 7px;display:flex}.sessions-drawer h2{font-size:17px;font-weight:550}.sessions-drawer h2 span{color:var(--fg);margin-left:6px;font-size:16px}.sessions-drawer>.primary{margin:0 6px 22px}.session-list{flex:1;overflow:auto}.session-item{text-align:left;border:1px solid #0000;border-radius:7px;flex-direction:column;align-items:stretch;gap:10px;width:100%;margin-bottom:7px;padding:15px;display:flex}.session-item.active{background:#362527;border-color:#5e3e41}.session-item:hover{background:#312324}.session-item strong{justify-content:space-between;align-items:center;font-size:16px;font-weight:550;display:flex}.session-item .path{font-size:16px}.session-model{color:var(--fg);overflow-wrap:anywhere;align-items:center;gap:6px;font-size:16px;display:flex}.session-model img{background:#ecdfe0;border-radius:3px;width:15px;height:15px;padding:1px}.active-dot{background:var(--accent);border-radius:50%;width:5px;height:5px}.sessions-drawer footer{color:var(--fg);align-items:center;gap:8px;padding:18px 8px 0;font-size:16px;display:flex}.modal-backdrop{z-index:80;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);background:#0d0808bd;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:12px;width:460px;max-width:100%;max-height:90dvh;padding:28px;overflow:auto;box-shadow:0 24px 70px #0000008c}.modal header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:27px;display:flex}.modal header h2{letter-spacing:-.5px;margin-top:7px;font-size:22px;font-weight:550}.modal label{color:var(--fg);flex-direction:column;gap:9px;margin-top:20px;font-size:16px;display:flex}.modal input,.modal select{width:100%;padding:12px;font-size:16px}.modal small.path{color:var(--fg);margin-top:-1px;font-size:16px;line-height:1.6}.modal footer{justify-content:flex-end;gap:10px;margin-top:26px;display:flex}.model-modal{flex-direction:column;width:500px;display:flex;overflow:hidden}.login-veil{z-index:100;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);background:#0d0808e0;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.login-card{width:400px}.login-card .hint{color:var(--fg);font-size:15px;line-height:1.55}.login-card footer{justify-content:flex-end}.model-list{max-height:50vh;margin-top:12px;overflow:auto}.model-list button{text-align:left;border-radius:6px;justify-content:flex-start;gap:12px;width:100%;padding:12px 10px;display:flex}.model-list button.selected,.model-list button:hover{background:#402b2d}.model-list button>div{flex-direction:column;flex:1;gap:5px;display:flex}.model-list strong{font-size:16px;font-weight:500}.model-list small{color:var(--fg);font-size:16px}.model-modal .hint{margin:14px 0 0}.learning-list{flex-direction:column;gap:23px;padding:0;list-style:none;display:flex}.learning-list li{gap:17px;display:flex}.learning-list li>span{font-family:var(--font-mono);color:var(--fg);border:1px solid #5a383b;border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:27px;font-size:16px;display:flex}.learning-list strong{color:var(--fg);font-size:16px;font-weight:500}.learning-list p{color:var(--fg);margin-top:5px;font-size:16px;line-height:1.8}.help-modal{width:530px}.toast{z-index:100;background:var(--card);color:var(--on-primary);border:1px solid var(--line);border-radius:999px;align-items:center;gap:10px;max-width:90%;padding:13px 19px;font-size:16px;font-weight:600;line-height:1.5;display:flex;position:fixed;bottom:28px;left:50%;transform:translate(-50%);box-shadow:0 10px 30px #00000073}.toast svg{color:var(--accent);flex-shrink:0}.pi-user .message-label{justify-content:flex-end}.pi-user .user-message{text-align:right}.state-json-actions{flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-bottom:20px;display:flex}.state-json-actions .hint{flex-basis:100%;margin:0}textarea.app-state-json{resize:vertical;width:100%;min-height:280px;max-height:none;font-family:var(--font-mono);color:var(--fg);margin-bottom:10px}.toast-enter-active,.toast-leave-active{transition:opacity .2s}.toast-enter-from,.toast-leave-to{opacity:0}.error-banner{color:var(--fg);z-index:90;background:#462b2d;align-items:center;gap:10px;padding:10px 25px;font-size:16px;display:flex}.error-banner span{flex:1}.welcome{text-align:center;background:radial-gradient(#39232533,#0000 65%);flex-direction:column;flex:1;justify-content:center;align-items:center;padding:35px;display:flex}.welcome-symbol{width:126px;height:70px;margin-bottom:33px;position:relative}.welcome .eyebrow{color:var(--fg);letter-spacing:2.6px;font-size:16px}.welcome h1{letter-spacing:-2.5px;color:var(--fg);margin:20px 0;font-size:clamp(36px,4.6vw,64px);font-weight:500;line-height:1.15}.welcome p{color:var(--fg);margin:4px 0 30px;font-size:16px}.welcome-features{color:var(--fg);gap:33px;margin-top:70px;font-size:16px;display:flex}.welcome-features>span{align-items:center;gap:8px;display:flex}.selected{color:var(--accent)}@keyframes pulse{0%,to{opacity:.45}50%{opacity:1}}@media (width>=1600px){.workspace{grid-template-columns:440px minmax(0,1fr)}.chat-scroll{padding-left:max(70px,50% - 385px);padding-right:max(70px,50% - 385px)}.composer-region{padding-left:max(46px,50% - 415px);padding-right:max(46px,50% - 415px)}}@media (width<=1050px){.workspace{grid-template-columns:330px minmax(0,1fr)}.session-heading,.model-section,.inspector-body{padding-left:20px;padding-right:20px}.chat-empty h2{font-size:23px}.composer-footnote>span:last-child{display:none}.starter-grid{grid-template-columns:1fr;max-width:300px}.starter-grid button{padding:13px}.starter-grid button>svg:first-child{margin-bottom:3px}.topbar{padding-right:16px}}@media (width<=740px){.shell{height:auto;min-height:100dvh;overflow:visible}.topbar{height:58px;min-height:58px;padding:0 12px;position:sticky;top:0}.brand{gap:8px}.brand strong{font-size:16px}.brand-separator,.brand>.muted,.version,.connection{display:none}.top-actions{gap:5px}.workspace{flex-direction:column;display:flex}.inspector{border-right:0;border-bottom:1px solid var(--line);min-height:310px;max-height:55vh}.session-heading{padding:17px 20px 10px}.session-heading h1{margin:5px 0;font-size:19px}.session-heading>.eyebrow,.session-status,.model-section,.inspector-footer{display:none}.inspector-tabs{padding:0 13px}.inspector-tabs button{padding:11px 3px}.inspector-body{min-height:150px;padding:17px 20px}.chat-panel{height:85dvh;min-height:500px}.chat-header{min-height:55px;padding:0 13px}.chat-scroll{padding:24px 22px}.chat-empty h2{font-size:22px}.composer-region{padding:12px}.composer-left{gap:3px}.composer-left .context-indicator{display:none}.composer-right{gap:8px}.modal{padding:22px}.welcome{min-height:90dvh}.welcome-features{flex-direction:column;align-items:center;gap:20px;margin-top:40px}.drawer-backdrop{top:58px}.toast{width:max-content;max-width:90%;font-size:16px;bottom:15px}.fork-label{display:none}}@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}@media (width<=740px){.model-section{padding:9px 20px;display:block}.model-section .section-label,.model-section .thinking-row,.model-section .metrics{display:none}.model-button{padding:7px 10px}.model-button img{width:24px;height:24px}.model-button small{display:none}}.primary,.send{background:var(--primary);border-color:var(--primary-line);color:#fff}.primary:hover,.send:hover{background:var(--primary-hover)}.model-button img,.model-list img{background:#fff;border:1px solid #67575c;flex-shrink:0;width:42px;height:42px;padding:5px}.session-model img{background:#fff;flex-shrink:0;width:32px;height:32px;padding:3px}img[src$=openai\.png]{background:#242024;border-color:#81747a;padding:3px}button:disabled{opacity:1;color:#d4c7ca;background-color:#33272b;border-color:#554249}.icon-button{width:36px;height:36px;color:var(--fg)}.inspector-tabs{padding:0 10px}.inspector-tabs button{min-width:0;padding:15px 7px 13px}.session-heading h1{line-height:1.4}.session-status,.section-label,.panel-heading,.job-title,.job-meta,.composer-footnote,.composer-toolbar{flex-wrap:wrap}.metrics{grid-template-columns:1fr 1.4fr .6fr;gap:12px}.metrics small{line-height:1.5}.model-button{min-height:70px}.model-button small{line-height:1.5}.model-button strong{white-space:normal}.inspector-footer{height:auto;min-height:52px;padding:8px 20px}.counter-card{flex-wrap:wrap;gap:12px}.counter-card .field-label{max-width:180px;line-height:1.5}.raw summary{flex-wrap:wrap;line-height:1.6}.raw summary span{color:var(--fg)}.tool-row summary{flex-wrap:wrap}.tool-row .tag{margin-left:auto}.tool-call summary{flex-wrap:wrap}.tool-call summary code{max-width:100%}.fork-button{opacity:1;color:#ffd3da}.session-item .path{line-height:1.6}.sessions-drawer{width:420px}.modal{width:560px}.model-modal{width:650px}.model-list button{min-height:78px}.model-list small{line-height:1.5}.task-card>div:first-child{flex-wrap:wrap}.composer-footnote{line-height:1.6}.composer-left,.composer-right{flex-wrap:wrap;gap:8px}.send{width:40px;height:40px}.interrupt{min-height:40px}.tag{line-height:1.4}.brand{gap:10px}.welcome-features{flex-wrap:wrap;justify-content:center}@media (width>=741px) and (width<=1599px){.workspace{grid-template-columns:minmax(410px,36%) minmax(0,1fr)}.chat-scroll{padding-left:30px;padding-right:30px}.composer-footnote>span:last-child{display:none}.chat-header{flex-wrap:wrap;gap:10px;padding:10px 18px}}@media (width<=1100px) and (width>=741px){.brand>.muted,.brand-separator,.version{display:none}.starter-grid{grid-template-columns:1fr}.composer-left .context-indicator{display:none}.conversation-select select{max-width:205px}}@media (width<=740px){.inspector{max-height:60vh}.topbar{height:68px;min-height:68px}.top-actions .icon-button{display:none}.brand strong{font-size:16px}.model-button img{width:40px;height:40px}.model-button small{display:block}.model-button{min-height:64px}.inspector-tabs{padding:0 4px}.inspector-tabs button{gap:4px;padding:12px 4px}.inspector-body{padding:18px 16px}.conversation-select{gap:6px;max-width:calc(100% - 94px)}.conversation-select select{width:100%;max-width:180px}.chat-header-actions{gap:0}.chat-header-actions .icon-button{width:30px}.chat-header{padding:0 10px}.drawer-backdrop{top:68px}.composer-toolbar{padding-left:9px}.composer-left select{max-width:120px;padding-left:0}.composer-footnote{align-items:flex-start}.composer-footnote>span:first-child{align-items:baseline}.starter-grid strong,.starter-grid span{line-height:1.5}.chat-empty{padding:24px 0}.chat-panel{min-height:760px}.modal{padding:20px}.top-actions .primary{padding:8px}}.session-heading .cwd-button{text-align:left;width:100%;min-width:0;display:flex}.cwd-button:hover{color:var(--fg)}.cwd-button svg{flex-shrink:0}.cwd-trail{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.full-directory{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;font-size:16px;line-height:1.6;display:block}.modal.path-modal{width:max-content;min-width:min(960px,100%)}.markdown :is(h4,h5,h6,small,sub,sup){font-size:16px}.inspector>.inspector-tabs{border-top:0;flex-shrink:0;min-height:74px;padding:0 8px}.inspector>.inspector-tabs button{flex-direction:column;gap:5px;padding:10px 4px;line-height:1.4;position:relative}.inspector-tabs .count{position:absolute;top:4px;right:4px}.inspector-body.session-panel{padding:0 0 24px}.session-panel .session-heading{padding:24px 26px}.session-panel .model-section{padding:22px 26px}@media (width<=740px){.inspector>.inspector-tabs{padding:0 4px}.session-panel .session-heading,.session-panel .model-section{padding:20px 16px}.session-panel .session-heading>.eyebrow{display:block}.session-panel .session-status,.session-panel .section-label,.session-panel .thinking-row{display:flex}.session-panel .metrics{display:grid}}.hint,.path,.eyebrow,.section-label,.section-label span+span,.field-label,.counter-card .field-label,.model-button small,.model-list small,.metrics small,.thinking-row>span,.saved,.job-meta,.demo-action small,.task-card p,.tool-row p,.tool-row small,.tool-call summary code,.tool-result summary>span,.thinking,.thinking div,.raw summary,.raw summary span,.message-label>span:not(.mini-pi):not(.streaming),.composer-footnote,.context-indicator,.composer-left select,.version,.session-model,.sessions-drawer footer,.inspector-footer,.starter-grid span,.chat-empty p,.welcome p,.welcome-features,.learning-list p{color:var(--secondary)}input::placeholder,textarea::placeholder{color:var(--secondary);opacity:1}.chat-header{flex-wrap:nowrap;gap:14px}.chat-header-actions{flex-shrink:0}.lineage-picker{flex:1;min-width:0;padding:8px 0;position:relative}.lineage-toolbar{align-items:center;gap:4px;min-width:0;display:flex}.conversation-lineage{scrollbar-width:thin;scrollbar-color:var(--line) transparent;align-items:center;gap:4px;min-width:0;display:flex;overflow-x:auto}.lineage-crumb{color:var(--secondary);white-space:nowrap;border-radius:6px;flex-shrink:0;padding:7px 9px;font-size:16px}.lineage-crumb:hover{background:#342328}.lineage-crumb.current{color:var(--accent);background:#392328}.lineage-separator{color:var(--secondary)}.conversation-menu-toggle{flex-shrink:0}.lineage-source{color:var(--secondary);margin:4px 9px 0;font-size:16px;line-height:1.5}.conversation-menu-dismiss{z-index:25;cursor:default;position:fixed;inset:0}.conversation-picker{z-index:30;background:#251b1e;border:1px solid #68474e;border-radius:9px;width:min(540px,100vw - 48px);max-height:min(65vh,620px);padding:8px;position:absolute;top:100%;left:0;overflow-y:auto;box-shadow:0 16px 48px #0007}.conversation-picker-heading{color:var(--secondary);padding:10px 12px 14px;font-size:16px}.conversation-choice{text-align:left;border-radius:6px;justify-content:space-between;align-items:center;gap:14px;width:100%;padding:12px;display:flex}.conversation-choice:hover,.conversation-choice.selected{background:#3b272d}.conversation-choice-content{flex-direction:column;gap:6px;min-width:0;display:flex}.choice-lineage{color:var(--fg);flex-wrap:wrap;align-items:center;gap:5px;font-size:16px;line-height:1.5;display:flex}.choice-lineage>span{white-space:nowrap}.choice-lineage .choice-ancestor,.choice-lineage>svg,.choice-source{color:var(--secondary)}.choice-source{font-size:16px;line-height:1.5}.conversation-choice.selected .choice-lineage>span:last-child{color:var(--accent)}@media (width<=740px){.chat-header{flex-wrap:wrap;gap:4px;padding:8px 10px}.lineage-picker{flex-basis:100%;width:100%}.chat-header-actions{margin-left:auto}.conversation-picker{width:min(540px,100vw - 20px)}.lineage-crumb{padding:7px}}.queue-mode{min-width:150px;position:relative}.composer-left .queue-mode select{appearance:none;color:#f8eeee;cursor:pointer;background:#342329;border:1px solid #77515a;border-radius:8px;width:100%;max-width:none;min-height:40px;padding:7px 36px 7px 12px;font-size:16px;font-weight:600}.queue-mode>svg{pointer-events:none;color:var(--secondary);position:absolute;top:50%;right:10px;transform:translateY(-50%)}.interrupt .stop-sign{color:#ff647a;stroke:#ffb5c0;flex-shrink:0}.switch{border-radius:20px;flex-shrink:0;width:58px;height:34px;padding:4px}.switch>span{width:26px;height:26px}.state-boolean .switch{margin-left:0}.task-section{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.task-section h3,.task-example h4{align-items:center;gap:8px;margin:0 0 10px;font-size:16px;font-weight:650;display:flex}.task-example{border:1px solid var(--line);background:#25191c;border-radius:8px;margin-top:12px;padding:16px}.task-example p,.task-explanation p,.task-empty{color:var(--secondary);margin:8px 0 14px;font-size:16px;line-height:1.6}.task-decision-buttons{flex-wrap:wrap;gap:8px;margin:16px 0;display:flex}.approval-card{border-color:#c68957}.tasks-panel .task-note{margin-bottom:0}.tasks-panel .task-card .raw{margin-top:12px}.chat-header-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.chat-header{flex-wrap:wrap}.chat-header-actions .secondary{min-height:38px}@media (width<=740px){.topbar{flex-wrap:wrap;gap:12px;height:auto;padding:12px 16px}.top-actions{flex-wrap:wrap;gap:8px;margin-left:auto}.chat-header-actions{justify-content:flex-start;width:100%}}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--line);background-clip:padding-box;border:2px solid #0000;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:var(--faint);background-clip:padding-box}.label{font-family:var(--font-display);letter-spacing:.14em;text-transform:uppercase;color:var(--faint);font-size:14px;font-weight:700}.topbar-sep{background:var(--line);flex-shrink:0;width:1px;height:22px}.daemon{color:var(--faint);flex-wrap:wrap;align-items:center;gap:8px;min-width:0;font-size:15px;display:flex}.daemon b{color:var(--fg);font-weight:500;font-family:var(--font-mono)}.daemon .sep{color:var(--offline);flex-shrink:0}.dot{background:var(--ok);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in oklab, var(--ok) 16%, transparent);border-radius:50%;flex:0 0 8px;display:inline-block}.dot.off{background:var(--offline);box-shadow:none}.chip{border:1px solid var(--line);height:28px;font-family:var(--font-mono);color:var(--faint);background:var(--bg);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:13px;display:inline-flex}.chip b{color:var(--fg);font-weight:500}.chip.accent{border-color:color-mix(in oklab, var(--accent) 40%, var(--line));color:var(--accent)}.chip .dot{width:7px;height:7px;box-shadow:none;flex:0 0 7px}.secondary{border:1px solid var(--line);background:var(--card);transition:background .12s var(--ease), border-color .12s var(--ease)}.secondary:not(:disabled):hover{border-color:var(--faint)}.scrim{z-index:80;background:#0a0607ad;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.dialog{border:1px solid var(--line);background:var(--panel);border-radius:12px;width:min(560px,100%);max-height:calc(100dvh - 40px);overflow-y:auto;box-shadow:0 24px 70px #0000008c}.dialog-head{justify-content:space-between;align-items:flex-start;gap:12px;padding:18px 20px 0;display:flex}.dialog-eyebrow{font-family:var(--font-display);letter-spacing:.14em;text-transform:uppercase;color:var(--accent);font-size:14px;font-weight:700}.dialog h3{font-family:var(--font-display);letter-spacing:-.01em;margin:5px 0 0;font-size:20px;font-weight:700}.dialog-body{flex-direction:column;gap:12px;padding:16px 20px;display:flex}.help-step{border-bottom:1px solid var(--line-soft);grid-template-columns:26px minmax(0,1fr);gap:10px;padding:7px 0;font-size:16px;display:grid}.help-step:last-of-type{border-bottom:0}.help-step .n{font-family:var(--font-mono);color:var(--accent)}.help-step b{font-weight:600}.help-step .body{color:var(--muted);margin-top:2px;line-height:1.6}.help-callout{border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--chat);color:var(--muted);align-items:flex-start;gap:10px;margin-top:4px;padding:10px 12px;font-size:16px;display:flex}.help-callout svg{flex-shrink:0;margin-top:2px}.dialog-foot{align-items:center;gap:8px;padding:0 20px 18px;display:flex}.dialog-foot .right{gap:8px;margin-left:auto;display:flex}.mnav{display:none}@media (width<=760px){.daemon,.topbar-sep{display:none}.mnav{padding:4px 6px calc(4px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--panel);grid-template-columns:repeat(3,1fr);gap:2px;display:grid}.mnav button{min-height:48px;color:var(--faint);background:0 0;border:0;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-size:12px;display:flex;position:relative}.mnav button.is-on{color:var(--accent);background:color-mix(in oklab, var(--accent) 9%, transparent)}.mnav .badge{background:var(--primary);min-width:16px;height:16px;color:var(--on-primary);font-family:var(--font-mono);border-radius:999px;padding:0 4px;font-size:11px;line-height:16px;position:absolute;top:5px;right:calc(50% - 22px)}}.composer:focus-within{border-color:color-mix(in oklab, var(--accent) 55%, var(--line));box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent)}.send{border:1px solid var(--primary-line);transition:background .12s var(--ease);border-radius:8px}.pi-user{border-bottom:0;flex-direction:column;align-items:flex-end;gap:8px;padding-bottom:12px;display:flex}.pi-user .user-message{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);max-width:78%;padding:10px 14px}.inspector-tabs{background:var(--tree)}.inspector-tabs button{color:var(--muted)}.inspector-tabs button:hover{color:var(--fg)}.inspector-tabs button.active{color:var(--accent)}.insp-tab-active-line{border-bottom:2px solid var(--accent)}.switch{background:var(--offline)}.switch.on{background:var(--primary)}.switch.on>span{background:var(--on-primary)}.tool-call{background:var(--card);border-color:var(--line)}.tool-result{background:var(--chat)}.tool-result.failed,.tool-call.failed{border-color:color-mix(in oklab, var(--err) 45%, var(--line))}.metrics{border:1px solid var(--line);border-radius:var(--radius);background:var(--line);gap:1px;overflow:hidden}.metrics>div{background:var(--chat);padding:9px 12px}.metrics span{font-family:var(--font-mono);font-weight:500}.model-button{background:var(--chat);border:1px solid var(--line);border-radius:var(--radius)}.model-button:hover{border-color:var(--faint)}input,textarea,select{border-radius:var(--radius-sm)}input:focus,textarea:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent)}.chat-panel{background:var(--chat)}.chat-header,.inspector{background:var(--panel)}.network-sidebar{background:var(--tree)}.net-workspace{--tree-w:300px;--inspector-w:450px;--rail-w:52px;flex:1;min-height:0;display:flex;position:relative}.net-workspace>.chat-panel,.net-workspace>.welcome,.net-workspace>.offline-panel{flex:auto;min-width:0}.net-workspace>.network-sidebar{width:var(--tree-w);flex:none}.net-workspace>.network-sidebar.collapsed{width:var(--rail-w)}.net-workspace>.inspector{width:var(--inspector-w);border-right:1px solid var(--line);border-left:0;flex:none;min-height:0;max-height:none}.net-workspace>.inspector.collapsed{width:var(--rail-w)}.network-summary{color:var(--muted);border:1px solid var(--line);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;margin-left:6px;padding:3px 10px;font-size:15px;display:inline-flex}.tree-toggle,.inspector-toggle,.tree-backdrop,.inspector-backdrop{display:none}.panel-rail{scrollbar-width:none;flex-direction:column;align-items:center;gap:6px;height:100%;padding:10px 0;display:flex;overflow-y:auto}.panel-rail .panel-toggle{margin-bottom:6px}.rail-device,.rail-tab{width:38px;height:38px;color:var(--muted);border-radius:8px;position:relative}.rail-device:hover,.rail-tab:hover{color:var(--fg);background:#ffffff0a}.rail-tab.active{color:var(--accent);background:#ff899714}.rail-device .dot{width:8px;height:8px;box-shadow:0 0 0 2px var(--tree);flex-basis:8px;position:absolute;bottom:4px;right:4px}.rail-tab .count{background:var(--accent);color:#1a1012;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:11px;line-height:16px;position:absolute;top:2px;right:2px}.inspector .panel-rail{background:var(--panel)}.inspector-tabs .panel-toggle{align-self:center;margin-left:auto}.device-icon{flex:none;display:inline-block}.device-icon.exe,.device-icon.apple{color:#e9e2e2}.network-sidebar{background:var(--tree);border-right:1px solid var(--line);flex-direction:column;min-height:0;display:flex}.tree-head{color:var(--muted);letter-spacing:1.6px;justify-content:space-between;align-items:center;padding:10px 12px 10px 16px;font-size:14px;font-weight:650;display:flex}.tree-head span{align-items:center;gap:8px;display:inline-flex}.tree-list{scrollbar-width:thin;scrollbar-color:var(--line) transparent;outline:none;flex:1;padding:4px 6px 12px;overflow:auto}.tree-list:focus-visible{box-shadow:inset 0 0 0 1px #856669}.tree-empty{padding:12px 10px}.tree-row{--depth:0;min-height:34px;padding:3px 6px 3px calc(4px + var(--depth) * 16px);cursor:pointer;color:#e9e2e2;white-space:nowrap;border-radius:6px;align-items:center;gap:7px;font-size:15px;display:flex;position:relative}.tree-row:hover{background:#ffffff08}.tree-row.focus{box-shadow:inset 0 0 0 1px #6d5557}.tree-row.sel{background:#ff899714}.tree-row.sel:before{content:"";background:var(--accent);border-radius:2px;width:3px;position:absolute;top:5px;bottom:5px;left:0}.tree-row.stale{opacity:.55}.tree-row .chev{width:18px;height:18px;color:var(--muted);flex:0 0 18px;padding:0}.tree-row span.chev{display:inline-block}.tree-row .name{text-overflow:ellipsis;min-width:0;overflow:hidden}.tree-row.device .name{font-family:var(--font-mono);font-size:15px}.tree-row.session .name{font-weight:600}.tree-row .ico{color:var(--muted);flex:none}.tree-row .ico.root{color:var(--accent)}.tree-row .badge{color:var(--muted);font-size:12px;font-family:var(--font-mono);border:1px solid #443738;border-radius:4px;padding:1px 5px}.tree-row .meta,.tree-row .path{color:var(--muted);text-overflow:ellipsis;min-width:0;font-size:13px;overflow:hidden}.tree-row .path{font-family:var(--font-mono);flex:1}.tree-row .meta.err{color:#ff8a80}.tree-row .acts{background:var(--tree);border-radius:6px;gap:2px;margin-left:auto;display:none}.tree-row:hover .acts,.tree-row.focus .acts{display:inline-flex}.tree-row:hover .acts~*,.tree-row .acts .icon-button{width:26px;height:26px}.tree-row .acts .icon-button:disabled{opacity:.35;background:0 0}.tree-row .bg-count{color:var(--muted);align-items:center;gap:4px;font-size:13px;display:inline-flex}.tree-row>.dot.work,.tree-row>.bg-count{margin-left:auto}.tree-row>.dot.work+.bg-count{margin-left:6px}.tree-row:hover>.dot.work,.tree-row:hover>.bg-count,.tree-row.focus>.dot.work,.tree-row.focus>.bg-count{display:none}.dot{background:#756062;border-radius:50%;flex:0 0 9px;width:9px;height:9px;display:inline-block}.dot.on{background:var(--ok);box-shadow:0 0 6px #6fcf9766}.dot.chk{background:var(--secondary);animation:1.1s ease-in-out infinite dpi-pulse}.dot.err{background:var(--err)}.dot.off{background:var(--offline)}.dot.work{background:var(--accent);animation:1.1s ease-in-out infinite dpi-pulse}.dot.bg{border:2px solid var(--accent);background:0 0;width:9px;height:9px}@keyframes dpi-pulse{50%{opacity:.35}}.tree-resizer{cursor:col-resize;z-index:5;flex:0 0 6px;width:6px;margin:0 -3px;position:relative}.tree-resizer:hover{background:#ff899733}.crumbs{scrollbar-width:thin;scrollbar-color:var(--line) transparent;align-items:flex-end;gap:4px;min-width:0;padding:2px 0;display:flex;overflow-x:auto}.crumb{color:#e9e2e2;border-radius:8px;flex-direction:column;flex:none;align-items:flex-start;gap:2px;max-width:260px;padding:5px 10px 6px;display:inline-flex}.crumb:hover{background:#ffffff0a}.crumb.current{color:var(--accent);background:#ff899714}.crumb-kind{letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);font-size:11px;line-height:1}.crumb-main{align-items:center;gap:7px;min-width:0;max-width:100%;font-size:17px;font-weight:600;line-height:1.2;display:inline-flex}.crumb-name,.crumb .device-chip{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.crumb .device-chip{font-family:var(--font-mono)}.crumb-sep{color:var(--muted);flex:none;margin-bottom:8px}.chat-header-actions .secondary.active{border-color:var(--accent)}.history-divider{color:var(--muted);letter-spacing:1px;text-transform:uppercase;align-items:center;gap:8px;margin:8px 0 18px;font-size:14px;display:flex}.history-divider:after{content:"";border-top:1px dashed #4a3b3c;flex:1}.entry.history{opacity:.6}.retry-note{margin-top:4px}.session-modal{width:1120px}.device-modal code,.session-modal code{overflow-wrap:anywhere}.modal .field{flex-direction:column;gap:9px;margin-top:20px;display:flex}.dir-browser{flex-direction:column;gap:8px;display:flex}.dir-path{gap:8px;display:flex}.dir-path input{font-family:var(--font-mono);flex:1;font-size:14px!important}.dir-list{border:1px solid var(--line);background:var(--chat);border-radius:7px;max-height:220px;padding:4px;overflow:auto}.dir-item{color:#e9e2e2;border-radius:5px;justify-content:flex-start;width:100%;padding:6px 8px;font-size:15px}.dir-item:hover{background:#ffffff0a}.dir-item[aria-selected=true]{color:#fff;background:#ff899714}.dir-item span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.device-result{overflow-wrap:anywhere;border:1px solid #544042;border-radius:8px;align-items:flex-start;gap:10px;margin-top:18px;padding:12px;display:flex}.device-result.online{border-color:#6fcf9777}.device-result:not(.online){border-color:#ff6b6b77}.primary.danger{background:#c94f5d;border-color:#c94f5d}.offline-panel .chat-empty{gap:6px;max-width:640px;margin:0 auto}.offline-panel .eyebrow{font-family:var(--font-mono);letter-spacing:.5px;color:var(--muted);overflow-wrap:anywhere}.offline-panel.unauthorized svg,.offline-panel.mismatch svg{color:var(--err)}.offline-error{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:14px}.offline-command{border:1px solid var(--line);background:#0f0a0b;border-radius:8px;align-items:center;gap:8px;margin:10px 0 4px;padding:10px 14px;display:inline-flex}.offline-command code{color:#fff;font-size:17px}.offline-actions{gap:10px;margin-top:16px;display:flex}.spin{animation:1s linear infinite dpi-spin}@keyframes dpi-spin{to{transform:rotate(360deg)}}@media (width<=1100px){.inspector-toggle{display:inline-flex}.net-workspace>.inspector.overlay{z-index:30;width:min(420px,100%);position:absolute;top:0;bottom:0;left:0;box-shadow:20px 0 60px #0008}.inspector-backdrop{z-index:29;background:#0d080899;display:block;position:absolute;inset:0}}@media (width<=760px){.tree-resizer{display:none}.tree-toggle{display:inline-flex}.net-workspace>.network-sidebar{display:none}.net-workspace>.network-sidebar.open{z-index:40;width:min(340px,90vw);display:flex;position:absolute;top:0;bottom:0;left:0;box-shadow:20px 0 60px #0008}.tree-backdrop{z-index:39;background:#0d080899;display:block;position:absolute;inset:0}.network-summary,.new-agent-button{display:none!important}.shell{height:100dvh;overflow:hidden}.net-workspace .chat-panel{height:auto;min-height:0}.net-workspace>.inspector .session-status,.net-workspace>.inspector .model-section{display:block}.top-actions .inspector-toggle{display:inline-flex}.crumb-kind{display:none}}.net-workspace .lineage-picker{flex:240px}.net-workspace .conversation-lineage{flex:0 auto}.composer{position:relative}.slash-menu{background:var(--card);z-index:20;border:1px solid #544042;border-radius:10px;max-height:320px;margin:0;padding:6px;list-style:none;position:absolute;bottom:calc(100% + 8px);left:0;right:0;overflow-y:auto;box-shadow:0 20px 60px #0007}.slash-menu li{cursor:pointer;border-radius:6px;align-items:baseline;gap:10px;padding:7px 10px;display:flex}.slash-menu li.active{background:#ff899714}.slash-menu code{color:var(--accent);font-size:15px}.slash-args{color:var(--muted);font-family:var(--font-mono);font-size:14px}.slash-desc{color:var(--muted);text-align:right;margin-left:auto;font-size:14px}.job-run{border:1px solid #5a3a3e;border-left:4px solid var(--accent);min-width:0;color:var(--fg);background:linear-gradient(#2a1b1d,#221617);border-radius:9px;margin:14px 0 6px;padding:16px 18px 14px}.job-run.is-completed{border-left-color:var(--ok)}.job-run.is-waiting{border-left-color:var(--warn)}.job-run.is-failed,.job-run.is-declined,.job-run.is-aborted{border-left-color:#8d6a6d}.job-run-head{align-items:center;gap:12px;display:flex}.job-run-icon{width:40px;height:40px;color:var(--accent);background:#3d2629;border-radius:9px;flex:none;place-items:center;display:grid}.job-run-titles{flex:1;min-width:0}.job-run-titles h3{font-family:var(--font-title);margin:2px 0 0;font-size:19px;font-weight:750}.job-run-eyebrow{letter-spacing:1.2px;color:var(--secondary);flex-wrap:wrap;align-items:center;gap:4px 12px;font-size:16px;display:flex}.job-run-repeat{letter-spacing:0;color:var(--fg);align-items:center;gap:5px;display:inline-flex}.job-run-status{background:#352728;border-radius:5px;flex:none;align-items:center;gap:7px;padding:4px 9px;font-size:16px;display:inline-flex}.job-run-status i{background:currentColor;border-radius:50%;width:7px;height:7px}.job-run-status.running{color:var(--accent)}.job-run-status.running i{animation:1.5s infinite pulse}.job-run-status.waiting{color:var(--warn)}.job-run-status.completed{color:var(--ok)}.job-run-about{margin:12px 0 8px;font-size:16px;line-height:1.55}.job-run-meta{font-family:var(--font-mono);color:var(--secondary);flex-wrap:wrap;gap:6px 14px;font-size:16px;display:flex}.job-run-input,.job-run-resumed{color:var(--fg)}.job-run-resumed{color:var(--warn)}.job-stepper{flex-wrap:wrap;align-items:center;gap:8px 0;margin:16px 0 12px;padding:0;list-style:none;display:flex}.job-stepper li{align-items:center;display:inline-flex}.job-stepper li:not(:last-child):after{content:"→";color:#8d6a6d;margin:0 8px}.job-chip{background:#241819;border:1px solid #4a3638;border-radius:999px;align-items:center;gap:7px;padding:4px 11px 4px 4px;font-size:16px;display:inline-flex}.job-step-dot{width:24px;height:24px;font-family:var(--font-mono);background:#3a2a2c;border-radius:50%;place-items:center;font-size:15px;display:grid}.ph-done .job-chip{border-color:#3f6b52}.ph-done .job-step-dot{color:#b9f2cf;background:#24543a}.ph-running .job-chip{border-color:var(--accent);box-shadow:0 0 0 3px #ff899722}.ph-running .job-step-dot{color:var(--accent);background:#5a2a31}.ph-waiting .job-chip{border-color:var(--warn);box-shadow:0 0 0 3px #f2c94c22}.ph-waiting .job-step-dot{color:var(--warn);background:#574719}.ph-failed .job-chip,.ph-aborted .job-chip{border-color:#8d4a52}.job-stepper .ph-skipped{opacity:.55}.job-step-progress{font-family:var(--font-mono);color:var(--secondary)}.job-phases{grid-template-columns:minmax(0,1fr);gap:6px;display:grid}.job-phase{background:#1f1415;border:1px solid #3c2b2d;border-radius:7px}.job-phase.ph-running{border-color:#6a3a41}.job-phase.ph-waiting{border-color:#6b5a24}.job-phase.ph-skipped,.job-phase.ph-pending{opacity:.7}.job-phase>summary{cursor:pointer;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:9px 12px;font-size:16px;list-style:none;display:flex}.job-phase summary::-webkit-details-marker{display:none}.job-phase-n{font-family:var(--font-mono);color:var(--secondary)}.job-phase-summary{color:#e6d7d8;flex:1;min-width:160px}.job-phase-time{font-family:var(--font-mono);color:var(--secondary);margin-left:auto}.job-phase-about,.job-phase-empty{color:var(--secondary);margin:0;padding:0 12px 8px 34px;font-size:16px}.job-steps{grid-template-columns:minmax(0,1fr);gap:5px;margin:0;padding:0 12px 10px 34px;list-style:none;display:grid}.job-steps>li{font-size:16px;display:block}.job-steps summary,.job-step-line{align-items:center;gap:9px;min-width:0;list-style:none;display:flex}.job-steps summary{cursor:pointer}.job-steps summary:after{content:"⌄";color:var(--secondary);margin-left:2px}.job-steps details[open] summary:after{content:"⌃"}.job-steps code{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--font-mono);background:#2c1e20;border-radius:4px;padding:1px 6px;font-size:16px;overflow:hidden}.job-steps .k-tool code{border:1px solid #5a3a3e;flex:none}.job-step-kind{color:var(--secondary)}.job-steps .k-tool .job-step-kind,.job-steps .k-agent .job-step-kind{color:var(--accent)}.job-step-text{min-width:0;color:var(--fg)}.job-step-args{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--font-mono);color:var(--secondary);overflow:hidden}.job-step-state{font-family:var(--font-mono);color:var(--secondary);flex:none;align-items:center;gap:5px;display:inline-flex}.job-steps .st-done .job-step-state svg{color:var(--ok)}.job-steps .st-error .job-step-state svg{color:#ff8997}.job-steps .st-waiting .job-step-state svg{color:var(--warn)}.job-steps pre{white-space:pre-wrap;color:#e6d7d8;background:#180f10;border-radius:5px;max-height:180px;margin:4px 0 2px 25px;padding:7px 9px;font-size:16px;overflow:auto}.job-step-link{margin:2px 0 0 25px}.job-approval{background:#2c2514;border:1px solid #8a7330;border-radius:8px;margin-top:12px;padding:12px 14px}.job-approval>div:first-child{color:var(--warn);align-items:center;gap:8px;display:flex}.job-approval p{margin:6px 0 10px;font-size:16px;line-height:1.5}.job-approval-buttons{flex-wrap:wrap;gap:8px;display:flex}.job-run-foot{color:var(--secondary);border-top:1px solid #3c2b2d;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:12px;padding-top:10px;font-size:16px;display:flex}.job-run-foot span{flex:1;min-width:220px}.job-def{background:#241819;border:1px solid #453536;border-radius:8px;margin-top:12px;padding:13px}.job-def-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.job-def-head svg{color:var(--accent)}.job-def-head strong{margin-right:auto;font-size:16px}.job-def p{margin:8px 0;font-size:16px;line-height:1.5}.job-chain{flex-wrap:wrap;gap:6px 4px;margin:8px 0;padding:0;list-style:none;display:flex}.job-chain li{border:1px solid #4a3638;border-radius:999px;align-items:center;gap:5px;padding:3px 9px 3px 3px;font-size:16px;display:inline-flex}.job-chain li span{width:20px;height:20px;font-family:var(--font-mono);background:#3a2a2c;border-radius:50%;place-items:center;font-size:14px;display:grid}.job-chain li:not(:last-child):after{content:"→";color:#8d6a6d;margin-left:4px}.job-def-meta{flex-wrap:wrap;gap:6px;display:flex}.job-def-meta code{font-family:var(--font-mono);color:var(--secondary);overflow-wrap:anywhere;font-size:16px}.job-def-last{flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:10px;font-size:16px;display:flex}.job-def-last .text-button{margin-top:0}.job-def-run{margin-top:12px}.task-tree{gap:4px;margin:0 0 12px;padding:0;list-style:none;display:grid}.task-row{margin-left:calc(var(--depth) * 18px);background:#211617;border:1px solid #3c2b2d;border-left:3px solid #5a3a3e;border-radius:6px;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:7px 10px;font-size:16px;display:flex}.task-row[data-task-kind=pi\.tool]{border-left-color:var(--accent)}.task-row[data-task-kind^="demo.job."]{border-left-color:var(--warn)}.task-row small{width:100%;font-family:var(--font-mono);color:var(--secondary);font-size:16px}.task-row .text-button{margin-top:0}.task-phase{font-family:var(--font-mono);color:var(--secondary)}.context-section{margin-top:18px}.context-numbers{flex-wrap:wrap;align-items:baseline;gap:6px 8px;font-size:16px;display:flex}.context-numbers strong{font-family:var(--font-title);font-size:22px}.context-pct{font-family:var(--font-mono);color:var(--secondary)}.context-compacting{color:var(--warn);align-items:center;gap:6px;margin-left:auto;display:inline-flex}.context-compacting i{background:currentColor;border-radius:50%;width:7px;height:7px;animation:1.2s infinite pulse}.context-bar{touch-action:none;background:#2d2122;border:1px solid #453536;border-radius:7px;height:14px;margin:40px 0 44px;position:relative}.context-bar.off .context-marker{opacity:.45}.context-fill{background:linear-gradient(90deg, #8a3a45, var(--accent));border-radius:7px 0 0 7px;transition:width .3s;position:absolute;inset:0 auto 0 0}.context-fill.hot{background:linear-gradient(90deg, #8a3a45, var(--warn))}.context-reserve{background:repeating-linear-gradient(135deg,#ffffff10 0 5px,#0000 5px 10px);border-left:1px solid #8d6a6d;border-radius:0 7px 7px 0;position:absolute;top:0;bottom:0;right:0}.context-marker{background:var(--warn);cursor:ew-resize;touch-action:none;border-radius:2px;width:4px;height:26px;margin-left:-2px;padding:0;position:absolute;top:-7px}.context-marker:before{content:"";position:absolute;inset:-4px -10px}.context-marker.wait{background:var(--fg)}.context-marker-label{white-space:nowrap;font-size:16px;font-family:var(--font-mono);color:var(--warn);pointer-events:none;position:absolute;left:50%;transform:translate(-50%)}.context-marker.auto .context-marker-label{bottom:calc(100% + 4px)}.context-marker.wait .context-marker-label{color:var(--fg);top:calc(100% + 4px)}.context-marker.label-start .context-marker-label{left:-2px;transform:none}.context-marker.label-end .context-marker-label{left:auto;right:-2px;transform:none}.context-hint{margin:0 0 10px}.context-details-toggle{color:var(--warn);letter-spacing:0;align-items:center;gap:4px;padding:0;font-size:16px;display:inline-flex}.compaction-modal p{margin:0 0 12px;font-size:16px;line-height:1.6}.modal .context-toggle{flex-direction:row;align-items:center;gap:8px;margin-top:6px}.modal .context-toggle input{width:auto;padding:0}.context-toggle{flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:16px;display:flex}.context-toggle small{width:100%;color:var(--secondary);font-size:16px}.ext-card{background:#241819;border:1px solid #453536;border-left:3px solid #5a3a3e;border-radius:8px;margin-top:12px;padding:13px 14px}.ext-card.on{border-left-color:var(--ok)}.ext-head{align-items:center;gap:12px;display:flex}.ext-head>div{flex-wrap:wrap;align-items:baseline;gap:4px 10px;min-width:0;display:flex}.ext-head strong{font-size:16px}.ext-head code{font-family:var(--font-mono);color:var(--secondary);font-size:16px}.ext-card>p{margin:8px 0 0;font-size:16px;line-height:1.5}.ext-prompts{border-top:1px solid #3c2b2d;gap:10px;margin:12px 0 0;padding:10px 0 0;list-style:none;display:grid}.ext-prompts.off{opacity:.6}.ext-prompts li{gap:4px;font-size:16px;display:grid}.ext-prompts label{cursor:pointer;align-items:center;gap:8px;display:flex}.ext-prompts code{font-family:var(--font-mono);font-size:16px}.ext-prompts li>span{color:var(--secondary);padding-left:26px;line-height:1.45}.ext-prompts details{padding-left:26px}.ext-prompts summary{cursor:pointer;color:var(--accent)}.ext-prompts pre{white-space:pre-wrap;background:#180f10;border-radius:6px;max-height:260px;margin:6px 0 0;padding:9px;font-size:16px;overflow:auto}.tool-row.disabled summary>strong,.tool-row.disabled summary>svg,.tool-row.disabled>p,.tool-row.disabled>pre,.tool-row.disabled>small{opacity:.45}.tool-row summary .tag.tool-disabled{color:var(--warn);border-color:#6b5a24;margin-left:2px;margin-right:auto}.tool-row summary .tag.tool-disabled+.tag{margin-left:auto}
|
|
1
|
+
@import "https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;450;500;550;600;650;700&family=Manrope:wght@400;500;600;650;700;750;800&family=IBM+Plex+Mono:wght@400;500&display=swap";.git-chip-wrap[data-v-c0fb9e98]{align-items:center;display:inline-flex;position:relative}.git-chip[data-v-c0fb9e98]{gap:4px}.git-chip .branch[data-v-c0fb9e98]{text-overflow:ellipsis;white-space:nowrap;max-width:14ch;overflow:hidden}.dirty[data-v-c0fb9e98]{color:var(--warn,#e5a50a)}.ahead[data-v-c0fb9e98]{color:var(--ok,#2ea043)}.behind[data-v-c0fb9e98]{color:var(--info,#58a6ff)}.tunnel-status{flex-wrap:wrap;align-items:center;gap:.5rem;font-size:.75rem;display:inline-flex}.tunnel-status .axis{border:1px solid var(--border,#333);border-radius:999px;align-items:center;gap:.25rem;padding:.1rem .5rem;display:inline-flex}.tunnel-status .axis.transport{color:var(--fg,#eee)}.tunnel-status .axis.monitor.offline{color:var(--muted,#888)}.tunnel-status .axis.monitor.unauthorized,.tunnel-status .axis.monitor.mismatch,.tunnel-status .axis.monitor.incompatible{color:var(--warn,#e0b040)}.tunnel-status .axis.monitor.online{color:var(--ok,#6cc070)}.tunnel-status .axis.muted{color:var(--muted,#888);border-style:dashed}.tunnel-status .axis.url{color:var(--accent,#7ab8ff);text-decoration:none}.tunnel-status .live{color:var(--ok,#6cc070)}.token-manager{border:1px solid var(--border,#333);border-radius:8px;flex-direction:column;gap:.5rem;padding:.6rem .8rem;font-size:.8rem;display:flex}.token-manager header{align-items:center;gap:.4rem;display:flex}.token-manager h3{text-transform:uppercase;letter-spacing:.08em;margin:0;font-size:.8rem}.token-manager .pairing-status{border:1px solid var(--border,#333);border-radius:999px;margin-left:auto;padding:.05rem .5rem;font-size:.7rem}.token-manager .pairing-status.paired{color:var(--ok,#6cc070)}.token-manager .pairing-status.revoked{color:var(--warn,#e0b040)}.token-manager dl{grid-template-columns:auto 1fr;gap:.15rem .8rem;margin:0;display:grid}.token-manager dt{color:var(--muted,#888)}.token-manager dd{text-overflow:ellipsis;min-width:0;margin:0;overflow:hidden}.token-manager .credential-fingerprint{white-space:normal;overflow-wrap:anywhere}.token-manager .rotation-badge{color:var(--warn,#e0b040);align-items:center;gap:.35rem;margin:0;font-size:.75rem;display:flex}.token-manager .token-actions{flex-wrap:wrap;gap:.5rem;display:flex}.token-manager .spin{animation:1.2s linear infinite tm-spin}@keyframes tm-spin{to{transform:rotate(360deg)}}.git-pane[data-v-b3561e54]{gap:4px;display:grid}.git-top[data-v-b3561e54]{flex-wrap:wrap;gap:8px}.branch-wrap[data-v-b3561e54]{position:relative}.branch-btn[data-v-b3561e54]{border:1px solid var(--line);border-radius:6px;align-items:center;gap:7px;padding:6px 12px;display:inline-flex}.branch-btn strong[data-v-b3561e54]{font-size:16px}.menu[data-v-b3561e54]{z-index:40;background:var(--bg-2,#221a1c);border:1px solid var(--line);border-radius:8px;min-width:300px;max-height:280px;padding:4px;position:absolute;top:calc(100% + 6px);left:0;overflow:auto;box-shadow:0 10px 30px #00000080}.menu button[data-v-b3561e54]{text-align:left;border-radius:6px;align-items:center;gap:10px;width:100%;padding:7px 10px;font-size:15px;display:flex}.menu button[data-v-b3561e54]:hover,.menu button.cur[data-v-b3561e54]{background:#403536}.menu .new-branch[data-v-b3561e54]{border-top:1px solid var(--line);gap:6px;padding:8px;display:flex}.menu .new-branch input[data-v-b3561e54]{flex:1;min-width:0}.auto-stash[data-v-b3561e54]{opacity:.85;align-items:center;gap:8px;padding:8px 10px;font-size:14px;display:flex}.muted-line[data-v-b3561e54]{opacity:.65;font-size:13px}.cap[data-v-b3561e54]{padding:4px 0}.row[data-v-b3561e54]{flex-wrap:wrap;align-items:center;gap:6px;margin:8px 0;display:flex}.hintbox[data-v-b3561e54]{border-radius:6px;flex-wrap:wrap;align-items:center;gap:10px;margin:4px 0;padding:6px 10px;display:flex}.hintbox.warn[data-v-b3561e54]{border:1px solid var(--warn,#e5a50a);color:var(--warn,#e5a50a)}.merge-banner[data-v-b3561e54]{border-radius:6px;padding:8px 10px}.files.conflicts[data-v-b3561e54]{border-color:var(--warn,#e5a50a)}.conflict-head[data-v-b3561e54]{color:var(--warn,#e5a50a)}.files[data-v-b3561e54]{border:1px solid var(--line);border-radius:8px;max-height:260px;padding:4px 10px;overflow:auto}.file[data-v-b3561e54]{justify-content:space-between;align-items:center;gap:6px;padding:3px 0;display:flex}.file.all[data-v-b3561e54]{border-bottom:1px solid var(--line)}.file-label[data-v-b3561e54]{cursor:pointer;flex:1;align-items:center;gap:8px;min-width:0;display:flex}.file .path[data-v-b3561e54]{text-overflow:ellipsis;white-space:nowrap;font-size:14px;overflow:hidden}.file .xy[data-v-b3561e54]{opacity:.7;font-size:12px}.nums[data-v-b3561e54]{opacity:.8;color:var(--ok,#2ea043);white-space:nowrap;font-size:11px}.nums.bin[data-v-b3561e54]{color:var(--warn,#e5a50a)}.dir-row[data-v-b3561e54]{opacity:.8;align-items:center;gap:6px;width:100%;padding:3px 0;font-size:13px;display:flex}.dir-row .open[data-v-b3561e54]{transform:rotate(90deg)}.file-acts[data-v-b3561e54]{gap:2px;display:flex}.file-diff[data-v-b3561e54]{border:1px solid var(--line);border-radius:8px;flex-wrap:wrap;align-items:center;gap:8px;margin:8px 0;padding:8px 10px;display:flex}.file-diff pre[data-v-b3561e54]{width:100%;max-height:260px;margin:6px 0 0;font-size:12px;overflow:auto}.mode-chips[data-v-b3561e54]{gap:2px;display:inline-flex}.mode-chips button[data-v-b3561e54]{border:1px solid var(--line);border-radius:10px;padding:2px 8px;font-size:12px}.mode-chips button.on[data-v-b3561e54]{background:#403536}textarea[data-v-b3561e54]{resize:vertical;width:100%;min-height:76px;font:inherit;margin-top:8px}.commits[data-v-b3561e54]{gap:3px;max-height:340px;display:grid;overflow:auto}.commit-row[data-v-b3561e54]{white-space:nowrap;align-items:center;gap:8px;display:flex}.commit-row .lane[data-v-b3561e54]{flex-shrink:0}.commit-row .hash[data-v-b3561e54]{color:var(--ok,#2ea043);font-size:13px}.hash-btn svg[data-v-b3561e54]{transition:transform .1s}.hash-btn svg.open[data-v-b3561e54]{transform:rotate(90deg)}.commit-row .refs[data-v-b3561e54]{color:var(--warn,#e5a50a);text-overflow:ellipsis;max-width:18ch;font-size:12px;overflow:hidden}.commit-row .subject[data-v-b3561e54]{text-overflow:ellipsis;max-width:40%;font-size:14px;overflow:hidden}.commit-row .who[data-v-b3561e54]{font-size:12px}.commit-files[data-v-b3561e54]{border-left:2px solid var(--line);margin-left:16px;padding:2px 0 6px 34px}.cf[data-v-b3561e54]{gap:10px;padding:1px 0;font-size:13px;display:flex}.cf-status[data-v-b3561e54]{opacity:.8;width:2ch;font-size:11px}.cps[data-v-b3561e54]{border:1px solid var(--line);border-radius:8px;margin-bottom:6px;padding:4px 10px}.cp-row[data-v-b3561e54]{align-items:center;gap:10px;padding:2px 0;font-size:14px;display:flex}.cp-row code[data-v-b3561e54]{color:var(--warn,#e5a50a)}.cp-subj[data-v-b3561e54]{text-overflow:ellipsis;white-space:nowrap;max-width:40%;overflow:hidden}.wt[data-v-b3561e54]{align-items:center;gap:8px;padding:2px 0;display:flex}.wt code[data-v-b3561e54]{text-overflow:ellipsis;white-space:nowrap;max-width:40%;font-size:13px;overflow:hidden}.wt.main code[data-v-b3561e54]{font-weight:650}.grow[data-v-b3561e54]{flex:1}.tag-x[data-v-b3561e54]{opacity:.7;margin-left:4px;display:inline-flex}.pr-row[data-v-b3561e54]{white-space:nowrap;align-items:center;gap:8px;padding:2px 0;display:flex}.pr-row .tag.open[data-v-b3561e54]{color:var(--ok,#2ea043)}.pr-checks[data-v-b3561e54]{white-space:pre-wrap;background:#00000040;border-radius:6px;margin:4px 0;padding:8px;font-size:12px}.turns[data-v-b3561e54]{max-height:180px;overflow:auto}.modal-veil[data-v-b3561e54]{z-index:90;background:#0000008c;justify-content:center;align-items:center;display:flex;position:fixed;inset:0}.modal[data-v-b3561e54]{background:var(--bg-2,#221a1c);border:1px solid var(--line);border-radius:10px;min-width:340px;max-width:520px;padding:16px 18px}.modal.danger[data-v-b3561e54]{border-color:var(--warn,#e5a50a)}.modal h5[data-v-b3561e54]{margin:0 0 6px;font-size:17px}.modal p[data-v-b3561e54]{margin:0 0 10px;font-size:15px}.modal textarea[data-v-b3561e54]{min-height:56px}.modal .danger[data-v-b3561e54]{border-color:var(--warn,#e5a50a)}.op-out[data-v-b3561e54]{background:#00000040;border-radius:6px;max-height:300px;margin-top:8px;padding:10px;font-size:12px;overflow:auto}h4[data-v-b3561e54]{align-items:center;gap:8px;margin:0;font-size:16px;display:flex}.device-handoff[data-v-01884b7b]{border:1px solid var(--border);background:var(--panel);border-radius:12px;margin-bottom:14px;padding:14px 16px}header[data-v-01884b7b]{align-items:center;gap:8px;margin-bottom:6px;font-weight:650;display:flex}h3[data-v-01884b7b]{margin:0;font-size:14.5px}.what[data-v-01884b7b]{color:var(--muted);margin:0 0 10px;font-size:13px}code[data-v-01884b7b]{font-family:ui-monospace,monospace;font-size:12px}.row[data-v-01884b7b]{flex-wrap:wrap;align-items:end;gap:8px;display:flex}label[data-v-01884b7b]{color:var(--muted);gap:4px;font-size:12px;display:grid}input[data-v-01884b7b]{border:1px solid var(--border);background:var(--panel);width:90px;color:inherit;font:inherit;border-radius:8px;padding:7px 9px}.err[data-v-01884b7b]{color:var(--danger,#f28b82);margin:8px 0 0;font-size:12.5px}.target[data-v-01884b7b]{color:var(--muted);word-break:break-all;margin:10px 0 0;font-family:ui-monospace,monospace;font-size:12px}.pair-wizard .pair-steps{color:var(--muted,#888);gap:.5rem;margin:.25rem 0 .75rem;padding:0;font-size:.78rem;list-style:none;display:flex}.pair-wizard .pair-steps li{border:1px solid #0000;border-radius:999px;padding:.15rem .6rem}.pair-wizard .pair-steps li.on{color:var(--fg,#eee);border-color:currentColor}.pair-wizard .pair-grid{grid-template-columns:auto 1fr;align-items:start;gap:1rem;display:grid}.pair-wizard .pair-code{letter-spacing:.18em;font-size:1.7rem;font-family:var(--mono,monospace);margin-bottom:.35rem}.pair-wizard .pair-copy-actions{flex-wrap:wrap;gap:.4rem;display:flex}.pair-wizard .pair-qr svg{border:1px solid var(--border,#333);border-radius:6px}.pair-wizard .pair-side{flex-direction:column;gap:.6rem;min-width:0;display:flex}.pair-wizard .fp{word-break:break-all;background:var(--bg2,#222);border-radius:6px;padding:.4rem;font-size:.78rem;display:block}.pair-wizard .pair-confirm{align-items:center;gap:.45rem;font-size:.85rem;display:flex}.pair-wizard .pair-confirm.warn{color:var(--warn,#e0b040)}.pair-wizard .spin{animation:1.2s linear infinite pair-spin}@keyframes pair-spin{to{transform:rotate(360deg)}}.pair-pending{border:1px solid #2a3442;border-radius:12px;margin:0 0 18px;padding:14px 16px}.pair-pending h3{margin:0 0 10px;font-size:14px}.pair-pending ul{gap:10px;margin:0;padding:0;list-style:none;display:grid}.pair-pending li{border-bottom:1px solid #222b36;gap:4px;padding-bottom:10px;display:grid}.pair-pending li:last-child{border-bottom:0;padding-bottom:0}.pair-pending .who{flex-wrap:wrap;align-items:baseline;gap:8px;display:flex}.pair-pending .fp{word-break:break-all;color:#7ee2a8;font-family:ui-monospace,monospace;font-size:12px}.pair-pending .row{justify-content:space-between;align-items:center;gap:10px;display:flex}.pair-pending .phase{color:#8fa0b5;font-size:12px}:root{font-family:var(--font-body);color:var(--fg);background:var(--bg);font-synthesis:none;--bg:#151010;--tree:#181213;--chat:#161011;--panel:#1c1516;--card:#251a1b;--line-soft:#2a2021;--fg:#f2eeee;--faint:#8d7778;--primary:#b9283c;--primary-line:#df5363;--primary-hover:#cf354a;--on-primary:#fff;--ok:#6fcf97;--warn:#f2c94c;--err:#ff6b6b;--offline:#5a4a4b;--font-body:"DM Sans", "Segoe UI", sans-serif;--font-display:"Manrope", "Segoe UI", sans-serif;--font-mono:"IBM Plex Mono", ui-monospace, Menlo, monospace;--topbar-h:65px;--tree-w:300px;--insp-w:450px;--radius:10px;--radius-sm:6px;--ease:cubic-bezier(.2, .7, .3, 1);--secondary:#c9a87c;--muted:var(--secondary);--line:#332829;--accent:#ff8997;--surface:#1e1718;--font-title:var(--font-display);font-size:16px}*{box-sizing:border-box}body{margin:0}button,input,textarea,select{font:inherit}button{cursor:pointer}button,a,input,textarea,select{-webkit-tap-highlight-color:transparent}button{color:inherit;background:0 0;border:0;justify-content:center;align-items:center;gap:7px;display:inline-flex}button:disabled{opacity:.8;cursor:not-allowed}button:not(:disabled):hover{filter:brightness(1.13)}button:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}input,textarea,select{color:inherit;background:var(--chat);border:1px solid var(--line);border-radius:7px;outline:none;min-width:0;padding:10px 12px}input::placeholder,textarea::placeholder{color:var(--fg)}textarea{resize:vertical;line-height:1.6}select{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;cursor:pointer}h1,h2,h3,p{margin:0}h1,h2,h3{font-family:var(--font-title)}h2{font-size:16px;font-weight:650}pre,code{font-family:var(--font-mono)}pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.7}small{font-size:16px}svg{flex-shrink:0}.shell{flex-direction:column;height:100dvh;display:flex;overflow:hidden}.topbar{height:var(--topbar-h);min-height:var(--topbar-h);border-bottom:1px solid var(--line);background:var(--panel);z-index:10;justify-content:space-between;align-items:center;padding:0 26px 0 17px;display:flex}.brand,.top-actions{align-items:center;gap:14px;display:flex}.brand strong{letter-spacing:-.5px;font-size:16px;font-family:var(--font-title);font-weight:750}.brandmark{flex-shrink:0;width:45px;height:25px;margin-left:3px;display:block}.brand-separator{color:var(--fg);margin:0 2px;font-weight:400}.muted{color:var(--muted)}.icon-button{width:29px;height:29px;color:var(--muted);border-radius:5px;padding:4px}.icon-button:hover{color:var(--fg);background:#ffffff08}.primary{background:var(--accent);color:var(--fg);border:1px solid var(--accent);white-space:nowrap;border-radius:7px;padding:12px 18px;font-weight:650;box-shadow:0 1px 2px #0002}.primary.small{padding:8px 12px;font-size:16px}.secondary{background:#2b2021;border:1px solid #443738;border-radius:6px;padding:8px 12px;font-size:16px;font-weight:500}.connection{color:var(--muted);align-items:center;gap:7px;font-size:16px;display:flex}.connection i,.live-dot{background:#756062;border-radius:100%;flex-shrink:0;width:5px;height:5px;display:inline-block}.connection .online,.live-dot{background:var(--accent);box-shadow:0 0 7px #cdadb018}.version{font-family:var(--font-mono);color:var(--fg);border:1px solid #3b3031;border-radius:4px;padding:4px 6px;font-size:16px}.workspace{flex:1;grid-template-columns:minmax(340px,34%) minmax(0,1fr);min-height:0;display:grid}.inspector{border-right:1px solid var(--line);background:var(--panel);flex-direction:column;min-height:0;display:flex}.session-heading{padding:25px 26px 21px}.eyebrow{letter-spacing:1.8px;color:var(--fg);font-size:16px;font-weight:600}.session-heading h1{color:var(--fg);letter-spacing:-.7px;overflow-wrap:anywhere;justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px;font-size:16px;font-weight:650;display:flex}.path{font-family:var(--font-mono);color:var(--fg);overflow-wrap:anywhere;align-items:center;gap:7px;font-size:16px;display:flex}.session-status{align-items:center;gap:9px;margin-top:19px;display:flex}.status-pill{color:var(--fg);background:#352728;border-radius:4px;align-items:center;gap:6px;padding:4px 8px;font-size:16px;line-height:1.3;display:flex}.status-pill i{background:currentColor;border-radius:50%;width:4px;height:4px}.status-pill.working{color:var(--accent);background:#412b2d}.working i{animation:1.5s infinite pulse}.saved{color:var(--fg);align-items:center;gap:5px;margin-left:auto;font-size:16px;display:flex}.background-pill{color:var(--fg);font-size:16px}.model-section{border-top:1px solid var(--line);padding:18px 26px 22px}.section-label{letter-spacing:1.3px;color:var(--fg);justify-content:space-between;margin-bottom:13px;font-size:16px;display:flex}.section-label span+span{letter-spacing:0;color:var(--fg)}.model-button{text-align:left;background:#251c1d;border:1px solid #423435;border-radius:8px;width:100%;padding:11px 13px}.model-button img,.model-list img{object-fit:contain;background:#f0e8e9;border-radius:6px;width:29px;height:29px;padding:3px}.model-button>div{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}.model-button strong{text-overflow:ellipsis;white-space:nowrap;font-size:16px;overflow:hidden}.model-button small{color:var(--muted);font-size:16px}.thinking-row{color:var(--fg);justify-content:space-between;align-items:center;margin-top:10px;font-size:16px;display:flex}.thinking-row select{color:var(--fg);background:0 0;border:0;padding:4px 2px;font-size:16px}.metrics{grid-template-columns:1fr 1.3fr .5fr;margin-top:21px;display:grid}.metrics>div{flex-direction:column;gap:5px;display:flex}.metrics span{font-family:var(--font-title);letter-spacing:-.5px;font-size:19px;font-weight:500}.metrics small{color:var(--fg);font-size:16px}.stats-section{margin-top:24px}.stats-section .metrics{margin-top:14px}.usage-breakdown{border-collapse:collapse;font-variant-numeric:tabular-nums;width:100%;margin-top:22px;font-size:16px}.usage-breakdown th,.usage-breakdown td{text-align:right;border-bottom:1px solid var(--line);padding:10px 0;font-weight:400}.usage-breakdown th{color:var(--secondary)}.usage-breakdown th:first-child{text-align:left}.usage-breakdown td{color:var(--fg)}.inspector-tabs{border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--tree);padding:0 16px;display:flex}.inspector-tabs button{color:var(--fg);border-bottom:2px solid #0000;flex:1;gap:6px;padding:15px 3px 13px;font-size:16px}.inspector-tabs button.active{color:var(--accent);border-bottom-color:var(--accent)}.count{background:#462f31;border-radius:4px;padding:1px 4px;font-size:16px}.inspector-body{scrollbar-width:thin;scrollbar-color:var(--line) transparent;flex:1;padding:23px 26px 32px;overflow:auto}.panel-heading{justify-content:space-between;align-items:center;gap:9px;display:flex}.panel-heading svg{color:var(--fg)}.tag{color:var(--fg);white-space:nowrap;background:#302526;border:1px solid #403536;border-radius:4px;padding:3px 5px;font-size:16px}.tag.completed{color:var(--accent)}.tag.waiting,.tag.aborted,.tag.rejected{color:var(--fg)}.hint{color:var(--fg);margin:8px 0 18px;font-size:16px;line-height:1.65}.field-label{letter-spacing:1px;color:var(--fg);margin-bottom:8px;font-size:16px;display:block}.inline-input{background:#181112;border:1px solid #3a2d2e;border-radius:7px;align-items:center;display:flex;overflow:hidden}.inline-input input{width:100%;box-shadow:none;background:0 0;border:0;padding:10px;font-size:16px}.inline-input .icon-button{margin-right:4px}.counter-card{background:#261b1c;border:1px solid #403031;border-radius:8px;justify-content:space-between;align-items:center;margin:16px 0;padding:17px 15px;display:flex}.app-state-json{white-space:pre-wrap;overflow-wrap:anywhere;border:1px solid var(--line);background:#140e10;border-radius:8px;max-height:300px;margin:16px 0 24px;padding:16px;font-size:16px;line-height:1.6;overflow:auto}.state-field{min-width:0}.state-field:not(.state-root){border:1px solid var(--line);border-radius:8px;margin:10px 0;padding:12px}.state-field .state-field{background:#25191c40}.state-field-heading{align-items:center;gap:8px;margin-bottom:12px;display:flex}.state-field-heading strong{overflow-wrap:anywhere;flex:1;min-width:0;font-size:16px}.state-field-heading select{width:auto;max-width:120px;color:var(--secondary);padding:5px}.state-field-heading .icon-button{flex-shrink:0}.state-field textarea,.state-field input{width:100%;min-width:0;font-size:16px}.state-number{align-items:center;gap:8px;display:flex}.state-number input{text-align:center;appearance:textfield}.state-number input::-webkit-inner-spin-button{appearance:none}.state-number input::-webkit-outer-spin-button{appearance:none}.state-number button{flex-shrink:0;padding:10px}.state-boolean{align-items:center;gap:12px;display:flex}.state-boolean>span{color:var(--secondary)}.state-add{flex-wrap:wrap;gap:8px;margin-top:12px;display:flex}.state-add input{flex-basis:100%}.state-add select{flex:1;width:auto}.state-add-button{margin-top:8px}.counter-card .field-label{margin:0;font-size:16px}.counter-card strong{font-family:var(--font-title);color:var(--accent);margin-top:4px;font-size:32px;font-weight:500;line-height:1.1;display:block}.counter-card .secondary{color:var(--fg);background:#392a2b;border-color:#5a3c3f;padding:7px 9px;font-size:16px}.note{color:var(--fg);overflow-wrap:anywhere;align-items:flex-start;gap:8px;margin:0 0 10px;font-size:16px;line-height:1.6;display:flex}.note>span{background:#836669;border-radius:50%;flex-shrink:0;width:4px;height:4px;margin-top:7px}.notes{margin-bottom:14px}.raw{border-top:1px solid var(--line);margin-top:16px;padding-top:12px}.raw summary{cursor:pointer;color:var(--fg);font-family:var(--font-mono);align-items:center;gap:7px;font-size:16px;list-style:none;display:flex}.raw summary:after{content:"+";color:var(--fg);margin-left:auto}.raw[open] summary:after{content:"−"}.raw summary span{color:var(--fg);margin-left:auto;font-size:16px}.raw pre{background:var(--chat);color:var(--fg);border:1px solid #35292a;border-radius:6px;max-height:340px;padding:11px;overflow:auto}.raw textarea{width:100%;font-size:16px}.raw button{margin-top:8px}.section-divider{border-top:1px solid var(--line);margin:25px 0 22px}.demo-action{text-align:left;border-bottom:1px solid #362829;align-items:center;gap:11px;width:100%;padding:12px 0;display:flex}.demo-action>span:nth-child(2){flex-direction:column;flex:1;gap:4px;display:flex}.demo-action strong{font-size:16px;font-weight:500}.demo-action small{color:var(--fg);font-size:16px}.demo-action>svg{color:var(--fg)}.demo-icon{width:32px;height:32px;color:var(--accent);background:#3b292b;border-radius:7px;justify-content:center;align-items:center;display:flex}.demo-icon.lavender{color:var(--fg);background:#3b292b}.job-card{background:#26191a;border:1px solid #453536;border-radius:7px;margin-top:16px;padding:13px}.job-title{justify-content:space-between;align-items:center;gap:5px;display:flex}.job-title strong{font-size:16px;font-weight:500}.progress{background:#403031;border-radius:4px;height:3px;margin:14px 0 8px;overflow:hidden}.progress>div{background:var(--accent);height:100%;transition:width .3s}.job-meta{font-family:var(--font-mono);color:var(--fg);justify-content:space-between;gap:6px;font-size:16px;display:flex}.approval{flex-wrap:wrap;gap:7px;margin-top:15px;display:flex}.approval>span{width:100%;color:var(--fg);margin-bottom:3px;font-size:16px}.approval button{padding:6px 10px;font-size:16px}.text-button{color:var(--accent);margin-top:12px;padding:0;font-size:16px}.danger{color:var(--fg)}.inspector-footer{height:39px;min-height:39px;color:var(--fg);border-top:1px solid #372728;align-items:center;gap:8px;padding:0 22px;font-size:16px;display:flex}.inspector-footer .icon-button{margin-left:auto}.chat-panel{background:var(--chat);flex-direction:column;min-height:0;display:flex;position:relative}.agent-stream-status{border-bottom:1px solid var(--warn);color:var(--warn);flex-wrap:wrap;align-items:center;gap:12px;padding:12px 24px;display:flex}.agent-stream-status>div{overflow-wrap:anywhere;flex:220px;min-width:0}.agent-stream-status p{margin:4px 0 0;font-size:13px}.chat-header{border-bottom:1px solid var(--line);background:#1c1415;justify-content:space-between;align-items:center;min-height:63px;padding:0 25px;display:flex}.conversation-select{color:var(--fg);align-items:center;gap:9px;min-width:0;display:flex}.conversation-select select{box-shadow:none;color:var(--fg);background:0 0;border:0;max-width:230px;padding:8px 3px;font-size:16px}.fork-label{white-space:nowrap;color:var(--fg);align-items:center;gap:3px;font-size:16px;display:flex}.chat-header-actions{align-items:center;gap:8px;display:flex}.relative{position:relative}.dropdown{z-index:20;background:var(--line-soft);border:1px solid #4b3b3c;border-radius:8px;min-width:205px;padding:6px;position:absolute;top:36px;right:0;box-shadow:0 10px 35px #0005}.dropdown button{width:100%;color:var(--fg);border-radius:5px;justify-content:flex-start;padding:10px 9px;font-size:16px;display:flex}.dropdown button:hover{background:#3c2d2e}.chat-scroll{scrollbar-width:thin;scrollbar-color:var(--line) transparent;scroll-behavior:smooth;flex:1;padding:32px clamp(24px,5vw,88px) 20px;overflow:auto}.chat-empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;min-height:100%;padding:30px 0 48px;display:flex}.agent-orb{background:radial-gradient(at top,#492d2f,#281a1b);border:1px solid #503a3c;border-radius:17px;justify-content:center;align-items:center;width:58px;height:58px;margin-bottom:26px;display:flex;position:relative;box-shadow:0 10px 50px #b07d820c}.agent-orb>img{width:45px;height:25px}.agent-orb>i{border:3px solid var(--chat);background:var(--accent);border-radius:50%;width:11px;height:11px;position:absolute;bottom:-1px;right:-2px}.chat-empty .eyebrow{letter-spacing:2.1px;font-size:16px}.chat-empty h2{letter-spacing:-.8px;margin:11px 0;font-size:27px;font-weight:500}.chat-empty p{color:var(--fg);font-size:16px;line-height:1.7}.starter-grid{grid-template-columns:1fr 1fr;gap:13px;width:100%;max-width:470px;margin-top:34px;display:grid}.starter-grid button{text-align:left;background:var(--tree);border:1px solid #3c2c2d;border-radius:8px;flex-direction:column;align-items:flex-start;gap:6px;padding:18px;display:flex;position:relative}.starter-grid button>svg:first-child{color:var(--fg);margin-bottom:13px}.starter-grid strong{font-size:16px;font-weight:500}.starter-grid span{color:var(--fg);font-size:16px}.starter-grid button>svg:last-child{color:var(--fg);position:absolute;top:16px;right:13px}.composer-region{background:linear-gradient(transparent, var(--chat) 15%);padding:18px clamp(20px,3vw,46px) 16px}.composer{background:#281c1d;border:1px solid #513d3f;border-radius:11px;box-shadow:0 6px 30px #0002}.composer textarea{resize:none;width:100%;min-height:80px;max-height:220px;box-shadow:none;background:0 0;border:0;padding:18px 20px 9px;font-size:16px;display:block}.composer-toolbar{justify-content:space-between;align-items:center;gap:7px;padding:9px 11px 12px 17px;display:flex}.composer-left,.composer-right{align-items:center;gap:12px;display:flex}.context-indicator{color:var(--fg);align-items:center;gap:5px;font-size:16px;display:flex}.composer-left select{color:var(--fg);background:0 0;border:0;padding:4px;font-size:16px}.interrupt{color:var(--fg);background:#452b2d24;border:1px solid #66414460;border-radius:5px;padding:6px 8px;font-size:16px}.send{background:var(--accent);width:33px;height:33px;color:var(--fg);border-radius:7px}.composer-footnote{color:var(--fg);justify-content:space-between;align-items:center;gap:12px;margin-top:11px;font-size:16px;display:flex}.composer-footnote>span:first-child{align-items:center;gap:6px;display:flex}.composer-footnote .live-dot{width:4px;height:4px}.entry{margin-bottom:26px;position:relative}.message-label{color:var(--fg);letter-spacing:1.3px;align-items:center;gap:8px;margin-bottom:10px;font-size:16px;display:flex}.message-label>span:not(.mini-pi):not(.streaming){font-family:var(--font-mono);letter-spacing:0;color:var(--fg);font-size:16px}.user-message{white-space:pre-wrap;color:var(--fg);font-size:16px;line-height:1.8}.pi-user{border-bottom:1px solid #392628;padding-bottom:20px}.mini-pi{flex-shrink:0;width:36px;height:20px}.markdown{color:var(--fg);overflow-wrap:anywhere;font-size:16px;line-height:1.85}.markdown p{margin:0 0 14px}.markdown p:last-child{margin-bottom:0}.markdown h1,.markdown h2,.markdown h3{color:var(--fg);margin:22px 0 12px;font-size:16px}.markdown ul,.markdown ol{margin:12px 0;padding-left:23px}.markdown li{margin:6px 0}.markdown strong{color:var(--fg);font-weight:600}.markdown code{color:var(--fg);background:#3a2628;border-radius:4px;padding:2px 5px;font-size:16px}.markdown pre{white-space:pre;background:#251819;border:1px solid #3d2b2d;border-radius:7px;margin:14px 0;padding:16px;overflow:auto}.markdown pre code{background:0 0;padding:0}.markdown a{color:var(--accent)}.markdown table{border-collapse:collapse;width:100%}.markdown td,.markdown th{border:1px solid var(--line);text-align:left;padding:8px}.fork-button{color:var(--fg);letter-spacing:0;opacity:1;white-space:nowrap;margin-left:auto;padding:3px 5px;font-size:16px;display:inline-flex}.entry:hover .fork-button,.fork-button:focus-visible{opacity:1}.event-line{color:var(--fg);align-items:center;gap:7px;padding:8px 0;font-size:16px;display:flex}.event-line>span{flex:1}.pi-tool-result{margin-top:-17px;margin-bottom:20px}.tool-call,.tool-result{color:var(--fg);background:#251819;border:1px solid #453032;border-radius:6px;margin:10px 0;font-size:16px;overflow:hidden}.tool-call summary,.tool-result summary{cursor:pointer;align-items:center;gap:9px;padding:10px 12px;list-style:none;display:flex}.tool-call summary:after,.tool-result summary:after{content:"⌄";color:var(--fg);margin-left:auto}.tool-call summary code{white-space:nowrap;text-overflow:ellipsis;color:var(--fg);font-size:16px;overflow:hidden}.tool-call pre,.tool-result pre{color:var(--fg);border-top:1px solid #412b2d;max-height:340px;margin:0;padding:11px;overflow:auto}.tool-result{background:#201415;border-color:#3b2b2c}.tool-result summary>span{color:var(--fg);font-size:16px}.tool-result.failed{color:var(--fg);border-color:#673f43}.tool-call.failed{border-color:#a44c58}.tool-status{color:var(--secondary);margin-left:auto}.tool-section-label{color:var(--secondary);border-top:1px solid #412b2d;align-items:center;gap:12px;padding:10px 12px;display:flex}.tool-section-label .fork-button{margin-left:auto}.thinking{color:var(--fg);margin:8px 0 16px;font-size:16px}.thinking summary{cursor:pointer}.thinking div{white-space:pre-wrap;color:var(--fg);border-left:1px solid #5a3a3d;margin-top:12px;padding-left:12px;font-size:16px;line-height:1.8}.message-error{color:var(--fg);overflow-wrap:anywhere;background:#39232550;border:1px solid #6b4245;border-radius:6px;margin-top:10px;padding:10px;font-size:16px;line-height:1.7}.streaming{letter-spacing:0;color:var(--accent);margin-left:auto;font-size:16px}.typing{gap:5px;padding:12px 0;display:flex}.typing i{background:#af7c81;border-radius:50%;width:5px;height:5px;animation:1.2s infinite pulse}.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}.live-tool{background:#2c1d1e;border:1px solid #624346;border-radius:6px;margin:10px 0;padding:11px}.live-tool>div{color:var(--fg);align-items:center;gap:8px;font-size:16px;display:flex}.live-tool>div>span{color:var(--fg);margin-left:auto;font-size:16px}.live-tool pre{max-height:150px;color:var(--fg);overflow:auto}.queue{background:#2e1f20;border:1px solid #4a3537;border-radius:7px;margin-bottom:10px;padding:5px 10px}.queue>div{color:var(--fg);align-items:center;gap:7px;font-size:16px;display:flex}.queue span{white-space:nowrap;text-overflow:ellipsis;flex:1;overflow:hidden}.history-banner{color:var(--fg);background:#33292a33;align-items:center;gap:7px;padding:8px 26px;font-size:16px;display:flex}.empty-panel{color:var(--fg);flex-direction:column;align-items:center;gap:12px;padding:30px 0;font-size:16px;display:flex}.empty-panel strong{color:var(--fg);font-weight:500}.task-card{background:#2a1b1c;border:1px solid #4d3537;border-radius:7px;margin:10px 0;padding:13px}.task-card.child{border-left:2px solid #84595d;margin-left:14px}.task-card>div:first-child{justify-content:space-between;align-items:center;gap:6px;display:flex}.task-card strong{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:16px;font-weight:400}.task-card p{color:var(--fg);margin:8px 0 11px;font-size:16px}.hook-card{background:#2a2525;border:1px solid #483c3d;border-radius:7px;margin-bottom:20px;padding:14px}.hook-card>div{color:var(--fg);align-items:center;gap:8px;display:flex}.hook-card strong{font-size:16px;font-weight:500}.hook-card p{color:var(--fg);margin-top:10px;font-size:16px;line-height:1.6}.switch{background:#544b4c;border-radius:12px;justify-content:flex-start;width:29px;height:17px;margin-left:auto;padding:2px}.switch>span{background:#dbcccd;border-radius:50%;width:13px;height:13px}.switch.on{background:var(--primary);justify-content:flex-end}.tool-row{border-bottom:1px solid #3a2a2b;padding:12px 0}.tool-row summary{cursor:pointer;color:var(--fg);align-items:center;gap:7px;list-style:none;display:flex}.tool-row strong{font-family:var(--font-mono);font-size:16px;font-weight:500}.tool-row .tag{margin-left:auto;font-size:16px}.tool-row p{color:var(--fg);white-space:pre-wrap;margin:12px 0;font-size:16px;line-height:1.75}.tool-row small{color:var(--fg);line-height:1.6}.tool-signature{border:1px solid var(--line);font-family:var(--font-mono);white-space:pre-wrap;overflow-wrap:anywhere;color:var(--fg);background:#120d0e;border-radius:8px;margin:0 0 12px;padding:12px 14px;font-size:14px;line-height:1.6}.tk-keyword{color:var(--accent)}.tk-function{color:#ffd38a}.tk-property{color:#9ed8cf}.tk-type{color:#8fb6ff}.tk-string{color:#e6b98f}.tk-number{color:#d4a5ff}.tk-comment{color:var(--faint);font-style:italic}.tk-punct{color:#b8a6a7}.prompt-chip{width:100%;color:var(--fg);text-align:left;border-bottom:1px solid var(--line);justify-content:space-between;padding:14px 0;font-size:16px;display:flex}.drawer-backdrop{z-index:40;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);background:#0007;position:fixed;inset:65px 0 0}.sessions-drawer{background:var(--card);border-right:1px solid #513d3f;flex-direction:column;width:326px;max-width:90vw;height:100%;padding:24px 18px;display:flex;box-shadow:20px 0 70px #0004}.sessions-drawer header{justify-content:space-between;align-items:center;margin-bottom:22px;padding:0 7px;display:flex}.sessions-drawer h2{font-size:17px;font-weight:550}.sessions-drawer h2 span{color:var(--fg);margin-left:6px;font-size:16px}.sessions-drawer>.primary{margin:0 6px 22px}.session-list{flex:1;overflow:auto}.session-item{text-align:left;border:1px solid #0000;border-radius:7px;flex-direction:column;align-items:stretch;gap:10px;width:100%;margin-bottom:7px;padding:15px;display:flex}.session-item.active{background:#362527;border-color:#5e3e41}.session-item:hover{background:#312324}.session-item strong{justify-content:space-between;align-items:center;font-size:16px;font-weight:550;display:flex}.session-item .path{font-size:16px}.session-model{color:var(--fg);overflow-wrap:anywhere;align-items:center;gap:6px;font-size:16px;display:flex}.session-model img{background:#ecdfe0;border-radius:3px;width:15px;height:15px;padding:1px}.active-dot{background:var(--accent);border-radius:50%;width:5px;height:5px}.sessions-drawer footer{color:var(--fg);align-items:center;gap:8px;padding:18px 8px 0;font-size:16px;display:flex}.modal-backdrop{z-index:80;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);background:#0d0808bd;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.modal{background:var(--panel);border:1px solid var(--line);border-radius:12px;width:460px;max-width:100%;max-height:90dvh;padding:28px;overflow:auto;box-shadow:0 24px 70px #0000008c}.modal header{justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:27px;display:flex}.modal header h2{letter-spacing:-.5px;margin-top:7px;font-size:22px;font-weight:550}.modal label{color:var(--fg);flex-direction:column;gap:9px;margin-top:20px;font-size:16px;display:flex}.modal input,.modal select{width:100%;padding:12px;font-size:16px}.modal small.path{color:var(--fg);margin-top:-1px;font-size:16px;line-height:1.6}.modal footer{justify-content:flex-end;gap:10px;margin-top:26px;display:flex}.model-modal{flex-direction:column;width:500px;display:flex;overflow:hidden}.login-veil{z-index:100;-webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px);background:#0d0808e0;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.login-card{width:400px}.login-card .hint{color:var(--fg);font-size:15px;line-height:1.55}.login-card footer{justify-content:flex-end}.model-list{max-height:50vh;margin-top:12px;overflow:auto}.model-list button{text-align:left;border-radius:6px;justify-content:flex-start;gap:12px;width:100%;padding:12px 10px;display:flex}.model-list button.selected,.model-list button:hover{background:#402b2d}.model-list button>div{flex-direction:column;flex:1;gap:5px;display:flex}.model-list strong{font-size:16px;font-weight:500}.model-list small{color:var(--fg);font-size:16px}.model-modal .hint{margin:14px 0 0}.learning-list{flex-direction:column;gap:23px;padding:0;list-style:none;display:flex}.learning-list li{gap:17px;display:flex}.learning-list li>span{font-family:var(--font-mono);color:var(--fg);border:1px solid #5a383b;border-radius:5px;flex-shrink:0;justify-content:center;align-items:center;width:28px;height:27px;font-size:16px;display:flex}.learning-list strong{color:var(--fg);font-size:16px;font-weight:500}.learning-list p{color:var(--fg);margin-top:5px;font-size:16px;line-height:1.8}.help-modal{width:530px}.toast{z-index:100;background:var(--card);color:var(--on-primary);border:1px solid var(--line);border-radius:999px;align-items:center;gap:10px;max-width:90%;padding:13px 19px;font-size:16px;font-weight:600;line-height:1.5;display:flex;position:fixed;bottom:28px;left:50%;transform:translate(-50%);box-shadow:0 10px 30px #00000073}.toast svg{color:var(--accent);flex-shrink:0}.pi-user .message-label{justify-content:flex-end}.pi-user .user-message{text-align:right}.state-json-actions{flex-wrap:wrap;justify-content:flex-end;gap:10px;margin-bottom:20px;display:flex}.state-json-actions .hint{flex-basis:100%;margin:0}textarea.app-state-json{resize:vertical;width:100%;min-height:280px;max-height:none;font-family:var(--font-mono);color:var(--fg);margin-bottom:10px}.toast-enter-active,.toast-leave-active{transition:opacity .2s}.toast-enter-from,.toast-leave-to{opacity:0}.error-banner{color:var(--fg);z-index:90;background:#462b2d;align-items:center;gap:10px;padding:10px 25px;font-size:16px;display:flex}.error-banner span{flex:1}.welcome{text-align:center;background:radial-gradient(#39232533,#0000 65%);flex-direction:column;flex:1;justify-content:center;align-items:center;padding:35px;display:flex}.welcome-symbol{width:126px;height:70px;margin-bottom:33px;position:relative}.welcome .eyebrow{color:var(--fg);letter-spacing:2.6px;font-size:16px}.welcome h1{letter-spacing:-2.5px;color:var(--fg);margin:20px 0;font-size:clamp(36px,4.6vw,64px);font-weight:500;line-height:1.15}.welcome p{color:var(--fg);margin:4px 0 30px;font-size:16px}.welcome-features{color:var(--fg);gap:33px;margin-top:70px;font-size:16px;display:flex}.welcome-features>span{align-items:center;gap:8px;display:flex}.selected{color:var(--accent)}@keyframes pulse{0%,to{opacity:.45}50%{opacity:1}}@media (width>=1600px){.workspace{grid-template-columns:440px minmax(0,1fr)}.chat-scroll{padding-left:max(70px,50% - 385px);padding-right:max(70px,50% - 385px)}.composer-region{padding-left:max(46px,50% - 415px);padding-right:max(46px,50% - 415px)}}@media (width<=1050px){.workspace{grid-template-columns:330px minmax(0,1fr)}.session-heading,.model-section,.inspector-body{padding-left:20px;padding-right:20px}.chat-empty h2{font-size:23px}.composer-footnote>span:last-child{display:none}.starter-grid{grid-template-columns:1fr;max-width:300px}.starter-grid button{padding:13px}.starter-grid button>svg:first-child{margin-bottom:3px}.topbar{padding-right:16px}}@media (width<=740px){.shell{height:auto;min-height:100dvh;overflow:visible}.topbar{height:58px;min-height:58px;padding:0 12px;position:sticky;top:0}.brand{gap:8px}.brand strong{font-size:16px}.brand-separator,.brand>.muted,.version,.connection{display:none}.top-actions{gap:5px}.workspace{flex-direction:column;display:flex}.inspector{border-right:0;border-bottom:1px solid var(--line);min-height:310px;max-height:55vh}.session-heading{padding:17px 20px 10px}.session-heading h1{margin:5px 0;font-size:19px}.session-heading>.eyebrow,.session-status,.model-section,.inspector-footer{display:none}.inspector-tabs{padding:0 13px}.inspector-tabs button{padding:11px 3px}.inspector-body{min-height:150px;padding:17px 20px}.chat-panel{height:85dvh;min-height:500px}.chat-header{min-height:55px;padding:0 13px}.chat-scroll{padding:24px 22px}.chat-empty h2{font-size:22px}.composer-region{padding:12px}.composer-left{gap:3px}.composer-left .context-indicator{display:none}.composer-right{gap:8px}.modal{padding:22px}.welcome{min-height:90dvh}.welcome-features{flex-direction:column;align-items:center;gap:20px;margin-top:40px}.drawer-backdrop{top:58px}.toast{width:max-content;max-width:90%;font-size:16px;bottom:15px}.fork-label{display:none}}@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}@media (width<=740px){.model-section{padding:9px 20px;display:block}.model-section .section-label,.model-section .thinking-row,.model-section .metrics{display:none}.model-button{padding:7px 10px}.model-button img{width:24px;height:24px}.model-button small{display:none}}.primary,.send{background:var(--primary);border-color:var(--primary-line);color:#fff}.primary:hover,.send:hover{background:var(--primary-hover)}.model-button img,.model-list img{background:#fff;border:1px solid #67575c;flex-shrink:0;width:42px;height:42px;padding:5px}.session-model img{background:#fff;flex-shrink:0;width:32px;height:32px;padding:3px}img[src$=openai\.png]{background:#242024;border-color:#81747a;padding:3px}button:disabled{opacity:1;color:#d4c7ca;background-color:#33272b;border-color:#554249}.icon-button{width:36px;height:36px;color:var(--fg)}.inspector-tabs{padding:0 10px}.inspector-tabs button{min-width:0;padding:15px 7px 13px}.session-heading h1{line-height:1.4}.session-status,.section-label,.panel-heading,.job-title,.job-meta,.composer-footnote,.composer-toolbar{flex-wrap:wrap}.metrics{grid-template-columns:1fr 1.4fr .6fr;gap:12px}.metrics small{line-height:1.5}.model-button{min-height:70px}.model-button small{line-height:1.5}.model-button strong{white-space:normal}.inspector-footer{height:auto;min-height:52px;padding:8px 20px}.counter-card{flex-wrap:wrap;gap:12px}.counter-card .field-label{max-width:180px;line-height:1.5}.raw summary{flex-wrap:wrap;line-height:1.6}.raw summary span{color:var(--fg)}.tool-row summary{flex-wrap:wrap}.tool-row .tag{margin-left:auto}.tool-call summary{flex-wrap:wrap}.tool-call summary code{max-width:100%}.fork-button{opacity:1;color:#ffd3da}.session-item .path{line-height:1.6}.sessions-drawer{width:420px}.modal{width:560px}.model-modal{width:650px}.model-list button{min-height:78px}.model-list small{line-height:1.5}.task-card>div:first-child{flex-wrap:wrap}.composer-footnote{line-height:1.6}.composer-left,.composer-right{flex-wrap:wrap;gap:8px}.send{width:40px;height:40px}.interrupt{min-height:40px}.tag{line-height:1.4}.brand{gap:10px}.welcome-features{flex-wrap:wrap;justify-content:center}@media (width>=741px) and (width<=1599px){.workspace{grid-template-columns:minmax(410px,36%) minmax(0,1fr)}.chat-scroll{padding-left:30px;padding-right:30px}.composer-footnote>span:last-child{display:none}.chat-header{flex-wrap:wrap;gap:10px;padding:10px 18px}}@media (width<=1100px) and (width>=741px){.brand>.muted,.brand-separator,.version{display:none}.starter-grid{grid-template-columns:1fr}.composer-left .context-indicator{display:none}.conversation-select select{max-width:205px}}@media (width<=740px){.inspector{max-height:60vh}.topbar{height:68px;min-height:68px}.top-actions .icon-button{display:none}.brand strong{font-size:16px}.model-button img{width:40px;height:40px}.model-button small{display:block}.model-button{min-height:64px}.inspector-tabs{padding:0 4px}.inspector-tabs button{gap:4px;padding:12px 4px}.inspector-body{padding:18px 16px}.conversation-select{gap:6px;max-width:calc(100% - 94px)}.conversation-select select{width:100%;max-width:180px}.chat-header-actions{gap:0}.chat-header-actions .icon-button{width:30px}.chat-header{padding:0 10px}.drawer-backdrop{top:68px}.composer-toolbar{padding-left:9px}.composer-left select{max-width:120px;padding-left:0}.composer-footnote{align-items:flex-start}.composer-footnote>span:first-child{align-items:baseline}.starter-grid strong,.starter-grid span{line-height:1.5}.chat-empty{padding:24px 0}.chat-panel{min-height:760px}.modal{padding:20px}.top-actions .primary{padding:8px}}.session-heading .cwd-button{text-align:left;width:100%;min-width:0;display:flex}.cwd-button:hover{color:var(--fg)}.cwd-button svg{flex-shrink:0}.cwd-trail{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;overflow:hidden}.full-directory{white-space:pre-wrap;overflow-wrap:anywhere;-webkit-user-select:text;user-select:text;font-size:16px;line-height:1.6;display:block}.modal.path-modal{width:max-content;min-width:min(960px,100%)}.markdown :is(h4,h5,h6,small,sub,sup){font-size:16px}.inspector>.inspector-tabs{border-top:0;flex-shrink:0;min-height:74px;padding:0 8px}.inspector>.inspector-tabs button{flex-direction:column;gap:5px;padding:10px 4px;line-height:1.4;position:relative}.inspector-tabs .count{position:absolute;top:4px;right:4px}.inspector-body.session-panel{padding:0 0 24px}.session-panel .session-heading{padding:24px 26px}.session-panel .model-section{padding:22px 26px}@media (width<=740px){.inspector>.inspector-tabs{padding:0 4px}.session-panel .session-heading,.session-panel .model-section{padding:20px 16px}.session-panel .session-heading>.eyebrow{display:block}.session-panel .session-status,.session-panel .section-label,.session-panel .thinking-row{display:flex}.session-panel .metrics{display:grid}}.hint,.path,.eyebrow,.section-label,.section-label span+span,.field-label,.counter-card .field-label,.model-button small,.model-list small,.metrics small,.thinking-row>span,.saved,.job-meta,.demo-action small,.task-card p,.tool-row p,.tool-row small,.tool-call summary code,.tool-result summary>span,.thinking,.thinking div,.raw summary,.raw summary span,.message-label>span:not(.mini-pi):not(.streaming),.composer-footnote,.context-indicator,.composer-left select,.version,.session-model,.sessions-drawer footer,.inspector-footer,.starter-grid span,.chat-empty p,.welcome p,.welcome-features,.learning-list p{color:var(--secondary)}input::placeholder,textarea::placeholder{color:var(--secondary);opacity:1}.chat-header{flex-wrap:nowrap;gap:14px}.chat-header-actions{flex-shrink:0}.lineage-picker{flex:1;min-width:0;padding:8px 0;position:relative}.lineage-toolbar{align-items:center;gap:4px;min-width:0;display:flex}.conversation-lineage{scrollbar-width:thin;scrollbar-color:var(--line) transparent;align-items:center;gap:4px;min-width:0;display:flex;overflow-x:auto}.lineage-crumb{color:var(--secondary);white-space:nowrap;border-radius:6px;flex-shrink:0;padding:7px 9px;font-size:16px}.lineage-crumb:hover{background:#342328}.lineage-crumb.current{color:var(--accent);background:#392328}.lineage-separator{color:var(--secondary)}.conversation-menu-toggle{flex-shrink:0}.lineage-source{color:var(--secondary);margin:4px 9px 0;font-size:16px;line-height:1.5}.conversation-menu-dismiss{z-index:25;cursor:default;position:fixed;inset:0}.conversation-picker{z-index:30;background:#251b1e;border:1px solid #68474e;border-radius:9px;width:min(540px,100vw - 48px);max-height:min(65vh,620px);padding:8px;position:absolute;top:100%;left:0;overflow-y:auto;box-shadow:0 16px 48px #0007}.conversation-picker-heading{color:var(--secondary);padding:10px 12px 14px;font-size:16px}.conversation-choice{text-align:left;border-radius:6px;justify-content:space-between;align-items:center;gap:14px;width:100%;padding:12px;display:flex}.conversation-choice:hover,.conversation-choice.selected{background:#3b272d}.conversation-choice-content{flex-direction:column;gap:6px;min-width:0;display:flex}.choice-lineage{color:var(--fg);flex-wrap:wrap;align-items:center;gap:5px;font-size:16px;line-height:1.5;display:flex}.choice-lineage>span{white-space:nowrap}.choice-lineage .choice-ancestor,.choice-lineage>svg,.choice-source{color:var(--secondary)}.choice-source{font-size:16px;line-height:1.5}.conversation-choice.selected .choice-lineage>span:last-child{color:var(--accent)}@media (width<=740px){.chat-header{flex-wrap:wrap;gap:4px;padding:8px 10px}.lineage-picker{flex-basis:100%;width:100%}.chat-header-actions{margin-left:auto}.conversation-picker{width:min(540px,100vw - 20px)}.lineage-crumb{padding:7px}}.queue-mode{min-width:150px;position:relative}.composer-left .queue-mode select{appearance:none;color:#f8eeee;cursor:pointer;background:#342329;border:1px solid #77515a;border-radius:8px;width:100%;max-width:none;min-height:40px;padding:7px 36px 7px 12px;font-size:16px;font-weight:600}.queue-mode>svg{pointer-events:none;color:var(--secondary);position:absolute;top:50%;right:10px;transform:translateY(-50%)}.interrupt .stop-sign{color:#ff647a;stroke:#ffb5c0;flex-shrink:0}.switch{border-radius:20px;flex-shrink:0;width:58px;height:34px;padding:4px}.switch>span{width:26px;height:26px}.state-boolean .switch{margin-left:0}.task-section{border-top:1px solid var(--line);margin-top:24px;padding-top:20px}.task-section h3,.task-example h4{align-items:center;gap:8px;margin:0 0 10px;font-size:16px;font-weight:650;display:flex}.task-example{border:1px solid var(--line);background:#25191c;border-radius:8px;margin-top:12px;padding:16px}.task-example p,.task-explanation p,.task-empty{color:var(--secondary);margin:8px 0 14px;font-size:16px;line-height:1.6}.task-decision-buttons{flex-wrap:wrap;gap:8px;margin:16px 0;display:flex}.approval-card{border-color:#c68957}.tasks-panel .task-note{margin-bottom:0}.tasks-panel .task-card .raw{margin-top:12px}.chat-header-actions{flex-wrap:wrap;justify-content:flex-end;gap:8px;display:flex}.chat-header{flex-wrap:wrap}.chat-header-actions .secondary{min-height:38px}@media (width<=740px){.topbar{flex-wrap:wrap;gap:12px;height:auto;padding:12px 16px}.top-actions{flex-wrap:wrap;gap:8px;margin-left:auto}.chat-header-actions{justify-content:flex-start;width:100%}}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:0 0}::-webkit-scrollbar-thumb{background:var(--line);background-clip:padding-box;border:2px solid #0000;border-radius:10px}::-webkit-scrollbar-thumb:hover{background:var(--faint);background-clip:padding-box}.label{font-family:var(--font-display);letter-spacing:.14em;text-transform:uppercase;color:var(--faint);font-size:14px;font-weight:700}.topbar-sep{background:var(--line);flex-shrink:0;width:1px;height:22px}.daemon{color:var(--faint);flex-wrap:wrap;align-items:center;gap:8px;min-width:0;font-size:15px;display:flex}.daemon b{color:var(--fg);font-weight:500;font-family:var(--font-mono)}.daemon .sep{color:var(--offline);flex-shrink:0}.dot{background:var(--ok);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in oklab, var(--ok) 16%, transparent);border-radius:50%;flex:0 0 8px;display:inline-block}.dot.off{background:var(--offline);box-shadow:none}.chip{border:1px solid var(--line);height:28px;font-family:var(--font-mono);color:var(--faint);background:var(--bg);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-size:13px;display:inline-flex}.chip b{color:var(--fg);font-weight:500}.chip.accent{border-color:color-mix(in oklab, var(--accent) 40%, var(--line));color:var(--accent)}.chip .dot{width:7px;height:7px;box-shadow:none;flex:0 0 7px}.secondary{border:1px solid var(--line);background:var(--card);transition:background .12s var(--ease), border-color .12s var(--ease)}.secondary:not(:disabled):hover{border-color:var(--faint)}.scrim{z-index:80;background:#0a0607ad;place-items:center;padding:20px;display:grid;position:fixed;inset:0}.dialog{border:1px solid var(--line);background:var(--panel);border-radius:12px;width:min(560px,100%);max-height:calc(100dvh - 40px);overflow-y:auto;box-shadow:0 24px 70px #0000008c}.dialog-head{justify-content:space-between;align-items:flex-start;gap:12px;padding:18px 20px 0;display:flex}.dialog-eyebrow{font-family:var(--font-display);letter-spacing:.14em;text-transform:uppercase;color:var(--accent);font-size:14px;font-weight:700}.dialog h3{font-family:var(--font-display);letter-spacing:-.01em;margin:5px 0 0;font-size:20px;font-weight:700}.dialog-body{flex-direction:column;gap:12px;padding:16px 20px;display:flex}.help-step{border-bottom:1px solid var(--line-soft);grid-template-columns:26px minmax(0,1fr);gap:10px;padding:7px 0;font-size:16px;display:grid}.help-step:last-of-type{border-bottom:0}.help-step .n{font-family:var(--font-mono);color:var(--accent)}.help-step b{font-weight:600}.help-step .body{color:var(--muted);margin-top:2px;line-height:1.6}.help-callout{border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--chat);color:var(--muted);align-items:flex-start;gap:10px;margin-top:4px;padding:10px 12px;font-size:16px;display:flex}.help-callout svg{flex-shrink:0;margin-top:2px}.dialog-foot{align-items:center;gap:8px;padding:0 20px 18px;display:flex}.dialog-foot .right{gap:8px;margin-left:auto;display:flex}.mnav{display:none}@media (width<=760px){.daemon,.topbar-sep{display:none}.mnav{padding:4px 6px calc(4px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--panel);grid-template-columns:repeat(3,1fr);gap:2px;display:grid}.mnav button{min-height:48px;color:var(--faint);background:0 0;border:0;border-radius:8px;flex-direction:column;justify-content:center;align-items:center;gap:2px;font-size:12px;display:flex;position:relative}.mnav button.is-on{color:var(--accent);background:color-mix(in oklab, var(--accent) 9%, transparent)}.mnav .badge{background:var(--primary);min-width:16px;height:16px;color:var(--on-primary);font-family:var(--font-mono);border-radius:999px;padding:0 4px;font-size:11px;line-height:16px;position:absolute;top:5px;right:calc(50% - 22px)}}.composer:focus-within{border-color:color-mix(in oklab, var(--accent) 55%, var(--line));box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent)}.send{border:1px solid var(--primary-line);transition:background .12s var(--ease);border-radius:8px}.pi-user{border-bottom:0;flex-direction:column;align-items:flex-end;gap:8px;padding-bottom:12px;display:flex}.pi-user .user-message{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);max-width:78%;padding:10px 14px}.inspector-tabs{background:var(--tree)}.inspector-tabs button{color:var(--muted)}.inspector-tabs button:hover{color:var(--fg)}.inspector-tabs button.active{color:var(--accent)}.insp-tab-active-line{border-bottom:2px solid var(--accent)}.switch{background:var(--offline)}.switch.on{background:var(--primary)}.switch.on>span{background:var(--on-primary)}.tool-call{background:var(--card);border-color:var(--line)}.tool-result{background:var(--chat)}.tool-result.failed,.tool-call.failed{border-color:color-mix(in oklab, var(--err) 45%, var(--line))}.metrics{border:1px solid var(--line);border-radius:var(--radius);background:var(--line);gap:1px;overflow:hidden}.metrics>div{background:var(--chat);padding:9px 12px}.metrics span{font-family:var(--font-mono);font-weight:500}.model-button{background:var(--chat);border:1px solid var(--line);border-radius:var(--radius)}.model-button:hover{border-color:var(--faint)}input,textarea,select{border-radius:var(--radius-sm)}input:focus,textarea:focus,select:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in oklab, var(--accent) 10%, transparent)}.chat-panel{background:var(--chat)}.chat-header,.inspector{background:var(--panel)}.network-sidebar{background:var(--tree)}.net-workspace{--tree-w:300px;--inspector-w:450px;--rail-w:52px;flex:1;min-height:0;display:flex;position:relative}.net-workspace>.chat-panel,.net-workspace>.welcome,.net-workspace>.offline-panel{flex:auto;min-width:0}.net-workspace>.network-sidebar{width:var(--tree-w);flex:none}.net-workspace>.network-sidebar.collapsed{width:var(--rail-w)}.net-workspace>.inspector{width:var(--inspector-w);border-right:1px solid var(--line);border-left:0;flex:none;min-height:0;max-height:none}.net-workspace>.inspector.collapsed{width:var(--rail-w)}.network-summary{color:var(--muted);border:1px solid var(--line);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;margin-left:6px;padding:3px 10px;font-size:15px;display:inline-flex}.tree-toggle,.inspector-toggle,.tree-backdrop,.inspector-backdrop{display:none}.panel-rail{scrollbar-width:none;flex-direction:column;align-items:center;gap:6px;height:100%;padding:10px 0;display:flex;overflow-y:auto}.panel-rail .panel-toggle{margin-bottom:6px}.rail-device,.rail-tab{width:38px;height:38px;color:var(--muted);border-radius:8px;position:relative}.rail-device:hover,.rail-tab:hover{color:var(--fg);background:#ffffff0a}.rail-tab.active{color:var(--accent);background:#ff899714}.rail-device .dot{width:8px;height:8px;box-shadow:0 0 0 2px var(--tree);flex-basis:8px;position:absolute;bottom:4px;right:4px}.rail-tab .count{background:var(--accent);color:#1a1012;border-radius:8px;min-width:16px;height:16px;padding:0 4px;font-size:11px;line-height:16px;position:absolute;top:2px;right:2px}.inspector .panel-rail{background:var(--panel)}.inspector-tabs .panel-toggle{align-self:center;margin-left:auto}.device-icon{flex:none;display:inline-block}.device-icon.exe,.device-icon.apple{color:#e9e2e2}.network-sidebar{background:var(--tree);border-right:1px solid var(--line);flex-direction:column;min-height:0;display:flex}.tree-head{color:var(--muted);letter-spacing:1.6px;justify-content:space-between;align-items:center;padding:10px 12px 10px 16px;font-size:14px;font-weight:650;display:flex}.tree-head span{align-items:center;gap:8px;display:inline-flex}.tree-list{scrollbar-width:thin;scrollbar-color:var(--line) transparent;outline:none;flex:1;padding:4px 6px 12px;overflow:auto}.tree-list:focus-visible{box-shadow:inset 0 0 0 1px #856669}.tree-empty{padding:12px 10px}.tree-row{--depth:0;min-height:34px;padding:3px 6px 3px calc(4px + var(--depth) * 16px);cursor:pointer;color:#e9e2e2;white-space:nowrap;border-radius:6px;align-items:center;gap:7px;font-size:15px;display:flex;position:relative}.tree-row:hover{background:#ffffff08}.tree-row.focus{box-shadow:inset 0 0 0 1px #6d5557}.tree-row.sel{background:#ff899714}.tree-row.sel:before{content:"";background:var(--accent);border-radius:2px;width:3px;position:absolute;top:5px;bottom:5px;left:0}.tree-row.stale{opacity:.55}.tree-row .chev{width:18px;height:18px;color:var(--muted);flex:0 0 18px;padding:0}.tree-row span.chev{display:inline-block}.tree-row .name{text-overflow:ellipsis;min-width:0;overflow:hidden}.tree-row.device .name{font-family:var(--font-mono);font-size:15px}.tree-row.session .name{font-weight:600}.tree-row .ico{color:var(--muted);flex:none}.tree-row .ico.root{color:var(--accent)}.tree-row .badge{color:var(--muted);font-size:12px;font-family:var(--font-mono);border:1px solid #443738;border-radius:4px;padding:1px 5px}.tree-row .meta,.tree-row .path{color:var(--muted);text-overflow:ellipsis;min-width:0;font-size:13px;overflow:hidden}.tree-row .path{font-family:var(--font-mono);flex:1}.tree-row .meta.err{color:#ff8a80}.tree-row .acts{background:var(--tree);border-radius:6px;gap:2px;margin-left:auto;display:none}.tree-row:hover .acts,.tree-row.focus .acts{display:inline-flex}.tree-row:hover .acts~*,.tree-row .acts .icon-button{width:26px;height:26px}.tree-row .acts .icon-button:disabled{opacity:.35;background:0 0}.tree-row .bg-count{color:var(--muted);align-items:center;gap:4px;font-size:13px;display:inline-flex}.tree-row>.dot.work,.tree-row>.bg-count{margin-left:auto}.tree-row>.dot.work+.bg-count{margin-left:6px}.tree-row:hover>.dot.work,.tree-row:hover>.bg-count,.tree-row.focus>.dot.work,.tree-row.focus>.bg-count{display:none}.dot{background:#756062;border-radius:50%;flex:0 0 9px;width:9px;height:9px;display:inline-block}.dot.on{background:var(--ok);box-shadow:0 0 6px #6fcf9766}.dot.chk{background:var(--secondary);animation:1.1s ease-in-out infinite dpi-pulse}.dot.err{background:var(--err)}.dot.off{background:var(--offline)}.dot.work{background:var(--accent);animation:1.1s ease-in-out infinite dpi-pulse}.dot.bg{border:2px solid var(--accent);background:0 0;width:9px;height:9px}@keyframes dpi-pulse{50%{opacity:.35}}.tree-resizer{cursor:col-resize;z-index:5;flex:0 0 6px;width:6px;margin:0 -3px;position:relative}.tree-resizer:hover{background:#ff899733}.crumbs{scrollbar-width:thin;scrollbar-color:var(--line) transparent;align-items:flex-end;gap:4px;min-width:0;padding:2px 0;display:flex;overflow-x:auto}.crumb{color:#e9e2e2;border-radius:8px;flex-direction:column;flex:none;align-items:flex-start;gap:2px;max-width:260px;padding:5px 10px 6px;display:inline-flex}.crumb:hover{background:#ffffff0a}.crumb.current{color:var(--accent);background:#ff899714}.crumb-kind{letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);font-size:11px;line-height:1}.crumb-main{align-items:center;gap:7px;min-width:0;max-width:100%;font-size:17px;font-weight:600;line-height:1.2;display:inline-flex}.crumb-name,.crumb .device-chip{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.crumb .device-chip{font-family:var(--font-mono)}.crumb-sep{color:var(--muted);flex:none;margin-bottom:8px}.chat-header-actions .secondary.active{border-color:var(--accent)}.history-divider{color:var(--muted);letter-spacing:1px;text-transform:uppercase;align-items:center;gap:8px;margin:8px 0 18px;font-size:14px;display:flex}.history-divider:after{content:"";border-top:1px dashed #4a3b3c;flex:1}.entry.history{opacity:.6}.retry-note{margin-top:4px}.session-modal{width:1120px}.device-modal code,.session-modal code{overflow-wrap:anywhere}.modal .field{flex-direction:column;gap:9px;margin-top:20px;display:flex}.dir-browser{flex-direction:column;gap:8px;display:flex}.dir-path{gap:8px;display:flex}.dir-path input{font-family:var(--font-mono);flex:1;font-size:14px!important}.dir-list{border:1px solid var(--line);background:var(--chat);border-radius:7px;max-height:220px;padding:4px;overflow:auto}.dir-item{color:#e9e2e2;border-radius:5px;justify-content:flex-start;width:100%;padding:6px 8px;font-size:15px}.dir-item:hover{background:#ffffff0a}.dir-item[aria-selected=true]{color:#fff;background:#ff899714}.dir-item span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.device-result{overflow-wrap:anywhere;border:1px solid #544042;border-radius:8px;align-items:flex-start;gap:10px;margin-top:18px;padding:12px;display:flex}.device-result.online{border-color:#6fcf9777}.device-result:not(.online){border-color:#ff6b6b77}.primary.danger{background:#c94f5d;border-color:#c94f5d}.offline-panel .chat-empty{gap:6px;max-width:640px;margin:0 auto}.offline-panel .eyebrow{font-family:var(--font-mono);letter-spacing:.5px;color:var(--muted);overflow-wrap:anywhere}.offline-panel.unauthorized svg,.offline-panel.mismatch svg{color:var(--err)}.offline-error{font-family:var(--font-mono);overflow-wrap:anywhere;font-size:14px}.offline-command{border:1px solid var(--line);background:#0f0a0b;border-radius:8px;align-items:center;gap:8px;margin:10px 0 4px;padding:10px 14px;display:inline-flex}.offline-command code{color:#fff;font-size:17px}.offline-actions{gap:10px;margin-top:16px;display:flex}.spin{animation:1s linear infinite dpi-spin}@keyframes dpi-spin{to{transform:rotate(360deg)}}@media (width<=1100px){.inspector-toggle{display:inline-flex}.net-workspace>.inspector.overlay{z-index:30;width:min(420px,100%);position:absolute;top:0;bottom:0;left:0;box-shadow:20px 0 60px #0008}.inspector-backdrop{z-index:29;background:#0d080899;display:block;position:absolute;inset:0}}@media (width<=760px){.tree-resizer{display:none}.tree-toggle{display:inline-flex}.net-workspace>.network-sidebar{display:none}.net-workspace>.network-sidebar.open{z-index:40;width:min(340px,90vw);display:flex;position:absolute;top:0;bottom:0;left:0;box-shadow:20px 0 60px #0008}.tree-backdrop{z-index:39;background:#0d080899;display:block;position:absolute;inset:0}.network-summary,.new-agent-button{display:none!important}.shell{height:100dvh;overflow:hidden}.net-workspace .chat-panel{height:auto;min-height:0}.net-workspace>.inspector .session-status,.net-workspace>.inspector .model-section{display:block}.top-actions .inspector-toggle{display:inline-flex}.crumb-kind{display:none}}.net-workspace .lineage-picker{flex:240px}.net-workspace .conversation-lineage{flex:0 auto}.composer{position:relative}.slash-menu{background:var(--card);z-index:20;border:1px solid #544042;border-radius:10px;max-height:320px;margin:0;padding:6px;list-style:none;position:absolute;bottom:calc(100% + 8px);left:0;right:0;overflow-y:auto;box-shadow:0 20px 60px #0007}.slash-menu li{cursor:pointer;border-radius:6px;align-items:baseline;gap:10px;padding:7px 10px;display:flex}.slash-menu li.active{background:#ff899714}.slash-menu code{color:var(--accent);font-size:15px}.slash-args{color:var(--muted);font-family:var(--font-mono);font-size:14px}.slash-desc{color:var(--muted);text-align:right;margin-left:auto;font-size:14px}.job-run{border:1px solid #5a3a3e;border-left:4px solid var(--accent);min-width:0;color:var(--fg);background:linear-gradient(#2a1b1d,#221617);border-radius:9px;margin:14px 0 6px;padding:16px 18px 14px}.job-run.is-completed{border-left-color:var(--ok)}.job-run.is-waiting{border-left-color:var(--warn)}.job-run.is-failed,.job-run.is-declined,.job-run.is-aborted{border-left-color:#8d6a6d}.job-run-head{align-items:center;gap:12px;display:flex}.job-run-icon{width:40px;height:40px;color:var(--accent);background:#3d2629;border-radius:9px;flex:none;place-items:center;display:grid}.job-run-titles{flex:1;min-width:0}.job-run-titles h3{font-family:var(--font-title);margin:2px 0 0;font-size:19px;font-weight:750}.job-run-eyebrow{letter-spacing:1.2px;color:var(--secondary);flex-wrap:wrap;align-items:center;gap:4px 12px;font-size:16px;display:flex}.job-run-repeat{letter-spacing:0;color:var(--fg);align-items:center;gap:5px;display:inline-flex}.job-run-status{background:#352728;border-radius:5px;flex:none;align-items:center;gap:7px;padding:4px 9px;font-size:16px;display:inline-flex}.job-run-status i{background:currentColor;border-radius:50%;width:7px;height:7px}.job-run-status.running{color:var(--accent)}.job-run-status.running i{animation:1.5s infinite pulse}.job-run-status.waiting{color:var(--warn)}.job-run-status.completed{color:var(--ok)}.job-run-about{margin:12px 0 8px;font-size:16px;line-height:1.55}.job-run-meta{font-family:var(--font-mono);color:var(--secondary);flex-wrap:wrap;gap:6px 14px;font-size:16px;display:flex}.job-run-input,.job-run-resumed{color:var(--fg)}.job-run-resumed{color:var(--warn)}.job-stepper{flex-wrap:wrap;align-items:center;gap:8px 0;margin:16px 0 12px;padding:0;list-style:none;display:flex}.job-stepper li{align-items:center;display:inline-flex}.job-stepper li:not(:last-child):after{content:"→";color:#8d6a6d;margin:0 8px}.job-chip{background:#241819;border:1px solid #4a3638;border-radius:999px;align-items:center;gap:7px;padding:4px 11px 4px 4px;font-size:16px;display:inline-flex}.job-step-dot{width:24px;height:24px;font-family:var(--font-mono);background:#3a2a2c;border-radius:50%;place-items:center;font-size:15px;display:grid}.ph-done .job-chip{border-color:#3f6b52}.ph-done .job-step-dot{color:#b9f2cf;background:#24543a}.ph-running .job-chip{border-color:var(--accent);box-shadow:0 0 0 3px #ff899722}.ph-running .job-step-dot{color:var(--accent);background:#5a2a31}.ph-waiting .job-chip{border-color:var(--warn);box-shadow:0 0 0 3px #f2c94c22}.ph-waiting .job-step-dot{color:var(--warn);background:#574719}.ph-failed .job-chip,.ph-aborted .job-chip{border-color:#8d4a52}.job-stepper .ph-skipped{opacity:.55}.job-step-progress{font-family:var(--font-mono);color:var(--secondary)}.job-phases{grid-template-columns:minmax(0,1fr);gap:6px;display:grid}.job-phase{background:#1f1415;border:1px solid #3c2b2d;border-radius:7px}.job-phase.ph-running{border-color:#6a3a41}.job-phase.ph-waiting{border-color:#6b5a24}.job-phase.ph-skipped,.job-phase.ph-pending{opacity:.7}.job-phase>summary{cursor:pointer;flex-wrap:wrap;align-items:baseline;gap:4px 10px;padding:9px 12px;font-size:16px;list-style:none;display:flex}.job-phase summary::-webkit-details-marker{display:none}.job-phase-n{font-family:var(--font-mono);color:var(--secondary)}.job-phase-summary{color:#e6d7d8;flex:1;min-width:160px}.job-phase-time{font-family:var(--font-mono);color:var(--secondary);margin-left:auto}.job-phase-about,.job-phase-empty{color:var(--secondary);margin:0;padding:0 12px 8px 34px;font-size:16px}.job-steps{grid-template-columns:minmax(0,1fr);gap:5px;margin:0;padding:0 12px 10px 34px;list-style:none;display:grid}.job-steps>li{font-size:16px;display:block}.job-steps summary,.job-step-line{align-items:center;gap:9px;min-width:0;list-style:none;display:flex}.job-steps summary{cursor:pointer}.job-steps summary:after{content:"⌄";color:var(--secondary);margin-left:2px}.job-steps details[open] summary:after{content:"⌃"}.job-steps code{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--font-mono);background:#2c1e20;border-radius:4px;padding:1px 6px;font-size:16px;overflow:hidden}.job-steps .k-tool code{border:1px solid #5a3a3e;flex:none}.job-step-kind{color:var(--secondary)}.job-steps .k-tool .job-step-kind,.job-steps .k-agent .job-step-kind{color:var(--accent)}.job-step-text{min-width:0;color:var(--fg)}.job-step-args{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-family:var(--font-mono);color:var(--secondary);overflow:hidden}.job-step-state{font-family:var(--font-mono);color:var(--secondary);flex:none;align-items:center;gap:5px;display:inline-flex}.job-steps .st-done .job-step-state svg{color:var(--ok)}.job-steps .st-error .job-step-state svg{color:#ff8997}.job-steps .st-waiting .job-step-state svg{color:var(--warn)}.job-steps pre{white-space:pre-wrap;color:#e6d7d8;background:#180f10;border-radius:5px;max-height:180px;margin:4px 0 2px 25px;padding:7px 9px;font-size:16px;overflow:auto}.job-step-link{margin:2px 0 0 25px}.job-approval{background:#2c2514;border:1px solid #8a7330;border-radius:8px;margin-top:12px;padding:12px 14px}.job-approval>div:first-child{color:var(--warn);align-items:center;gap:8px;display:flex}.job-approval p{margin:6px 0 10px;font-size:16px;line-height:1.5}.job-approval-buttons{flex-wrap:wrap;gap:8px;display:flex}.job-run-foot{color:var(--secondary);border-top:1px solid #3c2b2d;flex-wrap:wrap;align-items:center;gap:8px 14px;margin-top:12px;padding-top:10px;font-size:16px;display:flex}.job-run-foot span{flex:1;min-width:220px}.job-def{background:#241819;border:1px solid #453536;border-radius:8px;margin-top:12px;padding:13px}.job-def-head{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.job-def-head svg{color:var(--accent)}.job-def-head strong{margin-right:auto;font-size:16px}.job-def p{margin:8px 0;font-size:16px;line-height:1.5}.job-chain{flex-wrap:wrap;gap:6px 4px;margin:8px 0;padding:0;list-style:none;display:flex}.job-chain li{border:1px solid #4a3638;border-radius:999px;align-items:center;gap:5px;padding:3px 9px 3px 3px;font-size:16px;display:inline-flex}.job-chain li span{width:20px;height:20px;font-family:var(--font-mono);background:#3a2a2c;border-radius:50%;place-items:center;font-size:14px;display:grid}.job-chain li:not(:last-child):after{content:"→";color:#8d6a6d;margin-left:4px}.job-def-meta{flex-wrap:wrap;gap:6px;display:flex}.job-def-meta code{font-family:var(--font-mono);color:var(--secondary);overflow-wrap:anywhere;font-size:16px}.job-def-last{flex-wrap:wrap;align-items:center;gap:6px 10px;margin-top:10px;font-size:16px;display:flex}.job-def-last .text-button{margin-top:0}.job-def-run{margin-top:12px}.task-tree{gap:4px;margin:0 0 12px;padding:0;list-style:none;display:grid}.task-row{margin-left:calc(var(--depth) * 18px);background:#211617;border:1px solid #3c2b2d;border-left:3px solid #5a3a3e;border-radius:6px;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:7px 10px;font-size:16px;display:flex}.task-row[data-task-kind=pi\.tool]{border-left-color:var(--accent)}.task-row[data-task-kind^="demo.job."]{border-left-color:var(--warn)}.task-row small{width:100%;font-family:var(--font-mono);color:var(--secondary);font-size:16px}.task-row .text-button{margin-top:0}.task-phase{font-family:var(--font-mono);color:var(--secondary)}.context-section{margin-top:18px}.context-numbers{flex-wrap:wrap;align-items:baseline;gap:6px 8px;font-size:16px;display:flex}.context-numbers strong{font-family:var(--font-title);font-size:22px}.context-pct{font-family:var(--font-mono);color:var(--secondary)}.context-compacting{color:var(--warn);align-items:center;gap:6px;margin-left:auto;display:inline-flex}.context-compacting i{background:currentColor;border-radius:50%;width:7px;height:7px;animation:1.2s infinite pulse}.context-bar{touch-action:none;background:#2d2122;border:1px solid #453536;border-radius:7px;height:14px;margin:40px 0 44px;position:relative}.context-bar.off .context-marker{opacity:.45}.context-fill{background:linear-gradient(90deg, #8a3a45, var(--accent));border-radius:7px 0 0 7px;transition:width .3s;position:absolute;inset:0 auto 0 0}.context-fill.hot{background:linear-gradient(90deg, #8a3a45, var(--warn))}.context-reserve{background:repeating-linear-gradient(135deg,#ffffff10 0 5px,#0000 5px 10px);border-left:1px solid #8d6a6d;border-radius:0 7px 7px 0;position:absolute;top:0;bottom:0;right:0}.context-marker{background:var(--warn);cursor:ew-resize;touch-action:none;border-radius:2px;width:4px;height:26px;margin-left:-2px;padding:0;position:absolute;top:-7px}.context-marker:before{content:"";position:absolute;inset:-4px -10px}.context-marker.wait{background:var(--fg)}.context-marker-label{white-space:nowrap;font-size:16px;font-family:var(--font-mono);color:var(--warn);pointer-events:none;position:absolute;left:50%;transform:translate(-50%)}.context-marker.auto .context-marker-label{bottom:calc(100% + 4px)}.context-marker.wait .context-marker-label{color:var(--fg);top:calc(100% + 4px)}.context-marker.label-start .context-marker-label{left:-2px;transform:none}.context-marker.label-end .context-marker-label{left:auto;right:-2px;transform:none}.context-hint{margin:0 0 10px}.context-details-toggle{color:var(--warn);letter-spacing:0;align-items:center;gap:4px;padding:0;font-size:16px;display:inline-flex}.compaction-modal p{margin:0 0 12px;font-size:16px;line-height:1.6}.modal .context-toggle{flex-direction:row;align-items:center;gap:8px;margin-top:6px}.modal .context-toggle input{width:auto;padding:0}.context-toggle{flex-wrap:wrap;align-items:center;gap:4px 8px;font-size:16px;display:flex}.context-toggle small{width:100%;color:var(--secondary);font-size:16px}.ext-card{background:#241819;border:1px solid #453536;border-left:3px solid #5a3a3e;border-radius:8px;margin-top:12px;padding:13px 14px}.ext-card.on{border-left-color:var(--ok)}.ext-head{align-items:center;gap:12px;display:flex}.ext-head>div{flex-wrap:wrap;align-items:baseline;gap:4px 10px;min-width:0;display:flex}.ext-head strong{font-size:16px}.ext-head code{font-family:var(--font-mono);color:var(--secondary);font-size:16px}.ext-card>p{margin:8px 0 0;font-size:16px;line-height:1.5}.ext-prompts{border-top:1px solid #3c2b2d;gap:10px;margin:12px 0 0;padding:10px 0 0;list-style:none;display:grid}.ext-prompts.off{opacity:.6}.ext-prompts li{gap:4px;font-size:16px;display:grid}.ext-prompts label{cursor:pointer;align-items:center;gap:8px;display:flex}.ext-prompts code{font-family:var(--font-mono);font-size:16px}.ext-prompts li>span{color:var(--secondary);padding-left:26px;line-height:1.45}.ext-prompts details{padding-left:26px}.ext-prompts summary{cursor:pointer;color:var(--accent)}.ext-prompts pre{white-space:pre-wrap;background:#180f10;border-radius:6px;max-height:260px;margin:6px 0 0;padding:9px;font-size:16px;overflow:auto}.tool-row.disabled summary>strong,.tool-row.disabled summary>svg,.tool-row.disabled>p,.tool-row.disabled>pre,.tool-row.disabled>small{opacity:.45}.tool-row summary .tag.tool-disabled{color:var(--warn);border-color:#6b5a24;margin-left:2px;margin-right:auto}.tool-row summary .tag.tool-disabled+.tag{margin-left:auto}
|
|
@@ -73,9 +73,9 @@ ${e}</tr>
|
|
|
73
73
|
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Cp(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Rp(e,t){return Lp.parse(e,t)}Rp.options=Rp.setOptions=function(e){return Lp.setOptions(e),Rp.defaults=Lp.defaults,ff(Rp.defaults),Rp},Rp.getDefaults=uf,Rp.defaults=df,Rp.use=function(...e){return Lp.use(...e),Rp.defaults=Lp.defaults,ff(Rp.defaults),Rp},Rp.walkTokens=function(e,t){return Lp.walkTokens(e,t)},Rp.parseInline=Lp.parseInline,Rp.Parser=Fp,Rp.parser=Fp.parse,Rp.Renderer=Np,Rp.TextRenderer=Pp,Rp.Lexer=Mp,Rp.lexer=Mp.lex,Rp.Tokenizer=jp,Rp.Hooks=Ip,Rp.parse=Rp,Rp.options,Rp.setOptions,Rp.use,Rp.walkTokens,Rp.parseInline,Fp.parse,Mp.lex;function zp(e,t){this.v=e,this.k=t}function Bp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Vp(e){if(Array.isArray(e))return e}function Hp(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Up(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
74
74
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wp(e,t){return Vp(e)||Hp(e,t)||Gp(e,t)||Up()}function Gp(e,t){if(e){if(typeof e==`string`)return Bp(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Bp(e,t):void 0}}function Kp(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof zp;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}Kp.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},Kp.prototype.next=function(e){return this._invoke(`next`,e)},Kp.prototype.throw=function(e){return this._invoke(`throw`,e)},Kp.prototype.return=function(e){return this._invoke(`return`,e)};var qp=Object.entries,Jp=Object.setPrototypeOf,Yp=Object.isFrozen,Xp=Object.getPrototypeOf,Zp=Object.getOwnPropertyDescriptor,Qp=Object.freeze,$p=Object.seal,em=Object.create,tm=typeof Reflect<`u`&&Reflect,nm=tm.apply,rm=tm.construct;Qp||=function(e){return e},$p||=function(e){return e},nm||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},rm||=function(e){return new e(...[...arguments].slice(1))};var im=wm(Array.prototype.forEach);Array.prototype.indexOf;var am=wm(Array.prototype.lastIndexOf),om=wm(Array.prototype.pop),sm=wm(Array.prototype.push);Array.prototype.slice;var cm=wm(Array.prototype.splice),lm=Array.isArray,um=wm(String.prototype.toLowerCase),dm=wm(String.prototype.toString),fm=wm(String.prototype.match),pm=wm(String.prototype.replace),mm=wm(String.prototype.indexOf),hm=wm(String.prototype.trim),gm=wm(Number.prototype.toString),_m=wm(Boolean.prototype.toString),vm=typeof BigInt>`u`?null:wm(BigInt.prototype.toString),ym=typeof Symbol>`u`?null:wm(Symbol.prototype.toString),bm=wm(Object.prototype.hasOwnProperty),xm=wm(Object.prototype.toString),Sm=wm(RegExp.prototype.test),Cm=Tm(TypeError);function wm(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return nm(e,t,n)}}function Tm(e){return function(){return rm(e,[...arguments])}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:um;if(Jp&&Jp(e,null),!lm(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Yp(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Em(e){for(let t=0;t<e.length;t++)bm(e,t)||(e[t]=null);return e}function Dm(e){let t=em(null);for(let r of qp(e)){var n=Wp(r,2);let i=n[0],a=n[1];bm(e,i)&&(t[i]=lm(a)?Em(a):a&&typeof a==`object`&&a.constructor===Object?Dm(a):a)}return t}function Om(e){switch(typeof e){case`string`:return e;case`number`:return gm(e);case`boolean`:return _m(e);case`bigint`:return vm?vm(e):`0`;case`symbol`:return ym?ym(e):`Symbol()`;case`undefined`:return xm(e);case`function`:case`object`:{if(e===null)return xm(e);let t=e,n=km(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:xm(e)}return xm(e)}default:return xm(e)}}function km(e,t){for(;e!==null;){let n=Zp(e,t);if(n){if(n.get)return wm(n.get);if(typeof n.value==`function`)return wm(n.value)}e=Xp(e)}function n(){return null}return n}function Am(e){try{return Sm(e,``),!0}catch{return!1}}var jm=Qp(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Mm=Qp(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Nm=Qp([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),Pm=Qp([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Fm=Qp(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Im=Qp([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Lm=Qp([`#text`]),Rm=Qp(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),zm=Qp(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),Bm=Qp(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),Vm=Qp([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Hm=$p(/{{[\w\W]*|^[\w\W]*}}/g),Um=$p(/<%[\w\W]*|^[\w\W]*%>/g),Wm=$p(/\${[\w\W]*/g),Gm=$p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Km=$p(/^aria-[\-\w]+$/),qm=$p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Jm=$p(/^(?:\w+script|data):/i),Ym=$p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Xm=$p(/^html$/i),Zm=$p(/^[a-z][.\w]*(-[.\w]+)+$/i),Qm=$p(/<[/\w!]/g),$m=$p(/<[/\w]/g),eh=$p(/<\/no(script|embed|frames)/i),th=$p(/\/>/i),nh={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rh=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],ih=Qp(q({},rh)),ah=function(){let e={};return im(rh,t=>{e[t]=$p(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),Qp(e)}(),oh=function(){return typeof window>`u`?null:window},sh=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},ch=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},lh=function(e,t,n,r){return bm(e,t)&&lm(e[t])?q(r.base?Dm(r.base):{},e[t],r.transform):n},uh=function(e,t,n){let r=bm(e,t)?e[t]:void 0;return r&&typeof r==`object`?Dm(r):n()};function dh(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:oh(),t=e=>dh(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==nh.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=km(d,`cloneNode`),p=km(d,`remove`),m=km(d,`removeAttributeNode`),h=km(d,`nextSibling`),g=km(d,`childNodes`),_=km(d,`parentNode`),v=km(d,`shadowRoot`),y=km(d,`attributes`),b=o&&o.prototype?km(o.prototype,`nodeType`):null,ee=o&&o.prototype?km(o.prototype,`nodeName`):null,x=o&&o.prototype?km(o.prototype,`ownerDocument`):null,S=function(e){return b?b(e):e.nodeType},te=function(e){return ee?ee(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let ne,C=``,re,ie=!1,ae=0,oe=function(){if(ae>0)throw Cm(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},se=function(e){oe(),ae++;try{return ne.createHTML(e)}finally{ae--}},ce=function(e){oe(),ae++;try{return ne.createScriptURL(e)}finally{ae--}},le=function(){return ie||=(re=sh(u,i),!0),re},ue=n,w=ue.implementation,de=ue.createNodeIterator,fe=ue.createDocumentFragment,pe=ue.getElementsByTagName,me=r.importNode,he=ch();t.isSupported=typeof qp==`function`&&typeof _==`function`&&w&&w.createHTMLDocument!==void 0;let ge=Hm,_e=Um,ve=Wm,ye=Gm,be=Km,xe=Jm,T=Ym,Se=Zm,Ce=qm,we=null,Te=q({},[...jm,...Mm,...Nm,...Fm,...Lm]),Ee=null,De=q({},[...Rm,...zm,...Bm,...Vm]),Oe=Object.seal(em(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ke=null,Ae=null,je=Object.seal(em(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),E=!0,Me=!0,Ne=!1,Pe=!0,Fe=!1,Ie=!0,D=!1,Le=!1,Re=null,ze=null,Be=!1,Ve=!1,He=!1,Ue=!1,We=!0,Ge=!1,Ke=`user-content-`,qe=!0,Je=!1,Ye={},Xe=null,Ze=q({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Qe=null,$e=q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),et=null,tt=q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),nt=`http://www.w3.org/1998/Math/MathML`,rt=`http://www.w3.org/2000/svg`,it=`http://www.w3.org/1999/xhtml`,at=it,ot=!1,st=null,ct=q({},[nt,rt,it],dm),lt=Qp([`mi`,`mo`,`mn`,`ms`,`mtext`]),ut=q({},lt),dt=Qp([`annotation-xml`]),ft=q({},dt),pt=q({},[`title`,`style`,`font`,`a`,`script`]),mt=null,ht=[`application/xhtml+xml`,`text/html`],gt=null,_t=null,vt=n.createElement(`form`),yt=function(e){return e instanceof RegExp||e instanceof Function},bt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(_t&&_t===e)return;(!e||typeof e!=`object`)&&(e={}),e=Dm(e),mt=ht.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,gt=mt===`application/xhtml+xml`?dm:um,we=lh(e,`ALLOWED_TAGS`,Te,{transform:gt}),Ee=lh(e,`ALLOWED_ATTR`,De,{transform:gt}),st=lh(e,`ALLOWED_NAMESPACES`,ct,{transform:dm}),et=lh(e,`ADD_URI_SAFE_ATTR`,tt,{transform:gt,base:tt}),Qe=lh(e,`ADD_DATA_URI_TAGS`,$e,{transform:gt,base:$e}),Xe=lh(e,`FORBID_CONTENTS`,Ze,{transform:gt}),ke=lh(e,`FORBID_TAGS`,Dm({}),{transform:gt}),Ae=lh(e,`FORBID_ATTR`,Dm({}),{transform:gt}),Ye=bm(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Dm(e.USE_PROFILES):e.USE_PROFILES:!1,E=e.ALLOW_ARIA_ATTR!==!1,Me=e.ALLOW_DATA_ATTR!==!1,Ne=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Fe=e.SAFE_FOR_TEMPLATES||!1,Ie=e.SAFE_FOR_XML!==!1,D=e.WHOLE_DOCUMENT||!1,Ve=e.RETURN_DOM||!1,He=e.RETURN_DOM_FRAGMENT||!1,Ue=e.RETURN_TRUSTED_TYPE||!1,Be=e.FORCE_BODY||!1,We=e.SANITIZE_DOM!==!1,Ge=e.SANITIZE_NAMED_PROPS||!1,qe=e.KEEP_CONTENT!==!1,Je=e.IN_PLACE||!1,Ce=Am(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:qm,at=typeof e.NAMESPACE==`string`?e.NAMESPACE:it,ut=uh(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>q({},lt)),ft=uh(e,`HTML_INTEGRATION_POINTS`,()=>q({},dt));let t=uh(e,`CUSTOM_ELEMENT_HANDLING`,()=>em(null));if(Oe=em(null),bm(t,`tagNameCheck`)&&yt(t.tagNameCheck)&&(Oe.tagNameCheck=t.tagNameCheck),bm(t,`attributeNameCheck`)&&yt(t.attributeNameCheck)&&(Oe.attributeNameCheck=t.attributeNameCheck),bm(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Oe.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),$p(Oe),Fe&&(Me=!1),He&&(Ve=!0),Ye&&(we=q({},Lm),Ee=em(null),Ye.html===!0&&(q(we,jm),q(Ee,Rm)),Ye.svg===!0&&(q(we,Mm),q(Ee,zm),q(Ee,Vm)),Ye.svgFilters===!0&&(q(we,Nm),q(Ee,zm),q(Ee,Vm)),Ye.mathMl===!0&&(q(we,Fm),q(Ee,Bm),q(Ee,Vm))),je.tagCheck=null,je.attributeCheck=null,bm(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?je.tagCheck=e.ADD_TAGS:lm(e.ADD_TAGS)&&(we===Te&&(we=Dm(we)),q(we,e.ADD_TAGS,gt))),bm(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?je.attributeCheck=e.ADD_ATTR:lm(e.ADD_ATTR)&&(Ee===De&&(Ee=Dm(Ee)),q(Ee,e.ADD_ATTR,gt))),bm(e,`ADD_FORBID_CONTENTS`)&&lm(e.ADD_FORBID_CONTENTS)&&(Xe===Ze&&(Xe=Dm(Xe)),q(Xe,e.ADD_FORBID_CONTENTS,gt)),qe&&(we[`#text`]=!0),D&&q(we,[`html`,`head`,`body`]),we.table&&(q(we,[`tbody`]),delete ke.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Cm(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Cm(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=ne;ne=e.TRUSTED_TYPES_POLICY;try{C=se(``)}catch(e){throw ne=t,e}}else e.TRUSTED_TYPES_POLICY===null?(ne=void 0,C=``):(ne===void 0&&(ne=le()),ne&&typeof C==`string`&&(C=se(``)));Qp&&Qp(e),_t=e},xt=q({},[...Mm,...Nm,...Pm]),St=q({},[...Fm,...Im]),Ct=function(e,t,n){return t.namespaceURI===it?e===`svg`:t.namespaceURI===nt?e===`svg`&&(n===`annotation-xml`||ut[n]):!!xt[e]},wt=function(e,t,n){return t.namespaceURI===it?e===`math`:t.namespaceURI===rt?e===`math`&&ft[n]:!!St[e]},Tt=function(e,t,n){return t.namespaceURI===rt&&!ft[n]||t.namespaceURI===nt&&!ut[n]?!1:!St[e]&&(pt[e]||!xt[e])},Et=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:at,tagName:`template`});let n=um(e.tagName),r=um(t.tagName);return st[e.namespaceURI]?e.namespaceURI===rt?Ct(n,t,r):e.namespaceURI===nt?wt(n,t,r):e.namespaceURI===it?Tt(n,t,r):!!(mt===`application/xhtml+xml`&&st[e.namespaceURI]):!1},Dt=function(e){sm(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Cm(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},Ot=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},kt=function(e){Mt(e);let t=g(e);if(t){let e=[];im(t,t=>{sm(e,t)}),im(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&Ot(e,r,i)}},At=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}sm(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Ve||He)try{Dt(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},jt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||Ee[gt(i)]||Ot(e,r,i)}},Mt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===nh.element&&jt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},Nt=function(e,t){return Ie?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},Pt=function(e){if(!Ie)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===nh.processingInstruction||n===nh.comment&&Sm($m,e.data)){try{p(e)}catch{}continue}if(n===nh.element){let t=e,n=gt(te(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&Nt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ft=function(e){let t=null,r=null;if(Be)e=`<remove></remove>`+e;else{let t=fm(e,/^[\r\n\t ]+/);r=t&&t[0]}mt===`application/xhtml+xml`&&at===it&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=ne?se(e):e;if(at===it)try{t=new l().parseFromString(i,mt)}catch{}if(!t||!t.documentElement){t=w.createDocument(at,`template`,null);try{t.documentElement.innerHTML=ot?C:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),at===it?pe.call(t,D?`html`:`body`)[0]:D?t.documentElement:a},It=function(e){let t=x?x(e):e.ownerDocument;return de.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Lt=function(e){return e=pm(e,ge,` `),e=pm(e,_e,` `),e=pm(e,ve,` `),e},Rt=function(e){e.normalize();let t=x?x(e):e.ownerDocument,n=de.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Lt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&im(i,e=>{Bt(e.content)&&Rt(e.content)})},zt=function(e){let t=ee?ee(e):null;return typeof t!=`string`||gt(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},Bt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===nh.documentFragment}catch{return!1}},Vt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Ht(e,n,r){e.length!==0&&im(e,e=>{e.call(t,n,r,_t)})}let Ut=function(e,t){return!!(Ie&&e.hasChildNodes()&&!Vt(e.firstElementChild)&&Sm(Qm,e.textContent)&&Sm(Qm,e.innerHTML)||Ie&&e.namespaceURI===it&&ih[t]&&(Vt(e.firstElementChild)||typeof e.textContent==`string`&&Sm(ah[t],e.textContent))||e.nodeType===nh.processingInstruction||Ie&&e.nodeType===nh.comment&&Sm($m,e.data))},Wt=function(e,t){return e instanceof RegExp?Sm(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Gt=function(e,t,n){if(!ke[t]&&Zt(t)&&Wt(Oe.tagNameCheck,t))return!1;if(qe&&!Xe[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Dt(e),!0},Kt=function(e,t,n,r){return e.length===0?t:t===n||t===r?Dm(t):t},qt=function(e,t){return e===t||_(e)!==null?!1:(Je&&Mt(e),!0)},Jt=function(e,n){if(Ht(he.beforeSanitizeElements,e,null),qt(e,n))return!0;if(zt(e))return Dt(e),!0;let r=gt(te(e));if(we=Kt(he.uponSanitizeElement,we,Te,Re),Ht(he.uponSanitizeElement,e,{tagName:r,allowedTags:we}),qt(e,n))return!0;if(Ut(e,r))return Dt(e),!0;if(ke[r]||!(je.tagCheck instanceof Function&&je.tagCheck(r))&&!we[r]){let t=Gt(e,r,n);return t===!1&&(Ht(he.afterSanitizeElements,e,null),qt(e,n))?!0:t}if(S(e)===nh.element&&!Et(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Sm(eh,e.innerHTML))return Dt(e),!0;if(Fe&&e.nodeType===nh.text){let n=Lt(e.textContent);e.textContent!==n&&(sm(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Ht(he.afterSanitizeElements,e,null),qt(e,n)},Yt=function(e,t,r){if(Ae[t]||Nt(t,e)||We&&(t===`id`||t===`name`)&&(r in n||r in vt))return!1;let i=Ee[t]||je.attributeCheck instanceof Function&&je.attributeCheck(t,e);return Me&&Sm(ye,t)||E&&Sm(be,t)?!0:i?et[t]||Sm(Ce,pm(r,T,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&mm(r,`data:`)===0&&Qe[e]||Ne&&!Sm(xe,pm(r,T,``))?!0:!r:Zt(e)&&Wt(Oe.tagNameCheck,e)&&Wt(Oe.attributeNameCheck,t,e)||t===`is`&&Oe.allowCustomizedBuiltInElements&&Wt(Oe.tagNameCheck,r)},Xt=q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Zt=function(e){return!Xt[um(e)]&&Sm(Se,e)},Qt=function(e,t,n,r){if(ne&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return se(r);case`TrustedScriptURL`:return ce(r)}return r},$t=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!zt(e)||(Dt(e),!1)}catch{return At(t,e),!1}},en=function(e,n){if(Ht(he.beforeSanitizeAttributes,e,null),qt(e,n))return;let r=e.attributes;if(!r||zt(e))return;Ee=Kt(he.uponSanitizeAttribute,Ee,De,ze);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:Ee,forceKeepAttr:void 0},a=r.length,o=gt(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=gt(s),d=l,f=s===`value`?d:hm(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Ht(he.uponSanitizeAttribute,e,i),f=i.attrValue,Ge&&(u===`id`||u===`name`)&&mm(f,Ke)!==0&&(At(s,e,n),f=Ke+f,p=!0),Ie&&Sm(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){At(s,e,n);continue}if(u===`attributename`&&fm(f,`href`)){At(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){At(s,e,n);continue}if(!Pe&&Sm(th,f)){At(s,e,n);continue}if(Fe&&(f=Lt(f)),!Yt(o,u,f)){At(s,e,n);continue}f=Qt(o,u,c,f),f!==d&&$t(e,s,c,f)&&p&&om(t.removed)}}Ht(he.afterSanitizeAttributes,e,null),qt(e,n)},tn=function(e){let t=null,n=It(e);for(Ht(he.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Ht(he.uponSanitizeShadowNode,t,null),Jt(t,e),en(t,e),Bt(t.content)&&tn(t.content),S(t)===nh.element){let e=v(t);Bt(e)&&(nn(e),tn(e))}Ht(he.afterSanitizeShadowDOM,e,null)},nn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){tn(e.shadow);continue}let n=e.node,r=S(n)===nh.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=ee?ee(n):null;if(typeof e==`string`&>(e)===`template`){let e=n.content;Bt(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);Bt(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(ot=!e,ot&&(e=`<!-->`),typeof e!=`string`&&!Vt(e)&&(e=Om(e),typeof e!=`string`))throw Cm(`dirty is not a string, aborting`);if(!t.isSupported)return e;Le?(we=Re,Ee=ze):bt(n),(he.uponSanitizeElement.length>0||he.uponSanitizeAttribute.length>0)&&(we=Dm(we)),he.uponSanitizeAttribute.length>0&&(Ee=Dm(Ee)),t.removed=[];let c=Je&&typeof e!=`string`&&Vt(e);if(c){Pt(e);let t=te(e);if(typeof t==`string`){let n=gt(t);if(!we[n]||ke[n])throw kt(e),Cm(`root node is forbidden and cannot be sanitized in-place`)}if(zt(e))throw kt(e),Cm(`root node is clobbered and cannot be sanitized in-place`);try{nn(e)}catch(t){throw kt(e),t}}else if(Vt(e))i=Ft(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===nh.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),nn(i);else{if(!Ve&&!Fe&&!D&&e.indexOf(`<`)===-1)return ne&&Ue?se(e):e;if(i=Ft(e),!i)return Ve?null:Ue?C:``}i&&Be&&Dt(i.firstChild);let l=c?e:i;try{let e=It(l);for(;o=e.nextNode();)Jt(o,l),en(o,l),Bt(o.content)&&tn(o.content)}catch(n){throw c&&(kt(e),im(t.removed,e=>{e.element&&Mt(e.element)})),n}if(c){let n=!1;if(im(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Mt(t.element))}),n)throw Cm(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return Fe&&Rt(e),e}if(Ve){if(Fe&&Rt(i),He)for(s=fe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(Ee.shadowroot||Ee.shadowrootmode)&&(s=me.call(r,s,!0)),s}let u=D?i.outerHTML:i.innerHTML;return D&&we[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Sm(Xm,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
75
75
|
`+u),Fe&&(u=Lt(u)),ne&&Ue?se(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bt(e),Le=!0,Re=we,ze=Ee},t.clearConfig=function(){_t=null,Le=!1,Re=null,ze=null,ne=re,C=``},t.isValidAttribute=function(e,t,n){_t||bt({});let r=gt(e),i=gt(t);return Yt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&bm(he,e)&&sm(he[e],t)},t.removeHook=function(e,t){if(bm(he,e)){if(t!==void 0){let n=am(he[e],t);return n===-1?void 0:cm(he[e],n,1)[0]}return om(he[e])}},t.removeHooks=function(e){bm(he,e)&&(he[e]=[])},t.removeAllHooks=function(){he=ch()},t}var fh=dh();function ph(e,t){let n;try{n=new URL(e.trim())}catch{return null}return n.protocol!==`https:`&&n.protocol!==`http:`||n.origin===t?null:n.href}var mh=`p.br.hr.strong.b.em.i.del.s.code.pre.blockquote.ul.ol.li.a.h1.h2.h3.h4.h5.h6.small.sub.sup.table.thead.tbody.tr.th.td.img.input`.split(`.`),hh=[`form`,`style`,`script`,`button`,`select`,`textarea`,`iframe`,`object`,`embed`,`svg`,`math`],gh={a:[`href`,`title`],img:[`src`,`alt`,`title`],th:[`colspan`,`rowspan`,`align`],td:[`colspan`,`rowspan`,`align`],ol:[`start`],code:[`class`],input:[`type`,`checked`,`disabled`]},_h=[...new Set(Object.values(gh).flat())],vh=/^language-[\w-]+$/,yh=/^\d{1,4}$/,bh=/^(left|right|center)$/i;function xh(e,t,n){if(!Object.hasOwn(gh,e)||!gh[e].includes(t))return!1;switch(t){case`class`:return vh.test(n);case`type`:return n.toLowerCase()===`checkbox`;case`colspan`:case`rowspan`:case`start`:return yh.test(n);case`align`:return bh.test(n);default:return!0}}var Sh=/^data:image\/(png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/i,Ch=/^\/api(\/|$)/i;function wh(e,t){if(Sh.test(e))return!0;if(!e.trim())return!1;let n;try{n=new URL(e,t)}catch{return!1}return(n.protocol===`https:`||n.protocol===`http:`)&&n.origin===t&&!Ch.test(n.pathname)}fh.isSupported&&fh.addHook(`afterSanitizeAttributes`,e=>{let t=e.nodeName.toLowerCase();for(let{name:n,value:r}of Array.from(e.attributes))xh(t,n,r)||e.removeAttribute(n);if(t===`img`&&!wh(e.getAttribute(`src`)??``,location.origin)){e.replaceWith(document.createTextNode(e.getAttribute(`alt`)??``));return}if(t===`input`){e.getAttribute(`type`)===null?e.remove():e.setAttribute(`disabled`,``);return}if(t!==`a`)return;let n=e.getAttribute(`href`),r=n===null?null:ph(n,location.origin);r?(e.setAttribute(`href`,r),e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)):(e.removeAttribute(`href`),e.removeAttribute(`target`))});var Th={ALLOWED_TAGS:mh,ALLOWED_ATTR:_h,FORBID_TAGS:hh,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1},Eh=new Map;function Dh(e){let t=Eh.get(e);return t===void 0&&(t=fh.sanitize(Rp.parse(e,{async:!1}),Th),Eh.size>400&&Eh.delete(Eh.keys().next().value),Eh.set(e,t)),t}var Oh=`demo.job-runs`,kh=e=>e.status!==`running`&&e.status!==`waiting`,Ah=B(()=>_u.value?.info?.jobs??[]),jh=e=>Ah.value.find(t=>t.id===e),Mh=B(()=>{let e=Pu.value.docs[Oh];return Object.values(e?.items??{}).sort((e,t)=>t.id-e.id)}),Nh=e=>Mh.value.find(t=>t.id===e),Ph=e=>Mh.value.find(t=>t.toolCallId===e),Fh=O(Date.now());setInterval(()=>Fh.value=Date.now(),1e3);var Ih=e=>e<1e3?`${Math.max(0,Math.round(e))}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`,Lh=O();async function Rh(e,t){if(!Lh.value){Lh.value=e;try{return await Gu(t)}finally{Lh.value=void 0}}}function zh(e){ed.value&&rd(),setTimeout(()=>document.querySelector(`[data-job-run="${e}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}async function Bh(e){let t=await Rh(`start:${e.id}`,()=>wu.value.demo(`jobs`,{job:e.id}));t&&(G(`${e.title} started. It runs in the chat.`),zh(t.taskId))}var Vh=(e,t)=>Rh(`decide:${e.id}`,()=>wu.value.demo(`jobs/${e.id}/approval`,{approved:t})),Hh=e=>Rh(`stop:${e.id}`,()=>Tu.value.abortTask(e.id));function Uh(e){U.value&&Eu({...U.value,agentId:e})}var Wh=[`data-job-run`,`aria-label`],Gh={class:`job-run-head`},Kh={class:`job-run-icon`},qh={class:`job-run-titles`},Jh={class:`job-run-eyebrow`},Yh={class:`job-run-repeat`},Xh={key:0,class:`job-run-about`},Zh={class:`job-run-meta`},Qh={key:0,class:`job-run-resumed`},$h={class:`job-stepper`,"aria-label":`Phases`},eg=[`aria-current`],tg={class:`job-chip`},ng={class:`job-step-dot`},rg={class:`job-step-label`},ig={key:0,class:`job-step-progress`},ag={class:`job-phases`},og=[`open`],sg={class:`job-phase-n`},cg={class:`job-phase-summary`},lg={class:`job-phase-time`},ug={key:0,class:`job-phase-about`},dg={key:1,class:`job-steps`},fg=[`open`],pg={key:1,class:`job-step-line`},mg=[`onClick`],hg={key:2,class:`job-phase-empty`},gg={key:1,class:`job-approval`,role:`group`,"aria-label":`Approval`},_g={class:`job-approval-buttons`},vg=[`disabled`],yg=[`disabled`],bg={key:2,class:`message-error`},xg={class:`job-run-foot`},Sg=[`disabled`],Cg=kr({__name:`JobCard`,props:{run:{}},setup(e){let t=e,n=B(()=>jh(t.run.job)),r=B(()=>kh(t.run)),i=B(()=>Ih((t.run.endedAt??Fh.value)-t.run.startedAt)),a={running:`Running`,waiting:`Waiting for you`,completed:`Completed`,failed:`Failed`,aborted:`Stopped`,declined:`Declined`},o={command:el,tool:sl,agent:Qs,state:$s,approval:Xc,checkpoint:mc,note:kc},s=e=>e.kind===`tool`?`${e.label}: a subagent tool call, its own durable task`:e.label,c=e=>{let t=e.step,n=[`command`,`tool`,`state`].includes(t.kind)?so(`code`,{title:s(t)},t.label):so(`span`,{class:`job-step-text`},t.label),r=t.status===`running`?so(Ac,{size:15,class:`spin`}):t.status===`done`?so(tc,{size:15}):t.status===`waiting`?so(xc,{size:15}):so(cl,{size:15});return[so(o[t.kind],{size:16,class:`job-step-kind`}),n,t.kind===`tool`&&t.detail?so(`span`,{class:`job-step-args`,title:t.detail},t.detail):null,so(`span`,{class:`job-step-state`},[r,t.ms!==void 0&&t.kind!==`note`?so(`span`,Ih(t.ms)):null])]};c.props=[`step`];let l=e=>n.value?.phases.find(t=>t.id===e),u=e=>e.startedAt?Ih((e.endedAt??(e.status===`running`||e.status===`waiting`?Fh.value:e.startedAt))-e.startedAt):``,d=e=>e.status!==`pending`&&e.status!==`skipped`,f=B(()=>Object.entries(t.run.input)),p=B(()=>t.run.phases.find(e=>e.status===`waiting`));return(t,o)=>(N(),P(`article`,{class:T([`job-run`,`is-${e.run.status}`]),"data-job-run":e.run.id,"aria-label":`${e.run.title} run ${e.run.run}: ${a[e.run.status]}`},[I(`header`,Gh,[I(`span`,Kh,[L(k(ol),{size:22})]),I(`div`,qh,[I(`div`,Jh,[o[3]||=I(`span`,null,`DURABLE JOB`,-1),I(`span`,Yh,[L(k(qc),{size:15}),R(`Repeatable workflow, run #`+E(e.run.run),1)])]),I(`h3`,null,E(e.run.title),1)]),I(`span`,{class:T([`job-run-status`,e.run.status])},[o[4]||=I(`i`,null,null,-1),R(E(a[e.run.status]),1)],2)]),n.value?(N(),P(`p`,Xh,E(n.value.summary),1)):z(``,!0),I(`div`,Zh,[I(`span`,null,`task #`+E(e.run.id),1),I(`span`,null,E(e.run.startedBy===`agent`?`started by the agent`:`started by you`),1),I(`span`,null,E(i.value),1),(N(!0),P(M,null,j(f.value,([e,t])=>(N(),P(`span`,{key:e,class:`job-run-input`},E(e)+`=`+E(t),1))),128)),e.run.resumed?(N(),P(`span`,Qh,`resumed `+E(e.run.resumed)+`× after restart`,1)):z(``,!0)]),I(`ol`,$h,[(N(!0),P(M,null,j(e.run.phases,(t,n)=>(N(),P(`li`,{key:t.id,class:T(`ph-${t.status}`),"aria-current":e.run.phase===t.id&&!r.value?`step`:void 0},[I(`span`,tg,[I(`span`,ng,[t.status===`done`?(N(),F(k(tc),{key:0,size:15})):t.status===`running`?(N(),F(k(Ac),{key:1,size:15,class:`spin`})):t.status===`waiting`?(N(),F(k(xc),{key:2,size:15})):[`failed`,`aborted`].includes(t.status)?(N(),F(k(cl),{key:3,size:15})):(N(),P(M,{key:4},[R(E(n+1),1)],64))]),I(`span`,rg,E(t.label),1),t.progress?(N(),P(`span`,ig,E(t.progress.done)+`/`+E(t.progress.total),1)):z(``,!0)])],10,eg))),128))]),I(`div`,ag,[(N(!0),P(M,null,j(e.run.phases,(e,t)=>(N(),P(`details`,{key:e.id,class:T([`job-phase`,`ph-${e.status}`]),open:d(e)},[I(`summary`,null,[I(`span`,sg,E(t+1),1),I(`strong`,null,E(e.label),1),I(`span`,cg,E(e.summary??(e.status===`pending`?l(e.id)?.summary:e.status===`skipped`?`Skipped`:``)),1),I(`span`,lg,E(u(e)),1)]),e.status===`done`?z(``,!0):(N(),P(`p`,ug,E(l(e.id)?.summary),1)),e.steps.length?(N(),P(`ul`,dg,[(N(!0),P(M,null,j(e.steps,e=>(N(),P(`li`,{key:e.id,class:T([`k-${e.kind}`,`st-${e.status}`])},[e.detail&&e.kind!==`tool`?(N(),P(`details`,{key:0,open:e.status===`error`},[I(`summary`,null,[L(c,{step:e},null,8,[`step`])]),I(`pre`,null,E(e.detail),1)],8,fg)):(N(),P(`div`,pg,[L(c,{step:e},null,8,[`step`])])),e.kind===`agent`&&e.conversationId?(N(),P(`button`,{key:2,class:`text-button job-step-link`,onClick:t=>k(Uh)(e.conversationId)},` Open subagent #`+E(e.conversationId),9,mg)):z(``,!0)],2))),128))])):e.status===`pending`?(N(),P(`p`,hg,`Not started yet.`)):z(``,!0)],10,og))),128))]),e.run.approval===`pending`?(N(),P(`div`,gg,[I(`div`,null,[L(k(Xc),{size:20}),o[5]||=I(`strong`,null,`Approve to continue`,-1)]),I(`p`,null,E(p.value?l(p.value.id)?.summary:`This run waits for you`)+`. It is paused on a saved checkpoint: close the browser or restart the device and the decision will still be waiting. `,1),I(`div`,_g,[I(`button`,{class:`primary small`,disabled:!!k(Lh),onClick:o[0]||=t=>k(Vh)(e.run,!0)},[L(k(tc),{size:18}),o[6]||=R(`Approve & continue `,-1)],8,vg),I(`button`,{class:`secondary`,disabled:!!k(Lh),onClick:o[1]||=t=>k(Vh)(e.run,!1)},`Decline`,8,yg)])])):z(``,!0),e.run.error&&e.run.status!==`aborted`?(N(),P(`p`,bg,E(e.run.error),1)):z(``,!0),I(`footer`,xg,[I(`span`,null,E(e.run.background?`Runs in the background: the conversation owns it, so Interrupt leaves it running.`:`Owned by this tool call: Interrupt stops it.`)+` Each phase saves a checkpoint, so a restart resumes the current phase.`,1),r.value?z(``,!0):(N(),P(`button`,{key:0,class:`secondary danger`,disabled:!!k(Lh),onClick:o[2]||=t=>k(Hh)(e.run)},[L(k(Ic),{size:16}),o[7]||=R(`Stop `,-1)],8,Sg))])],10,Wh))}}),wg={class:`message-label`},Tg={class:`user-message`},Eg={class:`message-label`},Dg={key:0,class:`streaming`},Og={key:1},kg=[`aria-label`],Ag=[`innerHTML`],jg={key:1,class:`thinking`},Mg=[`data-call-id`],Ng={class:`tool-status`},Pg={class:`tool-section-label`},Fg=[`aria-label`,`onClick`],Ig={key:0,class:`typing`},Lg={key:1,class:`message-error`},Rg=[`aria-label`],zg={key:3,class:`live-tool`},Bg={key:0},Vg={class:`event-line`},Hg=[`aria-label`],Ug={key:0,class:`raw`},Wg=kr({__name:`TranscriptItem`,props:{item:{}},emits:[`fork`],setup(e,{emit:t}){let n=t,r=e=>e.status===`error`?`Error`:e.status===`done`?`Done`:e.status,i=e=>e.kind===`user`?`pi-user`:e.kind===`assistant`?e.streaming?`live-generation`:`pi-assistant`:e.kind===`tool-result`?`pi-tool-result`:e.kind===`tool`?`live-tool-entry`:e.entryKind.replaceAll(`.`,`-`);return(t,a)=>(N(),P(`article`,{class:T([`entry`,i(e.item)])},[e.item.kind===`user`?(N(),P(M,{key:0},[I(`div`,wg,[a[3]||=R(` YOU `,-1),I(`span`,null,`#`+E(e.item.id),1)]),I(`div`,Tg,E(e.item.text),1)],64)):e.item.kind===`assistant`?(N(),P(M,{key:1},[I(`div`,Eg,[a[5]||=R(` AGENT `,-1),e.item.streaming?(N(),P(`span`,Dg,`Working`)):(N(),P(`span`,Og,`#`+E(e.item.id),1)),e.item.streaming?z(``,!0):(N(),P(`button`,{key:2,class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,title:`Fork from this entry. App State stays shared.`,onClick:a[0]||=t=>n(`fork`,e.item.id)},[L(k(yc),{size:18}),a[4]||=R(`Fork `,-1)],8,kg))]),(N(!0),P(M,null,j(e.item.blocks,(e,t)=>(N(),P(M,{key:t},[e.type===`text`?(N(),P(`div`,{key:0,class:`markdown`,innerHTML:k(Dh)(e.text)},null,8,Ag)):e.type===`thinking`?(N(),P(`details`,jg,[a[6]||=I(`summary`,null,`Thinking`,-1),I(`div`,null,E(e.text),1)])):(N(),P(`details`,{key:2,class:T([`tool-call`,{failed:e.call.status===`error`}]),"data-call-id":e.call.callId},[I(`summary`,null,[e.call.status===`error`?(N(),F(k(wc),{key:0,size:18})):e.call.status===`done`?(N(),F(k(tc),{key:1,size:18})):e.call.status===`running`?(N(),F(k(Ws),{key:2,size:18})):(N(),F(k(sl),{key:3,size:18})),I(`strong`,null,E(e.call.name),1),I(`code`,null,E(k(Ju)(e.call.args)?.slice(0,90)),1),I(`span`,Ng,E(r(e.call)),1)]),a[10]||=I(`div`,{class:`tool-section-label`},`Input`,-1),I(`pre`,null,E(k(Ju)(e.call.args)),1),e.call.result===void 0?e.call.output?(N(),P(M,{key:1},[a[9]||=I(`div`,{class:`tool-section-label`},`Live output`,-1),I(`pre`,null,E(e.call.output),1)],64)):z(``,!0):(N(),P(M,{key:0},[I(`div`,Pg,[a[8]||=I(`span`,null,`Result`,-1),e.call.resultEntryId===void 0?z(``,!0):(N(),P(`button`,{key:0,class:`fork-button`,"aria-label":`Fork at entry ${e.call.resultEntryId}`,title:`Fork after this result`,onClick:t=>n(`fork`,e.call.resultEntryId)},[L(k(yc),{size:18}),a[7]||=R(`Fork `,-1)],8,Fg))]),I(`pre`,null,E(e.call.result),1)],64))],10,Mg)),e.type===`tool`&&e.call.name===`run_durable_job`&&k(Ph)(e.call.callId)?(N(),F(Cg,{key:3,run:k(Ph)(e.call.callId)},null,8,[`run`])):z(``,!0)],64))),128)),e.item.streaming&&!e.item.blocks.length?(N(),P(`div`,Ig,[...a[11]||=[I(`i`,null,null,-1),I(`i`,null,null,-1),I(`i`,null,null,-1)]])):z(``,!0),e.item.error?(N(),P(`div`,Lg,E(e.item.error),1)):z(``,!0)],64)):e.item.kind===`tool-result`?(N(),P(`details`,{key:2,class:T([`tool-result`,{failed:e.item.isError}])},[I(`summary`,null,[e.item.isError?(N(),F(k(wc),{key:1,size:18})):(N(),F(k(tc),{key:0,size:18})),I(`strong`,null,E(e.item.name),1),I(`span`,null,E(e.item.isError?`error`:`result`),1),I(`button`,{class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,onClick:a[1]||=Ms(t=>n(`fork`,e.item.id),[`prevent`])},[L(k(yc),{size:18}),a[12]||=R(`Fork `,-1)],8,Rg)]),I(`pre`,null,E(e.item.text),1)],2)):e.item.kind===`tool`?(N(),P(`div`,zg,[I(`div`,null,[L(k(Ws),{size:18}),I(`strong`,null,E(e.item.call.name),1),I(`span`,null,E(e.item.call.status),1)]),e.item.call.output?(N(),P(`pre`,Bg,E(e.item.call.output),1)):z(``,!0),e.item.call.name===`run_durable_job`&&k(Ph)(e.item.call.callId)?(N(),F(Cg,{key:1,run:k(Ph)(e.item.call.callId)},null,8,[`run`])):z(``,!0)])):e.item.entryKind===`demo.job`&&k(Nh)(e.item.data.taskId)?(N(),F(Cg,{key:4,run:k(Nh)(e.item.data.taskId)},null,8,[`run`])):(N(),P(M,{key:5},[I(`div`,Vg,[e.item.entryKind===`demo.state-change`?(N(),F(k($s),{key:0,size:18})):(N(),F(k(Dc),{key:1,size:18})),I(`span`,null,E(e.item.text),1),I(`button`,{class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,onClick:a[2]||=t=>n(`fork`,e.item.id)},[L(k(yc),{size:18}),a[13]||=R(`Fork `,-1)],8,Hg)]),e.item.note?(N(),P(`details`,Ug,[a[14]||=I(`summary`,null,`Context note`,-1),I(`pre`,null,E(e.item.note),1)])):z(``,!0)],64))],2))}}),Gg={key:0,class:`git-chip-wrap`},Kg=[`title`],qg={class:`branch`},Jg={key:0,class:`dirty`},Yg={key:1,class:`ahead`},Xg={key:2,class:`behind`},Zg=kr({__name:`GitChip`,props:{deviceId:{},cwd:{}},setup(e){let t=e,n=B(()=>t.cwd??Su.value?.cwd??``),r=B(()=>t.deviceId??gu.value),i=B(()=>Od(r.value||`?`,n.value||`?`)),a=B(()=>i.value.status),o=B(()=>i.value.loading),s=B(()=>(a.value?.staged??0)+(a.value?.unstaged??0)+(a.value?.untracked??0));return Ad(r.value||`?`,n.value||`?`),Yr(()=>Ad(r.value||`?`,n.value||`?`)),A([r,n],()=>void Ad(r.value||`?`,n.value||`?`)),(e,t)=>a.value?.repo||o.value?(N(),P(`span`,Gg,[I(`button`,{class:`crumb git-chip`,title:a.value?`${a.value.root} · ${a.value.head??``} ${a.value.subject??``} — opens the Git tab`:`loading git…`,onClick:t[0]||=e=>k(nd)(`git`)},[L(k(_c),{size:16,"aria-hidden":`true`}),I(`span`,qg,E(a.value?.branch??a.value?.head??`…`),1),s.value?(N(),P(`span`,Jg,`±`+E(s.value),1)):z(``,!0),a.value?.ahead?(N(),P(`span`,Yg,`↑`+E(a.value.ahead),1)):z(``,!0),a.value?.behind?(N(),P(`span`,Xg,`↓`+E(a.value.behind),1)):z(``,!0),L(k(nc),{size:14,"aria-hidden":`true`})],8,Kg)])):z(``,!0)}}),Qg=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},$g=Qg(Zg,[[`__scopeId`,`data-v-c0fb9e98`]]),e_=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2)}`,t_=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],n_={enabled:!0,reserveTokens:16384,backgroundTokens:32768,keepRecentTokens:2e3},r_={auto:2e5,wait:25e4};function i_(e){if(!(e>0))return{...n_};let t=Math.min(r_.wait,e-n_.reserveTokens),n=Math.min(r_.auto,t-n_.backgroundTokens);return{...n_,reserveTokens:e-t,backgroundTokens:t-n}}function a_(e,t){let n=Math.max(0,e-t.reserveTokens);return{wait:n,auto:t.backgroundTokens>0?Math.max(0,n-t.backgroundTokens):void 0}}var o_=(e,t)=>{if(e===void 0)throw Error(`No ${t} selected`);return e},s_=[{name:`compact`,args:`[instructions]`,description:`Summarize older context; stored entries stay`,run:async e=>{await o_(wu.value,`agent`).compact(e||void 0),G(`Compaction requested. /tasks shows its outcome.`)}},{name:`reset`,args:`[handoff note]`,description:`Start a fresh context; history stays stored`,run:async e=>{await o_(wu.value,`agent`).reset(e||void 0),G(`New context started.`)}},{name:`tasks`,description:`Open the Tasks panel`,run:()=>nd(`tasks`)},{name:`new`,args:`[name]`,description:`New agent in this workspace`,run:async e=>{let t=o_(U.value,`workspace`),n=await o_(Tu.value,`workspace`).createAgent(e?{name:e}:{});Eu({...t,agentId:n.id}),G(`New agent ${n.name}.`)}},{name:`fork`,args:`[entryId] [name]`,description:`Fork at an entry (default: the last reply)`,run:async e=>{let[t,...n]=e.split(/\s+/).filter(Boolean),r=t&&/^\d+$/.test(t)?Number(t):void 0,i=(r===void 0?[t,...n]:n).filter(Boolean).join(` `),a=r??Pu.value.entries.filter(e=>e.kind===`pi.assistant`).at(-1)?.id;if(a===void 0)throw Error(`Nothing to fork yet`);let o=o_(U.value,`agent`),s=await o_(wu.value,`agent`).fork({entryId:a,name:i||void 0});Eu({...o,agentId:s.id}),G(`Forked at entry #${a}. App State stays shared.`)}},{name:`name`,args:`<name>`,description:`Rename this agent`,run:async e=>{if(!e)throw Error(`Usage: /name <name>`);await o_(wu.value,`agent`).rename(e),G(`Agent renamed to ${e}.`)}},{name:`model`,description:`Choose this agent's model`,run:()=>W.dialog={kind:`models`}},{name:`thinking`,args:`<level>`,description:`Thinking level: ${t_.join(`, `)}`,run:async e=>{if(!t_.includes(e))throw Error(`Levels: ${t_.join(`, `)}`);await o_(wu.value,`agent`).configure({thinkingLevel:e}),await Uu(),G(`Thinking ${e}. Used on the next turn.`)}},{name:`help`,description:`How this works, keys and commands`,run:()=>W.dialog={kind:`help`}}];function c_(e){let t=e.trim().match(/^\/(\S+)\s*([\s\S]*)$/),n=t&&s_.find(e=>e.name===t[1]);return n?{command:n,arg:t[2].trim()}:void 0}var l_={class:`composer-region`},u_={key:0,class:`queue`},d_=[`aria-label`,`onClick`],f_={class:`composer`},p_={key:0,class:`slash-menu`,role:`listbox`,"aria-label":`Slash commands`},m_=[`aria-selected`,`onMousedown`],h_={key:0,class:`slash-args`},g_={class:`slash-desc`},__={class:`composer-toolbar`},v_={class:`composer-left`},y_={class:`queue-mode`},b_={class:`composer-right`},x_=[`disabled`],S_=[`disabled`],C_=kr({__name:`Composer`,setup(e){let t=O(`followUp`),n=O(!1),r=B(()=>vu.value&&Pu.value.ready&&bu.status.value===`live`&&lu.value===`live`),i=O(0),a=O(!1),o=B(()=>{let e=W.composer.match(/^\/(\S*)$/);return e&&!a.value?s_.filter(t=>t.name.startsWith(e[1].toLowerCase())):[]});A(()=>W.composer,()=>{i.value=0,W.composer.startsWith(`/`)||(a.value=!1)});async function s(e,t=!1){!e.args||t&&e.args.startsWith(`[`)&&W.composer===`/${e.name}`?(W.composer=`/${e.name}`,await u()):W.composer=`/${e.name} `}function c(e){if(!o.value.length){e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),u());return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=o.value.length;i.value=(i.value+(e.key===`ArrowDown`?1:t-1))%t}else if(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey)s(o.value[i.value],e.key===`Enter`);else if(e.key===`Escape`)a.value=!0;else return;e.preventDefault(),e.stopPropagation()}async function l(e){let t=c_(e);return t?(n.value=!0,await Gu(async()=>{await t.command.run(t.arg),W.composer=``}),n.value=!1,!0):!1}async function u(){let e=W.composer.trim(),i=wu.value;if(!e||n.value||!i||!r.value||e.startsWith(`/`)&&await l(e))return;n.value=!0;let a=U.value,o=`${a.deviceId}/${a.sessionId}/${a.agentId}`,s;try{s=JSON.parse(sessionStorage.getItem(`dpi.pending-send`)??`null`)}catch{}let c=s?.key===o&&s.content===e&&s.mode===t.value?s.requestId:e_();sessionStorage.setItem(`dpi.pending-send`,JSON.stringify({key:o,content:e,mode:t.value,requestId:c})),await Gu(async()=>{await i.send(e,t.value,c),sessionStorage.removeItem(`dpi.pending-send`),W.composer=``}),n.value=!1}function d(e){Gu(()=>wu.value.withdraw(e))}return(e,a)=>(N(),P(`div`,l_,[k(Pu).inbox.length?(N(),P(`div`,u_,[(N(!0),P(M,null,j(k(Pu).inbox,e=>(N(),P(`div`,{key:e.id},[L(k(oc),{size:18}),I(`span`,null,E(e.mode===`steer`?`Steer`:`Queued`)+`: `+E(e.content??`Context update`),1),I(`button`,{class:`icon-button`,"aria-label":`Withdraw submission ${e.id}`,title:`Withdraw queued input`,onClick:t=>d(e.id)},[L(k(cl),{size:18})],8,d_)]))),128))])):z(``,!0),I(`div`,f_,[o.value.length?(N(),P(`ul`,p_,[(N(!0),P(M,null,j(o.value,(e,t)=>(N(),P(`li`,{key:e.name,role:`option`,"aria-selected":t===i.value,class:T({active:t===i.value}),onMousedown:Ms(t=>s(e),[`prevent`])},[I(`code`,null,`/`+E(e.name),1),e.args?(N(),P(`span`,h_,E(e.args),1)):z(``,!0),I(`span`,g_,E(e.description),1)],42,m_))),128))])):z(``,!0),Wn(I(`textarea`,{"onUpdate:modelValue":a[0]||=e=>k(W).composer=e,rows:`2`,placeholder:`Give your agent something to do, or type / for commands…`,"aria-label":`Message your agent`,onKeydown:c},null,544),[[Ss,k(W).composer]]),I(`div`,__,[I(`div`,v_,[I(`div`,y_,[Wn(I(`select`,{"onUpdate:modelValue":a[1]||=e=>t.value=e,"aria-label":`When busy`,title:`Follow-up waits for this run. Steer joins after a tool round.`},[...a[3]||=[I(`option`,{value:`followUp`},`Follow-up`,-1),I(`option`,{value:`steer`},`Steer`,-1),I(`option`,{value:`reject`},`Reject if busy`,-1)]],512),[[Ts,t.value]]),L(k(nc),{size:24,"aria-hidden":`true`})])]),I(`div`,b_,[I(`button`,{class:`interrupt`,disabled:!k(Ru)||k(Zu),title:`Stop foreground work and owned subagents (Escape). Background jobs continue.`,onClick:a[2]||=(...e)=>k(Qu)&&k(Qu)(...e)},[L(k(Ic),{size:24,class:`stop-sign`,fill:`currentColor`}),a[4]||=R(`Interrupt`,-1)],8,x_),I(`button`,{class:`send`,"aria-label":`Send message`,disabled:!k(W).composer.trim()||n.value||!r.value,onClick:u},[L(k(Xs),{size:20})],8,S_)])])]),a[5]||=I(`div`,{class:`composer-footnote`},[I(`span`,null,[I(`i`,{class:`live-dot`}),R(`Closing this window never interrupts your agent.`)])],-1)]))}}),w_={class:`chat-panel`},T_={class:`chat-header`},E_={class:`lineage-picker`},D_={class:`lineage-toolbar`},O_=[`title`],k_={class:`crumb-main`},A_={class:`device-chip`},j_=[`title`],M_={class:`crumb-main`},N_={class:`crumb-name`},P_=[`aria-current`,`title`,`onClick`],F_={class:`crumb-kind`},I_={class:`crumb-main`},L_={class:`crumb-name`},R_=[`disabled`],z_=[`aria-expanded`],B_={key:0,class:`lineage-source`},V_={id:`conversation-picker`,class:`conversation-picker`,role:`dialog`,"aria-label":`Choose conversation`},H_=[`aria-label`,`aria-current`,`onClick`],U_={class:`conversation-choice-content`},W_={class:`choice-lineage`},G_={class:`choice-source`},K_={key:0,class:`agent-stream-status`,role:`alert`},q_=[`disabled`],J_={key:0,class:`chat-empty`},Y_={key:0},X_={key:1},Z_={key:0,class:`chat-empty`},Q_={class:`starter-grid`},$_={key:1,class:`entry live-generation`},ev={class:`message-label`},tv={class:`streaming`},nv={key:2,class:`hint retry-note`},rv=kr({__name:`AgentView`,setup(e){let t=O(),n=O(),r=O(!1),i=B(()=>Pu.value.items),a=B(()=>i.value.some(e=>e.kind===`assistant`&&e.streaming)),o=B(()=>i.value.some(e=>e.kind===`tool`&&e.call.status===`running`||e.kind===`assistant`&&e.blocks.some(e=>e.type===`tool`&&e.call.status===`running`))),s=e=>e.kind===`fork`?`Forked from agent #${e.parentId} at entry #${e.forkedAt}`:e.kind===`subagent`?`Owned by agent #${e.ownerAgentId}`:`Root agent`,c=B(()=>Fu.value.map(e=>({...e,lineage:Cl(Fu.value,e.id)})).sort((e,t)=>{for(let n=0;n<Math.min(e.lineage.length,t.lineage.length);n++)if(e.lineage[n].id!==t.lineage[n].id)return e.lineage[n].id-t.lineage[n].id;return e.lineage.length-t.lineage.length})),l=B(()=>Iu.value.at(-1)),u=e=>e.kind===`root`?`agent`:e.kind;function d(){U.value&&(mu.tree=!0,ku(U.value.deviceId,!0))}function f(){let e=Fu.value.find(e=>e.kind===`root`)??Fu.value[0];e&&p(e.id)}function p(e){r.value=!1,U.value&&Eu({...U.value,agentId:e})}function m(e){let t=wu.value,n=U.value;t&&n&&(W.dialog={kind:`prompt`,title:`Fork conversation`,hint:`${l.value?.name??`Agent #${n.agentId}`} / entry #${e}. Leave the name blank to use Fork #ID.`,label:`Fork name`,optional:!0,placeholder:`e.g. Alternative approach`,submit:`Create fork`,run:async r=>{let i=await t.fork({entryId:e,name:r||void 0});Eu({...n,agentId:i.id}),G(`Forked at entry #${e}. App State stays shared.`)}})}function h(){let e=wu.value,t=l.value;e&&t&&(W.dialog={kind:`prompt`,title:`Rename agent`,label:`Agent name`,value:t.named?t.name:``,placeholder:t.name,submit:`Save name`,run:t=>e.rename(t)})}A(U,()=>{r.value=!1});let g=!0;return A(bu.version,()=>{let e=t.value;g=!e||e.scrollHeight-e.scrollTop-e.clientHeight<120},{flush:`pre`}),A(bu.version,()=>{g&&jn(()=>t.value?.scrollTo({top:t.value.scrollHeight,behavior:`instant`}))}),A(()=>Iu.value.length,()=>void jn(()=>n.value&&(n.value.scrollLeft=n.value.scrollWidth))),(e,g)=>(N(),P(`section`,w_,[I(`header`,T_,[I(`div`,E_,[I(`div`,D_,[I(`nav`,{ref_key:`lineageNav`,ref:n,class:`crumbs conversation-lineage`,"aria-label":`Conversation lineage`},[I(`button`,{class:`crumb`,title:`${k(_u)?.name} · ${k(_u)?.url}`,onClick:d},[g[5]||=I(`span`,{class:`crumb-kind`},`device`,-1),I(`span`,k_,[L(Sd,{device:k(_u),size:18},null,8,[`device`]),I(`span`,A_,E(k(_u)?.name??k(_u)?.id),1)])],8,O_),L(k(rc),{class:`crumb-sep`,size:18,"aria-hidden":`true`}),I(`button`,{class:`crumb`,title:k(Su)?.cwd,onClick:f},[g[6]||=I(`span`,{class:`crumb-kind`},`workspace`,-1),I(`span`,M_,[L(k(hc),{size:18,"aria-hidden":`true`}),I(`span`,N_,E(k(Su)?.name),1)])],8,j_),k(Su)?.cwd?(N(),F($g,{key:0})):z(``,!0),(N(!0),P(M,null,j(k(Iu),e=>(N(),P(M,{key:e.id},[L(k(rc),{class:`crumb-sep`,size:18,"aria-hidden":`true`}),I(`button`,{class:T([`crumb`,{current:e.id===k(U)?.agentId}]),"aria-current":e.id===k(U)?.agentId?`page`:void 0,title:s(e),onClick:t=>p(e.id)},[I(`span`,F_,E(u(e)),1),I(`span`,I_,[e.kind===`fork`?(N(),F(k(yc),{key:0,size:18,"aria-hidden":`true`})):e.kind===`subagent`?(N(),F(k(cc),{key:1,size:18,"aria-hidden":`true`})):(N(),F(k(Mc),{key:2,size:18,"aria-hidden":`true`})),I(`span`,L_,E(e.name),1)])],10,P_)],64))),128))],512),I(`button`,{class:`icon-button`,"aria-label":`Rename agent`,title:`Rename this agent`,disabled:!l.value,onClick:h},[L(k(Hc),{size:18})],8,R_),I(`button`,{class:`icon-button conversation-menu-toggle`,"aria-label":`Browse conversations`,"aria-haspopup":`dialog`,"aria-expanded":r.value,"aria-controls":`conversation-picker`,title:`Browse roots and forks`,onClick:g[0]||=e=>r.value=!r.value},[L(k(nc),{size:18})],8,z_)]),l.value&&l.value.kind!==`root`?(N(),P(`div`,B_,E(s(l.value)),1)):z(``,!0),r.value?(N(),P(M,{key:1},[I(`button`,{class:`conversation-menu-dismiss`,"aria-label":`Close conversation picker`,onClick:g[1]||=e=>r.value=!1}),I(`section`,V_,[g[7]||=I(`div`,{class:`conversation-picker-heading`},`Roots & forks`,-1),(N(!0),P(M,null,j(c.value,e=>(N(),P(`button`,{key:e.id,class:T([`conversation-choice`,{selected:e.id===k(U)?.agentId}]),"aria-label":e.lineage.map(e=>e.name).join(` → `),"aria-current":e.id===k(U)?.agentId?`page`:void 0,onClick:t=>p(e.id)},[I(`div`,U_,[I(`span`,W_,[(N(!0),P(M,null,j(e.lineage,(t,n)=>(N(),P(M,{key:t.id},[n?(N(),F(k(rc),{key:0,size:18,"aria-hidden":`true`})):z(``,!0),I(`span`,{class:T({"choice-ancestor":n<e.lineage.length-1})},E(t.name),3)],64))),128))]),I(`span`,G_,E(s(e)),1)]),e.id===k(U)?.agentId?(N(),F(k(tc),{key:0,size:18,"aria-hidden":`true`})):e.kind===`fork`?(N(),F(k(yc),{key:1,size:18,"aria-hidden":`true`})):(N(),F(k(Mc),{key:2,size:18,"aria-hidden":`true`}))],10,H_))),128))])],64)):z(``,!0)])]),k(bu).fault.value||k(bu).status.value===`fault`||k(bu).status.value===`reconnecting`||k(Pu).ready&&k(bu).status.value===`connecting`?(N(),P(`div`,K_,[I(`div`,null,[I(`strong`,null,E(k(Pu).ready?`Cached transcript is stale.`:`Agent stream unavailable.`),1),I(`p`,null,E(k(bu).fault.value||`Updates are paused while the stream reconnects.`),1),g[8]||=I(`p`,null,`Sending is paused until a fresh snapshot arrives. Your draft is kept.`,-1)]),I(`button`,{disabled:k(bu).status.value===`connecting`,onClick:g[2]||=(...e)=>k(bu).retry&&k(bu).retry(...e)},` Retry stream `,8,q_)])):z(``,!0),I(`div`,{ref_key:`chat`,ref:t,class:`chat-scroll`,"data-testid":`chat`},[k(Pu).ready?(N(),P(M,{key:1},[i.value.length?z(``,!0):(N(),P(`div`,Z_,[g[13]||=I(`div`,{class:`agent-orb`},[I(`img`,{src:`/icons/durable-pi.svg`,alt:`Durable Pi`}),I(`i`)],-1),g[14]||=I(`span`,{class:`eyebrow`},`YOUR DURABLE AGENT IS READY`,-1),g[15]||=I(`h2`,null,`A conversation with continuity.`,-1),I(`p`,null,`Messages, tools and state live on `+E(k(_u)?.id)+`, beyond this window.`,1),I(`div`,Q_,[I(`button`,{onClick:g[3]||=e=>k(Ku)(`Inspect this directory using your tools and give me a brief overview. Do not modify any files.`)},[L(k(hc),{size:18}),g[9]||=I(`strong`,null,`Explore this directory`,-1),g[10]||=I(`span`,null,`See coding tools in action`,-1),L(k(Ys),{size:18})]),I(`button`,{onClick:g[4]||=e=>k(Ku)(`Use read_state, then update_state to add a field called progress with value 1 and a boolean called ready with value false.`)},[L(k($s),{size:18}),g[11]||=I(`strong`,null,`Make a state change`,-1),g[12]||=I(`span`,null,`Watch the workspace update`,-1),L(k(Ys),{size:18})])])])),(N(!0),P(M,null,j(i.value,e=>(N(),F(Wg,{key:e.id,item:e,onFork:m},null,8,[`item`]))),128)),k(Pu).running&&!a.value&&!o.value?(N(),P(`div`,$_,[I(`div`,ev,[g[16]||=R(` AGENT `,-1),I(`span`,tv,E(k(Pu).retry?`Retry scheduled`:`Working`),1)]),g[17]||=I(`div`,{class:`typing`},[I(`i`),I(`i`),I(`i`)],-1)])):z(``,!0),k(Pu).retry?(N(),P(`p`,nv,` Retrying: `+E(k(Pu).retry.error),1)):z(``,!0),(N(!0),P(M,null,j(k(Pu).notices,(e,t)=>(N(),P(`p`,{key:t,class:`message-error`},E(e),1))),128))],64)):(N(),P(`div`,J_,[L(k(Ws),{size:30}),k(bu).status.value===`fault`?(N(),P(`h2`,Y_,`This agent is unavailable.`)):(N(),P(`h2`,X_,`Connecting to the agent…`)),I(`p`,null,`The agent keeps working on `+E(k(_u)?.id)+` while this view connects.`,1)]))],512),L(C_)]))}});function iv(e,t){return`${e}/${t.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`}var av=[`data-state-path`],ov={key:0,class:`state-field-heading`},sv=[`value`,`aria-label`,`disabled`],cv=[`value`],lv=[`aria-label`,`disabled`],uv=[`aria-label`,`disabled`],dv=[`aria-label`,`disabled`],fv=[`value`],pv=[`disabled`],mv=[`disabled`,`aria-label`],hv={key:2,class:`state-number`},gv=[`aria-label`,`disabled`],_v=[`aria-label`,`disabled`],vv=[`aria-label`,`disabled`],yv={key:3,class:`state-boolean`},bv=[`aria-label`,`aria-checked`,`disabled`],xv=[`aria-label`,`disabled`],Sv={key:5,class:`muted`},Cv=kr({__name:`StateEditor`,props:{value:{type:[String,Number,Boolean,null,Array,Object]},path:{default:``},label:{default:`App State`},disabled:{type:Boolean}},emits:[`change`],setup(e,{emit:t}){let n=e,r=t,i=B(()=>n.value===null?`null`:Array.isArray(n.value)?`array`:typeof n.value),a=B(()=>i.value===`object`||i.value===`array`),o=B(()=>a.value?Object.entries(n.value):[]),s=O(``),c=O(!1),l=O(``),u=O(`string`),d=O(!1),f=[`string`,`number`,`boolean`,`object`,`array`,`null`],p={string:()=>``,number:()=>0,boolean:()=>!1,object:()=>({}),array:()=>[],null:()=>null};A(()=>n.value,e=>{c.value||(s.value=String(e??``))},{immediate:!0});function m(e,t){r(`change`,{operation:e,path:n.path,value:t})}function h(){c.value=!1;let e=i.value===`number`?Number(s.value):s.value;if(i.value===`number`&&(!String(s.value).trim()||!Number.isFinite(e))){s.value=String(n.value);return}e!==n.value&&m(`update`,e)}function g(){let e=i.value===`array`?`-`:l.value.trim();e&&(r(`change`,{operation:`create`,path:iv(n.path,e),value:p[u.value]()}),l.value=``,d.value=!1)}return(t,n)=>{let _=ei(`StateEditor`,!0);return N(),P(`div`,{class:T([`state-field`,{"state-root":e.path===``}]),"data-state-path":e.path},[e.path===``?z(``,!0):(N(),P(`div`,ov,[I(`strong`,null,E(e.label),1),I(`select`,{value:i.value,"aria-label":`Type of ${e.path}`,disabled:e.disabled,onChange:n[0]||=e=>m(`update`,p[e.target.value]())},[(N(),P(M,null,j(f,e=>I(`option`,{key:e,value:e},E(e),9,cv)),64))],40,sv),I(`button`,{class:`icon-button`,"aria-label":`Delete ${e.path}`,title:`Delete field`,disabled:e.disabled,onClick:n[1]||=e=>m(`delete`)},[L(k(tl),{size:18})],8,lv)])),a.value?(N(),P(M,{key:1},[(N(!0),P(M,null,j(o.value,([t,i])=>(N(),F(_,{key:t,value:i,path:k(iv)(e.path,t),label:t,disabled:e.disabled,onChange:n[2]||=e=>r(`change`,e)},null,8,[`value`,`path`,`label`,`disabled`]))),128)),d.value&&i.value===`array`?(N(),P(`form`,{key:0,class:`state-add`,onSubmit:Ms(g,[`prevent`])},[i.value===`array`?z(``,!0):Wn((N(),P(`input`,{key:0,"onUpdate:modelValue":n[3]||=e=>l.value=e,placeholder:`Field name`,"aria-label":`New field name in ${e.path||`/`}`,required:``,disabled:e.disabled},null,8,uv)),[[Ss,l.value]]),Wn(I(`select`,{"onUpdate:modelValue":n[4]||=e=>u.value=e,"aria-label":`New field type in ${e.path||`/`}`,disabled:e.disabled},[(N(),P(M,null,j(f,e=>I(`option`,{key:e,value:e},E(e),9,fv)),64))],8,dv),[[Ts,u.value]]),I(`button`,{class:`secondary small`,disabled:e.disabled||i.value!==`array`&&!l.value.trim()},` Add `,8,pv),I(`button`,{type:`button`,class:`text-button`,onClick:n[5]||=e=>d.value=!1},`Cancel`)],32)):i.value===`array`?(N(),P(`button`,{key:1,class:`text-button state-add-button`,disabled:e.disabled,"aria-label":`Add ${i.value===`array`?`item`:`field`} to ${e.path||`/`}`,onClick:n[6]||=e=>d.value=!0},[L(k(Wc),{size:18}),R(E(i.value===`array`?`Add item`:`Add field`),1)],8,mv)):z(``,!0)],64)):i.value===`number`?(N(),P(`div`,hv,[I(`button`,{class:`secondary`,"aria-label":`Decrement ${e.path}`,disabled:e.disabled,onClick:n[7]||=e=>m(`increment`,-1)},[L(k(Nc),{size:18})],8,gv),Wn(I(`input`,{"onUpdate:modelValue":n[8]||=e=>s.value=e,type:`number`,step:`any`,"aria-label":`Value of ${e.path}`,disabled:e.disabled,onFocus:n[9]||=e=>c.value=!0,onBlur:h,onKeydown:n[10]||=Ps(e=>e.target.blur(),[`enter`])},null,40,_v),[[Ss,s.value]]),I(`button`,{class:`secondary`,"aria-label":`Increment ${e.path}`,disabled:e.disabled,onClick:n[11]||=e=>m(`increment`,1)},[L(k(Wc),{size:18})],8,vv)])):i.value===`boolean`?(N(),P(`div`,yv,[I(`button`,{class:T([`switch`,{on:e.value===!0}]),role:`switch`,"aria-label":`Value of ${e.path}`,"aria-checked":e.value===!0,disabled:e.disabled,onClick:n[12]||=t=>m(`update`,!e.value)},[...n[15]||=[I(`span`,null,null,-1)]],10,bv),I(`span`,null,E(e.value),1)])):i.value===`string`?Wn((N(),P(`textarea`,{key:4,"onUpdate:modelValue":n[13]||=e=>s.value=e,rows:`2`,"aria-label":`Value of ${e.path}`,disabled:e.disabled,onFocus:n[14]||=e=>c.value=!0,onBlur:h},null,40,xv)),[[Ss,s.value]]):(N(),P(`span`,Sv,`null`))],10,av)}}}),wv=[`data-status`],Tv=[`title`],Ev=[`title`],Dv=[`href`],Ov=[`title`],kv=kr({__name:`TunnelStatusBar`,props:{device:{}},setup(e){let t=e,n=B(()=>t.device.status===`online`),r=B(()=>t.device.transport===`tunnel`),i=B(()=>n.value?r.value?`online · via tunnel`:`online · LAN`:r.value?`tunnel`:`LAN`),a=B(()=>t.device.tunnel?.state===`connected`);return(t,o)=>(N(),P(`span`,{class:`tunnel-status`,"data-status":e.device.status},[I(`span`,{class:`axis transport`,title:r.value?`Hub ⇄ device over the tunnel (WSS)`:`Hub → device over LAN`},[r.value?(N(),F(k(ec),{key:0,size:13,class:T({live:a.value})},null,8,[`class`])):(N(),F(k(al),{key:1,size:13,class:T({live:n.value})},null,8,[`class`])),R(` `+E(i.value),1)],8,Tv),I(`span`,{class:T([`axis monitor`,e.device.status])},[e.device.status===`offline`?(N(),F(k(il),{key:0,size:13})):(N(),P(M,{key:1},[R(E(e.device.status),1)],64))],2),r.value&&a.value&&e.device.tunnel?(N(),P(`span`,{key:0,class:`axis muted`,title:`tunnel last seen ${k(Xu)(e.device.tunnel.lastSeenAt)}`},E(e.device.tunnel.readerCount)+` reader`+E(e.device.tunnel.readerCount===1?``:`s`),9,Ev)):z(``,!0),e.device.url?(N(),P(`a`,{key:1,class:`axis url`,href:e.device.url,target:`_blank`,rel:`noreferrer`},E(e.device.url),9,Dv)):z(``,!0),e.device.lastSeenAt?(N(),P(`span`,{key:2,class:`axis muted`,title:`last probe ${k(Xu)(e.device.lastSeenAt)}`},E(k(Xu)(e.device.lastSeenAt)),9,Ov)):z(``,!0)],8,wv))}});async function Av(e,t,n,r,i){let a=await fetch(`/api${t}`,{method:e,headers:n===void 0?{}:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n),signal:r,...i?{keepalive:i}:{}}),o=await a.json().catch(()=>void 0);if(!a.ok){let e=o?.error;throw new Ll(e?.code??`internal`,e?.message??`${a.status} ${a.statusText}`,a.status)}return o}function jv(e){return e.offerUrl??e.pairUrl}var Mv={pending:e=>Av(`GET`,`/pair/codes`,void 0,e),pairings:e=>Av(`GET`,`/pairings`,void 0,e),createCode:e=>Av(`POST`,`/pair/code`,{},e),resolveCode:(e,t)=>Av(`POST`,`/pair/resolve`,{code:e},t),codeState:(e,t)=>Av(`GET`,`/pair/codes/${encodeURIComponent(e)}`,void 0,t),approve:(e,t,n)=>Av(`POST`,`/pair/codes/${encodeURIComponent(e)}/approve`,t,n),cancel:(e,t,n)=>Av(`POST`,`/pair/codes/${encodeURIComponent(e)}/cancel`,{},t,n),rotate:(e,t)=>Av(`POST`,`/pairings/${encodeURIComponent(e)}/rotate`,{},t),revoke:(e,t=`user`,n)=>Av(`POST`,`/pairings/${encodeURIComponent(e)}/revoke`,{reason:t},n)},Nv=0;function Pv(){let e=++Nv,t=!1;return{gen:e,close:()=>t=!0,closed:()=>t}}var Fv=class extends Error{codeId;constructor(e){super(`pairing poll timed out for ${e}`),this.codeId=e,this.name=`PollTimeout`}},Iv=e=>e===`issued`||e===`cancelled`||e===`expired`;async function Lv(e,t,n={}){let r=n.intervalMs??1e3,i=Date.now()+(n.timeoutMs??33e4);for(;;){if(e.closed())return;if(n.signal?.aborted)throw new DOMException(`The operation was aborted.`,`AbortError`);if(Date.now()>i)throw new Fv(t);let a=await Mv.codeState(t,n.signal);if(e.closed())return;if(e.state=a,n.onState?.(a),Iv(a.phase))return a;await new Promise(e=>setTimeout(e,r))}}var Rv={key:0,class:`token-manager`,"aria-label":`Credential manager`},zv={class:`credential-fingerprint`},Bv=[`title`],Vv={key:0,class:`rotation-badge`,role:`status`},Hv={class:`token-actions`},Uv=[`disabled`],Wv=[`disabled`],Gv={key:1,class:`message-error`,role:`alert`},Kv=kr({__name:`TokenManager`,props:{device:{}},setup(e){let t=e,n=O(!1),r=O(``),i=B(()=>t.device.pairing);async function a(){if(!n.value){n.value=!0,r.value=``;try{await Mv.rotate(t.device.id),G(`Rotation queued — it completes when the device acknowledges the new credential.`)}catch(e){r.value=Ql(e)}finally{n.value=!1}}}async function o(){n.value||(W.dialog={kind:`prompt`,title:`Revoke ${t.device.id}?`,hint:`Every tunnel credential for this device dies at commit and the live tunnel is cut within a second. The device cleans its own files the next time it talks to the hub.`,submit:`Revoke`,danger:!0,run:async()=>{await Mv.revoke(t.device.id,`user`),G(`Revoke committed on the hub. The tunnel is cut; the device cleans up on its next contact.`)}})}return(e,t)=>i.value?(N(),P(`section`,Rv,[I(`header`,null,[L(k(Tc),{size:15}),t[0]||=I(`h3`,null,`Credential`,-1),I(`span`,{class:T([`pairing-status`,i.value.status])},E(i.value.status),3)]),I(`dl`,null,[t[1]||=I(`dt`,null,`Key fingerprint`,-1),I(`dd`,null,[I(`code`,zv,E(i.value.keyFingerprint),1)]),t[2]||=I(`dt`,null,`Paired`,-1),I(`dd`,{title:new Date(i.value.pairedAt).toISOString()},E(k(Xu)(i.value.pairedAt)),9,Bv),t[3]||=I(`dt`,null,`Generation`,-1),I(`dd`,null,E(i.value.credentialGeneration),1)]),i.value.rotationPending?(N(),P(`p`,Vv,[L(k(Kc),{size:13,class:`spin`}),t[4]||=R(` rotation queued — waiting for the device to ACK `,-1)])):z(``,!0),I(`div`,Hv,[i.value.status===`paired`?(N(),P(`button`,{key:0,class:`small`,disabled:n.value||i.value.rotationPending,onClick:a},[L(k(Kc),{size:14}),t[5]||=R(` Rotate credential `,-1)],8,Uv)):z(``,!0),i.value.status===`paired`?(N(),P(`button`,{key:1,class:`small danger`,disabled:n.value,onClick:o},[L(k(Zc),{size:14}),t[6]||=R(` Revoke `,-1)],8,Wv)):z(``,!0)]),r.value?(N(),P(`p`,Gv,E(r.value),1)):z(``,!0)])):z(``,!0)}}),qv={class:`tasks-panel`},Jv={class:`panel-heading`},Yv={class:`tag`},Xv={key:0,class:`message-error`,role:`alert`},Zv={class:`task-section`,"aria-label":`Durable jobs`},Qv={key:0,class:`task-empty`},$v=[`data-job`],ey={class:`job-def-head`},ty={key:0,class:`tag`},ny={class:`tag`},ry=[`aria-label`],iy=[`title`],ay={class:`job-def-meta`},oy=[`title`],sy=[`title`],cy={key:0,class:`job-def-last`},ly=[`onClick`],uy=[`disabled`,`onClick`],dy=[`disabled`,`onClick`],fy=[`disabled`,`onClick`],py={class:`task-section`,"aria-label":`Agent activity`},my={class:`panel-heading`},hy={key:0,class:`task-empty`},gy={key:1,class:`task-tree`},_y=[`data-task-kind`],vy={class:`tag`},yy={key:0,class:`task-phase`},by=[`onClick`],xy=[`disabled`],Sy={class:`raw`},Cy=kr({__name:`TasksPanel`,setup(e){let t=O(``),n=O(!1),r=O([]),i=O(),a=e=>({running:`Running`,waiting:`Waiting`,completed:`Completed`,aborted:`Stopped`,declined:`Declined`,failed:`Failed`,pending:`Queued`,completing:`Finishing`,terminal:`Finished`})[e]??e,o=B(()=>new Map(Ah.value.map(e=>[e.id,Mh.value.find(t=>t.job===e.id)]))),s=B(()=>{let e=Lu.value,t=new Set(e.map(e=>e.id)),n=new Map;for(let r of e){let e=r.owner!==void 0&&t.has(r.owner)?r.owner:void 0;n.set(e,[...n.get(e)??[],r])}let r=[],i=(e,t)=>{for(let a of(n.get(e)??[]).sort((e,t)=>e.id-t.id))r.push({task:a,depth:t}),i(a.id,t+1)};return i(void 0,0),r}),c=e=>e.kind===`pi.tool`?{icon:sl,name:e.label??`Tool call`,what:`tool call`}:e.kind===`pi.generation`?{icon:Qs,name:`Model response`,what:`generation`}:e.kind===`pi.compaction`?{icon:Dc,name:`Compaction`,what:`compaction`}:e.kind.startsWith(`demo.job.`)?{icon:ol,name:e.label??jh(e.kind.slice(9))?.title??e.kind,what:`durable job`}:e.kind===`demo.job-approval`?{icon:Xc,name:`Approval`,what:`waits for you`}:{icon:Ws,name:e.label??e.kind,what:e.kind},l=e=>e.state.phase?e.kind.startsWith(`demo.job.`)?jh(e.kind.slice(9))?.phases.find(t=>t.id===e.state.phase)?.label??e.state.phase:e.state.phase:``;async function u(){if(!n.value&&wu.value){n.value=!0,t.value=``;try{await wu.value.abort(!0)}catch(e){t.value=Ql(e)}finally{n.value=!1}}}async function d(e){let n=Tu.value;if(e.target.open&&n)try{let[e,t]=await Promise.all([n.tasks(`terminal`,40),n.inspect()]);r.value=e,i.value=t}catch(e){t.value=Ql(e)}}let f=B(()=>r.value.filter(e=>e.state.status===`terminal`).slice(-12).reverse());return(e,r)=>(N(),P(`div`,qv,[I(`div`,Jv,[r[0]||=I(`h2`,null,`Tasks`,-1),I(`span`,Yv,E(k(Lu).length)+` active`,1)]),t.value?(N(),P(`p`,Xv,E(t.value),1)):z(``,!0),I(`section`,Zv,[I(`h3`,null,[L(k(qc),{size:18}),r[1]||=R(`Durable jobs`,-1)]),r[2]||=I(`p`,{class:`hint`},[R(` Repeatable workflows with named phases. Every run follows the same phases and saves a checkpoint after each one. Start one here, or ask your agent: it finds these with `),I(`code`,null,`list_durable_jobs`),R(`, starts them with `),I(`code`,null,`run_durable_job`),R(` and checks them with `),I(`code`,null,`check_durable_job`),R(`. Runs play out live in the chat. `)],-1),k(Ah).length?z(``,!0):(N(),P(`p`,Qv,` This device has no durable jobs. Deploy the latest backend to it. `)),(N(!0),P(M,null,j(k(Ah),e=>(N(),P(`article`,{key:e.id,class:`job-def`,"data-job":e.id},[I(`div`,ey,[L(k(ol),{size:18}),I(`strong`,null,E(e.title),1),e.approval?(N(),P(`span`,ty,`needs approval`)):z(``,!0),I(`span`,ny,`~`+E(e.seconds)+`s`,1)]),I(`p`,null,E(e.summary),1),I(`ol`,{class:`job-chain`,"aria-label":`${e.title} phases`},[(N(!0),P(M,null,j(e.phases,(e,t)=>(N(),P(`li`,{key:e.id,title:e.summary},[I(`span`,null,E(t+1),1),R(E(e.label),1),e.kind===`repeat`?(N(),F(k(qc),{key:0,size:13})):z(``,!0),e.kind===`approval`?(N(),F(k(Xc),{key:1,size:13})):z(``,!0)],8,iy))),128))],8,ry),I(`div`,ay,[(N(!0),P(M,null,j(e.inputs,e=>(N(),P(`code`,{key:e.name,title:e.description},E(e.name)+`=`+E(e.default),9,oy))),128)),I(`code`,{title:`Each run saves its result to App State ${e.resultPath}`},`→ `+E(e.resultPath),9,sy)]),o.value.get(e.id)?(N(),P(`div`,cy,[I(`span`,null,[R(`Run #`+E(o.value.get(e.id).run)+`: `,1),I(`strong`,null,E(a(o.value.get(e.id).status)),1),k(kh)(o.value.get(e.id))?z(``,!0):(N(),P(M,{key:0},[R(` in `+E(o.value.get(e.id).phases.find(t=>t.id===o.value.get(e.id).phase)?.label),1)],64))]),I(`button`,{class:`text-button`,onClick:t=>k(zh)(o.value.get(e.id).id)},` Show in chat `,8,ly),o.value.get(e.id).approval===`pending`?(N(),P(M,{key:0},[I(`button`,{class:`primary small`,disabled:!!k(Lh),onClick:t=>k(Vh)(o.value.get(e.id),!0)},` Approve `,8,uy),I(`button`,{class:`secondary`,disabled:!!k(Lh),onClick:t=>k(Vh)(o.value.get(e.id),!1)},` Decline `,8,dy)],64)):z(``,!0)])):z(``,!0),I(`button`,{class:`secondary job-def-run`,disabled:!!k(Lh)||!k(wu),onClick:t=>k(Bh)(e)},[L(k(Uc),{size:16}),R(`Run `+E(e.title),1)],8,fy)],8,$v))),128))]),I(`section`,py,[I(`div`,my,[r[3]||=I(`h3`,null,`Agent activity`,-1),L(k(Ws),{size:18})]),r[5]||=I(`p`,{class:`hint`},` Every model response and every tool call is its own durable task with an id, an owner and a checkpoint. Follow them live here; after a restart each one resumes or reports how it ended. `,-1),s.value.length?(N(),P(`ul`,gy,[(N(!0),P(M,null,j(s.value,({task:e,depth:t})=>(N(),P(`li`,{key:e.id,class:`task-row`,style:_e({"--depth":t}),"data-task-kind":e.kind},[(N(),F(ni(c(e).icon),{size:16})),I(`strong`,null,E(c(e).name),1),I(`span`,vy,E(a(e.state.status)),1),l(e)?(N(),P(`span`,yy,E(l(e)),1)):z(``,!0),I(`small`,null,`#`+E(e.id)+` `+E(c(e).what)+`, agent #`+E(e.conversationId)+E(e.effectiveBackground?`, background`:``),1),(N(!0),P(M,null,j(e.conversations,e=>(N(),P(`button`,{key:e,class:`text-button`,onClick:t=>k(Uh)(e)},` Open agent #`+E(e),9,by))),128))],12,_y))),128))])):(N(),P(`p`,hy,`Nothing running. Send a message or run a job.`)),r[6]||=I(`p`,{class:`hint`},` Interrupt or Esc stops foreground work and what it owns. Stop all also stops background runs. `,-1),I(`button`,{class:`secondary danger`,disabled:!k(Lu).length||n.value,onClick:u},[L(k(Ic),{size:18}),r[4]||=R(`Stop all `,-1)],8,xy)]),I(`details`,{class:`raw task-section`,onToggle:d},[I(`summary`,null,[L(k(oc),{size:18}),r[7]||=R(`Runtime details`,-1)]),r[9]||=I(`p`,{class:`hint`},` Recent task results and recovery records, read from the device when opened. `,-1),(N(!0),P(M,null,j(f.value,e=>(N(),P(`details`,{key:e.id,class:`raw`},[I(`summary`,null,[R(E(e.kind)+` #`+E(e.id),1),I(`span`,null,E(a(e.state.outcome?.status??e.state.status)),1)]),I(`pre`,null,E(JSON.stringify(e.state.outcome,null,2)),1)]))),128)),I(`details`,Sy,[r[8]||=I(`summary`,null,`Recovery inspection`,-1),I(`pre`,null,E(JSON.stringify(i.value,null,2)),1)])],32)]))}}),wy={class:`git-pane`},Ty={key:0,class:`hint`},Ey={key:0,class:`hint`},Dy={key:1,class:`muted-line`},Oy={key:2,class:`message-error`},ky={key:0,class:`hint`},Ay={key:0,class:`message-error merge-banner`},jy=[`disabled`],My={class:`panel-heading git-top`},Ny={class:`branch-wrap`},Py=[`disabled`],Fy={key:0,class:`menu`},Iy=[`onClick`],Ly={class:`muted-line`},Ry={class:`new-branch`},zy=[`disabled`],By={class:`auto-stash`},Vy={class:`tag`},Hy={key:0,class:`tag`},Uy={key:1,class:`tag`},Wy={key:2,class:`tag`,title:`vs the picked base`},Gy={class:`tag`},Ky=[`href`],qy=[`disabled`],Jy={class:`row ops`},Yy=[`disabled`],Xy=[`disabled`],Zy=[`disabled`],Qy=[`disabled`],$y=[`disabled`],eb={key:1,class:`message-error hintbox`},tb=[`disabled`],nb=[`disabled`],rb={key:2,class:`message-error hintbox`},ib=[`disabled`],ab={class:`task-section`,"aria-label":`Commit`},ob={class:`panel-heading`},sb={class:`tag`},cb=[`disabled`],lb=[`disabled`],ub={key:0,class:`hintbox warn`},db={key:1,class:`cps turns`},fb={key:0,class:`hint`},pb={class:`muted-line`},mb={class:`cp-subj`},hb={key:2,class:`muted-line cap`},gb={key:3,class:`files conflicts`},_b={class:`file all`},vb={class:`muted-line conflict-head`},yb={class:`file-label`},bb={class:`xy`},xb=[`title`],Sb={class:`file-acts`},Cb=[`onClick`],wb=[`disabled`,`onClick`],Tb=[`disabled`,`onClick`],Eb={key:4,class:`files`},Db={class:`file all`},Ob=[`checked`],kb={class:`muted-line`},Ab=[`onClick`],jb={class:`muted-line`},Mb={class:`file-label`},Nb=[`checked`,`onChange`],Pb=[`title`],Fb=[`title`],Ib={class:`file-acts`},Lb=[`onClick`],Rb=[`onClick`],zb=[`onClick`],Bb={key:5,class:`files`},Vb={class:`file all`},Hb=[`checked`],Ub={class:`muted-line`},Wb=[`onClick`],Gb={class:`muted-line`},Kb={class:`file-label`},qb=[`checked`,`onChange`],Jb=[`title`],Yb=[`title`],Xb={class:`file-acts`},Zb=[`onClick`],Qb=[`onClick`],$b=[`onClick`],ex=[`onClick`],tx=[`onClick`],nx={key:6,class:`file-diff`},rx={class:`mode-chips`},ix={key:0,class:`nums bin`},ax={key:1,class:`nums`},ox={key:2},sx={class:`row`},cx=[`disabled`],lx=[`disabled`],ux=[`disabled`],dx={class:`task-section`,"aria-label":`Log`},fx={class:`panel-heading`},px=[`disabled`],mx=[`disabled`],hx=[`disabled`],gx={key:0,class:`cps`},_x={key:0,class:`hint`},vx={class:`muted-line`},yx={class:`cp-subj`},bx=[`disabled`,`onClick`],xx={key:1,class:`hint`},Sx={key:2,class:`commits`},Cx=[`title`],wx=[`width`],Tx=[`x1`,`x2`],Ex=[`x1`,`x2`,`stroke`],Dx=[`cx`,`fill`],Ox=[`onClick`],kx={class:`hash`},Ax=[`href`],jx={key:1,class:`refs`},Mx={class:`subject`},Nx={class:`muted-line who`},Px={key:0,class:`commit-files`},Fx=[`data-s`],Ix={class:`path`},Lx={key:0,class:`hint`},Rx={key:3,class:`message-error`},zx={key:4,class:`hint`},Bx={class:`task-section`,"aria-label":`Worktrees`},Vx={class:`panel-heading`},Hx={class:`branch-wrap`},Ux=[`disabled`],Wx={key:0,class:`menu`},Gx=[`onClick`],Kx={class:`new-branch`},qx=[`disabled`],Jx=[`title`],Yx={class:`muted-line`},Xx=[`disabled`,`onClick`],Zx=[`disabled`,`onClick`],Qx=[`disabled`,`onClick`],$x={key:3,class:`task-section`,"aria-label":`Pull requests`},eS={class:`panel-heading`},tS=[`disabled`],nS=[`disabled`],rS={key:0,class:`hint`},iS={key:1,class:`commits`},aS={class:`hash`},oS={class:`subject`},sS={class:`muted-line who`},cS=[`disabled`,`onClick`],lS=[`disabled`,`onClick`],uS=[`disabled`,`onClick`],dS=[`href`],fS={key:4,class:`op-out`},pS=[`placeholder`],mS={class:`row`},hS=[`disabled`],gS=Qg(kr({__name:`GitPanel`,props:{deviceId:{},cwd:{}},setup(e){let t=e,n=B(()=>t.cwd??Su.value?.cwd??``),r=B(()=>t.deviceId??gu.value),i=B(()=>Od(r.value||`?`,n.value||`?`)),a=B(()=>i.value.status),o=B(()=>i.value.loading),s=B(()=>i.value.refreshing),c=B(()=>i.value.error),l=B(()=>{let e=Su.value;return e&&e.cwd===n.value&&!t.deviceId?e.id:void 0}),u=O(``),d=O(``),f=O(``),p=O(new Set),m=O(!1),h=O(!1),g=O(``),_=O(null),v=O(`working`),y=B(()=>`dpi-git-draft:${r.value}:${n.value}`),b=O(null),ee=O(!0),x=O(``),S=O(!1),te=O([]),ne=B(()=>{if(!te.value.length||!n.value)return null;let e=e=>e.startsWith(`/`)||e.includes(`:\\`)?e:`${n.value}/${e}`,t=new Set(te.value);return{changed:(a.value?.files??[]).filter(n=>t.has(e(n.path))).length,total:te.value.length}}),C=O(null),re=O(``),ie=e=>{re.value=e.input?.value??``,C.value=e},ae=()=>{let e=C.value;C.value=null,e&&e.action(re.value)};window.addEventListener(`keydown`,e=>{e.key===`Escape`&&C.value&&(C.value=null)});let oe=O([]),se=O(!1),ce=O(new Map),le=O([]),ue=O(!1),w=O(new Map),de=O(!1),fe=B(()=>/github\.com|gitlab/i.test(a.value?.remoteUrl??``)),pe=async()=>{if(r.value&&n.value){de.value=!0;try{let e=await H(r.value).gitOp(n.value,`pr-list`);le.value=e.prs??[]}catch(e){G(`pr list failed: ${e.message.slice(0,120)}`)}finally{de.value=!1}}};A(ue,e=>{e&&pe()});let me=()=>ie({title:`Create pull request`,body:`head: ${a.value?.branch??`?`}`,confirmLabel:`Create PR`,input:{placeholder:`PR title`,value:f.value.trim()||``},action:e=>void he(e)});async function he(e){if(r.value&&n.value&&e.trim()){de.value=!0;try{G((await H(r.value).gitOp(n.value,`pr-create`,{message:e.trim(),body:e.trim()})).text.split(`
|
|
76
|
-
`)[0]??`PR created`),await pe()}catch(e){G(`pr create failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}async function ge(e){if(r.value&&n.value){de.value=!0;try{let t=await H(r.value).gitOp(n.value,`pr-checks`,{n:e});w.value=new Map(w.value).set(e,t.text.slice(0,1500))}catch(e){G(`pr checks failed: ${e.message.slice(0,120)}`)}finally{de.value=!1}}}let _e=e=>ie({title:`Merge PR #${e}?`,body:`squash-merge via gh on the device.`,confirmLabel:`Squash & merge`,danger:!0,action:()=>void ve(e)});async function ve(e){if(r.value&&n.value){de.value=!0;try{G((await H(r.value).gitOp(n.value,`pr-merge`,{n:e})).text||`PR #${e} merged`),await pe(),await De()}catch(e){G(`pr merge failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}let ye=e=>ie({title:`Comment on PR #${e}`,body:`posted as the device's gh login`,confirmLabel:`Comment`,input:{placeholder:`comment…`,value:``},action:t=>void be(e,t)});async function be(e,t){if(r.value&&n.value&&t.trim()){de.value=!0;try{G((await H(r.value).gitOp(n.value,`pr-comment`,{n:e,body:t.trim()})).text||`comment posted`)}catch(e){G(`pr comment failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}let xe=O([]),Se=O(!1),Ce=async()=>{if(r.value&&l.value)try{let e=await H(r.value).sessionGitTurns(l.value);xe.value=e.turns}catch{xe.value=[]}};A(Se,e=>{e&&Ce()});let we=0;window.addEventListener(`focus`,()=>{!n.value||Date.now()-we<15e3||(we=Date.now(),Ad(r.value||`?`,n.value||`?`,{force:!0}))});let Te=O(new Set),Ee=()=>{typeof localStorage<`u`&&(f.value=localStorage.getItem(y.value)??``)};Ad(r.value||`?`,n.value||`?`),Ee(),Yr(()=>Ad(r.value||`?`,n.value||`?`)),A(f,e=>{typeof localStorage<`u`&&(e?localStorage.setItem(y.value,e):localStorage.removeItem(y.value))}),A([r,n],()=>{m.value=!1,h.value=!1,_.value=null,b.value=null,x.value=``,S.value=!1,te.value=[],ce.value=new Map,Te.value=new Set,Ad(r.value||`?`,n.value||`?`),Ee()});let De=()=>(p.value=new Set,_.value=null,Ad(r.value||`?`,n.value||`?`,{force:!0})),Oe=B(()=>a.value?.files??[]);A(Oe,e=>{let t=new Set;for(let n of e)n.x!==`?`&&n.y!==`?`&&t.add(n.path);p.value=t},{immediate:!0});let ke=B(()=>Oe.value.some(e=>p.value.has(e.path))),Ae=B(()=>Oe.value.filter(e=>!Me(e)&&e.x!==` `&&e.x!==`?`)),je=B(()=>Oe.value.filter(e=>!Me(e)&&(e.x===` `||e.x===`?`))),Me=e=>`UAD`.includes(e.x)&&`UAD`.includes(e.y),Ne=B(()=>Oe.value.filter(Me)),Pe=B(()=>Oe.value.length>=500),Fe=B(()=>(a.value?.staged??0)+(a.value?.unstaged??0)+(a.value?.untracked??0)>0),Ie=B(()=>!a.value?.identity?.name||!a.value?.identity?.email),D=B(()=>{let e=a.value?.remoteUrl??``,t=e.match(/git@([^:]+):(.+?)(?:\.git)?$/)??e.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);return t?`https://${t[1]}/${t[2]}`:``}),Le=e=>{let t=new Set(p.value);t.has(e)?t.delete(e):t.add(e),p.value=t},Re=e=>{let t=e.every(e=>p.value.has(e.path)),n=new Set(p.value);for(let r of e)t?n.delete(r.path):n.add(r.path);p.value=n},ze=e=>{let t=e.lastIndexOf(`/`);return t===-1?`.`:e.slice(0,t)},Be=e=>{let t=new Map;for(let n of e){let e=ze(n.path);t.has(e)||t.set(e,[]),t.get(e).push(n)}return[...t.entries()].map(([e,t])=>({dir:e,files:t,open:!Te.value.has(e)}))},Ve=e=>{let t=new Set(Te.value);t.has(e)?t.delete(e):t.add(e),Te.value=t},He=e=>e.a===void 0&&e.d===void 0?``:e.a===-1||e.d===-1?`bin`:`+${e.a??0} −${e.d??0}`,Ue=e=>{navigator.clipboard?.writeText(e).then(()=>G(`copied ${e}`))};async function We(e,t={}){if(r.value&&n.value){u.value=e,d.value=``;try{let i=await H(r.value).gitOp(n.value,e,t);d.value=i.text||`(empty)`,e===`push`&&(x.value=``),e===`pull`&&(S.value=!1),[`fetch`,`pull`,`push`,`stash-push`,`stash-pop`].includes(e)&&G(`git ${e} ✓`),await De(),yt(!0)}catch(t){let n=t.message;e===`push`&&(/no upstream|has no upstream|upstream is gone/i.test(n)?x.value=`no upstream — set it while pushing?`:/fetch first|non-fast-forward|rejected.*fetch|behind/i.test(n)?x.value=`the remote has work you lack — pull first`:/authentication|permission|could not read|403|denied/i.test(n)?x.value=`credentials rejected on the device — check its git login`:x.value=``),e===`pull`&&/not possible to fast-forward|divergent|unrelated histories/i.test(n)&&(S.value=!0),G(`git ${e}: ${n.slice(0,160)}`)}finally{u.value=``}}}async function Ge(e,t,i=!1){if(!r.value||!n.value||(i&&(u.value=e),!t&&e!==`stage`))return;if(e===`discard`&&t&&!i){ie({title:`Roll back to HEAD?`,body:`${t} — uncommitted changes are lost.`,confirmLabel:`Roll back`,danger:!0,action:()=>void Ge(e,t,!0)});return}u.value=e;let a=t?[t]:Oe.value.filter(e=>e.x===` `||e.x===`M`).map(e=>e.path);try{G((await H(r.value).gitOp(n.value,e,{files:a})).text),await De()}catch(t){G(`${e} failed: ${t.message.slice(0,140)}`)}finally{u.value=``}}async function Ke(e){if(r.value&&n.value&&e.length){u.value=`unstage`;try{G((await H(r.value).gitOp(n.value,`unstage`,{files:e})).text),await De()}catch(e){G(`unstage failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function qe(e,t){if(r.value&&n.value){u.value=`resolve`;try{G((await H(r.value).gitOp(n.value,`resolve`,{side:e,files:[t]})).text),await De()}catch(e){G(`resolve failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function Je(e){if(r.value&&n.value&&e.length){u.value=`ignore`;try{G((await H(r.value).gitOp(n.value,`ignore`,{lines:e})).text),await De()}catch(e){G(`ignore failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function Ye(e){if(r.value&&n.value){if(_.value?.path===e)return _.value=null;u.value=`diff`;try{let t=await H(r.value).gitOp(n.value,`diff-file`,{target:e,staged:v.value===`staged`});_.value={path:e,text:t.text}}catch(e){G(`diff failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}let Xe=async()=>{let e=_.value?.path;_.value=null,e&&await Ye(e)},Ze=B(()=>/Binary files .* differ/i.test(_.value?.text??``));async function Qe(){if(r.value&&n.value){u.value=`abort`;try{G((await H(r.value).gitOp(n.value,`merge-abort`)).text),await De()}catch(e){G(`abort failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}}async function $e(e){if(m.value=!1,r.value&&n.value){u.value=`compare`;try{let t=await H(r.value).gitOp(n.value,`compare`,{ref:e});b.value={ref:e,ahead:t.ahead??0,behind:t.behind??0}}catch(e){G(`compare failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function et(e,t=!1){if(m.value=!1,!r.value||!n.value||e===a.value?.branch&&!t)return;u.value=`switch`;let i=H(r.value),o=!1;try{if(ee.value&&!t&&Fe.value&&(await i.gitOp(n.value,`stash-push`,{message:`dpi auto-stash before ${e}`}),o=!0),G((await i.gitOp(n.value,`switch`,{ref:e,create:t})).text||`switched to ${e}`),o)try{let e=await i.gitOp(n.value,`stash-pop`);/conflict/i.test(e.text)&&G(`stash popped WITH CONFLICTS — resolve in the file list`)}catch{G(`switched, but the stash did not pop — resolve manually (git stash list)`)}await De(),yt(!0)}catch(e){if(G(`switch failed: ${e.message.slice(0,140)}`),o)try{await i.gitOp(n.value,`stash-pop`)}catch{}}finally{u.value=``}}async function tt(e=!1){if(!r.value||!n.value||!f.value.trim())return;u.value=`commit`;let t=Oe.value.filter(e=>p.value.has(e.path)).map(e=>e.path);if(!t.length)return G(`check the files to commit — nothing is selected`);let i=H(r.value);try{if(G((await i.gitOp(n.value,`commit`,{message:f.value.trim()
|
|
76
|
+
`)[0]??`PR created`),await pe()}catch(e){G(`pr create failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}async function ge(e){if(r.value&&n.value){de.value=!0;try{let t=await H(r.value).gitOp(n.value,`pr-checks`,{n:e});w.value=new Map(w.value).set(e,t.text.slice(0,1500))}catch(e){G(`pr checks failed: ${e.message.slice(0,120)}`)}finally{de.value=!1}}}let _e=e=>ie({title:`Merge PR #${e}?`,body:`squash-merge via gh on the device.`,confirmLabel:`Squash & merge`,danger:!0,action:()=>void ve(e)});async function ve(e){if(r.value&&n.value){de.value=!0;try{G((await H(r.value).gitOp(n.value,`pr-merge`,{n:e})).text||`PR #${e} merged`),await pe(),await De()}catch(e){G(`pr merge failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}let ye=e=>ie({title:`Comment on PR #${e}`,body:`posted as the device's gh login`,confirmLabel:`Comment`,input:{placeholder:`comment…`,value:``},action:t=>void be(e,t)});async function be(e,t){if(r.value&&n.value&&t.trim()){de.value=!0;try{G((await H(r.value).gitOp(n.value,`pr-comment`,{n:e,body:t.trim()})).text||`comment posted`)}catch(e){G(`pr comment failed: ${e.message.slice(0,140)}`)}finally{de.value=!1}}}let xe=O([]),Se=O(!1),Ce=async()=>{if(r.value&&l.value)try{let e=await H(r.value).sessionGitTurns(l.value);xe.value=e.turns}catch{xe.value=[]}};A(Se,e=>{e&&Ce()});let we=0;window.addEventListener(`focus`,()=>{!n.value||Date.now()-we<15e3||(we=Date.now(),Ad(r.value||`?`,n.value||`?`,{force:!0}))});let Te=O(new Set),Ee=()=>{typeof localStorage<`u`&&(f.value=localStorage.getItem(y.value)??``)};Ad(r.value||`?`,n.value||`?`),Ee(),Yr(()=>Ad(r.value||`?`,n.value||`?`)),A(f,e=>{typeof localStorage<`u`&&(e?localStorage.setItem(y.value,e):localStorage.removeItem(y.value))}),A([r,n],()=>{m.value=!1,h.value=!1,_.value=null,b.value=null,x.value=``,S.value=!1,te.value=[],ce.value=new Map,Te.value=new Set,Ad(r.value||`?`,n.value||`?`),Ee()});let De=()=>(p.value=new Set,_.value=null,Ad(r.value||`?`,n.value||`?`,{force:!0})),Oe=B(()=>a.value?.files??[]);A(Oe,e=>{let t=new Set;for(let n of e)n.x!==`?`&&n.y!==`?`&&t.add(n.path);p.value=t},{immediate:!0});let ke=B(()=>Oe.value.some(e=>p.value.has(e.path))),Ae=B(()=>Oe.value.filter(e=>!Me(e)&&e.x!==` `&&e.x!==`?`)),je=B(()=>Oe.value.filter(e=>!Me(e)&&(e.x===` `||e.x===`?`))),Me=e=>`UAD`.includes(e.x)&&`UAD`.includes(e.y),Ne=B(()=>Oe.value.filter(Me)),Pe=B(()=>Oe.value.length>=500),Fe=B(()=>(a.value?.staged??0)+(a.value?.unstaged??0)+(a.value?.untracked??0)>0),Ie=B(()=>!a.value?.identity?.name||!a.value?.identity?.email),D=B(()=>{let e=a.value?.remoteUrl??``,t=e.match(/git@([^:]+):(.+?)(?:\.git)?$/)??e.match(/^https?:\/\/([^/]+)\/(.+?)(?:\.git)?$/);return t?`https://${t[1]}/${t[2]}`:``}),Le=e=>{let t=new Set(p.value);t.has(e)?t.delete(e):t.add(e),p.value=t},Re=e=>{let t=e.every(e=>p.value.has(e.path)),n=new Set(p.value);for(let r of e)t?n.delete(r.path):n.add(r.path);p.value=n},ze=e=>{let t=e.lastIndexOf(`/`);return t===-1?`.`:e.slice(0,t)},Be=e=>{let t=new Map;for(let n of e){let e=ze(n.path);t.has(e)||t.set(e,[]),t.get(e).push(n)}return[...t.entries()].map(([e,t])=>({dir:e,files:t,open:!Te.value.has(e)}))},Ve=e=>{let t=new Set(Te.value);t.has(e)?t.delete(e):t.add(e),Te.value=t},He=e=>e.a===void 0&&e.d===void 0?``:e.a===-1||e.d===-1?`bin`:`+${e.a??0} −${e.d??0}`,Ue=e=>{navigator.clipboard?.writeText(e).then(()=>G(`copied ${e}`))};async function We(e,t={}){if(r.value&&n.value){u.value=e,d.value=``;try{let i=await H(r.value).gitOp(n.value,e,t);d.value=i.text||`(empty)`,e===`push`&&(x.value=``),e===`pull`&&(S.value=!1),[`fetch`,`pull`,`push`,`stash-push`,`stash-pop`].includes(e)&&G(`git ${e} ✓`),await De(),yt(!0)}catch(t){let n=t.message;e===`push`&&(/no upstream|has no upstream|upstream is gone/i.test(n)?x.value=`no upstream — set it while pushing?`:/fetch first|non-fast-forward|rejected.*fetch|behind/i.test(n)?x.value=`the remote has work you lack — pull first`:/authentication|permission|could not read|403|denied/i.test(n)?x.value=`credentials rejected on the device — check its git login`:x.value=``),e===`pull`&&/not possible to fast-forward|divergent|unrelated histories/i.test(n)&&(S.value=!0),G(`git ${e}: ${n.slice(0,160)}`)}finally{u.value=``}}}async function Ge(e,t,i=!1){if(!r.value||!n.value||(i&&(u.value=e),!t&&e!==`stage`))return;if(e===`discard`&&t&&!i){ie({title:`Roll back to HEAD?`,body:`${t} — uncommitted changes are lost.`,confirmLabel:`Roll back`,danger:!0,action:()=>void Ge(e,t,!0)});return}u.value=e;let a=t?[t]:Oe.value.filter(e=>e.x===` `||e.x===`M`).map(e=>e.path);try{G((await H(r.value).gitOp(n.value,e,{files:a})).text),await De()}catch(t){G(`${e} failed: ${t.message.slice(0,140)}`)}finally{u.value=``}}async function Ke(e){if(r.value&&n.value&&e.length){u.value=`unstage`;try{G((await H(r.value).gitOp(n.value,`unstage`,{files:e})).text),await De()}catch(e){G(`unstage failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function qe(e,t){if(r.value&&n.value){u.value=`resolve`;try{G((await H(r.value).gitOp(n.value,`resolve`,{side:e,files:[t]})).text),await De()}catch(e){G(`resolve failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function Je(e){if(r.value&&n.value&&e.length){u.value=`ignore`;try{G((await H(r.value).gitOp(n.value,`ignore`,{lines:e})).text),await De()}catch(e){G(`ignore failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function Ye(e){if(r.value&&n.value){if(_.value?.path===e)return _.value=null;u.value=`diff`;try{let t=await H(r.value).gitOp(n.value,`diff-file`,{target:e,staged:v.value===`staged`});_.value={path:e,text:t.text}}catch(e){G(`diff failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}let Xe=async()=>{let e=_.value?.path;_.value=null,e&&await Ye(e)},Ze=B(()=>/Binary files .* differ/i.test(_.value?.text??``));async function Qe(){if(r.value&&n.value){u.value=`abort`;try{G((await H(r.value).gitOp(n.value,`merge-abort`)).text),await De()}catch(e){G(`abort failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}}async function $e(e){if(m.value=!1,r.value&&n.value){u.value=`compare`;try{let t=await H(r.value).gitOp(n.value,`compare`,{ref:e});b.value={ref:e,ahead:t.ahead??0,behind:t.behind??0}}catch(e){G(`compare failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}}async function et(e,t=!1){if(m.value=!1,!r.value||!n.value||e===a.value?.branch&&!t)return;u.value=`switch`;let i=H(r.value),o=!1;try{if(ee.value&&!t&&Fe.value&&(await i.gitOp(n.value,`stash-push`,{message:`dpi auto-stash before ${e}`}),o=!0),G((await i.gitOp(n.value,`switch`,{ref:e,create:t})).text||`switched to ${e}`),o)try{let e=await i.gitOp(n.value,`stash-pop`);/conflict/i.test(e.text)&&G(`stash popped WITH CONFLICTS — resolve in the file list`)}catch{G(`switched, but the stash did not pop — resolve manually (git stash list)`)}await De(),yt(!0)}catch(e){if(G(`switch failed: ${e.message.slice(0,140)}`),o)try{await i.gitOp(n.value,`stash-pop`)}catch{}}finally{u.value=``}}async function tt(e=!1){if(!r.value||!n.value||!f.value.trim())return;u.value=`commit`;let t=Oe.value.filter(e=>p.value.has(e.path)).map(e=>e.path);if(!t.length)return G(`check the files to commit — nothing is selected`);let i=H(r.value);try{if(G((await i.gitOp(n.value,`commit`,{message:f.value.trim(),...a.value?.merge?{}:{files:t}})).text),f.value=``,e)try{G(`pushed: ${(await i.gitOp(n.value,`push`)).text.slice(0,80)}`)}catch(e){G(`committed, but push failed: ${e.message.slice(0,120)}`)}await De(),yt(!0)}catch(e){G(`commit failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}function nt(e){let t=e?.models??[],n=t.find(t=>`${t.provider}/${t.id}`===e?.defaultModel),r=new Map;for(let e of t)r.has(e.provider)||r.set(e.provider,e);let i=[...r.values()].filter(e=>e!==n).slice(0,3);return(n?[n,...i]:i).slice(0,4)}async function rt(){if(!r.value||!n.value)return;let e=Oe.value.filter(e=>p.value.has(e.path)).map(e=>e.path);if(!e.length)return G(`check files first — the model summarises THOSE`);u.value=`ai`;let t=H(r.value),i=``;for(let r of e.slice(0,5)){let e=await t.gitOp(n.value,`diff-file`,{target:r});if(i+=`${e.text}\n`,i.length>4e3)break}i=i.slice(0,4e3);let a=`Write ONE concise git commit message (under 72 chars, imperative, no quotes, no backticks) for these changes:\n\n${i}`,o=uu.devices.value.find(e=>e.id===r.value)?.info,s=nt(o);if(!s.length)return u.value=``,G(`no model on the device`);let c=[];try{for(let e of s){let r=await t.createSession({name:`git-msg`,cwd:n.value,model:{provider:e.provider,modelId:e.id}}).then(e=>e.id).catch(()=>``);if(!r){c.push(`${e.provider}: no session`);continue}try{let n=await t.agent(r,1).send(a,`followUp`,void 0,12e4),i=n.status===`done`?n.answer.text.trim().split(`
|
|
77
77
|
`)[0]?.slice(0,100):``;if(i){f.value=i;return}c.push(`${e.provider}/${e.id}: ${n.status===`unanswered`?n.reason:`empty answer`}`)}finally{t.session(r).archive().catch(()=>{})}}G(`ai message failed on every model — ${c.join(`; `).slice(0,140)}`)}catch(e){G(`ai message failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}async function it(){if(r.value&&l.value){u.value=`session-files`;try{let e=await H(r.value).sessionGitFiles(l.value);te.value=e.files;let t=e=>e.startsWith(`/`)||e.includes(`:\\`)?e:`${n.value}/${e}`,i=new Set(e.files.map(t)),a=Oe.value.filter(e=>i.has(t(e.path)));p.value=new Set(a.map(e=>e.path)),G(a.length?`${a.length} session file(s) still changed — checked`:`the session touched nothing that is still changed`)}catch(e){G(`session files failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}}async function at(e){if(ce.value.has(e)){ce.value.delete(e),ce.value=new Map(ce.value);return}if(r.value&&n.value)try{let t=await H(r.value).gitOp(n.value,`show-files`,{target:e});ce.value=new Map(ce.value).set(e,t.changed??[])}catch(e){G(`commit files failed: ${e.message.slice(0,120)}`)}}async function ot(){if(!r.value||!n.value)return;let e=`cp-${new Date().toISOString().slice(0,16).replace(/[-:T]/g,``)}`;u.value=`checkpoint`;try{G((await H(r.value).gitOp(n.value,`checkpoint`,{name:e})).text),se.value=!0,await st()}catch(e){G(`checkpoint failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}async function st(){if(r.value&&n.value)try{let e=await H(r.value).gitOp(n.value,`checkpoints`);oe.value=e.checkpoints??[]}catch{oe.value=[]}}async function ct(e){if(!r.value||!n.value)return;let t=e;ie({title:`Rewind to ${t}?`,body:`reset --hard — ALL uncommitted changes in this worktree are LOST.`,confirmLabel:`Rewind`,danger:!0,action:()=>void lt(t)})}async function lt(e){if(r.value&&n.value){u.value=`rewind`;try{G((await H(r.value).gitOp(n.value,`rewind`,{name:e})).text),await De(),yt(!0)}catch(e){G(`rewind failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}}A(se,e=>{e&&st()});async function ut(e){if(h.value=!1,!r.value||!n.value||!a.value?.root)return;let t=a.value.root,i=`${t.slice(0,t.lastIndexOf(`/`))}/${t.slice(t.lastIndexOf(`/`)+1)}-${e.replace(/[/\\]+/g,`-`)}`;u.value=`wt`;try{G((await H(r.value).gitOp(n.value,`worktree-add`,{branch:e,target:i})).text.split(`
|
|
78
78
|
`)[0]??`worktree ${i}`),g.value=``,await De()}catch(e){G(`worktree failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}async function dt(e,t){if(r.value){u.value=`session`;try{let n=uu.devices.value.find(e=>e.id===r.value)?.info,i=nt(n)[0];if(!i)return G(`no model available on ${r.value} — cannot create a session`);let a=await H(r.value).createSession({name:t??e.slice(e.lastIndexOf(`/`)+1),cwd:e,model:{provider:i.provider,modelId:i.id}});Eu({deviceId:r.value,sessionId:a.id,agentId:1}),G(`session "${a.name}" on ${e}`)}catch(e){G(`session failed: ${e.message.slice(0,160)}`)}finally{u.value=``}}}async function ft(e){if(r.value){u.value=`go`;try{let t=(await H(r.value).sessions()).find(t=>t.cwd===e);t?(Eu({deviceId:r.value,sessionId:t.id,agentId:1}),G(`switched to session "${t.name}"`)):await dt(e,null)}catch(e){G(`switch failed: ${e.message.slice(0,120)}`)}finally{u.value=``}}}async function pt(e){if(!r.value||!n.value)return;u.value=`wt`;let t=`Uncommitted changes in it will be LOST.`;try{let n=(await H(r.value).gitStatusBatch([e],{timeoutMs:6e4}))[e];t=(n?.staged??0)+(n?.unstaged??0)+(n?.untracked??0)>0?`It CONTAINS uncommitted changes — they will be LOST.`:`Its checkout is clean.`}catch{}ie({title:`Remove worktree?`,body:`${e} — ${t}`,confirmLabel:`Remove`,danger:!0,action:()=>void mt(e)})}async function mt(e){u.value=`wt`;try{await H(r.value).gitOp(n.value,`worktree-remove`,{target:e}),await De()}catch(e){G(`remove failed: ${e.message.slice(0,140)}`)}finally{u.value=``}}let ht=O([]),gt=O(!1),_t=O(``),vt=0;async function yt(e=!1){if(r.value&&n.value&&!(!e&&ht.value.length&&Date.now()-vt<12e4)){gt.value=!0;try{let e=await H(r.value).gitOp(n.value,`log-list`);ht.value=e.commits??[],_t.value=``,vt=Date.now()}catch(e){_t.value=e.message.slice(0,120)}finally{gt.value=!1}}}yt(),A([r,n],()=>{ht.value=[],vt=0,yt()});let bt=B(()=>(a.value?.worktrees??[]).filter(e=>e.path)),xt=[`#4f8cc9`,`#b8860b`,`#7aa25c`,`#a061ba`,`#c96f6f`,`#5fa8a0`],St=B(()=>{let e=new Map,t=[],n=[];for(let r of ht.value){let i=e.get(r.hash);i===void 0&&(i=n.indexOf(null),i===-1&&(n.push(null),i=n.length-1),e.set(r.hash,i)),n[i]=null;let a=[];r.parents.forEach((t,r)=>{let o=e.get(t);(o===void 0||n[o]===t)&&(o=n.indexOf(null),o===-1&&(n.push(null),o=n.length-1),e.set(t,o)),n[o]=t,r===0&&(n[i]=t),a.push(o)}),t.push({lane:i,parents:a,width:Math.max(1,n.length)})}return t}),Ct=e=>e*12+7;return(e,t)=>(N(),P(`div`,wy,[n.value?(N(),P(M,{key:1},[o.value?(N(),P(`p`,Ey,`loading git…`)):s.value?(N(),P(`p`,Dy,`refreshing…`)):z(``,!0),c.value?(N(),P(`p`,Oy,[R(E(c.value)+` `,1),I(`button`,{onClick:t[0]||=e=>De()},`retry`)])):z(``,!0),a.value?(N(),P(`div`,{key:3,class:T({stale:!!c.value||!!s.value})},[a.value.repo?(N(),P(M,{key:1},[a.value.merge?(N(),P(`p`,Ay,[R(` merge in progress — `+E(a.value.conflicts??Ne.value.length)+` unmerged path(s). Resolve them in the lists above, or `,1),I(`button`,{class:`small`,disabled:!!u.value,onClick:t[1]||=e=>Qe()},`abort merge`,8,jy)])):z(``,!0),I(`div`,My,[I(`div`,Ny,[I(`button`,{class:`branch-btn`,disabled:!!u.value,onClick:t[2]||=e=>m.value=!m.value},[L(k(_c),{size:16}),I(`strong`,null,E(a.value.branch??`detached`),1),L(k(nc),{size:14})],8,Py),m.value?(N(),P(`div`,Fy,[(N(!0),P(M,null,j(a.value.branches??[],e=>(N(),P(`button`,{key:e.name,class:T({cur:e.current}),onClick:t=>et(e.name)},[L(k(_c),{size:13}),I(`span`,null,E(e.name),1),I(`span`,Ly,E(e.current?`current`:e.upstream?`→ ${e.upstream}`:``),1),t[42]||=I(`span`,{class:`grow`},null,-1),e.current?z(``,!0):(N(),F(k(vc),{key:0,size:13,title:`compare with this base`,onClick:Ms(t=>$e(e.name),[`stop`])},null,8,[`onClick`]))],10,Iy))),128)),I(`div`,Ry,[Wn(I(`input`,{"onUpdate:modelValue":t[3]||=e=>g.value=e,placeholder:`new branch…`,onKeyup:t[4]||=Ps(e=>g.value.trim()&&et(g.value.trim(),!0),[`enter`])},null,544),[[Ss,g.value]]),I(`button`,{disabled:!g.value.trim(),onClick:t[5]||=e=>et(g.value.trim(),!0)},[L(k(Wc),{size:13})],8,zy)]),I(`label`,By,[Wn(I(`input`,{type:`checkbox`,"onUpdate:modelValue":t[6]||=e=>ee.value=e},null,512),[[Cs,ee.value]]),t[43]||=R(` auto-stash on switch`,-1)])])):z(``,!0)]),I(`span`,Vy,E(a.value.upstream??`no upstream`),1),a.value.ahead?(N(),P(`span`,Hy,`↑`+E(a.value.ahead),1)):z(``,!0),a.value.behind?(N(),P(`span`,Uy,`↓`+E(a.value.behind),1)):z(``,!0),b.value?(N(),P(`span`,Wy,[R(` vs `+E(b.value.ref)+`: ↑`+E(b.value.ahead)+` ↓`+E(b.value.behind)+` `,1),I(`button`,{class:`tag-x`,onClick:t[7]||=e=>b.value=null},[L(k(cl),{size:11})])])):z(``,!0),I(`span`,Gy,`+`+E(a.value.staged??0)+` ~`+E(a.value.unstaged??0)+` ?`+E(a.value.untracked??0),1),D.value?(N(),P(`a`,{key:3,class:`icon-button`,href:`${D.value}/tree/${a.value.branch??``}`,target:`_blank`,rel:`noopener`,title:`open on the remote`},[L(k(Js),{size:15,style:{transform:`rotate(45deg)`}})],8,Ky)):z(``,!0),I(`button`,{class:`icon-button`,disabled:!!u.value||o.value||s.value,title:`refresh`,onClick:t[8]||=e=>De()},[L(k(Kc),{size:16})],8,qy)]),I(`div`,Jy,[I(`button`,{class:`small`,disabled:!!u.value,onClick:t[9]||=e=>We(`fetch`)},[L(k(Ks),{size:14}),t[44]||=R(`fetch`,-1)],8,Yy),I(`button`,{class:`small`,disabled:!!u.value,onClick:t[10]||=e=>We(`pull`)},[L(k(Ks),{size:14}),t[45]||=R(`pull`,-1)],8,Xy),I(`button`,{class:`small primary`,disabled:!!u.value,title:`push`,onClick:t[11]||=e=>We(`push`)},[L(k(Js),{size:14}),t[46]||=R(`push`,-1)],8,Zy),I(`button`,{class:`small`,disabled:!!u.value,title:`stash changes`,onClick:t[12]||=e=>We(`stash-push`,{message:f.value.trim()||void 0})},[L(k($c),{size:14}),t[47]||=R(`stash`,-1)],8,Qy),I(`button`,{class:`small`,disabled:!!u.value,title:`pop the newest stash`,onClick:t[13]||=e=>We(`stash-pop`)},[L(k(Lc),{size:14}),t[48]||=R(`unstash`,-1)],8,$y)]),x.value?(N(),P(`p`,eb,[R(E(x.value)+` `,1),x.value.includes(`upstream`)?(N(),P(`button`,{key:0,class:`small primary`,disabled:!!u.value,onClick:t[14]||=e=>We(`push`,{setUpstream:!0,ref:a.value.branch})},`push -u origin `+E(a.value.branch),9,tb)):x.value.includes(`remote has work`)?(N(),P(`button`,{key:1,class:`small primary`,disabled:!!u.value,onClick:t[15]||=e=>We(`pull`)},`pull now`,8,nb)):z(``,!0)])):z(``,!0),S.value?(N(),P(`p`,rb,[t[49]||=R(` fast-forward is not possible — branches diverged. `,-1),I(`button`,{class:`small primary`,disabled:!!u.value,onClick:t[16]||=e=>We(`pull`,{rebase:!0})},`pull --rebase`,8,ib)])):z(``,!0),I(`section`,ab,[I(`div`,ob,[t[50]||=I(`h4`,null,`Commit`,-1),I(`span`,sb,E(Oe.value.length?`${p.value.size}/${Oe.value.length} files`:`no changes`),1),t[51]||=I(`span`,{class:`grow`},null,-1),l.value?(N(),P(`button`,{key:0,class:`small`,disabled:!!u.value,title:`check the files this session's agent touched`,onClick:it},[L(k(mc),{size:13}),R(` session files`+E(ne.value?` (${ne.value.changed}/${ne.value.total})`:``),1)],8,cb)):z(``,!0),l.value?(N(),P(`button`,{key:1,class:`small`,disabled:!!u.value,title:`what each turn of this session changed`,onClick:t[17]||=e=>Se.value=!Se.value},` turns `,8,lb)):z(``,!0)]),Ie.value?(N(),P(`p`,ub,[...t[52]||=[R(`git user.name/user.email is not set on the device — `,-1),I(`code`,null,`dpi device config`,-1),R(` or `,-1),I(`code`,null,`git config --global`,-1),R(` before committing.`,-1)]])):z(``,!0),Se.value?(N(),P(`div`,db,[xe.value.length?z(``,!0):(N(),P(`p`,fb,`no turns recorded yet for this session.`)),(N(!0),P(M,null,j(xe.value,(e,t)=>(N(),P(`div`,{key:t,class:`cp-row`},[I(`code`,null,`t`+E(xe.value.length-t),1),I(`span`,pb,E(e.when.slice(0,16).replace(`T`,` `)),1),I(`span`,mb,E(e.files.map(e=>`${e.path}×${e.writes}`).join(`, `)||`(no file writes)`),1)]))),128))])):z(``,!0),Pe.value?(N(),P(`p`,hb,`showing the first 500 changed files — commit in smaller batches`)):z(``,!0),Ne.value.length?(N(),P(`div`,gb,[I(`label`,_b,[I(`span`,vb,`Conflicts · `+E(Ne.value.length)+` — pick a side per file`,1)]),(N(!0),P(M,null,j(Ne.value,e=>(N(),P(`div`,{key:e.path,class:`file`},[I(`label`,yb,[I(`code`,bb,E(e.x)+E(e.y),1),I(`span`,{class:`path`,title:e.path},E(e.path),9,xb)]),I(`span`,Sb,[I(`button`,{class:`icon-button`,title:`view the conflict`,onClick:t=>Ye(e.path)},[L(k(pc),{size:13})],8,Cb),I(`button`,{class:`small`,disabled:!!u.value,title:`keep this branch's version and stage it`,onClick:t=>qe(`ours`,e.path)},`ours`,8,wb),I(`button`,{class:`small`,disabled:!!u.value,title:`take the incoming version and stage it`,onClick:t=>qe(`theirs`,e.path)},`theirs`,8,Tb)])]))),128))])):z(``,!0),Ae.value.length?(N(),P(`div`,Eb,[I(`label`,Db,[I(`input`,{type:`checkbox`,checked:Ae.value.every(e=>p.value.has(e.path)),onChange:t[18]||=e=>Re(Ae.value)},null,40,Ob),I(`span`,kb,`Staged · `+E(Ae.value.length),1),t[55]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`icon-button`,title:`stage every changed file`,onClick:t[19]||=e=>Ge(`stage`)},[L(k(Wc),{size:13}),t[53]||=R(` all`,-1)]),I(`button`,{class:`icon-button`,title:`unstage all (git reset HEAD)`,onClick:t[20]||=e=>Ke(Ae.value.map(e=>e.path))},[L(k(Nc),{size:13}),t[54]||=R(` none`,-1)])]),(N(!0),P(M,null,j(Be(Ae.value),e=>(N(),P(M,{key:e.dir},[e.dir===`.`?z(``,!0):(N(),P(`button`,{key:0,class:`dir-row`,onClick:t=>Ve(e.dir)},[L(k(rc),{size:12,class:T({open:e.open})},null,8,[`class`]),R(E(e.dir),1),I(`span`,jb,`· `+E(e.files.length),1)],8,Ab)),(N(!0),P(M,null,j(e.files,t=>Wn((N(),P(`div`,{key:t.path,class:`file`},[I(`label`,Mb,[I(`input`,{type:`checkbox`,checked:p.value.has(t.path),onChange:e=>Le(t.path)},null,40,Nb),I(`code`,{class:`xy`,title:`index ${t.x} · worktree ${t.y}`},E(t.x)+E(t.y),9,Pb),I(`span`,{class:`path`,title:t.path},E(t.path),9,Fb),He(t)?(N(),P(`span`,{key:0,class:T([`nums`,{bin:He(t)===`bin`}])},E(He(t)),3)):z(``,!0)]),I(`span`,Ib,[I(`button`,{class:`icon-button`,title:`view diff`,onClick:e=>Ye(t.path)},[L(k(pc),{size:13})],8,Lb),I(`button`,{class:`icon-button`,title:`unstage (git reset HEAD)`,onClick:e=>Ke([t.path])},[L(k(Nc),{size:13})],8,Rb),I(`button`,{class:`icon-button`,title:`roll back to HEAD`,onClick:e=>Ge(`discard`,t.path)},[L(k(uc),{size:13})],8,zb)])])),[[Vo,e.open]])),128))],64))),128))])):z(``,!0),je.value.length?(N(),P(`div`,Bb,[I(`label`,Vb,[I(`input`,{type:`checkbox`,checked:je.value.every(e=>p.value.has(e.path)),onChange:t[21]||=e=>Re(je.value)},null,40,Hb),I(`span`,Ub,`Unstaged · `+E(je.value.length),1)]),(N(!0),P(M,null,j(Be(je.value),e=>(N(),P(M,{key:e.dir},[e.dir===`.`?z(``,!0):(N(),P(`button`,{key:0,class:`dir-row`,onClick:t=>Ve(e.dir)},[L(k(rc),{size:12,class:T({open:e.open})},null,8,[`class`]),R(E(e.dir),1),I(`span`,Gb,`· `+E(e.files.length),1)],8,Wb)),(N(!0),P(M,null,j(e.files,t=>Wn((N(),P(`div`,{key:t.path,class:`file`},[I(`label`,Kb,[I(`input`,{type:`checkbox`,checked:p.value.has(t.path),onChange:e=>Le(t.path)},null,40,qb),I(`code`,{class:`xy`,title:`index ${t.x} · worktree ${t.y}`},E(t.x)+E(t.y),9,Jb),I(`span`,{class:`path`,title:t.path},E(t.path),9,Yb),He(t)?(N(),P(`span`,{key:0,class:T([`nums`,{bin:He(t)===`bin`}])},E(He(t)),3)):z(``,!0)]),I(`span`,Xb,[I(`button`,{class:`icon-button`,title:`view diff`,onClick:e=>Ye(t.path)},[L(k(pc),{size:13})],8,Zb),t.x===`?`?(N(),P(`button`,{key:0,class:`icon-button`,title:`add to .gitignore`,onClick:e=>Je([t.path])},[L(k(Zs),{size:13})],8,Qb)):(N(),P(`button`,{key:1,class:`icon-button`,title:`stage (git add)`,onClick:e=>Ge(`stage`,t.path)},[L(k(Wc),{size:13})],8,$b)),t.x===`?`?z(``,!0):(N(),P(`button`,{key:2,class:`icon-button`,title:`roll back to HEAD`,onClick:e=>Ge(`discard`,t.path)},[L(k(uc),{size:13})],8,ex)),I(`button`,{class:`icon-button`,title:`copy path`,onClick:e=>Ue(t.path)},[L(k(sc),{size:13})],8,tx)])])),[[Vo,e.open]])),128))],64))),128))])):z(``,!0),_.value?(N(),P(`p`,nx,[I(`strong`,null,E(_.value.path),1),I(`span`,rx,[I(`button`,{class:T({on:v.value===`working`}),onClick:t[22]||=e=>{v.value=`working`,Xe()}},`working`,2),I(`button`,{class:T({on:v.value===`staged`}),onClick:t[23]||=e=>{v.value=`staged`,Xe()}},`staged`,2)]),Ze.value?(N(),P(`span`,ix,`binary file`)):_.value.text.length>8e3?(N(),P(`span`,ax,`truncated at 8000 chars`)):z(``,!0),I(`button`,{class:`icon-button`,title:`close diff`,onClick:t[24]||=e=>_.value=null},[L(k(cl),{size:13})]),Ze.value?z(``,!0):(N(),P(`pre`,ox,E(_.value.text.slice(0,8e3)),1))])):z(``,!0),Wn(I(`textarea`,{"onUpdate:modelValue":t[25]||=e=>f.value=e,rows:`4`,placeholder:`Commit message… (Ctrl+Enter to commit)`,onKeydown:[t[26]||=Ps(Ms(e=>tt(),[`exact`,`prevent`]),[`enter`]),t[27]||=Ps(Ms(e=>tt(),[`meta`,`prevent`]),[`enter`]),t[28]||=Ps(Ms(e=>tt(),[`ctrl`,`prevent`]),[`enter`])]},null,544),[[Ss,f.value]]),I(`div`,sx,[I(`button`,{class:`small`,disabled:!!u.value||!p.value.size,title:`ask the device's model for a message`,onClick:rt},[L(k(Qc),{size:14}),t[56]||=R(` ai message`,-1)],8,cx),t[58]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`primary small`,disabled:!!u.value||!f.value.trim()||!ke.value,onClick:t[29]||=e=>tt(!1)},[L(k(tc),{size:14}),R(` Commit`+E(p.value.size?` ${p.value.size} file${p.value.size>1?`s`:``}`:``),1)],8,lx),a.value.upstream?(N(),P(`button`,{key:0,class:`primary small`,disabled:!!u.value||!f.value.trim()||!ke.value,title:`commit, then push`,onClick:t[30]||=e=>tt(!0)},[L(k(tc),{size:14}),t[57]||=R(` Commit & push `,-1)],8,ux)):z(``,!0)])]),I(`section`,dx,[I(`div`,fx,[I(`h4`,null,[L(k(Sc),{size:16}),t[59]||=R(` Log`,-1)]),t[61]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`small`,disabled:!!u.value,title:`save a checkpoint ref of HEAD`,onClick:ot},[L(k(mc),{size:13}),t[60]||=R(` checkpoint`,-1)],8,px),I(`button`,{class:`small`,disabled:!!u.value,onClick:t[31]||=e=>se.value=!se.value},`checkpoints `+E(oe.value.length?`(${oe.value.length})`:``),9,mx),I(`button`,{class:`icon-button`,disabled:gt.value,title:`refresh log`,onClick:t[32]||=e=>yt(!0)},[L(k(Kc),{size:14})],8,hx)]),se.value?(N(),P(`div`,gx,[oe.value.length?z(``,!0):(N(),P(`p`,_x,`no checkpoints yet — one click saves a named ref of HEAD.`)),(N(!0),P(M,null,j(oe.value,e=>(N(),P(`div`,{key:e.name,class:`cp-row`},[I(`code`,null,E(e.name),1),I(`span`,vx,E(e.hash)+` · `+E(e.date),1),I(`span`,yx,E(e.subject),1),t[63]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`small`,disabled:!!u.value,title:`reset --hard to this checkpoint (this worktree)`,onClick:t=>ct(e.name)},[L(k(nl),{size:13}),t[62]||=R(` rewind`,-1)],8,bx)]))),128))])):z(``,!0),gt.value&&!ht.value.length?(N(),P(`p`,xx,`loading log…`)):ht.value.length?(N(),P(`div`,Sx,[(N(!0),P(M,null,j(ht.value,(e,t)=>(N(),P(M,{key:e.hash},[I(`div`,{class:`commit-row`,title:e.refs},[St.value[t]?(N(),P(`svg`,{key:0,class:`lane`,width:St.value[t].width*12+4,height:`24`,"aria-hidden":`true`},[(N(!0),P(M,null,j(St.value[t].width,e=>(N(),P(`line`,{key:e,x1:Ct(e-1),x2:Ct(e-1),y1:`0`,y2:`24`,stroke:`#3a3134`,"stroke-width":`2`},null,8,Tx))),128)),(N(!0),P(M,null,j(St.value[t].parents,(e,n)=>(N(),P(`line`,{key:`p`+n,x1:Ct(St.value[t].lane),x2:Ct(e),y1:`12`,y2:`24`,stroke:xt[e%xt.length],"stroke-width":`2`},null,8,Ex))),128)),I(`circle`,{cx:Ct(St.value[t].lane),cy:`12`,r:`4`,fill:xt[St.value[t].lane%xt.length]},null,8,Dx)],8,wx)):z(``,!0),I(`button`,{class:`icon-button hash-btn`,title:`files in this commit`,onClick:t=>at(e.hash)},[L(k(rc),{size:12,class:T({open:ce.value.has(e.hash)})},null,8,[`class`])],8,Ox),I(`code`,kx,[D.value?(N(),P(`a`,{key:0,href:`${D.value}/commit/${e.hash}`,target:`_blank`,rel:`noopener`,title:`on the remote`},E(e.hash),9,Ax)):(N(),P(M,{key:1},[R(E(e.hash),1)],64))]),e.refs?(N(),P(`span`,jx,E(e.refs.split(`,`)[0]),1)):z(``,!0),I(`span`,Mx,E(e.subject),1),I(`span`,Nx,E(e.author)+` · `+E(e.date),1)],8,Cx),ce.value.has(e.hash)?(N(),P(`div`,Px,[(N(!0),P(M,null,j(ce.value.get(e.hash),e=>(N(),P(`div`,{key:e.path,class:`cf`},[I(`code`,{class:`cf-status`,"data-s":e.status},E(e.status),9,Fx),I(`span`,Ix,E(e.path),1)]))),128)),ce.value.get(e.hash)?.length?z(``,!0):(N(),P(`p`,Lx,`no files (merge/empty commit)`))])):z(``,!0)],64))),128))])):_t.value?(N(),P(`p`,Rx,`log failed: `+E(_t.value),1)):(N(),P(`p`,zx,`no commits`))]),I(`section`,Bx,[I(`div`,Vx,[I(`h4`,null,[L(k(Lc),{size:16}),t[64]||=R(` Worktrees`,-1)]),I(`div`,Hx,[I(`button`,{class:`small`,disabled:!!u.value,onClick:t[33]||=e=>h.value=!h.value},[L(k(Wc),{size:13}),t[65]||=R(` worktree`,-1)],8,Ux),h.value?(N(),P(`div`,Wx,[(N(!0),P(M,null,j((a.value.branches??[]).filter(e=>!e.current),e=>(N(),P(`button`,{key:e.name,onClick:t=>ut(e.name)},[L(k(_c),{size:13}),I(`span`,null,E(e.name),1),t[66]||=I(`span`,{class:`muted-line`},`existing`,-1)],8,Gx))),128)),I(`div`,Kx,[Wn(I(`input`,{"onUpdate:modelValue":t[34]||=e=>g.value=e,placeholder:`or a NEW branch…`,onKeyup:t[35]||=Ps(e=>g.value.trim()&&ut(g.value.trim()),[`enter`])},null,544),[[Ss,g.value]]),I(`button`,{disabled:!g.value.trim(),onClick:t[36]||=e=>ut(g.value.trim())},`create`,8,qx)])])):z(``,!0)])]),(N(!0),P(M,null,j(bt.value,e=>(N(),P(`div`,{key:e.path,class:T([`wt`,{main:e.path===a.value.root}])},[I(`code`,{title:e.path},E(e.path),9,Jx),I(`span`,Yx,E(e.branch??e.head),1),t[67]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`icon-button`,disabled:!!u.value,title:`jump to this worktree (session or new)`,onClick:t=>ft(e.path)},[L(k(qs),{size:13})],8,Xx),I(`button`,{class:`small`,disabled:!!u.value,title:`create a session on this worktree`,onClick:t=>dt(e.path,e.branch)},`session`,8,Zx),e.path===a.value.root?z(``,!0):(N(),P(`button`,{key:0,class:`icon-button`,disabled:!!u.value,onClick:t=>pt(e.path)},[L(k(cl),{size:13})],8,Qx)),e.path===a.value.root?(N(),F(k(tc),{key:1,size:13,class:`muted-line`})):z(``,!0)],2))),128))]),fe.value?(N(),P(`section`,$x,[I(`div`,eS,[I(`h4`,null,[L(k(bc),{size:16}),t[68]||=R(` Pull requests`,-1)]),t[69]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`small`,disabled:de.value||!!u.value,onClick:me},`create PR`,8,tS),I(`button`,{class:`small`,disabled:de.value,onClick:t[37]||=e=>ue.value=!ue.value},E(ue.value?`hide`:`list`),9,nS)]),ue.value&&!le.value.length&&!de.value?(N(),P(`p`,rS,`no open PRs (or gh is not logged in on the device — every action will say so).`)):z(``,!0),ue.value?(N(),P(`div`,iS,[(N(!0),P(M,null,j(le.value,e=>(N(),P(`div`,{key:e.n,class:`pr-row`},[I(`code`,aS,`#`+E(e.n),1),I(`span`,{class:T([`tag`,{open:e.state===`OPEN`}])},E(e.state.toLowerCase())+E(e.draft?` · draft`:``),3),I(`span`,oS,E(e.title),1),I(`span`,sS,E(e.branch),1),t[70]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`icon-button`,title:`run checks`,disabled:de.value,onClick:t=>ge(e.n)},[L(k(Kc),{size:13})],8,cS),I(`button`,{class:`icon-button`,title:`comment`,disabled:de.value,onClick:t=>ye(e.n)},[L(k(sc),{size:13})],8,lS),e.state===`OPEN`?(N(),P(`button`,{key:0,class:`small`,disabled:de.value||!!u.value,onClick:t=>_e(e.n)},`squash & merge`,8,uS)):z(``,!0),I(`a`,{class:`icon-button`,href:e.url,target:`_blank`,rel:`noopener`,title:`open on the forge`},[L(k(Js),{size:13,style:{transform:`rotate(45deg)`}})],8,dS)]))),128)),(N(!0),P(M,null,j(w.value,([e,t])=>(N(),P(`pre`,{key:e,class:`pr-checks`},`#`+E(e)+` checks:`+E(`
|
|
79
|
-
`)+E(t),1))),128))])):z(``,!0)])):z(``,!0),d.value?(N(),P(`pre`,fS,E(d.value.slice(0,6e3)),1)):z(``,!0)],64)):(N(),P(`p`,ky,[...t[41]||=[R(`Not a git repository — run `,-1),I(`code`,null,`git init`,-1),R(` (or open a session inside a repo).`,-1)]]))],2)):z(``,!0),C.value?(N(),P(`div`,{key:4,class:`modal-veil`,onClick:t[40]||=Ms(e=>C.value=null,[`self`])},[I(`div`,{class:T([`modal`,{danger:C.value.danger}]),role:`dialog`,"aria-modal":`true`},[I(`h5`,null,E(C.value.title),1),I(`p`,null,E(C.value.body),1),C.value.input?Wn((N(),P(`textarea`,{key:0,"onUpdate:modelValue":t[38]||=e=>re.value=e,rows:`2`,placeholder:C.value.input.placeholder},null,8,pS)),[[Ss,re.value]]):z(``,!0),I(`div`,mS,[t[72]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`small`,onClick:t[39]||=e=>C.value=null},[...t[71]||=[R(`cancel `,-1),I(`span`,{class:`muted-line`},`(esc)`,-1)]]),I(`button`,{class:T([`primary small`,{danger:C.value.danger}]),disabled:!(!C.value.input||re.value.trim()),onClick:ae},E(C.value.confirmLabel??`confirm`),11,hS)])],2)])):z(``,!0)],64)):(N(),P(`p`,Ty,`No session selected — open a session to see its git.`))]))}}),[[`__scopeId`,`data-v-5b2b6dbb`]]),_S={class:`extensions-panel`},vS={class:`panel-heading`},yS={key:0,class:`task-empty`},bS=[`data-extension`],xS={class:`ext-head`},SS=[`aria-checked`,`aria-label`,`disabled`,`onClick`],CS=[`checked`,`disabled`,`onChange`],wS=kr({__name:`ExtensionsPanel`,setup(e){let t=an(),n=O(!1);async function r(){let e=wu.value;if(!e||!vu.value)return void(t.value=void 0);t.value=await e.extensions().catch(()=>void 0)??t.value}A([wu,vu,()=>JSON.stringify(Pu.value.agent.extensions??null)],r,{immediate:!0});async function i(e){let r=wu.value;if(r&&!n.value){n.value=!0;try{let n=await Gu(()=>r.setExtension(e));n&&(t.value=n),Uu()}finally{n.value=!1}}}return(e,r)=>(N(),P(`div`,_S,[I(`div`,vS,[r[0]||=I(`h2`,null,`Extensions`,-1),L(k(Gc),{size:18})]),r[3]||=I(`p`,{class:`hint`},` Custom harness capabilities for this agent. Turn one on and the next request uses it. The choice is stored with the agent, so it survives restarts. `,-1),t.value?z(``,!0):(N(),P(`p`,yS,`Loading extensions…`)),(N(!0),P(M,null,j(t.value?.extensions??[],e=>(N(),P(`article`,{key:e.name,class:T([`ext-card`,{on:e.enabled}]),"data-extension":e.name},[I(`div`,xS,[I(`div`,null,[I(`strong`,null,E(e.title),1),I(`code`,null,E(e.name),1)]),I(`button`,{class:T([`switch`,{on:e.enabled}]),role:`switch`,"aria-checked":e.enabled,"aria-label":e.title,disabled:n.value,onClick:t=>i({name:e.name,enabled:!e.enabled})},[...r[1]||=[I(`span`,null,null,-1)]],10,SS)]),I(`p`,null,E(e.description),1),e.prompts?(N(),P(`ul`,{key:0,class:T([`ext-prompts`,{off:!e.enabled}])},[(N(!0),P(M,null,j(e.prompts,e=>(N(),P(`li`,{key:e.id},[I(`label`,null,[I(`input`,{type:`checkbox`,checked:e.enabled,disabled:n.value,onChange:t=>i({prompt:e.id,enabled:t.target.checked})},null,40,CS),I(`code`,null,E(e.id),1)]),I(`span`,null,E(e.description),1),I(`details`,null,[r[2]||=I(`summary`,null,`View prompt`,-1),I(`pre`,null,E(e.text),1)])]))),128))],2)):z(``,!0)],10,bS))),128))]))}}),TS={class:`context-section`,"aria-labelledby":`context-title`},ES={class:`section-label`},DS={key:0,class:`hint`},OS={class:`context-numbers`},kS={class:`context-pct`},AS={key:0,class:`context-compacting`},jS=[`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],MS={class:`context-marker-label`},NS=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],PS={class:`context-marker-label`},FS={class:`hint context-hint`},IS={class:`modal compaction-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`compaction-title`},LS={class:`context-toggle`},RS=[`checked`],zS=512,BS=4096,VS=1024,HS=kr({__name:`ContextBar`,setup(e){let t=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),n=B(()=>Bu.value?.contextWindow??0),r=B(()=>{let e=Pu.value.entries;for(let t=e.length-1;t>=0;t--){if(e[t].kind!==`pi.assistant`)continue;let n=e[t].model?.find(e=>e.role===`assistant`)?.usage;if(n)return n.totalTokens||n.input+n.output+n.cacheRead+n.cacheWrite}return 0}),i=B(()=>Pu.value.compactions.length>0),a=O(),o=B(()=>a.value??Su.value?.compaction??i_(n.value));A(()=>JSON.stringify(Su.value?.compaction),e=>{a.value&&e===JSON.stringify(a.value)&&(a.value=void 0)});let s=O(),c=B(()=>W.dialog?.kind===`compaction`),l=()=>void(W.dialog=void 0);Jr(()=>c.value&&l());let u=B(()=>s.value??a_(n.value,o.value)),d=e=>`${Math.min(100,Math.max(0,100*e/(n.value||1)))}%`,f=B(()=>Math.round(100*r.value/(n.value||1))),p=e=>{let t=e/(n.value||1);return t<.35?`start`:t>.65?`end`:`center`},m=(e,t)=>Math.min(n.value-VS,Math.max((t??BS)+VS,e)),h=(e,t)=>Math.min(t-VS,Math.max(BS,e));function g(e,t){let n=u.value,r=Math.round(t/zS)*zS;s.value=e===`wait`?{auto:n.auto,wait:m(r,n.auto)}:{auto:h(r,n.wait),wait:n.wait}}async function _(e){let t=Tu.value;if(!t)return;let n=await Gu(()=>t.setCompaction(e));n&&(a.value=n),s.value=void 0}function v(){let e=s.value;e&&_({reserveTokens:n.value-e.wait,...e.auto===void 0?{}:{backgroundTokens:e.wait-e.auto}})}let y=O(),b;function ee(e,t){b=e,t.currentTarget.setPointerCapture(t.pointerId)}function x(e){if(!b||!y.value)return;let t=y.value.getBoundingClientRect();g(b,(e.clientX-t.left)/t.width*n.value)}function S(){b&&(b=void 0,v())}function te(e,t){let n=(t.shiftKey?8192:1024)*(t.key===`ArrowRight`||t.key===`ArrowUp`?1:t.key===`ArrowLeft`||t.key===`ArrowDown`?-1:0);if(!n)return;t.preventDefault();let r=u.value;g(e,(e===`auto`?r.auto??BS:r.wait)+n)}return(e,a)=>(N(),P(M,null,[I(`section`,TS,[I(`div`,ES,[a[7]||=I(`span`,{id:`context-title`},`CONTEXT`,-1),n.value?(N(),P(`button`,{key:0,class:`context-details-toggle`,onClick:a[0]||=e=>k(W).dialog={kind:`compaction`}},[L(k(wc),{size:16}),a[6]||=R(`Details `,-1)])):z(``,!0)]),n.value?(N(),P(M,{key:1},[I(`div`,OS,[I(`strong`,null,E(t(r.value)),1),I(`span`,null,`of `+E(t(n.value))+` tokens`,1),I(`span`,kS,E(f.value)+`%`,1),i.value?(N(),P(`span`,AS,[...a[8]||=[I(`i`,null,null,-1),R(`Compacting`,-1)]])):z(``,!0)]),I(`div`,{ref_key:`bar`,ref:y,class:T([`context-bar`,{off:!o.value.enabled}]),onPointermove:x,onPointerup:S,onPointercancel:S},[I(`div`,{class:T([`context-fill`,{hot:u.value.auto!==void 0&&r.value>=u.value.auto}]),style:_e({width:d(r.value)})},null,6),I(`div`,{class:`context-reserve`,style:_e({left:d(u.value.wait)}),title:`Reserved for the answer`},null,4),u.value.auto===void 0?z(``,!0):(N(),P(`button`,{key:0,class:T([`context-marker auto`,`label-${p(u.value.auto)}`]),role:`slider`,"aria-label":`Automatic compaction starts at`,"aria-valuemin":BS,"aria-valuemax":u.value.wait-VS,"aria-valuenow":u.value.auto,"aria-valuetext":`${t(u.value.auto)} tokens`,style:_e({left:d(u.value.auto)}),onPointerdown:a[1]||=e=>ee(`auto`,e),onKeydown:a[2]||=e=>te(`auto`,e),onKeyup:v,onBlur:v},[I(`span`,MS,`Auto-compact at `+E(t(u.value.auto)),1)],46,jS)),I(`button`,{class:T([`context-marker wait`,`label-${p(u.value.wait)}`]),role:`slider`,"aria-label":`The next request waits for a summary at`,"aria-valuemin":(u.value.auto??BS)+VS,"aria-valuemax":n.value-VS,"aria-valuenow":u.value.wait,"aria-valuetext":`${t(u.value.wait)} tokens, ${t(n.value-u.value.wait)} reserved`,style:_e({left:d(u.value.wait)}),onPointerdown:a[3]||=e=>ee(`wait`,e),onKeydown:a[4]||=e=>te(`wait`,e),onKeyup:v,onBlur:v},[I(`span`,PS,`Reserve at `+E(t(u.value.wait)),1)],46,NS)],34),I(`p`,FS,[o.value.enabled?(N(),P(M,{key:0},[a[9]||=R(`Compacts in the background at `,-1),I(`strong`,null,E(t(u.value.auto??u.value.wait)),1),a[10]||=R(` and waits at `,-1),I(`strong`,null,E(t(u.value.wait)),1),a[11]||=R(`.`,-1)],64)):(N(),P(M,{key:1},[R(`Automatic compaction is off.`)],64))])],64)):(N(),P(`div`,DS,`Pick a model to see its context window.`))]),(N(),F(dr,{to:`body`},[c.value?(N(),P(`div`,{key:0,class:`modal-backdrop`,onClick:Ms(l,[`self`])},[I(`section`,IS,[I(`header`,null,[a[12]||=I(`h2`,{id:`compaction-title`},`Context compaction`,-1),I(`button`,{class:`icon-button`,"aria-label":`Close context compaction`,onClick:l},[L(k(cl),{size:18})])]),I(`p`,null,[a[13]||=R(` A summary starts in the background at `,-1),I(`strong`,null,E(t(u.value.auto??u.value.wait)),1),a[14]||=R(`. Above `,-1),I(`strong`,null,E(t(u.value.wait)),1),R(` the next request waits for it, keeping `+E(t(n.value-u.value.wait))+` free for the answer. Drag a marker on the bar to change either point. `,1)]),a[16]||=I(`p`,null,[R(`Older entries stay stored, and `),I(`code`,null,`search_history`),R(` still finds them.`)],-1),I(`label`,LS,[I(`input`,{type:`checkbox`,checked:o.value.enabled,onChange:a[5]||=e=>_({enabled:e.target.checked})},null,40,RS),a[15]||=R(` Automatic compaction `,-1)]),a[17]||=I(`p`,{class:`hint`},[R(` Applies to every agent in this session. `),I(`code`,null,`/compact`),R(` works either way. `)],-1),I(`footer`,null,[I(`button`,{class:`secondary`,onClick:l},`Close`)])])])):z(``,!0)]))],64))}}),US=/^[A-Za-z_$][\w$]*$/,WS=e=>` `.repeat(e);function GS(e,t){let n=[],r=(e,t=`text`)=>n.push({text:e,kind:t});return r(`function`,`keyword`),r(` `),r(e,`function`),r(`(`,`punct`),r(`args`),r(`: `,`punct`),KS(t,0,r),r(`): `,`punct`),r(`Promise`,`type`),r(`<`,`punct`),r(`ToolResult`,`type`),r(`>;`,`punct`),n}function KS(e,t,n){if(!e||typeof e!=`object`)return n(`unknown`,`type`);if(`const`in e)return YS(e.const,n);if(e.enum)return JS(e.enum.map(e=>({const:e})),t,n);if(e.anyOf??e.oneOf)return JS(e.anyOf??e.oneOf,t,n);if(Array.isArray(e.type))return JS(e.type.map(t=>({...e,type:t})),t,n);switch(e.type){case`string`:case`boolean`:case`null`:return n(e.type,`type`);case`number`:case`integer`:return n(`number`,`type`);case`array`:{let r=!!(e.items?.anyOf??e.items?.oneOf??e.items?.enum);return r&&n(`(`,`punct`),KS(e.items,t,n),r&&n(`)`,`punct`),n(`[]`,`punct`)}case`object`:return qS(e,t,n);default:return n(`unknown`,`type`)}}function qS(e,t,n){let r=Object.entries(e.properties??{});if(!r.length)return e.additionalProperties&&typeof e.additionalProperties==`object`?(n(`Record`,`type`),n(`<`,`punct`),n(`string`,`type`),n(`, `,`punct`),KS(e.additionalProperties,t,n),n(`>`,`punct`)):n(`{}`,`punct`);let i=new Set(e.required??[]);n(`{`,`punct`),n(`
|
|
79
|
+
`)+E(t),1))),128))])):z(``,!0)])):z(``,!0),d.value?(N(),P(`pre`,fS,E(d.value.slice(0,6e3)),1)):z(``,!0)],64)):(N(),P(`p`,ky,[...t[41]||=[R(`Not a git repository — run `,-1),I(`code`,null,`git init`,-1),R(` (or open a session inside a repo).`,-1)]]))],2)):z(``,!0),C.value?(N(),P(`div`,{key:4,class:`modal-veil`,onClick:t[40]||=Ms(e=>C.value=null,[`self`])},[I(`div`,{class:T([`modal`,{danger:C.value.danger}]),role:`dialog`,"aria-modal":`true`},[I(`h5`,null,E(C.value.title),1),I(`p`,null,E(C.value.body),1),C.value.input?Wn((N(),P(`textarea`,{key:0,"onUpdate:modelValue":t[38]||=e=>re.value=e,rows:`2`,placeholder:C.value.input.placeholder},null,8,pS)),[[Ss,re.value]]):z(``,!0),I(`div`,mS,[t[72]||=I(`span`,{class:`grow`},null,-1),I(`button`,{class:`small`,onClick:t[39]||=e=>C.value=null},[...t[71]||=[R(`cancel `,-1),I(`span`,{class:`muted-line`},`(esc)`,-1)]]),I(`button`,{class:T([`primary small`,{danger:C.value.danger}]),disabled:!(!C.value.input||re.value.trim()),onClick:ae},E(C.value.confirmLabel??`confirm`),11,hS)])],2)])):z(``,!0)],64)):(N(),P(`p`,Ty,`No session selected — open a session to see its git.`))]))}}),[[`__scopeId`,`data-v-b3561e54`]]),_S={class:`extensions-panel`},vS={class:`panel-heading`},yS={key:0,class:`task-empty`},bS=[`data-extension`],xS={class:`ext-head`},SS=[`aria-checked`,`aria-label`,`disabled`,`onClick`],CS=[`checked`,`disabled`,`onChange`],wS=kr({__name:`ExtensionsPanel`,setup(e){let t=an(),n=O(!1);async function r(){let e=wu.value;if(!e||!vu.value)return void(t.value=void 0);t.value=await e.extensions().catch(()=>void 0)??t.value}A([wu,vu,()=>JSON.stringify(Pu.value.agent.extensions??null)],r,{immediate:!0});async function i(e){let r=wu.value;if(r&&!n.value){n.value=!0;try{let n=await Gu(()=>r.setExtension(e));n&&(t.value=n),Uu()}finally{n.value=!1}}}return(e,r)=>(N(),P(`div`,_S,[I(`div`,vS,[r[0]||=I(`h2`,null,`Extensions`,-1),L(k(Gc),{size:18})]),r[3]||=I(`p`,{class:`hint`},` Custom harness capabilities for this agent. Turn one on and the next request uses it. The choice is stored with the agent, so it survives restarts. `,-1),t.value?z(``,!0):(N(),P(`p`,yS,`Loading extensions…`)),(N(!0),P(M,null,j(t.value?.extensions??[],e=>(N(),P(`article`,{key:e.name,class:T([`ext-card`,{on:e.enabled}]),"data-extension":e.name},[I(`div`,xS,[I(`div`,null,[I(`strong`,null,E(e.title),1),I(`code`,null,E(e.name),1)]),I(`button`,{class:T([`switch`,{on:e.enabled}]),role:`switch`,"aria-checked":e.enabled,"aria-label":e.title,disabled:n.value,onClick:t=>i({name:e.name,enabled:!e.enabled})},[...r[1]||=[I(`span`,null,null,-1)]],10,SS)]),I(`p`,null,E(e.description),1),e.prompts?(N(),P(`ul`,{key:0,class:T([`ext-prompts`,{off:!e.enabled}])},[(N(!0),P(M,null,j(e.prompts,e=>(N(),P(`li`,{key:e.id},[I(`label`,null,[I(`input`,{type:`checkbox`,checked:e.enabled,disabled:n.value,onChange:t=>i({prompt:e.id,enabled:t.target.checked})},null,40,CS),I(`code`,null,E(e.id),1)]),I(`span`,null,E(e.description),1),I(`details`,null,[r[2]||=I(`summary`,null,`View prompt`,-1),I(`pre`,null,E(e.text),1)])]))),128))],2)):z(``,!0)],10,bS))),128))]))}}),TS={class:`context-section`,"aria-labelledby":`context-title`},ES={class:`section-label`},DS={key:0,class:`hint`},OS={class:`context-numbers`},kS={class:`context-pct`},AS={key:0,class:`context-compacting`},jS=[`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],MS={class:`context-marker-label`},NS=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],PS={class:`context-marker-label`},FS={class:`hint context-hint`},IS={class:`modal compaction-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`compaction-title`},LS={class:`context-toggle`},RS=[`checked`],zS=512,BS=4096,VS=1024,HS=kr({__name:`ContextBar`,setup(e){let t=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),n=B(()=>Bu.value?.contextWindow??0),r=B(()=>{let e=Pu.value.entries;for(let t=e.length-1;t>=0;t--){if(e[t].kind!==`pi.assistant`)continue;let n=e[t].model?.find(e=>e.role===`assistant`)?.usage;if(n)return n.totalTokens||n.input+n.output+n.cacheRead+n.cacheWrite}return 0}),i=B(()=>Pu.value.compactions.length>0),a=O(),o=B(()=>a.value??Su.value?.compaction??i_(n.value));A(()=>JSON.stringify(Su.value?.compaction),e=>{a.value&&e===JSON.stringify(a.value)&&(a.value=void 0)});let s=O(),c=B(()=>W.dialog?.kind===`compaction`),l=()=>void(W.dialog=void 0);Jr(()=>c.value&&l());let u=B(()=>s.value??a_(n.value,o.value)),d=e=>`${Math.min(100,Math.max(0,100*e/(n.value||1)))}%`,f=B(()=>Math.round(100*r.value/(n.value||1))),p=e=>{let t=e/(n.value||1);return t<.35?`start`:t>.65?`end`:`center`},m=(e,t)=>Math.min(n.value-VS,Math.max((t??BS)+VS,e)),h=(e,t)=>Math.min(t-VS,Math.max(BS,e));function g(e,t){let n=u.value,r=Math.round(t/zS)*zS;s.value=e===`wait`?{auto:n.auto,wait:m(r,n.auto)}:{auto:h(r,n.wait),wait:n.wait}}async function _(e){let t=Tu.value;if(!t)return;let n=await Gu(()=>t.setCompaction(e));n&&(a.value=n),s.value=void 0}function v(){let e=s.value;e&&_({reserveTokens:n.value-e.wait,...e.auto===void 0?{}:{backgroundTokens:e.wait-e.auto}})}let y=O(),b;function ee(e,t){b=e,t.currentTarget.setPointerCapture(t.pointerId)}function x(e){if(!b||!y.value)return;let t=y.value.getBoundingClientRect();g(b,(e.clientX-t.left)/t.width*n.value)}function S(){b&&(b=void 0,v())}function te(e,t){let n=(t.shiftKey?8192:1024)*(t.key===`ArrowRight`||t.key===`ArrowUp`?1:t.key===`ArrowLeft`||t.key===`ArrowDown`?-1:0);if(!n)return;t.preventDefault();let r=u.value;g(e,(e===`auto`?r.auto??BS:r.wait)+n)}return(e,a)=>(N(),P(M,null,[I(`section`,TS,[I(`div`,ES,[a[7]||=I(`span`,{id:`context-title`},`CONTEXT`,-1),n.value?(N(),P(`button`,{key:0,class:`context-details-toggle`,onClick:a[0]||=e=>k(W).dialog={kind:`compaction`}},[L(k(wc),{size:16}),a[6]||=R(`Details `,-1)])):z(``,!0)]),n.value?(N(),P(M,{key:1},[I(`div`,OS,[I(`strong`,null,E(t(r.value)),1),I(`span`,null,`of `+E(t(n.value))+` tokens`,1),I(`span`,kS,E(f.value)+`%`,1),i.value?(N(),P(`span`,AS,[...a[8]||=[I(`i`,null,null,-1),R(`Compacting`,-1)]])):z(``,!0)]),I(`div`,{ref_key:`bar`,ref:y,class:T([`context-bar`,{off:!o.value.enabled}]),onPointermove:x,onPointerup:S,onPointercancel:S},[I(`div`,{class:T([`context-fill`,{hot:u.value.auto!==void 0&&r.value>=u.value.auto}]),style:_e({width:d(r.value)})},null,6),I(`div`,{class:`context-reserve`,style:_e({left:d(u.value.wait)}),title:`Reserved for the answer`},null,4),u.value.auto===void 0?z(``,!0):(N(),P(`button`,{key:0,class:T([`context-marker auto`,`label-${p(u.value.auto)}`]),role:`slider`,"aria-label":`Automatic compaction starts at`,"aria-valuemin":BS,"aria-valuemax":u.value.wait-VS,"aria-valuenow":u.value.auto,"aria-valuetext":`${t(u.value.auto)} tokens`,style:_e({left:d(u.value.auto)}),onPointerdown:a[1]||=e=>ee(`auto`,e),onKeydown:a[2]||=e=>te(`auto`,e),onKeyup:v,onBlur:v},[I(`span`,MS,`Auto-compact at `+E(t(u.value.auto)),1)],46,jS)),I(`button`,{class:T([`context-marker wait`,`label-${p(u.value.wait)}`]),role:`slider`,"aria-label":`The next request waits for a summary at`,"aria-valuemin":(u.value.auto??BS)+VS,"aria-valuemax":n.value-VS,"aria-valuenow":u.value.wait,"aria-valuetext":`${t(u.value.wait)} tokens, ${t(n.value-u.value.wait)} reserved`,style:_e({left:d(u.value.wait)}),onPointerdown:a[3]||=e=>ee(`wait`,e),onKeydown:a[4]||=e=>te(`wait`,e),onKeyup:v,onBlur:v},[I(`span`,PS,`Reserve at `+E(t(u.value.wait)),1)],46,NS)],34),I(`p`,FS,[o.value.enabled?(N(),P(M,{key:0},[a[9]||=R(`Compacts in the background at `,-1),I(`strong`,null,E(t(u.value.auto??u.value.wait)),1),a[10]||=R(` and waits at `,-1),I(`strong`,null,E(t(u.value.wait)),1),a[11]||=R(`.`,-1)],64)):(N(),P(M,{key:1},[R(`Automatic compaction is off.`)],64))])],64)):(N(),P(`div`,DS,`Pick a model to see its context window.`))]),(N(),F(dr,{to:`body`},[c.value?(N(),P(`div`,{key:0,class:`modal-backdrop`,onClick:Ms(l,[`self`])},[I(`section`,IS,[I(`header`,null,[a[12]||=I(`h2`,{id:`compaction-title`},`Context compaction`,-1),I(`button`,{class:`icon-button`,"aria-label":`Close context compaction`,onClick:l},[L(k(cl),{size:18})])]),I(`p`,null,[a[13]||=R(` A summary starts in the background at `,-1),I(`strong`,null,E(t(u.value.auto??u.value.wait)),1),a[14]||=R(`. Above `,-1),I(`strong`,null,E(t(u.value.wait)),1),R(` the next request waits for it, keeping `+E(t(n.value-u.value.wait))+` free for the answer. Drag a marker on the bar to change either point. `,1)]),a[16]||=I(`p`,null,[R(`Older entries stay stored, and `),I(`code`,null,`search_history`),R(` still finds them.`)],-1),I(`label`,LS,[I(`input`,{type:`checkbox`,checked:o.value.enabled,onChange:a[5]||=e=>_({enabled:e.target.checked})},null,40,RS),a[15]||=R(` Automatic compaction `,-1)]),a[17]||=I(`p`,{class:`hint`},[R(` Applies to every agent in this session. `),I(`code`,null,`/compact`),R(` works either way. `)],-1),I(`footer`,null,[I(`button`,{class:`secondary`,onClick:l},`Close`)])])])):z(``,!0)]))],64))}}),US=/^[A-Za-z_$][\w$]*$/,WS=e=>` `.repeat(e);function GS(e,t){let n=[],r=(e,t=`text`)=>n.push({text:e,kind:t});return r(`function`,`keyword`),r(` `),r(e,`function`),r(`(`,`punct`),r(`args`),r(`: `,`punct`),KS(t,0,r),r(`): `,`punct`),r(`Promise`,`type`),r(`<`,`punct`),r(`ToolResult`,`type`),r(`>;`,`punct`),n}function KS(e,t,n){if(!e||typeof e!=`object`)return n(`unknown`,`type`);if(`const`in e)return YS(e.const,n);if(e.enum)return JS(e.enum.map(e=>({const:e})),t,n);if(e.anyOf??e.oneOf)return JS(e.anyOf??e.oneOf,t,n);if(Array.isArray(e.type))return JS(e.type.map(t=>({...e,type:t})),t,n);switch(e.type){case`string`:case`boolean`:case`null`:return n(e.type,`type`);case`number`:case`integer`:return n(`number`,`type`);case`array`:{let r=!!(e.items?.anyOf??e.items?.oneOf??e.items?.enum);return r&&n(`(`,`punct`),KS(e.items,t,n),r&&n(`)`,`punct`),n(`[]`,`punct`)}case`object`:return qS(e,t,n);default:return n(`unknown`,`type`)}}function qS(e,t,n){let r=Object.entries(e.properties??{});if(!r.length)return e.additionalProperties&&typeof e.additionalProperties==`object`?(n(`Record`,`type`),n(`<`,`punct`),n(`string`,`type`),n(`, `,`punct`),KS(e.additionalProperties,t,n),n(`>`,`punct`)):n(`{}`,`punct`);let i=new Set(e.required??[]);n(`{`,`punct`),n(`
|
|
80
80
|
`);for(let[e,a]of r){let r=XS(a);r&&n(`${WS(t+1)}${r}\n`,`comment`),n(WS(t+1)),n(US.test(e)?e:JSON.stringify(e),`property`),n(i.has(e)?`: `:`?: `,`punct`),KS(a,t+1,n),n(`;`,`punct`),n(`
|
|
81
81
|
`)}n(WS(t)),n(`}`,`punct`)}function JS(e,t,n){e.forEach((e,r)=>{r&&n(` | `,`punct`),KS(e,t,n)})}function YS(e,t){if(typeof e==`string`)return t(JSON.stringify(e),`string`);if(typeof e==`number`)return t(String(e),`number`);t(String(e),`type`)}function XS(e){let t=[e.description,e.minimum===void 0?``:`@minimum ${e.minimum}`,e.maximum===void 0?``:`@maximum ${e.maximum}`,e.default===void 0?``:`@default ${JSON.stringify(e.default)}`].filter(Boolean);return t.length?`/** ${t.join(` `)} */`:``}var ZS={key:0,class:`panel-rail`,"aria-label":`Inspector (collapsed)`},QS=[`title`],$S=[`aria-label`,`title`,`onClick`],eC={key:0,class:`count`},tC={class:`inspector-tabs`,role:`tablist`,"aria-label":`Session details`},nC=[`id`,`aria-selected`,`onClick`],rC={key:0,class:`count`},iC=[`title`],aC=[`aria-labelledby`],oC={class:`session-heading`},sC=[`title`],cC={class:`cwd-trail`,dir:`rtl`},lC={dir:`ltr`},uC={class:`session-status`},dC={key:0,class:`background-pill`},fC=[`title`],pC={class:`model-section`},mC=[`src`],hC={class:`thinking-row`},gC=[`value`],_C={class:`stats-section`,"aria-labelledby":`stats-title`},vC={class:`metrics`},yC=[`title`],bC={class:`usage-breakdown`,"aria-label":`Agent token and cost breakdown`},xC={scope:`row`},SC={class:`panel-heading`},CC={class:`hint app-state-description`},wC=[`disabled`],TC={class:`state-json-actions`},EC={key:0,class:`hint`},DC=[`disabled`],OC=[`disabled`],kC={key:0,class:`message-error`,role:`alert`},AC={class:`panel-heading`},jC={class:`tag`},MC={class:`hook-card`},NC=[`aria-checked`],PC={key:0,class:`tag tool-disabled`},FC={class:`tag`},IC=[`aria-label`],LC=kr({__name:`Inspector`,setup(e){let t=B(()=>new Map(Vu.value?.tools.map(e=>[e.name,GS(e.name,e.parameters)]))),n=[{id:`session`,label:`Session`,icon:hc},{id:`git`,label:`Git`,icon:_c},{id:`state`,label:`State`,icon:$s},{id:`tasks`,label:`Tasks`,icon:Ws},{id:`tools`,label:`Tools`,icon:sl},{id:`extensions`,label:`Extend`,icon:Gc}],r=B(()=>[{label:`Input`,tokens:zu.value.input,cost:zu.value.inputCost},{label:`Output`,tokens:zu.value.output,cost:zu.value.outputCost},{label:`Cache read`,tokens:zu.value.cacheRead,cost:zu.value.cacheReadCost},{label:`Cache write`,tokens:zu.value.cacheWrite,cost:zu.value.cacheWriteCost}]),i=B(()=>Lu.value.filter(e=>e.background).length);function a(e,t){Gu(async()=>{await wu.value.configure(e),await Uu(),t&&G(t)})}function o(){let e=Tu.value;e&&(W.dialog={kind:`prompt`,title:`Rename session`,label:`Session name`,value:Su.value?.name??``,submit:`Save name`,run:t=>e.rename(t)})}let s=xu.sharedState,c=O(``),l=O(``),u=O(0),d=O(!1),f=O(``),p=B(()=>c.value!==l.value),m=B(()=>p.value&&s.value?.revision!==u.value);function h(){c.value=Ju(s.value?.value??{}),l.value=c.value,u.value=s.value?.revision??0,f.value=``}A(s,()=>!p.value&&h(),{immediate:!0});async function g(e){if(!d.value&&wu.value){d.value=!0,f.value=``;try{await wu.value.demo(`state`,e)}catch(e){f.value=Ql(e)}finally{d.value=!1}}}async function _(){if(!d.value&&wu.value){f.value=``,d.value=!0;try{let e=JSON.parse(c.value);if(!e||Array.isArray(e)||typeof e!=`object`)throw Error(`App State must be a JSON object.`);let t=await wu.value.demo(`state`,{operation:`update`,path:``,value:e,expectedRevision:u.value});c.value=Ju(t.value),l.value=c.value,u.value=t.revision,G(`Shared App State saved.`)}catch(e){f.value=Ql(e)}finally{d.value=!1}}}let v=B(()=>Vu.value?.config.readOnly===!0),y=B(()=>Vu.value?.tools.filter(e=>e.offered).length??0);return(e,l)=>(N(),P(`aside`,{class:T([`inspector`,{collapsed:!k(td),overlay:k(W).inspectorOverlay}])},[k(td)?(N(),P(M,{key:1},[I(`div`,tC,[(N(),P(M,null,j(n,e=>I(`button`,{id:`inspector-tab-${e.id}`,key:e.id,role:`tab`,"aria-controls":`inspector-panel`,"aria-selected":k(W).tab===e.id,class:T({active:k(W).tab===e.id}),onClick:t=>k(W).tab=e.id},[(N(),F(ni(e.icon),{size:18})),R(E(e.label),1),e.id===`tasks`&&k(Lu).length?(N(),P(`span`,rC,E(k(Lu).length),1)):z(``,!0)],10,nC)),64)),I(`button`,{class:`icon-button panel-toggle`,"aria-label":`Collapse inspector`,title:`Collapse inspector (${k(sd).inspector})`,onClick:l[1]||=e=>k(rd)()},[L(k(Rc),{size:18})],8,iC)]),I(`div`,{id:`inspector-panel`,class:T([`inspector-body`,{"session-panel":k(W).tab===`session`}]),role:`tabpanel`,"aria-labelledby":`inspector-tab-${k(W).tab}`},[k(W).tab===`session`?(N(),P(M,{key:0},[I(`section`,oC,[I(`h1`,null,[I(`span`,null,E(k(Su)?.name??`Loading session`),1),I(`button`,{class:`icon-button`,title:`Rename session`,"aria-label":`Rename session`,onClick:o},[L(k(Hc),{size:18})])]),I(`button`,{class:`path cwd-button`,title:k(Su)?.cwd,"aria-label":`Show full working directory`,onClick:l[2]||=e=>k(W).dialog={kind:`path`,path:k(Su)?.cwd??``}},[L(k(hc),{size:18}),I(`span`,cC,[I(`bdi`,lC,E(k(Su)?.cwd),1)])],8,sC),I(`div`,uC,[I(`span`,{class:T([`status-pill`,{working:k(Ru)}])},[l[7]||=I(`i`,null,null,-1),R(E(k(Ru)?`Working`:`Idle`),1)],2),i.value?(N(),P(`span`,dC,E(i.value)+` background`,1)):z(``,!0),I(`span`,{class:`saved`,title:k(_u)?.id},[L(k(Jc),{size:18}),R(E(k(_u)?.name??k(_u)?.id),1)],8,fC),k(_u)?(N(),F(kv,{key:1,device:k(_u)},null,8,[`device`])):z(``,!0)])]),k(_u)?(N(),F(Kv,{key:0,device:k(_u)},null,8,[`device`])):z(``,!0),I(`section`,pC,[l[14]||=I(`div`,{class:`section-label`},[I(`span`,null,`AGENT`)],-1),I(`button`,{class:`model-button`,onClick:l[3]||=e=>k(W).dialog={kind:`models`}},[I(`img`,{src:k(Yu)(k(Pu).agent.model?.modelId),alt:``},null,8,mC),I(`div`,null,[I(`strong`,null,E(k(Bu)?.name??k(Pu).agent.model?.modelId??`Loading…`),1),I(`small`,null,E(k(Bu)?.tier??``)+` / `+E(k(Pu).agent.model?.provider??``),1)]),L(k(nc),{size:18})]),I(`div`,hC,[l[8]||=I(`span`,null,`Thinking`,-1),I(`select`,{"aria-label":`Thinking level`,value:k(Pu).agent.thinkingLevel??`low`,onChange:l[4]||=e=>a({thinkingLevel:e.target.value},`Thinking ${e.target.value}. Used on the next turn.`)},[(N(!0),P(M,null,j(k(t_),e=>(N(),P(`option`,{key:e},E(e),1))),128))],40,gC)]),L(HS),I(`section`,_C,[l[13]||=I(`div`,{class:`section-label`},[I(`span`,{id:`stats-title`},`STATS`)],-1),I(`div`,vC,[I(`div`,{title:`${k(zu).tokens.toLocaleString(`en-US`)} total tokens`},[I(`span`,null,E(k(qu)(k(zu).tokens)),1),l[9]||=I(`small`,null,`total tokens`,-1)],8,yC),I(`div`,null,[I(`span`,null,`$`+E(k(zu).cost.toFixed(4)),1),l[10]||=I(`small`,null,`agent cost`,-1)]),I(`div`,null,[I(`span`,null,E(k(Vu)?.tools.length??0),1),l[11]||=I(`small`,null,`tools`,-1)])]),I(`table`,bC,[l[12]||=I(`thead`,null,[I(`tr`,null,[I(`th`,{scope:`col`},`Type`),I(`th`,{scope:`col`},`Tokens`),I(`th`,{scope:`col`},`Cost (USD)`)])],-1),I(`tbody`,null,[(N(!0),P(M,null,j(r.value,e=>(N(),P(`tr`,{key:e.label},[I(`th`,xC,E(e.label),1),I(`td`,null,E(e.tokens.toLocaleString(`en-US`)),1),I(`td`,null,`$`+E(e.cost.toFixed(4)),1)]))),128))])])])])],64)):z(``,!0),k(W).tab===`state`?(N(),P(M,{key:1},[I(`div`,SC,[l[15]||=I(`h2`,null,`App State`,-1),L(k($s),{size:18})]),I(`p`,CC,` One shared JSON object for every agent, session and fork on `+E(k(_u)?.name??k(_u)?.id)+`. You and your agents can read, create, update or delete values and fields. Changes appear live and persist across closed browsers, interrupted agents and backend restarts. `,1),Wn(I(`textarea`,{"onUpdate:modelValue":l[5]||=e=>c.value=e,class:`app-state-json`,"aria-label":`App State JSON`,spellcheck:`false`,disabled:d.value||!k(s),rows:`12`},null,8,wC),[[Ss,c.value]]),I(`div`,TC,[m.value?(N(),P(`span`,EC,`State changed elsewhere. Load the latest JSON before saving.`)):z(``,!0),p.value?(N(),P(`button`,{key:1,class:`secondary`,disabled:d.value,onClick:h},E(m.value?`Load latest`:`Reset`),9,DC)):z(``,!0),I(`button`,{class:`primary small`,disabled:!p.value||d.value||m.value,onClick:_},E(d.value?`Saving…`:`Save JSON`),9,OC)]),f.value?(N(),P(`p`,kC,E(f.value),1)):z(``,!0),L(Cv,{value:k(s)?.value??{},disabled:d.value||p.value||!k(s),onChange:g},null,8,[`value`,`disabled`])],64)):z(``,!0),k(W).tab===`tasks`?(N(),F(Cy,{key:2})):z(``,!0),k(W).tab===`git`?(N(),F(gS,{key:3})):z(``,!0),k(W).tab===`extensions`?(N(),F(wS,{key:4})):z(``,!0),k(W).tab===`tools`?(N(),P(M,{key:5},[I(`div`,AC,[l[16]||=I(`h2`,null,`Tools`,-1),I(`span`,jC,E(y.value)+` / `+E(k(Vu)?.tools.length??0),1)]),l[20]||=I(`p`,{class:`hint`},` Every tool this agent's extensions provide. Open one to see its definition. `,-1),I(`div`,MC,[I(`div`,null,[L(k(Xc),{size:18}),l[18]||=I(`strong`,null,`Read only`,-1),I(`button`,{class:T([`switch`,{on:v.value}]),role:`switch`,"aria-checked":v.value,"aria-label":`Read only`,onClick:l[6]||=e=>a({readOnly:!v.value},v.value?`Read only off. Every tool is back.`:`Read only on. Tools that write are disabled.`)},[...l[17]||=[I(`span`,null,null,-1)]],10,NC)]),l[19]||=I(`p`,null,` Offers this agent only tools that read. Tools that create, update or delete leave its next request, and the choice is stored with the agent. `,-1)]),(N(!0),P(M,null,j(k(Vu)?.tools,e=>(N(),P(`details`,{key:e.name,class:T([`tool-row`,{disabled:!e.offered}])},[I(`summary`,null,[L(k(sl),{size:18}),I(`strong`,null,E(e.name),1),e.offered?z(``,!0):(N(),P(`span`,PC,`disabled`)),I(`span`,FC,E(e.replay===`safe`?`replay safe`:`interrupt on crash`),1)]),I(`p`,null,E(e.description),1),e.parameters?(N(),P(`pre`,{key:0,class:`tool-signature`,"aria-label":`${e.name} TypeScript definition`},[I(`code`,null,[(N(!0),P(M,null,j(t.value.get(e.name),(e,t)=>(N(),P(`span`,{key:t,class:T(`tk-${e.kind}`)},E(e.text),3))),128))])],8,IC)):z(``,!0),I(`small`,null,E(e.replay===`safe`?`An interrupted execution may run again after recovery.`:`A crash records an interrupted result instead of rerunning this effect.`),1)],2))),128))],64)):z(``,!0)],10,aC)],64)):(N(),P(`div`,ZS,[I(`button`,{class:`icon-button panel-toggle`,"aria-label":`Expand inspector`,title:`Expand inspector (${k(sd).inspector})`,onClick:l[0]||=e=>k(nd)()},[L(k(zc),{size:18})],8,QS),(N(),P(M,null,j(n,e=>I(`button`,{key:e.id,class:T([`rail-tab`,{active:k(W).tab===e.id}]),"aria-label":`Open ${e.label}`,title:e.label,onClick:t=>k(nd)(e.id)},[(N(),F(ni(e.icon),{size:20})),e.id===`tasks`&&k(Lu).length?(N(),P(`span`,eC,E(k(Lu).length),1)):z(``,!0)],10,$S)),64))]))],2))}}),RC={class:`chat-empty`},zC={class:`eyebrow`},BC={key:3,class:`hint offline-error`},VC={key:4,class:`offline-command`},HC={key:5,class:`hint`},UC={key:6,class:`hint`},WC={class:`offline-actions`},GC=[`disabled`],KC={key:7,class:`message-error`,role:`alert`},qC=kr({__name:`OfflinePanel`,props:{device:{}},setup(e){let t=e,n=O(!1),r=O(``),i=B(()=>{let e=t.device,n=e.source===`config`;switch(e.status){case`checking`:return{title:`Checking ${e.id}…`,text:`Probing the device. This view fills in as soon as it answers.`};case`unauthorized`:return e.transport===`tunnel`?{title:`${e.id} tunnel credentials are not valid`,text:`Pair the device again — the hub will mint a fresh credential.`}:{title:e.hasToken?`${e.id} rejected its token`:`No token for ${e.id}`,text:e.hasToken?`The device's DPI_TOKEN changed (a rotate or a rebuilt device). Copy the current token into this hub's registry, then check again.`:`This hub has no token for the device yet. Register it, then check again.`,command:n&&e.kind!==`url`?`just net register ${e.id}`:`just net register ${e.id} --token <token>`};case`mismatch`:return{title:`${e.id} answers as a different device`,text:`The URL now reaches a backend with another identity (a rebuilt VM or a new data directory). If that is expected, register it again: that trusts the identity it answers with now.`,command:e.kind===`url`?`just net register ${e.id} --token <token>`:`just net register ${e.id}`};case`incompatible`:return{title:`${e.id} speaks another API version`,text:`Update the device's dpi-backend.`,command:n?`just net deploy ${e.id}`:void 0};default:return{title:`${e.id} is offline`,text:`Last seen ${Xu(e.lastSeenAt)}. Its agents keep their state on the device and resume when its backend starts again. The tree shows the last known sessions.`,command:n?e.kind===`local`?`just backend run`:e.kind===`url`?void 0:`just net restart ${e.id}`:void 0,alt:n&&e.kind!==`local`&&e.kind!==`url`?`just net up ${e.id}`:void 0}}});async function a(){n.value=!0,r.value=``;try{let e=await Zl.check(t.device.id);e.status===`online`&&G(`${e.id} is online.`)}catch(e){r.value=Ql(e)}finally{n.value=!1}}async function o(e){try{await navigator.clipboard.writeText(e),G(`Copied.`)}catch{G(`Clipboard needs localhost or HTTPS. Select the text to copy.`)}}return(t,s)=>(N(),P(`section`,{class:T([`chat-panel offline-panel`,e.device.status]),"aria-live":`polite`},[I(`div`,RC,[e.device.status===`checking`?(N(),F(k(jc),{key:0,class:`spin`,size:30})):e.device.status===`mismatch`||e.device.status===`unauthorized`?(N(),F(k(Yc),{key:1,size:30})):(N(),F(k(il),{key:2,size:30})),I(`span`,zC,E(e.device.kind.toUpperCase())+` · `+E(e.device.url??(e.device.transport===`tunnel`?`tunnel`:`no endpoint`)),1),I(`h2`,null,E(i.value.title),1),I(`p`,null,E(i.value.text),1),e.device.error?(N(),P(`p`,BC,E(e.device.error),1)):z(``,!0),i.value.command?(N(),P(`div`,VC,[I(`code`,null,E(i.value.command),1),I(`button`,{class:`icon-button`,"aria-label":`Copy command`,onClick:s[0]||=e=>o(i.value.command)},[L(k(sc),{size:18})])])):z(``,!0),i.value.command?(N(),P(`p`,HC,`Run it in this repo's terminal, then press Check now.`)):z(``,!0),i.value.alt?(N(),P(`p`,UC,[s[2]||=R(` Never deployed or rebuilt? `,-1),I(`code`,null,E(i.value.alt),1),s[3]||=R(` provisions it from scratch. `,-1)])):z(``,!0),I(`div`,WC,[I(`button`,{class:`secondary`,disabled:n.value,onClick:s[1]||=e=>a()},[L(k(Kc),{size:18}),R(E(n.value?`Checking…`:`Check now`),1)],8,GC)]),r.value?(N(),P(`p`,KC,E(r.value),1)):z(``,!0)])],2))}}),JC={class:`dir-browser`},YC={class:`dir-path`},XC=[`disabled`],ZC=[`aria-busy`],QC=[`title`],$C=[`aria-selected`,`title`,`onClick`],ew={key:1,class:`hint`},tw={key:0,class:`message-error`,role:`alert`},nw=kr({__name:`DirBrowser`,props:ui({deviceId:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=Ai(e,`modelValue`),r=O(),i=O(!1),a=O(``),o=0;async function s(e){let s=++o,c=t.deviceId;i.value=!0,a.value=``;try{let t=await H(c).dirs(e);return s===o?(r.value=t,t.path&&(n.value=t.path),t):void 0}catch(e){s===o&&(a.value=Ql(e));return}finally{s===o&&(i.value=!1)}}return A(()=>t.deviceId,async()=>{r.value=void 0;let e=await s(``),t=e?.dirs[0];t&&!e.path&&await s(t.path)},{immediate:!0}),(e,t)=>(N(),P(`div`,JC,[I(`div`,YC,[Wn(I(`input`,{"onUpdate:modelValue":t[0]||=e=>n.value=e,"aria-label":`Working directory`,required:``,placeholder:`/path/to/project`,spellcheck:`false`,autocomplete:`off`,onKeydown:t[1]||=Ps(Ms(e=>s(n.value),[`prevent`]),[`enter`])},null,544),[[Ss,n.value]]),I(`button`,{type:`button`,class:`secondary small`,disabled:i.value||!n.value,onClick:t[2]||=e=>s(n.value)},` Go `,8,XC)]),I(`div`,{class:`dir-list`,role:`listbox`,"aria-label":`Directories`,"aria-busy":i.value},[I(`button`,{type:`button`,class:`dir-item`,title:`Start directories`,onClick:t[3]||=e=>s(``)},[L(k(Cc),{size:16}),t[5]||=I(`span`,null,`Start dirs`,-1)]),r.value?.parent?(N(),P(`button`,{key:0,type:`button`,class:`dir-item`,title:r.value.parent,onClick:t[4]||=e=>s(r.value.parent)},[L(k(lc),{size:16}),t[6]||=I(`span`,null,`..`,-1)],8,QC)):z(``,!0),(N(!0),P(M,null,j(r.value?.dirs,e=>(N(),P(`button`,{key:e.path,type:`button`,class:`dir-item`,role:`option`,"aria-selected":e.path===n.value,title:e.path,onClick:t=>s(e.path)},[e.path===n.value?(N(),F(k(hc),{key:0,size:16})):(N(),F(k(gc),{key:1,size:16})),I(`span`,null,E(e.name),1)],8,$C))),128)),r.value&&!r.value.dirs.length?(N(),P(`p`,ew,`No subdirectories.`)):z(``,!0)],8,ZC),a.value?(N(),P(`p`,tw,E(a.value),1)):z(``,!0)]))}}),rw={key:0,class:`message-error`},iw=[`value`],aw={class:`field`},ow={key:0,class:`hint`,title:`The device has no provider key — it lists its built-in catalog, and chat needs OPENROUTER_API_KEY set in the device's env file`},sw=[`value`],cw={key:2,class:`message-error`,role:`alert`},lw=[`disabled`],uw=kr({__name:`NewSessionDialog`,props:{deviceId:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=B(()=>uu.devices.value.filter(e=>e.status===`online`)),a=O(i.value.find(e=>e.id===n.deviceId)?.id??i.value[0]?.id??``),o=B(()=>i.value.find(e=>e.id===a.value)),s=B(()=>{let e=o.value?.info?.models??[];if(e.length)return e;let t=o.value?.info;return t?.defaultModel&&t.provider?[{id:t.defaultModel,provider:t.provider,name:`${t.defaultModel} (device default)`,tier:`—`,icon:`lab.png`,contextWindow:0,reasoning:!1,cost:{input:0,output:0}}]:[]}),c=B(()=>!s.value.length||(o.value?.info?.models?.length??0)===0),l=B(()=>!!o.value?.info?.providerKeyMissing),u=e=>`${e.provider}/${e.id}`,d=O({name:``,cwd:``,model:``}),f=O(!1),p=O(``);A(o,e=>{let t=s.value,n=t.find(t=>t.id===e?.info?.defaultModel)??t[0];d.value.model=n?u(n):``,d.value.cwd=``},{immediate:!0});async function m(){if(!f.value&&o.value){f.value=!0,p.value=``;try{let e=s.value.find(e=>u(e)===d.value.model)??s.value[0];if(!e)throw Error(`Choose a model`);let t=await H(o.value.id).createSession({name:d.value.name.trim()||`New session`,cwd:d.value.cwd.trim(),model:{provider:e.provider,modelId:e.id}}),n=t.agents.find(e=>e.kind===`root`)??t.agents[0];Eu({deviceId:o.value.id,sessionId:t.id,agentId:n?.id??1}),G(`Session created on ${o.value.id}.`),r(`close`)}catch(e){p.value=Ql(e)}finally{f.value=!1}}}return(e,t)=>(N(),P(`div`,{class:`modal-backdrop`,onClick:t[6]||=Ms(e=>r(`close`),[`self`])},[I(`form`,{class:`modal session-modal`,onSubmit:Ms(m,[`prevent`])},[I(`header`,null,[t[7]||=I(`div`,null,[I(`span`,{class:`eyebrow`},`A PERSISTENT WORKSPACE`),I(`h2`,null,`New session`)],-1),I(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close new session`,onClick:t[0]||=e=>r(`close`)},[L(k(cl),{size:18})])]),i.value.length?(N(),P(M,{key:1},[I(`label`,null,[t[8]||=R(`Device`,-1),Wn(I(`select`,{"onUpdate:modelValue":t[1]||=e=>a.value=e,"aria-label":`Device`},[(N(!0),P(M,null,j(i.value,e=>(N(),P(`option`,{key:e.id,value:e.id},E(e.name)+E(e.info?.hostname&&e.info.hostname!==e.name?` · ${e.info.hostname}`:``),9,iw))),128))],512),[[Ts,a.value]])]),I(`label`,null,[t[9]||=R(`Session name`,-1),Wn(I(`input`,{"onUpdate:modelValue":t[2]||=e=>d.value.name=e,autofocus:``,placeholder:`My durable agent`,maxlength:`100`},null,512),[[Ss,d.value.name]])]),I(`div`,aw,[I(`span`,null,`Working directory on `+E(i.value.find(e=>e.id===a.value)?.name??a.value),1),L(nw,{modelValue:d.value.cwd,"onUpdate:modelValue":t[3]||=e=>d.value.cwd=e,"device-id":a.value},null,8,[`modelValue`,`device-id`])]),I(`label`,null,[t[10]||=R(`Model`,-1),c.value||l.value?(N(),P(`span`,ow,`no API key on device — chat needs one`)):z(``,!0),Wn(I(`select`,{"onUpdate:modelValue":t[4]||=e=>d.value.model=e,"aria-label":`New session model`},[(N(!0),P(M,null,j(s.value,e=>(N(),P(`option`,{key:u(e),value:u(e)},E(e.tier)+` / `+E(e.name),9,sw))),128))],512),[[Ts,d.value.model]])])],64)):(N(),P(`p`,rw,` No device is online. Start one with just backend run or just net up <id>, then try again. `)),p.value?(N(),P(`p`,cw,E(p.value),1)):z(``,!0),I(`footer`,null,[I(`button`,{type:`button`,class:`secondary`,onClick:t[5]||=e=>r(`close`)},`Cancel`),I(`button`,{class:`primary`,disabled:f.value||!d.value.model||!d.value.cwd||!o.value},[L(k(Wc),{size:18}),R(E(f.value?`Creating…`:`Create session`),1)],8,lw)])],32)]))}}),dw=new Uint8Array(512),fw=new Uint8Array(256);(()=>{let e=1;for(let t=0;t<255;t++)dw[t]=e,fw[e]=t,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)dw[e]=dw[e-255]})();var pw=(e,t)=>e===0||t===0?0:dw[fw[e]+fw[t]];function mw(e){let t=[1];for(let n=0;n<e;n++){let e=Array(t.length+1).fill(0);for(let r=0;r<t.length;r++)e[r]^=t[r],e[r+1]^=pw(t[r],dw[n]);t=e}return t}function hw(e,t){let n=mw(t),r=Array(t).fill(0);for(let i of e){let e=i^r[0];r.shift(),r.push(0);for(let i=0;i<t;i++)r[i]^=pw(n[i+1],e)}return r}var gw=[21,25,29,33,37,41,45,49,53,57,61,65],_w=[19,34,55,80,108,136,156,194,232,274,324,370],vw=[7,10,15,20,26,36,40,48,60,72,80,96],yw=[7,10,15,20,26,18,20,24,30,18,20,24],bw=[[[1,19]],[[1,34]],[[1,55]],[[1,80]],[[1,108]],[[2,68]],[[2,78]],[[2,97]],[[2,116]],[[2,68],[2,69]],[[4,81]],[[2,92],[2,93]]],xw=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58]],Sw=e=>e<=9?8:16;function Cw(e){for(let t=1;t<=gw.length;t++)if(4+Sw(t)+e*8<=_w[t-1]*8)return t;throw Error(`qr: payload too long (${e} bytes; v12L max ${_w[11]-3})`)}function ww(e,t){let n=[...new TextEncoder().encode(e)],r=[],i=(e,t)=>{for(let n=t-1;n>=0;n--)r.push(e>>n&1)};i(4,4),i(n.length,Sw(t));for(let e of n)i(e,8);let a=_w[t-1],o=a*8;for(i(0,Math.min(4,o-r.length));r.length%8!=0;)r.push(0);let s=[236,17],c=0;for(;r.length<o;)i(s[c++%2],8);let l=[];for(let e=0;e<a;e++){let t=0;for(let n=0;n<8;n++)t=t<<1|r[e*8+n];l.push(t)}return l}function Tw(e,t){let n=yw[e-1],r=[],i=0;for(let[n,a]of bw[e-1])for(let e=0;e<n;e++)r.push(t.slice(i,i+=a));let a=[],o=Math.max(...r.map(e=>e.length));for(let e=0;e<o;e++)for(let t of r)e<t.length&&a.push(t[e]);let s=r.map(e=>hw(e,n));for(let e=0;e<n;e++)for(let t of s)a.push(t[e]);return a}function Ew(e){return Array.from({length:e},()=>Array(e).fill(!1))}function Dw(e,t){let n=gw[t-1],r=(t,r)=>{for(let i=-1;i<=7;i++)for(let a=-1;a<=7;a++){let o=t+i,s=r+a;if(o<0||o>=n||s<0||s>=n)continue;let c=i>=0&&i<=6&&a>=0&&a<=6&&(i===0||i===6||a===0||a===6),l=i>=2&&i<=4&&a>=2&&a<=4;e[o][s]=c||l}};r(0,0),r(0,n-7),r(n-7,0);for(let t=8;t<n-8;t++)e[6][t]=t%2==0,e[t][6]=t%2==0;let i=xw[t-1];for(let t of i)for(let r of i)if(!(t<=8&&r<=8||t<=8&&r>=n-9||t>=n-9&&r<=8))for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)e[t+n][r+i]=Math.max(Math.abs(n),Math.abs(i))!==1;if(e[n-8][8]=!0,t>=7){let r=t<<12;for(let e=17;e>=12;e--)r>>e&1&&(r^=7973<<e-12);let i=t<<12|r&4095;for(let t=0;t<18;t++){let r=(i>>t&1)==1,a=n-11+t%3,o=t/3|0;e[a][o]=r,e[o][a]=r}}}function Ow(e){let t=8|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>9&1?1335:0);let r=(t<<10|n)^21522,i=[];for(let e=14;e>=0;e--)i.push((r>>e&1)==1);return i}function kw(e,t){let n=gw[0]*0+e.length,r=Ow(t);for(let t=0;t<=5;t++)e[8][t]=r[t];e[8][7]=r[6],e[8][8]=r[7],e[7][8]=r[8];for(let t=9;t<15;t++)e[14-t][8]=r[t];for(let t=0;t<7;t++)e[n-1-t][8]=r[t];e[8][n-8]=r[7];for(let t=8;t<15;t++)e[8][n-15+t]=r[t];e[n-8][8]=!0}function Aw(e,t,n,r){let i=e.length;gw[n-1]*gw[n-1];let a=e=>((t[e>>3]??0)>>7-(e&7)&1)==1,o=0,s=!0;for(let t=i-1;t>0;t-=2){t===6&&t--;for(let c=0;c<i;c++){let l=s?i-1-c:c;for(let i of[t,t-1]){if(Mw(l,i,n))continue;if(o>=(_w[n-1]+vw[n-1])*8){o++;continue}let t=a(o++);jw(l,i,r)&&(t=!t),e[l][i]=t}}s=!s}}function jw(e,t,n){switch(n){case 0:return(e+t)%2==0;case 1:return e%2==0;case 2:return t%3==0;case 3:return(e+t)%3==0;case 4:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return e*t%2+e*t%3==0;case 6:return(e*t%2+e*t%3)%2==0;default:return((e+t)%2+e*t%3)%2==0}}function Mw(e,t,n){let r=gw[n-1];if(e<=8&&t<=8||e<=8&&t>=r-8||e>=r-8&&t<=8||e===6||t===6||n>=7&&(e>=r-11&&e<=r-9&&t<=5||t>=r-11&&t<=r-9&&e<=5))return!0;let i=xw[n-1];for(let n of i)for(let a of i)if(!(n<=8&&a<=8||n<=8&&a>=r-9||n>=r-9&&a<=8)&&Math.abs(e-n)<=2&&Math.abs(t-a)<=2)return!0;return!1}function Nw(e){let t=e.length,n=0;for(let r=0;r<2;r++)for(let i=0;i<t;i++){let a=1;for(let o=1;o<t;o++)(r===0?e[i][o]:e[o][i])===(r===0?e[i][o-1]:e[o-1][i])?(a++,o===t-1&&a>=5&&(n+=3+(a-5))):(a>=5&&(n+=3+(a-5)),a=1)}for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=e[r][i];e[r][i+1]===t&&e[r+1][i]===t&&e[r+1][i+1]===t&&(n+=3)}let r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=(e,t)=>{for(let i=0;i+11<=t;i++){let t=!0;for(let n=0;n<11;n++)if(e(i+n)!==r[n]){t=!1;break}t&&(n+=40)}};for(let n=0;n<t;n++)i(t=>e[n][t],t);for(let n=0;n<t;n++)i(t=>e[t][n],t);let a=0;for(let t of e)for(let e of t)e&&a++;let o=a*100/(t*t);return n+=Math.floor(Math.abs(o-50)/5)*10,n}function Pw(e,t){let n=Cw(new TextEncoder().encode(e).length),r=gw[n-1],i=Tw(n,ww(e,n)),a=Ew(r);return Dw(a,n),Aw(a,i,n,t),kw(a,t),a}function Fw(e,t){if(t!==void 0)return Pw(e,t);let n;for(let t=0;t<8;t++){let r=Pw(e,t),i=Nw(r);(!n||i<n.score)&&(n={m:r,score:i})}return n.m}function Iw(e,t=160){let n=Fw(e),r=n.length,i=t/(r+8),a=``;for(let e=0;e<r;e++)for(let t=0;t<r;t++)n[e][t]&&(a+=`<rect x="${((t+4)*i).toFixed(2)}" y="${((e+4)*i).toFixed(2)}" width="${i.toFixed(3)}" height="${i.toFixed(3)}"/>`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${t}" shape-rendering="crispEdges"><rect width="${t}" height="${t}" fill="#fff"/><g fill="#000">${a}</g></svg>`}var Lw={class:`device-handoff`,"aria-label":`Pair this machine`},Rw={class:`row`},zw=[`disabled`],Bw=[`disabled`],Vw={key:0,class:`target`,"data-testid":`device-url`},Hw={key:1,class:`err`},Uw=Qg(kr({__name:`DeviceHandoff`,props:{offerFragment:{}},setup(e){let t=e,n=O(`4780`),r=O(!1),i=B(()=>{let e=/^\d{1,5}$/.test(n.value)?Number(n.value):0;if(!(!e||e<1||e>65535))return`http://127.0.0.1:${e}/pair#${t.offerFragment}`});function a(){let e=i.value;e&&window.open(e,`_blank`,`noopener`)}async function o(){let e=i.value;if(e)try{await navigator.clipboard.writeText(e),r.value=!0,setTimeout(()=>r.value=!1,1600)}catch{}}return(e,t)=>(N(),P(`section`,Lw,[I(`header`,null,[L(k(Pc),{size:18}),t[1]||=I(`h3`,null,`Pair THIS machine`,-1)]),t[4]||=I(`p`,{class:`what`},[R(` If this browser runs on the device itself, open its local pairing page — the offer is relayed inside the link, nothing is sent to the hub. Start `),I(`code`,null,`dpi device`),R(` there first. `)],-1),I(`div`,Rw,[I(`label`,null,[t[2]||=R(` local port `,-1),Wn(I(`input`,{"onUpdate:modelValue":t[0]||=e=>n.value=e,inputmode:`numeric`,spellcheck:`false`,"aria-label":`Local dpi backend port`},null,512),[[Ss,n.value]])]),I(`button`,{class:`primary`,type:`button`,disabled:!i.value,onClick:a},[L(k(fc),{size:15}),t[3]||=R(`Open the device page `,-1)],8,zw),I(`button`,{class:`secondary`,type:`button`,disabled:!i.value,onClick:o},[L(k(sc),{size:15}),R(E(r.value?`Copied`:`Copy link`),1)],8,Bw)]),i.value?(N(),P(`p`,Vw,E(i.value),1)):z(``,!0),i.value?z(``,!0):(N(),P(`p`,Hw,`port must be 1–65535`))]))}}),[[`__scopeId`,`data-v-01884b7b`]]);function Ww(e){return $w(e)&&!Gw(e)&&!rT(e)&&Symbol.asyncIterator in e}function Gw(e){return Array.isArray(e)}function Kw(e){return typeof e==`bigint`}function qw(e){return typeof e==`boolean`}function Jw(e){return e instanceof globalThis.Date}function Yw(e){return typeof e==`function`}function Xw(e){return $w(e)&&!Gw(e)&&!rT(e)&&Symbol.iterator in e}function Zw(e){return e===null}function Qw(e){return typeof e==`number`}function $w(e){return typeof e==`object`&&!!e}function eT(e){return e instanceof globalThis.RegExp}function tT(e){return typeof e==`string`}function nT(e){return typeof e==`symbol`}function rT(e){return e instanceof globalThis.Uint8Array}function iT(e){return e===void 0}function aT(e){return e.map(e=>uT(e))}function oT(e){return new Date(e.getTime())}function sT(e){return new Uint8Array(e)}function cT(e){return new RegExp(e.source,e.flags)}function lT(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=uT(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=uT(e[n]);return t}function uT(e){return Gw(e)?aT(e):Jw(e)?oT(e):rT(e)?sT(e):eT(e)?cT(e):$w(e)?lT(e):e}function dT(e){return uT(e)}function fT(e,t){return dT(t===void 0?e:{...t,...e})}function pT(e){return typeof e==`object`&&!!e}function mT(e){return globalThis.Array.isArray(e)&&!globalThis.ArrayBuffer.isView(e)}function hT(e){return e===void 0}function gT(e){return typeof e==`number`}var _T;(function(e){e.InstanceMode=`default`,e.ExactOptionalPropertyTypes=!1,e.AllowArrayObject=!1,e.AllowNaN=!1,e.AllowNullVoid=!1;function t(t,n){return e.ExactOptionalPropertyTypes?n in t:t[n]!==void 0}e.IsExactOptionalProperty=t;function n(t){let n=pT(t);return e.AllowArrayObject?n:n&&!mT(t)}e.IsObjectLike=n;function r(e){return n(e)&&!(e instanceof Date)&&!(e instanceof Uint8Array)}e.IsRecordLike=r;function i(t){return e.AllowNaN?gT(t):Number.isFinite(t)}e.IsNumberLike=i;function a(t){let n=hT(t);return e.AllowNullVoid?n||t===null:n}e.IsVoidLike=a})(_T||={});function vT(e){return globalThis.Object.freeze(e).map(e=>CT(e))}function yT(e){return e}function bT(e){return e}function xT(e){return e}function ST(e){let t={};for(let n of Object.getOwnPropertyNames(e))t[n]=CT(e[n]);for(let n of Object.getOwnPropertySymbols(e))t[n]=CT(e[n]);return globalThis.Object.freeze(t)}function CT(e){return Gw(e)?vT(e):Jw(e)?yT(e):rT(e)?bT(e):eT(e)?xT(e):$w(e)?ST(e):e}function J(e,t){let n=t===void 0?e:{...t,...e};switch(_T.InstanceMode){case`freeze`:return CT(n);case`clone`:return dT(n);default:return n}}var wT=class extends Error{constructor(e){super(e)}},TT=Symbol.for(`TypeBox.Transform`),ET=Symbol.for(`TypeBox.Readonly`),DT=Symbol.for(`TypeBox.Optional`),OT=Symbol.for(`TypeBox.Hint`),Y=Symbol.for(`TypeBox.Kind`);function kT(e){return $w(e)&&e[ET]===`Readonly`}function AT(e){return $w(e)&&e[DT]===`Optional`}function jT(e){return X(e,`Any`)}function MT(e){return X(e,`Argument`)}function NT(e){return X(e,`Array`)}function PT(e){return X(e,`AsyncIterator`)}function FT(e){return X(e,`BigInt`)}function IT(e){return X(e,`Boolean`)}function LT(e){return X(e,`Computed`)}function RT(e){return X(e,`Constructor`)}function zT(e){return X(e,`Date`)}function BT(e){return X(e,`Function`)}function VT(e){return X(e,`Integer`)}function HT(e){return X(e,`Intersect`)}function UT(e){return X(e,`Iterator`)}function X(e,t){return $w(e)&&Y in e&&e[Y]===t}function WT(e){return qw(e)||Qw(e)||tT(e)}function GT(e){return X(e,`Literal`)}function KT(e){return X(e,`MappedKey`)}function qT(e){return X(e,`MappedResult`)}function JT(e){return X(e,`Never`)}function YT(e){return X(e,`Not`)}function XT(e){return X(e,`Null`)}function ZT(e){return X(e,`Number`)}function QT(e){return X(e,`Object`)}function $T(e){return X(e,`Promise`)}function eE(e){return X(e,`Record`)}function tE(e){return X(e,`Ref`)}function nE(e){return X(e,`RegExp`)}function rE(e){return X(e,`String`)}function iE(e){return X(e,`Symbol`)}function aE(e){return X(e,`TemplateLiteral`)}function oE(e){return X(e,`This`)}function sE(e){return $w(e)&&TT in e}function cE(e){return X(e,`Tuple`)}function lE(e){return X(e,`Undefined`)}function uE(e){return X(e,`Union`)}function dE(e){return X(e,`Uint8Array`)}function fE(e){return X(e,`Unknown`)}function pE(e){return X(e,`Unsafe`)}function mE(e){return X(e,`Void`)}function hE(e){return $w(e)&&Y in e&&tT(e[Y])}function gE(e){return jT(e)||MT(e)||NT(e)||IT(e)||FT(e)||PT(e)||LT(e)||RT(e)||zT(e)||BT(e)||VT(e)||HT(e)||UT(e)||GT(e)||KT(e)||qT(e)||JT(e)||YT(e)||XT(e)||ZT(e)||QT(e)||$T(e)||eE(e)||tE(e)||nE(e)||rE(e)||iE(e)||aE(e)||oE(e)||cE(e)||lE(e)||uE(e)||dE(e)||fE(e)||pE(e)||mE(e)||hE(e)}var _E=`Argument.Any.Array.AsyncIterator.BigInt.Boolean.Computed.Constructor.Date.Enum.Function.Integer.Intersect.Iterator.Literal.MappedKey.MappedResult.Not.Null.Number.Object.Promise.Record.Ref.RegExp.String.Symbol.TemplateLiteral.This.Tuple.Undefined.Union.Uint8Array.Unknown.Void`.split(`.`);function vE(e){try{return new RegExp(e),!0}catch{return!1}}function yE(e){if(!tT(e))return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=7&&n<=13||n===27||n===127)return!1}return!0}function bE(e){return CE(e)||vD(e)}function xE(e){return iT(e)||Kw(e)}function SE(e){return iT(e)||Qw(e)}function CE(e){return iT(e)||qw(e)}function wE(e){return iT(e)||tT(e)}function TE(e){return iT(e)||tT(e)&&yE(e)&&vE(e)}function EE(e){return iT(e)||tT(e)&&yE(e)}function DE(e){return iT(e)||vD(e)}function OE(e){return $w(e)&&e[DT]===`Optional`}function kE(e){return Z(e,`Any`)&&wE(e.$id)}function AE(e){return Z(e,`Argument`)&&Qw(e.index)}function jE(e){return Z(e,`Array`)&&e.type===`array`&&wE(e.$id)&&vD(e.items)&&SE(e.minItems)&&SE(e.maxItems)&&CE(e.uniqueItems)&&DE(e.contains)&&SE(e.minContains)&&SE(e.maxContains)}function ME(e){return Z(e,`AsyncIterator`)&&e.type===`AsyncIterator`&&wE(e.$id)&&vD(e.items)}function NE(e){return Z(e,`BigInt`)&&e.type===`bigint`&&wE(e.$id)&&xE(e.exclusiveMaximum)&&xE(e.exclusiveMinimum)&&xE(e.maximum)&&xE(e.minimum)&&xE(e.multipleOf)}function PE(e){return Z(e,`Boolean`)&&e.type===`boolean`&&wE(e.$id)}function FE(e){return Z(e,`Computed`)&&tT(e.target)&&Gw(e.parameters)&&e.parameters.every(e=>vD(e))}function IE(e){return Z(e,`Constructor`)&&e.type===`Constructor`&&wE(e.$id)&&Gw(e.parameters)&&e.parameters.every(e=>vD(e))&&vD(e.returns)}function LE(e){return Z(e,`Date`)&&e.type===`Date`&&wE(e.$id)&&SE(e.exclusiveMaximumTimestamp)&&SE(e.exclusiveMinimumTimestamp)&&SE(e.maximumTimestamp)&&SE(e.minimumTimestamp)&&SE(e.multipleOfTimestamp)}function RE(e){return Z(e,`Function`)&&e.type===`Function`&&wE(e.$id)&&Gw(e.parameters)&&e.parameters.every(e=>vD(e))&&vD(e.returns)}function zE(e){return Z(e,`Integer`)&&e.type===`integer`&&wE(e.$id)&&SE(e.exclusiveMaximum)&&SE(e.exclusiveMinimum)&&SE(e.maximum)&&SE(e.minimum)&&SE(e.multipleOf)}function BE(e){return $w(e)&&Object.entries(e).every(([e,t])=>yE(e)&&vD(t))}function VE(e){return Z(e,`Intersect`)&&!(tT(e.type)&&e.type!==`object`)&&Gw(e.allOf)&&e.allOf.every(e=>vD(e)&&!lD(e))&&wE(e.type)&&(CE(e.unevaluatedProperties)||DE(e.unevaluatedProperties))&&wE(e.$id)}function HE(e){return Z(e,`Iterator`)&&e.type===`Iterator`&&wE(e.$id)&&vD(e.items)}function Z(e,t){return $w(e)&&Y in e&&e[Y]===t}function UE(e){return KE(e)&&tT(e.const)}function WE(e){return KE(e)&&Qw(e.const)}function GE(e){return KE(e)&&qw(e.const)}function KE(e){return Z(e,`Literal`)&&wE(e.$id)&&qE(e.const)}function qE(e){return qw(e)||Qw(e)||tT(e)}function JE(e){return Z(e,`MappedKey`)&&Gw(e.keys)&&e.keys.every(e=>Qw(e)||tT(e))}function YE(e){return Z(e,`MappedResult`)&&BE(e.properties)}function XE(e){return Z(e,`Never`)&&$w(e.not)&&Object.getOwnPropertyNames(e.not).length===0}function ZE(e){return Z(e,`Not`)&&vD(e.not)}function QE(e){return Z(e,`Null`)&&e.type===`null`&&wE(e.$id)}function $E(e){return Z(e,`Number`)&&e.type===`number`&&wE(e.$id)&&SE(e.exclusiveMaximum)&&SE(e.exclusiveMinimum)&&SE(e.maximum)&&SE(e.minimum)&&SE(e.multipleOf)}function eD(e){return Z(e,`Object`)&&e.type===`object`&&wE(e.$id)&&BE(e.properties)&&bE(e.additionalProperties)&&SE(e.minProperties)&&SE(e.maxProperties)}function tD(e){return Z(e,`Promise`)&&e.type===`Promise`&&wE(e.$id)&&vD(e.item)}function nD(e){return Z(e,`Record`)&&e.type===`object`&&wE(e.$id)&&bE(e.additionalProperties)&&$w(e.patternProperties)&&(e=>{let t=Object.getOwnPropertyNames(e.patternProperties);return t.length===1&&vE(t[0])&&$w(e.patternProperties)&&vD(e.patternProperties[t[0]])})(e)}function rD(e){return Z(e,`Ref`)&&wE(e.$id)&&tT(e.$ref)}function iD(e){return Z(e,`RegExp`)&&wE(e.$id)&&tT(e.source)&&tT(e.flags)&&SE(e.maxLength)&&SE(e.minLength)}function aD(e){return Z(e,`String`)&&e.type===`string`&&wE(e.$id)&&SE(e.minLength)&&SE(e.maxLength)&&TE(e.pattern)&&EE(e.format)}function oD(e){return Z(e,`Symbol`)&&e.type===`symbol`&&wE(e.$id)}function sD(e){return Z(e,`TemplateLiteral`)&&e.type===`string`&&tT(e.pattern)&&e.pattern[0]===`^`&&e.pattern[e.pattern.length-1]===`$`}function cD(e){return Z(e,`This`)&&wE(e.$id)&&tT(e.$ref)}function lD(e){return $w(e)&&TT in e}function uD(e){return Z(e,`Tuple`)&&e.type===`array`&&wE(e.$id)&&Qw(e.minItems)&&Qw(e.maxItems)&&e.minItems===e.maxItems&&(iT(e.items)&&iT(e.additionalItems)&&e.minItems===0||Gw(e.items)&&e.items.every(e=>vD(e)))}function dD(e){return Z(e,`Undefined`)&&e.type===`undefined`&&wE(e.$id)}function fD(e){return Z(e,`Union`)&&wE(e.$id)&&$w(e)&&Gw(e.anyOf)&&e.anyOf.every(e=>vD(e))}function pD(e){return Z(e,`Uint8Array`)&&e.type===`Uint8Array`&&wE(e.$id)&&SE(e.minByteLength)&&SE(e.maxByteLength)}function mD(e){return Z(e,`Unknown`)&&wE(e.$id)}function hD(e){return Z(e,`Unsafe`)}function gD(e){return Z(e,`Void`)&&e.type===`void`&&wE(e.$id)}function _D(e){return $w(e)&&Y in e&&tT(e[Y])&&!_E.includes(e[Y])}function vD(e){return $w(e)&&(kE(e)||AE(e)||jE(e)||PE(e)||NE(e)||ME(e)||FE(e)||IE(e)||LE(e)||RE(e)||zE(e)||VE(e)||HE(e)||KE(e)||JE(e)||YE(e)||XE(e)||ZE(e)||QE(e)||$E(e)||eD(e)||tD(e)||nD(e)||rD(e)||iD(e)||aD(e)||oD(e)||sD(e)||cD(e)||uD(e)||dD(e)||fD(e)||pD(e)||mD(e)||hD(e)||gD(e)||_D(e))}var yD=`(true|false)`,bD=`(0|[1-9][0-9]*)`,xD=`(.*)`,SD=`(?!.*)`;`${yD}`;var CD=`^${bD}$`,wD=`^${xD}$`,TD=`^${SD}$`;function ED(e,t){return e.includes(t)}function DD(e){return[...new Set(e)]}function OD(e,t){return e.filter(e=>t.includes(e))}function kD(e,t){return e.reduce((e,t)=>OD(e,t),t)}function AD(e){return e.length===1?e[0]:e.length>1?kD(e.slice(1),e[0]):[]}function jD(e){let t=[];for(let n of e)t.push(...n);return t}function MD(e){return J({[Y]:`Any`},e)}function ND(e,t){return J({[Y]:`Array`,type:`array`,items:e},t)}function PD(e){return J({[Y]:`Argument`,index:e})}function FD(e,t){return J({[Y]:`AsyncIterator`,type:`AsyncIterator`,items:e},t)}function ID(e,t,n){return J({[Y]:`Computed`,target:e,parameters:t},n)}function LD(e,t){let{[t]:n,...r}=e;return r}function RD(e,t){return t.reduce((e,t)=>LD(e,t),e)}function zD(e){return J({[Y]:`Never`,not:{}},e)}function BD(e){return J({[Y]:`MappedResult`,properties:e})}function VD(e,t,n){return J({[Y]:`Constructor`,type:`Constructor`,parameters:e,returns:t},n)}function HD(e,t,n){return J({[Y]:`Function`,type:`Function`,parameters:e,returns:t},n)}function UD(e,t){return J({[Y]:`Union`,anyOf:e},t)}function WD(e){return e.some(e=>AT(e))}function GD(e){return e.map(e=>AT(e)?KD(e):e)}function KD(e){return RD(e,[DT])}function qD(e,t){return WD(e)?Nk(UD(GD(e),t)):UD(GD(e),t)}function JD(e,t){return e.length===1?J(e[0],t):e.length===0?zD(t):qD(e,t)}function YD(e,t){return e.length===0?zD(t):e.length===1?J(e[0],t):UD(e,t)}var XD=class extends wT{};function ZD(e){return e.replace(/\\\$/g,`$`).replace(/\\\*/g,`*`).replace(/\\\^/g,`^`).replace(/\\\|/g,`|`).replace(/\\\(/g,`(`).replace(/\\\)/g,`)`)}function QD(e,t,n){return e[t]===n&&e.charCodeAt(t-1)!==92}function $D(e,t){return QD(e,t,`(`)}function eO(e,t){return QD(e,t,`)`)}function tO(e,t){return QD(e,t,`|`)}function nO(e){if(!($D(e,0)&&eO(e,e.length-1)))return!1;let t=0;for(let n=0;n<e.length;n++)if($D(e,n)&&(t+=1),eO(e,n)&&--t,t===0&&n!==e.length-1)return!1;return!0}function rO(e){return e.slice(1,e.length-1)}function iO(e){let t=0;for(let n=0;n<e.length;n++)if($D(e,n)&&(t+=1),eO(e,n)&&--t,tO(e,n)&&t===0)return!0;return!1}function aO(e){for(let t=0;t<e.length;t++)if($D(e,t))return!0;return!1}function oO(e){let[t,n]=[0,0],r=[];for(let i=0;i<e.length;i++)if($D(e,i)&&(t+=1),eO(e,i)&&--t,tO(e,i)&&t===0){let t=e.slice(n,i);t.length>0&&r.push(cO(t)),n=i+1}let i=e.slice(n);return i.length>0&&r.push(cO(i)),r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`or`,expr:r}}function sO(e){function t(e,t){if(!$D(e,t))throw new XD(`TemplateLiteralParser: Index must point to open parens`);let n=0;for(let r=t;r<e.length;r++)if($D(e,r)&&(n+=1),eO(e,r)&&--n,n===0)return[t,r];throw new XD(`TemplateLiteralParser: Unclosed group parens in expression`)}function n(e,t){for(let n=t;n<e.length;n++)if($D(e,n))return[t,n];return[t,e.length]}let r=[];for(let i=0;i<e.length;i++)if($D(e,i)){let[n,a]=t(e,i),o=e.slice(n,a+1);r.push(cO(o)),i=a}else{let[t,a]=n(e,i),o=e.slice(t,a);o.length>0&&r.push(cO(o)),i=a-1}return r.length===0?{type:`const`,const:``}:r.length===1?r[0]:{type:`and`,expr:r}}function cO(e){return nO(e)?cO(rO(e)):iO(e)?oO(e):aO(e)?sO(e):{type:`const`,const:ZD(e)}}function lO(e){return cO(e.slice(1,e.length-1))}var uO=class extends wT{};function dO(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`0`&&e.expr[1].type===`const`&&e.expr[1].const===`[1-9][0-9]*`}function fO(e){return e.type===`or`&&e.expr.length===2&&e.expr[0].type===`const`&&e.expr[0].const===`true`&&e.expr[1].type===`const`&&e.expr[1].const===`false`}function pO(e){return e.type===`const`&&e.const===`.*`}function mO(e){return dO(e)||pO(e)?!1:fO(e)?!0:e.type===`and`||e.type===`or`?e.expr.every(e=>mO(e)):e.type===`const`||(()=>{throw new uO(`Unknown expression type`)})()}function hO(e){return mO(lO(e.pattern))}var gO=class extends wT{};function*_O(e){if(e.length===1)return yield*e[0];for(let t of e[0])for(let n of _O(e.slice(1)))yield`${t}${n}`}function*vO(e){return yield*_O(e.expr.map(e=>[...xO(e)]))}function*yO(e){for(let t of e.expr)yield*xO(t)}function*bO(e){return yield e.const}function*xO(e){return e.type===`and`?yield*vO(e):e.type===`or`?yield*yO(e):e.type===`const`?yield*bO(e):(()=>{throw new gO(`Unknown expression`)})()}function SO(e){let t=lO(e.pattern);return mO(t)?[...xO(t)]:[]}function CO(e,t){return J({[Y]:`Literal`,const:e,type:typeof e},t)}function wO(e){return J({[Y]:`Boolean`,type:`boolean`},e)}function TO(e){return J({[Y]:`BigInt`,type:`bigint`},e)}function EO(e){return J({[Y]:`Number`,type:`number`},e)}function DO(e){return J({[Y]:`String`,type:`string`},e)}function*OO(e){let t=e.trim().replace(/"|'/g,``);return t===`boolean`?yield wO():t===`number`?yield EO():t===`bigint`?yield TO():t===`string`?yield DO():yield(()=>{let e=t.split(`|`).map(e=>CO(e.trim()));return e.length===0?zD():e.length===1?e[0]:JD(e)})()}function*kO(e){if(e[1]!==`{`)return yield*[CO(`$`),...AO(e.slice(1))];for(let t=2;t<e.length;t++)if(e[t]===`}`){let n=OO(e.slice(2,t)),r=AO(e.slice(t+1));return yield*[...n,...r]}yield CO(e)}function*AO(e){for(let t=0;t<e.length;t++)if(e[t]===`$`)return yield*[CO(e.slice(0,t)),...kO(e.slice(t))];yield CO(e)}function jO(e){return[...AO(e)]}var MO=class extends wT{};function NO(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function PO(e,t){return aE(e)?e.pattern.slice(1,e.pattern.length-1):uE(e)?`(${e.anyOf.map(e=>PO(e,t)).join(`|`)})`:ZT(e)||VT(e)||FT(e)?`${t}${bD}`:rE(e)?`${t}${xD}`:GT(e)?`${t}${NO(e.const.toString())}`:IT(e)?`${t}${yD}`:(()=>{throw new MO(`Unexpected Kind '${e[Y]}'`)})()}function FO(e){return`^${e.map(e=>PO(e,``)).join(``)}$`}function IO(e){return JD(SO(e).map(e=>CO(e)))}function LO(e,t){let n=tT(e)?FO(jO(e)):FO(e);return J({[Y]:`TemplateLiteral`,type:`string`,pattern:n},t)}function RO(e){return SO(e).map(e=>e.toString())}function zO(e){let t=[];for(let n of e)t.push(...VO(n));return t}function BO(e){return[e.toString()]}function VO(e){return[...new Set(aE(e)?RO(e):uE(e)?zO(e.anyOf):GT(e)?BO(e.const):ZT(e)||VT(e)?[`[number]`]:[])]}function HO(e,t,n){let r={};for(let i of Object.getOwnPropertyNames(t))r[i]=nk(e,VO(t[i]),n);return r}function UO(e,t,n){return HO(e,t.properties,n)}function WO(e,t,n){return BD(UO(e,t,n))}function GO(e,t){return e.map(e=>$O(e,t))}function KO(e){return e.filter(e=>!JT(e))}function qO(e,t){return Hk(KO(GO(e,t)))}function JO(e){return e.some(e=>JT(e))?[]:e}function YO(e,t){return JD(JO(GO(e,t)))}function XO(e,t){return t in e?e[t]:t===`[number]`?JD(e):zD()}function ZO(e,t){return t===`[number]`?e:zD()}function QO(e,t){return t in e?e[t]:zD()}function $O(e,t){return HT(e)?qO(e.allOf,t):uE(e)?YO(e.anyOf,t):cE(e)?XO(e.items??[],t):NT(e)?ZO(e.items,t):QT(e)?QO(e.properties,t):zD()}function ek(e,t){return t.map(t=>$O(e,t))}function tk(e,t){return JD(ek(e,t))}function nk(e,t,n){if(tE(e)||tE(t)){if(!gE(e)||!gE(t))throw new wT(`Index types using Ref parameters require both Type and Key to be of TSchema`);return ID(`Index`,[e,t])}return qT(t)?WO(e,t,n):KT(t)?ok(e,t,n):J(gE(t)?tk(e,VO(t)):tk(e,t),n)}function rk(e,t,n){return{[t]:nk(e,[t],dT(n))}}function ik(e,t,n){return t.reduce((t,r)=>({...t,...rk(e,r,n)}),{})}function ak(e,t,n){return ik(e,t.keys,n)}function ok(e,t,n){return BD(ak(e,t,n))}function sk(e,t){return J({[Y]:`Iterator`,type:`Iterator`,items:e},t)}function ck(e){return globalThis.Object.keys(e).filter(t=>!AT(e[t]))}function lk(e,t){let n=ck(e);return J(n.length>0?{[Y]:`Object`,type:`object`,required:n,properties:e}:{[Y]:`Object`,type:`object`,properties:e},t)}var uk=lk;function dk(e,t){return J({[Y]:`Promise`,type:`Promise`,item:e},t)}function fk(e){return J(RD(e,[ET]))}function pk(e){return J({...e,[ET]:`Readonly`})}function mk(e,t){return t===!1?fk(e):pk(e)}function hk(e,t){let n=t??!0;return qT(e)?vk(e,n):mk(e,n)}function gk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=hk(e[r],t);return n}function _k(e,t){return gk(e.properties,t)}function vk(e,t){return BD(_k(e,t))}function yk(e,t){return J(e.length>0?{[Y]:`Tuple`,type:`array`,items:e,additionalItems:!1,minItems:e.length,maxItems:e.length}:{[Y]:`Tuple`,type:`array`,minItems:e.length,maxItems:e.length},t)}function bk(e,t){return e in t?Dk(e,t[e]):BD(t)}function xk(e){return{[e]:CO(e)}}function Sk(e){let t={};for(let n of e)t[n]=CO(n);return t}function Ck(e,t){return ED(t,e)?xk(e):Sk(t)}function wk(e,t){return bk(e,Ck(e,t))}function Tk(e,t){return t.map(t=>Dk(e,t))}function Ek(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(t))n[r]=Dk(e,t[r]);return n}function Dk(e,t){let n={...t};return AT(t)?Nk(Dk(e,RD(t,[DT]))):kT(t)?hk(Dk(e,RD(t,[ET]))):qT(t)?bk(e,t.properties):KT(t)?wk(e,t.keys):RT(t)?VD(Tk(e,t.parameters),Dk(e,t.returns),n):BT(t)?HD(Tk(e,t.parameters),Dk(e,t.returns),n):PT(t)?FD(Dk(e,t.items),n):UT(t)?sk(Dk(e,t.items),n):HT(t)?Uk(Tk(e,t.allOf),n):uE(t)?YD(Tk(e,t.anyOf),n):cE(t)?yk(Tk(e,t.items??[]),n):QT(t)?uk(Ek(e,t.properties),n):NT(t)?ND(Dk(e,t.items),n):$T(t)?dk(Dk(e,t.item),n):t}function Ok(e,t){let n={};for(let r of e)n[r]=Dk(r,t);return n}function kk(e,t,n){let r=gE(e)?VO(e):e;return uk(Ok(r,t({[Y]:`MappedKey`,keys:r})),n)}function Ak(e){return J(RD(e,[DT]))}function jk(e){return J({...e,[DT]:`Optional`})}function Mk(e,t){return t===!1?Ak(e):jk(e)}function Nk(e,t){let n=t??!0;return qT(e)?Ik(e,n):Mk(e,n)}function Pk(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=Nk(e[r],t);return n}function Fk(e,t){return Pk(e.properties,t)}function Ik(e,t){return BD(Fk(e,t))}function Lk(e,t={}){let n=e.every(e=>QT(e)),r=gE(t.unevaluatedProperties)?{unevaluatedProperties:t.unevaluatedProperties}:{};return J(t.unevaluatedProperties===!1||gE(t.unevaluatedProperties)||n?{...r,[Y]:`Intersect`,type:`object`,allOf:e}:{...r,[Y]:`Intersect`,allOf:e},t)}function Rk(e){return e.every(e=>AT(e))}function zk(e){return RD(e,[DT])}function Bk(e){return e.map(e=>AT(e)?zk(e):e)}function Vk(e,t){return Rk(e)?Nk(Lk(Bk(e),t)):Lk(Bk(e),t)}function Hk(e,t={}){if(e.length===1)return J(e[0],t);if(e.length===0)return zD(t);if(e.some(e=>sE(e)))throw Error(`Cannot intersect transform types`);return Vk(e,t)}function Uk(e,t){if(e.length===1)return J(e[0],t);if(e.length===0)return zD(t);if(e.some(e=>sE(e)))throw Error(`Cannot intersect transform types`);return Lk(e,t)}function Wk(...e){let[t,n]=typeof e[0]==`string`?[e[0],e[1]]:[e[0].$id,e[1]];if(typeof t!=`string`)throw new wT(`Ref: $ref must be a string`);return J({[Y]:`Ref`,$ref:t},n)}function Gk(e,t){return ID(`Awaited`,[ID(e,t)])}function Kk(e){return ID(`Awaited`,[Wk(e)])}function qk(e){return Uk(Xk(e))}function Jk(e){return YD(Xk(e))}function Yk(e){return Zk(e)}function Xk(e){return e.map(e=>Zk(e))}function Zk(e,t){return J(LT(e)?Gk(e.target,e.parameters):HT(e)?qk(e.allOf):uE(e)?Jk(e.anyOf):$T(e)?Yk(e.item):tE(e)?Kk(e.$ref):e,t)}function Qk(e){let t=[];for(let n of e)t.push(aA(n));return t}function $k(e){return jD(Qk(e))}function eA(e){return AD(Qk(e))}function tA(e){return e.map((e,t)=>t.toString())}function nA(e){return[`[number]`]}function rA(e){return globalThis.Object.getOwnPropertyNames(e)}function iA(e){return oA?globalThis.Object.getOwnPropertyNames(e).map(e=>e[0]===`^`&&e[e.length-1]===`$`?e.slice(1,e.length-1):e):[]}function aA(e){return HT(e)?$k(e.allOf):uE(e)?eA(e.anyOf):cE(e)?tA(e.items??[]):NT(e)?nA(e.items):QT(e)?rA(e.properties):eE(e)?iA(e.patternProperties):[]}var oA=!1;function sA(e,t){return ID(`KeyOf`,[ID(e,t)])}function cA(e){return ID(`KeyOf`,[Wk(e)])}function lA(e,t){return J(JD(uA(aA(e))),t)}function uA(e){return e.map(e=>e===`[number]`?EO():CO(e))}function dA(e,t){return LT(e)?sA(e.target,e.parameters):tE(e)?cA(e.$ref):qT(e)?mA(e,t):lA(e,t)}function fA(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=dA(e[r],dT(t));return n}function pA(e,t){return fA(e.properties,t)}function mA(e,t){return BD(pA(e,t))}function hA(e){let t=[];for(let n of e)t.push(...aA(n));return DD(t)}function gA(e){return e.filter(e=>!JT(e))}function _A(e,t){let n=[];for(let r of e)n.push(...ek(r,[t]));return gA(n)}function vA(e,t){let n={};for(let r of t)n[r]=Hk(_A(e,r));return n}function yA(e,t){return uk(vA(e,hA(e)),t)}function bA(e){return J({[Y]:`Date`,type:`Date`},e)}function xA(e){return J({[Y]:`Null`,type:`null`},e)}function SA(e){return J({[Y]:`Symbol`,type:`symbol`},e)}function CA(e){return J({[Y]:`Undefined`,type:`undefined`},e)}function wA(e){return J({[Y]:`Uint8Array`,type:`Uint8Array`},e)}function TA(e){return J({[Y]:`Unknown`},e)}function EA(e){return e.map(e=>kA(e,!1))}function DA(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=hk(kA(e[n],!1));return t}function OA(e,t){return t===!0?e:hk(e)}function kA(e,t){return Ww(e)||Xw(e)?OA(MD(),t):Gw(e)?hk(yk(EA(e))):rT(e)?wA():Jw(e)?bA():$w(e)?OA(uk(DA(e)),t):Yw(e)?OA(HD([],TA()),t):iT(e)?CA():Zw(e)?xA():nT(e)?SA():Kw(e)?TO():Qw(e)||qw(e)||tT(e)?CO(e):uk({})}function AA(e,t){return J(kA(e,!0),t)}function jA(e,t){return RT(e)?yk(e.parameters,t):zD(t)}function MA(e,t){if(iT(e))throw Error(`Enum undefined or empty`);let n=globalThis.Object.getOwnPropertyNames(e).filter(e=>isNaN(e)).map(t=>e[t]);return YD([...new Set(n)].map(e=>CO(e)),{...t,[OT]:`Enum`})}var NA=class extends wT{},Q;(function(e){e[e.Union=0]=`Union`,e[e.True=1]=`True`,e[e.False=2]=`False`})(Q||={});function PA(e){return e===Q.False?e:Q.True}function FA(e){throw new NA(e)}function IA(e){return XE(e)||VE(e)||fD(e)||mD(e)||kE(e)}function LA(e,t){return XE(t)?tj(e,t):VE(t)?ZA(e,t):fD(t)?Rj(e,t):mD(t)?Bj(e,t):kE(t)?RA(e,t):FA(`StructuralRight`)}function RA(e,t){return Q.True}function zA(e,t){return VE(t)?ZA(e,t):fD(t)&&t.anyOf.some(e=>kE(e)||mD(e))?Q.True:fD(t)?Q.Union:mD(t)||kE(t)?Q.True:Q.Union}function BA(e,t){return mD(e)?Q.False:kE(e)?Q.Union:XE(e)?Q.True:Q.False}function VA(e,t){return eD(t)&&vj(t)?Q.True:IA(t)?LA(e,t):jE(t)?PA(Wj(e.items,t.items)):Q.False}function HA(e,t){return IA(t)?LA(e,t):ME(t)?PA(Wj(e.items,t.items)):Q.False}function UA(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):NE(t)?Q.True:Q.False}function WA(e,t){return GE(e)||PE(e)?Q.True:Q.False}function GA(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):PE(t)?Q.True:Q.False}function KA(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):IE(t)?e.parameters.length>t.parameters.length?Q.False:e.parameters.every((e,n)=>PA(Wj(t.parameters[n],e))===Q.True)?PA(Wj(e.returns,t.returns)):Q.False:Q.False}function qA(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):LE(t)?Q.True:Q.False}function JA(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):RE(t)?e.parameters.length>t.parameters.length?Q.False:e.parameters.every((e,n)=>PA(Wj(t.parameters[n],e))===Q.True)?PA(Wj(e.returns,t.returns)):Q.False:Q.False}function YA(e,t){return KE(e)&&Qw(e.const)||$E(e)||zE(e)?Q.True:Q.False}function XA(e,t){return zE(t)||$E(t)?Q.True:IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):Q.False}function ZA(e,t){return t.allOf.every(t=>Wj(e,t)===Q.True)?Q.True:Q.False}function QA(e,t){return e.allOf.some(e=>Wj(e,t)===Q.True)?Q.True:Q.False}function $A(e,t){return IA(t)?LA(e,t):HE(t)?PA(Wj(e.items,t.items)):Q.False}function ej(e,t){return KE(t)&&t.const===e.const?Q.True:IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):aD(t)?kj(e,t):$E(t)?oj(e,t):zE(t)?YA(e,t):PE(t)?WA(e,t):Q.False}function tj(e,t){return Q.False}function nj(e,t){return Q.True}function rj(e){let[t,n]=[e,0];for(;ZE(t);)t=t.not,n+=1;return n%2==0?t:TA()}function ij(e,t){return ZE(e)?Wj(rj(e),t):ZE(t)?Wj(e,rj(t)):FA(`Invalid fallthrough for Not`)}function aj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):QE(t)?Q.True:Q.False}function oj(e,t){return WE(e)||$E(e)||zE(e)?Q.True:Q.False}function sj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):zE(t)||$E(t)?Q.True:Q.False}function cj(e,t){return Object.getOwnPropertyNames(e.properties).length===t}function lj(e){return vj(e)}function uj(e){return cj(e,0)||cj(e,1)&&`description`in e.properties&&fD(e.properties.description)&&e.properties.description.anyOf.length===2&&(aD(e.properties.description.anyOf[0])&&dD(e.properties.description.anyOf[1])||aD(e.properties.description.anyOf[1])&&dD(e.properties.description.anyOf[0]))}function dj(e){return cj(e,0)}function fj(e){return cj(e,0)}function pj(e){return cj(e,0)}function mj(e){return cj(e,0)}function hj(e){return vj(e)}function gj(e){let t=EO();return cj(e,0)||cj(e,1)&&`length`in e.properties&&PA(Wj(e.properties.length,t))===Q.True}function _j(e){return cj(e,0)}function vj(e){let t=EO();return cj(e,0)||cj(e,1)&&`length`in e.properties&&PA(Wj(e.properties.length,t))===Q.True}function yj(e){let t=HD([MD()],MD());return cj(e,0)||cj(e,1)&&`then`in e.properties&&PA(Wj(e.properties.then,t))===Q.True}function bj(e,t){return Wj(e,t)===Q.False||OE(e)&&!OE(t)?Q.False:Q.True}function xj(e,t){return mD(e)?Q.False:kE(e)?Q.Union:XE(e)||UE(e)&&lj(t)||WE(e)&&dj(t)||GE(e)&&fj(t)||oD(e)&&uj(t)||NE(e)&&pj(t)||aD(e)&&lj(t)||oD(e)&&uj(t)||$E(e)&&dj(t)||zE(e)&&dj(t)||PE(e)&&fj(t)||pD(e)&&hj(t)||LE(e)&&mj(t)||IE(e)&&_j(t)||RE(e)&&gj(t)?Q.True:nD(e)&&aD(wj(e))?t[OT]===`Record`?Q.True:Q.False:nD(e)&&$E(wj(e))&&cj(t,0)?Q.True:Q.False}function Sj(e,t){return IA(t)?LA(e,t):nD(t)?Ej(e,t):eD(t)?(()=>{for(let n of Object.getOwnPropertyNames(t.properties)){if(!(n in e.properties)&&!OE(t.properties[n]))return Q.False;if(OE(t.properties[n]))return Q.True;if(bj(e.properties[n],t.properties[n])===Q.False)return Q.False}return Q.True})():Q.False}function Cj(e,t){return IA(t)?LA(e,t):eD(t)&&yj(t)?Q.True:tD(t)?PA(Wj(e.item,t.item)):Q.False}function wj(e){return CD in e.patternProperties?EO():wD in e.patternProperties?DO():FA(`Unknown record key pattern`)}function Tj(e){return CD in e.patternProperties?e.patternProperties[CD]:wD in e.patternProperties?e.patternProperties[wD]:FA(`Unable to get record value schema`)}function Ej(e,t){let[n,r]=[wj(t),Tj(t)];return UE(e)&&$E(n)&&PA(Wj(e,r))===Q.True?Q.True:pD(e)&&$E(n)||aD(e)&&$E(n)||jE(e)&&$E(n)?Wj(e,r):eD(e)?(()=>{for(let t of Object.getOwnPropertyNames(e.properties))if(bj(r,e.properties[t])===Q.False)return Q.False;return Q.True})():Q.False}function Dj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Wj(Tj(e),Tj(t)):Q.False}function Oj(e,t){return Wj(iD(e)?DO():e,iD(t)?DO():t)}function kj(e,t){return KE(e)&&tT(e.const)||aD(e)?Q.True:Q.False}function Aj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):aD(t)?Q.True:Q.False}function jj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):oD(t)?Q.True:Q.False}function Mj(e,t){return sD(e)?Wj(IO(e),t):sD(t)?Wj(e,IO(t)):FA(`Invalid fallthrough for TemplateLiteral`)}function Nj(e,t){return jE(t)&&e.items!==void 0&&e.items.every(e=>Wj(e,t.items)===Q.True)}function Pj(e,t){return XE(e)?Q.True:mD(e)?Q.False:kE(e)?Q.Union:Q.False}function Fj(e,t){return IA(t)?LA(e,t):eD(t)&&vj(t)||jE(t)&&Nj(e,t)?Q.True:uD(t)?iT(e.items)&&!iT(t.items)||!iT(e.items)&&iT(t.items)?Q.False:iT(e.items)&&!iT(t.items)||e.items.every((e,n)=>Wj(e,t.items[n])===Q.True)?Q.True:Q.False:Q.False}function Ij(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):pD(t)?Q.True:Q.False}function Lj(e,t){return IA(t)?LA(e,t):eD(t)?xj(e,t):nD(t)?Ej(e,t):gD(t)?Hj(e,t):dD(t)?Q.True:Q.False}function Rj(e,t){return t.anyOf.some(t=>Wj(e,t)===Q.True)?Q.True:Q.False}function zj(e,t){return e.anyOf.every(e=>Wj(e,t)===Q.True)?Q.True:Q.False}function Bj(e,t){return Q.True}function Vj(e,t){return XE(t)?tj(e,t):VE(t)?ZA(e,t):fD(t)?Rj(e,t):kE(t)?RA(e,t):aD(t)?kj(e,t):$E(t)?oj(e,t):zE(t)?YA(e,t):PE(t)?WA(e,t):jE(t)?BA(e,t):uD(t)?Pj(e,t):eD(t)?xj(e,t):mD(t)?Q.True:Q.False}function Hj(e,t){return dD(e)||dD(e)?Q.True:Q.False}function Uj(e,t){return VE(t)?ZA(e,t):fD(t)?Rj(e,t):mD(t)?Bj(e,t):kE(t)?RA(e,t):eD(t)?xj(e,t):gD(t)?Q.True:Q.False}function Wj(e,t){return sD(e)||sD(t)?Mj(e,t):iD(e)||iD(t)?Oj(e,t):ZE(e)||ZE(t)?ij(e,t):kE(e)?zA(e,t):jE(e)?VA(e,t):NE(e)?UA(e,t):PE(e)?GA(e,t):ME(e)?HA(e,t):IE(e)?KA(e,t):LE(e)?qA(e,t):RE(e)?JA(e,t):zE(e)?XA(e,t):VE(e)?QA(e,t):HE(e)?$A(e,t):KE(e)?ej(e,t):XE(e)?nj(e,t):QE(e)?aj(e,t):$E(e)?sj(e,t):eD(e)?Sj(e,t):nD(e)?Dj(e,t):aD(e)?Aj(e,t):oD(e)?jj(e,t):uD(e)?Fj(e,t):tD(e)?Cj(e,t):pD(e)?Ij(e,t):dD(e)?Lj(e,t):fD(e)?zj(e,t):mD(e)?Vj(e,t):gD(e)?Uj(e,t):FA(`Unknown left type operand '${e[Y]}'`)}function Gj(e,t){return Wj(e,t)}function Kj(e,t,n,r,i){let a={};for(let o of globalThis.Object.getOwnPropertyNames(e))a[o]=Xj(e[o],t,n,r,dT(i));return a}function qj(e,t,n,r,i){return Kj(e.properties,t,n,r,i)}function Jj(e,t,n,r,i){return BD(qj(e,t,n,r,i))}function Yj(e,t,n,r){let i=Gj(e,t);return i===Q.Union?YD([n,r]):i===Q.True?n:r}function Xj(e,t,n,r,i){return qT(e)?Jj(e,t,n,r,i):KT(e)?J(eM(e,t,n,r,i)):J(Yj(e,t,n,r),i)}function Zj(e,t,n,r,i){return{[e]:Xj(CO(e),t,n,r,dT(i))}}function Qj(e,t,n,r,i){return e.reduce((e,a)=>({...e,...Zj(a,t,n,r,i)}),{})}function $j(e,t,n,r,i){return Qj(e.keys,t,n,r,i)}function eM(e,t,n,r,i){return BD($j(e,t,n,r,i))}function tM(e,t){return rM(IO(e),t)}function nM(e,t){let n=e.filter(e=>Gj(e,t)===Q.False);return n.length===1?n[0]:YD(n)}function rM(e,t,n={}){return aE(e)?J(tM(e,t),n):qT(e)?J(oM(e,t),n):J(uE(e)?nM(e.anyOf,t):Gj(e,t)===Q.False?e:zD(),n)}function iM(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=rM(e[r],t);return n}function aM(e,t){return iM(e.properties,t)}function oM(e,t){return BD(aM(e,t))}function sM(e,t){return lM(IO(e),t)}function cM(e,t){let n=e.filter(e=>Gj(e,t)!==Q.False);return n.length===1?n[0]:YD(n)}function lM(e,t,n){return aE(e)?J(sM(e,t),n):qT(e)?J(fM(e,t),n):J(uE(e)?cM(e.anyOf,t):Gj(e,t)===Q.False?zD():e,n)}function uM(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=lM(e[r],t);return n}function dM(e,t){return uM(e.properties,t)}function fM(e,t){return BD(dM(e,t))}function pM(e,t){return RT(e)?J(e.returns,t):zD(t)}function mM(e){return hk(Nk(e))}function hM(e,t,n){return J({[Y]:`Record`,type:`object`,patternProperties:{[e]:t}},n)}function gM(e,t,n){let r={};for(let n of e)r[n]=t;return uk(r,{...n,[OT]:`Record`})}function _M(e,t,n){return hO(e)?gM(VO(e),t,n):hM(e.pattern,t,n)}function vM(e,t,n){return gM(VO(YD(e)),t,n)}function yM(e,t,n){return gM([e.toString()],t,n)}function bM(e,t,n){return hM(e.source,t,n)}function xM(e,t,n){return hM(iT(e.pattern)?wD:e.pattern,t,n)}function SM(e,t,n){return hM(wD,t,n)}function CM(e,t,n){return hM(TD,t,n)}function wM(e,t,n){return uk({true:t,false:t},n)}function TM(e,t,n){return hM(CD,t,n)}function EM(e,t,n){return hM(CD,t,n)}function DM(e,t,n={}){return uE(e)?vM(e.anyOf,t,n):aE(e)?_M(e,t,n):GT(e)?yM(e.const,t,n):IT(e)?wM(e,t,n):VT(e)?TM(e,t,n):ZT(e)?EM(e,t,n):nE(e)?bM(e,t,n):rE(e)?xM(e,t,n):jT(e)?SM(e,t,n):JT(e)?CM(e,t,n):zD(n)}function OM(e){return globalThis.Object.getOwnPropertyNames(e.patternProperties)[0]}function kM(e){let t=OM(e);return t===wD?DO():t===CD?EO():DO({pattern:t})}function AM(e){return e.patternProperties[OM(e)]}function jM(e,t){return t.parameters=GM(e,t.parameters),t.returns=KM(e,t.returns),t}function MM(e,t){return t.parameters=GM(e,t.parameters),t.returns=KM(e,t.returns),t}function NM(e,t){return t.allOf=GM(e,t.allOf),t}function PM(e,t){return t.anyOf=GM(e,t.anyOf),t}function FM(e,t){return iT(t.items)||(t.items=GM(e,t.items)),t}function IM(e,t){return t.items=KM(e,t.items),t}function LM(e,t){return t.items=KM(e,t.items),t}function RM(e,t){return t.items=KM(e,t.items),t}function zM(e,t){return t.item=KM(e,t.item),t}function BM(e,t){let n=WM(e,t.properties);return{...t,...uk(n)}}function VM(e,t){let n=DM(KM(e,kM(t)),KM(e,AM(t)));return{...t,...n}}function HM(e,t){return t.index in e?e[t.index]:TA()}function UM(e,t){let n=kT(t),r=AT(t),i=KM(e,t);return n&&r?mM(i):n&&!r?hk(i):!n&&r?Nk(i):i}function WM(e,t){return globalThis.Object.getOwnPropertyNames(t).reduce((n,r)=>({...n,[r]:UM(e,t[r])}),{})}function GM(e,t){return t.map(t=>KM(e,t))}function KM(e,t){return RT(t)?jM(e,t):BT(t)?MM(e,t):HT(t)?NM(e,t):uE(t)?PM(e,t):cE(t)?FM(e,t):NT(t)?IM(e,t):PT(t)?LM(e,t):UT(t)?RM(e,t):$T(t)?zM(e,t):QT(t)?BM(e,t):eE(t)?VM(e,t):MT(t)?HM(e,t):t}function qM(e,t){return KM(t,fT(e))}function JM(e){return J({[Y]:`Integer`,type:`integer`},e)}function YM(e,t,n){return{[e]:oN(CO(e),t,dT(n))}}function XM(e,t,n){return e.reduce((e,r)=>({...e,...YM(r,t,n)}),{})}function ZM(e,t,n){return XM(e.keys,t,n)}function QM(e,t,n){return BD(ZM(e,t,n))}function $M(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toLowerCase(),n].join(``)}function eN(e){let[t,n]=[e.slice(0,1),e.slice(1)];return[t.toUpperCase(),n].join(``)}function tN(e){return e.toUpperCase()}function nN(e){return e.toLowerCase()}function rN(e,t,n){let r=lO(e.pattern);return mO(r)?LO([YD(aN([...xO(r)].map(e=>CO(e)),t))],n):{...e,pattern:iN(e.pattern,t)}}function iN(e,t){return typeof e==`string`?t===`Uncapitalize`?$M(e):t===`Capitalize`?eN(e):t===`Uppercase`?tN(e):t===`Lowercase`?nN(e):e:e.toString()}function aN(e,t){return e.map(e=>oN(e,t))}function oN(e,t,n={}){return KT(e)?QM(e,t,n):aE(e)?rN(e,t,n):uE(e)?YD(aN(e.anyOf,t),n):GT(e)?CO(iN(e.const,t),n):J(e,n)}function sN(e,t={}){return oN(e,`Capitalize`,t)}function cN(e,t={}){return oN(e,`Lowercase`,t)}function lN(e,t={}){return oN(e,`Uncapitalize`,t)}function uN(e,t={}){return oN(e,`Uppercase`,t)}function dN(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=xN(e[i],t,dT(n));return r}function fN(e,t,n){return dN(e.properties,t,n)}function pN(e,t,n){return BD(fN(e,t,n))}function mN(e,t){return e.map(e=>bN(e,t))}function hN(e,t){return e.map(e=>bN(e,t))}function gN(e,t){let{[t]:n,...r}=e;return r}function _N(e,t){return t.reduce((e,t)=>gN(e,t),e)}function vN(e,t,n){let r=RD(e,[TT,`$id`,`required`,`properties`]);return uk(_N(n,t),r)}function yN(e){return YD(e.reduce((e,t)=>WT(t)?[...e,CO(t)]:e,[]))}function bN(e,t){return HT(e)?Uk(mN(e.allOf,t)):uE(e)?YD(hN(e.anyOf,t)):QT(e)?vN(e,t,e.properties):uk({})}function xN(e,t,n){let r=Gw(t)?yN(t):t,i=gE(t)?VO(t):t,a=tE(e),o=tE(t);return qT(e)?pN(e,i,n):KT(t)?TN(e,t,n):a&&o||!a&&o||a&&!o?ID(`Omit`,[e,r],n):J({...bN(e,i),...n})}function SN(e,t,n){return{[t]:xN(e,[t],dT(n))}}function CN(e,t,n){return t.reduce((t,r)=>({...t,...SN(e,r,n)}),{})}function wN(e,t,n){return CN(e,t.keys,n)}function TN(e,t,n){return BD(wN(e,t,n))}function EN(e,t,n){let r={};for(let i of globalThis.Object.getOwnPropertyNames(e))r[i]=FN(e[i],t,dT(n));return r}function DN(e,t,n){return EN(e.properties,t,n)}function ON(e,t,n){return BD(DN(e,t,n))}function kN(e,t){return e.map(e=>PN(e,t))}function AN(e,t){return e.map(e=>PN(e,t))}function jN(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function MN(e,t,n){let r=RD(e,[TT,`$id`,`required`,`properties`]);return uk(jN(n,t),r)}function NN(e){return YD(e.reduce((e,t)=>WT(t)?[...e,CO(t)]:e,[]))}function PN(e,t){return HT(e)?Uk(kN(e.allOf,t)):uE(e)?YD(AN(e.anyOf,t)):QT(e)?MN(e,t,e.properties):uk({})}function FN(e,t,n){let r=Gw(t)?NN(t):t,i=gE(t)?VO(t):t,a=tE(e),o=tE(t);return qT(e)?ON(e,i,n):KT(t)?zN(e,t,n):a&&o||!a&&o||a&&!o?ID(`Pick`,[e,r],n):J({...PN(e,i),...n})}function IN(e,t,n){return{[t]:FN(e,[t],dT(n))}}function LN(e,t,n){return t.reduce((t,r)=>({...t,...IN(e,r,n)}),{})}function RN(e,t,n){return LN(e,t.keys,n)}function zN(e,t,n){return BD(RN(e,t,n))}function BN(e,t){return ID(`Partial`,[ID(e,t)])}function VN(e){return ID(`Partial`,[Wk(e)])}function HN(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=Nk(e[n]);return t}function UN(e,t){let n=RD(e,[TT,`$id`,`required`,`properties`]);return uk(HN(t),n)}function WN(e){return e.map(e=>GN(e))}function GN(e){return LT(e)?BN(e.target,e.parameters):tE(e)?VN(e.$ref):HT(e)?Uk(WN(e.allOf)):uE(e)?YD(WN(e.anyOf)):QT(e)?UN(e,e.properties):FT(e)||IT(e)||VT(e)||GT(e)||XT(e)||ZT(e)||rE(e)||iE(e)||lE(e)?e:uk({})}function KN(e,t){return qT(e)?YN(e,t):J({...GN(e),...t})}function qN(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=KN(e[r],dT(t));return n}function JN(e,t){return qN(e.properties,t)}function YN(e,t){return BD(JN(e,t))}function XN(e,t){return ID(`Required`,[ID(e,t)])}function ZN(e){return ID(`Required`,[Wk(e)])}function QN(e){let t={};for(let n of globalThis.Object.getOwnPropertyNames(e))t[n]=RD(e[n],[DT]);return t}function $N(e,t){let n=RD(e,[TT,`$id`,`required`,`properties`]);return uk(QN(t),n)}function eP(e){return e.map(e=>tP(e))}function tP(e){return LT(e)?XN(e.target,e.parameters):tE(e)?ZN(e.$ref):HT(e)?Uk(eP(e.allOf)):uE(e)?YD(eP(e.anyOf)):QT(e)?$N(e,e.properties):FT(e)||IT(e)||VT(e)||GT(e)||XT(e)||ZT(e)||rE(e)||iE(e)||lE(e)?e:uk({})}function nP(e,t){return qT(e)?aP(e,t):J({...tP(e),...t})}function rP(e,t){let n={};for(let r of globalThis.Object.getOwnPropertyNames(e))n[r]=nP(e[r],t);return n}function iP(e,t){return rP(e.properties,t)}function aP(e,t){return BD(iP(e,t))}function oP(e,t){return t.map(t=>tE(t)?sP(e,t.$ref):OP(e,t))}function sP(e,t){return t in e?tE(e[t])?sP(e,e[t].$ref):OP(e,e[t]):zD()}function cP(e){return Zk(e[0])}function lP(e){return nk(e[0],e[1])}function uP(e){return dA(e[0])}function dP(e){return KN(e[0])}function fP(e){return xN(e[0],e[1])}function pP(e){return FN(e[0],e[1])}function mP(e){return nP(e[0])}function hP(e,t,n){let r=oP(e,n);return t===`Awaited`?cP(r):t===`Index`?lP(r):t===`KeyOf`?uP(r):t===`Partial`?dP(r):t===`Omit`?fP(r):t===`Pick`?pP(r):t===`Required`?mP(r):zD()}function gP(e,t){return ND(OP(e,t))}function _P(e,t){return FD(OP(e,t))}function vP(e,t,n){return VD(DP(e,t),OP(e,n))}function yP(e,t,n){return HD(DP(e,t),OP(e,n))}function bP(e,t){return Uk(DP(e,t))}function xP(e,t){return sk(OP(e,t))}function SP(e,t){return uk(globalThis.Object.keys(t).reduce((n,r)=>({...n,[r]:OP(e,t[r])}),{}))}function CP(e,t){let[n,r]=[OP(e,AM(t)),OM(t)],i=fT(t);return i.patternProperties[r]=n,i}function wP(e,t){return tE(t)?{...sP(e,t.$ref),[TT]:t[TT]}:t}function TP(e,t){return yk(DP(e,t))}function EP(e,t){return YD(DP(e,t))}function DP(e,t){return t.map(t=>OP(e,t))}function OP(e,t){return AT(t)?J(OP(e,RD(t,[DT])),t):kT(t)?J(OP(e,RD(t,[ET])),t):sE(t)?J(wP(e,t),t):NT(t)?J(gP(e,t.items),t):PT(t)?J(_P(e,t.items),t):LT(t)?J(hP(e,t.target,t.parameters)):RT(t)?J(vP(e,t.parameters,t.returns),t):BT(t)?J(yP(e,t.parameters,t.returns),t):HT(t)?J(bP(e,t.allOf),t):UT(t)?J(xP(e,t.items),t):QT(t)?J(SP(e,t.properties),t):eE(t)?J(CP(e,t)):cE(t)?J(TP(e,t.items||[]),t):uE(t)?J(EP(e,t.anyOf),t):t}function kP(e,t){return t in e?OP(e,e[t]):zD()}function AP(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:kP(e,n)}),{})}var jP=class{constructor(e){let t=AP(e),n=this.WithIdentifiers(t);this.$defs=n}Import(e,t){let n={...this.$defs,[e]:J(this.$defs[e],t)};return J({[Y]:`Import`,$defs:n,$ref:e})}WithIdentifiers(e){return globalThis.Object.getOwnPropertyNames(e).reduce((t,n)=>({...t,[n]:{...e[n],$id:n}}),{})}};function MP(e){return new jP(e)}function NP(e,t){return J({[Y]:`Not`,not:e},t)}function PP(e,t){return BT(e)?yk(e.parameters,t):zD()}var FP=0;function IP(e,t={}){iT(t.$id)&&(t.$id=`T${FP++}`);let n=fT(e({[Y]:`This`,$ref:`${t.$id}`}));return n.$id=t.$id,J({[OT]:`Recursive`,...n},t)}function LP(e,t){let n=tT(e)?new globalThis.RegExp(e):e;return J({[Y]:`RegExp`,type:`RegExp`,source:n.source,flags:n.flags},t)}function RP(e){return HT(e)?e.allOf:uE(e)?e.anyOf:cE(e)?e.items??[]:[]}function zP(e){return RP(e)}function BP(e,t){return BT(e)?J(e.returns,t):zD(t)}var VP=class{constructor(e){this.schema=e}Decode(e){return new HP(this.schema,e)}},HP=class{constructor(e,t){this.schema=e,this.decode=t}EncodeTransform(e,t){let n={Encode:n=>t[TT].Encode(e(n)),Decode:e=>this.decode(t[TT].Decode(e))};return{...t,[TT]:n}}EncodeSchema(e,t){let n={Decode:this.decode,Encode:e};return{...t,[TT]:n}}Encode(e){return sE(this.schema)?this.EncodeTransform(e,this.schema):this.EncodeSchema(e,this.schema)}};function UP(e){return new VP(e)}function WP(e={}){return J({[Y]:e[Y]??`Unsafe`},e)}function GP(e){return J({[Y]:`Void`,type:`void`},e)}var $=t({Any:()=>MD,Argument:()=>PD,Array:()=>ND,AsyncIterator:()=>FD,Awaited:()=>Zk,BigInt:()=>TO,Boolean:()=>wO,Capitalize:()=>sN,Composite:()=>yA,Const:()=>AA,Constructor:()=>VD,ConstructorParameters:()=>jA,Date:()=>bA,Enum:()=>MA,Exclude:()=>rM,Extends:()=>Xj,Extract:()=>lM,Function:()=>HD,Index:()=>nk,InstanceType:()=>pM,Instantiate:()=>qM,Integer:()=>JM,Intersect:()=>Uk,Iterator:()=>sk,KeyOf:()=>dA,Literal:()=>CO,Lowercase:()=>cN,Mapped:()=>kk,Module:()=>MP,Never:()=>zD,Not:()=>NP,Null:()=>xA,Number:()=>EO,Object:()=>uk,Omit:()=>xN,Optional:()=>Nk,Parameters:()=>PP,Partial:()=>KN,Pick:()=>FN,Promise:()=>dk,Readonly:()=>hk,ReadonlyOptional:()=>mM,Record:()=>DM,Recursive:()=>IP,Ref:()=>Wk,RegExp:()=>LP,Required:()=>nP,Rest:()=>zP,ReturnType:()=>BP,String:()=>DO,Symbol:()=>SA,TemplateLiteral:()=>LO,Transform:()=>UP,Tuple:()=>yk,Uint8Array:()=>wA,Uncapitalize:()=>lN,Undefined:()=>CA,Union:()=>YD,Unknown:()=>TA,Unsafe:()=>WP,Uppercase:()=>uN,Void:()=>GP}),KP={additionalProperties:!1},qP=$.String({pattern:`^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$`,minLength:36,maxLength:36}),JP=$.String({pattern:`^[a-z0-9][a-z0-9-]{0,31}(?![\\s\\S])`,minLength:1,maxLength:32}),YP=$.String({pattern:`^sha256:[0-9a-f]{64}$`,minLength:71,maxLength:71}),XP=$.String({pattern:`^[A-Za-z0-9_-]{43}$`,minLength:43,maxLength:43}),ZP=$.String({pattern:`^dpt_[A-Za-z0-9_-]{43}$`,minLength:47,maxLength:47}),QP=`[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}`,$P=`^(?:${QP}|[A-Z2-7]{12}|[A-Z2-7]{8})(?![\\s\\S])`,eF=$.String({pattern:$P,minLength:8,maxLength:36}),tF=new RegExp($P),nF=/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;function rF(e){return typeof e!=`string`||e.length>36?!1:tF.test(e)}function iF(e){if(typeof e!=`string`)return;if(nF.test(e)){let t=e.toLowerCase();return rF(t)?t:void 0}let t=e.replace(/[\s-]+/g,``).toUpperCase();if(rF(t)&&!(/[\s-]/.test(e)&&t.length!==12))return t}$.Object({type:$.Literal(`pair.request`),v:$.Literal(1),requestId:qP,code:eF,deviceUid:qP,deviceName:$.String({minLength:1,maxLength:64}),hostname:$.Optional($.String({minLength:1,maxLength:128})),platform:$.Optional($.String({minLength:1,maxLength:64})),publicKey:$.String({minLength:1,maxLength:256}),keyFingerprint:YP,clientTime:$.Integer(),hubNonce:$.Optional(XP)},KP),$.Object({type:$.Literal(`pair.device-request`),v:$.Literal(1),requestId:qP,deviceUid:qP,deviceName:$.String({minLength:1,maxLength:64}),hostname:$.Optional($.String({minLength:1,maxLength:128})),platform:$.Optional($.String({minLength:1,maxLength:64})),publicKey:$.String({minLength:1,maxLength:256}),keyFingerprint:YP,clientTime:$.Integer(),hubNonce:$.Optional(XP)},KP);var aF=$.Object({type:$.Literal(`pair.challenge`),v:$.Literal(1),enrollmentId:qP,nonce:XP,issuedAt:$.Integer(),hubId:qP,hubPublicKey:$.Optional($.String({minLength:1,maxLength:256})),hubKeyFingerprint:$.Optional(YP),hubSignature:$.Optional($.String({pattern:`^[A-Za-z0-9_-]{86}$`,minLength:86,maxLength:86}))},KP);$.Object({type:$.Literal(`pair.device-ack`),v:$.Literal(1),codeId:qP,code:eF,expiresAt:$.Integer(),hubOrigin:$.String(),hubId:qP,challenge:aF},KP),$.Object({type:$.Literal(`pair.response`),v:$.Literal(1),enrollmentId:qP,nonce:XP,signature:$.String({pattern:`^[A-Za-z0-9_-]{86}$`,minLength:86,maxLength:86})},KP),$.Object({type:$.Literal(`pair.pending`),v:$.Literal(1),enrollmentId:qP,state:$.Literal(`awaiting_approval`),expiresAt:$.Integer(),pollAfterMs:$.Integer({minimum:1})},KP),$.Object({type:$.Literal(`pair.token`),v:$.Literal(1),enrollmentId:qP,deviceUid:qP,deviceId:JP,pairingEpoch:qP,credentialId:qP,generation:$.Integer({minimum:1}),hubId:qP,hubOrigin:$.String(),hubUrl:$.String(),tunnelToken:ZP,issuedAt:$.Integer(),expiresAt:$.Null(),hubKeyFingerprint:$.Optional(YP)},KP),$.Object({enrollmentId:qP,deviceUid:qP,keyFingerprint:YP,replaceKey:$.Optional($.Boolean())},KP),$.Object({type:$.Literal(`pair.revoke`),v:$.Literal(1),deviceId:JP,pairingEpoch:qP,reason:$.Union([$.Literal(`user`),$.Literal(`compromise`),$.Literal(`hub_migrated`)]),revokedAt:$.Integer()},KP);var oF=$.Object({type:$.Literal(`pair.error`),v:$.Literal(1),code:$.Union([$.Literal(`code_invalid`),$.Literal(`code_expired`),$.Literal(`code_used`),$.Literal(`code_in_use`),$.Literal(`rate_limited`),$.Literal(`signature_invalid`),$.Literal(`clock_skew`),$.Literal(`paired_elsewhere`),$.Literal(`hub_required`),$.Literal(`fingerprint_mismatch`),$.Literal(`identity_conflict`),$.Literal(`enrollment_lost`),$.Literal(`enrollment_cancelled`),$.Literal(`already_issued`),$.Literal(`challenge_expired`)]),message:$.String({maxLength:512}),retryAfterMs:$.Optional($.Integer({minimum:1}))},KP);$.Object({type:$.Literal(`pair.code`),v:$.Literal(1),codeId:qP,code:eF,expiresAt:$.Integer(),hubOrigin:$.String({maxLength:2048}),pairUrl:$.String({maxLength:4096}),offerUrl:$.Optional($.String({maxLength:2048}))},KP);var sF=$.Union([$.Literal(`open`),$.Literal(`awaiting_proof`),$.Literal(`awaiting_approval`),$.Literal(`approved`),$.Literal(`issued`),$.Literal(`connected`),$.Literal(`cancelled`),$.Literal(`expired`)]);$.Object({type:$.Literal(`pair.code-state`),v:$.Literal(1),codeId:qP,expiresAt:$.Integer(),phase:sF,enrollment:$.Optional($.Object({enrollmentId:qP,deviceUid:qP,deviceName:$.String({minLength:1,maxLength:64}),keyFingerprint:YP,proofVerified:$.Boolean(),keyChanged:$.Boolean()},KP)),deviceId:$.Optional(JP),error:$.Optional(oF)},KP);function cF(e){if(typeof e!=`string`||e.length===0||e.length>2048)return{ok:!1,error:`origin: empty or too long`};if(/\s|\n|\r|\t/.test(e))return{ok:!1,error:`origin: whitespace not allowed`};let t;try{t=new URL(e)}catch{return{ok:!1,error:`origin: not a valid URL`}}return t.protocol!==`https:`&&!(t.protocol===`http:`&&/^(127\.0\.0\.1|\[::1\]|localhost)$/.test(t.hostname))?{ok:!1,error:`origin: HTTPS origin required`}:t.username||t.password?{ok:!1,error:`origin: userinfo not allowed`}:t.search||t.hash?{ok:!1,error:`origin: query/fragment not allowed`}:t.pathname!==`/`&&t.pathname!==``?{ok:!1,error:`origin: base path not allowed`}:{ok:!0,origin:t.origin,tunnelUrl:`${t.origin}/api/tunnel`}}function lF(e){if(e!==``&&/^[A-Za-z0-9_-]+$/.test(e))try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch{return}}var uF=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,dF=RegExp(`^${QP}$`),fF=/^sha256:[0-9a-f]{64}$/;function pF(e){let t=lF(e);if(!t||t.length>1024)return;let n;try{n=JSON.parse(new TextDecoder().decode(t))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(r.v!==2&&r.v!==3)return;let i=r.v===3?6:5;if(Object.keys(r).length!==i||typeof r.hub!=`string`)return;let a=cF(r.hub);if(a.ok&&a.origin===r.hub&&typeof r.id==`string`&&uF.test(r.id)&&typeof r.code==`string`&&dF.test(r.code)&&typeof r.exp==`number`&&Number.isSafeInteger(r.exp))return r.v===3?typeof r.kfp!=`string`||!fF.test(r.kfp)?void 0:{v:3,hub:r.hub,id:r.id,code:r.code,exp:r.exp,kfp:r.kfp}:{v:2,hub:r.hub,id:r.id,code:r.code,exp:r.exp}}function mF(e,t=Date.now()){let n=pF(e);if(n&&!(n.exp<t-3e4)&&!(n.exp>t+6e5))return n}function hF(e,t=Date.now()){let n;try{n=new URL(e)}catch{return}if(!/^\/pair\/?$/.test(n.pathname)||n.username||n.password||n.search||!n.hash.startsWith(`#offer=`))return;let r=mF(n.hash.slice(7),t);if(r&&r.hub===n.origin)return{offer:r,rest:`${n.origin}/pair`}}function gF(e){if(!/^\/pair\/?$/.test(e.pathname))return;if(e.hash.startsWith(`#offer=`)){let t=hF(e.href);if(t)return{code:t.offer.code,origin:e.origin,offerFragment:e.hash.slice(1)};let n=mF(e.hash.slice(7));return n&&n.hub!==e.origin?{error:`This pairing link does not belong to this hub. Open the original hub link instead.`}:{error:`Invalid pairing link. Use a complete link from the hub wizard.`}}let t=e.searchParams;if(!t.has(`code`)&&!t.has(`origin`)&&!t.has(`v`))return;let n=t.get(`code`),r=n===null?void 0:iF(n);if(e.username||e.password||e.hash||t.getAll(`code`).length!==1||!r||t.getAll(`v`).length!==1||t.get(`v`)!==`1`)return{error:`Invalid pairing link. Use a complete version 1 link from the hub wizard.`};if(t.has(`origin`))try{let n=new URL(t.get(`origin`));if(t.getAll(`origin`).length!==1||n.origin!==e.origin||n.pathname!==`/`||n.username||n.password||n.search||n.hash)throw Error(`origin mismatch`)}catch{return{error:`This pairing link does not belong to this hub. Open the original hub link instead.`}}return{code:r,origin:e.origin}}var _F=e=>/^\/pair\/?$/.test(e.pathname)?`/`:void 0,vF=e=>/^\/pair\/?$/.test(e.pathname)&&gF(e)===void 0?`/`:void 0,yF=4e3;async function bF(e){if(!e.needsCancel)return{closed:!0,confirmed:!0};let t,n=await Promise.race([e.cancel().catch(()=>`failed`),new Promise(n=>t=setTimeout(()=>n(`failed`),e.timeoutMs))]);return clearTimeout(t),{closed:n!==`issued`,confirmed:n===`cancelled`}}var xF={class:`modal pair-wizard`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`pair-title`},SF={key:1,class:`pair-pending`,"aria-label":`Machines waiting for approval`},CF={class:`who`},wF={key:0,class:`muted`},TF={key:1,class:`muted`},EF={class:`fp`},DF={class:`row`},OF={class:`phase`},kF=[`onClick`],AF={key:2,class:`hint`},jF={class:`pair-steps`,"aria-label":`Pairing progress`},MF={class:`pair-grid`},NF={class:`pair-code-box`},PF={class:`pair-code`,"aria-label":`Pairing code`},FF={class:`pair-copy-actions`},IF=[`innerHTML`],LF={class:`pair-side`},RF={key:0,class:`hint`},zF={class:`pair-fingerprint`},BF={class:`fp`},VF={class:`pair-confirm`},HF={key:0,class:`pair-confirm warn`},UF=[`disabled`],WF=[`disabled`],GF={class:`hint`},KF=[`disabled`],qF={key:5,class:`error`,role:`alert`},JF={key:4},YF={class:`error`,role:`alert`},XF=kr({__name:`PairDeviceWizard`,props:{handoff:{}},emits:[`close`],setup(e,{expose:t,emit:n}){let r=n,i=e,a=O(`boot`),o=O(),s=O(),c=O(),l=O(``),u=O(!1),d=O(!1),f=O(!1),p=O(!1),m=O(!1),h=O(!1),g=O(),_=O([]),v=B(()=>{let e=s.value?.code??``;return!rF(e)||e.includes(`-`)?e:(e.match(/.{4}/g)??[]).join(`-`)}),y=B(()=>s.value?jv(s.value):``),b=B(()=>y.value?Iw(y.value,148):``),ee=B(()=>c.value?.enrollment?.keyFingerprint??``),x=B(()=>c.value?.deviceId??``);A(x,e=>{g.value?.(),e&&(g.value=A(()=>uu.devices.value.find(t=>t.id===e)?.status,e=>{e===`online`&&(G(`Device paired and online.`),g.value?.(),g.value=void 0)},{immediate:!0}))});async function S(e){a.value=`boot`,l.value=``,f.value=!1,p.value=!1,c.value=void 0,s.value=void 0,o.value?.close();let t=Pv();o.value=t;try{let n=e?await Mv.resolveCode(e):await Mv.createCode();if(t.closed()){await Mv.cancel(n.codeId).catch(()=>{G(`The late pairing code could not be cancelled. Check device credentials before retrying.`)});return}if(s.value=n,a.value=`code`,e){let e=_F(new URL(window.location.href));e&&window.history.replaceState(window.history.state,``,e)}Lv(t,n.codeId,{intervalMs:1e3,onState:e=>{c.value=e,e.phase===`awaiting_proof`?a.value=`proof`:e.phase===`awaiting_approval`||e.phase===`approved`?a.value=`approve`:e.phase===`issued`||e.phase===`connected`?a.value=`issued`:e.phase===`cancelled`?a.value=`cancelled`:e.phase===`expired`&&(a.value=`expired`)}}).catch(e=>{t.closed()||(l.value=e instanceof Error?e.message:String(e),a.value=`expired`)})}catch(e){l.value=e instanceof Error?e.message:String(e),a.value=`expired`}}async function te(){let e=c.value,t=o.value;if(e?.enrollment&&t&&!u.value){u.value=!0,l.value=``;try{let t=await Mv.approve(s.value.codeId,{enrollmentId:e.enrollment.enrollmentId,deviceUid:e.enrollment.deviceUid,keyFingerprint:e.enrollment.keyFingerprint,...p.value?{replaceKey:!0}:{}});c.value=t,(t.phase===`issued`||t.phase===`connected`)&&(a.value=`issued`)}catch(e){l.value=e instanceof Error?e.message:String(e)}finally{u.value=!1}}}async function ne(e){if(!s.value)return`cancelled`;try{let t=await Mv.cancel(s.value.codeId,void 0,e);return c.value=t,o.value&&(o.value.state=t),a.value=t.phase===`expired`?`expired`:`cancelled`,o.value?.close(),`cancelled`}catch(e){if(e instanceof Ll&&e.status===409&&String(e.code)===`already_issued`){let e=await Mv.codeState(s.value.codeId).catch(()=>void 0);return e&&(c.value=e,o.value&&(o.value.state=e)),a.value=`issued`,l.value=`Credential already issued. Closing does not revoke it; choose Revoke explicitly if needed.`,`issued`}return l.value=e instanceof Error?e.message:String(e),`failed`}}let C=()=>ne(!1),re=()=>[`issued`,`connected`,`cancelled`,`expired`].includes(c.value?.phase??``);async function ie(){let e=x.value;if(e){u.value=!0;try{await Mv.revoke(e,`user`),G(`Issued credential revoked.`),r(`close`)}catch(e){l.value=e instanceof Error?e.message:String(e)}finally{u.value=!1}}}async function ae(){if(s.value)try{await navigator.clipboard.writeText(s.value.code),m.value=!0,setTimeout(()=>m.value=!1,1500)}catch{l.value=`Clipboard unavailable; copy the code manually.`}}async function oe(){if(s.value)try{await navigator.clipboard.writeText(s.value.offerUrl??s.value.pairUrl),h.value=!0,setTimeout(()=>h.value=!1,1500)}catch{l.value=`Clipboard unavailable; copy the link manually.`}}async function se(){if(!d.value){d.value=!0,u.value=!0;try{let e=await bF({needsCancel:!!s.value&&!re(),cancel:C,timeoutMs:yF});if(!e.closed)return;o.value?.close(),g.value?.(),e.confirmed||G(`Pairing cancellation was not confirmed. The code expires on its own; check device credentials before retrying.`),r(`close`)}finally{d.value=!1,u.value=!1}}}t({close:se});let ce;async function le(){try{_.value=(await Mv.pending()).codes}catch{}}async function ue(e){s.value=void 0,c.value=void 0,l.value=``;let t=Pv();o.value=t,a.value=e.phase===`approved_ready`?`approve`:`proof`,Lv(t,e.codeId,{intervalMs:1e3,onState:e=>{c.value=e,e.phase===`awaiting_proof`?a.value=`proof`:e.phase===`awaiting_approval`||e.phase===`approved`?a.value=`approve`:e.phase===`issued`||e.phase===`connected`?a.value=`issued`:e.phase===`cancelled`?a.value=`cancelled`:e.phase===`expired`&&(a.value=`expired`)}}).catch(e=>{l.value=e instanceof Error?e.message:String(e)})}return Wr(()=>{if(le(),ce=setInterval(()=>void le(),3e3),i.handoff&&`error`in i.handoff){l.value=i.handoff.error,a.value=`expired`;return}S(i.handoff?.code)}),qr(()=>{clearInterval(ce);let e=o.value;e&&!e.closed()&&s.value&&!re()&&ne(!0).then(e=>{e!==`cancelled`&&G(`Pairing cancellation was not confirmed. Check device credentials before retrying.`)}),e?.close(),g.value?.()}),(e,t)=>(N(),P(`div`,{class:`modal-backdrop`,onClick:Ms(se,[`self`])},[I(`div`,xF,[I(`header`,null,[t[5]||=I(`h2`,{id:`pair-title`},`Pair a device`,-1),I(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close dialog`,onClick:se},[L(k(cl),{size:18})])]),i.handoff&&`offerFragment`in i.handoff&&i.handoff.offerFragment?(N(),F(Uw,{key:0,"offer-fragment":i.handoff.offerFragment},null,8,[`offer-fragment`])):z(``,!0),_.value.length?(N(),P(`section`,SF,[t[6]||=I(`h3`,null,`Machines waiting for you`,-1),I(`ul`,null,[(N(!0),P(M,null,j(_.value,e=>(N(),P(`li`,{key:e.codeId},[I(`div`,CF,[I(`strong`,null,E(e.deviceName??`unnamed device`),1),e.hostname?(N(),P(`span`,wF,E(e.hostname),1)):z(``,!0),e.platform?(N(),P(`span`,TF,E(e.platform),1)):z(``,!0)]),I(`div`,EF,E(e.keyFingerprint),1),I(`div`,DF,[I(`span`,OF,E(e.phase.replaceAll(`_`,` `)),1),I(`button`,{type:`button`,class:`small`,onClick:t=>ue(e)},`Review`,8,kF)])]))),128))]),t[7]||=I(`p`,{class:`hint`},` Compare each fingerprint with the machine's own terminal before approving. Codes are minted by the hub — nothing has to be copied to the machine. `,-1)])):z(``,!0),a.value===`boot`?(N(),P(`p`,AF,`Minting a pairing code…`)):s.value?(N(),P(M,{key:3},[I(`ol`,jF,[t[8]||=I(`li`,{class:T({on:!0})},`Code`,-1),I(`li`,{class:T({on:[`proof`,`approve`,`issued`].includes(a.value)})},`Proof`,2),I(`li`,{class:T({on:[`approve`,`issued`].includes(a.value)})},`Fingerprint`,2),I(`li`,{class:T({on:a.value===`issued`})},`Online`,2)]),I(`div`,MF,[I(`div`,NF,[I(`div`,PF,E(v.value),1),I(`div`,FF,[I(`button`,{type:`button`,class:`small`,onClick:ae},[L(k(sc),{size:14}),R(` `+E(m.value?`Copied`:`Copy code`),1)]),I(`button`,{type:`button`,class:`small`,onClick:oe,title:`Self-contained link: hub, code and expiry all in the fragment — it never reaches server logs`},[L(k(sc),{size:14}),R(` `+E(h.value?`Copied link`:`Copy link`),1)])]),t[9]||=I(`p`,{class:`hint`},` Run the device pairing command and scan, or enter this code on the device. Expires in 5 minutes. `,-1),I(`div`,{class:`pair-qr`,"aria-label":`Pairing QR code`,title:`Same offer link as Copy link: hub, code and expiry all in the #offer= fragment — it never reaches server logs`,innerHTML:b.value},null,8,IF)]),I(`div`,LF,[a.value===`code`||a.value===`proof`?(N(),P(`p`,RF,[L(k(Kc),{size:14,class:`spin`}),t[10]||=R(` Waiting for the device to submit its signing proof… `,-1)])):a.value===`approve`?(N(),P(M,{key:1},[I(`div`,zF,[t[11]||=I(`h3`,null,`Device key fingerprint`,-1),I(`code`,BF,E(ee.value),1),t[12]||=I(`p`,{class:`hint`},` Compare ALL 64 hex characters with the fingerprint shown on the device screen. `,-1)]),I(`label`,VF,[Wn(I(`input`,{"onUpdate:modelValue":t[0]||=e=>f.value=e,type:`checkbox`},null,512),[[Cs,f.value]]),t[13]||=R(` The fingerprint matches the device display exactly `,-1)]),c.value?.enrollment?.keyChanged?(N(),P(`label`,HF,[Wn(I(`input`,{"onUpdate:modelValue":t[1]||=e=>p.value=e,type:`checkbox`},null,512),[[Cs,p.value]]),L(k(Yc),{size:14}),t[14]||=R(` Device is already paired with a DIFFERENT key — replace the stored key (replaceKey) `,-1)])):z(``,!0),I(`button`,{type:`button`,class:`primary`,disabled:!f.value||u.value||c.value?.enrollment?.keyChanged===!0&&!p.value,onClick:te},` Approve device `,8,UF),I(`button`,{type:`button`,class:`small`,disabled:u.value,onClick:C},` Cancel pairing `,8,WF)],64)):a.value===`issued`?(N(),P(M,{key:2},[I(`p`,GF,[L(k(ic),{size:14}),t[15]||=R(` Credential issued. The device is connecting through the tunnel — you will get a toast once the monitor probe reports it online. `,-1)]),I(`button`,{type:`button`,class:`small`,onClick:se},`Close`),I(`button`,{type:`button`,class:`small danger`,disabled:!x.value||u.value,title:`Mistaken approval? Revoke the credential now.`,onClick:ie},` Revoke this credential `,8,KF)],64)):a.value===`cancelled`?(N(),P(M,{key:3},[t[16]||=I(`p`,{class:`hint`},`Pairing was cancelled (or the signature failed too many times).`,-1),I(`button`,{type:`button`,class:`small`,onClick:t[2]||=e=>S()},`Start over`)],64)):a.value===`expired`?(N(),P(M,{key:4},[t[17]||=I(`p`,{class:`hint`},`The pairing code expired.`,-1),I(`button`,{type:`button`,class:`small`,onClick:t[3]||=e=>S()},`New code`)],64)):z(``,!0),l.value?(N(),P(`p`,qF,E(l.value),1)):z(``,!0)])])],64)):(N(),P(`div`,JF,[I(`p`,YF,E(l.value||`This pairing link is unavailable.`),1),I(`button`,{type:`button`,class:`small`,onClick:t[4]||=e=>S()},`New code`)]))])]))}}),ZF={class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`device-credentials-title`},QF={class:`hint`},$F={key:1,class:`hint`},eI=kr({__name:`DeviceCredentialsDialog`,props:{deviceId:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=B(()=>uu.devices.value.find(e=>e.id===n.deviceId));return(e,t)=>(N(),P(`div`,{class:`modal-backdrop`,onClick:t[2]||=Ms(e=>r(`close`),[`self`])},[I(`section`,ZF,[I(`header`,null,[t[3]||=I(`h2`,{id:`device-credentials-title`},`Device credentials`,-1),I(`button`,{class:`icon-button`,"aria-label":`Close device credentials`,onClick:t[0]||=e=>r(`close`)},[L(k(cl),{size:18})])]),i.value?(N(),P(M,{key:0},[I(`p`,null,[R(E(i.value.name)+` `,1),I(`code`,null,E(i.value.id),1)]),I(`p`,QF,E(i.value.status)+` · tunnel `+E(i.value.tunnel?.state??`disconnected`)+` · `+E(i.value.tunnel?.readerCount??0)+` readers `,1),L(Kv,{device:i.value},null,8,[`device`])],64)):(N(),P(`p`,$F,`This device is no longer in the registry.`)),I(`footer`,null,[I(`button`,{class:`secondary`,onClick:t[1]||=e=>r(`close`)},`Close`)])])]))}}),tI={id:`prompt-title`},nI=[`disabled`],rI={key:0,class:`hint`},iI={key:1},aI={key:0,class:`muted`},oI=[`placeholder`,`disabled`],sI=[`required`,`placeholder`,`aria-label`,`disabled`],cI={key:2,class:`message-error`,role:`alert`},lI=[`disabled`],uI=[`disabled`],dI=kr({__name:`PromptDialog`,props:{dialog:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=O(n.dialog.value??``),a=O(!1),o=O(``),s=O(),c=!!n.dialog.label;async function l(){if(!a.value&&(!c||n.dialog.optional||i.value.trim())){a.value=!0,o.value=``;try{await n.dialog.run(i.value.trim()),r(`close`)}catch(e){o.value=Ql(e)}finally{a.value=!1}}}return Wr(()=>void jn(()=>(s.value?.focus(),s.value?.select()))),(t,n)=>(N(),P(`div`,{class:`modal-backdrop`,onClick:n[4]||=Ms(e=>!a.value&&r(`close`),[`self`])},[I(`form`,{class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`prompt-title`,onSubmit:Ms(l,[`prevent`])},[I(`header`,null,[I(`h2`,tI,E(e.dialog.title),1),I(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close dialog`,disabled:a.value,onClick:n[0]||=e=>r(`close`)},[L(k(cl),{size:18})],8,nI)]),e.dialog.hint?(N(),P(`p`,rI,E(e.dialog.hint),1)):z(``,!0),c?(N(),P(`label`,iI,[R(E(e.dialog.label)+` `,1),e.dialog.optional?(N(),P(`span`,aI,`(optional)`)):z(``,!0),e.dialog.multiline?Wn((N(),P(`textarea`,{key:1,ref_key:`input`,ref:s,"onUpdate:modelValue":n[1]||=e=>i.value=e,rows:`4`,placeholder:e.dialog.placeholder,disabled:a.value},null,8,oI)),[[Ss,i.value]]):Wn((N(),P(`input`,{key:2,ref_key:`input`,ref:s,"onUpdate:modelValue":n[2]||=e=>i.value=e,maxlength:`100`,required:!e.dialog.optional,placeholder:e.dialog.placeholder,"aria-label":e.dialog.label,disabled:a.value},null,8,sI)),[[Ss,i.value]])])):z(``,!0),o.value?(N(),P(`p`,cI,E(o.value),1)):z(``,!0),I(`footer`,null,[I(`button`,{type:`button`,class:`secondary`,disabled:a.value,onClick:n[3]||=e=>r(`close`)},` Cancel `,8,lI),I(`button`,{class:T([`primary`,{danger:e.dialog.danger}]),disabled:a.value||c&&!e.dialog.optional&&!i.value.trim()},E(a.value?`Working…`:e.dialog.submit),11,uI)])],32)]))}}),fI={class:`modal model-modal`},pI={class:`eyebrow`},mI={class:`model-list`},hI=[`onClick`],gI=[`src`],_I={class:`hint`},vI=kr({__name:`ModelPicker`,emits:[`close`],setup(e,{emit:t}){let n=t,r=O(``),i=B(()=>Nu.value.filter(e=>`${e.name} ${e.id} ${e.tier}`.toLowerCase().includes(r.value.toLowerCase()))),a=e=>e.id===Pu.value.agent.model?.modelId&&e.provider===Pu.value.agent.model?.provider;async function o(e){await Gu(()=>wu.value.configure({model:{provider:e.provider,modelId:e.id}}))&&(await Uu(),G(`Model saved. Used on the next turn.`),n(`close`))}return(e,t)=>(N(),P(`div`,{class:`modal-backdrop`,onClick:t[2]||=Ms(e=>n(`close`),[`self`])},[I(`section`,fI,[I(`header`,null,[I(`div`,null,[I(`span`,pI,`PER AGENT · `+E(k(_u)?.id),1),t[3]||=I(`h2`,null,`Choose a model`,-1)]),I(`button`,{class:`icon-button`,"aria-label":`Close model picker`,onClick:t[0]||=e=>n(`close`)},[L(k(cl),{size:18})])]),Wn(I(`input`,{"onUpdate:modelValue":t[1]||=e=>r.value=e,placeholder:`Search models or tiers…`,"aria-label":`Search models`},null,512),[[Ss,r.value]]),I(`div`,mI,[(N(!0),P(M,null,j(i.value,e=>(N(),P(`button`,{key:`${e.provider}/${e.id}`,class:T({selected:a(e)}),onClick:t=>o(e)},[I(`img`,{src:k(Yu)(e.id),alt:``},null,8,gI),I(`div`,null,[I(`strong`,null,E(e.name),1),I(`small`,null,E(e.tier)+` / `+E(e.provider)+` / `+E(k(qu)(e.contextWindow))+` context`,1)]),a(e)?(N(),F(k(tc),{key:0,size:18})):z(``,!0)],10,hI))),128))]),I(`p`,_I,`Models available on `+E(k(_u)?.id)+`. Provider keys stay on the device.`,1)])]))}}),yI={class:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`help-title`},bI={class:`dialog-head`},xI={class:`dialog-body`},SI={class:`n`},CI={class:`body`},wI={class:`help-callout`},TI={class:`dialog-foot`},EI={class:`right`},DI=kr({__name:`HelpDialog`,setup(e){let t=[{title:`Pick a device, start a session`,body:`Every device in the tree runs dpi-backend. A session gets its own SQLite database on that device, in the directory you choose.`},{title:`Send work, then close the browser`,body:`The device owns the run. Reopening restores committed messages, state and live progress.`},{title:`Change state and fork`,body:`Edit App State by hand or through the agent. Every session and fork on a device shares it.`},{title:`Interrupt deliberately`,body:`Interrupt stops foreground work and owned subagents. Background jobs continue. Stop all includes them.`},{title:`Explore the boundaries`,body:`Queue a follow-up, steer after tools, wait for approval, compact context, reset or inspect raw state.`},{title:`Restart a device`,body:`Its tree dims and shows the restart command. Checkpointed jobs recover on boot. Replay-safe tools may rerun. Other interrupted tools return an error.`}];return(e,n)=>(N(),P(`div`,{class:`scrim`,onClick:n[2]||=Ms(e=>k(W).dialog=void 0,[`self`])},[I(`section`,yI,[I(`div`,bI,[n[3]||=I(`div`,null,[I(`span`,{class:`dialog-eyebrow`},`LEARN BY DOING`),I(`h3`,{id:`help-title`},`What makes this durable?`)],-1),I(`button`,{class:`icon-button`,"aria-label":`Close help`,onClick:n[0]||=e=>k(W).dialog=void 0},[L(k(cl),{size:18})])]),I(`div`,xI,[(N(),P(M,null,j(t,(e,t)=>I(`div`,{key:e.title,class:`help-step`},[I(`span`,SI,E(String(t+1).padStart(2,`0`)),1),I(`div`,null,[I(`b`,null,E(e.title),1),I(`div`,CI,E(e.body),1)])])),64)),I(`div`,wI,[L(k(wc),{size:18}),n[4]||=I(`span`,null,`Durable does not mean exactly-once external effects. Checkpoints protect progress. Tools still need their own idempotency.`,-1)])]),I(`div`,TI,[I(`div`,EI,[I(`button`,{class:`secondary`,type:`button`,onClick:n[1]||=e=>k(W).dialog=void 0},`Close`)])])])]))}}),OI=Gt({needed:!1,busy:!1,error:``}),kI=new Set,AI=e=>{let t=[...kI];kI=new Set;for(let n of t)n(e)},jI=()=>new Promise(e=>kI.add(e));async function MI(e){if(OI.busy||!e)return!1;OI.busy=!0,OI.error=``;try{let t=await fetch(`/api/session`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({token:e})});return await t.text().catch(()=>``),t.ok?(OI.needed=!1,AI(!0),!0):(OI.error=t.status===401?`That token was not accepted.`:t.status===429?`Too many attempts. Wait a minute and try again.`:`Login failed (${t.status}).`,!1)}catch{return OI.error=`Cannot reach the hub.`,!1}finally{OI.busy=!1}}var NI=e=>{try{return new URL(e,location.href).pathname===`/api/session`}catch{return e===`/api/session`}};function PI(e){return(async(t,n)=>{let r=()=>e(t,n),i=await r();if(i.status!==401||NI(typeof t==`string`?t:t instanceof URL?t.href:t.url)||n?.body instanceof ReadableStream)return i;OI.needed=!0;let a=await i.text().catch(()=>``);return await jI()?r():new Response(a,{status:i.status,headers:i.headers})})}function FI(){typeof window>`u`||window.__adminFetch||(window.__adminFetch=!0,window.fetch=PI(window.fetch.bind(window)))}var II={class:`login-veil`,"data-testid":`login-card`},LI=[`disabled`],RI={key:0,class:`message-error`,role:`alert`},zI=[`disabled`],BI=kr({__name:`LoginCard`,setup(e){let t=O(``),n=O();async function r(){if(OI.busy||!t.value.trim())return;let e=await MI(t.value.trim());t.value=``,e&&n.value?.blur()}return Wr(()=>void jn(()=>n.value?.focus())),(e,i)=>(N(),P(`div`,II,[I(`form`,{class:`modal login-card`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`login-title`,onSubmit:Ms(r,[`prevent`])},[i[2]||=I(`header`,null,[I(`h2`,{id:`login-title`},`Admin token`)],-1),i[3]||=I(`p`,{class:`hint`},[R(` This hub is locked. Sign in with the token from its `),I(`code`,null,`admin.token`),R(` file. `)],-1),i[4]||=I(`label`,{for:`admin-token`},`Admin token`,-1),Wn(I(`input`,{id:`admin-token`,ref_key:`input`,ref:n,"onUpdate:modelValue":i[0]||=e=>t.value=e,type:`password`,name:`admin-token`,autocomplete:`off`,spellcheck:`false`,placeholder:`adm_…`,"aria-label":`Admin token`,disabled:k(OI).busy,onKeydown:i[1]||=Ps(e=>k(OI).error=``,[`esc`])},null,40,LI),[[Ss,t.value]]),k(OI).error?(N(),P(`p`,RI,E(k(OI).error),1)):z(``,!0),I(`footer`,null,[I(`button`,{class:`primary`,type:`submit`,disabled:k(OI).busy||!t.value.trim()},E(k(OI).busy?`Checking…`:`Sign in`),9,zI)])],32)]))}}),VI={key:0,class:`toast`,role:`status`},HI=kr({__name:`Toast`,setup(e){return(e,t)=>(N(),F(Co,{name:`toast`},{default:Un(()=>[k(W).toast?(N(),P(`div`,VI,[L(k(tc),{size:18}),R(E(k(W).toast),1)])):z(``,!0)]),_:1}))}}),UI={class:`shell`,"data-testid":`app-shell`},WI={key:0,class:`error-banner`,role:`alert`},GI={key:4,class:`welcome`,"data-testid":`welcome-empty`},KI=[`disabled`],qI={class:`welcome-features`},JI={class:`modal path-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`path-title`},YI={class:`full-directory`},XI=kr({__name:`App`,setup(e){let t=()=>uu.devices.value.filter(e=>e.status===`online`).length,n=O();function r(){W.dialog={kind:`new-session`,deviceId:U.value?.deviceId}}function i(e){let t=W.dialog?void 0:cd(e);if(t)return e.preventDefault(),t===`tree`?id():ad();if(e.key===`Escape`){if(W.dialog){W.dialog.kind===`pair`?n.value?.close():W.dialog=void 0;return}!e.repeat&&!e.isComposing&&Ru.value&&(e.preventDefault(),Qu()),W.drawer=!1,W.inspectorOverlay=!1}}function a(e){let t=e.clientX,n=pu.value,r=e=>pu.value=Math.max(220,Math.min(560,n+e.clientX-t)),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}return Wr(()=>Md()),Wr(()=>{document.addEventListener(`keydown`,i),ju()}),qr(()=>{cu.stop(),document.removeEventListener(`keydown`,i)}),(e,i)=>(N(),P(`div`,UI,[L(gd,{onNewSession:r}),k(W).error?(N(),P(`div`,WI,[L(k(wc),{size:18}),I(`span`,null,E(k(W).error),1),I(`button`,{class:`icon-button`,"aria-label":`Dismiss error`,onClick:i[0]||=e=>k(W).error=``},`×`)])):z(``,!0),I(`main`,{class:`net-workspace`,style:_e({"--tree-w":`${k(pu)}px`})},[L(lf),k(mu).tree?(N(),P(`div`,{key:0,class:`tree-resizer`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize network tree`,onPointerdown:Ms(a,[`prevent`])},null,32)):z(``,!0),k(W).drawer?(N(),P(`div`,{key:1,class:`tree-backdrop`,onClick:i[1]||=e=>k(W).drawer=!1})):z(``,!0),k(U)&&k(_u)&&k(vu)?(N(),P(M,{key:2},[L(LC),k(W).inspectorOverlay?(N(),P(`div`,{key:0,class:`inspector-backdrop`,onClick:i[2]||=e=>k(rd)()})):z(``,!0),(N(),F(rv,{key:`${k(U).deviceId}/${k(U).sessionId}`}))],64)):k(U)&&k(_u)?(N(),F(qC,{key:3,device:k(_u)},null,8,[`device`])):(N(),P(`section`,GI,[i[14]||=I(`img`,{class:`welcome-symbol`,src:`/icons/durable-pi.svg`,alt:`Durable Pi`},null,-1),i[15]||=I(`span`,{class:`eyebrow`},`THE DURABLE AGENT NETWORK`,-1),i[16]||=I(`h1`,null,[R(`Close the tab.`),I(`br`),R(`The work continues.`)],-1),i[17]||=I(`p`,null,`Agents run on your devices. This page is only a window into them.`,-1),I(`button`,{class:`primary`,disabled:!t(),onClick:r},[L(k(Wc),{size:18}),R(E(k(uu).devices.value.length?`Create a session`:`Add a device to dpi-network.yaml`),1)],8,KI),I(`div`,qI,[I(`span`,null,[L(k(dc),{size:18}),i[11]||=R(`SQLite on each device`,-1)]),I(`span`,null,[L(k(yc),{size:18}),i[12]||=R(`Branch any agent`,-1)]),I(`span`,null,[L(k(Ws),{size:18}),i[13]||=R(`Watch from anywhere`,-1)])])]))],4),L(yd),k(W).dialog?.kind===`pair`?(N(),F(XF,{key:1,ref_key:`pairWizard`,ref:n,handoff:k(W).dialog.handoff,onClose:i[3]||=e=>k(W).dialog=void 0},null,8,[`handoff`])):z(``,!0),k(W).dialog?.kind===`credentials`?(N(),F(eI,{key:2,"device-id":k(W).dialog.deviceId,onClose:i[4]||=e=>k(W).dialog=void 0},null,8,[`device-id`])):z(``,!0),k(W).dialog?.kind===`new-session`?(N(),F(uw,{key:3,"device-id":k(W).dialog.deviceId,onClose:i[5]||=e=>k(W).dialog=void 0},null,8,[`device-id`])):k(W).dialog?.kind===`prompt`?(N(),F(dI,{key:4,dialog:k(W).dialog,onClose:i[6]||=e=>k(W).dialog=void 0},null,8,[`dialog`])):k(W).dialog?.kind===`models`?(N(),F(vI,{key:5,onClose:i[7]||=e=>k(W).dialog=void 0})):k(W).dialog?.kind===`path`?(N(),P(`div`,{key:6,class:`modal-backdrop`,onClick:i[10]||=Ms(e=>k(W).dialog=void 0,[`self`])},[I(`section`,JI,[I(`header`,null,[i[18]||=I(`h2`,{id:`path-title`},`Working directory`,-1),I(`button`,{class:`icon-button`,"aria-label":`Close working directory`,onClick:i[8]||=e=>k(W).dialog=void 0},[L(k(cl),{size:18})])]),I(`code`,YI,E(k(W).dialog.path),1),I(`footer`,null,[I(`button`,{class:`secondary`,onClick:i[9]||=e=>k(W).dialog=void 0},`Close`)])])])):k(W).dialog?.kind===`help`?(N(),F(DI,{key:7})):z(``,!0),k(OI).needed?(N(),F(BI,{key:8})):z(``,!0),L(HI)]))}});FI();var ZI=new URL(window.location.href);if(/^\/pair\/?$/.test(ZI.pathname)){let e=gF(ZI);e?(ZI.search=``,ZI.hash=``,window.history.replaceState(window.history.state,``,ZI),W.dialog={kind:`pair`,handoff:e}):window.history.replaceState(window.history.state,``,vF(ZI))}Rs(XI).mount(`#app`);
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<meta name="referrer" content="no-referrer" />
|
|
8
8
|
<link rel="icon" type="image/svg+xml" href="/icons/durable-pi.svg" />
|
|
9
9
|
<title>Durable Pi | Network</title>
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-W7_6LpLB.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CpTBG0M5.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="app"></div>
|
|
@@ -535,9 +535,11 @@ async function commit(thenPush = false) {
|
|
|
535
535
|
if (!chosen.length) return notify("check the files to commit — nothing is selected");
|
|
536
536
|
const client = deviceClient(devId.value);
|
|
537
537
|
try {
|
|
538
|
+
// During a merge git refuses path-limited commits ("cannot do a partial
|
|
539
|
+
// commit during a merge") — the changelist is everything staged anyway.
|
|
538
540
|
const r = await client.gitOp(cwd.value, "commit", {
|
|
539
541
|
message: commitMsg.value.trim(),
|
|
540
|
-
files: chosen,
|
|
542
|
+
...(status.value?.merge ? {} : { files: chosen }),
|
|
541
543
|
});
|
|
542
544
|
notify(r.text);
|
|
543
545
|
commitMsg.value = "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-durable",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.35",
|
|
4
4
|
"description": "Durable Pi \u2014 the durable agent network: hub web UI, device backend daemon, TUI admin and the shared SDK, packaged as one runnable monorepo install",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|