conduyt 1.20.0 → 1.22.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 +35 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -69,7 +69,9 @@ contacts
69
69
  .option("--limit <n>", "max results")
70
70
  .option("--cursor <cursor>", "pagination cursor")
71
71
  .option("--query <q>", "search query")
72
- .action(run(async (client, opts) => client.get(`/api/v1/contacts${buildQuery({ limit: opts.limit, cursor: opts.cursor, query: opts.query })}`)));
72
+ .option("--master-status <list>", "only these lead statuses, comma-separated (open, won, lost, abandoned, disqualified, or an account custom status)")
73
+ .option("--exclude-master-status <list>", "hide these lead statuses, comma-separated — e.g. won,lost,abandoned,disqualified is the Active view")
74
+ .action(run(async (client, opts) => client.get(`/api/v1/contacts${buildQuery({ limit: opts.limit, cursor: opts.cursor, query: opts.query, master_status: opts.masterStatus, exclude_master_status: opts.excludeMasterStatus })}`)));
73
75
  contacts
74
76
  .command("get <id>")
75
77
  .description("Get a single contact by id")
@@ -1832,7 +1834,7 @@ replyCapture
1832
1834
  // ---- lifecycle (master lead status + intake deals) ----
1833
1835
  const lifecycle = program
1834
1836
  .command("lifecycle")
1835
- .description("Lifecycle v2 settings: lead master statuses and automatic intake-deal creation");
1837
+ .description("Lifecycle settings: lead master statuses, intake-deal creation, how the tenant works leads, and lost propagation");
1836
1838
  lifecycle
1837
1839
  .command("settings")
1838
1840
  .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 +1846,19 @@ lifecycle
1844
1846
  ? raw.masterStatuses.filter((x) => typeof x === "string")
1845
1847
  : [];
1846
1848
  const intakeDeals = raw.intakeDeals && typeof raw.intakeDeals === "object" ? raw.intakeDeals : null;
1849
+ // Lifecycle v3 (2026-09-08): how the tenant works leads + whether LOST propagation is live
1850
+ const dealWorkingMode = raw.dealWorkingMode === "pipeline" || raw.dealWorkingMode === "status" ? raw.dealWorkingMode : null;
1851
+ const lostRaw = raw.lostPropagation && typeof raw.lostPropagation === "object" ? raw.lostPropagation : null;
1847
1852
  return {
1848
1853
  data: {
1854
+ dealWorkingMode,
1855
+ ...(dealWorkingMode === null
1856
+ ? { dealWorkingModeNote: "null = not chosen yet — 'pipeline': every inbound contact gets a deal card (intake deals required); 'status': the contact is the opportunity" }
1857
+ : {}),
1858
+ lostPropagation: {
1859
+ enabled: lostRaw?.enabled === true,
1860
+ enabledAt: typeof lostRaw?.enabledAt === "string" ? lostRaw.enabledAt : null,
1861
+ },
1849
1862
  masterStatuses: {
1850
1863
  defaults: DEFAULTS,
1851
1864
  customs,
@@ -1860,6 +1873,26 @@ lifecycle
1860
1873
  },
1861
1874
  };
1862
1875
  }));
1876
+ lifecycle
1877
+ .command("set-working-mode <mode>")
1878
+ .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.")
1879
+ .action(run(async (client, mode) => {
1880
+ if (mode !== "pipeline" && mode !== "status")
1881
+ throw new Error("mode must be 'pipeline' or 'status'.");
1882
+ return client.patch("/api/v1/settings", { dealWorkingMode: mode });
1883
+ }));
1884
+ lifecycle
1885
+ .command("set-lost-propagation")
1886
+ .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.")
1887
+ .option("--enable", "flips happen live from now on")
1888
+ .option("--disable", "shadow report only")
1889
+ .action(run(async (client, opts) => {
1890
+ if (opts.enable && opts.disable)
1891
+ throw new Error("Pass either --enable or --disable, not both.");
1892
+ if (opts.enable === undefined && opts.disable === undefined)
1893
+ throw new Error("Pass --enable or --disable.");
1894
+ return client.patch("/api/v1/settings", { lostPropagation: { enabled: Boolean(opts.enable) } });
1895
+ }));
1863
1896
  lifecycle
1864
1897
  .command("set-intake-deals")
1865
1898
  .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.22.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",