@opengeni/api-router 0.22.2 → 0.26.1
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/app.d.ts +2 -2
- package/dist/app.js +1 -1
- package/dist/auth/managed-auth.d.ts +0 -30
- package/dist/browser-controller-authority.d.ts +43 -0
- package/dist/browser-state-authority.d.ts +27 -0
- package/dist/{chunk-HWXJW5C7.js → chunk-JIKNR5YL.js} +27993 -14546
- package/dist/chunk-JIKNR5YL.js.map +1 -0
- package/dist/codemode.d.ts +23 -0
- package/dist/editable-artifact-live-hints.d.ts +11 -0
- package/dist/editable-artifact-native-kernel.d.ts +37 -0
- package/dist/editable-artifact-office-import.d.ts +22 -0
- package/dist/editable-artifact-production.d.ts +29 -0
- package/dist/editable-artifact-websocket.d.ts +49 -0
- package/dist/editable-artifact-workspace-files.d.ts +23 -0
- package/dist/github-browser-flow.d.ts +6 -0
- package/dist/http/cors.d.ts +1 -0
- package/dist/http/sse.d.ts +2 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1824 -30
- package/dist/index.js.map +1 -1
- package/dist/integrations/api-integrations.d.ts +24 -0
- package/dist/integrations/atlassian.d.ts +176 -0
- package/dist/integrations/github-skill-source.d.ts +5 -0
- package/dist/integrations/google-drive.d.ts +85 -0
- package/dist/integrations/oauth-client.d.ts +30 -1
- package/dist/integrations/provider-oauth.d.ts +19 -0
- package/dist/integrations/slack-bot.d.ts +4 -0
- package/dist/integrations/slack-interactions.d.ts +14 -2
- package/dist/integrations/social-api.d.ts +2 -1
- package/dist/mcp/editable-artifact-query-schema.d.ts +4 -0
- package/dist/mcp/editable-artifacts.d.ts +13 -0
- package/dist/mcp/receipts.d.ts +28 -0
- package/dist/mcp/scheduled-task-view.d.ts +518 -0
- package/dist/mcp/server.d.ts +14 -3
- package/dist/memory-slack-delivery.d.ts +9 -0
- package/dist/routes/api-integrations.d.ts +8 -0
- package/dist/routes/browser-identities.d.ts +5 -0
- package/dist/routes/browser-sessions.d.ts +6 -0
- package/dist/routes/company-profile.d.ts +3 -0
- package/dist/routes/computer-sessions.d.ts +6 -0
- package/dist/routes/editable-artifacts.d.ts +44 -0
- package/dist/routes/integration-features.d.ts +3 -0
- package/dist/routes/memory-slack-publications.d.ts +6 -0
- package/dist/routes/plugins.d.ts +8 -0
- package/dist/routes/sessions.d.ts +17 -2
- package/dist/routes/skills.d.ts +6 -0
- package/dist/routes/video-generation.d.ts +3 -0
- package/dist/sandbox/auth-callout.d.ts +2 -0
- package/dist/sandbox/channel-a.d.ts +59 -2
- package/dist/sandbox/metrics-ingestion.d.ts +6 -1
- package/dist/sandbox/viewer.d.ts +4 -2
- package/dist/temporal-schedule-cleanup.d.ts +26 -0
- package/package.json +19 -14
- package/src/app.ts +277 -41
- package/src/auth/managed-auth.ts +0 -16
- package/src/browser-controller-authority.ts +137 -0
- package/src/browser-state-authority.ts +236 -0
- package/src/codemode.ts +186 -0
- package/src/editable-artifact-live-hints.ts +64 -0
- package/src/editable-artifact-native-kernel.ts +659 -0
- package/src/editable-artifact-office-import.ts +230 -0
- package/src/editable-artifact-production.ts +419 -0
- package/src/editable-artifact-websocket.ts +311 -0
- package/src/editable-artifact-workspace-files.ts +186 -0
- package/src/github-browser-flow.ts +35 -6
- package/src/http/auth.ts +2 -0
- package/src/http/cors.ts +3 -0
- package/src/http/sse.ts +101 -6
- package/src/index.ts +147 -23
- package/src/integrations/api-integrations.ts +350 -0
- package/src/integrations/atlassian.ts +1621 -0
- package/src/integrations/github-skill-source.ts +142 -0
- package/src/integrations/google-drive.ts +1000 -64
- package/src/integrations/oauth-client.ts +159 -89
- package/src/integrations/provider-oauth.ts +777 -0
- package/src/integrations/slack-bot.ts +31 -2
- package/src/integrations/slack-interactions.ts +610 -42
- package/src/integrations/social-api.ts +11 -0
- package/src/mcp/documents.ts +74 -26
- package/src/mcp/editable-artifact-query-schema.ts +236 -0
- package/src/mcp/editable-artifacts.ts +448 -0
- package/src/mcp/receipts.ts +95 -0
- package/src/mcp/scheduled-task-view.ts +642 -0
- package/src/mcp/server.ts +1718 -310
- package/src/memory-slack-delivery.ts +209 -0
- package/src/observability.ts +3 -3
- package/src/routes/api-integrations.ts +407 -0
- package/src/routes/api-keys.ts +7 -1
- package/src/routes/browser-identities.ts +136 -0
- package/src/routes/browser-sessions.ts +2543 -0
- package/src/routes/codex.ts +7 -4
- package/src/routes/company-profile.ts +255 -0
- package/src/routes/computer-sessions.ts +1247 -0
- package/src/routes/connections.ts +358 -102
- package/src/routes/documents.ts +22 -3
- package/src/routes/editable-artifacts.ts +1159 -0
- package/src/routes/enrollments.ts +54 -12
- package/src/routes/environments.ts +60 -11
- package/src/routes/files.ts +277 -65
- package/src/routes/github.ts +18 -2
- package/src/routes/install.ts +38 -2
- package/src/routes/integration-features.ts +258 -0
- package/src/routes/machines.ts +1 -1
- package/src/routes/memory-slack-publications.ts +216 -0
- package/src/routes/packs.ts +437 -7
- package/src/routes/plugins.ts +751 -0
- package/src/routes/rigs.ts +77 -20
- package/src/routes/scheduled-tasks.ts +94 -42
- package/src/routes/sessions.ts +475 -234
- package/src/routes/skills.ts +174 -0
- package/src/routes/transcription-recordings.ts +65 -33
- package/src/routes/video-generation.ts +132 -0
- package/src/routes/workspaces.ts +46 -24
- package/src/sandbox/auth-callout.ts +16 -4
- package/src/sandbox/channel-a.ts +809 -85
- package/src/sandbox/enrollment.ts +13 -3
- package/src/sandbox/machines.ts +1 -1
- package/src/sandbox/metrics-ingestion.ts +121 -3
- package/src/sandbox/rematerialize.ts +35 -47
- package/src/sandbox/viewer.ts +58 -29
- package/src/temporal-schedule-cleanup.ts +135 -0
- package/dist/chunk-HWXJW5C7.js.map +0 -1
- package/dist/mcp/toolspace.d.ts +0 -62
- package/src/mcp/toolspace.ts +0 -1186
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type IntegrationCredentialResolver, type IntegrationInvocationAuthority, type IntegrationTransport } from "@opengeni/capabilities";
|
|
2
|
+
import { ApiIntegrationPreview, type ApiIntegrationSource } from "@opengeni/contracts";
|
|
3
|
+
import type { StoredApiIntegrationRevision } from "@opengeni/db";
|
|
4
|
+
export type ApiIntegrationConnectionDescriptor = {
|
|
5
|
+
id: string;
|
|
6
|
+
kind: "oauth2" | "api_key" | "app_install" | "delegated";
|
|
7
|
+
providerDomain: string;
|
|
8
|
+
scopes: string[];
|
|
9
|
+
ownership: "workspace" | "personal";
|
|
10
|
+
};
|
|
11
|
+
export type ResolvedApiIntegrationPreview = {
|
|
12
|
+
preview: ApiIntegrationPreview;
|
|
13
|
+
revision: StoredApiIntegrationRevision;
|
|
14
|
+
provider: string | null;
|
|
15
|
+
requiredScopes: string[];
|
|
16
|
+
authScheme: Record<string, unknown>;
|
|
17
|
+
};
|
|
18
|
+
export declare function resolveApiIntegrationPreview(input: {
|
|
19
|
+
source: ApiIntegrationSource;
|
|
20
|
+
connection: ApiIntegrationConnectionDescriptor | null;
|
|
21
|
+
transport: IntegrationTransport;
|
|
22
|
+
credentialResolver?: IntegrationCredentialResolver;
|
|
23
|
+
authority: IntegrationInvocationAuthority;
|
|
24
|
+
}): Promise<ResolvedApiIntegrationPreview>;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { AccessGrant, ScheduledTask } from "@opengeni/contracts";
|
|
2
|
+
import { AtlassianOAuthStartResponse, type AtlassianDisconnectRequest, type AtlassianLifecycleActionRequest, type AtlassianOAuthStartRequest } from "@opengeni/contracts/atlassian";
|
|
3
|
+
import { type ApiRouteDeps } from "@opengeni/core";
|
|
4
|
+
import { getConnectionMetadata } from "@opengeni/db";
|
|
5
|
+
type AtlassianConnectionRecord = NonNullable<Awaited<ReturnType<typeof getConnectionMetadata>>>;
|
|
6
|
+
export declare function startAtlassianOAuth(deps: ApiRouteDeps, input: {
|
|
7
|
+
accountId: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
subjectId: string;
|
|
10
|
+
requestUrl: string;
|
|
11
|
+
payload: AtlassianOAuthStartRequest;
|
|
12
|
+
}): Promise<AtlassianOAuthStartResponse>;
|
|
13
|
+
export declare function completeAtlassianOAuthCallback(deps: ApiRouteDeps, input: {
|
|
14
|
+
code?: string | undefined;
|
|
15
|
+
state?: string | undefined;
|
|
16
|
+
error?: string | undefined;
|
|
17
|
+
requestUrl: string;
|
|
18
|
+
}): Promise<{
|
|
19
|
+
redirectTo: string;
|
|
20
|
+
}>;
|
|
21
|
+
export declare function browseAtlassianSources(deps: ApiRouteDeps, input: {
|
|
22
|
+
workspaceId: string;
|
|
23
|
+
subjectId: string;
|
|
24
|
+
connectionId: string;
|
|
25
|
+
}): Promise<{
|
|
26
|
+
connection: {
|
|
27
|
+
id: string;
|
|
28
|
+
accountId: string;
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
subjectId: string | null;
|
|
31
|
+
providerDomain: string;
|
|
32
|
+
kind: "api_key" | "app_install" | "delegated" | "oauth2";
|
|
33
|
+
status: "active" | "error" | "needs_reauth" | "revoked";
|
|
34
|
+
grantedScopes: string[];
|
|
35
|
+
expiresAt: string | null;
|
|
36
|
+
lastRefreshAt: string | null;
|
|
37
|
+
lastUsedAt: string | null;
|
|
38
|
+
lastError: string | null;
|
|
39
|
+
version: number;
|
|
40
|
+
verifiedInstallAt?: string | null | undefined;
|
|
41
|
+
verifiedInstallVersion?: number | null | undefined;
|
|
42
|
+
metadata: Record<string, unknown>;
|
|
43
|
+
createdBySubjectId: string | null;
|
|
44
|
+
updatedBySubjectId: string | null;
|
|
45
|
+
createdAt: string;
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
};
|
|
48
|
+
items: {
|
|
49
|
+
id: string;
|
|
50
|
+
cloudId: string;
|
|
51
|
+
siteName: string;
|
|
52
|
+
siteUrl: string;
|
|
53
|
+
resourceId: string;
|
|
54
|
+
key: string;
|
|
55
|
+
name: string;
|
|
56
|
+
kind: "confluence_space" | "jira_project";
|
|
57
|
+
description: string | null;
|
|
58
|
+
webUrl: string;
|
|
59
|
+
}[];
|
|
60
|
+
}>;
|
|
61
|
+
export declare function searchAtlassianLive(deps: ApiRouteDeps, input: {
|
|
62
|
+
workspaceId: string;
|
|
63
|
+
subjectId: string;
|
|
64
|
+
connectionId: string;
|
|
65
|
+
query: string;
|
|
66
|
+
product?: "jira" | "confluence" | undefined;
|
|
67
|
+
limit: number;
|
|
68
|
+
}): Promise<({
|
|
69
|
+
kind: "jira_issue";
|
|
70
|
+
id: string;
|
|
71
|
+
key: string;
|
|
72
|
+
title: string;
|
|
73
|
+
sourceId: string | null;
|
|
74
|
+
sourceName: string | null;
|
|
75
|
+
status: string | null;
|
|
76
|
+
updatedAt: string | null;
|
|
77
|
+
url: string;
|
|
78
|
+
} | {
|
|
79
|
+
kind: "confluence_page";
|
|
80
|
+
id: string;
|
|
81
|
+
key: null;
|
|
82
|
+
title: string;
|
|
83
|
+
sourceId: string | null;
|
|
84
|
+
sourceName: string | null;
|
|
85
|
+
status: null;
|
|
86
|
+
updatedAt: string | null;
|
|
87
|
+
url: string;
|
|
88
|
+
})[]>;
|
|
89
|
+
export declare function getAtlassianLiveItem(deps: ApiRouteDeps, input: {
|
|
90
|
+
workspaceId: string;
|
|
91
|
+
subjectId: string;
|
|
92
|
+
connectionId: string;
|
|
93
|
+
kind: "jira_issue" | "confluence_page";
|
|
94
|
+
id: string;
|
|
95
|
+
}): Promise<{
|
|
96
|
+
kind: "jira_issue";
|
|
97
|
+
id: string;
|
|
98
|
+
key: string;
|
|
99
|
+
title: string;
|
|
100
|
+
source: {
|
|
101
|
+
id: string;
|
|
102
|
+
name: string;
|
|
103
|
+
siteName: string;
|
|
104
|
+
};
|
|
105
|
+
status: string | null;
|
|
106
|
+
issueType: string | null;
|
|
107
|
+
priority: string | null;
|
|
108
|
+
assignee: string | null;
|
|
109
|
+
reporter: string | null;
|
|
110
|
+
labels: string[];
|
|
111
|
+
createdAt: string | null;
|
|
112
|
+
updatedAt: string | null;
|
|
113
|
+
description: string;
|
|
114
|
+
comments: {
|
|
115
|
+
author: string | null;
|
|
116
|
+
createdAt: string | null;
|
|
117
|
+
body: string;
|
|
118
|
+
}[];
|
|
119
|
+
url: string;
|
|
120
|
+
content?: never;
|
|
121
|
+
} | {
|
|
122
|
+
key?: never;
|
|
123
|
+
issueType?: never;
|
|
124
|
+
priority?: never;
|
|
125
|
+
assignee?: never;
|
|
126
|
+
reporter?: never;
|
|
127
|
+
labels?: never;
|
|
128
|
+
description?: never;
|
|
129
|
+
kind: "confluence_page";
|
|
130
|
+
id: string;
|
|
131
|
+
title: string;
|
|
132
|
+
source: {
|
|
133
|
+
id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
siteName: string;
|
|
136
|
+
};
|
|
137
|
+
status: string | null;
|
|
138
|
+
createdAt: string | null;
|
|
139
|
+
updatedAt: string | null;
|
|
140
|
+
content: string;
|
|
141
|
+
comments: {
|
|
142
|
+
createdAt: string | null;
|
|
143
|
+
content: string;
|
|
144
|
+
}[];
|
|
145
|
+
url: string;
|
|
146
|
+
}>;
|
|
147
|
+
export declare function saveAtlassianSources(deps: ApiRouteDeps, input: {
|
|
148
|
+
accountId: string;
|
|
149
|
+
workspaceId: string;
|
|
150
|
+
subjectId: string;
|
|
151
|
+
connectionId: string;
|
|
152
|
+
grant: AccessGrant;
|
|
153
|
+
payload: unknown;
|
|
154
|
+
canManageOrganizationDestination: boolean;
|
|
155
|
+
canManageWorkspaceDestination: boolean;
|
|
156
|
+
canManagePersonalDestination: boolean;
|
|
157
|
+
}): Promise<import("@opengeni/db").ConnectionMetadataWithVerification>;
|
|
158
|
+
export declare function transitionAtlassianLifecycle(deps: ApiRouteDeps, input: {
|
|
159
|
+
workspaceId: string;
|
|
160
|
+
subjectId: string;
|
|
161
|
+
connectionId: string;
|
|
162
|
+
payload: AtlassianLifecycleActionRequest;
|
|
163
|
+
}): Promise<import("@opengeni/db").ConnectionMetadataWithVerification>;
|
|
164
|
+
export declare function disconnectAtlassian(deps: ApiRouteDeps, input: {
|
|
165
|
+
workspaceId: string;
|
|
166
|
+
subjectId: string;
|
|
167
|
+
connection: AtlassianConnectionRecord;
|
|
168
|
+
payload: AtlassianDisconnectRequest;
|
|
169
|
+
}): Promise<import("@opengeni/db").ConnectionMetadataWithVerification | null>;
|
|
170
|
+
export declare function revokeAtlassianScheduleAuthorization(deps: ApiRouteDeps, input: {
|
|
171
|
+
task: ScheduledTask;
|
|
172
|
+
subjectId: string;
|
|
173
|
+
}): Promise<void>;
|
|
174
|
+
export declare function isSelectableConfluenceSpaceType(value: unknown): boolean;
|
|
175
|
+
export declare function confluenceNextUrl(cloudId: string, next: string): URL;
|
|
176
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { GitHubSkillSourceClient } from "@opengeni/core";
|
|
3
|
+
type GitHubJsonRequest = (path: string, maxBytes: number, label: string) => Promise<unknown>;
|
|
4
|
+
export declare function createGitHubSkillSourceClient(settings: Settings, requestJson?: GitHubJsonRequest): GitHubSkillSourceClient;
|
|
5
|
+
export {};
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
+
import type { AccessGrant, ScheduledTask } from "@opengeni/contracts";
|
|
1
2
|
import { GoogleDriveOAuthStartResponse, type GoogleDriveDisconnectRequest, type GoogleDriveLifecycleActionRequest, type GoogleDriveOAuthStartRequest } from "@opengeni/contracts/google-drive";
|
|
3
|
+
import { IntegrationFeatureMutationResult } from "@opengeni/contracts";
|
|
2
4
|
import type { ApiRouteDeps } from "@opengeni/core";
|
|
3
5
|
import { getConnectionMetadata } from "@opengeni/db";
|
|
6
|
+
export declare function wakeGoogleDriveSourcesFromWorkspaceEvent(deps: ApiRouteDeps, input: {
|
|
7
|
+
accountId: string;
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
connectionId: string;
|
|
10
|
+
connectionOwnerSubjectId: string;
|
|
11
|
+
eventId: string;
|
|
12
|
+
driveId: string | null;
|
|
13
|
+
}): Promise<{
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
triggered: number;
|
|
16
|
+
}>;
|
|
4
17
|
type GoogleDriveConnectionRecord = NonNullable<Awaited<ReturnType<typeof getConnectionMetadata>>>;
|
|
5
18
|
export declare function startGoogleDriveOAuth(deps: ApiRouteDeps, input: {
|
|
6
19
|
accountId: string;
|
|
@@ -82,14 +95,86 @@ export declare function browseGoogleDrive(deps: ApiRouteDeps, input: {
|
|
|
82
95
|
nextPageToken: string | null;
|
|
83
96
|
incompleteSearch: boolean;
|
|
84
97
|
}>;
|
|
98
|
+
export declare function browseGoogleDriveIntegrationSource(deps: ApiRouteDeps, input: {
|
|
99
|
+
workspaceId: string;
|
|
100
|
+
subjectId: string;
|
|
101
|
+
capabilityId: string;
|
|
102
|
+
instanceKey: string;
|
|
103
|
+
featureKey: string;
|
|
104
|
+
parentId: string;
|
|
105
|
+
pageToken?: string | undefined;
|
|
106
|
+
}): Promise<{
|
|
107
|
+
connection: {
|
|
108
|
+
id: string;
|
|
109
|
+
accountId: string;
|
|
110
|
+
workspaceId: string;
|
|
111
|
+
subjectId: string | null;
|
|
112
|
+
providerDomain: string;
|
|
113
|
+
kind: "api_key" | "app_install" | "delegated" | "oauth2";
|
|
114
|
+
status: "active" | "error" | "needs_reauth" | "revoked";
|
|
115
|
+
grantedScopes: string[];
|
|
116
|
+
expiresAt: string | null;
|
|
117
|
+
lastRefreshAt: string | null;
|
|
118
|
+
lastUsedAt: string | null;
|
|
119
|
+
lastError: string | null;
|
|
120
|
+
version: number;
|
|
121
|
+
verifiedInstallAt?: string | null | undefined;
|
|
122
|
+
verifiedInstallVersion?: number | null | undefined;
|
|
123
|
+
metadata: Record<string, unknown>;
|
|
124
|
+
createdBySubjectId: string | null;
|
|
125
|
+
updatedBySubjectId: string | null;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
};
|
|
129
|
+
parentId: string;
|
|
130
|
+
current: {
|
|
131
|
+
id: string;
|
|
132
|
+
name: string;
|
|
133
|
+
mimeType: string;
|
|
134
|
+
kind: "file" | "folder";
|
|
135
|
+
driveId: string | null;
|
|
136
|
+
modifiedTime: string | null;
|
|
137
|
+
size: string | null;
|
|
138
|
+
webViewLink: string | null;
|
|
139
|
+
} | null;
|
|
140
|
+
items: {
|
|
141
|
+
id: string;
|
|
142
|
+
name: string;
|
|
143
|
+
mimeType: string;
|
|
144
|
+
kind: "file" | "folder";
|
|
145
|
+
driveId: string | null;
|
|
146
|
+
modifiedTime: string | null;
|
|
147
|
+
size: string | null;
|
|
148
|
+
webViewLink: string | null;
|
|
149
|
+
}[];
|
|
150
|
+
nextPageToken: string | null;
|
|
151
|
+
incompleteSearch: boolean;
|
|
152
|
+
}>;
|
|
153
|
+
export declare function saveGoogleDriveIntegrationSource(deps: ApiRouteDeps, input: {
|
|
154
|
+
accountId: string;
|
|
155
|
+
workspaceId: string;
|
|
156
|
+
subjectId: string;
|
|
157
|
+
capabilityId: string;
|
|
158
|
+
instanceKey: string;
|
|
159
|
+
featureKey: string;
|
|
160
|
+
payload: unknown;
|
|
161
|
+
canManageOrganizationDestination: boolean;
|
|
162
|
+
canManageWorkspaceDestination: boolean;
|
|
163
|
+
canManagePersonalDestination: boolean;
|
|
164
|
+
}): Promise<IntegrationFeatureMutationResult>;
|
|
85
165
|
export declare function saveGoogleDriveSource(deps: ApiRouteDeps, input: {
|
|
86
166
|
accountId: string;
|
|
87
167
|
workspaceId: string;
|
|
88
168
|
subjectId: string;
|
|
89
169
|
connectionId: string;
|
|
170
|
+
grant: AccessGrant;
|
|
90
171
|
payload: unknown;
|
|
91
172
|
canManageOrganizationDestination: boolean;
|
|
92
173
|
canManageWorkspaceDestination: boolean;
|
|
93
174
|
canManagePersonalDestination: boolean;
|
|
94
175
|
}): Promise<import("@opengeni/db").ConnectionMetadataWithVerification>;
|
|
176
|
+
export declare function revokeKnowledgeSourceScheduleAuthorization(deps: ApiRouteDeps, input: {
|
|
177
|
+
task: ScheduledTask;
|
|
178
|
+
subjectId: string;
|
|
179
|
+
}): Promise<void>;
|
|
95
180
|
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import { OAuthStartResponse, type OAuthStartRequest } from "@opengeni/contracts";
|
|
2
|
+
import { OAuthStartResponse, type ConnectionOwnership, type OAuthStartRequest } from "@opengeni/contracts";
|
|
3
3
|
import type { Observability } from "@opengeni/observability";
|
|
4
4
|
import { type Database } from "@opengeni/db";
|
|
5
5
|
export declare const oauthStateTtlMs: number;
|
|
6
6
|
export declare const OFFICIAL_SLACK_MCP_URL: "https://mcp.slack.com/mcp";
|
|
7
|
+
export declare const OFFICIAL_GMAIL_MCP_URL = "https://gmailmcp.googleapis.com/mcp/v1";
|
|
8
|
+
export declare const OFFICIAL_GMAIL_MCP_SCOPES: readonly ["https://www.googleapis.com/auth/gmail.readonly", "https://www.googleapis.com/auth/gmail.compose", "https://www.googleapis.com/auth/gmail.modify"];
|
|
7
9
|
export { OAUTH_MAX_RESPONSE_BYTES } from "@opengeni/network";
|
|
8
10
|
type OAuthClientDeps = {
|
|
9
11
|
db: Database;
|
|
@@ -37,6 +39,7 @@ export declare const OAUTH_START_DEADLINE_MS = 15000;
|
|
|
37
39
|
export declare const OAUTH_CALLBACK_DEADLINE_MS = 30000;
|
|
38
40
|
export type OAuthStartStage = "connection_lookup" | "mcp_challenge" | "protected_resource_metadata" | "authorization_server_metadata" | "client_registration";
|
|
39
41
|
export declare function startMcpOAuth(deps: OAuthClientDeps, context: OAuthStartContext): Promise<OAuthStartResponse>;
|
|
42
|
+
export declare function assertOfficialGmailPersonalOwnership(mcpUrl: string, ownership: ConnectionOwnership): void;
|
|
40
43
|
export declare function completeMcpOAuthCallback(deps: OAuthClientDeps, input: {
|
|
41
44
|
code?: string | undefined;
|
|
42
45
|
state?: string | undefined;
|
|
@@ -45,3 +48,29 @@ export declare function completeMcpOAuthCallback(deps: OAuthClientDeps, input: {
|
|
|
45
48
|
export declare function integrationBaseUrl(publicBaseUrl: string | undefined, requestUrl: string): string;
|
|
46
49
|
export declare function requireIntegrationsStateSecret(settings: Settings): string;
|
|
47
50
|
export declare function assertSlackAuthorizationServer(as: AuthorizationServerMetadata): void;
|
|
51
|
+
export declare function assertGoogleAuthorizationServer(as: AuthorizationServerMetadata): void;
|
|
52
|
+
export declare function buildAuthorizationUrl(input: {
|
|
53
|
+
endpoint: string;
|
|
54
|
+
settings: Settings;
|
|
55
|
+
clientId: string;
|
|
56
|
+
redirectUri: string;
|
|
57
|
+
state: string;
|
|
58
|
+
resource: string;
|
|
59
|
+
verifier: string;
|
|
60
|
+
scopes: string[];
|
|
61
|
+
resourceParameterSupported: boolean;
|
|
62
|
+
}): string;
|
|
63
|
+
export type OAuthPublicErrorFields = {
|
|
64
|
+
errorClass: "OAuthOperationError";
|
|
65
|
+
errorCode: "oauth_operation_failed";
|
|
66
|
+
status?: number;
|
|
67
|
+
origin: "oauth";
|
|
68
|
+
};
|
|
69
|
+
/** Allowlisted projection for public telemetry; canonical OAuth errors stay exact. */
|
|
70
|
+
export declare function oauthPublicErrorFields(error: unknown): OAuthPublicErrorFields;
|
|
71
|
+
export declare function chooseMcpAuthorizeScopes(input: {
|
|
72
|
+
mcpUrl: string;
|
|
73
|
+
requested: string[] | undefined;
|
|
74
|
+
challenged: string[] | undefined;
|
|
75
|
+
supported: string[];
|
|
76
|
+
}): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Settings } from "@opengeni/config";
|
|
2
|
+
import { OAuthStartResponse, type ApiIntegrationOAuthStartRequest } from "@opengeni/contracts";
|
|
3
|
+
import { type ApiRouteDeps } from "@opengeni/core";
|
|
4
|
+
export declare function startApiIntegrationProviderOAuth(deps: ApiRouteDeps, input: {
|
|
5
|
+
accountId: string;
|
|
6
|
+
workspaceId: string;
|
|
7
|
+
subjectId: string;
|
|
8
|
+
requestUrl: string;
|
|
9
|
+
payload: ApiIntegrationOAuthStartRequest;
|
|
10
|
+
}): Promise<OAuthStartResponse>;
|
|
11
|
+
export declare function completeApiIntegrationProviderOAuth(deps: ApiRouteDeps, input: {
|
|
12
|
+
code?: string | undefined;
|
|
13
|
+
state?: string | undefined;
|
|
14
|
+
error?: string | undefined;
|
|
15
|
+
requestUrl: string;
|
|
16
|
+
}): Promise<{
|
|
17
|
+
redirectTo: string;
|
|
18
|
+
}>;
|
|
19
|
+
export declare function isApiIntegrationProviderOAuthState(value: string | undefined, settings: Settings): boolean;
|
|
@@ -157,6 +157,8 @@ export declare class OpenGeniSlackBotClient {
|
|
|
157
157
|
channelId: string;
|
|
158
158
|
limit?: number;
|
|
159
159
|
cursor?: string;
|
|
160
|
+
latest?: string;
|
|
161
|
+
inclusive?: boolean;
|
|
160
162
|
}): Promise<{
|
|
161
163
|
channel: {
|
|
162
164
|
id: string;
|
|
@@ -427,6 +429,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
427
429
|
userId?: string;
|
|
428
430
|
threadTimestamp?: string;
|
|
429
431
|
text: string;
|
|
432
|
+
requireActiveNonSharedChannel?: boolean;
|
|
430
433
|
}): Promise<{
|
|
431
434
|
channelId: string;
|
|
432
435
|
timestamp: string;
|
|
@@ -445,6 +448,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
445
448
|
}>;
|
|
446
449
|
private slackMessageExists;
|
|
447
450
|
private requireMemberChannel;
|
|
451
|
+
private requireActiveNonSharedMemberChannel;
|
|
448
452
|
private requireFileForChannel;
|
|
449
453
|
private readPrivateFileText;
|
|
450
454
|
private call;
|
|
@@ -2,7 +2,7 @@ import { type WorkspaceSlackReactionSummonSettings } from "@opengeni/contracts";
|
|
|
2
2
|
import { type SlackInstallationRoute, type SlackInteractionInboxEntry, type SlackInteractionTriggerKind } from "@opengeni/db";
|
|
3
3
|
import { type ApiRouteDeps } from "@opengeni/core";
|
|
4
4
|
import type { Hono } from "hono";
|
|
5
|
-
import { type OpenGeniSlackBotClient } from "./slack-bot";
|
|
5
|
+
import { type OpenGeniSlackBotClient } from "./slack-bot.js";
|
|
6
6
|
export declare const SLACK_INTERACTION_MAX_BODY_BYTES: number;
|
|
7
7
|
export declare const SLACK_SIGNATURE_REPLAY_WINDOW_SECONDS = 300;
|
|
8
8
|
export declare const SLACK_DELIVERY_EVENT_TYPES: readonly ["agent.message.completed", "session.humanInput.requested", "turn.completed", "turn.failed", "turn.cancelled", "session.status.changed"];
|
|
@@ -13,7 +13,7 @@ export declare const SLACK_TASK_INSTRUCTIONS: string;
|
|
|
13
13
|
* selection at session creation while keeping Slack mutations out of the model
|
|
14
14
|
* surface; interaction delivery remains owned by the durable delivery pump.
|
|
15
15
|
*/
|
|
16
|
-
export declare const SLACK_TASK_FIRST_PARTY_MCP_TOOLS: ("artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_publish" | "artifacts_rollback" | "environment_list" | "environment_set_variable" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_set" | "goal_update" | "memory_correct" | "memory_save" | "memory_search" | "preference_registry_get" | "preference_registry_summary" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_pause" | "session_resume" | "session_send_message" | "session_steer" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "variable_set_list" | "variable_set_set_variable")[];
|
|
16
|
+
export declare const SLACK_TASK_FIRST_PARTY_MCP_TOOLS: ("artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_publish" | "artifacts_rollback" | "atlassian_get" | "atlassian_search" | "atlassian_sources_list" | "browser_act" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "computer_act" | "computer_lifecycle" | "computer_observe" | "computer_open" | "computer_targets" | "connected_machine_remove" | "editable_artifact_apply" | "editable_artifact_create" | "editable_artifact_export" | "editable_artifact_export_status" | "editable_artifact_get" | "editable_artifact_import" | "editable_artifact_inspect" | "editable_artifact_list" | "environment_list" | "environment_set_variable" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_set" | "goal_update" | "interaction_discover" | "memory_correct" | "memory_save" | "memory_search" | "preference_registry_get" | "preference_registry_summary" | "reddit_accounts_list" | "reddit_mentions_live" | "reddit_post_reply" | "reddit_posts_sync" | "reddit_search_live" | "reddit_thread_fetch" | "rig_get" | "rig_list" | "rig_promote" | "rig_propose_change" | "rig_verify" | "run_on" | "sandbox_attach" | "sandbox_provision" | "sandbox_swap" | "sandboxes_list" | "scheduled_task_runs_list" | "scheduled_tasks_create" | "scheduled_tasks_delete" | "scheduled_tasks_get" | "scheduled_tasks_list" | "scheduled_tasks_pause" | "scheduled_tasks_resume" | "scheduled_tasks_trigger" | "scheduled_tasks_update" | "session_create" | "session_events" | "session_get" | "session_pause" | "session_resume" | "session_send_message" | "session_steer" | "sessions_list" | "set_other_session_title" | "set_session_title" | "slack_bot_channel_history" | "slack_bot_delete_message" | "slack_bot_file_content" | "slack_bot_file_info" | "slack_bot_list_channels" | "slack_bot_list_files" | "slack_bot_list_users" | "slack_bot_post_message" | "slack_bot_thread_replies" | "social_connections_list" | "social_daily_analysis_context" | "social_mentions_live" | "social_post_reply" | "social_posts_recent" | "social_posts_sync" | "social_search_live" | "social_thread_fetch" | "variable_set_get_variable" | "variable_set_list" | "variable_set_set_variable" | "x_accounts_list" | "x_mentions_live" | "x_post_reply" | "x_posts_sync" | "x_search_live" | "x_thread_fetch")[];
|
|
17
17
|
export type NormalizedSlackInteraction = {
|
|
18
18
|
providerEventId: string;
|
|
19
19
|
providerMessageId: string;
|
|
@@ -25,6 +25,12 @@ export type NormalizedSlackInteraction = {
|
|
|
25
25
|
triggerKind: SlackInteractionTriggerKind;
|
|
26
26
|
text: string;
|
|
27
27
|
};
|
|
28
|
+
export declare function slackInteractionRoutePolicy(entry: Pick<SlackInteractionInboxEntry, "triggerKind" | "slackChannelId" | "slackThreadTs" | "slackMessageTs" | "slackUserId">): {
|
|
29
|
+
directMessageShortcut: boolean;
|
|
30
|
+
requiresChannelAccess: boolean;
|
|
31
|
+
visibility: "private" | "workspace";
|
|
32
|
+
initialRouteKey: string;
|
|
33
|
+
};
|
|
28
34
|
export declare function verifySlackRequestSignature(input: {
|
|
29
35
|
timestamp: string | null;
|
|
30
36
|
signature: string | null;
|
|
@@ -38,6 +44,12 @@ export declare function startSlackInteractionPump(deps: ApiRouteDeps, options?:
|
|
|
38
44
|
intervalMs?: number;
|
|
39
45
|
maxPerTick?: number;
|
|
40
46
|
}): () => void;
|
|
47
|
+
export type SlackInvocationMessageContext = {
|
|
48
|
+
messages: Awaited<ReturnType<OpenGeniSlackBotClient["threadReplies"]>>["messages"];
|
|
49
|
+
nextCursor: string | null;
|
|
50
|
+
kind: "thread" | "channel";
|
|
51
|
+
};
|
|
52
|
+
export declare function slackInvocationTaskText(entry: Pick<SlackInteractionInboxEntry, "slackMessageTs" | "slackUserId" | "text">, context: SlackInvocationMessageContext): string;
|
|
41
53
|
type SlackReactionMessageContext = Awaited<ReturnType<OpenGeniSlackBotClient["reactionMessageContext"]>>;
|
|
42
54
|
export declare function slackReactionTaskText(context: SlackReactionMessageContext): string;
|
|
43
55
|
type SlackUserLinkToken = {
|
|
@@ -2,7 +2,7 @@ import type { Settings } from "@opengeni/config";
|
|
|
2
2
|
import type { SocialConnection } from "@opengeni/contracts";
|
|
3
3
|
import type { Observability } from "@opengeni/observability";
|
|
4
4
|
import type { Database } from "@opengeni/db";
|
|
5
|
-
import { type SocialProviderFetch } from "./social-oauth";
|
|
5
|
+
import { type SocialProviderFetch } from "./social-oauth.js";
|
|
6
6
|
export type SocialLivePost = {
|
|
7
7
|
id: string;
|
|
8
8
|
provider: "x" | "reddit";
|
|
@@ -24,6 +24,7 @@ type ConnectionRef = {
|
|
|
24
24
|
connectionId: string;
|
|
25
25
|
subjectId?: string | null;
|
|
26
26
|
};
|
|
27
|
+
export declare function assertSocialConnectionProvider(connection: Pick<SocialConnection, "provider">, expected: "x" | "reddit"): void;
|
|
27
28
|
export declare function socialSearchLive(deps: SocialApiDeps, ref: ConnectionRef, input: {
|
|
28
29
|
query: string;
|
|
29
30
|
limit?: number | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditableArtifactAgentQuery } from "@opengeni/core/editable-artifacts";
|
|
2
|
+
import * as z from "zod/v4";
|
|
3
|
+
/** Exact bounded query union shared by the model-facing direct inspect tool. */
|
|
4
|
+
export declare const EditableArtifactQueryRequestSchema: z.ZodType<EditableArtifactAgentQuery["query"]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import type { ApiRouteDeps } from "@opengeni/core";
|
|
4
|
+
type RegisterEditableArtifactToolsInput = Readonly<{
|
|
5
|
+
server: McpServer;
|
|
6
|
+
deps: ApiRouteDeps;
|
|
7
|
+
grant: AccessGrant;
|
|
8
|
+
sessionId: string;
|
|
9
|
+
authorize(): Promise<void>;
|
|
10
|
+
}>;
|
|
11
|
+
/** Register the one canonical agent artifact surface used directly and by CodeMode. */
|
|
12
|
+
export declare function registerEditableArtifactAgentTools(input: RegisterEditableArtifactToolsInput): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type McpMutationReceiptType } from "@opengeni/contracts";
|
|
2
|
+
export type McpMutationReceiptInput = Omit<McpMutationReceiptType, "receiptVersion" | "timestamp" | "warnings"> & {
|
|
3
|
+
timestamp?: string;
|
|
4
|
+
warnings?: string[];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Build and validate a compact first-party MCP mutation receipt at the API
|
|
8
|
+
* boundary. Contract parsing is intentional: it prevents a handler from
|
|
9
|
+
* accidentally adding an unbounded entity or a copy of request fields.
|
|
10
|
+
*/
|
|
11
|
+
export declare function mcpMutationReceipt(input: McpMutationReceiptInput): McpMutationReceiptType;
|
|
12
|
+
export type SessionCreateReceiptResult = {
|
|
13
|
+
session: {
|
|
14
|
+
id: string;
|
|
15
|
+
queueVersion: number;
|
|
16
|
+
status: string;
|
|
17
|
+
sandboxGroupId: string;
|
|
18
|
+
parentSessionId: string | null;
|
|
19
|
+
rootSessionId: string;
|
|
20
|
+
nestedAgentDepth: number;
|
|
21
|
+
effectiveMaxNestedAgentDepth: number;
|
|
22
|
+
};
|
|
23
|
+
outcome: "created" | "repaired" | "replayed";
|
|
24
|
+
changed: boolean;
|
|
25
|
+
usageRecording: "recorded" | "failed";
|
|
26
|
+
};
|
|
27
|
+
/** Project committed session-create truth without copying request fields. */
|
|
28
|
+
export declare function sessionCreateMutationReceipt(result: SessionCreateReceiptResult, idempotencyKeyRequested: boolean): McpMutationReceiptType;
|