@formigio/fazemos-cli 0.10.81 → 0.10.84
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/commands/floor.d.ts +31 -0
- package/dist/commands/floor.js +367 -0
- package/dist/commands/floor.js.map +1 -0
- package/dist/dispatch.d.ts +29 -0
- package/dist/dispatch.js +38 -0
- package/dist/dispatch.js.map +1 -1
- package/dist/index.js +71 -18
- package/dist/index.js.map +1 -1
- package/dist/preflight/row3_persona.js +3 -1
- package/dist/preflight/row3_persona.js.map +1 -1
- package/dist/types/floor.d.ts +101 -0
- package/dist/types/floor.js +12 -0
- package/dist/types/floor.js.map +1 -0
- package/dist/wake.js +33 -12
- package/dist/wake.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { loadYaml, summarize } from './yaml/load.js';
|
|
|
15
15
|
import { printFindings, printJson } from './yaml/format.js';
|
|
16
16
|
import { validateManifest } from './manifest/checks.js';
|
|
17
17
|
import { validatePath as validateRunbookPath } from './runbook/checks.js';
|
|
18
|
-
import { findLocalRegistry, resolveRole, buildInboxFile, writeInboxFile, writeInboxFileAtPath, buildRolesSyncPayload, findUnprocessedInboxFiles, computeFileHash, gitCommitInboxFile, gitCommitAndPushInboxFile, isAgentExecution, computeRegistryInboxPath, computeChildDispatchDepth, shouldFallBackToFile, } from './dispatch.js';
|
|
18
|
+
import { findLocalRegistry, resolveRole, buildInboxFile, writeInboxFile, writeInboxFileAtPath, buildRolesSyncPayload, findUnprocessedInboxFiles, computeFileHash, gitCommitInboxFile, gitCommitAndPushInboxFile, isAgentExecution, computeRegistryInboxPath, computeChildDispatchDepth, shouldFallBackToFile, isWakeIneligibleForCadencelessRole, } from './dispatch.js';
|
|
19
19
|
import { execSync } from 'child_process';
|
|
20
20
|
import { registerPauseCommands } from './pause.js';
|
|
21
21
|
import { registerBudgetCommands } from './budget.js';
|
|
@@ -31,6 +31,8 @@ import { registerProfilesCommands } from './commands/profiles.js';
|
|
|
31
31
|
import { registerImageCommands } from './commands/image.js';
|
|
32
32
|
import { registerIngestCommands } from './commands/ingest.js';
|
|
33
33
|
import { registerAssetCommands } from './commands/asset/index.js';
|
|
34
|
+
// F70 — Floor Projection
|
|
35
|
+
import { registerFloorCommands } from './commands/floor.js';
|
|
34
36
|
// F53 — Agent Provisioning Tooling
|
|
35
37
|
import { runPreflight } from './commands/preflight.js';
|
|
36
38
|
import { runProvision } from './commands/provision.js';
|
|
@@ -1664,14 +1666,14 @@ projects
|
|
|
1664
1666
|
if (p.docsRepoSource === 'project') {
|
|
1665
1667
|
// Variant A — docs_repo set directly on this project
|
|
1666
1668
|
console.log(` Docs repository: ${p.effectiveDocsRepo} ${chalk.gray('(set for this project)')}`);
|
|
1667
|
-
const docsRoot = p.docsRoot
|
|
1668
|
-
console.log(` Docs root: ${docsRoot}
|
|
1669
|
+
const docsRoot = p.docsRoot === null ? 'ROOT (repo root)' : p.docsRoot;
|
|
1670
|
+
console.log(` Docs root: ${docsRoot}`);
|
|
1669
1671
|
}
|
|
1670
1672
|
else if (p.docsRepoSource === 'org') {
|
|
1671
1673
|
// Variant B — inheriting from org workspace_repo
|
|
1672
1674
|
console.log(` Docs repository: ${p.effectiveDocsRepo} ${chalk.gray('(inherited from org)')}`);
|
|
1673
|
-
const docsRoot = p.docsRoot
|
|
1674
|
-
console.log(` Docs root: ${docsRoot}
|
|
1675
|
+
const docsRoot = p.docsRoot === null ? 'ROOT (repo root)' : p.docsRoot;
|
|
1676
|
+
console.log(` Docs root: ${docsRoot}`);
|
|
1675
1677
|
console.log(chalk.gray(` → change with: fazemos projects set-docs-repo <owner/repo>`));
|
|
1676
1678
|
}
|
|
1677
1679
|
else {
|
|
@@ -1982,8 +1984,8 @@ projects
|
|
|
1982
1984
|
// Sage Screen 6 — set path
|
|
1983
1985
|
console.log(chalk.green(`✓ Docs repo set for ${p.name} (${p.slug})`));
|
|
1984
1986
|
console.log(` Docs repository: ${docsRepo} ${chalk.gray('(set for this project)')}`);
|
|
1985
|
-
const docsRoot = p.docsRoot
|
|
1986
|
-
console.log(` Docs root: ${docsRoot}
|
|
1987
|
+
const docsRoot = p.docsRoot === null ? 'ROOT (repo root)' : p.docsRoot;
|
|
1988
|
+
console.log(` Docs root: ${docsRoot}`);
|
|
1987
1989
|
console.log(chalk.gray(' Reachability is tested when a pipeline first tries to clone the repo.'));
|
|
1988
1990
|
console.log(chalk.gray(' If it can\'t be reached, we\'ll point you back here.'));
|
|
1989
1991
|
}
|
|
@@ -2136,7 +2138,12 @@ projects
|
|
|
2136
2138
|
if (unchangedFields.length > 0) {
|
|
2137
2139
|
console.log(chalk.gray(` (unchanged: ${unchangedFields.join(', ')})`));
|
|
2138
2140
|
}
|
|
2139
|
-
|
|
2141
|
+
if (data.auditLogId) {
|
|
2142
|
+
console.log(` Audit: logged as project_setup (id: ${data.auditLogId})`);
|
|
2143
|
+
}
|
|
2144
|
+
else {
|
|
2145
|
+
console.log(chalk.gray(` Audit: no changes detected — audit row skipped`));
|
|
2146
|
+
}
|
|
2140
2147
|
}
|
|
2141
2148
|
catch (err) {
|
|
2142
2149
|
if (opts.json) {
|
|
@@ -10273,6 +10280,31 @@ Types: question | task | signal | response | flag | decision | direction | brief
|
|
|
10273
10280
|
// Resolve recipient
|
|
10274
10281
|
// rul_dispatch_cli_fallthrough_on_local_unresolved
|
|
10275
10282
|
const resolved = resolveRole(to, localRegistry);
|
|
10283
|
+
// BUG221 lever-a (AC-3): env-unresolvable pre-flight.
|
|
10284
|
+
// Detect a misconfigured FAZEMOS_ENV BEFORE any API call so the CLI
|
|
10285
|
+
// exits loudly (code 3) instead of silently degrading to file-only.
|
|
10286
|
+
// The unresolved path ALWAYS calls the API; the resolved path calls it
|
|
10287
|
+
// unless --file-only is set. Skip only when resolved + --file-only
|
|
10288
|
+
// (no API call will be made in that branch).
|
|
10289
|
+
if (!resolved || !opts.fileOnly) {
|
|
10290
|
+
try {
|
|
10291
|
+
getEnv();
|
|
10292
|
+
}
|
|
10293
|
+
catch {
|
|
10294
|
+
const envName = getActiveEnvName();
|
|
10295
|
+
console.error(`fazemos dispatch: FAZEMOS_ENV="${envName}" is not configured; nothing sent. Set env or use --file-only to force a local dead-letter.`);
|
|
10296
|
+
process.exitCode = 3;
|
|
10297
|
+
return;
|
|
10298
|
+
}
|
|
10299
|
+
}
|
|
10300
|
+
// BUG221 lever-a (AC-4): wake-ineligible type to cadenceless target pre-flight.
|
|
10301
|
+
// Applies only to resolved roles (unresolved roles have no local cadence data).
|
|
10302
|
+
// Refuses BEFORE any API call — no file written, no network call.
|
|
10303
|
+
if (resolved && !opts.fileOnly && isWakeIneligibleForCadencelessRole(type, resolved.role.cadence_schedule)) {
|
|
10304
|
+
console.error(`fazemos dispatch: role "${to}" has no drain cadence and type "${type}" does not fire a wake; nothing sent. Use type=task or type=question, or fix the role's cadence, or use --file-only.`);
|
|
10305
|
+
process.exitCode = 4;
|
|
10306
|
+
return;
|
|
10307
|
+
}
|
|
10276
10308
|
if (!resolved) {
|
|
10277
10309
|
// Registry-less path: recipient not found in local workspace registry
|
|
10278
10310
|
// (e.g. cross-workspace human role like `founder` in a peer workspace).
|
|
@@ -10317,9 +10349,16 @@ Types: question | task | signal | response | flag | decision | direction | brief
|
|
|
10317
10349
|
process.exitCode = 1;
|
|
10318
10350
|
return;
|
|
10319
10351
|
}
|
|
10320
|
-
//
|
|
10321
|
-
// rul_dispatch_local_file_best_effort_cross_workspace
|
|
10322
|
-
|
|
10352
|
+
// BUG221 lever-a (AC-2b): transient network failure in registry-less path.
|
|
10353
|
+
// rul_dispatch_local_file_best_effort_cross_workspace: NO file write —
|
|
10354
|
+
// there is no role.inbox because the recipient is not in this workspace's
|
|
10355
|
+
// registry. Exit 2 (non-zero) so downstream tooling sees the failure loudly.
|
|
10356
|
+
const networkMsg = err instanceof Error ? err.message : String(err);
|
|
10357
|
+
const apiUrl = getEnv().apiUrl;
|
|
10358
|
+
console.error(`fazemos dispatch: API unreachable at ${apiUrl} after network error; recipient '${to}' is not in this workspace's registry and cannot be file-mirrored locally. Nothing sent.`);
|
|
10359
|
+
console.error(` Error: ${networkMsg}`);
|
|
10360
|
+
process.exitCode = 2;
|
|
10361
|
+
return;
|
|
10323
10362
|
}
|
|
10324
10363
|
// 2xx — server resolved the recipient. Print UX §4.4 stdout copy verbatim.
|
|
10325
10364
|
// rul_dispatch_local_file_best_effort_cross_workspace
|
|
@@ -10404,24 +10443,28 @@ Types: question | task | signal | response | flag | decision | direction | brief
|
|
|
10404
10443
|
process.exitCode = 1;
|
|
10405
10444
|
return;
|
|
10406
10445
|
}
|
|
10407
|
-
//
|
|
10408
|
-
|
|
10409
|
-
|
|
10446
|
+
// BUG221 lever-a (AC-2): transient network failure in resolved path.
|
|
10447
|
+
// Write a file-only fallback (role.inbox is available) AND exit 2 (non-zero).
|
|
10448
|
+
// The operator is told the file was written and drain-on-cadence is the recovery
|
|
10449
|
+
// path. This replaces the old silent exit-0 — downstream tooling now sees failure.
|
|
10450
|
+
const networkMsg = err instanceof Error ? err.message : String(err);
|
|
10451
|
+
const apiUrl = getEnv().apiUrl;
|
|
10410
10452
|
fullPath = writeInboxFile(registry._workspaceRoot, role, filename, content);
|
|
10411
10453
|
relPath = fullPath.startsWith(registry._workspaceRoot)
|
|
10412
10454
|
? fullPath.slice(registry._workspaceRoot.length + 1)
|
|
10413
10455
|
: fullPath;
|
|
10414
|
-
console.
|
|
10415
|
-
console.
|
|
10456
|
+
console.error(`fazemos dispatch: API unreachable at ${apiUrl} after network error; wrote file-only fallback at ${fullPath}. Recipient will drain on next cadence tick.`);
|
|
10457
|
+
console.error(` Error: ${networkMsg}`);
|
|
10416
10458
|
if (opts.commit) {
|
|
10417
10459
|
try {
|
|
10418
10460
|
gitCommitInboxFile(registry._workspaceRoot, relPath, `dispatch(${opts.from} → ${to}): ${type}`);
|
|
10419
|
-
console.
|
|
10461
|
+
console.error(' File committed.');
|
|
10420
10462
|
}
|
|
10421
10463
|
catch (cerr) {
|
|
10422
|
-
console.
|
|
10464
|
+
console.error(` warning: commit failed — ${cerr instanceof Error ? cerr.message : String(cerr)}`);
|
|
10423
10465
|
}
|
|
10424
10466
|
}
|
|
10467
|
+
process.exitCode = 2;
|
|
10425
10468
|
return;
|
|
10426
10469
|
}
|
|
10427
10470
|
// API returned file_path — CLI writes the actual file (Dex S-B).
|
|
@@ -10952,6 +10995,16 @@ registerIngestCommands(program);
|
|
|
10952
10995
|
// put: idempotent by content hash; retries once on 403 from S3 (expired presigned URL).
|
|
10953
10996
|
// show: warns on silent-canary state (s3_object_exists=false + committed + permanent).
|
|
10954
10997
|
registerAssetCommands(program);
|
|
10998
|
+
// ── F70 — Floor Projection: fazemos floor summary/status/--json ──────────────
|
|
10999
|
+
// Registers `floor` top-level command with `summary` and `status` sub-commands.
|
|
11000
|
+
// GET /api/floor/summary[?projectId=<uuid>] — read-only org-scoped projection.
|
|
11001
|
+
// Scoping: ?projectId query param (not X-Fazemos-Project-Id header).
|
|
11002
|
+
// --project <slug> resolve slug → uuid, pass ?projectId=<uuid>
|
|
11003
|
+
// --all-projects no ?projectId (org-wide)
|
|
11004
|
+
// (default) active project if set, otherwise org-wide
|
|
11005
|
+
// Requires pipelines:read scope (same as work-queue/summary precedent).
|
|
11006
|
+
// Top-level --json is sugar for `floor summary --json`.
|
|
11007
|
+
registerFloorCommands(program);
|
|
10955
11008
|
// Skip auto-parse only when running under Vitest (which sets process.env.VITEST).
|
|
10956
11009
|
// Tests import `program` and drive it via `program.parseAsync(...)` after mocking
|
|
10957
11010
|
// `./api.js`. In every other context — direct invocation, npx tsx, OR the bin
|