@hediet/linkrpc-cli 0.0.3-next.20261027.1 → 0.0.3-next.20261028.2

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.
@@ -1,4 +1,4 @@
1
- import { p as autorun } from "./cli-CeXRuTXb.js";
1
+ import { p as autorun } from "./cli-CuQ0wsuQ.js";
2
2
  import React, { useEffect, useReducer, useRef } from "react";
3
3
  //#region src/ui/useObservable.ts
4
4
  /**
@@ -90,4 +90,4 @@ function useScroll(count, cursor, height) {
90
90
  //#endregion
91
91
  export { useObservable as n, useScroll as t };
92
92
 
93
- //# sourceMappingURL=scroll-CSP06v90.js.map
93
+ //# sourceMappingURL=scroll-flNV90LP.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-CSP06v90.js","names":[],"sources":["../../src/ui/useObservable.ts","../../src/ui/scroll.ts"],"sourcesContent":["import { useEffect, useReducer, useRef } from \"react\";\nimport { autorun, type IObservable } from \"@vscode/observables\";\n\n/**\n * Minimal React hook that subscribes a component to an observable value.\n *\n * We don't pull in `@vscode/observables-react` here because it imports\n * `react-dom` (for `unstable_batchedUpdates`), which doesn't exist on the\n * terminal renderer (`ink`). The mechanics are the same — `autorun` plus a\n * `useReducer`-driven forceUpdate.\n */\nexport function useObservable<T>(obs: IObservable<T>): T {\n const [, forceUpdate] = useReducer((x: number) => x + 1, 0);\n const valueRef = useRef<{ value: T } | undefined>(undefined);\n\n useEffect(() => {\n const disposable = autorun((reader) => {\n const v = obs.read(reader);\n const prev = valueRef.current;\n valueRef.current = { value: v };\n if (prev !== undefined) forceUpdate();\n });\n return () => disposable.dispose();\n }, [obs]);\n\n if (valueRef.current === undefined) {\n // First render: read the current value without subscribing.\n // `get()` skips the reader-based dependency tracking.\n valueRef.current = { value: obs.get() };\n }\n return valueRef.current.value;\n}\n","import React from \"react\";\n\nexport interface ScrollWindow {\n /** First visible item index (inclusive). */\n readonly start: number;\n /** One past the last visible item index (exclusive). */\n readonly end: number;\n /** How many items are hidden above the window. */\n readonly above: number;\n /** How many items are hidden below the window. */\n readonly below: number;\n}\n\n/**\n * Pure scroll math for a vertical list rendered into a fixed-height viewport.\n *\n * The cursor stays stationary until it reaches a viewport edge, then the window\n * scrolls (classic list behaviour) rather than re-centering on every move.\n * `prevOffset` is the offset from the previous render; the returned `offset`\n * should be fed back in next time.\n *\n * One row on each overflowing side is reserved for a \"▲/▼ more\" indicator, so an\n * indicator never hides a real item; this makes the visible item count\n * `height - 2` while scrolling. When the list fits, the full range is returned\n * with no indicators.\n */\nexport function computeWindow(\n count: number,\n cursor: number,\n prevOffset: number,\n height: number,\n): { offset: number; window: ScrollWindow } {\n if (height <= 0 || count <= 0) {\n return { offset: 0, window: { start: 0, end: 0, above: 0, below: 0 } };\n }\n if (count <= height) {\n return { offset: 0, window: { start: 0, end: count, above: 0, below: 0 } };\n }\n\n // Reserve a row top and bottom for indicators so layout stays stable while\n // scrolling. At the very edges one reserved row goes unused (rendered blank).\n const visible = Math.max(1, height - 2);\n const c = Math.max(0, Math.min(count - 1, cursor));\n\n let offset = prevOffset;\n offset = Math.min(offset, c); // cursor scrolled above the window\n offset = Math.max(offset, c - visible + 1); // cursor scrolled below the window\n offset = Math.max(0, Math.min(offset, count - visible));\n\n const end = offset + visible;\n return { offset, window: { start: offset, end, above: offset, below: count - end } };\n}\n\n/**\n * Stateful wrapper around {@link computeWindow}. Ink has no scroll container, so\n * any list longer than the available rows must be sliced by hand; without this\n * the overflow corrupts sibling panes and the terminal frame. The scroll offset\n * is kept in a ref so it survives re-renders without involving the view model.\n */\nexport function useScroll(count: number, cursor: number, height: number): ScrollWindow {\n const offsetRef = React.useRef(0);\n const { offset, window } = computeWindow(count, cursor, offsetRef.current, height);\n offsetRef.current = offset;\n return window;\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,cAAiB,KAAwB;CACrD,MAAM,GAAG,eAAe,YAAY,MAAc,IAAI,GAAG,CAAC;CAC1D,MAAM,WAAW,OAAiC,K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AU,SAAS,MAAM;CACjF,UAAU,UAAU;CACpB,OAAO;AACX"}
1
+ {"version":3,"file":"scroll-flNV90LP.js","names":[],"sources":["../../src/ui/useObservable.ts","../../src/ui/scroll.ts"],"sourcesContent":["import { useEffect, useReducer, useRef } from \"react\";\nimport { autorun, type IObservable } from \"@vscode/observables\";\n\n/**\n * Minimal React hook that subscribes a component to an observable value.\n *\n * We don't pull in `@vscode/observables-react` here because it imports\n * `react-dom` (for `unstable_batchedUpdates`), which doesn't exist on the\n * terminal renderer (`ink`). The mechanics are the same — `autorun` plus a\n * `useReducer`-driven forceUpdate.\n */\nexport function useObservable<T>(obs: IObservable<T>): T {\n const [, forceUpdate] = useReducer((x: number) => x + 1, 0);\n const valueRef = useRef<{ value: T } | undefined>(undefined);\n\n useEffect(() => {\n const disposable = autorun((reader) => {\n const v = obs.read(reader);\n const prev = valueRef.current;\n valueRef.current = { value: v };\n if (prev !== undefined) forceUpdate();\n });\n return () => disposable.dispose();\n }, [obs]);\n\n if (valueRef.current === undefined) {\n // First render: read the current value without subscribing.\n // `get()` skips the reader-based dependency tracking.\n valueRef.current = { value: obs.get() };\n }\n return valueRef.current.value;\n}\n","import React from \"react\";\n\nexport interface ScrollWindow {\n /** First visible item index (inclusive). */\n readonly start: number;\n /** One past the last visible item index (exclusive). */\n readonly end: number;\n /** How many items are hidden above the window. */\n readonly above: number;\n /** How many items are hidden below the window. */\n readonly below: number;\n}\n\n/**\n * Pure scroll math for a vertical list rendered into a fixed-height viewport.\n *\n * The cursor stays stationary until it reaches a viewport edge, then the window\n * scrolls (classic list behaviour) rather than re-centering on every move.\n * `prevOffset` is the offset from the previous render; the returned `offset`\n * should be fed back in next time.\n *\n * One row on each overflowing side is reserved for a \"▲/▼ more\" indicator, so an\n * indicator never hides a real item; this makes the visible item count\n * `height - 2` while scrolling. When the list fits, the full range is returned\n * with no indicators.\n */\nexport function computeWindow(\n count: number,\n cursor: number,\n prevOffset: number,\n height: number,\n): { offset: number; window: ScrollWindow } {\n if (height <= 0 || count <= 0) {\n return { offset: 0, window: { start: 0, end: 0, above: 0, below: 0 } };\n }\n if (count <= height) {\n return { offset: 0, window: { start: 0, end: count, above: 0, below: 0 } };\n }\n\n // Reserve a row top and bottom for indicators so layout stays stable while\n // scrolling. At the very edges one reserved row goes unused (rendered blank).\n const visible = Math.max(1, height - 2);\n const c = Math.max(0, Math.min(count - 1, cursor));\n\n let offset = prevOffset;\n offset = Math.min(offset, c); // cursor scrolled above the window\n offset = Math.max(offset, c - visible + 1); // cursor scrolled below the window\n offset = Math.max(0, Math.min(offset, count - visible));\n\n const end = offset + visible;\n return { offset, window: { start: offset, end, above: offset, below: count - end } };\n}\n\n/**\n * Stateful wrapper around {@link computeWindow}. Ink has no scroll container, so\n * any list longer than the available rows must be sliced by hand; without this\n * the overflow corrupts sibling panes and the terminal frame. The scroll offset\n * is kept in a ref so it survives re-renders without involving the view model.\n */\nexport function useScroll(count: number, cursor: number, height: number): ScrollWindow {\n const offsetRef = React.useRef(0);\n const { offset, window } = computeWindow(count, cursor, offsetRef.current, height);\n offsetRef.current = offset;\n return window;\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,cAAiB,KAAwB;CACrD,MAAM,GAAG,eAAe,YAAY,MAAc,IAAI,GAAG,CAAC;CAC1D,MAAM,WAAW,OAAiC,KAAA,CAAS;CAE3D,gBAAgB;EACZ,MAAM,aAAa,SAAS,WAAW;GACnC,MAAM,IAAI,IAAI,KAAK,MAAM;GACzB,MAAM,OAAO,SAAS;GACtB,SAAS,UAAU,EAAE,OAAO,EAAE;GAC9B,IAAI,SAAS,KAAA,GAAW,YAAY;EACxC,CAAC;EACD,aAAa,WAAW,QAAQ;CACpC,GAAG,CAAC,GAAG,CAAC;CAER,IAAI,SAAS,YAAY,KAAA,GAGrB,SAAS,UAAU,EAAE,OAAO,IAAI,IAAI,EAAE;CAE1C,OAAO,SAAS,QAAQ;AAC5B;;;;;;;;;;;;;;;;ACLA,SAAgB,cACZ,OACA,QACA,YACA,QACwC;CACxC,IAAI,UAAU,KAAK,SAAS,GACxB,OAAO;EAAE,QAAQ;EAAG,QAAQ;GAAE,OAAO;GAAG,KAAK;GAAG,OAAO;GAAG,OAAO;EAAE;CAAE;CAEzE,IAAI,SAAS,QACT,OAAO;EAAE,QAAQ;EAAG,QAAQ;GAAE,OAAO;GAAG,KAAK;GAAO,OAAO;GAAG,OAAO;EAAE;CAAE;CAK7E,MAAM,UAAU,KAAK,IAAI,GAAG,SAAS,CAAC;CACtC,MAAM,IAAI,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,GAAG,MAAM,CAAC;CAEjD,IAAI,SAAS;CACb,SAAS,KAAK,IAAI,QAAQ,CAAC;CAC3B,SAAS,KAAK,IAAI,QAAQ,IAAI,UAAU,CAAC;CACzC,SAAS,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,QAAQ,OAAO,CAAC;CAEtD,MAAM,MAAM,SAAS;CACrB,OAAO;EAAE;EAAQ,QAAQ;GAAE,OAAO;GAAQ;GAAK,OAAO;GAAQ,OAAO,QAAQ;EAAI;CAAE;AACvF;;;;;;;AAQA,SAAgB,UAAU,OAAe,QAAgB,QAA8B;CACnF,MAAM,YAAY,MAAM,OAAO,CAAC;CAChC,MAAM,EAAE,QAAQ,WAAW,cAAc,OAAO,QAAQ,UAAU,SAAS,MAAM;CACjF,UAAU,UAAU;CACpB,OAAO;AACX"}
@@ -1,4 +1,4 @@
1
- import { M as readEndpointDiscovery, O as CallLogLevelSchema, f as endpointDefinition, l as connectToHubManagement } from "./runComplete-CxpTYwUW.js";
1
+ import { M as readEndpointDiscovery, O as CallLogLevelSchema, f as endpointDefinition, l as connectToHubManagement } from "./runComplete-CHZWS4m_.js";
2
2
  import { createRequire } from "node:module";
3
3
  import "@hediet/linkrpc";
4
4
  import { z } from "zod";
@@ -845,4 +845,4 @@ function _sleep(ms) {
845
845
  //#endregion
846
846
  export { nodeDaemonLaunch, startDaemon, stopDaemon };
847
847
 
848
- //# sourceMappingURL=src-DQiXYpCP.js.map
848
+ //# sourceMappingURL=src-u4eOE1Iz.js.map