@oxygen-agent/cli 1.1014.2040 → 1.1014.2101

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 (134) hide show
  1. package/README.md +1 -1
  2. package/dist/cli-output.js +12 -0
  3. package/dist/column-decision-options.js +1 -1
  4. package/dist/command-families/tables/bundle-format.d.ts +1 -1
  5. package/dist/command-families/tables/bundle-format.js +1 -1
  6. package/dist/command-families/tables/import-columns.js +1 -1
  7. package/dist/command-families/tables/import-upload.d.ts +1 -1
  8. package/dist/command-families/tables/import-values.js +1 -1
  9. package/dist/command-families/tables/imports.d.ts +1 -1
  10. package/dist/command-families/tables/imports.js +1 -1
  11. package/dist/command-families/tables/register-relations.js +1 -1
  12. package/dist/command-families/tables/row-selection.js +1 -1
  13. package/dist/command-support.d.ts +7 -0
  14. package/dist/command-support.js +25 -0
  15. package/dist/commands/billing.js +2 -2
  16. package/dist/commands/columns.js +1 -1
  17. package/dist/commands/enrich-column.js +1 -1
  18. package/dist/commands/mailboxes.js +1 -1
  19. package/dist/commands/table-runs.js +1 -1
  20. package/dist/deliverability-evidence-commands.js +1 -1
  21. package/dist/streamed-file-import.d.ts +1 -1
  22. package/dist/streamed-file-import.js +1 -1
  23. package/node_modules/@oxygen/shared/dist/agent-sessions.d.ts +1 -1
  24. package/node_modules/@oxygen/shared/dist/agent-sessions.js +1 -1
  25. package/node_modules/@oxygen/shared/dist/capability-discovery.d.ts +1 -1
  26. package/node_modules/@oxygen/shared/dist/capability-discovery.js +1 -1
  27. package/node_modules/@oxygen/shared/dist/contracts/guided-activation.js +1 -1
  28. package/node_modules/@oxygen/shared/dist/copilot-access.js +1 -1
  29. package/node_modules/@oxygen/shared/dist/freemail-domains.d.ts +1 -1
  30. package/node_modules/@oxygen/shared/dist/freemail-domains.js +1 -1
  31. package/node_modules/@oxygen/shared/dist/index.d.ts +11 -11
  32. package/node_modules/@oxygen/shared/dist/index.js +11 -11
  33. package/node_modules/@oxygen/shared/dist/langfuse.d.ts +5 -1
  34. package/node_modules/@oxygen/shared/dist/langfuse.js +25 -3
  35. package/node_modules/@oxygen/shared/dist/{email-deliverability-policy.d.ts → mailboxes/email-deliverability-policy.d.ts} +1 -1
  36. package/node_modules/@oxygen/shared/dist/{emailguard-placement-probe.js → mailboxes/emailguard-placement-probe.js} +1 -1
  37. package/node_modules/@oxygen/shared/dist/{mailbox-standby-rollout.d.ts → mailboxes/standby-rollout.d.ts} +1 -1
  38. package/node_modules/@oxygen/shared/dist/{mailbox-standby-rollout.js → mailboxes/standby-rollout.js} +2 -2
  39. package/node_modules/@oxygen/shared/dist/{warmup-metrics.js → mailboxes/warmup-metrics.js} +1 -1
  40. package/node_modules/@oxygen/shared/dist/object-storage.js +1 -1
  41. package/node_modules/@oxygen/shared/dist/{guided-activation.d.ts → onboarding/guided-activation.d.ts} +1 -1
  42. package/node_modules/@oxygen/shared/dist/{guided-activation.js → onboarding/guided-activation.js} +2 -2
  43. package/node_modules/@oxygen/shared/dist/{guided-onboarding-company-context.d.ts → onboarding/guided-onboarding-company-context.d.ts} +6 -6
  44. package/node_modules/@oxygen/shared/dist/{guided-onboarding-company-context.js → onboarding/guided-onboarding-company-context.js} +2 -2
  45. package/node_modules/@oxygen/shared/dist/{signup-lead-payload.js → onboarding/signup-lead-payload.js} +2 -2
  46. package/node_modules/@oxygen/shared/dist/{signup-lead-webhook.js → onboarding/signup-lead-webhook.js} +2 -2
  47. package/node_modules/@oxygen/shared/dist/onboarding-leads.d.ts +4 -0
  48. package/node_modules/@oxygen/shared/dist/plan-band.d.ts +1 -1
  49. package/node_modules/@oxygen/shared/dist/plan-band.js +1 -1
  50. package/node_modules/@oxygen/shared/dist/plan-limits.d.ts +1 -1
  51. package/node_modules/@oxygen/shared/dist/plan-limits.js +3 -3
  52. package/node_modules/@oxygen/shared/dist/redis-endpoint-map.d.ts +10 -0
  53. package/node_modules/@oxygen/shared/dist/redis-endpoint-map.js +63 -0
  54. package/node_modules/@oxygen/shared/dist/repricing.js +1 -1
  55. package/node_modules/@oxygen/shared/dist/sending-limits.js +1 -1
  56. package/node_modules/@oxygen/shared/dist/table-run-summary.js +1 -1
  57. package/node_modules/@oxygen/shared/dist/{table-capacity.d.ts → tables/capacity.d.ts} +2 -2
  58. package/node_modules/@oxygen/shared/dist/{table-capacity.js → tables/capacity.js} +1 -1
  59. package/node_modules/@oxygen/shared/dist/{column-decision.js → tables/column-decision.js} +1 -1
  60. package/node_modules/@oxygen/shared/dist/{enrichment-intents.d.ts → tables/enrichment-intents.d.ts} +1 -1
  61. package/node_modules/@oxygen/shared/dist/{file-import.js → tables/file-import.js} +2 -2
  62. package/node_modules/@oxygen/shared/dist/teammates.js +1 -1
  63. package/node_modules/@oxygen/shared/dist/{ugc-amplification-identity.js → ugc/amplification-identity.js} +1 -1
  64. package/node_modules/@oxygen/shared/dist/version.d.ts +1 -1
  65. package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
  66. package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
  67. package/node_modules/@oxygen/shared/dist/version.js +1 -1
  68. package/node_modules/@oxygen/shared/dist/workspace-event-catalog.js +1 -1
  69. package/node_modules/@oxygen/shared/dist/workspace-placement.js +1 -1
  70. package/node_modules/@oxygen/shared/package.json +0 -35
  71. package/package.json +1 -1
  72. /package/node_modules/@oxygen/shared/dist/{deliverability-blacklist.d.ts → mailboxes/deliverability-blacklist.d.ts} +0 -0
  73. /package/node_modules/@oxygen/shared/dist/{deliverability-blacklist.js → mailboxes/deliverability-blacklist.js} +0 -0
  74. /package/node_modules/@oxygen/shared/dist/{deliverability-checks.d.ts → mailboxes/deliverability-checks.d.ts} +0 -0
  75. /package/node_modules/@oxygen/shared/dist/{deliverability-checks.js → mailboxes/deliverability-checks.js} +0 -0
  76. /package/node_modules/@oxygen/shared/dist/{deliverability-evidence.d.ts → mailboxes/deliverability-evidence.d.ts} +0 -0
  77. /package/node_modules/@oxygen/shared/dist/{deliverability-evidence.js → mailboxes/deliverability-evidence.js} +0 -0
  78. /package/node_modules/@oxygen/shared/dist/{deliverability-loop.d.ts → mailboxes/deliverability-loop.d.ts} +0 -0
  79. /package/node_modules/@oxygen/shared/dist/{deliverability-loop.js → mailboxes/deliverability-loop.js} +0 -0
  80. /package/node_modules/@oxygen/shared/dist/{deliverability-surface.d.ts → mailboxes/deliverability-surface.d.ts} +0 -0
  81. /package/node_modules/@oxygen/shared/dist/{deliverability-surface.js → mailboxes/deliverability-surface.js} +0 -0
  82. /package/node_modules/@oxygen/shared/dist/{domain-authentication.d.ts → mailboxes/domain-authentication.d.ts} +0 -0
  83. /package/node_modules/@oxygen/shared/dist/{domain-authentication.js → mailboxes/domain-authentication.js} +0 -0
  84. /package/node_modules/@oxygen/shared/dist/{email-deliverability-policy.js → mailboxes/email-deliverability-policy.js} +0 -0
  85. /package/node_modules/@oxygen/shared/dist/{email-health-status.d.ts → mailboxes/email-health-status.d.ts} +0 -0
  86. /package/node_modules/@oxygen/shared/dist/{email-health-status.js → mailboxes/email-health-status.js} +0 -0
  87. /package/node_modules/@oxygen/shared/dist/{email-health-summary.d.ts → mailboxes/email-health-summary.d.ts} +0 -0
  88. /package/node_modules/@oxygen/shared/dist/{email-health-summary.js → mailboxes/email-health-summary.js} +0 -0
  89. /package/node_modules/@oxygen/shared/dist/{emailguard-placement-probe.d.ts → mailboxes/emailguard-placement-probe.d.ts} +0 -0
  90. /package/node_modules/@oxygen/shared/dist/{microsoft-consent-url.d.ts → mailboxes/microsoft-consent-url.d.ts} +0 -0
  91. /package/node_modules/@oxygen/shared/dist/{microsoft-consent-url.js → mailboxes/microsoft-consent-url.js} +0 -0
  92. /package/node_modules/@oxygen/shared/dist/{placement-copy.d.ts → mailboxes/placement-copy.d.ts} +0 -0
  93. /package/node_modules/@oxygen/shared/dist/{placement-copy.js → mailboxes/placement-copy.js} +0 -0
  94. /package/node_modules/@oxygen/shared/dist/{placement-history.d.ts → mailboxes/placement-history.d.ts} +0 -0
  95. /package/node_modules/@oxygen/shared/dist/{placement-history.js → mailboxes/placement-history.js} +0 -0
  96. /package/node_modules/@oxygen/shared/dist/{placement-report.d.ts → mailboxes/placement-report.d.ts} +0 -0
  97. /package/node_modules/@oxygen/shared/dist/{placement-report.js → mailboxes/placement-report.js} +0 -0
  98. /package/node_modules/@oxygen/shared/dist/{received-authentication.d.ts → mailboxes/received-authentication.d.ts} +0 -0
  99. /package/node_modules/@oxygen/shared/dist/{received-authentication.js → mailboxes/received-authentication.js} +0 -0
  100. /package/node_modules/@oxygen/shared/dist/{ses-identity-policy.d.ts → mailboxes/ses-identity-policy.d.ts} +0 -0
  101. /package/node_modules/@oxygen/shared/dist/{ses-identity-policy.js → mailboxes/ses-identity-policy.js} +0 -0
  102. /package/node_modules/@oxygen/shared/dist/{mailbox-standby.d.ts → mailboxes/standby.d.ts} +0 -0
  103. /package/node_modules/@oxygen/shared/dist/{mailbox-standby.js → mailboxes/standby.js} +0 -0
  104. /package/node_modules/@oxygen/shared/dist/{warmup-metrics.d.ts → mailboxes/warmup-metrics.d.ts} +0 -0
  105. /package/node_modules/@oxygen/shared/dist/{onboarding-first-leads.d.ts → onboarding/first-leads.d.ts} +0 -0
  106. /package/node_modules/@oxygen/shared/dist/{onboarding-first-leads.js → onboarding/first-leads.js} +0 -0
  107. /package/node_modules/@oxygen/shared/dist/{future-signup-events.d.ts → onboarding/future-signup-events.d.ts} +0 -0
  108. /package/node_modules/@oxygen/shared/dist/{future-signup-events.js → onboarding/future-signup-events.js} +0 -0
  109. /package/node_modules/@oxygen/shared/dist/{future-signup-lifecycle-projection.d.ts → onboarding/future-signup-lifecycle-projection.d.ts} +0 -0
  110. /package/node_modules/@oxygen/shared/dist/{future-signup-lifecycle-projection.js → onboarding/future-signup-lifecycle-projection.js} +0 -0
  111. /package/node_modules/@oxygen/shared/dist/{guided-activation.fixture.d.ts → onboarding/guided-activation.fixture.d.ts} +0 -0
  112. /package/node_modules/@oxygen/shared/dist/{guided-activation.fixture.js → onboarding/guided-activation.fixture.js} +0 -0
  113. /package/node_modules/@oxygen/shared/dist/{onboarding-plays.d.ts → onboarding/plays.d.ts} +0 -0
  114. /package/node_modules/@oxygen/shared/dist/{onboarding-plays.js → onboarding/plays.js} +0 -0
  115. /package/node_modules/@oxygen/shared/dist/{onboarding-research.d.ts → onboarding/research.d.ts} +0 -0
  116. /package/node_modules/@oxygen/shared/dist/{onboarding-research.js → onboarding/research.js} +0 -0
  117. /package/node_modules/@oxygen/shared/dist/{signup-lead-deliveries.d.ts → onboarding/signup-lead-deliveries.d.ts} +0 -0
  118. /package/node_modules/@oxygen/shared/dist/{signup-lead-deliveries.js → onboarding/signup-lead-deliveries.js} +0 -0
  119. /package/node_modules/@oxygen/shared/dist/{signup-lead-payload.d.ts → onboarding/signup-lead-payload.d.ts} +0 -0
  120. /package/node_modules/@oxygen/shared/dist/{signup-lead-webhook.d.ts → onboarding/signup-lead-webhook.d.ts} +0 -0
  121. /package/node_modules/@oxygen/shared/dist/{column-decision.d.ts → tables/column-decision.d.ts} +0 -0
  122. /package/node_modules/@oxygen/shared/dist/{column-types.d.ts → tables/column-types.d.ts} +0 -0
  123. /package/node_modules/@oxygen/shared/dist/{column-types.js → tables/column-types.js} +0 -0
  124. /package/node_modules/@oxygen/shared/dist/{company-enrichment-fields.d.ts → tables/company-enrichment-fields.d.ts} +0 -0
  125. /package/node_modules/@oxygen/shared/dist/{company-enrichment-fields.js → tables/company-enrichment-fields.js} +0 -0
  126. /package/node_modules/@oxygen/shared/dist/{enrichment-intents.js → tables/enrichment-intents.js} +0 -0
  127. /package/node_modules/@oxygen/shared/dist/{file-import.d.ts → tables/file-import.d.ts} +0 -0
  128. /package/node_modules/@oxygen/shared/dist/{import-limits.d.ts → tables/import-limits.d.ts} +0 -0
  129. /package/node_modules/@oxygen/shared/dist/{import-limits.js → tables/import-limits.js} +0 -0
  130. /package/node_modules/@oxygen/shared/dist/{table-limits.d.ts → tables/limits.d.ts} +0 -0
  131. /package/node_modules/@oxygen/shared/dist/{table-limits.js → tables/limits.js} +0 -0
  132. /package/node_modules/@oxygen/shared/dist/{ugc-amplification-identity.d.ts → ugc/amplification-identity.d.ts} +0 -0
  133. /package/node_modules/@oxygen/shared/dist/{ugc.d.ts → ugc/ugc.d.ts} +0 -0
  134. /package/node_modules/@oxygen/shared/dist/{ugc.js → ugc/ugc.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.2040
37
+ Version: 1.1014.2101
@@ -383,6 +383,18 @@ function writeMaxCreditsHint(error) {
383
383
  process.stderr.write(`hint: the estimate is ${estimated} credits; re-run with --max-credits ${estimated} or higher\n`);
384
384
  return;
385
385
  }
386
+ // A paused run never finishes, so its wait times out: say how to resume it.
387
+ case "table_action_run_wait_timeout": {
388
+ if (readDetailsString(error.details, "status") !== "paused")
389
+ return;
390
+ const userMessage = readDetailsString(error.details, "user_message");
391
+ const nextStep = readDetailsString(error.details, "next_step");
392
+ if (userMessage)
393
+ process.stderr.write(`hint: ${userMessage}\n`);
394
+ if (nextStep)
395
+ process.stderr.write(`hint: ${nextStep}\n`);
396
+ return;
397
+ }
386
398
  case "copilot_send_timeout": {
387
399
  const nextStep = readDetailsString(error.details, "next_step");
388
400
  const interrupt = readDetailsString(error.details, "interrupt_command");
@@ -1,5 +1,5 @@
1
1
  import { OxygenError } from "@oxygen/shared/cli-result";
2
- import { COLUMN_DECISION_GROUNDINGS, } from "@oxygen/shared/column-decision";
2
+ import { COLUMN_DECISION_GROUNDINGS, } from "@oxygen/shared/tables/column-decision";
3
3
  function readFlag(value) {
4
4
  if (typeof value !== "string")
5
5
  return null;
@@ -1,5 +1,5 @@
1
1
  import { QueryColumnDescriptor } from "../../command-support.js";
2
- import type { RowsFileFormat } from "@oxygen/shared/file-import";
2
+ import type { RowsFileFormat } from "@oxygen/shared/tables/file-import";
3
3
  export declare const TABLE_BUNDLE_SCHEMA_VERSION = 2;
4
4
  export declare const TABLE_BUNDLE_LEGACY_SCHEMA_VERSION = 1;
5
5
  export declare const TABLE_BUNDLE_SUPPORTED_SCHEMA_VERSIONS: number[];
@@ -1,7 +1,7 @@
1
1
  import { readRecordString } from "../../cli-values.js";
2
2
  import { readRecord } from "../../command-support.js";
3
3
  import { OxygenError } from "@oxygen/shared/cli-result";
4
- import { parseRowsFileBuffer } from "@oxygen/shared/file-import";
4
+ import { parseRowsFileBuffer } from "@oxygen/shared/tables/file-import";
5
5
  import { existsSync, readFileSync, createReadStream, statSync, openSync, readSync, closeSync } from "node:fs";
6
6
  import { createInterface } from "node:readline/promises";
7
7
  // Bundle formats. Version 2 is line-delimited: a header line carrying the
@@ -3,7 +3,7 @@ import { readRecord } from "../../command-support.js";
3
3
  import { requestOxygen } from "../../http-client.js";
4
4
  import { readOption } from "../../util.js";
5
5
  import { OxygenError } from "@oxygen/shared/cli-result";
6
- import { normalizeRowsForNewTable, inferImportColumnLabels, normalizeImportColumnKey } from "@oxygen/shared/file-import";
6
+ import { normalizeRowsForNewTable, inferImportColumnLabels, normalizeImportColumnKey } from "@oxygen/shared/tables/file-import";
7
7
  import { tableWebUrl } from "./import-values.js";
8
8
  import { normalizeCreatedTableUpsertKey } from "./bundle-format.js";
9
9
  export async function prepareImportTarget(table, options, parsedRows) {
@@ -1,4 +1,4 @@
1
- import type { RowsFileFormat } from "@oxygen/shared/file-import";
1
+ import type { RowsFileFormat } from "@oxygen/shared/tables/file-import";
2
2
  import { TablesFileImportOptions } from "./options.js";
3
3
  import { ImportTarget } from "./import-columns.js";
4
4
  /**
@@ -4,7 +4,7 @@ import { defaultApiUrl } from "../../credentials.js";
4
4
  import { oxygenAppUrl } from "../../help.js";
5
5
  import { STREAMED_FILE_IMPORT_MIN_BYTES } from "../../streamed-file-import.js";
6
6
  import { OxygenError } from "@oxygen/shared/cli-result";
7
- import { MAX_BUFFERED_IMPORT_PARSE_BYTES } from "@oxygen/shared/file-import";
7
+ import { MAX_BUFFERED_IMPORT_PARSE_BYTES } from "@oxygen/shared/tables/file-import";
8
8
  import { PLAN_LIMITS, MAX_CLI_JSON_BODY_BYTES } from "@oxygen/shared/plan-limits";
9
9
  import { createHash } from "node:crypto";
10
10
  import { readFileSync } from "node:fs";
@@ -1,4 +1,4 @@
1
- import type { RowsFileFormat } from "@oxygen/shared/file-import";
1
+ import type { RowsFileFormat } from "@oxygen/shared/tables/file-import";
2
2
  import { TablesFileImportOptions, TablesImportOptions } from "./options.js";
3
3
  /**
4
4
  * `--url` hands the fetch to the server: the same durable import the file path
@@ -5,7 +5,7 @@ import { shouldStreamFileImport, STREAMED_FILE_IMPORT_MIN_BYTES, scanStreamedImp
5
5
  import { readOption } from "../../util.js";
6
6
  import { chunk } from "@oxygen/shared/array-utils";
7
7
  import { OxygenError } from "@oxygen/shared/cli-result";
8
- import { normalizeRowsFormat, inferRowsFileFormat, assertImportFormatWithinBufferedLimit, dropBlankImportCells } from "@oxygen/shared/file-import";
8
+ import { normalizeRowsFormat, inferRowsFileFormat, assertImportFormatWithinBufferedLimit, dropBlankImportCells } from "@oxygen/shared/tables/file-import";
9
9
  import { statSync, readFileSync } from "node:fs";
10
10
  import { basename } from "node:path";
11
11
  import { emitQueueWaitStderrNote, enqueueImportFile, formatMebibytes, putImportFile, tryEnqueueStagedFileImport } from "./import-upload.js";
@@ -1,4 +1,4 @@
1
- import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/table-limits";
1
+ import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/tables/limits";
2
2
  import { emitCliFailure, emitSuccess } from "../../cli-output.js";
3
3
  import { readPositiveInt } from "../../cli-values.js";
4
4
  import { requestOxygen } from "../../http-client.js";
@@ -1,7 +1,7 @@
1
1
  import { parseJsonArray } from "../../command-support.js";
2
2
  import { readOption } from "../../util.js";
3
3
  import { OxygenError } from "@oxygen/shared/cli-result";
4
- import { normalizeRowsFormat, inferRowsFileFormat, parseRowsFileBuffer } from "@oxygen/shared/file-import";
4
+ import { normalizeRowsFormat, inferRowsFileFormat, parseRowsFileBuffer } from "@oxygen/shared/tables/file-import";
5
5
  import { readFileSync } from "node:fs";
6
6
  import { resolve } from "node:path";
7
7
  export async function readDeleteRowIdsOption(options) {
@@ -263,9 +263,16 @@ interface GetSurfaceRunWaitParams {
263
263
  timeoutCode: string;
264
264
  timeoutMessage: string;
265
265
  timeoutDetailIdKey: string;
266
+ timeoutExtraDetails?: CliRunWaitConfig["timeoutExtraDetails"];
266
267
  }
267
268
  export declare function buildGetSurfaceRunWaitConfig(params: GetSurfaceRunWaitParams): CliRunWaitConfig;
268
269
  export declare function waitForTableActionRun(runId: string, options: TableRunsWaitOptions): Promise<Record<string, unknown>>;
270
+ /**
271
+ * A paused run never finishes on its own, so the wait times out on it. Say
272
+ * why it is paused and how to resume, as the MCP wait's text does; the wait's
273
+ * timeout and return are unchanged.
274
+ */
275
+ export declare function pausedTableRunWaitDetails(runId: string, latestRun: Record<string, unknown> | null, status: string | null): Record<string, unknown>;
269
276
  export type QueryColumnDescriptor = {
270
277
  id?: string;
271
278
  key: string;
@@ -447,6 +447,7 @@ export function buildGetSurfaceRunWaitConfig(params) {
447
447
  timeoutCode: params.timeoutCode,
448
448
  timeoutMessage: params.timeoutMessage,
449
449
  timeoutDetailIdKey: params.timeoutDetailIdKey,
450
+ ...(params.timeoutExtraDetails ? { timeoutExtraDetails: params.timeoutExtraDetails } : {}),
450
451
  };
451
452
  }
452
453
  export function waitForTableActionRun(runId, options) {
@@ -464,8 +465,32 @@ export function waitForTableActionRun(runId, options) {
464
465
  timeoutCode: "table_action_run_wait_timeout",
465
466
  timeoutMessage: "Timed out waiting for table action run to finish.",
466
467
  timeoutDetailIdKey: "action_run_id",
468
+ timeoutExtraDetails: (latestRun, status) => pausedTableRunWaitDetails(runId, latestRun, status),
467
469
  }));
468
470
  }
471
+ /**
472
+ * A paused run never finishes on its own, so the wait times out on it. Say
473
+ * why it is paused and how to resume, as the MCP wait's text does; the wait's
474
+ * timeout and return are unchanged.
475
+ */
476
+ export function pausedTableRunWaitDetails(runId, latestRun, status) {
477
+ if (status !== "paused" || !latestRun)
478
+ return {};
479
+ const resume = `oxygen table-runs resume ${runId}`;
480
+ const forCredits = readRecordString(latestRun, "recommended_action") === "top_up_then_resume";
481
+ const userMessage = readRecordString(latestRun, "user_message");
482
+ // Disconnecting an account frees credits only when some are held for one.
483
+ const creditPause = latestRun.credit_pause;
484
+ const heldForAccounts = typeof creditPause === "object" && creditPause !== null
485
+ && creditPause.credits_held_for_accounts === true;
486
+ return {
487
+ ...(userMessage ? { user_message: userMessage } : {}),
488
+ ...(forCredits ? { recommended_action: "top_up_then_resume" } : {}),
489
+ next_step: forCredits
490
+ ? `${heldForAccounts ? "Top up credits or disconnect an account" : "Top up credits"} in Billing, then run \`${resume}\`.`
491
+ : `Run \`${resume}\` to continue it.`,
492
+ };
493
+ }
469
494
  export function normalizeExportRowsFormat(value) {
470
495
  const normalized = value?.trim().toLowerCase() || "json";
471
496
  if (normalized === "json"
@@ -199,7 +199,7 @@ export function registerBillingFamily(program, handleAsyncAction, billingDocsUrl
199
199
  .option("--provider <provider>", "Filter by provider id. With --meter provider_seats, selects the seat provider: linkedin (default) or whatsapp.")
200
200
  .option("--source <source_id>", "Filter by source_id/provider operation.")
201
201
  .option("--source-id <source_id>", "Alias for --source.")
202
- .option("--run-id <run_id>", "Filter by run id recorded in ledger metadata. New settlements preserve the reserve's run id; historical settled charges can omit it. For those older runs, use `table-runs get <run>` (creditsUsed) or `table-runs items`.")
202
+ .option("--run-id <run_id>", "Filter by run id recorded in ledger metadata. New settlements preserve the reserve's run id; historical settled charges can omit it. For those older runs, use `table-runs get <run>` (creditsUsed); `table-runs items` lists per-item credits while the run keeps its items; where run history retention is on, settled items go 24 hours after the run ends.")
203
203
  .option("--nonzero", "Only include events that changed available or reserved credits.")
204
204
  .option("--workspace <id|slug>", "Only one workspace's spend on a plan that pays for several (credits meter).")
205
205
  .option("--group-by <key>", "workspace: credits spent per workspace on a pooled plan, in by_workspace, for the same filters (credits meter).")
@@ -227,7 +227,7 @@ export function registerBillingFamily(program, handleAsyncAction, billingDocsUrl
227
227
  .option("--provider <provider>", "Filter by provider id.")
228
228
  .option("--source <source_id>", "Filter by source_id/provider operation.")
229
229
  .option("--source-id <source_id>", "Alias for --source.")
230
- .option("--run-id <run_id>", "Filter by run id recorded in ledger metadata. New settlements preserve the reserve's run id; historical settled charges can omit it. For those older runs, use `table-runs get <run>` (creditsUsed) or `table-runs items`.")
230
+ .option("--run-id <run_id>", "Filter by run id recorded in ledger metadata. New settlements preserve the reserve's run id; historical settled charges can omit it. For those older runs, use `table-runs get <run>` (creditsUsed); `table-runs items` lists per-item credits while the run keeps its items; where run history retention is on, settled items go 24 hours after the run ends.")
231
231
  .option("--nonzero", "Only include events that changed available or reserved credits. Default for audit except BYOK filters.")
232
232
  .option("--json", "Print a JSON envelope.")
233
233
  .action(async (options) => {
@@ -1,4 +1,4 @@
1
- import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/table-limits";
1
+ import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/tables/limits";
2
2
  import { parseKeyValuePairs, parseJsonObject, readNonNegativeInt, readPositiveInt, readRecordString } from "../cli-values.js";
3
3
  import { readColumnDecisionFlags } from "../column-decision-options.js";
4
4
  import { formatAiPromptPreviewNotice, formatColumnReferenceNotices, formatEnrichmentInputMappingNotice } from "../column-run-notices.js";
@@ -1,4 +1,4 @@
1
- import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/table-limits";
1
+ import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/tables/limits";
2
2
  import { readJsonObjectOption, readPositiveInt } from "../cli-values.js";
3
3
  import { readCsvOption, readFilterSelectionOption, readPositiveNumber } from "../command-support.js";
4
4
  import { requestOxygen } from "../http-client.js";
@@ -5,7 +5,7 @@ import { requestOxygen } from "../http-client.js";
5
5
  import { readOption } from "../util.js";
6
6
  import { withDeliverabilityEvidenceCommands } from "../deliverability-evidence-commands.js";
7
7
  import { OxygenError } from "@oxygen/shared/cli-result";
8
- import { inferRowsFileFormat, parseXlsxWorkbookBuffer } from "@oxygen/shared/file-import";
8
+ import { inferRowsFileFormat, parseXlsxWorkbookBuffer } from "@oxygen/shared/tables/file-import";
9
9
  import { MAILBOX_IMPORT_FILE_MAX_BYTES as SHARED_MAILBOX_IMPORT_FILE_MAX_BYTES, MAILBOX_IMPORT_ROW_LIMIT as SHARED_MAILBOX_IMPORT_ROW_LIMIT, normalizeMailboxImportFile as normalizeSharedMailboxImportFile, normalizeMailboxImportVendor as normalizeSharedMailboxImportVendor, normalizeMailboxWorkbookRows, parseMailboxImportText, summarizeMailboxImportValidation as summarizeSharedMailboxImportValidation } from "@oxygen/shared/mailbox-import";
10
10
  import { Command, Option } from "commander";
11
11
  import { formatMailboxFleetHealth, formatMailboxRoster } from "../mailbox-fleet-output.js";
@@ -1,4 +1,4 @@
1
- import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/table-limits";
1
+ import { MAX_TABLE_ACTION_RUN_MAX_CONCURRENCY } from "@oxygen/shared/tables/limits";
2
2
  import { parseJsonObject, readPositiveInt } from "../cli-values.js";
3
3
  import { formatRows, normalizeExportRowsFormat, parseJsonArray, readCsvOption, readFilterSelectionOption, readFormulaValuesOption, readPositiveNumber, tableRunsListPath, waitForTableActionRun } from "../command-support.js";
4
4
  import { requestOxygen } from "../http-client.js";
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { resolve } from "node:path";
3
- import { DELIVERABILITY_CHECK_LIST_FIELDS, DELIVERABILITY_EVIDENCE_FIELDS, DELIVERABILITY_OBSERVATION_LIST_FIELDS, DELIVERABILITY_SURFACE_BUCKETS, DELIVERABILITY_SURFACE_CHECK_KINDS, DELIVERABILITY_SURFACE_FINDING_STATUSES, DELIVERABILITY_SURFACE_FOLDERS, DELIVERABILITY_SURFACE_MAX_LIMIT, DELIVERABILITY_SURFACE_RECEIVER_PROVIDERS, DELIVERABILITY_SURFACE_RUN_STATUSES, DELIVERABILITY_SURFACE_SOURCES, DELIVERABILITY_SURFACE_SUBJECT_TYPES, deliverabilitySurfaceQuery, } from "@oxygen/shared/deliverability-surface";
3
+ import { DELIVERABILITY_CHECK_LIST_FIELDS, DELIVERABILITY_EVIDENCE_FIELDS, DELIVERABILITY_OBSERVATION_LIST_FIELDS, DELIVERABILITY_SURFACE_BUCKETS, DELIVERABILITY_SURFACE_CHECK_KINDS, DELIVERABILITY_SURFACE_FINDING_STATUSES, DELIVERABILITY_SURFACE_FOLDERS, DELIVERABILITY_SURFACE_MAX_LIMIT, DELIVERABILITY_SURFACE_RECEIVER_PROVIDERS, DELIVERABILITY_SURFACE_RUN_STATUSES, DELIVERABILITY_SURFACE_SOURCES, DELIVERABILITY_SURFACE_SUBJECT_TYPES, deliverabilitySurfaceQuery, } from "@oxygen/shared/mailboxes/deliverability-surface";
4
4
  import { Command, Option } from "commander";
5
5
  import { requestOxygen } from "./http-client.js";
6
6
  const WINDOW_HELP = "ISO 8601 time or a relative window such as 7d or 24h.";
@@ -1,4 +1,4 @@
1
- import { type RowsFileFormat } from "@oxygen/shared/file-import";
1
+ import { type RowsFileFormat } from "@oxygen/shared/tables/file-import";
2
2
  /**
3
3
  * Large-file imports (decision F.8, 2026-09-27: up to 5 GiB on the largest plans).
4
4
  *
@@ -1,7 +1,7 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { createReadStream } from "node:fs";
3
3
  import { Readable } from "node:stream";
4
- import { iterateRowsFileStreamBatches, } from "@oxygen/shared/file-import";
4
+ import { iterateRowsFileStreamBatches, } from "@oxygen/shared/tables/file-import";
5
5
  /**
6
6
  * Large-file imports (decision F.8, 2026-09-27: up to 5 GiB on the largest plans).
7
7
  *
@@ -1,4 +1,4 @@
1
- import type { GuidedActivationRoutine } from "./guided-activation.js";
1
+ import type { GuidedActivationRoutine } from "./onboarding/guided-activation.js";
2
2
  import { type WorkspaceEventCatalogEntry } from "./workspace-event-catalog.js";
3
3
  import { type AgentSessionSchedule } from "./agent-session-schedule.js";
4
4
  export type AgentSessionStatus = "draft" | "active" | "paused" | "budget_wait" | "completed" | "archived";
@@ -1,5 +1,5 @@
1
1
  import { agentsEnabled, agentsEnabledIn } from "./agents-enabled.js";
2
- import { guidedActivationEnabled } from "./guided-activation.js";
2
+ import { guidedActivationEnabled } from "./onboarding/guided-activation.js";
3
3
  import { networkMiningEnabled } from "./network-mining.js";
4
4
  import { validateContract } from "./contracts/schema.js";
5
5
  import { GUIDED_ACTIVATION_SCAN_POLICY_CONTRACT } from "./contracts/guided-activation.js";
@@ -1,5 +1,5 @@
1
1
  import type { CapabilityMcpCall, CapabilityRouteCard } from "./capability-discovery-types.js";
2
- import { type EnrichmentIntentTaxonomyEntry } from "./enrichment-intents.js";
2
+ import { type EnrichmentIntentTaxonomyEntry } from "./tables/enrichment-intents.js";
3
3
  import { type RecipePrimitive } from "./recipes.js";
4
4
  import { type SkillPlayMatch } from "./skill-play-routing.js";
5
5
  export { matchSkillPlay, SKILL_PLAY_TRIGGERS, type SkillPlayMatch } from "./skill-play-routing.js";
@@ -4,7 +4,7 @@ import { normalizeIntent } from "./capability-intents/normalize.js";
4
4
  import { withRecordBrief } from "./capability-intents/records.js";
5
5
  import { isCompanySourcingIntent, sourcingPlaybookFor } from "./capability-intents/sourcing-and-provider-tools.js";
6
6
  import { CAPABILITY_ROUTE_DEFINITIONS } from "./capability-routes/index.js";
7
- import { findEnrichmentIntentByAlias } from "./enrichment-intents.js";
7
+ import { findEnrichmentIntentByAlias } from "./tables/enrichment-intents.js";
8
8
  import { networkMiningEnabled } from "./network-mining.js";
9
9
  import { nativeChatEnabled, withNativeChatDiscovery } from "./support/native-chat-discovery.js";
10
10
  import { RECIPE_PRIMITIVES } from "./recipes.js";
@@ -1,5 +1,5 @@
1
1
  import { arr, bool, enumOf, int, num, obj, str } from "./schema.js";
2
- import { GUIDED_ACTIVATION_REVISIONS } from "../guided-activation.js";
2
+ import { GUIDED_ACTIVATION_REVISIONS } from "../onboarding/guided-activation.js";
3
3
  const id = () => str({ minLength: 1, maxLength: 160 });
4
4
  export const GUIDED_ACTIVATION_REVISIONS_CONTRACT = obj(Object.fromEntries(GUIDED_ACTIVATION_REVISIONS.map(key => [key, id()])), { required: [...GUIDED_ACTIVATION_REVISIONS] });
5
5
  export const GUIDED_ACTIVATION_SCAN_POLICY_CONTRACT = obj({
@@ -1,4 +1,4 @@
1
- import { guidedActivationEnabled } from "./guided-activation.js";
1
+ import { guidedActivationEnabled } from "./onboarding/guided-activation.js";
2
2
  import { isStaffEmail } from "./staff.js";
3
3
  export function copilotAudience(env = process.env) {
4
4
  const deployment = env.OXYGEN_DEPLOY_ENV?.trim().toLowerCase();
@@ -32,7 +32,7 @@
32
32
  * So a host must be in this tier to be safe for BOTH, and the safe direction for an
33
33
  * edit is to ADD, never to remove or relocate to the broad tier. Extend it only with
34
34
  * hosts that are unambiguously consumer mailboxes — and note the ORDER caveat in
35
- * `packages/tenant-db/src/freemail-domains.ts`, because a core-tier edit also changes
35
+ * `packages/tenant-db/src/mailboxes/freemail-domains.ts`, because a core-tier edit also changes
36
36
  * a formula string already persisted in every tenant's column definitions.
37
37
  *
38
38
  * - `PERSONAL_EMAIL_DOMAINS` (broad) answers "is this domain a poor stand-in for a
@@ -32,7 +32,7 @@
32
32
  * So a host must be in this tier to be safe for BOTH, and the safe direction for an
33
33
  * edit is to ADD, never to remove or relocate to the broad tier. Extend it only with
34
34
  * hosts that are unambiguously consumer mailboxes — and note the ORDER caveat in
35
- * `packages/tenant-db/src/freemail-domains.ts`, because a core-tier edit also changes
35
+ * `packages/tenant-db/src/mailboxes/freemail-domains.ts`, because a core-tier edit also changes
36
36
  * a formula string already persisted in every tenant's column definitions.
37
37
  *
38
38
  * - `PERSONAL_EMAIL_DOMAINS` (broad) answers "is this domain a poor stand-in for a
@@ -18,8 +18,8 @@ export * from "./provider-balance-signal.js";
18
18
  export * from "./provider-funding-errors.js";
19
19
  export * from "./publishing-limits.js";
20
20
  export * from "./spend-safety.js";
21
- export * from "./company-enrichment-fields.js";
22
- export * from "./enrichment-intents.js";
21
+ export * from "./tables/company-enrichment-fields.js";
22
+ export * from "./tables/enrichment-intents.js";
23
23
  export * from "./error-message.js";
24
24
  export * from "./sql-rows.js";
25
25
  export * from "./cell-format.js";
@@ -29,7 +29,7 @@ export * from "./cli-result.js";
29
29
  export * from "./collab.js";
30
30
  export * from "./crm-reply-events.js";
31
31
  export * from "./crm-activity-events.js";
32
- export * from "./column-types.js";
32
+ export * from "./tables/column-types.js";
33
33
  export * from "./copilot-errors.js";
34
34
  export * from "./copilot-journeys.js";
35
35
  export * from "./copilot-playbooks.js";
@@ -42,8 +42,8 @@ export * from "./email-hard-bounce.js";
42
42
  export * from "./email-tracking-token.js";
43
43
  export * from "./email-unsubscribe-token.js";
44
44
  export * from "./error-redaction.js";
45
- export * from "./future-signup-events.js";
46
- export * from "./future-signup-lifecycle-projection.js";
45
+ export * from "./onboarding/future-signup-events.js";
46
+ export * from "./onboarding/future-signup-lifecycle-projection.js";
47
47
  export * from "./feature-gates.js";
48
48
  export * from "./product-analytics-core.js";
49
49
  export * from "./product-analytics-environment.js";
@@ -64,7 +64,7 @@ export * from "./linkedin-quota-denial.js";
64
64
  export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
66
  export * from "./member-columns.js";
67
- export * from "./microsoft-consent-url.js";
67
+ export * from "./mailboxes/microsoft-consent-url.js";
68
68
  export * from "./networks.js";
69
69
  export * from "./person-name.js";
70
70
  export * from "./product-doctrine.js";
@@ -81,8 +81,8 @@ export { ESP_MATCHING_MODES, type EspMatchingMode, DEFAULT_ESP_MATCHING_MODE, is
81
81
  export * from "./suppression-entries.js";
82
82
  export * from "./dnc-identities.js";
83
83
  export * from "./dnc-rules.js";
84
- export * from "./table-limits.js";
85
- export * from "./table-capacity.js";
84
+ export * from "./tables/limits.js";
85
+ export * from "./tables/capacity.js";
86
86
  export * from "./log.js";
87
87
  export * from "./log-collapse.js";
88
88
  export * from "./axiom-field-budget.js";
@@ -90,7 +90,7 @@ export { redactSecretsInString, sanitizeLogFields } from "./redaction.js";
90
90
  export * from "./provider-request-outcomes.js";
91
91
  export * from "./schedule-label.js";
92
92
  export * from "./social-capabilities.js";
93
- export * from "./signup-lead-deliveries.js";
93
+ export * from "./onboarding/signup-lead-deliveries.js";
94
94
  export * from "./sql-error.js";
95
95
  export * from "./postgres-text.js";
96
96
  export * from "./tags/tags.js";
@@ -112,8 +112,8 @@ export * from "./workspace-event-catalog.js";
112
112
  export * from "./notetaker-events.js";
113
113
  export * from "./workspace-agents.js";
114
114
  export * from "./semver.js";
115
- export * from "./ugc.js";
116
- export * from "./ugc-amplification-identity.js";
115
+ export * from "./ugc/ugc.js";
116
+ export * from "./ugc/amplification-identity.js";
117
117
  export * from "./knowledge-repository.js";
118
118
  export * from "./knowledge-bases.js";
119
119
  export * from "./external-write-policy.js";
@@ -18,8 +18,8 @@ export * from "./provider-balance-signal.js";
18
18
  export * from "./provider-funding-errors.js";
19
19
  export * from "./publishing-limits.js";
20
20
  export * from "./spend-safety.js";
21
- export * from "./company-enrichment-fields.js";
22
- export * from "./enrichment-intents.js";
21
+ export * from "./tables/company-enrichment-fields.js";
22
+ export * from "./tables/enrichment-intents.js";
23
23
  export * from "./error-message.js";
24
24
  export * from "./sql-rows.js";
25
25
  export * from "./cell-format.js";
@@ -29,7 +29,7 @@ export * from "./cli-result.js";
29
29
  export * from "./collab.js";
30
30
  export * from "./crm-reply-events.js";
31
31
  export * from "./crm-activity-events.js";
32
- export * from "./column-types.js";
32
+ export * from "./tables/column-types.js";
33
33
  export * from "./copilot-errors.js";
34
34
  export * from "./copilot-journeys.js";
35
35
  export * from "./copilot-playbooks.js";
@@ -42,8 +42,8 @@ export * from "./email-hard-bounce.js";
42
42
  export * from "./email-tracking-token.js";
43
43
  export * from "./email-unsubscribe-token.js";
44
44
  export * from "./error-redaction.js";
45
- export * from "./future-signup-events.js";
46
- export * from "./future-signup-lifecycle-projection.js";
45
+ export * from "./onboarding/future-signup-events.js";
46
+ export * from "./onboarding/future-signup-lifecycle-projection.js";
47
47
  export * from "./feature-gates.js";
48
48
  export * from "./product-analytics-core.js";
49
49
  export * from "./product-analytics-environment.js";
@@ -64,7 +64,7 @@ export * from "./linkedin-quota-denial.js";
64
64
  export * from "./tables/linkedin-url.js";
65
65
  export * from "./linkedin-sequences.js";
66
66
  export * from "./member-columns.js";
67
- export * from "./microsoft-consent-url.js";
67
+ export * from "./mailboxes/microsoft-consent-url.js";
68
68
  export * from "./networks.js";
69
69
  export * from "./person-name.js";
70
70
  export * from "./product-doctrine.js";
@@ -82,8 +82,8 @@ export { ESP_MATCHING_MODES, DEFAULT_ESP_MATCHING_MODE, isEspMatchingMode, valid
82
82
  export * from "./suppression-entries.js";
83
83
  export * from "./dnc-identities.js";
84
84
  export * from "./dnc-rules.js";
85
- export * from "./table-limits.js";
86
- export * from "./table-capacity.js";
85
+ export * from "./tables/limits.js";
86
+ export * from "./tables/capacity.js";
87
87
  export * from "./log.js";
88
88
  export * from "./log-collapse.js";
89
89
  export * from "./axiom-field-budget.js";
@@ -102,7 +102,7 @@ export { redactSecretsInString, sanitizeLogFields } from "./redaction.js";
102
102
  export * from "./provider-request-outcomes.js";
103
103
  export * from "./schedule-label.js";
104
104
  export * from "./social-capabilities.js";
105
- export * from "./signup-lead-deliveries.js";
105
+ export * from "./onboarding/signup-lead-deliveries.js";
106
106
  export * from "./sql-error.js";
107
107
  export * from "./postgres-text.js";
108
108
  export * from "./tags/tags.js";
@@ -124,8 +124,8 @@ export * from "./workspace-event-catalog.js";
124
124
  export * from "./notetaker-events.js";
125
125
  export * from "./workspace-agents.js";
126
126
  export * from "./semver.js";
127
- export * from "./ugc.js";
128
- export * from "./ugc-amplification-identity.js";
127
+ export * from "./ugc/ugc.js";
128
+ export * from "./ugc/amplification-identity.js";
129
129
  export * from "./knowledge-repository.js";
130
130
  export * from "./knowledge-bases.js";
131
131
  export * from "./external-write-policy.js";
@@ -103,7 +103,11 @@ export type LlmTracingClient = {
103
103
  * describes.
104
104
  */
105
105
  score(body: LlmScoreBody): Promise<boolean>;
106
- /** Never rejects; bounded at 5s on workers, 15s in serverless after(). */
106
+ /**
107
+ * Never rejects. One flush runs at a time, bounded at 5s on workers and 15s
108
+ * in serverless after(); a call made while one runs waits for it and then
109
+ * for the next, so it returns within ~10s (~30s serverless).
110
+ */
107
111
  flush(): Promise<void>;
108
112
  /** Flush + stop timers. Never rejects; bounded at 30s to drain active retries. */
109
113
  shutdown(): Promise<void>;
@@ -236,14 +236,19 @@ function sanitizedErrorReason(error) {
236
236
  return /^[A-Za-z][A-Za-z0-9_]{0,63}$/.test(name) ? name : "unknown";
237
237
  }
238
238
  function boundedNever(rejectable, warn, timeoutMs = FLUSH_TIMEOUT_MS) {
239
+ // A throwing logger must still settle: the client's shared flush waits on this.
240
+ const safeWarn = (error) => { try {
241
+ warn(error);
242
+ }
243
+ catch { /* fail-open */ } };
239
244
  return new Promise((resolve) => {
240
245
  const timer = setTimeout(() => {
241
- warn(new Error("langfuse_flush_deadline_exceeded"));
246
+ safeWarn(new Error("langfuse_flush_deadline_exceeded"));
242
247
  resolve();
243
248
  }, timeoutMs);
244
249
  timer.unref?.();
245
250
  rejectable
246
- .catch((error) => warn(error))
251
+ .catch((error) => safeWarn(error))
247
252
  .finally(() => {
248
253
  clearTimeout(timer);
249
254
  resolve();
@@ -926,6 +931,23 @@ export function createLlmTracingClient(env = process.env, options) {
926
931
  ...(body.endTime ? { endTime: body.endTime } : {}),
927
932
  });
928
933
  }, kind);
934
+ // One flush at a time per client; callers arriving meanwhile share one
935
+ // trailing flush, which starts after theirs were emitted. Off-web every AI
936
+ // cell schedules a fire-and-forget flush, and each forceFlush exports every
937
+ // queued span outside the BatchSpanProcessor's single export: a 20k-row dev
938
+ // run held thousands of serialized batches and their retries in the
939
+ // provider heap (1.45 GB, 2.5 s GC stalls) while Langfuse timed out.
940
+ const boundedFlush = () => boundedNever((async () => emitter.flush())(), (error) => warn(error, { stage: "flush" }), env.VERCEL ? 15_000 : FLUSH_TIMEOUT_MS);
941
+ let flushInFlight = null;
942
+ let trailingFlush = null;
943
+ const flush = () => {
944
+ if (!flushInFlight) {
945
+ flushInFlight = boundedFlush().finally(() => { flushInFlight = null; });
946
+ return flushInFlight;
947
+ }
948
+ trailingFlush ??= flushInFlight.then(() => { trailingFlush = null; return flush(); });
949
+ return trailingFlush;
950
+ };
929
951
  return {
930
952
  trace: (body) => guarded(() => {
931
953
  const startTime = body.startTime ?? new Date();
@@ -1023,7 +1045,7 @@ export function createLlmTracingClient(env = process.env, options) {
1023
1045
  // The "never rejects, bounded at ~5s" contract is the CLIENT's, so it is
1024
1046
  // enforced here (15s for serverless after()) rather than inside one emitter — an emitter that throws
1025
1047
  // synchronously or rejects must still not escape into product code.
1026
- flush: () => boundedNever((async () => emitter.flush())(), (error) => warn(error, { stage: "flush" }), env.VERCEL ? 15_000 : FLUSH_TIMEOUT_MS),
1048
+ flush,
1027
1049
  shutdown: () => boundedNever(
1028
1050
  // The final window is reported whatever its age: nothing follows it.
1029
1051
  (async () => { try {
@@ -1,4 +1,4 @@
1
- import type { SequenceSendWindow } from "./sequences.js";
1
+ import type { SequenceSendWindow } from "../sequences.js";
2
2
  /** Deliverability defaults are independent of pricing and confer no send/spend authority. */
3
3
  export declare const EMAIL_DELIVERABILITY_POLICY_VERSION = "2026-09-27-v1";
4
4
  export declare const EMAIL_DELIVERABILITY_DEFAULTS: Readonly<{
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { CliHttpError } from "./cli-http-error.js";
2
+ import { CliHttpError } from "../cli-http-error.js";
3
3
  const MAX_SEED_RECIPIENTS = 50;
4
4
  const DEFAULT_SUBJECT = "Oxygen inbox-placement test";
5
5
  const DEFAULT_BODY = "This message is an inbox-placement test sent from Oxygen.";
@@ -1,4 +1,4 @@
1
- export { mailboxStandbyWritesReady, assertMailboxStandbyWritesReady } from "./write-rollout.js";
1
+ export { mailboxStandbyWritesReady, assertMailboxStandbyWritesReady } from "../write-rollout.js";
2
2
  export declare function assertMailboxStandbyMetadataWriteReady(metadata: Record<string, unknown> | null | undefined): void;
3
3
  export declare function assertSequenceStandbyWriteReady(settings: {
4
4
  auto_replace_mailboxes?: boolean;
@@ -1,5 +1,5 @@
1
- import { assertMailboxStandbyMetadataWritesReady, assertMailboxStandbyWritesReady } from "./write-rollout.js";
2
- export { mailboxStandbyWritesReady, assertMailboxStandbyWritesReady } from "./write-rollout.js";
1
+ import { assertMailboxStandbyMetadataWritesReady, assertMailboxStandbyWritesReady } from "../write-rollout.js";
2
+ export { mailboxStandbyWritesReady, assertMailboxStandbyWritesReady } from "../write-rollout.js";
3
3
  export function assertMailboxStandbyMetadataWriteReady(metadata) {
4
4
  assertMailboxStandbyMetadataWritesReady(metadata);
5
5
  }
@@ -1,4 +1,4 @@
1
- import { isRecord } from "./type-guards.js";
1
+ import { isRecord } from "../type-guards.js";
2
2
  const SPAM_PLACEMENT_KEYS = ["landed_spam", "spam", "saved_from_spam", "savedFromSpam", "spam_saved", "rescued_from_spam"];
3
3
  const RESCUE_KEYS = SPAM_PLACEMENT_KEYS.slice(2);
4
4
  /** SendKit reports placement and independent send totals, not rescues or a failure count.
@@ -3,7 +3,7 @@ import { randomUUID } from "node:crypto";
3
3
  import { DeleteObjectCommand, GetObjectCommand, HeadObjectCommand, PutObjectCommand, S3Client, } from "@aws-sdk/client-s3";
4
4
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
5
5
  import { OxygenError } from "./cli-result.js";
6
- import { IMPORT_OBJECT_SINGLE_PUT_MAX_BYTES } from "./import-limits.js";
6
+ import { IMPORT_OBJECT_SINGLE_PUT_MAX_BYTES } from "./tables/import-limits.js";
7
7
  // S3-compatible object storage for large CSV/file imports. The CLI uploads the
8
8
  // raw file straight to the bucket via a presigned PUT URL (bypassing Vercel's
9
9
  // ~4.5MB request-body limit), then the Fly worker downloads it and COPY-loads
@@ -11,7 +11,7 @@ export type GuidedOnboardingResearch = {
11
11
  results_turn_id?: string;
12
12
  results_pending?: boolean;
13
13
  /** The lead list OXYGEN sources beside the research (onboarding-leads.ts). */
14
- leads?: import("./onboarding-leads.js").OnboardingLeadsProgress;
14
+ leads?: import("../onboarding-leads.js").OnboardingLeadsProgress;
15
15
  };
16
16
  export type GuidedActivationPurpose = typeof GUIDED_ACTIVATION_PURPOSES[number];
17
17
  export type GuidedActivationRoutine = {
@@ -1,5 +1,5 @@
1
- import { OxygenError } from "./cli-result.js";
2
- import { isProductionData } from "./deploy-env.js";
1
+ import { OxygenError } from "../cli-result.js";
2
+ import { isProductionData } from "../deploy-env.js";
3
3
  export const GUIDED_ACTIVATION_PURPOSES = ["lead_scan", "morning_briefing"];
4
4
  export const GUIDED_ACTIVATION_POINTERS = ["knowledge", "first_leads_table", "sequence", "sender", "oxygent", "direct_chat", "scan_routine", "briefing_routine"];
5
5
  export const GUIDED_ACTIVATION_REVISIONS = ["configuration", "sequence", "audience", "recipients", "sender", "copy", "knowledge", "schedule", "authority"];