@silo-code/sdk 0.23.1 → 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 +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/permissions.d.ts +6 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js.map +1 -1
- package/dist/processes-service.d.ts +33 -2
- package/dist/processes-service.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/webview-service.d.ts +164 -0
- package/dist/webview-service.d.ts.map +1 -0
- package/dist/webview-service.js +2 -0
- package/dist/webview-service.js.map +1 -0
- package/package.json +1 -1
- package/src/Tooltip.tsx +13 -0
- package/src/index.ts +12 -0
- package/src/permissions.ts +11 -1
- package/src/processes-service.ts +32 -2
- package/src/types.ts +8 -0
- package/src/webview-service.ts +178 -0
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,UAA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CACd,IACE,CACR,CAAC;AACJ,CAAC;AAED,SAAS,YAAY,CAAC,EACpB,OAAO,EACP,EAAE,EACF,SAAS,GAKV;IACC,MAAM,QAAQ,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAsB;QACtD,UAAU,EAAE,QAAQ;KACrB,CAAC,CAAC;IAEH,eAAe,CAAC,GAAG,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";
|
|
@@ -34,6 +34,7 @@ export { DND_MIME } from "./dnd-service.js";
|
|
|
34
34
|
export type { UiService, FileFilter, MenuItem, MenuItemTrailing, MenuSeparator, MenuHeader, MenuEntry, ShowMenuOptions, ConfirmOptions, PromptOptions, ModalOptions, NotifyAction, NotifyOptions, } from "./ui-service.js";
|
|
35
35
|
export { NetworkError } from "./network-service.js";
|
|
36
36
|
export type { NetworkService, NetworkRequestOptions, NetworkResponse, NetworkBytesResponse, } from "./network-service.js";
|
|
37
|
+
export type { WebviewService, WebFrame, WebviewNavType, WebviewNavigateEvent, WebviewRect, PickedElement, } from "./webview-service.js";
|
|
37
38
|
export type { SystemService, SystemInfo } from "./system-service.js";
|
|
38
39
|
export type { LogService, LogLevel } from "./output-service.js";
|
|
39
40
|
export type { ContextKeys } from "./context-keys.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,E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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"}
|
package/dist/permissions.d.ts
CHANGED
|
@@ -11,11 +11,16 @@
|
|
|
11
11
|
* - `network` — make outbound network requests. Declarative consent only until
|
|
12
12
|
* sandboxed execution lands (in-process code can reach the network directly);
|
|
13
13
|
* declare it so the capability is reviewable and shown at install.
|
|
14
|
+
* - `webview` — use {@link ExtensionContext.webview} to get real DOM access,
|
|
15
|
+
* script execution, and native pixel capture inside an iframe you own,
|
|
16
|
+
* including cross-origin content. Declare it because this reaches into
|
|
17
|
+
* arbitrary embedded pages, not because it touches the filesystem/network
|
|
18
|
+
* directly.
|
|
14
19
|
*
|
|
15
20
|
* @category Extension Contract
|
|
16
21
|
* @public
|
|
17
22
|
*/
|
|
18
|
-
export type Permission = "fs:read" | "fs:write" | "process" | "network";
|
|
23
|
+
export type Permission = "fs:read" | "fs:write" | "process" | "network" | "webview";
|
|
19
24
|
/**
|
|
20
25
|
* Thrown by {@link FileService} and {@link ProcessService} when an extension
|
|
21
26
|
* touches a path — or runs a process with a working directory — outside the open
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,UAAU,GAClB,SAAS,GACT,UAAU,GACV,SAAS,GACT,SAAS,GACT,SAAS,CAAC;AAEd;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAEV,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM;CAS3C"}
|
package/dist/permissions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;
|
|
1
|
+
{"version":3,"file":"permissions.js","sourceRoot":"","sources":["../src/permissions.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,6EAA6E;AAC7E,8EAA8E;AAC9E,qEAAqE;AA+BrE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAIxC,YAAY,IAAY,EAAE,OAAgB;QACxC,KAAK,CAAC,OAAO,IAAI,kCAAkC,IAAI,EAAE,CAAC,CAAC;QAJ7D,8DAA8D;QACrD;;;;;WAAa;QAIpB,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,4EAA4E;QAC5E,4EAA4E;QAC5E,yCAAyC;QACzC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IACzD,CAAC;CACF"}
|
|
@@ -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,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-service.js";
|
|
|
38
38
|
import type { DndService } from "./dnd-service.js";
|
|
39
39
|
import type { UiService } from "./ui-service.js";
|
|
40
40
|
import type { NetworkService } from "./network-service.js";
|
|
41
|
+
import type { WebviewService } from "./webview-service.js";
|
|
41
42
|
import type { SystemService } from "./system-service.js";
|
|
42
43
|
import type { LogService } from "./output-service.js";
|
|
43
44
|
import type { ExtensionStorage, ExtensionStorageScopes } from "./extension-storage.js";
|
|
@@ -616,6 +617,13 @@ export interface ExtensionContext {
|
|
|
616
617
|
* loading a URL. See {@link NetworkService} for the full API.
|
|
617
618
|
*/
|
|
618
619
|
readonly net: NetworkService;
|
|
620
|
+
/**
|
|
621
|
+
* Real DOM access, navigation control, and native pixel capture inside an
|
|
622
|
+
* `<iframe>` you own — including cross-origin content the browser's
|
|
623
|
+
* same-origin policy would otherwise fully sandbox. Requires the
|
|
624
|
+
* `"webview"` {@link Permission}. See {@link WebviewService}.
|
|
625
|
+
*/
|
|
626
|
+
readonly webview: WebviewService;
|
|
619
627
|
/**
|
|
620
628
|
* Static host-platform metadata — the OS, CPU architecture, and running Silo
|
|
621
629
|
* version. Values are baked into the binary at build time and never change
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,KAAK,EAAE,gBAA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;;;;OAKG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,SAAS,CAAC,GAAG,GAAG,OAAO;IACtC;;;;OAIG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;;OAKG;IACH,QAAQ,CAAC,GAAG,EAAE,gBAAgB,GAAG,GAAG,GAAG,IAAI,CAAC;IAC5C,gEAAgE;IAChE,UAAU,CAAC,IAAI,IAAI,CAAC;CACrB"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import type { Disposable } from "./types.js";
|
|
2
|
+
import type { Event } from "./event.js";
|
|
3
|
+
/**
|
|
4
|
+
* The kind of in-frame navigation reported by {@link WebFrame.onNavigate}.
|
|
5
|
+
*
|
|
6
|
+
* - `"load"` — a full document load (the initial navigation, or any
|
|
7
|
+
* non-SPA link click / `location.href` assignment).
|
|
8
|
+
* - `"push"` / `"replace"` — `history.pushState` / `history.replaceState`,
|
|
9
|
+
* the SPA route-change primitives (React Router, Vue Router, etc.).
|
|
10
|
+
* - `"pop"` — a `popstate` event (back/forward within the SPA).
|
|
11
|
+
* - `"hash"` — a `hashchange` event.
|
|
12
|
+
*
|
|
13
|
+
* @category Core Types
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
16
|
+
export type WebviewNavType = "push" | "replace" | "pop" | "load" | "hash";
|
|
17
|
+
/**
|
|
18
|
+
* One navigation event from {@link WebFrame.onNavigate}.
|
|
19
|
+
*
|
|
20
|
+
* @category Core Types
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export interface WebviewNavigateEvent {
|
|
24
|
+
/** The kind of navigation — see {@link WebviewNavType}. */
|
|
25
|
+
type: WebviewNavType;
|
|
26
|
+
/** The frame's URL after the navigation. */
|
|
27
|
+
url: string;
|
|
28
|
+
/**
|
|
29
|
+
* `true` on the first event reported by a freshly created document — i.e.
|
|
30
|
+
* this event is the result of a full document load, whoever initiated it.
|
|
31
|
+
* `false` for every subsequent event from the same document (SPA route
|
|
32
|
+
* changes, the page's own `replaceState` calls, hash changes).
|
|
33
|
+
*
|
|
34
|
+
* This matters because frameworks commonly call `history.replaceState`
|
|
35
|
+
* while booting, so a single full-page navigation can report a `"replace"`
|
|
36
|
+
* event *before* its `"load"`. Without this flag a consumer tracking its
|
|
37
|
+
* own history stack can't tell that boot-time `"replace"` (a brand-new
|
|
38
|
+
* page — usually a new history entry) apart from a genuine in-page
|
|
39
|
+
* `replaceState` (rewrite the current entry).
|
|
40
|
+
*/
|
|
41
|
+
newDocument: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A rectangle in frame-relative CSS pixels — the coordinate space
|
|
45
|
+
* `getBoundingClientRect()` returns inside the frame's own document. Used by
|
|
46
|
+
* {@link WebFrame.captureRect} (e.g. for a picked element or a marquee
|
|
47
|
+
* selection) and returned as part of {@link PickedElement}.
|
|
48
|
+
*
|
|
49
|
+
* @category Core Types
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export interface WebviewRect {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The result of {@link WebFrame.pickElement} — what the user clicked while
|
|
60
|
+
* picking.
|
|
61
|
+
*
|
|
62
|
+
* @category Core Types
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export interface PickedElement {
|
|
66
|
+
/** A CSS selector breadcrumb from `<html>` down to the clicked element (tag + up to 2 classes per level). */
|
|
67
|
+
selector: string;
|
|
68
|
+
/** The element's trimmed text content, truncated to 200 characters. */
|
|
69
|
+
text: string;
|
|
70
|
+
/** The element's frame-relative bounding rect — pass to {@link WebFrame.captureRect} to screenshot just this element. */
|
|
71
|
+
rect: WebviewRect;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A live connection to an embedded frame's content, returned by
|
|
75
|
+
* {@link WebviewService.attach}. Dispose it (or let `ctx.subscriptions`
|
|
76
|
+
* dispose it) when your panel unmounts.
|
|
77
|
+
*
|
|
78
|
+
* @category Consumer Services
|
|
79
|
+
* @public
|
|
80
|
+
*/
|
|
81
|
+
export interface WebFrame extends Disposable {
|
|
82
|
+
/** The frame's current URL, updated on every {@link onNavigate} event. `null` before the first load. */
|
|
83
|
+
readonly url: string | null;
|
|
84
|
+
/** Subscribe to in-frame navigation — the only way to track SPA route changes and full loads alike. See {@link WebviewNavType}. */
|
|
85
|
+
onNavigate: Event<WebviewNavigateEvent>;
|
|
86
|
+
/**
|
|
87
|
+
* Fires when a navigation lands on what looks like a frame-blocked page —
|
|
88
|
+
* sites sending `X-Frame-Options` / `frame-ancestors` don't error, WebKit
|
|
89
|
+
* (and other engines) just commit an empty document at the target URL, so
|
|
90
|
+
* this is a heuristic (empty title + no body content after load), not a
|
|
91
|
+
* definitive diagnosis. Treat it as "this page probably won't work
|
|
92
|
+
* embedded — offer to open it in a browser instead."
|
|
93
|
+
*/
|
|
94
|
+
onBlocked: Event<void>;
|
|
95
|
+
/** Navigate the frame back in its history, if possible. */
|
|
96
|
+
back(): void;
|
|
97
|
+
/** Navigate the frame forward in its history, if possible. */
|
|
98
|
+
forward(): void;
|
|
99
|
+
/** Reload the frame's current page. */
|
|
100
|
+
reload(): void;
|
|
101
|
+
/**
|
|
102
|
+
* Run JavaScript inside the frame and resolve with its result. A single
|
|
103
|
+
* expression's value is returned (e.g. `"document.title"`,
|
|
104
|
+
* `"location.href"`, `"document.querySelectorAll('a').length"`) — matching
|
|
105
|
+
* how a devtools console evaluates. Multi-statement code runs but only
|
|
106
|
+
* returns a value if it ends in an explicit `return`-compatible form.
|
|
107
|
+
* The result must be structured-clone-safe (no DOM nodes, functions, etc.).
|
|
108
|
+
*/
|
|
109
|
+
exec<T = unknown>(code: string): Promise<T>;
|
|
110
|
+
/**
|
|
111
|
+
* Enter interactive element-pick mode: the user hovers to highlight and
|
|
112
|
+
* clicks to select, or presses Escape to cancel. Resolves with the picked
|
|
113
|
+
* element, or `null` if cancelled. No timeout — this is inherently
|
|
114
|
+
* user-paced.
|
|
115
|
+
*/
|
|
116
|
+
pickElement(): Promise<PickedElement | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Cancel an in-flight {@link pickElement} call — exits pick mode in the
|
|
119
|
+
* frame and resolves the pending `pickElement()` promise with `null`. A
|
|
120
|
+
* no-op if no pick is active (including if it already ended, e.g. via
|
|
121
|
+
* Escape or a click).
|
|
122
|
+
*/
|
|
123
|
+
cancelPick(): void;
|
|
124
|
+
/** A native PNG snapshot of the frame's current visible viewport. */
|
|
125
|
+
capture(): Promise<Blob>;
|
|
126
|
+
/** A native PNG snapshot of a frame-relative sub-rect — e.g. a {@link PickedElement.rect} or a marquee selection. */
|
|
127
|
+
captureRect(rect: WebviewRect): Promise<Blob>;
|
|
128
|
+
/** A native PNG snapshot of the frame's entire scrollable document, stitched from scrolled captures. Scroll position is restored afterward. */
|
|
129
|
+
captureFullPage(): Promise<Blob>;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The webview-bridge domain, exposed as {@link ExtensionContext.webview}.
|
|
133
|
+
* Requires the `"webview"` {@link Permission}.
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```tsx
|
|
137
|
+
* function MyPanel({ ctx }: { ctx: ExtensionContext }) {
|
|
138
|
+
* const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
139
|
+
* const frameRef = useRef<WebFrame | null>(null);
|
|
140
|
+
*
|
|
141
|
+
* useEffect(() => {
|
|
142
|
+
* if (!iframeRef.current) return;
|
|
143
|
+
* const frame = ctx.webview.attach(iframeRef.current);
|
|
144
|
+
* frameRef.current = frame;
|
|
145
|
+
* const sub = frame.onNavigate((e) => console.log(e.type, e.url));
|
|
146
|
+
* return () => { sub.dispose(); frame.dispose(); };
|
|
147
|
+
* }, []);
|
|
148
|
+
*
|
|
149
|
+
* return <iframe ref={iframeRef} src="https://example.com" />;
|
|
150
|
+
* }
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @category Consumer Services
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export interface WebviewService {
|
|
157
|
+
/**
|
|
158
|
+
* Attach the bridge to an iframe your panel owns. The iframe can be
|
|
159
|
+
* cross-origin — that's the point. Returns a {@link WebFrame}; call
|
|
160
|
+
* `.dispose()` (or push it onto `ctx.subscriptions`) when done with it.
|
|
161
|
+
*/
|
|
162
|
+
attach(frame: HTMLIFrameElement): WebFrame;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=webview-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webview-service.d.ts","sourceRoot":"","sources":["../src/webview-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAWrC;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,IAAI,EAAE,cAAc,CAAC;IACrB,4CAA4C;IAC5C,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;;;;OAYG;IACH,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,6GAA6G;IAC7G,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,IAAI,EAAE,WAAW,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAS,SAAQ,UAAU;IAC1C,wGAAwG;IACxG,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,mIAAmI;IACnI,UAAU,EAAE,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC;;;;;;;OAOG;IACH,SAAS,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACvB,2DAA2D;IAC3D,IAAI,IAAI,IAAI,CAAC;IACb,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;IAChB,uCAAuC;IACvC,MAAM,IAAI,IAAI,CAAC;IACf;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC5C;;;;;OAKG;IACH,WAAW,IAAI,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,UAAU,IAAI,IAAI,CAAC;IACnB,qEAAqE;IACrE,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,qHAAqH;IACrH,WAAW,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,+IAA+I;IAC/I,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;OAIG;IACH,MAAM,CAAC,KAAK,EAAE,iBAAiB,GAAG,QAAQ,CAAC;CAC5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webview-service.js","sourceRoot":"","sources":["../src/webview-service.ts"],"names":[],"mappings":""}
|
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
|
@@ -93,6 +93,7 @@ export type {
|
|
|
93
93
|
ProcessesService,
|
|
94
94
|
ProcessInfo,
|
|
95
95
|
ProcessStats,
|
|
96
|
+
ProcessTreeNode,
|
|
96
97
|
} from "./processes-service";
|
|
97
98
|
export type {
|
|
98
99
|
TerminalService,
|
|
@@ -179,6 +180,17 @@ export type {
|
|
|
179
180
|
NetworkBytesResponse,
|
|
180
181
|
} from "./network-service";
|
|
181
182
|
|
|
183
|
+
// The webview-bridge domain: real DOM access, navigation control, and native
|
|
184
|
+
// pixel capture inside an iframe you own, including cross-origin content.
|
|
185
|
+
export type {
|
|
186
|
+
WebviewService,
|
|
187
|
+
WebFrame,
|
|
188
|
+
WebviewNavType,
|
|
189
|
+
WebviewNavigateEvent,
|
|
190
|
+
WebviewRect,
|
|
191
|
+
PickedElement,
|
|
192
|
+
} from "./webview-service";
|
|
193
|
+
|
|
182
194
|
// Static host-platform metadata: OS, CPU arch, and Silo version.
|
|
183
195
|
export type { SystemService, SystemInfo } from "./system-service";
|
|
184
196
|
|
package/src/permissions.ts
CHANGED
|
@@ -16,11 +16,21 @@
|
|
|
16
16
|
* - `network` — make outbound network requests. Declarative consent only until
|
|
17
17
|
* sandboxed execution lands (in-process code can reach the network directly);
|
|
18
18
|
* declare it so the capability is reviewable and shown at install.
|
|
19
|
+
* - `webview` — use {@link ExtensionContext.webview} to get real DOM access,
|
|
20
|
+
* script execution, and native pixel capture inside an iframe you own,
|
|
21
|
+
* including cross-origin content. Declare it because this reaches into
|
|
22
|
+
* arbitrary embedded pages, not because it touches the filesystem/network
|
|
23
|
+
* directly.
|
|
19
24
|
*
|
|
20
25
|
* @category Extension Contract
|
|
21
26
|
* @public
|
|
22
27
|
*/
|
|
23
|
-
export type Permission =
|
|
28
|
+
export type Permission =
|
|
29
|
+
| "fs:read"
|
|
30
|
+
| "fs:write"
|
|
31
|
+
| "process"
|
|
32
|
+
| "network"
|
|
33
|
+
| "webview";
|
|
24
34
|
|
|
25
35
|
/**
|
|
26
36
|
* Thrown by {@link FileService} and {@link ProcessService} when an extension
|
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
|
}
|
package/src/types.ts
CHANGED
|
@@ -38,6 +38,7 @@ import type { ThemeService, ThemePreset } from "./theme-service";
|
|
|
38
38
|
import type { DndService } from "./dnd-service";
|
|
39
39
|
import type { UiService } from "./ui-service";
|
|
40
40
|
import type { NetworkService } from "./network-service";
|
|
41
|
+
import type { WebviewService } from "./webview-service";
|
|
41
42
|
import type { SystemService } from "./system-service";
|
|
42
43
|
import type { LogService } from "./output-service";
|
|
43
44
|
import type {
|
|
@@ -639,6 +640,13 @@ export interface ExtensionContext {
|
|
|
639
640
|
* loading a URL. See {@link NetworkService} for the full API.
|
|
640
641
|
*/
|
|
641
642
|
readonly net: NetworkService;
|
|
643
|
+
/**
|
|
644
|
+
* Real DOM access, navigation control, and native pixel capture inside an
|
|
645
|
+
* `<iframe>` you own — including cross-origin content the browser's
|
|
646
|
+
* same-origin policy would otherwise fully sandbox. Requires the
|
|
647
|
+
* `"webview"` {@link Permission}. See {@link WebviewService}.
|
|
648
|
+
*/
|
|
649
|
+
readonly webview: WebviewService;
|
|
642
650
|
/**
|
|
643
651
|
* Static host-platform metadata — the OS, CPU architecture, and running Silo
|
|
644
652
|
* version. Values are baked into the binary at build time and never change
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import type { Disposable } from "./types";
|
|
2
|
+
import type { Event } from "./event";
|
|
3
|
+
|
|
4
|
+
// `ctx.webview` — real DOM access, navigation control, and native pixel
|
|
5
|
+
// capture inside an `<iframe>` your panel owns, including cross-origin
|
|
6
|
+
// content that the browser's same-origin policy would otherwise fully
|
|
7
|
+
// sandbox. The host achieves this by injecting a handshake-gated script into
|
|
8
|
+
// every frame (a Tauri all-frames init script reaches subframes the browser
|
|
9
|
+
// itself can't be reached from) and talking to it over `postMessage`; none of
|
|
10
|
+
// that machinery is visible here — `attach` just gives you a working
|
|
11
|
+
// `WebFrame`. Requires the `"webview"` {@link Permission}.
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The kind of in-frame navigation reported by {@link WebFrame.onNavigate}.
|
|
15
|
+
*
|
|
16
|
+
* - `"load"` — a full document load (the initial navigation, or any
|
|
17
|
+
* non-SPA link click / `location.href` assignment).
|
|
18
|
+
* - `"push"` / `"replace"` — `history.pushState` / `history.replaceState`,
|
|
19
|
+
* the SPA route-change primitives (React Router, Vue Router, etc.).
|
|
20
|
+
* - `"pop"` — a `popstate` event (back/forward within the SPA).
|
|
21
|
+
* - `"hash"` — a `hashchange` event.
|
|
22
|
+
*
|
|
23
|
+
* @category Core Types
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export type WebviewNavType = "push" | "replace" | "pop" | "load" | "hash";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* One navigation event from {@link WebFrame.onNavigate}.
|
|
30
|
+
*
|
|
31
|
+
* @category Core Types
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export interface WebviewNavigateEvent {
|
|
35
|
+
/** The kind of navigation — see {@link WebviewNavType}. */
|
|
36
|
+
type: WebviewNavType;
|
|
37
|
+
/** The frame's URL after the navigation. */
|
|
38
|
+
url: string;
|
|
39
|
+
/**
|
|
40
|
+
* `true` on the first event reported by a freshly created document — i.e.
|
|
41
|
+
* this event is the result of a full document load, whoever initiated it.
|
|
42
|
+
* `false` for every subsequent event from the same document (SPA route
|
|
43
|
+
* changes, the page's own `replaceState` calls, hash changes).
|
|
44
|
+
*
|
|
45
|
+
* This matters because frameworks commonly call `history.replaceState`
|
|
46
|
+
* while booting, so a single full-page navigation can report a `"replace"`
|
|
47
|
+
* event *before* its `"load"`. Without this flag a consumer tracking its
|
|
48
|
+
* own history stack can't tell that boot-time `"replace"` (a brand-new
|
|
49
|
+
* page — usually a new history entry) apart from a genuine in-page
|
|
50
|
+
* `replaceState` (rewrite the current entry).
|
|
51
|
+
*/
|
|
52
|
+
newDocument: boolean;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* A rectangle in frame-relative CSS pixels — the coordinate space
|
|
57
|
+
* `getBoundingClientRect()` returns inside the frame's own document. Used by
|
|
58
|
+
* {@link WebFrame.captureRect} (e.g. for a picked element or a marquee
|
|
59
|
+
* selection) and returned as part of {@link PickedElement}.
|
|
60
|
+
*
|
|
61
|
+
* @category Core Types
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface WebviewRect {
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The result of {@link WebFrame.pickElement} — what the user clicked while
|
|
73
|
+
* picking.
|
|
74
|
+
*
|
|
75
|
+
* @category Core Types
|
|
76
|
+
* @public
|
|
77
|
+
*/
|
|
78
|
+
export interface PickedElement {
|
|
79
|
+
/** A CSS selector breadcrumb from `<html>` down to the clicked element (tag + up to 2 classes per level). */
|
|
80
|
+
selector: string;
|
|
81
|
+
/** The element's trimmed text content, truncated to 200 characters. */
|
|
82
|
+
text: string;
|
|
83
|
+
/** The element's frame-relative bounding rect — pass to {@link WebFrame.captureRect} to screenshot just this element. */
|
|
84
|
+
rect: WebviewRect;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* A live connection to an embedded frame's content, returned by
|
|
89
|
+
* {@link WebviewService.attach}. Dispose it (or let `ctx.subscriptions`
|
|
90
|
+
* dispose it) when your panel unmounts.
|
|
91
|
+
*
|
|
92
|
+
* @category Consumer Services
|
|
93
|
+
* @public
|
|
94
|
+
*/
|
|
95
|
+
export interface WebFrame extends Disposable {
|
|
96
|
+
/** The frame's current URL, updated on every {@link onNavigate} event. `null` before the first load. */
|
|
97
|
+
readonly url: string | null;
|
|
98
|
+
/** Subscribe to in-frame navigation — the only way to track SPA route changes and full loads alike. See {@link WebviewNavType}. */
|
|
99
|
+
onNavigate: Event<WebviewNavigateEvent>;
|
|
100
|
+
/**
|
|
101
|
+
* Fires when a navigation lands on what looks like a frame-blocked page —
|
|
102
|
+
* sites sending `X-Frame-Options` / `frame-ancestors` don't error, WebKit
|
|
103
|
+
* (and other engines) just commit an empty document at the target URL, so
|
|
104
|
+
* this is a heuristic (empty title + no body content after load), not a
|
|
105
|
+
* definitive diagnosis. Treat it as "this page probably won't work
|
|
106
|
+
* embedded — offer to open it in a browser instead."
|
|
107
|
+
*/
|
|
108
|
+
onBlocked: Event<void>;
|
|
109
|
+
/** Navigate the frame back in its history, if possible. */
|
|
110
|
+
back(): void;
|
|
111
|
+
/** Navigate the frame forward in its history, if possible. */
|
|
112
|
+
forward(): void;
|
|
113
|
+
/** Reload the frame's current page. */
|
|
114
|
+
reload(): void;
|
|
115
|
+
/**
|
|
116
|
+
* Run JavaScript inside the frame and resolve with its result. A single
|
|
117
|
+
* expression's value is returned (e.g. `"document.title"`,
|
|
118
|
+
* `"location.href"`, `"document.querySelectorAll('a').length"`) — matching
|
|
119
|
+
* how a devtools console evaluates. Multi-statement code runs but only
|
|
120
|
+
* returns a value if it ends in an explicit `return`-compatible form.
|
|
121
|
+
* The result must be structured-clone-safe (no DOM nodes, functions, etc.).
|
|
122
|
+
*/
|
|
123
|
+
exec<T = unknown>(code: string): Promise<T>;
|
|
124
|
+
/**
|
|
125
|
+
* Enter interactive element-pick mode: the user hovers to highlight and
|
|
126
|
+
* clicks to select, or presses Escape to cancel. Resolves with the picked
|
|
127
|
+
* element, or `null` if cancelled. No timeout — this is inherently
|
|
128
|
+
* user-paced.
|
|
129
|
+
*/
|
|
130
|
+
pickElement(): Promise<PickedElement | null>;
|
|
131
|
+
/**
|
|
132
|
+
* Cancel an in-flight {@link pickElement} call — exits pick mode in the
|
|
133
|
+
* frame and resolves the pending `pickElement()` promise with `null`. A
|
|
134
|
+
* no-op if no pick is active (including if it already ended, e.g. via
|
|
135
|
+
* Escape or a click).
|
|
136
|
+
*/
|
|
137
|
+
cancelPick(): void;
|
|
138
|
+
/** A native PNG snapshot of the frame's current visible viewport. */
|
|
139
|
+
capture(): Promise<Blob>;
|
|
140
|
+
/** A native PNG snapshot of a frame-relative sub-rect — e.g. a {@link PickedElement.rect} or a marquee selection. */
|
|
141
|
+
captureRect(rect: WebviewRect): Promise<Blob>;
|
|
142
|
+
/** A native PNG snapshot of the frame's entire scrollable document, stitched from scrolled captures. Scroll position is restored afterward. */
|
|
143
|
+
captureFullPage(): Promise<Blob>;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The webview-bridge domain, exposed as {@link ExtensionContext.webview}.
|
|
148
|
+
* Requires the `"webview"` {@link Permission}.
|
|
149
|
+
*
|
|
150
|
+
* @example
|
|
151
|
+
* ```tsx
|
|
152
|
+
* function MyPanel({ ctx }: { ctx: ExtensionContext }) {
|
|
153
|
+
* const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
154
|
+
* const frameRef = useRef<WebFrame | null>(null);
|
|
155
|
+
*
|
|
156
|
+
* useEffect(() => {
|
|
157
|
+
* if (!iframeRef.current) return;
|
|
158
|
+
* const frame = ctx.webview.attach(iframeRef.current);
|
|
159
|
+
* frameRef.current = frame;
|
|
160
|
+
* const sub = frame.onNavigate((e) => console.log(e.type, e.url));
|
|
161
|
+
* return () => { sub.dispose(); frame.dispose(); };
|
|
162
|
+
* }, []);
|
|
163
|
+
*
|
|
164
|
+
* return <iframe ref={iframeRef} src="https://example.com" />;
|
|
165
|
+
* }
|
|
166
|
+
* ```
|
|
167
|
+
*
|
|
168
|
+
* @category Consumer Services
|
|
169
|
+
* @public
|
|
170
|
+
*/
|
|
171
|
+
export interface WebviewService {
|
|
172
|
+
/**
|
|
173
|
+
* Attach the bridge to an iframe your panel owns. The iframe can be
|
|
174
|
+
* cross-origin — that's the point. Returns a {@link WebFrame}; call
|
|
175
|
+
* `.dispose()` (or push it onto `ctx.subscriptions`) when done with it.
|
|
176
|
+
*/
|
|
177
|
+
attach(frame: HTMLIFrameElement): WebFrame;
|
|
178
|
+
}
|