@dudousxd/nestjs-durable-dashboard 0.45.1 → 0.46.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.
@@ -10,7 +10,13 @@ import { ConsoleSessionError, type OpenConsoleOptions } from '../client/console-
10
10
  export interface UseOpenConsoleResult {
11
11
  /** Start the mint-then-navigate. Never rejects — read `error` instead. */
12
12
  open: () => void;
13
- /** True from the click until the navigation starts, or until it fails. */
13
+ /**
14
+ * True from the click until the navigation starts, or until it fails.
15
+ *
16
+ * With the DEFAULT navigation it stays true afterwards, because the page is being replaced and
17
+ * flipping the button back to idle would flicker "ready to click again" on a document that is
18
+ * leaving. With a caller-supplied `navigate` it is cleared on success — see {@link open}.
19
+ */
14
20
  isPending: boolean;
15
21
  /** The last refusal, or `null`. Cleared when `open()` is called again. */
16
22
  error: ConsoleSessionError | null;
@@ -1 +1 @@
1
- {"version":3,"file":"use-open-console.d.ts","sourceRoot":"","sources":["../../src/react/use-open-console.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,KAAK,kBAAkB,EAExB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,0EAA0E;IAC1E,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClC,uEAAuE;IACvE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,oBAAoB,CAsD5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,GAAE,kBAAuB,GAAG;IACnF,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAKA"}
1
+ {"version":3,"file":"use-open-console.d.ts","sourceRoot":"","sources":["../../src/react/use-open-console.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,KAAK,kBAAkB,EAExB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC,0EAA0E;IAC1E,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB;;;;;;OAMG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAClC,uEAAuE;IACvE,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,wBAAgB,qBAAqB,CAAC,OAAO,GAAE,kBAAuB,GAAG,oBAAoB,CA8D5F;AAED;;;;;;;;GAQG;AACH,wBAAgB,iCAAiC,CAAC,OAAO,GAAE,kBAAuB,GAAG;IACnF,WAAW,EAAE,SAAS,OAAO,EAAE,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC,CAKA"}
@@ -10,14 +10,22 @@ export function useOpenDurableConsole(options = {}) {
10
10
  const open = useCallback(() => {
11
11
  setIsPending(true);
12
12
  setError(null);
13
+ // Whether success ends this page's life is decided by WHO navigates.
14
+ //
15
+ // The default navigation replaces the document, so `isPending` is deliberately left set: the
16
+ // component is about to be torn down, and flipping the button back to idle first shows a
17
+ // flicker of "ready to click again" on a page that is leaving.
18
+ //
19
+ // A caller-supplied `navigate` carries no such promise — the option's own documentation offers
20
+ // "open in a new tab" as a use for it, and that keeps this page alive and on screen. Assuming
21
+ // teardown there left the button `disabled` forever, with only a reload to clear it: the launcher
22
+ // worked exactly once per page. So when the caller navigates, the flag reports the truth (the
23
+ // mint finished) rather than a guess about the page.
24
+ const callerNavigates = optionsRef.current.navigate !== undefined;
13
25
  void openDurableConsole(optionsRef.current)
14
26
  .then(() => {
15
- // Deliberately NOT clearing `isPending` on success: the navigation is already underway and
16
- // this component is about to be torn down. Flipping the button back to idle first produces
17
- // a visible flicker of "ready to click again" on a page that is leaving.
18
- //
19
- // The page leaving is not the same as the page dying — see the `pageshow` effect below,
20
- // which is what un-sticks this flag when the user comes back.
27
+ if (callerNavigates)
28
+ setIsPending(false);
21
29
  })
22
30
  .catch((cause) => {
23
31
  setError(cause instanceof ConsoleSessionError
@@ -26,8 +34,9 @@ export function useOpenDurableConsole(options = {}) {
26
34
  setIsPending(false);
27
35
  });
28
36
  }, []);
29
- // The counterpart to leaving `isPending` set on success. That choice assumes the launcher page is
30
- // discarded once the navigation completes — but with the browser's back/forward cache it is not:
37
+ // The counterpart to leaving `isPending` set on success under the DEFAULT navigation. That choice
38
+ // assumes the launcher page is discarded once the navigation completes — but with the browser's
39
+ // back/forward cache it is not:
31
40
  // pressing Back restores this page from memory with React state intact, so the user lands back on
32
41
  // a spinner that never stops, on a button `disabled` by that very flag. This is the one signal
33
42
  // that says "you are looking at a restored page": browsers fire `pageshow` with
@@ -1 +1 @@
1
- {"version":3,"file":"use-open-console.js","sourceRoot":"","sources":["../../src/react/use-open-console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,OAAO,EACL,mBAAmB,EAEnB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAqBtC,MAAM,UAAU,qBAAqB,CAAC,UAA8B,EAAE;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAA6B,IAAI,CAAC,CAAC;IAErE,kGAAkG;IAClG,wFAAwF;IACxF,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC;IAE7B,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,EAAE;QAC5B,Y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,MAAM,UAAU,iCAAiC,CAAC,UAA8B,EAAE;IAIhF,OAAO;QACL,WAAW,EAAE,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAU;QAC9E,UAAU,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,CAAC;KAC9C,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- import{c as A,j as _,Q as y,a as v,A as R}from"./index-CgSV49eF.js";window.__bench={polls:0,runs:0,longTasks:[],longTaskAt:[]};new PerformanceObserver(t=>{for(const e of t.getEntries())window.__bench.longTasks.push(Math.round(e.duration)),window.__bench.longTaskAt.push(Math.round(e.startTime))}).observe({entryTypes:["longtask"]});const m=new URLSearchParams(window.location.search),T=Number(m.get("runs")??"10000"),j=Number(m.get("steps")??"488"),b=Number(m.get("churn")??"5"),l=["ingestion","catalog.workflow-run","link-subwo-to-mvr","etl","dpas-extraction"],g=["@dudousxd/nestjs-catalog-pipeline","@dudousxd/nestjs-agent",void 0],I=Array.from({length:12},(t,e)=>` at frame${e} (/app/dist/src/step-${e}.js:${e*7}:19)`).join(`
1
+ import{c as A,j as _,Q as y,a as v,A as R}from"./index-DyuI-y-B.js";window.__bench={polls:0,runs:0,longTasks:[],longTaskAt:[]};new PerformanceObserver(t=>{for(const e of t.getEntries())window.__bench.longTasks.push(Math.round(e.duration)),window.__bench.longTaskAt.push(Math.round(e.startTime))}).observe({entryTypes:["longtask"]});const m=new URLSearchParams(window.location.search),T=Number(m.get("runs")??"10000"),j=Number(m.get("steps")??"488"),b=Number(m.get("churn")??"5"),l=["ingestion","catalog.workflow-run","link-subwo-to-mvr","etl","dpas-extraction"],g=["@dudousxd/nestjs-catalog-pipeline","@dudousxd/nestjs-agent",void 0],I=Array.from({length:12},(t,e)=>` at frame${e} (/app/dist/src/step-${e}.js:${e*7}:19)`).join(`
2
2
  `),f=Date.parse("2026-08-01T00:00:00.000Z");function $(t){const e=t%5<2,n=e?"failed":t%97===0?"suspended":"completed",o=new Date(f+t*6e4).toISOString();return{id:`${l[t%l.length]}:${t}:2026-08-01T00:00`,workflow:l[t%l.length],workflowVersion:"4",status:n,namespace:"default",...g[t%g.length]!==void 0?{origin:g[t%g.length]}:{},tags:[`tier:${t%3}`,`region:r${t%4}`],createdAt:o,updatedAt:o,input:{file:`drop-${t}.csv`,base:`base-${t%12}`},...e?{error:{message:`step ${t} failed after 3 attempts`,stack:I}}:{}}}let u=Array.from({length:T},(t,e)=>$(e));window.__bench.runs=u.length;const O=l.map(t=>({group:t,kind:"workflow",depth:0,liveWorkers:[{group:t,instanceId:`worker-${t}`,lastBeatAt:f}]}));function N(){if(b<=0)return;const t=new Date().toISOString();u=u.map((e,n)=>n<b?{...e,updatedAt:t}:e)}function x(t){return{run:$(0),timeline:Array.from({length:j},(e,n)=>({runId:t,seq:n,name:`handle_chunk_${n}`,kind:n%3===0?"remote":"local",status:"completed",attempts:1,workerGroup:"ingestion",startedAt:new Date(f+n*900).toISOString(),finishedAt:new Date(f+n*900+700).toISOString()})),children:[]}}function D(t,e){var k;const n=t.match(/^\/runs\/(.+)$/);if(n!=null&&n[1]&&n[1]!=="facets")return x(decodeURIComponent(n[1]));if(t==="/runs/facets"){const s=new Map;for(const a of u){const p=(k=a.origin)!=null&&k.trim()?a.origin:null,w=`${a.status}|${p??""}`,d=s.get(w);d?d.count+=1:s.set(w,{status:a.status,origin:p,count:1})}return[...s.values()]}if(t!=="/runs")return;window.__bench.polls+=1,N();const o=e.getAll("status"),i=e.get("origin"),c=e.get("limit");let r=u;return o.length&&(r=r.filter(s=>o.includes(s.status))),e.get("unattributed")==="true"?r=r.filter(s=>{var a;return!((a=s.origin)!=null&&a.trim())}):i&&(r=r.filter(s=>s.origin===i)),(c?r.slice(0,Number(c)):r).map(s=>{const{input:a,output:p,error:w,...d}=s;return d})}const S=window.fetch.bind(window);window.fetch=async(t,e)=>{const o=(typeof t=="string"?t:t instanceof URL?t.href:t.url).match(/\/durable\/api(\/[^?]*)\??(.*)$/),i=o==null?void 0:o[1];if(!i)return S(t,e);const c=h=>new Response(JSON.stringify(h),{status:200,headers:{"content-type":"application/json"}});if(i==="/workers")return c(O);if(i==="/topology")return c({role:"control-plane"});const r=D(i,new URLSearchParams((o==null?void 0:o[2])??""));return r===void 0?S(t,e):c(r)};A(document.getElementById("root")).render(_.jsx(y,{client:new v,children:_.jsx(R,{})}));
@@ -1 +1 @@
1
- import{a as t,c as r,j as e,r as s,Q as n,A as o}from"./index-CgSV49eF.js";const i=new t({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});r(document.getElementById("root")).render(e.jsx(s.StrictMode,{children:e.jsx(n,{client:i,children:e.jsx(o,{})})}));
1
+ import{a as t,c as r,j as e,r as s,Q as n,A as o}from"./index-DyuI-y-B.js";const i=new t({defaultOptions:{queries:{refetchInterval:2e3,refetchOnWindowFocus:!1}}});r(document.getElementById("root")).render(e.jsx(s.StrictMode,{children:e.jsx(n,{client:i,children:e.jsx(o,{})})}));