@opensteer/runtime-core 0.1.1 → 0.1.3

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.d.ts CHANGED
@@ -1,61 +1,9 @@
1
- import { BrowserCoreEngine, PageRef, NetworkRecord, HeaderEntry, BodyPayload, SessionRef } from '@opensteer/browser-core';
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, OpensteerNetworkSaveInput, OpensteerNetworkSaveOutput, 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;
@@ -278,9 +296,10 @@ interface ReverseReportRegistryStore {
278
296
  }
279
297
 
280
298
  interface SavedNetworkQueryInput {
299
+ readonly pageRef?: NetworkQueryRecord["record"]["pageRef"];
281
300
  readonly recordId?: string;
282
301
  readonly requestId?: string;
283
- readonly actionId?: string;
302
+ readonly capture?: string;
284
303
  readonly tag?: string;
285
304
  readonly url?: string;
286
305
  readonly hostname?: string;
@@ -291,19 +310,55 @@ interface SavedNetworkQueryInput {
291
310
  readonly includeBodies?: boolean;
292
311
  readonly limit?: number;
293
312
  }
313
+ type SavedNetworkBodyWriteMode = "authoritative" | "metadata-only";
314
+ interface SavedNetworkSaveOptions {
315
+ readonly bodyWriteMode: SavedNetworkBodyWriteMode;
316
+ readonly tag?: string;
317
+ }
294
318
  interface SavedNetworkStore {
295
319
  readonly databasePath: string;
296
320
  initialize(): Promise<void>;
297
- save(records: readonly NetworkQueryRecord[], tag?: string): Promise<number>;
321
+ save(records: readonly NetworkQueryRecord[], options: SavedNetworkSaveOptions): Promise<number>;
322
+ tagByFilter(filter: SavedNetworkQueryInput, tag: string): Promise<number>;
298
323
  query(input?: SavedNetworkQueryInput): Promise<readonly NetworkQueryRecord[]>;
299
324
  getByRecordId(recordId: string, options?: {
300
325
  readonly includeBodies?: boolean;
301
326
  }): Promise<NetworkQueryRecord | undefined>;
302
327
  clear(input?: {
328
+ readonly capture?: string;
303
329
  readonly tag?: string;
304
330
  }): Promise<number>;
305
331
  }
306
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
+
307
362
  interface TraceRunManifest {
308
363
  readonly runId: string;
309
364
  readonly createdAt: number;
@@ -370,6 +425,7 @@ interface OpensteerWorkspaceManifest {
370
425
  readonly live: "live";
371
426
  readonly artifacts: "artifacts";
372
427
  readonly traces: "traces";
428
+ readonly observations: "observations";
373
429
  readonly registry: "registry";
374
430
  };
375
431
  }
@@ -391,10 +447,12 @@ interface FilesystemOpensteerWorkspace {
391
447
  readonly liveCloudPath: string;
392
448
  readonly artifactsPath: string;
393
449
  readonly tracesPath: string;
450
+ readonly observationsPath: string;
394
451
  readonly registryPath: string;
395
452
  readonly lockPath: string;
396
453
  readonly artifacts: OpensteerArtifactStore;
397
454
  readonly traces: OpensteerTraceStore;
455
+ readonly observations: FilesystemObservationStore;
398
456
  readonly registry: {
399
457
  readonly descriptors: DescriptorRegistryStore;
400
458
  readonly requestPlans: RequestPlanRegistryStore;
@@ -596,9 +654,14 @@ interface OpensteerSessionRuntimeOptions {
596
654
  readonly requestPlans?: RequestPlanRegistryStore;
597
655
  readonly authRecipes?: AuthRecipeRegistryStore;
598
656
  readonly recipes?: RecipeRegistryStore;
657
+ readonly reverseCases?: ReverseCaseRegistryStore;
658
+ readonly reversePackages?: ReversePackageRegistryStore;
599
659
  };
600
660
  readonly cleanupRootOnClose?: boolean;
601
661
  readonly sessionInfo?: Partial<Omit<OpensteerSessionInfo, "sessionId" | "activePageRef">>;
662
+ readonly observability?: Partial<ObservabilityConfig>;
663
+ readonly observationSessionId?: string;
664
+ readonly observationSink?: ObservationSink;
602
665
  }
603
666
  interface RuntimeOperationOptions {
604
667
  readonly signal?: AbortSignal;
@@ -615,21 +678,27 @@ declare class OpensteerSessionRuntime {
615
678
  private readonly registryOverrides;
616
679
  private readonly cleanupRootOnClose;
617
680
  private readonly sessionInfoBase;
681
+ private observationConfig;
682
+ private readonly observationSessionId;
683
+ private readonly injectedObservationSink;
618
684
  private root;
619
685
  private engine;
620
686
  private dom;
621
687
  private computer;
622
- private readonly networkJournal;
688
+ private readonly networkHistory;
623
689
  private extractionDescriptors;
624
690
  private sessionRef;
625
691
  private pageRef;
626
692
  private runId;
627
- private readonly backgroundNetworkPersistence;
693
+ private observations;
694
+ private readonly operationEventStorage;
695
+ private readonly pendingOperationEventCaptures;
628
696
  private readonly cookieJars;
629
697
  private readonly recipeCache;
630
698
  private ownsEngine;
631
699
  constructor(options: OpensteerSessionRuntimeOptions);
632
700
  info(): Promise<OpensteerSessionInfo>;
701
+ setObservabilityConfig(input: Partial<ObservabilityConfig> | undefined): Promise<ObservabilityConfig>;
633
702
  open(input?: OpensteerOpenInput, options?: RuntimeOperationOptions): Promise<OpensteerOpenOutput>;
634
703
  listPages(input?: OpensteerPageListInput, options?: RuntimeOperationOptions): Promise<OpensteerPageListOutput>;
635
704
  newPage(input?: OpensteerPageNewInput, options?: RuntimeOperationOptions): Promise<OpensteerPageNewOutput>;
@@ -645,7 +714,7 @@ declare class OpensteerSessionRuntime {
645
714
  scroll(input: OpensteerDomScrollInput, options?: RuntimeOperationOptions): Promise<OpensteerActionResult>;
646
715
  extract(input: OpensteerDomExtractInput, options?: RuntimeOperationOptions): Promise<OpensteerDomExtractOutput>;
647
716
  queryNetwork(input?: OpensteerNetworkQueryInput, options?: RuntimeOperationOptions): Promise<OpensteerNetworkQueryOutput>;
648
- saveNetwork(input: OpensteerNetworkSaveInput, options?: RuntimeOperationOptions): Promise<OpensteerNetworkSaveOutput>;
717
+ tagNetwork(input: OpensteerNetworkTagInput, options?: RuntimeOperationOptions): Promise<OpensteerNetworkTagOutput>;
649
718
  clearNetwork(input?: OpensteerNetworkClearInput, options?: RuntimeOperationOptions): Promise<OpensteerNetworkClearOutput>;
650
719
  captureScripts(input?: OpensteerCaptureScriptsInput, options?: RuntimeOperationOptions): Promise<OpensteerCaptureScriptsOutput>;
651
720
  minimizeNetwork(input: OpensteerNetworkMinimizeInput, options?: RuntimeOperationOptions): Promise<OpensteerNetworkMinimizeOutput>;
@@ -720,8 +789,10 @@ declare class OpensteerSessionRuntime {
720
789
  private queryLiveNetwork;
721
790
  private captureScriptsInternal;
722
791
  private materializeCapturedScript;
792
+ private runMutationCapturedOperation;
723
793
  private beginMutationCapture;
724
- private completeMutationCapture;
794
+ private finalizeMutationCaptureBestEffort;
795
+ private completeMutationCaptureWithSignal;
725
796
  private resolveNetworkRecordByRecordId;
726
797
  private resolveCurrentStateSource;
727
798
  private resolveReverseCaseById;
@@ -737,7 +808,13 @@ declare class OpensteerSessionRuntime {
737
808
  private waitForMatchingReplayRecord;
738
809
  private isObservedReplayRecordSettled;
739
810
  private replayInteractionTraceById;
811
+ private readBrowserNetworkRecords;
740
812
  private readLiveNetworkRecords;
813
+ private persistLiveRequestIds;
814
+ private persistLiveRequestIdsWithSignal;
815
+ private syncPersistedNetworkSelection;
816
+ private toSavedNetworkQueryInput;
817
+ private toQueryInputFromTagInput;
741
818
  private readLiveRequestIds;
742
819
  private observeLiveTransportDelta;
743
820
  private executeTransportRequestWithJournal;
@@ -777,8 +854,7 @@ declare class OpensteerSessionRuntime {
777
854
  private updateCookieJarFromResponse;
778
855
  private readCookieValue;
779
856
  private readStorageValue;
780
- private scheduleBackgroundNetworkSaveByRequestIds;
781
- private flushBackgroundNetworkPersistence;
857
+ private flushPersistedNetworkHistory;
782
858
  private toDomTargetRef;
783
859
  private ensureRoot;
784
860
  private ensureEngine;
@@ -797,7 +873,14 @@ declare class OpensteerSessionRuntime {
797
873
  private appendTrace;
798
874
  private cleanupSessionResources;
799
875
  private resetRuntimeState;
876
+ private ensureObservationSession;
877
+ private resolveObservationSessionId;
800
878
  private runWithOperationTimeout;
879
+ private wrapEngineWithObservationCapture;
880
+ private captureObservedStepEvents;
881
+ private recordPendingOperationEventCapture;
882
+ private consumePendingOperationEventCapture;
883
+ private drainPendingEngineEvents;
801
884
  private navigatePage;
802
885
  }
803
886
 
@@ -821,7 +904,7 @@ interface OpensteerSemanticRuntime {
821
904
  scroll(input: OpensteerDomScrollInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerActionResult>;
822
905
  extract(input: OpensteerDomExtractInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerDomExtractOutput>;
823
906
  queryNetwork(input?: OpensteerNetworkQueryInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerNetworkQueryOutput>;
824
- saveNetwork(input: OpensteerNetworkSaveInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerNetworkSaveOutput>;
907
+ tagNetwork(input: OpensteerNetworkTagInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerNetworkTagOutput>;
825
908
  minimizeNetwork(input: OpensteerNetworkMinimizeInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerNetworkMinimizeOutput>;
826
909
  diffNetwork(input: OpensteerNetworkDiffInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerNetworkDiffOutput>;
827
910
  probeNetwork(input: OpensteerTransportProbeInput, options?: OpensteerRuntimeOperationOptions): Promise<OpensteerTransportProbeOutput>;
@@ -874,4 +957,247 @@ declare function dispatchSemanticOperation(runtime: OpensteerSemanticRuntime, op
874
957
  readonly signal?: AbortSignal;
875
958
  }): Promise<unknown>;
876
959
 
877
- export { type AuthRecipeRecord, type AuthRecipeRegistryStore, type CreateFilesystemOpensteerWorkspaceOptions, type DescriptorRecord, type DescriptorRegistryStore, type DomDescriptorPayload, type DomDescriptorRecord, type DomDescriptorStore, type DomReadDescriptorInput, type DomWriteDescriptorInput, type FilesystemOpensteerWorkspace, type InteractionTraceRecord, type InteractionTraceRegistryStore, type ListRegistryRecordsInput, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OPENSTEER_RUNTIME_CORE_VERSION, type OpensteerEngineFactory, type OpensteerEngineFactoryOptions, type OpensteerExtractionDescriptorPayload, type OpensteerExtractionDescriptorRecord, type OpensteerExtractionDescriptorStore, type OpensteerRuntimeOperationOptions, type OpensteerRuntimeWorkspace, type OpensteerSemanticRuntime, OpensteerSessionRuntime, type OpensteerSessionRuntimeOptions, type OpensteerWorkspaceManifest, type RecipeRecord, type RecipeRegistryStore, type RegistryProvenance, type RequestPlanFreshness, type RequestPlanRecord, type RequestPlanRegistryStore, type ResolveRegistryRecordInput, type UpdateRequestPlanFreshnessInput, type WriteAuthRecipeInput, type WriteRecipeInput, type WriteRequestPlanInput, buildDomDescriptorKey, buildDomDescriptorPayload, buildDomDescriptorVersion, createDomDescriptorStore, createFilesystemOpensteerWorkspace, createOpensteerExtractionDescriptorStore, dispatchSemanticOperation, hashDomDescriptorDescription, normalizeWorkspaceId, parseDomDescriptorRecord, parseExtractionDescriptorRecord, resolveFilesystemWorkspacePath, sanitizeReplayElementPath };
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 };