@hyperframes/inspector 0.9.55 → 0.9.56
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/service.js +1022 -210
- package/dist/types/core/src/safePath.d.ts +4 -1
- package/dist/types/engine/src/services/publicNetwork/captureProxy.d.ts +13 -0
- package/dist/types/engine/src/services/publicNetwork/publicNetwork.d.ts +14 -0
- package/dist/types/engine/src/services/publicNetwork/upstreamProxy.d.ts +14 -0
- package/dist/types/engine/src/utils/browserSafePort.d.ts +8 -0
- package/dist/types/engine/src/utils/networkPolicy.d.ts +5 -0
- package/dist/types/inspector/src/pageServer.d.ts +1 -0
- package/dist/types/inspector/src/service.d.ts +4 -1
- package/package.json +5 -3
|
@@ -35,7 +35,10 @@ export declare function resolveWithinProject(base: string, relativePath: string)
|
|
|
35
35
|
/** Segments as Windows opens them: any case, no trailing dots or spaces, no `:stream` suffix. */
|
|
36
36
|
export declare function projectPathSegments(relPath: string): string[];
|
|
37
37
|
export declare function isVcsOrSecretPath(relPath: string): boolean;
|
|
38
|
-
/**
|
|
38
|
+
/** Credential files and tool or agent state, for a project-relative path in any spelling Windows opens. */
|
|
39
|
+
export declare function isCredentialOrToolStatePath(relPath: string): boolean;
|
|
40
|
+
/** Files no composition loads, for a project-relative path in any spelling Windows opens: git, env, credentials, tool
|
|
41
|
+
* state, app records. */
|
|
39
42
|
export declare function isStudioPrivatePath(relPath: string): boolean;
|
|
40
43
|
/** Whether `isPrivate` holds for a file under `projectDir`, spelled as given or with its links resolved. */
|
|
41
44
|
export declare function isPrivateFileUnder(projectDir: string, filePath: string, isPrivate: (relPath: string) => boolean): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type RefusedHostClass } from "./publicNetwork.js";
|
|
2
|
+
import { type UpstreamProxy } from "./upstreamProxy.js";
|
|
3
|
+
type OnRefused = (hostClass: RefusedHostClass) => void;
|
|
4
|
+
export declare function onRenderRefusal(listener: OnRefused): () => void;
|
|
5
|
+
export declare const logRefusal: OnRefused;
|
|
6
|
+
/** Every browser target uses this proxy; it dials a checked numeric IPv4, or (unless null) the upstream proxy. */
|
|
7
|
+
export declare function startCaptureProxy(upstream?: UpstreamProxy | null, onRefused?: OnRefused): Promise<{
|
|
8
|
+
url: string;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function browserProxyArgs(proxyUrl: string, directHost?: string): string[];
|
|
12
|
+
export declare function createPublicOnlyProfile(prefix: string): Promise<string>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type NonPublicIPv4Class } from "../../utils/networkPolicy.js";
|
|
2
|
+
/** IPv4-only (IPv6 fails closed), on the engine's special-use list so capture and downloads agree. */
|
|
3
|
+
export declare function isPublicIPv4(address: string): boolean;
|
|
4
|
+
export type RefusedHostClass = NonPublicIPv4Class | "internal-name" | "ipv6";
|
|
5
|
+
export declare class NonPublicHostError extends Error {
|
|
6
|
+
readonly hostClass: RefusedHostClass;
|
|
7
|
+
constructor(message: string, hostClass: RefusedHostClass);
|
|
8
|
+
}
|
|
9
|
+
export declare function assertPublicHostname(hostname: string): string;
|
|
10
|
+
/** Validate every A answer, then return a numeric peer that callers must dial directly. */
|
|
11
|
+
export declare function resolvePublicAddress(hostname: string): Promise<string>;
|
|
12
|
+
export declare function systemLookupInKillableChild(host: string, timeoutMs: number): Promise<string[]>;
|
|
13
|
+
/** Pinned asset transport, or the opt-in upstream proxy; redirects are returned for caller validation. */
|
|
14
|
+
export declare function publicRequest(url: string | URL, init?: RequestInit): Promise<Response>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Socket } from "node:net";
|
|
2
|
+
export interface UpstreamProxy {
|
|
3
|
+
host: string;
|
|
4
|
+
port: number;
|
|
5
|
+
authorization?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Unset means capture dials checked public peers itself; set, every capture request goes to this proxy. */
|
|
8
|
+
export declare function captureUpstreamProxy(env?: Readonly<Record<string, string | undefined>>): UpstreamProxy | undefined;
|
|
9
|
+
export declare function connectAuthority(target: URL): string;
|
|
10
|
+
/** Opens a CONNECT tunnel through the upstream proxy; resolves only on a 2xx reply. */
|
|
11
|
+
export declare function openUpstreamTunnel(proxy: UpstreamProxy, authority: string, options?: {
|
|
12
|
+
signal?: AbortSignal;
|
|
13
|
+
onSocket?: (socket: Socket) => void;
|
|
14
|
+
}): Promise<Socket>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Server } from "node:net";
|
|
2
|
+
export declare const isBrowserSafePort: (port: number) => boolean;
|
|
3
|
+
type Bindable = Pick<Server, "address" | "close" | "listen" | "once" | "off">;
|
|
4
|
+
/** Rebinds an already-listening server until the OS hands it a port a browser will load from. */
|
|
5
|
+
export declare function settleOnBrowserSafePort(server: Bindable, host: string): Promise<number>;
|
|
6
|
+
/** `server.listen(0, host)` that never lands on a port Chromium blocks; resolves to the bound port. */
|
|
7
|
+
export declare function listenOnBrowserSafePort(server: Bindable, host: string): Promise<number>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type NonPublicIPv4Class = "loopback" | "private" | "link-local" | "carrier-grade" | "reserved";
|
|
2
|
+
export declare function ipv4HostClass(address: string): NonPublicIPv4Class | "public";
|
|
3
|
+
export declare function carriedIPv4(address: string): string | undefined;
|
|
4
|
+
/** Literal-host policy shared by rendering and capture; DNS resolution remains trusted. */
|
|
5
|
+
export declare function isBlockedNetworkHost(hostname: string): boolean;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { Server } from "node:http";
|
|
2
2
|
export declare function closeServer(server: Server): Promise<void>;
|
|
3
3
|
export declare function isLoopbackHost(host: string | undefined): boolean;
|
|
4
|
+
export declare function servableProjectFile(project: string, urlPath: string): string | null;
|
|
@@ -9,7 +9,8 @@ export interface InspectorOptions {
|
|
|
9
9
|
export declare class Inspector {
|
|
10
10
|
readonly options: InspectorOptions;
|
|
11
11
|
private session?;
|
|
12
|
-
private
|
|
12
|
+
private host?;
|
|
13
|
+
private serve?;
|
|
13
14
|
private tail;
|
|
14
15
|
private timer?;
|
|
15
16
|
private closed;
|
|
@@ -25,6 +26,8 @@ export declare class Inspector {
|
|
|
25
26
|
constructor(project: string, options?: InspectorOptions);
|
|
26
27
|
private serialize;
|
|
27
28
|
private closeSession;
|
|
29
|
+
private openHost;
|
|
30
|
+
private closeHost;
|
|
28
31
|
private ensure;
|
|
29
32
|
private view;
|
|
30
33
|
private idle;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/inspector",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.56",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/heygen-com/hyperframes",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"htmlparser2": "^10.1.0",
|
|
44
44
|
"postcss": "^8.5.8",
|
|
45
45
|
"puppeteer-core": "^25.8.0",
|
|
46
|
-
"@hyperframes/core": "0.9.
|
|
47
|
-
"@hyperframes/parsers": "0.9.
|
|
46
|
+
"@hyperframes/core": "0.9.56",
|
|
47
|
+
"@hyperframes/parsers": "0.9.56"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/node": "^25.0.10",
|
|
@@ -56,6 +56,8 @@
|
|
|
56
56
|
"test": "vitest run",
|
|
57
57
|
"typecheck": "tsc --noEmit",
|
|
58
58
|
"serve": "bun run build && bun src/server.ts",
|
|
59
|
+
"test:egress": "bun tests/egress.ts",
|
|
60
|
+
"test:service-worker": "bun tests/serviceWorker.ts",
|
|
59
61
|
"test:timeline": "bun tests/timeline.ts",
|
|
60
62
|
"test:timeline-compositions": "bun tests/timelineCompositions.ts",
|
|
61
63
|
"test:live": "bun run build && bun tests/live.ts",
|