@oxygen-agent/cli 1.1014.2119 → 1.1014.2170

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 (71) hide show
  1. package/README.md +1 -1
  2. package/dist/command-manifest.js +15 -0
  3. package/dist/commands/crm.js +1 -1
  4. package/dist/commands/domains.js +68 -2
  5. package/dist/commands/find.js +1 -1
  6. package/dist/commands/people.js +1 -0
  7. package/dist/commands/subscriptions.d.ts +1 -1
  8. package/dist/commands/subscriptions.js +1 -1
  9. package/dist/sender-limits-flags.js +1 -1
  10. package/node_modules/@oxygen/formula/dist/value-normalizers.js +1 -1
  11. package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.d.ts +1 -0
  12. package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.js +4 -0
  13. package/node_modules/@oxygen/shared/dist/capability-intents/sending-infrastructure.rules.js +7 -1
  14. package/node_modules/@oxygen/shared/dist/capability-routes/sending-infrastructure.js +2 -1
  15. package/node_modules/@oxygen/shared/dist/company-url-identity.d.ts +14 -0
  16. package/node_modules/@oxygen/shared/dist/company-url-identity.js +35 -0
  17. package/node_modules/@oxygen/shared/dist/diagnostic-spool.d.ts +8 -3
  18. package/node_modules/@oxygen/shared/dist/diagnostic-spool.js +19 -11
  19. package/node_modules/@oxygen/shared/dist/diagnostic-storage.d.ts +9 -2
  20. package/node_modules/@oxygen/shared/dist/diagnostic-storage.js +9 -4
  21. package/node_modules/@oxygen/shared/dist/domain-web-presence.d.ts +55 -0
  22. package/node_modules/@oxygen/shared/dist/domain-web-presence.js +78 -0
  23. package/node_modules/@oxygen/shared/dist/index.d.ts +4 -4
  24. package/node_modules/@oxygen/shared/dist/index.js +4 -4
  25. package/node_modules/@oxygen/shared/dist/mailboxes/placement-report.d.ts +10 -0
  26. package/node_modules/@oxygen/shared/dist/mailboxes/placement-report.js +39 -2
  27. package/node_modules/@oxygen/shared/dist/managed-email-branding.js +1 -1
  28. package/node_modules/@oxygen/shared/dist/mcp-event-contract.js +3 -3
  29. package/node_modules/@oxygen/shared/dist/object-storage.d.ts +21 -0
  30. package/node_modules/@oxygen/shared/dist/object-storage.js +48 -0
  31. package/node_modules/@oxygen/shared/dist/{bulk-email-pacing.js → sequences/bulk-email-pacing.js} +1 -1
  32. package/node_modules/@oxygen/shared/dist/{email-documents.js → sequences/email-documents.js} +1 -1
  33. package/node_modules/@oxygen/shared/dist/{linkedin-connection-identity.js → sequences/linkedin-connection-identity.js} +1 -1
  34. package/node_modules/@oxygen/shared/dist/{sending-limits.d.ts → sequences/sending-limits.d.ts} +1 -1
  35. package/node_modules/@oxygen/shared/dist/{sending-limits.js → sequences/sending-limits.js} +2 -2
  36. package/node_modules/@oxygen/shared/dist/{sending-schedule.d.ts → sequences/sending-schedule.d.ts} +1 -1
  37. package/node_modules/@oxygen/shared/dist/tables/enrichment-intents.js +1 -1
  38. package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
  39. package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
  40. package/node_modules/@oxygen/shared/dist/workspace-event-catalog.d.ts +1 -1
  41. package/node_modules/@oxygen/shared/dist/workspace-event-catalog.js +3 -3
  42. package/node_modules/@oxygen/shared/package.json +0 -5
  43. package/package.json +1 -1
  44. /package/node_modules/@oxygen/shared/dist/{crm-activity-events.d.ts → records/activity-events.d.ts} +0 -0
  45. /package/node_modules/@oxygen/shared/dist/{crm-activity-events.js → records/activity-events.js} +0 -0
  46. /package/node_modules/@oxygen/shared/dist/{hubspot-engagements.d.ts → records/hubspot-engagements.d.ts} +0 -0
  47. /package/node_modules/@oxygen/shared/dist/{hubspot-engagements.js → records/hubspot-engagements.js} +0 -0
  48. /package/node_modules/@oxygen/shared/dist/{member-columns.d.ts → records/member-columns.d.ts} +0 -0
  49. /package/node_modules/@oxygen/shared/dist/{member-columns.js → records/member-columns.js} +0 -0
  50. /package/node_modules/@oxygen/shared/dist/{notetaker-events.d.ts → records/notetaker-events.d.ts} +0 -0
  51. /package/node_modules/@oxygen/shared/dist/{notetaker-events.js → records/notetaker-events.js} +0 -0
  52. /package/node_modules/@oxygen/shared/dist/{crm-record-brief.d.ts → records/record-brief.d.ts} +0 -0
  53. /package/node_modules/@oxygen/shared/dist/{crm-record-brief.js → records/record-brief.js} +0 -0
  54. /package/node_modules/@oxygen/shared/dist/{crm-reply-events.d.ts → records/reply-events.d.ts} +0 -0
  55. /package/node_modules/@oxygen/shared/dist/{crm-reply-events.js → records/reply-events.js} +0 -0
  56. /package/node_modules/@oxygen/shared/dist/{bulk-email-pacing.d.ts → sequences/bulk-email-pacing.d.ts} +0 -0
  57. /package/node_modules/@oxygen/shared/dist/{email-brand-kit.d.ts → sequences/email-brand-kit.d.ts} +0 -0
  58. /package/node_modules/@oxygen/shared/dist/{email-brand-kit.js → sequences/email-brand-kit.js} +0 -0
  59. /package/node_modules/@oxygen/shared/dist/{email-documents.d.ts → sequences/email-documents.d.ts} +0 -0
  60. /package/node_modules/@oxygen/shared/dist/{email-subscriptions.d.ts → sequences/email-subscriptions.d.ts} +0 -0
  61. /package/node_modules/@oxygen/shared/dist/{email-subscriptions.js → sequences/email-subscriptions.js} +0 -0
  62. /package/node_modules/@oxygen/shared/dist/{enrollment-origin.d.ts → sequences/enrollment-origin.d.ts} +0 -0
  63. /package/node_modules/@oxygen/shared/dist/{enrollment-origin.js → sequences/enrollment-origin.js} +0 -0
  64. /package/node_modules/@oxygen/shared/dist/{linkedin-connection-identity.d.ts → sequences/linkedin-connection-identity.d.ts} +0 -0
  65. /package/node_modules/@oxygen/shared/dist/{sequence-sender-variables.d.ts → sequences/sender-variables.d.ts} +0 -0
  66. /package/node_modules/@oxygen/shared/dist/{sequence-sender-variables.js → sequences/sender-variables.js} +0 -0
  67. /package/node_modules/@oxygen/shared/dist/{sending-schedule.js → sequences/sending-schedule.js} +0 -0
  68. /package/node_modules/@oxygen/shared/dist/{voice-countries.d.ts → sequences/voice-countries.d.ts} +0 -0
  69. /package/node_modules/@oxygen/shared/dist/{voice-countries.js → sequences/voice-countries.js} +0 -0
  70. /package/node_modules/@oxygen/shared/dist/{whatsapp-sender-limits.d.ts → sequences/whatsapp-sender-limits.d.ts} +0 -0
  71. /package/node_modules/@oxygen/shared/dist/{whatsapp-sender-limits.js → sequences/whatsapp-sender-limits.js} +0 -0
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.1014.2119
37
+ Version: 1.1014.2170
@@ -115,6 +115,16 @@ const SPENDING_WITHOUT_APPROVAL_COMMANDS = new Set([
115
115
  "sequences test-send",
116
116
  ]);
117
117
  const MUTATING_COMMANDS = new Set([
118
+ "domains forwarding get",
119
+ "domains web-presence set",
120
+ "domains web-presence bulk",
121
+ "domains web-presence check",
122
+ "domains web-presence reconcile",
123
+ "domains web-presence defaults-set",
124
+ "domains web-presence destination-add",
125
+ "domains web-presence destination-check",
126
+ "domains web-presence destination-publish",
127
+ "domains web-presence destination-remove",
118
128
  // A newsletter test send emails members and is metered; the hyphenated leaf
119
129
  // matches no verb (`test` is not one).
120
130
  "sequences test-send",
@@ -191,6 +201,11 @@ const MUTATING_COMMANDS = new Set([
191
201
  // mode, but a small number of approved operations are explicitly
192
202
  // zero-credit. Keep those exceptions exact so discovery never invents spend.
193
203
  const ZERO_CREDIT_APPROVAL_COMMANDS = new Set([
204
+ "domains forwarding set",
205
+ "domains web-presence set", "domains web-presence bulk", "domains web-presence check",
206
+ "domains web-presence reconcile", "domains web-presence defaults-set",
207
+ "domains web-presence destination-add", "domains web-presence destination-check",
208
+ "domains web-presence destination-publish", "domains web-presence destination-remove",
194
209
  "custom-integrations remove",
195
210
  "integrations disconnect",
196
211
  // Native deliverability tests send approved real email without buying provider credits.
@@ -5,7 +5,7 @@ import { addContractFlags, readContractFlags } from "../contract-flags.js";
5
5
  import { readCrmNoteEditFields, readCrmPhotoFields, readCrmFileLabel, buildCrmObjectsPath, buildCrmConnectionsPath, buildCrmRecordPath } from "../crm-support-flags.js";
6
6
  import { requestOxygen } from "../http-client.js";
7
7
  import { networkMiningHostServed } from "../network-mining-host.js";
8
- import { CRM_RECORD_BRIEF_SECTIONS } from "@oxygen/shared/crm-record-brief";
8
+ import { CRM_RECORD_BRIEF_SECTIONS } from "@oxygen/shared/records/record-brief";
9
9
  import { isRecord, readClearableOption, readOption } from "../util.js";
10
10
  import { OxygenError, success } from "@oxygen/shared/cli-result";
11
11
  import { CRM_ENRICHMENT_READ_CONTRACT } from "@oxygen/shared/contracts/crm-enrichment-read";
@@ -8,6 +8,67 @@ import { OxygenError } from "@oxygen/shared/cli-result";
8
8
  import { sleep } from "@oxygen/shared/timing";
9
9
  import { Command } from "commander";
10
10
  import { resolve } from "node:path";
11
+ function websiteCommands(handleAsyncAction) {
12
+ const website = new Command("web-presence").description("Sending-domain websites: masking, neutral relays, destination ownership and broken-root health.");
13
+ for (const action of ["get", "health", "defaults", "destinations", "plan"]) {
14
+ const command = new Command(action).description(`Read ${action === "get" ? "configured website and observed redirects" : action === "destinations" ? "website verification status and exact TXT records" : action}. Zero credits.`)
15
+ .option("--json", "Print a JSON envelope.");
16
+ if (action === "get")
17
+ command.argument("<domain>");
18
+ if (action === "plan")
19
+ command.argument("<plan-id>");
20
+ command.action(async (...args) => {
21
+ const options = args[action === "get" || action === "plan" ? 1 : 0];
22
+ const query = new URLSearchParams({ action });
23
+ if (action === "get")
24
+ query.set("domain", String(args[0]));
25
+ if (action === "plan")
26
+ query.set("plan_id", String(args[0]));
27
+ await handleAsyncAction(`domains web-presence ${action}`, options, () => requestOxygen(`/api/cli/domains/web-presence?${query}`));
28
+ });
29
+ website.addCommand(command);
30
+ }
31
+ for (const action of ["set", "bulk", "check", "reconcile", "defaults-set", "destination-add", "destination-check", "destination-publish", "destination-remove"]) {
32
+ const command = new Command(action).description(action === "check" ? "Probe exact website roots for TLS, status, redirects, exposure and latency; saves health, zero credits."
33
+ : action.startsWith("destination") ? "Manage website ownership verification and exact TXT publication. Public writes preview before approval."
34
+ : "Configure sending-domain websites. Public changes preview first; apply with the returned plan ID and hash.")
35
+ .option("--domains <domains>", "Comma-separated exact domains (maximum 100).")
36
+ .option("--mode <mode>", "off, forward, mask or relay.")
37
+ .option("--destination-url <url>", "Verified HTTPS website or neutral relay.")
38
+ .option("--relay-transport <transport>", "forward or mask.")
39
+ .option("--captcha <bool>", "true or false; true disables masking.")
40
+ .option("--approved", "Approve the reviewed change.")
41
+ .option("--plan-id <id>", "Exact preview plan ID.")
42
+ .option("--plan-hash <hash>", "Exact preview hash.")
43
+ .option("--json", "Print a JSON envelope.");
44
+ if (action === "set")
45
+ command.argument("<domain>");
46
+ if (action.startsWith("destination"))
47
+ command.argument("<root>", "Destination root domain.");
48
+ command.action(async (...args) => {
49
+ const positional = action === "set" || action.startsWith("destination");
50
+ const options = args[positional ? 1 : 0];
51
+ if (options.captcha !== undefined && options.captcha !== "true" && options.captcha !== "false")
52
+ throw new OxygenError("invalid_request", "--captcha must be true or false.", { exitCode: 2 });
53
+ const body = {
54
+ action: action === "defaults-set" ? "defaults" : action.replace(/-/g, "_"),
55
+ ...(action === "set" ? { domain: args[0] } : {}),
56
+ ...(action.startsWith("destination") ? { root: args[0] } : {}),
57
+ ...(options.domains ? { domains: String(options.domains).split(",").map((s) => s.trim()) } : {}),
58
+ ...(options.mode ? { mode: options.mode } : {}),
59
+ ...(options.destinationUrl !== undefined ? { destination_url: options.destinationUrl } : {}),
60
+ ...(options.relayTransport ? { relay_transport: options.relayTransport } : {}),
61
+ ...(options.captcha !== undefined ? { captcha_enabled: options.captcha === "true" } : {}),
62
+ ...(options.approved ? { approved: true } : {}),
63
+ ...(options.planId ? { plan_id: options.planId } : {}),
64
+ ...(options.planHash ? { plan_hash: options.planHash } : {}),
65
+ };
66
+ await handleAsyncAction(`domains web-presence ${action}`, options, () => requestOxygen("/api/cli/domains/web-presence", { method: "POST", body, timeoutMs: 300_000 }));
67
+ });
68
+ website.addCommand(command);
69
+ }
70
+ return website;
71
+ }
11
72
  // Cloudflare domain sync returns partial pages under the request budget; the
12
73
  // CLI auto-continues up to this many follow-up POSTs before handing back a
13
74
  // still-partial summary.
@@ -409,6 +470,7 @@ function sendingDomainsCommand(handleAsyncAction) {
409
470
  }
410
471
  export function registerDomainsFamily(program, handleAsyncAction) {
411
472
  program.addCommand(new Command("domains")
473
+ .addCommand(websiteCommands(handleAsyncAction))
412
474
  .description("Cold-email domains: sync zones from your own Cloudflare account (BYOK), inspect age/warmup/DNS health, check availability and pricing, buy domains, and archive or delete domains with their inboxes (OXYGEN-bought domains included). Your own Cloudflare account bills purchases to its payment method; domains registered by OXYGEN cost credits at the vendor price. Preview `domains buy` before approval.")
413
475
  .addCommand(new Command("list")
414
476
  .description("Saved domain health, no external calls. Use --authentication for compact daily SPF/DKIM/DMARC/MX/DNS results across managed, Cloudflare and imported sending domains; --attention returns issues, unverified, stale and failed checks. Daily checks cover non-disabled sending mailboxes, including paused mailboxes; disabled/deleted mailboxes are excluded. Default output includes cached Cloudflare rows, managed domains and standalone registrations, mailbox/warmup rollups, sending volume and DNS health. summary.by_dns_state gives all zone-state counts in one read. Run domains sync to refresh the Cloudflare cache.")
@@ -517,9 +579,9 @@ export function registerDomainsFamily(program, handleAsyncAction) {
517
579
  }));
518
580
  }))
519
581
  .addCommand(new Command("forwarding")
520
- .description("Read or change where an Oxygen-managed domain's WEB root forwards visitors (not mail — MX/SPF/DKIM/DMARC are untouched). Only domains Oxygen manages are editable; domains in your own Cloudflare zone are redirected there.")
582
+ .description("Compatibility commands for website redirects. Reads include public HTTP evidence; use web-presence for masking, captcha, verification and neutral relays.")
521
583
  .addCommand(new Command("get")
522
- .description("Show the domain's current web-root forwarding destination. Read-only, 0 credits.")
584
+ .description("Read configured and observed forwarding, including redirects missing from the provider's saved state. Refreshes the saved public-root observation; 0 credits.")
523
585
  .argument("<domain>", "Domain name, such as acme.com.")
524
586
  .option("--json", "Print a JSON envelope.")
525
587
  .action(async (domain, options) => {
@@ -530,6 +592,8 @@ export function registerDomainsFamily(program, handleAsyncAction) {
530
592
  .argument("<domain>", "Domain name, such as acme.com.")
531
593
  .requiredOption("--url <url>", "Destination http(s) URL. Pass an empty string to REMOVE the forward. Cannot point the domain at itself.")
532
594
  .option("--approved", "Apply the change. Without it, a preview is returned.")
595
+ .option("--plan-id <id>", "Exact forwarding preview plan ID.")
596
+ .option("--plan-hash <hash>", "Exact forwarding preview plan hash.")
533
597
  .option("--json", "Print a JSON envelope.")
534
598
  .action(async (domain, options) => {
535
599
  await handleAsyncAction("domains forwarding set", options, () => requestOxygen(`/api/cli/domains/${encodeURIComponent(domain)}/forwarding`, {
@@ -539,6 +603,8 @@ export function registerDomainsFamily(program, handleAsyncAction) {
539
603
  // field entirely and read as a malformed request. Clearing is an
540
604
  // explicit null, so the empty string is mapped here.
541
605
  forwarding_url: readOption(options.url) ?? null,
606
+ ...(options.planId ? { plan_id: options.planId } : {}),
607
+ ...(options.planHash ? { plan_hash: options.planHash } : {}),
542
608
  ...(options.approved ? { approved: true } : {}),
543
609
  },
544
610
  }));
@@ -125,7 +125,7 @@ export function registerFindFamily(program, handleAsyncAction) {
125
125
  await handleAsyncAction("find linkedin", options, () => requestOxygen("/api/cli/find/run", { method: "POST", body: buildFindBody("linkedin", options) }));
126
126
  }))
127
127
  .addCommand(new Command("person")
128
- .description("Enrich one person from a LinkedIn URL, a LinkedIn public id or member id, a Sales Navigator link, or an email / name + company: one managed profile lookup returns the profile block — first, last and full name, current company and its LinkedIn URL, job title, job start date, education and school, headline, bio, location and follower count — the same fields the person_enrich table preset extracts for free. An email or name is first resolved to the profile through the LinkedIn URL waterfall (priced as an identity prerequisite). A member id uses managed enrichment. A Sales Navigator link resolves on the workspace's own HarvestAPI key. dry_run previews the lookup and its price for free.")
128
+ .description("Enrich one person from a LinkedIn URL, a LinkedIn public id or member id, a Sales Navigator link, or an email / name + company: a public profile runs Blitz first, then the managed LinkedIn lookup only when Blitz has no profile (each billed only on a hit), returns the profile block — first, last and full name, current company and its LinkedIn URL, job title, job start date, education and school, headline, bio, location and follower count (LinkedIn lookup only) — the same fields the person_enrich table preset extracts for free. An email or name is first resolved to the profile through the LinkedIn URL waterfall (priced as an identity prerequisite). A member id uses managed enrichment. A Sales Navigator link resolves on the workspace's own HarvestAPI key. dry_run previews the lookup and its price for free.")
129
129
  .option("--linkedin-url <url>", "Person LinkedIn profile URL (linkedin.com/in/<handle>).")
130
130
  .option("--linkedin-id <id>", "LinkedIn public identifier (the part after /in/), or a member ID beginning ACo/ACw; both support managed enrichment. Preview checks input shape and price without resolving the ID.")
131
131
  .option("--sales-navigator-url <url>", "Sales Navigator lead or people link; resolved on the workspace's own HarvestAPI key.")
@@ -120,6 +120,7 @@ function readPeopleSearchRunBody(options) {
120
120
  ...(plan ? { plan } : {}),
121
121
  ...(options.routeId ? { route_id: options.routeId } : {}),
122
122
  ...(options.toolId ? { tool_id: options.toolId } : {}),
123
+ ...(readOption(options.tableName) ? { table_name: readOption(options.tableName) } : {}),
123
124
  ...(options.table ? { table: options.table } : {}),
124
125
  ...(options.project ? { project: options.project } : {}),
125
126
  ...(options.upsertKey ? { upsert_key: options.upsertKey } : {}),
@@ -1,5 +1,5 @@
1
1
  import { ExtractedCommandActionHandler } from "../command-support.js";
2
- import { type EmailContactImportRow } from "@oxygen/shared/email-subscriptions";
2
+ import { type EmailContactImportRow } from "@oxygen/shared/sequences/email-subscriptions";
3
3
  import { Command } from "commander";
4
4
  type ImportEntry = EmailContactImportRow;
5
5
  /** Read --file as JSON (by extension or content) or as CSV with an email column. */
@@ -1,7 +1,7 @@
1
1
  import { requestOxygen } from "../http-client.js";
2
2
  import { isRecord, readOption } from "../util.js";
3
3
  import { OxygenError } from "@oxygen/shared/cli-result";
4
- import { EmailSubscriptionInputError, chunkContactImport, keepContactProperties, parseContactsCsv, } from "@oxygen/shared/email-subscriptions";
4
+ import { EmailSubscriptionInputError, chunkContactImport, keepContactProperties, parseContactsCsv, } from "@oxygen/shared/sequences/email-subscriptions";
5
5
  import { Command } from "commander";
6
6
  import { readFileSync } from "node:fs";
7
7
  import { resolve } from "node:path";
@@ -5,7 +5,7 @@
5
5
  import { OxygenError } from "@oxygen/shared/cli-result";
6
6
  import { LINKEDIN_SENDER_LIMIT_DEFAULTS, LINKEDIN_SENDER_LIMIT_MAXIMUMS, linkedInSenderLimitCautionLevel, } from "@oxygen/shared/linkedin-sequences";
7
7
  import { SENDER_LIMITS_PATCH_CONTRACT } from "@oxygen/shared/contracts/sender-limits";
8
- import { WHATSAPP_SENDER_LIMIT_DEFAULTS, WHATSAPP_SENDER_LIMIT_KEYS, WHATSAPP_SENDER_LIMIT_MAXIMUMS, WHATSAPP_SENDER_LIMIT_NOTES, } from "@oxygen/shared/whatsapp-sender-limits";
8
+ import { WHATSAPP_SENDER_LIMIT_DEFAULTS, WHATSAPP_SENDER_LIMIT_KEYS, WHATSAPP_SENDER_LIMIT_MAXIMUMS, WHATSAPP_SENDER_LIMIT_NOTES, } from "@oxygen/shared/sequences/whatsapp-sender-limits";
9
9
  import { readContractFlags } from "./contract-flags.js";
10
10
  /** "<text> (default N, max M)." for a LinkedIn sender limit flag, from the enforced constants. */
11
11
  function linkedInLimitHelp(key, text) {
@@ -5,7 +5,7 @@
5
5
  * "does foo@Bar.com match FOO@bar.com" answers the same everywhere — including
6
6
  * in the browser. Pure string functions — no I/O, no tenant context.
7
7
  */
8
- import { normalizeLinkedinMemberId } from "@oxygen/shared/linkedin-connection-identity";
8
+ import { normalizeLinkedinMemberId } from "@oxygen/shared/sequences/linkedin-connection-identity";
9
9
  export const VALUE_NORMALIZATIONS = [
10
10
  "exact_text_v1",
11
11
  "lower_trim_v1",
@@ -1,3 +1,4 @@
1
+ export declare function isDomainWebsiteIntent(query: string): boolean;
1
2
  export declare function isMailboxVolumeIntent(query: string): boolean;
2
3
  /** Supporting placement instructions belong to deliverability, even when the ask names an inbox. */
3
4
  export declare function placementGuideRecommendation(query: string): {
@@ -1,3 +1,7 @@
1
+ export function isDomainWebsiteIntent(query) {
2
+ return /\b(domains?|website|sending|destination)\b/.test(query)
3
+ && /\b(mask(?:ing)?|neutral relay|web presence|web root|forwarding|captcha|tls|522|525|website (?:mode|defaults?|health))\b/.test(query);
4
+ }
1
5
  // How much campaign email one inbox may send: its daily campaign limit and the
2
6
  // ramp-up that climbs to it. The 2026-10-01 MCP baseline searched "mailbox
3
7
  // sending settings warmup ramp daily limit" and was routed to Workflows (bare
@@ -1,4 +1,4 @@
1
- import { isDomainDnsIntent, isInboxAvatarIntent, isMailboxDeleteIntent, isMailboxOnboardingIntent, isMailboxVolumeIntent, isSendingDomainDeleteIntent, isWarmupEnrollmentIntent, placementGuideRecommendation, } from "./sending-infrastructure.js";
1
+ import { isDomainDnsIntent, isDomainWebsiteIntent, isInboxAvatarIntent, isMailboxDeleteIntent, isMailboxOnboardingIntent, isMailboxVolumeIntent, isSendingDomainDeleteIntent, isWarmupEnrollmentIntent, placementGuideRecommendation, } from "./sending-infrastructure.js";
2
2
  export const rules = {
3
3
  preRoutes: [
4
4
  // Standby mailboxes: a campaign's standby on Sequences, the shared pool here.
@@ -20,6 +20,7 @@ export const rules = {
20
20
  },
21
21
  ],
22
22
  explicit: [
23
+ { order: 435, route: (query) => isDomainWebsiteIntent(query) ? "sending-infrastructure" : null },
23
24
  { order: 440, route: (query) => isInboxAvatarIntent(query) ? "sending-infrastructure" : null },
24
25
  { order: 450, route: (query) => isDomainDnsIntent(query) || isMailboxDeleteIntent(query) || isSendingDomainDeleteIntent(query) ? "sending-infrastructure" : null },
25
26
  { order: 460, route: (query) => isMailboxOnboardingIntent(query) || isWarmupEnrollmentIntent(query) ? "sending-infrastructure" : null },
@@ -30,6 +31,11 @@ export const rules = {
30
31
  { order: 600, route: (query) => placementGuideRecommendation(query) ? "sending-infrastructure" : null },
31
32
  ],
32
33
  recommendations: [
34
+ { order: 545, recommend: (card, query) => card.id === "sending-infrastructure" && isDomainWebsiteIntent(query) ? {
35
+ tools: ["oxygen_domains_web_presence_get", "oxygen_domains_web_presence_set"],
36
+ commands: ["domains web-presence get", "domains web-presence check", "domains web-presence defaults", "domains web-presence destinations", "domains web-presence set"],
37
+ execution: "Read saved website settings, defaults and destination TXT records. A root check saves public HTTP/TLS/hop/exposure/latency evidence at zero credits. Website and TXT changes require an exact preview and explicit approval; masking does not guarantee privacy or inbox placement.",
38
+ } : null },
33
39
  { order: 50, recommend: (card, query) => card.id === "sending-infrastructure" ? placementGuideRecommendation(query) : null },
34
40
  // Whole domains go with every inbox on them, so the domain path leads and the
35
41
  // selected-mailbox path (with --include-domains) follows.
@@ -4,7 +4,7 @@ export const route = {
4
4
  id: "sending-infrastructure",
5
5
  layer: "External",
6
6
  primitive: null,
7
- owns: "Sending domains, managed/BYOK mailboxes, customer Gmail/Microsoft 365 connections, mail history controls, warmup, deliverability, egress IPs, and infrastructure health.",
7
+ owns: "Sending-domain websites (masking, neutral relays, destination verification, root TLS/redirect health), managed/BYOK mailboxes, customer Gmail/Microsoft 365 connections, mail history controls, warmup, deliverability, egress IPs, and infrastructure health.",
8
8
  notFor: "Writing campaign copy or sending outside a Sequence/Message owner.",
9
9
  execution: "Inspect or provision hosted sending infrastructure with explicit recurring-cost and external-write approval. Connect existing Gmail or Microsoft 365/Exchange Online mailboxes using mailboxes connect-oauth --vendor composio where enabled; 100 credits/month per mailbox includes mail history and CRM analysis. Read progress with oxygen_mailboxes_sync_status (CLI: mailboxes sync without --action); control it with oxygen_mailboxes_sync. Read oxygen-email-infra for history coverage and CRM rules.",
10
10
  posture: "mixed",
@@ -22,6 +22,7 @@ export const route = {
22
22
  "connect inbox",
23
23
  "mailbox history",
24
24
  "sending domain",
25
+ "domain masking", "web presence", "web root", "website defaults", "domain forwarding", "neutral relay",
25
26
  "dns",
26
27
  "warmup",
27
28
  "deliverability",
@@ -0,0 +1,14 @@
1
+ export type CompanyUrlIdentity = {
2
+ domain: string | null;
3
+ website: string | null;
4
+ linkedin_url: string | null;
5
+ };
6
+ /**
7
+ * The company a search-result URL identifies: the company's own site, a
8
+ * LinkedIn organization page, or nothing for a platform page that merely lists
9
+ * the company. A platform host is never the company's domain: reading LinkedIn's
10
+ * as one collapsed every LinkedIn-sourced row onto the `domain=linkedin.com`
11
+ * upsert key. Non-http(s), userinfo-bearing and whitespace URLs carry no
12
+ * identity. `website` is the URL as given.
13
+ */
14
+ export declare function companyIdentityFromUrl(url: unknown): CompanyUrlIdentity;
@@ -0,0 +1,35 @@
1
+ import { normalizeCompanyDncDomain, normalizeLinkedinCompanyUrl } from "./dnc-identities.js";
2
+ import { isListedWebsitePlatform } from "./listed-website-platforms.js";
3
+ /**
4
+ * The company a search-result URL identifies: the company's own site, a
5
+ * LinkedIn organization page, or nothing for a platform page that merely lists
6
+ * the company. A platform host is never the company's domain: reading LinkedIn's
7
+ * as one collapsed every LinkedIn-sourced row onto the `domain=linkedin.com`
8
+ * upsert key. Non-http(s), userinfo-bearing and whitespace URLs carry no
9
+ * identity. `website` is the URL as given.
10
+ */
11
+ export function companyIdentityFromUrl(url) {
12
+ const empty = { domain: null, website: null, linkedin_url: null };
13
+ if (typeof url !== "string")
14
+ return empty;
15
+ const trimmed = url.trim();
16
+ if (!trimmed || /\s|\\/.test(trimmed))
17
+ return empty;
18
+ try {
19
+ const parsed = new URL(trimmed);
20
+ if (!["http:", "https:"].includes(parsed.protocol) || parsed.username || parsed.password)
21
+ return empty;
22
+ const host = parsed.hostname.toLowerCase().replace(/\.+$/, "");
23
+ if (host === "linkedin.com" || host.endsWith(".linkedin.com")) {
24
+ // Subpages (/about, /posts, /jobs) name the same organization.
25
+ const page = parsed.pathname.match(/^\/(company|school)\/([^/]+)(?:\/|$)/i);
26
+ return { ...empty, linkedin_url: page ? normalizeLinkedinCompanyUrl(`https://www.linkedin.com/${page[1]}/${page[2]}`) : null };
27
+ }
28
+ // The platform check wants the bare host (`www.gmail.com` is `gmail.com`).
29
+ const domain = normalizeCompanyDncDomain(host);
30
+ return domain && !isListedWebsitePlatform(domain) ? { domain, website: trimmed, linkedin_url: null } : empty;
31
+ }
32
+ catch {
33
+ return empty;
34
+ }
35
+ }
@@ -7,12 +7,17 @@ export type UploadProgress = {
7
7
  store: string;
8
8
  published: boolean;
9
9
  };
10
- /** Admit durable content plus bounded receipt bytes; acknowledge only after publication. */
11
- export declare function admitDiagnosticSpool(directory: string, record: DiagnosticRecord, compressed: Buffer): Promise<() => Promise<void>>;
10
+ /**
11
+ * Admit durable content plus bounded receipt bytes; acknowledge only after publication.
12
+ * Without `retainReceipt` the acknowledgement also removes the receipt: a minted
13
+ * ID is never stored twice, and 72 hours of retained receipts made every full
14
+ * inspection outlast the five-second admission budget (2026-10-27, provider).
15
+ */
16
+ export declare function admitDiagnosticSpool(directory: string, record: DiagnosticRecord, compressed: Buffer, retainReceipt?: boolean): Promise<() => Promise<void>>;
12
17
  /** Receipt writes share the admission owner's protected byte count and retry reservation. */
13
18
  export declare function saveDiagnosticUploadProgress(directory: string, record: DiagnosticRecord, progress: UploadProgress, reservation?: UploadReservation): Promise<void>;
14
19
  /** A fixed set of stripes bounds SQLite lock files while coordinating direct and retry owners. */
15
20
  export declare function lockDiagnosticUpload(directory: string, id: string, waitMs?: number): Promise<() => Promise<void>>;
16
21
  export declare function readUploadProgress(directory: string, id: string, storeFingerprint: string): Promise<UploadProgress | null>;
17
22
  /** Replay retained bytes under their stripe; publication owns the upload acknowledgment. */
18
- export declare function retryDiagnosticSpool(directory: string, storeFingerprint: string, upload: (compressed: Buffer, reservation?: UploadReservation) => Promise<void>): Promise<void>;
23
+ export declare function retryDiagnosticSpool(directory: string, upload: (compressed: Buffer, reservation?: UploadReservation) => Promise<void>): Promise<void>;
@@ -12,11 +12,21 @@ const RECEIPT_MAX_BYTES = 512;
12
12
  const LEDGER_MAX_AGE_MS = 15_000;
13
13
  /** This process's last full listing supplies retry candidates between scans. */
14
14
  const inspections = new Map();
15
- /** Admit durable content plus bounded receipt bytes; acknowledge only after publication. */
16
- export async function admitDiagnosticSpool(directory, record, compressed) {
15
+ /**
16
+ * Admit durable content plus bounded receipt bytes; acknowledge only after publication.
17
+ * Without `retainReceipt` the acknowledgement also removes the receipt: a minted
18
+ * ID is never stored twice, and 72 hours of retained receipts made every full
19
+ * inspection outlast the five-second admission budget (2026-10-27, provider).
20
+ */
21
+ export async function admitDiagnosticSpool(directory, record, compressed, retainReceipt = true) {
17
22
  await storageStage("mkdir", () => mkdir(directory, { recursive: true, mode: 0o700 }));
18
23
  const path = await admitDiagnostic(directory, record, { compressed });
19
- return async () => { await unlink(path).catch(() => undefined); };
24
+ return async () => {
25
+ const removed = await unlink(path).then(() => true, error => error?.code === "ENOENT");
26
+ // A record left behind keeps its receipt so a retry cannot upload it again.
27
+ if (removed && !retainReceipt)
28
+ await unlink(join(directory, `${record.id}.receipt.json`)).catch(() => undefined);
29
+ };
20
30
  }
21
31
  /** Receipt writes share the admission owner's protected byte count and retry reservation. */
22
32
  export async function saveDiagnosticUploadProgress(directory, record, progress, reservation) {
@@ -354,7 +364,7 @@ async function reserveRetryBatch(directory, files, used, local) {
354
364
  return { files: files.slice(0, count), reservation };
355
365
  }
356
366
  /** Replay retained bytes under their stripe; publication owns the upload acknowledgment. */
357
- export async function retryDiagnosticSpool(directory, storeFingerprint, upload) {
367
+ export async function retryDiagnosticSpool(directory, upload) {
358
368
  const release = await storageStage("lock", () => acquireDiagnosticStorageLock(join(directory, ".upload.lock")));
359
369
  if (!release)
360
370
  return;
@@ -400,13 +410,11 @@ export async function retryDiagnosticSpool(directory, storeFingerprint, upload)
400
410
  }
401
411
  }
402
412
  catch (error) {
403
- // A completed owner can remove the path after this sweep's snapshot.
404
- // The private acknowledgement proves this is success, rather than loss.
405
- if (error instanceof StorageFailure && error.stage === "read" && error.failure?.code === "ENOENT") {
406
- const progress = await readUploadProgress(directory, name.slice(0, -8), storeFingerprint).then(value => value?.published === true).catch(() => false);
407
- if (progress)
408
- continue;
409
- }
413
+ // A completed owner can remove the path after this sweep's snapshot. Under
414
+ // the stripe only a publication acknowledgement or an inspection expiry
415
+ // (which counts its own loss) removes content, so absence is never a deferral.
416
+ if (error instanceof StorageFailure && error.stage === "read" && error.failure?.code === "ENOENT")
417
+ continue;
410
418
  log("warn", "diagnostics.spool_upload_deferred", { diagnostic_id: name.slice(0, -8), ...storageFailureFields(error) });
411
419
  }
412
420
  }
@@ -24,8 +24,15 @@ export declare function encodeDiagnostic(record: DiagnosticRecord): {
24
24
  };
25
25
  export declare function decodeDiagnostic(compressed: Uint8Array, expectedHash?: string): DiagnosticRecord;
26
26
  export declare function readDiagnostic(id: string, organizationId: string | null): Promise<DiagnosticStoredReceipt>;
27
- /** Durable local write precedes upload. Retries replay telemetry bytes only. */
28
- export declare function storeDiagnostic(record: DiagnosticRecord): Promise<DiagnosticStoredReceipt | null>;
27
+ /**
28
+ * Durable local write precedes upload. Retries replay telemetry bytes only.
29
+ * `retainReceipt: false` is for IDs minted for this one capture: nothing can
30
+ * store them again, so the receipt that suppresses a repeated store is dropped
31
+ * once publication is acknowledged rather than held for 72 hours.
32
+ */
33
+ export declare function storeDiagnostic(record: DiagnosticRecord, options?: {
34
+ retainReceipt?: boolean;
35
+ }): Promise<DiagnosticStoredReceipt | null>;
29
36
  export declare function flushDiagnosticSpool(): Promise<void>;
30
37
  /** A metadata-only fallback for an unsupported value never claims full capture. */
31
38
  export declare function partialDiagnostic(record: DiagnosticRecord, reason: string): DiagnosticRecord;
@@ -80,8 +80,13 @@ export async function readDiagnostic(id, organizationId) {
80
80
  throw new Error("Diagnostic scope mismatch");
81
81
  return { key, sha256: result.Metadata.sha256, bytes, compressed_bytes: compressed.length, record };
82
82
  }
83
- /** Durable local write precedes upload. Retries replay telemetry bytes only. */
84
- export async function storeDiagnostic(record) {
83
+ /**
84
+ * Durable local write precedes upload. Retries replay telemetry bytes only.
85
+ * `retainReceipt: false` is for IDs minted for this one capture: nothing can
86
+ * store them again, so the receipt that suppresses a repeated store is dropped
87
+ * once publication is acknowledged rather than held for 72 hours.
88
+ */
89
+ export async function storeDiagnostic(record, options = {}) {
85
90
  recordTelemetryCounter("oxygen.diagnostics.attempted", 1, { source: record.surface, layer: record.layer });
86
91
  if (!diagnosticsConfigured()) {
87
92
  if (!warned && process.env.NODE_ENV !== "test") {
@@ -102,7 +107,7 @@ export async function storeDiagnostic(record) {
102
107
  encoded = encodeDiagnostic(record);
103
108
  }
104
109
  record = parseDiagnosticRecord(JSON.parse(encoded.bytes.toString("utf8")));
105
- acknowledge = await admitDiagnosticSpool(directory, record, encoded.compressed);
110
+ acknowledge = await admitDiagnosticSpool(directory, record, encoded.compressed, options.retainReceipt !== false);
106
111
  startDiagnosticRetry();
107
112
  const receipt = await uploadEncodedDiagnostic(directory, record, encoded, acknowledge);
108
113
  return receipt;
@@ -181,7 +186,7 @@ export function flushDiagnosticSpool() {
181
186
  if (!diagnosticsConfigured())
182
187
  return;
183
188
  const directory = process.env.OXYGEN_DIAGNOSTICS_SPOOL_DIR;
184
- await retryDiagnosticSpool(directory, diagnosticStoreFingerprint(), async (compressed, reservation) => {
189
+ await retryDiagnosticSpool(directory, async (compressed, reservation) => {
185
190
  const record = await storageStage("decode", async () => decodeDiagnostic(compressed));
186
191
  await publishEncodedDiagnostic(directory, record, encodeDiagnostic(record), reservation);
187
192
  });
@@ -0,0 +1,55 @@
1
+ export declare const WEB_PRESENCE_MODES: readonly ["off", "forward", "mask", "relay"];
2
+ export type WebPresenceMode = typeof WEB_PRESENCE_MODES[number];
3
+ export type WebPresenceSetting = {
4
+ mode: WebPresenceMode;
5
+ destination_url: string | null;
6
+ relay_transport: "forward" | "mask";
7
+ captcha_enabled: boolean;
8
+ };
9
+ export type WebPresenceDestination = {
10
+ root: string;
11
+ vendor_uid: string;
12
+ status: "pending" | "verified" | "failed";
13
+ txt_record: {
14
+ type: "TXT";
15
+ name: string;
16
+ value: string;
17
+ };
18
+ checked_at: string | null;
19
+ verified_at: string | null;
20
+ };
21
+ export type WebPresenceHop = {
22
+ url: string;
23
+ status: number | null;
24
+ tls: "valid" | "invalid" | "not_https" | "unknown";
25
+ latency_ms: number;
26
+ location: string | null;
27
+ main_domain_exposed: boolean | null;
28
+ exposure: Array<"url" | "header" | "html">;
29
+ iframe: boolean;
30
+ };
31
+ export type WebPresenceHealth = {
32
+ domain: string;
33
+ checked_at: string;
34
+ main_domain: string | null;
35
+ healthy: boolean;
36
+ status: number | null;
37
+ tls: WebPresenceHop["tls"];
38
+ redirect_hops: number;
39
+ main_domain_exposed: boolean | null;
40
+ main_domain_first_exposed_hop: number | null;
41
+ latency_ms: number;
42
+ fault: string | null;
43
+ hops: WebPresenceHop[];
44
+ coverage: "bounded_headers_and_html";
45
+ };
46
+ export declare const DEFAULT_WEB_PRESENCE: WebPresenceSetting;
47
+ export declare function webPresenceCompanyDomain(company: Record<string, unknown>): string | null;
48
+ export declare function webPresenceDomain(value: unknown): string;
49
+ export declare function readWebPresenceSetting(value: Record<string, unknown>): WebPresenceSetting;
50
+ export declare function webPresenceUsesMask(setting: WebPresenceSetting): boolean;
51
+ export declare function webPresenceProviderMatches(setting: WebPresenceSetting, current: {
52
+ forwardingUrl: string | null;
53
+ maskEnabled: boolean | null;
54
+ captchaEnabled: boolean | null;
55
+ }): boolean;
@@ -0,0 +1,78 @@
1
+ import { OxygenError } from "./cli-result.js";
2
+ export const WEB_PRESENCE_MODES = ["off", "forward", "mask", "relay"];
3
+ export const DEFAULT_WEB_PRESENCE = {
4
+ mode: "mask", destination_url: null, relay_transport: "forward", captcha_enabled: false,
5
+ };
6
+ export function webPresenceCompanyDomain(company) {
7
+ for (const field of ["domain", "website_domain", "website", "url"]) {
8
+ if (typeof company[field] !== "string" || !company[field])
9
+ continue;
10
+ try {
11
+ const value = company[field];
12
+ return webPresenceDomain(new URL(value.includes("://") ? value : `https://${value}`).hostname.replace(/^www\./, ""));
13
+ }
14
+ catch { /* Try the next explicit website field. */ }
15
+ }
16
+ return null;
17
+ }
18
+ export function webPresenceDomain(value) {
19
+ const raw = typeof value === "string" ? value.trim().toLowerCase() : "";
20
+ let domain = raw;
21
+ try {
22
+ if (raw && !/[\s/@:#?]/.test(raw))
23
+ domain = new URL(`https://${raw}`).hostname;
24
+ }
25
+ catch {
26
+ domain = "";
27
+ }
28
+ if (!/^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/.test(domain)) {
29
+ throw new OxygenError("invalid_request", "A valid domain name is required.", { exitCode: 2 });
30
+ }
31
+ return domain;
32
+ }
33
+ export function readWebPresenceSetting(value) {
34
+ if (!WEB_PRESENCE_MODES.includes(value.mode)) {
35
+ throw new OxygenError("invalid_request", "mode must be off, forward, mask or relay.", { exitCode: 2 });
36
+ }
37
+ if (typeof value.captcha_enabled !== "undefined" && typeof value.captcha_enabled !== "boolean") {
38
+ throw new OxygenError("invalid_request", "captcha_enabled must be true or false.", { exitCode: 2 });
39
+ }
40
+ if (value.relay_transport !== undefined && value.relay_transport !== "forward" && value.relay_transport !== "mask") {
41
+ throw new OxygenError("invalid_request", "relay_transport must be forward or mask.", { exitCode: 2 });
42
+ }
43
+ const setting = {
44
+ mode: value.mode, destination_url: null,
45
+ relay_transport: value.relay_transport === "mask" ? "mask" : "forward",
46
+ captcha_enabled: value.captcha_enabled === true,
47
+ };
48
+ if (setting.mode !== "off") {
49
+ let url;
50
+ try {
51
+ url = new URL(String(value.destination_url ?? ""));
52
+ }
53
+ catch {
54
+ throw new OxygenError("invalid_request", "destination_url must be a valid website URL.", { exitCode: 2 });
55
+ }
56
+ const protocolAllowed = url.protocol === "https:" || (setting.mode === "forward" && url.protocol === "http:");
57
+ if (!protocolAllowed || url.username || url.password || (url.port && url.port !== (url.protocol === "https:" ? "443" : "80"))) {
58
+ throw new OxygenError("invalid_request", "Use HTTPS for masking or relay, or HTTP(S) for forwarding, without credentials or a custom port.", { exitCode: 2 });
59
+ }
60
+ webPresenceDomain(url.hostname);
61
+ setting.destination_url = url.href;
62
+ }
63
+ if (setting.captcha_enabled && (setting.mode === "off" || webPresenceUsesMask(setting))) {
64
+ throw new OxygenError("web_presence_captcha_conflict", "Captcha requires forwarding and disables masking.", {
65
+ exitCode: 2, details: { next_step: "Turn captcha off, or explicitly choose forward mode." },
66
+ });
67
+ }
68
+ return setting;
69
+ }
70
+ export function webPresenceUsesMask(setting) {
71
+ return setting.mode === "mask" || (setting.mode === "relay" && setting.relay_transport === "mask");
72
+ }
73
+ export function webPresenceProviderMatches(setting, current) {
74
+ const normalize = (v) => v ? new URL(v).href : null;
75
+ return normalize(current.forwardingUrl) === normalize(setting.destination_url)
76
+ && current.maskEnabled === webPresenceUsesMask(setting)
77
+ && current.captchaEnabled === setting.captcha_enabled;
78
+ }
@@ -27,8 +27,8 @@ export * from "./cli-envelope.js";
27
27
  export * from "./cli-login-code.js";
28
28
  export * from "./cli-result.js";
29
29
  export * from "./collab.js";
30
- export * from "./crm-reply-events.js";
31
- export * from "./crm-activity-events.js";
30
+ export * from "./records/reply-events.js";
31
+ export * from "./records/activity-events.js";
32
32
  export * from "./tables/column-types.js";
33
33
  export * from "./copilot-errors.js";
34
34
  export * from "./copilot-journeys.js";
@@ -63,7 +63,7 @@ export * from "./posts/linkedin-post-url.js";
63
63
  export * from "./linkedin-quota-denial.js";
64
64
  export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
- export * from "./member-columns.js";
66
+ export * from "./records/member-columns.js";
67
67
  export * from "./mailboxes/microsoft-consent-url.js";
68
68
  export * from "./networks.js";
69
69
  export * from "./person-name.js";
@@ -109,7 +109,7 @@ export * from "./workflow-mcp-tools.js";
109
109
  export * from "./webhook-headers.js";
110
110
  export * from "./workflow-trigger-label.js";
111
111
  export * from "./workspace-event-catalog.js";
112
- export * from "./notetaker-events.js";
112
+ export * from "./records/notetaker-events.js";
113
113
  export * from "./workspace-agents.js";
114
114
  export * from "./semver.js";
115
115
  export * from "./ugc/ugc.js";
@@ -27,8 +27,8 @@ export * from "./cli-envelope.js";
27
27
  export * from "./cli-login-code.js";
28
28
  export * from "./cli-result.js";
29
29
  export * from "./collab.js";
30
- export * from "./crm-reply-events.js";
31
- export * from "./crm-activity-events.js";
30
+ export * from "./records/reply-events.js";
31
+ export * from "./records/activity-events.js";
32
32
  export * from "./tables/column-types.js";
33
33
  export * from "./copilot-errors.js";
34
34
  export * from "./copilot-journeys.js";
@@ -63,7 +63,7 @@ export * from "./posts/linkedin-post-url.js";
63
63
  export * from "./linkedin-quota-denial.js";
64
64
  export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
- export * from "./member-columns.js";
66
+ export * from "./records/member-columns.js";
67
67
  export * from "./mailboxes/microsoft-consent-url.js";
68
68
  export * from "./networks.js";
69
69
  export * from "./person-name.js";
@@ -121,7 +121,7 @@ export * from "./workflow-mcp-tools.js";
121
121
  export * from "./webhook-headers.js";
122
122
  export * from "./workflow-trigger-label.js";
123
123
  export * from "./workspace-event-catalog.js";
124
- export * from "./notetaker-events.js";
124
+ export * from "./records/notetaker-events.js";
125
125
  export * from "./workspace-agents.js";
126
126
  export * from "./semver.js";
127
127
  export * from "./ugc/ugc.js";
@@ -1,7 +1,17 @@
1
1
  /** Shared placement-report policy. No provider calls, sends or billing effects. */
2
2
  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
+ /** Machine-readable reason on a report settled because the vendor closed seeds before our probe left. */
5
+ export declare const SEEDS_CLOSED_BEFORE_SEND = "seeds_closed_before_send";
4
6
  export declare function placementReportDeadline(provider: string, results: unknown): string | null;
5
7
  export declare function placementReportExpired(provider: string, results: unknown, now?: number): boolean;
8
+ /**
9
+ * True when EmailGuard gave a seed a terminal not-received verdict before our
10
+ * probe was sent: the vendor closed the test without measuring it, so its
11
+ * "completed" score describes nothing. waiting_for_email rows legitimately
12
+ * predate the send and never count. Vendor timestamps carry microseconds;
13
+ * Date.parse truncates them to milliseconds.
14
+ */
15
+ export declare function placementSeedsClosedBeforeSend(provider: string, currentResults: unknown, pollResults: unknown): boolean;
6
16
  /** Customer copy follows the persisted settlement receipt, never an inferred balance. */
7
17
  export declare function placementRefundMessage(value: unknown): string;
@@ -1,7 +1,10 @@
1
1
  /** Shared placement-report policy. No provider calls, sends or billing effects. */
2
2
  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
- export function placementReportDeadline(provider, results) {
4
+ /** Machine-readable reason on a report settled because the vendor closed seeds before our probe left. */
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) {
5
8
  if (provider !== "emailguard" || !results || typeof results !== "object")
6
9
  return null;
7
10
  const receipt = results.seed_delivery;
@@ -11,12 +14,46 @@ export function placementReportDeadline(provider, results) {
11
14
  if (send.status !== "sent" || typeof send.sent_at !== "string")
12
15
  return null;
13
16
  const sent = Date.parse(send.sent_at);
14
- return Number.isFinite(sent) ? new Date(sent + PLACEMENT_REPORT_WAIT_MS).toISOString() : null;
17
+ return Number.isFinite(sent) ? sent : null;
18
+ }
19
+ export function placementReportDeadline(provider, results) {
20
+ const sent = confirmedSendMs(provider, results);
21
+ return sent === null ? null : new Date(sent + PLACEMENT_REPORT_WAIT_MS).toISOString();
15
22
  }
16
23
  export function placementReportExpired(provider, results, now = Date.now()) {
17
24
  const deadline = placementReportDeadline(provider, results);
18
25
  return deadline !== null && now >= Date.parse(deadline);
19
26
  }
27
+ const NOT_RECEIVED = new Set(["email_not_received", "not_received"]);
28
+ // emailguard.ts normalizeFolder maps these vendor folders to "missing"; history SQL treats them as not observed.
29
+ const NOT_RECEIVED_FOLDERS = new Set(["missing", "not_received", "not_found"]);
30
+ /**
31
+ * True when EmailGuard gave a seed a terminal not-received verdict before our
32
+ * probe was sent: the vendor closed the test without measuring it, so its
33
+ * "completed" score describes nothing. waiting_for_email rows legitimately
34
+ * predate the send and never count. Vendor timestamps carry microseconds;
35
+ * Date.parse truncates them to milliseconds.
36
+ */
37
+ export function placementSeedsClosedBeforeSend(provider, currentResults, pollResults) {
38
+ const sent = confirmedSendMs(provider, currentResults);
39
+ if (sent === null || !pollResults || typeof pollResults !== "object")
40
+ return false;
41
+ const emails = pollResults.emails;
42
+ if (!Array.isArray(emails))
43
+ return false;
44
+ return emails.some((value) => {
45
+ if (!value || typeof value !== "object")
46
+ return false;
47
+ const row = value;
48
+ if (typeof row.status !== "string" || !NOT_RECEIVED.has(row.status.toLowerCase()))
49
+ return false;
50
+ if (row.folder !== null && row.folder !== undefined
51
+ && !(typeof row.folder === "string" && NOT_RECEIVED_FOLDERS.has(row.folder.toLowerCase())))
52
+ return false;
53
+ const closed = typeof row.updated_at === "string" ? Date.parse(row.updated_at) : Number.NaN;
54
+ return Number.isFinite(closed) && closed < sent;
55
+ });
56
+ }
20
57
  /** Customer copy follows the persisted settlement receipt, never an inferred balance. */
21
58
  export function placementRefundMessage(value) {
22
59
  if (!value || typeof value !== "object")
@@ -22,7 +22,7 @@ const COPY_FIELDS = new Set([
22
22
  "message", "note", "reason", "description", "hint", "transport_hint", "next_step",
23
23
  "next_action", "nextAction", "label", "title", "instruction", "instructions", "warnings",
24
24
  "recommendation", "recommendations", "limitations", "next_external_write", "price_note",
25
- "pricing_basis", "billing", "capability", "error", "errors", "summary", "blocker", "blockers", "detail", "details_text", "provider_label", "command", "next_command", "next_commands", "needs",
25
+ "pricing_basis", "billing", "capability", "error", "errors", "summary", "directional_note", "blocker", "blockers", "detail", "details_text", "provider_label", "command", "next_command", "next_commands", "needs",
26
26
  ]);
27
27
  export function managedEmailMessage(value, product = "warmup") {
28
28
  const label = product === "warmup" ? "OXYGEN Warm-up" : "OXYGEN placement evaluation";
@@ -1,8 +1,8 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { arr, enumOf, int, nullable, num, obj, str, unwrapNullable, validateContract, } from "./contracts/schema.js";
3
- import { CRM_ACTIVITY_CREATED_EVENT } from "./crm-activity-events.js";
4
- import { CRM_EMAIL_REPLY_CLASSIFIED_EVENT, CRM_WORKFLOW_EVENT_SOURCE, } from "./crm-reply-events.js";
5
- import { NOTETAKER_MEETING_COMPLETED_EVENT, NOTETAKER_WORKFLOW_EVENT_SOURCE } from "./notetaker-events.js";
3
+ import { CRM_ACTIVITY_CREATED_EVENT } from "./records/activity-events.js";
4
+ import { CRM_EMAIL_REPLY_CLASSIFIED_EVENT, CRM_WORKFLOW_EVENT_SOURCE, } from "./records/reply-events.js";
5
+ import { NOTETAKER_MEETING_COMPLETED_EVENT, NOTETAKER_WORKFLOW_EVENT_SOURCE } from "./records/notetaker-events.js";
6
6
  import { slugifyOption } from "./tables/select-options.js";
7
7
  import { SEQUENCE_ENROLLMENT_TERMINAL_EVENT, SEQUENCE_TERMINAL_EVENT_SOURCE, SEQUENCE_TERMINAL_STATUSES, } from "./sequence-terminal-events.js";
8
8
  import { resolveAppBaseUrl } from "./signed-token.js";
@@ -53,6 +53,27 @@ export declare function isInboxAvatarObjectKeyForOrganization(key: string, organ
53
53
  export declare function isImportObjectKeyForOrganization(key: string, organizationId: string): boolean;
54
54
  export declare function isCopilotAttachmentObjectKeyForOrganization(key: string, organizationId: string): boolean;
55
55
  export declare function isPublishingMediaObjectKeyForOrganization(key: string, organizationId: string): boolean;
56
+ /** The namespaces a Table import may read: staged uploads and Copilot attachments. */
57
+ export type TableImportSourceKind = "staged_import" | "copilot_attachment";
58
+ /**
59
+ * Which of this organization's import sources `key` names, or null when it names
60
+ * none. The one ownership predicate every Table import read (preview and
61
+ * staged import, on web, CLI, MCP and Copilot alike) asks.
62
+ *
63
+ * A Copilot attachment is importable because the Copilot's context hands the
64
+ * model exactly that key as the import handle; refusing it made every attached
65
+ * spreadsheet unimportable. Ownership stays strict: the key must be
66
+ * `<prefix>/<organizationId>/<object>` with no empty, `.` or `..` segment, no
67
+ * backslash and no control character, so neither another org's key nor a
68
+ * traversal spelled under this org's prefix passes.
69
+ */
70
+ export declare function tableImportSourceKindForOrganization(key: string, organizationId: string): TableImportSourceKind | null;
71
+ /**
72
+ * True only for a transient staging upload (`imports/…`), the one import
73
+ * source the worker may delete once it has streamed it. A Copilot attachment
74
+ * outlives its import: the chat still lists and serves it.
75
+ */
76
+ export declare function isImportStagingObjectKey(key: string): boolean;
56
77
  export type PresignedImportUpload = {
57
78
  uploadUrl: string;
58
79
  bucket: string;
@@ -143,6 +143,51 @@ export function isCopilotAttachmentObjectKeyForOrganization(key, organizationId)
143
143
  export function isPublishingMediaObjectKeyForOrganization(key, organizationId) {
144
144
  return key.startsWith(`publishing-media/${organizationId}/`);
145
145
  }
146
+ const TABLE_IMPORT_SOURCE_PREFIXES = [
147
+ ["imports", "staged_import"],
148
+ ["copilot", "copilot_attachment"],
149
+ ];
150
+ /**
151
+ * Which of this organization's import sources `key` names, or null when it names
152
+ * none. The one ownership predicate every Table import read (preview and
153
+ * staged import, on web, CLI, MCP and Copilot alike) asks.
154
+ *
155
+ * A Copilot attachment is importable because the Copilot's context hands the
156
+ * model exactly that key as the import handle; refusing it made every attached
157
+ * spreadsheet unimportable. Ownership stays strict: the key must be
158
+ * `<prefix>/<organizationId>/<object>` with no empty, `.` or `..` segment, no
159
+ * backslash and no control character, so neither another org's key nor a
160
+ * traversal spelled under this org's prefix passes.
161
+ */
162
+ export function tableImportSourceKindForOrganization(key, organizationId) {
163
+ if (!organizationId || /[/\\]/.test(organizationId))
164
+ return null;
165
+ if (key.includes("\\") || hasControlCharacter(key))
166
+ return null;
167
+ const segments = key.split("/");
168
+ if (segments.length < 3 || segments[1] !== organizationId)
169
+ return null;
170
+ if (segments.some((segment) => segment === "" || segment === "." || segment === ".."))
171
+ return null;
172
+ const match = TABLE_IMPORT_SOURCE_PREFIXES.find(([prefix]) => prefix === segments[0]);
173
+ return match ? match[1] : null;
174
+ }
175
+ function hasControlCharacter(value) {
176
+ for (let index = 0; index < value.length; index += 1) {
177
+ const code = value.charCodeAt(index);
178
+ if (code < 0x20 || code === 0x7f)
179
+ return true;
180
+ }
181
+ return false;
182
+ }
183
+ /**
184
+ * True only for a transient staging upload (`imports/…`), the one import
185
+ * source the worker may delete once it has streamed it. A Copilot attachment
186
+ * outlives its import: the chat still lists and serves it.
187
+ */
188
+ export function isImportStagingObjectKey(key) {
189
+ return key.startsWith("imports/");
190
+ }
146
191
  /**
147
192
  * Presign the one PUT that stages an import file under `imports/<org>/`.
148
193
  *
@@ -472,6 +517,9 @@ export async function deleteInboxAvatarObject(input) {
472
517
  await client.send(new DeleteObjectCommand({ Bucket: config.bucket, Key: input.storageKey }));
473
518
  }
474
519
  export async function deleteImportObject(input) {
520
+ if (!isImportStagingObjectKey(input.storageKey)) {
521
+ throw new OxygenError("invalid_object_key", "Refusing to delete an object outside the staged-import namespace.", { details: { prefix: input.storageKey.split("/")[0] ?? "" }, exitCode: 1 });
522
+ }
475
523
  assertAppStorageWriteAllowed();
476
524
  const { client, config } = resolveClient();
477
525
  await client.send(new DeleteObjectCommand({ Bucket: config.bucket, Key: input.storageKey }));
@@ -4,7 +4,7 @@
4
4
  // and a bigger send is spread over hours, so a bad list shows in the first hours
5
5
  // instead of in every inbox. Clean-room after mailcheap.ai's documented behaviour
6
6
  // (AGPL; design reference only, no code taken).
7
- import { SES_BULK_RATE_FRACTION, SES_TRANSACTIONAL_RESERVE_FRACTION } from "./email-delivery.js";
7
+ import { SES_BULK_RATE_FRACTION, SES_TRANSACTIONAL_RESERVE_FRACTION } from "../email-delivery.js";
8
8
  export const BULK_EMAIL_PACING = {
9
9
  /** A send this small always goes at once, even for a brand-new workspace. */
10
10
  quickEmails: 200,
@@ -5,7 +5,7 @@
5
5
  * the shared vocabulary every surface validates against; storage lives in
6
6
  * `@oxygen/tenant-db/email-documents`. Browser-safe: no Node imports.
7
7
  */
8
- import { sanitizeEmailHtml } from "./email-html-sanitize.js";
8
+ import { sanitizeEmailHtml } from "../email-html-sanitize.js";
9
9
  /** Gmail clips a message above ~102 KB; the server refuses a revision above this. */
10
10
  export const EMAIL_DOCUMENT_MAX_HTML_BYTES = 102_400;
11
11
  /** The editor's size meter warns from here. */
@@ -1,4 +1,4 @@
1
- import { normalizeLinkedinProfileUrl, isLinkedinMemberIdHandle } from "./tables/linkedin-url.js";
1
+ import { normalizeLinkedinProfileUrl, isLinkedinMemberIdHandle } from "../tables/linkedin-url.js";
2
2
  const LINKEDIN_PROFILE_URN_PREFIX = /^urn:li:(?:fs_miniProfile|fsd_profile|member):/;
3
3
  const LINKEDIN_CLASSIC_MEMBER_ID = /^ACo[A-Za-z0-9_-]+$/;
4
4
  function stripLinkedinProfileUrn(value) {
@@ -1,4 +1,4 @@
1
- import type { RepricingOptions } from "./repricing.js";
1
+ import type { RepricingOptions } from "../repricing.js";
2
2
  /**
3
3
  * The daily cap a new mailbox gets when nobody names one. New mailboxes were
4
4
  * created at 18 a day before the repricing, so this is an increase and is live.
@@ -1,5 +1,5 @@
1
- import { mailboxInfrastructureDailyCap } from "./email-infrastructure-policy.js";
2
- import { EMAIL_DELIVERABILITY_DEFAULTS } from "./mailboxes/email-deliverability-policy.js";
1
+ import { mailboxInfrastructureDailyCap } from "../email-infrastructure-policy.js";
2
+ import { EMAIL_DELIVERABILITY_DEFAULTS } from "../mailboxes/email-deliverability-policy.js";
3
3
  /**
4
4
  * The daily cap a new mailbox gets when nobody names one. New mailboxes were
5
5
  * created at 18 a day before the repricing, so this is an increase and is live.
@@ -1,4 +1,4 @@
1
- import type { SequenceSendWindow } from "./sequences.js";
1
+ import type { SequenceSendWindow } from "../sequences.js";
2
2
  /**
3
3
  * The one sending schedule Launch shows (web editor, CLI `--schedule-*`, MCP
4
4
  * `sending_schedule`). Email and social dispatch keep separate stored windows,
@@ -109,7 +109,7 @@ export const ENRICHMENT_INTENT_TAXONOMY = [
109
109
  {
110
110
  id: "find_work_email",
111
111
  label: "Work email",
112
- description: "Finds a verified work email through a cost-ordered waterfall that bills only when an address is found.",
112
+ description: "Finds a verified work email through a cost-ordered waterfall whose finders bill only on a hit; each address check bills too.",
113
113
  entity: "person",
114
114
  group: "contact",
115
115
  kind: "enrichment",
@@ -1 +1 @@
1
- export declare const OXYGEN_BUILD_VERSION = "1.1014.2119";
1
+ export declare const OXYGEN_BUILD_VERSION = "1.1014.2170";
@@ -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.1014.2119";
2
+ export const OXYGEN_BUILD_VERSION = "1.1014.2170";
@@ -1,4 +1,4 @@
1
- import { CRM_SIGNAL_WORKFLOW_EVENT_DEFINITIONS } from "./crm-reply-events.js";
1
+ import { CRM_SIGNAL_WORKFLOW_EVENT_DEFINITIONS } from "./records/reply-events.js";
2
2
  export declare const WORKSPACE_EVENT_PRODUCER_READINESS_REQUIREMENTS: readonly ["always", "notetaker_enabled", "blacklist_monitoring_active"];
3
3
  export type WorkspaceEventProducerReadinessRequirement = (typeof WORKSPACE_EVENT_PRODUCER_READINESS_REQUIREMENTS)[number];
4
4
  export type CrmSignalWorkflowEvent = (typeof CRM_SIGNAL_WORKFLOW_EVENT_DEFINITIONS)[number]["event"];
@@ -1,8 +1,8 @@
1
- import { CRM_ACTIVITY_CREATED_EVENT, CRM_ACTIVITY_EVENT_DEFINITIONS, } from "./crm-activity-events.js";
2
- import { CRM_SIGNAL_WORKFLOW_EVENT_DEFINITIONS, CRM_WORKFLOW_EVENT_SOURCE, } from "./crm-reply-events.js";
1
+ import { CRM_ACTIVITY_CREATED_EVENT, CRM_ACTIVITY_EVENT_DEFINITIONS, } from "./records/activity-events.js";
2
+ import { CRM_SIGNAL_WORKFLOW_EVENT_DEFINITIONS, CRM_WORKFLOW_EVENT_SOURCE, } from "./records/reply-events.js";
3
3
  import { SEQUENCE_CONTACT_ACTIVITY_EVENT, SEQUENCE_CRM_EVENT_DEFINITIONS, SEQUENCE_WORKFLOW_EVENT_SOURCE, } from "./sequence-crm-events.js";
4
4
  import { SEQUENCE_ENROLLMENT_TERMINAL_EVENT, SEQUENCE_TERMINAL_EVENT_SOURCE, SEQUENCE_TERMINAL_STATUSES, } from "./sequence-terminal-events.js";
5
- import { NOTETAKER_MEETING_COMPLETED_EVENT, NOTETAKER_MEETING_COMPLETED_PAYLOAD_FIELDS, NOTETAKER_WORKFLOW_EVENT_SOURCE, } from "./notetaker-events.js";
5
+ import { NOTETAKER_MEETING_COMPLETED_EVENT, NOTETAKER_MEETING_COMPLETED_PAYLOAD_FIELDS, NOTETAKER_WORKFLOW_EVENT_SOURCE, } from "./records/notetaker-events.js";
6
6
  import { BLACKLIST_LISTING_CHANGED_EVENT, BLACKLIST_LISTING_CHANGED_PAYLOAD_FIELDS, DELIVERABILITY_WORKFLOW_EVENT_SOURCE, } from "./mailboxes/deliverability-blacklist.js";
7
7
  import { networkMiningEnabled } from "./network-mining.js";
8
8
  import { NETWORK_MINING_SIGNAL_EVENT_DEFINITIONS } from "./network-mining-signals.js";
@@ -46,11 +46,6 @@
46
46
  "import": "./dist/cell-format.js",
47
47
  "default": "./dist/cell-format.js"
48
48
  },
49
- "./member-columns": {
50
- "types": "./dist/member-columns.d.ts",
51
- "import": "./dist/member-columns.js",
52
- "default": "./dist/member-columns.js"
53
- },
54
49
  "./json-path": {
55
50
  "types": "./dist/json-path.d.ts",
56
51
  "import": "./dist/json-path.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.1014.2119",
3
+ "version": "1.1014.2170",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",