@oxygen-agent/cli 1.1011.446 → 1.1011.469

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -34,4 +34,4 @@ oxygen update
34
34
 
35
35
  For product documentation, visit https://oxygen-agent.com/docs. For support, visit https://oxygen-agent.com.
36
36
 
37
- Version: 1.1011.446
37
+ Version: 1.1011.469
package/dist/index.js CHANGED
@@ -997,15 +997,12 @@ function writeDryRunNotice(data) {
997
997
  process.stderr.write(`${block.message}\n`);
998
998
  if (typeof block.next_step === "string")
999
999
  process.stderr.write(`${block.next_step}\n`);
1000
- // The server's next_step quotes the MANAGED price, because the live gate's
1001
- // `billedTool` reads the descriptor and never the credential mode. On a
1002
- // customer's own key that number is not what anyone pays, so say so instead
1003
- // of leaving a managed credit estimate as the last word on a BYOK preview.
1004
- // The `--max-credits` ceiling in that line is still required by the gate, so
1005
- // the command stays copy-pasteable rather than being edited into a 400.
1006
1000
  const byok = readByokCredentialMode(data);
1007
1001
  if (byok) {
1008
- process.stderr.write(`That estimate is the managed-key price. This run uses credential_mode ${byok}, so Oxygen charges no credits for it — your provider bills you directly. The live gate still requires --max-credits as a ceiling.\n`);
1002
+ const fee = asPayloadRecord(asPayloadRecord(data)?.credits)?.estimated_credits;
1003
+ process.stderr.write(typeof fee === "number"
1004
+ ? `Your own-key run (${byok}) is estimated at ${fee} Oxygen credits; your provider bills its call separately.\n`
1005
+ : `Your own-key run (${byok}) may incur an Oxygen platform fee; check the current credit quote before running it live. Your provider bills its call separately.\n`);
1009
1006
  }
1010
1007
  }
1011
1008
  /**
@@ -1017,7 +1014,7 @@ function readByokCredentialMode(data) {
1017
1014
  const result = asPayloadRecord(asPayloadRecord(data)?.result);
1018
1015
  const billing = asPayloadRecord(asPayloadRecord(result?.meta)?.billing);
1019
1016
  const mode = billing?.credential_mode;
1020
- if (typeof mode !== "string" || mode.length === 0 || mode === "managed")
1017
+ if (mode !== "byok" && mode !== "user_api_key")
1021
1018
  return null;
1022
1019
  return mode;
1023
1020
  }
@@ -1126,11 +1123,9 @@ function writeCreditsReceipt(data) {
1126
1123
  return;
1127
1124
  }
1128
1125
  if (typeof block.estimated_credits === "number") {
1129
- // A BYOK preview spends zero Oxygen credits, so quoting the managed
1130
- // estimate as "for a live run" is simply wrong; name the mode instead.
1131
1126
  const byok = readByokCredentialMode(data);
1132
1127
  process.stderr.write(byok
1133
- ? `estimated 0 Oxygen credits for a live run on your own key (${byok})${remaining !== null ? `, ${remaining} available` : ""}\n`
1128
+ ? `estimated ${block.estimated_credits.toLocaleString("en-US")} Oxygen credits for a live run on your own key (${byok})${remaining !== null ? `, ${remaining} available` : ""}\n`
1134
1129
  : `estimated ${block.estimated_credits.toLocaleString("en-US")} credits for a live run${remaining !== null ? `, ${remaining} available` : ""}\n`);
1135
1130
  // Last, where an agent reading the tail of the output sees it: the
1136
1131
  // estimate above is a ceiling, and only kept posts are charged
@@ -6595,7 +6590,7 @@ fixed scan; watermark_cursor starts a later bounded replay. Consumers must retai
6595
6590
  }));
6596
6591
  }))
6597
6592
  .addCommand(new Command("preview")
6598
- .description("Preview public LinkedIn posts for free (family linkedin_posts): up to 25 per keyword, with author, engagement and the --ai-filter applied. Nothing is created or charged. Each --keywords entry is one search against a small hourly search budget shared across OXYGEN, and keywords match their exact words: use a few short terms and let --ai-filter judge meaning. Then signals search run --family linkedin_posts with the same flags creates the table: free, except that with --ai-filter its Why it matches column fills itself for every kept post, quoted by the dry run.")
6593
+ .description("Preview public LinkedIn posts for free on Oxygen's Managed rail (family linkedin_posts): up to 25 per keyword, with author, engagement and the --ai-filter applied. Nothing is created or charged. Each --keywords entry is one search against a small hourly search budget shared across OXYGEN. After repricing, own-key previews are paused because they would make billable Up2Data calls without a credit approval; use Managed for the preview or quote a direct scraper tool run. Then signals search run --family linkedin_posts with the same flags creates the table.")
6599
6594
  .option("--family <family>", "linkedin_posts, the only family with a free preview.", "linkedin_posts")
6600
6595
  .option("--keywords <csv>", "A post must mention AT LEAST ONE of these (each is its own search, at most 5).")
6601
6596
  .option("--all-keywords <csv>", "A post must mention ALL of these.")
@@ -16132,7 +16127,7 @@ Examples:
16132
16127
  });
16133
16128
  }))
16134
16129
  .addCommand(new Command("push-external")
16135
- .description("Push table rows into a campaign you ALREADY run in an external sequencer (Smartlead, Instantly, lemlist, HeyReach), through your own connected API key. This is the External-layer sibling of `sequences enroll`: use it when the campaign lives in that tool and the rows live in Oxygen; for an Oxygen-native Sequence use `sequences create` + `sequences enroll` instead. Oxygen charges 0 credits (BYOK — your provider bills you), but it IS an external write: --mode dry_run (the default) previews the resolved campaign, the exact field mapping, three sample leads and the row counts, and --mode live --approved queues a durable per-row run. Every row gets its own cell holding that row's provider response as provenance, and a row already pushed to this campaign is skipped unless --force. The preview's live_executable reports whether Oxygen can queue the live push for that provider; when it cannot, the preview still gives you the resolved campaign, the mapping and the counts, and names the alternative.")
16130
+ .description("Inspect a possible push from an Oxygen table into an existing Smartlead, Instantly, lemlist, or HeyReach campaign. The preview shows field mapping, sample leads, row counts, and whether the live push is available. An own-key campaign lookup carries Oxygen's quoted per-call platform fee after repricing, so an unapproved preview does not call the provider. When live_executable is false, use the provider's own importer or `oxygen sequences create --from-table`.")
16136
16131
  .requiredOption("--provider <provider>", "External sequencer: smartlead, instantly, lemlist, or heyreach.")
16137
16132
  .requiredOption("--campaign <name-or-id>", "The campaign that already exists in that tool. A name is resolved against your connected account (exact id, then exact name, then a unique partial match).")
16138
16133
  .requiredOption("--from-table <table>", "Table id or slug whose rows are pushed.")
@@ -1 +1 @@
1
- export declare const OXYGEN_BUILD_VERSION = "1.1011.446";
1
+ export declare const OXYGEN_BUILD_VERSION = "1.1011.469";
@@ -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.1011.446";
2
+ export const OXYGEN_BUILD_VERSION = "1.1011.469";
@@ -2181,10 +2181,9 @@ export function readWorkflowRunPreApprovedLabels(metadata) {
2181
2181
  .filter((entry) => entry.length > 0);
2182
2182
  return Array.from(new Set(labels));
2183
2183
  }
2184
- // Managed tool runs attach `meta.billing` with the credits the run charged
2185
- // (`managed_credit_estimate` is reserved and captured in full). BYOK and
2186
- // user-connection runs consume no OXYGEN credits, so they never count
2187
- // against the cap.
2184
+ // Completed tool runs attach their captured OXYGEN charge in `meta.billing`.
2185
+ // Managed provider credits and own-key platform fees both count toward an
2186
+ // approved workflow ceiling; user OAuth calls carry neither charge.
2188
2187
  export function readManagedToolRunCredits(output) {
2189
2188
  if (!isRecord(output))
2190
2189
  return 0;
@@ -2194,9 +2193,11 @@ export function readManagedToolRunCredits(output) {
2194
2193
  const billing = meta.billing;
2195
2194
  if (!isRecord(billing))
2196
2195
  return 0;
2197
- if (billing.credential_mode !== "managed")
2198
- return 0;
2199
- const credits = billing.managed_credit_estimate;
2196
+ const credits = billing.credential_mode === "managed"
2197
+ ? billing.managed_credit_estimate
2198
+ : billing.credential_mode === "byok"
2199
+ ? billing.byok_platform_fee_credits
2200
+ : null;
2200
2201
  if (typeof credits !== "number" || !Number.isFinite(credits) || credits <= 0)
2201
2202
  return 0;
2202
2203
  return credits;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.1011.446",
3
+ "version": "1.1011.469",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",