conduyt 1.20.0 → 1.21.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.
Files changed (2) hide show
  1. package/dist/index.js +32 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1832,7 +1832,7 @@ replyCapture
1832
1832
  // ---- lifecycle (master lead status + intake deals) ----
1833
1833
  const lifecycle = program
1834
1834
  .command("lifecycle")
1835
- .description("Lifecycle v2 settings: lead master statuses and automatic intake-deal creation");
1835
+ .description("Lifecycle settings: lead master statuses, intake-deal creation, how the tenant works leads, and lost propagation");
1836
1836
  lifecycle
1837
1837
  .command("settings")
1838
1838
  .description("Show the Lifecycle v2 configuration: masterStatuses.effective (the five defaults plus the account's customs) and intakeDeals (null can mean not configured OR not visible to your key — the setting is admin-visible only)")
@@ -1844,8 +1844,19 @@ lifecycle
1844
1844
  ? raw.masterStatuses.filter((x) => typeof x === "string")
1845
1845
  : [];
1846
1846
  const intakeDeals = raw.intakeDeals && typeof raw.intakeDeals === "object" ? raw.intakeDeals : null;
1847
+ // Lifecycle v3 (2026-09-08): how the tenant works leads + whether LOST propagation is live
1848
+ const dealWorkingMode = raw.dealWorkingMode === "pipeline" || raw.dealWorkingMode === "status" ? raw.dealWorkingMode : null;
1849
+ const lostRaw = raw.lostPropagation && typeof raw.lostPropagation === "object" ? raw.lostPropagation : null;
1847
1850
  return {
1848
1851
  data: {
1852
+ dealWorkingMode,
1853
+ ...(dealWorkingMode === null
1854
+ ? { dealWorkingModeNote: "null = not chosen yet — 'pipeline': every inbound contact gets a deal card (intake deals required); 'status': the contact is the opportunity" }
1855
+ : {}),
1856
+ lostPropagation: {
1857
+ enabled: lostRaw?.enabled === true,
1858
+ enabledAt: typeof lostRaw?.enabledAt === "string" ? lostRaw.enabledAt : null,
1859
+ },
1849
1860
  masterStatuses: {
1850
1861
  defaults: DEFAULTS,
1851
1862
  customs,
@@ -1860,6 +1871,26 @@ lifecycle
1860
1871
  },
1861
1872
  };
1862
1873
  }));
1874
+ lifecycle
1875
+ .command("set-working-mode <mode>")
1876
+ .description("Set how this tenant works leads (Lifecycle v3): pipeline = every inbound contact gets a deal card in the intake pipeline (intake deals must be enabled first; a new form/webhook/line cannot go live without a pipeline); status = the contact is the opportunity, no automatic cards. Switchable later.")
1877
+ .action(run(async (client, mode) => {
1878
+ if (mode !== "pipeline" && mode !== "status")
1879
+ throw new Error("mode must be 'pipeline' or 'status'.");
1880
+ return client.patch("/api/v1/settings", { dealWorkingMode: mode });
1881
+ }));
1882
+ lifecycle
1883
+ .command("set-lost-propagation")
1884
+ .description("Turn LOST propagation on or off (Lifecycle v3 P2). On: a contact flips to lost within a minute of its LAST open deal closing lost (carrying that deal's reason), a new open deal reopens a lost/abandoned/disqualified contact, a won contact never flips. Forward-only from the first enable. A lost contact silences every drip, sequence and playbook for that person — read the nightly shadow report (job run lost-propagation-shadow) before enabling.")
1885
+ .option("--enable", "flips happen live from now on")
1886
+ .option("--disable", "shadow report only")
1887
+ .action(run(async (client, opts) => {
1888
+ if (opts.enable && opts.disable)
1889
+ throw new Error("Pass either --enable or --disable, not both.");
1890
+ if (opts.enable === undefined && opts.disable === undefined)
1891
+ throw new Error("Pass --enable or --disable.");
1892
+ return client.patch("/api/v1/settings", { lostPropagation: { enabled: Boolean(opts.enable) } });
1893
+ }));
1863
1894
  lifecycle
1864
1895
  .command("set-intake-deals")
1865
1896
  .description("Configure automatic deal creation on live intake (webhooks, public forms, public bookings). Even under --re-inbound always: bulk imports and staff/calendar/dialer-created appointments never mint, exact replays and same-source events within 10 min are skipped, and terminal-status contacts get no new deals")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.20.0",
3
+ "version": "1.21.0",
4
4
  "description": "Command-line interface for Conduyt CRM — manage contacts, deals, pipelines, and run insight queries from your terminal.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",