@opengeni/api-router 0.23.1 → 0.30.0
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 +3 -2
- package/dist/app.js +5 -3
- package/dist/auth/canonical-human-session-admission.d.ts +27 -0
- package/dist/browser-auth-broker.d.ts +20 -0
- package/dist/browser-controller-authority.d.ts +61 -0
- package/dist/browser-network-route.d.ts +8 -0
- package/dist/browser-state-authority.d.ts +27 -0
- package/dist/{chunk-T4T2PGU4.js → chunk-2PQMSRCB.js} +37891 -17463
- package/dist/chunk-2PQMSRCB.js.map +1 -0
- package/dist/codemode.d.ts +23 -0
- package/dist/controller-data-plane.d.ts +12 -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/auth.d.ts +1 -1
- package/dist/http/cors.d.ts +1 -0
- package/dist/http/sse.d.ts +18 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1796 -22
- 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/fiken.d.ts +233 -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 +22 -1
- package/dist/integrations/provider-oauth.d.ts +17 -0
- package/dist/integrations/slack-bot.d.ts +175 -1
- package/dist/integrations/slack-interactions.d.ts +24 -6
- package/dist/integrations/social-api.d.ts +2 -1
- package/dist/interaction-holder-heartbeat.d.ts +17 -0
- package/dist/interaction-metrics.d.ts +11 -0
- package/dist/mcp/editable-artifact-query-schema.d.ts +4 -0
- package/dist/mcp/editable-artifacts.d.ts +13 -0
- package/dist/mcp/scheduled-task-view.d.ts +168 -0
- package/dist/mcp/server.d.ts +16 -4
- package/dist/memory-slack-delivery.d.ts +9 -0
- package/dist/model-catalog.d.ts +1 -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/canonical-human-identities.d.ts +3 -0
- package/dist/routes/channels.d.ts +3 -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-facets.d.ts +3 -0
- package/dist/routes/interaction-resources.d.ts +5 -0
- package/dist/routes/memory-slack-publications.d.ts +6 -0
- package/dist/routes/organization-memberships.d.ts +3 -0
- package/dist/routes/plugins.d.ts +8 -0
- package/dist/routes/sessions.d.ts +18 -2
- package/dist/routes/skills.d.ts +6 -0
- package/dist/routes/slack-task-policy.d.ts +3 -0
- package/dist/routes/supergrok.d.ts +3 -0
- package/dist/routes/video-generation.d.ts +3 -0
- package/dist/sandbox/channel-a.d.ts +62 -2
- package/dist/sandbox/machines.d.ts +2 -2
- package/dist/sandbox/metrics-ingestion.d.ts +6 -1
- package/dist/sandbox/viewer.d.ts +7 -3
- package/dist/slack-reaction-files.d.ts +27 -0
- package/dist/temporal-schedule-cleanup.d.ts +26 -0
- package/dist/transcription/providers/xai-subscription.d.ts +8 -0
- package/dist/xai-realtime.d.ts +26 -0
- package/dist/xai-subscription-auth.d.ts +23 -0
- package/package.json +20 -14
- package/src/app.ts +604 -64
- package/src/auth/canonical-human-session-admission.ts +116 -0
- package/src/auth/managed-auth.ts +101 -0
- package/src/browser-auth-broker.ts +155 -0
- package/src/browser-controller-authority.ts +186 -0
- package/src/browser-network-route.ts +34 -0
- package/src/browser-state-authority.ts +236 -0
- package/src/codemode.ts +186 -0
- package/src/controller-data-plane.ts +35 -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 +29 -9
- package/src/http/cors.ts +3 -0
- package/src/http/sse.ts +229 -5
- package/src/index.ts +119 -20
- package/src/integrations/api-integrations.ts +365 -0
- package/src/integrations/atlassian.ts +1621 -0
- package/src/integrations/fiken.ts +1230 -0
- package/src/integrations/github-skill-source.ts +142 -0
- package/src/integrations/google-drive.ts +1005 -64
- package/src/integrations/oauth-client.ts +123 -33
- package/src/integrations/provider-oauth.ts +756 -0
- package/src/integrations/slack-bot.ts +669 -11
- package/src/integrations/slack-interactions.ts +2063 -93
- package/src/integrations/social-api.ts +11 -0
- package/src/interaction-holder-heartbeat.ts +95 -0
- package/src/interaction-metrics.ts +159 -0
- package/src/mcp/documents.ts +146 -6
- package/src/mcp/editable-artifact-query-schema.ts +236 -0
- package/src/mcp/editable-artifacts.ts +448 -0
- package/src/mcp/scheduled-task-view.ts +34 -0
- package/src/mcp/server.ts +1756 -355
- package/src/memory-slack-delivery.ts +209 -0
- package/src/model-catalog.ts +19 -6
- package/src/routes/api-integrations.ts +410 -0
- package/src/routes/browser-identities.ts +160 -0
- package/src/routes/browser-sessions.ts +4482 -0
- package/src/routes/canonical-human-identities.ts +156 -0
- package/src/routes/channels.ts +90 -0
- package/src/routes/company-profile.ts +255 -0
- package/src/routes/computer-sessions.ts +1602 -0
- package/src/routes/connections.ts +421 -99
- package/src/routes/documents.ts +22 -3
- package/src/routes/editable-artifacts.ts +1159 -0
- package/src/routes/files.ts +106 -4
- package/src/routes/github.ts +18 -2
- package/src/routes/install.ts +7 -1
- package/src/routes/integration-facets.ts +258 -0
- package/src/routes/interaction-resources.ts +595 -0
- package/src/routes/memory-slack-publications.ts +216 -0
- package/src/routes/organization-memberships.ts +53 -0
- package/src/routes/packs.ts +437 -7
- package/src/routes/plugins.ts +752 -0
- package/src/routes/rigs.ts +77 -20
- package/src/routes/scheduled-tasks.ts +67 -40
- package/src/routes/sessions.ts +830 -278
- package/src/routes/skills.ts +256 -0
- package/src/routes/slack-task-policy.ts +115 -0
- package/src/routes/supergrok.ts +717 -0
- package/src/routes/transcription-recordings.ts +9 -2
- package/src/routes/transcriptions.ts +2 -1
- package/src/routes/video-generation.ts +162 -0
- package/src/routes/workspaces.ts +68 -28
- package/src/sandbox/channel-a.ts +750 -116
- package/src/sandbox/machines.ts +5 -5
- package/src/sandbox/metrics-ingestion.ts +121 -3
- package/src/sandbox/rematerialize.ts +35 -47
- package/src/sandbox/viewer.ts +39 -12
- package/src/slack-reaction-files.ts +181 -0
- package/src/temporal-schedule-cleanup.ts +135 -0
- package/src/transcription/providers/xai-subscription.ts +110 -0
- package/src/transcription/service.ts +17 -2
- package/src/xai-realtime.ts +216 -0
- package/src/xai-subscription-auth.ts +132 -0
- package/dist/chunk-T4T2PGU4.js.map +0 -1
- package/dist/mcp/toolspace.d.ts +0 -71
- package/src/mcp/toolspace.ts +0 -1190
|
@@ -3,6 +3,7 @@ import { OPENGENI_SLACK_BOT_CREDENTIAL_LABEL, OPENGENI_SLACK_BOT_CREDENTIAL_ROLE
|
|
|
3
3
|
import { type Database } from "@opengeni/db";
|
|
4
4
|
import { type FetchLike } from "@opengeni/network";
|
|
5
5
|
import { HTTPException } from "hono/http-exception";
|
|
6
|
+
export declare const SLACK_REACTION_IMAGE_MAX_BYTES: number;
|
|
6
7
|
declare const SLACK_REACTION_CONTEXT_CHECKPOINT_VERSION = 1;
|
|
7
8
|
type SlackPayload = Record<string, unknown> & {
|
|
8
9
|
ok?: unknown;
|
|
@@ -20,6 +21,19 @@ export type VerifiedOpenGeniSlackBot = {
|
|
|
20
21
|
grantedScopes: string[];
|
|
21
22
|
metadata: OpenGeniSlackBotConnectionMetadata;
|
|
22
23
|
};
|
|
24
|
+
export type PreparedSlackReactionImage = Readonly<{
|
|
25
|
+
fileId: string;
|
|
26
|
+
filename: string;
|
|
27
|
+
declaredMimeType: string;
|
|
28
|
+
declaredSizeBytes: number | null;
|
|
29
|
+
downloadUrl: URL | null;
|
|
30
|
+
}>;
|
|
31
|
+
export type DownloadedSlackReactionImage = Readonly<{
|
|
32
|
+
fileId: string;
|
|
33
|
+
filename: string;
|
|
34
|
+
contentType: "image/png" | "image/jpeg" | "image/webp";
|
|
35
|
+
bytes: Uint8Array;
|
|
36
|
+
}>;
|
|
23
37
|
export declare function exchangeOpenGeniSlackAuthorizationCode(input: {
|
|
24
38
|
code: string;
|
|
25
39
|
clientId: string;
|
|
@@ -35,7 +49,32 @@ export type SlackBotReceipt = {
|
|
|
35
49
|
operationId?: string;
|
|
36
50
|
clientMessageId?: string;
|
|
37
51
|
};
|
|
38
|
-
type
|
|
52
|
+
export type SlackMessageBlock = {
|
|
53
|
+
type: "section";
|
|
54
|
+
block_id?: string;
|
|
55
|
+
text: {
|
|
56
|
+
type: "mrkdwn" | "plain_text";
|
|
57
|
+
text: string;
|
|
58
|
+
emoji?: boolean;
|
|
59
|
+
};
|
|
60
|
+
} | {
|
|
61
|
+
type: "actions";
|
|
62
|
+
block_id: string;
|
|
63
|
+
elements: Array<{
|
|
64
|
+
type: "button";
|
|
65
|
+
action_id: string;
|
|
66
|
+
value: string;
|
|
67
|
+
text: {
|
|
68
|
+
type: "plain_text";
|
|
69
|
+
text: string;
|
|
70
|
+
emoji?: boolean;
|
|
71
|
+
};
|
|
72
|
+
style?: "primary" | "danger";
|
|
73
|
+
}>;
|
|
74
|
+
} | {
|
|
75
|
+
type: "divider";
|
|
76
|
+
};
|
|
77
|
+
type SlackBotOperation = "channels.list" | "channel_history.read" | "thread_replies.read" | "users.list" | "files.list" | "file.info" | "file.content.read" | "message.post" | "message.update" | "message.delete";
|
|
39
78
|
type SlackBotContext = {
|
|
40
79
|
accountId: string;
|
|
41
80
|
workspaceId: string;
|
|
@@ -127,10 +166,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
127
166
|
isPrivate: boolean;
|
|
128
167
|
isMember: boolean;
|
|
129
168
|
isDirectMessage: boolean;
|
|
169
|
+
isMpim: boolean;
|
|
130
170
|
isArchived: boolean;
|
|
131
171
|
isShared: boolean;
|
|
132
172
|
isExternallyShared: boolean;
|
|
133
173
|
isOrgShared: boolean;
|
|
174
|
+
isPendingExternallyShared: boolean;
|
|
175
|
+
contextTeamId: string | null;
|
|
176
|
+
connectedTeamIds: string[] | null;
|
|
177
|
+
sharedTeamIds: string[] | null;
|
|
134
178
|
topic: string;
|
|
135
179
|
purpose: string;
|
|
136
180
|
numMembers: number | null;
|
|
@@ -145,18 +189,76 @@ export declare class OpenGeniSlackBotClient {
|
|
|
145
189
|
isPrivate: boolean;
|
|
146
190
|
isMember: boolean;
|
|
147
191
|
isDirectMessage: boolean;
|
|
192
|
+
isMpim: boolean;
|
|
148
193
|
isArchived: boolean;
|
|
149
194
|
isShared: boolean;
|
|
150
195
|
isExternallyShared: boolean;
|
|
151
196
|
isOrgShared: boolean;
|
|
197
|
+
isPendingExternallyShared: boolean;
|
|
198
|
+
contextTeamId: string | null;
|
|
199
|
+
connectedTeamIds: string[] | null;
|
|
200
|
+
sharedTeamIds: string[] | null;
|
|
152
201
|
topic: string;
|
|
153
202
|
purpose: string;
|
|
154
203
|
numMembers: number | null;
|
|
155
204
|
}>;
|
|
205
|
+
slackTaskPolicyFacts(channelId: string, userId: string): Promise<({
|
|
206
|
+
conversation: {
|
|
207
|
+
id: string;
|
|
208
|
+
name: string;
|
|
209
|
+
isPrivate: boolean;
|
|
210
|
+
isMember: boolean;
|
|
211
|
+
isDirectMessage: boolean;
|
|
212
|
+
isMpim: boolean;
|
|
213
|
+
isArchived: boolean;
|
|
214
|
+
isShared: boolean;
|
|
215
|
+
isExternallyShared: boolean;
|
|
216
|
+
isOrgShared: boolean;
|
|
217
|
+
isPendingExternallyShared: boolean;
|
|
218
|
+
contextTeamId: string | null;
|
|
219
|
+
connectedTeamIds: string[] | null;
|
|
220
|
+
sharedTeamIds: string[] | null;
|
|
221
|
+
topic: string;
|
|
222
|
+
purpose: string;
|
|
223
|
+
numMembers: number | null;
|
|
224
|
+
};
|
|
225
|
+
initiator: null;
|
|
226
|
+
} | {
|
|
227
|
+
conversation: {
|
|
228
|
+
id: string;
|
|
229
|
+
name: string;
|
|
230
|
+
isPrivate: boolean;
|
|
231
|
+
isMember: boolean;
|
|
232
|
+
isDirectMessage: boolean;
|
|
233
|
+
isMpim: boolean;
|
|
234
|
+
isArchived: boolean;
|
|
235
|
+
isShared: boolean;
|
|
236
|
+
isExternallyShared: boolean;
|
|
237
|
+
isOrgShared: boolean;
|
|
238
|
+
isPendingExternallyShared: boolean;
|
|
239
|
+
contextTeamId: string | null;
|
|
240
|
+
connectedTeamIds: string[] | null;
|
|
241
|
+
sharedTeamIds: string[] | null;
|
|
242
|
+
topic: string;
|
|
243
|
+
purpose: string;
|
|
244
|
+
numMembers: number | null;
|
|
245
|
+
};
|
|
246
|
+
initiator: {
|
|
247
|
+
id: string;
|
|
248
|
+
teamId: string | null;
|
|
249
|
+
isGuest: boolean | null;
|
|
250
|
+
isExternal: boolean | null;
|
|
251
|
+
};
|
|
252
|
+
}) & {
|
|
253
|
+
receipt: SlackBotReceipt;
|
|
254
|
+
}>;
|
|
156
255
|
channelHistory(input: {
|
|
157
256
|
channelId: string;
|
|
158
257
|
limit?: number;
|
|
159
258
|
cursor?: string;
|
|
259
|
+
latest?: string;
|
|
260
|
+
inclusive?: boolean;
|
|
261
|
+
authorizeRead?: () => Promise<void>;
|
|
160
262
|
}): Promise<{
|
|
161
263
|
channel: {
|
|
162
264
|
id: string;
|
|
@@ -164,10 +266,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
164
266
|
isPrivate: boolean;
|
|
165
267
|
isMember: boolean;
|
|
166
268
|
isDirectMessage: boolean;
|
|
269
|
+
isMpim: boolean;
|
|
167
270
|
isArchived: boolean;
|
|
168
271
|
isShared: boolean;
|
|
169
272
|
isExternallyShared: boolean;
|
|
170
273
|
isOrgShared: boolean;
|
|
274
|
+
isPendingExternallyShared: boolean;
|
|
275
|
+
contextTeamId: string | null;
|
|
276
|
+
connectedTeamIds: string[] | null;
|
|
277
|
+
sharedTeamIds: string[] | null;
|
|
171
278
|
topic: string;
|
|
172
279
|
purpose: string;
|
|
173
280
|
numMembers: number | null;
|
|
@@ -199,6 +306,10 @@ export declare class OpenGeniSlackBotClient {
|
|
|
199
306
|
threadTimestamp: string;
|
|
200
307
|
limit?: number;
|
|
201
308
|
cursor?: string;
|
|
309
|
+
oldest?: string;
|
|
310
|
+
latest?: string;
|
|
311
|
+
inclusive?: boolean;
|
|
312
|
+
authorizeRead?: () => Promise<void>;
|
|
202
313
|
}): Promise<{
|
|
203
314
|
channel: {
|
|
204
315
|
id: string;
|
|
@@ -206,10 +317,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
206
317
|
isPrivate: boolean;
|
|
207
318
|
isMember: boolean;
|
|
208
319
|
isDirectMessage: boolean;
|
|
320
|
+
isMpim: boolean;
|
|
209
321
|
isArchived: boolean;
|
|
210
322
|
isShared: boolean;
|
|
211
323
|
isExternallyShared: boolean;
|
|
212
324
|
isOrgShared: boolean;
|
|
325
|
+
isPendingExternallyShared: boolean;
|
|
326
|
+
contextTeamId: string | null;
|
|
327
|
+
connectedTeamIds: string[] | null;
|
|
328
|
+
sharedTeamIds: string[] | null;
|
|
213
329
|
topic: string;
|
|
214
330
|
purpose: string;
|
|
215
331
|
numMembers: number | null;
|
|
@@ -250,10 +366,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
250
366
|
isPrivate: boolean;
|
|
251
367
|
isMember: boolean;
|
|
252
368
|
isDirectMessage: boolean;
|
|
369
|
+
isMpim: boolean;
|
|
253
370
|
isArchived: boolean;
|
|
254
371
|
isShared: boolean;
|
|
255
372
|
isExternallyShared: boolean;
|
|
256
373
|
isOrgShared: boolean;
|
|
374
|
+
isPendingExternallyShared: boolean;
|
|
375
|
+
contextTeamId: string | null;
|
|
376
|
+
connectedTeamIds: string[] | null;
|
|
377
|
+
sharedTeamIds: string[] | null;
|
|
257
378
|
topic: string;
|
|
258
379
|
purpose: string;
|
|
259
380
|
numMembers: number | null;
|
|
@@ -299,6 +420,22 @@ export declare class OpenGeniSlackBotClient {
|
|
|
299
420
|
} & {
|
|
300
421
|
receipt: SlackBotReceipt;
|
|
301
422
|
}>;
|
|
423
|
+
/**
|
|
424
|
+
* Re-fetch and authorize the exact reacted-message files before any byte or
|
|
425
|
+
* workspace-storage mutation. The returned private URLs are process-local
|
|
426
|
+
* capabilities only and must never be persisted, logged, or projected into
|
|
427
|
+
* session input.
|
|
428
|
+
*/
|
|
429
|
+
prepareReactionImageDownloads(input: {
|
|
430
|
+
channelId: string;
|
|
431
|
+
files: readonly {
|
|
432
|
+
id: string;
|
|
433
|
+
name: string;
|
|
434
|
+
title: string;
|
|
435
|
+
}[];
|
|
436
|
+
}): Promise<PreparedSlackReactionImage[]>;
|
|
437
|
+
/** Download and fully validate one previously authorized Slack image. */
|
|
438
|
+
downloadReactionImage(input: PreparedSlackReactionImage): Promise<DownloadedSlackReactionImage>;
|
|
302
439
|
listUsers(input?: {
|
|
303
440
|
limit?: number;
|
|
304
441
|
cursor?: string;
|
|
@@ -326,10 +463,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
326
463
|
isPrivate: boolean;
|
|
327
464
|
isMember: boolean;
|
|
328
465
|
isDirectMessage: boolean;
|
|
466
|
+
isMpim: boolean;
|
|
329
467
|
isArchived: boolean;
|
|
330
468
|
isShared: boolean;
|
|
331
469
|
isExternallyShared: boolean;
|
|
332
470
|
isOrgShared: boolean;
|
|
471
|
+
isPendingExternallyShared: boolean;
|
|
472
|
+
contextTeamId: string | null;
|
|
473
|
+
connectedTeamIds: string[] | null;
|
|
474
|
+
sharedTeamIds: string[] | null;
|
|
333
475
|
topic: string;
|
|
334
476
|
purpose: string;
|
|
335
477
|
numMembers: number | null;
|
|
@@ -360,10 +502,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
360
502
|
isPrivate: boolean;
|
|
361
503
|
isMember: boolean;
|
|
362
504
|
isDirectMessage: boolean;
|
|
505
|
+
isMpim: boolean;
|
|
363
506
|
isArchived: boolean;
|
|
364
507
|
isShared: boolean;
|
|
365
508
|
isExternallyShared: boolean;
|
|
366
509
|
isOrgShared: boolean;
|
|
510
|
+
isPendingExternallyShared: boolean;
|
|
511
|
+
contextTeamId: string | null;
|
|
512
|
+
connectedTeamIds: string[] | null;
|
|
513
|
+
sharedTeamIds: string[] | null;
|
|
367
514
|
topic: string;
|
|
368
515
|
purpose: string;
|
|
369
516
|
numMembers: number | null;
|
|
@@ -394,10 +541,15 @@ export declare class OpenGeniSlackBotClient {
|
|
|
394
541
|
isPrivate: boolean;
|
|
395
542
|
isMember: boolean;
|
|
396
543
|
isDirectMessage: boolean;
|
|
544
|
+
isMpim: boolean;
|
|
397
545
|
isArchived: boolean;
|
|
398
546
|
isShared: boolean;
|
|
399
547
|
isExternallyShared: boolean;
|
|
400
548
|
isOrgShared: boolean;
|
|
549
|
+
isPendingExternallyShared: boolean;
|
|
550
|
+
contextTeamId: string | null;
|
|
551
|
+
connectedTeamIds: string[] | null;
|
|
552
|
+
sharedTeamIds: string[] | null;
|
|
401
553
|
topic: string;
|
|
402
554
|
purpose: string;
|
|
403
555
|
numMembers: number | null;
|
|
@@ -421,18 +573,36 @@ export declare class OpenGeniSlackBotClient {
|
|
|
421
573
|
} & {
|
|
422
574
|
receipt: SlackBotReceipt;
|
|
423
575
|
}>;
|
|
576
|
+
/**
|
|
577
|
+
* Internal server-owned delivery only. Generic model-facing MCP callers do
|
|
578
|
+
* not have a trustworthy durable logical-delivery identity and must never
|
|
579
|
+
* reach this method with a caller-generated operation ID.
|
|
580
|
+
*/
|
|
424
581
|
postMessage(input: {
|
|
425
582
|
operationId: string;
|
|
426
583
|
channelId?: string;
|
|
427
584
|
userId?: string;
|
|
428
585
|
threadTimestamp?: string;
|
|
429
586
|
text: string;
|
|
587
|
+
blocks?: SlackMessageBlock[];
|
|
588
|
+
requireActiveNonSharedChannel?: boolean;
|
|
430
589
|
}): Promise<{
|
|
431
590
|
channelId: string;
|
|
432
591
|
timestamp: string;
|
|
433
592
|
threadTimestamp: string | null;
|
|
434
593
|
receipt: SlackBotReceipt;
|
|
435
594
|
}>;
|
|
595
|
+
updateMessage(input: {
|
|
596
|
+
operationId: string;
|
|
597
|
+
channelId: string;
|
|
598
|
+
timestamp: string;
|
|
599
|
+
text: string;
|
|
600
|
+
blocks?: SlackMessageBlock[];
|
|
601
|
+
}): Promise<{
|
|
602
|
+
channelId: string;
|
|
603
|
+
timestamp: string;
|
|
604
|
+
receipt: SlackBotReceipt;
|
|
605
|
+
}>;
|
|
436
606
|
deleteMessage(input: {
|
|
437
607
|
operationId: string;
|
|
438
608
|
channelId: string;
|
|
@@ -444,7 +614,9 @@ export declare class OpenGeniSlackBotClient {
|
|
|
444
614
|
receipt: SlackBotReceipt;
|
|
445
615
|
}>;
|
|
446
616
|
private slackMessageExists;
|
|
617
|
+
private reconcilePostMessage;
|
|
447
618
|
private requireMemberChannel;
|
|
619
|
+
private requireActiveNonSharedMemberChannel;
|
|
448
620
|
private requireFileForChannel;
|
|
449
621
|
private readPrivateFileText;
|
|
450
622
|
private call;
|
|
@@ -457,6 +629,7 @@ export declare class OpenGeniSlackBotClient {
|
|
|
457
629
|
private completedPostResult;
|
|
458
630
|
private completedDeleteResult;
|
|
459
631
|
private postRequestDigest;
|
|
632
|
+
private updateRequestDigest;
|
|
460
633
|
private deleteRequestDigest;
|
|
461
634
|
private deletePrincipal;
|
|
462
635
|
private fileListPage;
|
|
@@ -480,6 +653,7 @@ export declare function createOpenGeniSlackBotInteractionClient(deps: {
|
|
|
480
653
|
subjectId: string;
|
|
481
654
|
sessionId?: string | null;
|
|
482
655
|
}): Promise<OpenGeniSlackBotClient>;
|
|
656
|
+
export declare function sniffSlackReactionImageMime(bytes: Uint8Array): "image/png" | "image/jpeg" | "image/webp" | null;
|
|
483
657
|
export declare function resolveSlackFilesListPage(input: {
|
|
484
658
|
channelId: string;
|
|
485
659
|
limit?: number;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { type WorkspaceSlackReactionSummonSettings } from "@opengeni/contracts";
|
|
1
|
+
import { type FileResourceRef, 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
|
+
import { type ImportedSlackReactionImage } from "../slack-reaction-files.js";
|
|
6
7
|
export declare const SLACK_INTERACTION_MAX_BODY_BYTES: number;
|
|
7
8
|
export declare const SLACK_SIGNATURE_REPLAY_WINDOW_SECONDS = 300;
|
|
8
|
-
export declare const SLACK_DELIVERY_EVENT_TYPES: readonly ["agent.message.completed", "session.humanInput.requested", "turn.completed", "turn.failed", "turn.cancelled", "session.status.changed"];
|
|
9
|
+
export declare const SLACK_DELIVERY_EVENT_TYPES: readonly ["agent.message.completed", "session.humanInput.requested", "session.requiresAction", "turn.completed", "turn.failed", "turn.cancelled", "session.status.changed"];
|
|
9
10
|
export declare const SLACK_TASK_INSTRUCTIONS: string;
|
|
10
11
|
/**
|
|
11
12
|
* Slack-originated tasks may retrieve the workspace bot's bounded read surface
|
|
@@ -13,7 +14,7 @@ export declare const SLACK_TASK_INSTRUCTIONS: string;
|
|
|
13
14
|
* selection at session creation while keeping Slack mutations out of the model
|
|
14
15
|
* surface; interaction delivery remains owned by the durable delivery pump.
|
|
15
16
|
*/
|
|
16
|
-
export declare const SLACK_TASK_FIRST_PARTY_MCP_TOOLS: ("artifacts_create" | "artifacts_get_source" | "artifacts_list" | "artifacts_publish" | "artifacts_rollback" | "connected_machine_remove" | "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_get_variable" | "variable_set_list" | "variable_set_set_variable")[];
|
|
17
|
+
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_auth" | "browser_clipboard" | "browser_debug" | "browser_identity" | "browser_lifecycle" | "browser_observe" | "browser_open" | "browser_publish" | "browser_tabs" | "capability_authorization_request" | "capability_catalog_search" | "computer_act" | "computer_clipboard" | "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" | "fiken_bank_accounts_list" | "fiken_companies_list" | "fiken_contact_create" | "fiken_contacts_list" | "fiken_invoice_draft_create" | "fiken_invoice_get" | "fiken_invoices_list" | "fiken_products_list" | "fiken_purchases_list" | "fiken_sales_list" | "github_connect_link" | "github_repositories_list" | "goal_complete" | "goal_pause" | "goal_progress" | "goal_set" | "goal_update" | "interaction_discover" | "interaction_request_human" | "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" | "task_note_archive" | "task_note_save" | "task_notes_list" | "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
18
|
export type NormalizedSlackInteraction = {
|
|
18
19
|
providerEventId: string;
|
|
19
20
|
providerMessageId: string;
|
|
@@ -24,8 +25,11 @@ export type NormalizedSlackInteraction = {
|
|
|
24
25
|
slackThreadTs: string | null;
|
|
25
26
|
triggerKind: SlackInteractionTriggerKind;
|
|
26
27
|
text: string;
|
|
28
|
+
hasFiles: boolean;
|
|
27
29
|
};
|
|
28
|
-
export declare function slackInteractionRoutePolicy(entry: Pick<SlackInteractionInboxEntry, "triggerKind" | "slackChannelId" | "slackThreadTs" | "slackMessageTs" | "slackUserId"
|
|
30
|
+
export declare function slackInteractionRoutePolicy(entry: Pick<SlackInteractionInboxEntry, "triggerKind" | "slackChannelId" | "slackThreadTs" | "slackMessageTs" | "slackUserId">, options?: {
|
|
31
|
+
privateHandoff?: boolean;
|
|
32
|
+
}): {
|
|
29
33
|
directMessageShortcut: boolean;
|
|
30
34
|
requiresChannelAccess: boolean;
|
|
31
35
|
visibility: "private" | "workspace";
|
|
@@ -44,8 +48,22 @@ export declare function startSlackInteractionPump(deps: ApiRouteDeps, options?:
|
|
|
44
48
|
intervalMs?: number;
|
|
45
49
|
maxPerTick?: number;
|
|
46
50
|
}): () => void;
|
|
51
|
+
export type SlackInvocationMessageContext = {
|
|
52
|
+
messages: Awaited<ReturnType<OpenGeniSlackBotClient["threadReplies"]>>["messages"];
|
|
53
|
+
nextCursor: string | null;
|
|
54
|
+
kind: "thread" | "channel";
|
|
55
|
+
};
|
|
56
|
+
export declare function slackInvocationTaskText(entry: Pick<SlackInteractionInboxEntry, "slackMessageTs" | "slackUserId" | "text">, context: SlackInvocationMessageContext): string;
|
|
47
57
|
type SlackReactionMessageContext = Awaited<ReturnType<OpenGeniSlackBotClient["reactionMessageContext"]>>;
|
|
48
|
-
|
|
58
|
+
type PreparedSlackReactionTask = Readonly<{
|
|
59
|
+
resources: FileResourceRef[];
|
|
60
|
+
attachments: ImportedSlackReactionImage[];
|
|
61
|
+
omissionCodes: string[];
|
|
62
|
+
omittedCount: number;
|
|
63
|
+
}>;
|
|
64
|
+
export declare function slackReactionTaskText(context: SlackReactionMessageContext, prepared?: PreparedSlackReactionTask): string;
|
|
65
|
+
export declare function slackDeliveryTextsCoalesce(left: string, right: string): boolean;
|
|
66
|
+
export declare function normalizedBlockActionInteraction(payload: Record<string, unknown>): NormalizedSlackInteraction;
|
|
49
67
|
type SlackUserLinkToken = {
|
|
50
68
|
workspaceId: string;
|
|
51
69
|
connectionId: string;
|
|
@@ -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,17 @@
|
|
|
1
|
+
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
+
import type { ApiRouteDeps } from "@opengeni/core";
|
|
3
|
+
/**
|
|
4
|
+
* Keep one durable interaction operation—and its sandbox holder when present—
|
|
5
|
+
* live while a bounded controller mutation is in flight. Browser profile
|
|
6
|
+
* capture/restore can legitimately take minutes; without this pulse a lifecycle
|
|
7
|
+
* reaper cannot distinguish that request from a caller that disappeared.
|
|
8
|
+
*/
|
|
9
|
+
export declare function withInteractionHolderHeartbeat<T>(deps: ApiRouteDeps, input: {
|
|
10
|
+
grant: AccessGrant;
|
|
11
|
+
workspaceId: string;
|
|
12
|
+
sandboxGroupId: string | null;
|
|
13
|
+
holderId: string;
|
|
14
|
+
operationId: string;
|
|
15
|
+
resourceId: string;
|
|
16
|
+
controllerGeneration: string;
|
|
17
|
+
}, run: () => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AuthRunMutationResponse, BrowserActionReceipt, BrowserActionRequest, PublishBrowserRevisionResponse, BrowserSessionMutationResponse, ComputerActionReceipt, ComputerActionRequest, ComputerSessionMutationResponse, InteractionInterventionMutationResponse, ProtectedAuthFillResponse } from "@opengeni/contracts";
|
|
2
|
+
import { type Observability } from "@opengeni/observability";
|
|
3
|
+
type InteractionLifecycleMutation = BrowserSessionMutationResponse | ComputerSessionMutationResponse;
|
|
4
|
+
type AuthMutation = AuthRunMutationResponse | ProtectedAuthFillResponse;
|
|
5
|
+
export declare function observeBrowserActionResult(observability: Observability | null | undefined, startedAtMs: number, request: BrowserActionRequest, receipt: BrowserActionReceipt): void;
|
|
6
|
+
export declare function observeComputerActionResult(observability: Observability | null | undefined, startedAtMs: number, request: ComputerActionRequest, receipt: ComputerActionReceipt): void;
|
|
7
|
+
export declare function observeLifecycleResult(observability: Observability | null | undefined, startedAtMs: number, response: InteractionLifecycleMutation): void;
|
|
8
|
+
export declare function observeBrowserRevisionPublication(observability: Observability | null | undefined, startedAtMs: number, response: PublishBrowserRevisionResponse): void;
|
|
9
|
+
export declare function observeAuthMutation(observability: Observability | null | undefined, startedAtMs: number, response: AuthMutation): void;
|
|
10
|
+
export declare function observeInterventionMutation(observability: Observability | null | undefined, response: InteractionInterventionMutationResponse): void;
|
|
11
|
+
export {};
|
|
@@ -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 {};
|