@oxygen-agent/cli 1.1014.136 → 1.1014.618
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/admin-primary-providers-render.js +27 -19
- package/dist/cli-output.d.ts +12 -0
- package/dist/cli-output.js +395 -0
- package/dist/cli-paths.d.ts +1 -0
- package/dist/cli-paths.js +3 -0
- package/dist/cli-profile-context.d.ts +3 -0
- package/dist/cli-profile-context.js +13 -0
- package/dist/command-manifest.d.ts +15 -0
- package/dist/command-manifest.js +23 -1
- package/dist/command-support.d.ts +438 -0
- package/dist/command-support.js +1610 -0
- package/dist/commands/action-column.d.ts +3 -0
- package/dist/commands/action-column.js +43 -0
- package/dist/commands/activation.d.ts +3 -0
- package/dist/commands/activation.js +24 -0
- package/dist/commands/admin.d.ts +3 -0
- package/dist/commands/admin.js +347 -0
- package/dist/commands/ads.d.ts +3 -0
- package/dist/commands/ads.js +62 -0
- package/dist/commands/agent.d.ts +3 -0
- package/dist/commands/agent.js +274 -0
- package/dist/commands/api-keys.d.ts +3 -0
- package/dist/commands/api-keys.js +77 -0
- package/dist/commands/approvals.d.ts +3 -0
- package/dist/commands/approvals.js +518 -0
- package/dist/commands/auth.d.ts +3 -0
- package/dist/commands/auth.js +230 -0
- package/dist/commands/billing.d.ts +3 -0
- package/dist/commands/billing.js +357 -0
- package/dist/commands/blueprints.d.ts +3 -0
- package/dist/commands/blueprints.js +312 -0
- package/dist/commands/budget.d.ts +3 -0
- package/dist/commands/budget.js +55 -0
- package/dist/commands/callables.d.ts +3 -0
- package/dist/commands/callables.js +111 -0
- package/dist/commands/capabilities.d.ts +3 -0
- package/dist/commands/capabilities.js +44 -0
- package/dist/commands/cells.d.ts +3 -0
- package/dist/commands/cells.js +94 -0
- package/dist/commands/columns.d.ts +3 -0
- package/dist/commands/columns.js +1628 -0
- package/dist/commands/commands.d.ts +3 -0
- package/dist/commands/commands.js +45 -0
- package/dist/commands/comments.d.ts +3 -0
- package/dist/commands/comments.js +188 -0
- package/dist/commands/companies.d.ts +3 -0
- package/dist/commands/companies.js +312 -0
- package/dist/commands/connections.d.ts +3 -0
- package/dist/commands/connections.js +39 -0
- package/dist/commands/context.d.ts +3 -0
- package/dist/commands/context.js +170 -0
- package/dist/commands/copilot.d.ts +3 -0
- package/dist/commands/copilot.js +565 -0
- package/dist/commands/crm.d.ts +3 -0
- package/dist/commands/crm.js +1669 -0
- package/dist/commands/custom-integrations.d.ts +3 -0
- package/dist/commands/custom-integrations.js +140 -0
- package/dist/commands/dashboards.d.ts +3 -0
- package/dist/commands/dashboards.js +240 -0
- package/dist/commands/db.d.ts +3 -0
- package/dist/commands/db.js +190 -0
- package/dist/commands/deliverability.d.ts +3 -0
- package/dist/commands/deliverability.js +90 -0
- package/dist/commands/directory.d.ts +3 -0
- package/dist/commands/directory.js +101 -0
- package/dist/commands/domains.d.ts +3 -0
- package/dist/commands/domains.js +604 -0
- package/dist/commands/egress.d.ts +3 -0
- package/dist/commands/egress.js +130 -0
- package/dist/commands/email.d.ts +3 -0
- package/dist/commands/email.js +49 -0
- package/dist/commands/engagement.d.ts +3 -0
- package/dist/commands/engagement.js +189 -0
- package/dist/commands/enrich-column.d.ts +3 -0
- package/dist/commands/enrich-column.js +149 -0
- package/dist/commands/enrichment.d.ts +3 -0
- package/dist/commands/enrichment.js +49 -0
- package/dist/commands/feedback.d.ts +3 -0
- package/dist/commands/feedback.js +96 -0
- package/dist/commands/feeds.d.ts +3 -0
- package/dist/commands/feeds.js +486 -0
- package/dist/commands/find.d.ts +3 -0
- package/dist/commands/find.js +159 -0
- package/dist/commands/followers.d.ts +3 -0
- package/dist/commands/followers.js +39 -0
- package/dist/commands/formulas.d.ts +3 -0
- package/dist/commands/formulas.js +43 -0
- package/dist/commands/home.d.ts +3 -0
- package/dist/commands/home.js +22 -0
- package/dist/commands/inbox.d.ts +3 -0
- package/dist/commands/inbox.js +779 -0
- package/dist/commands/integrations.d.ts +3 -0
- package/dist/commands/integrations.js +290 -0
- package/dist/commands/knowledge.d.ts +3 -0
- package/dist/commands/knowledge.js +874 -0
- package/dist/commands/lead-sourcing.d.ts +3 -0
- package/dist/commands/lead-sourcing.js +52 -0
- package/dist/commands/limits.d.ts +3 -0
- package/dist/commands/limits.js +54 -0
- package/dist/commands/linkedin.d.ts +3 -0
- package/dist/commands/linkedin.js +275 -0
- package/dist/commands/login.d.ts +3 -0
- package/dist/commands/login.js +347 -0
- package/dist/commands/logout.d.ts +3 -0
- package/dist/commands/logout.js +12 -0
- package/dist/commands/mailboxes.d.ts +3 -0
- package/dist/commands/mailboxes.js +1290 -0
- package/dist/commands/managed-inboxes.d.ts +3 -0
- package/dist/commands/managed-inboxes.js +361 -0
- package/dist/commands/messages.d.ts +3 -0
- package/dist/commands/messages.js +78 -0
- package/dist/commands/notetaker.d.ts +3 -0
- package/dist/commands/notetaker.js +79 -0
- package/dist/commands/observability.d.ts +3 -0
- package/dist/commands/observability.js +125 -0
- package/dist/commands/orgs.d.ts +3 -0
- package/dist/commands/orgs.js +237 -0
- package/dist/commands/people.d.ts +3 -0
- package/dist/commands/people.js +353 -0
- package/dist/commands/posts.d.ts +3 -0
- package/dist/commands/posts.js +139 -0
- package/dist/commands/profiles.d.ts +3 -0
- package/dist/commands/profiles.js +250 -0
- package/dist/commands/projects.d.ts +3 -0
- package/dist/commands/projects.js +94 -0
- package/dist/commands/prompts.d.ts +3 -0
- package/dist/commands/prompts.js +84 -0
- package/dist/commands/publishing.d.ts +3 -0
- package/dist/commands/publishing.js +1419 -0
- package/dist/commands/recipes.d.ts +3 -0
- package/dist/commands/recipes.js +120 -0
- package/dist/commands/reviews.d.ts +3 -0
- package/dist/commands/reviews.js +75 -0
- package/dist/commands/rows.d.ts +3 -0
- package/dist/commands/rows.js +27 -0
- package/dist/commands/runs.d.ts +3 -0
- package/dist/commands/runs.js +37 -0
- package/dist/commands/search.d.ts +3 -0
- package/dist/commands/search.js +182 -0
- package/dist/commands/senders.d.ts +3 -0
- package/dist/commands/senders.js +393 -0
- package/dist/commands/sequences.d.ts +3 -0
- package/dist/commands/sequences.js +2322 -0
- package/dist/commands/session.d.ts +3 -0
- package/dist/commands/session.js +109 -0
- package/dist/commands/signals.d.ts +3 -0
- package/dist/commands/signals.js +289 -0
- package/dist/commands/signup-leads.d.ts +3 -0
- package/dist/commands/signup-leads.js +46 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.js +50 -0
- package/dist/commands/sourcing.d.ts +3 -0
- package/dist/commands/sourcing.js +27 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +51 -0
- package/dist/commands/supabase.d.ts +3 -0
- package/dist/commands/supabase.js +128 -0
- package/dist/commands/support.d.ts +3 -0
- package/dist/commands/support.js +651 -0
- package/dist/commands/suppressions.d.ts +3 -0
- package/dist/commands/suppressions.js +577 -0
- package/dist/commands/table-ingestions.d.ts +3 -0
- package/dist/commands/table-ingestions.js +145 -0
- package/dist/commands/table-runs.d.ts +3 -0
- package/dist/commands/table-runs.js +277 -0
- package/dist/commands/tables.d.ts +3 -0
- package/dist/commands/tables.js +3492 -0
- package/dist/commands/tags.d.ts +3 -0
- package/dist/commands/tags.js +147 -0
- package/dist/commands/tools.d.ts +3 -0
- package/dist/commands/tools.js +246 -0
- package/dist/commands/update.d.ts +3 -0
- package/dist/commands/update.js +106 -0
- package/dist/commands/verify.d.ts +3 -0
- package/dist/commands/verify.js +27 -0
- package/dist/commands/viewers.d.ts +3 -0
- package/dist/commands/viewers.js +72 -0
- package/dist/commands/voice.d.ts +3 -0
- package/dist/commands/voice.js +351 -0
- package/dist/commands/whatsapp.d.ts +3 -0
- package/dist/commands/whatsapp.js +226 -0
- package/dist/commands/whoami.d.ts +3 -0
- package/dist/commands/whoami.js +110 -0
- package/dist/commands/worker.d.ts +3 -0
- package/dist/commands/worker.js +60 -0
- package/dist/commands/workflows.d.ts +3 -0
- package/dist/commands/workflows.js +1752 -0
- package/dist/commands/workspace.d.ts +3 -0
- package/dist/commands/workspace.js +94 -0
- package/dist/compact-list-flags.d.ts +7 -0
- package/dist/compact-list-flags.js +12 -0
- package/dist/crm-support-flags.js +14 -5
- package/dist/customer-operation-commands.js +8 -6
- package/dist/diagnostic-uploader.d.ts +3 -1
- package/dist/diagnostic-uploader.js +29 -8
- package/dist/help.d.ts +5 -0
- package/dist/help.js +22 -0
- package/dist/index.d.ts +98 -1
- package/dist/index.js +331 -30719
- package/dist/local-module-loader.d.ts +4 -0
- package/dist/local-module-loader.js +156 -0
- package/dist/visual-commands.js +9 -5
- package/node_modules/@oxygen/cli-ugc/dist/commands.js +2 -2
- package/node_modules/@oxygen/shared/dist/agent-session-schedule.d.ts +36 -0
- package/node_modules/@oxygen/shared/dist/agent-session-schedule.js +69 -0
- package/node_modules/@oxygen/shared/dist/agent-sessions.d.ts +14 -5
- package/node_modules/@oxygen/shared/dist/agent-sessions.js +14 -3
- package/node_modules/@oxygen/shared/dist/capability-discovery.js +175 -14
- package/node_modules/@oxygen/shared/dist/compact-list-result.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/compact-list-result.js +27 -0
- package/node_modules/@oxygen/shared/dist/contracts/agent-sessions.d.ts +12 -1
- package/node_modules/@oxygen/shared/dist/contracts/agent-sessions.js +5 -2
- package/node_modules/@oxygen/shared/dist/contracts/browser-operations.js +4 -2
- package/node_modules/@oxygen/shared/dist/contracts/compact-list-reads.d.ts +57 -0
- package/node_modules/@oxygen/shared/dist/contracts/compact-list-reads.js +23 -0
- package/node_modules/@oxygen/shared/dist/contracts/crm-support.d.ts +52 -0
- package/node_modules/@oxygen/shared/dist/contracts/crm-support.js +43 -2
- package/node_modules/@oxygen/shared/dist/contracts/customer-operations.js +17 -14
- package/node_modules/@oxygen/shared/dist/contracts/knowledge-content-reads.js +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/knowledge-proposal-reads.d.ts +49 -0
- package/node_modules/@oxygen/shared/dist/contracts/knowledge-proposal-reads.js +14 -0
- package/node_modules/@oxygen/shared/dist/contracts/knowledge-sync.js +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/limits-read.js +60 -7
- package/node_modules/@oxygen/shared/dist/contracts/operations.d.ts +9 -1
- package/node_modules/@oxygen/shared/dist/contracts/operations.js +13 -5
- package/node_modules/@oxygen/shared/dist/contracts/publishing-reads.js +1 -1
- package/node_modules/@oxygen/shared/dist/contracts/teammates.d.ts +16 -0
- package/node_modules/@oxygen/shared/dist/contracts/teammates.js +115 -0
- package/node_modules/@oxygen/shared/dist/cost-estimate-view.js +21 -3
- package/node_modules/@oxygen/shared/dist/cost-estimate.d.ts +31 -1
- package/node_modules/@oxygen/shared/dist/cost-estimate.js +56 -15
- package/node_modules/@oxygen/shared/dist/diagnostic-credentials.d.ts +2 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-credentials.js +2 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-lock.js +71 -44
- package/node_modules/@oxygen/shared/dist/diagnostic-spool.d.ts +18 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-spool.js +348 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-storage-failure.d.ts +10 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-storage-failure.js +42 -0
- package/node_modules/@oxygen/shared/dist/diagnostic-storage.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/diagnostic-storage.js +59 -213
- package/node_modules/@oxygen/shared/dist/diagnostics.js +3 -2
- package/node_modules/@oxygen/shared/dist/email-dsn.d.ts +16 -5
- package/node_modules/@oxygen/shared/dist/email-dsn.js +97 -1
- package/node_modules/@oxygen/shared/dist/emailguard-placement-probe.js +5 -0
- package/node_modules/@oxygen/shared/dist/enrichment-intents.js +4 -5
- package/node_modules/@oxygen/shared/dist/file-import.js +5 -2
- package/node_modules/@oxygen/shared/dist/hosted-ai.d.ts +30 -0
- package/node_modules/@oxygen/shared/dist/hosted-ai.js +20 -0
- package/node_modules/@oxygen/shared/dist/knowledge-bootstrap.d.ts +6 -2
- package/node_modules/@oxygen/shared/dist/knowledge-seed-content.d.ts +17 -7
- package/node_modules/@oxygen/shared/dist/knowledge-seed-content.js +81 -17
- package/node_modules/@oxygen/shared/dist/langfuse.js +8 -4
- package/node_modules/@oxygen/shared/dist/mailbox-egress-ownership.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/mailbox-import.d.ts +6 -3
- package/node_modules/@oxygen/shared/dist/mailbox-import.js +9 -9
- package/node_modules/@oxygen/shared/dist/mcp-server-info.d.ts +8 -0
- package/node_modules/@oxygen/shared/dist/mcp-server-info.js +10 -0
- package/node_modules/@oxygen/shared/dist/object-storage.d.ts +10 -0
- package/node_modules/@oxygen/shared/dist/object-storage.js +14 -0
- package/node_modules/@oxygen/shared/dist/plan-limits-view.d.ts +5 -0
- package/node_modules/@oxygen/shared/dist/plan-limits-view.js +17 -1
- package/node_modules/@oxygen/shared/dist/pricing-sheet.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/pricing-sheet.js +1 -1
- package/node_modules/@oxygen/shared/dist/provider-selection.d.ts +15 -0
- package/node_modules/@oxygen/shared/dist/provider-selection.js +3 -0
- package/node_modules/@oxygen/shared/dist/repricing.d.ts +1 -1
- package/node_modules/@oxygen/shared/dist/repricing.js +2 -2
- package/node_modules/@oxygen/shared/dist/schedule-label.d.ts +6 -0
- package/node_modules/@oxygen/shared/dist/schedule-label.js +12 -0
- package/node_modules/@oxygen/shared/dist/sequence-failures.d.ts +1 -0
- package/node_modules/@oxygen/shared/dist/sequence-failures.js +20 -6
- package/node_modules/@oxygen/shared/dist/teammate-groups.d.ts +55 -0
- package/node_modules/@oxygen/shared/dist/teammate-groups.js +74 -0
- package/node_modules/@oxygen/shared/dist/teammate-messages.d.ts +52 -0
- package/node_modules/@oxygen/shared/dist/teammate-messages.js +88 -0
- package/node_modules/@oxygen/shared/dist/teammate-notes.d.ts +58 -0
- package/node_modules/@oxygen/shared/dist/teammate-notes.js +73 -0
- package/node_modules/@oxygen/shared/dist/teammate-routines.d.ts +95 -0
- package/node_modules/@oxygen/shared/dist/teammate-routines.js +266 -0
- package/node_modules/@oxygen/shared/dist/teammate-tasks.d.ts +56 -0
- package/node_modules/@oxygen/shared/dist/teammate-tasks.js +114 -0
- package/node_modules/@oxygen/shared/dist/teammates.d.ts +78 -0
- package/node_modules/@oxygen/shared/dist/teammates.js +140 -0
- package/node_modules/@oxygen/shared/dist/user-capability-routing.js +120 -0
- 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/visual-render.d.ts +9 -1
- package/node_modules/@oxygen/shared/dist/visual-render.js +12 -5
- package/node_modules/@oxygen/shared/dist/warmup-metrics.d.ts +5 -0
- package/node_modules/@oxygen/shared/dist/warmup-metrics.js +44 -0
- package/package.json +1 -1
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { parseJsonObject, readPositiveInt } from "../cli-values.js";
|
|
2
|
+
import { readPositiveNumber } from "../command-support.js";
|
|
3
|
+
import { requestOxygen } from "../http-client.js";
|
|
4
|
+
import { readOption } from "../util.js";
|
|
5
|
+
import { OxygenError } from "@oxygen/shared/cli-result";
|
|
6
|
+
import { PUBLIC_WEBHOOK_INGRESS_PER_TARGET_PER_MINUTE } from "@oxygen/shared/plan-band";
|
|
7
|
+
import { Command } from "commander";
|
|
8
|
+
const AGENT_MODEL_POLICY_HELP = "Model policy JSON: level low (Fast), medium (Balanced, default), or high (Max); credential_mode managed or organization_byok.";
|
|
9
|
+
const AGENT_TOOL_POLICY_HELP = "Tool policy JSON. Effects: read, internal_write, paid, external_write. Ask-before-changes preset: {\"mode\":\"scoped\",\"rules\":[{\"decision\":\"allow\",\"effect\":\"read\"},{\"decision\":\"ask\",\"effect\":\"internal_write\"},{\"decision\":\"ask\",\"effect\":\"paid\"},{\"decision\":\"ask\",\"effect\":\"external_write\"}]}. Full mode requires --confirm-full-access.";
|
|
10
|
+
const WEBHOOK_TRIGGER_RATE_HELP = `${PUBLIC_WEBHOOK_INGRESS_PER_TARGET_PER_MINUTE.free.toLocaleString("en-US")}–${PUBLIC_WEBHOOK_INGRESS_PER_TARGET_PER_MINUTE["1999"].toLocaleString("en-US")} deliveries a minute by plan size, per trigger and sender IP; 429 returns Retry-After`;
|
|
11
|
+
export function registerAgentFamily(program, handleAsyncAction) {
|
|
12
|
+
// The Agents primitive's roster surface (ADR 0011): governed workspace agents
|
|
13
|
+
// that run inside the workspace as approval-gated, observable runs. Lists only
|
|
14
|
+
// shipped agents — no placeholders; user-defined custom agents arrive with the
|
|
15
|
+
// unified runtime envelope (create/update land then). (Distinct from
|
|
16
|
+
// `oxygen knowledge agent`, which configures the AI Knowledge Agent itself.)
|
|
17
|
+
program
|
|
18
|
+
.command("agent")
|
|
19
|
+
.description("Agents: the programmable Workspace Agent, custom Agents, and built-in specialists. Publish versioned instructions and policies, start durable chats/runs, inspect every event, and control approvals. Web: /agents.")
|
|
20
|
+
.addCommand(new Command("list")
|
|
21
|
+
.description("List the Workspace Agent and built-in specialists with state and recent run history.")
|
|
22
|
+
.option("--json", "Print a JSON envelope.")
|
|
23
|
+
.action(async (options) => {
|
|
24
|
+
await handleAsyncAction("agent list", options, () => requestOxygen("/api/cli/agent"));
|
|
25
|
+
}))
|
|
26
|
+
.addCommand(new Command("get")
|
|
27
|
+
.description("Show one agent — the Workspace Agent, a specialist, or a custom agent — with its active version and recent runs.")
|
|
28
|
+
.argument("<slug>", "Agent slug: workspace, a specialist (inbox-reply-drafts, meeting-notetaker, knowledge-synthesis), or a custom agent slug (from `oxygen agent create`).")
|
|
29
|
+
.option("--json", "Print a JSON envelope.")
|
|
30
|
+
.action(async (slug, options) => {
|
|
31
|
+
await handleAsyncAction("agent get", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}`));
|
|
32
|
+
}))
|
|
33
|
+
.addCommand(new Command("enable")
|
|
34
|
+
.description("Enable a workspace or specialist agent so it resumes its governed runs.")
|
|
35
|
+
.argument("<slug>", "Specialist slug: inbox-reply-drafts, meeting-notetaker, or knowledge-synthesis.")
|
|
36
|
+
.option("--json", "Print a JSON envelope.")
|
|
37
|
+
.action(async (slug, options) => {
|
|
38
|
+
await handleAsyncAction("agent enable", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/enable`, { method: "POST" }));
|
|
39
|
+
}))
|
|
40
|
+
.addCommand(new Command("disable")
|
|
41
|
+
.description("Disable a workspace or specialist agent so it stops new runs on the next worker tick.")
|
|
42
|
+
.argument("<slug>", "Specialist slug: inbox-reply-drafts, meeting-notetaker, or knowledge-synthesis.")
|
|
43
|
+
.option("--json", "Print a JSON envelope.")
|
|
44
|
+
.action(async (slug, options) => {
|
|
45
|
+
await handleAsyncAction("agent disable", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/disable`, { method: "POST" }));
|
|
46
|
+
}))
|
|
47
|
+
.addCommand(new Command("runs")
|
|
48
|
+
.description("List recent runs across all agents (or one via <slug>), newest first.")
|
|
49
|
+
.argument("[slug]", "Optional agent slug to filter to one agent.")
|
|
50
|
+
.option("--limit <n>", "Maximum runs to return (1-100). Defaults to 25.")
|
|
51
|
+
.option("--json", "Print a JSON envelope.")
|
|
52
|
+
.action(async (slug, options) => {
|
|
53
|
+
await handleAsyncAction("agent runs", options, () => {
|
|
54
|
+
const params = new URLSearchParams();
|
|
55
|
+
const target = readOption(slug);
|
|
56
|
+
const limit = readPositiveInt(options.limit);
|
|
57
|
+
if (target)
|
|
58
|
+
params.set("slug", target);
|
|
59
|
+
if (limit)
|
|
60
|
+
params.set("limit", String(limit));
|
|
61
|
+
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
62
|
+
return requestOxygen(`/api/cli/agent/runs${suffix}`);
|
|
63
|
+
});
|
|
64
|
+
}))
|
|
65
|
+
.addCommand(new Command("set")
|
|
66
|
+
.description("Publish an immutable version (reconfigure) for a runtime agent: the Workspace Agent or a custom agent.")
|
|
67
|
+
.argument("<slug>", "workspace, or a custom agent slug (from `oxygen agent create`).")
|
|
68
|
+
.requiredOption("--instructions <text>", "Workspace Agent instructions for this version.")
|
|
69
|
+
.option("--model-policy-json <json>", AGENT_MODEL_POLICY_HELP)
|
|
70
|
+
.option("--tool-policy-json <json>", AGENT_TOOL_POLICY_HELP)
|
|
71
|
+
.option("--context-policy-json <json>", "Context policy JSON: on_demand, prefetch, or grounded (seeds the run from the workspace knowledge wiki); optional resolve_args and file_ids.")
|
|
72
|
+
.option("--skills <csv>", "Comma-separated product skill slugs snapshotted into this immutable version.")
|
|
73
|
+
.option("--sandbox-policy-json <json>", "Sandbox policy JSON.")
|
|
74
|
+
.option("--limits-json <json>", "Optional limits JSON; platform hard ceilings still apply.")
|
|
75
|
+
.option("--confirm-full-access", "Acknowledge standing full catalog access when the policy mode is full.")
|
|
76
|
+
.option("--json", "Print a JSON envelope.")
|
|
77
|
+
.action(async (slug, options) => {
|
|
78
|
+
await handleAsyncAction("agent set", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}`, {
|
|
79
|
+
method: "PATCH",
|
|
80
|
+
body: {
|
|
81
|
+
instructions: options.instructions,
|
|
82
|
+
...(options.modelPolicyJson ? { model_policy: parseJsonObject(options.modelPolicyJson) } : {}),
|
|
83
|
+
...(options.toolPolicyJson ? { tool_policy: parseJsonObject(options.toolPolicyJson) } : {}),
|
|
84
|
+
...(options.contextPolicyJson ? { context_policy: parseJsonObject(options.contextPolicyJson) } : {}),
|
|
85
|
+
...(options.skills ? { skill_slugs: options.skills.split(",").map((value) => value.trim()).filter(Boolean) } : {}),
|
|
86
|
+
...(options.sandboxPolicyJson ? { sandbox_policy: parseJsonObject(options.sandboxPolicyJson) } : {}),
|
|
87
|
+
...(options.limitsJson ? { limits: parseJsonObject(options.limitsJson) } : {}),
|
|
88
|
+
confirm_full_access: options.confirmFullAccess === true,
|
|
89
|
+
},
|
|
90
|
+
}));
|
|
91
|
+
}))
|
|
92
|
+
.addCommand(new Command("create")
|
|
93
|
+
.description("Create a custom Agent and publish its first immutable version. This internal configuration write starts no chat/run and spends no credits.")
|
|
94
|
+
.argument("<slug>", "User-minted agent slug: a lowercase letter then letters, digits, or hyphens (2-49 chars).")
|
|
95
|
+
.requiredOption("--name <name>", "Display name for the agent.")
|
|
96
|
+
.requiredOption("--instructions <text>", "Durable standing instructions for the first immutable version.")
|
|
97
|
+
.option("--description <text>", "Optional one-line description of the agent's job.")
|
|
98
|
+
.option("--model-policy-json <json>", AGENT_MODEL_POLICY_HELP)
|
|
99
|
+
.option("--tool-policy-json <json>", AGENT_TOOL_POLICY_HELP)
|
|
100
|
+
.option("--context-policy-json <json>", "Context policy JSON: on_demand, prefetch, or grounded (seeds the run from the workspace knowledge wiki); optional resolve_args and file_ids.")
|
|
101
|
+
.option("--skills <csv>", "Comma-separated product skill slugs snapshotted into this immutable version.")
|
|
102
|
+
.option("--sandbox-policy-json <json>", "Sandbox policy JSON.")
|
|
103
|
+
.option("--limits-json <json>", "Optional limits JSON; platform hard ceilings still apply.")
|
|
104
|
+
.option("--confirm-full-access", "Acknowledge standing full catalog access when the policy mode is full.")
|
|
105
|
+
.option("--json", "Print a JSON envelope.")
|
|
106
|
+
.action(async (slug, options) => {
|
|
107
|
+
await handleAsyncAction("agent create", options, () => requestOxygen("/api/cli/agent/create", {
|
|
108
|
+
method: "POST",
|
|
109
|
+
body: {
|
|
110
|
+
slug,
|
|
111
|
+
name: options.name,
|
|
112
|
+
instructions: options.instructions,
|
|
113
|
+
...(options.description ? { description: options.description } : {}),
|
|
114
|
+
...(options.modelPolicyJson ? { model_policy: parseJsonObject(options.modelPolicyJson) } : {}),
|
|
115
|
+
...(options.toolPolicyJson ? { tool_policy: parseJsonObject(options.toolPolicyJson) } : {}),
|
|
116
|
+
...(options.contextPolicyJson ? { context_policy: parseJsonObject(options.contextPolicyJson) } : {}),
|
|
117
|
+
...(options.skills ? { skill_slugs: options.skills.split(",").map((value) => value.trim()).filter(Boolean) } : {}),
|
|
118
|
+
...(options.sandboxPolicyJson ? { sandbox_policy: parseJsonObject(options.sandboxPolicyJson) } : {}),
|
|
119
|
+
...(options.limitsJson ? { limits: parseJsonObject(options.limitsJson) } : {}),
|
|
120
|
+
confirm_full_access: options.confirmFullAccess === true,
|
|
121
|
+
},
|
|
122
|
+
}));
|
|
123
|
+
}))
|
|
124
|
+
.addCommand(new Command("custom")
|
|
125
|
+
.description("List the org's user-defined custom agents (distinct from `agent list`, which shows the built-in roster).")
|
|
126
|
+
.option("--tag <tag>", "Only custom agents carrying this workspace tag.")
|
|
127
|
+
.option("--json", "Print a JSON envelope.")
|
|
128
|
+
.action(async (options) => {
|
|
129
|
+
await handleAsyncAction("agent custom", options, () => requestOxygen(`/api/cli/agent/custom${options.tag ? `?tag=${encodeURIComponent(options.tag)}` : ""}`));
|
|
130
|
+
}))
|
|
131
|
+
.addCommand(new Command("delete")
|
|
132
|
+
.description("Archive a custom agent (soft delete): its triggers stop firing and it leaves the roster; versions/runs are preserved.")
|
|
133
|
+
.argument("<slug>", "The custom agent slug to archive.")
|
|
134
|
+
.option("--json", "Print a JSON envelope.")
|
|
135
|
+
.action(async (slug, options) => {
|
|
136
|
+
await handleAsyncAction("agent delete", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}`, { method: "DELETE" }));
|
|
137
|
+
}))
|
|
138
|
+
.addCommand(new Command("run")
|
|
139
|
+
.description("Start a durable chat/run for the Workspace Agent or a custom Agent on the Fly worker.")
|
|
140
|
+
.argument("<slug>", "workspace, or a custom Agent slug from `oxygen agent custom`.")
|
|
141
|
+
.option("--goal <text>", "Natural-language goal.")
|
|
142
|
+
.option("--input-json <json>", "Structured run input instead of --goal.")
|
|
143
|
+
.option("--idempotency-key <key>", "Deduplicate retries of the same source event.")
|
|
144
|
+
.option("--thread-id <id>", "Continue an existing persistent Agent thread.")
|
|
145
|
+
.option("--thread-mode <isolated|persistent>", "Create a persistent thread for this run. Defaults to isolated.")
|
|
146
|
+
.option("--file-ids <csv>", "Comma-separated workspace file UUIDs attached to context and eligible for sandbox input.")
|
|
147
|
+
.requiredOption("--max-credits <credits>", "Hard credit ceiling for this run.")
|
|
148
|
+
.requiredOption("--approved", "Explicitly approve managed inference up to --max-credits.")
|
|
149
|
+
.option("--approve-above-default", "Also approve a --max-credits above your default Agent run ceiling (`oxygen limits show`: spend_safety_defaults.agent_run_max_total_credits), for this run only.")
|
|
150
|
+
.option("--json", "Print a JSON envelope.")
|
|
151
|
+
.action(async (slug, options) => {
|
|
152
|
+
await handleAsyncAction("agent run", options, () => {
|
|
153
|
+
const maxCredits = readPositiveNumber(options.maxCredits);
|
|
154
|
+
if (maxCredits === undefined)
|
|
155
|
+
throw new OxygenError("invalid_request", "--max-credits must be positive.", { exitCode: 2 });
|
|
156
|
+
return requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/runs`, {
|
|
157
|
+
method: "POST",
|
|
158
|
+
body: {
|
|
159
|
+
...(options.goal ? { goal: options.goal } : {}),
|
|
160
|
+
...(options.inputJson ? { input: parseJsonObject(options.inputJson) } : {}),
|
|
161
|
+
...(options.idempotencyKey ? { idempotency_key: options.idempotencyKey } : {}),
|
|
162
|
+
...(options.threadId ? { thread_id: options.threadId } : {}),
|
|
163
|
+
thread_mode: options.threadMode ?? "isolated",
|
|
164
|
+
...(options.fileIds ? { file_ids: options.fileIds.split(",").map((value) => value.trim()).filter(Boolean) } : {}),
|
|
165
|
+
max_credits: maxCredits,
|
|
166
|
+
approved: options.approved === true,
|
|
167
|
+
...(options.approveAboveDefault ? { approve_above_default: true } : {}),
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}))
|
|
172
|
+
.addCommand(new Command("run-get")
|
|
173
|
+
.description("Inspect one Workspace or custom Agent run and its append-only event ledger.")
|
|
174
|
+
.argument("<slug>", "workspace, or a custom Agent slug from `oxygen agent custom`.")
|
|
175
|
+
.argument("<run-id>", "Agent run id.")
|
|
176
|
+
.option("--after-seq <n>", "Return events after this sequence number.")
|
|
177
|
+
.option("--json", "Print a JSON envelope.")
|
|
178
|
+
.action(async (slug, runId, options) => {
|
|
179
|
+
await handleAsyncAction("agent run get", options, () => {
|
|
180
|
+
const params = new URLSearchParams();
|
|
181
|
+
if (options.afterSeq)
|
|
182
|
+
params.set("after_seq", options.afterSeq);
|
|
183
|
+
const suffix = params.toString() ? `?${params.toString()}` : "";
|
|
184
|
+
return requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}${suffix}`);
|
|
185
|
+
});
|
|
186
|
+
}))
|
|
187
|
+
.addCommand(new Command("cancel")
|
|
188
|
+
.description("Request cancellation of an active Workspace or custom Agent run.")
|
|
189
|
+
.argument("<slug>", "workspace, or a custom Agent slug from `oxygen agent custom`.")
|
|
190
|
+
.argument("<run-id>", "Agent run id.")
|
|
191
|
+
.option("--json", "Print a JSON envelope.")
|
|
192
|
+
.action(async (slug, runId, options) => {
|
|
193
|
+
await handleAsyncAction("agent run cancel", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}/cancel`, { method: "POST" }));
|
|
194
|
+
}))
|
|
195
|
+
.addCommand(new Command("approval-decide")
|
|
196
|
+
.description("Approve or reject one pending Workspace or custom Agent tool call, then resume its durable run.")
|
|
197
|
+
.argument("<slug>", "workspace, or a custom Agent slug from `oxygen agent custom`.")
|
|
198
|
+
.argument("<run-id>", "Agent run id.")
|
|
199
|
+
.argument("<approval-id>", "Approval id from the run event ledger.")
|
|
200
|
+
.requiredOption("--decision <approved|rejected>", "Decision.")
|
|
201
|
+
.option("--json", "Print a JSON envelope.")
|
|
202
|
+
.action(async (slug, runId, approvalId, options) => {
|
|
203
|
+
await handleAsyncAction("agent approval decide", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/runs/${encodeURIComponent(runId)}/approvals/${encodeURIComponent(approvalId)}`, { method: "POST", body: { decision: options.decision } }));
|
|
204
|
+
}))
|
|
205
|
+
.addCommand(new Command("trigger-create")
|
|
206
|
+
.description(`Create a cron, internal event, or signed-webhook trigger for the Workspace Agent. A webhook trigger returns its URL, its secret once, and rate_limit: ${WEBHOOK_TRIGGER_RATE_HELP}.`)
|
|
207
|
+
.argument("<slug>", "Currently: workspace.")
|
|
208
|
+
.requiredOption("--type <cron|event|webhook>", "Trigger type.")
|
|
209
|
+
.requiredOption("--instruction <text>", "Goal template run for each delivery.")
|
|
210
|
+
.option("--cron <expression>", "Five-field cron expression for cron triggers.")
|
|
211
|
+
.option("--timezone <iana>", "IANA timezone. Defaults to UTC.")
|
|
212
|
+
.option("--event-source <source>", "Internal workflow-event source for event triggers.")
|
|
213
|
+
.option("--event-type <event>", "Internal workflow-event type for event triggers.")
|
|
214
|
+
.option("--thread-mode <isolated|persistent>", "Reuse a bounded thread across deliveries. Defaults to isolated.")
|
|
215
|
+
.requiredOption("--max-credits <credits>", "Standing per-delivery credit ceiling.")
|
|
216
|
+
.requiredOption("--approved", "Authorize each trigger delivery up to --max-credits.")
|
|
217
|
+
.option("--approve-above-default", "Also approve a per-delivery --max-credits above your default Agent run ceiling (`oxygen limits show`: spend_safety_defaults.agent_run_max_total_credits), for every delivery of this trigger.")
|
|
218
|
+
.option("--json", "Print a JSON envelope.")
|
|
219
|
+
.action(async (slug, options) => {
|
|
220
|
+
await handleAsyncAction("agent trigger create", options, () => {
|
|
221
|
+
const maxCredits = readPositiveNumber(options.maxCredits);
|
|
222
|
+
if (maxCredits === undefined)
|
|
223
|
+
throw new OxygenError("invalid_request", "--max-credits must be positive.", { exitCode: 2 });
|
|
224
|
+
return requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/triggers`, { method: "POST", body: {
|
|
225
|
+
type: options.type, instruction_template: options.instruction,
|
|
226
|
+
...(options.cron ? { cron_expression: options.cron } : {}),
|
|
227
|
+
...(options.timezone ? { timezone: options.timezone } : {}),
|
|
228
|
+
...(options.eventSource ? { event_source: options.eventSource } : {}),
|
|
229
|
+
...(options.eventType ? { event_type: options.eventType } : {}),
|
|
230
|
+
thread_mode: options.threadMode ?? "isolated",
|
|
231
|
+
max_credits: maxCredits,
|
|
232
|
+
approved: options.approved === true,
|
|
233
|
+
...(options.approveAboveDefault ? { approve_above_default: true } : {}),
|
|
234
|
+
} });
|
|
235
|
+
});
|
|
236
|
+
}))
|
|
237
|
+
.addCommand(new Command("triggers")
|
|
238
|
+
.description("List Workspace Agent cron, internal event, and webhook triggers. A legacy cron held to the plan minimum includes slowed_to_plan_minimum and its next run time.")
|
|
239
|
+
.argument("<slug>", "Currently: workspace.")
|
|
240
|
+
.option("--json", "Print a JSON envelope.")
|
|
241
|
+
.action(async (slug, options) => {
|
|
242
|
+
await handleAsyncAction("agent triggers", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/triggers`));
|
|
243
|
+
}))
|
|
244
|
+
.addCommand(new Command("trigger-set")
|
|
245
|
+
.description("Activate, pause, or archive one Workspace Agent trigger.")
|
|
246
|
+
.argument("<slug>", "Currently: workspace.")
|
|
247
|
+
.argument("<trigger-id>", "Agent trigger id.")
|
|
248
|
+
.requiredOption("--status <active|paused|archived>", "New trigger status.")
|
|
249
|
+
.option("--json", "Print a JSON envelope.")
|
|
250
|
+
.action(async (slug, triggerId, options) => {
|
|
251
|
+
await handleAsyncAction("agent trigger set", options, () => requestOxygen(`/api/cli/agent/${encodeURIComponent(slug)}/triggers/${encodeURIComponent(triggerId)}`, { method: "PATCH", body: { status: options.status } }));
|
|
252
|
+
}))
|
|
253
|
+
.addCommand(new Command("file-create")
|
|
254
|
+
.description("Store a tenant-owned text file for Agent context and sandbox input.")
|
|
255
|
+
.requiredOption("--name <name>", "Workspace filename.")
|
|
256
|
+
.requiredOption("--text <text>", "Inline text content (max 1.5 MB).")
|
|
257
|
+
.option("--mime-type <type>", "MIME type. Defaults to text/plain.")
|
|
258
|
+
.option("--json", "Print a JSON envelope.")
|
|
259
|
+
.action(async (options) => {
|
|
260
|
+
await handleAsyncAction("agent file create", options, () => requestOxygen("/api/cli/agent/files", {
|
|
261
|
+
method: "POST", body: { name: options.name, text: options.text, mime_type: options.mimeType ?? "text/plain" },
|
|
262
|
+
}));
|
|
263
|
+
}))
|
|
264
|
+
.addCommand(new Command("files")
|
|
265
|
+
.description("List tenant-owned Agent context files.")
|
|
266
|
+
.option("--limit <n>", "Maximum files (1-500).")
|
|
267
|
+
.option("--json", "Print a JSON envelope.")
|
|
268
|
+
.action(async (options) => {
|
|
269
|
+
await handleAsyncAction("agent files", options, () => {
|
|
270
|
+
const limit = readPositiveInt(options.limit);
|
|
271
|
+
return requestOxygen(`/api/cli/agent/files${limit ? `?limit=${limit}` : ""}`);
|
|
272
|
+
});
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { readPositiveInt } from "../cli-values.js";
|
|
2
|
+
import { requestOxygen } from "../http-client.js";
|
|
3
|
+
import { readOption } from "../util.js";
|
|
4
|
+
import { OxygenError } from "@oxygen/shared/cli-result";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
function buildApiKeyCreateBody(options) {
|
|
7
|
+
const body = {};
|
|
8
|
+
const name = readOption(options.name);
|
|
9
|
+
if (name)
|
|
10
|
+
body.name = name;
|
|
11
|
+
const expiresAt = resolveApiKeyExpiresAt(options);
|
|
12
|
+
if (expiresAt)
|
|
13
|
+
body.expires_at = expiresAt;
|
|
14
|
+
return body;
|
|
15
|
+
}
|
|
16
|
+
function resolveApiKeyExpiresAt(options) {
|
|
17
|
+
const expiresAt = readOption(options.expiresAt);
|
|
18
|
+
const expiresInDays = readOption(options.expiresInDays);
|
|
19
|
+
if (expiresAt && expiresInDays) {
|
|
20
|
+
throw new OxygenError("conflicting_flags", "Pass either --expires-at or --expires-in-days, not both.", {
|
|
21
|
+
exitCode: 1,
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
if (expiresAt) {
|
|
25
|
+
const date = new Date(expiresAt);
|
|
26
|
+
if (!Number.isFinite(date.getTime())) {
|
|
27
|
+
throw new OxygenError("invalid_expires_at", "--expires-at must be a valid ISO 8601 timestamp.", {
|
|
28
|
+
details: { expires_at: expiresAt },
|
|
29
|
+
exitCode: 1,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return date.toISOString();
|
|
33
|
+
}
|
|
34
|
+
if (expiresInDays) {
|
|
35
|
+
const days = readPositiveInt(expiresInDays);
|
|
36
|
+
if (!days) {
|
|
37
|
+
throw new OxygenError("invalid_number", "--expires-in-days must be a positive integer.", {
|
|
38
|
+
details: { value: expiresInDays },
|
|
39
|
+
exitCode: 1,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return new Date(Date.now() + days * 24 * 60 * 60 * 1000).toISOString();
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
export function registerApiKeysFamily(program, handleAsyncAction) {
|
|
47
|
+
program
|
|
48
|
+
.command("api-keys")
|
|
49
|
+
.description("Manage Oxygen CLI API keys for the current organization.")
|
|
50
|
+
.addCommand(new Command("list")
|
|
51
|
+
.description("List active CLI API keys for the current user and organization.")
|
|
52
|
+
.option("--json", "Print a JSON envelope.")
|
|
53
|
+
.action(async (options) => {
|
|
54
|
+
await handleAsyncAction("api-keys list", options, () => requestOxygen("/api/cli/api-keys"));
|
|
55
|
+
}))
|
|
56
|
+
.addCommand(new Command("create")
|
|
57
|
+
.description("Create a CLI API key. The token is shown once.")
|
|
58
|
+
.option("--name <name>", "Key name. Defaults to 'CLI key'.")
|
|
59
|
+
.option("--expires-at <iso>", "Expiration timestamp as ISO 8601.")
|
|
60
|
+
.option("--expires-in-days <days>", "Expire the key after this many days.")
|
|
61
|
+
.option("--json", "Print a JSON envelope.")
|
|
62
|
+
.action(async (options) => {
|
|
63
|
+
await handleAsyncAction("api-keys create", options, () => requestOxygen("/api/cli/api-keys", {
|
|
64
|
+
method: "POST",
|
|
65
|
+
body: buildApiKeyCreateBody(options),
|
|
66
|
+
}));
|
|
67
|
+
}))
|
|
68
|
+
.addCommand(new Command("revoke")
|
|
69
|
+
.description("Revoke a CLI API key for the current user and organization.")
|
|
70
|
+
.argument("<key-id>", "CLI API key id.")
|
|
71
|
+
.option("--json", "Print a JSON envelope.")
|
|
72
|
+
.action(async (keyId, options) => {
|
|
73
|
+
await handleAsyncAction("api-keys revoke", options, () => requestOxygen(`/api/cli/api-keys/${encodeURIComponent(keyId)}`, {
|
|
74
|
+
method: "DELETE",
|
|
75
|
+
}));
|
|
76
|
+
}));
|
|
77
|
+
}
|