


























@@ -12,7 +12,12 @@ import {
1212applyExistingCronSchedulePatch,
1313resolveCronEditScheduleRequest,
1414} from "./schedule-options.js";
15-import { getCronChannelOptions, parseDurationMs, warnIfCronSchedulerDisabled } from "./shared.js";
15+import {
16+getCronChannelOptions,
17+parseCronToolsAllow,
18+parseDurationMs,
19+warnIfCronSchedulerDisabled,
20+} from "./shared.js";
16211722const assignIf = (
1823target: Record<string, unknown>,
@@ -59,7 +64,7 @@ export function registerCronEditCommand(cron: Command) {
5964.option("--timeout-seconds <n>", "Timeout seconds for agent jobs")
6065.option("--light-context", "Enable lightweight bootstrap context for agent jobs")
6166.option("--no-light-context", "Disable lightweight bootstrap context for agent jobs")
62-.option("--tools <csv>", "Comma-separated tool allow-list (e.g. exec,read,write)")
67+.option("--tools <list>", "Tool allow-list (e.g. exec,read,write or exec read write)")
6368.option("--clear-tools", "Remove tool allow-list (use all tools)", false)
6469.option("--announce", "Announce summary to a chat (subagent-style)")
6570.option("--deliver", "Deprecated (use --announce). Announces a summary to a chat.")
@@ -175,6 +180,7 @@ export function registerCronEditCommand(cron: Command) {
175180const hasSystemEventPatch = typeof opts.systemEvent === "string";
176181const model = normalizeOptionalString(opts.model);
177182const thinking = normalizeOptionalString(opts.thinking);
183+const toolsAllow = parseCronToolsAllow(opts.tools);
178184const timeoutSeconds = opts.timeoutSeconds
179185 ? Number.parseInt(String(opts.timeoutSeconds), 10)
180186 : undefined;
@@ -190,6 +196,7 @@ export function registerCronEditCommand(cron: Command) {
190196hasTimeoutSeconds ||
191197typeof opts.lightContext === "boolean" ||
192198typeof opts.tools === "string" ||
199+Array.isArray(opts.tools) ||
193200opts.clearTools ||
194201hasDeliveryModeFlag ||
195202hasDeliveryTarget ||
@@ -217,11 +224,8 @@ export function registerCronEditCommand(cron: Command) {
217224);
218225if (opts.clearTools) {
219226payload.toolsAllow = null;
220-} else if (typeof opts.tools === "string" && opts.tools.trim()) {
221-payload.toolsAllow = opts.tools
222-.split(",")
223-.map((t: string) => t.trim())
224-.filter(Boolean);
227+} else if (toolsAllow) {
228+payload.toolsAllow = toolsAllow;
225229}
226230patch.payload = payload;
227231}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。