@audienti/cli 0.1.4 → 0.1.6

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/CHANGELOG.md CHANGED
@@ -4,6 +4,38 @@ All notable changes to the Audienti CLI are documented here.
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.1.6] - 2026-07-12
8
+
9
+ ### Added
10
+
11
+ - Add `audienti writer test-run <prsp_id>` for a single-prospect campaign preview with the no-reply path, planned actions, channel changes, and drafted messages, plus `--mode plan` and `--mode step --step <step_key|row_number>` for fast simulator and targeted writer-debug runs.
12
+ - Add `audienti analytics prospects --cohort-start YYYY-MM-DD --cohort-end YYYY-MM-DD` to inspect prospects by the `AccountProspect.created_at` cohort while keeping `--window` for activity counts.
13
+ - Add `audienti analytics prospects cohort-analysis --weeks <n>` to compare recent weekly prospect cohorts by current pipeline-stage counts.
14
+ - Add `--motion <motn_id>` to prospect analytics so cohorts can be narrowed to one motion/play.
15
+ - Add `--provenance <source>` to prospect analytics for lower-level intake source filters.
16
+ - Add `audienti analytics users --user me` for account-user action audit analytics with date-range, cohort, motion, and provenance filters.
17
+ - Add `audienti motions analytics <motn_id>` to inspect one motion's produced-day prospect cohorts, current active/inactive mix, and funnel stages from `AccountProspect.created_at`.
18
+
19
+ ### Changed
20
+
21
+ - Group root help by work area and common workflow so `audienti help` is easier to scan.
22
+
23
+ ## [0.1.5] - 2026-07-11
24
+
25
+ ### Added
26
+
27
+ - Add the `https://cli.audienti.com/install` curl installer backed by the public CLI mirror and npm package.
28
+ - Add `audienti operator next --done|--skip|--fail|--return` shortcuts for recording the current prospect next-move outcome without hand-building a payload file.
29
+ - Add `audienti prospects add-profile` and `audienti prospects report-bad-profile` for updating prospect profile channels through the same server paths used by the prospect show page.
30
+
31
+ ### Changed
32
+
33
+ - Send fingerprinted `operator next` outcome shortcuts through the server-derived row contract so queue-row semantics stay on the API side.
34
+
35
+ ### Fixed
36
+
37
+ - Reject `audienti operator next --note` and `--occurred-at` unless an outcome flag is present.
38
+
7
39
  ## [0.1.4] - 2026-07-11
8
40
 
9
41
  ### Added
package/README.md CHANGED
@@ -8,6 +8,13 @@ manage plays, import prospects, build lists, and work supported operator flows.
8
8
 
9
9
  Requires Node.js 20 or newer.
10
10
 
11
+ ```bash
12
+ curl -fsSL https://cli.audienti.com/install | bash
13
+ audienti --help
14
+ ```
15
+
16
+ Or install directly through npm:
17
+
11
18
  ```bash
12
19
  npm install --global @audienti/cli
13
20
  audienti --help
@@ -45,11 +52,80 @@ Common inspection commands:
45
52
 
46
53
  ```bash
47
54
  audienti operator next --plan
55
+ audienti writer test-run <prsp_id>
56
+ audienti motions analytics <motn_id>
57
+ audienti prospects show <prsp_id> --json
58
+ audienti prospects list --profiles
48
59
  audienti analytics prospects --window 24h
60
+ audienti analytics users --user me --window 30d
49
61
  audienti analytics visibility --window 24h --user me
50
62
  audienti analytics content --window week
51
63
  ```
52
64
 
65
+ To work the supported prospect operator queue from the CLI, inspect the next move
66
+ and record the outcome against that same row:
67
+
68
+ ```bash
69
+ audienti operator next --plan
70
+ audienti operator next --done --note "Connection request sent."
71
+ ```
72
+
73
+ To inspect activity for prospects that entered the account during a specific
74
+ cohort while keeping a separate activity window:
75
+
76
+ ```bash
77
+ audienti analytics prospects --cohort-start 2026-07-01 --cohort-end 2026-07-07 --window 7d
78
+ ```
79
+
80
+ To compare recent weekly prospect cohorts by their current pipeline stages:
81
+
82
+ ```bash
83
+ audienti analytics prospects cohort-analysis --weeks 4 --motion <motn_id>
84
+ ```
85
+
86
+ To see whether one motion is producing prospects by day, and where each
87
+ produced-day cohort currently sits in the funnel:
88
+
89
+ ```bash
90
+ audienti motions analytics <motn_id>
91
+ ```
92
+
93
+ To audit one account user's outbound actions, optionally narrowed to one motion
94
+ and one AccountProspect.created_at cohort:
95
+
96
+ ```bash
97
+ audienti analytics users --user me --start 2026-07-01 --end 2026-07-07 --cohort-start 2026-06-01 --cohort-end 2026-06-30 --motion <motn_id>
98
+ ```
99
+
100
+ To run a writer campaign test for one prospect, including the no-reply path,
101
+ planned actions, channel changes, and drafted messages:
102
+
103
+ ```bash
104
+ audienti writer test-run <prsp_id>
105
+ ```
106
+
107
+ For fast simulator work, plan the branches without drafting every message:
108
+
109
+ ```bash
110
+ audienti writer test-run <prsp_id> --mode plan
111
+ ```
112
+
113
+ For writer debugging, draft only one selected timeline row on one branch:
114
+
115
+ ```bash
116
+ audienti writer test-run <prsp_id> --mode step --branch no-accept --step 3
117
+ ```
118
+
119
+ To update a prospect's attached profile channels through the same paths used by
120
+ the prospect show page:
121
+
122
+ ```bash
123
+ audienti prospects add-profile <prsp_id> --url prospect@example.com
124
+ audienti prospects add-profile <prsp_id> --url +12025550123
125
+ audienti prospects add-profile <prsp_id> --url https://www.linkedin.com/in/example
126
+ audienti prospects report-bad-profile <prsp_id> <prof_id>
127
+ ```
128
+
53
129
  ## Compatibility
54
130
 
55
131
  The CLI talks to the versioned Audienti `/api/v1` contract at
package/install ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ package="@audienti/cli"
5
+ binary="audienti"
6
+ minimum_node_major=20
7
+
8
+ say() {
9
+ printf '%s\n' "$*"
10
+ }
11
+
12
+ fail() {
13
+ printf 'Audienti CLI install failed: %s\n' "$*" >&2
14
+ exit 1
15
+ }
16
+
17
+ require_command() {
18
+ if ! command -v "$1" >/dev/null 2>&1; then
19
+ fail "$2"
20
+ fi
21
+ }
22
+
23
+ require_command node "Node.js ${minimum_node_major} or newer is required. Install Node.js, then rerun this script."
24
+ require_command npm "npm is required. Install Node.js ${minimum_node_major} or newer with npm, then rerun this script."
25
+
26
+ node_major="$(node -p 'Number(process.versions.node.split(".")[0])' 2>/dev/null || true)"
27
+ case "$node_major" in
28
+ ''|*[!0-9]*)
29
+ fail "could not determine the installed Node.js version."
30
+ ;;
31
+ esac
32
+
33
+ if [ "$node_major" -lt "$minimum_node_major" ]; then
34
+ fail "Node.js ${minimum_node_major} or newer is required. Current version: $(node --version)."
35
+ fi
36
+
37
+ say "Installing ${package}..."
38
+ npm install --global --no-audit --no-fund "$package"
39
+
40
+ global_prefix="$(npm prefix --global 2>/dev/null || true)"
41
+ if [ -n "$global_prefix" ] && [ -d "$global_prefix/bin" ]; then
42
+ export PATH="$global_prefix/bin:$PATH"
43
+ fi
44
+
45
+ if ! command -v "$binary" >/dev/null 2>&1; then
46
+ if [ -n "$global_prefix" ] && [ -x "$global_prefix/bin/$binary" ]; then
47
+ fail "${binary} installed at ${global_prefix}/bin/${binary}, but that directory is not on PATH."
48
+ fi
49
+
50
+ fail "${binary} was not found on PATH after installation."
51
+ fi
52
+
53
+ "$binary" --help >/dev/null
54
+
55
+ cat <<'NEXT'
56
+ Audienti CLI installed.
57
+
58
+ Next:
59
+ audienti auth token <token>
60
+ audienti accounts list --json
61
+ audienti accounts select <acct_id>
62
+ NEXT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@audienti/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "Agent-first command-line client for Audienti.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,6 +10,7 @@
10
10
  "bin/",
11
11
  "src/",
12
12
  "skills/",
13
+ "install",
13
14
  "README.md",
14
15
  "LICENSE",
15
16
  "CHANGELOG.md"
@@ -19,7 +19,7 @@ audienti --help
19
19
  2. If it is unavailable, install the public package:
20
20
 
21
21
  ```bash
22
- npm install --global @audienti/cli
22
+ curl -fsSL https://cli.audienti.com/install | bash
23
23
  ```
24
24
 
25
25
  3. Authentication is explicit and per machine. Do not ask a user to paste a
package/src/api-client.js CHANGED
@@ -189,6 +189,20 @@ export class AudientiClient {
189
189
  });
190
190
  }
191
191
 
192
+ addProspectProfile(accountId, prospectId, body) {
193
+ return this.requestJson(accountPath(accountId, ["prospects", prospectId, "profiles"]), {
194
+ method: "POST",
195
+ body
196
+ });
197
+ }
198
+
199
+ reportBadProspectProfile(accountId, prospectId, body) {
200
+ return this.requestJson(accountPath(accountId, ["prospects", prospectId, "report_bad_profile"]), {
201
+ method: "POST",
202
+ body
203
+ });
204
+ }
205
+
192
206
  prospectImport(accountId, body) {
193
207
  return this.requestJson(accountPath(accountId, ["prospect_imports"]), {
194
208
  method: "POST",
@@ -219,6 +233,10 @@ export class AudientiClient {
219
233
  return this.requestJson(accountPath(accountId, ["analytics", "prospects"], query));
220
234
  }
221
235
 
236
+ analyticsUsers(accountId, query = {}) {
237
+ return this.requestJson(accountPath(accountId, ["analytics", "users"], query));
238
+ }
239
+
222
240
  analyticsVisibility(accountId, query = {}) {
223
241
  return this.requestJson(accountPath(accountId, ["analytics", "visibility"], query));
224
242
  }
@@ -308,6 +326,10 @@ function errorMessage(status, body) {
308
326
  return "The requested Audienti resource was not found.";
309
327
  }
310
328
 
329
+ if (status === 409) {
330
+ return body?.error || "Audienti rejected the request because the resource changed. Re-fetch and try again.";
331
+ }
332
+
311
333
  if (status === 422) {
312
334
  const reasons = [body?.errors, body?.details].find(Array.isArray);
313
335
  const details = reasons?.length > 0 ? reasons.join(", ") : body?.error;