@vm0/cli 9.240.0 → 9.240.2
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-BU3F5RW5.js → agent-VCTJB2V7.js} +5 -5
- package/{banking-L74MGBP6.js → banking-A7VMJ3DM.js} +3 -3
- package/{chat-IYZH3T3O.js → chat-LJTRIYLH.js} +4 -4
- package/{chunk-6F7XCWTU.js → chunk-3B4I4CZP.js} +2 -2
- package/{chunk-6F7XCWTU.js.map → chunk-3B4I4CZP.js.map} +1 -1
- package/{chunk-3IH2QU57.js → chunk-3BDRU5WG.js} +2 -2
- package/{chunk-YHR4HVAA.js → chunk-7JLQS475.js} +3 -3
- package/{chunk-QCYKZV5E.js → chunk-HQTSY3FI.js} +4 -4
- package/{chunk-PCP7O5ST.js → chunk-ISC7E56M.js} +2 -2
- package/{chunk-7BHKM63H.js → chunk-OGCTK67A.js} +6 -11
- package/chunk-OGCTK67A.js.map +1 -0
- package/{chunk-UHBFZAMT.js → chunk-UJ5H65KR.js} +9 -6
- package/chunk-UJ5H65KR.js.map +1 -0
- package/{chunk-V77QTHRL.js → chunk-VC7NX4NF.js} +4 -4
- package/{chunk-MFO54L7D.js → chunk-ZMWXQJYA.js} +127 -46
- package/{chunk-MFO54L7D.js.map → chunk-ZMWXQJYA.js.map} +1 -1
- package/{chunk-6R4HTQSH.js → chunk-ZZWAWZAX.js} +2 -2
- package/{chunk-6R4HTQSH.js.map → chunk-ZZWAWZAX.js.map} +1 -1
- package/{computer-use-WY7PTADU.js → computer-use-UFSUZW4S.js} +3 -3
- package/{connector-HQKPT3NI.js → connector-RVPMZLN5.js} +4 -4
- package/{credit-3VSUM5MJ.js → credit-5UXG5CV4.js} +4 -4
- package/{developer-support-5BH43Z25.js → developer-support-C2VVLCT5.js} +3 -3
- package/{doctor-DSWP27KJ.js → doctor-CNRNUHXX.js} +5 -5
- package/{generate-OGV26ZYH.js → generate-74MBJ6G2.js} +5 -5
- package/{github-VQ65HTCS.js → github-WOA2BET2.js} +3 -3
- package/{goal-TSNIPDUC.js → goal-NV23KTC2.js} +3 -3
- package/{host-T24ERN32.js → host-OFUEE5R2.js} +3 -3
- package/index.js +13 -13
- package/{logs-N2U6VGYP.js → logs-BKNAEZ2V.js} +6 -6
- package/{maps-QJAHISKI.js → maps-4E3HQO7Y.js} +3 -3
- package/{memory-M5KENS56.js → memory-ONWXGP6N.js} +3 -3
- package/{model-AH2AZKKM.js → model-KQ5DWFMB.js} +4 -4
- package/{model-provider-QWF2AOQA.js → model-provider-CH2NDJAQ.js} +4 -4
- package/{org-T4N5A63U.js → org-T5HKNOI5.js} +3 -3
- package/package.json +1 -1
- package/{phone-LT7NI7U4.js → phone-IKCDDVZE.js} +3 -3
- package/{preference-Y3DR33YJ.js → preference-BAVSSXYL.js} +3 -3
- package/{relationship-C4H3MOT2.js → relationship-FPV2UMAU.js} +3 -3
- package/{resource-VIGI33NN.js → resource-ZESK7TP6.js} +4 -4
- package/{scrape-FPAOJRQU.js → scrape-L4WRVDZC.js} +3 -3
- package/{search-CZ6N5LLL.js → search-4ZQP3MRX.js} +6 -6
- package/{secret-T5L72H7R.js → secret-VZONUOO3.js} +3 -3
- package/{slack-O5AEPMB3.js → slack-PNTENEPN.js} +3 -3
- package/{teams-6BZVHEUM.js → teams-UJCNHFVN.js} +3 -3
- package/{telegram-33Y34S6K.js → telegram-IWU5VQH4.js} +3 -3
- package/{variable-CLPVIKW5.js → variable-75ZY3D2M.js} +3 -3
- package/{video-E3KESQP6.js → video-EM7XKL3X.js} +2 -2
- package/{web-RHIEBRDN.js → web-BNTKPP5V.js} +3 -3
- package/{whoami-YIED4I4V.js → whoami-WJK3PZIO.js} +5 -5
- package/{workflow-JBYQGDQO.js → workflow-KNIVHJGP.js} +292 -263
- package/workflow-KNIVHJGP.js.map +1 -0
- package/zero.js +35 -35
- package/chunk-7BHKM63H.js.map +0 -1
- package/chunk-UHBFZAMT.js.map +0 -1
- package/workflow-JBYQGDQO.js.map +0 -1
- /package/{agent-BU3F5RW5.js.map → agent-VCTJB2V7.js.map} +0 -0
- /package/{banking-L74MGBP6.js.map → banking-A7VMJ3DM.js.map} +0 -0
- /package/{chat-IYZH3T3O.js.map → chat-LJTRIYLH.js.map} +0 -0
- /package/{chunk-3IH2QU57.js.map → chunk-3BDRU5WG.js.map} +0 -0
- /package/{chunk-YHR4HVAA.js.map → chunk-7JLQS475.js.map} +0 -0
- /package/{chunk-QCYKZV5E.js.map → chunk-HQTSY3FI.js.map} +0 -0
- /package/{chunk-PCP7O5ST.js.map → chunk-ISC7E56M.js.map} +0 -0
- /package/{chunk-V77QTHRL.js.map → chunk-VC7NX4NF.js.map} +0 -0
- /package/{computer-use-WY7PTADU.js.map → computer-use-UFSUZW4S.js.map} +0 -0
- /package/{connector-HQKPT3NI.js.map → connector-RVPMZLN5.js.map} +0 -0
- /package/{credit-3VSUM5MJ.js.map → credit-5UXG5CV4.js.map} +0 -0
- /package/{developer-support-5BH43Z25.js.map → developer-support-C2VVLCT5.js.map} +0 -0
- /package/{doctor-DSWP27KJ.js.map → doctor-CNRNUHXX.js.map} +0 -0
- /package/{generate-OGV26ZYH.js.map → generate-74MBJ6G2.js.map} +0 -0
- /package/{github-VQ65HTCS.js.map → github-WOA2BET2.js.map} +0 -0
- /package/{goal-TSNIPDUC.js.map → goal-NV23KTC2.js.map} +0 -0
- /package/{host-T24ERN32.js.map → host-OFUEE5R2.js.map} +0 -0
- /package/{logs-N2U6VGYP.js.map → logs-BKNAEZ2V.js.map} +0 -0
- /package/{maps-QJAHISKI.js.map → maps-4E3HQO7Y.js.map} +0 -0
- /package/{memory-M5KENS56.js.map → memory-ONWXGP6N.js.map} +0 -0
- /package/{model-AH2AZKKM.js.map → model-KQ5DWFMB.js.map} +0 -0
- /package/{model-provider-QWF2AOQA.js.map → model-provider-CH2NDJAQ.js.map} +0 -0
- /package/{org-T4N5A63U.js.map → org-T5HKNOI5.js.map} +0 -0
- /package/{phone-LT7NI7U4.js.map → phone-IKCDDVZE.js.map} +0 -0
- /package/{preference-Y3DR33YJ.js.map → preference-BAVSSXYL.js.map} +0 -0
- /package/{relationship-C4H3MOT2.js.map → relationship-FPV2UMAU.js.map} +0 -0
- /package/{resource-VIGI33NN.js.map → resource-ZESK7TP6.js.map} +0 -0
- /package/{scrape-FPAOJRQU.js.map → scrape-L4WRVDZC.js.map} +0 -0
- /package/{search-CZ6N5LLL.js.map → search-4ZQP3MRX.js.map} +0 -0
- /package/{secret-T5L72H7R.js.map → secret-VZONUOO3.js.map} +0 -0
- /package/{slack-O5AEPMB3.js.map → slack-PNTENEPN.js.map} +0 -0
- /package/{teams-6BZVHEUM.js.map → teams-UJCNHFVN.js.map} +0 -0
- /package/{telegram-33Y34S6K.js.map → telegram-IWU5VQH4.js.map} +0 -0
- /package/{variable-CLPVIKW5.js.map → variable-75ZY3D2M.js.map} +0 -0
- /package/{video-E3KESQP6.js.map → video-EM7XKL3X.js.map} +0 -0
- /package/{web-RHIEBRDN.js.map → web-BNTKPP5V.js.map} +0 -0
- /package/{whoami-YIED4I4V.js.map → whoami-WJK3PZIO.js.map} +0 -0
|
@@ -8,23 +8,23 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
copyWorkflow,
|
|
10
10
|
createWorkflow,
|
|
11
|
-
|
|
11
|
+
createWorkflowAutomation,
|
|
12
12
|
deleteWorkflow,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
deleteWorkflowAutomation,
|
|
14
|
+
disableWorkflowAutomation,
|
|
15
|
+
enableWorkflowAutomation,
|
|
16
16
|
getWorkflow,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
getWorkflowAutomation,
|
|
18
|
+
listWorkflowAutomations,
|
|
19
19
|
listWorkflows,
|
|
20
20
|
updateWorkflow,
|
|
21
|
-
|
|
22
|
-
} from "./chunk-
|
|
21
|
+
updateWorkflowAutomation
|
|
22
|
+
} from "./chunk-ZMWXQJYA.js";
|
|
23
23
|
import "./chunk-LTDQISD7.js";
|
|
24
24
|
import {
|
|
25
25
|
source_default,
|
|
26
26
|
withErrorHandler
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZZWAWZAX.js";
|
|
28
28
|
import "./chunk-LRHXR7JT.js";
|
|
29
29
|
import {
|
|
30
30
|
Command
|
|
@@ -442,7 +442,7 @@ Examples:
|
|
|
442
442
|
)
|
|
443
443
|
);
|
|
444
444
|
|
|
445
|
-
// src/commands/zero/workflow/
|
|
445
|
+
// src/commands/zero/workflow/automation/index.ts
|
|
446
446
|
init_esm_shims();
|
|
447
447
|
|
|
448
448
|
// src/commands/zero/shared/duration.ts
|
|
@@ -480,7 +480,7 @@ function formatDurationSeconds(seconds) {
|
|
|
480
480
|
return `${seconds}s`;
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
-
// src/commands/zero/workflow/
|
|
483
|
+
// src/commands/zero/workflow/automation/display.ts
|
|
484
484
|
init_esm_shims();
|
|
485
485
|
|
|
486
486
|
// src/lib/domain/relative-time.ts
|
|
@@ -506,7 +506,7 @@ function formatRelativeTime(dateStr) {
|
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
508
|
|
|
509
|
-
// src/commands/zero/workflow/
|
|
509
|
+
// src/commands/zero/workflow/automation/display.ts
|
|
510
510
|
var GMAIL_TEXT_FIELDS = [
|
|
511
511
|
"from",
|
|
512
512
|
"subject",
|
|
@@ -514,20 +514,20 @@ var GMAIL_TEXT_FIELDS = [
|
|
|
514
514
|
"to",
|
|
515
515
|
"cc"
|
|
516
516
|
];
|
|
517
|
-
function
|
|
518
|
-
return
|
|
517
|
+
function isWebhookAutomation(automation) {
|
|
518
|
+
return automation.kind === "event" && automation.eventType === "webhook-received";
|
|
519
519
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
520
|
+
function isNotionChildPageAutomation(automation) {
|
|
521
|
+
return automation.kind === "event" && automation.eventType === "notion-child-page-created";
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
return
|
|
523
|
+
function isNotionDatabaseItemAutomation(automation) {
|
|
524
|
+
return automation.kind === "event" && automation.eventType === "notion-database-item-created";
|
|
525
525
|
}
|
|
526
|
-
function
|
|
527
|
-
return
|
|
526
|
+
function isNotionPageContentUpdatedAutomation(automation) {
|
|
527
|
+
return automation.kind === "event" && automation.eventType === "notion-page-content-updated";
|
|
528
528
|
}
|
|
529
|
-
function
|
|
530
|
-
return
|
|
529
|
+
function isGoogleCalendarAutomation(automation) {
|
|
530
|
+
return automation.kind === "event" && (automation.eventType === "google-calendar-event-created" || automation.eventType === "google-calendar-event-updated" || automation.eventType === "google-calendar-event-cancelled");
|
|
531
531
|
}
|
|
532
532
|
function quote(value) {
|
|
533
533
|
return `"${value}"`;
|
|
@@ -573,52 +573,52 @@ function formatGithubSubject(subject) {
|
|
|
573
573
|
}
|
|
574
574
|
return subject;
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
return `Webhook: ${
|
|
576
|
+
function formatWebhookAutomationEntry(automation) {
|
|
577
|
+
return `Webhook: ${automation.webhookUrl ?? "hidden"}`;
|
|
578
578
|
}
|
|
579
|
-
function formatNotionParentPage(
|
|
580
|
-
return
|
|
579
|
+
function formatNotionParentPage(automation) {
|
|
580
|
+
return automation.eventConfig.parentPage.title ?? automation.eventConfig.parentPage.url;
|
|
581
581
|
}
|
|
582
|
-
function formatNotionDatabase(
|
|
583
|
-
return
|
|
582
|
+
function formatNotionDatabase(automation) {
|
|
583
|
+
return automation.eventConfig.dataSource.title ?? automation.eventConfig.dataSource.url;
|
|
584
584
|
}
|
|
585
|
-
function formatNotionContentUpdatedScope(
|
|
586
|
-
return
|
|
585
|
+
function formatNotionContentUpdatedScope(automation) {
|
|
586
|
+
return automation.eventConfig.scope.type === "page" ? automation.eventConfig.scope.page.title ?? automation.eventConfig.scope.page.url : automation.eventConfig.scope.dataSource.title ?? automation.eventConfig.scope.dataSource.url;
|
|
587
587
|
}
|
|
588
|
-
function formatNotionContentUpdatedScopeUrl(
|
|
589
|
-
return
|
|
588
|
+
function formatNotionContentUpdatedScopeUrl(automation) {
|
|
589
|
+
return automation.eventConfig.scope.type === "page" ? automation.eventConfig.scope.page.url : automation.eventConfig.scope.dataSource.url;
|
|
590
590
|
}
|
|
591
|
-
function
|
|
592
|
-
if (
|
|
593
|
-
return `Gmail new message: ${formatGmailMatchSummary(
|
|
591
|
+
function formatWorkflowAutomationEntry(automation) {
|
|
592
|
+
if (automation.kind === "event" && automation.eventType === "gmail-new-message") {
|
|
593
|
+
return `Gmail new message: ${formatGmailMatchSummary(automation.eventConfig)}`;
|
|
594
594
|
}
|
|
595
|
-
if (
|
|
596
|
-
return `Gmail label applied: ${quote(
|
|
595
|
+
if (automation.kind === "event" && automation.eventType === "gmail-label-applied") {
|
|
596
|
+
return `Gmail label applied: ${quote(automation.eventConfig.labelName)}`;
|
|
597
597
|
}
|
|
598
|
-
if (
|
|
599
|
-
return `GitHub label applied: ${quote(
|
|
600
|
-
|
|
601
|
-
)}, actor ${
|
|
598
|
+
if (automation.kind === "event" && automation.eventType === "github-label-applied") {
|
|
599
|
+
return `GitHub label applied: ${quote(automation.eventConfig.labelName)} (${formatGithubSubject(
|
|
600
|
+
automation.eventConfig.filters.subject
|
|
601
|
+
)}, actor ${automation.eventConfig.filters.actor.type})`;
|
|
602
602
|
}
|
|
603
|
-
if (
|
|
604
|
-
return `Google Calendar event created: ${
|
|
603
|
+
if (automation.kind === "event" && automation.eventType === "google-calendar-event-created") {
|
|
604
|
+
return `Google Calendar event created: ${automation.eventConfig.calendarId}`;
|
|
605
605
|
}
|
|
606
|
-
if (
|
|
607
|
-
return `Google Calendar event updated: ${
|
|
606
|
+
if (automation.kind === "event" && automation.eventType === "google-calendar-event-updated") {
|
|
607
|
+
return `Google Calendar event updated: ${automation.eventConfig.calendarId}`;
|
|
608
608
|
}
|
|
609
|
-
if (
|
|
610
|
-
return `Google Calendar event cancelled: ${
|
|
609
|
+
if (automation.kind === "event" && automation.eventType === "google-calendar-event-cancelled") {
|
|
610
|
+
return `Google Calendar event cancelled: ${automation.eventConfig.calendarId}`;
|
|
611
611
|
}
|
|
612
|
-
if (
|
|
612
|
+
if (automation.kind === "event" && automation.eventType === "google-meet-transcript-generated") {
|
|
613
613
|
return "Google Meet transcript ready: meetings you organize";
|
|
614
614
|
}
|
|
615
|
-
if (
|
|
616
|
-
return
|
|
615
|
+
if (isWebhookAutomation(automation)) {
|
|
616
|
+
return formatWebhookAutomationEntry(automation);
|
|
617
617
|
}
|
|
618
|
-
if (
|
|
619
|
-
return
|
|
618
|
+
if (automation.kind !== "schedule") {
|
|
619
|
+
return workflowAutomationKindLabel(automation);
|
|
620
620
|
}
|
|
621
|
-
const { schedule } =
|
|
621
|
+
const { schedule } = automation;
|
|
622
622
|
switch (schedule.type) {
|
|
623
623
|
case "cron":
|
|
624
624
|
return `${schedule.cronExpression} (${schedule.timezone})`;
|
|
@@ -631,11 +631,11 @@ function formatWorkflowTriggerEntry(trigger) {
|
|
|
631
631
|
function formatRunTime(value) {
|
|
632
632
|
return value ? formatRelativeTime(value) : source_default.dim("-");
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
if (
|
|
636
|
-
return
|
|
634
|
+
function workflowAutomationKindLabel(automation) {
|
|
635
|
+
if (automation.kind !== "event") {
|
|
636
|
+
return formatWorkflowAutomationEntry(automation);
|
|
637
637
|
}
|
|
638
|
-
switch (
|
|
638
|
+
switch (automation.eventType) {
|
|
639
639
|
case "gmail-new-message":
|
|
640
640
|
return "Gmail new message";
|
|
641
641
|
case "gmail-label-applied":
|
|
@@ -651,18 +651,18 @@ function workflowTriggerKindLabel(trigger) {
|
|
|
651
651
|
case "google-meet-transcript-generated":
|
|
652
652
|
return "Google Meet transcript ready";
|
|
653
653
|
case "notion-child-page-created":
|
|
654
|
-
return `New Notion child page: ${formatNotionParentPage(
|
|
654
|
+
return `New Notion child page: ${formatNotionParentPage(automation)}`;
|
|
655
655
|
case "notion-database-item-created":
|
|
656
|
-
return `New Notion database item: ${formatNotionDatabase(
|
|
656
|
+
return `New Notion database item: ${formatNotionDatabase(automation)}`;
|
|
657
657
|
case "notion-page-content-updated":
|
|
658
|
-
return `Notion page content updated: ${formatNotionContentUpdatedScope(
|
|
658
|
+
return `Notion page content updated: ${formatNotionContentUpdatedScope(automation)}`;
|
|
659
659
|
case "webhook-received":
|
|
660
660
|
return "Webhook";
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
|
-
function signedCurlExample(
|
|
664
|
-
const secret =
|
|
665
|
-
const webhookUrl =
|
|
663
|
+
function signedCurlExample(automation) {
|
|
664
|
+
const secret = automation.webhookSecret ?? "<signing-secret>";
|
|
665
|
+
const webhookUrl = automation.webhookUrl ?? "<webhook-url>";
|
|
666
666
|
return [
|
|
667
667
|
`BODY='{"hello":"world"}'`,
|
|
668
668
|
"TIMESTAMP=$(date +%s)",
|
|
@@ -674,17 +674,17 @@ function signedCurlExample(trigger) {
|
|
|
674
674
|
' --data "$BODY"'
|
|
675
675
|
].join("\n");
|
|
676
676
|
}
|
|
677
|
-
function
|
|
677
|
+
function printWorkflowAutomationsTable(automations) {
|
|
678
678
|
const idWidth = Math.max(
|
|
679
679
|
2,
|
|
680
|
-
...
|
|
681
|
-
return
|
|
680
|
+
...automations.map((automation) => {
|
|
681
|
+
return automation.id.length;
|
|
682
682
|
})
|
|
683
683
|
);
|
|
684
684
|
const scheduleWidth = Math.max(
|
|
685
685
|
7,
|
|
686
|
-
...
|
|
687
|
-
return
|
|
686
|
+
...automations.map((automation) => {
|
|
687
|
+
return formatWorkflowAutomationEntry(automation).length;
|
|
688
688
|
})
|
|
689
689
|
);
|
|
690
690
|
console.log(
|
|
@@ -692,108 +692,116 @@ function printWorkflowTriggersTable(triggers) {
|
|
|
692
692
|
[
|
|
693
693
|
"ID".padEnd(idWidth),
|
|
694
694
|
"STATUS".padEnd(8),
|
|
695
|
-
"
|
|
695
|
+
"AUTOMATION".padEnd(scheduleWidth),
|
|
696
696
|
"NEXT RUN"
|
|
697
697
|
].join(" ")
|
|
698
698
|
)
|
|
699
699
|
);
|
|
700
|
-
for (const
|
|
701
|
-
const status =
|
|
700
|
+
for (const automation of automations) {
|
|
701
|
+
const status = automation.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
|
|
702
702
|
console.log(
|
|
703
703
|
[
|
|
704
|
-
|
|
705
|
-
status.padEnd(8 + (
|
|
706
|
-
|
|
707
|
-
formatRunTime(
|
|
704
|
+
automation.id.padEnd(idWidth),
|
|
705
|
+
status.padEnd(8 + (automation.enabled ? 0 : 2)),
|
|
706
|
+
formatWorkflowAutomationEntry(automation).padEnd(scheduleWidth),
|
|
707
|
+
formatRunTime(automation.nextRunAt)
|
|
708
708
|
].join(" ")
|
|
709
709
|
);
|
|
710
710
|
}
|
|
711
711
|
}
|
|
712
|
-
function
|
|
713
|
-
const status =
|
|
714
|
-
console.log(`${"Kind:".padEnd(14)}${
|
|
715
|
-
console.log(`${"ID:".padEnd(14)}${
|
|
712
|
+
function printWorkflowAutomationDetails(automation, options) {
|
|
713
|
+
const status = automation.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
|
|
714
|
+
console.log(`${"Kind:".padEnd(14)}${automation.kind}`);
|
|
715
|
+
console.log(`${"ID:".padEnd(14)}${automation.id}`);
|
|
716
716
|
if (options?.workflowRef) {
|
|
717
717
|
console.log(`${"Workflow:".padEnd(14)}${options.workflowRef}`);
|
|
718
718
|
}
|
|
719
719
|
console.log(`${"Status:".padEnd(14)}${status}`);
|
|
720
|
-
console.log(
|
|
721
|
-
|
|
720
|
+
console.log(
|
|
721
|
+
`${"Automation:".padEnd(14)}${workflowAutomationKindLabel(automation)}`
|
|
722
|
+
);
|
|
723
|
+
if (automation.kind === "event" && automation.eventType === "gmail-new-message") {
|
|
722
724
|
console.log(
|
|
723
|
-
`${"Match:".padEnd(14)}${formatGmailMatchSummary(
|
|
725
|
+
`${"Match:".padEnd(14)}${formatGmailMatchSummary(automation.eventConfig)}`
|
|
724
726
|
);
|
|
725
727
|
}
|
|
726
|
-
if (
|
|
727
|
-
console.log(`${"Label:".padEnd(14)}${
|
|
728
|
+
if (automation.kind === "event" && automation.eventType === "gmail-label-applied") {
|
|
729
|
+
console.log(`${"Label:".padEnd(14)}${automation.eventConfig.labelName}`);
|
|
728
730
|
}
|
|
729
|
-
if (
|
|
730
|
-
console.log(`${"Label:".padEnd(14)}${
|
|
731
|
+
if (automation.kind === "event" && automation.eventType === "github-label-applied") {
|
|
732
|
+
console.log(`${"Label:".padEnd(14)}${automation.eventConfig.labelName}`);
|
|
731
733
|
console.log(
|
|
732
734
|
`${"Subject:".padEnd(14)}${formatGithubSubject(
|
|
733
|
-
|
|
735
|
+
automation.eventConfig.filters.subject
|
|
734
736
|
)}`
|
|
735
737
|
);
|
|
736
738
|
console.log(
|
|
737
|
-
`${"Actor:".padEnd(14)}${
|
|
739
|
+
`${"Actor:".padEnd(14)}${automation.eventConfig.filters.actor.type}`
|
|
738
740
|
);
|
|
739
741
|
}
|
|
740
|
-
if (
|
|
741
|
-
console.log(
|
|
742
|
+
if (isGoogleCalendarAutomation(automation)) {
|
|
743
|
+
console.log(
|
|
744
|
+
`${"Calendar:".padEnd(14)}${automation.eventConfig.calendarId}`
|
|
745
|
+
);
|
|
742
746
|
}
|
|
743
|
-
if (
|
|
747
|
+
if (isNotionChildPageAutomation(automation)) {
|
|
744
748
|
console.log(
|
|
745
|
-
`${"Parent page:".padEnd(14)}${formatNotionParentPage(
|
|
749
|
+
`${"Parent page:".padEnd(14)}${formatNotionParentPage(automation)}`
|
|
746
750
|
);
|
|
747
751
|
console.log(
|
|
748
|
-
`${"Parent URL:".padEnd(14)}${
|
|
752
|
+
`${"Parent URL:".padEnd(14)}${automation.eventConfig.parentPage.url}`
|
|
749
753
|
);
|
|
750
754
|
}
|
|
751
|
-
if (
|
|
752
|
-
console.log(`${"Database:".padEnd(14)}${formatNotionDatabase(
|
|
755
|
+
if (isNotionDatabaseItemAutomation(automation)) {
|
|
756
|
+
console.log(`${"Database:".padEnd(14)}${formatNotionDatabase(automation)}`);
|
|
753
757
|
console.log(
|
|
754
|
-
`${"Database URL:".padEnd(14)}${
|
|
758
|
+
`${"Database URL:".padEnd(14)}${automation.eventConfig.dataSource.url}`
|
|
755
759
|
);
|
|
756
760
|
}
|
|
757
|
-
if (
|
|
758
|
-
const scopeLabel =
|
|
761
|
+
if (isNotionPageContentUpdatedAutomation(automation)) {
|
|
762
|
+
const scopeLabel = automation.eventConfig.scope.type === "page" ? "Page" : "Database";
|
|
759
763
|
console.log(`${"Scope:".padEnd(14)}${scopeLabel}`);
|
|
760
764
|
console.log(
|
|
761
|
-
`${`${scopeLabel}:`.padEnd(14)}${formatNotionContentUpdatedScope(
|
|
765
|
+
`${`${scopeLabel}:`.padEnd(14)}${formatNotionContentUpdatedScope(automation)}`
|
|
762
766
|
);
|
|
763
767
|
console.log(
|
|
764
|
-
`${`${scopeLabel} URL:`.padEnd(14)}${formatNotionContentUpdatedScopeUrl(
|
|
768
|
+
`${`${scopeLabel} URL:`.padEnd(14)}${formatNotionContentUpdatedScopeUrl(automation)}`
|
|
765
769
|
);
|
|
766
770
|
}
|
|
767
|
-
if (
|
|
771
|
+
if (isWebhookAutomation(automation)) {
|
|
768
772
|
console.log(
|
|
769
|
-
`${"Webhook URL:".padEnd(14)}${
|
|
773
|
+
`${"Webhook URL:".padEnd(14)}${automation.webhookUrl ?? "hidden"}`
|
|
770
774
|
);
|
|
771
775
|
console.log(
|
|
772
|
-
`${"Secret:".padEnd(14)}${source_default.dim(`ends with ${
|
|
776
|
+
`${"Secret:".padEnd(14)}${source_default.dim(`ends with ${automation.secretLastFour}`)}`
|
|
773
777
|
);
|
|
774
778
|
console.log(
|
|
775
|
-
`${"Last received:".padEnd(14)}${formatRunTime(
|
|
779
|
+
`${"Last received:".padEnd(14)}${formatRunTime(automation.lastReceivedAt)}`
|
|
776
780
|
);
|
|
777
|
-
if (
|
|
781
|
+
if (automation.webhookSecret) {
|
|
778
782
|
console.log(
|
|
779
|
-
`${"Signing key:".padEnd(14)}${
|
|
783
|
+
`${"Signing key:".padEnd(14)}${automation.webhookSecret} ${source_default.dim(
|
|
780
784
|
"(shown only once)"
|
|
781
785
|
)}`
|
|
782
786
|
);
|
|
783
787
|
console.log("");
|
|
784
788
|
console.log(source_default.bold("Signed curl example:"));
|
|
785
|
-
console.log(signedCurlExample(
|
|
789
|
+
console.log(signedCurlExample(automation));
|
|
786
790
|
}
|
|
787
791
|
}
|
|
788
|
-
console.log(`${"Owner:".padEnd(14)}${
|
|
792
|
+
console.log(`${"Owner:".padEnd(14)}${automation.ownerUserId}`);
|
|
793
|
+
console.log(
|
|
794
|
+
`${"Chat thread:".padEnd(14)}${automation.chatThreadId ?? source_default.dim("-")}`
|
|
795
|
+
);
|
|
789
796
|
console.log(
|
|
790
|
-
`${"
|
|
797
|
+
`${"Next run:".padEnd(14)}${formatRunTime(automation.nextRunAt)}`
|
|
798
|
+
);
|
|
799
|
+
console.log(
|
|
800
|
+
`${"Last run:".padEnd(14)}${formatRunTime(automation.lastRunAt)}`
|
|
791
801
|
);
|
|
792
|
-
console.log(`${"Next run:".padEnd(14)}${formatRunTime(trigger.nextRunAt)}`);
|
|
793
|
-
console.log(`${"Last run:".padEnd(14)}${formatRunTime(trigger.lastRunAt)}`);
|
|
794
802
|
}
|
|
795
803
|
|
|
796
|
-
// src/commands/zero/workflow/
|
|
804
|
+
// src/commands/zero/workflow/automation/gmail-config.ts
|
|
797
805
|
init_esm_shims();
|
|
798
806
|
import { readFileSync as readFileSync4 } from "fs";
|
|
799
807
|
var TEXT_FIELD_LABELS = {
|
|
@@ -868,7 +876,7 @@ function parseTextMatcher(field, value) {
|
|
|
868
876
|
break;
|
|
869
877
|
default:
|
|
870
878
|
throw new Error(
|
|
871
|
-
`Unsupported Gmail
|
|
879
|
+
`Unsupported Gmail automation text matcher "${key}" for ${formatFieldName(field)}`
|
|
872
880
|
);
|
|
873
881
|
}
|
|
874
882
|
}
|
|
@@ -891,7 +899,7 @@ function parseMatch(value) {
|
|
|
891
899
|
const field = textFieldFromKey(key);
|
|
892
900
|
if (field === null) {
|
|
893
901
|
throw new Error(
|
|
894
|
-
`Unsupported Gmail
|
|
902
|
+
`Unsupported Gmail automation match field "${key}". Supported fields: from, subject, body, to, cc`
|
|
895
903
|
);
|
|
896
904
|
}
|
|
897
905
|
match[field] = parseTextMatcher(field, value[key]);
|
|
@@ -905,16 +913,16 @@ function readConfigMatch(path) {
|
|
|
905
913
|
} catch (error) {
|
|
906
914
|
const message = error instanceof Error ? error.message : String(error);
|
|
907
915
|
throw new Error(
|
|
908
|
-
`Failed to read Gmail
|
|
916
|
+
`Failed to read Gmail automation config "${path}": ${message}`
|
|
909
917
|
);
|
|
910
918
|
}
|
|
911
919
|
if (!isRecord(parsed)) {
|
|
912
|
-
throw new Error("Gmail
|
|
920
|
+
throw new Error("Gmail automation config must be a JSON object");
|
|
913
921
|
}
|
|
914
922
|
for (const key of Object.keys(parsed)) {
|
|
915
923
|
if (key !== "match") {
|
|
916
924
|
throw new Error(
|
|
917
|
-
`Unsupported Gmail
|
|
925
|
+
`Unsupported Gmail automation config field "${key}". Use a top-level match object`
|
|
918
926
|
);
|
|
919
927
|
}
|
|
920
928
|
}
|
|
@@ -949,7 +957,7 @@ function textFlagSpecs(options) {
|
|
|
949
957
|
}
|
|
950
958
|
];
|
|
951
959
|
}
|
|
952
|
-
function
|
|
960
|
+
function hasGmailAutomationOptions(options) {
|
|
953
961
|
return options.config !== void 0 || textFlagSpecs(options).some((spec) => {
|
|
954
962
|
return spec.contains !== void 0 || spec.doesNotContain !== void 0;
|
|
955
963
|
});
|
|
@@ -996,13 +1004,13 @@ function buildGmailLabelAppliedEventConfig(options) {
|
|
|
996
1004
|
const labelName = options.label?.trim();
|
|
997
1005
|
if (!labelName) {
|
|
998
1006
|
throw new Error(
|
|
999
|
-
'gmail-label-applied
|
|
1007
|
+
'gmail-label-applied automations require --label "Label name"'
|
|
1000
1008
|
);
|
|
1001
1009
|
}
|
|
1002
1010
|
return { provider: "gmail", event: "label_applied", labelName };
|
|
1003
1011
|
}
|
|
1004
1012
|
|
|
1005
|
-
// src/commands/zero/workflow/
|
|
1013
|
+
// src/commands/zero/workflow/automation/index.ts
|
|
1006
1014
|
var SCHEDULE_KINDS = ["cron", "once", "loop"];
|
|
1007
1015
|
var EVENT_KINDS = [
|
|
1008
1016
|
"gmail-new-message",
|
|
@@ -1016,13 +1024,13 @@ var EVENT_KINDS = [
|
|
|
1016
1024
|
"notion-page-content-updated",
|
|
1017
1025
|
"webhook"
|
|
1018
1026
|
];
|
|
1019
|
-
var
|
|
1027
|
+
var AUTOMATION_KINDS = [...SCHEDULE_KINDS, ...EVENT_KINDS];
|
|
1020
1028
|
var EXACTLY_ONE_FLAG_MESSAGE = "Provide exactly one of --expr (cron), --at (once), --every (loop), Gmail match options, --label, --subject, --actor, --calendar-id, --page-url, --parent-page-url, or --database-url";
|
|
1021
|
-
function
|
|
1029
|
+
function addGmailAutomationOptions(command) {
|
|
1022
1030
|
return command.option(
|
|
1023
1031
|
"--config <path>",
|
|
1024
|
-
"Path to a Gmail new message
|
|
1025
|
-
).option("--label <name>", "Label name for label-applied
|
|
1032
|
+
"Path to a Gmail new message automation config JSON"
|
|
1033
|
+
).option("--label <name>", "Label name for label-applied automations").option("--from-contains <text>", "Require the From header to contain text").option(
|
|
1026
1034
|
"--from-not-contains <text>",
|
|
1027
1035
|
"Require the From header not to contain text"
|
|
1028
1036
|
).option(
|
|
@@ -1045,7 +1053,7 @@ function addGmailTriggerOptions(command) {
|
|
|
1045
1053
|
"Require the Cc header not to contain text"
|
|
1046
1054
|
);
|
|
1047
1055
|
}
|
|
1048
|
-
function
|
|
1056
|
+
function addGithubAutomationOptions(command) {
|
|
1049
1057
|
return command.option(
|
|
1050
1058
|
"--subject <subject>",
|
|
1051
1059
|
"GitHub subject filter for github-label-applied: both | issues | pull-requests"
|
|
@@ -1155,7 +1163,7 @@ function buildSchedule(kind, options) {
|
|
|
1155
1163
|
case "cron":
|
|
1156
1164
|
if (!options.expr) {
|
|
1157
1165
|
throw new Error(
|
|
1158
|
-
'cron
|
|
1166
|
+
'cron automations require --expr (e.g. --expr "0 9 * * *")'
|
|
1159
1167
|
);
|
|
1160
1168
|
}
|
|
1161
1169
|
return {
|
|
@@ -1166,7 +1174,7 @@ function buildSchedule(kind, options) {
|
|
|
1166
1174
|
case "once": {
|
|
1167
1175
|
if (!options.at) {
|
|
1168
1176
|
throw new Error(
|
|
1169
|
-
'once
|
|
1177
|
+
'once automations require --at (e.g. --at "2026-06-10T09:00")'
|
|
1170
1178
|
);
|
|
1171
1179
|
}
|
|
1172
1180
|
const timezone = timezoneOrUtc(options.timezone);
|
|
@@ -1178,7 +1186,7 @@ function buildSchedule(kind, options) {
|
|
|
1178
1186
|
}
|
|
1179
1187
|
case "loop":
|
|
1180
1188
|
if (!options.every) {
|
|
1181
|
-
throw new Error("loop
|
|
1189
|
+
throw new Error("loop automations require --every (e.g. --every 15m)");
|
|
1182
1190
|
}
|
|
1183
1191
|
return {
|
|
1184
1192
|
type: "loop",
|
|
@@ -1186,47 +1194,49 @@ function buildSchedule(kind, options) {
|
|
|
1186
1194
|
};
|
|
1187
1195
|
default:
|
|
1188
1196
|
throw new Error(
|
|
1189
|
-
`Unknown
|
|
1197
|
+
`Unknown automation kind: "${kind}". Use one of: ${AUTOMATION_KINDS.join(", ")}`
|
|
1190
1198
|
);
|
|
1191
1199
|
}
|
|
1192
1200
|
}
|
|
1193
1201
|
function hasScheduleAddOptions(options) {
|
|
1194
1202
|
return options.expr !== void 0 || options.at !== void 0 || options.every !== void 0 || options.timezone !== void 0;
|
|
1195
1203
|
}
|
|
1196
|
-
function
|
|
1204
|
+
function hasGithubAutomationOptions(options) {
|
|
1197
1205
|
return options.subject !== void 0 || options.actor !== void 0;
|
|
1198
1206
|
}
|
|
1199
|
-
function
|
|
1207
|
+
function hasCalendarAutomationOptions(options) {
|
|
1200
1208
|
return options.calendarId !== void 0;
|
|
1201
1209
|
}
|
|
1202
|
-
function
|
|
1210
|
+
function hasNotionAutomationOptions(options) {
|
|
1203
1211
|
return options.pageUrl !== void 0 || options.parentPageUrl !== void 0 || options.databaseUrl !== void 0;
|
|
1204
1212
|
}
|
|
1205
1213
|
function hasEventAddOptions(options) {
|
|
1206
|
-
return
|
|
1214
|
+
return hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options) || hasCalendarAutomationOptions(options) || hasNotionAutomationOptions(options);
|
|
1207
1215
|
}
|
|
1208
1216
|
function assertNoScheduleAddOptions(options) {
|
|
1209
1217
|
if (hasScheduleAddOptions(options)) {
|
|
1210
1218
|
throw new Error(
|
|
1211
|
-
"--expr, --at, --every, and --timezone only apply to schedule
|
|
1219
|
+
"--expr, --at, --every, and --timezone only apply to schedule automations"
|
|
1212
1220
|
);
|
|
1213
1221
|
}
|
|
1214
1222
|
}
|
|
1215
|
-
function
|
|
1216
|
-
if (
|
|
1223
|
+
function assertNoGithubAutomationOptions(options, message = "GitHub automation flags only apply to GitHub event automations") {
|
|
1224
|
+
if (hasGithubAutomationOptions(options)) {
|
|
1217
1225
|
throw new Error(message);
|
|
1218
1226
|
}
|
|
1219
1227
|
}
|
|
1220
|
-
function
|
|
1221
|
-
if (
|
|
1228
|
+
function assertNoCalendarAutomationOptions(options) {
|
|
1229
|
+
if (hasCalendarAutomationOptions(options)) {
|
|
1222
1230
|
throw new Error(
|
|
1223
|
-
"Google Calendar
|
|
1231
|
+
"Google Calendar automation flags only apply to Google Calendar event automations"
|
|
1224
1232
|
);
|
|
1225
1233
|
}
|
|
1226
1234
|
}
|
|
1227
|
-
function
|
|
1228
|
-
if (
|
|
1229
|
-
throw new Error(
|
|
1235
|
+
function assertNoNotionAutomationOptions(options) {
|
|
1236
|
+
if (hasNotionAutomationOptions(options)) {
|
|
1237
|
+
throw new Error(
|
|
1238
|
+
"Notion automation flags only apply to Notion event automations"
|
|
1239
|
+
);
|
|
1230
1240
|
}
|
|
1231
1241
|
}
|
|
1232
1242
|
function scheduleUpdateFlagCount(options) {
|
|
@@ -1266,7 +1276,7 @@ function buildGithubLabelAppliedEventConfig(options, existing) {
|
|
|
1266
1276
|
const labelName = options.label?.trim() ?? existing?.eventConfig.labelName;
|
|
1267
1277
|
if (!labelName) {
|
|
1268
1278
|
throw new Error(
|
|
1269
|
-
'github-label-applied
|
|
1279
|
+
'github-label-applied automations require --label "Label name"'
|
|
1270
1280
|
);
|
|
1271
1281
|
}
|
|
1272
1282
|
return {
|
|
@@ -1290,11 +1300,11 @@ function buildGithubLabelAppliedEventConfig(options, existing) {
|
|
|
1290
1300
|
function buildGmailNewMessageCreateRequest(options) {
|
|
1291
1301
|
assertNoScheduleAddOptions(options);
|
|
1292
1302
|
if (hasGmailLabelOption(options)) {
|
|
1293
|
-
throw new Error("--label only applies to label-applied event
|
|
1303
|
+
throw new Error("--label only applies to label-applied event automations");
|
|
1294
1304
|
}
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1305
|
+
assertNoGithubAutomationOptions(options);
|
|
1306
|
+
assertNoCalendarAutomationOptions(options);
|
|
1307
|
+
assertNoNotionAutomationOptions(options);
|
|
1298
1308
|
return {
|
|
1299
1309
|
kind: "event",
|
|
1300
1310
|
eventType: "gmail-new-message",
|
|
@@ -1303,14 +1313,14 @@ function buildGmailNewMessageCreateRequest(options) {
|
|
|
1303
1313
|
}
|
|
1304
1314
|
function buildGmailLabelAppliedCreateRequest(options) {
|
|
1305
1315
|
assertNoScheduleAddOptions(options);
|
|
1306
|
-
if (
|
|
1316
|
+
if (hasGmailAutomationOptions(options)) {
|
|
1307
1317
|
throw new Error(
|
|
1308
|
-
"Gmail match flags and --config only apply to gmail-new-message
|
|
1318
|
+
"Gmail match flags and --config only apply to gmail-new-message automations"
|
|
1309
1319
|
);
|
|
1310
1320
|
}
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1321
|
+
assertNoGithubAutomationOptions(options);
|
|
1322
|
+
assertNoCalendarAutomationOptions(options);
|
|
1323
|
+
assertNoNotionAutomationOptions(options);
|
|
1314
1324
|
return {
|
|
1315
1325
|
kind: "event",
|
|
1316
1326
|
eventType: "gmail-label-applied",
|
|
@@ -1319,13 +1329,13 @@ function buildGmailLabelAppliedCreateRequest(options) {
|
|
|
1319
1329
|
}
|
|
1320
1330
|
function buildGithubLabelAppliedCreateRequest(options) {
|
|
1321
1331
|
assertNoScheduleAddOptions(options);
|
|
1322
|
-
if (
|
|
1332
|
+
if (hasGmailAutomationOptions(options)) {
|
|
1323
1333
|
throw new Error(
|
|
1324
|
-
"Gmail match flags and --config only apply to Gmail event
|
|
1334
|
+
"Gmail match flags and --config only apply to Gmail event automations"
|
|
1325
1335
|
);
|
|
1326
1336
|
}
|
|
1327
|
-
|
|
1328
|
-
|
|
1337
|
+
assertNoCalendarAutomationOptions(options);
|
|
1338
|
+
assertNoNotionAutomationOptions(options);
|
|
1329
1339
|
return {
|
|
1330
1340
|
kind: "event",
|
|
1331
1341
|
eventType: "github-label-applied",
|
|
@@ -1334,9 +1344,9 @@ function buildGithubLabelAppliedCreateRequest(options) {
|
|
|
1334
1344
|
}
|
|
1335
1345
|
function buildGoogleCalendarEventCreateRequest(eventType, options) {
|
|
1336
1346
|
assertNoScheduleAddOptions(options);
|
|
1337
|
-
if (
|
|
1347
|
+
if (hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options) || hasNotionAutomationOptions(options)) {
|
|
1338
1348
|
throw new Error(
|
|
1339
|
-
"Gmail, GitHub, and Notion
|
|
1349
|
+
"Gmail, GitHub, and Notion automation flags only apply to their event automations"
|
|
1340
1350
|
);
|
|
1341
1351
|
}
|
|
1342
1352
|
const calendarId = options.calendarId?.trim() || "primary";
|
|
@@ -1374,20 +1384,20 @@ function buildGoogleCalendarEventCreateRequest(eventType, options) {
|
|
|
1374
1384
|
}
|
|
1375
1385
|
function buildNotionChildPageCreatedCreateRequest(options) {
|
|
1376
1386
|
assertNoScheduleAddOptions(options);
|
|
1377
|
-
if (
|
|
1387
|
+
if (hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options) || hasCalendarAutomationOptions(options)) {
|
|
1378
1388
|
throw new Error(
|
|
1379
|
-
"Gmail, GitHub, and Google Calendar
|
|
1389
|
+
"Gmail, GitHub, and Google Calendar automation flags only apply to their event automations"
|
|
1380
1390
|
);
|
|
1381
1391
|
}
|
|
1382
1392
|
const parentPageUrl = options.parentPageUrl?.trim();
|
|
1383
1393
|
if (options.pageUrl !== void 0 || options.databaseUrl !== void 0) {
|
|
1384
1394
|
throw new Error(
|
|
1385
|
-
"--page-url and --database-url do not apply to notion-child-page-created
|
|
1395
|
+
"--page-url and --database-url do not apply to notion-child-page-created automations"
|
|
1386
1396
|
);
|
|
1387
1397
|
}
|
|
1388
1398
|
if (!parentPageUrl) {
|
|
1389
1399
|
throw new Error(
|
|
1390
|
-
'notion-child-page-created
|
|
1400
|
+
'notion-child-page-created automations require --parent-page-url "https://www.notion.so/..."'
|
|
1391
1401
|
);
|
|
1392
1402
|
}
|
|
1393
1403
|
return {
|
|
@@ -1402,20 +1412,20 @@ function buildNotionChildPageCreatedCreateRequest(options) {
|
|
|
1402
1412
|
}
|
|
1403
1413
|
function buildNotionDatabaseItemCreatedCreateRequest(options) {
|
|
1404
1414
|
assertNoScheduleAddOptions(options);
|
|
1405
|
-
if (
|
|
1415
|
+
if (hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options) || hasCalendarAutomationOptions(options)) {
|
|
1406
1416
|
throw new Error(
|
|
1407
|
-
"Gmail, GitHub, and Google Calendar
|
|
1417
|
+
"Gmail, GitHub, and Google Calendar automation flags only apply to their event automations"
|
|
1408
1418
|
);
|
|
1409
1419
|
}
|
|
1410
1420
|
if (options.pageUrl !== void 0 || options.parentPageUrl !== void 0) {
|
|
1411
1421
|
throw new Error(
|
|
1412
|
-
"--page-url and --parent-page-url do not apply to notion-database-item-created
|
|
1422
|
+
"--page-url and --parent-page-url do not apply to notion-database-item-created automations"
|
|
1413
1423
|
);
|
|
1414
1424
|
}
|
|
1415
1425
|
const databaseUrl = options.databaseUrl?.trim();
|
|
1416
1426
|
if (!databaseUrl) {
|
|
1417
1427
|
throw new Error(
|
|
1418
|
-
'notion-database-item-created
|
|
1428
|
+
'notion-database-item-created automations require --database-url "https://www.notion.so/..."'
|
|
1419
1429
|
);
|
|
1420
1430
|
}
|
|
1421
1431
|
return {
|
|
@@ -1430,21 +1440,21 @@ function buildNotionDatabaseItemCreatedCreateRequest(options) {
|
|
|
1430
1440
|
}
|
|
1431
1441
|
function buildNotionPageContentUpdatedCreateRequest(options) {
|
|
1432
1442
|
assertNoScheduleAddOptions(options);
|
|
1433
|
-
if (
|
|
1443
|
+
if (hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options) || hasCalendarAutomationOptions(options)) {
|
|
1434
1444
|
throw new Error(
|
|
1435
|
-
"Gmail, GitHub, and Google Calendar
|
|
1445
|
+
"Gmail, GitHub, and Google Calendar automation flags only apply to their event automations"
|
|
1436
1446
|
);
|
|
1437
1447
|
}
|
|
1438
1448
|
if (options.parentPageUrl !== void 0) {
|
|
1439
1449
|
throw new Error(
|
|
1440
|
-
"--parent-page-url only applies to notion-child-page-created
|
|
1450
|
+
"--parent-page-url only applies to notion-child-page-created automations"
|
|
1441
1451
|
);
|
|
1442
1452
|
}
|
|
1443
1453
|
const pageUrl = options.pageUrl?.trim();
|
|
1444
1454
|
const databaseUrl = options.databaseUrl?.trim();
|
|
1445
1455
|
if ((pageUrl !== void 0 && pageUrl.length > 0) === (databaseUrl !== void 0 && databaseUrl.length > 0)) {
|
|
1446
1456
|
throw new Error(
|
|
1447
|
-
'notion-page-content-updated
|
|
1457
|
+
'notion-page-content-updated automations require exactly one of --page-url "https://www.notion.so/..." or --database-url "https://www.notion.so/..."'
|
|
1448
1458
|
);
|
|
1449
1459
|
}
|
|
1450
1460
|
return {
|
|
@@ -1464,7 +1474,7 @@ function buildNotionPageContentUpdatedCreateRequest(options) {
|
|
|
1464
1474
|
function buildWebhookCreateRequest(options) {
|
|
1465
1475
|
assertNoScheduleAddOptions(options);
|
|
1466
1476
|
if (hasEventAddOptions(options)) {
|
|
1467
|
-
throw new Error("Event
|
|
1477
|
+
throw new Error("Event automation flags only apply to event automations");
|
|
1468
1478
|
}
|
|
1469
1479
|
return {
|
|
1470
1480
|
kind: "event",
|
|
@@ -1478,7 +1488,7 @@ function buildWebhookCreateRequest(options) {
|
|
|
1478
1488
|
}
|
|
1479
1489
|
function buildScheduleCreateRequest(kind, options) {
|
|
1480
1490
|
if (hasEventAddOptions(options)) {
|
|
1481
|
-
throw new Error("Event
|
|
1491
|
+
throw new Error("Event automation flags only apply to event automations");
|
|
1482
1492
|
}
|
|
1483
1493
|
return { schedule: buildSchedule(kind, options) };
|
|
1484
1494
|
}
|
|
@@ -1509,19 +1519,21 @@ function buildCreateRequest(kind, options) {
|
|
|
1509
1519
|
}
|
|
1510
1520
|
}
|
|
1511
1521
|
function buildEventUpdate(options, existing) {
|
|
1512
|
-
const hasGmailOptions =
|
|
1522
|
+
const hasGmailOptions = hasGmailAutomationOptions(options);
|
|
1513
1523
|
const hasLabelOption = hasGmailLabelOption(options);
|
|
1514
|
-
const hasGithubOptions =
|
|
1524
|
+
const hasGithubOptions = hasGithubAutomationOptions(options);
|
|
1515
1525
|
if (existing.eventType === "google-calendar-event-created" || existing.eventType === "google-calendar-event-updated" || existing.eventType === "google-calendar-event-cancelled") {
|
|
1516
|
-
throw new Error("Google Calendar event
|
|
1526
|
+
throw new Error("Google Calendar event automations cannot be updated");
|
|
1517
1527
|
}
|
|
1518
1528
|
if (existing.eventType === "github-label-applied") {
|
|
1519
1529
|
if (hasGmailOptions) {
|
|
1520
|
-
throw new Error(
|
|
1530
|
+
throw new Error(
|
|
1531
|
+
"Gmail match flags only apply to Gmail event automations"
|
|
1532
|
+
);
|
|
1521
1533
|
}
|
|
1522
1534
|
if (!hasLabelOption && !hasGithubOptions) {
|
|
1523
1535
|
throw new Error(
|
|
1524
|
-
"Provide --label, --subject, or --actor for github-label-applied
|
|
1536
|
+
"Provide --label, --subject, or --actor for github-label-applied automations"
|
|
1525
1537
|
);
|
|
1526
1538
|
}
|
|
1527
1539
|
return {
|
|
@@ -1529,24 +1541,30 @@ function buildEventUpdate(options, existing) {
|
|
|
1529
1541
|
};
|
|
1530
1542
|
}
|
|
1531
1543
|
if (hasGithubOptions) {
|
|
1532
|
-
throw new Error(
|
|
1544
|
+
throw new Error(
|
|
1545
|
+
"GitHub automation flags only apply to GitHub event automations"
|
|
1546
|
+
);
|
|
1533
1547
|
}
|
|
1534
1548
|
if (existing.eventType === "gmail-label-applied") {
|
|
1535
1549
|
if (!hasLabelOption || hasGmailOptions) {
|
|
1536
|
-
throw new Error("Use --label for gmail-label-applied
|
|
1550
|
+
throw new Error("Use --label for gmail-label-applied automations");
|
|
1537
1551
|
}
|
|
1538
1552
|
return { eventConfig: buildGmailLabelAppliedEventConfig(options) };
|
|
1539
1553
|
}
|
|
1540
1554
|
if (!hasGmailOptions || hasLabelOption) {
|
|
1541
|
-
throw new Error(
|
|
1555
|
+
throw new Error(
|
|
1556
|
+
"Use Gmail match options for gmail-new-message automations"
|
|
1557
|
+
);
|
|
1542
1558
|
}
|
|
1543
1559
|
return { eventConfig: buildGmailNewMessageEventConfig(options) };
|
|
1544
1560
|
}
|
|
1545
1561
|
function buildScheduleUpdate(options) {
|
|
1546
|
-
const hasGmailOptions =
|
|
1562
|
+
const hasGmailOptions = hasGmailAutomationOptions(options);
|
|
1547
1563
|
const hasLabelOption = hasGmailLabelOption(options);
|
|
1548
1564
|
if (hasGmailOptions || hasLabelOption) {
|
|
1549
|
-
throw new Error(
|
|
1565
|
+
throw new Error(
|
|
1566
|
+
"Gmail automation flags only apply to Gmail event automations"
|
|
1567
|
+
);
|
|
1550
1568
|
}
|
|
1551
1569
|
const flagCount = scheduleUpdateFlagCount(options);
|
|
1552
1570
|
if (flagCount !== 1) {
|
|
@@ -1564,27 +1582,29 @@ function buildScheduleUpdate(options) {
|
|
|
1564
1582
|
return { schedule: buildSchedule("loop", options) };
|
|
1565
1583
|
}
|
|
1566
1584
|
function buildUpdate(options, existing) {
|
|
1567
|
-
const hasEventOptions =
|
|
1585
|
+
const hasEventOptions = hasGmailAutomationOptions(options) || hasGmailLabelOption(options) || hasGithubAutomationOptions(options);
|
|
1568
1586
|
if (hasScheduleUpdateOptions(options) && hasEventOptions) {
|
|
1569
|
-
throw new Error("Use either schedule flags or event
|
|
1587
|
+
throw new Error("Use either schedule flags or event automation options");
|
|
1570
1588
|
}
|
|
1571
|
-
if (
|
|
1589
|
+
if (hasGmailAutomationOptions(options) && hasGmailLabelOption(options)) {
|
|
1572
1590
|
throw new Error("Use either Gmail match options or --label");
|
|
1573
1591
|
}
|
|
1574
1592
|
if (existing.kind === "event") {
|
|
1575
1593
|
if (hasScheduleUpdateOptions(options)) {
|
|
1576
|
-
throw new Error("Schedule flags only apply to schedule
|
|
1594
|
+
throw new Error("Schedule flags only apply to schedule automations");
|
|
1577
1595
|
}
|
|
1578
1596
|
return buildEventUpdate(options, existing);
|
|
1579
1597
|
}
|
|
1580
|
-
if (
|
|
1581
|
-
throw new Error(
|
|
1598
|
+
if (hasGithubAutomationOptions(options)) {
|
|
1599
|
+
throw new Error(
|
|
1600
|
+
"GitHub automation flags only apply to GitHub event automations"
|
|
1601
|
+
);
|
|
1582
1602
|
}
|
|
1583
1603
|
return buildScheduleUpdate(options);
|
|
1584
1604
|
}
|
|
1585
|
-
var addCommand =
|
|
1586
|
-
|
|
1587
|
-
new Command().name("add").description("Add
|
|
1605
|
+
var addCommand = addGithubAutomationOptions(
|
|
1606
|
+
addGmailAutomationOptions(
|
|
1607
|
+
new Command().name("add").description("Add an automation to a workflow").argument("<workflow>", "Workflow ID or name").argument("<kind>", `Automation type: ${AUTOMATION_KINDS.join(" | ")}`).option("--expr <expression>", 'Cron expression for kind "cron"').option("--at <iso-time>", 'Fire time for kind "once"').option(
|
|
1588
1608
|
"--every <duration>",
|
|
1589
1609
|
'Interval for kind "loop" (e.g. 15m, 1h, 90s)'
|
|
1590
1610
|
).option(
|
|
@@ -1594,149 +1614,158 @@ var addCommand = addGithubTriggerOptions(
|
|
|
1594
1614
|
)
|
|
1595
1615
|
).option(
|
|
1596
1616
|
"--calendar-id <id>",
|
|
1597
|
-
"Google Calendar ID for Google Calendar event
|
|
1617
|
+
"Google Calendar ID for Google Calendar event automations (default: primary)"
|
|
1598
1618
|
).option(
|
|
1599
1619
|
"--page-url <url>",
|
|
1600
|
-
"Notion page URL for notion-page-content-updated
|
|
1620
|
+
"Notion page URL for notion-page-content-updated automations"
|
|
1601
1621
|
).option(
|
|
1602
1622
|
"--parent-page-url <url>",
|
|
1603
|
-
"Parent Notion page URL for notion-child-page-created
|
|
1623
|
+
"Parent Notion page URL for notion-child-page-created automations"
|
|
1604
1624
|
).option(
|
|
1605
1625
|
"--database-url <url>",
|
|
1606
|
-
"Notion database URL for notion-database-item-created or notion-page-content-updated
|
|
1626
|
+
"Notion database URL for notion-database-item-created or notion-page-content-updated automations"
|
|
1607
1627
|
).option("--agent <id>", "Agent ID for resolving a workflow name").addHelpText(
|
|
1608
1628
|
"after",
|
|
1609
1629
|
`
|
|
1610
1630
|
Examples:
|
|
1611
|
-
zero workflow
|
|
1612
|
-
zero workflow
|
|
1613
|
-
zero workflow
|
|
1614
|
-
zero workflow
|
|
1615
|
-
zero workflow
|
|
1616
|
-
zero workflow
|
|
1617
|
-
zero workflow
|
|
1618
|
-
zero workflow
|
|
1619
|
-
zero workflow
|
|
1620
|
-
zero workflow
|
|
1621
|
-
zero workflow
|
|
1622
|
-
zero workflow
|
|
1623
|
-
zero workflow
|
|
1624
|
-
zero workflow
|
|
1625
|
-
zero workflow
|
|
1631
|
+
zero workflow automation add tell-a-joke --agent <agent-id> cron --expr "0 9 * * *" -z Asia/Shanghai
|
|
1632
|
+
zero workflow automation add tell-a-joke --agent <agent-id> once --at "2026-06-10T09:00" -z Asia/Shanghai
|
|
1633
|
+
zero workflow automation add tell-a-joke --agent <agent-id> loop --every 15m
|
|
1634
|
+
zero workflow automation add triage --agent <agent-id> gmail-new-message --from-contains "@example.com"
|
|
1635
|
+
zero workflow automation add triage --agent <agent-id> gmail-new-message --config ./gmail-automation.json
|
|
1636
|
+
zero workflow automation add triage --agent <agent-id> gmail-label-applied --label "Support"
|
|
1637
|
+
zero workflow automation add triage --agent <agent-id> github-label-applied --label "triage" --subject both --actor me
|
|
1638
|
+
zero workflow automation add triage --agent <agent-id> google-calendar-event-created
|
|
1639
|
+
zero workflow automation add triage --agent <agent-id> google-calendar-event-updated
|
|
1640
|
+
zero workflow automation add triage --agent <agent-id> google-calendar-event-cancelled
|
|
1641
|
+
zero workflow automation add research-notes --agent <agent-id> notion-child-page-created --parent-page-url "https://www.notion.so/workspace/Page-title-1234567890abcdef1234567890abcdef"
|
|
1642
|
+
zero workflow automation add research-notes --agent <agent-id> notion-database-item-created --database-url "https://www.notion.so/1234567890abcdef1234567890abcdef?v=abcdef1234567890abcdef1234567890"
|
|
1643
|
+
zero workflow automation add research-notes --agent <agent-id> notion-page-content-updated --page-url "https://www.notion.so/workspace/Page-title-1234567890abcdef1234567890abcdef"
|
|
1644
|
+
zero workflow automation add research-notes --agent <agent-id> notion-page-content-updated --database-url "https://www.notion.so/1234567890abcdef1234567890abcdef?v=abcdef1234567890abcdef1234567890"
|
|
1645
|
+
zero workflow automation add triage --agent <agent-id> webhook
|
|
1626
1646
|
|
|
1627
1647
|
Notes:
|
|
1628
1648
|
- Workflow names resolve under --agent, then ZERO_AGENT_ID
|
|
1629
|
-
- Gmail
|
|
1630
|
-
- GitHub label
|
|
1631
|
-
- Webhook
|
|
1649
|
+
- Gmail automations match all inbound messages when no text match rules are provided
|
|
1650
|
+
- GitHub label automations require the GitHub App installation in the workspace
|
|
1651
|
+
- Webhook automations print the signing secret only once after creation
|
|
1632
1652
|
- Use the workflow ID when a name is ambiguous`
|
|
1633
1653
|
).action(
|
|
1634
1654
|
withErrorHandler(
|
|
1635
1655
|
async (workflowRef, kind, options) => {
|
|
1636
1656
|
if (options.timezone && kind !== "cron" && kind !== "once" && kind !== "gmail-new-message") {
|
|
1637
|
-
throw new Error(
|
|
1657
|
+
throw new Error(
|
|
1658
|
+
"--timezone only applies to cron and once automations"
|
|
1659
|
+
);
|
|
1638
1660
|
}
|
|
1639
1661
|
const workflowId = await resolveWorkflowRef(workflowRef, options);
|
|
1640
1662
|
const body = buildCreateRequest(kind, options);
|
|
1641
|
-
const
|
|
1663
|
+
const automation = await createWorkflowAutomation(workflowId, body);
|
|
1642
1664
|
console.log(
|
|
1643
|
-
source_default.green(`\u2713
|
|
1665
|
+
source_default.green(`\u2713 Automation added to workflow "${workflowRef}"`)
|
|
1644
1666
|
);
|
|
1645
|
-
|
|
1667
|
+
printWorkflowAutomationDetails(automation, { workflowRef });
|
|
1646
1668
|
}
|
|
1647
1669
|
)
|
|
1648
1670
|
);
|
|
1649
|
-
var updateCommand =
|
|
1650
|
-
|
|
1671
|
+
var updateCommand = addGithubAutomationOptions(
|
|
1672
|
+
addGmailAutomationOptions(
|
|
1651
1673
|
new Command().name("update").description(
|
|
1652
|
-
"Replace a workflow
|
|
1653
|
-
).argument("<
|
|
1674
|
+
"Replace a workflow automation's schedule or Gmail match config"
|
|
1675
|
+
).argument("<automation>", "Workflow automation ID").option("--expr <expression>", 'New cron schedule (e.g. "0 9 * * *")').option("--at <iso-time>", 'New one-time fire (e.g. "2026-06-10T09:00")').option("--every <duration>", "New loop interval (e.g. 15m, 1h, 90s)").option("-z, --timezone <tz>", "IANA timezone for --expr / --at")
|
|
1654
1676
|
)
|
|
1655
1677
|
).addHelpText(
|
|
1656
1678
|
"after",
|
|
1657
1679
|
`
|
|
1658
1680
|
Examples:
|
|
1659
|
-
zero workflow
|
|
1660
|
-
zero workflow
|
|
1661
|
-
zero workflow
|
|
1662
|
-
zero workflow
|
|
1663
|
-
zero workflow
|
|
1664
|
-
zero workflow
|
|
1665
|
-
zero workflow
|
|
1681
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --expr "0 9 * * *" -z Asia/Shanghai
|
|
1682
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --at "2026-06-10T09:00" -z UTC
|
|
1683
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --every 10m
|
|
1684
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --from-contains "@example.com"
|
|
1685
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --config ./gmail-automation.json
|
|
1686
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --label "Support"
|
|
1687
|
+
zero workflow automation update 22222222-2222-4222-8222-222222222222 --actor anyone`
|
|
1666
1688
|
).action(
|
|
1667
1689
|
withErrorHandler(async (id, options) => {
|
|
1668
|
-
const existing = await
|
|
1669
|
-
const
|
|
1690
|
+
const existing = await getWorkflowAutomation(id);
|
|
1691
|
+
const automation = await updateWorkflowAutomation(
|
|
1670
1692
|
id,
|
|
1671
1693
|
buildUpdate(options, existing)
|
|
1672
1694
|
);
|
|
1673
|
-
console.log(source_default.green(`\u2713
|
|
1674
|
-
|
|
1695
|
+
console.log(source_default.green(`\u2713 Automation ${automation.id} updated`));
|
|
1696
|
+
printWorkflowAutomationDetails(automation);
|
|
1675
1697
|
})
|
|
1676
1698
|
);
|
|
1677
|
-
var listCommand2 = new Command().name("list").alias("ls").description("List a workflow's
|
|
1699
|
+
var listCommand2 = new Command().name("list").alias("ls").description("List a workflow's automations").argument("<workflow>", "Workflow ID or name").option("--agent <id>", "Agent ID for resolving a workflow name").addHelpText(
|
|
1678
1700
|
"after",
|
|
1679
1701
|
`
|
|
1680
1702
|
Examples:
|
|
1681
|
-
zero workflow
|
|
1682
|
-
zero workflow
|
|
1703
|
+
zero workflow automation list tell-a-joke --agent <agent-id>
|
|
1704
|
+
zero workflow automation list <workflow-id>`
|
|
1683
1705
|
).action(
|
|
1684
1706
|
withErrorHandler(
|
|
1685
1707
|
async (workflowRef, options) => {
|
|
1686
1708
|
const workflowId = await resolveWorkflowRef(workflowRef, options);
|
|
1687
|
-
const
|
|
1688
|
-
if (
|
|
1689
|
-
console.log(source_default.dim("No
|
|
1709
|
+
const automations = await listWorkflowAutomations(workflowId);
|
|
1710
|
+
if (automations.length === 0) {
|
|
1711
|
+
console.log(source_default.dim("No automations"));
|
|
1690
1712
|
console.log(
|
|
1691
1713
|
source_default.dim(
|
|
1692
|
-
` Add one with: zero workflow
|
|
1714
|
+
` Add one with: zero workflow automation add ${workflowRef} cron --expr "0 9 * * *"`
|
|
1693
1715
|
)
|
|
1694
1716
|
);
|
|
1695
1717
|
return;
|
|
1696
1718
|
}
|
|
1697
|
-
|
|
1719
|
+
printWorkflowAutomationsTable(automations);
|
|
1698
1720
|
}
|
|
1699
1721
|
)
|
|
1700
1722
|
);
|
|
1701
|
-
var showCommand = new Command().name("show").description("Show a workflow
|
|
1723
|
+
var showCommand = new Command().name("show").description("Show a workflow automation").argument("<automation>", "Workflow automation ID").action(
|
|
1702
1724
|
withErrorHandler(async (id) => {
|
|
1703
|
-
const
|
|
1704
|
-
|
|
1725
|
+
const automation = await getWorkflowAutomation(id);
|
|
1726
|
+
printWorkflowAutomationDetails(automation);
|
|
1705
1727
|
})
|
|
1706
1728
|
);
|
|
1707
|
-
var rmCommand = new Command().name("rm").alias("remove").description("Remove a workflow
|
|
1729
|
+
var rmCommand = new Command().name("rm").alias("remove").description("Remove a workflow automation").argument("<automation>", "Workflow automation ID").action(
|
|
1708
1730
|
withErrorHandler(async (id) => {
|
|
1709
|
-
await
|
|
1710
|
-
console.log(source_default.green(`\u2713
|
|
1731
|
+
await deleteWorkflowAutomation(id);
|
|
1732
|
+
console.log(source_default.green(`\u2713 Automation ${id} removed`));
|
|
1711
1733
|
})
|
|
1712
1734
|
);
|
|
1713
|
-
var enableCommand = new Command().name("enable").description("Enable a workflow
|
|
1735
|
+
var enableCommand = new Command().name("enable").description("Enable a workflow automation").argument("<automation>", "Workflow automation ID").action(
|
|
1714
1736
|
withErrorHandler(async (id) => {
|
|
1715
|
-
const
|
|
1716
|
-
console.log(source_default.green(`\u2713
|
|
1737
|
+
const automation = await enableWorkflowAutomation(id);
|
|
1738
|
+
console.log(source_default.green(`\u2713 Automation ${automation.id} enabled`));
|
|
1717
1739
|
})
|
|
1718
1740
|
);
|
|
1719
|
-
var disableCommand = new Command().name("disable").description("Disable a workflow
|
|
1741
|
+
var disableCommand = new Command().name("disable").description("Disable a workflow automation").argument("<automation>", "Workflow automation ID").action(
|
|
1720
1742
|
withErrorHandler(async (id) => {
|
|
1721
|
-
const
|
|
1722
|
-
console.log(source_default.green(`\u2713
|
|
1743
|
+
const automation = await disableWorkflowAutomation(id);
|
|
1744
|
+
console.log(source_default.green(`\u2713 Automation ${automation.id} disabled`));
|
|
1723
1745
|
})
|
|
1724
1746
|
);
|
|
1725
|
-
var
|
|
1747
|
+
var automationCommand = new Command().name("automation").description("Manage a workflow's automations").addCommand(addCommand).addCommand(updateCommand).addCommand(listCommand2).addCommand(showCommand).addCommand(rmCommand).addCommand(enableCommand).addCommand(disableCommand).addHelpText(
|
|
1726
1748
|
"after",
|
|
1727
1749
|
`
|
|
1728
1750
|
Examples:
|
|
1729
|
-
Add
|
|
1730
|
-
Add a Notion page:
|
|
1731
|
-
Add a webhook:
|
|
1732
|
-
Update a schedule:
|
|
1733
|
-
List
|
|
1734
|
-
Inspect
|
|
1735
|
-
Pause one
|
|
1751
|
+
Add an automation: zero workflow automation add <workflow-id> cron --expr "0 9 * * *"
|
|
1752
|
+
Add a Notion page: zero workflow automation add <workflow-id> notion-child-page-created --parent-page-url "https://www.notion.so/..."
|
|
1753
|
+
Add a webhook: zero workflow automation add <workflow-id> webhook
|
|
1754
|
+
Update a schedule: zero workflow automation update <automation-id> --every 10m
|
|
1755
|
+
List automations: zero workflow automation list <workflow-id>
|
|
1756
|
+
Inspect an automation: zero workflow automation show <automation-id>
|
|
1757
|
+
Pause one automation: zero workflow automation disable <automation-id>`
|
|
1736
1758
|
);
|
|
1737
1759
|
|
|
1760
|
+
// src/commands/zero/workflow/legacy-trigger.ts
|
|
1761
|
+
init_esm_shims();
|
|
1762
|
+
var legacyTriggerCommand = new Command("trigger").helpOption(false).allowUnknownOption().argument("[args...]").action(() => {
|
|
1763
|
+
console.error("renamed: use zero workflow automation");
|
|
1764
|
+
process.exit(1);
|
|
1765
|
+
});
|
|
1766
|
+
|
|
1738
1767
|
// src/commands/zero/workflow/index.ts
|
|
1739
|
-
var zeroWorkflowCommand = new Command("workflow").description("Manage workflows").addCommand(createCommand).addCommand(editCommand).addCommand(viewCommand).addCommand(listCommand).addCommand(deleteCommand).addCommand(copyCommand).addCommand(
|
|
1768
|
+
var zeroWorkflowCommand = new Command("workflow").description("Manage workflows").addCommand(createCommand).addCommand(editCommand).addCommand(viewCommand).addCommand(listCommand).addCommand(deleteCommand).addCommand(copyCommand).addCommand(automationCommand).addCommand(legacyTriggerCommand, { hidden: true }).addHelpText(
|
|
1740
1769
|
"after",
|
|
1741
1770
|
`
|
|
1742
1771
|
Examples:
|
|
@@ -1745,10 +1774,10 @@ Examples:
|
|
|
1745
1774
|
View workflow content: zero workflow view <workflow> --agent <agent-id>
|
|
1746
1775
|
Update workflow content: zero workflow edit <workflow> --agent <agent-id> --instruction "New steps"
|
|
1747
1776
|
Copy onto another agent: zero workflow copy <workflow> --agent <source-agent-id> --to-agent <target-agent-id>
|
|
1748
|
-
Manage
|
|
1777
|
+
Manage automations: zero workflow automation --help
|
|
1749
1778
|
Delete a workflow: zero workflow delete <workflow> --agent <agent-id> -y`
|
|
1750
1779
|
);
|
|
1751
1780
|
export {
|
|
1752
1781
|
zeroWorkflowCommand
|
|
1753
1782
|
};
|
|
1754
|
-
//# sourceMappingURL=workflow-
|
|
1783
|
+
//# sourceMappingURL=workflow-KNIVHJGP.js.map
|