effect-browser 0.2.0-beta.7 → 0.2.0-beta.8
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/README.md +486 -152
- package/dist/Browser-n-bKgBNN.d.mts +372 -0
- package/dist/Browser.d.mts +3 -200
- package/dist/Browser.mjs +9 -1
- package/dist/Browser.mjs.map +1 -1
- package/dist/{BrowserData-KHk4o__c.d.mts → BrowserData-CPIIIHol.d.mts} +81 -7
- package/dist/BrowserData.d.mts +2 -2
- package/dist/BrowserData.mjs +104 -6
- package/dist/BrowserData.mjs.map +1 -1
- package/dist/{BrowserRuntime-hxkTNlRa.d.mts → BrowserRuntime-CFe9uUTv.d.mts} +16 -11
- package/dist/{BrowserRuntime-Cr76CN4I.mjs → BrowserRuntime-HJ1yYlFS.mjs} +4990 -4309
- package/dist/BrowserRuntime-HJ1yYlFS.mjs.map +1 -0
- package/dist/BrowserRuntime.d.mts +2 -2
- package/dist/BrowserRuntime.mjs +2 -1
- package/dist/Capture.d.mts +9 -7
- package/dist/Capture.mjs +157 -32
- package/dist/Capture.mjs.map +1 -1
- package/dist/{CaptureData-Dys0Ko9d.mjs → CaptureData-CYriZHX1.mjs} +25 -6
- package/dist/CaptureData-CYriZHX1.mjs.map +1 -0
- package/dist/CaptureData.d.mts +62 -3
- package/dist/CaptureData.mjs +2 -2
- package/dist/Chromium.d.mts +2 -2
- package/dist/Chromium.mjs +19 -10
- package/dist/Chromium.mjs.map +1 -1
- package/dist/Errors.d.mts +66 -17
- package/dist/Errors.mjs +47 -5
- package/dist/Errors.mjs.map +1 -1
- package/dist/Images-CaaPNeed.mjs +76 -0
- package/dist/Images-CaaPNeed.mjs.map +1 -0
- package/dist/OperationOptions-DAeRS6O9.mjs +55 -0
- package/dist/OperationOptions-DAeRS6O9.mjs.map +1 -0
- package/dist/PageControl.d.mts +6 -6
- package/dist/PageControl.mjs +16 -10
- package/dist/PageControl.mjs.map +1 -1
- package/dist/PageRegistry-B3q9DS3g.mjs +164 -0
- package/dist/PageRegistry-B3q9DS3g.mjs.map +1 -0
- package/dist/Plan-D8qQ48Ic.mjs +512 -0
- package/dist/Plan-D8qQ48Ic.mjs.map +1 -0
- package/dist/Plan.d.mts +3 -0
- package/dist/Plan.mjs +2 -0
- package/dist/PlanData-B668RxbQ.d.mts +4831 -0
- package/dist/PlanData.d.mts +3 -0
- package/dist/PlanData.mjs +268 -0
- package/dist/PlanData.mjs.map +1 -0
- package/dist/PlanInput-BJcPPncs.mjs +75 -0
- package/dist/PlanInput-BJcPPncs.mjs.map +1 -0
- package/dist/PublicSession-Bs61Eal8.mjs +5601 -0
- package/dist/PublicSession-Bs61Eal8.mjs.map +1 -0
- package/dist/Testing.d.mts +48 -6
- package/dist/Testing.mjs +651 -113
- package/dist/Testing.mjs.map +1 -1
- package/dist/Timeline-fV22Xk-S.d.mts +29 -0
- package/dist/Timeline.d.mts +4 -0
- package/dist/Timeline.mjs +20 -0
- package/dist/Timeline.mjs.map +1 -0
- package/dist/TimelineData-BsOn-YGZ.d.mts +3818 -0
- package/dist/TimelineData.d.mts +3 -0
- package/dist/TimelineData.mjs +482 -0
- package/dist/TimelineData.mjs.map +1 -0
- package/dist/index.d.mts +5 -1
- package/dist/index.mjs +5 -1
- package/package.json +17 -1
- package/dist/Association-CH3kPHXE.mjs +0 -167
- package/dist/Association-CH3kPHXE.mjs.map +0 -1
- package/dist/BrowserRuntime-Cr76CN4I.mjs.map +0 -1
- package/dist/CaptureData-Dys0Ko9d.mjs.map +0 -1
- package/dist/PageControlAssociation-DabEg5AR.mjs +0 -10
- package/dist/PageControlAssociation-DabEg5AR.mjs.map +0 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { A as PlanEncoded, B as RunPhase, C as NativePhase, D as PerformedEncoded, E as Performed, F as RecordedAction, G as Step, H as RunTiming, I as RecordedActionEncoded, J as ValueSource, K as StepAttempt, L as RecordedStep, M as Precondition, N as Ran, O as PhaseEvidence, P as RanStep, R as RecordedTarget, S as MotionProfile, T as PerformanceEvidence, U as SettledEvidence, V as RunReceipt, W as SettledOptions, _ as InputValue, a as AttemptSnapshot, b as LivePlanEncoded, c as Condition, d as DescriptorCapture, f as DescriptorEncoded, g as InputName, h as InputBindings, i as AttemptResult, j as Postcondition, k as Plan, l as DefaultMotionProfile, m as FrameDescriptor, n as Action, o as BasicDescriptorEvidence, p as Expectation, q as StepId, r as ActionTarget, s as CaptureIncompleteReason, t as AcknowledgementFact, u as Descriptor, v as Limits, w as Ordinal, x as MatchScope, y as LivePlan, z as ResolveGuard } from "./PlanData-B668RxbQ.mjs";
|
|
2
|
+
export { AcknowledgementFact, Action, ActionTarget, AttemptResult, AttemptSnapshot, BasicDescriptorEvidence, CaptureIncompleteReason, Condition, DefaultMotionProfile, Descriptor, DescriptorCapture, DescriptorEncoded, Expectation, FrameDescriptor, InputBindings, InputName, InputValue, Limits, LivePlan, LivePlanEncoded, MatchScope, MotionProfile, NativePhase, Ordinal, PerformanceEvidence, Performed, PerformedEncoded, PhaseEvidence, Plan, PlanEncoded, Postcondition, Precondition, Ran, RanStep, RecordedAction, RecordedActionEncoded, RecordedStep, RecordedTarget, ResolveGuard, RunPhase, RunReceipt, RunTiming, SettledEvidence, SettledOptions, Step, StepAttempt, StepId, ValueSource };
|
|
3
|
+
export {};
|
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
import { ControlFacts, FillFormOptions, FillRequest, Identifier, KeyStroke, NavigateRequest, ObservedElement, PointerMoveRequest, ScrollRequest, TargetUrl, TypeRequest, Viewport, ViewportRect, WaitForElementRequest, WheelRequest } from "./BrowserData.mjs";
|
|
2
|
+
import { Effect, Schema } from "effect";
|
|
3
|
+
//#region src/PlanData.ts
|
|
4
|
+
/** These bounds limit one authored walk, independently of the owner's remaining allowance. */
|
|
5
|
+
const Limits = {
|
|
6
|
+
steps: 128,
|
|
7
|
+
identifierLength: 128,
|
|
8
|
+
encodedBytes: 1048576,
|
|
9
|
+
inputBytes: 65536,
|
|
10
|
+
frameDepth: 8,
|
|
11
|
+
conditions: 16,
|
|
12
|
+
fields: 32,
|
|
13
|
+
options: 64
|
|
14
|
+
};
|
|
15
|
+
const utf8 = new TextEncoder();
|
|
16
|
+
const closed = { parseOptions: { onExcessProperty: "error" } };
|
|
17
|
+
const motionRange = (maximum, minimum = 0) => Schema.Struct({
|
|
18
|
+
minMillis: Schema.Finite.check(Schema.isBetween({
|
|
19
|
+
minimum,
|
|
20
|
+
maximum
|
|
21
|
+
})),
|
|
22
|
+
maxMillis: Schema.Finite.check(Schema.isBetween({
|
|
23
|
+
minimum,
|
|
24
|
+
maximum
|
|
25
|
+
}))
|
|
26
|
+
}).check(Schema.makeFilter((value) => value.minMillis <= value.maxMillis, { title: "ordered finite duration bounds" })).annotate(closed);
|
|
27
|
+
/** Chosen bounded presentation policy; these constants are not scientific calibration. */
|
|
28
|
+
const MotionProfile = Schema.Struct({
|
|
29
|
+
name: Schema.Literal("default"),
|
|
30
|
+
pointer: Schema.Struct({
|
|
31
|
+
duration: motionRange(5e3),
|
|
32
|
+
aimInset: Schema.Finite.check(Schema.isBetween({
|
|
33
|
+
minimum: 0,
|
|
34
|
+
maximum: .49
|
|
35
|
+
})),
|
|
36
|
+
curvature: Schema.Finite.check(Schema.isBetween({
|
|
37
|
+
minimum: 0,
|
|
38
|
+
maximum: .25
|
|
39
|
+
}))
|
|
40
|
+
}).annotate(closed),
|
|
41
|
+
keys: Schema.Struct({
|
|
42
|
+
interval: motionRange(1e3),
|
|
43
|
+
hold: motionRange(500)
|
|
44
|
+
}).annotate(closed),
|
|
45
|
+
scroll: Schema.Struct({
|
|
46
|
+
duration: motionRange(5e3),
|
|
47
|
+
intervalMillis: Schema.Finite.check(Schema.isBetween({
|
|
48
|
+
minimum: 8,
|
|
49
|
+
maximum: 250
|
|
50
|
+
}))
|
|
51
|
+
}).annotate(closed)
|
|
52
|
+
}).annotate(closed);
|
|
53
|
+
const DefaultMotionProfile = Object.freeze({
|
|
54
|
+
name: "default",
|
|
55
|
+
pointer: Object.freeze({
|
|
56
|
+
duration: Object.freeze({
|
|
57
|
+
minMillis: 120,
|
|
58
|
+
maxMillis: 1500
|
|
59
|
+
}),
|
|
60
|
+
aimInset: .15,
|
|
61
|
+
curvature: .08
|
|
62
|
+
}),
|
|
63
|
+
keys: Object.freeze({
|
|
64
|
+
interval: Object.freeze({
|
|
65
|
+
minMillis: 30,
|
|
66
|
+
maxMillis: 70
|
|
67
|
+
}),
|
|
68
|
+
hold: Object.freeze({
|
|
69
|
+
minMillis: 10,
|
|
70
|
+
maxMillis: 30
|
|
71
|
+
})
|
|
72
|
+
}),
|
|
73
|
+
scroll: Object.freeze({
|
|
74
|
+
duration: Object.freeze({
|
|
75
|
+
minMillis: 120,
|
|
76
|
+
maxMillis: 800
|
|
77
|
+
}),
|
|
78
|
+
intervalMillis: 20
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
/** Serialized style contains policy data, never callbacks, random services or native authority. */
|
|
82
|
+
const Performed = Schema.Struct({
|
|
83
|
+
motion: MotionProfile.pipe(Schema.withDecodingDefaultKey(Effect.succeed(DefaultMotionProfile))),
|
|
84
|
+
seed: Schema.optionalKey(Schema.Int),
|
|
85
|
+
slips: Schema.Struct({ probability: Schema.Finite.check(Schema.isBetween({
|
|
86
|
+
minimum: 0,
|
|
87
|
+
maximum: 1
|
|
88
|
+
})) }).annotate(closed).pipe(Schema.withDecodingDefaultKey(Effect.succeed({ probability: 0 })))
|
|
89
|
+
}).annotate(closed);
|
|
90
|
+
const StepId = Identifier.check(Schema.isMaxLength(Limits.identifierLength));
|
|
91
|
+
const InputName = Identifier.check(Schema.isMaxLength(256));
|
|
92
|
+
const InputValue = FillRequest.fields.value.check(Schema.makeFilter((value) => utf8.encode(value).byteLength <= Limits.inputBytes, { title: "at most 65,536 UTF-8 input bytes" }));
|
|
93
|
+
const InputBindings = Schema.Record(InputName, InputValue).check(Schema.makeFilter((values) => Object.keys(values).length <= Limits.steps * Limits.fields, { title: "at most 4,096 named inputs" }), Schema.makeFilter((values) => utf8.encode(JSON.stringify(values)).byteLength <= Limits.encodedBytes, { title: "at most 1 MiB of encoded input bindings" })).annotate(closed);
|
|
94
|
+
const MatchScope = Schema.Literals(["document", "viewport"]);
|
|
95
|
+
/** Zero-based index, accepted only after the complete filtered candidate count equals `of`. */
|
|
96
|
+
const Ordinal = Schema.Struct({
|
|
97
|
+
index: Schema.Natural,
|
|
98
|
+
of: Schema.Int.check(Schema.isGreaterThan(0))
|
|
99
|
+
}).check(Schema.makeFilter((value) => value.index < value.of, { title: "index less than of" })).annotate(closed);
|
|
100
|
+
/** Each segment is resolved among the exact parent's complete child-frame inventory. */
|
|
101
|
+
const FrameDescriptor = Schema.Struct({ path: Schema.Array(Schema.Struct({
|
|
102
|
+
name: Schema.NonEmptyString.check(Schema.isMaxLength(256)),
|
|
103
|
+
url: Schema.String.check(Schema.isMaxLength(8192)),
|
|
104
|
+
ordinal: Schema.optionalKey(Ordinal)
|
|
105
|
+
}).annotate(closed)).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.frameDepth)) }).annotate(closed);
|
|
106
|
+
/** Full raw label equality; geometry is diagnostic and never chooses a candidate. */
|
|
107
|
+
const Descriptor = Schema.Struct({
|
|
108
|
+
kind: ControlFacts.fields.kind,
|
|
109
|
+
label: ControlFacts.fields.label,
|
|
110
|
+
matchScope: MatchScope.pipe(Schema.withDecodingDefaultKey(Effect.succeed("document"))),
|
|
111
|
+
destination: Schema.optionalKey(ControlFacts.fields.destination.schema),
|
|
112
|
+
identity: Schema.optionalKey(Schema.Struct({
|
|
113
|
+
inputType: ControlFacts.fields.inputType,
|
|
114
|
+
autocomplete: ControlFacts.fields.autocomplete,
|
|
115
|
+
formMethod: ControlFacts.fields.formMethod
|
|
116
|
+
}).annotate(closed)),
|
|
117
|
+
ordinal: Schema.optionalKey(Ordinal),
|
|
118
|
+
frame: Schema.optionalKey(FrameDescriptor)
|
|
119
|
+
}).annotate(closed);
|
|
120
|
+
const RecordedTarget = Schema.TaggedStruct("Descriptor", { descriptor: Descriptor }).annotate(closed);
|
|
121
|
+
const ActionTarget = Schema.Union([Schema.TaggedStruct("Ref", { reference: ObservedElement }).annotate(closed), RecordedTarget]);
|
|
122
|
+
const valueSource = (value) => Schema.TaggedUnion({
|
|
123
|
+
Literal: { value },
|
|
124
|
+
Input: { name: InputName }
|
|
125
|
+
}).annotate(closed);
|
|
126
|
+
const ValueSource = valueSource(InputValue);
|
|
127
|
+
const TypeValueSource = valueSource(TypeRequest.fields.text);
|
|
128
|
+
const Milliseconds = Schema.Finite.check(Schema.isBetween({
|
|
129
|
+
minimum: 0,
|
|
130
|
+
maximum: 6e4
|
|
131
|
+
}));
|
|
132
|
+
const PositiveMilliseconds = Milliseconds.check(Schema.isGreaterThan(0));
|
|
133
|
+
const SettledOptions = Schema.Struct({
|
|
134
|
+
quietMillis: PositiveMilliseconds,
|
|
135
|
+
withinMillis: PositiveMilliseconds
|
|
136
|
+
}).check(Schema.makeFilter((value) => value.quietMillis <= value.withinMillis, { title: "quiet interval fits within the original deadline" })).annotate(closed);
|
|
137
|
+
const Origin = TargetUrl.check(Schema.makeFilter((value) => new URL(value).origin === value, { title: "an exact http(s) origin" }));
|
|
138
|
+
/** Conditions are bounded data. No expression, selector, callback or regular expression is accepted. */
|
|
139
|
+
const Precondition = Schema.TaggedUnion({
|
|
140
|
+
Origin: { value: Origin },
|
|
141
|
+
Path: { value: Schema.String.check(Schema.isMaxLength(8192), Schema.isPattern(/^\//)) },
|
|
142
|
+
Text: {
|
|
143
|
+
value: Schema.String.check(Schema.isMaxLength(131072)),
|
|
144
|
+
match: Schema.Literals(["equals", "contains"]),
|
|
145
|
+
scope: MatchScope.pipe(Schema.withDecodingDefaultKey(Effect.succeed("document")))
|
|
146
|
+
},
|
|
147
|
+
Viewport: { ...Viewport.fields },
|
|
148
|
+
Scroll: {
|
|
149
|
+
x: Schema.Finite,
|
|
150
|
+
y: Schema.Finite
|
|
151
|
+
},
|
|
152
|
+
Geometry: {
|
|
153
|
+
target: Descriptor,
|
|
154
|
+
box: ViewportRect
|
|
155
|
+
}
|
|
156
|
+
}).annotate(closed);
|
|
157
|
+
const Condition = Precondition;
|
|
158
|
+
const Postcondition = Precondition;
|
|
159
|
+
const Conditions = Schema.Array(Precondition).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.conditions));
|
|
160
|
+
const Expectation = Schema.Struct({
|
|
161
|
+
before: Schema.optionalKey(Conditions),
|
|
162
|
+
after: Schema.optionalKey(Conditions)
|
|
163
|
+
}).check(Schema.makeFilter((value) => value.before !== void 0 || value.after !== void 0, { title: "at least one precondition or postcondition" })).annotate(closed);
|
|
164
|
+
const ResolveGuard = Schema.TaggedUnion({
|
|
165
|
+
Strict: {},
|
|
166
|
+
ViewportContext: { before: Conditions }
|
|
167
|
+
}).annotate(closed);
|
|
168
|
+
/** One variant definition owns both live authority and descriptor-only durable projections. */
|
|
169
|
+
const actionSchema = (target) => {
|
|
170
|
+
const options = Schema.Array(target).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.options), Schema.makeFilter((values) => new Set(values.map((value) => JSON.stringify(value))).size === values.length, { title: "each option target at most once" }));
|
|
171
|
+
const fields = Schema.Array(Schema.TaggedUnion({
|
|
172
|
+
Value: {
|
|
173
|
+
target,
|
|
174
|
+
value: ValueSource
|
|
175
|
+
},
|
|
176
|
+
Checked: {
|
|
177
|
+
target,
|
|
178
|
+
checked: Schema.Boolean
|
|
179
|
+
},
|
|
180
|
+
Options: {
|
|
181
|
+
target,
|
|
182
|
+
options
|
|
183
|
+
}
|
|
184
|
+
}).annotate(closed)).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.fields));
|
|
185
|
+
return Schema.TaggedUnion({
|
|
186
|
+
Navigate: { ...NavigateRequest.fields },
|
|
187
|
+
Click: { target },
|
|
188
|
+
Hover: { target },
|
|
189
|
+
Fill: {
|
|
190
|
+
target,
|
|
191
|
+
value: ValueSource
|
|
192
|
+
},
|
|
193
|
+
Type: {
|
|
194
|
+
target: Schema.optionalKey(target),
|
|
195
|
+
text: TypeValueSource
|
|
196
|
+
},
|
|
197
|
+
Press: {
|
|
198
|
+
target: Schema.optionalKey(target),
|
|
199
|
+
...KeyStroke.fields
|
|
200
|
+
},
|
|
201
|
+
Select: {
|
|
202
|
+
target,
|
|
203
|
+
options
|
|
204
|
+
},
|
|
205
|
+
Scroll: { mode: Schema.TaggedUnion({
|
|
206
|
+
By: { ...ScrollRequest.fields },
|
|
207
|
+
To: { target }
|
|
208
|
+
}).annotate(closed) },
|
|
209
|
+
PointerMove: { ...PointerMoveRequest.fields },
|
|
210
|
+
Wheel: { ...WheelRequest.fields },
|
|
211
|
+
Wait: { mode: Schema.Union([
|
|
212
|
+
Schema.TaggedStruct("Duration", { milliseconds: Milliseconds }).annotate(closed),
|
|
213
|
+
Schema.TaggedStruct("Element", {
|
|
214
|
+
target,
|
|
215
|
+
state: WaitForElementRequest.fields.state,
|
|
216
|
+
timeoutMillis: WaitForElementRequest.fields.timeoutMillis
|
|
217
|
+
}).annotate(closed),
|
|
218
|
+
Schema.TaggedStruct("Settled", SettledOptions.fields).check(Schema.makeFilter((value) => value.quietMillis <= value.withinMillis)).annotate(closed)
|
|
219
|
+
]) },
|
|
220
|
+
FillForm: {
|
|
221
|
+
fields,
|
|
222
|
+
submit: Schema.optionalKey(target),
|
|
223
|
+
options: Schema.optionalKey(FillFormOptions)
|
|
224
|
+
}
|
|
225
|
+
}).annotate(closed);
|
|
226
|
+
};
|
|
227
|
+
const Action = actionSchema(ActionTarget);
|
|
228
|
+
const RecordedAction = actionSchema(RecordedTarget);
|
|
229
|
+
const stepSchema = (action) => Schema.Struct({
|
|
230
|
+
id: StepId,
|
|
231
|
+
action,
|
|
232
|
+
expect: Schema.optionalKey(Expectation),
|
|
233
|
+
resolution: ResolveGuard.pipe(Schema.withDecodingDefaultKey(Effect.succeed({ _tag: "Strict" })))
|
|
234
|
+
}).annotate(closed);
|
|
235
|
+
const Step = stepSchema(Action);
|
|
236
|
+
const RecordedStep = stepSchema(RecordedAction);
|
|
237
|
+
const planSchema = (step) => Schema.Struct({
|
|
238
|
+
version: Schema.Literal(1),
|
|
239
|
+
steps: Schema.Array(step).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.steps), Schema.makeFilter((steps) => new Set(steps.map((step) => step.id)).size === steps.length, { title: "unique step identifiers" }))
|
|
240
|
+
}).check(Schema.makeFilter((value) => utf8.encode(JSON.stringify(value)).byteLength <= Limits.encodedBytes, { title: "at most 1 MiB of encoded plan data" })).annotate(closed);
|
|
241
|
+
const LivePlan = planSchema(Step);
|
|
242
|
+
const Plan = planSchema(RecordedStep);
|
|
243
|
+
const CaptureIncompleteReason = Schema.Literals([
|
|
244
|
+
"FactsUnavailable",
|
|
245
|
+
"LabelOmitted",
|
|
246
|
+
"DestinationOmitted",
|
|
247
|
+
"IdentityOmitted",
|
|
248
|
+
"FrameUnavailable",
|
|
249
|
+
"TargetUnavailable",
|
|
250
|
+
"EvidenceLimit"
|
|
251
|
+
]);
|
|
252
|
+
const BasicDescriptorEvidence = Schema.Struct({
|
|
253
|
+
path: Schema.Array(Schema.String.check(Schema.isMaxLength(128))).check(Schema.isMaxLength(8)),
|
|
254
|
+
matchScope: Schema.optionalKey(MatchScope),
|
|
255
|
+
facts: Schema.optionalKey(ControlFacts)
|
|
256
|
+
}).annotate(closed);
|
|
257
|
+
/** Incomplete contains no executable action member; faithful intent is not a uniqueness promise. */
|
|
258
|
+
const DescriptorCapture = Schema.TaggedUnion({
|
|
259
|
+
Complete: { action: RecordedAction },
|
|
260
|
+
Incomplete: {
|
|
261
|
+
facts: BasicDescriptorEvidence,
|
|
262
|
+
reason: CaptureIncompleteReason
|
|
263
|
+
}
|
|
264
|
+
}).annotate(closed);
|
|
265
|
+
//#endregion
|
|
266
|
+
export { Action, ActionTarget, BasicDescriptorEvidence, CaptureIncompleteReason, Condition, DefaultMotionProfile, Descriptor, DescriptorCapture, Expectation, FrameDescriptor, InputBindings, InputName, InputValue, Limits, LivePlan, MatchScope, MotionProfile, Ordinal, Performed, Plan, Postcondition, Precondition, RecordedAction, RecordedStep, RecordedTarget, ResolveGuard, SettledOptions, Step, StepId, ValueSource };
|
|
267
|
+
|
|
268
|
+
//# sourceMappingURL=PlanData.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanData.mjs","names":[],"sources":["../src/PlanData.ts"],"sourcesContent":["import { type Cause, Effect, Schema } from \"effect\";\n\nimport {\n type ActionResult,\n type Checkpoint,\n ControlFacts,\n FillFormOptions,\n type FillFormResult,\n FillRequest,\n Identifier,\n type InputReceipt,\n KeyStroke,\n NavigateRequest,\n type NavigationResult,\n ObservedElement,\n PointerMoveRequest,\n ScrollRequest,\n TargetUrl,\n TypeRequest,\n Viewport,\n ViewportRect,\n WaitForElementRequest,\n WheelRequest,\n} from \"./BrowserData.ts\";\nimport type { BrowserError, BrowserOutcome, Containment, InitializationError } from \"./Errors.ts\";\n\n/** These bounds limit one authored walk, independently of the owner's remaining allowance. */\nexport const Limits = {\n steps: 128,\n identifierLength: 128,\n encodedBytes: 1024 * 1024,\n inputBytes: 65536,\n frameDepth: 8,\n conditions: 16,\n fields: 32,\n options: 64,\n} as const;\n\nconst utf8 = new TextEncoder();\nconst closed = { parseOptions: { onExcessProperty: \"error\" } } as const;\n\nconst motionRange = (maximum: number, minimum = 0) =>\n Schema.Struct({\n minMillis: Schema.Finite.check(Schema.isBetween({ minimum, maximum })),\n maxMillis: Schema.Finite.check(Schema.isBetween({ minimum, maximum })),\n })\n .check(\n Schema.makeFilter((value) => value.minMillis <= value.maxMillis, {\n title: \"ordered finite duration bounds\",\n }),\n )\n .annotate(closed);\n\n/** Chosen bounded presentation policy; these constants are not scientific calibration. */\nexport const MotionProfile = Schema.Struct({\n name: Schema.Literal(\"default\"),\n pointer: Schema.Struct({\n duration: motionRange(5000),\n aimInset: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 0.49 })),\n curvature: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 0.25 })),\n }).annotate(closed),\n keys: Schema.Struct({\n interval: motionRange(1000),\n hold: motionRange(500),\n }).annotate(closed),\n scroll: Schema.Struct({\n duration: motionRange(5000),\n intervalMillis: Schema.Finite.check(Schema.isBetween({ minimum: 8, maximum: 250 })),\n }).annotate(closed),\n}).annotate(closed);\n\nexport type MotionProfile = typeof MotionProfile.Type;\n\nexport const DefaultMotionProfile: MotionProfile = Object.freeze({\n name: \"default\",\n pointer: Object.freeze({\n duration: Object.freeze({ minMillis: 120, maxMillis: 1500 }),\n aimInset: 0.15,\n curvature: 0.08,\n }),\n keys: Object.freeze({\n interval: Object.freeze({ minMillis: 30, maxMillis: 70 }),\n hold: Object.freeze({ minMillis: 10, maxMillis: 30 }),\n }),\n scroll: Object.freeze({\n duration: Object.freeze({ minMillis: 120, maxMillis: 800 }),\n intervalMillis: 20,\n }),\n});\n\n/** Serialized style contains policy data, never callbacks, random services or native authority. */\nexport const Performed = Schema.Struct({\n motion: MotionProfile.pipe(Schema.withDecodingDefaultKey(Effect.succeed(DefaultMotionProfile))),\n seed: Schema.optionalKey(Schema.Int),\n slips: Schema.Struct({\n probability: Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 1 })),\n })\n .annotate(closed)\n .pipe(Schema.withDecodingDefaultKey(Effect.succeed({ probability: 0 }))),\n}).annotate(closed);\n\nexport type Performed = typeof Performed.Type;\nexport type PerformedEncoded = typeof Performed.Encoded;\n\nexport const StepId = Identifier.check(Schema.isMaxLength(Limits.identifierLength));\n\nexport type StepId = typeof StepId.Type;\n\nexport const InputName = Identifier.check(Schema.isMaxLength(256));\n\nexport type InputName = typeof InputName.Type;\n\nexport const InputValue = FillRequest.fields.value.check(\n Schema.makeFilter((value) => utf8.encode(value).byteLength <= Limits.inputBytes, {\n title: \"at most 65,536 UTF-8 input bytes\",\n }),\n);\n\nexport type InputValue = typeof InputValue.Type;\n\nexport const InputBindings = Schema.Record(InputName, InputValue)\n .check(\n Schema.makeFilter((values) => Object.keys(values).length <= Limits.steps * Limits.fields, {\n title: \"at most 4,096 named inputs\",\n }),\n Schema.makeFilter(\n (values) => utf8.encode(JSON.stringify(values)).byteLength <= Limits.encodedBytes,\n {\n title: \"at most 1 MiB of encoded input bindings\",\n },\n ),\n )\n .annotate(closed);\n\nexport type InputBindings = typeof InputBindings.Type;\n\nexport const MatchScope = Schema.Literals([\"document\", \"viewport\"]);\n\nexport type MatchScope = typeof MatchScope.Type;\n\n/** Zero-based index, accepted only after the complete filtered candidate count equals `of`. */\nexport const Ordinal = Schema.Struct({\n index: Schema.Natural,\n of: Schema.Int.check(Schema.isGreaterThan(0)),\n})\n .check(Schema.makeFilter((value) => value.index < value.of, { title: \"index less than of\" }))\n .annotate(closed);\n\nexport type Ordinal = typeof Ordinal.Type;\n\n/** Each segment is resolved among the exact parent's complete child-frame inventory. */\nexport const FrameDescriptor = Schema.Struct({\n path: Schema.Array(\n Schema.Struct({\n name: Schema.NonEmptyString.check(Schema.isMaxLength(256)),\n url: Schema.String.check(Schema.isMaxLength(8192)),\n ordinal: Schema.optionalKey(Ordinal),\n }).annotate(closed),\n ).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.frameDepth)),\n}).annotate(closed);\n\nexport type FrameDescriptor = typeof FrameDescriptor.Type;\n\n/** Full raw label equality; geometry is diagnostic and never chooses a candidate. */\nexport const Descriptor = Schema.Struct({\n kind: ControlFacts.fields.kind,\n label: ControlFacts.fields.label,\n matchScope: MatchScope.pipe(Schema.withDecodingDefaultKey(Effect.succeed(\"document\"))),\n destination: Schema.optionalKey(ControlFacts.fields.destination.schema),\n identity: Schema.optionalKey(\n Schema.Struct({\n inputType: ControlFacts.fields.inputType,\n autocomplete: ControlFacts.fields.autocomplete,\n formMethod: ControlFacts.fields.formMethod,\n }).annotate(closed),\n ),\n ordinal: Schema.optionalKey(Ordinal),\n frame: Schema.optionalKey(FrameDescriptor),\n}).annotate(closed);\n\nexport type Descriptor = typeof Descriptor.Type;\nexport type DescriptorEncoded = typeof Descriptor.Encoded;\n\nexport const RecordedTarget = Schema.TaggedStruct(\"Descriptor\", {\n descriptor: Descriptor,\n}).annotate(closed);\n\nexport type RecordedTarget = typeof RecordedTarget.Type;\n\nexport const ActionTarget = Schema.Union([\n Schema.TaggedStruct(\"Ref\", { reference: ObservedElement }).annotate(closed),\n RecordedTarget,\n]);\n\nexport type ActionTarget = typeof ActionTarget.Type;\n\nconst valueSource = <S extends Schema.Constraint>(value: S) =>\n Schema.TaggedUnion({ Literal: { value }, Input: { name: InputName } }).annotate(closed);\n\nexport const ValueSource = valueSource(InputValue);\n\nexport type ValueSource = typeof ValueSource.Type;\n\nconst TypeValueSource = valueSource(TypeRequest.fields.text);\nconst Milliseconds = Schema.Finite.check(Schema.isBetween({ minimum: 0, maximum: 60000 }));\nconst PositiveMilliseconds = Milliseconds.check(Schema.isGreaterThan(0));\n\nexport const SettledOptions = Schema.Struct({\n quietMillis: PositiveMilliseconds,\n withinMillis: PositiveMilliseconds,\n})\n .check(\n Schema.makeFilter((value) => value.quietMillis <= value.withinMillis, {\n title: \"quiet interval fits within the original deadline\",\n }),\n )\n .annotate(closed);\n\nexport type SettledOptions = typeof SettledOptions.Type;\n\nconst Origin = TargetUrl.check(\n Schema.makeFilter((value) => new URL(value).origin === value, {\n title: \"an exact http(s) origin\",\n }),\n);\n\n/** Conditions are bounded data. No expression, selector, callback or regular expression is accepted. */\nexport const Precondition = Schema.TaggedUnion({\n Origin: { value: Origin },\n Path: { value: Schema.String.check(Schema.isMaxLength(8192), Schema.isPattern(/^\\//)) },\n Text: {\n value: Schema.String.check(Schema.isMaxLength(131072)),\n match: Schema.Literals([\"equals\", \"contains\"]),\n scope: MatchScope.pipe(Schema.withDecodingDefaultKey(Effect.succeed(\"document\"))),\n },\n Viewport: { ...Viewport.fields },\n Scroll: { x: Schema.Finite, y: Schema.Finite },\n Geometry: { target: Descriptor, box: ViewportRect },\n}).annotate(closed);\n\nexport type Precondition = typeof Precondition.Type;\n\nexport const Condition = Precondition;\n\nexport type Condition = typeof Condition.Type;\n\nexport const Postcondition = Precondition;\n\nexport type Postcondition = typeof Postcondition.Type;\n\nconst Conditions = Schema.Array(Precondition).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(Limits.conditions),\n);\n\nexport const Expectation = Schema.Struct({\n before: Schema.optionalKey(Conditions),\n after: Schema.optionalKey(Conditions),\n})\n .check(\n Schema.makeFilter((value) => value.before !== undefined || value.after !== undefined, {\n title: \"at least one precondition or postcondition\",\n }),\n )\n .annotate(closed);\n\nexport type Expectation = typeof Expectation.Type;\n\nexport const ResolveGuard = Schema.TaggedUnion({\n Strict: {},\n ViewportContext: { before: Conditions },\n}).annotate(closed);\n\nexport type ResolveGuard = typeof ResolveGuard.Type;\n\n/** One variant definition owns both live authority and descriptor-only durable projections. */\nconst actionSchema = <T extends Schema.Constraint>(target: T) => {\n const options = Schema.Array(target).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(Limits.options),\n Schema.makeFilter(\n (values) => new Set(values.map((value) => JSON.stringify(value))).size === values.length,\n {\n title: \"each option target at most once\",\n },\n ),\n );\n\n const fields = Schema.Array(\n Schema.TaggedUnion({\n Value: { target, value: ValueSource },\n Checked: { target, checked: Schema.Boolean },\n Options: { target, options },\n }).annotate(closed),\n ).check(Schema.isMinLength(1), Schema.isMaxLength(Limits.fields));\n\n return Schema.TaggedUnion({\n Navigate: { ...NavigateRequest.fields },\n Click: { target },\n Hover: { target },\n Fill: { target, value: ValueSource },\n Type: { target: Schema.optionalKey(target), text: TypeValueSource },\n Press: { target: Schema.optionalKey(target), ...KeyStroke.fields },\n Select: { target, options },\n Scroll: {\n mode: Schema.TaggedUnion({\n By: { ...ScrollRequest.fields },\n To: { target },\n }).annotate(closed),\n },\n PointerMove: { ...PointerMoveRequest.fields },\n Wheel: { ...WheelRequest.fields },\n Wait: {\n mode: Schema.Union([\n Schema.TaggedStruct(\"Duration\", { milliseconds: Milliseconds }).annotate(closed),\n Schema.TaggedStruct(\"Element\", {\n target,\n state: WaitForElementRequest.fields.state,\n timeoutMillis: WaitForElementRequest.fields.timeoutMillis,\n }).annotate(closed),\n Schema.TaggedStruct(\"Settled\", SettledOptions.fields)\n .check(Schema.makeFilter((value) => value.quietMillis <= value.withinMillis))\n .annotate(closed),\n ]),\n },\n FillForm: {\n fields,\n submit: Schema.optionalKey(target),\n options: Schema.optionalKey(FillFormOptions),\n },\n }).annotate(closed);\n};\n\nexport const Action = actionSchema(ActionTarget);\n\nexport type Action = typeof Action.Type;\n\nexport const RecordedAction = actionSchema(RecordedTarget);\n\nexport type RecordedAction = typeof RecordedAction.Type;\nexport type RecordedActionEncoded = typeof RecordedAction.Encoded;\n\nconst stepSchema = <A extends Schema.Constraint>(action: A) =>\n Schema.Struct({\n id: StepId,\n action,\n expect: Schema.optionalKey(Expectation),\n resolution: ResolveGuard.pipe(\n Schema.withDecodingDefaultKey(Effect.succeed({ _tag: \"Strict\" })),\n ),\n }).annotate(closed);\n\nexport const Step = stepSchema(Action);\n\nexport type Step = typeof Step.Type;\n\nexport const RecordedStep = stepSchema(RecordedAction);\n\nexport type RecordedStep = typeof RecordedStep.Type;\n\nconst planSchema = <S extends Schema.Constraint & { readonly Type: { readonly id: string } }>(\n step: S,\n) =>\n Schema.Struct({\n version: Schema.Literal(1),\n steps: Schema.Array(step).check(\n Schema.isMinLength(1),\n Schema.isMaxLength(Limits.steps),\n Schema.makeFilter((steps) => new Set(steps.map((step) => step.id)).size === steps.length, {\n title: \"unique step identifiers\",\n }),\n ),\n })\n .check(\n Schema.makeFilter(\n (value) => utf8.encode(JSON.stringify(value)).byteLength <= Limits.encodedBytes,\n {\n title: \"at most 1 MiB of encoded plan data\",\n },\n ),\n )\n .annotate(closed);\n\nexport const LivePlan = planSchema(Step);\n\nexport type LivePlan = typeof LivePlan.Type;\nexport type LivePlanEncoded = typeof LivePlan.Encoded;\n\nexport const Plan = planSchema(RecordedStep);\n\nexport type Plan = typeof Plan.Type;\nexport type PlanEncoded = typeof Plan.Encoded;\n\nexport const CaptureIncompleteReason = Schema.Literals([\n \"FactsUnavailable\",\n \"LabelOmitted\",\n \"DestinationOmitted\",\n \"IdentityOmitted\",\n \"FrameUnavailable\",\n \"TargetUnavailable\",\n \"EvidenceLimit\",\n]);\n\nexport type CaptureIncompleteReason = typeof CaptureIncompleteReason.Type;\n\nexport const BasicDescriptorEvidence = Schema.Struct({\n path: Schema.Array(Schema.String.check(Schema.isMaxLength(128))).check(Schema.isMaxLength(8)),\n matchScope: Schema.optionalKey(MatchScope),\n facts: Schema.optionalKey(ControlFacts),\n}).annotate(closed);\n\nexport type BasicDescriptorEvidence = typeof BasicDescriptorEvidence.Type;\n\n/** Incomplete contains no executable action member; faithful intent is not a uniqueness promise. */\nexport const DescriptorCapture = Schema.TaggedUnion({\n Complete: { action: RecordedAction },\n Incomplete: { facts: BasicDescriptorEvidence, reason: CaptureIncompleteReason },\n}).annotate(closed);\n\nexport type DescriptorCapture = typeof DescriptorCapture.Type;\n\nexport type RunPhase =\n | \"Preparation\"\n | \"Resolution\"\n | \"Precondition\"\n | \"Input\"\n | \"Field\"\n | \"Verification\"\n | \"Submit\"\n | \"Postcondition\"\n | \"Checkpoint\"\n | \"Settled\"\n | \"Terminal\";\n\nexport type NativePhase = \"Prepared\" | \"Dispatched\" | \"Acknowledged\" | \"FollowUp\" | \"Terminal\";\n\n/** A preparatory native acknowledgement does not imply completed logical input. */\nexport interface AcknowledgementFact {\n readonly subphase: \"scroll-into-view\" | \"focus\" | \"key-burst\" | \"scroll-burst\";\n readonly logicalComplete: boolean;\n}\n\n/** Host-only evidence retains the exact acknowledgement separately from an optional input receipt. */\nexport interface PhaseEvidence {\n readonly phase: NativePhase | \"InputReceipt\" | \"SubphaseReceipt\";\n readonly operation?: RunPhase;\n readonly atMonotonicNanos: bigint;\n /** A late native reply never repairs an already decided unknown outcome. */\n readonly late: boolean;\n readonly input?: InputReceipt;\n readonly fieldIndex?: number;\n readonly acknowledgement?: AcknowledgementFact;\n /** Completed adjacent bursts are summarized; an unresolved dispatch is never folded. */\n readonly burst?: {\n readonly subphase: \"key-burst\" | \"scroll-burst\";\n readonly dispatches: number;\n readonly acknowledgements: number;\n readonly firstDispatchedMonotonicNanos: bigint;\n readonly lastAcknowledgedMonotonicNanos: bigint;\n };\n readonly scroll?: {\n readonly target: {\n readonly generation: number;\n readonly pageId: string;\n readonly frameId: string;\n };\n readonly startedMonotonicNanos: bigint;\n readonly completedMonotonicNanos: bigint;\n readonly qualification: \"native-call-interval\" | \"exact-node-scroll-into-view\";\n /** Commanded deltas, when exposed by the original native scroll capability. */\n readonly delta?: { readonly x: number; readonly y: number };\n };\n}\n\nexport interface SettledEvidence extends SettledOptions {\n readonly signals: ReadonlyArray<\"dom-mutation\" | \"scroll\" | \"root-geometry\" | \"viewport\">;\n readonly observedMillis: number;\n readonly samples: number;\n readonly mutations: number;\n readonly scrollChanges: number;\n readonly geometryChanges: number;\n readonly viewportChanges: number;\n readonly visibility: \"visible\" | \"hidden\";\n}\n\nexport type AttemptResult =\n | { readonly _tag: \"Refused\"; readonly outcome: \"undispatched\" | \"rejected\" }\n | { readonly _tag: \"Acknowledged\"; readonly outcome: \"performed\" | \"undispatched\" }\n | { readonly _tag: \"Unknown\"; readonly outcome: \"unknown\" }\n | { readonly _tag: \"AcknowledgedWithPostconditionFailure\"; readonly outcome: \"performed\" };\n\n/** Causes stay typed on the host; this value is deliberately not a serialization schema. */\nexport interface StepAttempt<Id extends string = string, E = BrowserError | InitializationError> {\n readonly id: string;\n readonly stepId: Id;\n readonly sourceStep: Step & { readonly id: Id };\n readonly action: Action[\"_tag\"];\n readonly phase: RunPhase;\n readonly phases: ReadonlyArray<PhaseEvidence>;\n readonly capture?: DescriptorCapture;\n readonly outcome?: BrowserOutcome;\n readonly error?: BrowserError | InitializationError;\n readonly result?: AttemptResult;\n readonly containment: Containment;\n readonly completed: boolean;\n readonly cause?: Cause.Cause<E>;\n readonly receipt?: RunReceipt;\n readonly performance?: PerformanceEvidence;\n}\n\n/** Host timing is measured in the original owner's monotonic domain, never a remote clock. */\nexport interface RunTiming {\n readonly requestedMonotonicNanos: bigint;\n readonly intendedMonotonicNanos: bigint;\n readonly startedMonotonicNanos: bigint | null;\n readonly deadlineMonotonicNanos: bigint;\n readonly latenessNanos: bigint | null;\n readonly seed?: number;\n}\n\nexport interface PerformanceEvidence {\n readonly seed: number;\n readonly profile: MotionProfile;\n}\n\nexport type RunReceipt =\n | NavigationResult\n | ActionResult\n | InputReceipt\n | FillFormResult\n | SettledEvidence\n | void;\n\nexport interface RanStep<Id extends string = string> {\n readonly id: Id;\n readonly sourceStep: Step & { readonly id: Id };\n readonly receipt: RunReceipt;\n readonly attempt: StepAttempt<Id>;\n readonly recorded: DescriptorCapture;\n readonly expect?: Expectation;\n readonly resolution: ResolveGuard;\n readonly checkpoint?: Checkpoint;\n readonly settled?: SettledEvidence;\n}\n\nexport interface AttemptSnapshot<E = BrowserError | InitializationError> {\n readonly runId: string;\n readonly attempts: ReadonlyArray<StepAttempt<string, E>>;\n readonly completed: ReadonlyArray<RanStep>;\n readonly terminal: boolean;\n readonly timing: RunTiming;\n}\n\nexport interface Ran<P extends LivePlan = LivePlan> {\n readonly runId: string;\n readonly version: 1;\n readonly timing: RunTiming;\n readonly steps: ReadonlyArray<RanStep<P[\"steps\"][number][\"id\"]>>;\n readonly completion:\n | { readonly _tag: \"Complete\" }\n | {\n readonly _tag: \"Through\";\n readonly through: string;\n readonly next: { readonly index: number; readonly stepId: string } | null;\n };\n}\n"],"mappings":";;;;AA2BA,MAAa,SAAS;CACpB,OAAO;CACP,kBAAkB;CAClB,cAAc;CACd,YAAY;CACZ,YAAY;CACZ,YAAY;CACZ,QAAQ;CACR,SAAS;AACX;AAEA,MAAM,OAAO,IAAI,YAAY;AAC7B,MAAM,SAAS,EAAE,cAAc,EAAE,kBAAkB,QAAQ,EAAE;AAE7D,MAAM,eAAe,SAAiB,UAAU,MAC9C,OAAO,OAAO;CACZ,WAAW,OAA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,UAAU,IAAI,IAAI,MAAM,KAAK,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,MAAM,QAAQ,EACxF,OAAO,0BACT,CAAC,CACH;AACF,CAAC,CAAC,CACC,MACC,OAAO,YACJ,UAAU,KAAK,OAAO,KAAK,UAAU,KAAK,CAAC,CAAC,CAAC,cAAc,OAAO,cACnE,EACE,OAAO,qCACT,CACF,CACF,CAAC,CACA,SAAS,MAAM;AAEpB,MAAa,WAAW,WAAW,IAAI;AAKvC,MAAa,OAAO,WAAW,YAAY;AAK3C,MAAa,0BAA0B,OAAO,SAAS;CACrD;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAID,MAAa,0BAA0B,OAAO,OAAO;CACnD,MAAM,OAAO,MAAM,OAAO,OAAO,MAAM,OAAO,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;CAC5F,YAAY,OAAO,YAAY,UAAU;CACzC,OAAO,OAAO,YAAY,YAAY;AACxC,CAAC,CAAC,CAAC,SAAS,MAAM;;AAKlB,MAAa,oBAAoB,OAAO,YAAY;CAClD,UAAU,EAAE,QAAQ,eAAe;CACnC,YAAY;EAAE,OAAO;EAAyB,QAAQ;CAAwB;AAChF,CAAC,CAAC,CAAC,SAAS,MAAM"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ObservedElement, ViewportPoint, ViewportRect } from "./BrowserData.mjs";
|
|
2
|
+
import { Limits } from "./PlanData.mjs";
|
|
3
|
+
import { Effect, Predicate, Schema } from "effect";
|
|
4
|
+
//#region src/internal/browser/PlanInput.ts
|
|
5
|
+
const utf8 = new TextEncoder();
|
|
6
|
+
const maximumNodes = 16384;
|
|
7
|
+
const maximumDepth = 16;
|
|
8
|
+
const maximumKeys = 4096;
|
|
9
|
+
const dataPrototypes = /* @__PURE__ */ new Set([
|
|
10
|
+
null,
|
|
11
|
+
Object.prototype,
|
|
12
|
+
ObservedElement.prototype,
|
|
13
|
+
ViewportPoint.prototype,
|
|
14
|
+
ViewportRect.prototype
|
|
15
|
+
]);
|
|
16
|
+
/** Cost admission precedes the semantic decoder; refinements alone run after child parsing. */
|
|
17
|
+
const boundedInput = (value) => {
|
|
18
|
+
let bytes = 0;
|
|
19
|
+
let nodes = 0;
|
|
20
|
+
const ancestors = /* @__PURE__ */ new Set();
|
|
21
|
+
const add = (count) => {
|
|
22
|
+
bytes += count;
|
|
23
|
+
return bytes <= Limits.encodedBytes;
|
|
24
|
+
};
|
|
25
|
+
const string = (text) => text.length <= Limits.encodedBytes && add(utf8.encode(JSON.stringify(text)).byteLength);
|
|
26
|
+
const visit = (input, depth) => {
|
|
27
|
+
if (++nodes > maximumNodes || depth > maximumDepth) return false;
|
|
28
|
+
if (input === null) return add(4);
|
|
29
|
+
if (typeof input === "string") return string(input);
|
|
30
|
+
if (typeof input === "boolean") return add(input ? 4 : 5);
|
|
31
|
+
if (typeof input === "number") return Number.isFinite(input) && add(JSON.stringify(input).length);
|
|
32
|
+
if (!Predicate.isObjectKeyword(input) || ancestors.has(input)) return false;
|
|
33
|
+
ancestors.add(input);
|
|
34
|
+
if (Array.isArray(input)) {
|
|
35
|
+
if (input.length > Limits.steps || !add(2 + Math.max(0, input.length - 1))) return false;
|
|
36
|
+
if (Reflect.ownKeys(input).length !== input.length + 1) return false;
|
|
37
|
+
for (let index = 0; index < input.length; index++) {
|
|
38
|
+
const property = Object.getOwnPropertyDescriptor(input, String(index));
|
|
39
|
+
if (property === void 0 || !("value" in property) || !visit(property.value, depth + 1)) return false;
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
const prototype = Object.getPrototypeOf(input);
|
|
43
|
+
if (prototype !== null && !Predicate.isObjectKeyword(prototype) || !dataPrototypes.has(prototype)) return false;
|
|
44
|
+
const keys = Reflect.ownKeys(input);
|
|
45
|
+
if (keys.length > maximumKeys || !add(2 + Math.max(0, keys.length - 1))) return false;
|
|
46
|
+
for (const key of keys) {
|
|
47
|
+
if (typeof key !== "string") return false;
|
|
48
|
+
const property = Object.getOwnPropertyDescriptor(input, key);
|
|
49
|
+
if (property === void 0 || !property.enumerable || !("value" in property) || !string(key) || !add(1) || !visit(property.value, depth + 1)) return false;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
ancestors.delete(input);
|
|
53
|
+
return true;
|
|
54
|
+
};
|
|
55
|
+
try {
|
|
56
|
+
if (Predicate.isObject(value)) {
|
|
57
|
+
const steps = Object.getOwnPropertyDescriptor(value, "steps");
|
|
58
|
+
if (steps !== void 0 && (!("value" in steps) || Array.isArray(steps.value) && steps.value.length > Limits.steps)) return false;
|
|
59
|
+
}
|
|
60
|
+
return visit(value, 0);
|
|
61
|
+
} catch {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const CostBound = Schema.Unknown.check(Schema.makeFilter(boundedInput, { title: "bounded finite JSON plan/input data" }));
|
|
66
|
+
/** This shared boundary never traverses an oversized step array in the semantic decoder. */
|
|
67
|
+
const guardedDecode = (schema) => {
|
|
68
|
+
const admit = Schema.decodeUnknownEffect(CostBound);
|
|
69
|
+
const decode = Schema.decodeUnknownEffect(schema);
|
|
70
|
+
return (value, options) => admit(value).pipe(Effect.flatMap((input) => decode(input, options)));
|
|
71
|
+
};
|
|
72
|
+
//#endregion
|
|
73
|
+
export { guardedDecode as t };
|
|
74
|
+
|
|
75
|
+
//# sourceMappingURL=PlanInput-BJcPPncs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanInput-BJcPPncs.mjs","names":[],"sources":["../src/internal/browser/PlanInput.ts"],"sourcesContent":["import { Effect, Predicate, Schema, type SchemaAST } from \"effect\";\n\nimport { ObservedElement, ViewportPoint, ViewportRect } from \"../../BrowserData.ts\";\nimport { Limits } from \"../../PlanData.ts\";\n\nconst utf8 = new TextEncoder();\nconst maximumNodes = 16384;\nconst maximumDepth = 16;\nconst maximumKeys = 4096;\n\nconst dataPrototypes = new Set<object | null>([\n null,\n Object.prototype,\n ObservedElement.prototype,\n ViewportPoint.prototype,\n ViewportRect.prototype,\n]);\n\n/** Cost admission precedes the semantic decoder; refinements alone run after child parsing. */\nexport const boundedInput = (value: unknown): boolean => {\n let bytes = 0;\n let nodes = 0;\n const ancestors = new Set<object>();\n\n const add = (count: number): boolean => {\n bytes += count;\n\n return bytes <= Limits.encodedBytes;\n };\n\n const string = (text: string): boolean =>\n text.length <= Limits.encodedBytes && add(utf8.encode(JSON.stringify(text)).byteLength);\n\n const visit = (input: unknown, depth: number): boolean => {\n if (++nodes > maximumNodes || depth > maximumDepth) return false;\n if (input === null) return add(4);\n if (typeof input === \"string\") return string(input);\n if (typeof input === \"boolean\") return add(input ? 4 : 5);\n if (typeof input === \"number\")\n return Number.isFinite(input) && add(JSON.stringify(input).length);\n if (!Predicate.isObjectKeyword(input) || ancestors.has(input)) return false;\n ancestors.add(input);\n\n if (Array.isArray(input)) {\n if (input.length > Limits.steps || !add(2 + Math.max(0, input.length - 1))) return false;\n const keys = Reflect.ownKeys(input);\n\n // Dense JSON arrays have precisely their indices and the intrinsic length member.\n if (keys.length !== input.length + 1) return false;\n for (let index = 0; index < input.length; index++) {\n const property = Object.getOwnPropertyDescriptor(input, String(index));\n\n if (property === undefined || !(\"value\" in property) || !visit(property.value, depth + 1))\n return false;\n }\n } else {\n const prototype: unknown = Object.getPrototypeOf(input);\n\n if (\n (prototype !== null && !Predicate.isObjectKeyword(prototype)) ||\n !dataPrototypes.has(prototype)\n )\n return false;\n const keys = Reflect.ownKeys(input);\n\n if (keys.length > maximumKeys || !add(2 + Math.max(0, keys.length - 1))) return false;\n for (const key of keys) {\n if (typeof key !== \"string\") return false;\n const property = Object.getOwnPropertyDescriptor(input, key);\n\n if (\n property === undefined ||\n !property.enumerable ||\n !(\"value\" in property) ||\n !string(key) ||\n !add(1) ||\n !visit(property.value, depth + 1)\n )\n return false;\n }\n }\n ancestors.delete(input);\n\n return true;\n };\n\n try {\n if (Predicate.isObject(value)) {\n const steps = Object.getOwnPropertyDescriptor(value, \"steps\");\n\n if (\n steps !== undefined &&\n (!(\"value\" in steps) || (Array.isArray(steps.value) && steps.value.length > Limits.steps))\n )\n return false;\n }\n\n return visit(value, 0);\n } catch {\n return false;\n }\n};\n\nconst CostBound = Schema.Unknown.check(\n Schema.makeFilter(boundedInput, { title: \"bounded finite JSON plan/input data\" }),\n);\n\n/** This shared boundary never traverses an oversized step array in the semantic decoder. */\nexport const guardedDecode = <S extends Schema.Constraint>(schema: S) => {\n const admit = Schema.decodeUnknownEffect(CostBound);\n const decode = Schema.decodeUnknownEffect(schema);\n\n return (value: unknown, options?: SchemaAST.ParseOptions) =>\n admit(value).pipe(Effect.flatMap((input) => decode(input, options)));\n};\n"],"mappings":";;;;AAKA,MAAM,OAAO,IAAI,YAAY;AAC7B,MAAM,eAAe;AACrB,MAAM,eAAe;AACrB,MAAM,cAAc;AAEpB,MAAM,iCAAiB,IAAI,IAAmB;CAC5C;CACA,OAAO;CACP,gBAAgB;CAChB,cAAc;CACd,aAAa;AACf,CAAC;;AAGD,MAAa,gBAAgB,UAA4B;CACvD,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,MAAM,4BAAY,IAAI,IAAY;CAElC,MAAM,OAAO,UAA2B;EACtC,SAAS;EAET,OAAO,SAAS,OAAO;CACzB;CAEA,MAAM,UAAU,SACd,KAAK,UAAU,OAAO,gBAAgB,IAAI,KAAK,OAAO,KAAK,UAAU,IAAI,CAAC,CAAC,CAAC,UAAU;CAExF,MAAM,SAAS,OAAgB,UAA2B;EACxD,IAAI,EAAE,QAAQ,gBAAgB,QAAQ,cAAc,OAAO;EAC3D,IAAI,UAAU,MAAM,OAAO,IAAI,CAAC;EAChC,IAAI,OAAO,UAAU,UAAU,OAAO,OAAO,KAAK;EAClD,IAAI,OAAO,UAAU,WAAW,OAAO,IAAI,QAAQ,IAAI,CAAC;EACxD,IAAI,OAAO,UAAU,UACnB,OAAO,OAAO,SAAS,KAAK,KAA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