@formigio/fazemos-cli 0.10.31 → 0.10.33
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/governance.d.ts +29 -0
- package/dist/governance.js +406 -0
- package/dist/governance.js.map +1 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -1
- package/dist/wake.d.ts +39 -0
- package/dist/wake.js +304 -0
- package/dist/wake.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* F34 — Governance Reporting Rollup: CLI command helpers.
|
|
3
|
+
*
|
|
4
|
+
* Exports `registerGovernanceCommands(program)` which wires the following
|
|
5
|
+
* command into the root Commander program (mirrors src/trigger.ts:149):
|
|
6
|
+
*
|
|
7
|
+
* fazemos governance status [--window 24h|7d] [--json]
|
|
8
|
+
* → GET /api/control-plane/governance?window=…
|
|
9
|
+
* Returns GovernanceStatus: control_plane + activity + cost + queue +
|
|
10
|
+
* waiting_on_me — a cross-Org read-only rollup answering
|
|
11
|
+
* "what ran / what it cost / what's queued / what's waiting on me".
|
|
12
|
+
*
|
|
13
|
+
* Auth: requireAuth only (cross-Org endpoint; mirrors /api/my-work/unified).
|
|
14
|
+
* Server resolves orgIds[] + roleSlugs[] via resolveCallerContext.
|
|
15
|
+
* No project scoping — always cross-Org (noProjectHeader: true).
|
|
16
|
+
*
|
|
17
|
+
* Read-only: NO write sub-commands; status-only in v1 (AC1).
|
|
18
|
+
*
|
|
19
|
+
* Spec: F34-governance-reporting-rollup-tech-spec.md §7
|
|
20
|
+
* Manifest: cli section (fazemos-cli/src/governance.ts)
|
|
21
|
+
*/
|
|
22
|
+
import type { Command } from 'commander';
|
|
23
|
+
/**
|
|
24
|
+
* Register `governance status` into the root Commander program.
|
|
25
|
+
* Called from index.ts alongside registerTriggerCommands.
|
|
26
|
+
*
|
|
27
|
+
* @see fazemos-cli/src/trigger.ts:149 — mirrors status sub-command pattern
|
|
28
|
+
*/
|
|
29
|
+
export declare function registerGovernanceCommands(program: Command): void;
|
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* F34 — Governance Reporting Rollup: CLI command helpers.
|
|
3
|
+
*
|
|
4
|
+
* Exports `registerGovernanceCommands(program)` which wires the following
|
|
5
|
+
* command into the root Commander program (mirrors src/trigger.ts:149):
|
|
6
|
+
*
|
|
7
|
+
* fazemos governance status [--window 24h|7d] [--json]
|
|
8
|
+
* → GET /api/control-plane/governance?window=…
|
|
9
|
+
* Returns GovernanceStatus: control_plane + activity + cost + queue +
|
|
10
|
+
* waiting_on_me — a cross-Org read-only rollup answering
|
|
11
|
+
* "what ran / what it cost / what's queued / what's waiting on me".
|
|
12
|
+
*
|
|
13
|
+
* Auth: requireAuth only (cross-Org endpoint; mirrors /api/my-work/unified).
|
|
14
|
+
* Server resolves orgIds[] + roleSlugs[] via resolveCallerContext.
|
|
15
|
+
* No project scoping — always cross-Org (noProjectHeader: true).
|
|
16
|
+
*
|
|
17
|
+
* Read-only: NO write sub-commands; status-only in v1 (AC1).
|
|
18
|
+
*
|
|
19
|
+
* Spec: F34-governance-reporting-rollup-tech-spec.md §7
|
|
20
|
+
* Manifest: cli section (fazemos-cli/src/governance.ts)
|
|
21
|
+
*/
|
|
22
|
+
import chalk from 'chalk';
|
|
23
|
+
import { api } from './api.js';
|
|
24
|
+
// ── Helpers ────────────────────────────────────────────────────────────────────
|
|
25
|
+
/**
|
|
26
|
+
* Validate and normalize a --window flag value.
|
|
27
|
+
* Throws a user-facing error for unsupported values.
|
|
28
|
+
*/
|
|
29
|
+
function normalizeWindow(value) {
|
|
30
|
+
const v = value.trim().toLowerCase();
|
|
31
|
+
if (v !== '24h' && v !== '7d') {
|
|
32
|
+
throw new Error(`--window must be '24h' or '7d', got: ${value}`);
|
|
33
|
+
}
|
|
34
|
+
return v;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Section header — bold white label matching the chalk section-table pattern.
|
|
38
|
+
*/
|
|
39
|
+
function sectionHeader(label) {
|
|
40
|
+
console.log();
|
|
41
|
+
console.log(chalk.bold.white(`── ${label} ──`));
|
|
42
|
+
console.log();
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Format a spend value with the appropriate unit suffix.
|
|
46
|
+
* Tokens: "1,234,567 T" — per UX §11.2 T suffix convention.
|
|
47
|
+
* USD: "$12.34"
|
|
48
|
+
*/
|
|
49
|
+
function formatSpend(amount, unit) {
|
|
50
|
+
if (unit === 'usd') {
|
|
51
|
+
return `$${amount.toFixed(4)}`;
|
|
52
|
+
}
|
|
53
|
+
return `${Math.round(amount).toLocaleString()} T`;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Format a percentage for display (e.g. 87.4%).
|
|
57
|
+
*/
|
|
58
|
+
function formatPct(pct) {
|
|
59
|
+
return `${pct.toFixed(1)}%`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* ANSI-colored label for an activity row's status.
|
|
63
|
+
* green = fired/in-flight, yellow = suppressed/deferred/skipped, red = failed/depth-refused.
|
|
64
|
+
*/
|
|
65
|
+
function activityStatusLabel(status) {
|
|
66
|
+
switch (status) {
|
|
67
|
+
case 'fired':
|
|
68
|
+
case 'in-flight':
|
|
69
|
+
return chalk.green(status);
|
|
70
|
+
case 'suppressed':
|
|
71
|
+
case 'deferred':
|
|
72
|
+
case 'skipped':
|
|
73
|
+
return chalk.yellow(status);
|
|
74
|
+
case 'failed':
|
|
75
|
+
case 'depth-refused':
|
|
76
|
+
return chalk.red(status);
|
|
77
|
+
default:
|
|
78
|
+
return chalk.dim(status);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Colored source_type badge.
|
|
83
|
+
*/
|
|
84
|
+
function sourceTypeLabel(sourceType) {
|
|
85
|
+
switch (sourceType) {
|
|
86
|
+
case 'trigger':
|
|
87
|
+
return chalk.cyan('trigger');
|
|
88
|
+
case 'dispatch_wake':
|
|
89
|
+
return chalk.magenta('wake');
|
|
90
|
+
case 'dispatch':
|
|
91
|
+
return chalk.blue('dispatch');
|
|
92
|
+
case 'pipeline_step':
|
|
93
|
+
return chalk.dim('step');
|
|
94
|
+
default:
|
|
95
|
+
return chalk.dim(sourceType);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Render the CONTROL PLANE block:
|
|
100
|
+
* - Pause state (F32): paused/clear, with per-scope sub-rows
|
|
101
|
+
* - Budget state (F33): unit / used / cap / headroom
|
|
102
|
+
*/
|
|
103
|
+
function renderControlPlane(status) {
|
|
104
|
+
sectionHeader('CONTROL PLANE');
|
|
105
|
+
const { pause, budget } = status.control_plane;
|
|
106
|
+
// ── Pause ──────────────────────────────────────────────────────────────────
|
|
107
|
+
if (pause.paused) {
|
|
108
|
+
console.log(` Pause: ${chalk.red('⏸ PAUSED')} (${pause.scopes.length} scope${pause.scopes.length !== 1 ? 's' : ''})`);
|
|
109
|
+
for (const scope of pause.scopes) {
|
|
110
|
+
const scopeLabel = scope.scope === 'global'
|
|
111
|
+
? chalk.bold('global')
|
|
112
|
+
: `${scope.scope}: ${chalk.cyan(scope.scope_key ?? '?')}`;
|
|
113
|
+
console.log(` └─ ${scopeLabel}`);
|
|
114
|
+
if (scope.reason) {
|
|
115
|
+
console.log(` reason: ${scope.reason}`);
|
|
116
|
+
}
|
|
117
|
+
if (scope.paused_by_name) {
|
|
118
|
+
console.log(` paused by: ${scope.paused_by_name}`);
|
|
119
|
+
}
|
|
120
|
+
console.log(` paused at: ${new Date(scope.paused_at).toLocaleString()}`);
|
|
121
|
+
if (scope.paused_until) {
|
|
122
|
+
console.log(` until: ${new Date(scope.paused_until).toLocaleString()}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
console.log(` Pause: ${chalk.green('▶ clear — no active pauses')}`);
|
|
128
|
+
}
|
|
129
|
+
// ── Budget ─────────────────────────────────────────────────────────────────
|
|
130
|
+
console.log();
|
|
131
|
+
if (!budget) {
|
|
132
|
+
console.log(` Budget: ${chalk.dim('no global budget configured')}`);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
const used = formatSpend(budget.used, budget.unit);
|
|
136
|
+
const effUsed = formatSpend(budget.effective_used, budget.unit);
|
|
137
|
+
const cap = budget.cap != null ? formatSpend(budget.cap, budget.unit) : 'unlimited';
|
|
138
|
+
const headroom = budget.headroom_pct != null
|
|
139
|
+
? ` (${formatPct(budget.headroom_pct)} headroom)`
|
|
140
|
+
: '';
|
|
141
|
+
const usageColor = budget.headroom_pct != null
|
|
142
|
+
? (budget.headroom_pct < 10 ? chalk.red : budget.headroom_pct < 25 ? chalk.yellow : chalk.green)
|
|
143
|
+
: chalk.white;
|
|
144
|
+
console.log(` Budget (${budget.unit}): ${usageColor(`${effUsed} / ${cap}`)}${headroom}`);
|
|
145
|
+
if (budget.used !== budget.effective_used) {
|
|
146
|
+
console.log(` weighted: ${used}`);
|
|
147
|
+
}
|
|
148
|
+
if (budget.resets_at) {
|
|
149
|
+
console.log(` resets at: ${new Date(budget.resets_at).toLocaleString()}`);
|
|
150
|
+
}
|
|
151
|
+
if (budget.under_count_note) {
|
|
152
|
+
console.log(` ${chalk.dim('* cache tokens excluded from spend')}`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Render the WHAT RAN (activity) block.
|
|
158
|
+
* Shows up to 50 activity rows with source_type, role, description, status.
|
|
159
|
+
* Suppressed/depth-refused rows show status_detail as └─ sub-row.
|
|
160
|
+
* Degraded sources shown as banner.
|
|
161
|
+
*/
|
|
162
|
+
function renderActivity(status) {
|
|
163
|
+
sectionHeader('WHAT RAN');
|
|
164
|
+
const { rows, total_count, truncated, sources_degraded } = status.activity;
|
|
165
|
+
const windowLabel = status.window === '7d' ? 'last 7 days' : 'last 24 hours';
|
|
166
|
+
if (sources_degraded.length > 0) {
|
|
167
|
+
console.log(chalk.yellow(` ⚠ Partial view — some sources unavailable: ${sources_degraded.join(', ')}`));
|
|
168
|
+
console.log();
|
|
169
|
+
}
|
|
170
|
+
if (rows.length === 0) {
|
|
171
|
+
console.log(chalk.dim(` Team was quiet in the ${windowLabel}. No activity recorded.`));
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
const totalLabel = truncated
|
|
175
|
+
? `showing first ${rows.length} of ${total_count}`
|
|
176
|
+
: `${total_count} total`;
|
|
177
|
+
console.log(chalk.dim(` ${windowLabel} — ${totalLabel}`));
|
|
178
|
+
console.log();
|
|
179
|
+
for (const row of rows) {
|
|
180
|
+
const roleStr = row.role ? chalk.cyan(row.role.padEnd(24)) : ' '.repeat(24);
|
|
181
|
+
const srcLabel = sourceTypeLabel(row.source_type).padEnd(12);
|
|
182
|
+
const statusLabel = activityStatusLabel(row.status);
|
|
183
|
+
const ts = new Date(row.timestamp).toLocaleString();
|
|
184
|
+
// Context: org + project prefix
|
|
185
|
+
const orgSlug = row.org?.slug ?? row.org_id.slice(0, 8);
|
|
186
|
+
const projectSlug = row.project?.slug;
|
|
187
|
+
const contextPrefix = projectSlug
|
|
188
|
+
? `${chalk.dim(orgSlug + '/' + projectSlug)}`
|
|
189
|
+
: chalk.dim(orgSlug);
|
|
190
|
+
console.log(` ${srcLabel} ${roleStr} ${statusLabel} ${chalk.dim(ts)}`);
|
|
191
|
+
console.log(` ${contextPrefix} ${row.description}`);
|
|
192
|
+
// Status detail as └─ sub-row for suppressed/refused rows
|
|
193
|
+
if (row.status_detail && (row.status === 'suppressed' || row.status === 'depth-refused' || row.status === 'failed')) {
|
|
194
|
+
console.log(` ${chalk.dim('└─')} ${chalk.yellow(row.status_detail)}`);
|
|
195
|
+
}
|
|
196
|
+
// Click-through link when execution_id + project context available (UQ-1)
|
|
197
|
+
if (row.execution_id && row.org?.slug && row.project?.slug) {
|
|
198
|
+
const link = `/org/${row.org.slug}/project/${row.project.slug}/executions/${row.execution_id}`;
|
|
199
|
+
console.log(` ${chalk.dim('↳ ' + link)}`);
|
|
200
|
+
}
|
|
201
|
+
console.log();
|
|
202
|
+
}
|
|
203
|
+
if (truncated) {
|
|
204
|
+
console.log(chalk.dim(` … and ${total_count - rows.length} more (use --json for full data)`));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Render the WHAT IT COST block.
|
|
209
|
+
* By-role and by-project spend breakdown with T suffix, and an under-count footnote.
|
|
210
|
+
*/
|
|
211
|
+
function renderCost(status) {
|
|
212
|
+
sectionHeader('WHAT IT COST');
|
|
213
|
+
const { unit, by_role, by_project, total, cap, pct_of_cap, under_count_note } = status.cost;
|
|
214
|
+
const windowLabel = status.window === '7d' ? 'last 7 days' : 'last 24 hours';
|
|
215
|
+
if (total === 0) {
|
|
216
|
+
console.log(chalk.dim(` No spend recorded in the ${windowLabel}.`));
|
|
217
|
+
if (under_count_note) {
|
|
218
|
+
console.log(chalk.dim(' * cache tokens excluded'));
|
|
219
|
+
}
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const totalStr = formatSpend(total, unit);
|
|
223
|
+
const capStr = cap != null ? ` / ${formatSpend(cap, unit)}` : '';
|
|
224
|
+
const pctStr = pct_of_cap != null ? ` (${formatPct(pct_of_cap)} of cap)` : '';
|
|
225
|
+
const totalColor = pct_of_cap != null
|
|
226
|
+
? (pct_of_cap > 90 ? chalk.red : pct_of_cap > 75 ? chalk.yellow : chalk.green)
|
|
227
|
+
: chalk.white;
|
|
228
|
+
console.log(` Total (${windowLabel}): ${totalColor(`${totalStr}${capStr}`)}${pctStr}`);
|
|
229
|
+
// By-role breakdown
|
|
230
|
+
if (by_role.length > 0) {
|
|
231
|
+
console.log();
|
|
232
|
+
console.log(' By role:');
|
|
233
|
+
for (const r of by_role) {
|
|
234
|
+
const spendStr = formatSpend(r.spend, unit);
|
|
235
|
+
const pctLabel = chalk.dim(`${formatPct(r.pct)}`);
|
|
236
|
+
console.log(` ${chalk.cyan(r.role.padEnd(28))} ${spendStr.padStart(14)} ${pctLabel}`);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// By-project breakdown
|
|
240
|
+
if (by_project.length > 0) {
|
|
241
|
+
console.log();
|
|
242
|
+
console.log(' By project:');
|
|
243
|
+
for (const p of by_project) {
|
|
244
|
+
const name = p.project?.slug ?? p.project_id.slice(0, 12);
|
|
245
|
+
const spendStr = formatSpend(p.spend, unit);
|
|
246
|
+
const pctLabel = chalk.dim(`${formatPct(p.pct)}`);
|
|
247
|
+
console.log(` ${chalk.cyan(name.padEnd(28))} ${spendStr.padStart(14)} ${pctLabel}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
if (under_count_note) {
|
|
251
|
+
console.log();
|
|
252
|
+
console.log(chalk.dim(' * cache tokens excluded from spend totals'));
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Render the QUEUE block.
|
|
257
|
+
* Per-role in-flight and queued counts, with totals.
|
|
258
|
+
*/
|
|
259
|
+
function renderQueue(status) {
|
|
260
|
+
sectionHeader('QUEUE');
|
|
261
|
+
const { by_role, total_in_flight, total_queued } = status.queue;
|
|
262
|
+
if (total_in_flight === 0 && total_queued === 0) {
|
|
263
|
+
console.log(chalk.dim(' Queue is idle — no in-flight or queued work.'));
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
console.log(` In-flight: ${chalk.green(String(total_in_flight))} Queued: ${chalk.yellow(String(total_queued))}`);
|
|
267
|
+
if (by_role.length > 0) {
|
|
268
|
+
console.log();
|
|
269
|
+
console.log(' By role:');
|
|
270
|
+
for (const r of by_role) {
|
|
271
|
+
if (r.in_flight === 0 && r.queued === 0)
|
|
272
|
+
continue;
|
|
273
|
+
const inFlightStr = chalk.green(String(r.in_flight).padStart(3));
|
|
274
|
+
const queuedStr = chalk.yellow(String(r.queued).padStart(3));
|
|
275
|
+
console.log(` ${chalk.cyan(r.role.padEnd(28))} in-flight: ${inFlightStr} queued: ${queuedStr}`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Render the WAITING ON ME block.
|
|
281
|
+
* Cross-Org dispatches addressed to the caller's roles, plus F37 approval gates
|
|
282
|
+
* when present (null gates → omit sub-list entirely; [] → "no pending approvals").
|
|
283
|
+
*/
|
|
284
|
+
function renderWaitingOnMe(status) {
|
|
285
|
+
sectionHeader('WAITING ON ME');
|
|
286
|
+
const { dispatches, approval_gates, you_are_clear } = status.waiting_on_me;
|
|
287
|
+
if (you_are_clear) {
|
|
288
|
+
console.log(chalk.green(' ✓ You\'re clear — no dispatches or approvals waiting on you.'));
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
// ── Dispatches ─────────────────────────────────────────────────────────────
|
|
292
|
+
if (dispatches.length > 0) {
|
|
293
|
+
console.log(` Dispatches (${dispatches.length}):`);
|
|
294
|
+
console.log();
|
|
295
|
+
for (const d of dispatches) {
|
|
296
|
+
const priorityColor = d.priority === 'urgent' || d.priority === 'high'
|
|
297
|
+
? chalk.red
|
|
298
|
+
: d.priority === 'normal'
|
|
299
|
+
? chalk.yellow
|
|
300
|
+
: chalk.dim;
|
|
301
|
+
console.log(` ${priorityColor(`[${d.priority}]`)} ${chalk.bold(d.summary)}`);
|
|
302
|
+
console.log(` from: ${chalk.cyan(d.from_role)} type: ${chalk.dim(d.type)}`);
|
|
303
|
+
console.log(` created: ${new Date(d.created_at).toLocaleString()}`);
|
|
304
|
+
const routePath = d.route_to.projectSlug
|
|
305
|
+
? `/org/${d.route_to.orgSlug}/project/${d.route_to.projectSlug}${d.route_to.path}`
|
|
306
|
+
: `/org/${d.route_to.orgSlug}${d.route_to.path}`;
|
|
307
|
+
console.log(` route: ${chalk.dim(routePath)}`);
|
|
308
|
+
console.log(` id: ${chalk.dim(d.id)}`);
|
|
309
|
+
console.log();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
// ── Approval gates ─────────────────────────────────────────────────────────
|
|
313
|
+
// null → F37 absent → omit sub-list entirely (AC6)
|
|
314
|
+
// [] → F37 present, no pending gates → show "no pending approvals"
|
|
315
|
+
// [...] → list open gates
|
|
316
|
+
if (approval_gates !== null) {
|
|
317
|
+
console.log();
|
|
318
|
+
if (approval_gates.length === 0) {
|
|
319
|
+
console.log(chalk.dim(' Approvals: no pending approval requests.'));
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
console.log(` Approvals (${approval_gates.length} pending):`);
|
|
323
|
+
console.log();
|
|
324
|
+
for (const gate of approval_gates) {
|
|
325
|
+
console.log(` ${chalk.bold(gate.description)}`);
|
|
326
|
+
if (gate.deadline_at) {
|
|
327
|
+
console.log(` deadline: ${new Date(gate.deadline_at).toLocaleString()}`);
|
|
328
|
+
}
|
|
329
|
+
console.log(` id: ${chalk.dim(gate.id)}`);
|
|
330
|
+
console.log();
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
// ── Command registration ───────────────────────────────────────────────────────
|
|
336
|
+
/**
|
|
337
|
+
* Register `governance status` into the root Commander program.
|
|
338
|
+
* Called from index.ts alongside registerTriggerCommands.
|
|
339
|
+
*
|
|
340
|
+
* @see fazemos-cli/src/trigger.ts:149 — mirrors status sub-command pattern
|
|
341
|
+
*/
|
|
342
|
+
export function registerGovernanceCommands(program) {
|
|
343
|
+
// ── `fazemos governance` ──────────────────────────────────────────────────
|
|
344
|
+
//
|
|
345
|
+
// Parent command hosting sub-commands: status (status-only in v1 per AC1).
|
|
346
|
+
// The parent itself has no action.
|
|
347
|
+
const governanceCmd = program
|
|
348
|
+
.command('governance')
|
|
349
|
+
.description('Cross-Org governance rollup — what ran, what it cost, what\'s queued, what\'s waiting on you.\n\n' +
|
|
350
|
+
'Sub-commands:\n' +
|
|
351
|
+
' status Show governance status rollup across all your orgs\n\n' +
|
|
352
|
+
'Read-only in v1 — no write sub-commands (AC1).\n' +
|
|
353
|
+
'Auth: your orgs + roles are resolved server-side; no --project or org header needed.');
|
|
354
|
+
// ── `fazemos governance status` ───────────────────────────────────────────
|
|
355
|
+
//
|
|
356
|
+
// GET /api/control-plane/governance?window=<24h|7d>
|
|
357
|
+
//
|
|
358
|
+
// Returns GovernanceStatus: control_plane + activity + cost + queue + waiting_on_me.
|
|
359
|
+
// Cross-Org (noProjectHeader: true); server resolves orgIds[] + roleSlugs[] via
|
|
360
|
+
// resolveCallerContext(req.user.sub) — mirrors the /api/my-work/unified auth posture.
|
|
361
|
+
//
|
|
362
|
+
// Usage:
|
|
363
|
+
// fazemos governance status
|
|
364
|
+
// fazemos governance status --window 7d
|
|
365
|
+
// fazemos governance status --json
|
|
366
|
+
governanceCmd
|
|
367
|
+
.command('status')
|
|
368
|
+
.description('Show governance rollup: control plane, recent activity, cost, queue depth, and what\'s waiting on you.\n\n' +
|
|
369
|
+
'Aggregates five SHIPPED surfaces (F32 pause_states, F33 budget_states + executions spend,\n' +
|
|
370
|
+
'F35 trigger_fires, F36 wake_fires, F26 dispatches inbox) into one cross-Org snapshot.\n\n' +
|
|
371
|
+
'Window:\n' +
|
|
372
|
+
' --window 24h (default) Activity and cost for the last 24 hours\n' +
|
|
373
|
+
' --window 7d Activity and cost for the last 7 days\n\n' +
|
|
374
|
+
'Note: control_plane, queue, and waiting_on_me are always current-state regardless of --window.\n\n' +
|
|
375
|
+
'Readable by any authenticated user (cross-Org; your orgs resolved server-side).\n' +
|
|
376
|
+
'Use --json for machine-readable output (raw GovernanceStatus).')
|
|
377
|
+
.option('--window <24h|7d>', 'time window for activity and cost data (default: 24h)', '24h')
|
|
378
|
+
.option('--json', 'output machine-readable JSON (raw GovernanceStatus)')
|
|
379
|
+
.action(async (opts) => {
|
|
380
|
+
try {
|
|
381
|
+
const window = normalizeWindow(opts.window);
|
|
382
|
+
const data = await api('GET', `/api/control-plane/governance?window=${encodeURIComponent(window)}`, undefined, { noProjectHeader: true });
|
|
383
|
+
if (opts.json) {
|
|
384
|
+
console.log(JSON.stringify(data, null, 2));
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
// ── Human output — chalk section-tables per UX §11.2 ──────────────
|
|
388
|
+
const generatedAt = new Date(data.generated_at).toLocaleString();
|
|
389
|
+
const windowLabel = window === '7d' ? '7-day' : '24h';
|
|
390
|
+
console.log(chalk.bold(`Governance Status ${chalk.dim(`(${windowLabel} window · generated ${generatedAt})`)}`));
|
|
391
|
+
console.log(chalk.dim(` Orgs: ${data.meta.orgCount} Projects: ${data.meta.projectCount} Roles: ${data.meta.roleSlugs.join(', ') || '—'}`));
|
|
392
|
+
renderControlPlane(data);
|
|
393
|
+
renderActivity(data);
|
|
394
|
+
renderCost(data);
|
|
395
|
+
renderQueue(data);
|
|
396
|
+
renderWaitingOnMe(data);
|
|
397
|
+
console.log();
|
|
398
|
+
}
|
|
399
|
+
catch (err) {
|
|
400
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
401
|
+
console.error(chalk.red(`Error: ${msg}`));
|
|
402
|
+
process.exit(1);
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
//# sourceMappingURL=governance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"governance.js","sourceRoot":"","sources":["../src/governance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAsI/B,kFAAkF;AAElF;;;GAGG;AACH,SAAS,eAAe,CAAC,KAAa;IACpC,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACrC,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,wCAAwC,KAAK,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,CAAqB,CA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,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,QAAQ,eAAe,IAAI,CAAC,IAAI,CAAC,YAAY,YAAY,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC;YAE9I,kBAAkB,CAAC,IAAI,CAAC,CAAC;YACzB,cAAc,CAAC,IAAI,CAAC,CAAC;YACrB,UAAU,CAAC,IAAI,CAAC,CAAC;YACjB,WAAW,CAAC,IAAI,CAAC,CAAC;YAClB,iBAAiB,CAAC,IAAI,CAAC,CAAC;YAExB,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,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
|
@@ -16,6 +16,8 @@ import { execSync } from 'child_process';
|
|
|
16
16
|
import { registerPauseCommands } from './pause.js';
|
|
17
17
|
import { registerBudgetCommands } from './budget.js';
|
|
18
18
|
import { registerTriggerCommands } from './trigger.js';
|
|
19
|
+
import { registerWakeCommands } from './wake.js';
|
|
20
|
+
import { registerGovernanceCommands } from './governance.js';
|
|
19
21
|
import { parseExecutionsJson, resolveWaitOptions, waitForPipelines, buildAwsCommand, validateExecutionEntry, } from './wait-for-pipeline.js';
|
|
20
22
|
import { readFileSync, readdirSync, writeFileSync, mkdirSync, existsSync, statSync } from 'fs';
|
|
21
23
|
import { fileURLToPath } from 'url';
|
|
@@ -8750,6 +8752,18 @@ registerBudgetCommands(program);
|
|
|
8750
8752
|
// writes are org+project level (noProjectHeader: true on all calls).
|
|
8751
8753
|
// admin/owner required for fire-now/disable/enable; member for list/status.
|
|
8752
8754
|
registerTriggerCommands(program);
|
|
8755
|
+
// ── F36 — Inbox Auto-Wake: wake status/disable/enable ────────────────────────
|
|
8756
|
+
// Registers `wake` top-level command with status, disable, and enable
|
|
8757
|
+
// sub-commands. Project-scoped reads (project_id query param);
|
|
8758
|
+
// writes are org+project level (noProjectHeader: true on all calls).
|
|
8759
|
+
// admin/owner required for disable/enable; any active member for status.
|
|
8760
|
+
// No cadence dimension — wake_disables is UNIQUE(org_id, role), no cadence.
|
|
8761
|
+
registerWakeCommands(program);
|
|
8762
|
+
// ── F34 — Governance Reporting Rollup: governance status ─────────────────────
|
|
8763
|
+
// Registers `governance` top-level command with `status` sub-command.
|
|
8764
|
+
// Cross-Org read (noProjectHeader: true); server resolves orgIds[] + roleSlugs[]
|
|
8765
|
+
// via resolveCallerContext. Read-only in v1 — no write sub-commands (AC1).
|
|
8766
|
+
registerGovernanceCommands(program);
|
|
8753
8767
|
// Skip auto-parse only when running under Vitest (which sets process.env.VITEST).
|
|
8754
8768
|
// Tests import `program` and drive it via `program.parseAsync(...)` after mocking
|
|
8755
8769
|
// `./api.js`. In every other context — direct invocation, npx tsx, OR the bin
|