@oxygen-agent/cli 1.131.7 → 1.134.0

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.131.7
37
+ Version: 1.134.0
package/dist/index.js CHANGED
@@ -808,11 +808,31 @@ export function createProgram() {
808
808
  }));
809
809
  tablesCommand.addCommand(new Command("webhook")
810
810
  .description("Create and manage direct table webhooks.")
811
+ .addCommand(new Command("list")
812
+ .description("List direct table webhooks.")
813
+ .argument("[table]", "Optional table id or slug.")
814
+ .option("--status <status>", "Filter by active or disabled.")
815
+ .option("--limit <n>", "Maximum webhooks to return. Defaults to 100.")
816
+ .option("--json", "Print a JSON envelope.")
817
+ .action((table, options) => handleAsyncAction("tables webhook list", options, () => requestOxygen(tableWebhookListPath({
818
+ table: table ?? options.table,
819
+ status: options.status,
820
+ limit: options.limit,
821
+ })))))
822
+ .addCommand(new Command("get")
823
+ .description("Get one direct table webhook by endpoint id.")
824
+ .argument("<endpoint_id>", "Webhook endpoint id, such as tw_...")
825
+ .option("--json", "Print a JSON envelope.")
826
+ .action((endpointId, options) => handleAsyncAction("tables webhook get", options, () => {
827
+ const params = new URLSearchParams({ endpoint_id: endpointId });
828
+ return requestOxygen(`/api/cli/tables/webhooks?${params.toString()}`);
829
+ })))
811
830
  .addCommand(new Command("create")
812
831
  .description("Create a direct webhook endpoint that writes inbound JSON into a table.")
813
832
  .argument("<table>", "Table id or slug.")
814
833
  .option("--name <name>", "Display name for the webhook.")
815
834
  .option("--mode <mode>", "insert or upsert. Defaults to upsert when --upsert-key is set, otherwise insert.")
835
+ .option("--auth-mode <mode>", "secret or none. Defaults to secret; use none only for public provider webhooks that cannot send auth headers.")
816
836
  .option("--upsert-key <key>", "Column key used to upsert rows. Required for upsert mode.")
817
837
  .option("--items-path <path>", "Dot path to an array of row objects in the webhook payload.")
818
838
  .option("--event-id-path <path>", "Dot path to the event id. Defaults to event_id, eventId, id, or payload hash.")
@@ -825,14 +845,15 @@ export function createProgram() {
825
845
  .option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
826
846
  .option("--auto-run-approved", "Approve this webhook to queue the configured auto-run columns for rows it writes.")
827
847
  .option("--json", "Print a JSON envelope.")
828
- .action(async (table, options) => {
848
+ .action((table, options) => {
829
849
  const autoRun = readTableWebhookAutoRunOptions(options);
830
- await handleAsyncAction("tables webhook create", options, async () => requestOxygen("/api/cli/tables/webhooks", {
850
+ return handleAsyncAction("tables webhook create", options, () => requestOxygen("/api/cli/tables/webhooks", {
831
851
  method: "POST",
832
852
  body: {
833
853
  table,
834
854
  ...(readOption(options.name) ? { name: readOption(options.name) } : {}),
835
855
  ...(readOption(options.mode) ? { mode: readOption(options.mode) } : {}),
856
+ ...(readOption(options.authMode) ? { auth_mode: readOption(options.authMode) } : {}),
836
857
  ...(readOption(options.upsertKey) ? { upsert_key: readOption(options.upsertKey) } : {}),
837
858
  ...(readOption(options.itemsPath) ? { items_path: readOption(options.itemsPath) } : {}),
838
859
  ...(readOption(options.eventIdPath) ? { event_id_path: readOption(options.eventIdPath) } : {}),
@@ -845,23 +866,51 @@ export function createProgram() {
845
866
  .addCommand(new Command("update")
846
867
  .description("Update a direct table webhook endpoint.")
847
868
  .argument("<endpoint_id>", "Webhook endpoint id, such as tw_...")
869
+ .option("--name <name>", "Update the webhook display name.")
870
+ .option("--status <status>", "active or disabled.")
871
+ .option("--auth-mode <mode>", "secret or none. Setting secret rotates and returns a new webhook secret.")
848
872
  .option("--auto-run-columns <csv>", "Comma-separated enrichment, tool, AI, or formula columns to queue for webhook-written rows.")
849
873
  .option("--auto-run-max-credits <n>", "Approved credit safety ceiling for webhook-triggered paid auto-runs.")
850
874
  .option("--auto-run-max-concurrency <n>", "Maximum concurrent row items for webhook-triggered auto-runs.")
851
875
  .option("--auto-run-force", "Run auto-run columns even when the target cell already has a value.")
852
876
  .option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
853
877
  .option("--auto-run-approved", "Approve this webhook to queue the configured auto-run columns for rows it writes.")
878
+ .option("--clear-auto-run", "Remove the webhook auto-run configuration.")
854
879
  .option("--json", "Print a JSON envelope.")
855
- .action(async (endpointId, options) => {
880
+ .action((endpointId, options) => {
856
881
  const autoRun = readTableWebhookAutoRunOptions(options);
857
- await handleAsyncAction("tables webhook update", options, async () => requestOxygen("/api/cli/tables/webhooks", {
882
+ if (autoRun && options.clearAutoRun) {
883
+ throw new OxygenError("invalid_table_webhook", "Pass either auto-run options or --clear-auto-run, not both.", {
884
+ exitCode: 1,
885
+ });
886
+ }
887
+ return handleAsyncAction("tables webhook update", options, () => requestOxygen("/api/cli/tables/webhooks", {
858
888
  method: "PATCH",
859
889
  body: {
860
890
  endpoint_id: endpointId,
891
+ ...(readOption(options.name) ? { name: readOption(options.name) } : {}),
892
+ ...(readOption(options.status) ? { status: readOption(options.status) } : {}),
893
+ ...(readOption(options.authMode) ? { auth_mode: readOption(options.authMode) } : {}),
861
894
  ...(autoRun ? { auto_run: autoRun } : {}),
895
+ ...(options.clearAutoRun ? { clear_auto_run: true } : {}),
862
896
  },
863
897
  }));
864
- })));
898
+ }))
899
+ .addCommand(new Command("deliveries")
900
+ .description("List direct table webhook deliveries and auto-run enqueue status.")
901
+ .argument("[endpoint_id]", "Optional webhook endpoint id, such as tw_...")
902
+ .option("--table <table>", "Filter by table id or slug.")
903
+ .option("--status <status>", "Filter by received, completed, or failed.")
904
+ .option("--auto-run-status <status>", "Filter by not_configured, queued, skipped, or failed_to_enqueue.")
905
+ .option("--limit <n>", "Maximum deliveries to return. Defaults to 50.")
906
+ .option("--json", "Print a JSON envelope.")
907
+ .action((endpointId, options) => handleAsyncAction("tables webhook deliveries", options, () => requestOxygen(tableWebhookDeliveriesPath({
908
+ endpointId,
909
+ table: options.table,
910
+ status: options.status,
911
+ autoRunStatus: options.autoRunStatus,
912
+ limit: options.limit,
913
+ }))))));
865
914
  program
866
915
  .command("context")
867
916
  .description("Workspace-level GTM context commands.")
@@ -2099,7 +2148,7 @@ export function createProgram() {
2099
2148
  .option("--route-id <id>", "Route id from the plan to execute.")
2100
2149
  .option("--tool-id <tool>", "Tool id from the plan to execute.")
2101
2150
  .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.")
2151
+ .option("--upsert-key <column>", "Column key used for live upsert. Must match the plan upsert key, usually domain.")
2103
2152
  .option("--mode <mode>", "dry_run or live. Defaults to dry_run.")
2104
2153
  .option("--max-pages <n>", "Maximum provider pages to ingest. Defaults to the route estimate.")
2105
2154
  .option("--max-credits <n>", "Required credit ceiling for live runs.")
@@ -3628,6 +3677,40 @@ function normalizeWorkflowRunErrors(value) {
3628
3677
  function isTerminalWorkflowRunStatus(status) {
3629
3678
  return status === "completed" || status === "failed" || status === "canceled";
3630
3679
  }
3680
+ function tableWebhookListPath(options) {
3681
+ const params = new URLSearchParams();
3682
+ const table = readOption(options.table);
3683
+ const status = readOption(options.status);
3684
+ const limit = readPositiveInt(options.limit);
3685
+ if (table)
3686
+ params.set("table", table);
3687
+ if (status)
3688
+ params.set("status", status);
3689
+ if (limit)
3690
+ params.set("limit", String(limit));
3691
+ const query = params.toString();
3692
+ return `/api/cli/tables/webhooks${query ? `?${query}` : ""}`;
3693
+ }
3694
+ function tableWebhookDeliveriesPath(options) {
3695
+ const params = new URLSearchParams();
3696
+ const endpointId = readOption(options.endpointId);
3697
+ const table = readOption(options.table);
3698
+ const status = readOption(options.status);
3699
+ const autoRunStatus = readOption(options.autoRunStatus);
3700
+ const limit = readPositiveInt(options.limit);
3701
+ if (endpointId)
3702
+ params.set("endpoint_id", endpointId);
3703
+ if (table)
3704
+ params.set("table", table);
3705
+ if (status)
3706
+ params.set("status", status);
3707
+ if (autoRunStatus)
3708
+ params.set("auto_run_status", autoRunStatus);
3709
+ if (limit)
3710
+ params.set("limit", String(limit));
3711
+ const query = params.toString();
3712
+ return `/api/cli/tables/webhooks/deliveries${query ? `?${query}` : ""}`;
3713
+ }
3631
3714
  function readTableWebhookAutoRunOptions(options) {
3632
3715
  const columns = readCsvOption(options.autoRunColumns);
3633
3716
  const requested = columns.length > 0
@@ -24,9 +24,12 @@ export function log(level, msg, fields) {
24
24
  ...fields,
25
25
  }),
26
26
  });
27
- if (level === "error" || level === "warn") {
27
+ if (level === "error") {
28
28
  console.error(line);
29
29
  }
30
+ else if (level === "warn") {
31
+ console.warn(line);
32
+ }
30
33
  else {
31
34
  console.log(line);
32
35
  }
@@ -1,2 +1,2 @@
1
- export declare const OXYGEN_VERSION = "1.131.7";
1
+ export declare const OXYGEN_VERSION = "1.134.0";
2
2
  export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.0.0";
@@ -1,3 +1,3 @@
1
- export const OXYGEN_VERSION = "1.131.7";
1
+ export const OXYGEN_VERSION = "1.134.0";
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.131.7",
3
+ "version": "1.134.0",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",