@series-a/cli 0.7.1 → 0.15.1

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,61 @@ All notable changes to this package are documented here. This project follows
4
4
  [Semantic Versioning](https://semver.org/) and uses
5
5
  [Changesets](https://github.com/changesets/changesets) to manage releases.
6
6
 
7
+ ## 0.15.0 — Newsletter audiences and sending
8
+
9
+ - `advisoros audiences create|edit|delete|add-leads|remove-leads` — full CRUD for smart audiences (lead segments), not just read + enrol.
10
+ - `advisoros newsletter audience-create|audience-show|audience-edit|audience-delete` — manage mailing audiences; mirrored to Resend automatically when the workspace has it connected, local-only when it does not.
11
+ - `advisoros newsletter contact-add|contacts-import|contact-remove|contact-unsubscribe` — contact management including CSV bulk import.
12
+ - `advisoros newsletter sync-segment <segmentId> <audienceId>` — push a smart audience's leads into a mailing audience.
13
+ - `advisoros newsletter send|test|render|metrics` — send now, schedule, test-send, render HTML, and read delivery totals, open/click/bounce rates and sending health.
14
+ - New Agent API actions on `audiences` and `newsletter`; MCP gains `manage_audience` and `send_newsletter` (44 tools, manifest 0.12.0).
15
+
16
+ ## 0.14.0 — Daily reports
17
+
18
+ - `advisoros reports list` — browse persisted daily reports (past and present) per workspace, with status, activity totals and recipient/sent counts.
19
+ - `advisoros reports show <id|YYYY-MM-DD>` — full report detail including stats and the shareable dashboard URL.
20
+ - `advisoros reports generate` — run the daily-report engine on demand; dry-run by default, `--send` emails all workspace members, `--to <email>` sends a single test copy.
21
+ - Backed by the new Agent API `daily_reports` resource (`list` / `get` / `generate`).
22
+
23
+ ## 0.13.0 — Full lifecycle + scheduling engine
24
+
25
+ - Campaign lifecycle is complete from the terminal: `campaigns update` (name, goal, sequence, sender accounts, daily send limit — no longer create-time-only), `launch`, `pause`, `resume`, `archive`, `clone`, and `delete` (dry-run preview by default, `--force` to execute, blocked when the campaign has dispatched activity unless forced).
26
+ - Sequence editing: `sequences update-step`, `delete-step`, and `replace-steps` — steps are no longer append-only. Graph validation flags disconnected nodes and cycles before launch.
27
+ - Scheduling engine awareness: calendar/schedule commands report whether a workspace will publish via Taplio (when connected) or the built-in cron scheduler, so automation targets the right engine.
28
+ - Live counts after writes: campaign and sequence mutations re-read the record and return live stats, clearly separated from the stored snapshot which may lag.
29
+ - Clearer errors under load: the API now returns a typed 429 with retry-after guidance instead of empty lists during heavy automation; the CLI surfaces this plainly.
30
+
31
+ ## 0.12.0 — Agent audit trail
32
+
33
+ - `advisoros audit list/show/stats` — query the durable per-workspace audit log of every CLI/MCP/Agent API action (actor, surface, action, outcome, duration, correlation ID).
34
+ - CLI requests now send actor/client/version headers so audit records attribute actions to the right user and CLI version.
35
+ - `login` persists the profile email for audit attribution.
36
+
37
+ ## 0.11.0 — Video management
38
+
39
+ - `videos` resource group: `list`, `show`, `create`, `generate`, `update`, `publish`, `unpublish`, `refresh`, `delete` against video projects, with workspace scoping and destructive-action confirmation.
40
+
41
+ ## 0.10.0 — Calendar & Command Centre write access
42
+
43
+ - Full content calendar read/write/delete/schedule via CLI, with bulk operations and engine-aware scheduling (Taplio when connected, built-in cron otherwise).
44
+ - Command Centre content management: update, approve, schedule, unschedule, and publish-now actions.
45
+
46
+ ## 0.9.0 — Tone of Voice
47
+
48
+ - Full Tone of Voice support: workspace configuration, writing-sample references, benchmark pinning, voice cards, scoring/redrafting, and report CRUD.
49
+
50
+ ## 0.8.0 — Content Strategy
51
+
52
+ - Full content strategy read/write: create, list, show, update, delete strategies; manage strategy posts; retry/resume generation.
53
+
54
+ ## 0.7.0 — Hardening & admin keys
55
+
56
+ - Shared typed errors with machine-readable codes across all commands.
57
+ - Cursor pagination up to 1,000 items per page.
58
+ - Destructive actions require explicit confirmation (`--confirm` / `--force`).
59
+ - `login --admin` for admin API keys, `--as-agent` impersonation flag, and `whoami` scope reporting.
60
+ - Admin keys (`advos_admin_…`) authorize from key scope alone and work across all workspaces.
61
+
7
62
  ## 0.6.1 — Campaign editing
8
63
 
9
64
  - `campaigns` — added `update`/`edit` (name, description, goal, sequence, sender accounts, daily send limit, launch stage, status). Mirrors the new `update_campaign` MCP tool.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@series-a/cli",
3
- "version": "0.7.1",
3
+ "version": "0.15.1",
4
4
  "description": "AdvisorPro command-line interface — drive leads, campaigns, sequences and agents from your terminal.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/api.mjs CHANGED
@@ -1,5 +1,15 @@
1
+ import { randomUUID } from "node:crypto";
2
+ import { createRequire } from "node:module";
1
3
  import { getProfile, DEFAULTS } from "./config.mjs";
2
4
 
5
+ const CLI_VERSION = (() => {
6
+ try {
7
+ return createRequire(import.meta.url)("../package.json").version;
8
+ } catch {
9
+ return "unknown";
10
+ }
11
+ })();
12
+
3
13
  export class AdvisorOSApiError extends Error {
4
14
  constructor(message, { status, body } = {}) {
5
15
  super(message);
@@ -32,6 +42,11 @@ export async function call(resource, action, params = {}, opts = {}) {
32
42
  stored?.agentName ||
33
43
  "advisoros-cli";
34
44
 
45
+ const actorEmail =
46
+ opts.actorEmail || process.env.ADVISOROS_ACTOR_EMAIL || stored?.email || null;
47
+ const actorUserId =
48
+ opts.actorUserId || process.env.ADVISOROS_ACTOR_USER_ID || stored?.userId || null;
49
+
35
50
  if (!apiKey) {
36
51
  throw new AdvisorOSApiError(
37
52
  "No API key configured. Run `advisoros login` or set ADVISOROS_API_KEY.",
@@ -59,6 +74,12 @@ export async function call(resource, action, params = {}, opts = {}) {
59
74
  headers: {
60
75
  "Content-Type": "application/json",
61
76
  "x-service-account-key": apiKey,
77
+ "x-surface": "cli",
78
+ "x-client-name": "advisoros-cli",
79
+ "x-client-version": CLI_VERSION,
80
+ "x-correlation-id": opts.correlationId || randomUUID(),
81
+ ...(actorUserId ? { "x-actor-user-id": actorUserId } : {}),
82
+ ...(actorEmail ? { "x-actor-email": actorEmail } : {}),
62
83
  },
63
84
  body: JSON.stringify(body),
64
85
  });
@@ -14,6 +14,7 @@ export function registerAuth(program) {
14
14
  .option("--admin", "admin key login — verify cross-workspace, no workspace required", false)
15
15
  .option("--base-url <url>", "agent-api base URL", DEFAULTS.baseUrl)
16
16
  .option("--as-agent <name>", "caller identity to send as agent_name", "advisoros-cli")
17
+ .option("--email <email>", "your email — recorded on the audit trail for every action")
17
18
  .action(async (opts) => {
18
19
  try {
19
20
  let { apiKey, workspace, baseUrl, profile } = opts;
@@ -49,7 +50,7 @@ export function registerAuth(program) {
49
50
  apiKey, baseUrl, agentName,
50
51
  });
51
52
  const count = verify?.pagination?.total ?? verify?.workspaces?.length ?? 0;
52
- await setProfile(profile, { apiKey, baseUrl, admin: true, agentName, ...(workspace ? { workspaceId: workspace } : {}) });
53
+ await setProfile(profile, { apiKey, baseUrl, admin: true, agentName, ...(opts.email ? { email: opts.email } : {}), ...(workspace ? { workspaceId: workspace } : {}) });
53
54
  process.stdout.write(chalk.green(
54
55
  `\n✓ Logged in as admin profile "${profile}" — ${count} workspaces reachable\n` +
55
56
  ` Config: ${CONFIG_PATH}\n` +
@@ -63,7 +64,7 @@ export function registerAuth(program) {
63
64
  apiKey, workspaceId: workspace, baseUrl, agentName,
64
65
  });
65
66
  const count = verify?.agents?.length ?? 0;
66
- await setProfile(profile, { apiKey, workspaceId: workspace, baseUrl, agentName });
67
+ await setProfile(profile, { apiKey, workspaceId: workspace, baseUrl, agentName, ...(opts.email ? { email: opts.email } : {}) });
67
68
  process.stdout.write(chalk.green(
68
69
  `\n✓ Logged in as profile "${profile}" — workspace ${workspace} (${count} agents visible)\n` +
69
70
  ` Config: ${CONFIG_PATH}\n`,