@moberg_hr/work-tree 2.16.0 → 2.17.0

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-GKHHCDRV.js");
55
+ const { run } = await import("./cli-M6RBYAO6.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));
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/version.ts
4
+ var VERSION = true ? "2.17.0" : "dev";
5
+
6
+ export {
7
+ VERSION
8
+ };
9
+ //# sourceMappingURL=chunk-3TNVVBVG.js.map
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  VERSION
4
- } from "./chunk-3OMFMSZ4.js";
4
+ } from "./chunk-3TNVVBVG.js";
5
5
  import {
6
6
  resolveProjectTarget
7
7
  } from "./chunk-IPHADNF5.js";
@@ -216,12 +216,12 @@ var COMMANDS = [
216
216
  { names: ["todo"], load: async () => (await import("./todo-SECMZCGC.js")).todoCommand },
217
217
  { names: ["hydrate"], load: async () => (await import("./hydrate-VAJO2JGT.js")).hydrateCommand },
218
218
  { names: ["diff"], load: async () => (await import("./diff-NAL5334E.js")).diffCommand },
219
- { names: ["web"], load: async () => (await import("./web-PHQBICO5.js")).webCommand },
219
+ { names: ["web"], load: async () => (await import("./web-FT3AEB3E.js")).webCommand },
220
220
  { names: ["hook"], load: async () => (await import("./hook-OIAJHLTJ.js")).hookCommand },
221
221
  { names: ["run"], load: async () => (await import("./run-RXCZSZKP.js")).runCommand },
222
222
  { names: ["broadcast"], load: async () => (await import("./broadcast-RY6NAYGN.js")).broadcastCommand },
223
223
  { names: ["attach", "a"], load: async () => (await import("./attach-Z2HEZVZW.js")).attachCommand },
224
- { names: ["pty-host"], load: async () => (await import("./pty-host-QTWYR5QT.js")).ptyHostCommand },
224
+ { names: ["pty-host"], load: async () => (await import("./pty-host-5GYGW43F.js")).ptyHostCommand },
225
225
  { names: ["state"], load: async () => (await import("./state-NXTIYKP5.js")).stateCommand },
226
226
  { names: ["move"], load: async () => (await import("./move-GY5G47JO.js")).moveCommand },
227
227
  { names: ["install-skills"], load: async () => (await import("./install-skills-RJPZOV37.js")).installSkillsCommand },
@@ -325,4 +325,4 @@ export {
325
325
  commandsFor,
326
326
  run
327
327
  };
328
- //# sourceMappingURL=chunk-473UMEVN.js.map
328
+ //# sourceMappingURL=chunk-X2EMWCFQ.js.map
@@ -3,8 +3,8 @@ import {
3
3
  COMMANDS,
4
4
  commandsFor,
5
5
  run
6
- } from "./chunk-473UMEVN.js";
7
- import "./chunk-3OMFMSZ4.js";
6
+ } from "./chunk-X2EMWCFQ.js";
7
+ import "./chunk-3TNVVBVG.js";
8
8
  import "./chunk-IPHADNF5.js";
9
9
  import "./chunk-JYWX2N5W.js";
10
10
  import "./chunk-IKGSTBTG.js";
@@ -17,4 +17,4 @@ export {
17
17
  commandsFor,
18
18
  run
19
19
  };
20
- //# sourceMappingURL=cli-GKHHCDRV.js.map
20
+ //# sourceMappingURL=cli-M6RBYAO6.js.map
@@ -56,7 +56,7 @@ import {
56
56
  } from "./chunk-4HNMJIUZ.js";
57
57
  import {
58
58
  VERSION
59
- } from "./chunk-3OMFMSZ4.js";
59
+ } from "./chunk-3TNVVBVG.js";
60
60
  import "./chunk-DOYJR2HF.js";
61
61
  import {
62
62
  resolveWorkBinPath
@@ -1228,4 +1228,4 @@ export {
1228
1228
  ptyHostCommand,
1229
1229
  stopHost
1230
1230
  };
1231
- //# sourceMappingURL=pty-host-QTWYR5QT.js.map
1231
+ //# sourceMappingURL=pty-host-5GYGW43F.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-473UMEVN.js";
4
+ } from "./chunk-X2EMWCFQ.js";
5
5
  import {
6
6
  consoleReporter
7
7
  } from "./chunk-S5HJT7CM.js";
8
- import "./chunk-3OMFMSZ4.js";
8
+ import "./chunk-3TNVVBVG.js";
9
9
  import "./chunk-IPHADNF5.js";
10
10
  import "./chunk-JYWX2N5W.js";
11
11
  import "./chunk-IKGSTBTG.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-1hFrx0fV.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-C0ZT-YWI.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-CJOk_dgn.js.map
96
+ //# sourceMappingURL=PtyView-8godLDSh.js.map