@moberg_hr/work-tree 2.21.0 → 2.21.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.
package/dist/bin.js CHANGED
@@ -52,7 +52,7 @@ if (args[0] === "hook" && args[1] === "statusline") {
52
52
  } else {
53
53
  const { default: chalk } = await import("chalk");
54
54
  if (!process.env.NO_COLOR && chalk.level === 0) chalk.level = 1;
55
- const { run } = await import("./cli-RRT5BOWM.js");
55
+ const { run } = await import("./cli-6XNTBRIC.js");
56
56
  const { withReporter } = await import("./report-Z36H65YG.js");
57
57
  const { consoleReporter, reportStreamFor } = await import("./console-reporter-XU6VFUZE.js");
58
58
  await withReporter(consoleReporter(reportStreamFor(args)), () => run(args));
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-5GW6OEYN.js";
4
+ } from "./chunk-DVXO4L3C.js";
5
5
  import {
6
6
  resolveProjectTarget
7
7
  } from "./chunk-IPHADNF5.js";
@@ -219,12 +219,12 @@ var COMMANDS = [
219
219
  { names: ["todo"], load: async () => (await import("./todo-ZBFRL2A5.js")).todoCommand },
220
220
  { names: ["hydrate"], load: async () => (await import("./hydrate-N6ZIPOLK.js")).hydrateCommand },
221
221
  { names: ["diff"], load: async () => (await import("./diff-GBVTHXCV.js")).diffCommand },
222
- { names: ["web"], load: async () => (await import("./web-A6FWH4WT.js")).webCommand },
222
+ { names: ["web"], load: async () => (await import("./web-OI4MT7VN.js")).webCommand },
223
223
  { names: ["hook"], load: async () => (await import("./hook-3LHEQPBM.js")).hookCommand },
224
224
  { names: ["run"], load: async () => (await import("./run-UYTHFJ7P.js")).runCommand },
225
225
  { names: ["broadcast"], load: async () => (await import("./broadcast-4AMVPDUV.js")).broadcastCommand },
226
226
  { names: ["attach", "a"], load: async () => (await import("./attach-QX72JAJN.js")).attachCommand },
227
- { names: ["pty-host"], load: async () => (await import("./pty-host-72PLYNBT.js")).ptyHostCommand },
227
+ { names: ["pty-host"], load: async () => (await import("./pty-host-3UNFCKXJ.js")).ptyHostCommand },
228
228
  { names: ["state"], load: async () => (await import("./state-GM22X3RN.js")).stateCommand },
229
229
  { names: ["move"], load: async () => (await import("./move-TUX7SKKM.js")).moveCommand },
230
230
  { names: ["install-skills"], load: async () => (await import("./install-skills-N63CWTOH.js")).installSkillsCommand },
@@ -328,4 +328,4 @@ export {
328
328
  commandsFor,
329
329
  run
330
330
  };
331
- //# sourceMappingURL=chunk-FGZVHEFP.js.map
331
+ //# sourceMappingURL=chunk-64JQ5X2R.js.map
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/version.ts
4
+ var VERSION = true ? "2.21.1" : "dev";
5
+
6
+ export {
7
+ VERSION
8
+ };
9
+ //# sourceMappingURL=chunk-DVXO4L3C.js.map
@@ -3,8 +3,8 @@ import {
3
3
  COMMANDS,
4
4
  commandsFor,
5
5
  run
6
- } from "./chunk-FGZVHEFP.js";
7
- import "./chunk-5GW6OEYN.js";
6
+ } from "./chunk-64JQ5X2R.js";
7
+ import "./chunk-DVXO4L3C.js";
8
8
  import "./chunk-IPHADNF5.js";
9
9
  import "./chunk-JYWX2N5W.js";
10
10
  import "./chunk-3ZPVKUYD.js";
@@ -17,4 +17,4 @@ export {
17
17
  commandsFor,
18
18
  run
19
19
  };
20
- //# sourceMappingURL=cli-RRT5BOWM.js.map
20
+ //# sourceMappingURL=cli-6XNTBRIC.js.map
@@ -58,7 +58,7 @@ import {
58
58
  } from "./chunk-YQSWVHKK.js";
59
59
  import {
60
60
  VERSION
61
- } from "./chunk-5GW6OEYN.js";
61
+ } from "./chunk-DVXO4L3C.js";
62
62
  import "./chunk-Z6ACV5ZQ.js";
63
63
  import "./chunk-JUGF3YE7.js";
64
64
  import {
@@ -1232,4 +1232,4 @@ export {
1232
1232
  ptyHostCommand,
1233
1233
  stopHost
1234
1234
  };
1235
- //# sourceMappingURL=pty-host-72PLYNBT.js.map
1235
+ //# sourceMappingURL=pty-host-3UNFCKXJ.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-FGZVHEFP.js";
4
+ } from "./chunk-64JQ5X2R.js";
5
5
  import {
6
6
  consoleReporter
7
7
  } from "./chunk-S5HJT7CM.js";
8
- import "./chunk-5GW6OEYN.js";
8
+ import "./chunk-DVXO4L3C.js";
9
9
  import "./chunk-IPHADNF5.js";
10
10
  import "./chunk-JYWX2N5W.js";
11
11
  import "./chunk-3ZPVKUYD.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,u as l}from"./index-Rj1VHPO1.js";var u=l(r(),1),d=2e3,f=20,p=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>d?null:(m(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>d?{arrived:t.arrived,shown:null}:(m(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?h(this.samples).median:null}reading(){return this.samples.length?{arrived:h(this.samples),shown:this.shownSamples.length?h(this.shownSamples):null}:null}};function m(e,t){e.push(t),e.length>f&&e.shift()}function h(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 g(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 _=200,v=100,y=class{keys=[];stalls=[];key(e){e&&this.keys.length<_&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=v||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:ee(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 ee(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 te(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 ne(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 re(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??ne,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 b=[3,10,30,60];function ie(e){return e>=0&&e<b.length?b[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var x=[2e3,1e4,6e4],oe=6e5,S=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<oe),this.losses.push(e),x[this.losses.length-1]??null}},se=/^(\s*)([●⏺⎿])(\s)/u,C=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,w=e=>e.length-e.trimStart().length,T=``,E=``,le=``,ue=``,de=/[\uE000-\uE003]/gu,D=e=>e.replace(de,``);function fe(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 pe=e=>fe(e,w(D(e)));function me(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return se.test(D(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=D(n),c=pe(n),l=s.trimStart(),u=i(e)+w(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!C.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(w(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=>D(e).trim()),c=s.length?Math.min(...s.map(e=>w(D(e)))):0;return a.map((e,t)=>t===0?pe(e):fe(e,Math.min(c,w(D(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,u as l}from"./index-BOoVxITJ.js";var u=l(r(),1),d=2e3,f=20,p=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>d?null:(m(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>d?{arrived:t.arrived,shown:null}:(m(this.shownSamples,n),{arrived:t.arrived,shown:n})}median(){return this.samples.length?h(this.samples).median:null}reading(){return this.samples.length?{arrived:h(this.samples),shown:this.shownSamples.length?h(this.shownSamples):null}:null}};function m(e,t){e.push(t),e.length>f&&e.shift()}function h(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 g(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 _=200,v=100,y=class{keys=[];stalls=[];key(e){e&&this.keys.length<_&&this.keys.push({arrived:Math.round(e.arrived),shown:e.shown===null?null:Math.round(e.shown)})}stall(e,t){this.stalls.length>=v||this.stalls.push({at:t,ms:Math.round(e.duration),blocking:e.blockingDuration===void 0?null:Math.round(e.blockingDuration),what:ee(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 ee(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 te(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 ne(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 re(e,t){let n=t.WebSocketImpl??WebSocket,r=t.askTicket??ne,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 b=[3,10,30,60];function ie(e){return e>=0&&e<b.length?b[e]*1e3:null}function ae(e){return e?.trim()?e.trim():`the connection closed before it started`}var x=[2e3,1e4,6e4],oe=6e5,S=class{losses=[];lost(e){return this.losses=this.losses.filter(t=>e-t<oe),this.losses.push(e),x[this.losses.length-1]??null}},se=/^(\s*)([●⏺⎿])(\s)/u,C=/^(?:[-*+•]\s|\d+[.)]\s|#{1,6}\s|>\s|[│┃|┌└├╭╰─━])/u,ce=/^(?:[-*+•]|\d+[.)])\s+/u,w=e=>e.length-e.trimStart().length,T=``,E=``,le=``,ue=``,de=/[\uE000-\uE003]/gu,D=e=>e.replace(de,``);function fe(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 pe=e=>fe(e,w(D(e)));function me(e,t,n){let r=e.split(/\r?\n/).map(e=>{let t=e.replace(/\s+$/u,``);return se.test(D(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=D(n),c=pe(n),l=s.trimStart(),u=i(e)+w(s),d=i(e)+s.length;if(o&&l&&o.end+1+(l.split(/\s/u)[0]?.length??0)>t-2&&!C.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(w(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=>D(e).trim()),c=s.length?Math.min(...s.map(e=>w(D(e)))):0;return a.map((e,t)=>t===0?pe(e):fe(e,Math.min(c,w(D(e))))).join(`
2
2
  `)}function he(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+=E),t&&(n+=T),r&&(n+=le),l=t,u=r),n+=e.ch}u&&(n+=ue),l&&(n+=E),r<t.end.y&&!a&&(n+=`
3
3
  `)}return n}function ge(e){let t=e.getSelection(),n=e.getSelectionPosition();if(!n)return t;let r=he(e.buffer.active,n),i=e=>e.replace(/\r\n/gu,`
4
4
  `).replace(/[ \t]+$/gmu,``);return i(D(r))===i(t)?r:t}function _e(e){let t=c(e).replaceAll(T,`<b>`).replaceAll(E,`</b>`).replaceAll(le,`<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 ve=/^\s*[│┃|].*[│┃|]\s*$/u,ye=/^\s*(?:[┌├└╭╰┏┣┗┡╞][─━┬┼┴┳╋┻┐┤┘╮╯┓┫┛┩╡═╪╤╧\s]*|\|?(?:\s*:?-{3,}:?\s*\|)+\s*:?-*:?\s*\|?)$/u,be=e=>e.trim().replace(/^[│┃|]|[│┃|]$/gu,``).split(/[│┃|]/u).map(e=>e.trim());function xe(e){let t=[[]],n=0;for(let r of e)ye.test(r)?(n++,t[t.length-1].length&&t.push([])):ve.test(r)&&t[t.length-1].push(be(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 Se(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 Ce(e,t,n=0){let r=me(e,t,n).split(`
@@ -93,4 +93,4 @@ void main() {
93
93
  `);xe=!0});let Ae=t.onData(e=>{if(xe){e===`\r`&&b(e=>e+1);return}je(e)});function je(e){xe||(ve?(le.send(JSON.stringify({type:`input`,data:e})),O.key(Se.keySent(performance.now()))):ye.push(e))}let Me=t.cols,Ne=t.rows,Pe=(e=!1)=>{d.current&&(n.fit(),(e||t.cols!==Me||t.rows!==Ne)&&(Me=t.cols,Ne=t.rows,ve&&le.send(JSON.stringify({type:`resize`,cols:t.cols,rows:t.rows}))))},Fe=()=>Pe(),Ie=typeof ResizeObserver<`u`?new ResizeObserver(()=>Pe()):null;Ie?Ie.observe(l.current):window.addEventListener(`resize`,Fe),h.current=()=>{Pe(!0),t.focus()},_.current=n=>{n!==e&&(e=n,t.options.theme={...n.theme},t.options.fontFamily=n.fontFamily,t.options.fontSize=n.fontSize,t.options.lineHeight=n.lineHeight,Pe())};let Le=()=>Pe(!0);return t.textarea?.addEventListener(`focus`,Le),()=>{u=!0,clearTimeout(de),clearTimeout(_e),clearTimeout(c),t.textarea?.removeEventListener(`paste`,x,!0),t.element?.removeEventListener(`copy`,C,!0),t.textarea?.removeEventListener(`focus`,Le),h.current=null,_.current=null,Ie?.disconnect(),window.removeEventListener(`resize`,Fe),Ae.dispose(),k.dispose(),clearInterval(ke),De(),Oe(),clearTimeout(Te);try{le.close()}catch{}t.dispose()}},[r,ne]),(0,u.useEffect)(()=>{_.current?.(f)},[f]);let _e=()=>{he(!0),b(e=>e+1)};(0,u.useEffect)(()=>{if(!C||!c)return;let e=setInterval(()=>{document.visibilityState===`visible`&&_e()},Tp);return()=>clearInterval(e)},[C,c]);let ve=async()=>{await t(`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`})&&(w.current=!0,ce(null),b(e=>e+1))},ye=i?`work tree ${i}${a?` ${a}`:``}`:`work tree <target> <branch>`,be=g(T,de,le);return(0,$.jsxs)($.Fragment,{children:[C&&(0,$.jsxs)(`div`,{className:`wd-pty-elsewhere`,role:`status`,children:[(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-title`,children:[C.confirmed?`This session’s Claude is open in another terminal`:`This session’s Claude seems to be running in another terminal`,C.lastActivity!==null&&(0,$.jsxs)($.Fragment,{children:[` (last wrote `,Dp(C.lastActivity),`)`]}),C.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:ye}),` (Ctrl+] detaches, Claude keeps running).`]}),(0,$.jsxs)(`p`,{className:`wd-pty-elsewhere-actions`,children:[(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:_e,disabled:me,children:me?`Checking…`:`Check again`}),!C.confirmed&&(0,$.jsx)(`button`,{type:`button`,className:`wd-link-button`,onClick:()=>void ve(),children:`It's not running — start it here…`})]})]}),(0,$.jsxs)(`div`,{className:`wd-pty-frame`,style:C?{display:`none`}:void 0,children:[(0,$.jsx)(`div`,{ref:l,className:`wd-pty-host`}),be&&(0,$.jsx)(`span`,{className:`wd-pty-latency`+(be.slow?` wd-pty-latency-slow`:``),title:be.title,children:be.text}),v!==`ready`&&!C&&!x&&(0,$.jsx)(`div`,{className:`wd-pty-connecting`,role:`status`,children:v===`starting`?`Starting Claude — resuming the conversation…`:`Connecting…`}),v!==`ready`&&!C&&x&&(0,$.jsxs)(`div`,{className:`wd-pty-connecting wd-pty-failed`,role:`alert`,children:[(0,$.jsxs)(`p`,{children:[`Couldn't start Claude: `,x.reason,`.`]}),(0,$.jsxs)(`p`,{children:[x.retryAt===null?`Stopped trying on its own.`:(0,$.jsx)(kp,{at:x.retryAt}),` `,(0,$.jsx)(`button`,{type:`button`,className:`wd-btn-secondary`,onClick:()=>{se.current=0,oe(null),b(e=>e+1)},children:x.retryAt===null?`Try again`:`Try now`})]})]})]})]})}function kp({at:e}){let[t,n]=(0,u.useState)(()=>Date.now());return(0,u.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{Tp as ELSEWHERE_RECHECK_MS,Op as PtyView,wp as openLink};
96
- //# sourceMappingURL=PtyView-B11_5QTN.js.map
96
+ //# sourceMappingURL=PtyView-BbZKZwM6.js.map