automate-it 0.1.0 → 0.2.0
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/ait.mjs +32 -7
- package/package.json +2 -2
package/ait.mjs
CHANGED
|
@@ -37,6 +37,8 @@ Tasks (the review-gate loop):
|
|
|
37
37
|
ait task create --title <t> Create a task
|
|
38
38
|
[--instructions <text>] [--output-types x,linkedin,...]
|
|
39
39
|
[--publish-mode manual|immediate|scheduled] [--publish-at <ISO date>]
|
|
40
|
+
Omitted --publish-mode falls back to the workspace's default publish
|
|
41
|
+
mode; scheduled without --publish-at auto-schedules at approval.
|
|
40
42
|
[--no-review] [--claim] [--skills <names or ids>] [--assign <userId|me>]
|
|
41
43
|
--claim creates the task already claimed (status "working") so the
|
|
42
44
|
built-in worker never picks it up — use it when YOU will generate the
|
|
@@ -71,6 +73,11 @@ Tasks (the review-gate loop):
|
|
|
71
73
|
ait task approve <taskId> Approve (reviewer/admin keys)
|
|
72
74
|
ait task reject <taskId> [--comment <text>]
|
|
73
75
|
ait task publish <taskId> [--platforms a,b]
|
|
76
|
+
ait task schedule <taskId> --at <ISO date> | --auto | --clear
|
|
77
|
+
Schedule an approved task to publish
|
|
78
|
+
later; --auto picks the next open slot
|
|
79
|
+
per the workspace's scheduling rules;
|
|
80
|
+
--clear returns it to manual
|
|
74
81
|
ait task delete <taskId>
|
|
75
82
|
|
|
76
83
|
Skills (workspace voice, formatting rules, bundled reference files):
|
|
@@ -99,7 +106,7 @@ All workspace commands accept --workspace <id>.`;
|
|
|
99
106
|
|
|
100
107
|
export class CliError extends Error {}
|
|
101
108
|
|
|
102
|
-
const BOOLEAN_FLAGS = new Set(["no-review", "claim", "mine", "help"]);
|
|
109
|
+
const BOOLEAN_FLAGS = new Set(["no-review", "claim", "mine", "clear", "auto", "help"]);
|
|
103
110
|
|
|
104
111
|
export function parseArgs(argv) {
|
|
105
112
|
const positional = [];
|
|
@@ -268,18 +275,15 @@ export function shapeLinks(task) {
|
|
|
268
275
|
/** Fields shared by `task create` and `task submit`. */
|
|
269
276
|
function buildCreateTaskArgs(flags) {
|
|
270
277
|
if (!flags.title) throw new CliError("--title is required for task create");
|
|
271
|
-
const publishMode = flags["publish-mode"]
|
|
272
|
-
if (!PUBLISH_MODES.includes(publishMode)) {
|
|
278
|
+
const publishMode = flags["publish-mode"];
|
|
279
|
+
if (publishMode && !PUBLISH_MODES.includes(publishMode)) {
|
|
273
280
|
throw new CliError(`--publish-mode must be one of: ${PUBLISH_MODES.join(", ")}`);
|
|
274
281
|
}
|
|
275
|
-
if (publishMode === "scheduled" && !flags["publish-at"]) {
|
|
276
|
-
throw new CliError('--publish-at is required when --publish-mode is "scheduled"');
|
|
277
|
-
}
|
|
278
282
|
return {
|
|
279
283
|
title: flags.title,
|
|
280
284
|
...(flags.instructions ? { instructions: flags.instructions } : {}),
|
|
281
285
|
outputTypes: csv(flags["output-types"]),
|
|
282
|
-
publishMode,
|
|
286
|
+
...(publishMode ? { publishMode } : {}),
|
|
283
287
|
...(flags["publish-at"] ? { publishAt: flags["publish-at"] } : {}),
|
|
284
288
|
requiresReview: flags["no-review"] !== true,
|
|
285
289
|
};
|
|
@@ -468,6 +472,27 @@ export async function runCommand(argv, opts = {}) {
|
|
|
468
472
|
});
|
|
469
473
|
}
|
|
470
474
|
|
|
475
|
+
case "task schedule": {
|
|
476
|
+
const taskId = requirePositional(rest, "taskId", "ait task schedule <taskId> --at <ISO date> | --auto | --clear");
|
|
477
|
+
const modes = [flags.at ? "--at" : null, flags.auto === true ? "--auto" : null, flags.clear === true ? "--clear" : null].filter(Boolean);
|
|
478
|
+
if (modes.length > 1) {
|
|
479
|
+
throw new CliError(`Use only one of --at, --auto, --clear (got ${modes.join(" and ")})`);
|
|
480
|
+
}
|
|
481
|
+
let publishAt = null;
|
|
482
|
+
if (flags.auto === true) {
|
|
483
|
+
publishAt = "auto";
|
|
484
|
+
} else if (flags.clear !== true) {
|
|
485
|
+
if (!flags.at) {
|
|
486
|
+
throw new CliError("task schedule requires --at <ISO date>, --auto, or --clear");
|
|
487
|
+
}
|
|
488
|
+
const at = new Date(flags.at);
|
|
489
|
+
if (isNaN(at.getTime())) throw new CliError(`--at is not a valid date: ${flags.at}`);
|
|
490
|
+
publishAt = at.toISOString();
|
|
491
|
+
}
|
|
492
|
+
const workspaceId = await resolveWorkspace(ctx, flags);
|
|
493
|
+
return callTool(ctx, "schedule_task", { workspaceId, taskId, publishAt });
|
|
494
|
+
}
|
|
495
|
+
|
|
471
496
|
case "task add-content": {
|
|
472
497
|
const taskId = requirePositional(rest, "taskId", "ait task add-content <taskId> --body <text>");
|
|
473
498
|
if (!flags.body && !flags.media) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "automate-it",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI for Automate It — AI agents create content tasks, submit them through a human review gate, and publish everywhere. Speaks the Automate It MCP server; zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"node": ">=18"
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
|
-
"homepage": "https://
|
|
16
|
+
"homepage": "https://automate.it.com/agents",
|
|
17
17
|
"keywords": [
|
|
18
18
|
"automate-it",
|
|
19
19
|
"mcp",
|