@kortix/sdk 0.14.8 → 0.14.9
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 +123 -123
- package/dist/core/client/kortix.d.ts +123 -2
- package/dist/core/client/kortix.d.ts.map +1 -1
- package/dist/core/client/project-core.d.ts.map +1 -1
- package/dist/core/client/project-operations-admin.d.ts +52 -0
- package/dist/core/client/project-operations-admin.d.ts.map +1 -1
- package/dist/core/client/project-operations-review.d.ts +79 -0
- package/dist/core/client/project-operations-review.d.ts.map +1 -1
- package/dist/core/client/project-operations-review.js +79 -0
- package/dist/core/client/project-operations-review.js.map +1 -1
- package/dist/core/client/project-operations-workspace.d.ts +52 -0
- package/dist/core/client/project-operations-workspace.d.ts.map +1 -1
- package/dist/core/client/project-operations.d.ts +112 -4
- package/dist/core/client/project-operations.d.ts.map +1 -1
- package/dist/core/client/project-operations.js +22 -2
- package/dist/core/client/project-operations.js.map +1 -1
- package/dist/core/client/project-platform-security.d.ts +29 -0
- package/dist/core/client/project-platform-security.d.ts.map +1 -1
- package/dist/core/client/project-platform-security.js +27 -0
- package/dist/core/client/project-platform-security.js.map +1 -1
- package/dist/core/client/project-platform-settings.d.ts +2 -0
- package/dist/core/client/project-platform-settings.d.ts.map +1 -1
- package/dist/core/files/image-cache.d.ts +56 -0
- package/dist/core/files/image-cache.d.ts.map +1 -0
- package/dist/core/files/image-cache.js +130 -0
- package/dist/core/files/image-cache.js.map +1 -0
- package/dist/core/http/response-error.d.ts.map +1 -1
- package/dist/core/http/response-error.js +2 -0
- package/dist/core/http/response-error.js.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.d.ts +21 -15
- package/dist/core/rest/platform-client/host-boundary.d.ts.map +1 -1
- package/dist/core/rest/platform-client/host-boundary.js +10 -4
- package/dist/core/rest/platform-client/host-boundary.js.map +1 -1
- package/dist/core/rest/projects-client/agent-config.d.ts +4 -0
- package/dist/core/rest/projects-client/agent-config.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-config.js.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.d.ts +8 -0
- package/dist/core/rest/projects-client/agent-scope.d.ts.map +1 -1
- package/dist/core/rest/projects-client/agent-scope.js.map +1 -1
- package/dist/core/rest/projects-client/apps.d.ts +1 -1
- package/dist/core/rest/projects-client/apps.d.ts.map +1 -1
- package/dist/core/rest/projects-client/artifacts.d.ts +139 -0
- package/dist/core/rest/projects-client/artifacts.d.ts.map +1 -0
- package/dist/core/rest/projects-client/artifacts.js +72 -0
- package/dist/core/rest/projects-client/artifacts.js.map +1 -0
- package/dist/core/rest/projects-client/change-request-recovery.d.ts +30 -0
- package/dist/core/rest/projects-client/change-request-recovery.d.ts.map +1 -0
- package/dist/core/rest/projects-client/change-request-recovery.js +121 -0
- package/dist/core/rest/projects-client/change-request-recovery.js.map +1 -0
- package/dist/core/rest/projects-client/change-requests.d.ts +5 -0
- package/dist/core/rest/projects-client/change-requests.d.ts.map +1 -1
- package/dist/core/rest/projects-client/change-requests.js.map +1 -1
- package/dist/core/rest/projects-client/channels.d.ts +212 -2
- package/dist/core/rest/projects-client/channels.d.ts.map +1 -1
- package/dist/core/rest/projects-client/channels.js +111 -8
- package/dist/core/rest/projects-client/channels.js.map +1 -1
- package/dist/core/rest/projects-client/connectors.d.ts +259 -7
- package/dist/core/rest/projects-client/connectors.d.ts.map +1 -1
- package/dist/core/rest/projects-client/connectors.js +84 -4
- package/dist/core/rest/projects-client/connectors.js.map +1 -1
- package/dist/core/rest/projects-client/gateway.d.ts +23 -0
- package/dist/core/rest/projects-client/gateway.d.ts.map +1 -1
- package/dist/core/rest/projects-client/gateway.js.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.d.ts +4 -0
- package/dist/core/rest/projects-client/iam-actions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/iam-actions.js +4 -0
- package/dist/core/rest/projects-client/iam-actions.js.map +1 -1
- package/dist/core/rest/projects-client/index.d.ts +5 -0
- package/dist/core/rest/projects-client/index.d.ts.map +1 -1
- package/dist/core/rest/projects-client/index.js +5 -0
- package/dist/core/rest/projects-client/index.js.map +1 -1
- package/dist/core/rest/projects-client/memory.d.ts +236 -0
- package/dist/core/rest/projects-client/memory.d.ts.map +1 -0
- package/dist/core/rest/projects-client/memory.js +92 -0
- package/dist/core/rest/projects-client/memory.js.map +1 -0
- package/dist/core/rest/projects-client/projects.d.ts +21 -6
- package/dist/core/rest/projects-client/projects.d.ts.map +1 -1
- package/dist/core/rest/projects-client/projects.js +4 -4
- package/dist/core/rest/projects-client/projects.js.map +1 -1
- package/dist/core/rest/projects-client/review-items.d.ts.map +1 -1
- package/dist/core/rest/projects-client/review-items.js +40 -2
- package/dist/core/rest/projects-client/review-items.js.map +1 -1
- package/dist/core/rest/projects-client/session-groups.d.ts +48 -0
- package/dist/core/rest/projects-client/session-groups.d.ts.map +1 -0
- package/dist/core/rest/projects-client/session-groups.js +50 -0
- package/dist/core/rest/projects-client/session-groups.js.map +1 -0
- package/dist/core/rest/projects-client/sessions.d.ts +32 -0
- package/dist/core/rest/projects-client/sessions.d.ts.map +1 -1
- package/dist/core/rest/projects-client/sessions.js +10 -0
- package/dist/core/rest/projects-client/sessions.js.map +1 -1
- package/dist/core/rest/projects-client/setup-links.d.ts +5 -0
- package/dist/core/rest/projects-client/setup-links.d.ts.map +1 -1
- package/dist/core/rest/projects-client/setup-links.js.map +1 -1
- package/dist/core/rest/projects-client/spaces.d.ts +263 -0
- package/dist/core/rest/projects-client/spaces.d.ts.map +1 -0
- package/dist/core/rest/projects-client/spaces.js +165 -0
- package/dist/core/rest/projects-client/spaces.js.map +1 -0
- package/dist/core/rest/projects-client/triggers.d.ts +79 -32
- package/dist/core/rest/projects-client/triggers.d.ts.map +1 -1
- package/dist/core/rest/projects-client/triggers.js +1 -1
- package/dist/core/rest/projects-client/triggers.js.map +1 -1
- package/dist/core/session-log/turns/blocks.d.ts +2 -2
- package/dist/core/session-log/turns/blocks.d.ts.map +1 -1
- package/dist/core/session-log/turns/blocks.js +13 -5
- package/dist/core/session-log/turns/blocks.js.map +1 -1
- package/dist/core/session-log/turns/v1-parts.d.ts.map +1 -1
- package/dist/core/session-log/turns/v1-parts.js +18 -4
- package/dist/core/session-log/turns/v1-parts.js.map +1 -1
- package/dist/core/session-log/types.d.ts +13 -3
- package/dist/core/session-log/types.d.ts.map +1 -1
- package/dist/core/session-log/v1.d.ts +4 -1
- package/dist/core/session-log/v1.d.ts.map +1 -1
- package/dist/core/session-log/v1.js +2 -0
- package/dist/core/session-log/v1.js.map +1 -1
- package/dist/core/turns/parts.js +1 -1
- package/dist/core/turns/parts.js.map +1 -1
- package/dist/core/turns/safe-url.d.ts +3 -0
- package/dist/core/turns/safe-url.d.ts.map +1 -0
- package/dist/core/turns/safe-url.js +13 -0
- package/dist/core/turns/safe-url.js.map +1 -0
- package/dist/core/turns/segments/group-steps.d.ts.map +1 -1
- package/dist/core/turns/segments/group-steps.js +7 -6
- package/dist/core/turns/segments/group-steps.js.map +1 -1
- package/dist/core/turns/segments/narration.d.ts.map +1 -1
- package/dist/core/turns/segments/narration.js +35 -18
- package/dist/core/turns/segments/narration.js.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.d.ts +14 -4
- package/dist/core/turns/segments/session-activity-groups.d.ts.map +1 -1
- package/dist/core/turns/segments/session-activity-groups.js +47 -7
- package/dist/core/turns/segments/session-activity-groups.js.map +1 -1
- package/dist/core/turns/segments/work-split.d.ts +1 -1
- package/dist/core/turns/segments/work-split.d.ts.map +1 -1
- package/dist/core/turns/segments/work-split.js +3 -6
- package/dist/core/turns/segments/work-split.js.map +1 -1
- package/dist/core/turns/tools/image-gen-view.d.ts +162 -0
- package/dist/core/turns/tools/image-gen-view.d.ts.map +1 -0
- package/dist/core/turns/tools/image-gen-view.js +402 -0
- package/dist/core/turns/tools/image-gen-view.js.map +1 -0
- package/dist/core/turns/tools/index.d.ts +2 -1
- package/dist/core/turns/tools/index.d.ts.map +1 -1
- package/dist/core/turns/tools/index.js +2 -1
- package/dist/core/turns/tools/index.js.map +1 -1
- package/dist/core/turns/tools/tool-meta.d.ts.map +1 -1
- package/dist/core/turns/tools/tool-meta.js +8 -0
- package/dist/core/turns/tools/tool-meta.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/kortix.esm.min.js +41 -39
- package/dist/kortix.global.js +41 -39
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +5 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/query-keys.d.ts +55 -1
- package/dist/react/query-keys.d.ts.map +1 -1
- package/dist/react/query-keys.js +62 -2
- package/dist/react/query-keys.js.map +1 -1
- package/dist/react/session-cache-write.d.ts +8 -0
- package/dist/react/session-cache-write.d.ts.map +1 -1
- package/dist/react/session-cache-write.js +50 -1
- package/dist/react/session-cache-write.js.map +1 -1
- package/dist/react/use-artifacts.d.ts +49 -0
- package/dist/react/use-artifacts.d.ts.map +1 -0
- package/dist/react/use-artifacts.js +120 -0
- package/dist/react/use-artifacts.js.map +1 -0
- package/dist/react/use-feature-flag.d.ts +1 -1
- package/dist/react/use-feature-flag.d.ts.map +1 -1
- package/dist/react/use-feature-flag.js +4 -1
- package/dist/react/use-feature-flag.js.map +1 -1
- package/dist/react/use-project-apps.d.ts.map +1 -1
- package/dist/react/use-project-apps.js +8 -5
- package/dist/react/use-project-apps.js.map +1 -1
- package/dist/react/use-project-memory.d.ts +41 -0
- package/dist/react/use-project-memory.d.ts.map +1 -0
- package/dist/react/use-project-memory.js +126 -0
- package/dist/react/use-project-memory.js.map +1 -0
- package/dist/react/use-project-sessions.d.ts +26 -7
- package/dist/react/use-project-sessions.d.ts.map +1 -1
- package/dist/react/use-project-sessions.js +57 -21
- package/dist/react/use-project-sessions.js.map +1 -1
- package/dist/react/use-project-spaces.d.ts +74 -0
- package/dist/react/use-project-spaces.d.ts.map +1 -0
- package/dist/react/use-project-spaces.js +196 -0
- package/dist/react/use-project-spaces.js.map +1 -0
- package/dist/react/use-session-groups.d.ts +41 -0
- package/dist/react/use-session-groups.d.ts.map +1 -0
- package/dist/react/use-session-groups.js +140 -0
- package/dist/react/use-session-groups.js.map +1 -0
- package/dist/workspace-search/client.d.ts.map +1 -1
- package/dist/workspace-search/client.js +4 -10
- package/dist/workspace-search/client.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Project channels — Slack
|
|
1
|
+
// Project channels — Slack, Teams, email and Telegram connection installs.
|
|
2
2
|
import { backendApi } from '../../http/api-client.js';
|
|
3
3
|
import { unwrap } from './shared.js';
|
|
4
4
|
async function bindChatIdentity(service, token) {
|
|
@@ -61,28 +61,98 @@ export async function disconnectSlack(projectId) {
|
|
|
61
61
|
if (!res.success)
|
|
62
62
|
throw new Error(res.error?.message ?? 'Failed to disconnect');
|
|
63
63
|
}
|
|
64
|
+
const channelPath = (projectId, platform) => `/projects/${encodeURIComponent(projectId)}/channels/${platform}`;
|
|
65
|
+
// A literal path, so route-contract.test.ts resolves the Telegram-only routes
|
|
66
|
+
// to `/channels/telegram/…` and fails when the API drops one.
|
|
67
|
+
const telegramPath = (projectId) => `/projects/${encodeURIComponent(projectId)}/channels/telegram`;
|
|
68
|
+
async function channelUsers(projectId, platform, fallback) {
|
|
69
|
+
return unwrap(await backendApi.get(`${channelPath(projectId, platform)}/users`, { showErrors: false }), fallback);
|
|
70
|
+
}
|
|
71
|
+
async function allowUser(projectId, platform, userId, fallback) {
|
|
72
|
+
return unwrap(await backendApi.post(`${channelPath(projectId, platform)}/allowed-users`, { user_id: userId }, { showErrors: false }), fallback);
|
|
73
|
+
}
|
|
74
|
+
async function removeUser(projectId, platform, userId, fallback) {
|
|
75
|
+
return unwrap(await backendApi.delete(`${channelPath(projectId, platform)}/allowed-users/${encodeURIComponent(userId)}`, { showErrors: false }), fallback);
|
|
76
|
+
}
|
|
77
|
+
async function dismissRequest(projectId, platform, userId, fallback) {
|
|
78
|
+
return unwrap(await backendApi.delete(`${channelPath(projectId, platform)}/access-requests/${encodeURIComponent(userId)}`, { showErrors: false }), fallback);
|
|
79
|
+
}
|
|
80
|
+
async function userPhoto(projectId, platform, userId, version, signal, fallback) {
|
|
81
|
+
const query = version ? `?v=${encodeURIComponent(version)}` : '';
|
|
82
|
+
const res = await backendApi.get(`${channelPath(projectId, platform)}/users/${encodeURIComponent(userId)}/photo${query}`, { showErrors: false, signal });
|
|
83
|
+
if (res.error?.status === 404)
|
|
84
|
+
return null;
|
|
85
|
+
return unwrap(res, fallback);
|
|
86
|
+
}
|
|
64
87
|
/** The project's Telegram bot, or null when none is connected (or the flag is off). */
|
|
65
88
|
export async function getTelegramInstallation(projectId) {
|
|
66
|
-
const res = await backendApi.get(
|
|
89
|
+
const res = await backendApi.get(`${telegramPath(projectId)}/installation`, { showErrors: false });
|
|
67
90
|
if (!res.success)
|
|
68
91
|
return null;
|
|
69
92
|
return res.data ?? null;
|
|
70
93
|
}
|
|
71
94
|
/** Connect a Telegram bot: Kortix registers its webhook and stores the token server-side. */
|
|
72
95
|
export async function connectTelegram(projectId, input) {
|
|
73
|
-
return unwrap(await backendApi.post(
|
|
96
|
+
return unwrap(await backendApi.post(`${telegramPath(projectId)}/connect`, input, { showErrors: false }), 'Failed to connect Telegram');
|
|
74
97
|
}
|
|
75
98
|
/** Replace the Telegram user ids allowed to talk to the bot. */
|
|
76
99
|
export async function setTelegramAllowedUsers(projectId, userIds) {
|
|
77
|
-
return unwrap(await backendApi.put(
|
|
100
|
+
return unwrap(await backendApi.put(`${telegramPath(projectId)}/allowed-users`, { user_ids: userIds }, { showErrors: false }), 'Failed to update allowed Telegram users');
|
|
78
101
|
}
|
|
79
102
|
export async function disconnectTelegram(projectId) {
|
|
80
|
-
const res = await backendApi.delete(
|
|
81
|
-
showErrors: false,
|
|
82
|
-
});
|
|
103
|
+
const res = await backendApi.delete(telegramPath(projectId), { showErrors: false });
|
|
83
104
|
if (!res.success)
|
|
84
105
|
throw new Error(res.error?.message ?? 'Failed to disconnect Telegram');
|
|
85
106
|
}
|
|
107
|
+
/** The allowed users and the people who asked for access, with their Telegram names. */
|
|
108
|
+
export function listTelegramUsers(projectId) {
|
|
109
|
+
return channelUsers(projectId, 'telegram', 'Failed to load Telegram users');
|
|
110
|
+
}
|
|
111
|
+
/** Allow one Telegram user. Adds the id once and clears their access request. */
|
|
112
|
+
export function allowTelegramUser(projectId, userId) {
|
|
113
|
+
return allowUser(projectId, 'telegram', userId, 'Failed to allow the Telegram user');
|
|
114
|
+
}
|
|
115
|
+
/** Remove one Telegram user from the allowed list. Idempotent. */
|
|
116
|
+
export function removeTelegramUser(projectId, userId) {
|
|
117
|
+
return removeUser(projectId, 'telegram', userId, 'Failed to remove the Telegram user');
|
|
118
|
+
}
|
|
119
|
+
/** Dismiss one access request without allowing the user. Idempotent. */
|
|
120
|
+
export function dismissTelegramAccessRequest(projectId, userId) {
|
|
121
|
+
return dismissRequest(projectId, 'telegram', userId, 'Failed to dismiss the access request');
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* A Telegram user's profile photo (JPEG), fetched through the Kortix API so the
|
|
125
|
+
* bot token stays server-side. Null when the user has no visible photo.
|
|
126
|
+
* `version` is `TelegramUser.photo_version`; it keys the HTTP cache.
|
|
127
|
+
*/
|
|
128
|
+
export function getTelegramUserPhoto(projectId, userId, version, signal) {
|
|
129
|
+
return userPhoto(projectId, 'telegram', userId, version, signal, 'Failed to load the Telegram photo');
|
|
130
|
+
}
|
|
131
|
+
/** The allowed users and the people who asked for access on one chat platform, with their names there. */
|
|
132
|
+
export function listChannelUsers(projectId, platform) {
|
|
133
|
+
return channelUsers(projectId, platform, 'Failed to load the users');
|
|
134
|
+
}
|
|
135
|
+
/** Allow one user on a chat platform. Adds the id once and clears their access request. */
|
|
136
|
+
export function allowChannelUser(projectId, platform, userId) {
|
|
137
|
+
return allowUser(projectId, platform, userId, 'Failed to allow the user');
|
|
138
|
+
}
|
|
139
|
+
/** Remove one user from a chat platform's allowed list. Idempotent. */
|
|
140
|
+
export function removeChannelUser(projectId, platform, userId) {
|
|
141
|
+
return removeUser(projectId, platform, userId, 'Failed to remove the user');
|
|
142
|
+
}
|
|
143
|
+
/** Dismiss one access request on a chat platform without allowing the user. Idempotent. */
|
|
144
|
+
export function dismissChannelAccessRequest(projectId, platform, userId) {
|
|
145
|
+
return dismissRequest(projectId, platform, userId, 'Failed to dismiss the access request');
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* A chat user's profile photo, fetched through the Kortix API so the bot
|
|
149
|
+
* credential stays server-side. Null when the user has no visible photo. The
|
|
150
|
+
* Blob's type is the image type (`image/jpeg` on Telegram).
|
|
151
|
+
* `version` is `ChannelUser.photo_version`; it keys the HTTP cache.
|
|
152
|
+
*/
|
|
153
|
+
export function getChannelUserPhoto(projectId, platform, userId, version, signal) {
|
|
154
|
+
return userPhoto(projectId, platform, userId, version, signal, 'Failed to load the photo');
|
|
155
|
+
}
|
|
86
156
|
/**
|
|
87
157
|
* Download a Slack-hosted file through the server-side proxy (SSRF-guarded to
|
|
88
158
|
* `*.slack.com`) — the bot token never reaches the sandbox. Backs `slack download`.
|
|
@@ -113,7 +183,7 @@ function normalizeEmailInstallation(value) {
|
|
|
113
183
|
connectorSlug,
|
|
114
184
|
};
|
|
115
185
|
}
|
|
116
|
-
const DEFAULT_EMAIL_MODE = { provider: '
|
|
186
|
+
const DEFAULT_EMAIL_MODE = { provider: 'resend', managed_available: false };
|
|
117
187
|
export async function getEmailInstallation(projectId, connectorSlug) {
|
|
118
188
|
const query = connectorSlug ? `?connector_slug=${encodeURIComponent(connectorSlug)}` : '';
|
|
119
189
|
const res = await backendApi.get(`/projects/${encodeURIComponent(projectId)}/channels/email/installation${query}`, { showErrors: false });
|
|
@@ -131,6 +201,22 @@ export async function connectEmail(projectId, input) {
|
|
|
131
201
|
const installation = unwrap(await backendApi.post(`/projects/${encodeURIComponent(projectId)}/channels/email/connect`, input, { showErrors: false }), 'Failed to connect email');
|
|
132
202
|
return normalizeEmailInstallation(installation);
|
|
133
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* The domains a Resend API key can create inboxes on. No `apiKey`: the
|
|
206
|
+
* deployment's managed account, which offers its one managed domain. The key
|
|
207
|
+
* travels in the POST body, never in a URL.
|
|
208
|
+
*/
|
|
209
|
+
export async function listEmailDomains(projectId, input = {}) {
|
|
210
|
+
return unwrap(await backendApi.post(`/projects/${encodeURIComponent(projectId)}/channels/email/domains`, input.apiKey ? { api_key: input.apiKey } : {}, { showErrors: false }), 'Failed to list email domains');
|
|
211
|
+
}
|
|
212
|
+
/** Add a custom domain to the Resend account of `apiKey`; returns the DNS records to set. */
|
|
213
|
+
export async function addEmailDomain(projectId, input) {
|
|
214
|
+
return unwrap(await backendApi.post(`/projects/${encodeURIComponent(projectId)}/channels/email/domains/add`, { api_key: input.apiKey, domain: input.domain }, { showErrors: false }), 'Failed to add the email domain');
|
|
215
|
+
}
|
|
216
|
+
/** Ask Resend to check a custom domain's DNS records again. */
|
|
217
|
+
export async function verifyEmailDomain(projectId, input) {
|
|
218
|
+
return unwrap(await backendApi.post(`/projects/${encodeURIComponent(projectId)}/channels/email/domains/verify`, { api_key: input.apiKey, domain_id: input.domainId }, { showErrors: false }), 'Failed to check the email domain');
|
|
219
|
+
}
|
|
134
220
|
export async function disconnectEmail(projectId, connectorSlug) {
|
|
135
221
|
const query = connectorSlug ? `?connector_slug=${encodeURIComponent(connectorSlug)}` : '';
|
|
136
222
|
const res = await backendApi.delete(`/projects/${encodeURIComponent(projectId)}/channels/email/installation${query}`, { showErrors: false });
|
|
@@ -141,6 +227,23 @@ export async function updateEmailPolicy(projectId, connectorSlug, senderPolicy)
|
|
|
141
227
|
const installation = unwrap(await backendApi.patch(`/projects/${encodeURIComponent(projectId)}/channels/email/installation`, { connector_slug: connectorSlug ?? 'kortix_email', sender_policy: senderPolicy }, { showErrors: false }), 'Failed to update email policy');
|
|
142
228
|
return normalizeEmailInstallation(installation);
|
|
143
229
|
}
|
|
230
|
+
/** The inboxes you can see: every shared one, and your own private ones. */
|
|
231
|
+
export async function listEmailInboxes(projectId) {
|
|
232
|
+
const data = unwrap(await backendApi.get(`/projects/${encodeURIComponent(projectId)}/channels/email/inboxes`, { showErrors: false }), 'Failed to list email inboxes');
|
|
233
|
+
return data.inboxes ?? [];
|
|
234
|
+
}
|
|
235
|
+
/** Add an inbox (a new account of the email connector). The key travels in the body. */
|
|
236
|
+
export async function addEmailInbox(projectId, input) {
|
|
237
|
+
return unwrap(await backendApi.post(`/projects/${encodeURIComponent(projectId)}/channels/email/inboxes`, input, { showErrors: false }), 'Failed to add the email inbox');
|
|
238
|
+
}
|
|
239
|
+
/** Change who may email an inbox, its agent, or its names. */
|
|
240
|
+
export async function updateEmailInbox(projectId, connectionId, input) {
|
|
241
|
+
return unwrap(await backendApi.patch(`/projects/${encodeURIComponent(projectId)}/channels/email/inboxes/${encodeURIComponent(connectionId)}`, input, { showErrors: false }), 'Failed to update the email inbox');
|
|
242
|
+
}
|
|
243
|
+
/** Remove an inbox. Resend deletes it too when Kortix created it. */
|
|
244
|
+
export async function removeEmailInbox(projectId, connectionId) {
|
|
245
|
+
return unwrap(await backendApi.delete(`/projects/${encodeURIComponent(projectId)}/channels/email/inboxes/${encodeURIComponent(connectionId)}`, { showErrors: false }), 'Failed to remove the email inbox');
|
|
246
|
+
}
|
|
144
247
|
export async function listChannelBindings(projectId) {
|
|
145
248
|
return unwrap(await backendApi.get(`/projects/${encodeURIComponent(projectId)}/channels/bindings`, { showErrors: false }), 'Failed to load channel bindings');
|
|
146
249
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/channels.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAEzE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EA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E,CACtB,EACD,+BAA+B,CAChC,CAAC;IACF,OAAO,0BAA0B,CAAC,YAAY,CAAC,CAAC;AAClD,CAAC;AA8DD,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,SAAiB;IACzD,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,GAAG,CAClB,aAAa,kBAAkB,CAAC,SAAS,CAAC,oBAAoB,EAC9D,EAAE,UAAU,EAAE,KAAK,EAAE,CACtB,EACD,iCAAiC,CAClC,CAAC;AACJ,CAAC;AAUD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAAiB,EACjB,SAAiB,EACjB,KAAgC;IAEhC,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,KAAK,CACpB,aAAa,kBAAkB,CAAC,SAAS,CAAC,sBAAsB,kBAAkB,CAAC,SAAS,CAAC,EAAE,EAC/F,KAAK,EACL,EAAE,UAAU,EAAE,KAAK,EAAE,CACtB,EACD,kCAAkC,CACnC,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../../../src/core/rest/projects-client/channels.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AASlC,KAAK,UAAU,gBAAgB,CAC7B,OAA0B,EAC1B,KAAa;IAEb,OAAO,MAAM,CACX,MAAM,UAAU,CAAC,IAAI,CAAyB,aAAa,OAAO,gBAAgB,EAAE,EAAE,KAAK,EAAE,CAAC,EAC9F,gCAAgC,CACjC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,gBAAgB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;AAC1C,CAAC;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
|
name: string;
|
|
4
5
|
description: string;
|
|
5
6
|
risk: 'read' | 'write' | 'destructive';
|
|
7
|
+
/**
|
|
8
|
+
* What the tool likely does, for grouping: an un-annotated MCP or managed
|
|
9
|
+
* tool's stored `write` is a fail-closed fallback, so its name decides
|
|
10
|
+
* (`unknown` when the name says nothing). The admin list (`listConnectors`)
|
|
11
|
+
* only; the gateway enforces `risk`. Absent on older servers.
|
|
12
|
+
*/
|
|
13
|
+
likely_risk?: 'read' | 'write' | 'unknown';
|
|
6
14
|
inputSchema: Record<string, unknown> | null;
|
|
7
15
|
/**
|
|
8
16
|
* JSON Schema of the call's `output`. Present only when the catalog was read
|
|
@@ -45,6 +53,9 @@ export interface ConnectorCatalogEntry {
|
|
|
45
53
|
accounts?: ConnectorAccount[];
|
|
46
54
|
/** Label of the account an unnamed call resolves to, or null if none. */
|
|
47
55
|
default_account?: string | null;
|
|
56
|
+
/** The calling agent's policy set on this connector; `actions` omits what it
|
|
57
|
+
* blocks. Absent when the caller has none (base rules) or on older servers. */
|
|
58
|
+
policy_set?: string;
|
|
48
59
|
}
|
|
49
60
|
/** One callable connector action, identified by `<connector>.<action>`. */
|
|
50
61
|
export interface ConnectorTool {
|
|
@@ -78,9 +89,16 @@ export interface ConnectorCallResult<T = unknown, O = unknown> {
|
|
|
78
89
|
upstream_status?: number | null;
|
|
79
90
|
/** A failure the upstream reported inside a 2xx (MCP `isError`, GraphQL `errors`). */
|
|
80
91
|
upstream_error?: string;
|
|
92
|
+
/** With `status: 'tool_error'` (`ok: false`, HTTP 200): the tool's own error text. */
|
|
93
|
+
error?: string;
|
|
81
94
|
risk?: ConnectorAction['risk'];
|
|
82
95
|
status?: string;
|
|
83
96
|
reason?: string;
|
|
97
|
+
/** On a denial the caller's policy set decided (`reason` `policy_block` or
|
|
98
|
+
* `policy_set_missing`): the set name. */
|
|
99
|
+
policy_set?: string;
|
|
100
|
+
/** With `policy_set`: the agent whose set decided. */
|
|
101
|
+
agent?: string | null;
|
|
84
102
|
execution_id?: string | null;
|
|
85
103
|
retryable?: boolean;
|
|
86
104
|
approval_url?: string | null;
|
|
@@ -249,6 +267,13 @@ export interface AdminConnector {
|
|
|
249
267
|
* `status` is `error`. Absent on older servers.
|
|
250
268
|
*/
|
|
251
269
|
lastError?: string | null;
|
|
270
|
+
/** The one state to show: `needs_account` = it needs an account and has none
|
|
271
|
+
* the caller can use. Absent on older servers. */
|
|
272
|
+
state?: 'disabled' | 'error' | 'needs_account' | 'connected';
|
|
273
|
+
/** Why, in a few words, for every state but `connected`. */
|
|
274
|
+
state_reason?: string | null;
|
|
275
|
+
/** False: the connector runs with no account. Absent on older servers. */
|
|
276
|
+
auth_needed?: boolean;
|
|
252
277
|
}
|
|
253
278
|
export interface ConnectorsResponse {
|
|
254
279
|
connectors: AdminConnector[];
|
|
@@ -725,29 +750,155 @@ export type ConnectorPolicyAction = 'always_run' | 'require_approval' | 'block';
|
|
|
725
750
|
export interface ConnectorPolicyRule {
|
|
726
751
|
match: string;
|
|
727
752
|
action: ConnectorPolicyAction;
|
|
753
|
+
/** ALL must hold for the rule to apply. Absent/empty = a plain tool-name rule.
|
|
754
|
+
* Servers that predate connector-rule conditions drop them on write. */
|
|
755
|
+
conditions?: PolicyArgCondition[];
|
|
728
756
|
}
|
|
729
|
-
/**
|
|
730
|
-
|
|
757
|
+
/**
|
|
758
|
+
* Which policy scope decided an action. Project rules win and cannot be overridden here.
|
|
759
|
+
* `policy_set` = the calling agent's policy set on this connector
|
|
760
|
+
* (`agents.<a>.policy_sets.<slug>`), evaluated after project rules and before
|
|
761
|
+
* the connector's base rules.
|
|
762
|
+
*/
|
|
763
|
+
export type ConnectorPolicySource = 'project' | 'policy_set' | 'connector' | 'risk_default' | 'allow_all';
|
|
731
764
|
export interface ConnectorEffectivePolicy {
|
|
732
765
|
/** Connector-relative tool path, e.g. `send_email`. */
|
|
733
766
|
path: string;
|
|
734
767
|
action: ConnectorPolicyAction;
|
|
735
768
|
source: ConnectorPolicySource;
|
|
769
|
+
/** The stored risk the project default decides on. Older servers omit it. */
|
|
770
|
+
risk?: ConnectorAction['risk'];
|
|
771
|
+
/** The rule that decided; absent when the default did. Older servers omit it. */
|
|
772
|
+
rule?: ConnectorPolicyRule;
|
|
736
773
|
}
|
|
737
|
-
|
|
774
|
+
/** Selects one policy set on a connector. Absent, empty or `base` = the base rules. */
|
|
775
|
+
export interface ConnectorPolicySetOptions {
|
|
776
|
+
policySet?: string;
|
|
777
|
+
}
|
|
778
|
+
/**
|
|
779
|
+
* Read a connector's rules: the base rules, or one policy set's rules with
|
|
780
|
+
* `{ policySet }`. A set that does not exist answers 404 `policy_set_not_found`.
|
|
781
|
+
*/
|
|
782
|
+
export declare function getConnectorPolicies(projectId: string, slug: string, options?: ConnectorPolicySetOptions): Promise<{
|
|
738
783
|
policies: ConnectorPolicyRule[];
|
|
784
|
+
/** The policy set these rules belong to; absent for the base rules. */
|
|
785
|
+
policy_set?: string;
|
|
739
786
|
/**
|
|
740
787
|
* Resolved per tool through the same function the call gate uses. Present
|
|
741
788
|
* so an editor can show WHICH scope decided — without it a connector rule
|
|
742
789
|
* that a project-scope rule silently overrules still renders as if it applied.
|
|
790
|
+
* For a policy set, it is what an agent with that set gets.
|
|
743
791
|
* Older servers omit this; treat as empty.
|
|
744
792
|
*/
|
|
745
793
|
effective?: ConnectorEffectivePolicy[];
|
|
746
794
|
/** Project-scope rules, which are evaluated first and win. */
|
|
747
795
|
project_policies?: ConnectorPolicyRule[];
|
|
748
796
|
default_mode?: "risk" | "allow_all";
|
|
797
|
+
/** Marked sensitive: every tool no rule decides needs approval. */
|
|
798
|
+
sensitive?: boolean;
|
|
799
|
+
}>;
|
|
800
|
+
/**
|
|
801
|
+
* Replace a connector's rules: the base rules, or one policy set's rules with
|
|
802
|
+
* `{ policySet }`. This is the only writer of a set's rules; the set itself is
|
|
803
|
+
* created with {@link upsertConnectorPolicySet}.
|
|
804
|
+
*/
|
|
805
|
+
export declare function setConnectorPolicies(projectId: string, slug: string, policies: ConnectorPolicyRule[], options?: ConnectorPolicySetOptions): Promise<{
|
|
806
|
+
ok: boolean;
|
|
807
|
+
sync?: ConnectorSyncResult;
|
|
808
|
+
}>;
|
|
809
|
+
/**
|
|
810
|
+
* A named rule set on one connector (`connectors[].policy_sets.<name>` in
|
|
811
|
+
* kortix.yaml). An agent gets it with `agents.<a>.policy_sets.<slug>: <name>`,
|
|
812
|
+
* so one connected account serves agents with different rules.
|
|
813
|
+
*/
|
|
814
|
+
export interface ConnectorPolicySet {
|
|
815
|
+
name: string;
|
|
816
|
+
description: string | null;
|
|
817
|
+
policies: ConnectorPolicyRule[];
|
|
818
|
+
/** The agents whose `policy_sets` name this set. */
|
|
819
|
+
agents: string[];
|
|
820
|
+
}
|
|
821
|
+
/** List a connector's policy sets, sets with zero rules included. */
|
|
822
|
+
export declare function listConnectorPolicySets(projectId: string, slug: string): Promise<{
|
|
823
|
+
sets: ConnectorPolicySet[];
|
|
824
|
+
}>;
|
|
825
|
+
/**
|
|
826
|
+
* Create a policy set, or set (`string`) or clear (`null`) its description.
|
|
827
|
+
* Omitting `description` on an existing set keeps it. Rules are written with
|
|
828
|
+
* `setConnectorPolicies(projectId, slug, policies, { policySet: name })`.
|
|
829
|
+
*/
|
|
830
|
+
export declare function upsertConnectorPolicySet(projectId: string, slug: string, name: string, input?: {
|
|
831
|
+
description?: string | null;
|
|
832
|
+
template?: ConnectorPolicySetTemplate;
|
|
833
|
+
}): Promise<{
|
|
834
|
+
ok: boolean;
|
|
835
|
+
sync?: ConnectorSyncResult;
|
|
836
|
+
created: boolean;
|
|
837
|
+
/** The template applied, when one was sent. */
|
|
838
|
+
template?: ConnectorPolicySetTemplate;
|
|
839
|
+
/** How many rules the template wrote. */
|
|
840
|
+
rules?: number;
|
|
841
|
+
}>;
|
|
842
|
+
/**
|
|
843
|
+
* A policy set's starting rules, written by the server from the connector's
|
|
844
|
+
* tools: `read_only` blocks every tool that is not a read, `ask_before_writes`
|
|
845
|
+
* asks a person for each. A tool whose name says nothing gets the rule too.
|
|
846
|
+
* Applying a template replaces the set's rules.
|
|
847
|
+
*/
|
|
848
|
+
export type ConnectorPolicySetTemplate = 'read_only' | 'ask_before_writes';
|
|
849
|
+
/** One agent on one connector: may it use it, and under which rule set. */
|
|
850
|
+
export interface ConnectorAgentRow {
|
|
851
|
+
agent: string;
|
|
852
|
+
/** The agent's grant lists the connector (or all connectors). */
|
|
853
|
+
granted: boolean;
|
|
854
|
+
/** The rule set it runs under here; null = the base rules. */
|
|
855
|
+
policy_set: string | null;
|
|
856
|
+
/** It names a set the connector does not define: every call is blocked. */
|
|
857
|
+
policy_set_missing: boolean;
|
|
858
|
+
}
|
|
859
|
+
/** Every declared agent of the project on one connector. */
|
|
860
|
+
export declare function listConnectorAgents(projectId: string, slug: string): Promise<{
|
|
861
|
+
slug: string;
|
|
862
|
+
policy_sets: string[];
|
|
863
|
+
agents: ConnectorAgentRow[];
|
|
864
|
+
}>;
|
|
865
|
+
/** Every connector × every declared agent, from kortix.yaml. */
|
|
866
|
+
export interface ConnectorRulesMatrix {
|
|
867
|
+
connectors: Array<{
|
|
868
|
+
slug: string;
|
|
869
|
+
name: string;
|
|
870
|
+
policy_sets: string[];
|
|
871
|
+
}>;
|
|
872
|
+
agents: Array<{
|
|
873
|
+
agent: string;
|
|
874
|
+
cells: Record<string, Omit<ConnectorAgentRow, 'agent'>>;
|
|
875
|
+
}>;
|
|
876
|
+
}
|
|
877
|
+
/** Who uses which connector under which rule set, in one request. */
|
|
878
|
+
export declare function getConnectorRulesMatrix(projectId: string): Promise<ConnectorRulesMatrix>;
|
|
879
|
+
/** OAuth2 client credentials for a connector's shared account. `token_endpoint_auth_method` defaults to `client_secret_basic`. */
|
|
880
|
+
export type ConnectorOAuth2ClientCredentialsInput = Omit<OAuth2ClientCredentials, 'type' | 'token_endpoint_auth_method'> & {
|
|
881
|
+
token_endpoint_auth_method?: OAuth2TokenEndpointAuthMethod;
|
|
882
|
+
};
|
|
883
|
+
/**
|
|
884
|
+
* Set OAuth2 client credentials on a connector's shared account. The server
|
|
885
|
+
* requests a token first and stores nothing when that fails (`503`
|
|
886
|
+
* `oauth2_token_failed`); it refreshes the token before each call needs it.
|
|
887
|
+
* The secret is never returned.
|
|
888
|
+
*/
|
|
889
|
+
export declare function setConnectorOAuth2ClientCredentials(projectId: string, slug: string, input: ConnectorOAuth2ClientCredentialsInput): Promise<{
|
|
890
|
+
ok: boolean;
|
|
891
|
+
slug: string;
|
|
892
|
+
account: string | null;
|
|
893
|
+
expires_at: string | null;
|
|
894
|
+
}>;
|
|
895
|
+
/** Rename a policy set and every agent assignment of it, in one commit. */
|
|
896
|
+
export declare function renameConnectorPolicySet(projectId: string, slug: string, name: string, newName: string): Promise<{
|
|
897
|
+
ok: boolean;
|
|
898
|
+
sync?: ConnectorSyncResult;
|
|
749
899
|
}>;
|
|
750
|
-
|
|
900
|
+
/** Delete a policy set. Answers 409 `policy_set_in_use` (with `agents`) while an agent uses it. */
|
|
901
|
+
export declare function deleteConnectorPolicySet(projectId: string, slug: string, name: string): Promise<{
|
|
751
902
|
ok: boolean;
|
|
752
903
|
sync?: ConnectorSyncResult;
|
|
753
904
|
}>;
|
|
@@ -896,7 +1047,7 @@ export interface McpServerSignInCheck {
|
|
|
896
1047
|
one_click: boolean;
|
|
897
1048
|
}
|
|
898
1049
|
export declare function checkMcpServerSignIn(projectId: string, url: string): Promise<McpServerSignInCheck>;
|
|
899
|
-
/** A Pipedream or Composio connector, and the Kortix app it moves to
|
|
1050
|
+
/** A Pipedream or Composio connector, and the Kortix app it moves to. */
|
|
900
1051
|
export interface ConnectorMove {
|
|
901
1052
|
slug: string;
|
|
902
1053
|
name: string;
|
|
@@ -1105,7 +1256,18 @@ export declare function listConnectSections(projectId: string, opts?: {
|
|
|
1105
1256
|
perCategory?: number;
|
|
1106
1257
|
maxCategories?: number;
|
|
1107
1258
|
}): Promise<ConnectSectionsPage>;
|
|
1108
|
-
|
|
1259
|
+
/** `composio`: a managed app. Install it as a
|
|
1260
|
+
* Composio toolkit from `DiscoverConnector.composio`. `cli` is kept for
|
|
1261
|
+
* compatibility: the catalogue no longer returns CLI records (2026-10-24),
|
|
1262
|
+
* and the API answers `400` to `kind=cli`. */
|
|
1263
|
+
export type DiscoverConnectorKind = 'openapi' | 'mcp' | 'graphql' | 'composio' | 'kortix' | 'cli';
|
|
1264
|
+
/** What a `kortix` entry is: an integration Kortix built itself — a channel
|
|
1265
|
+
* people message the agent in (`slack`, `teams`, `email`, `telegram`) or the
|
|
1266
|
+
* computer it works on (`computer`). It is set up on its own page, never
|
|
1267
|
+
* through `installDiscoverConnector`. */
|
|
1268
|
+
export interface DiscoverKortixApp {
|
|
1269
|
+
app: 'slack' | 'teams' | 'email' | 'telegram' | 'computer';
|
|
1270
|
+
}
|
|
1109
1271
|
export interface DiscoverConnector {
|
|
1110
1272
|
id: string;
|
|
1111
1273
|
kind: DiscoverConnectorKind;
|
|
@@ -1118,6 +1280,19 @@ export interface DiscoverConnector {
|
|
|
1118
1280
|
categories: string[];
|
|
1119
1281
|
feeds: string[];
|
|
1120
1282
|
popularity: number | null;
|
|
1283
|
+
/** The app's hosted MCP server. MCP entries only. */
|
|
1284
|
+
mcpUrl?: string;
|
|
1285
|
+
/** The server signs in with OAuth. */
|
|
1286
|
+
oauth?: boolean;
|
|
1287
|
+
/** Connects with nothing to set up: a public or self-registering MCP server,
|
|
1288
|
+
* a Kortix catalogue app, or a managed app. */
|
|
1289
|
+
oneClick?: boolean;
|
|
1290
|
+
/** The managed toolkit a `composio` entry installs. */
|
|
1291
|
+
composio?: ConnectToolkit;
|
|
1292
|
+
/** What a `kortix` entry sets up. */
|
|
1293
|
+
kortix?: DiscoverKortixApp;
|
|
1294
|
+
/** The project's profiles that are this app's way in (MCP URL or toolkit). Absent on older servers. */
|
|
1295
|
+
installed?: string[];
|
|
1121
1296
|
}
|
|
1122
1297
|
export interface DiscoverConnectorTemplate {
|
|
1123
1298
|
provider: 'openapi' | 'postman' | 'mcp' | 'graphql';
|
|
@@ -1134,7 +1309,8 @@ export interface DiscoverConnectorTemplate {
|
|
|
1134
1309
|
}
|
|
1135
1310
|
export interface DiscoverConnectorVariant {
|
|
1136
1311
|
id: string;
|
|
1137
|
-
|
|
1312
|
+
/** `composio`: a Composio app, installed from `composio`. */
|
|
1313
|
+
kind: 'openapi' | 'postman' | 'mcp' | 'graphql' | 'http' | 'composio' | 'kortix' | 'cli';
|
|
1138
1314
|
name: string;
|
|
1139
1315
|
url: string | null;
|
|
1140
1316
|
docs: string | null;
|
|
@@ -1143,16 +1319,30 @@ export interface DiscoverConnectorVariant {
|
|
|
1143
1319
|
requiresAuth: boolean;
|
|
1144
1320
|
command: string | null;
|
|
1145
1321
|
connector: DiscoverConnectorTemplate | null;
|
|
1322
|
+
/** Connects with nothing to set up. */
|
|
1323
|
+
oneClick?: boolean;
|
|
1324
|
+
/** The way Install uses without asking; the first variant. */
|
|
1325
|
+
recommended?: boolean;
|
|
1326
|
+
/** The Composio toolkit a `composio` variant installs. */
|
|
1327
|
+
composio?: ConnectToolkit;
|
|
1328
|
+
/** What a `kortix` variant sets up. */
|
|
1329
|
+
kortix?: DiscoverKortixApp;
|
|
1330
|
+
/** The project's profiles that are this way. Absent on older servers. */
|
|
1331
|
+
installed?: string[];
|
|
1146
1332
|
}
|
|
1147
1333
|
export interface DiscoverConnectorsPage {
|
|
1148
1334
|
items: DiscoverConnector[];
|
|
1149
1335
|
total: number;
|
|
1150
1336
|
nextCursor?: string;
|
|
1151
1337
|
hasMore: boolean;
|
|
1338
|
+
/** Catalogue sources that could not be reached (`integrations`, `composio`): some apps are missing. */
|
|
1339
|
+
degraded?: string[];
|
|
1152
1340
|
}
|
|
1153
1341
|
export interface DiscoverConnectorDetail {
|
|
1154
1342
|
item: DiscoverConnector;
|
|
1155
1343
|
variants: DiscoverConnectorVariant[];
|
|
1344
|
+
/** Every profile the project has of this app, any way. Absent on older servers. */
|
|
1345
|
+
installed?: string[];
|
|
1156
1346
|
}
|
|
1157
1347
|
/** @deprecated Use `DiscoverConnectorKind`. */
|
|
1158
1348
|
export type DiscoverIntegrationKind = DiscoverConnectorKind;
|
|
@@ -1173,6 +1363,10 @@ export interface DiscoverConnectorsQuery {
|
|
|
1173
1363
|
* exactly the connectors that section counted, picks first. */
|
|
1174
1364
|
category?: string;
|
|
1175
1365
|
limit?: number;
|
|
1366
|
+
/** Only the entries that connect with nothing to set up (`oneClick`). */
|
|
1367
|
+
oneClick?: boolean;
|
|
1368
|
+
/** Only the entries that connect these ways. */
|
|
1369
|
+
kinds?: DiscoverConnectorKind[];
|
|
1176
1370
|
}
|
|
1177
1371
|
/**
|
|
1178
1372
|
* A page of the Discover catalogue. Accepts the original positional
|
|
@@ -1201,6 +1395,8 @@ export interface DiscoverSectionsPage {
|
|
|
1201
1395
|
sections: DiscoverSection[];
|
|
1202
1396
|
/** Every section in browse order. */
|
|
1203
1397
|
categories: DiscoverCategory[];
|
|
1398
|
+
/** Catalogue sources that could not be reached. */
|
|
1399
|
+
degraded?: string[];
|
|
1204
1400
|
}
|
|
1205
1401
|
/**
|
|
1206
1402
|
* The Discover browse page in one request: Popular, then a fixed top slice of
|
|
@@ -1209,8 +1405,64 @@ export interface DiscoverSectionsPage {
|
|
|
1209
1405
|
export declare function listDiscoverSections(projectId: string, opts?: {
|
|
1210
1406
|
perCategory?: number;
|
|
1211
1407
|
maxCategories?: number;
|
|
1408
|
+
oneClick?: boolean;
|
|
1409
|
+
kinds?: DiscoverConnectorKind[];
|
|
1212
1410
|
}): Promise<DiscoverSectionsPage>;
|
|
1213
1411
|
export declare function getDiscoverConnector(projectId: string, id: string): Promise<DiscoverConnectorDetail>;
|
|
1412
|
+
/** One tool a way to connect offers, read before install. */
|
|
1413
|
+
export interface DiscoverConnectorTool {
|
|
1414
|
+
name: string;
|
|
1415
|
+
description: string;
|
|
1416
|
+
}
|
|
1417
|
+
export interface DiscoverConnectorTools {
|
|
1418
|
+
way: {
|
|
1419
|
+
id: string;
|
|
1420
|
+
kind: DiscoverConnectorVariant['kind'];
|
|
1421
|
+
name: string;
|
|
1422
|
+
};
|
|
1423
|
+
tools: DiscoverConnectorTool[];
|
|
1424
|
+
/** Every tool the source lists; `tools` holds at most 500. */
|
|
1425
|
+
total: number;
|
|
1426
|
+
/** `mcp`: the server's own list; `directory`: names from a public
|
|
1427
|
+
* directory; `composio`; `spec`: the OpenAPI operations; `none`: this way
|
|
1428
|
+
* lists its tools only after install. */
|
|
1429
|
+
source: 'mcp' | 'directory' | 'composio' | 'spec' | 'none';
|
|
1430
|
+
}
|
|
1431
|
+
/** The tools of one way to connect a Discover app (`way`: a variant id;
|
|
1432
|
+
* default the recommended way), before it is installed. */
|
|
1433
|
+
export declare function getDiscoverConnectorTools(projectId: string, id: string, way?: string): Promise<DiscoverConnectorTools>;
|
|
1434
|
+
export interface DiscoverInstallResult {
|
|
1435
|
+
ok: true;
|
|
1436
|
+
slug: string;
|
|
1437
|
+
name: string;
|
|
1438
|
+
provider: string;
|
|
1439
|
+
way: {
|
|
1440
|
+
id: string;
|
|
1441
|
+
kind: DiscoverConnectorVariant['kind'];
|
|
1442
|
+
name: string;
|
|
1443
|
+
oneClick: boolean;
|
|
1444
|
+
};
|
|
1445
|
+
sync?: ConnectorSyncResult;
|
|
1446
|
+
/**
|
|
1447
|
+
* `connect`: sign in (`connectorConnect`); `credential`: set its key;
|
|
1448
|
+
* `ready`: usable now; `fix`: added, but its tools did not load (`error`).
|
|
1449
|
+
*/
|
|
1450
|
+
next: 'connect' | 'credential' | 'ready' | 'fix';
|
|
1451
|
+
/** The project already had this way: nothing was added; `slug` is that profile. */
|
|
1452
|
+
existing?: boolean;
|
|
1453
|
+
/** Why the tools did not load, with `next: 'fix'`. */
|
|
1454
|
+
error?: string;
|
|
1455
|
+
}
|
|
1456
|
+
/** Install one way to connect a Discover app as a connector profile:
|
|
1457
|
+
* `way` by variant id, else the recommended one. */
|
|
1458
|
+
export declare function installDiscoverConnector(projectId: string, input: {
|
|
1459
|
+
id: string;
|
|
1460
|
+
way?: string;
|
|
1461
|
+
name?: string;
|
|
1462
|
+
slug?: string;
|
|
1463
|
+
/** Add a second profile of a way the project already has. */
|
|
1464
|
+
as_new_profile?: boolean;
|
|
1465
|
+
}): Promise<DiscoverInstallResult>;
|
|
1214
1466
|
/** @deprecated Use `listDiscoverConnectors`. */
|
|
1215
1467
|
export declare const listDiscoverIntegrations: typeof listDiscoverConnectors;
|
|
1216
1468
|
/** @deprecated Use `getDiscoverConnector`. */
|