@formigio/fazemos-cli 0.10.40 → 0.10.41
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/autostart.d.ts +49 -0
- package/dist/autostart.js +364 -0
- package/dist/autostart.js.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTON-AUTOSTART — Action→Pipeline Auto-Start: CLI command helpers.
|
|
3
|
+
*
|
|
4
|
+
* Exports `registerAutoStartCommands(program)` which wires the following commands
|
|
5
|
+
* into the root Commander program (mirrors the trigger/wake group pattern):
|
|
6
|
+
*
|
|
7
|
+
* fazemos autostart list
|
|
8
|
+
* → GET /api/control-plane/autostart?project_id=<id>
|
|
9
|
+
* Reads the allow-listed (action_id, template_id, enabled) bindings.
|
|
10
|
+
*
|
|
11
|
+
* fazemos autostart status [--json]
|
|
12
|
+
* → GET /api/control-plane/autostart?project_id=<id>
|
|
13
|
+
* bindings + recent action_pipeline_fires (window_key, fire_status,
|
|
14
|
+
* pipeline_instance_id, last_error).
|
|
15
|
+
*
|
|
16
|
+
* fazemos autostart disable --action <action-id> [--until <iso>] [--reason <text>]
|
|
17
|
+
* → POST /api/control-plane/autostart/disable
|
|
18
|
+
* { action: "disable", project_id, worksheet_action_id, reason, until? }
|
|
19
|
+
* Upserts an action_autostart_disables row; timed (--until) or indefinite.
|
|
20
|
+
*
|
|
21
|
+
* fazemos autostart enable --action <action-id>
|
|
22
|
+
* → POST /api/control-plane/autostart/disable
|
|
23
|
+
* { action: "enable", project_id, worksheet_action_id }
|
|
24
|
+
* Deletes the disable row (re-enables the action's auto-start).
|
|
25
|
+
*
|
|
26
|
+
* Auth: disable/enable require admin/owner (same as trigger/wake).
|
|
27
|
+
* list/status require any active org member.
|
|
28
|
+
* Scope: project-scoped reads (project_id query param); writes are org+project.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: `fire-now` is deliberately NOT offered in V1 — manual pipeline start is
|
|
31
|
+
* already `fazemos pl create`. A fire-now re-drive of a failed row is V2.
|
|
32
|
+
*
|
|
33
|
+
* Spec: AUTON-AUTOSTART-tech-spec.md §11 (R12, AC14)
|
|
34
|
+
* Manifest: cli_commands (fazemos autostart list/status/disable/enable)
|
|
35
|
+
*
|
|
36
|
+
* Key differences from trigger.ts:
|
|
37
|
+
* - No cadence dimension (action auto-start is per-action, per-window)
|
|
38
|
+
* - No fire-now command (V1 spec explicitly excludes it)
|
|
39
|
+
* - Bindings keyed by action_id + template_id (not role + cadence)
|
|
40
|
+
* - disable/enable keyed by --action <worksheet_action_id> (not --role + --cadence)
|
|
41
|
+
* - Endpoint: /api/control-plane/autostart and /api/control-plane/autostart/disable
|
|
42
|
+
*/
|
|
43
|
+
import type { Command } from 'commander';
|
|
44
|
+
/**
|
|
45
|
+
* Register `autostart list`, `autostart status`, `autostart disable`, and
|
|
46
|
+
* `autostart enable` into the root Commander program. Called from index.ts
|
|
47
|
+
* alongside registerTriggerCommands and registerWakeCommands.
|
|
48
|
+
*/
|
|
49
|
+
export declare function registerAutoStartCommands(program: Command): void;
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AUTON-AUTOSTART — Action→Pipeline Auto-Start: CLI command helpers.
|
|
3
|
+
*
|
|
4
|
+
* Exports `registerAutoStartCommands(program)` which wires the following commands
|
|
5
|
+
* into the root Commander program (mirrors the trigger/wake group pattern):
|
|
6
|
+
*
|
|
7
|
+
* fazemos autostart list
|
|
8
|
+
* → GET /api/control-plane/autostart?project_id=<id>
|
|
9
|
+
* Reads the allow-listed (action_id, template_id, enabled) bindings.
|
|
10
|
+
*
|
|
11
|
+
* fazemos autostart status [--json]
|
|
12
|
+
* → GET /api/control-plane/autostart?project_id=<id>
|
|
13
|
+
* bindings + recent action_pipeline_fires (window_key, fire_status,
|
|
14
|
+
* pipeline_instance_id, last_error).
|
|
15
|
+
*
|
|
16
|
+
* fazemos autostart disable --action <action-id> [--until <iso>] [--reason <text>]
|
|
17
|
+
* → POST /api/control-plane/autostart/disable
|
|
18
|
+
* { action: "disable", project_id, worksheet_action_id, reason, until? }
|
|
19
|
+
* Upserts an action_autostart_disables row; timed (--until) or indefinite.
|
|
20
|
+
*
|
|
21
|
+
* fazemos autostart enable --action <action-id>
|
|
22
|
+
* → POST /api/control-plane/autostart/disable
|
|
23
|
+
* { action: "enable", project_id, worksheet_action_id }
|
|
24
|
+
* Deletes the disable row (re-enables the action's auto-start).
|
|
25
|
+
*
|
|
26
|
+
* Auth: disable/enable require admin/owner (same as trigger/wake).
|
|
27
|
+
* list/status require any active org member.
|
|
28
|
+
* Scope: project-scoped reads (project_id query param); writes are org+project.
|
|
29
|
+
*
|
|
30
|
+
* NOTE: `fire-now` is deliberately NOT offered in V1 — manual pipeline start is
|
|
31
|
+
* already `fazemos pl create`. A fire-now re-drive of a failed row is V2.
|
|
32
|
+
*
|
|
33
|
+
* Spec: AUTON-AUTOSTART-tech-spec.md §11 (R12, AC14)
|
|
34
|
+
* Manifest: cli_commands (fazemos autostart list/status/disable/enable)
|
|
35
|
+
*
|
|
36
|
+
* Key differences from trigger.ts:
|
|
37
|
+
* - No cadence dimension (action auto-start is per-action, per-window)
|
|
38
|
+
* - No fire-now command (V1 spec explicitly excludes it)
|
|
39
|
+
* - Bindings keyed by action_id + template_id (not role + cadence)
|
|
40
|
+
* - disable/enable keyed by --action <worksheet_action_id> (not --role + --cadence)
|
|
41
|
+
* - Endpoint: /api/control-plane/autostart and /api/control-plane/autostart/disable
|
|
42
|
+
*/
|
|
43
|
+
import chalk from 'chalk';
|
|
44
|
+
import { api } from './api.js';
|
|
45
|
+
import { getActiveProjectId } from './config.js';
|
|
46
|
+
// ── Helpers ────────────────────────────────────────────────────────────────────
|
|
47
|
+
/**
|
|
48
|
+
* Validate an ISO 8601 timestamp string (used for --until on disable).
|
|
49
|
+
* The API is strict — malformed timestamps produce a 400.
|
|
50
|
+
*/
|
|
51
|
+
function validateIsoTimestamp(value) {
|
|
52
|
+
const d = new Date(value);
|
|
53
|
+
if (isNaN(d.getTime())) {
|
|
54
|
+
throw new Error(`--until must be a valid ISO 8601 timestamp (e.g. 2026-12-31T23:59:59Z), got: ${value}`);
|
|
55
|
+
}
|
|
56
|
+
return value;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Human-readable fire_status label with colour.
|
|
60
|
+
* Mirrors the action_pipeline_fires.fire_status CHECK values:
|
|
61
|
+
* 'claimed' → in progress; 'fired' → created + launched; 'failed' → errored.
|
|
62
|
+
*/
|
|
63
|
+
function fireStatusLabel(status) {
|
|
64
|
+
switch (status) {
|
|
65
|
+
case 'fired':
|
|
66
|
+
return chalk.green(status);
|
|
67
|
+
case 'failed':
|
|
68
|
+
return chalk.red(status);
|
|
69
|
+
case 'claimed':
|
|
70
|
+
return chalk.cyan(status);
|
|
71
|
+
default:
|
|
72
|
+
return chalk.dim(status);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
// ── Command registration ───────────────────────────────────────────────────────
|
|
76
|
+
/**
|
|
77
|
+
* Register `autostart list`, `autostart status`, `autostart disable`, and
|
|
78
|
+
* `autostart enable` into the root Commander program. Called from index.ts
|
|
79
|
+
* alongside registerTriggerCommands and registerWakeCommands.
|
|
80
|
+
*/
|
|
81
|
+
export function registerAutoStartCommands(program) {
|
|
82
|
+
// ── `fazemos autostart` ──────────────────────────────────────────────────────
|
|
83
|
+
//
|
|
84
|
+
// Parent command hosting sub-commands: list, status, disable, enable.
|
|
85
|
+
// The parent itself has no action (sub-commands always required).
|
|
86
|
+
const autoStartCmd = program
|
|
87
|
+
.command('autostart')
|
|
88
|
+
.description('Inspect and operate the action→pipeline auto-start control plane (AUTONOMY).\n\n' +
|
|
89
|
+
'Sub-commands:\n' +
|
|
90
|
+
' list List the allow-listed (action, template) auto-start bindings\n' +
|
|
91
|
+
' status Show bindings + recent fire history (last 50 entries)\n' +
|
|
92
|
+
' disable Disable auto-start for an action (timed or indefinite) (admin/owner)\n' +
|
|
93
|
+
' enable Re-enable a previously disabled action auto-start (admin/owner)\n\n' +
|
|
94
|
+
'list/status are readable by any active org member.\n' +
|
|
95
|
+
'disable/enable require admin or owner role.\n' +
|
|
96
|
+
'All operations are project-scoped (uses active project or --project override).\n\n' +
|
|
97
|
+
'The auto-start engine is GATED OFF by default (AUTOSTART_ALLOWLIST empty).\n' +
|
|
98
|
+
'An empty bindings list means the engine is dormant — this is the safe\n' +
|
|
99
|
+
'default state. The ENABLE flip is a separate founder step.');
|
|
100
|
+
// ── `fazemos autostart list` ──────────────────────────────────────────────────
|
|
101
|
+
//
|
|
102
|
+
// GET /api/control-plane/autostart?project_id=<id>
|
|
103
|
+
//
|
|
104
|
+
// Prints the allow-listed (action_id, template_id) bindings + enabled state.
|
|
105
|
+
// No --json flag needed (list is simple enough for human output only).
|
|
106
|
+
//
|
|
107
|
+
// Usage:
|
|
108
|
+
// fazemos autostart list
|
|
109
|
+
autoStartCmd
|
|
110
|
+
.command('list')
|
|
111
|
+
.description('List the configured auto-start bindings for the active project.\n\n' +
|
|
112
|
+
'Shows each allow-listed (action_id, template_id) pair and whether it is\n' +
|
|
113
|
+
'currently enabled. The binding list is driven by AUTOSTART_ALLOWLIST on\n' +
|
|
114
|
+
'the API; the enabled state reflects any operator disable in effect.\n\n' +
|
|
115
|
+
'An empty list means the engine is dormant (default safe state).\n\n' +
|
|
116
|
+
'Readable by any active org member.')
|
|
117
|
+
.action(async () => {
|
|
118
|
+
try {
|
|
119
|
+
const projectId = getActiveProjectId();
|
|
120
|
+
if (!projectId) {
|
|
121
|
+
throw new Error('No active project. Run `fazemos projects switch <slug>` first.');
|
|
122
|
+
}
|
|
123
|
+
const data = await api('GET', `/api/control-plane/autostart?project_id=${encodeURIComponent(projectId)}`, undefined, { noProjectHeader: true });
|
|
124
|
+
const { bindings } = data;
|
|
125
|
+
if (bindings.length === 0) {
|
|
126
|
+
console.log(chalk.yellow('No auto-start bindings configured (AUTOSTART_ALLOWLIST is empty or not set).\n' +
|
|
127
|
+
'The engine is dormant — this is the default safe state.'));
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
console.log(chalk.bold(`Auto-start bindings (${bindings.length} entries):`));
|
|
131
|
+
console.log();
|
|
132
|
+
for (const binding of bindings) {
|
|
133
|
+
const enabledLabel = binding.enabled
|
|
134
|
+
? chalk.green('enabled')
|
|
135
|
+
: chalk.red('disabled');
|
|
136
|
+
console.log(` ${chalk.cyan(binding.action_id)} ${enabledLabel}`);
|
|
137
|
+
console.log(` template: ${chalk.dim(binding.template_id)}`);
|
|
138
|
+
console.log();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
catch (err) {
|
|
142
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
143
|
+
console.error(chalk.red(`Error: ${msg}`));
|
|
144
|
+
process.exit(1);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
// ── `fazemos autostart status` ────────────────────────────────────────────────
|
|
148
|
+
//
|
|
149
|
+
// GET /api/control-plane/autostart?project_id=<id>
|
|
150
|
+
//
|
|
151
|
+
// bindings + recent action_pipeline_fires (window_key, fire_status,
|
|
152
|
+
// pipeline_instance_id, last_error, claimed_at, fired_at, failed_at).
|
|
153
|
+
// Fires capped at 50 most recent entries (ordered by claimed_at DESC) by the API.
|
|
154
|
+
//
|
|
155
|
+
// Usage:
|
|
156
|
+
// fazemos autostart status
|
|
157
|
+
// fazemos autostart status --json
|
|
158
|
+
autoStartCmd
|
|
159
|
+
.command('status')
|
|
160
|
+
.description('Show auto-start bindings and recent fire history for the active project.\n\n' +
|
|
161
|
+
'Prints the allow-listed (action, template) bindings alongside the last 50\n' +
|
|
162
|
+
'action_pipeline_fire records (window_key, fire_status, pipeline_instance_id).\n\n' +
|
|
163
|
+
'fire_status values:\n' +
|
|
164
|
+
' claimed — claim inserted; pipeline create + launch in progress\n' +
|
|
165
|
+
' fired — pipeline instance created and launched successfully\n' +
|
|
166
|
+
' failed — the create/launch attempt failed (see last_error)\n\n' +
|
|
167
|
+
'Note: suppressed fires do NOT appear in the ledger (the claim is deleted on\n' +
|
|
168
|
+
'suppression; `autostart_suppressed` is logged as an agent_event instead).\n\n' +
|
|
169
|
+
'Readable by any active org member. Use --json for machine-readable output.')
|
|
170
|
+
.option('--json', 'output machine-readable JSON')
|
|
171
|
+
.action(async (opts) => {
|
|
172
|
+
try {
|
|
173
|
+
const projectId = getActiveProjectId();
|
|
174
|
+
if (!projectId) {
|
|
175
|
+
throw new Error('No active project. Run `fazemos projects switch <slug>` first.');
|
|
176
|
+
}
|
|
177
|
+
const data = await api('GET', `/api/control-plane/autostart?project_id=${encodeURIComponent(projectId)}`, undefined, { noProjectHeader: true });
|
|
178
|
+
if (opts.json) {
|
|
179
|
+
console.log(JSON.stringify(data, null, 2));
|
|
180
|
+
return;
|
|
181
|
+
}
|
|
182
|
+
const { bindings, fires } = data;
|
|
183
|
+
// ── Bindings ──────────────────────────────────────────────────────────
|
|
184
|
+
if (bindings.length === 0) {
|
|
185
|
+
console.log(chalk.yellow('No auto-start bindings configured (AUTOSTART_ALLOWLIST is empty or not set).'));
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
console.log(chalk.bold(`Auto-start bindings (${bindings.length} entries):`));
|
|
189
|
+
console.log();
|
|
190
|
+
for (const binding of bindings) {
|
|
191
|
+
const enabledLabel = binding.enabled
|
|
192
|
+
? chalk.green('enabled')
|
|
193
|
+
: chalk.red('disabled');
|
|
194
|
+
console.log(` ${chalk.cyan(binding.action_id)} ${enabledLabel}`);
|
|
195
|
+
console.log(` template: ${chalk.dim(binding.template_id)}`);
|
|
196
|
+
}
|
|
197
|
+
console.log();
|
|
198
|
+
}
|
|
199
|
+
// ── Recent fires ──────────────────────────────────────────────────────
|
|
200
|
+
if (fires.length === 0) {
|
|
201
|
+
console.log(chalk.dim('No recent auto-start fires.'));
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
console.log(chalk.bold(`Recent auto-start fires (${fires.length}):`));
|
|
205
|
+
console.log();
|
|
206
|
+
for (const fire of fires) {
|
|
207
|
+
const statusLabel = fireStatusLabel(fire.fire_status);
|
|
208
|
+
console.log(` ${chalk.cyan(fire.worksheet_action_id.slice(0, 8) + '…')} window: ${fire.window_key} ${statusLabel}`);
|
|
209
|
+
if (fire.pipeline_instance_id) {
|
|
210
|
+
console.log(` pipeline: ${chalk.dim(fire.pipeline_instance_id)}`);
|
|
211
|
+
}
|
|
212
|
+
if (fire.template_id) {
|
|
213
|
+
console.log(` template: ${chalk.dim(fire.template_id)}`);
|
|
214
|
+
}
|
|
215
|
+
if (fire.last_error) {
|
|
216
|
+
console.log(` error: ${chalk.red(fire.last_error)}`);
|
|
217
|
+
}
|
|
218
|
+
console.log(` claimed: ${new Date(fire.claimed_at).toLocaleString()}`);
|
|
219
|
+
if (fire.fired_at) {
|
|
220
|
+
console.log(` fired: ${new Date(fire.fired_at).toLocaleString()}`);
|
|
221
|
+
}
|
|
222
|
+
if (fire.failed_at) {
|
|
223
|
+
console.log(` failed: ${chalk.red(new Date(fire.failed_at).toLocaleString())}`);
|
|
224
|
+
}
|
|
225
|
+
console.log(` id: ${chalk.dim(fire.id)}`);
|
|
226
|
+
console.log();
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
catch (err) {
|
|
230
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
231
|
+
console.error(chalk.red(`Error: ${msg}`));
|
|
232
|
+
process.exit(1);
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
// ── `fazemos autostart disable` ───────────────────────────────────────────────
|
|
236
|
+
//
|
|
237
|
+
// POST /api/control-plane/autostart/disable { action: "disable", ... }
|
|
238
|
+
//
|
|
239
|
+
// Upserts an action_autostart_disables row the sweep consults before claiming.
|
|
240
|
+
// Active disable → action not eligible → no claim, no fire.
|
|
241
|
+
// --until <iso>: timed disable; omit for indefinite until `fazemos autostart enable`.
|
|
242
|
+
//
|
|
243
|
+
// Note: does NOT delete the action from the AUTOSTART_ALLOWLIST (that is an
|
|
244
|
+
// SSM / deployment-level change). The disable row is the operator kill switch.
|
|
245
|
+
//
|
|
246
|
+
// Usage:
|
|
247
|
+
// fazemos autostart disable --action <action-id> --reason "Pausing during Q2 freeze"
|
|
248
|
+
// fazemos autostart disable --action <action-id> --until 2026-12-31T23:59:59Z --reason "Q2 freeze"
|
|
249
|
+
autoStartCmd
|
|
250
|
+
.command('disable')
|
|
251
|
+
.description('Disable auto-start for an action (admin/owner only).\n\n' +
|
|
252
|
+
'Upserts a disable record for the given action. While disabled, the auto-start\n' +
|
|
253
|
+
'sweep skips this action — no claim, no fire. The action\'s readiness state\n' +
|
|
254
|
+
'(auto_start=\'ready\') is preserved; re-enabling allows the next sweep to fire.\n\n' +
|
|
255
|
+
' (no --until) Indefinite disable — remains until `fazemos autostart enable`\n' +
|
|
256
|
+
' --until <iso> Timed disable — auto-expires at the given UTC timestamp\n\n' +
|
|
257
|
+
'Requires admin or owner role. --reason is mandatory (audit trail).')
|
|
258
|
+
.requiredOption('--action <id>', 'worksheet_action_id (UUID) to disable')
|
|
259
|
+
.requiredOption('--reason <text>', 'reason for the disable (required for audit trail)')
|
|
260
|
+
.option('--until <iso>', 'ISO 8601 timestamp when the disable expires (omit for indefinite)')
|
|
261
|
+
.option('--json', 'output machine-readable JSON')
|
|
262
|
+
.action(async (opts) => {
|
|
263
|
+
try {
|
|
264
|
+
const projectId = getActiveProjectId();
|
|
265
|
+
if (!projectId) {
|
|
266
|
+
throw new Error('No active project. Run `fazemos projects switch <slug>` first.');
|
|
267
|
+
}
|
|
268
|
+
const body = {
|
|
269
|
+
action: 'disable',
|
|
270
|
+
project_id: projectId,
|
|
271
|
+
worksheet_action_id: opts.action.trim(),
|
|
272
|
+
reason: opts.reason,
|
|
273
|
+
};
|
|
274
|
+
if (opts.until !== undefined) {
|
|
275
|
+
body.until = validateIsoTimestamp(opts.until);
|
|
276
|
+
}
|
|
277
|
+
const data = await api('POST', '/api/control-plane/autostart/disable', body, {
|
|
278
|
+
noProjectHeader: true,
|
|
279
|
+
});
|
|
280
|
+
if (opts.json) {
|
|
281
|
+
console.log(JSON.stringify(data, null, 2));
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
if (data.disabled) {
|
|
285
|
+
console.log(chalk.red(`⏸ Auto-start disabled for action: ${chalk.cyan(opts.action.trim())}`));
|
|
286
|
+
if (opts.until) {
|
|
287
|
+
console.log(` Expires at: ${new Date(opts.until).toLocaleString()}`);
|
|
288
|
+
}
|
|
289
|
+
else {
|
|
290
|
+
console.log(` Duration: indefinite (run \`fazemos autostart enable --action ${opts.action.trim()}\` to re-enable)`);
|
|
291
|
+
}
|
|
292
|
+
console.log(` Reason: ${opts.reason}`);
|
|
293
|
+
console.log();
|
|
294
|
+
console.log(chalk.dim(' The action remains in the AUTOSTART_ALLOWLIST.'));
|
|
295
|
+
console.log(chalk.dim(' The sweep will skip it until the disable is removed or expires.'));
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
console.log(chalk.yellow(`No change — auto-start was already disabled for action ${opts.action.trim()}.`));
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch (err) {
|
|
302
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
303
|
+
console.error(chalk.red(`Error: ${msg}`));
|
|
304
|
+
process.exit(1);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
// ── `fazemos autostart enable` ────────────────────────────────────────────────
|
|
308
|
+
//
|
|
309
|
+
// POST /api/control-plane/autostart/disable { action: "enable", ... }
|
|
310
|
+
//
|
|
311
|
+
// Deletes the action_autostart_disables row (re-enables the action's auto-start).
|
|
312
|
+
// After enable: the next sweep tick that finds this action ready + allow-listed
|
|
313
|
+
// will claim and fire as normal (subject to windowed-claim and live-pipeline checks).
|
|
314
|
+
//
|
|
315
|
+
// Usage:
|
|
316
|
+
// fazemos autostart enable --action <action-id>
|
|
317
|
+
autoStartCmd
|
|
318
|
+
.command('enable')
|
|
319
|
+
.description('Re-enable auto-start for a previously disabled action (admin/owner only).\n\n' +
|
|
320
|
+
'Deletes the disable record for the given action, allowing the next auto-start\n' +
|
|
321
|
+
'sweep tick to evaluate and fire it (subject to the windowed-claim and\n' +
|
|
322
|
+
'live-pipeline idempotency checks — one pipeline per window maximum).\n\n' +
|
|
323
|
+
'Requires admin or owner role.')
|
|
324
|
+
.requiredOption('--action <id>', 'worksheet_action_id (UUID) to re-enable')
|
|
325
|
+
.option('--reason <text>', 'reason for re-enabling (optional; recorded in audit trail)')
|
|
326
|
+
.option('--json', 'output machine-readable JSON')
|
|
327
|
+
.action(async (opts) => {
|
|
328
|
+
try {
|
|
329
|
+
const projectId = getActiveProjectId();
|
|
330
|
+
if (!projectId) {
|
|
331
|
+
throw new Error('No active project. Run `fazemos projects switch <slug>` first.');
|
|
332
|
+
}
|
|
333
|
+
const body = {
|
|
334
|
+
action: 'enable',
|
|
335
|
+
project_id: projectId,
|
|
336
|
+
worksheet_action_id: opts.action.trim(),
|
|
337
|
+
};
|
|
338
|
+
if (opts.reason !== undefined) {
|
|
339
|
+
body.reason = opts.reason;
|
|
340
|
+
}
|
|
341
|
+
const data = await api('POST', '/api/control-plane/autostart/disable', body, {
|
|
342
|
+
noProjectHeader: true,
|
|
343
|
+
});
|
|
344
|
+
if (opts.json) {
|
|
345
|
+
console.log(JSON.stringify(data, null, 2));
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
if (data.enabled) {
|
|
349
|
+
console.log(chalk.green(`▶ Auto-start enabled for action: ${chalk.cyan(opts.action.trim())}`));
|
|
350
|
+
console.log(` The next sweep tick (≤5 min) will evaluate and fire this action`);
|
|
351
|
+
console.log(` if it is still ready, allow-listed, and has no live pipeline.`);
|
|
352
|
+
}
|
|
353
|
+
else {
|
|
354
|
+
console.log(chalk.dim(`No-op — auto-start was not disabled for action ${opts.action.trim()}.`));
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
catch (err) {
|
|
358
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
359
|
+
console.error(chalk.red(`Error: ${msg}`));
|
|
360
|
+
process.exit(1);
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
//# sourceMappingURL=autostart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autostart.js","sourceRoot":"","sources":["../src/autostart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAoCjD,kFAAkF;AAElF;;;GAGG;AACH,SAAS,oBAAoB,CAAC,KAAa;IACzC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,IAAI,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,gFAAgF,KAAK,EAAE,CACxF,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,eAAe,CAAC,MAAc;IACrC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC3B,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5B;YACE,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,kFAAkF;AAElF;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CAAC,OAAgB;IAExD,gF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AAC,OAAO,EAAE,CAAC;gBACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,qCAAqC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;gBAChG,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;gBACjF,OAAO,CAAC,GAAG,CAAC,iEAAiE,CAAC,CAAC;YACjF,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kDAAkD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;YAClG,CAAC;QACH,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC7D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC;YAC1C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import { registerBudgetCommands } from './budget.js';
|
|
|
21
21
|
import { registerTriggerCommands } from './trigger.js';
|
|
22
22
|
import { registerWakeCommands } from './wake.js';
|
|
23
23
|
import { registerGovernanceCommands } from './governance.js';
|
|
24
|
+
import { registerAutoStartCommands } from './autostart.js';
|
|
24
25
|
import { parseExecutionsJson, resolveWaitOptions, waitForPipelines, buildAwsCommand, validateExecutionEntry, } from './wait-for-pipeline.js';
|
|
25
26
|
import { readFileSync, readdirSync, writeFileSync, mkdirSync, existsSync, statSync } from 'fs';
|
|
26
27
|
import { fileURLToPath } from 'url';
|
|
@@ -9519,6 +9520,13 @@ registerWakeCommands(program);
|
|
|
9519
9520
|
// Cross-Org read (noProjectHeader: true); server resolves orgIds[] + roleSlugs[]
|
|
9520
9521
|
// via resolveCallerContext. Read-only in v1 — no write sub-commands (AC1).
|
|
9521
9522
|
registerGovernanceCommands(program);
|
|
9523
|
+
// ── AUTON-AUTOSTART — Action→Pipeline Auto-Start: autostart list/status/disable/enable ──
|
|
9524
|
+
// Registers `autostart` top-level command with list, status, disable, and enable
|
|
9525
|
+
// sub-commands. Project-scoped reads (project_id query param);
|
|
9526
|
+
// writes are org+project level (noProjectHeader: true on all calls).
|
|
9527
|
+
// admin/owner required for disable/enable; any active member for list/status.
|
|
9528
|
+
// No fire-now in V1 (spec §11 explicitly excludes it).
|
|
9529
|
+
registerAutoStartCommands(program);
|
|
9522
9530
|
// Skip auto-parse only when running under Vitest (which sets process.env.VITEST).
|
|
9523
9531
|
// Tests import `program` and drive it via `program.parseAsync(...)` after mocking
|
|
9524
9532
|
// `./api.js`. In every other context — direct invocation, npx tsx, OR the bin
|