@moberg_hr/work-tree 2.20.0 → 2.20.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/{add-repo-KA723SUN.js → add-repo-VNG3JVRR.js} +2 -2
  2. package/dist/bin.js +1 -1
  3. package/dist/{chunk-MYMMOUTW.js → chunk-DDLMX47W.js} +2 -2
  4. package/dist/{chunk-J3XKW5CH.js → chunk-F36PSNNL.js} +2 -2
  5. package/dist/{chunk-M5NJSO3M.js → chunk-JO7AJVGA.js} +3 -3
  6. package/dist/chunk-JO7AJVGA.js.map +1 -0
  7. package/dist/{chunk-R7FZ4FNO.js → chunk-QWVY5AUJ.js} +2 -2
  8. package/dist/{chunk-JTADL4BQ.js → chunk-RBBZXZ6I.js} +12 -12
  9. package/dist/{chunk-EHVT6G2Z.js → chunk-T7GXKT6S.js} +2 -2
  10. package/dist/chunk-TO4GKLLT.js +9 -0
  11. package/dist/{chunk-JTH2PASW.js → chunk-YVJUALQX.js} +2 -2
  12. package/dist/{chunk-QSY3HEP4.js → chunk-ZKTYHYBU.js} +3 -3
  13. package/dist/{cleanup-6DHF6MVQ.js → cleanup-M6V7VOL2.js} +5 -5
  14. package/dist/{cli-7XVDO432.js → cli-KF7RFZQC.js} +3 -3
  15. package/dist/{fork-6AQ62ODJ.js → fork-7RCD2XI2.js} +4 -4
  16. package/dist/{move-ZF4Z7X5U.js → move-CV3PGUFM.js} +3 -3
  17. package/dist/{prune-BZ2NL4VG.js → prune-REKRGEJU.js} +4 -4
  18. package/dist/{pty-host-ULFHBYSP.js → pty-host-W5NXKWAV.js} +2 -2
  19. package/dist/{remove-4Z2PPUMR.js → remove-7RT6QRRH.js} +5 -5
  20. package/dist/{sync-LOUYX24W.js → sync-K7BZ55SE.js} +4 -4
  21. package/dist/{tree-7BZQE5JA.js → tree-APEY56SC.js} +3 -3
  22. package/dist/wd-bin.js +2 -2
  23. package/dist/web/assets/{PtyView-dPCRmDiL.js → PtyView-8APZdSre.js} +2 -2
  24. package/dist/web/assets/{PtyView-dPCRmDiL.js.map → PtyView-8APZdSre.js.map} +1 -1
  25. package/dist/web/assets/{index-1o9y5y_j.js → index-zOLWspb1.js} +4 -4
  26. package/dist/web/assets/{index-1o9y5y_j.js.map → index-zOLWspb1.js.map} +1 -1
  27. package/dist/web/index.html +1 -1
  28. package/dist/{web-HKNHNSJM.js → web-LACYKYDC.js} +9 -9
  29. package/npm-shrinkwrap.json +2 -2
  30. package/package.json +1 -1
  31. package/dist/chunk-6DOAS4VP.js +0 -9
  32. package/dist/chunk-M5NJSO3M.js.map +0 -1
  33. /package/dist/{add-repo-KA723SUN.js.map → add-repo-VNG3JVRR.js.map} +0 -0
  34. /package/dist/{chunk-MYMMOUTW.js.map → chunk-DDLMX47W.js.map} +0 -0
  35. /package/dist/{chunk-J3XKW5CH.js.map → chunk-F36PSNNL.js.map} +0 -0
  36. /package/dist/{chunk-R7FZ4FNO.js.map → chunk-QWVY5AUJ.js.map} +0 -0
  37. /package/dist/{chunk-JTADL4BQ.js.map → chunk-RBBZXZ6I.js.map} +0 -0
  38. /package/dist/{chunk-EHVT6G2Z.js.map → chunk-T7GXKT6S.js.map} +0 -0
  39. /package/dist/{chunk-6DOAS4VP.js.map → chunk-TO4GKLLT.js.map} +0 -0
  40. /package/dist/{chunk-JTH2PASW.js.map → chunk-YVJUALQX.js.map} +0 -0
  41. /package/dist/{chunk-QSY3HEP4.js.map → chunk-ZKTYHYBU.js.map} +0 -0
  42. /package/dist/{cleanup-6DHF6MVQ.js.map → cleanup-M6V7VOL2.js.map} +0 -0
  43. /package/dist/{cli-7XVDO432.js.map → cli-KF7RFZQC.js.map} +0 -0
  44. /package/dist/{fork-6AQ62ODJ.js.map → fork-7RCD2XI2.js.map} +0 -0
  45. /package/dist/{move-ZF4Z7X5U.js.map → move-CV3PGUFM.js.map} +0 -0
  46. /package/dist/{prune-BZ2NL4VG.js.map → prune-REKRGEJU.js.map} +0 -0
  47. /package/dist/{pty-host-ULFHBYSP.js.map → pty-host-W5NXKWAV.js.map} +0 -0
  48. /package/dist/{remove-4Z2PPUMR.js.map → remove-7RT6QRRH.js.map} +0 -0
  49. /package/dist/{sync-LOUYX24W.js.map → sync-K7BZ55SE.js.map} +0 -0
  50. /package/dist/{tree-7BZQE5JA.js.map → tree-APEY56SC.js.map} +0 -0
  51. /package/dist/{web-HKNHNSJM.js.map → web-LACYKYDC.js.map} +0 -0
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  WORKTREE_REMOVED
4
- } from "./chunk-MYMMOUTW.js";
4
+ } from "./chunk-DDLMX47W.js";
5
5
  import {
6
6
  archiveWaiting
7
- } from "./chunk-EHVT6G2Z.js";
7
+ } from "./chunk-T7GXKT6S.js";
8
8
  import "./chunk-AKMPF72Y.js";
9
9
  import "./chunk-JQO5ANP4.js";
10
10
  import "./chunk-F2H4FQ62.js";
11
11
  import "./chunk-ICEP4WAK.js";
12
- import "./chunk-R7FZ4FNO.js";
12
+ import "./chunk-QWVY5AUJ.js";
13
13
  import {
14
14
  stopSessionPty
15
15
  } from "./chunk-4EFPHIME.js";
@@ -20,7 +20,7 @@ import "./chunk-DLV7TRON.js";
20
20
  import {
21
21
  teardownWorktree,
22
22
  wouldRefuseRemoval
23
- } from "./chunk-M5NJSO3M.js";
23
+ } from "./chunk-JO7AJVGA.js";
24
24
  import "./chunk-Y7PWSACJ.js";
25
25
  import "./chunk-EORL2V7P.js";
26
26
  import "./chunk-UXEFUSJV.js";
@@ -148,4 +148,4 @@ var removeCommand = {
148
148
  export {
149
149
  removeCommand
150
150
  };
151
- //# sourceMappingURL=remove-4Z2PPUMR.js.map
151
+ //# sourceMappingURL=remove-7RT6QRRH.js.map
@@ -5,8 +5,8 @@ import {
5
5
  } from "./chunk-ABQYKTG4.js";
6
6
  import {
7
7
  defaultCleanupDeps
8
- } from "./chunk-QSY3HEP4.js";
9
- import "./chunk-EHVT6G2Z.js";
8
+ } from "./chunk-ZKTYHYBU.js";
9
+ import "./chunk-T7GXKT6S.js";
10
10
  import {
11
11
  applyCleanup,
12
12
  scanCleanup
@@ -19,7 +19,7 @@ import "./chunk-VRMALBZK.js";
19
19
  import "./chunk-WC4IN5MD.js";
20
20
  import "./chunk-OHX7WKZU.js";
21
21
  import "./chunk-DLV7TRON.js";
22
- import "./chunk-M5NJSO3M.js";
22
+ import "./chunk-JO7AJVGA.js";
23
23
  import "./chunk-Y7PWSACJ.js";
24
24
  import "./chunk-EORL2V7P.js";
25
25
  import "./chunk-UXEFUSJV.js";
@@ -124,4 +124,4 @@ var syncCommand = {
124
124
  export {
125
125
  syncCommand
126
126
  };
127
- //# sourceMappingURL=sync-LOUYX24W.js.map
127
+ //# sourceMappingURL=sync-K7BZ55SE.js.map
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-RQ7W2CVL.js";
21
21
  import {
22
22
  SETUP_WARNINGS
23
- } from "./chunk-R7FZ4FNO.js";
23
+ } from "./chunk-QWVY5AUJ.js";
24
24
  import "./chunk-4EFPHIME.js";
25
25
  import "./chunk-VRMALBZK.js";
26
26
  import "./chunk-WC4IN5MD.js";
@@ -32,7 +32,7 @@ import {
32
32
  openBaseCheckout,
33
33
  parseBaseSpec,
34
34
  setupWorktree
35
- } from "./chunk-M5NJSO3M.js";
35
+ } from "./chunk-JO7AJVGA.js";
36
36
  import "./chunk-Y7PWSACJ.js";
37
37
  import "./chunk-EORL2V7P.js";
38
38
  import "./chunk-SJBEIYLK.js";
@@ -334,4 +334,4 @@ var treeCommand = {
334
334
  export {
335
335
  treeCommand
336
336
  };
337
- //# sourceMappingURL=tree-7BZQE5JA.js.map
337
+ //# sourceMappingURL=tree-APEY56SC.js.map
package/dist/wd-bin.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  run
4
- } from "./chunk-JTADL4BQ.js";
4
+ } from "./chunk-RBBZXZ6I.js";
5
5
  import {
6
6
  consoleReporter
7
7
  } from "./chunk-S5HJT7CM.js";
8
- import "./chunk-6DOAS4VP.js";
8
+ import "./chunk-TO4GKLLT.js";
9
9
  import "./chunk-IPHADNF5.js";
10
10
  import "./chunk-JYWX2N5W.js";
11
11
  import "./chunk-LXBHVWOY.js";
@@ -1,4 +1,4 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-1o9y5y_j.js";var l=r(t(),1),u=2e3,d=20,f=class{sentAt=null;samples=[];shownSamples=[];open=null;keySent(e){let t=this.open;return this.open=null,this.sentAt===null&&(this.sentAt=e),t?{arrived:t.arrived,shown:null}:null}output(e){if(this.sentAt===null)return null;let t=e-this.sentAt,n=this.sentAt;return this.sentAt=null,t<0||t>u?null:(p(this.samples,t),this.open={sentAt:n,arrived:t},t)}rendered(e){let t=this.open;if(!t)return null;this.open=null;let n=e-t.sentAt;return n<0||n>u?{arrived:t.arrived,shown:null}:(p(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?m(this.samples).median:null}reading(){return this.samples.length?{arrived:m(this.samples),shown:this.shownSamples.length?m(this.shownSamples):null}:null}};function p(e,t){e.push(t),e.length>d&&e.shift()}function m(e){let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return{median:t.length%2?t[n]:(t[n-1]+t[n])/2,worst:t[Math.min(t.length-1,Math.ceil(t.length*.9)-1)]}}function h(e,t,n=null){let r=t!==`webgl`;if(e===null&&!r)return null;let i=e=>`${Math.round(e)} ms`,a=e?.shown??e?.arrived??null;return{text:[a&&`⌁ ${i(a.median)}${a.worst>a.median*1.5?` (${i(a.worst)})`:``}`,r&&`DOM`].filter(Boolean).join(` · `),title:[e&&`A keystroke, over the last 20 (median, and in brackets the slowest of most of them): its echo arrived in ${i(e.arrived.median)} (${i(e.arrived.worst)}) — browser → PTY host → ConPTY → Claude and back`+(e.shown?`; it was on screen in ${i(e.shown.median)} (${i(e.shown.worst)}) — the frame drawn after it.`:`.`),e&&n===`direct`&&`Connected straight to the PTY host.`,e&&n===`relay`&&"Connected through work web (the PTY host gave no ticket: restart it with `work pty-host --restart`).",r&&`Drawn without the GPU, which is slower while Claude works.`,t===`retrying`&&`The GPU renderer was lost; it is tried again by itself.`,t===`dom`&&`WebGL is unavailable here, or kept getting lost; reloading the page tries it again.`,e&&`Each keystroke and every freeze of this window is written to work’s debug log (terminal-perf).`].filter(Boolean).join(` `),slow:r||(a?.median??0)>100}}var g=200,_=100,v=class{keys=[];stalls=[];key(e){e&&this.keys.length<g&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=_||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:y(e)})}take(e){if(!this.keys.length&&!this.stalls.length)return null;let t={...e,keys:this.keys,stalls:this.stalls};return this.keys=[],this.stalls=[],t}};function y(e){return[...e.scripts??[]].sort((e,t)=>(t.duration??0)-(e.duration??0)).slice(0,3).map(e=>{let t=(e.sourceURL??``).split(`/`).pop()?.split(`?`)[0]??``;return[e.invoker,e.sourceFunctionName,t,e.duration===void 0?``:`${Math.round(e.duration)}ms`].filter(Boolean).join(` `).slice(0,160)}).join(`; `)}function ee(e){let t=typeof PerformanceObserver>`u`?null:PerformanceObserver,n=t?.supportedEntryTypes??[],r=n.includes(`long-animation-frame`)?`long-animation-frame`:n.includes(`longtask`)?`longtask`:null;if(!t||!r)return()=>{};let i=new t(t=>{for(let n of t.getEntries())e(n)});return i.observe({type:r,buffered:!1}),()=>i.disconnect()}async function te(e,t){try{let n=await fetch(`/api/terminals/${encodeURIComponent(e)}/ticket`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t})});return n.status===404&&!(n.headers.get(`content-type`)??``).includes(`json`)?null:await n.json()}catch{return null}}function ne(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??te,i=[],a=[],o=[],s=null,c=!1,l=!1,u=null,d=e=>{let t=new MessageEvent(`message`,{data:e});for(let e of i)e(t)},f=(e=new Event(`close`))=>{if(!l){l=!0;for(let t of a)t(e)}},p=(e,r)=>{if(c)return;u=r?`direct`:`relay`;let a=new n(e);a.binaryType=m.binaryType,s=a;let l=!1;a.addEventListener(`open`,()=>{l=!0;for(let e of o)a.send(e);o.length=0}),a.addEventListener(`message`,e=>{if(s===a)for(let t of i)t(e)}),a.addEventListener(`close`,e=>{if(s===a){if(r&&!l&&!c)return p(t.relayUrl,!1);f(e)}})},m={binaryType:`blob`,addEventListener(e,t){e===`message`?i.push(t):a.push(t)},send(e){s&&s.readyState===n.OPEN?s.send(e):o.push(e)},close(){c=!0,s?s.close():f()},get route(){return u}};return r(e,t.force).then(e=>{if(!c){if(e&&`url`in e)return p(e.url,!0);if(e&&`elsewhere`in e)return d(JSON.stringify(e.elsewhere)),f();if(e&&`error`in e)return d(JSON.stringify({type:`error`,message:e.error})),f();p(t.relayUrl,!1)}}),m}var re=[3,10,30,60];function ie(e){return e>=0&&e<re.length?re[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var b=[2e3,1e4,6e4],x=6e5,oe=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<x),this.losses.push(e),b[this.losses.length-1]??null}},S=/^(\s*)([●⏺⎿])(\s)/u,se=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,le=e=>e.length-e.trimStart().length,C=``,w=``,T=``,ue=``,de=/[\uE000-\uE003]/gu,fe=e=>e.replace(de,``);function pe(e,t){let n=``,r=0;for(;r<e.length&&t>0;r++)if(/[\uE000-\uE003]/u.test(e[r]))n+=e[r];else if(/\s/u.test(e[r]))t--;else break;return n+e.slice(r)}var me=e=>pe(e,le(fe(e)));function he(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return S.test(fe(t))?t.replace(/[●⏺⎿]/u,` `):t}),i=e=>e===0?n:0,a=[],o=null;for(let e=0;e<r.length;e++){let n=r[e],s=fe(n),c=me(n),l=s.trimStart(),u=i(e)+le(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!se.test(l)&&u===o.cont){o.text+=` `+c,o.end=d;continue}if(o&&a.push(o.text),!l){o=null,a.push(``);continue}let f=ce.exec(l);o={text:(e===0?``:` `.repeat(le(s)))+c,cont:u+(f?f[0].length:0),end:d},/[│┃]/u.test(l)&&(a.push(o.text),o=null)}o&&a.push(o.text);let s=a.slice(1).filter(e=>fe(e).trim()),c=s.length?Math.min(...s.map(e=>le(fe(e)))):0;return a.map((e,t)=>t===0?me(e):pe(e,Math.min(c,le(fe(e))))).join(`
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c}from"./index-zOLWspb1.js";var l=r(t(),1),u=2e3,d=20,f=class{sentAt=null;samples=[];shownSamples=[];open=null;keySent(e){let t=this.open;return this.open=null,this.sentAt===null&&(this.sentAt=e),t?{arrived:t.arrived,shown:null}:null}output(e){if(this.sentAt===null)return null;let t=e-this.sentAt,n=this.sentAt;return this.sentAt=null,t<0||t>u?null:(p(this.samples,t),this.open={sentAt:n,arrived:t},t)}rendered(e){let t=this.open;if(!t)return null;this.open=null;let n=e-t.sentAt;return n<0||n>u?{arrived:t.arrived,shown:null}:(p(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?m(this.samples).median:null}reading(){return this.samples.length?{arrived:m(this.samples),shown:this.shownSamples.length?m(this.shownSamples):null}:null}};function p(e,t){e.push(t),e.length>d&&e.shift()}function m(e){let t=[...e].sort((e,t)=>e-t),n=t.length>>1;return{median:t.length%2?t[n]:(t[n-1]+t[n])/2,worst:t[Math.min(t.length-1,Math.ceil(t.length*.9)-1)]}}function h(e,t,n=null){let r=t!==`webgl`;if(e===null&&!r)return null;let i=e=>`${Math.round(e)} ms`,a=e?.shown??e?.arrived??null;return{text:[a&&`⌁ ${i(a.median)}${a.worst>a.median*1.5?` (${i(a.worst)})`:``}`,r&&`DOM`].filter(Boolean).join(` · `),title:[e&&`A keystroke, over the last 20 (median, and in brackets the slowest of most of them): its echo arrived in ${i(e.arrived.median)} (${i(e.arrived.worst)}) — browser → PTY host → ConPTY → Claude and back`+(e.shown?`; it was on screen in ${i(e.shown.median)} (${i(e.shown.worst)}) — the frame drawn after it.`:`.`),e&&n===`direct`&&`Connected straight to the PTY host.`,e&&n===`relay`&&"Connected through work web (the PTY host gave no ticket: restart it with `work pty-host --restart`).",r&&`Drawn without the GPU, which is slower while Claude works.`,t===`retrying`&&`The GPU renderer was lost; it is tried again by itself.`,t===`dom`&&`WebGL is unavailable here, or kept getting lost; reloading the page tries it again.`,e&&`Each keystroke and every freeze of this window is written to work’s debug log (terminal-perf).`].filter(Boolean).join(` `),slow:r||(a?.median??0)>100}}var g=200,_=100,v=class{keys=[];stalls=[];key(e){e&&this.keys.length<g&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=_||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:y(e)})}take(e){if(!this.keys.length&&!this.stalls.length)return null;let t={...e,keys:this.keys,stalls:this.stalls};return this.keys=[],this.stalls=[],t}};function y(e){return[...e.scripts??[]].sort((e,t)=>(t.duration??0)-(e.duration??0)).slice(0,3).map(e=>{let t=(e.sourceURL??``).split(`/`).pop()?.split(`?`)[0]??``;return[e.invoker,e.sourceFunctionName,t,e.duration===void 0?``:`${Math.round(e.duration)}ms`].filter(Boolean).join(` `).slice(0,160)}).join(`; `)}function ee(e){let t=typeof PerformanceObserver>`u`?null:PerformanceObserver,n=t?.supportedEntryTypes??[],r=n.includes(`long-animation-frame`)?`long-animation-frame`:n.includes(`longtask`)?`longtask`:null;if(!t||!r)return()=>{};let i=new t(t=>{for(let n of t.getEntries())e(n)});return i.observe({type:r,buffered:!1}),()=>i.disconnect()}async function te(e,t){try{let n=await fetch(`/api/terminals/${encodeURIComponent(e)}/ticket`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t})});return n.status===404&&!(n.headers.get(`content-type`)??``).includes(`json`)?null:await n.json()}catch{return null}}function ne(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??te,i=[],a=[],o=[],s=null,c=!1,l=!1,u=null,d=e=>{let t=new MessageEvent(`message`,{data:e});for(let e of i)e(t)},f=(e=new Event(`close`))=>{if(!l){l=!0;for(let t of a)t(e)}},p=(e,r)=>{if(c)return;u=r?`direct`:`relay`;let a=new n(e);a.binaryType=m.binaryType,s=a;let l=!1;a.addEventListener(`open`,()=>{l=!0;for(let e of o)a.send(e);o.length=0}),a.addEventListener(`message`,e=>{if(s===a)for(let t of i)t(e)}),a.addEventListener(`close`,e=>{if(s===a){if(r&&!l&&!c)return p(t.relayUrl,!1);f(e)}})},m={binaryType:`blob`,addEventListener(e,t){e===`message`?i.push(t):a.push(t)},send(e){s&&s.readyState===n.OPEN?s.send(e):o.push(e)},close(){c=!0,s?s.close():f()},get route(){return u}};return r(e,t.force).then(e=>{if(!c){if(e&&`url`in e)return p(e.url,!0);if(e&&`elsewhere`in e)return d(JSON.stringify(e.elsewhere)),f();if(e&&`error`in e)return d(JSON.stringify({type:`error`,message:e.error})),f();p(t.relayUrl,!1)}}),m}var re=[3,10,30,60];function ie(e){return e>=0&&e<re.length?re[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var b=[2e3,1e4,6e4],x=6e5,oe=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<x),this.losses.push(e),b[this.losses.length-1]??null}},S=/^(\s*)([●⏺⎿])(\s)/u,se=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,le=e=>e.length-e.trimStart().length,C=``,w=``,T=``,ue=``,de=/[\uE000-\uE003]/gu,fe=e=>e.replace(de,``);function pe(e,t){let n=``,r=0;for(;r<e.length&&t>0;r++)if(/[\uE000-\uE003]/u.test(e[r]))n+=e[r];else if(/\s/u.test(e[r]))t--;else break;return n+e.slice(r)}var me=e=>pe(e,le(fe(e)));function he(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return S.test(fe(t))?t.replace(/[●⏺⎿]/u,` `):t}),i=e=>e===0?n:0,a=[],o=null;for(let e=0;e<r.length;e++){let n=r[e],s=fe(n),c=me(n),l=s.trimStart(),u=i(e)+le(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!se.test(l)&&u===o.cont){o.text+=` `+c,o.end=d;continue}if(o&&a.push(o.text),!l){o=null,a.push(``);continue}let f=ce.exec(l);o={text:(e===0?``:` `.repeat(le(s)))+c,cont:u+(f?f[0].length:0),end:d},/[│┃]/u.test(l)&&(a.push(o.text),o=null)}o&&a.push(o.text);let s=a.slice(1).filter(e=>fe(e).trim()),c=s.length?Math.min(...s.map(e=>le(fe(e)))):0;return a.map((e,t)=>t===0?me(e):pe(e,Math.min(c,le(fe(e))))).join(`
2
2
  `)}function ge(e,t){let n=``;for(let r=t.start.y;r<=t.end.y;r++){let i=e.getLine(r);if(!i)break;let a=r<t.end.y&&!!e.getLine(r+1)?.isWrapped,o=[],s=r===t.end.y?Math.min(t.end.x,i.length):i.length;for(let e=r===t.start.y?t.start.x:0;e<s;e++){let t=i.getCell(e);t&&t.getWidth()!==0&&o.push({ch:t.getChars()||` `,b:!!t.isBold(),i:!!t.isItalic()})}let c=o.length;if(!a)for(;c>0&&o[c-1].ch.trim()===``;)c--;let l=!1,u=!1;for(let e of o.slice(0,c)){let t=e.ch.trim()?e.b:l,r=e.ch.trim()?e.i:u;(t!==l||r!==u)&&(u&&(n+=ue),l&&(n+=w),t&&(n+=C),r&&(n+=T),l=t,u=r),n+=e.ch}u&&(n+=ue),l&&(n+=w),r<t.end.y&&!a&&(n+=`
3
3
  `)}return n}function _e(e){let t=e.getSelection(),n=e.getSelectionPosition();if(!n)return t;let r=ge(e.buffer.active,n),i=e=>e.replace(/\r\n/gu,`
4
4
  `).replace(/[ \t]+$/gmu,``);return i(fe(r))===i(t)?r:t}function ve(e){let t=c(e).replaceAll(C,`<b>`).replaceAll(w,`</b>`).replaceAll(T,`<i>`).replaceAll(ue,`</i>`).replace(/<\/b>(\s*)<b>/gu,`$1`).replace(/<\/i>(\s*)<i>/gu,`$1`);for(let e=``;e!==t;)e=t,t=t.replace(/(\s+)(<\/[bi]>)/gu,`$2$1`);return t}var ye=/^\s*[│┃|].*[│┃|]\s*$/u,be=/^\s*(?:[┌├└╭╰┏┣┗┡╞][─━┬┼┴┳╋┻┐┤┘╮╯┓┫┛┩╡═╪╤╧\s]*|\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*\|?)$/u,xe=e=>e.trim().replace(/^[│┃|]|[│┃|]$/gu,``).split(/[│┃|]/u).map(e=>e.trim());function Se(e){let t=[[]],n=0;for(let r of e)be.test(r)?(n++,t[t.length-1].length&&t.push([])):ye.test(r)&&t[t.length-1].push(xe(r));let r=t.filter(e=>e.length);if(!r.length||!r.some(e=>e.some(e=>e.length>1)))return null;let i=r.length>2||r.length===2&&r[1].length===1,a=e=>e[0].map((t,n)=>e.map(e=>e[n]??``).filter(Boolean).join(` `)),o=i?r.map(a):[a(r[0]),...r.slice(1).flat()];return n||o.length>1?o:null}function Ce(e){let[t,...n]=e,r=(e,t)=>`<tr>${e.map(e=>`<${t}>${c(e)}</${t}>`).join(``)}</tr>`;return`<table><thead>${r(t,`th`)}</thead><tbody>${n.map(e=>r(e,`td`)).join(``)}</tbody></table>`}function we(e,t,n=0){let r=he(e,t,n).split(`
@@ -93,4 +93,4 @@ void main() {
93
93
  `);be=!0});let ke=t.onData(e=>{if(be){e===`\r`&&_(e=>e+1);return}Ae(e)});function Ae(e){be||(ge?(w.send(JSON.stringify({type:`input`,data:e})),Ee.key(xe.keySent(performance.now()))):ve.push(e))}let je=t.cols,Me=t.rows,Ne=(e=!1)=>{u.current&&(n.fit(),(e||t.cols!==je||t.rows!==Me)&&(je=t.cols,Me=t.rows,ge&&w.send(JSON.stringify({type:`resize`,cols:t.cols,rows:t.rows}))))},Pe=()=>Ne(),Fe=typeof ResizeObserver<`u`?new ResizeObserver(()=>Ne()):null;Fe?Fe.observe(c.current):window.addEventListener(`resize`,Pe),d.current=()=>{Ne(!0),t.focus()};let Ie=()=>Ne(!0);return t.textarea?.addEventListener(`focus`,Ie),()=>{l=!0,clearTimeout(fe),clearTimeout(he),clearTimeout(s),t.textarea?.removeEventListener(`paste`,b,!0),t.element?.removeEventListener(`copy`,se,!0),t.textarea?.removeEventListener(`focus`,Ie),d.current=null,Fe?.disconnect(),window.removeEventListener(`resize`,Pe),ke.dispose(),De.dispose(),clearInterval(Oe),E(),D(),clearTimeout(Ce);try{w.close()}catch{}t.dispose()}},[e,g]);let me=()=>{pe(!0),_(e=>e+1)};(0,l.useEffect)(()=>{if(!b||!i)return;let e=setInterval(()=>{document.visibilityState===`visible`&&me()},wp);return()=>clearInterval(e)},[b,i]);let he=async()=>{await s(`Start this session's Claude here?
94
94
 
95
95
  If it is still open in another terminal, both would write to the same conversation.`,{ok:`Start it here`})&&(S.current=!0,x(null),_(e=>e+1))},ge=t?`work tree ${t}${r?` ${r}`:``}`:`work tree <target> <branch>`,ve=h(se,w,le);return(0,$.jsxs)($.Fragment,{children:[b&&(0,$.jsxs)(`div`,{className:`wd-pty-elsewhere`,role:`status`,children:[(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-title`,children:[b.confirmed?`This session’s Claude is open in another terminal`:`This session’s Claude seems to be running in another terminal`,b.lastActivity!==null&&(0,$.jsxs)($.Fragment,{children:[` (last wrote `,Ep(b.lastActivity),`)`]}),b.state===`needs_input`&&(0,$.jsx)($.Fragment,{children:`, waiting for your answer there`}),`.`]}),(0,$.jsxs)(`p`,{children:[`Close it there (type `,(0,$.jsx)(`code`,{children:`/exit`}),`) and this tab attaches by itself — it checks every few seconds. To have both show the same screen instead, restart it with `,(0,$.jsx)(`code`,{children:ge}),` (Ctrl+] detaches, Claude keeps running).`]}),(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-actions`,children:[(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:me,disabled:fe,children:fe?`Checking…`:`Check again`}),!b.confirmed&&(0,$.jsx)(`button`,{type:`button`,className:`wd-link-button`,onClick:()=>void he(),children:`It's not running — start it here…`})]})]}),(0,$.jsxs)(`div`,{className:`wd-pty-frame`,style:b?{display:`none`}:void 0,children:[(0,$.jsx)(`div`,{ref:c,className:`wd-pty-host`}),ve&&(0,$.jsx)(`span`,{className:`wd-pty-latency`+(ve.slow?` wd-pty-latency-slow`:``),title:ve.title,children:ve.text}),p!==`ready`&&!b&&!y&&(0,$.jsx)(`div`,{className:`wd-pty-connecting`,role:`status`,children:p===`starting`?`Starting Claude — resuming the conversation…`:`Connecting…`}),p!==`ready`&&!b&&y&&(0,$.jsxs)(`div`,{className:`wd-pty-connecting wd-pty-failed`,role:`alert`,children:[(0,$.jsxs)(`p`,{children:[`Couldn't start Claude: `,y.reason,`.`]}),(0,$.jsxs)(`p`,{children:[y.retryAt===null?`Stopped trying on its own.`:(0,$.jsx)(Op,{at:y.retryAt}),` `,(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:()=>{re.current=0,te(null),_(e=>e+1)},children:y.retryAt===null?`Try again`:`Try now`})]})]})]})]})}function Op({at:e}){let[t,n]=(0,l.useState)(()=>Date.now());return(0,l.useEffect)(()=>{let e=setInterval(()=>n(Date.now()),1e3);return()=>clearInterval(e)},[]),(0,$.jsxs)($.Fragment,{children:[`Trying again in `,Math.max(1,Math.ceil((e-t)/1e3)),` s…`]})}export{wp as ELSEWHERE_RECHECK_MS,Dp as PtyView,Cp as openLink};
96
- //# sourceMappingURL=PtyView-dPCRmDiL.js.map
96
+ //# sourceMappingURL=PtyView-8APZdSre.js.map