@north-light/cli 0.3.645 → 0.3.647

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.
@@ -10,6 +10,10 @@ export interface TeardownHooks {
10
10
  * precise reason (e.g. an oversized-frame overflow) instead of the generic
11
11
  * message. Read at teardown time, not captured at wiring time. */
12
12
  lastSocketError: () => string | undefined;
13
+ /** The exact `crtr surface attach to …` command that reopens this viewer
14
+ * (same node, same --observer / --canvas), printed under the broker-gone
15
+ * message so the user can reattach by hand. */
16
+ reattachCommand: string;
13
17
  /** This viewer's tmux pane, as self-tagged at startup. Used only by the
14
18
  * node-done path to close our own pane. */
15
19
  tagPane: () => string | undefined;
@@ -1,5 +1,6 @@
1
- var m=Object.defineProperty;var n=(t,o)=>m(t,"name",{value:o,configurable:!0});import{closePane as w,currentTmux as S,inTmux as T}from"../../../core/runtime/placement-tmux.js";import{FOCUS_REPORTING_OFF as I}from"./focus-events.js";function G(t,o){const{tui:f,socket:c,nodeId:i,remote:u}=t;let a=!1;const l=n(()=>{if(!a){a=!0;try{process.stdout.write(I),f.stop()}catch{}}},"restore");process.once("exit",l);let s=!1,d;const g=new Promise(e=>{d=e}),p=n(e=>{if(!s){if(s=!0,o.stopLocal(),e==="detach"&&c.send({type:"bye"}),c.close(),l(),e==="broker-gone"){const r=o.lastSocketError()??`broker gone \u2014 node ${i} is no longer running its engine. Re-focus to reattach.`;process.stderr.write(`
1
+ var g=Object.defineProperty;var n=(o,t)=>g(o,"name",{value:t,configurable:!0});import{closePane as w,currentTmux as S,inTmux as T}from"../../../core/runtime/placement-tmux.js";import{FOCUS_REPORTING_OFF as I}from"./focus-events.js";function G(o,t){const{tui:f,socket:c,nodeId:i,remote:u}=o;let a=!1;const d=n(()=>{if(!a){a=!0;try{process.stdout.write(I),f.stop()}catch{}}},"restore");process.once("exit",d);let s=!1,l;const m=new Promise(e=>{l=e}),p=n(e=>{if(!s){if(s=!0,t.stopLocal(),e==="detach"&&c.send({type:"bye"}),c.close(),d(),e==="broker-gone"){const r=t.lastSocketError()??`broker gone \u2014 node ${i} is no longer running its engine.`;process.stderr.write(`
2
2
  ${r}
3
+ Reattach with: ${t.reattachCommand}
3
4
  `)}if(e==="node-done"){process.stderr.write(`
4
5
  \u2713 node ${i} finished \u2014 final report submitted.
5
- `);const r=o.tagPane()??process.env.TMUX_PANE??S()?.pane;!u&&r!==void 0&&T()&&w(r)}d()}},"teardown");return{done:g,teardown:p,isTornDown:n(()=>s,"isTornDown"),installSignalHandlers:n(()=>{const e=n(()=>p("signal"),"onSignal");process.once("SIGTERM",e),process.once("SIGHUP",e),process.once("SIGINT",e)},"installSignalHandlers")}}n(G,"createTeardown");export{G as createTeardown};
6
+ `);const r=t.tagPane()??process.env.TMUX_PANE??S()?.pane;!u&&r!==void 0&&T()&&w(r)}l()}},"teardown");return{done:m,teardown:p,isTornDown:n(()=>s,"isTornDown"),installSignalHandlers:n(()=>{const e=n(()=>p("signal"),"onSignal");process.once("SIGTERM",e),process.once("SIGHUP",e),process.once("SIGINT",e)},"installSignalHandlers")}}n(G,"createTeardown");export{G as createTeardown};