@opensteer/runtime-core 0.1.2 → 0.1.4
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/index.cjs +7599 -4857
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +365 -55
- package/dist/index.d.ts +365 -55
- package/dist/index.js +7591 -4858
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,61 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { OpensteerSemanticOperationName, OpensteerArtifactKind, ArtifactProvenance, TraceContext, HtmlSnapshot, DomSnapshot, CookieRecord, StorageSnapshot, ScriptSourceArtifactData, ArtifactRelation, ArtifactReference, OpensteerArtifact, OpensteerAuthRecipePayload, OpensteerRequestPlanPayload, OpensteerRequestPlanFreshness, OpensteerRecipePayload, OpensteerReverseCasePayload, OpensteerInteractionTracePayload, OpensteerReversePackagePayload, OpensteerReverseReportPayload, NetworkQueryRecord, NetworkResourceType, TraceOutcome, OpensteerEvent, OpensteerError, TraceRecord, TraceBundle, ReplayElementPath, OpensteerBrowserOptions, OpensteerBrowserLaunchOptions, OpensteerBrowserContextOptions, OpensteerSessionInfo, OpensteerOpenInput, OpensteerOpenOutput, OpensteerPageListInput, OpensteerPageListOutput, OpensteerPageNewInput, OpensteerPageNewOutput, OpensteerPageActivateInput, OpensteerPageActivateOutput, OpensteerPageCloseInput, OpensteerPageCloseOutput, OpensteerPageGotoInput, OpensteerPageGotoOutput, OpensteerPageEvaluateInput, OpensteerPageEvaluateOutput, OpensteerAddInitScriptInput, OpensteerAddInitScriptOutput, OpensteerPageSnapshotInput, OpensteerPageSnapshotOutput, OpensteerDomClickInput, OpensteerActionResult, OpensteerDomHoverInput, OpensteerDomInputInput, OpensteerDomScrollInput, OpensteerDomExtractInput, OpensteerDomExtractOutput, OpensteerNetworkQueryInput, OpensteerNetworkQueryOutput, OpensteerNetworkTagInput, OpensteerNetworkTagOutput, OpensteerNetworkClearInput, OpensteerNetworkClearOutput, OpensteerCaptureScriptsInput, OpensteerCaptureScriptsOutput, OpensteerNetworkMinimizeInput, OpensteerNetworkMinimizeOutput, OpensteerNetworkDiffInput, OpensteerNetworkDiffOutput, OpensteerArtifactReadInput, OpensteerArtifactReadOutput, OpensteerTransportProbeInput, OpensteerTransportProbeOutput, OpensteerReverseDiscoverInput, OpensteerReverseDiscoverOutput, OpensteerReverseQueryInput, OpensteerReverseQueryOutput, OpensteerReversePackageCreateInput, OpensteerReversePackageCreateOutput, OpensteerReversePackageRunInput, OpensteerReversePackageRunOutput, OpensteerReverseExportInput, OpensteerReverseExportOutput, OpensteerReverseReportInput, OpensteerReverseReportOutput, OpensteerReversePackageGetInput, OpensteerReversePackageGetOutput, OpensteerReversePackageListInput, OpensteerReversePackageListOutput, OpensteerReversePackagePatchInput, OpensteerReversePackagePatchOutput, OpensteerInteractionCaptureInput, OpensteerInteractionCaptureOutput, OpensteerInteractionGetInput, OpensteerInteractionGetOutput, OpensteerInteractionDiffInput, OpensteerInteractionDiffOutput, OpensteerInteractionReplayInput, OpensteerInteractionReplayOutput, OpensteerScriptBeautifyInput, OpensteerScriptBeautifyOutput, OpensteerScriptDeobfuscateInput, OpensteerScriptDeobfuscateOutput, OpensteerScriptSandboxInput, OpensteerScriptSandboxOutput, OpensteerCaptchaSolveInput, OpensteerCaptchaSolveOutput, OpensteerInferRequestPlanInput, OpensteerWriteRequestPlanInput, OpensteerGetRequestPlanInput, OpensteerListRequestPlansInput, OpensteerListRequestPlansOutput, OpensteerWriteAuthRecipeInput, OpensteerWriteRecipeInput, OpensteerGetAuthRecipeInput, OpensteerGetRecipeInput, OpensteerListAuthRecipesInput, OpensteerListAuthRecipesOutput, OpensteerListRecipesInput, OpensteerListRecipesOutput, OpensteerRunAuthRecipeInput, OpensteerRunAuthRecipeOutput, OpensteerRunRecipeInput, OpensteerRunRecipeOutput, OpensteerRawRequestInput, OpensteerRawRequestOutput, OpensteerRequestExecuteInput, OpensteerRequestExecuteOutput, OpensteerComputerExecuteInput, OpensteerComputerExecuteOutput, OpensteerSessionCloseOutput } from '@opensteer/protocol';
|
|
1
|
+
import { OpensteerArtifactKind, ArtifactProvenance, TraceContext, HtmlSnapshot, DomSnapshot, CookieRecord, StorageSnapshot, ScriptSourceArtifactData, ArtifactRelation, ArtifactReference, OpensteerArtifact, ExternalBinaryLocation, OpensteerSemanticOperationName, OpensteerAuthRecipePayload, OpensteerRequestPlanPayload, OpensteerRequestPlanFreshness, OpensteerRecipePayload, OpensteerReverseCasePayload, OpensteerInteractionTracePayload, OpensteerReversePackagePayload, OpensteerReverseReportPayload, NetworkQueryRecord, NetworkResourceType, ObservationSink, ObservationSession, ObservationEvent, ObservationArtifact, ObservabilityConfig, ObservabilityProfile, TraceOutcome, OpensteerEvent, OpensteerError, TraceRecord, TraceBundle, ReplayElementPath, OpensteerBrowserOptions, OpensteerBrowserLaunchOptions, OpensteerBrowserContextOptions, OpensteerSessionInfo, OpensteerOpenInput, OpensteerOpenOutput, OpensteerPageListInput, OpensteerPageListOutput, OpensteerPageNewInput, OpensteerPageNewOutput, OpensteerPageActivateInput, OpensteerPageActivateOutput, OpensteerPageCloseInput, OpensteerPageCloseOutput, OpensteerPageGotoInput, OpensteerPageGotoOutput, OpensteerPageEvaluateInput, OpensteerPageEvaluateOutput, OpensteerAddInitScriptInput, OpensteerAddInitScriptOutput, OpensteerPageSnapshotInput, OpensteerPageSnapshotOutput, OpensteerDomClickInput, OpensteerActionResult, OpensteerDomHoverInput, OpensteerDomInputInput, OpensteerDomScrollInput, OpensteerDomExtractInput, OpensteerDomExtractOutput, OpensteerNetworkQueryInput, OpensteerNetworkQueryOutput, OpensteerNetworkTagInput, OpensteerNetworkTagOutput, OpensteerNetworkClearInput, OpensteerNetworkClearOutput, OpensteerCaptureScriptsInput, OpensteerCaptureScriptsOutput, OpensteerNetworkMinimizeInput, OpensteerNetworkMinimizeOutput, OpensteerNetworkDiffInput, OpensteerNetworkDiffOutput, OpensteerArtifactReadInput, OpensteerArtifactReadOutput, OpensteerTransportProbeInput, OpensteerTransportProbeOutput, OpensteerReverseDiscoverInput, OpensteerReverseDiscoverOutput, OpensteerReverseQueryInput, OpensteerReverseQueryOutput, OpensteerReversePackageCreateInput, OpensteerReversePackageCreateOutput, OpensteerReversePackageRunInput, OpensteerReversePackageRunOutput, OpensteerReverseExportInput, OpensteerReverseExportOutput, OpensteerReverseReportInput, OpensteerReverseReportOutput, OpensteerReversePackageGetInput, OpensteerReversePackageGetOutput, OpensteerReversePackageListInput, OpensteerReversePackageListOutput, OpensteerReversePackagePatchInput, OpensteerReversePackagePatchOutput, OpensteerInteractionCaptureInput, OpensteerInteractionCaptureOutput, OpensteerInteractionGetInput, OpensteerInteractionGetOutput, OpensteerInteractionDiffInput, OpensteerInteractionDiffOutput, OpensteerInteractionReplayInput, OpensteerInteractionReplayOutput, OpensteerScriptBeautifyInput, OpensteerScriptBeautifyOutput, OpensteerScriptDeobfuscateInput, OpensteerScriptDeobfuscateOutput, OpensteerScriptSandboxInput, OpensteerScriptSandboxOutput, OpensteerCaptchaSolveInput, OpensteerCaptchaSolveOutput, OpensteerInferRequestPlanInput, OpensteerWriteRequestPlanInput, OpensteerGetRequestPlanInput, OpensteerListRequestPlansInput, OpensteerListRequestPlansOutput, OpensteerWriteAuthRecipeInput, OpensteerWriteRecipeInput, OpensteerGetAuthRecipeInput, OpensteerGetRecipeInput, OpensteerListAuthRecipesInput, OpensteerListAuthRecipesOutput, OpensteerListRecipesInput, OpensteerListRecipesOutput, OpensteerRunAuthRecipeInput, OpensteerRunAuthRecipeOutput, OpensteerRunRecipeInput, OpensteerRunRecipeOutput, OpensteerRawRequestInput, OpensteerRawRequestOutput, OpensteerRequestExecuteInput, OpensteerRequestExecuteOutput, OpensteerComputerExecuteInput, OpensteerComputerExecuteOutput, OpensteerSessionCloseOutput } from '@opensteer/protocol';
|
|
3
2
|
export { ReplayElementPath } from '@opensteer/protocol';
|
|
3
|
+
import { BrowserCoreEngine, PageRef, NetworkRecord, HeaderEntry, BodyPayload, SessionRef } from '@opensteer/browser-core';
|
|
4
4
|
|
|
5
5
|
declare const OPENSTEER_RUNTIME_CORE_VERSION: string;
|
|
6
6
|
|
|
7
|
-
interface TimeoutResolutionInput {
|
|
8
|
-
readonly operation: OpensteerSemanticOperationName;
|
|
9
|
-
readonly signal?: AbortSignal;
|
|
10
|
-
}
|
|
11
|
-
interface TimeoutPolicy {
|
|
12
|
-
resolveTimeoutMs(input: TimeoutResolutionInput): number | undefined;
|
|
13
|
-
}
|
|
14
|
-
type SettleTrigger = "navigation" | "dom-action" | "snapshot";
|
|
15
|
-
interface SettleDelayInput {
|
|
16
|
-
readonly operation: OpensteerSemanticOperationName;
|
|
17
|
-
readonly trigger: SettleTrigger;
|
|
18
|
-
}
|
|
19
|
-
interface SettleContext extends SettleDelayInput {
|
|
20
|
-
readonly engine: BrowserCoreEngine;
|
|
21
|
-
readonly pageRef: PageRef;
|
|
22
|
-
readonly signal: AbortSignal;
|
|
23
|
-
readonly remainingMs: number | undefined;
|
|
24
|
-
}
|
|
25
|
-
interface SettleObserver {
|
|
26
|
-
settle(input: SettleContext): Promise<boolean>;
|
|
27
|
-
}
|
|
28
|
-
interface SettlePolicy {
|
|
29
|
-
readonly observers?: readonly SettleObserver[];
|
|
30
|
-
resolveDelayMs(input: SettleDelayInput): number;
|
|
31
|
-
}
|
|
32
|
-
interface RetryEvaluationInput {
|
|
33
|
-
readonly operation: OpensteerSemanticOperationName;
|
|
34
|
-
readonly error: unknown;
|
|
35
|
-
}
|
|
36
|
-
interface RetryDecision {
|
|
37
|
-
readonly retry: false;
|
|
38
|
-
}
|
|
39
|
-
interface RetryPolicy {
|
|
40
|
-
evaluate(input: RetryEvaluationInput): RetryDecision | Promise<RetryDecision>;
|
|
41
|
-
}
|
|
42
|
-
interface FallbackEvaluationInput {
|
|
43
|
-
readonly operation: OpensteerSemanticOperationName;
|
|
44
|
-
readonly error: unknown;
|
|
45
|
-
}
|
|
46
|
-
interface FallbackDecision {
|
|
47
|
-
readonly fallback: false;
|
|
48
|
-
}
|
|
49
|
-
interface FallbackPolicy {
|
|
50
|
-
evaluate(input: FallbackEvaluationInput): FallbackDecision | Promise<FallbackDecision>;
|
|
51
|
-
}
|
|
52
|
-
interface OpensteerPolicy {
|
|
53
|
-
readonly timeout: TimeoutPolicy;
|
|
54
|
-
readonly settle: SettlePolicy;
|
|
55
|
-
readonly retry: RetryPolicy;
|
|
56
|
-
readonly fallback: FallbackPolicy;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
7
|
type ArtifactPayloadType = "structured" | "binary";
|
|
60
8
|
type ProtocolArtifactDelivery = "external" | "inline-if-structured";
|
|
61
9
|
interface ArtifactScope extends TraceContext {
|
|
@@ -132,6 +80,76 @@ interface OpensteerArtifactStore {
|
|
|
132
80
|
readonly delivery?: ProtocolArtifactDelivery;
|
|
133
81
|
}): Promise<OpensteerArtifact | undefined>;
|
|
134
82
|
}
|
|
83
|
+
declare class FilesystemArtifactStore implements OpensteerArtifactStore {
|
|
84
|
+
private readonly rootPath;
|
|
85
|
+
readonly manifestsDirectory: string;
|
|
86
|
+
readonly objectsDirectory: string;
|
|
87
|
+
constructor(rootPath: string);
|
|
88
|
+
initialize(): Promise<void>;
|
|
89
|
+
writeStructured(input: WriteStructuredArtifactInput): Promise<ArtifactManifest>;
|
|
90
|
+
writeBinary(input: WriteBinaryArtifactInput): Promise<ArtifactManifest>;
|
|
91
|
+
getManifest(artifactId: string): Promise<ArtifactManifest | undefined>;
|
|
92
|
+
read(artifactId: string): Promise<StoredArtifactRecord | undefined>;
|
|
93
|
+
toProtocolArtifactReference(artifactId: string, relation: ArtifactRelation): Promise<ArtifactReference | undefined>;
|
|
94
|
+
toProtocolArtifact(artifactId: string, options?: {
|
|
95
|
+
readonly delivery?: ProtocolArtifactDelivery;
|
|
96
|
+
}): Promise<OpensteerArtifact | undefined>;
|
|
97
|
+
private manifestPath;
|
|
98
|
+
}
|
|
99
|
+
declare function createArtifactStore(rootPath: string): FilesystemArtifactStore;
|
|
100
|
+
declare function manifestToExternalBinaryLocation(rootPath: string, manifest: Pick<ArtifactManifest, "objectRelativePath" | "mediaType" | "byteLength" | "sha256">): ExternalBinaryLocation;
|
|
101
|
+
|
|
102
|
+
interface TimeoutResolutionInput {
|
|
103
|
+
readonly operation: OpensteerSemanticOperationName;
|
|
104
|
+
readonly signal?: AbortSignal;
|
|
105
|
+
}
|
|
106
|
+
interface TimeoutPolicy {
|
|
107
|
+
resolveTimeoutMs(input: TimeoutResolutionInput): number | undefined;
|
|
108
|
+
}
|
|
109
|
+
type SettleTrigger = "navigation" | "dom-action" | "snapshot";
|
|
110
|
+
interface SettleDelayInput {
|
|
111
|
+
readonly operation: OpensteerSemanticOperationName;
|
|
112
|
+
readonly trigger: SettleTrigger;
|
|
113
|
+
}
|
|
114
|
+
interface SettleContext extends SettleDelayInput {
|
|
115
|
+
readonly engine: BrowserCoreEngine;
|
|
116
|
+
readonly pageRef: PageRef;
|
|
117
|
+
readonly signal: AbortSignal;
|
|
118
|
+
readonly remainingMs: number | undefined;
|
|
119
|
+
}
|
|
120
|
+
interface SettleObserver {
|
|
121
|
+
settle(input: SettleContext): Promise<boolean>;
|
|
122
|
+
}
|
|
123
|
+
interface SettlePolicy {
|
|
124
|
+
readonly observers?: readonly SettleObserver[];
|
|
125
|
+
resolveDelayMs(input: SettleDelayInput): number;
|
|
126
|
+
}
|
|
127
|
+
interface RetryEvaluationInput {
|
|
128
|
+
readonly operation: OpensteerSemanticOperationName;
|
|
129
|
+
readonly error: unknown;
|
|
130
|
+
}
|
|
131
|
+
interface RetryDecision {
|
|
132
|
+
readonly retry: false;
|
|
133
|
+
}
|
|
134
|
+
interface RetryPolicy {
|
|
135
|
+
evaluate(input: RetryEvaluationInput): RetryDecision | Promise<RetryDecision>;
|
|
136
|
+
}
|
|
137
|
+
interface FallbackEvaluationInput {
|
|
138
|
+
readonly operation: OpensteerSemanticOperationName;
|
|
139
|
+
readonly error: unknown;
|
|
140
|
+
}
|
|
141
|
+
interface FallbackDecision {
|
|
142
|
+
readonly fallback: false;
|
|
143
|
+
}
|
|
144
|
+
interface FallbackPolicy {
|
|
145
|
+
evaluate(input: FallbackEvaluationInput): FallbackDecision | Promise<FallbackDecision>;
|
|
146
|
+
}
|
|
147
|
+
interface OpensteerPolicy {
|
|
148
|
+
readonly timeout: TimeoutPolicy;
|
|
149
|
+
readonly settle: SettlePolicy;
|
|
150
|
+
readonly retry: RetryPolicy;
|
|
151
|
+
readonly fallback: FallbackPolicy;
|
|
152
|
+
}
|
|
135
153
|
|
|
136
154
|
type JsonPrimitive = boolean | number | string | null;
|
|
137
155
|
type JsonValue = JsonPrimitive | JsonObject | JsonArray;
|
|
@@ -312,6 +330,35 @@ interface SavedNetworkStore {
|
|
|
312
330
|
}): Promise<number>;
|
|
313
331
|
}
|
|
314
332
|
|
|
333
|
+
interface ListObservationEventsInput {
|
|
334
|
+
readonly kind?: ObservationEvent["kind"];
|
|
335
|
+
readonly phase?: ObservationEvent["phase"];
|
|
336
|
+
readonly correlationId?: string;
|
|
337
|
+
readonly pageRef?: string;
|
|
338
|
+
readonly afterSequence?: number;
|
|
339
|
+
readonly from?: number;
|
|
340
|
+
readonly to?: number;
|
|
341
|
+
readonly limit?: number;
|
|
342
|
+
}
|
|
343
|
+
interface ListObservationArtifactsInput {
|
|
344
|
+
readonly kind?: ObservationArtifact["kind"];
|
|
345
|
+
readonly pageRef?: string;
|
|
346
|
+
readonly limit?: number;
|
|
347
|
+
}
|
|
348
|
+
interface FilesystemObservationStore extends ObservationSink {
|
|
349
|
+
readonly sessionsDirectory: string;
|
|
350
|
+
initialize(): Promise<void>;
|
|
351
|
+
getSession(sessionId: string): Promise<ObservationSession | undefined>;
|
|
352
|
+
listEvents(sessionId: string, input?: ListObservationEventsInput): Promise<readonly ObservationEvent[]>;
|
|
353
|
+
listArtifacts(sessionId: string, input?: ListObservationArtifactsInput): Promise<readonly ObservationArtifact[]>;
|
|
354
|
+
getArtifact(sessionId: string, artifactId: string): Promise<ObservationArtifact | undefined>;
|
|
355
|
+
}
|
|
356
|
+
interface NormalizedObservabilityConfig extends ObservabilityConfig {
|
|
357
|
+
readonly profile: ObservabilityProfile;
|
|
358
|
+
}
|
|
359
|
+
declare function normalizeObservabilityConfig(input: Partial<ObservabilityConfig> | undefined): NormalizedObservabilityConfig;
|
|
360
|
+
declare function createObservationStore(rootPath: string, artifacts: OpensteerArtifactStore): FilesystemObservationStore;
|
|
361
|
+
|
|
315
362
|
interface TraceRunManifest {
|
|
316
363
|
readonly runId: string;
|
|
317
364
|
readonly createdAt: number;
|
|
@@ -378,6 +425,7 @@ interface OpensteerWorkspaceManifest {
|
|
|
378
425
|
readonly live: "live";
|
|
379
426
|
readonly artifacts: "artifacts";
|
|
380
427
|
readonly traces: "traces";
|
|
428
|
+
readonly observations: "observations";
|
|
381
429
|
readonly registry: "registry";
|
|
382
430
|
};
|
|
383
431
|
}
|
|
@@ -399,10 +447,12 @@ interface FilesystemOpensteerWorkspace {
|
|
|
399
447
|
readonly liveCloudPath: string;
|
|
400
448
|
readonly artifactsPath: string;
|
|
401
449
|
readonly tracesPath: string;
|
|
450
|
+
readonly observationsPath: string;
|
|
402
451
|
readonly registryPath: string;
|
|
403
452
|
readonly lockPath: string;
|
|
404
453
|
readonly artifacts: OpensteerArtifactStore;
|
|
405
454
|
readonly traces: OpensteerTraceStore;
|
|
455
|
+
readonly observations: FilesystemObservationStore;
|
|
406
456
|
readonly registry: {
|
|
407
457
|
readonly descriptors: DescriptorRegistryStore;
|
|
408
458
|
readonly requestPlans: RequestPlanRegistryStore;
|
|
@@ -609,6 +659,9 @@ interface OpensteerSessionRuntimeOptions {
|
|
|
609
659
|
};
|
|
610
660
|
readonly cleanupRootOnClose?: boolean;
|
|
611
661
|
readonly sessionInfo?: Partial<Omit<OpensteerSessionInfo, "sessionId" | "activePageRef">>;
|
|
662
|
+
readonly observability?: Partial<ObservabilityConfig>;
|
|
663
|
+
readonly observationSessionId?: string;
|
|
664
|
+
readonly observationSink?: ObservationSink;
|
|
612
665
|
}
|
|
613
666
|
interface RuntimeOperationOptions {
|
|
614
667
|
readonly signal?: AbortSignal;
|
|
@@ -625,6 +678,9 @@ declare class OpensteerSessionRuntime {
|
|
|
625
678
|
private readonly registryOverrides;
|
|
626
679
|
private readonly cleanupRootOnClose;
|
|
627
680
|
private readonly sessionInfoBase;
|
|
681
|
+
private observationConfig;
|
|
682
|
+
private readonly observationSessionId;
|
|
683
|
+
private readonly injectedObservationSink;
|
|
628
684
|
private root;
|
|
629
685
|
private engine;
|
|
630
686
|
private dom;
|
|
@@ -634,11 +690,15 @@ declare class OpensteerSessionRuntime {
|
|
|
634
690
|
private sessionRef;
|
|
635
691
|
private pageRef;
|
|
636
692
|
private runId;
|
|
693
|
+
private observations;
|
|
694
|
+
private readonly operationEventStorage;
|
|
695
|
+
private readonly pendingOperationEventCaptures;
|
|
637
696
|
private readonly cookieJars;
|
|
638
697
|
private readonly recipeCache;
|
|
639
698
|
private ownsEngine;
|
|
640
699
|
constructor(options: OpensteerSessionRuntimeOptions);
|
|
641
700
|
info(): Promise<OpensteerSessionInfo>;
|
|
701
|
+
setObservabilityConfig(input: Partial<ObservabilityConfig> | undefined): Promise<ObservabilityConfig>;
|
|
642
702
|
open(input?: OpensteerOpenInput, options?: RuntimeOperationOptions): Promise<OpensteerOpenOutput>;
|
|
643
703
|
listPages(input?: OpensteerPageListInput, options?: RuntimeOperationOptions): Promise<OpensteerPageListOutput>;
|
|
644
704
|
newPage(input?: OpensteerPageNewInput, options?: RuntimeOperationOptions): Promise<OpensteerPageNewOutput>;
|
|
@@ -813,7 +873,14 @@ declare class OpensteerSessionRuntime {
|
|
|
813
873
|
private appendTrace;
|
|
814
874
|
private cleanupSessionResources;
|
|
815
875
|
private resetRuntimeState;
|
|
876
|
+
private ensureObservationSession;
|
|
877
|
+
private resolveObservationSessionId;
|
|
816
878
|
private runWithOperationTimeout;
|
|
879
|
+
private wrapEngineWithObservationCapture;
|
|
880
|
+
private captureObservedStepEvents;
|
|
881
|
+
private recordPendingOperationEventCapture;
|
|
882
|
+
private consumePendingOperationEventCapture;
|
|
883
|
+
private drainPendingEngineEvents;
|
|
817
884
|
private navigatePage;
|
|
818
885
|
}
|
|
819
886
|
|
|
@@ -890,4 +957,247 @@ declare function dispatchSemanticOperation(runtime: OpensteerSemanticRuntime, op
|
|
|
890
957
|
readonly signal?: AbortSignal;
|
|
891
958
|
}): Promise<unknown>;
|
|
892
959
|
|
|
893
|
-
|
|
960
|
+
type RecordedActionKind = "navigate" | "click" | "dblclick" | "type" | "keypress" | "scroll" | "select-option" | "new-tab" | "close-tab" | "switch-tab" | "go-back" | "go-forward" | "reload";
|
|
961
|
+
interface NavigateRecordedActionDetail {
|
|
962
|
+
readonly kind: "navigate";
|
|
963
|
+
readonly url: string;
|
|
964
|
+
readonly source: "poll" | "push-state" | "replace-state" | "hashchange" | "history-traversal" | "full-navigation";
|
|
965
|
+
}
|
|
966
|
+
interface ClickRecordedActionDetail {
|
|
967
|
+
readonly kind: "click";
|
|
968
|
+
readonly button: number;
|
|
969
|
+
readonly modifiers: readonly string[];
|
|
970
|
+
}
|
|
971
|
+
interface DblclickRecordedActionDetail {
|
|
972
|
+
readonly kind: "dblclick";
|
|
973
|
+
}
|
|
974
|
+
interface TypeRecordedActionDetail {
|
|
975
|
+
readonly kind: "type";
|
|
976
|
+
readonly text: string;
|
|
977
|
+
}
|
|
978
|
+
interface KeypressRecordedActionDetail {
|
|
979
|
+
readonly kind: "keypress";
|
|
980
|
+
readonly key: string;
|
|
981
|
+
readonly modifiers: readonly string[];
|
|
982
|
+
}
|
|
983
|
+
interface ScrollRecordedActionDetail {
|
|
984
|
+
readonly kind: "scroll";
|
|
985
|
+
readonly deltaX: number;
|
|
986
|
+
readonly deltaY: number;
|
|
987
|
+
}
|
|
988
|
+
interface SelectOptionRecordedActionDetail {
|
|
989
|
+
readonly kind: "select-option";
|
|
990
|
+
readonly value: string;
|
|
991
|
+
readonly label?: string;
|
|
992
|
+
}
|
|
993
|
+
interface NewTabRecordedActionDetail {
|
|
994
|
+
readonly kind: "new-tab";
|
|
995
|
+
readonly openerPageId?: string;
|
|
996
|
+
readonly initialUrl: string;
|
|
997
|
+
}
|
|
998
|
+
interface CloseTabRecordedActionDetail {
|
|
999
|
+
readonly kind: "close-tab";
|
|
1000
|
+
}
|
|
1001
|
+
interface SwitchTabRecordedActionDetail {
|
|
1002
|
+
readonly kind: "switch-tab";
|
|
1003
|
+
readonly fromPageId?: string;
|
|
1004
|
+
readonly toPageId: string;
|
|
1005
|
+
}
|
|
1006
|
+
interface GoBackRecordedActionDetail {
|
|
1007
|
+
readonly kind: "go-back";
|
|
1008
|
+
readonly url: string;
|
|
1009
|
+
}
|
|
1010
|
+
interface GoForwardRecordedActionDetail {
|
|
1011
|
+
readonly kind: "go-forward";
|
|
1012
|
+
readonly url: string;
|
|
1013
|
+
}
|
|
1014
|
+
interface ReloadRecordedActionDetail {
|
|
1015
|
+
readonly kind: "reload";
|
|
1016
|
+
readonly url: string;
|
|
1017
|
+
}
|
|
1018
|
+
type RecordedActionDetail = NavigateRecordedActionDetail | ClickRecordedActionDetail | DblclickRecordedActionDetail | TypeRecordedActionDetail | KeypressRecordedActionDetail | ScrollRecordedActionDetail | SelectOptionRecordedActionDetail | NewTabRecordedActionDetail | CloseTabRecordedActionDetail | SwitchTabRecordedActionDetail | GoBackRecordedActionDetail | GoForwardRecordedActionDetail | ReloadRecordedActionDetail;
|
|
1019
|
+
interface RecordedActionBase<TKind extends RecordedActionKind, TDetail extends RecordedActionDetail> {
|
|
1020
|
+
readonly kind: TKind;
|
|
1021
|
+
readonly timestamp: number;
|
|
1022
|
+
readonly pageId: string;
|
|
1023
|
+
readonly pageUrl: string;
|
|
1024
|
+
readonly selector?: string;
|
|
1025
|
+
readonly detail: TDetail;
|
|
1026
|
+
}
|
|
1027
|
+
type NavigateRecordedAction = RecordedActionBase<"navigate", NavigateRecordedActionDetail>;
|
|
1028
|
+
type ClickRecordedAction = RecordedActionBase<"click", ClickRecordedActionDetail>;
|
|
1029
|
+
type DblclickRecordedAction = RecordedActionBase<"dblclick", DblclickRecordedActionDetail>;
|
|
1030
|
+
type TypeRecordedAction = RecordedActionBase<"type", TypeRecordedActionDetail>;
|
|
1031
|
+
type KeypressRecordedAction = RecordedActionBase<"keypress", KeypressRecordedActionDetail>;
|
|
1032
|
+
type ScrollRecordedAction = RecordedActionBase<"scroll", ScrollRecordedActionDetail>;
|
|
1033
|
+
type SelectOptionRecordedAction = RecordedActionBase<"select-option", SelectOptionRecordedActionDetail>;
|
|
1034
|
+
type NewTabRecordedAction = RecordedActionBase<"new-tab", NewTabRecordedActionDetail>;
|
|
1035
|
+
type CloseTabRecordedAction = RecordedActionBase<"close-tab", CloseTabRecordedActionDetail>;
|
|
1036
|
+
type SwitchTabRecordedAction = RecordedActionBase<"switch-tab", SwitchTabRecordedActionDetail>;
|
|
1037
|
+
type GoBackRecordedAction = RecordedActionBase<"go-back", GoBackRecordedActionDetail>;
|
|
1038
|
+
type GoForwardRecordedAction = RecordedActionBase<"go-forward", GoForwardRecordedActionDetail>;
|
|
1039
|
+
type ReloadRecordedAction = RecordedActionBase<"reload", ReloadRecordedActionDetail>;
|
|
1040
|
+
type RecordedAction = NavigateRecordedAction | ClickRecordedAction | DblclickRecordedAction | TypeRecordedAction | KeypressRecordedAction | ScrollRecordedAction | SelectOptionRecordedAction | NewTabRecordedAction | CloseTabRecordedAction | SwitchTabRecordedAction | GoBackRecordedAction | GoForwardRecordedAction | ReloadRecordedAction;
|
|
1041
|
+
interface RecordingOptions {
|
|
1042
|
+
readonly workspace: string;
|
|
1043
|
+
readonly outputPath?: string;
|
|
1044
|
+
readonly url: string;
|
|
1045
|
+
readonly pollIntervalMs?: number;
|
|
1046
|
+
}
|
|
1047
|
+
interface RecorderInitialPageState {
|
|
1048
|
+
readonly pageId: string;
|
|
1049
|
+
readonly initialUrl: string;
|
|
1050
|
+
readonly openerPageId?: string;
|
|
1051
|
+
}
|
|
1052
|
+
interface LocalReplayTarget {
|
|
1053
|
+
readonly kind: "local";
|
|
1054
|
+
readonly workspace: string;
|
|
1055
|
+
}
|
|
1056
|
+
interface CloudReplayTarget {
|
|
1057
|
+
readonly kind: "cloud";
|
|
1058
|
+
readonly baseUrlEnvVar?: string;
|
|
1059
|
+
readonly apiKeyEnvVar?: string;
|
|
1060
|
+
readonly browserProfileId?: string;
|
|
1061
|
+
readonly reuseBrowserProfileIfActive?: boolean;
|
|
1062
|
+
}
|
|
1063
|
+
type ReplayTarget = LocalReplayTarget | CloudReplayTarget;
|
|
1064
|
+
interface CodegenOptions {
|
|
1065
|
+
readonly actions: readonly RecordedAction[];
|
|
1066
|
+
readonly workspace?: string;
|
|
1067
|
+
readonly startUrl?: string;
|
|
1068
|
+
readonly initialPages?: readonly RecorderInitialPageState[];
|
|
1069
|
+
readonly activePageId?: string;
|
|
1070
|
+
readonly replayTarget?: ReplayTarget;
|
|
1071
|
+
}
|
|
1072
|
+
interface RecorderPageState {
|
|
1073
|
+
readonly pageId: string;
|
|
1074
|
+
readonly pageRef: string;
|
|
1075
|
+
readonly openerPageRef?: string;
|
|
1076
|
+
readonly openerPageId?: string;
|
|
1077
|
+
readonly currentUrl: string;
|
|
1078
|
+
}
|
|
1079
|
+
interface FlowRecorderSnapshot {
|
|
1080
|
+
readonly url: string;
|
|
1081
|
+
readonly focused: boolean;
|
|
1082
|
+
readonly visibilityState: "hidden" | "visible" | "prerender";
|
|
1083
|
+
readonly stopRequested: boolean;
|
|
1084
|
+
readonly events: readonly RawFlowRecorderEvent[];
|
|
1085
|
+
}
|
|
1086
|
+
interface RawFlowRecorderBaseEvent {
|
|
1087
|
+
readonly timestamp: number;
|
|
1088
|
+
readonly selector?: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface RawFlowRecorderNavigateEvent extends RawFlowRecorderBaseEvent {
|
|
1091
|
+
readonly kind: "navigate";
|
|
1092
|
+
readonly url: string;
|
|
1093
|
+
readonly source: "push-state" | "replace-state" | "hashchange" | "history-traversal" | "full-navigation";
|
|
1094
|
+
}
|
|
1095
|
+
interface RawFlowRecorderClickEvent extends RawFlowRecorderBaseEvent {
|
|
1096
|
+
readonly kind: "click";
|
|
1097
|
+
readonly selector: string;
|
|
1098
|
+
readonly button: number;
|
|
1099
|
+
readonly modifiers: readonly string[];
|
|
1100
|
+
}
|
|
1101
|
+
interface RawFlowRecorderDblclickEvent extends RawFlowRecorderBaseEvent {
|
|
1102
|
+
readonly kind: "dblclick";
|
|
1103
|
+
readonly selector: string;
|
|
1104
|
+
}
|
|
1105
|
+
interface RawFlowRecorderTypeEvent extends RawFlowRecorderBaseEvent {
|
|
1106
|
+
readonly kind: "type";
|
|
1107
|
+
readonly selector: string;
|
|
1108
|
+
readonly text: string;
|
|
1109
|
+
}
|
|
1110
|
+
interface RawFlowRecorderKeypressEvent extends RawFlowRecorderBaseEvent {
|
|
1111
|
+
readonly kind: "keypress";
|
|
1112
|
+
readonly key: string;
|
|
1113
|
+
readonly modifiers: readonly string[];
|
|
1114
|
+
readonly selector?: string;
|
|
1115
|
+
}
|
|
1116
|
+
interface RawFlowRecorderScrollEvent extends RawFlowRecorderBaseEvent {
|
|
1117
|
+
readonly kind: "scroll";
|
|
1118
|
+
readonly deltaX: number;
|
|
1119
|
+
readonly deltaY: number;
|
|
1120
|
+
readonly selector?: string;
|
|
1121
|
+
}
|
|
1122
|
+
interface RawFlowRecorderSelectOptionEvent extends RawFlowRecorderBaseEvent {
|
|
1123
|
+
readonly kind: "select-option";
|
|
1124
|
+
readonly selector: string;
|
|
1125
|
+
readonly value: string;
|
|
1126
|
+
readonly label?: string;
|
|
1127
|
+
}
|
|
1128
|
+
interface RawFlowRecorderReloadEvent extends RawFlowRecorderBaseEvent {
|
|
1129
|
+
readonly kind: "reload";
|
|
1130
|
+
readonly url: string;
|
|
1131
|
+
}
|
|
1132
|
+
interface RawFlowRecorderGoBackEvent extends RawFlowRecorderBaseEvent {
|
|
1133
|
+
readonly kind: "go-back";
|
|
1134
|
+
readonly url: string;
|
|
1135
|
+
}
|
|
1136
|
+
interface RawFlowRecorderGoForwardEvent extends RawFlowRecorderBaseEvent {
|
|
1137
|
+
readonly kind: "go-forward";
|
|
1138
|
+
readonly url: string;
|
|
1139
|
+
}
|
|
1140
|
+
type RawFlowRecorderEvent = RawFlowRecorderNavigateEvent | RawFlowRecorderClickEvent | RawFlowRecorderDblclickEvent | RawFlowRecorderTypeEvent | RawFlowRecorderKeypressEvent | RawFlowRecorderScrollEvent | RawFlowRecorderSelectOptionEvent | RawFlowRecorderReloadEvent | RawFlowRecorderGoBackEvent | RawFlowRecorderGoForwardEvent;
|
|
1141
|
+
|
|
1142
|
+
interface FlowRecorderInstallScriptOptions {
|
|
1143
|
+
readonly showStopButton?: boolean;
|
|
1144
|
+
}
|
|
1145
|
+
declare function createFlowRecorderInstallScript(options?: FlowRecorderInstallScriptOptions): string;
|
|
1146
|
+
declare const FLOW_RECORDER_INSTALL_SCRIPT: string;
|
|
1147
|
+
declare const FLOW_RECORDER_DRAIN_SCRIPT: string;
|
|
1148
|
+
|
|
1149
|
+
interface RecorderRuntimeAdapter {
|
|
1150
|
+
addInitScript(input: {
|
|
1151
|
+
readonly script: string;
|
|
1152
|
+
}): Promise<unknown>;
|
|
1153
|
+
evaluate(input: {
|
|
1154
|
+
readonly script: string;
|
|
1155
|
+
readonly pageRef?: string;
|
|
1156
|
+
}): Promise<unknown>;
|
|
1157
|
+
listPages(): Promise<{
|
|
1158
|
+
readonly pages: readonly {
|
|
1159
|
+
readonly pageRef: string;
|
|
1160
|
+
readonly url: string;
|
|
1161
|
+
readonly openerPageRef?: string;
|
|
1162
|
+
}[];
|
|
1163
|
+
}>;
|
|
1164
|
+
}
|
|
1165
|
+
interface FlowRecorderCollectorOptions {
|
|
1166
|
+
readonly pollIntervalMs?: number;
|
|
1167
|
+
readonly onAction?: (action: RecordedAction) => void | Promise<void>;
|
|
1168
|
+
readonly installScript?: string;
|
|
1169
|
+
}
|
|
1170
|
+
declare class FlowRecorderCollector {
|
|
1171
|
+
private readonly runtime;
|
|
1172
|
+
private readonly pollIntervalMs;
|
|
1173
|
+
private readonly onAction;
|
|
1174
|
+
private readonly installScript;
|
|
1175
|
+
private readonly pages;
|
|
1176
|
+
private readonly actions;
|
|
1177
|
+
private nextPageOrdinal;
|
|
1178
|
+
private runningLoop;
|
|
1179
|
+
private loopStopRequested;
|
|
1180
|
+
private stopDetected;
|
|
1181
|
+
private focusedPageId;
|
|
1182
|
+
private stopWaiters;
|
|
1183
|
+
constructor(runtime: RecorderRuntimeAdapter, options?: FlowRecorderCollectorOptions);
|
|
1184
|
+
install(): Promise<void>;
|
|
1185
|
+
start(): void;
|
|
1186
|
+
stop(): Promise<readonly RecordedAction[]>;
|
|
1187
|
+
getActions(): readonly RecordedAction[];
|
|
1188
|
+
getPages(): readonly RecorderPageState[];
|
|
1189
|
+
getFocusedPageId(): string | undefined;
|
|
1190
|
+
waitForStop(): Promise<void>;
|
|
1191
|
+
pollOnce(): Promise<readonly RecordedAction[]>;
|
|
1192
|
+
private runLoop;
|
|
1193
|
+
private readEvaluatedPages;
|
|
1194
|
+
private readSnapshot;
|
|
1195
|
+
private normalizePoll;
|
|
1196
|
+
private normalizeRawEvent;
|
|
1197
|
+
private ensureKnownPage;
|
|
1198
|
+
private updateKnownPage;
|
|
1199
|
+
}
|
|
1200
|
+
|
|
1201
|
+
declare function generateReplayScript(options: CodegenOptions): string;
|
|
1202
|
+
|
|
1203
|
+
export { type ArtifactManifest, type ArtifactPayloadType, type ArtifactScope, type AuthRecipeRecord, type AuthRecipeRegistryStore, type ClickRecordedActionDetail, type CloseTabRecordedActionDetail, type CloudReplayTarget, type CodegenOptions, type CreateFilesystemOpensteerWorkspaceOptions, type DblclickRecordedActionDetail, type DescriptorRecord, type DescriptorRegistryStore, type DomDescriptorPayload, type DomDescriptorRecord, type DomDescriptorStore, type DomReadDescriptorInput, type DomWriteDescriptorInput, FLOW_RECORDER_DRAIN_SCRIPT, FLOW_RECORDER_INSTALL_SCRIPT, FilesystemArtifactStore, type FilesystemObservationStore, type FilesystemOpensteerWorkspace, FlowRecorderCollector, type FlowRecorderCollectorOptions, type FlowRecorderSnapshot, type GoBackRecordedActionDetail, type GoForwardRecordedActionDetail, type InteractionTraceRecord, type InteractionTraceRegistryStore, type KeypressRecordedActionDetail, type ListObservationArtifactsInput, type ListObservationEventsInput, type ListRegistryRecordsInput, type LocalReplayTarget, type NavigateRecordedActionDetail, type NewTabRecordedActionDetail, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OPENSTEER_RUNTIME_CORE_VERSION, type OpensteerArtifactStore, type OpensteerEngineFactory, type OpensteerEngineFactoryOptions, type OpensteerExtractionDescriptorPayload, type OpensteerExtractionDescriptorRecord, type OpensteerExtractionDescriptorStore, type OpensteerRuntimeOperationOptions, type OpensteerRuntimeWorkspace, type OpensteerSemanticRuntime, OpensteerSessionRuntime, type OpensteerSessionRuntimeOptions, type OpensteerWorkspaceManifest, type ProtocolArtifactDelivery, type RawFlowRecorderClickEvent, type RawFlowRecorderDblclickEvent, type RawFlowRecorderEvent, type RawFlowRecorderGoBackEvent, type RawFlowRecorderGoForwardEvent, type RawFlowRecorderKeypressEvent, type RawFlowRecorderNavigateEvent, type RawFlowRecorderReloadEvent, type RawFlowRecorderScrollEvent, type RawFlowRecorderSelectOptionEvent, type RawFlowRecorderTypeEvent, type RecipeRecord, type RecipeRegistryStore, type RecordedAction, type RecordedActionDetail, type RecordedActionKind, type RecorderInitialPageState, type RecorderPageState, type RecorderRuntimeAdapter, type RecordingOptions, type RegistryProvenance, type ReloadRecordedActionDetail, type ReplayTarget, type RequestPlanFreshness, type RequestPlanRecord, type RequestPlanRegistryStore, type ResolveRegistryRecordInput, type ReverseCaseRecord, type ReverseCaseRegistryStore, type ReversePackageRecord, type ReversePackageRegistryStore, type ReverseReportRecord, type ReverseReportRegistryStore, type ScrollRecordedActionDetail, type SelectOptionRecordedActionDetail, type StoredArtifactPayload, type StoredArtifactRecord, type StructuredArtifactKind, type SwitchTabRecordedActionDetail, type TypeRecordedActionDetail, type UpdateRequestPlanFreshnessInput, type UpdateReverseCaseInput, type WriteAuthRecipeInput, type WriteBinaryArtifactInput, type WriteDescriptorInput, type WriteInteractionTraceInput, type WriteRecipeInput, type WriteRequestPlanInput, type WriteReverseCaseInput, type WriteReversePackageInput, type WriteReverseReportInput, type WriteStructuredArtifactInput, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, createArtifactStore, createDomDescriptorStore, createFilesystemOpensteerWorkspace, createFlowRecorderInstallScript, createObservationStore, createOpensteerExtractionDescriptorStore, dispatchSemanticOperation, generateReplayScript, hashDomDescriptorDescription, manifestToExternalBinaryLocation, normalizeObservabilityConfig, normalizeWorkspaceId, parseDomDescriptorRecord, parseExtractionDescriptorRecord, resolveFilesystemWorkspacePath, sanitizeReplayElementPath };
|