@silo-code/sdk 0.24.0 → 0.25.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/Tooltip.d.ts +12 -1
- package/dist/Tooltip.d.ts.map +1 -1
- package/dist/Tooltip.js +7 -1
- package/dist/Tooltip.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/processes-service.d.ts +33 -2
- package/dist/processes-service.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Tooltip.tsx +13 -0
- package/src/index.ts +1 -0
- package/src/processes-service.ts +32 -2
package/dist/Tooltip.d.ts
CHANGED
|
@@ -10,6 +10,10 @@ import { type ReactNode } from "react";
|
|
|
10
10
|
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
11
11
|
* host — no stylesheet import is needed in the extension.
|
|
12
12
|
*
|
|
13
|
+
* Pass `disabled` to keep the trigger wrapper mounted (so layout stays stable)
|
|
14
|
+
* while suppressing the popup — handy when the tooltip is only useful
|
|
15
|
+
* conditionally, e.g. showing the full label of a tab only once it's truncated.
|
|
16
|
+
*
|
|
13
17
|
* @example
|
|
14
18
|
* ```tsx
|
|
15
19
|
* <Tooltip content="New File">
|
|
@@ -22,8 +26,15 @@ import { type ReactNode } from "react";
|
|
|
22
26
|
* @category Core Types
|
|
23
27
|
* @public
|
|
24
28
|
*/
|
|
25
|
-
export declare function Tooltip({ content, children, }: {
|
|
29
|
+
export declare function Tooltip({ content, children, disabled, }: {
|
|
30
|
+
/** Text shown in the popup. */
|
|
26
31
|
content: string;
|
|
32
|
+
/** The trigger element the tooltip is anchored to. */
|
|
27
33
|
children: ReactNode;
|
|
34
|
+
/**
|
|
35
|
+
* When `true`, the wrapper still renders (layout is unchanged) but the popup
|
|
36
|
+
* never appears. Defaults to `false`.
|
|
37
|
+
*/
|
|
38
|
+
disabled?: boolean;
|
|
28
39
|
}): import("react").JSX.Element;
|
|
29
40
|
//# sourceMappingURL=Tooltip.d.ts.map
|
package/dist/Tooltip.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO1E
|
|
1
|
+
{"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAO1E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,QAAgB,GACjB,EAAE;IACD,+BAA+B;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,QAAQ,EAAE,SAAS,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,+BA2CA"}
|
package/dist/Tooltip.js
CHANGED
|
@@ -15,6 +15,10 @@ const MARGIN_PX = 8;
|
|
|
15
15
|
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
16
16
|
* host — no stylesheet import is needed in the extension.
|
|
17
17
|
*
|
|
18
|
+
* Pass `disabled` to keep the trigger wrapper mounted (so layout stays stable)
|
|
19
|
+
* while suppressing the popup — handy when the tooltip is only useful
|
|
20
|
+
* conditionally, e.g. showing the full label of a tab only once it's truncated.
|
|
21
|
+
*
|
|
18
22
|
* @example
|
|
19
23
|
* ```tsx
|
|
20
24
|
* <Tooltip content="New File">
|
|
@@ -27,11 +31,13 @@ const MARGIN_PX = 8;
|
|
|
27
31
|
* @category Core Types
|
|
28
32
|
* @public
|
|
29
33
|
*/
|
|
30
|
-
export function Tooltip({ content, children, }) {
|
|
34
|
+
export function Tooltip({ content, children, disabled = false, }) {
|
|
31
35
|
const ref = useRef(null);
|
|
32
36
|
const [anchor, setAnchor] = useState(null);
|
|
33
37
|
const timer = useRef(null);
|
|
34
38
|
const show = () => {
|
|
39
|
+
if (disabled)
|
|
40
|
+
return;
|
|
35
41
|
timer.current = setTimeout(() => {
|
|
36
42
|
const r = ref.current?.getBoundingClientRect();
|
|
37
43
|
if (r)
|
package/dist/Tooltip.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB
|
|
1
|
+
{"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../src/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,QAAQ,GAAG,GAAG,CAAC;AACrB,MAAM,MAAM,GAAG,CAAC,CAAC;AACjB,MAAM,SAAS,GAAG,CAAC,CAAC;AAEpB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,UAAU,OAAO,CAAC,EACtB,OAAO,EACP,QAAQ,EACR,QAAQ,GAAG,KAAK,GAWjB;IACC,MAAM,GAAG,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAC;IAC1C,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAClC,IAAI,CACL,CAAC;IACF,MAAM,KAAK,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEjE,MAAM,IAAI,G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AAG,EAAE;QACnB,MAAM,EAAE,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,EAAE;YAAE,OAAO;QAChB,MAAM,CAAC,GAAG,EAAE,CAAC,WAAW,CAAC;QACzB,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC;QAE1B,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CACnB,SAAS,EACT,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,GAAG,CAAC,GAAG,SAAS,CAAC,CACxD,CAAC;QACF,MAAM,GAAG,GACP,SAAS,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,GAAG,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC;QAErE,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,CAAC,CAAC;IACjD,CAAC,EAAE,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,cAAK,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAC,cAAc,EAAC,KAAK,EAAE,KAAK,YACtD,OAAO,GACJ,CACP,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export type { WorkspaceService, WorkspaceState, CreateWorkspaceInput, WorkspaceS
|
|
|
21
21
|
export type { EditorService, EditorSaveHandlers, OpenFileOptions, EditorViewInfo, OpenDiffSpec, DiffContent, DiffContentRequest, DiffContentProvider, ActiveEditorInfo, EditorsState, EditorSaveEvent, } from "./editor-service.js";
|
|
22
22
|
export type { LayoutService, LayoutState, SidePanelColumnState, SideLocation, } from "./layout-service.js";
|
|
23
23
|
export type { ProcessService, ProcessSession, ProcessSpawnOptions, ProcessExecOptions, ProcessExecResult, } from "./process-service.js";
|
|
24
|
-
export type { ProcessesService, ProcessInfo, ProcessStats, } from "./processes-service.js";
|
|
24
|
+
export type { ProcessesService, ProcessInfo, ProcessStats, ProcessTreeNode, } from "./processes-service.js";
|
|
25
25
|
export type { TerminalService, CreateTerminalInput, TerminalKind, TerminalRecord, TerminalTabDecoration, TerminalTabDecorationProvider, OscEvent, } from "./terminal-service.js";
|
|
26
26
|
export type { FileService, FileMeta, FileChangeKind, FileChangeEvent, } from "./file-service.js";
|
|
27
27
|
export type { SearchService, SearchOptions, SearchMatch, SearchFileResult, SearchResponse, } from "./search-service.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,YAAY,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,QAAQ,EACR,OAAO,EACP,MAAM,EACN,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,SAAS,EACT,aAAa,EACb,UAAU,EACV,YAAY,EACZ,gBAAgB,EAChB,SAAS,EACT,iBAAiB,EACjB,eAAe,GAChB,MAAM,SAAS,CAAC;AAKjB,YAAY,EACV,SAAS,EACT,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,gBAAgB,CAAC;AAGxB,YAAY,EACV,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,EACrB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,aAAa,EACb,WAAW,EACX,oBAAoB,EACpB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EACV,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,M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AE,aAAa,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAKlE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG7D,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAIlD,YAAY,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAKrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAI9B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAK3D,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,wBAAwB,EACxB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,mBAAmB,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA4GH,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AA6BhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAoBzC,sEAAsE;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAkCjD,8EAA8E;AAC9E,8EAA8E;AAC9E,6DAA6D;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,yEAAyE;AACzE,iFAAiF;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,wEAAwE;AACxE,iFAAiF;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAC9E,8EAA8E;AAC9E,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -18,6 +18,23 @@ export interface ProcessStats {
|
|
|
18
18
|
/** Resident memory in megabytes. */
|
|
19
19
|
memoryMb: number;
|
|
20
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* One process in a session's descendant tree. Only produced while an extension
|
|
23
|
+
* holds `enableStats({ trees: true })` — see {@link ProcessInfo.tree}.
|
|
24
|
+
*
|
|
25
|
+
* @category Consumer Services
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
export interface ProcessTreeNode {
|
|
29
|
+
readonly pid: number;
|
|
30
|
+
/** Executable name (e.g. `"node"`), not a full command line. */
|
|
31
|
+
readonly command: string;
|
|
32
|
+
/** CPU% delta since the previous sample, per-core. 0 on the first sample after the process appears. */
|
|
33
|
+
readonly cpuPercent: number;
|
|
34
|
+
/** Resident memory in megabytes. */
|
|
35
|
+
readonly memoryMb: number;
|
|
36
|
+
readonly children: readonly ProcessTreeNode[];
|
|
37
|
+
}
|
|
21
38
|
/**
|
|
22
39
|
* Live view of what is currently running in one PTY session — the foreground
|
|
23
40
|
* process group as reported by the pty-host daemon every ~750 ms.
|
|
@@ -62,6 +79,13 @@ export interface ProcessInfo {
|
|
|
62
79
|
* Absent otherwise (no polling overhead when nobody needs it).
|
|
63
80
|
*/
|
|
64
81
|
readonly stats?: ProcessStats;
|
|
82
|
+
/**
|
|
83
|
+
* Process tree rooted at the foreground leader (the root node is the leader
|
|
84
|
+
* itself; descendants are found via parent edges, unioned on Unix with
|
|
85
|
+
* orphaned processes sharing the leader's process group). Only present while
|
|
86
|
+
* at least one extension holds `enableStats({ trees: true })`.
|
|
87
|
+
*/
|
|
88
|
+
readonly tree?: ProcessTreeNode;
|
|
65
89
|
}
|
|
66
90
|
/**
|
|
67
91
|
* Workspace process observability — a live read-only view of what is running
|
|
@@ -129,13 +153,20 @@ export interface ProcessesService {
|
|
|
129
153
|
/**
|
|
130
154
|
* Enable CPU + memory polling for all sessions in the active workspace.
|
|
131
155
|
* Returns a {@link Disposable} — **dispose it when done** to stop polling and
|
|
132
|
-
* remove `stats` from all {@link ProcessInfo} objects.
|
|
156
|
+
* remove `stats` (and `tree`) from all {@link ProcessInfo} objects.
|
|
157
|
+
*
|
|
158
|
+
* With `{ trees: true }`, each {@link ProcessInfo} additionally carries the
|
|
159
|
+
* descendant process tree rooted at its foreground leader (see
|
|
160
|
+
* {@link ProcessInfo.tree}) — built host-side from one shared process-table
|
|
161
|
+
* scan per tick, so it costs the same no matter how many extensions ask.
|
|
133
162
|
*
|
|
134
163
|
* Multiple callers share one poll loop (refcounted); the loop stops only when
|
|
135
164
|
* the last disposable is released. Polling interval is ~1500 ms.
|
|
136
165
|
*
|
|
137
166
|
* CPU% is `0` on the first sample; values stabilize after ~3 s.
|
|
138
167
|
*/
|
|
139
|
-
enableStats(
|
|
168
|
+
enableStats(options?: {
|
|
169
|
+
trees?: boolean;
|
|
170
|
+
}): Disposable;
|
|
140
171
|
}
|
|
141
172
|
//# sourceMappingURL=processes-service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processes-service.d.ts","sourceRoot":"","sources":["../src/processes-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAO1C;;;;;;;;;;GAUG;AACH,MAAM,WAAW,YAAY;IAC3B,gGAAgG;IAChG,GAAG,EAAE,MAAM,CAAC;IACZ,uFAAuF;IACvF,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B,kEAAkE;IAClE,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC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E,MAAM,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;;OAGG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yEAAyE;IACzE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,oEAAoE;IACpE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,eAAe,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,QAAQ,IAAI,WAAW,EAAE,CAAC;IAE1B;;;;;;;OAOG;IACH,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAE7D;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,UAAU,CAAC;IAEhE;;;;;;;;;;OAUG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAElC;;;;;;;;;;;;;;OAcG;IACH,WAAW,CAAC,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,UAAU,CAAC;CACxD"}
|
package/package.json
CHANGED
package/src/Tooltip.tsx
CHANGED
|
@@ -16,6 +16,10 @@ const MARGIN_PX = 8;
|
|
|
16
16
|
* The CSS classes (`.silo-tooltip`, `.silo-tooltip-host`) are provided by the
|
|
17
17
|
* host — no stylesheet import is needed in the extension.
|
|
18
18
|
*
|
|
19
|
+
* Pass `disabled` to keep the trigger wrapper mounted (so layout stays stable)
|
|
20
|
+
* while suppressing the popup — handy when the tooltip is only useful
|
|
21
|
+
* conditionally, e.g. showing the full label of a tab only once it's truncated.
|
|
22
|
+
*
|
|
19
23
|
* @example
|
|
20
24
|
* ```tsx
|
|
21
25
|
* <Tooltip content="New File">
|
|
@@ -31,9 +35,17 @@ const MARGIN_PX = 8;
|
|
|
31
35
|
export function Tooltip({
|
|
32
36
|
content,
|
|
33
37
|
children,
|
|
38
|
+
disabled = false,
|
|
34
39
|
}: {
|
|
40
|
+
/** Text shown in the popup. */
|
|
35
41
|
content: string;
|
|
42
|
+
/** The trigger element the tooltip is anchored to. */
|
|
36
43
|
children: ReactNode;
|
|
44
|
+
/**
|
|
45
|
+
* When `true`, the wrapper still renders (layout is unchanged) but the popup
|
|
46
|
+
* never appears. Defaults to `false`.
|
|
47
|
+
*/
|
|
48
|
+
disabled?: boolean;
|
|
37
49
|
}) {
|
|
38
50
|
const ref = useRef<HTMLSpanElement>(null);
|
|
39
51
|
const [anchor, setAnchor] = useState<{ cx: number; top: number } | null>(
|
|
@@ -42,6 +54,7 @@ export function Tooltip({
|
|
|
42
54
|
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
43
55
|
|
|
44
56
|
const show = () => {
|
|
57
|
+
if (disabled) return;
|
|
45
58
|
timer.current = setTimeout(() => {
|
|
46
59
|
const r = ref.current?.getBoundingClientRect();
|
|
47
60
|
if (r) setAnchor({ cx: r.left + r.width / 2, top: r.top - GAP_PX });
|
package/src/index.ts
CHANGED
package/src/processes-service.ts
CHANGED
|
@@ -25,6 +25,24 @@ export interface ProcessStats {
|
|
|
25
25
|
memoryMb: number;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/**
|
|
29
|
+
* One process in a session's descendant tree. Only produced while an extension
|
|
30
|
+
* holds `enableStats({ trees: true })` — see {@link ProcessInfo.tree}.
|
|
31
|
+
*
|
|
32
|
+
* @category Consumer Services
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export interface ProcessTreeNode {
|
|
36
|
+
readonly pid: number;
|
|
37
|
+
/** Executable name (e.g. `"node"`), not a full command line. */
|
|
38
|
+
readonly command: string;
|
|
39
|
+
/** CPU% delta since the previous sample, per-core. 0 on the first sample after the process appears. */
|
|
40
|
+
readonly cpuPercent: number;
|
|
41
|
+
/** Resident memory in megabytes. */
|
|
42
|
+
readonly memoryMb: number;
|
|
43
|
+
readonly children: readonly ProcessTreeNode[];
|
|
44
|
+
}
|
|
45
|
+
|
|
28
46
|
/**
|
|
29
47
|
* Live view of what is currently running in one PTY session — the foreground
|
|
30
48
|
* process group as reported by the pty-host daemon every ~750 ms.
|
|
@@ -69,6 +87,13 @@ export interface ProcessInfo {
|
|
|
69
87
|
* Absent otherwise (no polling overhead when nobody needs it).
|
|
70
88
|
*/
|
|
71
89
|
readonly stats?: ProcessStats;
|
|
90
|
+
/**
|
|
91
|
+
* Process tree rooted at the foreground leader (the root node is the leader
|
|
92
|
+
* itself; descendants are found via parent edges, unioned on Unix with
|
|
93
|
+
* orphaned processes sharing the leader's process group). Only present while
|
|
94
|
+
* at least one extension holds `enableStats({ trees: true })`.
|
|
95
|
+
*/
|
|
96
|
+
readonly tree?: ProcessTreeNode;
|
|
72
97
|
}
|
|
73
98
|
|
|
74
99
|
/**
|
|
@@ -141,12 +166,17 @@ export interface ProcessesService {
|
|
|
141
166
|
/**
|
|
142
167
|
* Enable CPU + memory polling for all sessions in the active workspace.
|
|
143
168
|
* Returns a {@link Disposable} — **dispose it when done** to stop polling and
|
|
144
|
-
* remove `stats` from all {@link ProcessInfo} objects.
|
|
169
|
+
* remove `stats` (and `tree`) from all {@link ProcessInfo} objects.
|
|
170
|
+
*
|
|
171
|
+
* With `{ trees: true }`, each {@link ProcessInfo} additionally carries the
|
|
172
|
+
* descendant process tree rooted at its foreground leader (see
|
|
173
|
+
* {@link ProcessInfo.tree}) — built host-side from one shared process-table
|
|
174
|
+
* scan per tick, so it costs the same no matter how many extensions ask.
|
|
145
175
|
*
|
|
146
176
|
* Multiple callers share one poll loop (refcounted); the loop stops only when
|
|
147
177
|
* the last disposable is released. Polling interval is ~1500 ms.
|
|
148
178
|
*
|
|
149
179
|
* CPU% is `0` on the first sample; values stabilize after ~3 s.
|
|
150
180
|
*/
|
|
151
|
-
enableStats(): Disposable;
|
|
181
|
+
enableStats(options?: { trees?: boolean }): Disposable;
|
|
152
182
|
}
|