codex-lens 0.1.8 → 0.1.10

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.
@@ -191,7 +191,8 @@ class Aggregator {
191
191
  data: {
192
192
  path: result.path,
193
193
  content: result.content,
194
- extension
194
+ extension,
195
+ diff: result.diff || null
195
196
  }
196
197
  }));
197
198
  }
@@ -2,7 +2,7 @@
2
2
  import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeSync } from "fs";
3
3
  import { dirname, join } from "path";
4
4
  import { homedir } from "os";
5
- const DEFAULT_LOG_DIR = join(homedir(), ".codex-viewer");
5
+ const DEFAULT_LOG_DIR = join(homedir(), ".codex-lens");
6
6
  class LogManager {
7
7
  constructor(logDir = DEFAULT_LOG_DIR) {
8
8
  this.logDir = logDir;
@@ -29,4 +29,4 @@
29
29
  * The original design remains. The terminal itself
30
30
  * has been extended to include xterm CSI codes, among
31
31
  * other features.
32
- */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg-primary: #1e1e1e;--bg-secondary: #252526;--bg-tertiary: #2d2d30;--text-primary: #cccccc;--text-secondary: #858585;--border-color: #3c3c3c;--accent-color: #007acc;--accent-hover: #1e8ad2;--diff-add-bg: #2d4a2d;--diff-add-text: #89d185;--diff-remove-bg: #5a2d2d;--diff-remove-text: #f48771;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;--font-mono: "SF Mono", "Fira Code", "Consolas", monospace}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:var(--font-family);background-color:var(--bg-primary);color:var(--text-primary);font-size:14px;line-height:1.5}.app-container{display:flex;height:100vh;width:100vw}.panel{display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--border-color)}.panel:last-child{border-right:none}.panel-header{padding:8px 12px;background:var(--bg-tertiary);border-bottom:1px solid var(--border-color);font-weight:600;font-size:12px;text-transform:uppercase;color:var(--text-secondary)}.panel-content{flex:1;overflow:auto}.file-tree{padding:8px}.file-item{padding:4px 8px;cursor:pointer;border-radius:3px;display:flex;align-items:center;gap:6px}.file-item:hover{background:var(--bg-tertiary)}.file-item.active{background:var(--accent-color)}.file-icon{width:16px;height:16px}.diff-line{font-family:var(--font-mono);font-size:13px;padding:2px 12px;white-space:pre}.diff-line.added{background:var(--diff-add-bg);color:var(--diff-add-text)}.diff-line.removed{background:var(--diff-remove-bg);color:var(--diff-remove-text)}.diff-line:before{display:inline-block;width:16px;margin-right:8px;text-align:center;font-weight:700}.diff-line.added:before{content:"+"}.diff-line.removed:before{content:"-"}.chat-message{padding:8px 12px;margin:4px 8px;border-radius:8px;max-width:85%}.chat-message.user{background:var(--accent-color);color:#fff;margin-left:auto}.chat-message.codex{background:var(--bg-tertiary);color:var(--text-primary)}.chat-input-container{padding:12px;border-top:1px solid var(--border-color);background:var(--bg-secondary)}.chat-input{width:100%;padding:8px 12px;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;color:var(--text-primary);font-family:var(--font-family);resize:none}.chat-input:focus{outline:none;border-color:var(--accent-color)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--text-secondary)}.ws-status{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:8px}.ws-status.connected{background:#0dbc79}.ws-status.disconnected{background:#cd3131}.version-info{display:flex;align-items:center;gap:8px;margin-left:auto}.version-number{font-size:11px;color:var(--text-secondary);font-weight:400}.update-badge{font-size:10px;padding:2px 6px;background:#d9534f;color:#fff;border-radius:3px;cursor:pointer}.update-badge:hover{background:#c9302c}.terminal-wrapper{flex:1;overflow:hidden;min-height:0}.left-panel{width:250px;flex-shrink:0}.middle-panel{flex:1;min-width:300px}.right-panel{width:40%;min-width:300px;max-width:60%}.section{margin-bottom:16px}.section-title{padding:8px 12px 4px;font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase}.empty-state{padding:20px;text-align:center;color:var(--text-secondary);font-size:13px}.code-panel{font-family:var(--font-mono)}.code-content{padding:12px;white-space:pre-wrap;word-break:break-all}.diff-container{font-family:var(--font-mono);font-size:13px}.tab-bar{display:flex;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);overflow-x:auto;min-height:36px}.tab{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--bg-secondary);border-right:1px solid var(--border-color);cursor:pointer;min-width:100px;max-width:200px;font-size:13px;color:var(--text-secondary)}.tab:hover{background:var(--bg-tertiary)}.tab.active{background:var(--bg-primary);color:var(--text-primary);border-bottom:2px solid var(--accent-color)}.tab-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-close{background:none;border:none;color:var(--text-secondary);font-size:16px;cursor:pointer;padding:0 4px;border-radius:3px;line-height:1}.tab-close:hover{background:#ffffff1a;color:var(--text-primary)}.context-menu{position:fixed;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:4px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px #0000004d;z-index:1000}.context-menu-item{padding:8px 16px;cursor:pointer;font-size:13px;color:var(--text-primary)}.context-menu-item:hover{background:var(--accent-color)}.file-context-menu{position:fixed;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:4px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px #0000004d;z-index:1000}.task-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);min-height:44px}.task-status{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500}.task-status.idle{color:var(--text-secondary)}.task-status.running{color:var(--accent-color)}.task-status:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%}.task-status.idle:before{background:var(--text-secondary)}.task-status.running:before{background:var(--accent-color);animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.task-buttons{display:flex;gap:8px}.task-btn{padding:6px 12px;border:none;border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;transition:background .2s}.task-btn-start{background:var(--accent-color);color:#fff}.task-btn-start:hover{background:var(--accent-hover)}.task-btn-rollback{background:#d9534f;color:#fff}.task-btn-rollback:hover{background:#c9302c}.task-btn-complete{background:#5cb85c;color:#fff}.task-btn-complete:hover{background:#4cae4c}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:2000}.modal-content{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:20px;min-width:320px;max-width:400px;box-shadow:0 8px 32px #0006}.modal-title{font-size:16px;font-weight:600;margin-bottom:12px;color:var(--text-primary)}.modal-body{font-size:14px;color:var(--text-secondary);margin-bottom:20px;line-height:1.6}.modal-buttons{display:flex;justify-content:flex-end;gap:12px}.modal-btn{padding:8px 16px;border:none;border-radius:4px;font-size:13px;font-weight:500;cursor:pointer;transition:background .2s}.modal-btn-cancel{background:var(--bg-tertiary);color:var(--text-primary)}.modal-btn-cancel:hover{background:var(--border-color)}.modal-btn-danger{background:#d9534f;color:#fff}.modal-btn-danger:hover{background:#c9302c}
32
+ */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility:not(.debug),.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .xterm-accessibility-tree:not(.debug) *::selection{color:transparent}.xterm .xterm-accessibility-tree{-webkit-user-select:text;user-select:text;white-space:pre}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg-primary: #1e1e1e;--bg-secondary: #252526;--bg-tertiary: #2d2d30;--text-primary: #cccccc;--text-secondary: #858585;--border-color: #3c3c3c;--accent-color: #007acc;--accent-hover: #1e8ad2;--diff-add-bg: #2d4a2d;--diff-add-text: #89d185;--diff-remove-bg: #5a2d2d;--diff-remove-text: #f48771;--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;--font-mono: "SF Mono", "Fira Code", "Consolas", monospace}*{margin:0;padding:0;box-sizing:border-box}html,body,#root{height:100%;width:100%;overflow:hidden}body{font-family:var(--font-family);background-color:var(--bg-primary);color:var(--text-primary);font-size:14px;line-height:1.5}.app-container{display:flex;height:100vh;width:100vw}.panel{display:flex;flex-direction:column;overflow:hidden;border-right:1px solid var(--border-color)}.panel:last-child{border-right:none}.panel-header{padding:8px 12px;background:var(--bg-tertiary);border-bottom:1px solid var(--border-color);font-weight:600;font-size:12px;text-transform:uppercase;color:var(--text-secondary)}.panel-content{flex:1;overflow:auto}.file-tree{padding:8px}.file-item{padding:4px 8px;cursor:pointer;border-radius:3px;display:flex;align-items:center;gap:6px}.file-item:hover{background:var(--bg-tertiary)}.file-item.active{background:var(--accent-color)}.file-icon{width:16px;height:16px}.diff-line{font-family:var(--font-mono);font-size:13px;padding:2px 12px;white-space:pre}.diff-line.added{background:var(--diff-add-bg);color:var(--diff-add-text)}.diff-line.removed{background:var(--diff-remove-bg);color:var(--diff-remove-text)}.diff-line:before{display:inline-block;width:16px;margin-right:8px;text-align:center;font-weight:700}.diff-line.added:before{content:"+"}.diff-line.removed:before{content:"-"}.chat-message{padding:8px 12px;margin:4px 8px;border-radius:8px;max-width:85%}.chat-message.user{background:var(--accent-color);color:#fff;margin-left:auto}.chat-message.codex{background:var(--bg-tertiary);color:var(--text-primary)}.chat-input-container{padding:12px;border-top:1px solid var(--border-color);background:var(--bg-secondary)}.chat-input{width:100%;padding:8px 12px;background:var(--bg-primary);border:1px solid var(--border-color);border-radius:4px;color:var(--text-primary);font-family:var(--font-family);resize:none}.chat-input:focus{outline:none;border-color:var(--accent-color)}::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:var(--bg-secondary)}::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:5px}::-webkit-scrollbar-thumb:hover{background:var(--text-secondary)}.ws-status{display:inline-block;width:8px;height:8px;border-radius:50%;margin-left:8px}.ws-status.connected{background:#0dbc79}.ws-status.disconnected{background:#cd3131}.version-info{display:flex;align-items:center;gap:8px;margin-left:auto}.version-number{font-size:11px;color:var(--text-secondary);font-weight:400}.update-badge{font-size:10px;padding:2px 6px;background:#d9534f;color:#fff;border-radius:3px;cursor:pointer}.update-badge:hover{background:#c9302c}.terminal-wrapper{flex:1;overflow:hidden;min-height:0}.left-panel{width:250px;flex-shrink:0}.middle-panel{flex:1;min-width:300px}.right-panel{width:40%;min-width:300px;max-width:60%}.section{margin-bottom:16px}.section-title{padding:8px 12px 4px;font-size:11px;font-weight:600;color:var(--text-secondary);text-transform:uppercase}.empty-state{padding:20px;text-align:center;color:var(--text-secondary);font-size:13px}.code-panel{font-family:var(--font-mono)}.code-content{padding:12px;white-space:pre-wrap;word-break:break-all}.diff-container{font-family:var(--font-mono);font-size:13px}.tab-bar{display:flex;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);overflow-x:auto;min-height:36px}.tab{display:flex;align-items:center;gap:8px;padding:8px 12px;background:var(--bg-secondary);border-right:1px solid var(--border-color);cursor:pointer;min-width:100px;max-width:200px;font-size:13px;color:var(--text-secondary)}.tab:hover{background:var(--bg-tertiary)}.tab.active{background:var(--bg-primary);color:var(--text-primary);border-bottom:2px solid var(--accent-color)}.tab-name{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tab-close{background:none;border:none;color:var(--text-secondary);font-size:16px;cursor:pointer;padding:0 4px;border-radius:3px;line-height:1}.tab-close:hover{background:#ffffff1a;color:var(--text-primary)}.context-menu{position:fixed;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:4px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px #0000004d;z-index:1000}.context-menu-item{padding:8px 16px;cursor:pointer;font-size:13px;color:var(--text-primary)}.context-menu-item:hover{background:var(--accent-color)}.file-context-menu{position:fixed;background:var(--bg-tertiary);border:1px solid var(--border-color);border-radius:4px;padding:4px 0;min-width:150px;box-shadow:0 4px 12px #0000004d;z-index:1000}.task-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--bg-secondary);border-bottom:1px solid var(--border-color);min-height:44px}.task-status{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500}.task-status.idle{color:var(--text-secondary)}.task-status.running{color:var(--accent-color)}.task-status:before{content:"";display:inline-block;width:8px;height:8px;border-radius:50%}.task-status.idle:before{background:var(--text-secondary)}.task-status.running:before{background:var(--accent-color);animation:pulse 1.5s infinite}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.task-buttons{display:flex;gap:8px}.task-btn{padding:6px 12px;border:none;border-radius:4px;font-size:12px;font-weight:500;cursor:pointer;transition:background .2s}.task-btn-start{background:var(--accent-color);color:#fff}.task-btn-start:hover{background:var(--accent-hover)}.task-btn-start:disabled{background:var(--bg-tertiary);color:var(--text-secondary);cursor:not-allowed}.task-btn-rollback{background:#d9534f;color:#fff}.task-btn-rollback:hover{background:#c9302c}.task-btn-complete{background:#5cb85c;color:#fff}.task-btn-complete:hover{background:#4cae4c}.modal-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:2000}.modal-content{background:var(--bg-secondary);border:1px solid var(--border-color);border-radius:8px;padding:20px;min-width:320px;max-width:400px;box-shadow:0 8px 32px #0006}.modal-title{font-size:16px;font-weight:600;margin-bottom:12px;color:var(--text-primary)}.modal-body{font-size:14px;color:var(--text-secondary);margin-bottom:20px;line-height:1.6}.modal-buttons{display:flex;justify-content:flex-end;gap:12px}.modal-btn{padding:8px 16px;border:none;border-radius:4px;font-size:13px;font-weight:500;cursor:pointer;transition:background .2s}.modal-btn-cancel{background:var(--bg-tertiary);color:var(--text-primary)}.modal-btn-cancel:hover{background:var(--border-color)}.modal-btn-danger{background:#d9534f;color:#fff}.modal-btn-danger:hover{background:#c9302c}
@@ -47,4 +47,4 @@ WARNING: This link could potentially be dangerous`)){const l=window.open();if(l)
47
47
  `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""}(c||(o.C0=c={})),function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"}(f||(o.C1=f={})),function(h){h.ST=`${c.ESC}\\`}(m||(o.C1_ESCAPED=m={}))},7399:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),m={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(h,p,S,E){const v={type:0,cancel:!1,key:void 0},u=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?v.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?v.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?v.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(v.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:v.key=h.ctrlKey?"\b":f.C0.DEL,h.altKey&&(v.key=f.C0.ESC+v.key);break;case 9:if(h.shiftKey){v.key=f.C0.ESC+"[Z";break}v.key=f.C0.HT,v.cancel=!0;break;case 13:v.key=h.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,v.cancel=!0;break;case 27:v.key=f.C0.ESC,h.altKey&&(v.key=f.C0.ESC+f.C0.ESC),v.cancel=!0;break;case 37:if(h.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"D",v.key===f.C0.ESC+"[1;3D"&&(v.key=f.C0.ESC+(S?"b":"[1;5D"))):v.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(h.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"C",v.key===f.C0.ESC+"[1;3C"&&(v.key=f.C0.ESC+(S?"f":"[1;5C"))):v.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(h.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"A",S||v.key!==f.C0.ESC+"[1;3A"||(v.key=f.C0.ESC+"[1;5A")):v.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(h.metaKey)break;u?(v.key=f.C0.ESC+"[1;"+(u+1)+"B",S||v.key!==f.C0.ESC+"[1;3B"||(v.key=f.C0.ESC+"[1;5B")):v.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(v.key=f.C0.ESC+"[2~");break;case 46:v.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:v.key=u?f.C0.ESC+"[1;"+(u+1)+"H":p?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:v.key=u?f.C0.ESC+"[1;"+(u+1)+"F":p?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:h.shiftKey?v.type=2:h.ctrlKey?v.key=f.C0.ESC+"[5;"+(u+1)+"~":v.key=f.C0.ESC+"[5~";break;case 34:h.shiftKey?v.type=3:h.ctrlKey?v.key=f.C0.ESC+"[6;"+(u+1)+"~":v.key=f.C0.ESC+"[6~";break;case 112:v.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:v.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:v.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:v.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:v.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:v.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:v.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:v.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:v.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:v.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:v.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:v.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(S&&!E||!h.altKey||h.metaKey)!S||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?v.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(v.key=f.C0.US),h.key==="@"&&(v.key=f.C0.NUL)):h.keyCode===65&&(v.type=1);else{const l=m[h.keyCode],s=l==null?void 0:l[h.shiftKey?1:0];if(s)v.key=f.C0.ESC+s;else if(h.keyCode>=65&&h.keyCode<=90){const n=h.ctrlKey?h.keyCode-64:h.keyCode+32;let _=String.fromCharCode(n);h.shiftKey&&(_=_.toUpperCase()),v.key=f.C0.ESC+_}else if(h.keyCode===32)v.key=f.C0.ESC+(h.ctrlKey?f.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let n=h.code.slice(3,4);h.shiftKey||(n=n.toLowerCase()),v.key=f.C0.ESC+n,v.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?v.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?v.key=f.C0.NUL:h.keyCode>=51&&h.keyCode<=55?v.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?v.key=f.C0.DEL:h.keyCode===219?v.key=f.C0.ESC:h.keyCode===220?v.key=f.C0.FS:h.keyCode===221&&(v.key=f.C0.GS)}return v}},482:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,m=c.length){let h="";for(let p=f;p<m;++p){let S=c[p];S>65535?(S-=65536,h+=String.fromCharCode(55296+(S>>10))+String.fromCharCode(S%1024+56320)):h+=String.fromCharCode(S)}return h},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const m=c.length;if(!m)return 0;let h=0,p=0;if(this._interim){const S=c.charCodeAt(p++);56320<=S&&S<=57343?f[h++]=1024*(this._interim-55296)+S-56320+65536:(f[h++]=this._interim,f[h++]=S),this._interim=0}for(let S=p;S<m;++S){const E=c.charCodeAt(S);if(55296<=E&&E<=56319){if(++S>=m)return this._interim=E,h;const v=c.charCodeAt(S);56320<=v&&v<=57343?f[h++]=1024*(E-55296)+v-56320+65536:(f[h++]=E,f[h++]=v)}else E!==65279&&(f[h++]=E)}return h}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const m=c.length;if(!m)return 0;let h,p,S,E,v=0,u=0,l=0;if(this.interim[0]){let _=!1,C=this.interim[0];C&=(224&C)==192?31:(240&C)==224?15:7;let w,k=0;for(;(w=63&this.interim[++k])&&k<4;)C<<=6,C|=w;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,x=g-k;for(;l<x;){if(l>=m)return 0;if(w=c[l++],(192&w)!=128){l--,_=!0;break}this.interim[k++]=w,C<<=6,C|=63&w}_||(g===2?C<128?l--:f[v++]=C:g===3?C<2048||C>=55296&&C<=57343||C===65279||(f[v++]=C):C<65536||C>1114111||(f[v++]=C)),this.interim.fill(0)}const s=m-4;let n=l;for(;n<m;){for(;!(!(n<s)||128&(h=c[n])||128&(p=c[n+1])||128&(S=c[n+2])||128&(E=c[n+3]));)f[v++]=h,f[v++]=p,f[v++]=S,f[v++]=E,n+=4;if(h=c[n++],h<128)f[v++]=h;else if((224&h)==192){if(n>=m)return this.interim[0]=h,v;if(p=c[n++],(192&p)!=128){n--;continue}if(u=(31&h)<<6|63&p,u<128){n--;continue}f[v++]=u}else if((240&h)==224){if(n>=m)return this.interim[0]=h,v;if(p=c[n++],(192&p)!=128){n--;continue}if(n>=m)return this.interim[0]=h,this.interim[1]=p,v;if(S=c[n++],(192&S)!=128){n--;continue}if(u=(15&h)<<12|(63&p)<<6|63&S,u<2048||u>=55296&&u<=57343||u===65279)continue;f[v++]=u}else if((248&h)==240){if(n>=m)return this.interim[0]=h,v;if(p=c[n++],(192&p)!=128){n--;continue}if(n>=m)return this.interim[0]=h,this.interim[1]=p,v;if(S=c[n++],(192&S)!=128){n--;continue}if(n>=m)return this.interim[0]=h,this.interim[1]=p,this.interim[2]=S,v;if(E=c[n++],(192&E)!=128){n--;continue}if(u=(7&h)<<18|(63&p)<<12|(63&S)<<6|63&E,u<65536||u>1114111)continue;f[v++]=u}}return v}}},225:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),m=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],h=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let S=0;S<m.length;++S)p.fill(0,m[S][0],m[S][1]+1)}}wcwidth(S){return S<32?0:S<127?1:S<65536?p[S]:function(E,v){let u,l=0,s=v.length-1;if(E<v[0][0]||E>v[s][1])return!1;for(;s>=l;)if(u=l+s>>1,E>v[u][1])l=u+1;else{if(!(E<v[u][0]))return!0;s=u-1}return!1}(S,h)?0:S>=131072&&S<=196605||S>=196608&&S<=262141?2:1}charProperties(S,E){let v=this.wcwidth(S),u=v===0&&E!==0;if(u){const l=f.UnicodeService.extractWidth(E);l===0?u=!1:l>v&&(v=l)}return f.UnicodeService.createPropertyValue(0,v,u)}}},5981:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),m=c(844);class h extends m.Disposable{constructor(S){super(),this._action=S,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(S,E){if(E!==void 0&&this._syncCalls>E)return void(this._syncCalls=0);if(this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(S,E){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=S.length,this._writeBuffer.push(S),this._callbacks.push(E)}_innerWrite(S=0,E=!0){const v=S||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],l=this._action(u,E);if(l){const n=_=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(v,_);return void l.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(n)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=h},5941:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function m(h,p){const S=h.toString(16),E=S.length<2?"0"+S:S;switch(p){case 4:return S[0];case 8:return E;case 12:return(E+E).slice(0,3);default:return E+E}}o.parseColor=function(h){if(!h)return;let p=h.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const S=c.exec(p);if(S){const E=S[1]?15:S[4]?255:S[7]?4095:65535;return[Math.round(parseInt(S[1]||S[4]||S[7]||S[10],16)/E*255),Math.round(parseInt(S[2]||S[5]||S[8]||S[11],16)/E*255),Math.round(parseInt(S[3]||S[6]||S[9]||S[12],16)/E*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),f.exec(p)&&[3,6,9,12].includes(p.length))){const S=p.length/3,E=[0,0,0];for(let v=0;v<3;++v){const u=parseInt(p.slice(S*v,S*v+S),16);E[v]=S===1?u<<4:S===2?u:S===3?u>>4:u>>8}return E}},o.toRgbString=function(h,p=16){const[S,E,v]=h;return`rgb:${m(S,p)}/${m(E,p)}/${m(v,p)}`}},5770:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),m=c(8742),h=c(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(E,v){this._handlers[E]===void 0&&(this._handlers[E]=[]);const u=this._handlers[E];return u.push(v),{dispose:()=>{const l=u.indexOf(v);l!==-1&&u.splice(l,1)}}}clearHandler(E){this._handlers[E]&&delete this._handlers[E]}setHandlerFallback(E){this._handlerFb=E}reset(){if(this._active.length)for(let E=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;E>=0;--E)this._active[E].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(E,v){if(this.reset(),this._ident=E,this._active=this._handlers[E]||p,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(E,v,u){if(this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].put(E,v,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(E,v,u))}unhook(E,v=!0){if(this._active.length){let u=!1,l=this._active.length-1,s=!1;if(this._stack.paused&&(l=this._stack.loopPosition-1,u=v,s=this._stack.fallThrough,this._stack.paused=!1),!s&&u===!1){for(;l>=0&&(u=this._active[l].unhook(E),u!==!0);l--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!1,u;l--}for(;l>=0;l--)if(u=this._active[l].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=l,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",E);this._active=p,this._ident=0}};const S=new m.Params;S.addParam(0),o.DcsHandler=class{constructor(E){this._handler=E,this._data="",this._params=S,this._hitLimit=!1}hook(E){this._params=E.length>1||E.params[0]?E.clone():S,this._data="",this._hitLimit=!1}put(E,v,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(E,v,u),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(E){let v=!1;if(this._hitLimit)v=!1;else if(E&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(u=>(this._params=S,this._data="",this._hitLimit=!1,u));return this._params=S,this._data="",this._hitLimit=!1,v}}},2015:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),m=c(8742),h=c(6242),p=c(6351);class S{constructor(l){this.table=new Uint8Array(l)}setDefault(l,s){this.table.fill(l<<4|s)}add(l,s,n,_){this.table[s<<8|l]=n<<4|_}addMany(l,s,n,_){for(let C=0;C<l.length;C++)this.table[s<<8|l[C]]=n<<4|_}}o.TransitionTable=S;const E=160;o.VT500_TRANSITION_TABLE=function(){const u=new S(4095),l=Array.apply(null,Array(256)).map((k,g)=>g),s=(k,g)=>l.slice(k,g),n=s(32,127),_=s(0,24);_.push(25),_.push.apply(_,s(28,32));const C=s(0,14);let w;for(w in u.setDefault(1,0),u.addMany(n,0,2,0),C)u.addMany([24,26,153,154],w,3,0),u.addMany(s(128,144),w,3,0),u.addMany(s(144,152),w,3,0),u.add(156,w,0,0),u.add(27,w,11,1),u.add(157,w,4,8),u.addMany([152,158,159],w,0,7),u.add(155,w,11,3),u.add(144,w,11,9);return u.addMany(_,0,3,0),u.addMany(_,1,3,1),u.add(127,1,0,1),u.addMany(_,8,0,8),u.addMany(_,3,3,3),u.add(127,3,0,3),u.addMany(_,4,3,4),u.add(127,4,0,4),u.addMany(_,6,3,6),u.addMany(_,5,3,5),u.add(127,5,0,5),u.addMany(_,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(n,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(s(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(n,7,0,7),u.addMany(_,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(s(64,127),3,7,0),u.addMany(s(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(s(48,60),4,8,4),u.addMany(s(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(s(32,64),6,0,6),u.add(127,6,0,6),u.addMany(s(64,127),6,0,0),u.addMany(s(32,48),3,9,5),u.addMany(s(32,48),5,9,5),u.addMany(s(48,64),5,0,6),u.addMany(s(64,127),5,7,0),u.addMany(s(32,48),4,9,5),u.addMany(s(32,48),1,9,2),u.addMany(s(32,48),2,9,2),u.addMany(s(48,127),2,10,0),u.addMany(s(48,80),1,10,0),u.addMany(s(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(s(96,127),1,10,0),u.add(80,1,11,9),u.addMany(_,9,0,9),u.add(127,9,0,9),u.addMany(s(28,32),9,0,9),u.addMany(s(32,48),9,9,12),u.addMany(s(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(_,11,0,11),u.addMany(s(32,128),11,0,11),u.addMany(s(28,32),11,0,11),u.addMany(_,10,0,10),u.add(127,10,0,10),u.addMany(s(28,32),10,0,10),u.addMany(s(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(s(32,48),10,9,12),u.addMany(_,12,0,12),u.add(127,12,0,12),u.addMany(s(28,32),12,0,12),u.addMany(s(32,48),12,9,12),u.addMany(s(48,64),12,0,11),u.addMany(s(64,127),12,12,13),u.addMany(s(64,127),10,12,13),u.addMany(s(64,127),9,12,13),u.addMany(_,13,13,13),u.addMany(n,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(E,0,2,0),u.add(E,8,5,8),u.add(E,6,0,6),u.add(E,11,0,11),u.add(E,13,13,13),u}();class v extends f.Disposable{constructor(l=o.VT500_TRANSITION_TABLE){super(),this._transitions=l,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new m.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(s,n,_)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,n)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new h.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(l,s=[64,126]){let n=0;if(l.prefix){if(l.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=l.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(l.intermediates){if(l.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let C=0;C<l.intermediates.length;++C){const w=l.intermediates.charCodeAt(C);if(32>w||w>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=w}}if(l.final.length!==1)throw new Error("final must be a single byte");const _=l.final.charCodeAt(0);if(s[0]>_||_>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return n<<=8,n|=_,n}identToString(l){const s=[];for(;l;)s.push(String.fromCharCode(255&l)),l>>=8;return s.reverse().join("")}setPrintHandler(l){this._printHandler=l}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(l,s){const n=this._identifier(l,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);const _=this._escHandlers[n];return _.push(s),{dispose:()=>{const C=_.indexOf(s);C!==-1&&_.splice(C,1)}}}clearEscHandler(l){this._escHandlers[this._identifier(l,[48,126])]&&delete this._escHandlers[this._identifier(l,[48,126])]}setEscHandlerFallback(l){this._escHandlerFb=l}setExecuteHandler(l,s){this._executeHandlers[l.charCodeAt(0)]=s}clearExecuteHandler(l){this._executeHandlers[l.charCodeAt(0)]&&delete this._executeHandlers[l.charCodeAt(0)]}setExecuteHandlerFallback(l){this._executeHandlerFb=l}registerCsiHandler(l,s){const n=this._identifier(l);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);const _=this._csiHandlers[n];return _.push(s),{dispose:()=>{const C=_.indexOf(s);C!==-1&&_.splice(C,1)}}}clearCsiHandler(l){this._csiHandlers[this._identifier(l)]&&delete this._csiHandlers[this._identifier(l)]}setCsiHandlerFallback(l){this._csiHandlerFb=l}registerDcsHandler(l,s){return this._dcsParser.registerHandler(this._identifier(l),s)}clearDcsHandler(l){this._dcsParser.clearHandler(this._identifier(l))}setDcsHandlerFallback(l){this._dcsParser.setHandlerFallback(l)}registerOscHandler(l,s){return this._oscParser.registerHandler(l,s)}clearOscHandler(l){this._oscParser.clearHandler(l)}setOscHandlerFallback(l){this._oscParser.setHandlerFallback(l)}setErrorHandler(l){this._errorHandler=l}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(l,s,n,_,C){this._parseStack.state=l,this._parseStack.handlers=s,this._parseStack.handlerPos=n,this._parseStack.transition=_,this._parseStack.chunkPos=C}parse(l,s,n){let _,C=0,w=0,k=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,k=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let x=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&x>-1){for(;x>=0&&(_=g[x](this._params),_!==!0);x--)if(_ instanceof Promise)return this._parseStack.handlerPos=x,_}this._parseStack.handlers=[];break;case 4:if(n===!1&&x>-1){for(;x>=0&&(_=g[x](),_!==!0);x--)if(_ instanceof Promise)return this._parseStack.handlerPos=x,_}this._parseStack.handlers=[];break;case 6:if(C=l[this._parseStack.chunkPos],_=this._dcsParser.unhook(C!==24&&C!==26,n),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(C=l[this._parseStack.chunkPos],_=this._oscParser.end(C!==24&&C!==26,n),_)return _;C===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,k=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=k;g<s;++g){switch(C=l[g],w=this._transitions.table[this.currentState<<8|(C<160?C:E)],w>>4){case 2:for(let P=g+1;;++P){if(P>=s||(C=l[P])<32||C>126&&C<E){this._printHandler(l,g,P),g=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<E){this._printHandler(l,g,P),g=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<E){this._printHandler(l,g,P),g=P-1;break}if(++P>=s||(C=l[P])<32||C>126&&C<E){this._printHandler(l,g,P),g=P-1;break}}break;case 3:this._executeHandlers[C]?this._executeHandlers[C]():this._executeHandlerFb(C),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:g,code:C,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const x=this._csiHandlers[this._collect<<8|C];let T=x?x.length-1:-1;for(;T>=0&&(_=x[T](this._params),_!==!0);T--)if(_ instanceof Promise)return this._preserveStack(3,x,T,w,g),_;T<0&&this._csiHandlerFb(this._collect<<8|C,this._params),this.precedingJoinState=0;break;case 8:do switch(C){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(C-48)}while(++g<s&&(C=l[g])>47&&C<60);g--;break;case 9:this._collect<<=8,this._collect|=C;break;case 10:const B=this._escHandlers[this._collect<<8|C];let O=B?B.length-1:-1;for(;O>=0&&(_=B[O](),_!==!0);O--)if(_ instanceof Promise)return this._preserveStack(4,B,O,w,g),_;O<0&&this._escHandlerFb(this._collect<<8|C),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|C,this._params);break;case 13:for(let P=g+1;;++P)if(P>=s||(C=l[P])===24||C===26||C===27||C>127&&C<E){this._dcsParser.put(l,g,P),g=P-1;break}break;case 14:if(_=this._dcsParser.unhook(C!==24&&C!==26),_)return this._preserveStack(6,[],0,w,g),_;C===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let P=g+1;;P++)if(P>=s||(C=l[P])<32||C>127&&C<E){this._oscParser.put(l,g,P),g=P-1;break}break;case 6:if(_=this._oscParser.end(C!==24&&C!==26),_)return this._preserveStack(5,[],0,w,g),_;C===27&&(w|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&w}}}o.EscapeSequenceParser=v},6242:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),m=c(482),h=[];o.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,S){this._handlers[p]===void 0&&(this._handlers[p]=[]);const E=this._handlers[p];return E.push(S),{dispose:()=>{const v=E.indexOf(S);v!==-1&&E.splice(v,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,S,E){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(p,S,E);else this._handlerFb(this._id,"PUT",(0,m.utf32ToString)(p,S,E))}start(){this.reset(),this._state=1}put(p,S,E){if(this._state!==3){if(this._state===1)for(;S<E;){const v=p[S++];if(v===59){this._state=2,this._start();break}if(v<48||57<v)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+v-48}this._state===2&&E-S>0&&this._put(p,S,E)}}end(p,S=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let E=!1,v=this._active.length-1,u=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,E=S,u=this._stack.fallThrough,this._stack.paused=!1),!u&&E===!1){for(;v>=0&&(E=this._active[v].end(p),E!==!0);v--)if(E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,E;v--}for(;v>=0;v--)if(E=this._active[v].end(!1),E instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,E}else this._handlerFb(this._id,"END",p);this._active=h,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,S,E){this._hitLimit||(this._data+=(0,m.utf32ToString)(p,S,E),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let S=!1;if(this._hitLimit)S=!1;else if(p&&(S=this._handler(this._data),S instanceof Promise))return S.then(E=>(this._data="",this._hitLimit=!1,E));return this._data="",this._hitLimit=!1,S}}},8742:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(h){const p=new f;if(!h.length)return p;for(let S=Array.isArray(h[0])?1:0;S<h.length;++S){const E=h[S];if(Array.isArray(E))for(let v=0;v<E.length;++v)p.addSubParam(E[v]);else p.addParam(E)}return p}constructor(h=32,p=32){if(this.maxLength=h,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new f(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let p=0;p<this.length;++p){h.push(this.params[p]);const S=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-S>0&&h.push(Array.prototype.slice.call(this._subParams,S,E))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>c?c:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>c?c:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const p=this._subParamsIdx[h]>>8,S=255&this._subParamsIdx[h];return S-p>0?this._subParams.subarray(p,S):null}getSubParamsAll(){const h={};for(let p=0;p<this.length;++p){const S=this._subParamsIdx[p]>>8,E=255&this._subParamsIdx[p];E-S>0&&(h[p]=this._subParams.slice(S,E))}return h}addDigit(h){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const S=this._digitIsSub?this._subParams:this.params,E=S[p-1];S[p-1]=~E?Math.min(10*E+h,c):h}}o.Params=f},5741:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const m={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(m),f.dispose=()=>this._wrappedAddonDispose(m),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let m=0;m<this._addons.length;m++)if(this._addons[m]===c){f=m;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),m=c(511);o.BufferApiView=class{constructor(h,p){this._buffer=h,this.type=p}init(h){return this._buffer=h,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(h){const p=this._buffer.lines.get(h);if(p)return new f.BufferLineApiView(p)}getNullCell(){return new m.CellData}}},3785:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(m){this._line=m}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(m,h){if(!(m<0||m>=this._line.length))return h?(this._line.loadCell(m,h),h):this._line.loadCell(m,new f.CellData)}translateToString(m,h,p){return this._line.translateToString(m,h,p)}}},8285:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),m=c(8460),h=c(844);class p extends h.Disposable{constructor(E){super(),this._core=E,this._onBufferChange=this.register(new m.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}o.BufferNamespaceApi=p},7975:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,m=>f(m.toArray()))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,(m,h)=>f(m,h.toArray()))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(y,o,c){var f=this&&this.__decorate||function(u,l,s,n){var _,C=arguments.length,w=C<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(_=u[k])&&(w=(C<3?_(w):C>3?_(l,s,w):_(l,s))||w);return C>3&&w&&Object.defineProperty(l,s,w),w},m=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const h=c(8460),p=c(844),S=c(5295),E=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let v=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(u){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(u.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new S.BufferSet(u,this))}resize(u,l){this.cols=u,this.rows=l,this.buffers.resize(u,l),this._onResize.fire({cols:u,rows:l})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,l=!1){const s=this.buffer;let n;n=this._cachedBlankLine,n&&n.length===this.cols&&n.getFg(0)===u.fg&&n.getBg(0)===u.bg||(n=s.getBlankLine(u,l),this._cachedBlankLine=n),n.isWrapped=l;const _=s.ybase+s.scrollTop,C=s.ybase+s.scrollBottom;if(s.scrollTop===0){const w=s.lines.isFull;C===s.lines.length-1?w?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(C+1,0,n.clone()),w?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const w=C-_+1;s.lines.shiftElements(_+1,w-1,-1),s.lines.set(C,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(u,l,s){const n=this.buffer;if(u<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else u+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);const _=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+u,n.ybase),0),_!==n.ydisp&&(l||this._onScroll.fire(n.ydisp))}};o.BufferService=v=f([m(0,E.IOptionsService)],v)},7994:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(y,o,c){var f=this&&this.__decorate||function(n,_,C,w){var k,g=arguments.length,x=g<3?_:w===null?w=Object.getOwnPropertyDescriptor(_,C):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(n,_,C,w);else for(var T=n.length-1;T>=0;T--)(k=n[T])&&(x=(g<3?k(x):g>3?k(_,C,x):k(_,C))||x);return g>3&&x&&Object.defineProperty(_,C,x),x},m=this&&this.__param||function(n,_){return function(C,w){_(C,w,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const h=c(2585),p=c(8460),S=c(844),E={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:n=>n.button!==4&&n.action===1&&(n.ctrl=!1,n.alt=!1,n.shift=!1,!0)},VT200:{events:19,restrict:n=>n.action!==32},DRAG:{events:23,restrict:n=>n.action!==32||n.button!==3},ANY:{events:31,restrict:n=>!0}};function v(n,_){let C=(n.ctrl?16:0)|(n.shift?4:0)|(n.alt?8:0);return n.button===4?(C|=64,C|=n.action):(C|=3&n.button,4&n.button&&(C|=64),8&n.button&&(C|=128),n.action===32?C|=32:n.action!==0||_||(C|=3)),C}const u=String.fromCharCode,l={DEFAULT:n=>{const _=[v(n,!1)+32,n.col+32,n.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${u(_[0])}${u(_[1])}${u(_[2])}`},SGR:n=>{const _=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.col};${n.row}${_}`},SGR_PIXELS:n=>{const _=n.action===0&&n.button!==4?"m":"M";return`\x1B[<${v(n,!0)};${n.x};${n.y}${_}`}};let s=o.CoreMouseService=class extends S.Disposable{constructor(n,_){super(),this._bufferService=n,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const C of Object.keys(E))this.addProtocol(C,E[C]);for(const C of Object.keys(l))this.addEncoding(C,l[C]);this.reset()}addProtocol(n,_){this._protocols[n]=_}addEncoding(n,_){this._encodings[n]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(n){if(!this._protocols[n])throw new Error(`unknown protocol "${n}"`);this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(n){if(!this._encodings[n])throw new Error(`unknown encoding "${n}"`);this._activeEncoding=n}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,n,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(n))return!1;const _=this._encodings[this._activeEncoding](n);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=n,!0}explainEvents(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}}_equalEvents(n,_,C){if(C){if(n.x!==_.x||n.y!==_.y)return!1}else if(n.col!==_.col||n.row!==_.row)return!1;return n.button===_.button&&n.action===_.action&&n.ctrl===_.ctrl&&n.alt===_.alt&&n.shift===_.shift}};o.CoreMouseService=s=f([m(0,h.IBufferService),m(1,h.ICoreService)],s)},6975:function(y,o,c){var f=this&&this.__decorate||function(s,n,_,C){var w,k=arguments.length,g=k<3?n:C===null?C=Object.getOwnPropertyDescriptor(n,_):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(s,n,_,C);else for(var x=s.length-1;x>=0;x--)(w=s[x])&&(g=(k<3?w(g):k>3?w(n,_,g):w(n,_))||g);return k>3&&g&&Object.defineProperty(n,_,g),g},m=this&&this.__param||function(s,n){return function(_,C){n(_,C,s)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const h=c(1439),p=c(8460),S=c(844),E=c(2585),v=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let l=o.CoreService=class extends S.Disposable{constructor(s,n,_){super(),this._bufferService=s,this._logService=n,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}reset(){this.modes=(0,h.clone)(v),this.decPrivateModes=(0,h.clone)(u)}triggerDataEvent(s,n=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;n&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),n&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(C=>C.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(n=>n.charCodeAt(0))),this._onBinary.fire(s))}};o.CoreService=l=f([m(0,E.IBufferService),m(1,E.ILogService),m(2,E.IOptionsService)],l)},9074:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),m=c(8460),h=c(844),p=c(6106);let S=0,E=0;class v extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new m.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new m.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const n=new u(s);if(n){const _=n.marker.onDispose(()=>n.dispose());n.onDispose(()=>{n&&(this._decorations.delete(n)&&this._onDecorationRemoved.fire(n),_.dispose())}),this._decorations.insert(n),this._onDecorationRegistered.fire(n)}return n}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,n,_){let C=0,w=0;for(const k of this._decorations.getKeyIterator(n))C=k.options.x??0,w=C+(k.options.width??1),s>=C&&s<w&&(!_||(k.options.layer??"bottom")===_)&&(yield k)}forEachDecorationAtCell(s,n,_,C){this._decorations.forEachByKey(n,w=>{S=w.options.x??0,E=S+(w.options.width??1),s>=S&&s<E&&(!_||(w.options.layer??"bottom")===_)&&C(w)})}}o.DecorationService=v;class u extends h.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new m.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new m.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),m=c(8343);class h{constructor(...S){this._entries=new Map;for(const[E,v]of S)this.set(E,v)}set(S,E){const v=this._entries.get(S);return this._entries.set(S,E),v}forEach(S){for(const[E,v]of this._entries.entries())S(E,v)}has(S){return this._entries.has(S)}get(S){return this._entries.get(S)}}o.ServiceCollection=h,o.InstantiationService=class{constructor(){this._services=new h,this._services.set(f.IInstantiationService,this)}setService(p,S){this._services.set(p,S)}getService(p){return this._services.get(p)}createInstance(p,...S){const E=(0,m.getServiceDependencies)(p).sort((l,s)=>l.index-s.index),v=[];for(const l of E){const s=this._services.get(l.id);if(!s)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${l.id}.`);v.push(s)}const u=E.length>0?E[0].index:S.length;if(S.length!==u)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${u+1} conflicts with ${S.length} static arguments`);return new p(...S,...v)}}},7866:function(y,o,c){var f=this&&this.__decorate||function(u,l,s,n){var _,C=arguments.length,w=C<3?l:n===null?n=Object.getOwnPropertyDescriptor(l,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(u,l,s,n);else for(var k=u.length-1;k>=0;k--)(_=u[k])&&(w=(C<3?_(w):C>3?_(l,s,w):_(l,s))||w);return C>3&&w&&Object.defineProperty(l,s,w),w},m=this&&this.__param||function(u,l){return function(s,n){l(s,n,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const h=c(844),p=c(2585),S={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let E,v=o.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),E=this}_updateLogLevel(){this._logLevel=S[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let l=0;l<u.length;l++)typeof u[l]=="function"&&(u[l]=u[l]())}_log(u,l,s){this._evalLazyOptionalParams(s),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+l,...s)}trace(u,...l){var s;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.trace.bind(this._optionsService.options.logger))??console.log,u,l)}debug(u,...l){var s;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.debug.bind(this._optionsService.options.logger))??console.log,u,l)}info(u,...l){var s;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.info.bind(this._optionsService.options.logger))??console.info,u,l)}warn(u,...l){var s;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.warn.bind(this._optionsService.options.logger))??console.warn,u,l)}error(u,...l){var s;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((s=this._optionsService.options.logger)==null?void 0:s.error.bind(this._optionsService.options.logger))??console.error,u,l)}};o.LogService=v=f([m(0,p.IOptionsService)],v),o.setTraceLogger=function(u){E=u},o.traceCall=function(u,l,s){if(typeof s.value!="function")throw new Error("not supported");const n=s.value;s.value=function(..._){if(E.logLevel!==p.LogLevelEnum.TRACE)return n.apply(this,_);E.trace(`GlyphRenderer#${n.name}(${_.map(w=>JSON.stringify(w)).join(", ")})`);const C=n.apply(this,_);return E.trace(`GlyphRenderer#${n.name} return`,C),C}}},7302:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),m=c(844),h=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class S extends m.Disposable{constructor(v){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...o.DEFAULT_OPTIONS};for(const l in v)if(l in u)try{const s=v[l];u[l]=this._sanitizeAndValidateOption(l,s)}catch(s){console.error(s)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,m.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(v,u){return this.onOptionChange(l=>{l===v&&u(this.rawOptions[v])})}onMultipleOptionChange(v,u){return this.onOptionChange(l=>{v.indexOf(l)!==-1&&u()})}_setupOptions(){const v=l=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},u=(l,s)=>{if(!(l in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);s=this._sanitizeAndValidateOption(l,s),this.rawOptions[l]!==s&&(this.rawOptions[l]=s,this._onOptionChange.fire(l))};for(const l in this.rawOptions){const s={get:v.bind(this,l),set:u.bind(this,l)};Object.defineProperty(this.options,l,s)}}_sanitizeAndValidateOption(v,u){switch(v){case"cursorStyle":if(u||(u=o.DEFAULT_OPTIONS[v]),!function(l){return l==="block"||l==="underline"||l==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${v}`);break;case"wordSeparator":u||(u=o.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=p.includes(u)?u:o.DEFAULT_OPTIONS[v];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${v} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${v} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}o.OptionsService=S},2660:function(y,o,c){var f=this&&this.__decorate||function(S,E,v,u){var l,s=arguments.length,n=s<3?E:u===null?u=Object.getOwnPropertyDescriptor(E,v):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(S,E,v,u);else for(var _=S.length-1;_>=0;_--)(l=S[_])&&(n=(s<3?l(n):s>3?l(E,v,n):l(E,v))||n);return s>3&&n&&Object.defineProperty(E,v,n),n},m=this&&this.__param||function(S,E){return function(v,u){E(v,u,S)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const h=c(2585);let p=o.OscLinkService=class{constructor(S){this._bufferService=S,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(S){const E=this._bufferService.buffer;if(S.id===void 0){const _=E.addMarker(E.ybase+E.y),C={data:S,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(C,_)),this._dataByLinkId.set(C.id,C),C.id}const v=S,u=this._getEntryIdKey(v),l=this._entriesWithId.get(u);if(l)return this.addLineToLink(l.id,E.ybase+E.y),l.id;const s=E.addMarker(E.ybase+E.y),n={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(n,s)),this._entriesWithId.set(n.key,n),this._dataByLinkId.set(n.id,n),n.id}addLineToLink(S,E){const v=this._dataByLinkId.get(S);if(v&&v.lines.every(u=>u.line!==E)){const u=this._bufferService.buffer.addMarker(E);v.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(v,u))}}getLinkData(S){var E;return(E=this._dataByLinkId.get(S))==null?void 0:E.data}_getEntryIdKey(S){return`${S.id};;${S.uri}`}_removeMarkerFromLink(S,E){const v=S.lines.indexOf(E);v!==-1&&(S.lines.splice(v,1),S.lines.length===0&&(S.data.id!==void 0&&this._entriesWithId.delete(S.key),this._dataByLinkId.delete(S.id)))}};o.OscLinkService=p=f([m(0,h.IBufferService)],p)},8343:(y,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(m){return m[f]||[]},o.createDecorator=function(m){if(o.serviceRegistry.has(m))return o.serviceRegistry.get(m);const h=function(p,S,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,u,l){u[c]===u?u[f].push({id:v,index:l}):(u[f]=[{id:v,index:l}],u[c]=u)})(h,p,E)};return h.toString=()=>m,o.serviceRegistry.set(m,h),h}},2585:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var m;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"}(m||(o.LogLevelEnum=m={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(y,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),m=c(225);class h{static extractShouldJoin(S){return(1&S)!=0}static extractWidth(S){return S>>1&3}static extractCharKind(S){return S>>3}static createPropertyValue(S,E,v=!1){return(16777215&S)<<3|(3&E)<<1|(v?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const S=new m.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(S){if(!this._providers[S])throw new Error(`unknown Unicode version "${S}"`);this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)}register(S){this._providers[S.version]=S}wcwidth(S){return this._activeProvider.wcwidth(S)}getStringCellWidth(S){let E=0,v=0;const u=S.length;for(let l=0;l<u;++l){let s=S.charCodeAt(l);if(55296<=s&&s<=56319){if(++l>=u)return E+this.wcwidth(s);const C=S.charCodeAt(l);56320<=C&&C<=57343?s=1024*(s-55296)+C-56320+65536:E+=this.wcwidth(C)}const n=this.charProperties(s,v);let _=h.extractWidth(n);h.extractShouldJoin(n)&&(_-=h.extractWidth(v)),E+=_,v=n}return E}charProperties(S,E){return this._activeProvider.charProperties(S,E)}}o.UnicodeService=h}},i={};function a(y){var o=i[y];if(o!==void 0)return o.exports;var c=i[y]={exports:{}};return r[y].call(c.exports,c,c.exports,a),c.exports}var d={};return(()=>{var y=d;Object.defineProperty(y,"__esModule",{value:!0}),y.Terminal=void 0;const o=a(9042),c=a(3236),f=a(844),m=a(5741),h=a(8285),p=a(7975),S=a(7090),E=["cols","rows"];class v extends f.Disposable{constructor(l){super(),this._core=this.register(new c.Terminal(l)),this._addonManager=this.register(new m.AddonManager),this._publicOptions={...this._core.options};const s=_=>this._core.options[_],n=(_,C)=>{this._checkReadonlyOptions(_),this._core.options[_]=C};for(const _ in this._core.options){const C={get:s.bind(this,_),set:n.bind(this,_)};Object.defineProperty(this._publicOptions,_,C)}}_checkReadonlyOptions(l){if(E.includes(l))throw new Error(`Option "${l}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new S.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const l=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(const s in l)this._publicOptions[s]=l[s]}blur(){this._core.blur()}focus(){this._core.focus()}input(l,s=!0){this._core.input(l,s)}resize(l,s){this._verifyIntegers(l,s),this._core.resize(l,s)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}attachCustomWheelEventHandler(l){this._core.attachCustomWheelEventHandler(l)}registerLinkProvider(l){return this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.registerMarker(l)}registerDecoration(l){return this._checkProposedApi(),this._verifyPositiveIntegers(l.x??0,l.width??0,l.height??0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,s,n){this._verifyIntegers(l,s,n),this._core.select(l,s,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,s){this._verifyIntegers(l,s),this._core.selectLines(l,s)}dispose(){super.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,s){this._core.write(l,s)}writeln(l,s){this._core.write(l),this._core.write(`\r
48
48
  `,s)}paste(l){this._core.paste(l)}refresh(l,s){this._verifyIntegers(l,s),this._core.refresh(l,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){this._addonManager.loadAddon(this,l)}static get strings(){return o}_verifyIntegers(...l){for(const s of l)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(const s of l)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}y.Terminal=v})(),d})())})(Ru);var uf=Ru.exports,Pu={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(a){this._terminal=a}dispose(){}fit(){const a=this.proposeDimensions();if(!a||!this._terminal||isNaN(a.cols)||isNaN(a.rows))return;const d=this._terminal._core;this._terminal.rows===a.rows&&this._terminal.cols===a.cols||(d._renderService.clear(),this._terminal.resize(a.cols,a.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const a=this._terminal._core,d=a._renderService.dimensions;if(d.css.cell.width===0||d.css.cell.height===0)return;const y=this._terminal.options.scrollback===0?0:a.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),m=window.getComputedStyle(this._terminal.element),h=c-(parseInt(m.getPropertyValue("padding-top"))+parseInt(m.getPropertyValue("padding-bottom"))),p=f-(parseInt(m.getPropertyValue("padding-right"))+parseInt(m.getPropertyValue("padding-left")))-y;return{cols:Math.max(2,Math.floor(p/d.css.cell.width)),rows:Math.max(1,Math.floor(h/d.css.cell.height))}}}})(),r})())})(Pu);var hf=Pu.exports,Au={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(y,o)=>{function c(m){try{const h=new URL(m),p=h.password&&h.username?`${h.protocol}//${h.username}:${h.password}@${h.host}`:h.username?`${h.protocol}//${h.username}@${h.host}`:`${h.protocol}//${h.host}`;return m.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(m,h,p,S={}){this._terminal=m,this._regex=h,this._handler=p,this._options=S}provideLinks(m,h){const p=f.computeLink(m,this._regex,this._terminal,this._handler);h(this._addCallbacks(p))}_addCallbacks(m){return m.map(h=>(h.leave=this._options.leave,h.hover=(p,S)=>{if(this._options.hover){const{range:E}=h;this._options.hover(p,S,E)}},h))}};class f{static computeLink(h,p,S,E){const v=new RegExp(p.source,(p.flags||"")+"g"),[u,l]=f._getWindowedLineStrings(h-1,S),s=u.join("");let n;const _=[];for(;n=v.exec(s);){const C=n[0];if(!c(C))continue;const[w,k]=f._mapStrIdx(S,l,0,n.index),[g,x]=f._mapStrIdx(S,w,k,C.length);if(w===-1||k===-1||g===-1||x===-1)continue;const T={start:{x:k+1,y:w+1},end:{x,y:g+1}};_.push({range:T,text:C,activate:E})}return _}static _getWindowedLineStrings(h,p){let S,E=h,v=h,u=0,l="";const s=[];if(S=p.buffer.active.getLine(h)){const n=S.translateToString(!0);if(S.isWrapped&&n[0]!==" "){for(u=0;(S=p.buffer.active.getLine(--E))&&u<2048&&(l=S.translateToString(!0),u+=l.length,s.push(l),S.isWrapped&&l.indexOf(" ")===-1););s.reverse()}for(s.push(n),u=0;(S=p.buffer.active.getLine(++v))&&S.isWrapped&&u<2048&&(l=S.translateToString(!0),u+=l.length,s.push(l),l.indexOf(" ")===-1););}return[s,E]}static _mapStrIdx(h,p,S,E){const v=h.buffer.active,u=v.getNullCell();let l=S;for(;E;){const s=v.getLine(p);if(!s)return[-1,-1];for(let n=l;n<s.length;++n){s.getCell(n,u);const _=u.getChars();if(u.getWidth()&&(E-=_.length||1,n===s.length-1&&_==="")){const C=v.getLine(p+1);C&&C.isWrapped&&(C.getCell(0,u),u.getWidth()===2&&(E+=1))}if(E<0)return[p,n]}p++,l=0}return[p,l]}}o.LinkComputer=f}},i={};function a(y){var o=i[y];if(o!==void 0)return o.exports;var c=i[y]={exports:{}};return r[y](c,c.exports,a),c.exports}var d={};return(()=>{var y=d;Object.defineProperty(y,"__esModule",{value:!0}),y.WebLinksAddon=void 0;const o=a(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(m,h){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}y.WebLinksAddon=class{constructor(m=f,h={}){this._handler=m,this._options=h}activate(m){this._terminal=m;const h=this._options,p=h.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,h))}dispose(){var m;(m=this._linkProvider)==null||m.dispose()}}})(),d})())})(Au);var df=Au.exports;const ff=[{label:"↑",seq:"\x1B[A"},{label:"↓",seq:"\x1B[B"},{label:"←",seq:"\x1B[D"},{label:"→",seq:"\x1B[C"},{label:"Enter",seq:"\r"},{label:"Tab",seq:" "},{label:"Esc",seq:"\x1B"},{label:"Ctrl+C",seq:""}];class _f extends mn.Component{constructor(r){super(r);ol(this,"handleVirtualKey",r=>{var i;this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r})),(i=this.terminal)==null||i.focus()});this.containerRef=mn.createRef(),this.terminal=null,this.fitAddon=null,this.ws=null,this.resizeObserver=null,this._writeBuffer="",this._writeTimer=null}componentDidMount(){this.initTerminal(),this.connectWebSocket(),this.setupResizeObserver()}componentWillUnmount(){this._writeTimer&&cancelAnimationFrame(this._writeTimer),this.ws&&(this.ws.close(),this.ws=null),this.resizeObserver&&this.resizeObserver.disconnect(),this.terminal&&this.terminal.dispose()}initTerminal(){this.terminal=new uf.Terminal({cursorBlink:!0,cursorStyle:"bar",fontSize:13,fontFamily:'Menlo, Monaco, "Courier New", monospace',theme:{background:"#0a0a0a",foreground:"#d4d4d4",cursor:"#d4d4d4",selectionBackground:"#264f78"},scrollback:3e3,allowProposedApi:!0}),this.fitAddon=new hf.FitAddon,this.terminal.loadAddon(this.fitAddon),this.terminal.loadAddon(new df.WebLinksAddon),this.terminal.open(this.containerRef.current),requestAnimationFrame(()=>{this.fitAddon&&(this.fitAddon.fit(),this.terminal.focus())}),this.terminal.onData(r=>{this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"input",data:r}))})}connectWebSocket(){const r=window.location.protocol==="https:"?"wss:":"ws:",i=window.location.hostname,a=window.location.port==="5173"?"5174":window.location.port,d=`${r}//${i}:${a}/ws/terminal`;this.ws=new WebSocket(d),this.ws.onopen=()=>{console.log("[Terminal] Connected to PTY service"),this.sendResize()},this.ws.onmessage=y=>{try{const o=JSON.parse(y.data);o.type==="data"?this._throttledWrite(o.data):o.type==="exit"?(this._flushWrite(),this.terminal&&this.terminal.write(`\r
49
49
  [Process exited with code ${o.exitCode??"?"}]\r
50
- `)):o.type==="state"&&!o.running&&this.terminal&&this._flushWrite()}catch(o){console.error("[Terminal] Parse error:",o)}},this.ws.onclose=()=>{console.log("[Terminal] Disconnected, reconnecting in 3s..."),setTimeout(()=>{this.containerRef.current&&this.connectWebSocket()},3e3)},this.ws.onerror=y=>{console.error("[Terminal] WebSocket error:",y)}}sendResize(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.terminal&&this.ws.send(JSON.stringify({type:"resize",cols:this.terminal.cols,rows:this.terminal.rows}))}setupResizeObserver(){this.containerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{if(this.fitAddon&&this.containerRef.current)try{this.fitAddon.fit(),this.sendResize()}catch{}},150)}),this.resizeObserver.observe(this.containerRef.current))}_throttledWrite(r){this._writeBuffer+=r,this._writeTimer||(this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()}))}_flushWrite(){if(this._writeTimer&&(cancelAnimationFrame(this._writeTimer),this._writeTimer=null),!this._writeBuffer||!this.terminal)return;const r=32768;if(this._writeBuffer.length<=r){const i=this._writeBuffer;this._writeBuffer="",this.terminal.write(i)}else{const i=this._writeBuffer.slice(0,r);this._writeBuffer=this._writeBuffer.slice(r),this.terminal.write(i),this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()})}}render(){return X.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"#0a0a0a"},children:[X.jsx("div",{ref:this.containerRef,style:{flex:1,overflow:"hidden",padding:"4px 8px"}}),X.jsx("div",{style:{display:"flex",gap:"4px",padding:"8px",background:"#111",borderTop:"1px solid #222",flexWrap:"wrap"},children:ff.map(r=>X.jsx("button",{onClick:()=>this.handleVirtualKey(r.seq),style:{padding:"8px 12px",border:"1px solid #333",borderRadius:"4px",background:"#1a1a1a",color:"#ccc",fontSize:"13px",fontFamily:"Menlo, Monaco, monospace",cursor:"pointer",minWidth:"44px",minHeight:"44px"},children:r.label},r.label))})]})}}function pf(){const[e,t]=ve.useState([]),[r,i]=ve.useState([]),[a,d]=ve.useState(null),[y,o]=ve.useState([]),[c,f]=ve.useState("disconnected"),[m,h]=ve.useState(null),[p,S]=ve.useState("idle"),[E,v]=ve.useState(null),[u,l]=ve.useState(!1),[s,n]=ve.useState(null),[_,C]=ve.useState(null),[w,k]=ve.useState(!1),g=ve.useRef(null);ve.useEffect(()=>(x(),O(),document.addEventListener("click",T),document.addEventListener("keydown",B),()=>{document.removeEventListener("click",T),document.removeEventListener("keydown",B),g.current&&g.current.close()}),[]);async function x(){try{const R=window.location.port==="5173"?"5174":window.location.port,L=window.location.protocol==="https:"?"https:":"http:",F=await fetch(`${L}//${window.location.hostname}:${R}/api/status`);if(F.ok){const I=await F.json();n(I.version),C(I.latestVersion),k(I.hasUpdate)}}catch(R){console.error("Failed to fetch status:",R)}}function T(){h(null)}function B(R){if(R.ctrlKey&&R.shiftKey&&R.key==="Enter"){R.preventDefault(),N();return}if(p==="running"&&R.ctrlKey&&R.key==="Enter"){R.preventDefault(),U();return}if(p==="running"&&R.ctrlKey&&R.key==="z"){R.preventDefault(),l(!0);return}a&&(R.ctrlKey&&R.key==="w"?(R.preventDefault(),D(a)):R.ctrlKey&&R.key==="Tab"&&(R.preventDefault(),R.shiftKey?$():z()))}function O(){const R=window.location.protocol==="https:"?"wss:":"ws:",L=window.location.hostname,F=window.location.port==="5173"?"5174":window.location.port,I=`${R}//${L}:${F}/ws`,K=new WebSocket(I);K.onopen=()=>{console.log("Connected to Codex Viewer"),f("connected"),K.send(JSON.stringify({type:"get_task_status"}))},K.onclose=()=>{console.log("Disconnected from Codex Viewer"),f("disconnected"),setTimeout(O,3e3)},K.onerror=V=>{console.error("WebSocket error:",V)},K.onmessage=V=>{try{const Z=JSON.parse(V.data);P(Z)}catch(Z){console.error("Failed to parse message:",Z)}},g.current=K}function P(R){switch(R.type){case"file_change":H(R.data);break;case"file_tree":t(R.data);break;case"file_content":q(R.data);break;case"task_status":S(R.data.status),v(R.data.taskId);break;case"task_started":S("running"),v(R.data.taskId),alert(`任务已创建,快照包含 ${R.data.filesCount} 个文件`);break;case"task_rolled_back":S("idle"),v(null),i([]),d(null),alert(`已撤回 ${R.data.restoredCount} 个文件`),l(!1);break;case"task_completed":S("idle"),v(null),alert("任务已完成,修改已保留");break;case"connected":console.log("Server confirmed connection");break;default:console.log("Unknown message type:",R.type)}}function N(){var R;p!=="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"start_task"}))}function W(){var R;p==="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"rollback_task"}))}function U(){var R;p==="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"complete_task"}))}function q(R){const L=R.path.split(/[/\\]/).pop(),F=r.find(I=>I.path===R.path);if(F)d(F.id);else{const I={id:Date.now().toString(),path:R.path,name:L,content:R.content,diff:R.diff||null,isDiff:!!R.diff};i(K=>[...K,I]),d(I.id)}}function H(R){R.path.split(/[/\\]/).pop();const L=r.find(F=>F.path===R.path);L&&(i(F=>F.map(I=>I.path===R.path?{...I,content:R.newContent,diff:R.diff,isDiff:!0}:I)),a===L.id&&d(L.id)),o(F=>{const I=F.filter(K=>K.path!==R.path);return[{path:R.path,time:Date.now(),diff:R.diff},...I].slice(0,10)})}function b(R){var L;((L=g.current)==null?void 0:L.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"open_file",data:R}))}function D(R){const L=r.findIndex(I=>I.id===R),F=r.filter(I=>I.id!==R);r.length===1?(i([]),d(null)):(a===R&&(L>=F.length?d(F[F.length-1].id):d(F[L].id)),i(F))}function A(R){const L=r.find(F=>F.id===R);i(L?[L]:[]),d(R)}function M(){i([]),d(null)}function z(){if(r.length<=1)return;const L=(r.findIndex(F=>F.id===a)+1)%r.length;d(r[L].id)}function $(){if(r.length<=1)return;const L=(r.findIndex(F=>F.id===a)-1+r.length)%r.length;d(r[L].id)}function Y(R,L){R.preventDefault(),h({x:R.clientX,y:R.clientY,tabId:L})}const Q=r.find(R=>R.id===a);return X.jsxs("div",{className:"app-container",children:[X.jsx(Sf,{files:e,recentChanges:y,activeFile:(Q==null?void 0:Q.path)||null,onFileClick:b}),X.jsxs("div",{className:"panel middle-panel",children:[X.jsx(vf,{taskStatus:p,onStartTask:N,onRollback:()=>l(!0),onComplete:U}),X.jsx(gf,{tabs:r,activeTabId:a,onTabClick:d,onTabClose:D,onContextMenu:Y}),X.jsx("div",{className:"panel-content code-panel",children:Q?Q.isDiff&&Q.diff?X.jsx("div",{className:"diff-container",children:Q.diff.map((R,L)=>X.jsx("div",{className:`diff-line ${R.added?"added":R.removed?"removed":""}`,children:R.content},L))}):X.jsx("pre",{className:"code-content",children:Q.content}):X.jsx("div",{className:"empty-state",children:"双击左侧文件查看内容..."})}),u&&X.jsx("div",{className:"modal-overlay",onClick:()=>l(!1),children:X.jsxs("div",{className:"modal-content",onClick:R=>R.stopPropagation(),children:[X.jsx("div",{className:"modal-title",children:"确认撤回"}),X.jsx("div",{className:"modal-body",children:"确定要撤回所有修改吗?此操作将把项目恢复到任务开始前的状态,且无法撤销。"}),X.jsxs("div",{className:"modal-buttons",children:[X.jsx("button",{className:"modal-btn modal-btn-cancel",onClick:()=>l(!1),children:"取消"}),X.jsx("button",{className:"modal-btn modal-btn-danger",onClick:W,children:"确认撤回"})]})]})})]}),m&&X.jsx(mf,{x:m.x,y:m.y,onClose:()=>h(null),onCloseTab:()=>{D(m.tabId),h(null)},onCloseOtherTabs:()=>{A(m.tabId),h(null)},onCloseAllTabs:()=>{M(),h(null)}}),X.jsxs("div",{className:"panel right-panel",children:[X.jsxs("div",{className:"panel-header",children:[X.jsx("span",{children:"Codex 终端"}),X.jsx("span",{className:`ws-status ${c}`}),X.jsxs("span",{className:"version-info",children:[s&&X.jsxs("span",{className:"version-number",children:["v",s]}),w&&_&&X.jsx("span",{className:"update-badge",title:`可用版本: ${_}`,children:"更新可用"})]})]}),X.jsx("div",{className:"terminal-wrapper",children:X.jsx(_f,{})})]})]})}function vf({taskStatus:e,onStartTask:t,onRollback:r,onComplete:i}){return X.jsxs("div",{className:"task-bar",children:[X.jsx("div",{className:`task-status ${e}`,children:e==="idle"?"空闲":"任务进行中"}),X.jsx("div",{className:"task-buttons",children:e==="idle"?X.jsx("button",{className:"task-btn task-btn-start",onClick:t,title:"Ctrl+Shift+Enter",children:"开始任务"}):X.jsxs(X.Fragment,{children:[X.jsx("button",{className:"task-btn task-btn-rollback",onClick:r,title:"Ctrl+Z",children:"撤回"}),X.jsx("button",{className:"task-btn task-btn-complete",onClick:i,title:"Ctrl+Enter",children:"完成"})]})})]})}function gf({tabs:e,activeTabId:t,onTabClick:r,onTabClose:i,onContextMenu:a}){return X.jsx("div",{className:"tab-bar",children:e.map(d=>X.jsxs("div",{className:`tab ${t===d.id?"active":""}`,onClick:()=>r(d.id),onContextMenu:y=>a(y,d.id),children:[X.jsx("span",{className:"tab-name",children:d.name}),X.jsx("button",{className:"tab-close",onClick:y=>{y.stopPropagation(),i(d.id)},children:"×"})]},d.id))})}function mf({x:e,y:t,onClose:r,onCloseTab:i,onCloseOtherTabs:a,onCloseAllTabs:d}){return X.jsxs("div",{className:"context-menu",style:{left:e,top:t},onClick:y=>y.stopPropagation(),children:[X.jsx("div",{className:"context-menu-item",onClick:i,children:"关闭标签页"}),X.jsx("div",{className:"context-menu-item",onClick:a,children:"关闭其他标签页"}),X.jsx("div",{className:"context-menu-item",onClick:d,children:"关闭全部标签页"})]})}function Sf({files:e,recentChanges:t,activeFile:r,onFileClick:i}){const[a,d]=ve.useState({}),[y,o]=ve.useState(null);function c(p){d(S=>({...S,[p]:!S[p]}))}function f(p,S){p.preventDefault(),p.stopPropagation(),o({x:p.clientX,y:p.clientY,item:S})}function m(){var p;(p=y==null?void 0:y.item)!=null&&p.path&&navigator.clipboard.writeText(y.item.path).then(()=>{console.log("Path copied:",y.item.path)}).catch(S=>{console.error("Failed to copy path:",S)}),o(null)}function h(p,S=0){return p.map((E,v)=>{const u=E.type==="directory",l=a[E.path],s=8+S*16;return X.jsxs(mn.Fragment,{children:[X.jsxs("div",{className:`file-item ${r===E.path?"active":""}`,onClick:()=>u?c(E.path):null,onDoubleClick:()=>!u&&i(E.path),onContextMenu:n=>f(n,E),style:{paddingLeft:`${s}px`},children:[X.jsx("span",{className:"file-icon",children:u?l?"📂":"📁":yf(E.type)}),X.jsx("span",{className:"file-name",children:E.name})]}),u&&l&&E.children&&h(E.children,S+1)]},E.path)})}return X.jsxs("div",{className:"panel left-panel",onClick:()=>o(null),children:[X.jsx("div",{className:"panel-header",children:"文件浏览器"}),X.jsxs("div",{className:"panel-content",children:[t.length>0&&X.jsxs("div",{className:"section",children:[X.jsx("div",{className:"section-title",children:"最近修改"}),t.map((p,S)=>X.jsxs("div",{className:`file-item ${r===p.path?"active":""}`,onDoubleClick:()=>i(p.path),children:[X.jsx("span",{className:"file-icon",children:"📝"}),X.jsx("span",{className:"file-name",children:p.path.split(/[/\\]/).pop()})]},S))]}),X.jsxs("div",{className:"section",children:[X.jsx("div",{className:"section-title",children:"项目文件"}),e.length===0?X.jsx("div",{className:"empty-state",children:t.length===0?"等待文件变化...":"暂无其他文件"}):h(e)]})]}),y&&X.jsx("div",{className:"file-context-menu",style:{left:y.x,top:y.y},onClick:p=>p.stopPropagation(),children:X.jsx("div",{className:"context-menu-item",onClick:m,children:"复制文件路径"})})]})}function yf(e){switch(e){case"directory":return"📁";case"file":return"📄";default:return"📄"}}const Cf=document.getElementById("root"),wf=Du(Cf);wf.render(X.jsx(pf,{}));
50
+ `)):o.type==="state"&&!o.running&&this.terminal&&this._flushWrite()}catch(o){console.error("[Terminal] Parse error:",o)}},this.ws.onclose=()=>{console.log("[Terminal] Disconnected, reconnecting in 3s..."),setTimeout(()=>{this.containerRef.current&&this.connectWebSocket()},3e3)},this.ws.onerror=y=>{console.error("[Terminal] WebSocket error:",y)}}sendResize(){this.ws&&this.ws.readyState===WebSocket.OPEN&&this.terminal&&this.ws.send(JSON.stringify({type:"resize",cols:this.terminal.cols,rows:this.terminal.rows}))}setupResizeObserver(){this.containerRef.current&&(this.resizeObserver=new ResizeObserver(()=>{this._resizeTimer&&clearTimeout(this._resizeTimer),this._resizeTimer=setTimeout(()=>{if(this.fitAddon&&this.containerRef.current)try{this.fitAddon.fit(),this.sendResize()}catch{}},150)}),this.resizeObserver.observe(this.containerRef.current))}_throttledWrite(r){this._writeBuffer+=r,this._writeTimer||(this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()}))}_flushWrite(){if(this._writeTimer&&(cancelAnimationFrame(this._writeTimer),this._writeTimer=null),!this._writeBuffer||!this.terminal)return;const r=32768;if(this._writeBuffer.length<=r){const i=this._writeBuffer;this._writeBuffer="",this.terminal.write(i)}else{const i=this._writeBuffer.slice(0,r);this._writeBuffer=this._writeBuffer.slice(r),this.terminal.write(i),this._writeTimer=requestAnimationFrame(()=>{this._flushWrite()})}}render(){return X.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",background:"#0a0a0a"},children:[X.jsx("div",{ref:this.containerRef,style:{flex:1,overflow:"hidden",padding:"4px 8px"}}),X.jsx("div",{style:{display:"flex",gap:"4px",padding:"8px",background:"#111",borderTop:"1px solid #222",flexWrap:"wrap"},children:ff.map(r=>X.jsx("button",{onClick:()=>this.handleVirtualKey(r.seq),style:{padding:"8px 12px",border:"1px solid #333",borderRadius:"4px",background:"#1a1a1a",color:"#ccc",fontSize:"13px",fontFamily:"Menlo, Monaco, monospace",cursor:"pointer",minWidth:"44px",minHeight:"44px"},children:r.label},r.label))})]})}}function pf(){const[e,t]=ve.useState([]),[r,i]=ve.useState([]),[a,d]=ve.useState(null),[y,o]=ve.useState([]),[c,f]=ve.useState("disconnected"),[m,h]=ve.useState(null),[p,S]=ve.useState("idle"),[E,v]=ve.useState(null),[u,l]=ve.useState(!1),[s,n]=ve.useState(null),[_,C]=ve.useState(null),[w,k]=ve.useState(!1),g=ve.useRef(null);ve.useEffect(()=>(x(),O(),document.addEventListener("click",T),document.addEventListener("keydown",B),()=>{document.removeEventListener("click",T),document.removeEventListener("keydown",B),g.current&&g.current.close()}),[]);async function x(){try{const R=window.location.port==="5173"?"5174":window.location.port,L=window.location.protocol==="https:"?"https:":"http:",F=await fetch(`${L}//${window.location.hostname}:${R}/api/status`);if(F.ok){const I=await F.json();n(I.version),C(I.latestVersion),k(I.hasUpdate)}}catch(R){console.error("Failed to fetch status:",R)}}function T(){h(null)}function B(R){if(R.ctrlKey&&R.shiftKey&&R.key==="Enter"){R.preventDefault(),N();return}if(p==="running"&&R.ctrlKey&&R.key==="Enter"){R.preventDefault(),U();return}if(p==="running"&&R.ctrlKey&&R.key==="z"){R.preventDefault(),l(!0);return}a&&(R.ctrlKey&&R.key==="w"?(R.preventDefault(),D(a)):R.ctrlKey&&R.key==="Tab"&&(R.preventDefault(),R.shiftKey?$():z()))}function O(){const R=window.location.protocol==="https:"?"wss:":"ws:",L=window.location.hostname,F=window.location.port==="5173"?"5174":window.location.port,I=`${R}//${L}:${F}/ws`,K=new WebSocket(I);K.onopen=()=>{console.log("Connected to Codex Viewer"),f("connected"),K.send(JSON.stringify({type:"get_task_status"}))},K.onclose=()=>{console.log("Disconnected from Codex Viewer"),f("disconnected"),setTimeout(O,3e3)},K.onerror=V=>{console.error("WebSocket error:",V)},K.onmessage=V=>{try{const Z=JSON.parse(V.data);P(Z)}catch(Z){console.error("Failed to parse message:",Z)}},g.current=K}function P(R){switch(R.type){case"file_change":H(R.data);break;case"file_tree":t(R.data);break;case"file_content":q(R.data);break;case"task_status":S(R.data.status),v(R.data.taskId);break;case"task_started":S("running"),v(R.data.taskId),alert(`任务已创建,快照包含 ${R.data.filesCount} 个文件`);break;case"task_rolled_back":S("idle"),v(null),i([]),d(null),alert(`已撤回 ${R.data.restoredCount} 个文件`),l(!1);break;case"task_completed":S("idle"),v(null),alert("任务已完成,修改已保留");break;case"connected":console.log("Server confirmed connection");break;default:console.log("Unknown message type:",R.type)}}function N(){var R;p!=="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"start_task"}))}function W(){var R;p==="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"rollback_task"}))}function U(){var R;p==="running"&&((R=g.current)==null?void 0:R.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"complete_task"}))}function q(R){const L=R.path.split(/[/\\]/).pop(),F=r.find(I=>I.path===R.path);if(F)d(F.id);else{const I={id:Date.now().toString(),path:R.path,name:L,content:R.content,diff:R.diff||null,isDiff:!!R.diff};i(K=>[...K,I]),d(I.id)}}function H(R){R.path.split(/[/\\]/).pop();const L=r.find(F=>F.path===R.path);L&&(i(F=>F.map(I=>I.path===R.path?{...I,content:R.newContent,diff:R.diff,isDiff:!0}:I)),a===L.id&&d(L.id)),o(F=>{const I=F.filter(K=>K.path!==R.path);return[{path:R.path,time:Date.now(),diff:R.diff},...I].slice(0,10)})}function b(R){var L;((L=g.current)==null?void 0:L.readyState)===WebSocket.OPEN&&g.current.send(JSON.stringify({type:"open_file",data:R}))}function D(R){const L=r.findIndex(I=>I.id===R),F=r.filter(I=>I.id!==R);r.length===1?(i([]),d(null)):(a===R&&(L>=F.length?d(F[F.length-1].id):d(F[L].id)),i(F))}function A(R){const L=r.find(F=>F.id===R);i(L?[L]:[]),d(R)}function M(){i([]),d(null)}function z(){if(r.length<=1)return;const L=(r.findIndex(F=>F.id===a)+1)%r.length;d(r[L].id)}function $(){if(r.length<=1)return;const L=(r.findIndex(F=>F.id===a)-1+r.length)%r.length;d(r[L].id)}function Y(R,L){R.preventDefault(),h({x:R.clientX,y:R.clientY,tabId:L})}const Q=r.find(R=>R.id===a);return X.jsxs("div",{className:"app-container",children:[X.jsx(Sf,{files:e,recentChanges:y,activeFile:(Q==null?void 0:Q.path)||null,onFileClick:b}),X.jsxs("div",{className:"panel middle-panel",children:[X.jsx(vf,{taskStatus:p,onStartTask:N,onRollback:()=>l(!0),onComplete:U}),X.jsx(gf,{tabs:r,activeTabId:a,onTabClick:d,onTabClose:D,onContextMenu:Y}),X.jsx("div",{className:"panel-content code-panel",children:Q?Q.isDiff&&Q.diff?X.jsx("div",{className:"diff-container",children:Q.diff.map((R,L)=>X.jsx("div",{className:`diff-line ${R.added?"added":R.removed?"removed":""}`,children:R.content},L))}):X.jsx("pre",{className:"code-content",children:Q.content}):X.jsx("div",{className:"empty-state",children:"双击左侧文件查看内容..."})}),u&&X.jsx("div",{className:"modal-overlay",onClick:()=>l(!1),children:X.jsxs("div",{className:"modal-content",onClick:R=>R.stopPropagation(),children:[X.jsx("div",{className:"modal-title",children:"确认撤回"}),X.jsx("div",{className:"modal-body",children:"确定要撤回所有修改吗?此操作将把项目恢复到任务开始前的状态,且无法撤销。"}),X.jsxs("div",{className:"modal-buttons",children:[X.jsx("button",{className:"modal-btn modal-btn-cancel",onClick:()=>l(!1),children:"取消"}),X.jsx("button",{className:"modal-btn modal-btn-danger",onClick:W,children:"确认撤回"})]})]})})]}),m&&X.jsx(mf,{x:m.x,y:m.y,onClose:()=>h(null),onCloseTab:()=>{D(m.tabId),h(null)},onCloseOtherTabs:()=>{A(m.tabId),h(null)},onCloseAllTabs:()=>{M(),h(null)}}),X.jsxs("div",{className:"panel right-panel",children:[X.jsxs("div",{className:"panel-header",children:[X.jsx("span",{children:"Codex 终端"}),X.jsx("span",{className:`ws-status ${c}`}),X.jsxs("span",{className:"version-info",children:[s&&X.jsxs("span",{className:"version-number",children:["v",s]}),w&&_&&X.jsx("span",{className:"update-badge",title:`可用版本: ${_}`,children:"更新可用"})]})]}),X.jsx("div",{className:"terminal-wrapper",children:X.jsx(_f,{})})]})]})}function vf({taskStatus:e,onStartTask:t,onRollback:r,onComplete:i}){return X.jsxs("div",{className:"task-bar",children:[X.jsx("div",{className:`task-status ${e}`,children:e==="idle"?"空闲":"任务进行中"}),X.jsx("div",{className:"task-buttons",children:e==="idle"?X.jsx("button",{className:"task-btn task-btn-start",disabled:!0,title:"快照功能暂时禁用",children:"开始任务"}):X.jsxs(X.Fragment,{children:[X.jsx("button",{className:"task-btn task-btn-rollback",onClick:r,title:"Ctrl+Z",children:"撤回"}),X.jsx("button",{className:"task-btn task-btn-complete",onClick:i,title:"Ctrl+Enter",children:"完成"})]})})]})}function gf({tabs:e,activeTabId:t,onTabClick:r,onTabClose:i,onContextMenu:a}){return X.jsx("div",{className:"tab-bar",children:e.map(d=>X.jsxs("div",{className:`tab ${t===d.id?"active":""}`,onClick:()=>r(d.id),onContextMenu:y=>a(y,d.id),children:[X.jsx("span",{className:"tab-name",children:d.name}),X.jsx("button",{className:"tab-close",onClick:y=>{y.stopPropagation(),i(d.id)},children:"×"})]},d.id))})}function mf({x:e,y:t,onClose:r,onCloseTab:i,onCloseOtherTabs:a,onCloseAllTabs:d}){return X.jsxs("div",{className:"context-menu",style:{left:e,top:t},onClick:y=>y.stopPropagation(),children:[X.jsx("div",{className:"context-menu-item",onClick:i,children:"关闭标签页"}),X.jsx("div",{className:"context-menu-item",onClick:a,children:"关闭其他标签页"}),X.jsx("div",{className:"context-menu-item",onClick:d,children:"关闭全部标签页"})]})}function Sf({files:e,recentChanges:t,activeFile:r,onFileClick:i}){const[a,d]=ve.useState({}),[y,o]=ve.useState(null);function c(p){d(S=>({...S,[p]:!S[p]}))}function f(p,S){p.preventDefault(),p.stopPropagation(),o({x:p.clientX,y:p.clientY,item:S})}function m(){var p;(p=y==null?void 0:y.item)!=null&&p.path&&navigator.clipboard.writeText(y.item.path).then(()=>{console.log("Path copied:",y.item.path)}).catch(S=>{console.error("Failed to copy path:",S)}),o(null)}function h(p,S=0){return p.map((E,v)=>{const u=E.type==="directory",l=a[E.path],s=8+S*16;return X.jsxs(mn.Fragment,{children:[X.jsxs("div",{className:`file-item ${r===E.path?"active":""}`,onClick:()=>u?c(E.path):null,onDoubleClick:()=>!u&&i(E.path),onContextMenu:n=>f(n,E),style:{paddingLeft:`${s}px`},children:[X.jsx("span",{className:"file-icon",children:u?l?"📂":"📁":yf(E.type)}),X.jsx("span",{className:"file-name",children:E.name})]}),u&&l&&E.children&&h(E.children,S+1)]},E.path)})}return X.jsxs("div",{className:"panel left-panel",onClick:()=>o(null),children:[X.jsx("div",{className:"panel-header",children:"文件浏览器"}),X.jsxs("div",{className:"panel-content",children:[t.length>0&&X.jsxs("div",{className:"section",children:[X.jsx("div",{className:"section-title",children:"最近修改"}),t.map((p,S)=>X.jsxs("div",{className:`file-item ${r===p.path?"active":""}`,onDoubleClick:()=>i(p.path),children:[X.jsx("span",{className:"file-icon",children:"📝"}),X.jsx("span",{className:"file-name",children:p.path.split(/[/\\]/).pop()})]},S))]}),X.jsxs("div",{className:"section",children:[X.jsx("div",{className:"section-title",children:"项目文件"}),e.length===0?X.jsx("div",{className:"empty-state",children:t.length===0?"等待文件变化...":"暂无其他文件"}):h(e)]})]}),y&&X.jsx("div",{className:"file-context-menu",style:{left:y.x,top:y.y},onClick:p=>p.stopPropagation(),children:X.jsx("div",{className:"context-menu-item",onClick:m,children:"复制文件路径"})})]})}function yf(e){switch(e){case"directory":return"📁";case"file":return"📄";default:return"📄"}}const Cf=document.getElementById("root"),wf=Du(Cf);wf.render(X.jsx(pf,{}));
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Codex Viewer</title>
7
- <script type="module" crossorigin src="./assets/main-Bw9MPROO.js"></script>
8
- <link rel="stylesheet" crossorigin href="./assets/main-BfQHBPtk.css">
7
+ <script type="module" crossorigin src="./assets/main-CpieJyFR.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./assets/main-BKzjViIb.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -20,7 +20,7 @@ const IGNORED_DIRS = [
20
20
  ".venv",
21
21
  ".env",
22
22
  ".DS_Store",
23
- ".codex-viewer"
23
+ ".codex-lens"
24
24
  ];
25
25
  const IGNORED_FILES = [
26
26
  ".DS_Store",
package/dist/watcher.js CHANGED
@@ -139,7 +139,14 @@ class FileWatcher {
139
139
  }
140
140
  handleChange(filePath, eventType) {
141
141
  try {
142
- if (!this.isCodeFile(filePath)) return;
142
+ const isCode = this.isCodeFile(filePath);
143
+ if (eventType === "add") {
144
+ logger.info(`File added: ${filePath}`);
145
+ this.emitFileTreeUpdate();
146
+ } else {
147
+ logger.info(`File changed: ${filePath}`);
148
+ }
149
+ if (!isCode) return;
143
150
  const stats = statSync(filePath);
144
151
  if (stats.size > 5 * 1024 * 1024) {
145
152
  logger.warn(`Skipping large file: ${filePath}`);
@@ -149,12 +156,10 @@ class FileWatcher {
149
156
  const oldContent = this.fileContents.get(filePath) || "";
150
157
  this.fileContents.set(filePath, newContent);
151
158
  if (eventType === "add") {
152
- logger.info(`File added: ${filePath}`);
153
159
  const lines = newContent.split("\n");
154
160
  const diff = lines.map((line) => ({ content: line, added: true }));
155
161
  this.emitFileChange(filePath, newContent, diff);
156
162
  } else {
157
- logger.info(`File changed: ${filePath}`);
158
163
  const changes = diffLines(oldContent, newContent);
159
164
  const diff = [];
160
165
  for (const change of changes) {
@@ -183,6 +188,7 @@ class FileWatcher {
183
188
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
184
189
  }
185
190
  });
191
+ this.emitFileTreeUpdate();
186
192
  }
187
193
  emitFileChange(filePath, newContent, diff) {
188
194
  this.wsEmitter({
@@ -197,6 +203,13 @@ class FileWatcher {
197
203
  }
198
204
  });
199
205
  }
206
+ emitFileTreeUpdate() {
207
+ const fileTree = scanDirectory(this.projectPath);
208
+ this.wsEmitter({
209
+ type: "file_tree",
210
+ data: fileTree
211
+ });
212
+ }
200
213
  isCodeFile(filePath) {
201
214
  const ext = extname(filePath).toLowerCase();
202
215
  return CODE_EXTENSIONS.has(ext);
@@ -208,7 +221,9 @@ class FileWatcher {
208
221
  return { error: "File too large" };
209
222
  }
210
223
  const content = readFileSync(filePath, "utf-8");
211
- return { content, path: filePath };
224
+ const lines = content.split("\n");
225
+ const diff = lines.map((line) => ({ content: line, added: true }));
226
+ return { content, path: filePath, diff };
212
227
  } catch (error) {
213
228
  return { error: error.message };
214
229
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-lens",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "A visualization tool for Codex that monitors API requests and file system changes with task snapshot rollback",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/aggregator.js CHANGED
@@ -223,7 +223,8 @@ class Aggregator {
223
223
  data: {
224
224
  path: result.path,
225
225
  content: result.content,
226
- extension
226
+ extension,
227
+ diff: result.diff || null
227
228
  }
228
229
  }));
229
230
  }
@@ -392,7 +392,7 @@ function TaskBar({ taskStatus, onStartTask, onRollback, onComplete }) {
392
392
  </div>
393
393
  <div className="task-buttons">
394
394
  {taskStatus === 'idle' ? (
395
- <button className="task-btn task-btn-start" onClick={onStartTask} title="Ctrl+Shift+Enter">
395
+ <button className="task-btn task-btn-start" disabled title="快照功能暂时禁用">
396
396
  开始任务
397
397
  </button>
398
398
  ) : (
package/src/global.css CHANGED
@@ -442,6 +442,12 @@ body {
442
442
  background: var(--accent-hover);
443
443
  }
444
444
 
445
+ .task-btn-start:disabled {
446
+ background: var(--bg-tertiary);
447
+ color: var(--text-secondary);
448
+ cursor: not-allowed;
449
+ }
450
+
445
451
  .task-btn-rollback {
446
452
  background: #d9534f;
447
453
  color: white;
@@ -2,7 +2,7 @@ import { appendFileSync, existsSync, mkdirSync, readFileSync, readdirSync, statS
2
2
  import { dirname, join } from 'path';
3
3
  import { homedir } from 'os';
4
4
 
5
- const DEFAULT_LOG_DIR = join(homedir(), '.codex-viewer');
5
+ const DEFAULT_LOG_DIR = join(homedir(), '.codex-lens');
6
6
 
7
7
  export class LogManager {
8
8
  constructor(logDir = DEFAULT_LOG_DIR) {
@@ -8,7 +8,7 @@ const IGNORED_DIRS = [
8
8
  'node_modules', '.git', '.svn', '.hg',
9
9
  '.idea', '.vscode', 'dist', 'build', '.cache',
10
10
  '__pycache__', '.pytest_cache', '.next', '.nuxt',
11
- '.venv', '.env', '.DS_Store', '.codex-viewer'
11
+ '.venv', '.env', '.DS_Store', '.codex-lens'
12
12
  ];
13
13
 
14
14
  const IGNORED_FILES = [
package/src/watcher.js CHANGED
@@ -118,7 +118,16 @@ class FileWatcher {
118
118
 
119
119
  handleChange(filePath, eventType) {
120
120
  try {
121
- if (!this.isCodeFile(filePath)) return;
121
+ const isCode = this.isCodeFile(filePath);
122
+
123
+ if (eventType === 'add') {
124
+ logger.info(`File added: ${filePath}`);
125
+ this.emitFileTreeUpdate();
126
+ } else {
127
+ logger.info(`File changed: ${filePath}`);
128
+ }
129
+
130
+ if (!isCode) return;
122
131
 
123
132
  const stats = statSync(filePath);
124
133
  if (stats.size > 5 * 1024 * 1024) {
@@ -132,12 +141,10 @@ class FileWatcher {
132
141
  this.fileContents.set(filePath, newContent);
133
142
 
134
143
  if (eventType === 'add') {
135
- logger.info(`File added: ${filePath}`);
136
144
  const lines = newContent.split('\n');
137
145
  const diff = lines.map(line => ({ content: line, added: true }));
138
146
  this.emitFileChange(filePath, newContent, diff);
139
147
  } else {
140
- logger.info(`File changed: ${filePath}`);
141
148
  const changes = diffLines(oldContent, newContent);
142
149
  const diff = [];
143
150
 
@@ -169,6 +176,7 @@ class FileWatcher {
169
176
  timestamp: new Date().toISOString()
170
177
  }
171
178
  });
179
+ this.emitFileTreeUpdate();
172
180
  }
173
181
 
174
182
  emitFileChange(filePath, newContent, diff) {
@@ -185,6 +193,14 @@ class FileWatcher {
185
193
  });
186
194
  }
187
195
 
196
+ emitFileTreeUpdate() {
197
+ const fileTree = scanDirectory(this.projectPath);
198
+ this.wsEmitter({
199
+ type: 'file_tree',
200
+ data: fileTree
201
+ });
202
+ }
203
+
188
204
  isCodeFile(filePath) {
189
205
  const ext = extname(filePath).toLowerCase();
190
206
  return CODE_EXTENSIONS.has(ext);
@@ -197,7 +213,9 @@ class FileWatcher {
197
213
  return { error: 'File too large' };
198
214
  }
199
215
  const content = readFileSync(filePath, 'utf-8');
200
- return { content, path: filePath };
216
+ const lines = content.split('\n');
217
+ const diff = lines.map(line => ({ content: line, added: true }));
218
+ return { content, path: filePath, diff };
201
219
  } catch (error) {
202
220
  return { error: error.message };
203
221
  }