@oxygen-agent/cli 1.128.3 → 1.131.7

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 and support, visit https://oxygen-agent.com.
36
36
 
37
- Version: 1.128.3
37
+ Version: 1.131.7
@@ -1,6 +1,6 @@
1
1
  import { type StoredCredentials } from "./credentials.js";
2
2
  type RequestOptions = {
3
- method?: "GET" | "POST" | "DELETE";
3
+ method?: "GET" | "POST" | "PATCH" | "DELETE";
4
4
  body?: Record<string, unknown>;
5
5
  formData?: FormData;
6
6
  credentials?: StoredCredentials;
package/dist/index.js CHANGED
@@ -818,8 +818,15 @@ export function createProgram() {
818
818
  .option("--event-id-path <path>", "Dot path to the event id. Defaults to event_id, eventId, id, or payload hash.")
819
819
  .option("--event-type-path <path>", "Dot path to the event type. Defaults to type or event.")
820
820
  .option("--occurred-at-path <path>", "Dot path to the event timestamp.")
821
+ .option("--auto-run-columns <csv>", "Comma-separated enrichment, tool, AI, or formula columns to queue for webhook-written rows.")
822
+ .option("--auto-run-max-credits <n>", "Approved credit safety ceiling for webhook-triggered paid auto-runs.")
823
+ .option("--auto-run-max-concurrency <n>", "Maximum concurrent row items for webhook-triggered auto-runs.")
824
+ .option("--auto-run-force", "Run auto-run columns even when the target cell already has a value.")
825
+ .option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
826
+ .option("--auto-run-approved", "Approve this webhook to queue the configured auto-run columns for rows it writes.")
821
827
  .option("--json", "Print a JSON envelope.")
822
828
  .action(async (table, options) => {
829
+ const autoRun = readTableWebhookAutoRunOptions(options);
823
830
  await handleAsyncAction("tables webhook create", options, async () => requestOxygen("/api/cli/tables/webhooks", {
824
831
  method: "POST",
825
832
  body: {
@@ -831,6 +838,27 @@ export function createProgram() {
831
838
  ...(readOption(options.eventIdPath) ? { event_id_path: readOption(options.eventIdPath) } : {}),
832
839
  ...(readOption(options.eventTypePath) ? { event_type_path: readOption(options.eventTypePath) } : {}),
833
840
  ...(readOption(options.occurredAtPath) ? { occurred_at_path: readOption(options.occurredAtPath) } : {}),
841
+ ...(autoRun ? { auto_run: autoRun } : {}),
842
+ },
843
+ }));
844
+ }))
845
+ .addCommand(new Command("update")
846
+ .description("Update a direct table webhook endpoint.")
847
+ .argument("<endpoint_id>", "Webhook endpoint id, such as tw_...")
848
+ .option("--auto-run-columns <csv>", "Comma-separated enrichment, tool, AI, or formula columns to queue for webhook-written rows.")
849
+ .option("--auto-run-max-credits <n>", "Approved credit safety ceiling for webhook-triggered paid auto-runs.")
850
+ .option("--auto-run-max-concurrency <n>", "Maximum concurrent row items for webhook-triggered auto-runs.")
851
+ .option("--auto-run-force", "Run auto-run columns even when the target cell already has a value.")
852
+ .option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
853
+ .option("--auto-run-approved", "Approve this webhook to queue the configured auto-run columns for rows it writes.")
854
+ .option("--json", "Print a JSON envelope.")
855
+ .action(async (endpointId, options) => {
856
+ const autoRun = readTableWebhookAutoRunOptions(options);
857
+ await handleAsyncAction("tables webhook update", options, async () => requestOxygen("/api/cli/tables/webhooks", {
858
+ method: "PATCH",
859
+ body: {
860
+ endpoint_id: endpointId,
861
+ ...(autoRun ? { auto_run: autoRun } : {}),
834
862
  },
835
863
  }));
836
864
  })));
@@ -2071,12 +2099,12 @@ export function createProgram() {
2071
2099
  .option("--route-id <id>", "Route id from the plan to execute.")
2072
2100
  .option("--tool-id <tool>", "Tool id from the plan to execute.")
2073
2101
  .option("--table <table>", "Existing table id or slug to receive rows. If omitted for live, Oxygen creates a table.")
2102
+ .option("--upsert-key <column>", "Column key used for live upsert. Defaults to the plan upsert key, usually domain.")
2074
2103
  .option("--mode <mode>", "dry_run or live. Defaults to dry_run.")
2075
2104
  .option("--max-pages <n>", "Maximum provider pages to ingest. Defaults to the route estimate.")
2076
2105
  .option("--max-credits <n>", "Required credit ceiling for live runs.")
2077
2106
  .option("--target-count <n>", "Desired company count when planning from --prompt.")
2078
2107
  .option("--source-intent <intent>", "Override detected intent when planning from --prompt.")
2079
- .option("--preflight-complete", "Confirm required descriptor, count, enum, or provider-specific preflight checks before live mode.")
2080
2108
  .option("--approved", "Required for live runs after inspecting dry-run output.")
2081
2109
  .option("--json", "Print a JSON envelope.")
2082
2110
  .action(async (options) => {
@@ -2264,7 +2292,7 @@ export function createProgram() {
2264
2292
  .description("Inspect and retry durable signup lead webhook deliveries.")
2265
2293
  .addCommand(new Command("list")
2266
2294
  .description("List signup lead webhook deliveries for the current organization.")
2267
- .option("--status <status>", "Filter by pending, running, succeeded, retrying, failed, or dead.")
2295
+ .option("--status <status>", "Filter by pending, running, succeeded, skipped, retrying, failed, or dead.")
2268
2296
  .option("--limit <n>", "Maximum deliveries to return. Defaults to 50.")
2269
2297
  .option("--json", "Print a JSON envelope.")
2270
2298
  .action(async (options) => {
@@ -3600,6 +3628,32 @@ function normalizeWorkflowRunErrors(value) {
3600
3628
  function isTerminalWorkflowRunStatus(status) {
3601
3629
  return status === "completed" || status === "failed" || status === "canceled";
3602
3630
  }
3631
+ function readTableWebhookAutoRunOptions(options) {
3632
+ const columns = readCsvOption(options.autoRunColumns);
3633
+ const requested = columns.length > 0
3634
+ || options.autoRunMaxCredits !== undefined
3635
+ || options.autoRunMaxConcurrency !== undefined
3636
+ || Boolean(options.autoRunForce)
3637
+ || options.autoRunConnectionId !== undefined
3638
+ || Boolean(options.autoRunApproved);
3639
+ if (!requested)
3640
+ return null;
3641
+ if (columns.length === 0) {
3642
+ throw new OxygenError("invalid_table_webhook", "Pass --auto-run-columns when configuring webhook auto-runs.", {
3643
+ exitCode: 1,
3644
+ });
3645
+ }
3646
+ const maxCredits = readPositiveNumber(options.autoRunMaxCredits);
3647
+ const maxConcurrency = readPositiveInt(options.autoRunMaxConcurrency);
3648
+ return {
3649
+ columns,
3650
+ approved: Boolean(options.autoRunApproved),
3651
+ ...(maxCredits !== undefined ? { max_credits: maxCredits } : {}),
3652
+ ...(maxConcurrency ? { max_concurrency: maxConcurrency } : {}),
3653
+ ...(options.autoRunForce ? { force: true } : {}),
3654
+ ...(readOption(options.autoRunConnectionId) ? { connection_id: readOption(options.autoRunConnectionId) } : {}),
3655
+ };
3656
+ }
3603
3657
  function readTableRunActions(options) {
3604
3658
  if (options.actionsJson && readOption(options.column)) {
3605
3659
  throw new OxygenError("invalid_table_run", "Pass either --actions-json or --column, not both.", {
@@ -3728,13 +3782,13 @@ function readCompaniesSearchRunBody(options) {
3728
3782
  ...(options.routeId ? { route_id: options.routeId } : {}),
3729
3783
  ...(options.toolId ? { tool_id: options.toolId } : {}),
3730
3784
  ...(options.table ? { table: options.table } : {}),
3785
+ ...(options.upsertKey ? { upsert_key: options.upsertKey } : {}),
3731
3786
  ...(options.mode ? { mode: options.mode } : {}),
3732
3787
  ...(maxPages !== undefined ? { max_pages: maxPages } : {}),
3733
3788
  ...(maxCredits !== undefined ? { max_credits: maxCredits } : {}),
3734
3789
  ...(targetCount !== undefined ? { target_count: targetCount } : {}),
3735
3790
  ...(options.sourceIntent ? { source_intent: options.sourceIntent } : {}),
3736
3791
  ...(options.approved ? { approved: true } : {}),
3737
- ...(options.preflightComplete ? { preflight_complete: true } : {}),
3738
3792
  };
3739
3793
  }
3740
3794
  function readCompanySearchPlanJson(value) {
@@ -14,7 +14,7 @@ export function log(level, msg, fields) {
14
14
  ts: new Date().toISOString(),
15
15
  level,
16
16
  msg,
17
- service_name: process.env.OTEL_SERVICE_NAME ?? process.env.OXYGEN_SERVICE_NAME ?? null,
17
+ service_name: process.env.OXYGEN_SERVICE_NAME ?? process.env.OTEL_SERVICE_NAME ?? null,
18
18
  oxygen_version: OXYGEN_VERSION,
19
19
  sha: process.env.VERCEL_GIT_COMMIT_SHA ?? null,
20
20
  region: process.env.VERCEL_REGION ?? null,
@@ -55,14 +55,27 @@ export function recordTelemetryHistogram(name, value, attributes) {
55
55
  histogram.record(value, normalizeTelemetryAttributes(commonTelemetryAttributes(attributes)));
56
56
  }
57
57
  export function commonTelemetryAttributes(attributes) {
58
+ const workerProcess = isWorkerProcess();
58
59
  return {
59
60
  "oxygen.version": OXYGEN_VERSION,
60
- "deployment.environment": process.env.VERCEL_ENV ?? process.env.NODE_ENV ?? null,
61
- "deployment.sha": process.env.VERCEL_GIT_COMMIT_SHA ?? process.env.FLY_IMAGE_REF ?? null,
62
- "cloud.region": process.env.VERCEL_REGION ?? process.env.FLY_REGION ?? null,
61
+ "deployment.environment": workerProcess
62
+ ? process.env.FLY_ENVIRONMENT ?? process.env.NODE_ENV ?? null
63
+ : process.env.VERCEL_ENV ?? process.env.NODE_ENV ?? null,
64
+ "deployment.sha": workerProcess
65
+ ? process.env.FLY_IMAGE_REF ?? process.env.VERCEL_GIT_COMMIT_SHA ?? null
66
+ : process.env.VERCEL_GIT_COMMIT_SHA ?? process.env.FLY_IMAGE_REF ?? null,
67
+ "cloud.region": workerProcess
68
+ ? process.env.FLY_REGION ?? process.env.VERCEL_REGION ?? null
69
+ : process.env.VERCEL_REGION ?? process.env.FLY_REGION ?? null,
63
70
  ...attributes,
64
71
  };
65
72
  }
73
+ function isWorkerProcess() {
74
+ if (process.env.OXYGEN_PROCESS_ROLE === "worker")
75
+ return true;
76
+ const flyApp = process.env.FLY_APP_NAME ?? process.env.FLY_APP ?? "";
77
+ return flyApp.includes("oxygen-table-worker");
78
+ }
66
79
  function getMeter() {
67
80
  return metrics.getMeter("oxygen", OXYGEN_VERSION);
68
81
  }
@@ -1,2 +1,2 @@
1
- export declare const OXYGEN_VERSION = "1.128.3";
1
+ export declare const OXYGEN_VERSION = "1.131.7";
2
2
  export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.0.0";
@@ -1,3 +1,3 @@
1
- export const OXYGEN_VERSION = "1.128.3";
1
+ export const OXYGEN_VERSION = "1.131.7";
2
2
  // Bump this only when deployed CLI/API contracts require a newer CLI.
3
3
  export const OXYGEN_MINIMUM_CLI_VERSION = "1.0.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxygen-agent/cli",
3
- "version": "1.128.3",
3
+ "version": "1.131.7",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",