aui-agent-builder 0.3.160 → 0.3.161

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 (74) hide show
  1. package/README.md +10 -17
  2. package/dist/api-client/apollo-client.d.ts.map +1 -1
  3. package/dist/api-client/apollo-client.js +2 -2
  4. package/dist/api-client/apollo-client.js.map +1 -1
  5. package/dist/commands/account.d.ts +11 -4
  6. package/dist/commands/account.d.ts.map +1 -1
  7. package/dist/commands/account.js +76 -59
  8. package/dist/commands/account.js.map +1 -1
  9. package/dist/commands/agents.d.ts +0 -1
  10. package/dist/commands/agents.d.ts.map +1 -1
  11. package/dist/commands/agents.js +80 -15
  12. package/dist/commands/agents.js.map +1 -1
  13. package/dist/commands/apollo.d.ts +5 -27
  14. package/dist/commands/apollo.d.ts.map +1 -1
  15. package/dist/commands/apollo.js +24 -36
  16. package/dist/commands/apollo.js.map +1 -1
  17. package/dist/commands/import-agent.d.ts +7 -0
  18. package/dist/commands/import-agent.d.ts.map +1 -1
  19. package/dist/commands/import-agent.js +27 -14
  20. package/dist/commands/import-agent.js.map +1 -1
  21. package/dist/commands/init.d.ts.map +1 -1
  22. package/dist/commands/init.js +76 -26
  23. package/dist/commands/init.js.map +1 -1
  24. package/dist/commands/integration-mcp-test.d.ts +13 -7
  25. package/dist/commands/integration-mcp-test.d.ts.map +1 -1
  26. package/dist/commands/integration-mcp-test.js +35 -51
  27. package/dist/commands/integration-mcp-test.js.map +1 -1
  28. package/dist/commands/integration-mcp-url.d.ts +40 -0
  29. package/dist/commands/integration-mcp-url.d.ts.map +1 -0
  30. package/dist/commands/integration-mcp-url.js +162 -0
  31. package/dist/commands/integration-mcp-url.js.map +1 -0
  32. package/dist/commands/integration.d.ts +51 -9
  33. package/dist/commands/integration.d.ts.map +1 -1
  34. package/dist/commands/integration.js +231 -66
  35. package/dist/commands/integration.js.map +1 -1
  36. package/dist/commands/report.d.ts +2 -13
  37. package/dist/commands/report.d.ts.map +1 -1
  38. package/dist/commands/report.js +1 -13
  39. package/dist/commands/report.js.map +1 -1
  40. package/dist/commands/util/apollo-agent.d.ts.map +1 -1
  41. package/dist/commands/util/apollo-agent.js +3 -1
  42. package/dist/commands/util/apollo-agent.js.map +1 -1
  43. package/dist/commands/version.d.ts.map +1 -1
  44. package/dist/commands/version.js +6 -1
  45. package/dist/commands/version.js.map +1 -1
  46. package/dist/config/index.d.ts +8 -0
  47. package/dist/config/index.d.ts.map +1 -1
  48. package/dist/config/index.js +9 -0
  49. package/dist/config/index.js.map +1 -1
  50. package/dist/errors/index.d.ts.map +1 -1
  51. package/dist/errors/index.js +10 -3
  52. package/dist/errors/index.js.map +1 -1
  53. package/dist/index.js +159 -78
  54. package/dist/index.js.map +1 -1
  55. package/dist/services/agents.service.d.ts.map +1 -1
  56. package/dist/services/agents.service.js +5 -2
  57. package/dist/services/agents.service.js.map +1 -1
  58. package/dist/services/integration.service.d.ts +282 -7
  59. package/dist/services/integration.service.d.ts.map +1 -1
  60. package/dist/services/integration.service.js +366 -29
  61. package/dist/services/integration.service.js.map +1 -1
  62. package/dist/services/pull-schema.service.d.ts +1 -1
  63. package/dist/services/pull-schema.service.d.ts.map +1 -1
  64. package/dist/services/pull-schema.service.js +6 -14
  65. package/dist/services/pull-schema.service.js.map +1 -1
  66. package/dist/ui/views/IntegrationView.d.ts +3 -1
  67. package/dist/ui/views/IntegrationView.d.ts.map +1 -1
  68. package/dist/ui/views/IntegrationView.js +2 -2
  69. package/dist/ui/views/IntegrationView.js.map +1 -1
  70. package/dist/utils/agent-injection.d.ts +1 -1
  71. package/dist/utils/agent-injection.d.ts.map +1 -1
  72. package/dist/utils/agent-injection.js +3 -5
  73. package/dist/utils/agent-injection.js.map +1 -1
  74. package/package.json +1 -1
@@ -0,0 +1,162 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { render, Box } from "ink";
3
+ import { getAuthenticatedSession, fetchComposioApiKey, getComposioServerUrl, getComposioToolkitConnectionStatus, discoverComposioTools, resetComposioClient, resolveScopeIds, } from "../services/integration.service.js";
4
+ import { Header, StatusLine, KeyValue, Spinner, } from "../ui/components/index.js";
5
+ import { isJsonMode, outputJson, stderrLog } from "../utils/json-output.js";
6
+ import { ValidationError, ConfigError, CLIError } from "../errors/index.js";
7
+ function log(node) {
8
+ const { unmount } = render(node);
9
+ unmount();
10
+ }
11
+ export async function integrationMcpUrl(options = {}) {
12
+ // ── Validate required flags ──
13
+ const toolkit = options.toolkit?.trim();
14
+ if (!toolkit) {
15
+ throw new ValidationError("--toolkit is required.", {
16
+ suggestion: "Pass --toolkit <slug> (e.g. --toolkit gmail).",
17
+ });
18
+ }
19
+ if (!options.allTools && !options.tools) {
20
+ throw new ValidationError("Tool selection is required.", {
21
+ suggestion: "Pass --all-tools to include every tool, or --tools <comma,separated,names> for a subset.",
22
+ });
23
+ }
24
+ // ── Session + scope ──
25
+ const session = await getAuthenticatedSession();
26
+ const scope = resolveScopeIds(session, {
27
+ organizationId: options.organizationId,
28
+ accountId: options.accountId,
29
+ networkId: options.networkId,
30
+ });
31
+ const composioUserId = (options.composioUserId || scope.networkId || "").trim();
32
+ if (!composioUserId) {
33
+ throw new ValidationError("Could not resolve a Composio user id.", {
34
+ suggestion: "Pass --composio-user-id, or ensure --network-id (or your session's network) is set.",
35
+ });
36
+ }
37
+ // ── API key (precedence: flag → env → backend-issued) ──
38
+ let apiKey = (options.composioApiKey && options.composioApiKey.trim()) ||
39
+ process.env.COMPOSIO_API_KEY ||
40
+ "";
41
+ if (!apiKey) {
42
+ if (isJsonMode())
43
+ stderrLog("Fetching integration configuration...");
44
+ const fetched = await fetchComposioApiKey(session);
45
+ if (fetched)
46
+ apiKey = fetched;
47
+ }
48
+ if (!apiKey) {
49
+ throw new ConfigError("Composio API key not available.", {
50
+ suggestion: "Pass --composio-api-key, set COMPOSIO_API_KEY, or have your administrator configure it on the backend.",
51
+ });
52
+ }
53
+ // ── Pre-flight: verify the toolkit is reachable for this user ──
54
+ // We do this before tool discovery / MCP-server provisioning so the failure
55
+ // is fast and the suggestion is actionable. NO_AUTH toolkits short-circuit.
56
+ await assertToolkitConnected(apiKey, composioUserId, toolkit);
57
+ // ── Resolve allowed tools ──
58
+ const allowedTools = await resolveAllowedTools(apiKey, toolkit, options);
59
+ // ── Provision (or reuse) the MCP server ──
60
+ if (isJsonMode()) {
61
+ stderrLog(`Provisioning Composio MCP server for ${toolkit}...`);
62
+ }
63
+ const provisionSpinner = isJsonMode()
64
+ ? null
65
+ : render(_jsx(Spinner, { label: `Provisioning Composio MCP server for ${toolkit}...` }));
66
+ try {
67
+ const { url, serverId } = await getComposioServerUrl(apiKey, {
68
+ composioUserId,
69
+ toolkit,
70
+ allowedTools,
71
+ serverId: options.serverId,
72
+ });
73
+ provisionSpinner?.unmount();
74
+ if (isJsonMode()) {
75
+ outputJson({
76
+ server_id: serverId,
77
+ server_url: url,
78
+ toolkit,
79
+ composio_user_id: composioUserId,
80
+ tool_count: allowedTools.length,
81
+ tool_names: allowedTools,
82
+ });
83
+ return;
84
+ }
85
+ renderResult({
86
+ serverId,
87
+ url,
88
+ toolkit,
89
+ composioUserId,
90
+ allowedTools,
91
+ });
92
+ }
93
+ catch (err) {
94
+ provisionSpinner?.unmount();
95
+ if (err instanceof CLIError)
96
+ throw err;
97
+ throw new CLIError(`Failed to provision Composio MCP server: ${err instanceof Error ? err.message : String(err)}`, {
98
+ code: "API_CLIENT_ERROR",
99
+ cause: err,
100
+ suggestion: "Re-run with AUI_DEBUG=1 to see the underlying Composio API call. If the toolkit needs to be re-connected, run `aui integration create --toolkit <slug>`.",
101
+ });
102
+ }
103
+ finally {
104
+ resetComposioClient();
105
+ }
106
+ }
107
+ async function assertToolkitConnected(apiKey, composioUserId, toolkit) {
108
+ if (isJsonMode())
109
+ stderrLog(`Checking authentication for ${toolkit}...`);
110
+ const spinner = isJsonMode()
111
+ ? null
112
+ : render(_jsx(Spinner, { label: `Checking authentication for ${toolkit}...` }));
113
+ try {
114
+ const status = await getComposioToolkitConnectionStatus(apiKey, composioUserId, toolkit);
115
+ if (status.isConnected)
116
+ return;
117
+ throw new ConfigError(`User '${composioUserId}' has no active connection for toolkit '${toolkit}'${status.authMode ? ` (auth scheme: ${status.authMode})` : ""}.`, {
118
+ suggestion: `Connect it first: aui integration create --toolkit ${toolkit}`,
119
+ });
120
+ }
121
+ finally {
122
+ spinner?.unmount();
123
+ }
124
+ }
125
+ async function resolveAllowedTools(apiKey, toolkit, options) {
126
+ if (options.allTools) {
127
+ if (isJsonMode())
128
+ stderrLog(`Discovering tools for ${toolkit}...`);
129
+ const spinner = isJsonMode()
130
+ ? null
131
+ : render(_jsx(Spinner, { label: `Discovering tools for ${toolkit}...` }));
132
+ try {
133
+ const { tools } = await discoverComposioTools(apiKey, toolkit);
134
+ const names = tools.map((t) => t.name).filter((n) => Boolean(n));
135
+ if (names.length === 0) {
136
+ throw new ConfigError(`No tools discovered for toolkit '${toolkit}'.`, {
137
+ suggestion: "Verify the toolkit slug and that your Composio API key has access to it.",
138
+ });
139
+ }
140
+ return names;
141
+ }
142
+ finally {
143
+ spinner?.unmount();
144
+ }
145
+ }
146
+ const names = options
147
+ .tools.split(",")
148
+ .map((t) => t.trim())
149
+ .filter(Boolean);
150
+ if (names.length === 0) {
151
+ throw new ValidationError("--tools must contain at least one tool name.", {
152
+ suggestion: "Example: --tools GMAIL_SEND_EMAIL,GMAIL_FETCH_EMAILS",
153
+ });
154
+ }
155
+ return names;
156
+ }
157
+ function renderResult(args) {
158
+ log(_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsx(Header, { title: "Composio MCP server ready", subtitle: `${args.toolkit} · ${args.allowedTools.length} tool(s)` }), _jsx(KeyValue, { label: "Server ID", value: args.serverId }), _jsx(KeyValue, { label: "Server URL", value: args.url }), _jsx(KeyValue, { label: "Toolkit", value: args.toolkit }), _jsx(KeyValue, { label: "User ID", value: args.composioUserId }), _jsx(KeyValue, { label: "Tools", value: String(args.allowedTools.length) })] }));
159
+ log(_jsx(StatusLine, { kind: "muted", label: `Test it: aui integration mcp-test --type direct --url '${args.url}' --tool <name>` }));
160
+ log(_jsx(StatusLine, { kind: "muted", label: `Reuse it: aui integration mcp-url --toolkit ${args.toolkit} --server-id ${args.serverId} --all-tools` }));
161
+ }
162
+ //# sourceMappingURL=integration-mcp-url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration-mcp-url.js","sourceRoot":"","sources":["../../src/commands/integration-mcp-url.tsx"],"names":[],"mappings":";AA6BA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,kCAAkC,EAClC,qBAAqB,EACrB,mBAAmB,EACnB,eAAe,GAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,OAAO,GACR,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAc5E,SAAS,GAAG,CAAC,IAAkB;IAC7B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACjC,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,UAAoC,EAAE;IAEtC,gCAAgC;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;IACxC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,eAAe,CAAC,wBAAwB,EAAE;YAClD,UAAU,EAAE,+CAA+C;SAC5D,CAAC,CAAC;IACL,CAAC;IACD,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,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AAW,EAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,GAAI,EACpD,KAAC,QAAQ,IAAC,KAAK,EAAC,YAAY,EAAC,KAAK,EAAE,IAAI,CAAC,GAAG,GAAI,EAChD,KAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,GAAI,EACjD,KAAC,QAAQ,IAAC,KAAK,EAAC,SAAS,EAAC,KAAK,EAAE,IAAI,CAAC,cAAc,GAAI,EACxD,KAAC,QAAQ,IAAC,KAAK,EAAC,OAAO,EAAC,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,GAAI,IAC/D,CACP,CAAC;IACF,GAAG,CACD,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,0DAA0D,IAAI,CAAC,GAAG,iBAAiB,GAC1F,CACH,CAAC;IACF,GAAG,CACD,KAAC,UAAU,IACT,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,+CAA+C,IAAI,CAAC,OAAO,gBAAgB,IAAI,CAAC,QAAQ,cAAc,GAC7G,CACH,CAAC;AACJ,CAAC"}
@@ -24,20 +24,34 @@
24
24
  * `--json` implies non-interactive and emits machine-readable output via
25
25
  * `outputJson` / `outputJsonError`.
26
26
  *
27
- * Composio (native) settings: `settings.user_id` is the agent's `network_id`
28
- * (per MCP_SCHEMA_CHANGES IntegrationComposioMCPSettingsView), so each
29
- * agent owns its own Composio user namespace.
27
+ * Composio (native) settings: `settings.composio.user_id` is the agent's
28
+ * `network_id` (per backend `ComposioIntegrationSchema`
29
+ * `IntegrationMCPSettings`), so each agent owns its own Composio user
30
+ * namespace. The MCP server is provisioned once on create; its caller-
31
+ * stable id is persisted at `settings.composio.server_id` and the
32
+ * provisioned HTTP URL is persisted at `settings.server_url` so the
33
+ * runtime can hit the MCP endpoint without round-tripping Composio.
30
34
  */
35
+ import { type MCPAuthentication, type MCPAuthFlags } from "../services/integration.service.js";
31
36
  export interface IntegrationOptions {
32
37
  create?: boolean;
33
38
  discover?: boolean;
34
39
  }
35
- export interface IntegrationCreateOptions {
40
+ /**
41
+ * `aui integration create` options. Auth flags come from the shared
42
+ * `MCPAuthFlags` surface so DIRECT integrations can carry any canonical
43
+ * `MCPAuthenticationType` (including `oauth_client_credentials`) without
44
+ * the command layer having to enumerate them.
45
+ */
46
+ export interface IntegrationCreateOptions extends MCPAuthFlags {
36
47
  name?: string;
37
48
  description?: string;
38
49
  url?: string;
39
- authType?: string;
40
- authToken?: string;
50
+ /**
51
+ * MCP transport. Mirrors `IntegrationMCPSettings.transport_type`.
52
+ * Defaults to `STREAMABLE_HTTP` at the wire when omitted.
53
+ */
54
+ transportType?: string;
41
55
  tools?: string;
42
56
  allTools?: boolean;
43
57
  type?: string;
@@ -59,6 +73,14 @@ export interface IntegrationCreateOptions {
59
73
  composioClientSecret?: string;
60
74
  /** BYO OAuth: optional bearer token. */
61
75
  composioClientBearerToken?: string;
76
+ /**
77
+ * Caller-stable MCP server identifier (the Composio MCP server's name).
78
+ * When set, the native flow reuses the existing server instead of
79
+ * minting a fresh `<uuid:30>` name. The id is also persisted on the
80
+ * resulting integration so subsequent runs (e.g. `aui integration
81
+ * mcp-url --server-id …`) resolve the same server.
82
+ */
83
+ serverId?: string;
62
84
  /**
63
85
  * Fully non-interactive mode. Skips selection prompts (org / account /
64
86
  * agent) and the final confirmation prompt. Required flags must be set —
@@ -66,14 +88,34 @@ export interface IntegrationCreateOptions {
66
88
  */
67
89
  full?: boolean;
68
90
  }
69
- export interface IntegrationDiscoverOptions {
91
+ /**
92
+ * `aui integration discover` options. Auth flags are the canonical
93
+ * `MCPAuthFlags` surface so discover supports the same auth types as
94
+ * `create` and `mcp-test` (bearer_token, api_key, oauth_client_credentials,
95
+ * the legacy `token` alias, and `none`).
96
+ */
97
+ export interface IntegrationDiscoverOptions extends MCPAuthFlags {
70
98
  url?: string;
71
- authType?: string;
72
- authToken?: string;
99
+ /** Optional MCP transport (`STREAMABLE_HTTP` default, `SSE` for legacy servers). */
100
+ transportType?: string;
73
101
  organizationId?: string;
74
102
  accountId?: string;
75
103
  networkId?: string;
76
104
  }
105
+ /**
106
+ * Inquirer-driven picker for DIRECT MCP authentication. Covers the full
107
+ * canonical `MCPAuthenticationType` surface — `none`, `bearer_token`,
108
+ * `api_key`, `oauth_client_credentials` — and returns the canonical
109
+ * shape so callers can pass it straight to `discoverMCPTools`,
110
+ * `saveIntegration`, or the Apollo MCP-test endpoint without reshaping.
111
+ *
112
+ * Exported so `integration-mcp-test.tsx` can share the same prompt UX
113
+ * (single source of truth for what auth modes the CLI surfaces). The
114
+ * legacy `--auth-type token` alias is NOT offered here on purpose —
115
+ * interactive users get the canonical names; only flag invocations keep
116
+ * the alias for backwards compat.
117
+ */
118
+ export declare function promptDirectMCPAuth(): Promise<MCPAuthentication>;
77
119
  export declare function integration(_options?: IntegrationOptions): Promise<void>;
78
120
  export declare function integrationDiscover(options?: IntegrationDiscoverOptions): Promise<void>;
79
121
  export declare function integrationCreate(options?: IntegrationCreateOptions): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/commands/integration.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAoDH,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,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