@vm0/cli 9.222.9 → 9.222.11
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/{agent-ZDJQRV5F.js → agent-XNVQRMKI.js} +4 -4
- package/automation-7MAK66QT.js +31 -0
- package/automation-7MAK66QT.js.map +1 -0
- package/{banking-3VE6CETL.js → banking-QBTNNOCQ.js} +2 -2
- package/{chat-LBGYMTDO.js → chat-ELAJKQXT.js} +2 -2
- package/{chunk-S473TX4B.js → chunk-5EPGSDIQ.js} +479 -46
- package/chunk-5EPGSDIQ.js.map +1 -0
- package/{chunk-OJEINPMU.js → chunk-7ZJOZZXZ.js} +3 -3
- package/{chunk-Y3NUN3UL.js → chunk-F774K6TY.js} +2 -2
- package/{chunk-YVZFUVCW.js → chunk-JOOQB7W3.js} +2 -2
- package/{chunk-QVSVGYE3.js → chunk-KBDCWC3F.js} +40 -395
- package/chunk-KBDCWC3F.js.map +1 -0
- package/{chunk-N2FY46MD.js → chunk-MJ4W2C3Z.js} +7 -9
- package/{chunk-N2FY46MD.js.map → chunk-MJ4W2C3Z.js.map} +1 -1
- package/{chunk-TWIQPNKQ.js → chunk-VTG6TDYL.js} +2 -2
- package/{chunk-LBHBBYUU.js → chunk-Y4YHS5UO.js} +2 -2
- package/{chunk-3ZVLQIJN.js → chunk-ZPWEXRMA.js} +3 -3
- package/{computer-use-7M4K42CT.js → computer-use-XXPDTJSQ.js} +2 -2
- package/{connector-PLTWJW2T.js → connector-PWDJ3R6G.js} +2 -2
- package/{credit-2MVNEHI6.js → credit-MYBUWRHP.js} +2 -2
- package/{developer-support-PEFJTIAK.js → developer-support-65OQ2RK4.js} +2 -2
- package/{doctor-NCFSDVXU.js → doctor-2U4HK4AX.js} +6 -6
- package/{generate-BZ2SR3S2.js → generate-UEDRCAKX.js} +2 -2
- package/{github-D52YY3PW.js → github-R6JKL74U.js} +2 -2
- package/{goal-CGDHCZQL.js → goal-BG47S2RP.js} +2 -2
- package/{host-RU374UJZ.js → host-2VS2KOZQ.js} +2 -2
- package/index.js +18 -20
- package/index.js.map +1 -1
- package/{logs-GLJEMUTL.js → logs-XFVZAKVG.js} +11 -13
- package/{logs-GLJEMUTL.js.map → logs-XFVZAKVG.js.map} +1 -1
- package/{maps-QCEV2Y5T.js → maps-ZBULOEZW.js} +2 -2
- package/{maskdb.generated-X4O7LDNM.js → maskdb.generated-VAIGGNUJ.js} +2 -2
- package/maskdb.generated-VAIGGNUJ.js.map +1 -0
- package/{maskdb.generated-ROG4XZ7X.js → maskdb.generated-WA5B4GQ5.js} +5 -1
- package/maskdb.generated-WA5B4GQ5.js.map +1 -0
- package/{model-RTTTCIHY.js → model-BFHGQJ5U.js} +3 -3
- package/{model-provider-CZJPMY6Z.js → model-provider-OUSOKSWW.js} +3 -3
- package/{org-4WKWAWHE.js → org-RI2EYUW7.js} +2 -2
- package/package.json +1 -1
- package/{phone-GI7KA3KZ.js → phone-SNLGLD3J.js} +2 -2
- package/{preference-KD4UYLQE.js → preference-XDSQRZWM.js} +2 -2
- package/{resource-UYWSXAUZ.js → resource-BA4FQCNQ.js} +2 -2
- package/schedule-OSHL7HWT.js +33 -0
- package/schedule-OSHL7HWT.js.map +1 -0
- package/{search-V5ME4TLE.js → search-KXVRANLT.js} +8 -10
- package/{search-V5ME4TLE.js.map → search-KXVRANLT.js.map} +1 -1
- package/{secret-YCQ5IAMV.js → secret-NFJQKUPS.js} +3 -3
- package/{slack-UF64OZUG.js → slack-JPM5WVX6.js} +2 -2
- package/{telegram-U76HOCPN.js → telegram-BNX4UZTT.js} +2 -2
- package/{variable-NXY6SYD3.js → variable-IAIPAH3T.js} +2 -2
- package/{web-QQFWWXYM.js → web-3TJGHZNA.js} +2 -2
- package/{whoami-NFGUYQYI.js → whoami-OVIXXMRR.js} +4 -4
- package/{workflow-CIIUERNL.js → workflow-WWMTJDLF.js} +71 -10
- package/workflow-WWMTJDLF.js.map +1 -0
- package/zero.js +36 -37
- package/zero.js.map +1 -1
- package/automation-FJOIHXBS.js +0 -501
- package/automation-FJOIHXBS.js.map +0 -1
- package/chunk-H63W4KQL.js +0 -160
- package/chunk-H63W4KQL.js.map +0 -1
- package/chunk-HQFETCZ6.js +0 -71
- package/chunk-HQFETCZ6.js.map +0 -1
- package/chunk-QVSVGYE3.js.map +0 -1
- package/chunk-S473TX4B.js.map +0 -1
- package/maskdb.generated-ROG4XZ7X.js.map +0 -1
- package/maskdb.generated-X4O7LDNM.js.map +0 -1
- package/schedule-MTI5OP23.js +0 -31
- package/schedule-MTI5OP23.js.map +0 -1
- package/workflow-CIIUERNL.js.map +0 -1
- /package/{agent-ZDJQRV5F.js.map → agent-XNVQRMKI.js.map} +0 -0
- /package/{banking-3VE6CETL.js.map → banking-QBTNNOCQ.js.map} +0 -0
- /package/{chat-LBGYMTDO.js.map → chat-ELAJKQXT.js.map} +0 -0
- /package/{chunk-OJEINPMU.js.map → chunk-7ZJOZZXZ.js.map} +0 -0
- /package/{chunk-Y3NUN3UL.js.map → chunk-F774K6TY.js.map} +0 -0
- /package/{chunk-YVZFUVCW.js.map → chunk-JOOQB7W3.js.map} +0 -0
- /package/{chunk-TWIQPNKQ.js.map → chunk-VTG6TDYL.js.map} +0 -0
- /package/{chunk-LBHBBYUU.js.map → chunk-Y4YHS5UO.js.map} +0 -0
- /package/{chunk-3ZVLQIJN.js.map → chunk-ZPWEXRMA.js.map} +0 -0
- /package/{computer-use-7M4K42CT.js.map → computer-use-XXPDTJSQ.js.map} +0 -0
- /package/{connector-PLTWJW2T.js.map → connector-PWDJ3R6G.js.map} +0 -0
- /package/{credit-2MVNEHI6.js.map → credit-MYBUWRHP.js.map} +0 -0
- /package/{developer-support-PEFJTIAK.js.map → developer-support-65OQ2RK4.js.map} +0 -0
- /package/{doctor-NCFSDVXU.js.map → doctor-2U4HK4AX.js.map} +0 -0
- /package/{generate-BZ2SR3S2.js.map → generate-UEDRCAKX.js.map} +0 -0
- /package/{github-D52YY3PW.js.map → github-R6JKL74U.js.map} +0 -0
- /package/{goal-CGDHCZQL.js.map → goal-BG47S2RP.js.map} +0 -0
- /package/{host-RU374UJZ.js.map → host-2VS2KOZQ.js.map} +0 -0
- /package/{maps-QCEV2Y5T.js.map → maps-ZBULOEZW.js.map} +0 -0
- /package/{model-RTTTCIHY.js.map → model-BFHGQJ5U.js.map} +0 -0
- /package/{model-provider-CZJPMY6Z.js.map → model-provider-OUSOKSWW.js.map} +0 -0
- /package/{org-4WKWAWHE.js.map → org-RI2EYUW7.js.map} +0 -0
- /package/{phone-GI7KA3KZ.js.map → phone-SNLGLD3J.js.map} +0 -0
- /package/{preference-KD4UYLQE.js.map → preference-XDSQRZWM.js.map} +0 -0
- /package/{resource-UYWSXAUZ.js.map → resource-BA4FQCNQ.js.map} +0 -0
- /package/{secret-YCQ5IAMV.js.map → secret-NFJQKUPS.js.map} +0 -0
- /package/{slack-UF64OZUG.js.map → slack-JPM5WVX6.js.map} +0 -0
- /package/{telegram-U76HOCPN.js.map → telegram-BNX4UZTT.js.map} +0 -0
- /package/{variable-NXY6SYD3.js.map → variable-IAIPAH3T.js.map} +0 -0
- /package/{web-QQFWWXYM.js.map → web-3TJGHZNA.js.map} +0 -0
- /package/{whoami-NFGUYQYI.js.map → whoami-OVIXXMRR.js.map} +0 -0
package/automation-FJOIHXBS.js
DELETED
|
@@ -1,501 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from "node:module";
|
|
3
|
-
const require = __createRequire(import.meta.url);
|
|
4
|
-
import {
|
|
5
|
-
formatDurationSeconds,
|
|
6
|
-
formatRelativeTime,
|
|
7
|
-
parseDurationSeconds
|
|
8
|
-
} from "./chunk-HQFETCZ6.js";
|
|
9
|
-
import {
|
|
10
|
-
isUUID
|
|
11
|
-
} from "./chunk-S473TX4B.js";
|
|
12
|
-
import "./chunk-I23JUVHS.js";
|
|
13
|
-
import "./chunk-Y3NUN3UL.js";
|
|
14
|
-
import "./chunk-LBHBBYUU.js";
|
|
15
|
-
import {
|
|
16
|
-
isInteractive,
|
|
17
|
-
promptConfirm
|
|
18
|
-
} from "./chunk-JFY6GK7Y.js";
|
|
19
|
-
import "./chunk-LTDQISD7.js";
|
|
20
|
-
import {
|
|
21
|
-
createAutomation,
|
|
22
|
-
deleteAutomation,
|
|
23
|
-
disableAutomation,
|
|
24
|
-
enableAutomation,
|
|
25
|
-
getComposeById,
|
|
26
|
-
listAutomations,
|
|
27
|
-
runAutomation,
|
|
28
|
-
showAutomation,
|
|
29
|
-
updateAutomation,
|
|
30
|
-
updateAutomationTrigger
|
|
31
|
-
} from "./chunk-QVSVGYE3.js";
|
|
32
|
-
import {
|
|
33
|
-
withErrorHandler
|
|
34
|
-
} from "./chunk-3F4RFLPX.js";
|
|
35
|
-
import {
|
|
36
|
-
source_default
|
|
37
|
-
} from "./chunk-JUTUEPIR.js";
|
|
38
|
-
import "./chunk-LRHXR7JT.js";
|
|
39
|
-
import {
|
|
40
|
-
Command
|
|
41
|
-
} from "./chunk-B3W2RUBP.js";
|
|
42
|
-
import {
|
|
43
|
-
init_esm_shims
|
|
44
|
-
} from "./chunk-DIRAZ3YX.js";
|
|
45
|
-
|
|
46
|
-
// src/commands/zero/automation/index.ts
|
|
47
|
-
init_esm_shims();
|
|
48
|
-
|
|
49
|
-
// src/commands/zero/automation/create.ts
|
|
50
|
-
init_esm_shims();
|
|
51
|
-
|
|
52
|
-
// src/commands/zero/automation/at-time-input.ts
|
|
53
|
-
init_esm_shims();
|
|
54
|
-
var EXPLICIT_OFFSET_RE = /(?:[zZ]|[+-]\d{2}:?\d{2})$/u;
|
|
55
|
-
function hasExplicitAtTimeOffset(atTime) {
|
|
56
|
-
return EXPLICIT_OFFSET_RE.test(atTime.trim());
|
|
57
|
-
}
|
|
58
|
-
function requireTimezoneForLocalAtTime(atTime, timezone, flagName) {
|
|
59
|
-
if (timezone || hasExplicitAtTimeOffset(atTime)) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
throw new Error(
|
|
63
|
-
`${flagName} without Z or an explicit offset requires --timezone (e.g. ${flagName} "2026-06-10T09:00" --timezone Asia/Shanghai)`
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/commands/zero/automation/trigger-display.ts
|
|
68
|
-
init_esm_shims();
|
|
69
|
-
function formatTriggerConfig(trigger) {
|
|
70
|
-
switch (trigger.kind) {
|
|
71
|
-
case "cron":
|
|
72
|
-
return `${trigger.cronExpression} (${trigger.timezone})`;
|
|
73
|
-
case "once":
|
|
74
|
-
return `at ${trigger.atTime} (${trigger.timezone})`;
|
|
75
|
-
case "loop":
|
|
76
|
-
return `every ${formatDurationSeconds(trigger.intervalSeconds)}`;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
function formatNextRun(trigger) {
|
|
80
|
-
if (!trigger.nextRunAt) {
|
|
81
|
-
return source_default.dim("-");
|
|
82
|
-
}
|
|
83
|
-
return formatRelativeTime(trigger.nextRunAt);
|
|
84
|
-
}
|
|
85
|
-
function printTriggersTable(triggers) {
|
|
86
|
-
const kindWidth = Math.max(
|
|
87
|
-
4,
|
|
88
|
-
...triggers.map((t) => {
|
|
89
|
-
return t.kind.length;
|
|
90
|
-
})
|
|
91
|
-
);
|
|
92
|
-
const idWidth = Math.max(
|
|
93
|
-
2,
|
|
94
|
-
...triggers.map((t) => {
|
|
95
|
-
return t.id.length;
|
|
96
|
-
})
|
|
97
|
-
);
|
|
98
|
-
const configWidth = Math.max(
|
|
99
|
-
6,
|
|
100
|
-
...triggers.map((t) => {
|
|
101
|
-
return formatTriggerConfig(t).length;
|
|
102
|
-
})
|
|
103
|
-
);
|
|
104
|
-
console.log(
|
|
105
|
-
source_default.dim(
|
|
106
|
-
[
|
|
107
|
-
"KIND".padEnd(kindWidth),
|
|
108
|
-
"ID".padEnd(idWidth),
|
|
109
|
-
"STATUS".padEnd(8),
|
|
110
|
-
"CONFIG".padEnd(configWidth),
|
|
111
|
-
"NEXT RUN"
|
|
112
|
-
].join(" ")
|
|
113
|
-
)
|
|
114
|
-
);
|
|
115
|
-
for (const trigger of triggers) {
|
|
116
|
-
const status = trigger.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
|
|
117
|
-
console.log(
|
|
118
|
-
[
|
|
119
|
-
trigger.kind.padEnd(kindWidth),
|
|
120
|
-
trigger.id.padEnd(idWidth),
|
|
121
|
-
status.padEnd(8 + (trigger.enabled ? 0 : 2)),
|
|
122
|
-
formatTriggerConfig(trigger).padEnd(configWidth),
|
|
123
|
-
formatNextRun(trigger)
|
|
124
|
-
].join(" ")
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// src/commands/zero/automation/create.ts
|
|
130
|
-
function buildInlineTrigger(options) {
|
|
131
|
-
const sugarCount = [options.cron, options.once, options.loop].filter(
|
|
132
|
-
(value) => {
|
|
133
|
-
return value !== void 0;
|
|
134
|
-
}
|
|
135
|
-
).length;
|
|
136
|
-
if (sugarCount !== 1) {
|
|
137
|
-
throw new Error("Use exactly one of --cron, --once, --loop");
|
|
138
|
-
}
|
|
139
|
-
if (options.timezone && !options.cron && !options.once) {
|
|
140
|
-
throw new Error("--timezone requires --cron or --once");
|
|
141
|
-
}
|
|
142
|
-
if (options.cron) {
|
|
143
|
-
return {
|
|
144
|
-
kind: "cron",
|
|
145
|
-
cronExpression: options.cron,
|
|
146
|
-
timezone: options.timezone
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
|
-
if (options.once) {
|
|
150
|
-
requireTimezoneForLocalAtTime(options.once, options.timezone, "--once");
|
|
151
|
-
return { kind: "once", atTime: options.once, timezone: options.timezone };
|
|
152
|
-
}
|
|
153
|
-
if (options.loop) {
|
|
154
|
-
return {
|
|
155
|
-
kind: "loop",
|
|
156
|
-
intervalSeconds: parseDurationSeconds(options.loop)
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
throw new Error("Use exactly one of --cron, --once, --loop");
|
|
160
|
-
}
|
|
161
|
-
var createCommand = new Command().name("create").description("Create an automation with a schedule trigger").requiredOption("-n, --name <name>", "Automation name").requiredOption("--agent <agent-id>", "Agent ID to run").requiredOption(
|
|
162
|
-
"-p, --prompt <instruction>",
|
|
163
|
-
"Instruction the agent runs when the automation fires"
|
|
164
|
-
).option("--description <text>", "Optional description").option("--cron <expression>", 'Add a cron trigger (e.g. "0 9 * * *")').option(
|
|
165
|
-
"--once <iso-time>",
|
|
166
|
-
'Add a one-time trigger (e.g. "2026-06-10T09:00")'
|
|
167
|
-
).option("--loop <duration>", "Add a loop trigger (e.g. 15m, 1h, 90s)").option("-z, --timezone <tz>", "IANA timezone for --cron / --once").addHelpText(
|
|
168
|
-
"after",
|
|
169
|
-
`
|
|
170
|
-
Examples:
|
|
171
|
-
Daily at 9am: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --cron "0 9 * * *"
|
|
172
|
-
One-time: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --once "2026-06-10T09:00" -z UTC
|
|
173
|
-
Every 15 min: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p "..." --loop 15m
|
|
174
|
-
|
|
175
|
-
Notes:
|
|
176
|
-
- Exactly one of --cron, --once, --loop is required`
|
|
177
|
-
).action(
|
|
178
|
-
withErrorHandler(async (options) => {
|
|
179
|
-
if (!isUUID(options.agent)) {
|
|
180
|
-
console.error(
|
|
181
|
-
source_default.red(`\u2717 Invalid agent ID "${options.agent}" \u2014 expected a UUID`)
|
|
182
|
-
);
|
|
183
|
-
console.error(source_default.dim(" Run: zero agent list to find agent IDs"));
|
|
184
|
-
process.exit(1);
|
|
185
|
-
}
|
|
186
|
-
const trigger = buildInlineTrigger(options);
|
|
187
|
-
const compose = await getComposeById(options.agent);
|
|
188
|
-
const { automation } = await createAutomation({
|
|
189
|
-
name: options.name,
|
|
190
|
-
agentId: compose.id,
|
|
191
|
-
instruction: options.prompt,
|
|
192
|
-
description: options.description,
|
|
193
|
-
chatThreadId: process.env.ZERO_CHAT_THREAD_ID,
|
|
194
|
-
trigger
|
|
195
|
-
});
|
|
196
|
-
console.log(source_default.green(`\u2713 Automation "${automation.name}" created`));
|
|
197
|
-
console.log(source_default.dim(` ID: ${automation.id}`));
|
|
198
|
-
console.log(source_default.dim(` Agent: ${compose.name}`));
|
|
199
|
-
console.log(source_default.dim(` Thread: ${automation.chatThreadId}`));
|
|
200
|
-
const createdTrigger = automation.triggers[0];
|
|
201
|
-
if (createdTrigger) {
|
|
202
|
-
console.log(
|
|
203
|
-
source_default.dim(
|
|
204
|
-
` Trigger: ${createdTrigger.kind} ${formatTriggerConfig(createdTrigger)} (${createdTrigger.id})`
|
|
205
|
-
)
|
|
206
|
-
);
|
|
207
|
-
}
|
|
208
|
-
console.log();
|
|
209
|
-
console.log(
|
|
210
|
-
` Run manually: ${source_default.cyan(`zero automation run ${automation.name}`)}`
|
|
211
|
-
);
|
|
212
|
-
})
|
|
213
|
-
);
|
|
214
|
-
|
|
215
|
-
// src/commands/zero/automation/list.ts
|
|
216
|
-
init_esm_shims();
|
|
217
|
-
function formatTriggerSummary(automation) {
|
|
218
|
-
const [trigger] = automation.triggers;
|
|
219
|
-
if (!trigger) {
|
|
220
|
-
return source_default.dim("-");
|
|
221
|
-
}
|
|
222
|
-
return trigger.kind;
|
|
223
|
-
}
|
|
224
|
-
var listCommand = new Command().name("list").alias("ls").description("List automations with their schedule trigger").addHelpText(
|
|
225
|
-
"after",
|
|
226
|
-
`
|
|
227
|
-
Examples:
|
|
228
|
-
zero automation list`
|
|
229
|
-
).action(
|
|
230
|
-
withErrorHandler(async () => {
|
|
231
|
-
const { automations } = await listAutomations();
|
|
232
|
-
if (automations.length === 0) {
|
|
233
|
-
console.log(source_default.dim("No automations found"));
|
|
234
|
-
console.log(
|
|
235
|
-
source_default.dim(
|
|
236
|
-
' Create one with: zero automation create -n <name> --agent <agent-id> -p "<instruction>"'
|
|
237
|
-
)
|
|
238
|
-
);
|
|
239
|
-
return;
|
|
240
|
-
}
|
|
241
|
-
const nameWidth = Math.max(
|
|
242
|
-
4,
|
|
243
|
-
...automations.map((a) => {
|
|
244
|
-
return a.name.length;
|
|
245
|
-
})
|
|
246
|
-
);
|
|
247
|
-
const idWidth = Math.max(
|
|
248
|
-
2,
|
|
249
|
-
...automations.map((a) => {
|
|
250
|
-
return a.id.length;
|
|
251
|
-
})
|
|
252
|
-
);
|
|
253
|
-
const agentWidth = Math.max(
|
|
254
|
-
5,
|
|
255
|
-
...automations.map((a) => {
|
|
256
|
-
return (a.displayName ?? a.agentId).length;
|
|
257
|
-
})
|
|
258
|
-
);
|
|
259
|
-
console.log(
|
|
260
|
-
source_default.dim(
|
|
261
|
-
[
|
|
262
|
-
"NAME".padEnd(nameWidth),
|
|
263
|
-
"ID".padEnd(idWidth),
|
|
264
|
-
"AGENT".padEnd(agentWidth),
|
|
265
|
-
"STATUS".padEnd(8),
|
|
266
|
-
"TRIGGER"
|
|
267
|
-
].join(" ")
|
|
268
|
-
)
|
|
269
|
-
);
|
|
270
|
-
for (const automation of automations) {
|
|
271
|
-
const status = automation.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
|
|
272
|
-
console.log(
|
|
273
|
-
[
|
|
274
|
-
automation.name.padEnd(nameWidth),
|
|
275
|
-
automation.id.padEnd(idWidth),
|
|
276
|
-
(automation.displayName ?? automation.agentId).padEnd(agentWidth),
|
|
277
|
-
status.padEnd(8 + (automation.enabled ? 0 : 2)),
|
|
278
|
-
formatTriggerSummary(automation)
|
|
279
|
-
].join(" ")
|
|
280
|
-
);
|
|
281
|
-
}
|
|
282
|
-
console.log();
|
|
283
|
-
console.log(
|
|
284
|
-
source_default.dim(` Details: zero automation show <automation-name-or-id>`)
|
|
285
|
-
);
|
|
286
|
-
})
|
|
287
|
-
);
|
|
288
|
-
|
|
289
|
-
// src/commands/zero/automation/show.ts
|
|
290
|
-
init_esm_shims();
|
|
291
|
-
var showCommand = new Command().name("show").description("Show an automation and its schedule").argument("<automation>", "Automation ID or name").addHelpText(
|
|
292
|
-
"after",
|
|
293
|
-
`
|
|
294
|
-
Examples:
|
|
295
|
-
zero automation show alerts
|
|
296
|
-
zero automation show 11111111-1111-4111-8111-111111111111
|
|
297
|
-
|
|
298
|
-
Notes:
|
|
299
|
-
- When the same name exists on multiple agents, the API rejects it as ambiguous \u2014 use the ID`
|
|
300
|
-
).action(
|
|
301
|
-
withErrorHandler(async (ref) => {
|
|
302
|
-
const automation = await showAutomation(ref);
|
|
303
|
-
const status = automation.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
|
|
304
|
-
const agent = automation.displayName ? `${automation.displayName} ${source_default.dim(`(${automation.agentId})`)}` : automation.agentId;
|
|
305
|
-
console.log(`${"Name:".padEnd(14)}${automation.name}`);
|
|
306
|
-
console.log(`${"ID:".padEnd(14)}${automation.id}`);
|
|
307
|
-
console.log(`${"Agent:".padEnd(14)}${agent}`);
|
|
308
|
-
console.log(`${"Status:".padEnd(14)}${status}`);
|
|
309
|
-
if (automation.description) {
|
|
310
|
-
console.log(`${"Description:".padEnd(14)}${automation.description}`);
|
|
311
|
-
}
|
|
312
|
-
console.log(
|
|
313
|
-
`${"Instruction:".padEnd(14)}${source_default.dim(automation.instruction)}`
|
|
314
|
-
);
|
|
315
|
-
console.log(`${"Thread:".padEnd(14)}${automation.chatThreadId}`);
|
|
316
|
-
console.log();
|
|
317
|
-
const [trigger] = automation.triggers;
|
|
318
|
-
if (!trigger) {
|
|
319
|
-
console.log(source_default.dim("No schedule trigger"));
|
|
320
|
-
return;
|
|
321
|
-
}
|
|
322
|
-
printTriggersTable([trigger]);
|
|
323
|
-
})
|
|
324
|
-
);
|
|
325
|
-
|
|
326
|
-
// src/commands/zero/automation/update.ts
|
|
327
|
-
init_esm_shims();
|
|
328
|
-
function buildTimingUpdate(options) {
|
|
329
|
-
const sugarCount = [options.cron, options.once, options.loop].filter(
|
|
330
|
-
(value) => {
|
|
331
|
-
return value !== void 0;
|
|
332
|
-
}
|
|
333
|
-
).length;
|
|
334
|
-
if (sugarCount > 1) {
|
|
335
|
-
throw new Error("Use at most one of --cron, --once, --loop");
|
|
336
|
-
}
|
|
337
|
-
if (options.timezone && !options.cron && !options.once) {
|
|
338
|
-
throw new Error("--timezone requires --cron or --once");
|
|
339
|
-
}
|
|
340
|
-
if (options.cron) {
|
|
341
|
-
return {
|
|
342
|
-
kind: "cron",
|
|
343
|
-
cronExpression: options.cron,
|
|
344
|
-
timezone: options.timezone
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
if (options.once) {
|
|
348
|
-
requireTimezoneForLocalAtTime(options.once, options.timezone, "--once");
|
|
349
|
-
return { kind: "once", atTime: options.once, timezone: options.timezone };
|
|
350
|
-
}
|
|
351
|
-
if (options.loop) {
|
|
352
|
-
return {
|
|
353
|
-
kind: "loop",
|
|
354
|
-
intervalSeconds: parseDurationSeconds(options.loop)
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
return void 0;
|
|
358
|
-
}
|
|
359
|
-
var updateCommand = new Command().name("update").description(
|
|
360
|
-
"Update an automation's name, instruction, description, or schedule"
|
|
361
|
-
).argument("<automation>", "Automation ID or name").option("-n, --name <name>", "New automation name").option("-p, --prompt <instruction>", "New instruction").option("--description <text>", "New description").option("--cron <expression>", 'New cron schedule (e.g. "0 9 * * *")').option("--once <iso-time>", 'New one-time fire (e.g. "2026-06-10T09:00")').option("--loop <duration>", "New loop interval (e.g. 15m, 1h, 90s)").option("-z, --timezone <tz>", "IANA timezone for --cron / --once").addHelpText(
|
|
362
|
-
"after",
|
|
363
|
-
`
|
|
364
|
-
Examples:
|
|
365
|
-
zero automation update alerts -p "Summarize alerts and post to Slack"
|
|
366
|
-
zero automation update alerts -n alerts-v2 --description "Daily alert digest"
|
|
367
|
-
zero automation update alerts --cron "0 18 * * 5" -z Asia/Shanghai
|
|
368
|
-
zero automation update alerts --loop 10m
|
|
369
|
-
|
|
370
|
-
Notes:
|
|
371
|
-
- At most one of --cron, --once, --loop; it replaces the automation's schedule trigger in place (the kind may switch, run history is kept)`
|
|
372
|
-
).action(
|
|
373
|
-
withErrorHandler(async (ref, options) => {
|
|
374
|
-
const timing = buildTimingUpdate(options);
|
|
375
|
-
const hasIdentityUpdate = options.name !== void 0 || options.prompt !== void 0 || options.description !== void 0;
|
|
376
|
-
if (!hasIdentityUpdate && !timing) {
|
|
377
|
-
throw new Error(
|
|
378
|
-
"Nothing to update: provide --name, --prompt, --description, --cron, --once, or --loop"
|
|
379
|
-
);
|
|
380
|
-
}
|
|
381
|
-
let timeTriggerId;
|
|
382
|
-
if (timing) {
|
|
383
|
-
const automation = await showAutomation(ref);
|
|
384
|
-
const timeTriggers = automation.triggers;
|
|
385
|
-
const [first] = timeTriggers;
|
|
386
|
-
if (!first) {
|
|
387
|
-
throw new Error(`Automation ${ref} has no schedule trigger`);
|
|
388
|
-
}
|
|
389
|
-
timeTriggerId = first.id;
|
|
390
|
-
}
|
|
391
|
-
if (hasIdentityUpdate) {
|
|
392
|
-
const automation = await updateAutomation(ref, {
|
|
393
|
-
name: options.name,
|
|
394
|
-
instruction: options.prompt,
|
|
395
|
-
description: options.description
|
|
396
|
-
});
|
|
397
|
-
console.log(source_default.green(`\u2713 Automation "${automation.name}" updated`));
|
|
398
|
-
}
|
|
399
|
-
if (timing && timeTriggerId) {
|
|
400
|
-
const trigger = await updateAutomationTrigger(timeTriggerId, timing);
|
|
401
|
-
console.log(source_default.green(`\u2713 Trigger ${trigger.id} updated`));
|
|
402
|
-
console.log(
|
|
403
|
-
source_default.dim(
|
|
404
|
-
` Schedule: ${trigger.kind} ${formatTriggerConfig(trigger)}`
|
|
405
|
-
)
|
|
406
|
-
);
|
|
407
|
-
}
|
|
408
|
-
})
|
|
409
|
-
);
|
|
410
|
-
|
|
411
|
-
// src/commands/zero/automation/delete.ts
|
|
412
|
-
init_esm_shims();
|
|
413
|
-
var deleteCommand = new Command().name("delete").alias("rm").description("Delete an automation (its triggers are removed too)").argument("<automation>", "Automation ID or name").option("-y, --yes", "Skip confirmation prompt").addHelpText(
|
|
414
|
-
"after",
|
|
415
|
-
`
|
|
416
|
-
Examples:
|
|
417
|
-
zero automation delete alerts
|
|
418
|
-
zero automation delete alerts -y
|
|
419
|
-
|
|
420
|
-
Notes:
|
|
421
|
-
- Use -y to skip confirmation in non-interactive mode`
|
|
422
|
-
).action(
|
|
423
|
-
withErrorHandler(async (ref, options) => {
|
|
424
|
-
if (!options.yes) {
|
|
425
|
-
if (!isInteractive()) {
|
|
426
|
-
throw new Error("--yes flag is required in non-interactive mode");
|
|
427
|
-
}
|
|
428
|
-
const confirmed = await promptConfirm(
|
|
429
|
-
`Delete automation ${source_default.cyan(ref)} and its schedule trigger?`,
|
|
430
|
-
false
|
|
431
|
-
);
|
|
432
|
-
if (!confirmed) {
|
|
433
|
-
console.log(source_default.dim("Cancelled"));
|
|
434
|
-
return;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
await deleteAutomation(ref);
|
|
438
|
-
console.log(source_default.green(`\u2713 Automation "${ref}" deleted`));
|
|
439
|
-
})
|
|
440
|
-
);
|
|
441
|
-
|
|
442
|
-
// src/commands/zero/automation/enable.ts
|
|
443
|
-
init_esm_shims();
|
|
444
|
-
var enableCommand = new Command().name("enable").description("Enable an automation").argument("<automation>", "Automation ID or name").addHelpText(
|
|
445
|
-
"after",
|
|
446
|
-
`
|
|
447
|
-
Examples:
|
|
448
|
-
zero automation enable alerts`
|
|
449
|
-
).action(
|
|
450
|
-
withErrorHandler(async (ref) => {
|
|
451
|
-
const automation = await enableAutomation(ref);
|
|
452
|
-
console.log(source_default.green(`\u2713 Automation "${automation.name}" enabled`));
|
|
453
|
-
})
|
|
454
|
-
);
|
|
455
|
-
|
|
456
|
-
// src/commands/zero/automation/disable.ts
|
|
457
|
-
init_esm_shims();
|
|
458
|
-
var disableCommand = new Command().name("disable").description("Disable an automation").argument("<automation>", "Automation ID or name").addHelpText(
|
|
459
|
-
"after",
|
|
460
|
-
`
|
|
461
|
-
Examples:
|
|
462
|
-
zero automation disable alerts`
|
|
463
|
-
).action(
|
|
464
|
-
withErrorHandler(async (ref) => {
|
|
465
|
-
const automation = await disableAutomation(ref);
|
|
466
|
-
console.log(source_default.green(`\u2713 Automation "${automation.name}" disabled`));
|
|
467
|
-
})
|
|
468
|
-
);
|
|
469
|
-
|
|
470
|
-
// src/commands/zero/automation/run.ts
|
|
471
|
-
init_esm_shims();
|
|
472
|
-
var runCommand = new Command().name("run").description("Manually fire an automation (runs its instruction once)").argument("<automation>", "Automation ID or name").addHelpText(
|
|
473
|
-
"after",
|
|
474
|
-
`
|
|
475
|
-
Examples:
|
|
476
|
-
zero automation run alerts`
|
|
477
|
-
).action(
|
|
478
|
-
withErrorHandler(async (ref) => {
|
|
479
|
-
const { runId } = await runAutomation(ref);
|
|
480
|
-
console.log(source_default.green(`\u2713 Automation "${ref}" fired`));
|
|
481
|
-
console.log(source_default.dim(` Run ID: ${runId}`));
|
|
482
|
-
})
|
|
483
|
-
);
|
|
484
|
-
|
|
485
|
-
// src/commands/zero/automation/index.ts
|
|
486
|
-
var zeroAutomationCommand = new Command().name("automation").description("Create or manage scheduled automations").addCommand(createCommand).addCommand(listCommand).addCommand(showCommand).addCommand(updateCommand).addCommand(deleteCommand).addCommand(enableCommand).addCommand(disableCommand).addCommand(runCommand).addHelpText(
|
|
487
|
-
"after",
|
|
488
|
-
`
|
|
489
|
-
Examples:
|
|
490
|
-
Create an automation: zero automation create -n alerts --agent <agent-id> -p "Summarize alerts" --cron "0 9 * * *"
|
|
491
|
-
List automations: zero automation list
|
|
492
|
-
Inspect one: zero automation show alerts
|
|
493
|
-
Fire manually: zero automation run alerts
|
|
494
|
-
Pause an automation: zero automation disable alerts
|
|
495
|
-
Resume an automation: zero automation enable alerts
|
|
496
|
-
Delete an automation: zero automation delete alerts`
|
|
497
|
-
);
|
|
498
|
-
export {
|
|
499
|
-
zeroAutomationCommand
|
|
500
|
-
};
|
|
501
|
-
//# sourceMappingURL=automation-FJOIHXBS.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/commands/zero/automation/index.ts","../src/commands/zero/automation/create.ts","../src/commands/zero/automation/at-time-input.ts","../src/commands/zero/automation/trigger-display.ts","../src/commands/zero/automation/list.ts","../src/commands/zero/automation/show.ts","../src/commands/zero/automation/update.ts","../src/commands/zero/automation/delete.ts","../src/commands/zero/automation/enable.ts","../src/commands/zero/automation/disable.ts","../src/commands/zero/automation/run.ts"],"sourcesContent":["import { Command } from \"commander\";\nimport { createCommand } from \"./create\";\nimport { listCommand } from \"./list\";\nimport { showCommand } from \"./show\";\nimport { updateCommand } from \"./update\";\nimport { deleteCommand } from \"./delete\";\nimport { enableCommand } from \"./enable\";\nimport { disableCommand } from \"./disable\";\nimport { runCommand } from \"./run\";\n\nexport const zeroAutomationCommand = new Command()\n .name(\"automation\")\n .description(\"Create or manage scheduled automations\")\n .addCommand(createCommand)\n .addCommand(listCommand)\n .addCommand(showCommand)\n .addCommand(updateCommand)\n .addCommand(deleteCommand)\n .addCommand(enableCommand)\n .addCommand(disableCommand)\n .addCommand(runCommand)\n // Deprecated aliases — fully functional, but print a stderr notice pointing\n // at the replacement command.\n .addHelpText(\n \"after\",\n `\nExamples:\n Create an automation: zero automation create -n alerts --agent <agent-id> -p \"Summarize alerts\" --cron \"0 9 * * *\"\n List automations: zero automation list\n Inspect one: zero automation show alerts\n Fire manually: zero automation run alerts\n Pause an automation: zero automation disable alerts\n Resume an automation: zero automation enable alerts\n Delete an automation: zero automation delete alerts`,\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { CreateTriggerRequest } from \"@vm0/api-contracts/contracts/automations\";\nimport { createAutomation, getComposeById } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { isUUID } from \"../../run/shared\";\nimport { requireTimezoneForLocalAtTime } from \"./at-time-input\";\nimport { parseDurationSeconds } from \"./duration\";\nimport { formatTriggerConfig } from \"./trigger-display\";\n\ninterface CreateOptions {\n name: string;\n agent: string;\n prompt: string;\n description?: string;\n cron?: string;\n once?: string;\n loop?: string;\n timezone?: string;\n}\n\n/**\n * Build the automation schedule trigger from exactly one inline flag\n * (--cron / --once / --loop, with optional --timezone).\n */\nfunction buildInlineTrigger(options: CreateOptions): CreateTriggerRequest {\n const sugarCount = [options.cron, options.once, options.loop].filter(\n (value) => {\n return value !== undefined;\n },\n ).length;\n\n if (sugarCount !== 1) {\n throw new Error(\"Use exactly one of --cron, --once, --loop\");\n }\n\n if (options.timezone && !options.cron && !options.once) {\n throw new Error(\"--timezone requires --cron or --once\");\n }\n\n if (options.cron) {\n return {\n kind: \"cron\",\n cronExpression: options.cron,\n timezone: options.timezone,\n };\n }\n if (options.once) {\n requireTimezoneForLocalAtTime(options.once, options.timezone, \"--once\");\n return { kind: \"once\", atTime: options.once, timezone: options.timezone };\n }\n if (options.loop) {\n return {\n kind: \"loop\",\n intervalSeconds: parseDurationSeconds(options.loop),\n };\n }\n throw new Error(\"Use exactly one of --cron, --once, --loop\");\n}\n\nexport const createCommand = new Command()\n .name(\"create\")\n .description(\"Create an automation with a schedule trigger\")\n .requiredOption(\"-n, --name <name>\", \"Automation name\")\n .requiredOption(\"--agent <agent-id>\", \"Agent ID to run\")\n .requiredOption(\n \"-p, --prompt <instruction>\",\n \"Instruction the agent runs when the automation fires\",\n )\n .option(\"--description <text>\", \"Optional description\")\n .option(\"--cron <expression>\", 'Add a cron trigger (e.g. \"0 9 * * *\")')\n .option(\n \"--once <iso-time>\",\n 'Add a one-time trigger (e.g. \"2026-06-10T09:00\")',\n )\n .option(\"--loop <duration>\", \"Add a loop trigger (e.g. 15m, 1h, 90s)\")\n .option(\"-z, --timezone <tz>\", \"IANA timezone for --cron / --once\")\n .addHelpText(\n \"after\",\n `\nExamples:\n Daily at 9am: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --cron \"0 9 * * *\"\n One-time: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --once \"2026-06-10T09:00\" -z UTC\n Every 15 min: zero automation create -n alerts --agent 550e8400-e29b-41d4-a716-446655440000 -p \"...\" --loop 15m\n\nNotes:\n - Exactly one of --cron, --once, --loop is required`,\n )\n .action(\n withErrorHandler(async (options: CreateOptions) => {\n if (!isUUID(options.agent)) {\n console.error(\n chalk.red(`✗ Invalid agent ID \"${options.agent}\" — expected a UUID`),\n );\n console.error(chalk.dim(\" Run: zero agent list to find agent IDs\"));\n process.exit(1);\n }\n\n const trigger = buildInlineTrigger(options);\n\n const compose = await getComposeById(options.agent);\n\n const { automation } = await createAutomation({\n name: options.name,\n agentId: compose.id,\n instruction: options.prompt,\n description: options.description,\n chatThreadId: process.env.ZERO_CHAT_THREAD_ID,\n trigger,\n });\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" created`));\n console.log(chalk.dim(` ID: ${automation.id}`));\n console.log(chalk.dim(` Agent: ${compose.name}`));\n console.log(chalk.dim(` Thread: ${automation.chatThreadId}`));\n\n const createdTrigger = automation.triggers[0];\n if (createdTrigger) {\n console.log(\n chalk.dim(\n ` Trigger: ${createdTrigger.kind} ${formatTriggerConfig(createdTrigger)} (${createdTrigger.id})`,\n ),\n );\n }\n\n console.log();\n console.log(\n ` Run manually: ${chalk.cyan(`zero automation run ${automation.name}`)}`,\n );\n }),\n );\n","const EXPLICIT_OFFSET_RE = /(?:[zZ]|[+-]\\d{2}:?\\d{2})$/u;\n\nfunction hasExplicitAtTimeOffset(atTime: string): boolean {\n return EXPLICIT_OFFSET_RE.test(atTime.trim());\n}\n\nexport function requireTimezoneForLocalAtTime(\n atTime: string,\n timezone: string | undefined,\n flagName: \"--at\" | \"--once\",\n): void {\n if (timezone || hasExplicitAtTimeOffset(atTime)) {\n return;\n }\n throw new Error(\n `${flagName} without Z or an explicit offset requires --timezone (e.g. ${flagName} \"2026-06-10T09:00\" --timezone Asia/Shanghai)`,\n );\n}\n","import chalk from \"chalk\";\nimport type { AutomationTriggerResponse } from \"@vm0/api-contracts/contracts/automations\";\nimport { formatRelativeTime } from \"../../../lib/domain/schedule-utils\";\nimport { formatDurationSeconds } from \"./duration\";\n\n/**\n * Shared rendering for an automation's schedule trigger.\n */\n\n/** One-line config summary per trigger kind. */\nexport function formatTriggerConfig(\n trigger: AutomationTriggerResponse,\n): string {\n switch (trigger.kind) {\n case \"cron\":\n return `${trigger.cronExpression} (${trigger.timezone})`;\n case \"once\":\n return `at ${trigger.atTime} (${trigger.timezone})`;\n case \"loop\":\n return `every ${formatDurationSeconds(trigger.intervalSeconds)}`;\n }\n}\n\nfunction formatNextRun(trigger: AutomationTriggerResponse): string {\n if (!trigger.nextRunAt) {\n return chalk.dim(\"-\");\n }\n return formatRelativeTime(trigger.nextRunAt);\n}\n\n/**\n * Print the triggers table: KIND, ID, STATUS, CONFIG, NEXT RUN\n */\nexport function printTriggersTable(\n triggers: readonly AutomationTriggerResponse[],\n): void {\n const kindWidth = Math.max(\n 4,\n ...triggers.map((t) => {\n return t.kind.length;\n }),\n );\n const idWidth = Math.max(\n 2,\n ...triggers.map((t) => {\n return t.id.length;\n }),\n );\n const configWidth = Math.max(\n 6,\n ...triggers.map((t) => {\n return formatTriggerConfig(t).length;\n }),\n );\n\n console.log(\n chalk.dim(\n [\n \"KIND\".padEnd(kindWidth),\n \"ID\".padEnd(idWidth),\n \"STATUS\".padEnd(8),\n \"CONFIG\".padEnd(configWidth),\n \"NEXT RUN\",\n ].join(\" \"),\n ),\n );\n\n for (const trigger of triggers) {\n const status = trigger.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n console.log(\n [\n trigger.kind.padEnd(kindWidth),\n trigger.id.padEnd(idWidth),\n status.padEnd(8 + (trigger.enabled ? 0 : 2)),\n formatTriggerConfig(trigger).padEnd(configWidth),\n formatNextRun(trigger),\n ].join(\" \"),\n );\n }\n}\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { AutomationResponse } from \"@vm0/api-contracts/contracts/automations\";\nimport { listAutomations } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nfunction formatTriggerSummary(automation: AutomationResponse): string {\n const [trigger] = automation.triggers;\n if (!trigger) {\n return chalk.dim(\"-\");\n }\n return trigger.kind;\n}\n\nexport const listCommand = new Command()\n .name(\"list\")\n .alias(\"ls\")\n .description(\"List automations with their schedule trigger\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation list`,\n )\n .action(\n withErrorHandler(async () => {\n const { automations } = await listAutomations();\n\n if (automations.length === 0) {\n console.log(chalk.dim(\"No automations found\"));\n console.log(\n chalk.dim(\n ' Create one with: zero automation create -n <name> --agent <agent-id> -p \"<instruction>\"',\n ),\n );\n return;\n }\n\n const nameWidth = Math.max(\n 4,\n ...automations.map((a) => {\n return a.name.length;\n }),\n );\n const idWidth = Math.max(\n 2,\n ...automations.map((a) => {\n return a.id.length;\n }),\n );\n const agentWidth = Math.max(\n 5,\n ...automations.map((a) => {\n return (a.displayName ?? a.agentId).length;\n }),\n );\n\n console.log(\n chalk.dim(\n [\n \"NAME\".padEnd(nameWidth),\n \"ID\".padEnd(idWidth),\n \"AGENT\".padEnd(agentWidth),\n \"STATUS\".padEnd(8),\n \"TRIGGER\",\n ].join(\" \"),\n ),\n );\n\n for (const automation of automations) {\n const status = automation.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n console.log(\n [\n automation.name.padEnd(nameWidth),\n automation.id.padEnd(idWidth),\n (automation.displayName ?? automation.agentId).padEnd(agentWidth),\n status.padEnd(8 + (automation.enabled ? 0 : 2)),\n formatTriggerSummary(automation),\n ].join(\" \"),\n );\n }\n\n console.log();\n console.log(\n chalk.dim(` Details: zero automation show <automation-name-or-id>`),\n );\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { showAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { printTriggersTable } from \"./trigger-display\";\n\nexport const showCommand = new Command()\n .name(\"show\")\n .description(\"Show an automation and its schedule\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation show alerts\n zero automation show 11111111-1111-4111-8111-111111111111\n\nNotes:\n - When the same name exists on multiple agents, the API rejects it as ambiguous — use the ID`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await showAutomation(ref);\n\n const status = automation.enabled\n ? chalk.green(\"enabled\")\n : chalk.yellow(\"disabled\");\n const agent = automation.displayName\n ? `${automation.displayName} ${chalk.dim(`(${automation.agentId})`)}`\n : automation.agentId;\n\n console.log(`${\"Name:\".padEnd(14)}${automation.name}`);\n console.log(`${\"ID:\".padEnd(14)}${automation.id}`);\n console.log(`${\"Agent:\".padEnd(14)}${agent}`);\n console.log(`${\"Status:\".padEnd(14)}${status}`);\n if (automation.description) {\n console.log(`${\"Description:\".padEnd(14)}${automation.description}`);\n }\n console.log(\n `${\"Instruction:\".padEnd(14)}${chalk.dim(automation.instruction)}`,\n );\n console.log(`${\"Thread:\".padEnd(14)}${automation.chatThreadId}`);\n\n console.log();\n const [trigger] = automation.triggers;\n if (!trigger) {\n console.log(chalk.dim(\"No schedule trigger\"));\n return;\n }\n\n printTriggersTable([trigger]);\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport type { UpdateTriggerRequest } from \"@vm0/api-contracts/contracts/automations\";\nimport {\n showAutomation,\n updateAutomation,\n updateAutomationTrigger,\n} from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\nimport { requireTimezoneForLocalAtTime } from \"./at-time-input\";\nimport { parseDurationSeconds } from \"./duration\";\nimport { formatTriggerConfig } from \"./trigger-display\";\n\ninterface UpdateOptions {\n name?: string;\n prompt?: string;\n description?: string;\n cron?: string;\n once?: string;\n loop?: string;\n timezone?: string;\n}\n\n/**\n * Build the optional schedule replacement from the timing sugar flags\n * (--cron / --once / --loop, with optional --timezone). The automation's\n * single time trigger is updated in place; its kind switches to match the\n * flag.\n */\nfunction buildTimingUpdate(\n options: UpdateOptions,\n): UpdateTriggerRequest | undefined {\n const sugarCount = [options.cron, options.once, options.loop].filter(\n (value) => {\n return value !== undefined;\n },\n ).length;\n\n if (sugarCount > 1) {\n throw new Error(\"Use at most one of --cron, --once, --loop\");\n }\n\n if (options.timezone && !options.cron && !options.once) {\n throw new Error(\"--timezone requires --cron or --once\");\n }\n\n if (options.cron) {\n return {\n kind: \"cron\",\n cronExpression: options.cron,\n timezone: options.timezone,\n };\n }\n if (options.once) {\n requireTimezoneForLocalAtTime(options.once, options.timezone, \"--once\");\n return { kind: \"once\", atTime: options.once, timezone: options.timezone };\n }\n if (options.loop) {\n return {\n kind: \"loop\",\n intervalSeconds: parseDurationSeconds(options.loop),\n };\n }\n return undefined;\n}\n\nexport const updateCommand = new Command()\n .name(\"update\")\n .description(\n \"Update an automation's name, instruction, description, or schedule\",\n )\n .argument(\"<automation>\", \"Automation ID or name\")\n .option(\"-n, --name <name>\", \"New automation name\")\n .option(\"-p, --prompt <instruction>\", \"New instruction\")\n .option(\"--description <text>\", \"New description\")\n .option(\"--cron <expression>\", 'New cron schedule (e.g. \"0 9 * * *\")')\n .option(\"--once <iso-time>\", 'New one-time fire (e.g. \"2026-06-10T09:00\")')\n .option(\"--loop <duration>\", \"New loop interval (e.g. 15m, 1h, 90s)\")\n .option(\"-z, --timezone <tz>\", \"IANA timezone for --cron / --once\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation update alerts -p \"Summarize alerts and post to Slack\"\n zero automation update alerts -n alerts-v2 --description \"Daily alert digest\"\n zero automation update alerts --cron \"0 18 * * 5\" -z Asia/Shanghai\n zero automation update alerts --loop 10m\n\nNotes:\n - At most one of --cron, --once, --loop; it replaces the automation's schedule trigger in place (the kind may switch, run history is kept)`,\n )\n .action(\n withErrorHandler(async (ref: string, options: UpdateOptions) => {\n const timing = buildTimingUpdate(options);\n const hasIdentityUpdate =\n options.name !== undefined ||\n options.prompt !== undefined ||\n options.description !== undefined;\n\n if (!hasIdentityUpdate && !timing) {\n throw new Error(\n \"Nothing to update: provide --name, --prompt, --description, --cron, --once, or --loop\",\n );\n }\n\n // Resolve the single trigger up front so a missing/ambiguous trigger\n // fails before any field is patched.\n let timeTriggerId: string | undefined;\n if (timing) {\n const automation = await showAutomation(ref);\n const timeTriggers = automation.triggers;\n const [first] = timeTriggers;\n if (!first) {\n throw new Error(`Automation ${ref} has no schedule trigger`);\n }\n timeTriggerId = first.id;\n }\n\n if (hasIdentityUpdate) {\n const automation = await updateAutomation(ref, {\n name: options.name,\n instruction: options.prompt,\n description: options.description,\n });\n console.log(chalk.green(`✓ Automation \"${automation.name}\" updated`));\n }\n\n if (timing && timeTriggerId) {\n const trigger = await updateAutomationTrigger(timeTriggerId, timing);\n console.log(chalk.green(`✓ Trigger ${trigger.id} updated`));\n console.log(\n chalk.dim(\n ` Schedule: ${trigger.kind} ${formatTriggerConfig(trigger)}`,\n ),\n );\n }\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { deleteAutomation } from \"../../../lib/api\";\nimport { isInteractive, promptConfirm } from \"../../../lib/utils/prompt-utils\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const deleteCommand = new Command()\n .name(\"delete\")\n .alias(\"rm\")\n .description(\"Delete an automation (its triggers are removed too)\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .option(\"-y, --yes\", \"Skip confirmation prompt\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation delete alerts\n zero automation delete alerts -y\n\nNotes:\n - Use -y to skip confirmation in non-interactive mode`,\n )\n .action(\n withErrorHandler(async (ref: string, options: { yes?: boolean }) => {\n if (!options.yes) {\n if (!isInteractive()) {\n throw new Error(\"--yes flag is required in non-interactive mode\");\n }\n const confirmed = await promptConfirm(\n `Delete automation ${chalk.cyan(ref)} and its schedule trigger?`,\n false,\n );\n if (!confirmed) {\n console.log(chalk.dim(\"Cancelled\"));\n return;\n }\n }\n\n await deleteAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${ref}\" deleted`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { enableAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const enableCommand = new Command()\n .name(\"enable\")\n .description(\"Enable an automation\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation enable alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await enableAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" enabled`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { disableAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const disableCommand = new Command()\n .name(\"disable\")\n .description(\"Disable an automation\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation disable alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const automation = await disableAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${automation.name}\" disabled`));\n }),\n );\n","import { Command } from \"commander\";\nimport chalk from \"chalk\";\nimport { runAutomation } from \"../../../lib/api\";\nimport { withErrorHandler } from \"../../../lib/command\";\n\nexport const runCommand = new Command()\n .name(\"run\")\n .description(\"Manually fire an automation (runs its instruction once)\")\n .argument(\"<automation>\", \"Automation ID or name\")\n .addHelpText(\n \"after\",\n `\nExamples:\n zero automation run alerts`,\n )\n .action(\n withErrorHandler(async (ref: string) => {\n const { runId } = await runAutomation(ref);\n\n console.log(chalk.green(`✓ Automation \"${ref}\" fired`));\n console.log(chalk.dim(` Run ID: ${runId}`));\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;ACAA;;;ACAA;AAAA,IAAM,qBAAqB;AAE3B,SAAS,wBAAwB,QAAyB;AACxD,SAAO,mBAAmB,KAAK,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