@oxygen-agent/cli 1.131.7 → 1.138.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
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { basename, dirname, extname, resolve } from "node:path";
|
|
|
8
8
|
import { createInterface } from "node:readline/promises";
|
|
9
9
|
import { stdin as input, stdout as output } from "node:process";
|
|
10
10
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
11
|
-
import { Command } from "commander";
|
|
11
|
+
import { Command, Option } from "commander";
|
|
12
12
|
import { formatCellForDisplay, OXYGEN_VERSION, OxygenError, success, toFailure } from "@oxygen/shared";
|
|
13
13
|
import { inferRowsFileFormat, normalizeRowsForNewTable, normalizeRowsFormat, parseRowsFileBuffer, } from "@oxygen/shared/file-import";
|
|
14
14
|
import { assertRecipeBundleSafe, assertWorkflowManifest, buildRecipeManifest, compileWorkflowDefinition, isAnyWorkflowManifest, isRecipeManifest, isWorkflowDefinition, isWorkflowManifest, } from "@oxygen/workflows";
|
|
@@ -725,11 +725,12 @@ export function createProgram() {
|
|
|
725
725
|
.argument("<table>", "Table id or slug.")
|
|
726
726
|
.option("--limit <n>", "Maximum preview rows to return. Defaults to 25; hard cap is 1000.")
|
|
727
727
|
.option("--fields <columns>", "Comma-separated column keys or ids to include.")
|
|
728
|
+
.option("--include-system-fields", "Include _row_id, _created_at, and _updated_at in preview rows.")
|
|
728
729
|
.option("--include-cell-states", "Include per-cell run state in the preview response.")
|
|
729
730
|
.option("--summary-only", "Return table metadata and stats without row JSON.")
|
|
730
731
|
.option("--json", "Print a JSON envelope.")
|
|
731
732
|
.action(async (table, options) => {
|
|
732
|
-
await handleAsyncAction("tables preview", options,
|
|
733
|
+
await handleAsyncAction("tables preview", options, () => {
|
|
733
734
|
const limit = readPositiveInt(options.limit);
|
|
734
735
|
return requestOxygen("/api/cli/tables/preview", {
|
|
735
736
|
method: "POST",
|
|
@@ -737,6 +738,7 @@ export function createProgram() {
|
|
|
737
738
|
table,
|
|
738
739
|
...(limit ? { limit } : {}),
|
|
739
740
|
...(readOption(options.fields) ? { fields: readCsvOption(options.fields) } : {}),
|
|
741
|
+
...(options.includeSystemFields ? { include_system_fields: true } : {}),
|
|
740
742
|
...(options.includeCellStates ? { include_cell_states: true } : {}),
|
|
741
743
|
...(options.summaryOnly ? { summary_only: true } : {}),
|
|
742
744
|
},
|
|
@@ -808,31 +810,52 @@ export function createProgram() {
|
|
|
808
810
|
}));
|
|
809
811
|
tablesCommand.addCommand(new Command("webhook")
|
|
810
812
|
.description("Create and manage direct table webhooks.")
|
|
813
|
+
.addCommand(new Command("list")
|
|
814
|
+
.description("List direct table webhooks.")
|
|
815
|
+
.argument("[table]", "Optional table id or slug.")
|
|
816
|
+
.option("--status <status>", "Filter by active or disabled.")
|
|
817
|
+
.option("--limit <n>", "Maximum webhooks to return. Defaults to 100.")
|
|
818
|
+
.option("--json", "Print a JSON envelope.")
|
|
819
|
+
.action((table, options) => handleAsyncAction("tables webhook list", options, () => requestOxygen(tableWebhookListPath({
|
|
820
|
+
table: table ?? options.table,
|
|
821
|
+
status: options.status,
|
|
822
|
+
limit: options.limit,
|
|
823
|
+
})))))
|
|
824
|
+
.addCommand(new Command("get")
|
|
825
|
+
.description("Get one direct table webhook by endpoint id.")
|
|
826
|
+
.argument("<endpoint_id>", "Webhook endpoint id, such as tw_...")
|
|
827
|
+
.option("--json", "Print a JSON envelope.")
|
|
828
|
+
.action((endpointId, options) => handleAsyncAction("tables webhook get", options, () => {
|
|
829
|
+
const params = new URLSearchParams({ endpoint_id: endpointId });
|
|
830
|
+
return requestOxygen(`/api/cli/tables/webhooks?${params.toString()}`);
|
|
831
|
+
})))
|
|
811
832
|
.addCommand(new Command("create")
|
|
812
833
|
.description("Create a direct webhook endpoint that writes inbound JSON into a table.")
|
|
813
834
|
.argument("<table>", "Table id or slug.")
|
|
814
835
|
.option("--name <name>", "Display name for the webhook.")
|
|
815
836
|
.option("--mode <mode>", "insert or upsert. Defaults to upsert when --upsert-key is set, otherwise insert.")
|
|
837
|
+
.option("--auth-mode <mode>", "none or secret. Defaults to none; use secret when the sender can include an Oxygen webhook secret.")
|
|
816
838
|
.option("--upsert-key <key>", "Column key used to upsert rows. Required for upsert mode.")
|
|
817
839
|
.option("--items-path <path>", "Dot path to an array of row objects in the webhook payload.")
|
|
818
840
|
.option("--event-id-path <path>", "Dot path to the event id. Defaults to event_id, eventId, id, or payload hash.")
|
|
819
841
|
.option("--event-type-path <path>", "Dot path to the event type. Defaults to type or event.")
|
|
820
842
|
.option("--occurred-at-path <path>", "Dot path to the event timestamp.")
|
|
821
843
|
.option("--auto-run-columns <csv>", "Comma-separated enrichment, tool, AI, or formula columns to queue for webhook-written rows.")
|
|
822
|
-
.
|
|
844
|
+
.addOption(new Option("--auto-run-max-credits <n>", "Deprecated optional safety ceiling for webhook-triggered auto-runs.").hideHelp())
|
|
823
845
|
.option("--auto-run-max-concurrency <n>", "Maximum concurrent row items for webhook-triggered auto-runs.")
|
|
824
846
|
.option("--auto-run-force", "Run auto-run columns even when the target cell already has a value.")
|
|
825
847
|
.option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
|
|
826
|
-
.
|
|
848
|
+
.addOption(new Option("--auto-run-approved", "Deprecated no-op. Auto-run is enabled by --auto-run-columns.").hideHelp())
|
|
827
849
|
.option("--json", "Print a JSON envelope.")
|
|
828
|
-
.action(
|
|
850
|
+
.action((table, options) => {
|
|
829
851
|
const autoRun = readTableWebhookAutoRunOptions(options);
|
|
830
|
-
|
|
852
|
+
return handleAsyncAction("tables webhook create", options, () => requestOxygen("/api/cli/tables/webhooks", {
|
|
831
853
|
method: "POST",
|
|
832
854
|
body: {
|
|
833
855
|
table,
|
|
834
856
|
...(readOption(options.name) ? { name: readOption(options.name) } : {}),
|
|
835
857
|
...(readOption(options.mode) ? { mode: readOption(options.mode) } : {}),
|
|
858
|
+
...(readOption(options.authMode) ? { auth_mode: readOption(options.authMode) } : {}),
|
|
836
859
|
...(readOption(options.upsertKey) ? { upsert_key: readOption(options.upsertKey) } : {}),
|
|
837
860
|
...(readOption(options.itemsPath) ? { items_path: readOption(options.itemsPath) } : {}),
|
|
838
861
|
...(readOption(options.eventIdPath) ? { event_id_path: readOption(options.eventIdPath) } : {}),
|
|
@@ -845,23 +868,51 @@ export function createProgram() {
|
|
|
845
868
|
.addCommand(new Command("update")
|
|
846
869
|
.description("Update a direct table webhook endpoint.")
|
|
847
870
|
.argument("<endpoint_id>", "Webhook endpoint id, such as tw_...")
|
|
871
|
+
.option("--name <name>", "Update the webhook display name.")
|
|
872
|
+
.option("--status <status>", "active or disabled.")
|
|
873
|
+
.option("--auth-mode <mode>", "none or secret. Setting secret rotates and returns a new webhook secret.")
|
|
848
874
|
.option("--auto-run-columns <csv>", "Comma-separated enrichment, tool, AI, or formula columns to queue for webhook-written rows.")
|
|
849
|
-
.
|
|
875
|
+
.addOption(new Option("--auto-run-max-credits <n>", "Deprecated optional safety ceiling for webhook-triggered auto-runs.").hideHelp())
|
|
850
876
|
.option("--auto-run-max-concurrency <n>", "Maximum concurrent row items for webhook-triggered auto-runs.")
|
|
851
877
|
.option("--auto-run-force", "Run auto-run columns even when the target cell already has a value.")
|
|
852
878
|
.option("--auto-run-connection-id <connection_id>", "Optional provider integration connection id for auto-runs.")
|
|
853
|
-
.
|
|
879
|
+
.addOption(new Option("--auto-run-approved", "Deprecated no-op. Auto-run is enabled by --auto-run-columns.").hideHelp())
|
|
880
|
+
.option("--clear-auto-run", "Remove the webhook auto-run configuration.")
|
|
854
881
|
.option("--json", "Print a JSON envelope.")
|
|
855
|
-
.action(
|
|
882
|
+
.action((endpointId, options) => {
|
|
856
883
|
const autoRun = readTableWebhookAutoRunOptions(options);
|
|
857
|
-
|
|
884
|
+
if (autoRun && options.clearAutoRun) {
|
|
885
|
+
throw new OxygenError("invalid_table_webhook", "Pass either auto-run options or --clear-auto-run, not both.", {
|
|
886
|
+
exitCode: 1,
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
return handleAsyncAction("tables webhook update", options, () => requestOxygen("/api/cli/tables/webhooks", {
|
|
858
890
|
method: "PATCH",
|
|
859
891
|
body: {
|
|
860
892
|
endpoint_id: endpointId,
|
|
893
|
+
...(readOption(options.name) ? { name: readOption(options.name) } : {}),
|
|
894
|
+
...(readOption(options.status) ? { status: readOption(options.status) } : {}),
|
|
895
|
+
...(readOption(options.authMode) ? { auth_mode: readOption(options.authMode) } : {}),
|
|
861
896
|
...(autoRun ? { auto_run: autoRun } : {}),
|
|
897
|
+
...(options.clearAutoRun ? { clear_auto_run: true } : {}),
|
|
862
898
|
},
|
|
863
899
|
}));
|
|
864
|
-
}))
|
|
900
|
+
}))
|
|
901
|
+
.addCommand(new Command("deliveries")
|
|
902
|
+
.description("List direct table webhook deliveries and auto-run enqueue status.")
|
|
903
|
+
.argument("[endpoint_id]", "Optional webhook endpoint id, such as tw_...")
|
|
904
|
+
.option("--table <table>", "Filter by table id or slug.")
|
|
905
|
+
.option("--status <status>", "Filter by received, completed, or failed.")
|
|
906
|
+
.option("--auto-run-status <status>", "Filter by not_configured, queued, skipped, or failed_to_enqueue.")
|
|
907
|
+
.option("--limit <n>", "Maximum deliveries to return. Defaults to 50.")
|
|
908
|
+
.option("--json", "Print a JSON envelope.")
|
|
909
|
+
.action((endpointId, options) => handleAsyncAction("tables webhook deliveries", options, () => requestOxygen(tableWebhookDeliveriesPath({
|
|
910
|
+
endpointId,
|
|
911
|
+
table: options.table,
|
|
912
|
+
status: options.status,
|
|
913
|
+
autoRunStatus: options.autoRunStatus,
|
|
914
|
+
limit: options.limit,
|
|
915
|
+
}))))));
|
|
865
916
|
program
|
|
866
917
|
.command("context")
|
|
867
918
|
.description("Workspace-level GTM context commands.")
|
|
@@ -2099,7 +2150,7 @@ export function createProgram() {
|
|
|
2099
2150
|
.option("--route-id <id>", "Route id from the plan to execute.")
|
|
2100
2151
|
.option("--tool-id <tool>", "Tool id from the plan to execute.")
|
|
2101
2152
|
.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.
|
|
2153
|
+
.option("--upsert-key <column>", "Column key used for live upsert. Must match the plan upsert key, usually domain.")
|
|
2103
2154
|
.option("--mode <mode>", "dry_run or live. Defaults to dry_run.")
|
|
2104
2155
|
.option("--max-pages <n>", "Maximum provider pages to ingest. Defaults to the route estimate.")
|
|
2105
2156
|
.option("--max-credits <n>", "Required credit ceiling for live runs.")
|
|
@@ -3628,6 +3679,40 @@ function normalizeWorkflowRunErrors(value) {
|
|
|
3628
3679
|
function isTerminalWorkflowRunStatus(status) {
|
|
3629
3680
|
return status === "completed" || status === "failed" || status === "canceled";
|
|
3630
3681
|
}
|
|
3682
|
+
function tableWebhookListPath(options) {
|
|
3683
|
+
const params = new URLSearchParams();
|
|
3684
|
+
const table = readOption(options.table);
|
|
3685
|
+
const status = readOption(options.status);
|
|
3686
|
+
const limit = readPositiveInt(options.limit);
|
|
3687
|
+
if (table)
|
|
3688
|
+
params.set("table", table);
|
|
3689
|
+
if (status)
|
|
3690
|
+
params.set("status", status);
|
|
3691
|
+
if (limit)
|
|
3692
|
+
params.set("limit", String(limit));
|
|
3693
|
+
const query = params.toString();
|
|
3694
|
+
return `/api/cli/tables/webhooks${query ? `?${query}` : ""}`;
|
|
3695
|
+
}
|
|
3696
|
+
function tableWebhookDeliveriesPath(options) {
|
|
3697
|
+
const params = new URLSearchParams();
|
|
3698
|
+
const endpointId = readOption(options.endpointId);
|
|
3699
|
+
const table = readOption(options.table);
|
|
3700
|
+
const status = readOption(options.status);
|
|
3701
|
+
const autoRunStatus = readOption(options.autoRunStatus);
|
|
3702
|
+
const limit = readPositiveInt(options.limit);
|
|
3703
|
+
if (endpointId)
|
|
3704
|
+
params.set("endpoint_id", endpointId);
|
|
3705
|
+
if (table)
|
|
3706
|
+
params.set("table", table);
|
|
3707
|
+
if (status)
|
|
3708
|
+
params.set("status", status);
|
|
3709
|
+
if (autoRunStatus)
|
|
3710
|
+
params.set("auto_run_status", autoRunStatus);
|
|
3711
|
+
if (limit)
|
|
3712
|
+
params.set("limit", String(limit));
|
|
3713
|
+
const query = params.toString();
|
|
3714
|
+
return `/api/cli/tables/webhooks/deliveries${query ? `?${query}` : ""}`;
|
|
3715
|
+
}
|
|
3631
3716
|
function readTableWebhookAutoRunOptions(options) {
|
|
3632
3717
|
const columns = readCsvOption(options.autoRunColumns);
|
|
3633
3718
|
const requested = columns.length > 0
|
|
@@ -3647,7 +3732,6 @@ function readTableWebhookAutoRunOptions(options) {
|
|
|
3647
3732
|
const maxConcurrency = readPositiveInt(options.autoRunMaxConcurrency);
|
|
3648
3733
|
return {
|
|
3649
3734
|
columns,
|
|
3650
|
-
approved: Boolean(options.autoRunApproved),
|
|
3651
3735
|
...(maxCredits !== undefined ? { max_credits: maxCredits } : {}),
|
|
3652
3736
|
...(maxConcurrency ? { max_concurrency: maxConcurrency } : {}),
|
|
3653
3737
|
...(options.autoRunForce ? { force: true } : {}),
|
|
@@ -24,9 +24,12 @@ export function log(level, msg, fields) {
|
|
|
24
24
|
...fields,
|
|
25
25
|
}),
|
|
26
26
|
});
|
|
27
|
-
if (level === "error"
|
|
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.
|
|
2
|
-
export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.
|
|
1
|
+
export declare const OXYGEN_VERSION = "1.138.0";
|
|
2
|
+
export declare const OXYGEN_MINIMUM_CLI_VERSION = "1.135.0";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const OXYGEN_VERSION = "1.
|
|
1
|
+
export const OXYGEN_VERSION = "1.138.0";
|
|
2
2
|
// Bump this only when deployed CLI/API contracts require a newer CLI.
|
|
3
|
-
export const OXYGEN_MINIMUM_CLI_VERSION = "1.
|
|
3
|
+
export const OXYGEN_MINIMUM_CLI_VERSION = "1.135.0";
|