conduyt 1.45.0 → 1.46.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 +51 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2250,6 +2250,57 @@ async function readAgentStatusesConfig(client) {
2250
2250
  const hidden = Array.isArray(stored.hidden) ? stored.hidden.filter((c) => typeof c === "string") : [];
2251
2251
  return { labels, hidden };
2252
2252
  }
2253
+ // ---- Smart Dialing policy (#95/#96, 2026-09-16) ----
2254
+ const SMART_DIAL_CALLER_IDS = ["local_presence", "did"];
2255
+ const ADVANCE_ON_MODES = ["disposition", "timer"];
2256
+ function onOffArg(raw, flag) {
2257
+ const v = raw.trim().toLowerCase();
2258
+ if (v === "on" || v === "true" || v === "yes")
2259
+ return true;
2260
+ if (v === "off" || v === "false" || v === "no")
2261
+ return false;
2262
+ throw new Error(`${flag} takes on or off (got '${raw}').`);
2263
+ }
2264
+ dialer
2265
+ .command("settings")
2266
+ .description("Show the account's Smart Dialing policy (GET /dialer/settings, dialer scope): autoAdvanceEnabled, pauseSeconds, advanceOn (disposition | timer), openLeadOnDial (the lead's record opens as each Smart Dialing call goes out), smartDialCallerId (local_presence = an area-code match from the number pool, the rep's own line when no pool exists; did = always the rep's own line), plus localPresenceConfigured.")
2267
+ .action(run(async (client) => client.get("/api/v1/dialer/settings")));
2268
+ dialer
2269
+ .command("set-settings")
2270
+ .description("Change the account's Smart Dialing policy (PATCH /dialer/settings, settings scope). Pass only what changes: --auto-advance on|off, --pause-seconds 1-60, --advance-on disposition|timer, --open-lead on|off (the lead's record opens as each Smart Dialing call goes out), --calls-from local_presence|did.")
2271
+ .option("--auto-advance <on|off>", "start the next dial automatically after a call")
2272
+ .option("--pause-seconds <n>", "seconds between calls when auto-advance is on (1-60)")
2273
+ .option("--advance-on <mode>", "disposition | timer")
2274
+ .option("--open-lead <on|off>", "open the lead's record as each Smart Dialing call goes out")
2275
+ .option("--calls-from <line>", "local_presence | did")
2276
+ .action(run(async (client, opts) => {
2277
+ const body = {};
2278
+ if (opts.autoAdvance !== undefined)
2279
+ body.autoAdvanceEnabled = onOffArg(opts.autoAdvance, "--auto-advance");
2280
+ if (opts.pauseSeconds !== undefined) {
2281
+ const n = Number(opts.pauseSeconds);
2282
+ if (!Number.isInteger(n) || n < 1 || n > 60)
2283
+ throw new Error("--pause-seconds must be a whole number from 1 to 60.");
2284
+ body.pauseSeconds = n;
2285
+ }
2286
+ if (opts.advanceOn !== undefined) {
2287
+ const mode = opts.advanceOn.trim().toLowerCase();
2288
+ if (!ADVANCE_ON_MODES.includes(mode))
2289
+ throw new Error(`--advance-on must be one of ${ADVANCE_ON_MODES.join(", ")}.`);
2290
+ body.advanceOn = mode;
2291
+ }
2292
+ if (opts.openLead !== undefined)
2293
+ body.openLeadOnDial = onOffArg(opts.openLead, "--open-lead");
2294
+ if (opts.callsFrom !== undefined) {
2295
+ const line = opts.callsFrom.trim().toLowerCase();
2296
+ if (!SMART_DIAL_CALLER_IDS.includes(line))
2297
+ throw new Error(`--calls-from must be one of ${SMART_DIAL_CALLER_IDS.join(", ")}.`);
2298
+ body.smartDialCallerId = line;
2299
+ }
2300
+ if (Object.keys(body).length === 0)
2301
+ throw new Error("Nothing to change: pass at least one of --auto-advance, --pause-seconds, --advance-on, --open-lead, --calls-from.");
2302
+ return client.patch("/api/v1/dialer/settings", body);
2303
+ }));
2253
2304
  dialer
2254
2305
  .command("statuses")
2255
2306
  .description("List the account's curated dialer statuses (GET /dialer/agent-statuses): Available, Break, Lunch, Meeting, Training, Offline. Each carries a FIXED basis the dialer runs on (available = takes inbound calls and Smart Dialing hand-outs; break = signed in, not ringable; offline = signed out), the label reps see, and whether admins hid it from the softphone menu. Rename with `dialer rename-status`, hide/show with `dialer hide-status` / `dialer show-status`; Available and Offline can never be hidden. Reports bucket by basis.")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conduyt",
3
- "version": "1.45.0",
3
+ "version": "1.46.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",