mirror of
https://github.com/morluto/rea.git
synced 2026-11-11 01:13:39 +00:00
fix(cli): reject non-decimal web capture deadlines (#9167)
This commit is contained in:
3 files changed
+31
-4
No files matched your search
@@ -38,6 +38,7 @@ import { inspectWebNetworkCaptureInputSchema } from "../domain/webNetworkCapture
|
||||
import { withCommandCancellation } from "./commandCancellation.js";
|
||||
import { finishAnalysisCommand } from "./finishAnalysisCommand.js";
|
||||
import type { CliInstance } from "./types.js";
|
||||
import { cliDecimalField } from "./options.js";
|
||||
|
||||
/** Same envelope label as the other JSON-input commands and `parseCliJsonInput`. */
|
||||
const cliError = (error: AnalysisError): JsonValue => ({
|
||||
@@ -512,8 +513,10 @@ const registerBuildCommand = (
|
||||
.boolean()
|
||||
.default(false)
|
||||
.describe("Run every stage and report, but write nothing"),
|
||||
captureTimeoutMs:
|
||||
// Decimal tokens only: numeric coercion would read "0x1" as 1 ms.
|
||||
captureTimeoutMs: cliDecimalField(
|
||||
inspectWebNetworkCaptureInputSchema.shape.capture_timeout_ms,
|
||||
),
|
||||
}),
|
||||
run: ({ args, options }) =>
|
||||
withCommandCancellation((signal) =>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { CLI_COMMANDS } from "../cliCommandNames.js";
|
||||
import { logCliCommand } from "../cliLogging.js";
|
||||
import type { Logger } from "pino";
|
||||
import type { CliInstance } from "./types.js";
|
||||
import { cliIntegerArgument } from "./options.js";
|
||||
import { cliDecimalField, cliIntegerArgument } from "./options.js";
|
||||
import { withCommandCancellation } from "./commandCancellation.js";
|
||||
import {
|
||||
analysisEvidenceDeliveryOptions,
|
||||
@@ -55,8 +55,10 @@ export const registerWebNetworkCaptureCommands = (
|
||||
.optional()
|
||||
.describe("Zero-based producer ordinals; repeat to select several"),
|
||||
...explicitSensitiveValueOptions,
|
||||
captureTimeoutMs:
|
||||
// Decimal tokens only: numeric coercion would read "0x1" as 1 ms.
|
||||
captureTimeoutMs: cliDecimalField(
|
||||
inspectWebNetworkCaptureInputSchema.shape.capture_timeout_ms,
|
||||
),
|
||||
}),
|
||||
run: ({ args, options }) =>
|
||||
withCommandCancellation((signal) =>
|
||||
|
||||
Reference in new issue
Block a user