@oxygen-agent/cli 1.1045.27 → 1.1046.48

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/README.md CHANGED
@@ -34,4 +34,4 @@ oxygen update
34
34
 
35
35
  For product documentation, visit https://oxygen-agent.com/docs. For support, visit https://oxygen-agent.com.
36
36
 
37
- Version: 1.1045.27
37
+ Version: 1.1046.48
@@ -843,13 +843,13 @@ export function registerMailboxesFamily(program, handleAsyncAction) {
843
843
  : requestOxygen(`/api/cli/mailboxes/sync?${new URLSearchParams({ mailbox }).toString()}`));
844
844
  }))
845
845
  .addCommand(new Command("connect-oauth")
846
- .description("Connect Gmail/Microsoft 365 with --vendor composio to import all mail into Unibox and business activity into CRM. The recurring rate is 100 credits per standard mailbox-month or 25 for Entra, including history, sync and analysis; previews cost 0, with no extra execution fee. Before consent, inspect current monthly connection prices and first-debit timing with billing commitments --view connection-prices --json. Quote a standard mailbox count with billing estimate --mailboxes <n> --json; the managed preview shows the listed rate; an unavailable managed Gmail connection directs you to OXYGEN support, and an unavailable managed Microsoft connection offers OXYGEN's own sign-in (--vendor oxygen --authorization-mode individual) as an explicit, sending-only choice. Managed OAuth requires provider rollout readiness and exact registered addresses, max 10. Use mailboxes sync for progress and pause/resume/disconnect. Composio uses individual owner consent only. Native --vendor oxygen retains its existing polling; full history/CRM requires managed reconnection. Warm-up retains its existing eligibility and pricing. Preview by default; pass --approved only after reviewing exact candidates. --vendor oxygen requires an exact address list and never discovers a domain directory. For --vendor oxygen only, Microsoft supports --authorization-mode tenant (one administrator approval, up to 500 exact selected addresses, recommended for dedicated sending tenants) or individual (one account sign-in per mailbox, max 10 per run, recommended for ordinary company/personal mailboxes). For Microsoft's built-in roles, tenant mode requires a Global Administrator or Privileged Role Administrator because it requests the Microsoft Graph application Mail.Send and Mail.Read permissions; Application Administrator and Cloud Application Administrator cannot consent to Microsoft Graph application roles. Microsoft's application grant is tenant-wide at the provider; OXYGEN—not Microsoft—enforces the selected-address boundary at verification and send time unless the tenant separately configures Exchange Application RBAC. For non-managed Microsoft mailboxes, native-send approval does not authorize OXYGEN Warm-up: every mailbox still needs its own `mailboxes warmup microsoft` Outlook consent before standalone enrollment. Connecting authorization does not change whether a mailbox is active or disabled. Google uses individual OAuth; --google-smtp with vendor=oxygen explicitly previews full-mail SMTP OAuth consent. Source tokens, passwords, authenticator seeds, and one-time codes never transfer. Managed authorization paths remain available through their vendor options.")
846
+ .description("Connect Gmail/Microsoft 365 with --vendor composio to import all mail into Unibox and business activity into CRM. The recurring rate is 100 credits per standard mailbox-month or 25 for Entra, including history, sync and analysis; previews cost 0, with no extra execution fee. Before consent, inspect current monthly connection prices and first-debit timing with billing commitments --view connection-prices --json. Quote a standard mailbox count with billing estimate --mailboxes <n> --json; the managed preview shows the listed rate; an unavailable managed Gmail connection directs you to OXYGEN support, and an unavailable managed Microsoft connection offers OXYGEN's own sign-in (--vendor oxygen --authorization-mode individual) as an explicit, sending-only choice. Managed OAuth requires provider rollout readiness and exact registered addresses, max 10. Use mailboxes sync for progress and pause/resume/disconnect. Composio uses individual owner consent only. Native --vendor oxygen retains its existing polling; full history/CRM requires managed reconnection. Warm-up retains its existing eligibility and pricing. Preview by default; pass --approved only after reviewing exact candidates. --vendor oxygen requires an exact address list and never discovers a domain directory. For --vendor oxygen only, Microsoft supports --authorization-mode tenant (one administrator approval, up to 500 exact selected addresses, recommended for dedicated sending tenants) or individual (one account sign-in per mailbox, max 10 per run, recommended for ordinary company/personal mailboxes). For Microsoft's built-in roles, tenant mode requires a Global Administrator or Privileged Role Administrator because it requests the Microsoft Graph application Mail.Send and Mail.Read permissions; Application Administrator and Cloud Application Administrator cannot consent to Microsoft Graph application roles. Microsoft's application grant is tenant-wide at the provider; OXYGEN—not Microsoft—enforces the selected-address boundary at verification and send time unless the tenant separately configures Exchange Application RBAC. For non-managed Microsoft mailboxes, native-send approval does not authorize OXYGEN Warm-up: every mailbox still needs its own `mailboxes warmup microsoft` Outlook consent before standalone enrollment. Connecting authorization does not change whether a mailbox is active or disabled. Google uses individual OAuth; --google-smtp with vendor=oxygen or vendor=inboxkit explicitly previews full-mail SMTP OAuth consent. Source tokens, passwords, authenticator seeds, and one-time codes never transfer. Managed authorization paths remain available through their vendor options.")
847
847
  .addHelpText("after", "\nDocs: https://oxygen-agent.com/docs/providers/mailboxes\n")
848
848
  .option("--provider <provider>", "Mailbox provider: google or microsoft.")
849
849
  .option("--vendor <vendor>", "Authorization path: composio for customer-owned Gmail/Microsoft 365 with managed consent, history and CRM; oxygen for native/tenant consent; zapmail (default) or inboxkit for provisioned inboxes.")
850
850
  .option("--mailboxes <list>", "Comma-separated exact mailbox addresses. Required for vendor=composio (max 10) or vendor=oxygen (tenant mode max 500; individual mode max 10).")
851
851
  .option("--authorization-mode <mode>", "vendor=oxygen only: auto, tenant, or individual. Tenant is Microsoft-only and never scans the directory.")
852
- .option("--google-smtp", "oxygen + google only: request full-mail OAuth access for SMTP XOAUTH2. Preview scopes before approval.")
852
+ .option("--google-smtp", "google with vendor oxygen or inboxkit: request full-mail OAuth access for SMTP XOAUTH2 (inboxkit re-asks managed mailboxes that lack it). Preview scopes before approval.")
853
853
  .option("--domains <list>", "Comma-separated sending domains to limit an inboxkit run to. Omit to cover every domain in the pool.")
854
854
  .option("--no-canary", "inboxkit only: fan out to every eligible mailbox on a domain that has never connected one, instead of firing a single canary first.")
855
855
  .option("--connection <id>", "Zapmail connection id. Defaults to the org's active Zapmail connection.")
@@ -1272,7 +1272,7 @@ export function registerMailboxesFamily(program, handleAsyncAction) {
1272
1272
  });
1273
1273
  }))
1274
1274
  .addCommand(new Command("reconnect")
1275
- .description("Manual repair for an existing live paid seat when automatic credential repair is disabled, exhausted, or needs a new credential: push the mailbox's CURRENT credential to its warmup provider. Use this when a new app password is needed because the old one was rotated or revoked (the provider reporting 'Username and Password not accepted'): re-import the new credential with `mailboxes import`, then run this. It costs 0 credits and leaves your warmup subscription and its renewal date exactly as they are — you do NOT need to disable and re-enable warmup, which would charge a second month. The provider cannot change a stored password in place, so the inbox's warmup history restarts from day 1. Targets the whole pool unless --mailboxes is given.")
1275
+ .description("Manual repair for an existing live paid seat when automatic credential repair is disabled, exhausted, or needs a new credential: push the mailbox's CURRENT credential to its warmup provider. Use this when a new app password is needed because the old one was rotated or revoked (the provider reporting 'Username and Password not accepted'): re-import the new credential with `mailboxes import`, then run this. It costs 0 credits and leaves your warmup subscription and its renewal date exactly as they are — you do NOT need to disable and re-enable warmup, which would charge a second month. The provider cannot change a stored password in place, so the inbox's warmup history restarts from day 1. A Microsoft inbox has no password: for a managed InboxKit one, reconnect replaces the seat through a fresh native export; a consent-connected one is refused. Targets the whole pool unless --mailboxes is given.")
1276
1276
  .option("--mailboxes <list>", "Comma-separated mailbox ids or addresses. Omit for the whole pool.")
1277
1277
  .option("--json", "Print a JSON envelope.")
1278
1278
  .action(async (options) => {
@@ -77,24 +77,31 @@ export function registerSendersFamily(program, handleAsyncAction) {
77
77
  });
78
78
  }))
79
79
  .addCommand(new Command("inbox-scope")
80
- .description("Inspect or change which LinkedIn conversations OXYGEN stores for one sender. Scope changes are internal and zero-credit: they do not sync LinkedIn or send a message.")
80
+ .description("Inspect or change which LinkedIn conversations OXYGEN stores for one sender, and which of them AI reply classification covers. Scope changes are internal and zero-credit: they do not sync LinkedIn or send a message.")
81
81
  .addCommand(new Command("get")
82
- .description("Show whether a sender syncs only OXYGEN-started conversations or its entire LinkedIn inbox.")
82
+ .description("Show whether a sender syncs only OXYGEN-started conversations or its entire LinkedIn inbox, and which chats AI reply classification covers.")
83
83
  .argument("<id>", "Sender account id, connection id, or Unipile account id.")
84
84
  .option("--json", "Print a JSON envelope.")
85
85
  .action(async (id, options) => {
86
86
  await handleAsyncAction("senders inbox-scope get", options, () => requestOxygen(`/api/cli/senders/${encodeURIComponent(id)}/inbox-scope`));
87
87
  }))
88
88
  .addCommand(new Command("set")
89
- .description("Set LinkedIn inbox privacy. oxygen_initiated hides and stops ingesting unrelated chats; all opts into the full inbox. This internal, zero-credit change does not trigger a provider sync or send a message. Existing stored messages are not deleted.")
89
+ .description("Set LinkedIn inbox privacy (--scope), which stored chats AI reply classification covers (--classify), or both. oxygen_initiated hides and stops ingesting unrelated chats; all opts into the full inbox. This internal, zero-credit change does not trigger a provider sync or send a message. Existing stored messages are not deleted.")
90
90
  .argument("<id>", "Sender account id, connection id, or Unipile account id.")
91
- .requiredOption("--scope <scope>", "oxygen_initiated or all.")
91
+ .option("--scope <scope>", "oxygen_initiated or all.")
92
+ .option("--classify <scope>", "Which stored chats AI reply classification triages (each classified chat uses credits): all (default), oxygen_initiated (chats OXYGEN started and chats with leads of your Sequences on this account; other chats stay in Unibox unclassified at no cost) or off (none; a campaign that pauses the company on reply then keeps it paused until you resume it). Applies to new messages.")
92
93
  .option("--json", "Print a JSON envelope.")
93
94
  .action(async (id, options) => {
94
- await handleAsyncAction("senders inbox-scope set", options, () => requestOxygen(`/api/cli/senders/${encodeURIComponent(id)}/inbox-scope`, {
95
- method: "PATCH",
96
- body: { scope: options.scope },
97
- }));
95
+ await handleAsyncAction("senders inbox-scope set", options, () => {
96
+ const scope = readOption(options.scope);
97
+ const classify = readOption(options.classify);
98
+ if (!scope && !classify)
99
+ throw new Error("Provide --scope, --classify, or both.");
100
+ return requestOxygen(`/api/cli/senders/${encodeURIComponent(id)}/inbox-scope`, {
101
+ method: "PATCH",
102
+ body: { ...(scope ? { scope } : {}), ...(classify ? { classification_scope: classify } : {}) },
103
+ });
104
+ });
98
105
  })))
99
106
  .addCommand(new Command("proxy-country")
100
107
  .description("Move a LinkedIn sender's automatic proxy to another country without reconnecting. The account picks a proxy there at once when one is free; otherwise its sequences stay paused and each `senders sync` asks again. Zero credits.")
@@ -47,6 +47,7 @@ export function registerSuppressionsFamily(program, handleAsyncAction) {
47
47
  .requiredOption("--rule <key>", "Rule key from `policy show` (e.g. linkedin_reply, whatsapp_reply, email_hard_bounce, reply_status:not_interested).")
48
48
  .requiredOption("--effect <effect>", "off (do nothing), stop_only (end this enrollment only) or suppress (also add to the do-not-contact list).")
49
49
  .option("--reason <reason>", "Reason stamped on the list entry when the rule suppresses. Defaults to the rule's own.")
50
+ .option("--applies-to <which>", "linkedin_reply only: all (every inbound message, the default) or enrolled (only someone enrolled in a Sequence on that LinkedIn account, so people who write to you by hand are not added). Omitted keeps the current choice.")
50
51
  .option("--json", "Print a JSON envelope.")
51
52
  .action(async (options) => {
52
53
  await handleAsyncAction("suppressions policy set", options, () => {
@@ -57,9 +58,10 @@ export function registerSuppressionsFamily(program, handleAsyncAction) {
57
58
  if (!effect)
58
59
  throw new Error("--effect is required.");
59
60
  const reason = readOption(options.reason);
61
+ const appliesTo = readOption(options.appliesTo);
60
62
  return requestOxygen("/api/cli/suppressions/policy", {
61
63
  method: "POST",
62
- body: { rule, effect, ...(reason ? { reason } : {}) },
64
+ body: { rule, effect, ...(reason ? { reason } : {}), ...(appliesTo ? { applies_to: appliesTo } : {}) },
63
65
  });
64
66
  });
65
67
  }))
@@ -3,6 +3,8 @@ export declare const PLACEMENT_REPORT_WAIT_MS: number;
3
3
  export declare const INCOMPLETE_PLACEMENT_MESSAGE = "This test is incomplete. Available seed results are shown.";
4
4
  /** Machine-readable reason on a report settled because the vendor closed seeds before our probe left. */
5
5
  export declare const SEEDS_CLOSED_BEFORE_SEND = "seeds_closed_before_send";
6
+ /** Machine-readable reason on a report settled because no seed received a probe whose send was never confirmed. */
7
+ export declare const SEED_DELIVERY_UNCONFIRMED = "seed_delivery_unconfirmed";
6
8
  export declare function placementReportDeadline(provider: string, results: unknown): string | null;
7
9
  export declare function placementReportExpired(provider: string, results: unknown, now?: number): boolean;
8
10
  /**
@@ -13,5 +15,12 @@ export declare function placementReportExpired(provider: string, results: unknow
13
15
  * Date.parse truncates them to milliseconds.
14
16
  */
15
17
  export declare function placementSeedsClosedBeforeSend(provider: string, currentResults: unknown, pollResults: unknown): boolean;
18
+ /**
19
+ * True when the seed send was never confirmed (receipt `uncertain`) and every seed
20
+ * row reports no receipt (T-463). Such misses cannot tell a blocked probe from one
21
+ * that never left the mailbox, so they measure nothing. Without seed rows there is
22
+ * no evidence either way and a supplier score stands.
23
+ */
24
+ export declare function placementUnconfirmedSendNeverReceived(provider: string, currentResults: unknown, pollResults: unknown): boolean;
16
25
  /** Customer copy follows the persisted settlement receipt, never an inferred balance. */
17
26
  export declare function placementRefundMessage(value: unknown): string;
@@ -3,21 +3,30 @@ export const PLACEMENT_REPORT_WAIT_MS = 2 * 60 * 60 * 1000;
3
3
  export const INCOMPLETE_PLACEMENT_MESSAGE = "This test is incomplete. Available seed results are shown.";
4
4
  /** Machine-readable reason on a report settled because the vendor closed seeds before our probe left. */
5
5
  export const SEEDS_CLOSED_BEFORE_SEND = "seeds_closed_before_send";
6
- /** Confirmed EmailGuard seed-send time in epoch ms, or null without valid send evidence. */
7
- function confirmedSendMs(provider, results) {
6
+ /** Machine-readable reason on a report settled because no seed received a probe whose send was never confirmed. */
7
+ export const SEED_DELIVERY_UNCONFIRMED = "seed_delivery_unconfirmed";
8
+ function seedReceipt(provider, results) {
8
9
  if (provider !== "emailguard" || !results || typeof results !== "object")
9
10
  return null;
10
11
  const receipt = results.seed_delivery;
11
- if (!receipt || typeof receipt !== "object")
12
- return null;
13
- const send = receipt;
14
- if (send.status !== "sent" || typeof send.sent_at !== "string")
12
+ return receipt && typeof receipt === "object" && !Array.isArray(receipt) ? receipt : null;
13
+ }
14
+ /**
15
+ * EmailGuard seed-send time in epoch ms, or null without send evidence: a confirmed
16
+ * send's `sent_at`, or, when the transport's outcome is unknown (the outbound job
17
+ * ended `uncertain` and is never retried), the time that verdict was recorded. The
18
+ * report then decides whether the probe landed.
19
+ */
20
+ function seedSendMs(provider, results) {
21
+ const send = seedReceipt(provider, results);
22
+ const at = send?.status === "sent" ? send.sent_at : send?.status === "uncertain" ? send.uncertain_at : null;
23
+ if (typeof at !== "string")
15
24
  return null;
16
- const sent = Date.parse(send.sent_at);
25
+ const sent = Date.parse(at);
17
26
  return Number.isFinite(sent) ? sent : null;
18
27
  }
19
28
  export function placementReportDeadline(provider, results) {
20
- const sent = confirmedSendMs(provider, results);
29
+ const sent = seedSendMs(provider, results);
21
30
  return sent === null ? null : new Date(sent + PLACEMENT_REPORT_WAIT_MS).toISOString();
22
31
  }
23
32
  export function placementReportExpired(provider, results, now = Date.now()) {
@@ -35,7 +44,7 @@ const NOT_RECEIVED_FOLDERS = new Set(["missing", "not_received", "not_found"]);
35
44
  * Date.parse truncates them to milliseconds.
36
45
  */
37
46
  export function placementSeedsClosedBeforeSend(provider, currentResults, pollResults) {
38
- const sent = confirmedSendMs(provider, currentResults);
47
+ const sent = seedSendMs(provider, currentResults);
39
48
  if (sent === null || !pollResults || typeof pollResults !== "object")
40
49
  return false;
41
50
  const emails = pollResults.emails;
@@ -54,6 +63,27 @@ export function placementSeedsClosedBeforeSend(provider, currentResults, pollRes
54
63
  return Number.isFinite(closed) && closed < sent;
55
64
  });
56
65
  }
66
+ const RECEIVED = new Set(["email_received", "received"]);
67
+ /**
68
+ * True when the seed send was never confirmed (receipt `uncertain`) and every seed
69
+ * row reports no receipt (T-463). Such misses cannot tell a blocked probe from one
70
+ * that never left the mailbox, so they measure nothing. Without seed rows there is
71
+ * no evidence either way and a supplier score stands.
72
+ */
73
+ export function placementUnconfirmedSendNeverReceived(provider, currentResults, pollResults) {
74
+ if (seedReceipt(provider, currentResults)?.status !== "uncertain")
75
+ return false;
76
+ const emails = pollResults && typeof pollResults === "object" ? pollResults.emails : null;
77
+ if (!Array.isArray(emails) || emails.length === 0)
78
+ return false;
79
+ return !emails.some((value) => {
80
+ if (!value || typeof value !== "object")
81
+ return false;
82
+ const row = value;
83
+ return typeof row.status === "string" && RECEIVED.has(row.status.toLowerCase())
84
+ && typeof row.folder === "string" && !NOT_RECEIVED_FOLDERS.has(row.folder.toLowerCase());
85
+ });
86
+ }
57
87
  /** Customer copy follows the persisted settlement receipt, never an inferred balance. */
58
88
  export function placementRefundMessage(value) {
59
89
  if (!value || typeof value !== "object")
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Which stored chats of a LinkedIn account the paid reply classifier triages
3
+ * (Tim's support autopilot, 2026-11-16, T-452; the email twin is
4
+ * email-classification-scope.ts, T-316). Inbox scope decides which chats enter
5
+ * OXYGEN; this decides which of those cost a classification.
6
+ *
7
+ * - `all` (default): every chat the inbox scope admits, as before this setting.
8
+ * - `oxygen_initiated`: chats OXYGEN started (the chats an `oxygen_initiated`
9
+ * inbox shows) and chats with a lead of a Sequence on this account (what
10
+ * reply-stop counts as a campaign reply). Chats someone started by hand stay
11
+ * in Unibox unclassified, at no cost.
12
+ * - `off`: none. A campaign that pauses the company on reply then keeps that
13
+ * company paused until someone resumes it, since no classification decides it.
14
+ *
15
+ * An unclassified chat gets no AI status, so no reply draft, hot-lead
16
+ * notification, reply-classification do-not-contact rule or CRM lead-stage move
17
+ * (a message from someone already in the CRM is still logged on their record).
18
+ * Reply-stop and the `linkedin_reply` do-not-contact rule never depend on
19
+ * classification. tenant-db's `dmClassificationInScopeSql` is the SQL twin.
20
+ */
21
+ export declare const LINKEDIN_CLASSIFICATION_SCOPES: readonly ["all", "oxygen_initiated", "off"];
22
+ export type LinkedInClassificationScope = (typeof LINKEDIN_CLASSIFICATION_SCOPES)[number];
23
+ /** Sender-account metadata key holding an explicit choice. */
24
+ export declare const LINKEDIN_CLASSIFICATION_SCOPE_KEY = "classification_scope";
25
+ export type LinkedInClassificationScopeView = {
26
+ scope: LinkedInClassificationScope;
27
+ /** `setting` when someone chose it; `default` otherwise. */
28
+ source: "setting" | "default";
29
+ };
30
+ export declare function isLinkedInClassificationScope(value: unknown): value is LinkedInClassificationScope;
31
+ /** The scope a LinkedIn account's chats are classified under. An unknown stored value reads as the default. */
32
+ export declare function resolveLinkedInClassificationScope(metadata: Record<string, unknown> | null | undefined): LinkedInClassificationScopeView;
33
+ /** One customer-facing sentence per scope for the CLI/MCP envelope. */
34
+ export declare const LINKEDIN_CLASSIFICATION_SCOPE_BEHAVIOR: Record<LinkedInClassificationScope, string>;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Which stored chats of a LinkedIn account the paid reply classifier triages
3
+ * (Tim's support autopilot, 2026-11-16, T-452; the email twin is
4
+ * email-classification-scope.ts, T-316). Inbox scope decides which chats enter
5
+ * OXYGEN; this decides which of those cost a classification.
6
+ *
7
+ * - `all` (default): every chat the inbox scope admits, as before this setting.
8
+ * - `oxygen_initiated`: chats OXYGEN started (the chats an `oxygen_initiated`
9
+ * inbox shows) and chats with a lead of a Sequence on this account (what
10
+ * reply-stop counts as a campaign reply). Chats someone started by hand stay
11
+ * in Unibox unclassified, at no cost.
12
+ * - `off`: none. A campaign that pauses the company on reply then keeps that
13
+ * company paused until someone resumes it, since no classification decides it.
14
+ *
15
+ * An unclassified chat gets no AI status, so no reply draft, hot-lead
16
+ * notification, reply-classification do-not-contact rule or CRM lead-stage move
17
+ * (a message from someone already in the CRM is still logged on their record).
18
+ * Reply-stop and the `linkedin_reply` do-not-contact rule never depend on
19
+ * classification. tenant-db's `dmClassificationInScopeSql` is the SQL twin.
20
+ */
21
+ export const LINKEDIN_CLASSIFICATION_SCOPES = ["all", "oxygen_initiated", "off"];
22
+ /** Sender-account metadata key holding an explicit choice. */
23
+ export const LINKEDIN_CLASSIFICATION_SCOPE_KEY = "classification_scope";
24
+ export function isLinkedInClassificationScope(value) {
25
+ return typeof value === "string" && LINKEDIN_CLASSIFICATION_SCOPES.includes(value);
26
+ }
27
+ /** The scope a LinkedIn account's chats are classified under. An unknown stored value reads as the default. */
28
+ export function resolveLinkedInClassificationScope(metadata) {
29
+ const stored = metadata?.[LINKEDIN_CLASSIFICATION_SCOPE_KEY];
30
+ return isLinkedInClassificationScope(stored) ? { scope: stored, source: "setting" } : { scope: "all", source: "default" };
31
+ }
32
+ /** One customer-facing sentence per scope for the CLI/MCP envelope. */
33
+ export const LINKEDIN_CLASSIFICATION_SCOPE_BEHAVIOR = {
34
+ all: "AI reply classification (credits per classified chat) runs on every stored LinkedIn chat with a new message.",
35
+ oxygen_initiated: "AI reply classification runs only on chats OXYGEN started and chats with leads of your Sequences on this account. Other chats stay in Unibox unclassified at no cost: no AI status, reply draft, hot-lead notification or CRM lead-stage move.",
36
+ off: "No AI reply classification on this account: no AI status, reply draft, hot-lead notification or CRM lead-stage move, and a campaign that pauses the company on reply keeps that company paused until you resume it.",
37
+ };
@@ -43,6 +43,18 @@
43
43
  export declare const DNC_RULE_EFFECTS: readonly ["off", "stop_only", "suppress"];
44
44
  export type DncRuleEffect = (typeof DNC_RULE_EFFECTS)[number];
45
45
  export declare const DNC_RULE_EFFECT_LABELS: Record<DncRuleEffect, string>;
46
+ /**
47
+ * Which inbound messages a reply rule counts (Tim's support autopilot,
48
+ * 2026-11-16, T-452). `all` is every inbound message, as the rule always
49
+ * worked. `enrolled` counts only a message from someone enrolled in a Sequence
50
+ * on the receiving account before it arrived (the match reply-stop uses), so a
51
+ * workspace syncing its whole LinkedIn inbox does not put everyone who writes
52
+ * to it by hand on the do-not-contact list. Stored in `dnc_rules.metadata`.
53
+ */
54
+ export declare const DNC_RULE_APPLIES_TO: readonly ["all", "enrolled"];
55
+ export type DncRuleAppliesTo = (typeof DNC_RULE_APPLIES_TO)[number];
56
+ export declare const DNC_RULE_APPLIES_TO_LABELS: Record<DncRuleAppliesTo, string>;
57
+ export declare function isDncRuleAppliesTo(value: unknown): value is DncRuleAppliesTo;
46
58
  /**
47
59
  * Which ledger a rule writes when it resolves to `suppress`. This decides which
48
60
  * reason enum the configured reason is validated against, so a rule can never be
@@ -70,6 +82,11 @@ export type DncRuleDefinition = {
70
82
  * behaving like `off`.
71
83
  */
72
84
  allowedEffects: readonly DncRuleEffect[];
85
+ /**
86
+ * Which messages the rule may be limited to. Absent means `all` only: only a
87
+ * caller that can tell an enrolled lead's message apart offers `enrolled`.
88
+ */
89
+ appliesToOptions?: readonly DncRuleAppliesTo[];
73
90
  /** Surfaces must warn before this rule is set below `suppress`. See the header. */
74
91
  compliance?: boolean;
75
92
  /** Grouping for the surfaces. */
@@ -110,6 +127,8 @@ export declare function replyStatusRule(label: {
110
127
  }): DncRuleDefinition;
111
128
  /** The builtin definition for a key, or null when the key is not a builtin. */
112
129
  export declare function builtinDncRule(key: string): DncRuleDefinition | null;
130
+ /** The `applies_to` values a rule accepts; every rule accepts `all`. */
131
+ export declare function allowedDncRuleAppliesTo(rule: DncRuleDefinition): readonly DncRuleAppliesTo[];
113
132
  export declare function isDncRuleEffect(value: unknown): value is DncRuleEffect;
114
133
  /**
115
134
  * Resolve a stored rule key to its definition. A `reply_status:*` key resolves even
@@ -46,6 +46,22 @@ export const DNC_RULE_EFFECT_LABELS = {
46
46
  stop_only: "Stop this enrollment only",
47
47
  suppress: "Stop and add to do-not-contact",
48
48
  };
49
+ /**
50
+ * Which inbound messages a reply rule counts (Tim's support autopilot,
51
+ * 2026-11-16, T-452). `all` is every inbound message, as the rule always
52
+ * worked. `enrolled` counts only a message from someone enrolled in a Sequence
53
+ * on the receiving account before it arrived (the match reply-stop uses), so a
54
+ * workspace syncing its whole LinkedIn inbox does not put everyone who writes
55
+ * to it by hand on the do-not-contact list. Stored in `dnc_rules.metadata`.
56
+ */
57
+ export const DNC_RULE_APPLIES_TO = ["all", "enrolled"];
58
+ export const DNC_RULE_APPLIES_TO_LABELS = {
59
+ all: "Any message",
60
+ enrolled: "Only Sequence leads",
61
+ };
62
+ export function isDncRuleAppliesTo(value) {
63
+ return typeof value === "string" && DNC_RULE_APPLIES_TO.includes(value);
64
+ }
49
65
  /**
50
66
  * Which ledger a rule writes when it resolves to `suppress`. This decides which
51
67
  * reason enum the configured reason is validated against, so a rule can never be
@@ -124,6 +140,7 @@ export const DNC_BUILTIN_RULES = [
124
140
  defaultEffect: "suppress",
125
141
  defaultReason: "replied",
126
142
  allowedEffects: ALL_EFFECTS,
143
+ appliesToOptions: DNC_RULE_APPLIES_TO,
127
144
  group: "automatic",
128
145
  },
129
146
  {
@@ -199,6 +216,10 @@ const BUILTIN_BY_KEY = new Map(DNC_BUILTIN_RULES.map((rule) => [rule.key, rule])
199
216
  export function builtinDncRule(key) {
200
217
  return BUILTIN_BY_KEY.get(key) ?? null;
201
218
  }
219
+ /** The `applies_to` values a rule accepts; every rule accepts `all`. */
220
+ export function allowedDncRuleAppliesTo(rule) {
221
+ return rule.appliesToOptions ?? ["all"];
222
+ }
202
223
  export function isDncRuleEffect(value) {
203
224
  return typeof value === "string" && DNC_RULE_EFFECTS.includes(value);
204
225
  }
@@ -160,6 +160,14 @@ const NO_SUCH_USER_TEXT = new RegExp(`${INVALID_RECIPIENT_TEXT.source}|${INVALID
160
160
  // Exchange/Outlook headline: "<local> wasn't found at <domain>." It is the
161
161
  // receiving directory's verdict only when it names the report's own recipient.
162
162
  const EXCHANGE_RECIPIENT_NOT_FOUND = /(?:^|[\s>])([^\s@<>"'()]+)\s+wasn['’]t found at\s+([a-z0-9-]+(?:\.[a-z0-9-]+)+)/gi;
163
+ // Exchange Online's directory-based edge blocking answers an address missing from
164
+ // the receiving directory with exactly this reply, before any spam filtering
165
+ // (Microsoft: "The recipient's address doesn't exist"). Gmail and on-premises
166
+ // Exchange reports of it never carry the headline above. Only the reply stamped by
167
+ // Exchange Online on its own line (AS(...), aka.ms/EXOSmtpErrors, an outlook.com
168
+ // server) is that verdict; the same words elsewhere, or "Relay Access Denied", are not.
169
+ // Both gaps are bounded: an unbounded tail rescans a long line from every 5.4.1.
170
+ const EXCHANGE_DIRECTORY_REJECTION = /\b5\.4\.1\b[^\n]{0,120}?Recipient address rejected:[ \t]*Access denied\b[^\n]{0,200}?(?:\bAS\(\d+\)|aka\.ms\/EXOSmtpErrors|\.outlook\.com\b)/i;
163
171
  const PROVIDER_REJECTED_TEXT = /(message rejected|has been blocked|\bblocked\b|\bbanned\b|\bspam\b|local policy violation|unsolicited|reputation)/i;
164
172
  const TRANSIENT_TEXT = /(temporar|will retry|try again later|rate ?limit|throttl)/i;
165
173
  // Greedy address capture: the character class already stops at whitespace and
@@ -190,6 +198,14 @@ function readProvider(from, haystack) {
190
198
  return "microsoft";
191
199
  return "unknown";
192
200
  }
201
+ function isExchangeDirectoryRejection(haystack) {
202
+ // A folded header field continues on indented lines: read it as one reply.
203
+ const lines = haystack.replace(/\r?\n[ \t]+/g, " ").split("\n");
204
+ // A machine-readable Diagnostic-Code is the reply itself; quoted prose elsewhere is not.
205
+ const diagnostics = lines.filter(line => /^[ \t]*Diagnostic-Code[ \t]*:/i.test(line));
206
+ return (diagnostics.length ? diagnostics : lines)
207
+ .some(line => EXCHANGE_DIRECTORY_REJECTION.test(line) && !PROVIDER_REJECTED_TEXT.test(line));
208
+ }
193
209
  function namesExchangeRecipientNotFound(haystack, recipient) {
194
210
  if (!recipient)
195
211
  return false;
@@ -222,6 +238,12 @@ function readKind(subject, haystack, hasBody, enhancedCode, recipient) {
222
238
  return "delayed";
223
239
  if (NO_SUCH_DOMAIN_CODE.test(enhancedCode))
224
240
  return "no_such_user";
241
+ // Solvism, 2026-11-16 (T-467): an on-premises Exchange relay's Dutch report of
242
+ // Exchange Online's "550 5.4.1 Recipient address rejected: Access denied" stopped
243
+ // the enrollment without a bounce or suppression. 110 of 113 such production
244
+ // reports in 60 days lacked the Outlook headline, 90 of them sent from Gmail.
245
+ if (enhancedCode === "5.4.1" && isExchangeDirectoryRejection(haystack))
246
+ return "no_such_user";
225
247
  // SignalFisher, 2026-10-22: Exchange's "554 5.4.14 Hop count exceeded" for
226
248
  // malpertuis@intracen.org carried "malpertuis wasn't found at intracen.org";
227
249
  // the receiving directory does not know the address. A routing status needs
@@ -1,3 +1,3 @@
1
1
  export declare const OXYGEN_VERSION: string;
2
- export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.1014.1035";
2
+ export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.1014.1219";
3
3
  export declare const GEO_EXPORT_MINIMUM_CLI_VERSION = "1.1013.0";
@@ -1 +1 @@
1
- export declare const OXYGEN_BUILD_VERSION = "1.1045.27";
1
+ export declare const OXYGEN_BUILD_VERSION = "1.1046.48";
@@ -1,2 +1,2 @@
1
1
  // GENERATED by scripts/ci/version-stamp.mjs from VERSION + git history. Do not edit; do not commit.
2
- export const OXYGEN_BUILD_VERSION = "1.1045.27";
2
+ export const OXYGEN_BUILD_VERSION = "1.1046.48";
@@ -49,7 +49,7 @@ export const OXYGEN_VERSION = OXYGEN_BUILD_VERSION;
49
49
  // Since 2026-09-28 the release-preparation step advances this literal to the
50
50
  // highest CLI version published on npm for at least 30 days. It never lowers
51
51
  // the floor. The source change lands on dev before the next production release.
52
- export const OXYGEN_MINIMUM_CLI_VERSION = "1.1014.1035";
52
+ export const OXYGEN_MINIMUM_CLI_VERSION = "1.1014.1219";
53
53
  // The internal GEO export first gains required pagination in this dev version.
54
54
  // Earlier pilot clients would save a partial file without its continuation.
55
55
  export const GEO_EXPORT_MINIMUM_CLI_VERSION = "1.1013.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.1045.27",
3
+ "version": "1.1046.48",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",