@oxygen-agent/cli 1.1014.135 → 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.
Files changed (292) hide show
  1. package/README.md +1 -1
  2. package/dist/admin-primary-providers-render.js +27 -19
  3. package/dist/cli-output.d.ts +12 -0
  4. package/dist/cli-output.js +395 -0
  5. package/dist/cli-paths.d.ts +1 -0
  6. package/dist/cli-paths.js +3 -0
  7. package/dist/cli-profile-context.d.ts +3 -0
  8. package/dist/cli-profile-context.js +13 -0
  9. package/dist/command-manifest.d.ts +15 -0
  10. package/dist/command-manifest.js +23 -1
  11. package/dist/command-support.d.ts +438 -0
  12. package/dist/command-support.js +1610 -0
  13. package/dist/commands/action-column.d.ts +3 -0
  14. package/dist/commands/action-column.js +43 -0
  15. package/dist/commands/activation.d.ts +3 -0
  16. package/dist/commands/activation.js +24 -0
  17. package/dist/commands/admin.d.ts +3 -0
  18. package/dist/commands/admin.js +347 -0
  19. package/dist/commands/ads.d.ts +3 -0
  20. package/dist/commands/ads.js +62 -0
  21. package/dist/commands/agent.d.ts +3 -0
  22. package/dist/commands/agent.js +274 -0
  23. package/dist/commands/api-keys.d.ts +3 -0
  24. package/dist/commands/api-keys.js +77 -0
  25. package/dist/commands/approvals.d.ts +3 -0
  26. package/dist/commands/approvals.js +518 -0
  27. package/dist/commands/auth.d.ts +3 -0
  28. package/dist/commands/auth.js +230 -0
  29. package/dist/commands/billing.d.ts +3 -0
  30. package/dist/commands/billing.js +357 -0
  31. package/dist/commands/blueprints.d.ts +3 -0
  32. package/dist/commands/blueprints.js +312 -0
  33. package/dist/commands/budget.d.ts +3 -0
  34. package/dist/commands/budget.js +55 -0
  35. package/dist/commands/callables.d.ts +3 -0
  36. package/dist/commands/callables.js +111 -0
  37. package/dist/commands/capabilities.d.ts +3 -0
  38. package/dist/commands/capabilities.js +44 -0
  39. package/dist/commands/cells.d.ts +3 -0
  40. package/dist/commands/cells.js +94 -0
  41. package/dist/commands/columns.d.ts +3 -0
  42. package/dist/commands/columns.js +1628 -0
  43. package/dist/commands/commands.d.ts +3 -0
  44. package/dist/commands/commands.js +45 -0
  45. package/dist/commands/comments.d.ts +3 -0
  46. package/dist/commands/comments.js +188 -0
  47. package/dist/commands/companies.d.ts +3 -0
  48. package/dist/commands/companies.js +312 -0
  49. package/dist/commands/connections.d.ts +3 -0
  50. package/dist/commands/connections.js +39 -0
  51. package/dist/commands/context.d.ts +3 -0
  52. package/dist/commands/context.js +170 -0
  53. package/dist/commands/copilot.d.ts +3 -0
  54. package/dist/commands/copilot.js +565 -0
  55. package/dist/commands/crm.d.ts +3 -0
  56. package/dist/commands/crm.js +1669 -0
  57. package/dist/commands/custom-integrations.d.ts +3 -0
  58. package/dist/commands/custom-integrations.js +140 -0
  59. package/dist/commands/dashboards.d.ts +3 -0
  60. package/dist/commands/dashboards.js +240 -0
  61. package/dist/commands/db.d.ts +3 -0
  62. package/dist/commands/db.js +190 -0
  63. package/dist/commands/deliverability.d.ts +3 -0
  64. package/dist/commands/deliverability.js +90 -0
  65. package/dist/commands/directory.d.ts +3 -0
  66. package/dist/commands/directory.js +101 -0
  67. package/dist/commands/domains.d.ts +3 -0
  68. package/dist/commands/domains.js +604 -0
  69. package/dist/commands/egress.d.ts +3 -0
  70. package/dist/commands/egress.js +130 -0
  71. package/dist/commands/email.d.ts +3 -0
  72. package/dist/commands/email.js +49 -0
  73. package/dist/commands/engagement.d.ts +3 -0
  74. package/dist/commands/engagement.js +189 -0
  75. package/dist/commands/enrich-column.d.ts +3 -0
  76. package/dist/commands/enrich-column.js +149 -0
  77. package/dist/commands/enrichment.d.ts +3 -0
  78. package/dist/commands/enrichment.js +49 -0
  79. package/dist/commands/feedback.d.ts +3 -0
  80. package/dist/commands/feedback.js +96 -0
  81. package/dist/commands/feeds.d.ts +3 -0
  82. package/dist/commands/feeds.js +486 -0
  83. package/dist/commands/find.d.ts +3 -0
  84. package/dist/commands/find.js +159 -0
  85. package/dist/commands/followers.d.ts +3 -0
  86. package/dist/commands/followers.js +39 -0
  87. package/dist/commands/formulas.d.ts +3 -0
  88. package/dist/commands/formulas.js +43 -0
  89. package/dist/commands/home.d.ts +3 -0
  90. package/dist/commands/home.js +22 -0
  91. package/dist/commands/inbox.d.ts +3 -0
  92. package/dist/commands/inbox.js +779 -0
  93. package/dist/commands/integrations.d.ts +3 -0
  94. package/dist/commands/integrations.js +290 -0
  95. package/dist/commands/knowledge.d.ts +3 -0
  96. package/dist/commands/knowledge.js +874 -0
  97. package/dist/commands/lead-sourcing.d.ts +3 -0
  98. package/dist/commands/lead-sourcing.js +52 -0
  99. package/dist/commands/limits.d.ts +3 -0
  100. package/dist/commands/limits.js +54 -0
  101. package/dist/commands/linkedin.d.ts +3 -0
  102. package/dist/commands/linkedin.js +275 -0
  103. package/dist/commands/login.d.ts +3 -0
  104. package/dist/commands/login.js +347 -0
  105. package/dist/commands/logout.d.ts +3 -0
  106. package/dist/commands/logout.js +12 -0
  107. package/dist/commands/mailboxes.d.ts +3 -0
  108. package/dist/commands/mailboxes.js +1290 -0
  109. package/dist/commands/managed-inboxes.d.ts +3 -0
  110. package/dist/commands/managed-inboxes.js +361 -0
  111. package/dist/commands/messages.d.ts +3 -0
  112. package/dist/commands/messages.js +78 -0
  113. package/dist/commands/notetaker.d.ts +3 -0
  114. package/dist/commands/notetaker.js +79 -0
  115. package/dist/commands/observability.d.ts +3 -0
  116. package/dist/commands/observability.js +125 -0
  117. package/dist/commands/orgs.d.ts +3 -0
  118. package/dist/commands/orgs.js +237 -0
  119. package/dist/commands/people.d.ts +3 -0
  120. package/dist/commands/people.js +353 -0
  121. package/dist/commands/posts.d.ts +3 -0
  122. package/dist/commands/posts.js +139 -0
  123. package/dist/commands/profiles.d.ts +3 -0
  124. package/dist/commands/profiles.js +250 -0
  125. package/dist/commands/projects.d.ts +3 -0
  126. package/dist/commands/projects.js +94 -0
  127. package/dist/commands/prompts.d.ts +3 -0
  128. package/dist/commands/prompts.js +84 -0
  129. package/dist/commands/publishing.d.ts +3 -0
  130. package/dist/commands/publishing.js +1419 -0
  131. package/dist/commands/recipes.d.ts +3 -0
  132. package/dist/commands/recipes.js +120 -0
  133. package/dist/commands/reviews.d.ts +3 -0
  134. package/dist/commands/reviews.js +75 -0
  135. package/dist/commands/rows.d.ts +3 -0
  136. package/dist/commands/rows.js +27 -0
  137. package/dist/commands/runs.d.ts +3 -0
  138. package/dist/commands/runs.js +37 -0
  139. package/dist/commands/search.d.ts +3 -0
  140. package/dist/commands/search.js +182 -0
  141. package/dist/commands/senders.d.ts +3 -0
  142. package/dist/commands/senders.js +393 -0
  143. package/dist/commands/sequences.d.ts +3 -0
  144. package/dist/commands/sequences.js +2322 -0
  145. package/dist/commands/session.d.ts +3 -0
  146. package/dist/commands/session.js +109 -0
  147. package/dist/commands/signals.d.ts +3 -0
  148. package/dist/commands/signals.js +289 -0
  149. package/dist/commands/signup-leads.d.ts +3 -0
  150. package/dist/commands/signup-leads.js +46 -0
  151. package/dist/commands/skills.d.ts +3 -0
  152. package/dist/commands/skills.js +50 -0
  153. package/dist/commands/sourcing.d.ts +3 -0
  154. package/dist/commands/sourcing.js +27 -0
  155. package/dist/commands/status.d.ts +3 -0
  156. package/dist/commands/status.js +51 -0
  157. package/dist/commands/supabase.d.ts +3 -0
  158. package/dist/commands/supabase.js +128 -0
  159. package/dist/commands/support.d.ts +3 -0
  160. package/dist/commands/support.js +651 -0
  161. package/dist/commands/suppressions.d.ts +3 -0
  162. package/dist/commands/suppressions.js +577 -0
  163. package/dist/commands/table-ingestions.d.ts +3 -0
  164. package/dist/commands/table-ingestions.js +145 -0
  165. package/dist/commands/table-runs.d.ts +3 -0
  166. package/dist/commands/table-runs.js +277 -0
  167. package/dist/commands/tables.d.ts +3 -0
  168. package/dist/commands/tables.js +3492 -0
  169. package/dist/commands/tags.d.ts +3 -0
  170. package/dist/commands/tags.js +147 -0
  171. package/dist/commands/tools.d.ts +3 -0
  172. package/dist/commands/tools.js +246 -0
  173. package/dist/commands/update.d.ts +3 -0
  174. package/dist/commands/update.js +106 -0
  175. package/dist/commands/verify.d.ts +3 -0
  176. package/dist/commands/verify.js +27 -0
  177. package/dist/commands/viewers.d.ts +3 -0
  178. package/dist/commands/viewers.js +72 -0
  179. package/dist/commands/voice.d.ts +3 -0
  180. package/dist/commands/voice.js +351 -0
  181. package/dist/commands/whatsapp.d.ts +3 -0
  182. package/dist/commands/whatsapp.js +226 -0
  183. package/dist/commands/whoami.d.ts +3 -0
  184. package/dist/commands/whoami.js +110 -0
  185. package/dist/commands/worker.d.ts +3 -0
  186. package/dist/commands/worker.js +60 -0
  187. package/dist/commands/workflows.d.ts +3 -0
  188. package/dist/commands/workflows.js +1752 -0
  189. package/dist/commands/workspace.d.ts +3 -0
  190. package/dist/commands/workspace.js +94 -0
  191. package/dist/compact-list-flags.d.ts +7 -0
  192. package/dist/compact-list-flags.js +12 -0
  193. package/dist/crm-support-flags.js +14 -5
  194. package/dist/customer-operation-commands.js +8 -6
  195. package/dist/diagnostic-uploader.d.ts +3 -1
  196. package/dist/diagnostic-uploader.js +29 -8
  197. package/dist/help.d.ts +5 -0
  198. package/dist/help.js +22 -0
  199. package/dist/index.d.ts +98 -1
  200. package/dist/index.js +331 -30719
  201. package/dist/local-module-loader.d.ts +4 -0
  202. package/dist/local-module-loader.js +156 -0
  203. package/dist/visual-commands.js +9 -5
  204. package/node_modules/@oxygen/cli-ugc/dist/commands.js +2 -2
  205. package/node_modules/@oxygen/shared/dist/agent-session-schedule.d.ts +36 -0
  206. package/node_modules/@oxygen/shared/dist/agent-session-schedule.js +69 -0
  207. package/node_modules/@oxygen/shared/dist/agent-sessions.d.ts +14 -5
  208. package/node_modules/@oxygen/shared/dist/agent-sessions.js +14 -3
  209. package/node_modules/@oxygen/shared/dist/capability-discovery.js +175 -14
  210. package/node_modules/@oxygen/shared/dist/compact-list-result.d.ts +6 -0
  211. package/node_modules/@oxygen/shared/dist/compact-list-result.js +27 -0
  212. package/node_modules/@oxygen/shared/dist/contracts/agent-sessions.d.ts +12 -1
  213. package/node_modules/@oxygen/shared/dist/contracts/agent-sessions.js +5 -2
  214. package/node_modules/@oxygen/shared/dist/contracts/browser-operations.js +4 -2
  215. package/node_modules/@oxygen/shared/dist/contracts/compact-list-reads.d.ts +57 -0
  216. package/node_modules/@oxygen/shared/dist/contracts/compact-list-reads.js +23 -0
  217. package/node_modules/@oxygen/shared/dist/contracts/crm-support.d.ts +52 -0
  218. package/node_modules/@oxygen/shared/dist/contracts/crm-support.js +43 -2
  219. package/node_modules/@oxygen/shared/dist/contracts/customer-operations.js +17 -14
  220. package/node_modules/@oxygen/shared/dist/contracts/knowledge-content-reads.js +1 -1
  221. package/node_modules/@oxygen/shared/dist/contracts/knowledge-proposal-reads.d.ts +49 -0
  222. package/node_modules/@oxygen/shared/dist/contracts/knowledge-proposal-reads.js +14 -0
  223. package/node_modules/@oxygen/shared/dist/contracts/knowledge-sync.js +1 -1
  224. package/node_modules/@oxygen/shared/dist/contracts/limits-read.js +60 -7
  225. package/node_modules/@oxygen/shared/dist/contracts/operations.d.ts +9 -1
  226. package/node_modules/@oxygen/shared/dist/contracts/operations.js +13 -5
  227. package/node_modules/@oxygen/shared/dist/contracts/publishing-reads.js +1 -1
  228. package/node_modules/@oxygen/shared/dist/contracts/teammates.d.ts +16 -0
  229. package/node_modules/@oxygen/shared/dist/contracts/teammates.js +115 -0
  230. package/node_modules/@oxygen/shared/dist/cost-estimate-view.js +21 -3
  231. package/node_modules/@oxygen/shared/dist/cost-estimate.d.ts +31 -1
  232. package/node_modules/@oxygen/shared/dist/cost-estimate.js +56 -15
  233. package/node_modules/@oxygen/shared/dist/diagnostic-credentials.d.ts +2 -0
  234. package/node_modules/@oxygen/shared/dist/diagnostic-credentials.js +2 -0
  235. package/node_modules/@oxygen/shared/dist/diagnostic-lock.js +71 -44
  236. package/node_modules/@oxygen/shared/dist/diagnostic-spool.d.ts +18 -0
  237. package/node_modules/@oxygen/shared/dist/diagnostic-spool.js +348 -0
  238. package/node_modules/@oxygen/shared/dist/diagnostic-storage-failure.d.ts +10 -0
  239. package/node_modules/@oxygen/shared/dist/diagnostic-storage-failure.js +42 -0
  240. package/node_modules/@oxygen/shared/dist/diagnostic-storage.d.ts +1 -1
  241. package/node_modules/@oxygen/shared/dist/diagnostic-storage.js +59 -213
  242. package/node_modules/@oxygen/shared/dist/diagnostics.js +3 -2
  243. package/node_modules/@oxygen/shared/dist/email-dsn.d.ts +16 -5
  244. package/node_modules/@oxygen/shared/dist/email-dsn.js +97 -1
  245. package/node_modules/@oxygen/shared/dist/emailguard-placement-probe.js +5 -0
  246. package/node_modules/@oxygen/shared/dist/enrichment-intents.js +4 -5
  247. package/node_modules/@oxygen/shared/dist/file-import.js +5 -2
  248. package/node_modules/@oxygen/shared/dist/hosted-ai.d.ts +30 -0
  249. package/node_modules/@oxygen/shared/dist/hosted-ai.js +20 -0
  250. package/node_modules/@oxygen/shared/dist/knowledge-bootstrap.d.ts +6 -2
  251. package/node_modules/@oxygen/shared/dist/knowledge-seed-content.d.ts +17 -7
  252. package/node_modules/@oxygen/shared/dist/knowledge-seed-content.js +81 -17
  253. package/node_modules/@oxygen/shared/dist/langfuse.js +8 -4
  254. package/node_modules/@oxygen/shared/dist/mailbox-egress-ownership.d.ts +1 -1
  255. package/node_modules/@oxygen/shared/dist/mailbox-import.d.ts +6 -3
  256. package/node_modules/@oxygen/shared/dist/mailbox-import.js +9 -9
  257. package/node_modules/@oxygen/shared/dist/mcp-server-info.d.ts +8 -0
  258. package/node_modules/@oxygen/shared/dist/mcp-server-info.js +10 -0
  259. package/node_modules/@oxygen/shared/dist/object-storage.d.ts +10 -0
  260. package/node_modules/@oxygen/shared/dist/object-storage.js +14 -0
  261. package/node_modules/@oxygen/shared/dist/plan-limits-view.d.ts +5 -0
  262. package/node_modules/@oxygen/shared/dist/plan-limits-view.js +17 -1
  263. package/node_modules/@oxygen/shared/dist/pricing-sheet.d.ts +1 -1
  264. package/node_modules/@oxygen/shared/dist/pricing-sheet.js +1 -1
  265. package/node_modules/@oxygen/shared/dist/provider-selection.d.ts +15 -0
  266. package/node_modules/@oxygen/shared/dist/provider-selection.js +3 -0
  267. package/node_modules/@oxygen/shared/dist/repricing.d.ts +1 -1
  268. package/node_modules/@oxygen/shared/dist/repricing.js +2 -2
  269. package/node_modules/@oxygen/shared/dist/schedule-label.d.ts +6 -0
  270. package/node_modules/@oxygen/shared/dist/schedule-label.js +12 -0
  271. package/node_modules/@oxygen/shared/dist/sequence-failures.d.ts +1 -0
  272. package/node_modules/@oxygen/shared/dist/sequence-failures.js +20 -6
  273. package/node_modules/@oxygen/shared/dist/teammate-groups.d.ts +55 -0
  274. package/node_modules/@oxygen/shared/dist/teammate-groups.js +74 -0
  275. package/node_modules/@oxygen/shared/dist/teammate-messages.d.ts +52 -0
  276. package/node_modules/@oxygen/shared/dist/teammate-messages.js +88 -0
  277. package/node_modules/@oxygen/shared/dist/teammate-notes.d.ts +58 -0
  278. package/node_modules/@oxygen/shared/dist/teammate-notes.js +73 -0
  279. package/node_modules/@oxygen/shared/dist/teammate-routines.d.ts +95 -0
  280. package/node_modules/@oxygen/shared/dist/teammate-routines.js +266 -0
  281. package/node_modules/@oxygen/shared/dist/teammate-tasks.d.ts +56 -0
  282. package/node_modules/@oxygen/shared/dist/teammate-tasks.js +114 -0
  283. package/node_modules/@oxygen/shared/dist/teammates.d.ts +78 -0
  284. package/node_modules/@oxygen/shared/dist/teammates.js +140 -0
  285. package/node_modules/@oxygen/shared/dist/user-capability-routing.js +120 -0
  286. package/node_modules/@oxygen/shared/dist/version.generated.d.ts +1 -1
  287. package/node_modules/@oxygen/shared/dist/version.generated.js +1 -1
  288. package/node_modules/@oxygen/shared/dist/visual-render.d.ts +9 -1
  289. package/node_modules/@oxygen/shared/dist/visual-render.js +12 -5
  290. package/node_modules/@oxygen/shared/dist/warmup-metrics.d.ts +5 -0
  291. package/node_modules/@oxygen/shared/dist/warmup-metrics.js +44 -0
  292. package/package.json +1 -1
@@ -0,0 +1,3 @@
1
+ import { ExtractedCommandActionHandler } from "../command-support.js";
2
+ import { Command } from "commander";
3
+ export declare function registerIntegrationsFamily(program: Command, handleAsyncAction: ExtractedCommandActionHandler): void;
@@ -0,0 +1,290 @@
1
+ import { assertModeFlagsExclusive, parseJsonObject } from "../cli-values.js";
2
+ import { collectRepeatable, parseJsonValue, readPositiveNumber } from "../command-support.js";
3
+ import { addContractFlags, readContractFlags } from "../contract-flags.js";
4
+ import { requestOxygen } from "../http-client.js";
5
+ import { readOption } from "../util.js";
6
+ import { OxygenError } from "@oxygen/shared/cli-result";
7
+ import { INTEGRATION_CONNECT_ACCOUNT_CONTRACT } from "@oxygen/shared/contracts/integration-connect";
8
+ import { Command, Option } from "commander";
9
+ function resolveComposioRunMode(options) {
10
+ assertModeFlagsExclusive(options);
11
+ if (options.live === true)
12
+ return "live";
13
+ if (options.dryRun === true)
14
+ return "dry_run";
15
+ const raw = readOption(options.mode);
16
+ if (raw) {
17
+ const normalized = raw.trim().toLowerCase().replace("-", "_");
18
+ if (normalized === "live" || normalized === "dry_run")
19
+ return normalized;
20
+ throw new OxygenError("invalid_mode", "--mode must be 'live' or 'dry_run'.", { details: { mode: raw }, exitCode: 1 });
21
+ }
22
+ return "dry_run";
23
+ }
24
+ function readNamedCredentials(entries) {
25
+ if (!entries || entries.length === 0)
26
+ return undefined;
27
+ const credentials = {};
28
+ for (const entry of entries) {
29
+ const separator = entry.indexOf("=");
30
+ if (separator <= 0) {
31
+ throw new Error("--credential must use name=value (for example, --credential subdomain=us).");
32
+ }
33
+ const name = entry.slice(0, separator).trim();
34
+ const value = entry.slice(separator + 1).trim();
35
+ if (!/^[A-Za-z][A-Za-z0-9_.-]{0,99}$/.test(name)) {
36
+ throw new Error("--credential has an invalid field name.");
37
+ }
38
+ if (!value) {
39
+ throw new Error(`--credential ${name}= requires a non-empty value.`);
40
+ }
41
+ if (Object.hasOwn(credentials, name)) {
42
+ throw new Error(`--credential field '${name}' was provided more than once.`);
43
+ }
44
+ credentials[name] = value;
45
+ }
46
+ return credentials;
47
+ }
48
+ export function registerIntegrationsFamily(program, handleAsyncAction) {
49
+ program
50
+ .command("integrations")
51
+ .description("Connect third-party tools such as PostHog, Slack, and HubSpot, and manage raw provider-webhook subscriptions. Start with `integrations list` to confirm any provider is supported, see its auth mode, and distinguish free connection setup from per-action credit estimates. Trigger-ready workspace events live under `workflows events list`. Local mailbox exports use `mailboxes import`, not this group.")
52
+ .addCommand(new Command("events")
53
+ .description("Inspect raw provider event definitions and manage subscriptions that feed workflows; use `workflows events list` for the trigger-ready workspace catalog.")
54
+ .addCommand(new Command("list")
55
+ .description("List raw provider event definitions and this org's enabled subscriptions. To choose a workflow trigger, use `oxygen workflows events list`.")
56
+ .option("--source <source>", "Filter by event source, such as hubspot or composio.gmail.")
57
+ .option("--event <event>", "Filter by event type, such as contact.created.")
58
+ .option("--toolkit <id>", "Filter by toolkit / integration id, such as gmail.")
59
+ .option("--json", "Print a JSON envelope.")
60
+ .action(async (options) => {
61
+ await handleAsyncAction("integrations events list", options, () => {
62
+ const query = new URLSearchParams();
63
+ if (readOption(options.source))
64
+ query.set("source", readOption(options.source) ?? "");
65
+ if (readOption(options.event))
66
+ query.set("event", readOption(options.event) ?? "");
67
+ if (readOption(options.toolkit))
68
+ query.set("toolkit", readOption(options.toolkit) ?? "");
69
+ const suffix = query.toString() ? `?${query.toString()}` : "";
70
+ return requestOxygen(`/api/cli/integrations/events${suffix}`);
71
+ });
72
+ }))
73
+ .addCommand(new Command("enable")
74
+ .description("Enable a provider event for a connected integration account.")
75
+ .requiredOption("--source <source>", "Event source, such as hubspot or composio.gmail.")
76
+ .requiredOption("--event <event>", "Event type, such as contact.created.")
77
+ .option("--connection-id <connection_id>", "Specific integration connection id. Defaults to the active default connection.")
78
+ .option("--trigger-config <json>", "JSON object passed to the provider when registering the trigger (Composio triggers only).")
79
+ .option("--json", "Print a JSON envelope.")
80
+ .action(async (options) => {
81
+ await handleAsyncAction("integrations events enable", options, () => {
82
+ const triggerConfigRaw = readOption(options.triggerConfig);
83
+ let triggerConfig;
84
+ if (triggerConfigRaw) {
85
+ const parsed = parseJsonValue(triggerConfigRaw, "--trigger-config");
86
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
87
+ throw new OxygenError("invalid_request", "--trigger-config must be a JSON object.", {
88
+ exitCode: 1,
89
+ });
90
+ }
91
+ triggerConfig = parsed;
92
+ }
93
+ return requestOxygen("/api/cli/integrations/events/enable", {
94
+ method: "POST",
95
+ body: {
96
+ source: readOption(options.source),
97
+ event: readOption(options.event),
98
+ ...(readOption(options.connectionId) ? { connection_id: readOption(options.connectionId) } : {}),
99
+ ...(triggerConfig ? { trigger_config: triggerConfig } : {}),
100
+ },
101
+ });
102
+ });
103
+ }))
104
+ .addCommand(new Command("disable")
105
+ .description("Disable a provider event for a connected integration account.")
106
+ .requiredOption("--source <source>", "Event source, such as hubspot.")
107
+ .requiredOption("--event <event>", "Event type, such as contact.created.")
108
+ .option("--connection-id <connection_id>", "Specific integration connection id. Defaults to the active default connection.")
109
+ .option("--json", "Print a JSON envelope.")
110
+ .action(async (options) => {
111
+ await handleAsyncAction("integrations events disable", options, () => requestOxygen("/api/cli/integrations/events/disable", {
112
+ method: "POST",
113
+ body: {
114
+ source: readOption(options.source),
115
+ event: readOption(options.event),
116
+ ...(readOption(options.connectionId) ? { connection_id: readOption(options.connectionId) } : {}),
117
+ },
118
+ }));
119
+ }))
120
+ .addCommand(new Command("deliveries")
121
+ .description("List recent provider webhook deliveries (Composio triggers, HubSpot webhooks, etc.) and the workflow runs they kicked off.")
122
+ .option("--source <source>", "Filter by event source, such as hubspot or composio.gmail.")
123
+ .option("--event <event>", "Filter by event type, such as contact.created or GMAIL_NEW_GMAIL_MESSAGE.")
124
+ .option("--toolkit <id>", "Filter by integration/toolkit id, such as gmail or hubspot.")
125
+ .option("--connection-id <connection_id>", "Filter by a specific integration connection id.")
126
+ .option("--result <result>", "Filter by delivery result: success or error.")
127
+ .option("--limit <n>", "Maximum deliveries to return (1-200). Defaults to 50.")
128
+ .option("--json", "Print a JSON envelope.")
129
+ .action(async (options) => {
130
+ await handleAsyncAction("integrations events deliveries", options, () => {
131
+ const query = new URLSearchParams();
132
+ const set = (key, value) => {
133
+ const trimmed = readOption(value);
134
+ if (trimmed)
135
+ query.set(key, trimmed);
136
+ };
137
+ set("source", options.source);
138
+ set("event", options.event);
139
+ set("toolkit", options.toolkit);
140
+ set("connection_id", options.connectionId);
141
+ set("result", options.result);
142
+ set("limit", options.limit);
143
+ const suffix = query.toString() ? `?${query.toString()}` : "";
144
+ return requestOxygen(`/api/cli/integrations/events/deliveries${suffix}`);
145
+ });
146
+ })))
147
+ .addCommand(new Command("list")
148
+ .description("List supported integrations and this org's connections. Add --integration <id> to read one integration and its connection state.")
149
+ .option("--integration <id>", "Return only this integration and its connections, such as hubspot.")
150
+ .option("--json", "Print a JSON envelope.")
151
+ .action(async (options) => {
152
+ await handleAsyncAction("integrations list", options, () => {
153
+ const integration = readOption(options.integration)?.trim();
154
+ return requestOxygen(`/api/cli/integrations/composio/list${integration ? `?integration=${encodeURIComponent(integration)}` : ""}`);
155
+ });
156
+ }))
157
+ .addCommand(addContractFlags(new Command("connect")
158
+ .description("Connect an integration. For OAuth toolkits, running this command immediately creates a pending provider authorization and returns a redirect URL; account access starts only if you approve on the provider's page. This is not a price preview. On a repriced workspace, a connected X account reserves 1,000 credits ($10) monthly; inspect current connection prices and first billing timing with `oxygen billing commitments --view connection-prices --json` before connecting. API-key integrations accept --api-key. Run without credentials only for an API-key integration to get a 0-credit preview of its exact fields (mode: needs_api_key): no credential is submitted, nothing is stored, and no provider call is made. Use repeatable --credential name=value when a provider also requires a host, subdomain, or other named value. To keep a secret out of shell history and process arguments, open the preview's web_url and submit it in Connections; --api-key is for controlled noninteractive use. Credential submission creates or replaces the connection immediately and needs no separate --approved flag. LinkedIn and WhatsApp return a hosted sign-in link instead (`oxygen senders connect` / `oxygen whatsapp connect` are the canonical paths).")
159
+ .argument("<integration_id>", "Integration id, such as 'slack' or 'serpapi'.")
160
+ .option("--api-key <value>", "API key for controlled noninteractive use. Literal values can appear in shell history and process arguments; prefer the preview web_url for manual entry.")
161
+ .option("--credential <name=value>", "Named provider credential field. Repeat for multi-field integrations (for example, PostHog: --credential subdomain=us).", collectRepeatable, [])
162
+ .option("--country <code>", "ISO 3166-1 alpha-2 country where the LinkedIn account owner normally signs in (required for `connect linkedin`; picks the egress proxy from the 56 countries OXYGEN has LinkedIn proxies in).")
163
+ .option("--pairing-phone-number <e164>", "WhatsApp only: pair by code sent to this E.164 number instead of showing a QR.")
164
+ .addOption(new Option("--acknowledge-risk", "Deprecated: LinkedIn connect no longer needs it. Still accepted so older scripts keep running.").hideHelp())
165
+ .option("--return-to <path>", "In-product destination after OAuth approval.")
166
+ .option("--json", "Print a JSON envelope."), INTEGRATION_CONNECT_ACCOUNT_CONTRACT, {
167
+ account_id: {
168
+ valueName: "<id>",
169
+ help: "Provider account id for integrations that span multiple accounts (e.g. Cloudflare when the token can access more than one account).",
170
+ },
171
+ })
172
+ .action(async (integrationId, options) => {
173
+ await handleAsyncAction("integrations connect", options, () => {
174
+ const apiKey = readOption(options.apiKey)?.trim();
175
+ const credentials = readNamedCredentials(options.credential);
176
+ const country = readOption(options.country)?.trim();
177
+ const pairingPhoneNumber = readOption(options.pairingPhoneNumber)?.trim();
178
+ return requestOxygen("/api/cli/integrations/connect", {
179
+ method: "POST",
180
+ body: {
181
+ integration_id: integrationId,
182
+ ...(apiKey ? { api_key: apiKey } : {}),
183
+ ...(credentials ? { credentials } : {}),
184
+ ...readContractFlags(options, INTEGRATION_CONNECT_ACCOUNT_CONTRACT),
185
+ ...(readOption(options.returnTo) ? { return_to: readOption(options.returnTo) } : {}),
186
+ ...(country ? { country } : {}),
187
+ ...(pairingPhoneNumber ? { pairing_phone_number: pairingPhoneNumber } : {}),
188
+ ...(options.acknowledgeRisk ? { acknowledge_linkedin_risk: true } : {}),
189
+ },
190
+ });
191
+ });
192
+ }))
193
+ .addCommand(new Command("test")
194
+ .description("Re-validate a stored integration API key against the provider and heal the connection when it passes (recovers benched or scope-degraded connections without re-pasting the key).")
195
+ .argument("<integration_id>", "Integration id, such as 'instantly'.")
196
+ .option("--connection-id <id>", "Test a specific connected account when multiple exist.")
197
+ .option("--json", "Print a JSON envelope.")
198
+ .action(async (integrationId, options) => {
199
+ const connectionId = readOption(options.connectionId)?.trim();
200
+ await handleAsyncAction("integrations test", options, () => requestOxygen("/api/cli/integrations/test", {
201
+ method: "POST",
202
+ body: {
203
+ integration_id: integrationId,
204
+ ...(connectionId ? { connection_id: connectionId } : {}),
205
+ },
206
+ }));
207
+ }))
208
+ .addCommand(new Command("disconnect")
209
+ .description("Disconnect an integration. LinkedIn and WhatsApp remove the connected account; pass --connection-id when more than one is connected.")
210
+ .argument("<integration_id>", "Integration id, such as 'slack'.")
211
+ .option("--connection-id <id>", "Disconnect a specific connected account when multiple exist.")
212
+ .option("--json", "Print a JSON envelope.")
213
+ .action(async (integrationId, options) => {
214
+ const connectionId = readOption(options.connectionId)?.trim();
215
+ await handleAsyncAction("integrations disconnect", options, () => requestOxygen("/api/cli/integrations/disconnect", {
216
+ method: "POST",
217
+ body: {
218
+ integration_id: integrationId,
219
+ ...(connectionId ? { connection_id: connectionId } : {}),
220
+ },
221
+ }));
222
+ }))
223
+ .addCommand(new Command("actions")
224
+ .description("List actions available for a connected integration — Composio toolkits and native providers (e.g. Instantly) alike.")
225
+ .argument("<integration_id>", "Integration id, such as 'slack'.")
226
+ .option("--json", "Print a JSON envelope.")
227
+ .action(async (integrationId, options) => {
228
+ await handleAsyncAction("integrations actions", options, () => {
229
+ const params = new URLSearchParams({ integration_id: integrationId });
230
+ return requestOxygen(`/api/cli/integrations/composio/actions?${params.toString()}`);
231
+ });
232
+ }))
233
+ .addCommand(new Command("destinations")
234
+ .description("List where a connected integration can send — for Microsoft Teams, your teams and your chats, plus one team's channels with --team-id. Free: these are read-only lookups, so no approval or credit cap is needed.")
235
+ .argument("<integration_id>", "Integration id. Supported: 'microsoft_teams'.")
236
+ .option("--team-id <id>", "List this team's channels as well.")
237
+ .option("--kind <kind>", "Narrow to one of: teams, channels, chats. Default lists teams and chats.")
238
+ .option("--connection-id <id>", "Use a specific connection when several are active.")
239
+ .option("--json", "Print a JSON envelope.")
240
+ .action(async (integrationId, options) => {
241
+ await handleAsyncAction("integrations destinations", options, () => {
242
+ const params = new URLSearchParams({ integration_id: integrationId });
243
+ const teamId = readOption(options.teamId);
244
+ if (teamId)
245
+ params.set("team_id", teamId);
246
+ const kind = readOption(options.kind);
247
+ if (kind)
248
+ params.set("kind", kind);
249
+ const connectionId = readOption(options.connectionId);
250
+ if (connectionId)
251
+ params.set("connection_id", connectionId);
252
+ return requestOxygen(`/api/cli/integrations/destinations?${params.toString()}`);
253
+ });
254
+ }))
255
+ .addCommand(new Command("run")
256
+ .description("Run an action for a connected integration — Composio toolkits and native providers alike.")
257
+ .argument("<integration_id>", "Integration id, such as 'slack'.")
258
+ .argument("<action_slug>", "Composio action slug, such as 'SLACK_SEND_MESSAGE'.")
259
+ .option("--connection-id <id>", "Select this workspace connection.")
260
+ .option("--credential-mode <mode>", "managed, user_api_key, or user_oauth.")
261
+ .option("--input <json>", "Arguments as JSON object. Default: empty object.")
262
+ .option("--live", "Execute the action live. Default is dry-run.")
263
+ .option("--dry-run", "Force dry-run (no provider call).")
264
+ .option("--mode <mode>", "'live' or 'dry_run'. Overridden by --live/--dry-run if provided.")
265
+ .option("--approved", "Required for live actions after inspecting dry-run output.")
266
+ .option("--max-credits <n>", "Required positive credit cap for live actions.")
267
+ .option("--json", "Print a JSON envelope.")
268
+ .action(async (integrationId, actionSlug, options) => {
269
+ await handleAsyncAction("integrations run", options, () => {
270
+ const args = readOption(options.input)
271
+ ? parseJsonObject(readOption(options.input))
272
+ : {};
273
+ const mode = resolveComposioRunMode(options);
274
+ const maxCredits = readPositiveNumber(options.maxCredits);
275
+ return requestOxygen("/api/cli/integrations/composio/run", {
276
+ method: "POST",
277
+ body: {
278
+ integration_id: integrationId,
279
+ action_slug: actionSlug,
280
+ arguments: args,
281
+ ...(readOption(options.connectionId) ? { connection_id: readOption(options.connectionId) } : {}),
282
+ ...(readOption(options.credentialMode) ? { credential_mode: readOption(options.credentialMode) } : {}),
283
+ mode,
284
+ ...(options.approved ? { approved: true } : {}),
285
+ ...(maxCredits !== undefined ? { max_credits: maxCredits } : {}),
286
+ },
287
+ });
288
+ });
289
+ }));
290
+ }
@@ -0,0 +1,3 @@
1
+ import { ExtractedCommandActionHandler } from "../command-support.js";
2
+ import { Command } from "commander";
3
+ export declare function registerKnowledgeFamily(program: Command, handleAsyncAction: ExtractedCommandActionHandler): void;