@flowapt/flowiq-cli 0.12.2 → 0.12.3

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/README.md CHANGED
@@ -1309,6 +1309,7 @@ flowiq report deck generate <org_id> 2026-08 --refresh --force # rebuild every
1309
1309
  flowiq report deck build <org_id> 2026-08 --refresh # metrics only; status then says "Copy is older than the numbers" until you narrate
1310
1310
  flowiq report deck narrate <org_id> 2026-08 # copy only (hand edits are kept)
1311
1311
  flowiq report deck narrate <org_id> 2026-08 --only changes,action_points # rewrite just these copy fields, keep the rest as written
1312
+ flowiq report deck check <org_id> 2026-08 # fact-check the copy as shown (hand edits too) against the figures; rewrites nothing
1312
1313
  flowiq report deck inputs <org_id> 2026-08 --file inputs.json # the super-admin input form
1313
1314
  flowiq report deck approve <org_id> 2026-08 # refused until every required input is present
1314
1315
  flowiq report deck send <org_id> 2026-08 --test-to me@flowapt.com # one test copy, status untouched
package/TEAM-GUIDE.md CHANGED
@@ -274,6 +274,7 @@ several.
274
274
  | Generate a client's monthly deck (metrics + copy) after the month has frozen | `flowiq report deck generate <org_id> 2026-08` — then review it at /reporting/deck |
275
275
  | See whether a client deck can be approved, and what is still missing | `flowiq report deck status <org_id> 2026-08` |
276
276
  | Rewrite one part of a deck's copy without touching the rest (e.g. the changes column and action points) | `flowiq report deck narrate <org_id> 2026-08 --only changes,suggested_updates,action_points` |
277
+ | Check a deck's wording against its figures before it goes out (e.g. a heading that says a group "leads" when it does not) | `flowiq report deck check <org_id> 2026-08` — lists each unsupported statement with a fix; rewrites nothing |
277
278
  | Send yourself a test copy of a client deck (PDF from flowiq@flowapt.com) | `flowiq report deck send <org_id> 2026-08 --test-to you@flowapt.com` — status untouched |
278
279
  | Take a tile, pill or card off a client deck (and its PDF) for one month | On `/reporting/deck` open **Inputs** (the rail beside the slides) → Show or hide; or `flowiq report deck inputs <org_id> 2026-08 --file inputs.json` with `{ "hidden": { "tile:tail": true } }` |
279
280
  | Approve a client deck / send it to the client | `flowiq report deck approve <org_id> 2026-08` then `… send … --client` (or let the 09:00 SAST schedule send it on the 5th) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flowapt/flowiq-cli",
3
- "version": "0.12.2",
3
+ "version": "0.12.3",
4
4
  "description": "Command-line tool for FlowIQ staff: round-trip agent prompts, questionnaires, fine-tuning, pin-board tasks, webhooks, templates, agent-updates, chat exports, and live agent testing without ever touching service-role credentials.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -80,6 +80,21 @@ export async function narrate(orgId, month, opts) {
80
80
  reportCopy(r, month);
81
81
  }
82
82
 
83
+ export async function check(orgId, month, opts) {
84
+ requireArgs(orgId, month);
85
+ const r = await post("check", orgId, month, {}, "Check");
86
+ if (opts.json) { console.log(JSON.stringify(r, null, 2)); return; }
87
+ printClaims(r.issues);
88
+ if (r.status) console.log(` status: ${r.status}${r.missing?.length ? ` · needed: ${r.missing.join(" · ")}` : ""}`);
89
+ }
90
+
91
+ function printClaims(issues) {
92
+ if (!Array.isArray(issues)) return;
93
+ if (!issues.length) { console.log(" fact check: passed (every statement is supported by the figures)"); return; }
94
+ console.log(` ⚠ fact check: ${issues.length} statement${issues.length === 1 ? "" : "s"} the figures do not support:`);
95
+ for (const i of issues) console.log(` ${i.path}: "${i.quote}" (${i.why}) → ${i.fix}`);
96
+ }
97
+
83
98
  export async function generate(orgId, month, opts) {
84
99
  requireArgs(orgId, month);
85
100
  const r = await post("generate", orgId, month, { refresh: !!opts.refresh, force: !!opts.force }, "Generate");
@@ -94,6 +109,7 @@ function reportCopy(r, month) {
94
109
  const n = Object.keys(r.guard.offenders || {}).length;
95
110
  console.log(` ⚠ numeric guard: ${n} field${n === 1 ? "" : "s"} carry figures that are not in the data — flagged on the slides: ${Object.keys(r.guard.offenders).join(", ")}`);
96
111
  } else if (r.guard) console.log(" numeric guard: passed (every figure in the copy exists in the data)");
112
+ if (r.guard?.claim_check?.ran) printClaims(r.guard.claim_check.issues);
97
113
  if (Array.isArray(r.length_issues) && r.length_issues.length) console.log(` trimmed to limit: ${r.length_issues.map((i) => `${i.path} (${i.length}→${i.limit})`).join(", ")}`);
98
114
  }
99
115
 
package/src/index.js CHANGED
@@ -381,6 +381,10 @@ export function run(argv) {
381
381
  .option("--only <fields>", "rewrite only these copy fields, comma-separated (e.g. changes,suggested_updates,action_points); the rest stays as written")
382
382
  .option("--json", "raw JSON output")
383
383
  .action((orgId, month, opts) => reportCmd.narrate(orgId, month, opts));
384
+ deck.command("check <organization_id> <month>")
385
+ .description("Fact-check the copy as the slides show it (hand edits included) against the month's figures; rewrites nothing")
386
+ .option("--json", "raw JSON output")
387
+ .action((orgId, month, opts) => reportCmd.check(orgId, month, opts));
384
388
  deck.command("generate <organization_id> <month>")
385
389
  .description("Build the metrics (if missing, or --refresh) and write the copy")
386
390
  .option("--refresh", "rebuild the metrics first")