captchakraken 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/solver.d.ts +43 -2
- package/dist/solver.js +416 -40
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/python/pyproject.toml +1 -1
- package/python/src/captchakraken/__init__.py +1 -1
- package/python/src/captchakraken/page_solver.py +264 -37
- package/python/src/captchakraken/planner.py +16 -1
package/dist/solver.d.ts
CHANGED
|
@@ -44,7 +44,10 @@ export declare class CaptchaKrakenSolver {
|
|
|
44
44
|
/** Answers keyed by screenshot hash; a hit means the answer already ran and changed nothing. */
|
|
45
45
|
private solutionCache;
|
|
46
46
|
private repeatedAnswerSeen;
|
|
47
|
-
|
|
47
|
+
private retriedUnusableAnswer;
|
|
48
|
+
private knownAnimated;
|
|
49
|
+
private animatedProbeDone;
|
|
50
|
+
/** The one recording for the animated board on screen, and its answer until the widget refuses it. */
|
|
48
51
|
private animatedPlan;
|
|
49
52
|
private keyframeMode;
|
|
50
53
|
private keyframeSteadyScreens;
|
|
@@ -54,6 +57,14 @@ export declare class CaptchaKrakenSolver {
|
|
|
54
57
|
private resampleLevel;
|
|
55
58
|
/** The recording `classifyByRecording` started and left running for the branch below to finish or drop. */
|
|
56
59
|
private pendingBurst;
|
|
60
|
+
/**
|
|
61
|
+
* The camera on the animated board in front of us, running across rounds until that board is gone.
|
|
62
|
+
*
|
|
63
|
+
* Distinct from `pendingBurst`, which is the speculative film one round starts and the same round spends.
|
|
64
|
+
* This one outlives a rejected answer on purpose: it is the only thing that can give the next ask a
|
|
65
|
+
* different question to answer, since the answer itself is deterministic at temperature 0.
|
|
66
|
+
*/
|
|
67
|
+
private animatedFilm;
|
|
57
68
|
private lastBurstFps;
|
|
58
69
|
private actedOnBoard;
|
|
59
70
|
private lastSubmitFrameHash;
|
|
@@ -110,6 +121,13 @@ export declare class CaptchaKrakenSolver {
|
|
|
110
121
|
/** The `--model` argv, or nothing: without VLLM_BASE_URL the CLI can see a credentials file this process cannot. */
|
|
111
122
|
private modelName;
|
|
112
123
|
private resolveCli;
|
|
124
|
+
/** What is LEFT of the solve, as a bound on one ask.
|
|
125
|
+
*
|
|
126
|
+
* The CLI is a child process and the solve deadline is only read between steps, so nothing stops an
|
|
127
|
+
* ask already in flight — measured against the hosted endpoint, one hung for ~124s inside a 45s
|
|
128
|
+
* budget and the attempt ran 143s. Never below the floor: a keyframe ask carries six images, and a
|
|
129
|
+
* timeout shorter than the work turns a busy endpoint into a guaranteed failure. */
|
|
130
|
+
private askTimeoutMs;
|
|
113
131
|
/** One-shot CLI tool call; `{}` on any failure so polling callers keep going. */
|
|
114
132
|
private runCliTool;
|
|
115
133
|
/** Start the persistent CV worker once; false when it cannot start, so callers fall back to one-shot spawns. */
|
|
@@ -142,12 +160,22 @@ export declare class CaptchaKrakenSolver {
|
|
|
142
160
|
private waitForAnyClickedTileLoaded;
|
|
143
161
|
/** Click, watch the clicked tiles, re-solve while they swap, submit on `done` or a chipped board. */
|
|
144
162
|
private solveRecaptchaGrid;
|
|
145
|
-
private recordKeyframeBurst;
|
|
146
163
|
/**
|
|
147
164
|
* Start filming now and decide later what it was for: the classifier, the speculative film, or the
|
|
148
165
|
* recording an animated answer is sliced from. Every window is wall-clock. A cycle is a screen that
|
|
149
166
|
* comes back; a board that shows nothing new for a floor window has settled. There is deliberately no
|
|
150
167
|
* "enough screens, stop" exit: measured on number_with_highest_value_video it failed every seed either way.
|
|
168
|
+
*
|
|
169
|
+
* `continuous` keeps the camera rolling past the first answer, for the whole solve. A one-shot burst can
|
|
170
|
+
* only ever show the model the screens that happened to fall inside its window — measured, a 4s burst
|
|
171
|
+
* against a 5.3s cycle showed two screens of three, and when the answer lived on the third there was no
|
|
172
|
+
* second chance, because the reused answer is identical by construction. Filming on means every later
|
|
173
|
+
* round slices a STRICTLY LONGER film: more repetitions for `_detect_cycle` to confirm against, and, on a
|
|
174
|
+
* board that never repeats, six evenly-spread picks across the whole solve instead of across four seconds.
|
|
175
|
+
*
|
|
176
|
+
* Longer, but never of TWO boards. A vendor that deals a fresh puzzle on a miss has replaced everything
|
|
177
|
+
* filmed so far, and keyframes cut across both states describe neither. `resume` cuts the film where our
|
|
178
|
+
* answer landed; a screen from before the cut coming back is what un-cuts it. See `snapshot`.
|
|
151
179
|
*/
|
|
152
180
|
private startKeyframeBurst;
|
|
153
181
|
/** Slice a burst into keyframes and solve them in one model request. The frame number is the guard. */
|
|
@@ -163,15 +191,28 @@ export declare class CaptchaKrakenSolver {
|
|
|
163
191
|
private resetSolveState;
|
|
164
192
|
/** Keyed on the retry mode too: the missed-tiles answer legitimately overlaps the previous one. */
|
|
165
193
|
private static answerSignature;
|
|
194
|
+
/** The recording still stands; dropping only the refused answer makes the retry an inference, not a burst. */
|
|
195
|
+
private invalidateAnimatedAnswer;
|
|
166
196
|
/** True when this answer already ran and changed nothing: resample, and let the recording path have a go. */
|
|
167
197
|
private noteAnswer;
|
|
168
198
|
/** A cache hit costs no inference, and means the answer already ran: the board cycles. */
|
|
169
199
|
private answerFor;
|
|
200
|
+
/**
|
|
201
|
+
* Drop the ANSWER, keep the camera.
|
|
202
|
+
*
|
|
203
|
+
* The two are deliberately separable. An answer the widget refused is spent — reusing it just presses the
|
|
204
|
+
* same wrong thing until the no-progress fence trips, three rounds in, with half the budget unspent. The
|
|
205
|
+
* film is the opposite: every second it keeps running makes the next slice a better question. So a
|
|
206
|
+
* refusal discards this and leaves `animatedFilm` alone; only a board that is GONE stops the camera.
|
|
207
|
+
*/
|
|
170
208
|
private discardAnimatedPlan;
|
|
209
|
+
/** The board is gone: its film can never describe the next one, so end it and free the frames. */
|
|
210
|
+
private stopAnimatedFilm;
|
|
171
211
|
/** Static or animated, decided by filming once. The film stays running for the branch that uses it. */
|
|
172
212
|
private classifyByRecording;
|
|
173
213
|
private releasePendingBurst;
|
|
174
214
|
private shouldSpeculate;
|
|
215
|
+
/** One second look per solve: a repeated answer arms it, and the recording it takes spends it. */
|
|
175
216
|
private shouldRetryAsAnimated;
|
|
176
217
|
private getSolution;
|
|
177
218
|
/** One inference through the CLI. */
|