@ulpi/browse 0.7.5 → 1.0.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/LICENSE +1 -1
- package/README.md +444 -300
- package/dist/browse.mjs +6756 -0
- package/package.json +17 -13
- package/skill/SKILL.md +114 -7
- package/bin/browse.ts +0 -11
- package/src/auth-vault.ts +0 -244
- package/src/browser-manager.ts +0 -961
- package/src/buffers.ts +0 -81
- package/src/bun.d.ts +0 -70
- package/src/cli.ts +0 -683
- package/src/commands/meta.ts +0 -748
- package/src/commands/read.ts +0 -347
- package/src/commands/write.ts +0 -484
- package/src/config.ts +0 -45
- package/src/constants.ts +0 -14
- package/src/diff.d.ts +0 -12
- package/src/domain-filter.ts +0 -140
- package/src/har.ts +0 -66
- package/src/install-skill.ts +0 -98
- package/src/png-compare.ts +0 -247
- package/src/policy.ts +0 -94
- package/src/rebrowser.d.ts +0 -7
- package/src/runtime.ts +0 -161
- package/src/sanitize.ts +0 -11
- package/src/server.ts +0 -485
- package/src/session-manager.ts +0 -192
- package/src/snapshot.ts +0 -606
- package/src/types.ts +0 -12
package/src/buffers.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared buffers and types — extracted to break circular dependency
|
|
3
|
-
* between server.ts and browser-manager.ts
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { DEFAULTS } from './constants';
|
|
7
|
-
|
|
8
|
-
export interface LogEntry {
|
|
9
|
-
timestamp: number;
|
|
10
|
-
level: string;
|
|
11
|
-
text: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface NetworkEntry {
|
|
15
|
-
timestamp: number;
|
|
16
|
-
method: string;
|
|
17
|
-
url: string;
|
|
18
|
-
status?: number;
|
|
19
|
-
duration?: number;
|
|
20
|
-
size?: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Per-session buffer container.
|
|
25
|
-
* Each session (or parallel agent) gets its own instance so buffers
|
|
26
|
-
* don't bleed across concurrent operations.
|
|
27
|
-
*/
|
|
28
|
-
export class SessionBuffers {
|
|
29
|
-
consoleBuffer: LogEntry[] = [];
|
|
30
|
-
networkBuffer: NetworkEntry[] = [];
|
|
31
|
-
consoleTotalAdded = 0;
|
|
32
|
-
networkTotalAdded = 0;
|
|
33
|
-
// Flush cursors — used by server.ts flush logic
|
|
34
|
-
lastConsoleFlushed = 0;
|
|
35
|
-
lastNetworkFlushed = 0;
|
|
36
|
-
|
|
37
|
-
addConsoleEntry(entry: LogEntry) {
|
|
38
|
-
if (this.consoleBuffer.length >= DEFAULTS.BUFFER_HIGH_WATER_MARK) {
|
|
39
|
-
this.consoleBuffer.shift();
|
|
40
|
-
}
|
|
41
|
-
this.consoleBuffer.push(entry);
|
|
42
|
-
this.consoleTotalAdded++;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
addNetworkEntry(entry: NetworkEntry) {
|
|
46
|
-
if (this.networkBuffer.length >= DEFAULTS.BUFFER_HIGH_WATER_MARK) {
|
|
47
|
-
this.networkBuffer.shift();
|
|
48
|
-
}
|
|
49
|
-
this.networkBuffer.push(entry);
|
|
50
|
-
this.networkTotalAdded++;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// ─── Default (singleton) buffers — backward compatibility ────────────
|
|
55
|
-
// Existing code that imports consoleBuffer, networkBuffer, addConsoleEntry,
|
|
56
|
-
// addNetworkEntry, consoleTotalAdded, networkTotalAdded continues to work
|
|
57
|
-
// unchanged against these module-level exports.
|
|
58
|
-
|
|
59
|
-
export const consoleBuffer: LogEntry[] = [];
|
|
60
|
-
export const networkBuffer: NetworkEntry[] = [];
|
|
61
|
-
|
|
62
|
-
// Total entries ever added — used by server.ts flush logic as a cursor
|
|
63
|
-
// that keeps advancing even after the ring buffer wraps.
|
|
64
|
-
export let consoleTotalAdded = 0;
|
|
65
|
-
export let networkTotalAdded = 0;
|
|
66
|
-
|
|
67
|
-
export function addConsoleEntry(entry: LogEntry) {
|
|
68
|
-
if (consoleBuffer.length >= DEFAULTS.BUFFER_HIGH_WATER_MARK) {
|
|
69
|
-
consoleBuffer.shift();
|
|
70
|
-
}
|
|
71
|
-
consoleBuffer.push(entry);
|
|
72
|
-
consoleTotalAdded++;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export function addNetworkEntry(entry: NetworkEntry) {
|
|
76
|
-
if (networkBuffer.length >= DEFAULTS.BUFFER_HIGH_WATER_MARK) {
|
|
77
|
-
networkBuffer.shift();
|
|
78
|
-
}
|
|
79
|
-
networkBuffer.push(entry);
|
|
80
|
-
networkTotalAdded++;
|
|
81
|
-
}
|
package/src/bun.d.ts
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bun runtime type declarations
|
|
3
|
-
*
|
|
4
|
-
* Covers the Bun globals used in this project so tsc --noEmit passes
|
|
5
|
-
* without pulling in the broken bun-types package.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
declare module 'bun' {
|
|
9
|
-
export function serve(options: {
|
|
10
|
-
port: number;
|
|
11
|
-
hostname?: string;
|
|
12
|
-
fetch: (req: Request) => Response | Promise<Response>;
|
|
13
|
-
}): BunServer;
|
|
14
|
-
|
|
15
|
-
export function spawn(cmd: string[], options?: {
|
|
16
|
-
stdio?: Array<'ignore' | 'pipe' | 'inherit'>;
|
|
17
|
-
stdout?: 'pipe' | 'ignore' | 'inherit';
|
|
18
|
-
stderr?: 'pipe' | 'ignore' | 'inherit';
|
|
19
|
-
stdin?: 'pipe' | 'ignore' | 'inherit';
|
|
20
|
-
env?: Record<string, string | undefined>;
|
|
21
|
-
}): BunSubprocess;
|
|
22
|
-
|
|
23
|
-
export function listen(options: {
|
|
24
|
-
hostname: string;
|
|
25
|
-
port: number;
|
|
26
|
-
socket: {
|
|
27
|
-
data: (...args: any[]) => void;
|
|
28
|
-
open?: (...args: any[]) => void;
|
|
29
|
-
close?: (...args: any[]) => void;
|
|
30
|
-
error?: (...args: any[]) => void;
|
|
31
|
-
};
|
|
32
|
-
}): BunTCPServer;
|
|
33
|
-
|
|
34
|
-
export function sleep(ms: number): Promise<void>;
|
|
35
|
-
|
|
36
|
-
export const stdin: { text(): Promise<string> };
|
|
37
|
-
|
|
38
|
-
interface BunServer {
|
|
39
|
-
port: number;
|
|
40
|
-
stop(): void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
interface BunTCPServer {
|
|
44
|
-
port: number;
|
|
45
|
-
stop(): void;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
interface BunSubprocess {
|
|
49
|
-
pid: number;
|
|
50
|
-
exitCode: number | null;
|
|
51
|
-
stderr: ReadableStream<Uint8Array> | null;
|
|
52
|
-
stdout: ReadableStream<Uint8Array> | null;
|
|
53
|
-
exited: Promise<number>;
|
|
54
|
-
kill(signal?: number): void;
|
|
55
|
-
unref(): void;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
declare var Bun: {
|
|
60
|
-
serve: typeof import('bun').serve;
|
|
61
|
-
spawn: typeof import('bun').spawn;
|
|
62
|
-
listen: typeof import('bun').listen;
|
|
63
|
-
sleep: typeof import('bun').sleep;
|
|
64
|
-
stdin: typeof import('bun').stdin;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
interface ImportMeta {
|
|
68
|
-
dir: string;
|
|
69
|
-
main: boolean;
|
|
70
|
-
}
|