@opensteer/engine-abp 0.8.2 → 0.8.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 +526 -245
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -3
- package/dist/index.d.ts +53 -3
- package/dist/index.js +526 -245
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -378,6 +378,27 @@ interface BrowserCapabilities {
|
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
interface PostLoadTrackerSnapshot {
|
|
382
|
+
readonly lastTrackedNetworkActivityAt: number;
|
|
383
|
+
readonly trackedPendingFetches: number;
|
|
384
|
+
readonly trackedPendingXhrs: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface ActionBoundarySnapshot {
|
|
388
|
+
readonly pageRef: PageRef;
|
|
389
|
+
readonly documentRef: DocumentRef;
|
|
390
|
+
readonly url?: string;
|
|
391
|
+
readonly tracker?: PostLoadTrackerSnapshot;
|
|
392
|
+
}
|
|
393
|
+
type ActionBoundarySettleTrigger = "dom-action" | "navigation";
|
|
394
|
+
type ActionBoundaryTimedOutPhase = "bootstrap";
|
|
395
|
+
interface ActionBoundaryOutcome {
|
|
396
|
+
readonly trigger: ActionBoundarySettleTrigger;
|
|
397
|
+
readonly crossDocument: boolean;
|
|
398
|
+
readonly bootstrapSettled: boolean;
|
|
399
|
+
readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
|
|
400
|
+
}
|
|
401
|
+
|
|
381
402
|
type ConsoleLevel = "debug" | "log" | "info" | "warn" | "error" | "trace";
|
|
382
403
|
interface StepEventBase {
|
|
383
404
|
readonly eventId: string;
|
|
@@ -675,6 +696,9 @@ interface BrowserExecutor {
|
|
|
675
696
|
}
|
|
676
697
|
interface BrowserInspector {
|
|
677
698
|
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
699
|
+
drainEvents(input: {
|
|
700
|
+
readonly pageRef: PageRef;
|
|
701
|
+
}): Promise<readonly StepEvent[]>;
|
|
678
702
|
listPages(input: {
|
|
679
703
|
readonly sessionRef: SessionRef;
|
|
680
704
|
}): Promise<readonly PageInfo[]>;
|
|
@@ -695,12 +719,22 @@ interface BrowserInspector {
|
|
|
695
719
|
readonly frameRef?: FrameRef;
|
|
696
720
|
readonly documentRef?: DocumentRef;
|
|
697
721
|
}): Promise<DomSnapshot>;
|
|
722
|
+
getActionBoundarySnapshot(input: {
|
|
723
|
+
readonly pageRef: PageRef;
|
|
724
|
+
}): Promise<ActionBoundarySnapshot>;
|
|
698
725
|
waitForVisualStability(input: {
|
|
699
726
|
readonly pageRef: PageRef;
|
|
700
727
|
readonly timeoutMs?: number;
|
|
701
728
|
readonly settleMs?: number;
|
|
702
729
|
readonly scope?: VisualStabilityScope;
|
|
703
730
|
}): Promise<void>;
|
|
731
|
+
waitForPostLoadQuiet(input: {
|
|
732
|
+
readonly pageRef: PageRef;
|
|
733
|
+
readonly timeoutMs?: number;
|
|
734
|
+
readonly quietMs?: number;
|
|
735
|
+
readonly captureWindowMs?: number;
|
|
736
|
+
readonly signal?: AbortSignal;
|
|
737
|
+
}): Promise<void>;
|
|
704
738
|
readText(input: NodeLocator): Promise<string | null>;
|
|
705
739
|
readAttributes(input: NodeLocator): Promise<readonly {
|
|
706
740
|
readonly name: string;
|
|
@@ -814,11 +848,12 @@ interface NormalizedComputerScreenshotOptions {
|
|
|
814
848
|
}
|
|
815
849
|
interface ComputerUseBridgeInput {
|
|
816
850
|
readonly pageRef: PageRef;
|
|
851
|
+
readonly snapshot?: ActionBoundarySnapshot;
|
|
817
852
|
readonly action: OpensteerComputerAction;
|
|
818
853
|
readonly screenshot: NormalizedComputerScreenshotOptions;
|
|
819
854
|
readonly signal: AbortSignal;
|
|
820
855
|
remainingMs(): number | undefined;
|
|
821
|
-
policySettle(pageRef: PageRef): Promise<void>;
|
|
856
|
+
policySettle(pageRef: PageRef, trigger: ActionBoundarySettleTrigger): Promise<void>;
|
|
822
857
|
}
|
|
823
858
|
interface ComputerUseBridgeOutput {
|
|
824
859
|
readonly pageRef: PageRef;
|
|
@@ -826,6 +861,7 @@ interface ComputerUseBridgeOutput {
|
|
|
826
861
|
readonly viewport: ViewportMetrics;
|
|
827
862
|
readonly events: readonly StepEvent[];
|
|
828
863
|
readonly timing: OpensteerComputerExecuteTiming;
|
|
864
|
+
readonly boundary?: ActionBoundaryOutcome;
|
|
829
865
|
}
|
|
830
866
|
interface ComputerUseBridge {
|
|
831
867
|
execute(input: ComputerUseBridgeInput): Promise<ComputerUseBridgeOutput>;
|
|
@@ -886,9 +922,10 @@ interface DomActionKeyPressInput {
|
|
|
886
922
|
}
|
|
887
923
|
interface DomActionSettleOptions {
|
|
888
924
|
readonly operation: "dom.click" | "dom.hover" | "dom.input" | "dom.scroll";
|
|
925
|
+
readonly snapshot?: ActionBoundarySnapshot;
|
|
889
926
|
readonly signal: AbortSignal;
|
|
890
927
|
remainingMs(): number | undefined;
|
|
891
|
-
policySettle(pageRef: PageRef): Promise<void>;
|
|
928
|
+
policySettle(pageRef: PageRef, trigger: ActionBoundarySettleTrigger): Promise<void>;
|
|
892
929
|
}
|
|
893
930
|
type DomPointerHitRelation = "self" | "descendant" | "ancestor" | "same-owner" | "outside" | "unknown";
|
|
894
931
|
interface DomPointerHitAssessment {
|
|
@@ -910,7 +947,7 @@ interface DomActionBridge {
|
|
|
910
947
|
scrollNodeIntoView(locator: NodeLocator, options?: DomActionScrollOptions): Promise<void>;
|
|
911
948
|
focusNode(locator: NodeLocator): Promise<void>;
|
|
912
949
|
pressKey(locator: NodeLocator, input: DomActionKeyPressInput): Promise<void>;
|
|
913
|
-
finalizeDomAction(pageRef: PageRef, options: DomActionSettleOptions): Promise<
|
|
950
|
+
finalizeDomAction(pageRef: PageRef, options: DomActionSettleOptions): Promise<ActionBoundaryOutcome>;
|
|
914
951
|
}
|
|
915
952
|
|
|
916
953
|
interface AbpLaunchOptions {
|
|
@@ -1061,6 +1098,9 @@ declare class AbpBrowserCoreEngine implements BrowserCoreEngine {
|
|
|
1061
1098
|
listPages(input: {
|
|
1062
1099
|
readonly sessionRef: SessionRef;
|
|
1063
1100
|
}): Promise<readonly PageInfo[]>;
|
|
1101
|
+
drainEvents(input: {
|
|
1102
|
+
readonly pageRef: PageRef;
|
|
1103
|
+
}): Promise<readonly StepEvent[]>;
|
|
1064
1104
|
listFrames(input: {
|
|
1065
1105
|
readonly pageRef: PageRef;
|
|
1066
1106
|
}): Promise<readonly FrameInfo[]>;
|
|
@@ -1078,12 +1118,22 @@ declare class AbpBrowserCoreEngine implements BrowserCoreEngine {
|
|
|
1078
1118
|
readonly frameRef?: FrameRef;
|
|
1079
1119
|
readonly documentRef?: DocumentRef;
|
|
1080
1120
|
}): Promise<DomSnapshot>;
|
|
1121
|
+
getActionBoundarySnapshot(input: {
|
|
1122
|
+
readonly pageRef: PageRef;
|
|
1123
|
+
}): Promise<ActionBoundarySnapshot>;
|
|
1081
1124
|
waitForVisualStability(input: {
|
|
1082
1125
|
readonly pageRef: PageRef;
|
|
1083
1126
|
readonly timeoutMs?: number;
|
|
1084
1127
|
readonly settleMs?: number;
|
|
1085
1128
|
readonly scope?: "main-frame" | "visible-frames";
|
|
1086
1129
|
}): Promise<void>;
|
|
1130
|
+
waitForPostLoadQuiet(input: {
|
|
1131
|
+
readonly pageRef: PageRef;
|
|
1132
|
+
readonly timeoutMs?: number;
|
|
1133
|
+
readonly quietMs?: number;
|
|
1134
|
+
readonly captureWindowMs?: number;
|
|
1135
|
+
readonly signal?: AbortSignal;
|
|
1136
|
+
}): Promise<void>;
|
|
1087
1137
|
readText(input: NodeLocator): Promise<string | null>;
|
|
1088
1138
|
readAttributes(input: NodeLocator): Promise<readonly {
|
|
1089
1139
|
readonly name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -378,6 +378,27 @@ interface BrowserCapabilities {
|
|
|
378
378
|
};
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
+
interface PostLoadTrackerSnapshot {
|
|
382
|
+
readonly lastTrackedNetworkActivityAt: number;
|
|
383
|
+
readonly trackedPendingFetches: number;
|
|
384
|
+
readonly trackedPendingXhrs: number;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface ActionBoundarySnapshot {
|
|
388
|
+
readonly pageRef: PageRef;
|
|
389
|
+
readonly documentRef: DocumentRef;
|
|
390
|
+
readonly url?: string;
|
|
391
|
+
readonly tracker?: PostLoadTrackerSnapshot;
|
|
392
|
+
}
|
|
393
|
+
type ActionBoundarySettleTrigger = "dom-action" | "navigation";
|
|
394
|
+
type ActionBoundaryTimedOutPhase = "bootstrap";
|
|
395
|
+
interface ActionBoundaryOutcome {
|
|
396
|
+
readonly trigger: ActionBoundarySettleTrigger;
|
|
397
|
+
readonly crossDocument: boolean;
|
|
398
|
+
readonly bootstrapSettled: boolean;
|
|
399
|
+
readonly timedOutPhase?: ActionBoundaryTimedOutPhase;
|
|
400
|
+
}
|
|
401
|
+
|
|
381
402
|
type ConsoleLevel = "debug" | "log" | "info" | "warn" | "error" | "trace";
|
|
382
403
|
interface StepEventBase {
|
|
383
404
|
readonly eventId: string;
|
|
@@ -675,6 +696,9 @@ interface BrowserExecutor {
|
|
|
675
696
|
}
|
|
676
697
|
interface BrowserInspector {
|
|
677
698
|
readonly capabilities: Readonly<BrowserCapabilities>;
|
|
699
|
+
drainEvents(input: {
|
|
700
|
+
readonly pageRef: PageRef;
|
|
701
|
+
}): Promise<readonly StepEvent[]>;
|
|
678
702
|
listPages(input: {
|
|
679
703
|
readonly sessionRef: SessionRef;
|
|
680
704
|
}): Promise<readonly PageInfo[]>;
|
|
@@ -695,12 +719,22 @@ interface BrowserInspector {
|
|
|
695
719
|
readonly frameRef?: FrameRef;
|
|
696
720
|
readonly documentRef?: DocumentRef;
|
|
697
721
|
}): Promise<DomSnapshot>;
|
|
722
|
+
getActionBoundarySnapshot(input: {
|
|
723
|
+
readonly pageRef: PageRef;
|
|
724
|
+
}): Promise<ActionBoundarySnapshot>;
|
|
698
725
|
waitForVisualStability(input: {
|
|
699
726
|
readonly pageRef: PageRef;
|
|
700
727
|
readonly timeoutMs?: number;
|
|
701
728
|
readonly settleMs?: number;
|
|
702
729
|
readonly scope?: VisualStabilityScope;
|
|
703
730
|
}): Promise<void>;
|
|
731
|
+
waitForPostLoadQuiet(input: {
|
|
732
|
+
readonly pageRef: PageRef;
|
|
733
|
+
readonly timeoutMs?: number;
|
|
734
|
+
readonly quietMs?: number;
|
|
735
|
+
readonly captureWindowMs?: number;
|
|
736
|
+
readonly signal?: AbortSignal;
|
|
737
|
+
}): Promise<void>;
|
|
704
738
|
readText(input: NodeLocator): Promise<string | null>;
|
|
705
739
|
readAttributes(input: NodeLocator): Promise<readonly {
|
|
706
740
|
readonly name: string;
|
|
@@ -814,11 +848,12 @@ interface NormalizedComputerScreenshotOptions {
|
|
|
814
848
|
}
|
|
815
849
|
interface ComputerUseBridgeInput {
|
|
816
850
|
readonly pageRef: PageRef;
|
|
851
|
+
readonly snapshot?: ActionBoundarySnapshot;
|
|
817
852
|
readonly action: OpensteerComputerAction;
|
|
818
853
|
readonly screenshot: NormalizedComputerScreenshotOptions;
|
|
819
854
|
readonly signal: AbortSignal;
|
|
820
855
|
remainingMs(): number | undefined;
|
|
821
|
-
policySettle(pageRef: PageRef): Promise<void>;
|
|
856
|
+
policySettle(pageRef: PageRef, trigger: ActionBoundarySettleTrigger): Promise<void>;
|
|
822
857
|
}
|
|
823
858
|
interface ComputerUseBridgeOutput {
|
|
824
859
|
readonly pageRef: PageRef;
|
|
@@ -826,6 +861,7 @@ interface ComputerUseBridgeOutput {
|
|
|
826
861
|
readonly viewport: ViewportMetrics;
|
|
827
862
|
readonly events: readonly StepEvent[];
|
|
828
863
|
readonly timing: OpensteerComputerExecuteTiming;
|
|
864
|
+
readonly boundary?: ActionBoundaryOutcome;
|
|
829
865
|
}
|
|
830
866
|
interface ComputerUseBridge {
|
|
831
867
|
execute(input: ComputerUseBridgeInput): Promise<ComputerUseBridgeOutput>;
|
|
@@ -886,9 +922,10 @@ interface DomActionKeyPressInput {
|
|
|
886
922
|
}
|
|
887
923
|
interface DomActionSettleOptions {
|
|
888
924
|
readonly operation: "dom.click" | "dom.hover" | "dom.input" | "dom.scroll";
|
|
925
|
+
readonly snapshot?: ActionBoundarySnapshot;
|
|
889
926
|
readonly signal: AbortSignal;
|
|
890
927
|
remainingMs(): number | undefined;
|
|
891
|
-
policySettle(pageRef: PageRef): Promise<void>;
|
|
928
|
+
policySettle(pageRef: PageRef, trigger: ActionBoundarySettleTrigger): Promise<void>;
|
|
892
929
|
}
|
|
893
930
|
type DomPointerHitRelation = "self" | "descendant" | "ancestor" | "same-owner" | "outside" | "unknown";
|
|
894
931
|
interface DomPointerHitAssessment {
|
|
@@ -910,7 +947,7 @@ interface DomActionBridge {
|
|
|
910
947
|
scrollNodeIntoView(locator: NodeLocator, options?: DomActionScrollOptions): Promise<void>;
|
|
911
948
|
focusNode(locator: NodeLocator): Promise<void>;
|
|
912
949
|
pressKey(locator: NodeLocator, input: DomActionKeyPressInput): Promise<void>;
|
|
913
|
-
finalizeDomAction(pageRef: PageRef, options: DomActionSettleOptions): Promise<
|
|
950
|
+
finalizeDomAction(pageRef: PageRef, options: DomActionSettleOptions): Promise<ActionBoundaryOutcome>;
|
|
914
951
|
}
|
|
915
952
|
|
|
916
953
|
interface AbpLaunchOptions {
|
|
@@ -1061,6 +1098,9 @@ declare class AbpBrowserCoreEngine implements BrowserCoreEngine {
|
|
|
1061
1098
|
listPages(input: {
|
|
1062
1099
|
readonly sessionRef: SessionRef;
|
|
1063
1100
|
}): Promise<readonly PageInfo[]>;
|
|
1101
|
+
drainEvents(input: {
|
|
1102
|
+
readonly pageRef: PageRef;
|
|
1103
|
+
}): Promise<readonly StepEvent[]>;
|
|
1064
1104
|
listFrames(input: {
|
|
1065
1105
|
readonly pageRef: PageRef;
|
|
1066
1106
|
}): Promise<readonly FrameInfo[]>;
|
|
@@ -1078,12 +1118,22 @@ declare class AbpBrowserCoreEngine implements BrowserCoreEngine {
|
|
|
1078
1118
|
readonly frameRef?: FrameRef;
|
|
1079
1119
|
readonly documentRef?: DocumentRef;
|
|
1080
1120
|
}): Promise<DomSnapshot>;
|
|
1121
|
+
getActionBoundarySnapshot(input: {
|
|
1122
|
+
readonly pageRef: PageRef;
|
|
1123
|
+
}): Promise<ActionBoundarySnapshot>;
|
|
1081
1124
|
waitForVisualStability(input: {
|
|
1082
1125
|
readonly pageRef: PageRef;
|
|
1083
1126
|
readonly timeoutMs?: number;
|
|
1084
1127
|
readonly settleMs?: number;
|
|
1085
1128
|
readonly scope?: "main-frame" | "visible-frames";
|
|
1086
1129
|
}): Promise<void>;
|
|
1130
|
+
waitForPostLoadQuiet(input: {
|
|
1131
|
+
readonly pageRef: PageRef;
|
|
1132
|
+
readonly timeoutMs?: number;
|
|
1133
|
+
readonly quietMs?: number;
|
|
1134
|
+
readonly captureWindowMs?: number;
|
|
1135
|
+
readonly signal?: AbortSignal;
|
|
1136
|
+
}): Promise<void>;
|
|
1087
1137
|
readText(input: NodeLocator): Promise<string | null>;
|
|
1088
1138
|
readAttributes(input: NodeLocator): Promise<readonly {
|
|
1089
1139
|
readonly name: string;
|