aui-agent-builder 0.4.5 → 0.4.7
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/dist/api-client/apollo-client.d.ts +102 -5
- package/dist/api-client/apollo-client.d.ts.map +1 -1
- package/dist/api-client/apollo-client.js +136 -5
- package/dist/api-client/apollo-client.js.map +1 -1
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +36 -3
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/rag-client.d.ts +9 -0
- package/dist/api-client/rag-client.d.ts.map +1 -1
- package/dist/api-client/rag-client.js +21 -0
- package/dist/api-client/rag-client.js.map +1 -1
- package/dist/commands/account.d.ts.map +1 -1
- package/dist/commands/account.js +12 -16
- package/dist/commands/account.js.map +1 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +85 -112
- package/dist/commands/agents.js.map +1 -1
- package/dist/commands/connect.d.ts.map +1 -1
- package/dist/commands/connect.js +14 -18
- package/dist/commands/connect.js.map +1 -1
- package/dist/commands/import-agent.d.ts +2 -5
- package/dist/commands/import-agent.d.ts.map +1 -1
- package/dist/commands/import-agent.js +14 -19
- package/dist/commands/import-agent.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +10 -3
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/integration-mcp-test.d.ts +0 -2
- package/dist/commands/integration-mcp-test.d.ts.map +1 -1
- package/dist/commands/integration-mcp-test.js +42 -135
- package/dist/commands/integration-mcp-test.js.map +1 -1
- package/dist/commands/integration-mcp-url.d.ts +6 -7
- package/dist/commands/integration-mcp-url.d.ts.map +1 -1
- package/dist/commands/integration-mcp-url.js +11 -29
- package/dist/commands/integration-mcp-url.js.map +1 -1
- package/dist/commands/integration-toolkits.d.ts +4 -11
- package/dist/commands/integration-toolkits.d.ts.map +1 -1
- package/dist/commands/integration-toolkits.js +6 -28
- package/dist/commands/integration-toolkits.js.map +1 -1
- package/dist/commands/integration-tools.d.ts +5 -15
- package/dist/commands/integration-tools.d.ts.map +1 -1
- package/dist/commands/integration-tools.js +17 -63
- package/dist/commands/integration-tools.js.map +1 -1
- package/dist/commands/integration.d.ts +0 -1
- package/dist/commands/integration.d.ts.map +1 -1
- package/dist/commands/integration.js +62 -168
- package/dist/commands/integration.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +100 -75
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/pull-agent.d.ts +2 -5
- package/dist/commands/pull-agent.d.ts.map +1 -1
- package/dist/commands/pull-agent.js +1 -1
- package/dist/commands/pull-agent.js.map +1 -1
- package/dist/commands/version.d.ts.map +1 -1
- package/dist/commands/version.js +130 -40
- package/dist/commands/version.js.map +1 -1
- package/dist/errors/index.d.ts +9 -0
- package/dist/errors/index.d.ts.map +1 -1
- package/dist/errors/index.js +20 -9
- package/dist/errors/index.js.map +1 -1
- package/dist/index.js +21 -31
- package/dist/index.js.map +1 -1
- package/dist/services/auth.service.d.ts +1 -1
- package/dist/services/auth.service.d.ts.map +1 -1
- package/dist/services/auth.service.js +8 -4
- package/dist/services/auth.service.js.map +1 -1
- package/dist/services/integration.service.d.ts +75 -148
- package/dist/services/integration.service.d.ts.map +1 -1
- package/dist/services/integration.service.js +408 -559
- package/dist/services/integration.service.js.map +1 -1
- package/dist/services/pull-schema.service.d.ts +4 -5
- package/dist/services/pull-schema.service.d.ts.map +1 -1
- package/dist/services/pull-schema.service.js +36 -8
- package/dist/services/pull-schema.service.js.map +1 -1
- package/dist/ui/components/ErrorDisplay.d.ts.map +1 -1
- package/dist/ui/components/ErrorDisplay.js +16 -4
- package/dist/ui/components/ErrorDisplay.js.map +1 -1
- package/package.json +1 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { render, Box } from "ink";
|
|
3
|
-
import { getAuthenticatedSession,
|
|
3
|
+
import { getAuthenticatedSession, getComposioServerUrl, getComposioToolkitConnectionStatus, discoverComposioTools, resolveScopeIds, assertComposioUserIdMatchesNetworkId, } from "../services/integration.service.js";
|
|
4
4
|
import { Header, StatusLine, KeyValue, Spinner, } from "../ui/components/index.js";
|
|
5
5
|
import { isJsonMode, outputJson, stderrLog } from "../utils/json-output.js";
|
|
6
6
|
import { ValidationError, ConfigError, CLIError } from "../errors/index.js";
|
|
@@ -34,28 +34,13 @@ export async function integrationMcpUrl(options = {}) {
|
|
|
34
34
|
suggestion: "Pass --composio-user-id, or ensure --network-id (or your session's network) is set.",
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
|
|
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
|
-
}
|
|
37
|
+
assertComposioUserIdMatchesNetworkId(composioUserId, scope.networkId);
|
|
53
38
|
// ── Pre-flight: verify the toolkit is reachable for this user ──
|
|
54
39
|
// We do this before tool discovery / MCP-server provisioning so the failure
|
|
55
40
|
// is fast and the suggestion is actionable. NO_AUTH toolkits short-circuit.
|
|
56
|
-
await assertToolkitConnected(
|
|
41
|
+
await assertToolkitConnected(session, scope, composioUserId, toolkit);
|
|
57
42
|
// ── Resolve allowed tools ──
|
|
58
|
-
const allowedTools = await resolveAllowedTools(
|
|
43
|
+
const allowedTools = await resolveAllowedTools(session, scope, composioUserId, toolkit, options);
|
|
59
44
|
// ── Provision (or reuse) the MCP server ──
|
|
60
45
|
if (isJsonMode()) {
|
|
61
46
|
stderrLog(`Provisioning Composio MCP server for ${toolkit}...`);
|
|
@@ -64,7 +49,7 @@ export async function integrationMcpUrl(options = {}) {
|
|
|
64
49
|
? null
|
|
65
50
|
: render(_jsx(Spinner, { label: `Provisioning Composio MCP server for ${toolkit}...` }));
|
|
66
51
|
try {
|
|
67
|
-
const { url, serverId } = await getComposioServerUrl(
|
|
52
|
+
const { url, serverId } = await getComposioServerUrl(session, scope, {
|
|
68
53
|
composioUserId,
|
|
69
54
|
toolkit,
|
|
70
55
|
allowedTools,
|
|
@@ -97,21 +82,18 @@ export async function integrationMcpUrl(options = {}) {
|
|
|
97
82
|
throw new CLIError(`Failed to provision Composio MCP server: ${err instanceof Error ? err.message : String(err)}`, {
|
|
98
83
|
code: "API_CLIENT_ERROR",
|
|
99
84
|
cause: err,
|
|
100
|
-
suggestion: "
|
|
85
|
+
suggestion: "If the toolkit needs to be re-connected, run `aui integration create --toolkit <slug>`.",
|
|
101
86
|
});
|
|
102
87
|
}
|
|
103
|
-
finally {
|
|
104
|
-
resetComposioClient();
|
|
105
|
-
}
|
|
106
88
|
}
|
|
107
|
-
async function assertToolkitConnected(
|
|
89
|
+
async function assertToolkitConnected(session, scope, composioUserId, toolkit) {
|
|
108
90
|
if (isJsonMode())
|
|
109
91
|
stderrLog(`Checking authentication for ${toolkit}...`);
|
|
110
92
|
const spinner = isJsonMode()
|
|
111
93
|
? null
|
|
112
94
|
: render(_jsx(Spinner, { label: `Checking authentication for ${toolkit}...` }));
|
|
113
95
|
try {
|
|
114
|
-
const status = await getComposioToolkitConnectionStatus(
|
|
96
|
+
const status = await getComposioToolkitConnectionStatus(session, scope, composioUserId, toolkit);
|
|
115
97
|
if (status.isConnected)
|
|
116
98
|
return;
|
|
117
99
|
throw new ConfigError(`User '${composioUserId}' has no active connection for toolkit '${toolkit}'${status.authMode ? ` (auth scheme: ${status.authMode})` : ""}.`, {
|
|
@@ -122,7 +104,7 @@ async function assertToolkitConnected(apiKey, composioUserId, toolkit) {
|
|
|
122
104
|
spinner?.unmount();
|
|
123
105
|
}
|
|
124
106
|
}
|
|
125
|
-
async function resolveAllowedTools(
|
|
107
|
+
async function resolveAllowedTools(session, scope, composioUserId, toolkit, options) {
|
|
126
108
|
if (options.allTools) {
|
|
127
109
|
if (isJsonMode())
|
|
128
110
|
stderrLog(`Discovering tools for ${toolkit}...`);
|
|
@@ -130,11 +112,11 @@ async function resolveAllowedTools(apiKey, toolkit, options) {
|
|
|
130
112
|
? null
|
|
131
113
|
: render(_jsx(Spinner, { label: `Discovering tools for ${toolkit}...` }));
|
|
132
114
|
try {
|
|
133
|
-
const { tools } = await discoverComposioTools(
|
|
115
|
+
const { tools } = await discoverComposioTools(session, scope, composioUserId, toolkit);
|
|
134
116
|
const names = tools.map((t) => t.name).filter((n) => Boolean(n));
|
|
135
117
|
if (names.length === 0) {
|
|
136
118
|
throw new ConfigError(`No tools discovered for toolkit '${toolkit}'.`, {
|
|
137
|
-
suggestion: "Verify the toolkit slug and that
|
|
119
|
+
suggestion: "Verify the toolkit slug and that the user has an active connection.",
|
|
138
120
|
});
|
|
139
121
|
}
|
|
140
122
|
return names;
|
|
@@ -1 +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,
|
|
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,oBAAoB,EACpB,kCAAkC,EAClC,qBAAqB,EACrB,eAAe,EACf,oCAAoC,GAErC,M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nE,CAAC,CAAC;IACL,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,IAMrB;IACC,GAAG,CACD,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,aACrC,KAAC,MAAM,IACL,KAAK,EAAC,2BAA2B,EACjC,QAAQ,EAAE,GAAG,IAAI,CAAC,OAAO,QAAQ,IAAI,CAAC,YAAY,CAAC,MAAM,UAAU,GACnE,EACF,KAAC,QAAQ,IAAC,KAAK,EAAC,WAAW,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"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `aui integration toolkits` — list native (Composio) toolkits
|
|
3
|
-
*
|
|
4
|
-
* Wraps the same endpoint the Composio dashboard hits:
|
|
5
|
-
* GET https://backend.composio.dev/api/v3.1/toolkits?sort_by=usage&limit=<n>
|
|
2
|
+
* `aui integration toolkits` — list native (Composio) toolkits via the
|
|
3
|
+
* Apollo MCP API (`GET /v1/integrations/mcp/composio/toolkits`).
|
|
6
4
|
*
|
|
7
5
|
* Designed to be safely consumed from the E2B sandbox (`agent-builder-bff`)
|
|
8
6
|
* as well as from a developer's terminal:
|
|
@@ -12,12 +10,8 @@
|
|
|
12
10
|
* standard CLI exit code (0 success, 2 validation, 1 runtime).
|
|
13
11
|
* - `--all` follows the pagination cursor and returns every toolkit in one
|
|
14
12
|
* call (otherwise a single page is returned).
|
|
15
|
-
* -
|
|
16
|
-
*
|
|
17
|
-
* 1. `--composio-api-key <key>`
|
|
18
|
-
* 2. `COMPOSIO_API_KEY` env var
|
|
19
|
-
* 3. Backend-issued key fetched via `fetchComposioApiKey` (requires
|
|
20
|
-
* an authenticated AUI session)
|
|
13
|
+
* - Authentication uses the user's `aui login` session — the gateway
|
|
14
|
+
* forwards Apollo's Composio API key, so the CLI never holds one.
|
|
21
15
|
*
|
|
22
16
|
* Examples:
|
|
23
17
|
* aui integration toolkits
|
|
@@ -28,7 +22,6 @@ export interface IntegrationToolkitsOptions {
|
|
|
28
22
|
search?: string;
|
|
29
23
|
limit?: string;
|
|
30
24
|
cursor?: string;
|
|
31
|
-
composioApiKey?: string;
|
|
32
25
|
all?: boolean;
|
|
33
26
|
}
|
|
34
27
|
export declare function integrationToolkits(options?: IntegrationToolkitsOptions): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-toolkits.d.ts","sourceRoot":"","sources":["../../src/commands/integration-toolkits.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"integration-toolkits.d.ts","sourceRoot":"","sources":["../../src/commands/integration-toolkits.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AA0BH,MAAM,WAAW,0BAA0B;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAOD,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,IAAI,CAAC,CA+Df"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { render, Box, Text } from "ink";
|
|
3
|
-
import { getAuthenticatedSession,
|
|
3
|
+
import { getAuthenticatedSession, listComposioToolkits, resolveScopeIds, composioApiError, } from "../services/integration.service.js";
|
|
4
4
|
import { Header, Section, StatusLine, KeyValue, Spinner, } from "../ui/components/index.js";
|
|
5
5
|
import { colors } from "../ui/theme.js";
|
|
6
6
|
import { isJsonMode, outputJson, stderrLog, } from "../utils/json-output.js";
|
|
7
|
-
import { ValidationError
|
|
7
|
+
import { ValidationError } from "../errors/index.js";
|
|
8
8
|
function log(node) {
|
|
9
9
|
const { unmount } = render(node);
|
|
10
10
|
unmount();
|
|
@@ -17,24 +17,8 @@ export async function integrationToolkits(options = {}) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
const search = options.search?.trim() || undefined;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
process.env.COMPOSIO_API_KEY ||
|
|
23
|
-
"";
|
|
24
|
-
if (!apiKey) {
|
|
25
|
-
if (isJsonMode()) {
|
|
26
|
-
stderrLog("Fetching integration configuration...");
|
|
27
|
-
}
|
|
28
|
-
const session = await getAuthenticatedSession();
|
|
29
|
-
const fetched = await fetchComposioApiKey(session);
|
|
30
|
-
if (fetched)
|
|
31
|
-
apiKey = fetched;
|
|
32
|
-
}
|
|
33
|
-
if (!apiKey) {
|
|
34
|
-
throw new ConfigError("Composio API key not available.", {
|
|
35
|
-
suggestion: "Pass --composio-api-key, set COMPOSIO_API_KEY, or have your administrator configure it on the backend.",
|
|
36
|
-
});
|
|
37
|
-
}
|
|
20
|
+
const session = await getAuthenticatedSession();
|
|
21
|
+
const scope = resolveScopeIds(session);
|
|
38
22
|
// ── Fetch ──
|
|
39
23
|
if (isJsonMode()) {
|
|
40
24
|
stderrLog(`Fetching toolkits from Composio${search ? ` (search="${search}")` : ""}${options.all ? " [all pages]" : ""}...`);
|
|
@@ -47,7 +31,7 @@ export async function integrationToolkits(options = {}) {
|
|
|
47
31
|
const toolkits = [];
|
|
48
32
|
let nextCursor = options.cursor;
|
|
49
33
|
do {
|
|
50
|
-
const result = await listComposioToolkits(
|
|
34
|
+
const result = await listComposioToolkits(session, scope, {
|
|
51
35
|
search,
|
|
52
36
|
limit,
|
|
53
37
|
cursor: nextCursor,
|
|
@@ -76,13 +60,7 @@ export async function integrationToolkits(options = {}) {
|
|
|
76
60
|
}
|
|
77
61
|
catch (err) {
|
|
78
62
|
spinner?.unmount();
|
|
79
|
-
|
|
80
|
-
throw err;
|
|
81
|
-
throw new CLIError(`Failed to fetch Composio toolkits: ${err instanceof Error ? err.message : String(err)}`, {
|
|
82
|
-
code: "API_CLIENT_ERROR",
|
|
83
|
-
cause: err,
|
|
84
|
-
suggestion: "Verify the Composio API key has access to the toolkit directory.",
|
|
85
|
-
});
|
|
63
|
+
throw composioApiError(err);
|
|
86
64
|
}
|
|
87
65
|
}
|
|
88
66
|
function renderToolkitsView(toolkits, search, nextCursor) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-toolkits.js","sourceRoot":"","sources":["../../src/commands/integration-toolkits.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"integration-toolkits.js","sourceRoot":"","sources":["../../src/commands/integration-toolkits.tsx"],"names":[],"mappings":";AAsBA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,GAEjB,MAAM,oCAAoC,CAAC;AAC5C,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ions=<version>&tool_slugs=<SLUG_A,SLUG_B>
|
|
4
|
+
* Apollo MCP API:
|
|
5
|
+
* GET /v1/integrations/mcp/composio/tools/by-slug?slugs=<A>&slugs=<B>
|
|
7
6
|
*
|
|
8
7
|
* Designed to be safely consumed from the E2B sandbox (`agent-builder-bff`)
|
|
9
8
|
* as well as from a developer's terminal:
|
|
@@ -11,24 +10,15 @@
|
|
|
11
10
|
* - Fully non-interactive: no prompts, no Ink layouts that block on input.
|
|
12
11
|
* - `--json` emits the canonical structured envelope and exits with the
|
|
13
12
|
* standard CLI exit code (0 success, 2 validation, 1 runtime).
|
|
14
|
-
* -
|
|
15
|
-
*
|
|
16
|
-
* 1. `--composio-api-key <key>`
|
|
17
|
-
* 2. `COMPOSIO_API_KEY` env var
|
|
18
|
-
* 3. Backend-issued key fetched via `fetchComposioApiKey` (requires
|
|
19
|
-
* an authenticated AUI session)
|
|
13
|
+
* - Authentication uses the user's `aui login` session — the gateway
|
|
14
|
+
* forwards Apollo's Composio API key, so the CLI never holds one.
|
|
20
15
|
*
|
|
21
16
|
* Examples:
|
|
22
17
|
* aui integration tools --slugs GMAIL_SEND_EMAIL,GMAIL_CREATE_EMAIL_DRAFT
|
|
23
|
-
* aui integration tools --slugs GMAIL_SEND_EMAIL --
|
|
24
|
-
* aui integration tools --slugs ... --composio-api-key sk-...
|
|
18
|
+
* aui integration tools --slugs GMAIL_SEND_EMAIL --json
|
|
25
19
|
*/
|
|
26
20
|
export interface IntegrationToolsOptions {
|
|
27
21
|
slugs?: string;
|
|
28
|
-
toolkitVersions?: string;
|
|
29
|
-
composioApiKey?: string;
|
|
30
|
-
limit?: string;
|
|
31
|
-
cursor?: string;
|
|
32
22
|
}
|
|
33
23
|
export declare function integrationTools(options?: IntegrationToolsOptions): Promise<void>;
|
|
34
24
|
//# sourceMappingURL=integration-tools.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-tools.d.ts","sourceRoot":"","sources":["../../src/commands/integration-tools.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"integration-tools.d.ts","sourceRoot":"","sources":["../../src/commands/integration-tools.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0BH,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAOD,wBAAsB,gBAAgB,CACpC,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CA6Cf"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { render, Box, Text } from "ink";
|
|
3
|
-
import { getAuthenticatedSession,
|
|
4
|
-
import { Header, Section, StatusLine,
|
|
3
|
+
import { getAuthenticatedSession, fetchComposioToolsBySlugs, resolveScopeIds, composioApiError, } from "../services/integration.service.js";
|
|
4
|
+
import { Header, Section, StatusLine, KeyValue, Spinner, } from "../ui/components/index.js";
|
|
5
5
|
import { colors } from "../ui/theme.js";
|
|
6
6
|
import { isJsonMode, outputJson, stderrLog, } from "../utils/json-output.js";
|
|
7
|
-
import { ValidationError
|
|
7
|
+
import { ValidationError } from "../errors/index.js";
|
|
8
8
|
function log(node) {
|
|
9
9
|
const { unmount } = render(node);
|
|
10
10
|
unmount();
|
|
@@ -19,90 +19,44 @@ export async function integrationTools(options = {}) {
|
|
|
19
19
|
suggestion: "Pass --slugs <SLUG_A,SLUG_B> with one or more Composio tool slugs (e.g. GMAIL_SEND_EMAIL).",
|
|
20
20
|
});
|
|
21
21
|
}
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
if (limit !== undefined && (Number.isNaN(limit) || limit <= 0)) {
|
|
25
|
-
throw new ValidationError("Invalid --limit value", {
|
|
26
|
-
suggestion: "Pass a positive integer (e.g. --limit 50).",
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
// ── Resolve API key ──
|
|
30
|
-
let apiKey = (options.composioApiKey && options.composioApiKey.trim()) ||
|
|
31
|
-
process.env.COMPOSIO_API_KEY ||
|
|
32
|
-
"";
|
|
33
|
-
if (!apiKey) {
|
|
34
|
-
if (isJsonMode()) {
|
|
35
|
-
stderrLog("Fetching integration configuration...");
|
|
36
|
-
}
|
|
37
|
-
const session = await getAuthenticatedSession();
|
|
38
|
-
const fetched = await fetchComposioApiKey(session);
|
|
39
|
-
if (fetched)
|
|
40
|
-
apiKey = fetched;
|
|
41
|
-
}
|
|
42
|
-
if (!apiKey) {
|
|
43
|
-
throw new ConfigError("Composio API key not available.", {
|
|
44
|
-
suggestion: "Pass --composio-api-key, set COMPOSIO_API_KEY, or have your administrator configure it on the backend.",
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
// ── Fetch ──
|
|
22
|
+
const session = await getAuthenticatedSession();
|
|
23
|
+
const scope = resolveScopeIds(session);
|
|
48
24
|
if (isJsonMode()) {
|
|
49
|
-
stderrLog(`Fetching ${slugs.length} tool(s) from Composio
|
|
25
|
+
stderrLog(`Fetching ${slugs.length} tool(s) from Composio...`);
|
|
50
26
|
}
|
|
51
27
|
let spinner = null;
|
|
52
28
|
if (!isJsonMode()) {
|
|
53
29
|
spinner = render(_jsx(Spinner, { label: `Fetching ${slugs.length} tool(s) from Composio...` }));
|
|
54
30
|
}
|
|
55
31
|
try {
|
|
56
|
-
const
|
|
57
|
-
toolkitVersions,
|
|
58
|
-
limit,
|
|
59
|
-
cursor: options.cursor,
|
|
60
|
-
});
|
|
32
|
+
const tools = await fetchComposioToolsBySlugs(session, scope, slugs);
|
|
61
33
|
spinner?.unmount();
|
|
62
34
|
if (isJsonMode()) {
|
|
63
35
|
outputJson({
|
|
64
36
|
requested_slugs: slugs,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
total_items: result.totalItems ?? null,
|
|
68
|
-
next_cursor: result.nextCursor ?? null,
|
|
69
|
-
tools: result.tools,
|
|
37
|
+
count: tools.length,
|
|
38
|
+
tools,
|
|
70
39
|
});
|
|
71
40
|
return;
|
|
72
41
|
}
|
|
73
|
-
renderToolsView(
|
|
42
|
+
renderToolsView(tools, slugs);
|
|
74
43
|
}
|
|
75
44
|
catch (err) {
|
|
76
45
|
spinner?.unmount();
|
|
77
|
-
|
|
78
|
-
throw err;
|
|
79
|
-
throw new CLIError(`Failed to fetch Composio tools: ${err instanceof Error ? err.message : String(err)}`, {
|
|
80
|
-
code: "API_CLIENT_ERROR",
|
|
81
|
-
cause: err,
|
|
82
|
-
suggestion: "Verify the tool slugs exist on Composio and that the API key has access to them.",
|
|
83
|
-
});
|
|
46
|
+
throw composioApiError(err);
|
|
84
47
|
}
|
|
85
48
|
}
|
|
86
|
-
function renderToolsView(tools, requestedSlugs
|
|
87
|
-
log(_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Header, { title: "Composio Tools", subtitle: `${tools.length} of ${requestedSlugs.length} requested
|
|
49
|
+
function renderToolsView(tools, requestedSlugs) {
|
|
50
|
+
log(_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Header, { title: "Composio Tools", subtitle: `${tools.length} of ${requestedSlugs.length} requested` }) }));
|
|
88
51
|
if (tools.length === 0) {
|
|
89
|
-
|
|
90
|
-
const missing = requestedSlugs.filter((s) => !returnedSlugs.has(s.toUpperCase()));
|
|
91
|
-
log(_jsx(StatusLine, { kind: "warning", label: `No tools returned${missing.length ? ` (missing: ${missing.join(", ")})` : "."}` }));
|
|
52
|
+
log(_jsx(StatusLine, { kind: "warning", label: `No tools returned for: ${requestedSlugs.join(", ")}` }));
|
|
92
53
|
return;
|
|
93
54
|
}
|
|
94
|
-
log(_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Section, { title: `Tools (${tools.length})`, children: tools.map((tool, i) => {
|
|
95
|
-
|
|
96
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: i < tools.length - 1 ? 1 : 0, children: [_jsx(Text, { bold: true, color: colors.brand, children: slug }), tool.name && tool.name !== slug && (_jsx(KeyValue, { label: "Name", value: String(tool.name) })), tool.toolkit_slug && (_jsx(KeyValue, { label: "Toolkit", value: tool.toolkit_name
|
|
97
|
-
? `${tool.toolkit_name} (${tool.toolkit_slug})`
|
|
98
|
-
: String(tool.toolkit_slug) })), tool.no_auth !== undefined && (_jsx(KeyValue, { label: "Auth", value: tool.no_auth ? "none" : "required" })), tool.description && (_jsx(Box, { marginLeft: 2, marginTop: 0, children: _jsx(Text, { color: colors.muted, children: String(tool.description) }) }))] }, slug));
|
|
99
|
-
}) }) }));
|
|
100
|
-
// Report any requested slugs that didn't come back, so JSON-less users
|
|
101
|
-
// still see which inputs were silently dropped by Composio.
|
|
102
|
-
const returnedSlugs = new Set(tools.map((t) => String(t.slug || t.name || "").toUpperCase()));
|
|
55
|
+
log(_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Section, { title: `Tools (${tools.length})`, children: tools.map((tool, i) => (_jsxs(Box, { flexDirection: "column", marginBottom: i < tools.length - 1 ? 1 : 0, children: [_jsx(Text, { bold: true, color: colors.brand, children: tool.slug }), tool.name && tool.name !== tool.slug && (_jsx(KeyValue, { label: "Name", value: tool.name })), tool.description && (_jsx(Box, { marginLeft: 2, children: _jsx(Text, { color: colors.muted, children: tool.description }) }))] }, tool.slug || `tool-${i}`))) }) }));
|
|
56
|
+
const returnedSlugs = new Set(tools.map((t) => t.slug.toUpperCase()));
|
|
103
57
|
const missing = requestedSlugs.filter((s) => !returnedSlugs.has(s.toUpperCase()));
|
|
104
58
|
if (missing.length > 0) {
|
|
105
|
-
log(_jsx(Box, { paddingX: 1, children: _jsx(
|
|
59
|
+
log(_jsx(Box, { paddingX: 1, children: _jsx(StatusLine, { kind: "warning", label: `Not returned: ${missing.join(", ")}` }) }));
|
|
106
60
|
}
|
|
107
61
|
}
|
|
108
62
|
//# sourceMappingURL=integration-tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-tools.js","sourceRoot":"","sources":["../../src/commands/integration-tools.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"integration-tools.js","sourceRoot":"","sources":["../../src/commands/integration-tools.tsx"],"names":[],"mappings":";AAqBA,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACxC,OAAO,EACL,uBAAuB,EACvB,yBAAyB,EACzB,eAAe,EACf,gBAAgB,GAEjB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,QAAQ,EACR,OAAO,GACR,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EACL,UAAU,EACV,UAAU,EACV,SAAS,GACV,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAMrD,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,gBAAgB,CACpC,UAAmC,EAAE;IAErC,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,CAAC;SAChC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,OAAO,CAAC,CAAC;IAEnB,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,eAAe,CAAC,kCAAkC,EAAE;YAC5D,UAAU,EACR,4FAA4F;SAC/F,CAAC,CAAC;IACL,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,uBAAuB,EAAE,CAAC;IAChD,MAAM,KAAK,GAAG,eAAe,CAAC,OAAO,CAAC,CAAC;IAEvC,IAAI,UAAU,EAAE,EAAE,CAAC;QAC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AM,GAAG,CAAC,EAAE,CAAC;QACvB,GAAG,CACD,KAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,YACd,KAAC,UAAU,IACT,IAAI,EAAC,SAAS,EACd,KAAK,EAAE,iBAAiB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAC5C,GACE,CACP,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -61,7 +61,6 @@ export interface IntegrationCreateOptions extends MCPAuthFlags {
|
|
|
61
61
|
networkId?: string;
|
|
62
62
|
networkCategoryId?: string;
|
|
63
63
|
versionId?: string;
|
|
64
|
-
composioApiKey?: string;
|
|
65
64
|
toolkit?: string;
|
|
66
65
|
/** Explicit auth scheme to use (e.g. OAUTH2, API_KEY). Skips the scheme-picker prompt. */
|
|
67
66
|
composioAuthScheme?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/commands/integration.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;
|
|
1
|
+
{"version":3,"file":"integration.d.ts","sourceRoot":"","sources":["../../src/commands/integration.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAMH,OAAO,EAkBL,KAAK,iBAAiB,EACtB,KAAK,YAAY,EAOlB,MAAM,oCAAoC,CAAC;AAgC5C,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,YAAY;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;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