@fabersep/memory 0.2.1 → 0.4.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.
@@ -0,0 +1,41 @@
1
+ export declare const DEFAULT_IDLE_TIMEOUT_MINUTES = 15;
2
+ export declare const SESSION_COOKIE_NAME = "faber_session";
3
+ export declare const WEB_CSP_HEADER = "default-src 'none'; script-src 'self'; style-src 'self'; img-src 'self' data:; connect-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'";
4
+ export type InitialWebView = 'auto' | 'review' | 'browse' | 'health';
5
+ export interface WebServerOptions {
6
+ homeDir?: string;
7
+ cwd?: string;
8
+ port?: number;
9
+ idleTimeoutMinutes?: number;
10
+ /** Test-only millisecond override for fast idle-timeout verification. */
11
+ idleTimeoutMsOverride?: number;
12
+ readOnly?: boolean;
13
+ initialView?: InitialWebView;
14
+ }
15
+ export interface RunningWebServer {
16
+ port: number;
17
+ host: '127.0.0.1';
18
+ token: string;
19
+ baseUrl: string;
20
+ authUrl: string;
21
+ readOnly: boolean;
22
+ idleTimeoutMs: number;
23
+ close: () => Promise<void>;
24
+ waitForClose: Promise<'stop' | 'idle' | 'signal' | 'close'>;
25
+ }
26
+ export declare function validatePortArg(raw: unknown): {
27
+ ok: true;
28
+ port: number;
29
+ } | {
30
+ ok: false;
31
+ error: string;
32
+ };
33
+ export declare function validateIdleTimeoutArg(raw: unknown): {
34
+ ok: true;
35
+ minutes: number;
36
+ } | {
37
+ ok: false;
38
+ error: string;
39
+ };
40
+ export declare function openBrowserBestEffort(url: string): boolean;
41
+ export declare function startWebServer(options?: WebServerOptions): Promise<RunningWebServer>;