@sente-labs/cli 0.3.0 → 0.4.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/dist/client.js +1 -1
- package/dist/commands/schedule.js +188 -0
- package/dist/commands/schedule.js.map +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/skill/SKILL.md +4 -0
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerScheduleCommands = registerScheduleCommands;
|
|
4
|
+
const client_1 = require("../client");
|
|
5
|
+
const output_1 = require("../output");
|
|
6
|
+
/**
|
|
7
|
+
* Parse a human-friendly interval string ("30m", "1h", "2d", "1w") into the
|
|
8
|
+
* gateway's `{intervalValue, intervalUnit}` shape. Accepts bare units too:
|
|
9
|
+
* "minute(s)", "hour(s)", "day(s)", "week(s)" -- always lower-case.
|
|
10
|
+
*/
|
|
11
|
+
function parseInterval(raw) {
|
|
12
|
+
const trimmed = raw.trim().toLowerCase();
|
|
13
|
+
// Shorthand first: "30m", "1h", "2d", "1w".
|
|
14
|
+
const shortMatch = trimmed.match(/^(\d+)\s*([smhdw])$/);
|
|
15
|
+
if (shortMatch) {
|
|
16
|
+
const value = parseInt(shortMatch[1], 10);
|
|
17
|
+
const u = shortMatch[2];
|
|
18
|
+
const unit = u === 'm' ? 'minutes' : u === 'h' ? 'hours' : u === 'd' ? 'days' : u === 'w' ? 'weeks' : null;
|
|
19
|
+
if (unit && value > 0)
|
|
20
|
+
return { intervalValue: value, intervalUnit: unit };
|
|
21
|
+
}
|
|
22
|
+
// Long form: "5 minutes", "1 hour", "3 days", "2 weeks".
|
|
23
|
+
const longMatch = trimmed.match(/^(\d+)\s*(minute|minutes|hour|hours|day|days|week|weeks)$/);
|
|
24
|
+
if (longMatch) {
|
|
25
|
+
const value = parseInt(longMatch[1], 10);
|
|
26
|
+
const u = longMatch[2];
|
|
27
|
+
const unit = u.startsWith('minute') ? 'minutes' : u.startsWith('hour') ? 'hours' : u.startsWith('day') ? 'days' : 'weeks';
|
|
28
|
+
if (value > 0)
|
|
29
|
+
return { intervalValue: value, intervalUnit: unit };
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`Could not parse interval "${raw}". Use e.g. "30m", "1h", "2d", "1w" or "5 minutes", "1 hour".`);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Translate CLI flags into the gateway's schedule body. Exactly one of
|
|
35
|
+
* `--interval`, `--cron`, `--at` must be set.
|
|
36
|
+
*/
|
|
37
|
+
function buildScheduleBody(opts) {
|
|
38
|
+
const provided = [opts.interval, opts.cron, opts.at].filter(Boolean).length;
|
|
39
|
+
if (provided === 0) {
|
|
40
|
+
throw new Error('Pass exactly one of --interval, --cron, or --at.');
|
|
41
|
+
}
|
|
42
|
+
if (provided > 1) {
|
|
43
|
+
throw new Error('--interval, --cron, and --at are mutually exclusive.');
|
|
44
|
+
}
|
|
45
|
+
const enabled = !opts.disabled;
|
|
46
|
+
const timezone = opts.timezone ?? 'UTC';
|
|
47
|
+
if (opts.interval) {
|
|
48
|
+
const { intervalValue, intervalUnit } = parseInterval(opts.interval);
|
|
49
|
+
return { scheduleType: 'interval', intervalValue, intervalUnit, timezone, enabled };
|
|
50
|
+
}
|
|
51
|
+
if (opts.cron) {
|
|
52
|
+
return { scheduleType: 'cron', cronExpression: opts.cron, timezone, enabled };
|
|
53
|
+
}
|
|
54
|
+
// one_time
|
|
55
|
+
const date = new Date(opts.at);
|
|
56
|
+
if (Number.isNaN(date.getTime())) {
|
|
57
|
+
throw new Error(`Could not parse --at "${opts.at}". Use ISO 8601 (e.g. "2026-12-31T17:00:00Z").`);
|
|
58
|
+
}
|
|
59
|
+
return { scheduleType: 'one_time', scheduledAt: date.toISOString(), timezone, enabled };
|
|
60
|
+
}
|
|
61
|
+
function describeSchedule(s) {
|
|
62
|
+
switch (s.scheduleType) {
|
|
63
|
+
case 'interval':
|
|
64
|
+
return `every ${s.intervalValue} ${s.intervalUnit}`;
|
|
65
|
+
case 'cron':
|
|
66
|
+
return `cron "${s.cronExpression}" (${s.timezone})`;
|
|
67
|
+
case 'one_time':
|
|
68
|
+
return `once at ${s.scheduledAt}`;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function registerScheduleCommands(program, globalOpts) {
|
|
72
|
+
const schedule = program.command('schedule').description('Task schedule commands');
|
|
73
|
+
schedule
|
|
74
|
+
.command('set')
|
|
75
|
+
.description('Create or replace a task schedule')
|
|
76
|
+
.argument('<taskId>', 'task id (or shortId)')
|
|
77
|
+
.option('--interval <duration>', 'recurring interval (e.g. 30m, 1h, 2d, 1w)')
|
|
78
|
+
.option('--cron <expression>', 'cron expression (e.g. "0 */2 * * *")')
|
|
79
|
+
.option('--at <iso>', 'run once at this ISO 8601 datetime')
|
|
80
|
+
.option('--timezone <tz>', 'IANA timezone for cron schedules', 'UTC')
|
|
81
|
+
.option('--disabled', 'create the schedule but leave it disabled')
|
|
82
|
+
.action(async (taskId, cmdOpts) => {
|
|
83
|
+
const opts = globalOpts();
|
|
84
|
+
try {
|
|
85
|
+
const body = buildScheduleBody(cmdOpts);
|
|
86
|
+
const client = new client_1.GatewayClient();
|
|
87
|
+
// POST creates, PUT updates. Try create first; on 409 fall back to update.
|
|
88
|
+
let res;
|
|
89
|
+
try {
|
|
90
|
+
res = await client.request(`/api/tasks/${taskId}/schedule`, {
|
|
91
|
+
method: 'POST',
|
|
92
|
+
body,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
catch (err) {
|
|
96
|
+
if (err instanceof client_1.ApiError && err.status === 409) {
|
|
97
|
+
res = await client.request(`/api/tasks/${taskId}/schedule`, {
|
|
98
|
+
method: 'PUT',
|
|
99
|
+
body,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
throw err;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
(0, output_1.printSuccess)({ schedule: res.schedule }, () => {
|
|
107
|
+
const s = res.schedule;
|
|
108
|
+
process.stdout.write(`Schedule ${s.id}: ${describeSchedule(s)}${s.enabled ? '' : ' (disabled)'}\n`);
|
|
109
|
+
if (s.nextRunAt) {
|
|
110
|
+
process.stdout.write(`Next run: ${s.nextRunAt}\n`);
|
|
111
|
+
}
|
|
112
|
+
}, opts);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
process.exit((0, output_1.printError)(err, opts));
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
schedule
|
|
119
|
+
.command('show')
|
|
120
|
+
.description('Show the schedule attached to a task (if any)')
|
|
121
|
+
.argument('<taskId>', 'task id')
|
|
122
|
+
.action(async (taskId) => {
|
|
123
|
+
const opts = globalOpts();
|
|
124
|
+
try {
|
|
125
|
+
const client = new client_1.GatewayClient();
|
|
126
|
+
const res = await client.request(`/api/tasks/${taskId}/schedule`);
|
|
127
|
+
(0, output_1.printSuccess)({ schedule: res.schedule }, () => {
|
|
128
|
+
if (!res.schedule) {
|
|
129
|
+
process.stdout.write('No schedule attached.\n');
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const s = res.schedule;
|
|
133
|
+
process.stdout.write(`${describeSchedule(s)}${s.enabled ? '' : ' (disabled)'}\n`);
|
|
134
|
+
if (s.nextRunAt)
|
|
135
|
+
process.stdout.write(`Next run: ${s.nextRunAt}\n`);
|
|
136
|
+
if (s.lastRunAt) {
|
|
137
|
+
process.stdout.write(`Last run: ${s.lastRunAt}${s.lastRunStatus ? ` (${s.lastRunStatus})` : ''}\n`);
|
|
138
|
+
}
|
|
139
|
+
}, opts);
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
process.exit((0, output_1.printError)(err, opts));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
schedule
|
|
146
|
+
.command('remove')
|
|
147
|
+
.description('Remove the schedule attached to a task')
|
|
148
|
+
.argument('<taskId>', 'task id')
|
|
149
|
+
.action(async (taskId) => {
|
|
150
|
+
const opts = globalOpts();
|
|
151
|
+
try {
|
|
152
|
+
const client = new client_1.GatewayClient();
|
|
153
|
+
await client.request(`/api/tasks/${taskId}/schedule`, { method: 'DELETE' });
|
|
154
|
+
(0, output_1.printSuccess)({ ok: true, taskId }, `Removed schedule from task ${taskId}`, opts);
|
|
155
|
+
}
|
|
156
|
+
catch (err) {
|
|
157
|
+
process.exit((0, output_1.printError)(err, opts));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
schedule
|
|
161
|
+
.command('list')
|
|
162
|
+
.description('List scheduled tasks in the current organization')
|
|
163
|
+
.option('--limit <n>', 'max rows (default 10, max 50)', '10')
|
|
164
|
+
.action(async (cmdOpts) => {
|
|
165
|
+
const opts = globalOpts();
|
|
166
|
+
try {
|
|
167
|
+
const limit = Math.max(1, Math.min(50, parseInt(cmdOpts.limit, 10) || 10));
|
|
168
|
+
const client = new client_1.GatewayClient();
|
|
169
|
+
const res = await client.request('/api/tasks/scheduled', {
|
|
170
|
+
query: { limit },
|
|
171
|
+
});
|
|
172
|
+
(0, output_1.printSuccess)({ total: res.total, schedules: res.schedules }, () => {
|
|
173
|
+
if (res.schedules.length === 0) {
|
|
174
|
+
process.stdout.write('No scheduled tasks.\n');
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
for (const s of res.schedules) {
|
|
178
|
+
const line = `${s.taskId} ${describeSchedule(s.schedule).padEnd(28)} ${s.projectName} / ${s.workflowName} / ${s.taskName}`;
|
|
179
|
+
process.stdout.write(`${line}\n`);
|
|
180
|
+
}
|
|
181
|
+
}, opts);
|
|
182
|
+
}
|
|
183
|
+
catch (err) {
|
|
184
|
+
process.exit((0, output_1.printError)(err, opts));
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=schedule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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P,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const project_1 = require("./commands/project");
|
|
|
8
8
|
const task_1 = require("./commands/task");
|
|
9
9
|
const init_1 = require("./commands/init");
|
|
10
10
|
const secret_1 = require("./commands/secret");
|
|
11
|
+
const schedule_1 = require("./commands/schedule");
|
|
11
12
|
const autoupdate_1 = require("./skill/autoupdate");
|
|
12
13
|
// Silently refresh the installed Claude Code skill to match the running CLI.
|
|
13
14
|
// Synchronous + cheap (a file stat + at most one small write). No-op if the
|
|
@@ -21,7 +22,7 @@ const program = new commander_1.Command();
|
|
|
21
22
|
program
|
|
22
23
|
.name('sente')
|
|
23
24
|
.description('Sente CLI -- manage QA tests from the command line and Claude Code')
|
|
24
|
-
.version('0.
|
|
25
|
+
.version('0.4.0')
|
|
25
26
|
.option('--json', 'Emit machine-readable JSON instead of human output');
|
|
26
27
|
/**
|
|
27
28
|
* Global options aren't auto-propagated to subcommands by Commander, so we
|
|
@@ -37,6 +38,7 @@ const globalOpts = () => program.opts();
|
|
|
37
38
|
(0, project_1.registerSyncCommand)(program, globalOpts);
|
|
38
39
|
(0, task_1.registerTaskCommands)(program, globalOpts);
|
|
39
40
|
(0, secret_1.registerSecretCommands)(program, globalOpts);
|
|
41
|
+
(0, schedule_1.registerScheduleCommands)(program, globalOpts);
|
|
40
42
|
program.parseAsync(process.argv).catch((err) => {
|
|
41
43
|
// Defensive: command actions handle their own errors. This only catches
|
|
42
44
|
// setup-time errors (e.g. unknown subcommand).
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,4CAAwD;AACxD,8CAA0D;AAC1D,gDAAkF;AAClF,0CAAuD;AACvD,0CAAmF;AACnF,8CAA2D;AAC3D,mDAA+E;AAG/E,6EAA6E;AAC7E,4EAA4E;AAC5E,0EAA0E;AAC1E,IAAA,mCAAsB,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OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,oEAAoE,CAAC;KACjF,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,QAAQ,EAAE,oDAAoD,CAAC,CAAC;AAE1E;;;;GAIG;AACH,MAAM,UAAU,GAAG,GAAe,EAAE,CAAC,OAAO,CAAC,IAAI,EAAc,CAAC;AAEhE,IAAA,4BAAoB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC1C,IAAA,8BAAqB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC3C,IAAA,0BAAmB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,IAAA,kCAA2B,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACjD,IAAA,iCAAuB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC7C,IAAA,6BAAmB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,IAAA,2BAAoB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC1C,IAAA,+BAAsB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAC5C,IAAA,mCAAwB,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AAE9C,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAC7C,wEAAwE;IACxE,+CAA+C;IAC/C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,OAAO,IAAI,GAAG,IAAI,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/skill/SKILL.md
CHANGED
|
@@ -111,6 +111,10 @@ The top-level `--instruction` is consulted by the agent when step text is ambigu
|
|
|
111
111
|
| `sente secret create --name <key> --project <projectId> [--target-url <url>]` | Create a secret. Hidden prompt for value, or `--value-stdin` for piping |
|
|
112
112
|
| `sente secret link <secretId> <projectId>` / `unlink ...` | Link/unlink an existing secret to a project |
|
|
113
113
|
| `sente secret delete <secretId>` | Delete a secret (removes from all linked projects) |
|
|
114
|
+
| `sente schedule set <taskId> --interval 1h \| --cron "..." \| --at <iso>` | Attach a schedule to a task (only one of the three) |
|
|
115
|
+
| `sente schedule show <taskId>` | Show a task's schedule (if any) |
|
|
116
|
+
| `sente schedule remove <taskId>` | Remove a task's schedule |
|
|
117
|
+
| `sente schedule list --json` | List scheduled tasks in the current org |
|
|
114
118
|
|
|
115
119
|
Use `--json` for every CLI call — outputs are stable JSON shaped for programmatic consumption.
|
|
116
120
|
|
package/package.json
CHANGED