diff options
| author | amankumarsingh77 <amankumarsingh7702@gmail.com> | 2026-07-28 20:25:38 +0530 |
|---|---|---|
| committer | Aman Kumar <145339995+amankumarsingh77@users.noreply.github.com> | 2026-08-02 19:12:46 +0530 |
| commit | 330767d862458386e804bde240a1f0d7835b9b8e (patch) | |
| tree | 13a5f2086d265959c1bfa10bb88641a6804fd1f5 /src/cdp/commands.ts | |
| parent | 12d7a38ba0f1b1e4e301fce81e22f4b93036d211 (diff) | |
refactor(cdp): strip comment noise
Removes module banners, section dividers, and comments restating the code.
Keeps one-line notes for the window.open/browserContextId constraint, the
seed-tab claim, the unverifiable-pin reuse rule, the SeedTargetProvider
rationale, the deliberate dialog retention, the discovery-time browser
quirks, and the guarded CDP decoder assertion.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'src/cdp/commands.ts')
| -rw-r--r-- | src/cdp/commands.ts | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/cdp/commands.ts b/src/cdp/commands.ts index e6d744d..580f8cf 100644 --- a/src/cdp/commands.ts +++ b/src/cdp/commands.ts @@ -78,7 +78,6 @@ const AxNode = Type.Object( export type AxNodeResult = Static<typeof AxNode>; export const COMMANDS = { - // --- Target --- "Target.attachToTarget": cmd( Type.Object({ targetId: Type.String(), flatten: Type.Optional(Type.Boolean()) }), Type.Object({ sessionId: Type.String() }), @@ -112,7 +111,6 @@ export const COMMANDS = { ), "Target.setDiscoverTargets": cmd(Type.Object({ discover: Type.Boolean() }), Empty), - // --- Browser --- "Browser.getWindowForTarget": cmd( Type.Object({ targetId: Type.Optional(Type.String()) }), Type.Object({ windowId: Type.Number(), bounds: Type.Optional(Type.Unknown()) }), @@ -126,7 +124,6 @@ export const COMMANDS = { Empty, ), - // --- Page --- "Page.enable": cmd(Type.Object({}), Empty), "Page.bringToFront": cmd(Type.Object({}), Empty), "Page.navigate": cmd( @@ -163,7 +160,6 @@ export const COMMANDS = { Empty, ), - // --- Runtime --- "Runtime.evaluate": cmd( Type.Object( { @@ -192,7 +188,6 @@ export const COMMANDS = { ), "Runtime.releaseObject": cmd(Type.Object({ objectId: Type.String() }), Empty), - // --- DOM --- "DOM.getDocument": cmd( Type.Object({ depth: Type.Optional(Type.Number()), pierce: Type.Optional(Type.Boolean()) }), Type.Object({ root: Type.Object({ nodeId: Type.Number() }, { additionalProperties: true }) }), @@ -224,13 +219,11 @@ export const COMMANDS = { Empty, ), - // --- Input --- "Input.dispatchMouseEvent": cmd(Type.Object({}, { additionalProperties: true }), Empty), "Input.dispatchKeyEvent": cmd(Type.Object({}, { additionalProperties: true }), Empty), "Input.dispatchDragEvent": cmd(Type.Object({}, { additionalProperties: true }), Empty), "Input.insertText": cmd(Type.Object({ text: Type.String() }), Empty), - // --- Network / Emulation / Accessibility --- "Network.getResponseBody": cmd( Type.Object({ requestId: Type.String() }), Type.Object({ body: Type.String(), base64Encoded: Type.Optional(Type.Boolean()) }), @@ -258,9 +251,6 @@ export const decodeResult = <M extends CdpMethod>( const why = spec.validate.Errors(raw).map((e) => e.message).join("; "); return err(cdpError("invalid_response", why, method)); } - // Guarded assertion — see Verified Fact 4. The Check above proves `raw` - // matches COMMANDS[method].result; TS cannot correlate a generic key to its - // mapped value, so this carries what the check established. The only - // assertion in the CDP layer; do not add another. + // Guarded assertion: the check above proves `raw` matches COMMANDS[method].result, which TS cannot correlate from a generic key. return ok(raw as ResultOf<M>); }; |
