@devicerail/recorder 0.1.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 +201 -0
- package/README.md +111 -0
- package/dist/bundle-cli.d.ts +13 -0
- package/dist/bundle-cli.js +311 -0
- package/dist/canonical.d.ts +22 -0
- package/dist/canonical.js +174 -0
- package/dist/checkpoint.d.ts +28 -0
- package/dist/checkpoint.js +993 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.js +10 -0
- package/dist/event-log.d.ts +71 -0
- package/dist/event-log.js +860 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -0
- package/dist/recorder.d.ts +72 -0
- package/dist/recorder.js +607 -0
- package/dist/source-file.d.ts +25 -0
- package/dist/source-file.js +291 -0
- package/dist/types.d.ts +50 -0
- package/dist/types.js +2 -0
- package/package.json +53 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type DeviceRailClient } from "@devicerail/client";
|
|
2
|
+
import type { SystemDescribeResult } from "@devicerail/protocol";
|
|
3
|
+
import { type BundleSourceFile } from "./source-file.js";
|
|
4
|
+
import { type RecorderBundleReceipt, type RecorderCheckpoint, type RecorderPhase } from "./types.js";
|
|
5
|
+
export interface RecorderEventSource {
|
|
6
|
+
describe(): Promise<SystemDescribeResult>;
|
|
7
|
+
listEvents(sessionId: string, afterSequence: number | null, limit: number): Promise<readonly unknown[]>;
|
|
8
|
+
exportSession(sessionId: string): Promise<unknown>;
|
|
9
|
+
/** Optional negotiated bounded form of the authoritative Session export. */
|
|
10
|
+
exportSessionPage?(sessionId: string, afterSequence: number | null, limit: number): Promise<unknown>;
|
|
11
|
+
}
|
|
12
|
+
/** Public-protocol adapter; Session lifecycle remains owned by the host. */
|
|
13
|
+
export declare class DeviceRailRecorderEventSource implements RecorderEventSource {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(client: DeviceRailClient);
|
|
16
|
+
describe(): Promise<SystemDescribeResult>;
|
|
17
|
+
listEvents(sessionId: string, afterSequence: number | null, limit: number): Promise<readonly unknown[]>;
|
|
18
|
+
exportSession(sessionId: string): Promise<unknown>;
|
|
19
|
+
exportSessionPage(sessionId: string, afterSequence: number | null, limit: number): Promise<unknown>;
|
|
20
|
+
}
|
|
21
|
+
interface RecorderOpenBase {
|
|
22
|
+
readonly checkpointPath: string;
|
|
23
|
+
readonly sessionId: string;
|
|
24
|
+
readonly signal?: AbortSignal;
|
|
25
|
+
}
|
|
26
|
+
export type RecorderOpenOptions = RecorderOpenBase & ({
|
|
27
|
+
readonly client: DeviceRailClient;
|
|
28
|
+
readonly eventSource?: never;
|
|
29
|
+
} | {
|
|
30
|
+
readonly client?: never;
|
|
31
|
+
readonly eventSource: RecorderEventSource;
|
|
32
|
+
});
|
|
33
|
+
export interface RecorderCaptureResult {
|
|
34
|
+
readonly accepted: number;
|
|
35
|
+
readonly duplicates: number;
|
|
36
|
+
readonly lastSequence: number | null;
|
|
37
|
+
readonly phase: RecorderPhase;
|
|
38
|
+
}
|
|
39
|
+
export interface RecorderCaptureOptions {
|
|
40
|
+
readonly signal?: AbortSignal;
|
|
41
|
+
}
|
|
42
|
+
export interface RecorderCaptureUntilOptions extends RecorderCaptureOptions {
|
|
43
|
+
readonly pollIntervalMs?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface RecorderFinalizeOptions {
|
|
46
|
+
readonly executable: string;
|
|
47
|
+
readonly sourcePath: string;
|
|
48
|
+
readonly evidenceDirectory: string;
|
|
49
|
+
readonly outputDirectory: string;
|
|
50
|
+
readonly signal?: AbortSignal;
|
|
51
|
+
}
|
|
52
|
+
export interface RecorderOfflineOpenOptions {
|
|
53
|
+
readonly checkpointPath: string;
|
|
54
|
+
}
|
|
55
|
+
/** Durable, resumable consumer of one public Session event stream. */
|
|
56
|
+
export declare class ExecutionRecorder {
|
|
57
|
+
#private;
|
|
58
|
+
private constructor();
|
|
59
|
+
static open(options: RecorderOpenOptions): Promise<ExecutionRecorder>;
|
|
60
|
+
/** Reopen a sealed/completed checkpoint after the daemon has stopped. */
|
|
61
|
+
static openOffline(options: RecorderOfflineOpenOptions): Promise<ExecutionRecorder>;
|
|
62
|
+
get phase(): RecorderPhase;
|
|
63
|
+
get lastSequence(): number | null;
|
|
64
|
+
get checkpoint(): RecorderCheckpoint;
|
|
65
|
+
bundleSource(): BundleSourceFile;
|
|
66
|
+
captureOnce(options?: RecorderCaptureOptions): Promise<RecorderCaptureResult>;
|
|
67
|
+
captureUntilSealed(options?: RecorderCaptureUntilOptions): Promise<BundleSourceFile>;
|
|
68
|
+
seal(options?: RecorderCaptureOptions): Promise<BundleSourceFile>;
|
|
69
|
+
publishSource(path: string, options?: RecorderCaptureOptions): Promise<void>;
|
|
70
|
+
finalize(options: RecorderFinalizeOptions): Promise<RecorderBundleReceipt>;
|
|
71
|
+
}
|
|
72
|
+
export {};
|