@oxygen-agent/cli 1.1023.41 → 1.1024.24
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 +1 -1
- package/dist/command-families/program.js +0 -4
- package/dist/command-manifest.js +0 -2
- package/dist/commands/budget.js +9 -4
- package/dist/commands/companies.js +1 -1
- package/dist/commands/publishing.js +16 -7
- package/dist/commands/sequences.js +9 -1
- package/dist/commands/workflows.js +1 -1
- package/node_modules/@oxygen/shared/dist/access/permissions.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/access/permissions.js +1 -1
- package/node_modules/@oxygen/shared/dist/billing/budget-scopes.d.ts +2 -2
- package/node_modules/@oxygen/shared/dist/billing/budget-scopes.js +2 -2
- package/node_modules/@oxygen/shared/dist/billing/plan-capabilities.js +1 -1
- package/node_modules/@oxygen/shared/dist/capability-intents/index.generated.d.ts +0 -40
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.d.ts +0 -20
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.js +0 -3
- package/node_modules/@oxygen/shared/dist/capability-intents/tables.rules.js +6 -41
- package/node_modules/@oxygen/shared/dist/capability-routes/tables.js +3 -3
- package/node_modules/@oxygen/shared/dist/contracts/browser-operations.js +1 -0
- package/node_modules/@oxygen/shared/dist/contracts/geo.js +2 -2
- package/node_modules/@oxygen/shared/dist/copilot/plan-hold.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/copilot/plan-hold.js +5 -2
- package/node_modules/@oxygen/shared/dist/geo/geo.d.ts +168 -2
- package/node_modules/@oxygen/shared/dist/geo/geo.js +357 -70
- package/node_modules/@oxygen/shared/dist/onboarding-leads.js +9 -3
- package/node_modules/@oxygen/shared/dist/schedule-label.js +29 -1
- package/node_modules/@oxygen/shared/dist/sequences/enrollment-origin.d.ts +3 -1
- package/node_modules/@oxygen/shared/dist/sequences/enrollment-origin.js +2 -0
- package/node_modules/@oxygen/shared/dist/version.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
- package/node_modules/@oxygen/shared/dist/version.js +1 -1
- package/package.json +1 -1
- package/dist/commands/callables.d.ts +0 -3
- package/dist/commands/callables.js +0 -111
- package/dist/functions-commands.d.ts +0 -6
- package/dist/functions-commands.js +0 -85
- package/node_modules/@oxygen/shared/dist/contracts/function-library-read.d.ts +0 -14
- package/node_modules/@oxygen/shared/dist/contracts/function-library-read.js +0 -16
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { parseJsonObject, readPositiveInt } from "../cli-values.js";
|
|
2
|
-
import { parseJsonArray, readPositiveNumber } from "../command-support.js";
|
|
3
|
-
import { requestOxygen } from "../http-client.js";
|
|
4
|
-
import { readOption } from "../util.js";
|
|
5
|
-
import { Command } from "commander";
|
|
6
|
-
export function registerCallablesFamily(program, handleAsyncAction) {
|
|
7
|
-
program
|
|
8
|
-
.command("callables")
|
|
9
|
-
.description("Publish and bind typed callable tables (reusable row-in/row-out table runs).")
|
|
10
|
-
.addCommand(new Command("publish")
|
|
11
|
-
.description("Publish an existing table as a versioned callable function.")
|
|
12
|
-
.argument("<table>", "Backing table id or slug.")
|
|
13
|
-
.requiredOption("--inputs-json <json>", "JSON array of inputs: [{column,key?,required?,description?}].")
|
|
14
|
-
.requiredOption("--actions-json <json>", "JSON array of executable backing-table column keys or ids.")
|
|
15
|
-
.requiredOption("--outputs-json <json>", "JSON array of outputs: [{column,key?,required?,description?}].")
|
|
16
|
-
.requiredOption("--max-credits-per-item <n>", "Default hard credit ceiling for one enrolled caller row.")
|
|
17
|
-
.option("--max-items <n>", "Default maximum source rows per invocation. Defaults to 100.")
|
|
18
|
-
.option("--slug <slug>", "Stable callable slug.")
|
|
19
|
-
.option("--name <name>", "Callable display name.")
|
|
20
|
-
.option("--description <text>", "What the callable does and when to use it.")
|
|
21
|
-
.option("--json", "Print a JSON envelope.")
|
|
22
|
-
.action(async (table, options) => {
|
|
23
|
-
await handleAsyncAction("callables publish", options, () => requestOxygen("/api/cli/callables", {
|
|
24
|
-
method: "POST",
|
|
25
|
-
body: {
|
|
26
|
-
table,
|
|
27
|
-
inputs: parseJsonArray(options.inputsJson),
|
|
28
|
-
action_columns: parseJsonArray(options.actionsJson),
|
|
29
|
-
outputs: parseJsonArray(options.outputsJson),
|
|
30
|
-
default_max_credits_per_item: readPositiveNumber(options.maxCreditsPerItem),
|
|
31
|
-
...(readPositiveInt(options.maxItems) !== undefined
|
|
32
|
-
? { default_max_items: readPositiveInt(options.maxItems) }
|
|
33
|
-
: {}),
|
|
34
|
-
...(readOption(options.slug) ? { slug: readOption(options.slug) } : {}),
|
|
35
|
-
...(readOption(options.name) ? { display_name: readOption(options.name) } : {}),
|
|
36
|
-
...(readOption(options.description) ? { description: readOption(options.description) } : {}),
|
|
37
|
-
},
|
|
38
|
-
}));
|
|
39
|
-
}))
|
|
40
|
-
.addCommand(new Command("list")
|
|
41
|
-
.description("List published callable tables and their current credit posture.")
|
|
42
|
-
.option("--include-disabled", "Include disabled definitions.")
|
|
43
|
-
.option("--limit <n>", "Maximum definitions to return.")
|
|
44
|
-
.option("--json", "Print a JSON envelope.")
|
|
45
|
-
.action(async (options) => {
|
|
46
|
-
await handleAsyncAction("callables list", options, () => {
|
|
47
|
-
const params = new URLSearchParams();
|
|
48
|
-
if (options.includeDisabled)
|
|
49
|
-
params.set("include_disabled", "true");
|
|
50
|
-
if (readPositiveInt(options.limit) !== undefined)
|
|
51
|
-
params.set("limit", String(readPositiveInt(options.limit)));
|
|
52
|
-
const suffix = params.toString();
|
|
53
|
-
return requestOxygen(`/api/cli/callables${suffix ? `?${suffix}` : ""}`);
|
|
54
|
-
});
|
|
55
|
-
}))
|
|
56
|
-
.addCommand(new Command("describe")
|
|
57
|
-
.description("Describe a callable's typed input/output contract and pinned backing columns.")
|
|
58
|
-
.argument("<callable>", "Callable id, slug, backing table id, or backing table slug.")
|
|
59
|
-
.option("--include-disabled", "Allow a disabled callable.")
|
|
60
|
-
.option("--json", "Print a JSON envelope.")
|
|
61
|
-
.action(async (callable, options) => {
|
|
62
|
-
await handleAsyncAction("callables describe", options, () => {
|
|
63
|
-
const params = new URLSearchParams({ callable });
|
|
64
|
-
if (options.includeDisabled)
|
|
65
|
-
params.set("include_disabled", "true");
|
|
66
|
-
return requestOxygen(`/api/cli/callables?${params.toString()}`);
|
|
67
|
-
});
|
|
68
|
-
}))
|
|
69
|
-
.addCommand(new Command("bind")
|
|
70
|
-
.description("Add a callable-function column to a source table with explicit input and callback mappings.")
|
|
71
|
-
.argument("<table>", "Caller/source table id or slug.")
|
|
72
|
-
.argument("<callable>", "Callable id or slug.")
|
|
73
|
-
.requiredOption("--inputs-json <json>", "JSON object mapping callable input keys to source column keys.")
|
|
74
|
-
.requiredOption("--outputs-json <json>", "JSON object mapping callable output keys to callback target column keys.")
|
|
75
|
-
.option("--max-credits-per-item <n>", "Override the callable's default per-enrolled-row cap.")
|
|
76
|
-
.option("--overwrite-policy <policy>", "empty_only (default) or overwrite.")
|
|
77
|
-
.option("--key <key>", "Binding column key.")
|
|
78
|
-
.option("--label <label>", "Binding column label.")
|
|
79
|
-
.option("--json", "Print a JSON envelope.")
|
|
80
|
-
.action(async (table, callable, options) => {
|
|
81
|
-
await handleAsyncAction("callables bind", options, () => requestOxygen("/api/cli/callables/bind", {
|
|
82
|
-
method: "POST",
|
|
83
|
-
body: {
|
|
84
|
-
table,
|
|
85
|
-
callable,
|
|
86
|
-
input_mapping: parseJsonObject(options.inputsJson),
|
|
87
|
-
output_mapping: parseJsonObject(options.outputsJson),
|
|
88
|
-
...(readPositiveNumber(options.maxCreditsPerItem) !== undefined
|
|
89
|
-
? { max_credits_per_item: readPositiveNumber(options.maxCreditsPerItem) }
|
|
90
|
-
: {}),
|
|
91
|
-
...(readOption(options.overwritePolicy) ? { overwrite_policy: readOption(options.overwritePolicy) } : {}),
|
|
92
|
-
...(readOption(options.key) ? { key: readOption(options.key) } : {}),
|
|
93
|
-
...(readOption(options.label) ? { label: readOption(options.label) } : {}),
|
|
94
|
-
},
|
|
95
|
-
}));
|
|
96
|
-
}))
|
|
97
|
-
.addCommand(new Command("enable")
|
|
98
|
-
.description("Enable a callable table.")
|
|
99
|
-
.argument("<callable>", "Callable id, slug, or backing table.")
|
|
100
|
-
.option("--json", "Print a JSON envelope.")
|
|
101
|
-
.action(async (callable, options) => {
|
|
102
|
-
await handleAsyncAction("callables enable", options, () => requestOxygen("/api/cli/callables/status", { method: "POST", body: { callable, status: "active" } }));
|
|
103
|
-
}))
|
|
104
|
-
.addCommand(new Command("disable")
|
|
105
|
-
.description("Disable new invocations without changing existing tables or in-flight runs.")
|
|
106
|
-
.argument("<callable>", "Callable id, slug, or backing table.")
|
|
107
|
-
.option("--json", "Print a JSON envelope.")
|
|
108
|
-
.action(async (callable, options) => {
|
|
109
|
-
await handleAsyncAction("callables disable", options, () => requestOxygen("/api/cli/callables/status", { method: "POST", body: { callable, status: "disabled" } }));
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Command } from "commander";
|
|
2
|
-
type JsonOptions = {
|
|
3
|
-
json?: boolean;
|
|
4
|
-
};
|
|
5
|
-
export declare function registerFunctionsCommands(program: Command, handle: (command: string, options: JsonOptions, action: () => Promise<unknown>) => Promise<void>): void;
|
|
6
|
-
export {};
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { OxygenError } from "@oxygen/shared/cli-result";
|
|
2
|
-
import { FUNCTION_LIBRARY_FILTER } from "@oxygen/shared/contracts/function-library-read";
|
|
3
|
-
import { parseJsonObject } from "./cli-values.js";
|
|
4
|
-
import { requestOxygen } from "./http-client.js";
|
|
5
|
-
export function registerFunctionsCommands(program, handle) {
|
|
6
|
-
const functions = program.command("functions")
|
|
7
|
-
.description("Create, publish and reuse your workspace's Functions backed by ordinary Tables.")
|
|
8
|
-
.addHelpText("after", "\n`functions list` shows your workspace's drafts and published Functions with per-row credit estimates. Attaching (`functions bind`) is free; only `columns run` spends, after a dry run. Use `functions duplicate <function>` to start an editable copy.\nDraft edits are isolated. Publishing updates future invocations of every caller; queued, in-flight and past runs retain their captured version. Existing caller caps never increase automatically.\nFlow: draft → describe → publish → bind → columns run --dry-run → approved run → runs.\nA bound Function executes on its own published execution table and writes named outputs back to the calling table. The call stays visible from the caller: `table-runs list --table <caller> --status all` lists the run, and the binding column's cell holds the outcome (status, outputs, credits, invocation and run ids). Address a Function by id, slug, or the display name shown by `functions list`.\nWorked example with commands: `oxygen skills get oxygen-tables --file references/functions.md --json`.\n");
|
|
9
|
-
functions.command("list").description("List your workspace's drafts and published Functions with per-row credit estimates (up to 500).")
|
|
10
|
-
.option("--managed", "Retired compatibility filter; returns an empty list. Use the workspace library without this flag.")
|
|
11
|
-
.option("--favorites", "Only the Functions you favourited (`functions favorite <function>`).")
|
|
12
|
-
.option("--json", "Print a JSON envelope.")
|
|
13
|
-
.action((options) => handle("functions list", options, () => {
|
|
14
|
-
if (options.managed && options.favorites)
|
|
15
|
-
throw new OxygenError("invalid_request", "Pass --managed or --favorites, not both.", { exitCode: 1 });
|
|
16
|
-
const filter = options.managed ? FUNCTION_LIBRARY_FILTER.managed : options.favorites ? FUNCTION_LIBRARY_FILTER.favorites : null;
|
|
17
|
-
return requestOxygen(filter ? `/api/cli/functions?${new URLSearchParams({ filter })}` : "/api/cli/functions");
|
|
18
|
-
}));
|
|
19
|
-
for (const [command, label] of [["favorite", "Favourite a Function so it appears under `functions list --favorites` and the Favorites tab; per user, per workspace."], ["unfavorite", "Remove a Function from your favourites."]]) {
|
|
20
|
-
functions.command(`${command} <function>`).description(label)
|
|
21
|
-
.option("--json", "Print a JSON envelope.")
|
|
22
|
-
.action((ref, options) => handle(`functions ${command}`, options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: command, function: ref } })));
|
|
23
|
-
}
|
|
24
|
-
functions.command("duplicate <function>").description("Copy a Function's steps into a new editable draft (same inputs and outputs, no rows).")
|
|
25
|
-
.option("--name <name>", "Display name for the copy. Defaults to '<source> (copy)'.")
|
|
26
|
-
.option("--json", "Print a JSON envelope.")
|
|
27
|
-
.action((ref, options) => handle("functions duplicate", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "duplicate", function: ref, ...(options.name ? { display_name: options.name } : {}) } })));
|
|
28
|
-
functions.command("describe <function>").description("Inspect a Function's inputs, outputs, steps, per-row credit estimate, caps, and draft or published version.")
|
|
29
|
-
.option("--json", "Print a JSON envelope.")
|
|
30
|
-
.action((ref, options) => handle("functions describe", options, () => requestOxygen(`/api/cli/functions?${new URLSearchParams({ function: ref })}`)));
|
|
31
|
-
functions.command("draft [function]").description("Create a Function draft, or save an existing Function's draft; executes nothing.")
|
|
32
|
-
.requiredOption("--definition-json <json>", "Draft object: {table,display_name,description?,inputs:[{column,key,required}],action_columns:[column],outputs:[{column,key,required}],default_max_credits_per_item,default_max_items?}. Saving requires display_name and the full contract.")
|
|
33
|
-
.option("--expected-draft-hash <hash>", "Reject saving if the draft has changed since inspection.")
|
|
34
|
-
.option("--json", "Print a JSON envelope.")
|
|
35
|
-
.action((ref, options) => handle("functions draft", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: {
|
|
36
|
-
...parseJsonObject(options.definitionJson),
|
|
37
|
-
operation: ref ? "save_draft" : "create_draft",
|
|
38
|
-
function: ref,
|
|
39
|
-
...(options.expectedDraftHash ? { expected_draft_hash: options.expectedDraftHash } : {}),
|
|
40
|
-
} })));
|
|
41
|
-
functions.command("publish <function>").description("Publish the inspected draft for every caller's future invocations; preserves captured runs and caller caps. Until the first publish a draft is addressed by its backing table id; publishing mints the Function id that bindings and runs record, and the table id keeps resolving.")
|
|
42
|
-
.requiredOption("--expected-draft-hash <hash>", "function.draft.contentHash returned by draft or describe; rejects concurrent edits.")
|
|
43
|
-
.option("--json", "Print a JSON envelope.")
|
|
44
|
-
.action((ref, options) => handle("functions publish", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "publish", function: ref, expected_draft_hash: options.expectedDraftHash } })));
|
|
45
|
-
functions.command("runs <function>").description("Inspect a Function's latest 100 invocations, the table that called each one, and their captured versions and bindings: each run's overwrite policy, output mapping and run condition as they were when it ran. Per row, the calling table's Function cell records overwrite_policy, written_columns, overwritten_columns (filled cells it replaced) and kept_columns (filled cells empty_only left). For a call that did not complete, creditsUsed can show the estimate; `table-runs provider-summary <run_id>` reports the credits actually captured.")
|
|
46
|
-
.option("--json", "Print a JSON envelope.")
|
|
47
|
-
.action((ref, options) => handle("functions runs", options, () => requestOxygen(`/api/cli/functions/runs?${new URLSearchParams({ function: ref })}`)));
|
|
48
|
-
functions.command("rename <function> <name>").description("Rename a Function while preserving its identity, callers and published execution.")
|
|
49
|
-
.option("--json", "Print a JSON envelope.")
|
|
50
|
-
.action((ref, name, options) => handle("functions rename", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "rename", function: ref, display_name: name } })));
|
|
51
|
-
functions.command("delete <function>").description("Preview removal from the Function library, then remove it with --yes; preserves backing tables, rows and run history. The preview names every column that calls it: those stop running, keeping the values they already wrote. Only the Function's own active runs block deletion.")
|
|
52
|
-
.addHelpText("after", "\nDeleting your own Function is final: there is no restore, unlike `tables delete`. To reuse the logic, `tables duplicate` the backing Table and draft a new Function from the copy.\n")
|
|
53
|
-
.option("--yes", "Confirm removal of this Function after reviewing its callers.")
|
|
54
|
-
.option("--json", "Print a JSON envelope.")
|
|
55
|
-
.action((ref, options) => handle("functions delete", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "delete", function: ref, approved: options.yes === true } })));
|
|
56
|
-
functions.command("restore").description("Retired: OXYGEN-provided Functions can no longer be restored. Create a workspace Function instead.")
|
|
57
|
-
.option("--catalog-id <id...>", "Legacy catalog identifiers; restoration is no longer available.")
|
|
58
|
-
.option("--json", "Print a JSON envelope.")
|
|
59
|
-
.action((options) => handle("functions restore", options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "restore_managed", ...(options.catalogId?.length ? { catalog_ids: options.catalogId } : {}) } })));
|
|
60
|
-
functions.command("bind <table> <function>").description("Add a Function column with explicit input/output mappings and a caller credit cap. Create each mapped output column on the caller table first with `columns add`; bind rejects an output mapped to a column the caller table does not have.")
|
|
61
|
-
.requiredOption("--inputs-json <json>", "Map Function input keys to caller columns or nested JSON paths, e.g. profile.company.domain.")
|
|
62
|
-
.requiredOption("--outputs-json <json>", "Object mapping Function output keys to existing caller column keys.")
|
|
63
|
-
.requiredOption("--max-credits-per-item <n>", "Hard credit ceiling for each caller row; future publishes cannot raise it.")
|
|
64
|
-
.option("--overwrite-policy <policy>", "Callback writes: empty_only or overwrite.", "empty_only")
|
|
65
|
-
.option("--key <key>", "Function column key.").option("--label <label>", "Function column label.")
|
|
66
|
-
.option("--json", "Print a JSON envelope.")
|
|
67
|
-
.action((table, ref, options) => handle("functions bind", options, () => {
|
|
68
|
-
const cap = Number(options.maxCreditsPerItem);
|
|
69
|
-
if (!Number.isFinite(cap) || cap <= 0)
|
|
70
|
-
throw new OxygenError("invalid_number", "Expected a positive credit ceiling.");
|
|
71
|
-
if (!["empty_only", "overwrite"].includes(options.overwritePolicy))
|
|
72
|
-
throw new OxygenError("invalid_request", "Overwrite policy must be empty_only or overwrite.");
|
|
73
|
-
return requestOxygen("/api/cli/callables/bind", { method: "POST", body: {
|
|
74
|
-
table, callable: ref,
|
|
75
|
-
input_mapping: parseJsonObject(options.inputsJson), output_mapping: parseJsonObject(options.outputsJson),
|
|
76
|
-
max_credits_per_item: cap,
|
|
77
|
-
overwrite_policy: options.overwritePolicy, key: options.key, label: options.label,
|
|
78
|
-
} });
|
|
79
|
-
}));
|
|
80
|
-
for (const [command, status] of [["enable", "active"], ["disable", "disabled"]]) {
|
|
81
|
-
functions.command(`${command} <function>`).description(`${command === "enable" ? "Enable" : "Disable"} future Function invocations; captured runs are unchanged.`)
|
|
82
|
-
.option("--json", "Print a JSON envelope.")
|
|
83
|
-
.action((ref, options) => handle(`functions ${command}`, options, () => requestOxygen("/api/cli/functions", { method: "POST", body: { operation: "set_status", function: ref, status } })));
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare const FUNCTION_LIBRARY_FILTER: {
|
|
2
|
-
readonly all: "all";
|
|
3
|
-
readonly managed: "managed";
|
|
4
|
-
readonly favorites: "favorites";
|
|
5
|
-
};
|
|
6
|
-
export declare const FUNCTION_LIBRARY_FILTERS: readonly ["all", "managed", "favorites"];
|
|
7
|
-
export type FunctionLibraryFilter = (typeof FUNCTION_LIBRARY_FILTERS)[number];
|
|
8
|
-
export declare const FUNCTION_LIBRARY_LIST_READ_CONTRACT: import("./schema.js").ContractObject<{
|
|
9
|
-
readonly filter: {
|
|
10
|
-
type: "string";
|
|
11
|
-
enum: readonly ("all" | "favorites" | "managed")[];
|
|
12
|
-
description?: string;
|
|
13
|
-
};
|
|
14
|
-
}, never>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { enumOf, obj } from "./schema.js";
|
|
2
|
-
export const FUNCTION_LIBRARY_FILTER = {
|
|
3
|
-
all: "all",
|
|
4
|
-
managed: "managed",
|
|
5
|
-
favorites: "favorites",
|
|
6
|
-
};
|
|
7
|
-
export const FUNCTION_LIBRARY_FILTERS = [
|
|
8
|
-
FUNCTION_LIBRARY_FILTER.all,
|
|
9
|
-
FUNCTION_LIBRARY_FILTER.managed,
|
|
10
|
-
FUNCTION_LIBRARY_FILTER.favorites,
|
|
11
|
-
];
|
|
12
|
-
export const FUNCTION_LIBRARY_LIST_READ_CONTRACT = obj({
|
|
13
|
-
filter: enumOf(FUNCTION_LIBRARY_FILTERS, {
|
|
14
|
-
description: "list_functions: all (default), favorites, or retired managed (empty).",
|
|
15
|
-
}),
|
|
16
|
-
});
|