@@ -10,10 +10,7 @@ import { sanitizeAgentId } from "../../routing/session-key.js";
|
10 | 10 | import { defaultRuntime } from "../../runtime.js"; |
11 | 11 | import type { GatewayRpcOpts } from "../gateway-rpc.js"; |
12 | 12 | import { addGatewayClientOptions, callGatewayFromCli } from "../gateway-rpc.js"; |
13 | | -import { |
14 | | -parsePositiveIntOrUndefined, |
15 | | -parseStrictPositiveIntOrUndefined, |
16 | | -} from "../program/helpers.js"; |
| 13 | +import { parseStrictPositiveIntOrUndefined } from "../program/helpers.js"; |
17 | 14 | import { resolveCronCreateScheduleFromArgs } from "./schedule-options.js"; |
18 | 15 | import { |
19 | 16 | getCronChannelOptions, |
@@ -234,8 +231,19 @@ export function registerCronAddCommand(cron: Command) {
|
234 | 231 | ? opts.outputTimeoutSeconds |
235 | 232 | : undefined); |
236 | 233 | const noOutputTimeoutSeconds = |
237 | | -parsePositiveIntOrUndefined(rawNoOutputTimeoutSeconds); |
238 | | -const outputMaxBytes = parsePositiveIntOrUndefined(opts.outputMaxBytes); |
| 234 | +parseStrictPositiveIntOrUndefined(rawNoOutputTimeoutSeconds); |
| 235 | +if ( |
| 236 | +rawNoOutputTimeoutSeconds !== undefined && |
| 237 | +noOutputTimeoutSeconds === undefined |
| 238 | +) { |
| 239 | +throw new Error( |
| 240 | +"Invalid --no-output-timeout-seconds (must be a positive integer).", |
| 241 | +); |
| 242 | +} |
| 243 | +const outputMaxBytes = parseStrictPositiveIntOrUndefined(opts.outputMaxBytes); |
| 244 | +if (opts.outputMaxBytes !== undefined && outputMaxBytes === undefined) { |
| 245 | +throw new Error("Invalid --output-max-bytes (must be a positive integer)."); |
| 246 | +} |
239 | 247 | return { |
240 | 248 | kind: "command" as const, |
241 | 249 | argv: commandArgv ?? ["sh", "-lc", commandShell ?? ""], |
|