channelstack 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +56 -2
- package/bin/channelstack.mjs +31 -0
- package/dist/integrations/checks/checks.test.d.ts +1 -0
- package/dist/integrations/checks/checks.test.js +31 -0
- package/dist/integrations/checks/index.d.ts +102 -0
- package/dist/integrations/checks/index.js +1034 -0
- package/dist/integrations/matchers-core/index.d.ts +217 -0
- package/dist/integrations/matchers-core/index.js +799 -0
- package/dist/integrations/matchers-core/matchers.test.d.ts +1 -0
- package/dist/integrations/matchers-core/matchers.test.js +407 -0
- package/dist/integrations/vitest/global-setup.d.ts +3 -0
- package/dist/integrations/vitest/global-setup.js +19 -0
- package/dist/integrations/vitest/index.d.ts +82 -0
- package/dist/integrations/vitest/index.js +42 -0
- package/dist/integrations/vitest/plugin.test.d.ts +1 -0
- package/dist/integrations/vitest/plugin.test.js +19 -0
- package/dist/integrations/vitest/refused.d.ts +22 -0
- package/dist/integrations/vitest/refused.js +49 -0
- package/dist/integrations/vitest/setup.d.ts +1 -0
- package/dist/integrations/vitest/setup.js +139 -0
- package/dist/sdks/typescript/client.d.ts +14 -0
- package/dist/sdks/typescript/client.js +11 -0
- package/dist/sdks/typescript/generated/channels.d.ts +32 -0
- package/dist/sdks/typescript/generated/channels.js +4 -0
- package/dist/sdks/typescript/generated/index.d.ts +4178 -0
- package/dist/sdks/typescript/generated/index.js +4608 -0
- package/dist/sdks/typescript/generated/normalisation.d.ts +18 -0
- package/dist/sdks/typescript/generated/normalisation.js +14 -0
- package/dist/sdks/typescript/runtime/client.d.ts +56 -0
- package/dist/sdks/typescript/runtime/client.js +74 -0
- package/dist/sdks/typescript/runtime/credentials.d.ts +7 -0
- package/dist/sdks/typescript/runtime/credentials.js +20 -0
- package/dist/sdks/typescript/runtime/duration.d.ts +4 -0
- package/dist/sdks/typescript/runtime/duration.js +13 -0
- package/dist/sdks/typescript/runtime/files.d.ts +47 -0
- package/dist/sdks/typescript/runtime/files.js +53 -0
- package/dist/sdks/typescript/runtime/launcher.d.ts +27 -0
- package/dist/sdks/typescript/runtime/launcher.js +124 -0
- package/dist/sdks/typescript/runtime/responder.d.ts +26 -0
- package/dist/sdks/typescript/runtime/responder.js +42 -0
- package/dist/sdks/typescript/runtime/transport.d.ts +43 -0
- package/dist/sdks/typescript/runtime/transport.js +95 -0
- package/dist/sdks/typescript/runtime/wait.d.ts +96 -0
- package/dist/sdks/typescript/runtime/wait.js +159 -0
- package/dist/sdks/typescript/types.d.ts +82 -0
- package/dist/sdks/typescript/types.js +1 -0
- package/package.json +82 -4
|
@@ -0,0 +1,4178 @@
|
|
|
1
|
+
import { ClientBase, CONTEXT, type HandleContext, QUIET } from "../runtime/client.ts";
|
|
2
|
+
import { type Duration } from "../runtime/duration.ts";
|
|
3
|
+
import { type FileInput, type MediaSource } from "../runtime/files.ts";
|
|
4
|
+
import type { LaunchOptions } from "../runtime/launcher.ts";
|
|
5
|
+
import { type Responder } from "../runtime/responder.ts";
|
|
6
|
+
import { ChannelstackError, type Transport } from "../runtime/transport.ts";
|
|
7
|
+
import { type QuietOptions, type WaitOptions, type QuietState } from "../runtime/wait.ts";
|
|
8
|
+
/** The server version this SDK was generated for. */
|
|
9
|
+
export declare const VERSION = "0.2.0";
|
|
10
|
+
export declare class AccountInactiveError extends ChannelstackError {
|
|
11
|
+
}
|
|
12
|
+
export declare class ActionRequiresError extends ChannelstackError {
|
|
13
|
+
}
|
|
14
|
+
export declare class AlreadyInChannelError extends ChannelstackError {
|
|
15
|
+
}
|
|
16
|
+
export declare class AlreadyReactedError extends ChannelstackError {
|
|
17
|
+
}
|
|
18
|
+
export declare class CannotDmBotError extends ChannelstackError {
|
|
19
|
+
}
|
|
20
|
+
export declare class CannotEditOthersMessageError extends ChannelstackError {
|
|
21
|
+
}
|
|
22
|
+
export declare class CannotMessageUserError extends ChannelstackError {
|
|
23
|
+
}
|
|
24
|
+
export declare class CantDeleteMessageError extends ChannelstackError {
|
|
25
|
+
}
|
|
26
|
+
export declare class CantUpdateMessageError extends ChannelstackError {
|
|
27
|
+
}
|
|
28
|
+
export declare class CrossWorkspaceCredentialError extends ChannelstackError {
|
|
29
|
+
}
|
|
30
|
+
export declare class DispatchFailedError extends ChannelstackError {
|
|
31
|
+
}
|
|
32
|
+
export declare class EmptyMessageError extends ChannelstackError {
|
|
33
|
+
}
|
|
34
|
+
export declare class FakeActorInLiveWorldError extends ChannelstackError {
|
|
35
|
+
}
|
|
36
|
+
export declare class ForbiddenError extends ChannelstackError {
|
|
37
|
+
}
|
|
38
|
+
export declare class InternalError extends ChannelstackError {
|
|
39
|
+
}
|
|
40
|
+
export declare class InvalidArgumentError extends ChannelstackError {
|
|
41
|
+
}
|
|
42
|
+
export declare class InvalidAuthError extends ChannelstackError {
|
|
43
|
+
}
|
|
44
|
+
export declare class InvalidFormBodyError extends ChannelstackError {
|
|
45
|
+
}
|
|
46
|
+
export declare class LiveMisconfiguredError extends ChannelstackError {
|
|
47
|
+
}
|
|
48
|
+
export declare class LiveNotAllowlistedError extends ChannelstackError {
|
|
49
|
+
}
|
|
50
|
+
export declare class MethodNotSupportedForChannelTypeError extends ChannelstackError {
|
|
51
|
+
}
|
|
52
|
+
export declare class MissingAccessError extends ChannelstackError {
|
|
53
|
+
}
|
|
54
|
+
export declare class MissingPermissionsError extends ChannelstackError {
|
|
55
|
+
}
|
|
56
|
+
export declare class MsgTooLongError extends ChannelstackError {
|
|
57
|
+
}
|
|
58
|
+
export declare class NameTakenError extends ChannelstackError {
|
|
59
|
+
}
|
|
60
|
+
export declare class NoReactionError extends ChannelstackError {
|
|
61
|
+
}
|
|
62
|
+
export declare class NoTextError extends ChannelstackError {
|
|
63
|
+
}
|
|
64
|
+
export declare class NotAllowedError extends ChannelstackError {
|
|
65
|
+
}
|
|
66
|
+
export declare class NotFoundError extends ChannelstackError {
|
|
67
|
+
}
|
|
68
|
+
export declare class NotInChannelError extends ChannelstackError {
|
|
69
|
+
}
|
|
70
|
+
export declare class NotInRoomError extends ChannelstackError {
|
|
71
|
+
}
|
|
72
|
+
export declare class ObjectNotFoundError extends ChannelstackError {
|
|
73
|
+
}
|
|
74
|
+
export declare class RestrictedResourceError extends ChannelstackError {
|
|
75
|
+
}
|
|
76
|
+
export declare class SessionNotFoundError extends ChannelstackError {
|
|
77
|
+
}
|
|
78
|
+
export declare class SplitViewUnavailableError extends ChannelstackError {
|
|
79
|
+
}
|
|
80
|
+
export declare class StopUnavailableError extends ChannelstackError {
|
|
81
|
+
}
|
|
82
|
+
export declare class ThreadAlreadyCreatedError extends ChannelstackError {
|
|
83
|
+
}
|
|
84
|
+
export declare class UnauthorizedError extends ChannelstackError {
|
|
85
|
+
}
|
|
86
|
+
export declare class UnsupportedInFakeError extends ChannelstackError {
|
|
87
|
+
}
|
|
88
|
+
export declare class UnsupportedInLiveError extends ChannelstackError {
|
|
89
|
+
}
|
|
90
|
+
export declare class ValidationErrorError extends ChannelstackError {
|
|
91
|
+
}
|
|
92
|
+
export declare class ValidationFailedError extends ChannelstackError {
|
|
93
|
+
}
|
|
94
|
+
export interface Status {
|
|
95
|
+
ready: boolean;
|
|
96
|
+
version: string;
|
|
97
|
+
drivers: string[];
|
|
98
|
+
}
|
|
99
|
+
export interface EventPage {
|
|
100
|
+
events: LogEvent[];
|
|
101
|
+
cursor: string;
|
|
102
|
+
}
|
|
103
|
+
export interface LogEvent {
|
|
104
|
+
at: string;
|
|
105
|
+
driver: string;
|
|
106
|
+
kind: "action" | "delivery" | "delivery_attempt" | "api_call" | "bot_loop";
|
|
107
|
+
data: Record<string, unknown>;
|
|
108
|
+
summary?: {
|
|
109
|
+
text: string;
|
|
110
|
+
outcome: string;
|
|
111
|
+
ok: boolean;
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
export interface Quiet {
|
|
115
|
+
busy: boolean;
|
|
116
|
+
quietForMs: number;
|
|
117
|
+
open: string[];
|
|
118
|
+
problems: string[];
|
|
119
|
+
loops?: string[];
|
|
120
|
+
}
|
|
121
|
+
export type Env = Record<string, string>;
|
|
122
|
+
export type EchoApps = EchoApp[];
|
|
123
|
+
export type EchoAppsWire = EchoAppData[];
|
|
124
|
+
export interface EchoMessage {
|
|
125
|
+
id: string;
|
|
126
|
+
room: string;
|
|
127
|
+
author: EchoPrincipal;
|
|
128
|
+
text: string;
|
|
129
|
+
at: string;
|
|
130
|
+
delivery?: string;
|
|
131
|
+
}
|
|
132
|
+
export interface EchoPrincipal {
|
|
133
|
+
id: string;
|
|
134
|
+
name: string;
|
|
135
|
+
kind: "user" | "app";
|
|
136
|
+
}
|
|
137
|
+
export interface EchoMessagePage {
|
|
138
|
+
messages: EchoMessage[];
|
|
139
|
+
cursor: string;
|
|
140
|
+
}
|
|
141
|
+
export interface EchoTranscript {
|
|
142
|
+
entries: EchoTranscriptEntry[];
|
|
143
|
+
}
|
|
144
|
+
export interface EchoTranscriptEntry {
|
|
145
|
+
id: string;
|
|
146
|
+
author: EchoPrincipal;
|
|
147
|
+
at: string;
|
|
148
|
+
text: string;
|
|
149
|
+
controls: string[];
|
|
150
|
+
edited: boolean;
|
|
151
|
+
depth: number;
|
|
152
|
+
}
|
|
153
|
+
export type Capabilities = Record<string, Capability>;
|
|
154
|
+
export interface Capability {
|
|
155
|
+
fake: boolean;
|
|
156
|
+
live: boolean;
|
|
157
|
+
liveRequires: string[];
|
|
158
|
+
}
|
|
159
|
+
export interface SlackTeam {
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
}
|
|
163
|
+
export type SlackApps = SlackApp[];
|
|
164
|
+
export type SlackAppsWire = SlackAppData[];
|
|
165
|
+
export interface DeliveryAttempt {
|
|
166
|
+
number: number;
|
|
167
|
+
sentAt: string;
|
|
168
|
+
transport: "http" | "socket";
|
|
169
|
+
url?: string;
|
|
170
|
+
requestHeaders: Record<string, string>;
|
|
171
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
172
|
+
responseStatus?: number;
|
|
173
|
+
responseBody?: string;
|
|
174
|
+
durationMs?: number;
|
|
175
|
+
forgedSignature: boolean;
|
|
176
|
+
}
|
|
177
|
+
export interface SlackMessageInput {
|
|
178
|
+
text?: string;
|
|
179
|
+
blocks?: unknown[];
|
|
180
|
+
metadata?: SlackMessageMetadata;
|
|
181
|
+
}
|
|
182
|
+
export interface SlackMessageMetadata {
|
|
183
|
+
event_type: string;
|
|
184
|
+
event_payload: Record<string, unknown>;
|
|
185
|
+
}
|
|
186
|
+
export type SlackUsers = SlackUser[];
|
|
187
|
+
export type SlackUsersWire = SlackUserData[];
|
|
188
|
+
export type SlackConversations = SlackConversation[];
|
|
189
|
+
export type SlackConversationsWire = SlackConversationData[];
|
|
190
|
+
export interface SlackButtonRef {
|
|
191
|
+
label?: string;
|
|
192
|
+
actionId?: string;
|
|
193
|
+
value?: string;
|
|
194
|
+
}
|
|
195
|
+
export interface SlackMenuRef {
|
|
196
|
+
label?: string;
|
|
197
|
+
actionId?: string;
|
|
198
|
+
}
|
|
199
|
+
export type SlackSuggestedPrompts = Array<{
|
|
200
|
+
title: string;
|
|
201
|
+
message: string;
|
|
202
|
+
}>;
|
|
203
|
+
export type SlackModals = SlackModal[];
|
|
204
|
+
export type SlackModalsWire = SlackModalData[];
|
|
205
|
+
export type SlackModalValues = Record<string, string | string[] | undefined>;
|
|
206
|
+
export type SlackModalValuesWire = Record<string, string | string[] | null>;
|
|
207
|
+
export type SlackMessages = SlackMessage[];
|
|
208
|
+
export type SlackMessagesWire = SlackMessageData[];
|
|
209
|
+
export type SlackMembers = Array<SlackUser | SlackApp>;
|
|
210
|
+
export type SlackMembersWire = Array<SlackUserData | SlackAppData>;
|
|
211
|
+
export type SlackReplies = SlackMessage[];
|
|
212
|
+
export type SlackRepliesWire = SlackMessageData[];
|
|
213
|
+
export type SlackReactions = SlackReaction[];
|
|
214
|
+
export type SlackReactionsWire = SlackReactionWire[];
|
|
215
|
+
export interface SlackReaction {
|
|
216
|
+
emoji: string;
|
|
217
|
+
by: Array<SlackUser | SlackApp>;
|
|
218
|
+
}
|
|
219
|
+
export interface SlackReactionWire {
|
|
220
|
+
emoji: string;
|
|
221
|
+
by: Array<SlackUserData | SlackAppData>;
|
|
222
|
+
}
|
|
223
|
+
export interface SlackThreadStatus {
|
|
224
|
+
state: "working" | "streaming" | "stopped" | "idle";
|
|
225
|
+
text?: string;
|
|
226
|
+
sessionStatus?: "active" | "processing" | "suspended" | "closed";
|
|
227
|
+
}
|
|
228
|
+
export interface SlackTranscript {
|
|
229
|
+
entries: SlackTranscriptEntry[];
|
|
230
|
+
text: string;
|
|
231
|
+
toString(): string;
|
|
232
|
+
}
|
|
233
|
+
export interface SlackTranscriptWire {
|
|
234
|
+
entries: SlackTranscriptEntry[];
|
|
235
|
+
text: string;
|
|
236
|
+
}
|
|
237
|
+
export interface SlackTranscriptEntry {
|
|
238
|
+
id: string;
|
|
239
|
+
author: SlackPrincipal;
|
|
240
|
+
at: string;
|
|
241
|
+
text: string;
|
|
242
|
+
controls: string[];
|
|
243
|
+
edited: boolean;
|
|
244
|
+
depth: number;
|
|
245
|
+
files: string[];
|
|
246
|
+
alsoInChannel?: true;
|
|
247
|
+
streaming?: "open" | "stopped" | "completed";
|
|
248
|
+
visibleTo?: SlackPrincipal;
|
|
249
|
+
}
|
|
250
|
+
export interface SlackPrincipal {
|
|
251
|
+
id: string;
|
|
252
|
+
name: string;
|
|
253
|
+
kind: "user" | "app";
|
|
254
|
+
}
|
|
255
|
+
export type SlackEphemeralMessages = SlackMessage[];
|
|
256
|
+
export type SlackEphemeralMessagesWire = SlackMessageData[];
|
|
257
|
+
export type SlackMessageDeliveries = SlackDelivery[];
|
|
258
|
+
export type SlackMessageDeliveriesWire = SlackDeliveryData[];
|
|
259
|
+
export type SlackDeliveries = SlackDelivery[];
|
|
260
|
+
export type SlackDeliveriesWire = SlackDeliveryData[];
|
|
261
|
+
export type SlackApiCalls = SlackApiCall[];
|
|
262
|
+
export interface SlackApiCall {
|
|
263
|
+
id: string;
|
|
264
|
+
channel: "slack";
|
|
265
|
+
operation: string;
|
|
266
|
+
method: string;
|
|
267
|
+
path: string;
|
|
268
|
+
at: string;
|
|
269
|
+
durationMs: number;
|
|
270
|
+
request?: unknown;
|
|
271
|
+
responseStatus: number;
|
|
272
|
+
response?: unknown;
|
|
273
|
+
error?: string;
|
|
274
|
+
}
|
|
275
|
+
export type SlackUninstallDeliveries = SlackDelivery[];
|
|
276
|
+
export type SlackUninstallDeliveriesWire = SlackDeliveryData[];
|
|
277
|
+
export type GitHubUsers = GitHubUser[];
|
|
278
|
+
export type GitHubUsersWire = GitHubUserData[];
|
|
279
|
+
export type GitHubRepos = GitHubRepo[];
|
|
280
|
+
export type GitHubReposWire = GitHubRepoData[];
|
|
281
|
+
export type GitHubIssues = GitHubIssueListing[];
|
|
282
|
+
export type GitHubIssuesWire = GitHubIssueListingWire[];
|
|
283
|
+
export interface GitHubIssueListing {
|
|
284
|
+
issue: GitHubIssue;
|
|
285
|
+
title: string;
|
|
286
|
+
pullRequest: boolean;
|
|
287
|
+
}
|
|
288
|
+
export interface GitHubIssueListingWire {
|
|
289
|
+
issue: GitHubIssueData;
|
|
290
|
+
title: string;
|
|
291
|
+
pullRequest: boolean;
|
|
292
|
+
}
|
|
293
|
+
export type GitHubApps = GitHubApp[];
|
|
294
|
+
export type GitHubAppsWire = GitHubAppData[];
|
|
295
|
+
export type GitHubCommits = GitHubCommit[];
|
|
296
|
+
export type GitHubCommitsWire = GitHubCommitData[];
|
|
297
|
+
export type GitHubCheckRuns = GitHubCheckRun[];
|
|
298
|
+
export type GitHubCheckRunsWire = GitHubCheckRunData[];
|
|
299
|
+
export type GitHubStatuses = Array<{
|
|
300
|
+
context: string;
|
|
301
|
+
state: "pending" | "success" | "failure" | "error";
|
|
302
|
+
author: GitHubUser | GitHubApp;
|
|
303
|
+
}>;
|
|
304
|
+
export type GitHubStatusesWire = Array<{
|
|
305
|
+
context: string;
|
|
306
|
+
state: "pending" | "success" | "failure" | "error";
|
|
307
|
+
author: GitHubUserData | GitHubAppData;
|
|
308
|
+
}>;
|
|
309
|
+
export type GitHubLabelDeliveries = GitHubDelivery[];
|
|
310
|
+
export type GitHubLabelDeliveriesWire = GitHubDeliveryData[];
|
|
311
|
+
export type GitHubUnlabelDeliveries = GitHubDelivery[];
|
|
312
|
+
export type GitHubUnlabelDeliveriesWire = GitHubDeliveryData[];
|
|
313
|
+
export type GitHubAssignDeliveries = GitHubDelivery[];
|
|
314
|
+
export type GitHubAssignDeliveriesWire = GitHubDeliveryData[];
|
|
315
|
+
export interface GitHubReview {
|
|
316
|
+
id: number;
|
|
317
|
+
author: GitHubUser | GitHubApp;
|
|
318
|
+
state: "COMMENTED" | "APPROVED" | "CHANGES_REQUESTED" | "DISMISSED" | "PENDING";
|
|
319
|
+
body: string;
|
|
320
|
+
comments: GitHubReviewComment[];
|
|
321
|
+
delivery?: GitHubDelivery;
|
|
322
|
+
}
|
|
323
|
+
export interface GitHubReviewWire {
|
|
324
|
+
id: number;
|
|
325
|
+
author: GitHubUserData | GitHubAppData;
|
|
326
|
+
state: "COMMENTED" | "APPROVED" | "CHANGES_REQUESTED" | "DISMISSED" | "PENDING";
|
|
327
|
+
body: string;
|
|
328
|
+
comments: GitHubReviewCommentData[];
|
|
329
|
+
delivery?: GitHubDeliveryData;
|
|
330
|
+
}
|
|
331
|
+
export type GitHubComments = GitHubComment[];
|
|
332
|
+
export type GitHubCommentsWire = GitHubCommentData[];
|
|
333
|
+
export interface GitHubTranscript {
|
|
334
|
+
entries: GitHubTranscriptEntry[];
|
|
335
|
+
text: string;
|
|
336
|
+
toString(): string;
|
|
337
|
+
}
|
|
338
|
+
export interface GitHubTranscriptWire {
|
|
339
|
+
entries: GitHubTranscriptEntry[];
|
|
340
|
+
text: string;
|
|
341
|
+
}
|
|
342
|
+
export interface GitHubTranscriptEntry {
|
|
343
|
+
id: string;
|
|
344
|
+
author: GitHubPrincipal;
|
|
345
|
+
at: string;
|
|
346
|
+
text: string;
|
|
347
|
+
controls: string[];
|
|
348
|
+
edited: boolean;
|
|
349
|
+
depth: number;
|
|
350
|
+
}
|
|
351
|
+
export interface GitHubPrincipal {
|
|
352
|
+
id: string;
|
|
353
|
+
name: string;
|
|
354
|
+
kind: "user" | "app";
|
|
355
|
+
}
|
|
356
|
+
export type GitHubReviews = GitHubReview[];
|
|
357
|
+
export type GitHubReviewsWire = GitHubReviewWire[];
|
|
358
|
+
export type GitHubReviewComments = GitHubReviewComment[];
|
|
359
|
+
export type GitHubReviewCommentsWire = GitHubReviewCommentData[];
|
|
360
|
+
export type GitHubPullCheckRuns = GitHubCheckRun[];
|
|
361
|
+
export type GitHubPullCheckRunsWire = GitHubCheckRunData[];
|
|
362
|
+
export type GitHubReactions = GitHubReaction[];
|
|
363
|
+
export type GitHubReactionsWire = GitHubReactionWire[];
|
|
364
|
+
export interface GitHubReaction {
|
|
365
|
+
content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes";
|
|
366
|
+
by: Array<GitHubUser | GitHubApp>;
|
|
367
|
+
}
|
|
368
|
+
export interface GitHubReactionWire {
|
|
369
|
+
content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes";
|
|
370
|
+
by: Array<GitHubUserData | GitHubAppData>;
|
|
371
|
+
}
|
|
372
|
+
export type GitHubReviewCommentReplies = GitHubReviewComment[];
|
|
373
|
+
export type GitHubReviewCommentRepliesWire = GitHubReviewCommentData[];
|
|
374
|
+
export type GitHubDeliveries = GitHubDelivery[];
|
|
375
|
+
export type GitHubDeliveriesWire = GitHubDeliveryData[];
|
|
376
|
+
export type GitHubApiCalls = GitHubApiCall[];
|
|
377
|
+
export interface GitHubApiCall {
|
|
378
|
+
id: string;
|
|
379
|
+
channel: "github";
|
|
380
|
+
operation: string;
|
|
381
|
+
method: string;
|
|
382
|
+
path: string;
|
|
383
|
+
at: string;
|
|
384
|
+
durationMs: number;
|
|
385
|
+
request?: unknown;
|
|
386
|
+
responseStatus: number;
|
|
387
|
+
response?: unknown;
|
|
388
|
+
error?: string;
|
|
389
|
+
}
|
|
390
|
+
export type GitHubAppCalls = GitHubApiCall[];
|
|
391
|
+
export type LinearApps = LinearApp[];
|
|
392
|
+
export type LinearAppsWire = LinearAppData[];
|
|
393
|
+
export type LinearUsers = LinearUser[];
|
|
394
|
+
export type LinearUsersWire = LinearUserData[];
|
|
395
|
+
export type LinearTeams = LinearTeam[];
|
|
396
|
+
export type LinearTeamsWire = LinearTeamData[];
|
|
397
|
+
export type LinearIssues = LinearIssueListing[];
|
|
398
|
+
export type LinearIssuesWire = LinearIssueListingWire[];
|
|
399
|
+
export interface LinearIssueListing {
|
|
400
|
+
issue: LinearIssue;
|
|
401
|
+
title: string;
|
|
402
|
+
}
|
|
403
|
+
export interface LinearIssueListingWire {
|
|
404
|
+
issue: LinearIssueData;
|
|
405
|
+
title: string;
|
|
406
|
+
}
|
|
407
|
+
export interface LinearIssueState {
|
|
408
|
+
name: string;
|
|
409
|
+
type: "backlog" | "unstarted" | "started" | "completed" | "canceled" | "triage" | "duplicate";
|
|
410
|
+
}
|
|
411
|
+
export type LinearComments = LinearComment[];
|
|
412
|
+
export type LinearCommentsWire = LinearCommentData[];
|
|
413
|
+
export type LinearAgentSessions = LinearAgentSession[];
|
|
414
|
+
export type LinearAgentSessionsWire = LinearAgentSessionData[];
|
|
415
|
+
export interface LinearTranscript {
|
|
416
|
+
entries: LinearTranscriptEntry[];
|
|
417
|
+
text: string;
|
|
418
|
+
toString(): string;
|
|
419
|
+
}
|
|
420
|
+
export interface LinearTranscriptWire {
|
|
421
|
+
entries: LinearTranscriptEntry[];
|
|
422
|
+
text: string;
|
|
423
|
+
}
|
|
424
|
+
export interface LinearTranscriptEntry {
|
|
425
|
+
id: string;
|
|
426
|
+
author: LinearPrincipal;
|
|
427
|
+
at: string;
|
|
428
|
+
text: string;
|
|
429
|
+
controls: string[];
|
|
430
|
+
edited: boolean;
|
|
431
|
+
depth: number;
|
|
432
|
+
}
|
|
433
|
+
export interface LinearPrincipal {
|
|
434
|
+
id: string;
|
|
435
|
+
name: string;
|
|
436
|
+
kind: "user" | "app";
|
|
437
|
+
}
|
|
438
|
+
export type LinearCommentReplies = LinearComment[];
|
|
439
|
+
export type LinearCommentRepliesWire = LinearCommentData[];
|
|
440
|
+
export type LinearAgentActivities = LinearAgentActivity[];
|
|
441
|
+
export type LinearAgentActivitiesWire = LinearAgentActivityData[];
|
|
442
|
+
export type LinearExternalUrls = Array<{
|
|
443
|
+
label: string;
|
|
444
|
+
url: string;
|
|
445
|
+
}>;
|
|
446
|
+
export type LinearPlan = Array<{
|
|
447
|
+
content: string;
|
|
448
|
+
status: "pending" | "inProgress" | "completed" | "canceled";
|
|
449
|
+
}>;
|
|
450
|
+
export type LinearDeliveries = LinearDelivery[];
|
|
451
|
+
export type LinearDeliveriesWire = LinearDeliveryData[];
|
|
452
|
+
export type LinearApiCalls = LinearApiCall[];
|
|
453
|
+
export interface LinearApiCall {
|
|
454
|
+
id: string;
|
|
455
|
+
channel: "linear";
|
|
456
|
+
operation: string;
|
|
457
|
+
method: string;
|
|
458
|
+
path: string;
|
|
459
|
+
at: string;
|
|
460
|
+
durationMs: number;
|
|
461
|
+
request?: unknown;
|
|
462
|
+
responseStatus: number;
|
|
463
|
+
response?: unknown;
|
|
464
|
+
error?: string;
|
|
465
|
+
}
|
|
466
|
+
export type NotionCapability = "read_content" | "update_content" | "insert_content" | "read_comments" | "insert_comments" | "read_user_info";
|
|
467
|
+
export type NotionIntegrations = NotionIntegration[];
|
|
468
|
+
export type NotionIntegrationsWire = NotionIntegrationData[];
|
|
469
|
+
export type NotionUsers = NotionUser[];
|
|
470
|
+
export type NotionUsersWire = NotionUserData[];
|
|
471
|
+
export type NotionPages = NotionPage[];
|
|
472
|
+
export type NotionPagesWire = NotionPageData[];
|
|
473
|
+
export type NotionPropertySchema = "title" | "rich_text" | "number" | "checkbox" | "date" | "people" | "url" | "email" | {
|
|
474
|
+
select: string[];
|
|
475
|
+
} | {
|
|
476
|
+
multi_select: string[];
|
|
477
|
+
} | {
|
|
478
|
+
status: string[];
|
|
479
|
+
} | {
|
|
480
|
+
relation: NotionDatabase;
|
|
481
|
+
};
|
|
482
|
+
export type NotionPropertyValue = string | number | boolean | string[] | {
|
|
483
|
+
start: string;
|
|
484
|
+
end?: string;
|
|
485
|
+
} | undefined;
|
|
486
|
+
export type NotionPropertyValueWire = string | number | boolean | string[] | {
|
|
487
|
+
start: string;
|
|
488
|
+
end?: string;
|
|
489
|
+
} | null;
|
|
490
|
+
export type NotionDiscussions = NotionDiscussion[];
|
|
491
|
+
export type NotionDiscussionsWire = NotionDiscussionData[];
|
|
492
|
+
export type NotionBlocks = unknown[];
|
|
493
|
+
export type NotionChildPages = NotionPage[];
|
|
494
|
+
export type NotionChildPagesWire = NotionPageData[];
|
|
495
|
+
export type NotionConnections = NotionIntegration[];
|
|
496
|
+
export type NotionConnectionsWire = NotionIntegrationData[];
|
|
497
|
+
export interface NotionTranscript {
|
|
498
|
+
entries: NotionTranscriptEntry[];
|
|
499
|
+
text: string;
|
|
500
|
+
toString(): string;
|
|
501
|
+
}
|
|
502
|
+
export interface NotionTranscriptWire {
|
|
503
|
+
entries: NotionTranscriptEntry[];
|
|
504
|
+
text: string;
|
|
505
|
+
}
|
|
506
|
+
export interface NotionTranscriptEntry {
|
|
507
|
+
id: string;
|
|
508
|
+
author: NotionPrincipal;
|
|
509
|
+
at: string;
|
|
510
|
+
text: string;
|
|
511
|
+
controls: string[];
|
|
512
|
+
edited: boolean;
|
|
513
|
+
depth: number;
|
|
514
|
+
}
|
|
515
|
+
export interface NotionPrincipal {
|
|
516
|
+
id: string;
|
|
517
|
+
name: string;
|
|
518
|
+
kind: "user" | "app";
|
|
519
|
+
}
|
|
520
|
+
export type NotionRows = NotionPage[];
|
|
521
|
+
export type NotionRowsWire = NotionPageData[];
|
|
522
|
+
export type NotionComments = NotionComment[];
|
|
523
|
+
export type NotionCommentsWire = NotionCommentData[];
|
|
524
|
+
export type NotionDeliveries = NotionDelivery[];
|
|
525
|
+
export type NotionDeliveriesWire = NotionDeliveryData[];
|
|
526
|
+
export type NotionApiCalls = NotionApiCall[];
|
|
527
|
+
export interface NotionApiCall {
|
|
528
|
+
id: string;
|
|
529
|
+
channel: "notion";
|
|
530
|
+
operation: string;
|
|
531
|
+
method: string;
|
|
532
|
+
path: string;
|
|
533
|
+
at: string;
|
|
534
|
+
durationMs: number;
|
|
535
|
+
request?: unknown;
|
|
536
|
+
responseStatus: number;
|
|
537
|
+
response?: unknown;
|
|
538
|
+
error?: string;
|
|
539
|
+
}
|
|
540
|
+
export type ResendApps = ResendApp[];
|
|
541
|
+
export type ResendAppsWire = ResendAppData[];
|
|
542
|
+
export interface ResendPrincipal {
|
|
543
|
+
id: string;
|
|
544
|
+
name: string;
|
|
545
|
+
kind: "user" | "app";
|
|
546
|
+
}
|
|
547
|
+
export type ResendUsers = ResendUser[];
|
|
548
|
+
export type ResendUsersWire = ResendUserData[];
|
|
549
|
+
export type ResendThreads = ResendThread[];
|
|
550
|
+
export type ResendThreadsWire = ResendThreadData[];
|
|
551
|
+
export type ResendInbox = ResendEmail[];
|
|
552
|
+
export type ResendInboxWire = ResendEmailData[];
|
|
553
|
+
export type ResendMessages = ResendEmail[];
|
|
554
|
+
export type ResendMessagesWire = ResendEmailData[];
|
|
555
|
+
export type ResendReplies = ResendEmail[];
|
|
556
|
+
export type ResendRepliesWire = ResendEmailData[];
|
|
557
|
+
export interface ResendTranscript {
|
|
558
|
+
entries: ResendTranscriptEntry[];
|
|
559
|
+
text: string;
|
|
560
|
+
toString(): string;
|
|
561
|
+
}
|
|
562
|
+
export interface ResendTranscriptWire {
|
|
563
|
+
entries: ResendTranscriptEntry[];
|
|
564
|
+
text: string;
|
|
565
|
+
}
|
|
566
|
+
export interface ResendTranscriptEntry {
|
|
567
|
+
id: string;
|
|
568
|
+
author: ResendPrincipal;
|
|
569
|
+
at: string;
|
|
570
|
+
text: string;
|
|
571
|
+
controls: string[];
|
|
572
|
+
edited: boolean;
|
|
573
|
+
depth: number;
|
|
574
|
+
}
|
|
575
|
+
export type ResendDeliveries = ResendDelivery[];
|
|
576
|
+
export type ResendDeliveriesWire = ResendDeliveryData[];
|
|
577
|
+
export type ResendApiCalls = ResendApiCall[];
|
|
578
|
+
export interface ResendApiCall {
|
|
579
|
+
id: string;
|
|
580
|
+
channel: "resend";
|
|
581
|
+
operation: string;
|
|
582
|
+
method: string;
|
|
583
|
+
path: string;
|
|
584
|
+
at: string;
|
|
585
|
+
durationMs: number;
|
|
586
|
+
request?: unknown;
|
|
587
|
+
responseStatus: number;
|
|
588
|
+
response?: unknown;
|
|
589
|
+
error?: string;
|
|
590
|
+
}
|
|
591
|
+
export type GoogleApps = GoogleApp[];
|
|
592
|
+
export type GoogleAppsWire = GoogleAppData[];
|
|
593
|
+
export interface GooglePrincipal {
|
|
594
|
+
id: string;
|
|
595
|
+
name: string;
|
|
596
|
+
kind: "user" | "app";
|
|
597
|
+
}
|
|
598
|
+
export type GoogleUsers = GoogleUser[];
|
|
599
|
+
export type GoogleUsersWire = GoogleUserData[];
|
|
600
|
+
export type GoogleThreads = GoogleThread[];
|
|
601
|
+
export type GoogleThreadsWire = GoogleThreadData[];
|
|
602
|
+
export type GoogleInbox = GoogleEmail[];
|
|
603
|
+
export type GoogleInboxWire = GoogleEmailData[];
|
|
604
|
+
export type GoogleMessages = GoogleEmail[];
|
|
605
|
+
export type GoogleMessagesWire = GoogleEmailData[];
|
|
606
|
+
export type GoogleReplies = GoogleEmail[];
|
|
607
|
+
export type GoogleRepliesWire = GoogleEmailData[];
|
|
608
|
+
export interface GoogleTranscript {
|
|
609
|
+
entries: GoogleTranscriptEntry[];
|
|
610
|
+
text: string;
|
|
611
|
+
toString(): string;
|
|
612
|
+
}
|
|
613
|
+
export interface GoogleTranscriptWire {
|
|
614
|
+
entries: GoogleTranscriptEntry[];
|
|
615
|
+
text: string;
|
|
616
|
+
}
|
|
617
|
+
export interface GoogleTranscriptEntry {
|
|
618
|
+
id: string;
|
|
619
|
+
author: GooglePrincipal;
|
|
620
|
+
at: string;
|
|
621
|
+
text: string;
|
|
622
|
+
controls: string[];
|
|
623
|
+
edited: boolean;
|
|
624
|
+
depth: number;
|
|
625
|
+
}
|
|
626
|
+
export type GoogleDeliveries = GoogleDelivery[];
|
|
627
|
+
export type GoogleDeliveriesWire = GoogleDeliveryData[];
|
|
628
|
+
export type GoogleApiCalls = GoogleApiCall[];
|
|
629
|
+
export interface GoogleApiCall {
|
|
630
|
+
id: string;
|
|
631
|
+
channel: "google";
|
|
632
|
+
operation: string;
|
|
633
|
+
method: string;
|
|
634
|
+
path: string;
|
|
635
|
+
at: string;
|
|
636
|
+
durationMs: number;
|
|
637
|
+
request?: unknown;
|
|
638
|
+
responseStatus: number;
|
|
639
|
+
response?: unknown;
|
|
640
|
+
error?: string;
|
|
641
|
+
}
|
|
642
|
+
export interface DiscordGuild {
|
|
643
|
+
id: string;
|
|
644
|
+
name: string;
|
|
645
|
+
}
|
|
646
|
+
export type DiscordApps = DiscordApp[];
|
|
647
|
+
export type DiscordAppsWire = DiscordAppData[];
|
|
648
|
+
export interface DiscordMessageInput {
|
|
649
|
+
content?: string;
|
|
650
|
+
embeds?: unknown[];
|
|
651
|
+
}
|
|
652
|
+
export type DiscordUsers = DiscordUser[];
|
|
653
|
+
export type DiscordUsersWire = DiscordUserData[];
|
|
654
|
+
export type DiscordChannels = DiscordChannel[];
|
|
655
|
+
export type DiscordChannelsWire = DiscordChannelData[];
|
|
656
|
+
export interface DiscordButtonRef {
|
|
657
|
+
label?: string;
|
|
658
|
+
customId?: string;
|
|
659
|
+
}
|
|
660
|
+
export type DiscordEphemeralMessages = DiscordMessage[];
|
|
661
|
+
export type DiscordEphemeralMessagesWire = DiscordMessageData[];
|
|
662
|
+
export type DiscordMessages = DiscordMessage[];
|
|
663
|
+
export type DiscordMessagesWire = DiscordMessageData[];
|
|
664
|
+
export type DiscordMembers = Array<DiscordUser | DiscordApp>;
|
|
665
|
+
export type DiscordMembersWire = Array<DiscordUserData | DiscordAppData>;
|
|
666
|
+
export type DiscordThreads = DiscordChannel[];
|
|
667
|
+
export type DiscordThreadsWire = DiscordChannelData[];
|
|
668
|
+
export interface DiscordTranscript {
|
|
669
|
+
entries: DiscordTranscriptEntry[];
|
|
670
|
+
text: string;
|
|
671
|
+
toString(): string;
|
|
672
|
+
}
|
|
673
|
+
export interface DiscordTranscriptWire {
|
|
674
|
+
entries: DiscordTranscriptEntry[];
|
|
675
|
+
text: string;
|
|
676
|
+
}
|
|
677
|
+
export interface DiscordTranscriptEntry {
|
|
678
|
+
id: string;
|
|
679
|
+
author: DiscordPrincipal;
|
|
680
|
+
at: string;
|
|
681
|
+
text: string;
|
|
682
|
+
controls: string[];
|
|
683
|
+
edited: boolean;
|
|
684
|
+
depth: number;
|
|
685
|
+
replyTo?: string;
|
|
686
|
+
streaming?: "open";
|
|
687
|
+
visibleTo?: DiscordPrincipal;
|
|
688
|
+
}
|
|
689
|
+
export interface DiscordPrincipal {
|
|
690
|
+
id: string;
|
|
691
|
+
name: string;
|
|
692
|
+
kind: "user" | "app";
|
|
693
|
+
}
|
|
694
|
+
export type DiscordReplies = DiscordMessage[];
|
|
695
|
+
export type DiscordRepliesWire = DiscordMessageData[];
|
|
696
|
+
export type DiscordReactions = DiscordReaction[];
|
|
697
|
+
export type DiscordReactionsWire = DiscordReactionWire[];
|
|
698
|
+
export interface DiscordReaction {
|
|
699
|
+
emoji: string;
|
|
700
|
+
by: Array<DiscordUser | DiscordApp>;
|
|
701
|
+
}
|
|
702
|
+
export interface DiscordReactionWire {
|
|
703
|
+
emoji: string;
|
|
704
|
+
by: Array<DiscordUserData | DiscordAppData>;
|
|
705
|
+
}
|
|
706
|
+
export type DiscordMessageDeliveries = DiscordDelivery[];
|
|
707
|
+
export type DiscordMessageDeliveriesWire = DiscordDeliveryData[];
|
|
708
|
+
export interface DiscordEndpointCheck {
|
|
709
|
+
valid: boolean;
|
|
710
|
+
problems: string[];
|
|
711
|
+
deliveries: string[];
|
|
712
|
+
}
|
|
713
|
+
export type DiscordDeliveries = DiscordDelivery[];
|
|
714
|
+
export type DiscordDeliveriesWire = DiscordDeliveryData[];
|
|
715
|
+
export type DiscordApiCalls = DiscordApiCall[];
|
|
716
|
+
export interface DiscordApiCall {
|
|
717
|
+
id: string;
|
|
718
|
+
channel: "discord";
|
|
719
|
+
operation: string;
|
|
720
|
+
method: string;
|
|
721
|
+
path: string;
|
|
722
|
+
at: string;
|
|
723
|
+
durationMs: number;
|
|
724
|
+
request?: unknown;
|
|
725
|
+
responseStatus: number;
|
|
726
|
+
response?: unknown;
|
|
727
|
+
error?: string;
|
|
728
|
+
}
|
|
729
|
+
export type OpenAITurnInput = string | OpenAITurn;
|
|
730
|
+
export interface OpenAITurn {
|
|
731
|
+
text?: string | string[];
|
|
732
|
+
toolCalls?: OpenAIToolCallSpec[];
|
|
733
|
+
citations?: Array<{
|
|
734
|
+
quote: string;
|
|
735
|
+
url?: string;
|
|
736
|
+
title?: string;
|
|
737
|
+
file?: string;
|
|
738
|
+
}>;
|
|
739
|
+
image?: OpenAIMediaSource | OpenAIMediaSource[];
|
|
740
|
+
audio?: OpenAIMediaSource;
|
|
741
|
+
reasoning?: {
|
|
742
|
+
summary?: string | string[];
|
|
743
|
+
tokens?: number;
|
|
744
|
+
};
|
|
745
|
+
refusal?: string;
|
|
746
|
+
finish?: "stop" | "length" | "content_filter";
|
|
747
|
+
usage?: {
|
|
748
|
+
input?: number;
|
|
749
|
+
output?: number;
|
|
750
|
+
reasoning?: number;
|
|
751
|
+
cached?: number;
|
|
752
|
+
};
|
|
753
|
+
timing?: OpenAITiming;
|
|
754
|
+
failAfter?: {
|
|
755
|
+
chunks: number;
|
|
756
|
+
how?: "error" | "drop" | "stall";
|
|
757
|
+
};
|
|
758
|
+
pauseAfter?: number;
|
|
759
|
+
error?: "rate_limit" | "slow_down" | "insufficient_quota" | "credit_balance_exhausted" | "organization_spend_limit_exceeded" | "project_spend_limit_exceeded" | "organization_usage_limit_exceeded" | "server_error" | "overloaded" | "timeout" | "context_length_exceeded" | "content_policy" | "invalid_api_key" | "not_in_organization" | "ip_not_authorized" | "unsupported_region";
|
|
760
|
+
retryAfter?: number | string;
|
|
761
|
+
shouldRetry?: boolean;
|
|
762
|
+
message?: string;
|
|
763
|
+
}
|
|
764
|
+
export interface OpenAIToolCallSpec {
|
|
765
|
+
name?: string;
|
|
766
|
+
arguments?: Record<string, unknown> | string;
|
|
767
|
+
input?: string;
|
|
768
|
+
webSearch?: {
|
|
769
|
+
query: string;
|
|
770
|
+
action?: "search" | "open_page" | "find_in_page";
|
|
771
|
+
url?: string;
|
|
772
|
+
pattern?: string;
|
|
773
|
+
sources?: Array<{
|
|
774
|
+
url: string;
|
|
775
|
+
title?: string;
|
|
776
|
+
}>;
|
|
777
|
+
};
|
|
778
|
+
fileSearch?: {
|
|
779
|
+
queries: string[];
|
|
780
|
+
results?: Array<{
|
|
781
|
+
file: string;
|
|
782
|
+
text: string;
|
|
783
|
+
score?: number;
|
|
784
|
+
}>;
|
|
785
|
+
};
|
|
786
|
+
codeInterpreter?: {
|
|
787
|
+
code: string;
|
|
788
|
+
logs?: string;
|
|
789
|
+
files?: OpenAIMediaSource[];
|
|
790
|
+
};
|
|
791
|
+
imageGeneration?: {
|
|
792
|
+
image: OpenAIMediaSource;
|
|
793
|
+
revisedPrompt?: string;
|
|
794
|
+
};
|
|
795
|
+
mcp?: {
|
|
796
|
+
server: string;
|
|
797
|
+
tool: string;
|
|
798
|
+
arguments?: Record<string, unknown>;
|
|
799
|
+
output?: string;
|
|
800
|
+
error?: string;
|
|
801
|
+
approval?: boolean;
|
|
802
|
+
};
|
|
803
|
+
shell?: {
|
|
804
|
+
commands: string[];
|
|
805
|
+
output?: string;
|
|
806
|
+
};
|
|
807
|
+
computer?: {
|
|
808
|
+
actions: OpenAIComputerAction[];
|
|
809
|
+
};
|
|
810
|
+
applyPatch?: {
|
|
811
|
+
operations: OpenAIPatchOperation[];
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
export type OpenAIMediaSource = MediaSource;
|
|
815
|
+
export interface OpenAIComputerAction {
|
|
816
|
+
type: string;
|
|
817
|
+
}
|
|
818
|
+
export interface OpenAIPatchOperation {
|
|
819
|
+
type: "create_file" | "update_file" | "delete_file";
|
|
820
|
+
path: string;
|
|
821
|
+
diff?: string;
|
|
822
|
+
}
|
|
823
|
+
export interface OpenAITiming {
|
|
824
|
+
firstToken?: number | string;
|
|
825
|
+
betweenChunks?: number | string;
|
|
826
|
+
}
|
|
827
|
+
export interface OpenAIMatch {
|
|
828
|
+
text?: string | RegExp;
|
|
829
|
+
prompt?: string | RegExp;
|
|
830
|
+
tools?: string[];
|
|
831
|
+
toolResult?: boolean | string;
|
|
832
|
+
endpoint?: "chat.completions" | "responses" | "images.generations" | "images.edits" | "audio.speech" | "audio.transcriptions" | "audio.translations";
|
|
833
|
+
model?: string | RegExp;
|
|
834
|
+
stream?: boolean;
|
|
835
|
+
from?: SlackUser | GitHubUser | LinearUser | NotionUser | ResendUser | GoogleUser | DiscordUser;
|
|
836
|
+
in?: SlackConversation | GitHubRepo | LinearTeam | NotionPage | NotionDatabase | ResendThread | GoogleThread | DiscordChannel;
|
|
837
|
+
approval?: boolean;
|
|
838
|
+
}
|
|
839
|
+
export type OpenAICalls = OpenAICall[];
|
|
840
|
+
export type OpenAICallsWire = OpenAICallData[];
|
|
841
|
+
export type OpenAIEndpoint = "chat.completions" | "responses" | "images.generations" | "images.edits" | "audio.speech" | "audio.transcriptions" | "audio.translations";
|
|
842
|
+
export interface OpenAIRequest {
|
|
843
|
+
endpoint: OpenAIEndpoint;
|
|
844
|
+
model: string;
|
|
845
|
+
stream: boolean;
|
|
846
|
+
prompt?: string;
|
|
847
|
+
file?: OpenAIPart;
|
|
848
|
+
instructions?: string;
|
|
849
|
+
messages: OpenAIMessage[];
|
|
850
|
+
tools: OpenAITool[];
|
|
851
|
+
toolChoice?: unknown;
|
|
852
|
+
responseFormat?: unknown;
|
|
853
|
+
lastUserText?: string;
|
|
854
|
+
lastToolResults: Array<{
|
|
855
|
+
callId: string;
|
|
856
|
+
name?: string;
|
|
857
|
+
text: string;
|
|
858
|
+
}>;
|
|
859
|
+
text: string;
|
|
860
|
+
context: OpenAIContext;
|
|
861
|
+
body?: unknown;
|
|
862
|
+
headers: Record<string, string>;
|
|
863
|
+
}
|
|
864
|
+
export interface OpenAIPart {
|
|
865
|
+
type: "image" | "file" | "audio";
|
|
866
|
+
from: "data" | "file_id" | "url";
|
|
867
|
+
url?: string;
|
|
868
|
+
fileId?: string;
|
|
869
|
+
mediaType?: string;
|
|
870
|
+
bytes?: number;
|
|
871
|
+
sha256?: string;
|
|
872
|
+
filename?: string;
|
|
873
|
+
}
|
|
874
|
+
export interface OpenAIMessage {
|
|
875
|
+
role: "system" | "developer" | "user" | "assistant" | "tool";
|
|
876
|
+
text: string;
|
|
877
|
+
toolCalls?: Array<{
|
|
878
|
+
id: string;
|
|
879
|
+
name: string;
|
|
880
|
+
arguments?: unknown;
|
|
881
|
+
}>;
|
|
882
|
+
callId?: string;
|
|
883
|
+
name?: string;
|
|
884
|
+
parts?: OpenAIPart[];
|
|
885
|
+
}
|
|
886
|
+
export interface OpenAITool {
|
|
887
|
+
type: string;
|
|
888
|
+
name?: string;
|
|
889
|
+
description?: string;
|
|
890
|
+
parameters?: unknown;
|
|
891
|
+
strict?: boolean;
|
|
892
|
+
settings?: Record<string, unknown>;
|
|
893
|
+
}
|
|
894
|
+
export interface OpenAIContext {
|
|
895
|
+
channel?: string;
|
|
896
|
+
from?: OpenAIRef;
|
|
897
|
+
conversation?: OpenAIRef;
|
|
898
|
+
thread?: OpenAIRef;
|
|
899
|
+
message?: OpenAIRef;
|
|
900
|
+
attributedBy?: "minted_id" | "tag" | "owned_id" | "text" | "order";
|
|
901
|
+
matched?: string;
|
|
902
|
+
tiedWith?: string[];
|
|
903
|
+
}
|
|
904
|
+
export interface OpenAIRef {
|
|
905
|
+
id: string;
|
|
906
|
+
}
|
|
907
|
+
export interface OpenAIToolCall {
|
|
908
|
+
id: string;
|
|
909
|
+
type: "function" | "custom" | "web_search" | "file_search" | "code_interpreter" | "image_generation" | "mcp" | "shell" | "computer" | "apply_patch";
|
|
910
|
+
hosted: boolean;
|
|
911
|
+
name: string;
|
|
912
|
+
arguments?: unknown;
|
|
913
|
+
madeIn: string;
|
|
914
|
+
result?: {
|
|
915
|
+
text: string;
|
|
916
|
+
sentIn: string;
|
|
917
|
+
};
|
|
918
|
+
}
|
|
919
|
+
export type OpenAIPausedCalls = OpenAICall[];
|
|
920
|
+
export type OpenAIPausedCallsWire = OpenAICallData[];
|
|
921
|
+
export type OpenAIToolCalls = OpenAIToolCall[];
|
|
922
|
+
export interface OpenAIHeldPage {
|
|
923
|
+
held: OpenAIHeldCall[];
|
|
924
|
+
cursor: string;
|
|
925
|
+
}
|
|
926
|
+
export interface OpenAIHeldCall {
|
|
927
|
+
id: string;
|
|
928
|
+
request: OpenAIRequest;
|
|
929
|
+
}
|
|
930
|
+
export type OpenAISessionCalls = OpenAICall[];
|
|
931
|
+
export type OpenAISessionCallsWire = OpenAICallData[];
|
|
932
|
+
export type OpenAISessionToolCalls = OpenAIToolCall[];
|
|
933
|
+
export type OpenAIProblems = string[];
|
|
934
|
+
export type OpenAISentSecrets = OpenAISentSecret[];
|
|
935
|
+
export interface OpenAISentSecret {
|
|
936
|
+
call: string;
|
|
937
|
+
kinds: string[];
|
|
938
|
+
}
|
|
939
|
+
export type OpenAIUnattributedCalls = OpenAIUnattributedCall[];
|
|
940
|
+
export interface OpenAIUnattributedCall {
|
|
941
|
+
id: string;
|
|
942
|
+
endpoint: OpenAIEndpoint;
|
|
943
|
+
model: string;
|
|
944
|
+
at: string;
|
|
945
|
+
lastUserText?: string;
|
|
946
|
+
tools: string[];
|
|
947
|
+
sinceMs: number;
|
|
948
|
+
message: string;
|
|
949
|
+
}
|
|
950
|
+
export type Places = Place[];
|
|
951
|
+
export type PlacesWire = PlaceData[];
|
|
952
|
+
export interface PlaceTranscript {
|
|
953
|
+
entries: PlaceTranscriptEntry[];
|
|
954
|
+
text: string;
|
|
955
|
+
toString(): string;
|
|
956
|
+
}
|
|
957
|
+
export interface PlaceTranscriptWire {
|
|
958
|
+
entries: PlaceTranscriptEntry[];
|
|
959
|
+
text: string;
|
|
960
|
+
}
|
|
961
|
+
export interface PlaceTranscriptEntry {
|
|
962
|
+
id: string;
|
|
963
|
+
author: PlacePrincipal;
|
|
964
|
+
at: string;
|
|
965
|
+
text: string;
|
|
966
|
+
controls: string[];
|
|
967
|
+
edited: boolean;
|
|
968
|
+
depth: number;
|
|
969
|
+
streaming?: "open" | "stopped" | "completed";
|
|
970
|
+
visibleTo?: PlacePrincipal;
|
|
971
|
+
}
|
|
972
|
+
export interface PlacePrincipal {
|
|
973
|
+
id: string;
|
|
974
|
+
name: string;
|
|
975
|
+
kind: "user" | "app";
|
|
976
|
+
}
|
|
977
|
+
export interface UiLoginLink {
|
|
978
|
+
url: string;
|
|
979
|
+
}
|
|
980
|
+
export declare class Channelstack extends ClientBase {
|
|
981
|
+
#private;
|
|
982
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
983
|
+
constructor(transport: Transport, stop: () => Promise<void>);
|
|
984
|
+
/** Server health, version and loaded drivers. */
|
|
985
|
+
status(): Promise<Status>;
|
|
986
|
+
/** Open a session: a scope in the shared world that owns what it creates. */
|
|
987
|
+
openSession(options?: {
|
|
988
|
+
name?: string;
|
|
989
|
+
}): Promise<Session>;
|
|
990
|
+
/** Drop the whole world. Avoid in parallel suites. */
|
|
991
|
+
reset(): Promise<void>;
|
|
992
|
+
/** Env vars for the agent: fake tokens, signing secrets and API URLs (what `channelstack env` prints). With `proxy`, the proxy and the CA instead of the API URLs. */
|
|
993
|
+
env(options?: {
|
|
994
|
+
proxy?: boolean;
|
|
995
|
+
app?: string;
|
|
996
|
+
channel?: string;
|
|
997
|
+
}): Promise<Env>;
|
|
998
|
+
/** A new one-time link that opens the UI in a browser (what `channelstack ui` prints). Experimental. */
|
|
999
|
+
uiLoginLink(): Promise<UiLoginLink>;
|
|
1000
|
+
}
|
|
1001
|
+
/** Wire data of a {@link Session}. */
|
|
1002
|
+
export interface SessionData {
|
|
1003
|
+
sessionId: string;
|
|
1004
|
+
drivers: string[];
|
|
1005
|
+
}
|
|
1006
|
+
export declare class Session implements AsyncDisposable {
|
|
1007
|
+
#private;
|
|
1008
|
+
readonly sessionId: string;
|
|
1009
|
+
readonly drivers: string[];
|
|
1010
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1011
|
+
constructor(ctx: HandleContext, data: SessionData);
|
|
1012
|
+
/** Close a session and remove everything it created. */
|
|
1013
|
+
close(): Promise<void>;
|
|
1014
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1015
|
+
/** The session's event log: actions, deliveries with every attempt, and the agent's API calls. */
|
|
1016
|
+
events(options?: {
|
|
1017
|
+
since?: string;
|
|
1018
|
+
}): Promise<EventPage>;
|
|
1019
|
+
/** Is the agent idle in this session, and for how long? Negative and exact-count matchers wait for this. */
|
|
1020
|
+
quiet(): Promise<Quiet>;
|
|
1021
|
+
/** The echo fixture: the agent's app and where it reaches the fake. Experimental. */
|
|
1022
|
+
echo(): Promise<EchoFixture>;
|
|
1023
|
+
/** The Slack fixture: the agent's app, the workspace, and where the agent reaches the fake. Experimental. */
|
|
1024
|
+
slack(): Promise<SlackFixture>;
|
|
1025
|
+
/** The GitHub fixture: the agent's App, the org, and where the agent reaches the fake. Experimental. */
|
|
1026
|
+
github(): Promise<GitHubFixture>;
|
|
1027
|
+
/** The Linear fixture: the agent's app, and where the agent reaches the fake. Experimental. */
|
|
1028
|
+
linear(): Promise<LinearFixture>;
|
|
1029
|
+
/** The Notion fixture: the agent's integration, and where the agent reaches the fake. Experimental. */
|
|
1030
|
+
notion(): Promise<NotionFixture>;
|
|
1031
|
+
/** The Resend fixture: the agent's team, and where the agent reaches the fake. Experimental. */
|
|
1032
|
+
resend(): Promise<ResendFixture>;
|
|
1033
|
+
/** The Google fixture: the agent's mailbox, and where the agent reaches the fake. Experimental. */
|
|
1034
|
+
google(): Promise<GoogleFixture>;
|
|
1035
|
+
/** The Discord fixture: the agent's app, the guild, and where the agent reaches the fake. Experimental. */
|
|
1036
|
+
discord(): Promise<DiscordFixture>;
|
|
1037
|
+
/** The OpenAI fixture: where the agent reaches the fake model. Experimental. */
|
|
1038
|
+
openai(): Promise<OpenAIFixture>;
|
|
1039
|
+
/** Every channel's places in the session, as the dev tools name them (a Slack channel, a GitHub issue, a Notion page, an email thread, a Discord channel), the most recently active last. Experimental. */
|
|
1040
|
+
places(): Promise<Places>;
|
|
1041
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1042
|
+
[QUIET](): Promise<QuietState>;
|
|
1043
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1044
|
+
[CONTEXT](): HandleContext;
|
|
1045
|
+
}
|
|
1046
|
+
/** Wire data of a {@link EchoFixture}. */
|
|
1047
|
+
export interface EchoFixtureData {
|
|
1048
|
+
app: EchoAppData;
|
|
1049
|
+
apiUrl: string;
|
|
1050
|
+
}
|
|
1051
|
+
export declare class EchoFixture {
|
|
1052
|
+
#private;
|
|
1053
|
+
readonly app: EchoApp;
|
|
1054
|
+
readonly apiUrl: string;
|
|
1055
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1056
|
+
constructor(ctx: HandleContext, data: EchoFixtureData);
|
|
1057
|
+
/** Create a person. Experimental. */
|
|
1058
|
+
createUser(options: {
|
|
1059
|
+
name: string;
|
|
1060
|
+
}): Promise<EchoUser>;
|
|
1061
|
+
/** Make another app (decision 0027), or return the one with this name. Its events go to CHANNELSTACK_ECHO_APP_<NAME>_WEBHOOK_URL. Experimental. */
|
|
1062
|
+
createApp(options: {
|
|
1063
|
+
name: string;
|
|
1064
|
+
}): Promise<EchoApp>;
|
|
1065
|
+
/** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
1066
|
+
apps(): Promise<EchoApps>;
|
|
1067
|
+
/** Create a room. Only the listed participants are members; include the app for it to receive events. Experimental. */
|
|
1068
|
+
createRoom(options?: {
|
|
1069
|
+
name?: string;
|
|
1070
|
+
participants?: Array<EchoUser | EchoApp>;
|
|
1071
|
+
}): Promise<EchoRoom>;
|
|
1072
|
+
/** Per action: works in the fake, works live, and what live needs. Experimental. */
|
|
1073
|
+
capabilities(): Promise<Capabilities>;
|
|
1074
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1075
|
+
[QUIET](): Promise<QuietState>;
|
|
1076
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1077
|
+
[CONTEXT](): HandleContext;
|
|
1078
|
+
}
|
|
1079
|
+
/** Wire data of a {@link EchoApp}. */
|
|
1080
|
+
export interface EchoAppData {
|
|
1081
|
+
id: string;
|
|
1082
|
+
name: string;
|
|
1083
|
+
kind: "app";
|
|
1084
|
+
}
|
|
1085
|
+
export declare class EchoApp {
|
|
1086
|
+
#private;
|
|
1087
|
+
readonly id: string;
|
|
1088
|
+
readonly name: string;
|
|
1089
|
+
readonly kind: "app";
|
|
1090
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1091
|
+
constructor(ctx: HandleContext, data: EchoAppData);
|
|
1092
|
+
/** An app a test made posts in a room it is a member of, as its own call would. Experimental. */
|
|
1093
|
+
say(text: string, options: {
|
|
1094
|
+
room: EchoRoom;
|
|
1095
|
+
}): Promise<EchoMessage>;
|
|
1096
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1097
|
+
[QUIET](): Promise<QuietState>;
|
|
1098
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1099
|
+
[CONTEXT](): HandleContext;
|
|
1100
|
+
}
|
|
1101
|
+
/** Wire data of a {@link EchoUser}. */
|
|
1102
|
+
export interface EchoUserData {
|
|
1103
|
+
id: string;
|
|
1104
|
+
name: string;
|
|
1105
|
+
kind: "user";
|
|
1106
|
+
}
|
|
1107
|
+
export declare class EchoUser {
|
|
1108
|
+
#private;
|
|
1109
|
+
readonly id: string;
|
|
1110
|
+
readonly name: string;
|
|
1111
|
+
readonly kind: "user";
|
|
1112
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1113
|
+
constructor(ctx: HandleContext, data: EchoUserData);
|
|
1114
|
+
/** Post a message in a room as this person. Experimental. */
|
|
1115
|
+
say(text: string, options: {
|
|
1116
|
+
room: EchoRoom;
|
|
1117
|
+
}): Promise<EchoMessage>;
|
|
1118
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1119
|
+
[QUIET](): Promise<QuietState>;
|
|
1120
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1121
|
+
[CONTEXT](): HandleContext;
|
|
1122
|
+
}
|
|
1123
|
+
/** Wire data of a {@link EchoRoom}. */
|
|
1124
|
+
export interface EchoRoomData {
|
|
1125
|
+
id: string;
|
|
1126
|
+
name: string;
|
|
1127
|
+
members: string[];
|
|
1128
|
+
}
|
|
1129
|
+
export declare class EchoRoom {
|
|
1130
|
+
#private;
|
|
1131
|
+
readonly id: string;
|
|
1132
|
+
readonly name: string;
|
|
1133
|
+
readonly members: string[];
|
|
1134
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1135
|
+
constructor(ctx: HandleContext, data: EchoRoomData);
|
|
1136
|
+
/** The room's messages, oldest first, with a cursor for the next read. Experimental. */
|
|
1137
|
+
messages(options?: {
|
|
1138
|
+
since?: string;
|
|
1139
|
+
}): Promise<EchoMessagePage>;
|
|
1140
|
+
/** The room as a person would read it. Experimental. */
|
|
1141
|
+
transcript(): Promise<EchoTranscript>;
|
|
1142
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1143
|
+
[QUIET](): Promise<QuietState>;
|
|
1144
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1145
|
+
[CONTEXT](): HandleContext;
|
|
1146
|
+
}
|
|
1147
|
+
/** Wire data of a {@link SlackFixture}. */
|
|
1148
|
+
export interface SlackFixtureData {
|
|
1149
|
+
app: SlackAppData;
|
|
1150
|
+
apiUrl: string;
|
|
1151
|
+
team: SlackTeam;
|
|
1152
|
+
socketConnections: number;
|
|
1153
|
+
}
|
|
1154
|
+
export declare class SlackFixture {
|
|
1155
|
+
#private;
|
|
1156
|
+
readonly app: SlackApp;
|
|
1157
|
+
readonly apiUrl: string;
|
|
1158
|
+
readonly team: SlackTeam;
|
|
1159
|
+
readonly socketConnections: number;
|
|
1160
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1161
|
+
constructor(ctx: HandleContext, data: SlackFixtureData);
|
|
1162
|
+
/** Create a person in the workspace. Experimental. */
|
|
1163
|
+
createUser(options: {
|
|
1164
|
+
name: string;
|
|
1165
|
+
id?: string;
|
|
1166
|
+
displayName?: string;
|
|
1167
|
+
realName?: string;
|
|
1168
|
+
email?: string;
|
|
1169
|
+
timezone?: string;
|
|
1170
|
+
admin?: boolean;
|
|
1171
|
+
owner?: boolean;
|
|
1172
|
+
guest?: boolean;
|
|
1173
|
+
bot?: boolean;
|
|
1174
|
+
token?: string;
|
|
1175
|
+
browser?: {
|
|
1176
|
+
storageState: string;
|
|
1177
|
+
};
|
|
1178
|
+
}): Promise<SlackUser>;
|
|
1179
|
+
/** The people this session created. Experimental. */
|
|
1180
|
+
users(): Promise<SlackUsers>;
|
|
1181
|
+
/** Make another app in the workspace, with its own bot user, tokens and signing secret (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_SLACK_APP_<NAME>_WEBHOOK_URL, or over its own Socket Mode connection. Experimental. */
|
|
1182
|
+
createApp(options: {
|
|
1183
|
+
name: string;
|
|
1184
|
+
scopes?: string[];
|
|
1185
|
+
botEvents?: string[];
|
|
1186
|
+
}): Promise<SlackApp>;
|
|
1187
|
+
/** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
1188
|
+
apps(): Promise<SlackApps>;
|
|
1189
|
+
/** The session's conversations, the one with the newest message last. Experimental. */
|
|
1190
|
+
conversations(): Promise<SlackConversations>;
|
|
1191
|
+
/** Create a channel. Only the listed participants are members; include the app for it to receive events. Experimental. */
|
|
1192
|
+
createChannel(options?: {
|
|
1193
|
+
name?: string;
|
|
1194
|
+
private?: boolean;
|
|
1195
|
+
participants?: Array<SlackUser | SlackApp>;
|
|
1196
|
+
topic?: string;
|
|
1197
|
+
purpose?: string;
|
|
1198
|
+
shared?: boolean;
|
|
1199
|
+
}): Promise<SlackConversation>;
|
|
1200
|
+
/** Every event channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
1201
|
+
deliveries(options?: {
|
|
1202
|
+
app?: SlackApp;
|
|
1203
|
+
}): Promise<SlackDeliveries>;
|
|
1204
|
+
/** The Web API calls the agent made about this session's conversations, people and files. Calls about nothing a session owns (auth.test, users.list) are in no session. Experimental. */
|
|
1205
|
+
calls(options?: {
|
|
1206
|
+
operation?: string;
|
|
1207
|
+
error?: true | string;
|
|
1208
|
+
}): Promise<SlackApiCalls>;
|
|
1209
|
+
/** The workspace uninstalls an app: the built-in one, or the one given. Undone when this session closes; run such tests on their own. Experimental. */
|
|
1210
|
+
uninstallApp(options?: {
|
|
1211
|
+
app?: SlackApp;
|
|
1212
|
+
}): Promise<SlackUninstallDeliveries>;
|
|
1213
|
+
/** Inject a fault: into the agent's Web API calls (removed when this session closes), or drop its Socket Mode connection once. Experimental. */
|
|
1214
|
+
fault(options: {
|
|
1215
|
+
type: "rate_limit" | "latency" | "error" | "drop_socket";
|
|
1216
|
+
operation?: string;
|
|
1217
|
+
retryAfter?: Duration;
|
|
1218
|
+
delay?: Duration;
|
|
1219
|
+
after?: Duration;
|
|
1220
|
+
error?: string;
|
|
1221
|
+
times?: number;
|
|
1222
|
+
app?: SlackApp;
|
|
1223
|
+
}): Promise<SlackFault>;
|
|
1224
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
1225
|
+
waitForCall(filter?: {
|
|
1226
|
+
operation?: string;
|
|
1227
|
+
error?: true | string;
|
|
1228
|
+
}, options?: WaitOptions): Promise<SlackApiCall>;
|
|
1229
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1230
|
+
[QUIET](): Promise<QuietState>;
|
|
1231
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1232
|
+
[CONTEXT](): HandleContext;
|
|
1233
|
+
}
|
|
1234
|
+
/** Wire data of a {@link SlackApp}. */
|
|
1235
|
+
export interface SlackAppData {
|
|
1236
|
+
id: string;
|
|
1237
|
+
name: string;
|
|
1238
|
+
kind: "app";
|
|
1239
|
+
botUserId: string;
|
|
1240
|
+
botId: string;
|
|
1241
|
+
botToken: string;
|
|
1242
|
+
appToken: string;
|
|
1243
|
+
signingSecret: string;
|
|
1244
|
+
scopes: string[];
|
|
1245
|
+
}
|
|
1246
|
+
export declare class SlackApp {
|
|
1247
|
+
#private;
|
|
1248
|
+
readonly id: string;
|
|
1249
|
+
readonly name: string;
|
|
1250
|
+
readonly kind: "app";
|
|
1251
|
+
readonly botUserId: string;
|
|
1252
|
+
readonly botId: string;
|
|
1253
|
+
readonly botToken: string;
|
|
1254
|
+
readonly appToken: string;
|
|
1255
|
+
readonly signingSecret: string;
|
|
1256
|
+
readonly scopes: string[];
|
|
1257
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1258
|
+
constructor(ctx: HandleContext, data: SlackAppData);
|
|
1259
|
+
/** An app a test made writes a top-level message, as its own chat.postMessage would: in a conversation it is a member of, or in a DM with the people in `to`. Experimental. */
|
|
1260
|
+
say(message: string | SlackMessageInput, options?: {
|
|
1261
|
+
channel?: SlackConversation;
|
|
1262
|
+
to?: SlackUser | SlackApp | Array<SlackUser | SlackApp>;
|
|
1263
|
+
}): Promise<SlackMessage>;
|
|
1264
|
+
/** An app a test made replies in a thread: pass the message that starts it, or any reply in it. Experimental. */
|
|
1265
|
+
reply(message: string | SlackMessageInput, options: {
|
|
1266
|
+
thread: SlackThread | SlackMessage;
|
|
1267
|
+
}): Promise<SlackMessage>;
|
|
1268
|
+
/** An app a test made reacts to a message. Experimental. */
|
|
1269
|
+
react(emoji: string, options: {
|
|
1270
|
+
message: SlackMessage;
|
|
1271
|
+
}): Promise<SlackDelivery | undefined>;
|
|
1272
|
+
/** An app a test made takes its reaction back. Experimental. */
|
|
1273
|
+
unreact(emoji: string, options: {
|
|
1274
|
+
message: SlackMessage;
|
|
1275
|
+
}): Promise<SlackDelivery | undefined>;
|
|
1276
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1277
|
+
[QUIET](): Promise<QuietState>;
|
|
1278
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1279
|
+
[CONTEXT](): HandleContext;
|
|
1280
|
+
}
|
|
1281
|
+
/** Wire data of a {@link SlackUser}. */
|
|
1282
|
+
export interface SlackUserData {
|
|
1283
|
+
id: string;
|
|
1284
|
+
name: string;
|
|
1285
|
+
kind: "user";
|
|
1286
|
+
displayName: string;
|
|
1287
|
+
realName: string;
|
|
1288
|
+
email?: string;
|
|
1289
|
+
isAdmin: boolean;
|
|
1290
|
+
isBot: boolean;
|
|
1291
|
+
}
|
|
1292
|
+
export declare class SlackUser {
|
|
1293
|
+
#private;
|
|
1294
|
+
readonly id: string;
|
|
1295
|
+
readonly name: string;
|
|
1296
|
+
readonly kind: "user";
|
|
1297
|
+
readonly displayName: string;
|
|
1298
|
+
readonly realName: string;
|
|
1299
|
+
readonly email: string | undefined;
|
|
1300
|
+
readonly isAdmin: boolean;
|
|
1301
|
+
readonly isBot: boolean;
|
|
1302
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1303
|
+
constructor(ctx: HandleContext, data: SlackUserData);
|
|
1304
|
+
/** Post a top-level message in a conversation, or in a DM with the people in `to`. Experimental. */
|
|
1305
|
+
say(message: string | SlackMessageInput, options?: {
|
|
1306
|
+
channel?: SlackConversation;
|
|
1307
|
+
to?: SlackUser | SlackApp | Array<SlackUser | SlackApp>;
|
|
1308
|
+
files?: string | FileInput[];
|
|
1309
|
+
}): Promise<SlackMessage>;
|
|
1310
|
+
/** Reply in a thread: pass the message that starts it, or any reply in it. Experimental. */
|
|
1311
|
+
reply(message: string | SlackMessageInput, options: {
|
|
1312
|
+
thread: SlackThread | SlackMessage;
|
|
1313
|
+
alsoSendToChannel?: boolean;
|
|
1314
|
+
files?: string | FileInput[];
|
|
1315
|
+
}): Promise<SlackMessage>;
|
|
1316
|
+
/** Edit one of this person's own messages. Experimental. */
|
|
1317
|
+
edit(text: string | SlackMessageInput, options: {
|
|
1318
|
+
message: SlackMessage;
|
|
1319
|
+
}): Promise<SlackMessage>;
|
|
1320
|
+
/** Delete a message: this person's own, or anyone's for an admin. Experimental. */
|
|
1321
|
+
delete(options: {
|
|
1322
|
+
message: SlackMessage;
|
|
1323
|
+
}): Promise<void>;
|
|
1324
|
+
/** Click a button, found by its label or action_id: on a message, or on the app's latest message that has it in a thread or a conversation. Experimental. */
|
|
1325
|
+
click(button: string | SlackButtonRef, options?: {
|
|
1326
|
+
message?: SlackMessage;
|
|
1327
|
+
thread?: SlackThread | SlackMessage;
|
|
1328
|
+
channel?: SlackConversation;
|
|
1329
|
+
}): Promise<SlackDelivery | undefined>;
|
|
1330
|
+
/** Choose from a select menu on a message: options by their text or value, the menu by its placeholder or action_id. Experimental. */
|
|
1331
|
+
select(option: string | string[], options: {
|
|
1332
|
+
menu: string | SlackMenuRef;
|
|
1333
|
+
message: SlackMessage;
|
|
1334
|
+
}): Promise<SlackDelivery>;
|
|
1335
|
+
/** Run an app's message shortcut on a message: it goes to that app alone. Experimental. */
|
|
1336
|
+
shortcut(callbackId: string, options: {
|
|
1337
|
+
message: SlackMessage;
|
|
1338
|
+
app?: SlackApp;
|
|
1339
|
+
}): Promise<SlackDelivery>;
|
|
1340
|
+
/** Run an app's slash command in a conversation, e.g. `/deploy web staging`: it goes to that app alone. Experimental. */
|
|
1341
|
+
runCommand(command: string, options: {
|
|
1342
|
+
channel: SlackConversation;
|
|
1343
|
+
app?: SlackApp;
|
|
1344
|
+
}): Promise<SlackDelivery>;
|
|
1345
|
+
/** Press Stop on the app's work in a thread: what is streaming there ends, and the app is told. Experimental. */
|
|
1346
|
+
stop(options: {
|
|
1347
|
+
thread: SlackThread | SlackMessage;
|
|
1348
|
+
}): Promise<SlackDelivery>;
|
|
1349
|
+
/** Open an app's split view: a new thread in this person's DM with that app, started from the channel they are looking at. Experimental. */
|
|
1350
|
+
openAgentThread(options?: {
|
|
1351
|
+
from?: SlackConversation;
|
|
1352
|
+
app?: SlackApp;
|
|
1353
|
+
}): Promise<SlackThread>;
|
|
1354
|
+
/** Pick one of the prompts the app suggested in a thread: this person says its message there. Experimental. */
|
|
1355
|
+
pickPrompt(title: string, options: {
|
|
1356
|
+
thread: SlackThread | SlackMessage;
|
|
1357
|
+
}): Promise<SlackMessage>;
|
|
1358
|
+
/** Look at another channel while the split view stays open: the app is told the new context. Experimental. */
|
|
1359
|
+
switchContext(channel: SlackConversation, options: {
|
|
1360
|
+
thread: SlackThread | SlackMessage;
|
|
1361
|
+
}): Promise<SlackDelivery>;
|
|
1362
|
+
/** The modals the app opened for this person, in the order it opened them; `open` says which are still up. Experimental. */
|
|
1363
|
+
modals(): Promise<SlackModals>;
|
|
1364
|
+
/** Add an emoji reaction to a message. Experimental. */
|
|
1365
|
+
react(emoji: string, options: {
|
|
1366
|
+
message: SlackMessage;
|
|
1367
|
+
}): Promise<SlackDelivery | undefined>;
|
|
1368
|
+
/** Remove this person's emoji reaction from a message. Experimental. */
|
|
1369
|
+
unreact(emoji: string, options: {
|
|
1370
|
+
message: SlackMessage;
|
|
1371
|
+
}): Promise<SlackDelivery | undefined>;
|
|
1372
|
+
/** Open (or reuse) a DM with the app, another person, or several. Experimental. */
|
|
1373
|
+
openDM(participants: SlackUser | SlackApp | Array<SlackUser | SlackApp>): Promise<SlackConversation>;
|
|
1374
|
+
/** Invite people or the app to a channel. Experimental. */
|
|
1375
|
+
invite(participants: SlackUser | SlackApp | Array<SlackUser | SlackApp>, options: {
|
|
1376
|
+
channel: SlackConversation;
|
|
1377
|
+
}): Promise<void>;
|
|
1378
|
+
/** Remove someone from a channel. Experimental. */
|
|
1379
|
+
kick(participant: SlackUser | SlackApp, options: {
|
|
1380
|
+
channel: SlackConversation;
|
|
1381
|
+
}): Promise<void>;
|
|
1382
|
+
/** Messages only this person can see. Experimental. */
|
|
1383
|
+
ephemeral(): Promise<SlackEphemeralMessages>;
|
|
1384
|
+
/** Wait for the next new open modal from the agent, after the last one this handle saw. */
|
|
1385
|
+
waitForModal(options?: {
|
|
1386
|
+
title?: string | RegExp;
|
|
1387
|
+
} & WaitOptions): Promise<SlackModal>;
|
|
1388
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1389
|
+
[QUIET](): Promise<QuietState>;
|
|
1390
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1391
|
+
[CONTEXT](): HandleContext;
|
|
1392
|
+
}
|
|
1393
|
+
/** Wire data of a {@link SlackMessage}. */
|
|
1394
|
+
export interface SlackMessageData {
|
|
1395
|
+
channel: string;
|
|
1396
|
+
ts: string;
|
|
1397
|
+
conversation: SlackConversationData;
|
|
1398
|
+
author: SlackUserData | SlackAppData;
|
|
1399
|
+
text: string;
|
|
1400
|
+
blocks: unknown[];
|
|
1401
|
+
files: string[];
|
|
1402
|
+
postedAt: string;
|
|
1403
|
+
threadTs?: string;
|
|
1404
|
+
edited: boolean;
|
|
1405
|
+
visibleTo?: SlackUserData;
|
|
1406
|
+
thread: SlackThreadData;
|
|
1407
|
+
delivery?: SlackDeliveryData;
|
|
1408
|
+
stream?: SlackStreamData;
|
|
1409
|
+
}
|
|
1410
|
+
export declare class SlackMessage {
|
|
1411
|
+
#private;
|
|
1412
|
+
readonly channel: string;
|
|
1413
|
+
readonly ts: string;
|
|
1414
|
+
readonly conversation: SlackConversation;
|
|
1415
|
+
readonly author: SlackUser | SlackApp;
|
|
1416
|
+
readonly text: string;
|
|
1417
|
+
readonly blocks: unknown[];
|
|
1418
|
+
readonly files: string[];
|
|
1419
|
+
readonly postedAt: string;
|
|
1420
|
+
readonly threadTs: string | undefined;
|
|
1421
|
+
readonly edited: boolean;
|
|
1422
|
+
readonly visibleTo: SlackUser | undefined;
|
|
1423
|
+
readonly thread: SlackThread;
|
|
1424
|
+
readonly delivery: SlackDelivery | undefined;
|
|
1425
|
+
readonly stream: SlackStream | undefined;
|
|
1426
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1427
|
+
constructor(ctx: HandleContext, data: SlackMessageData);
|
|
1428
|
+
/** Re-read a message: its latest text, edits and deliveries. Experimental. */
|
|
1429
|
+
refresh(): Promise<SlackMessage>;
|
|
1430
|
+
/** The reactions on a message, and who added each. Experimental. */
|
|
1431
|
+
reactions(): Promise<SlackReactions>;
|
|
1432
|
+
/** A message and the replies under it as a person would read them. Experimental. */
|
|
1433
|
+
transcript(options?: {
|
|
1434
|
+
as?: SlackUser | SlackApp;
|
|
1435
|
+
}): Promise<SlackTranscript>;
|
|
1436
|
+
/** The first delivery this message caused to this app (decision 0027), or nothing when it wasn't told. Experimental. */
|
|
1437
|
+
deliveryFor(app: SlackApp): Promise<SlackDelivery | undefined>;
|
|
1438
|
+
/** Every delivery this message caused to the agent. Experimental. */
|
|
1439
|
+
deliveries(): Promise<SlackMessageDeliveries>;
|
|
1440
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1441
|
+
[QUIET](): Promise<QuietState>;
|
|
1442
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1443
|
+
[CONTEXT](): HandleContext;
|
|
1444
|
+
}
|
|
1445
|
+
/** Wire data of a {@link SlackConversation}. */
|
|
1446
|
+
export interface SlackConversationData {
|
|
1447
|
+
id: string;
|
|
1448
|
+
kind: "channel" | "private_channel" | "im" | "mpim";
|
|
1449
|
+
name?: string;
|
|
1450
|
+
}
|
|
1451
|
+
export declare class SlackConversation {
|
|
1452
|
+
#private;
|
|
1453
|
+
readonly id: string;
|
|
1454
|
+
readonly kind: "channel" | "private_channel" | "im" | "mpim";
|
|
1455
|
+
readonly name: string | undefined;
|
|
1456
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1457
|
+
constructor(ctx: HandleContext, data: SlackConversationData);
|
|
1458
|
+
/** The newest message of a conversation, replies included. Experimental. */
|
|
1459
|
+
latestMessage(): Promise<SlackMessage>;
|
|
1460
|
+
/** Top-level messages of a conversation, oldest first. Experimental. */
|
|
1461
|
+
messages(): Promise<SlackMessages>;
|
|
1462
|
+
/** The people and apps in a conversation. Experimental. */
|
|
1463
|
+
members(): Promise<SlackMembers>;
|
|
1464
|
+
/** The conversation as a person would read it, threads included. Experimental. */
|
|
1465
|
+
transcript(options?: {
|
|
1466
|
+
as?: SlackUser | SlackApp;
|
|
1467
|
+
}): Promise<SlackTranscript>;
|
|
1468
|
+
/** Wait for the next new message matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
1469
|
+
waitForMessage(options?: {
|
|
1470
|
+
from?: SlackUser | SlackApp | string;
|
|
1471
|
+
} & WaitOptions): Promise<SlackMessage>;
|
|
1472
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1473
|
+
[QUIET](): Promise<QuietState>;
|
|
1474
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1475
|
+
[CONTEXT](): HandleContext;
|
|
1476
|
+
}
|
|
1477
|
+
/** Wire data of a {@link SlackThread}. */
|
|
1478
|
+
export interface SlackThreadData {
|
|
1479
|
+
channel: string;
|
|
1480
|
+
ts: string;
|
|
1481
|
+
conversation: SlackConversationData;
|
|
1482
|
+
}
|
|
1483
|
+
export declare class SlackThread {
|
|
1484
|
+
#private;
|
|
1485
|
+
readonly channel: string;
|
|
1486
|
+
readonly ts: string;
|
|
1487
|
+
readonly conversation: SlackConversation;
|
|
1488
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1489
|
+
constructor(ctx: HandleContext, data: SlackThreadData);
|
|
1490
|
+
/** The prompts the app suggested in a thread. Experimental. */
|
|
1491
|
+
suggestedPrompts(): Promise<SlackSuggestedPrompts>;
|
|
1492
|
+
/** The message that starts a thread, as it is now. Experimental. */
|
|
1493
|
+
root(): Promise<SlackMessage>;
|
|
1494
|
+
/** Replies in a thread, oldest first, without the message that starts it. Experimental. */
|
|
1495
|
+
replies(): Promise<SlackReplies>;
|
|
1496
|
+
/** What the agent is doing in a thread: its status line, an open stream, or idle. Experimental. */
|
|
1497
|
+
status(): Promise<SlackThreadStatus>;
|
|
1498
|
+
/** A thread as a person would read it. Experimental. */
|
|
1499
|
+
transcript(options?: {
|
|
1500
|
+
as?: SlackUser | SlackApp;
|
|
1501
|
+
}): Promise<SlackTranscript>;
|
|
1502
|
+
/** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
1503
|
+
waitForReply(options?: {
|
|
1504
|
+
from?: SlackUser | SlackApp | string;
|
|
1505
|
+
} & WaitOptions): Promise<SlackMessage>;
|
|
1506
|
+
/** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
|
|
1507
|
+
latestReply(options?: {
|
|
1508
|
+
from?: SlackUser | SlackApp | string;
|
|
1509
|
+
} & QuietOptions): Promise<SlackMessage>;
|
|
1510
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1511
|
+
[QUIET](): Promise<QuietState>;
|
|
1512
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1513
|
+
[CONTEXT](): HandleContext;
|
|
1514
|
+
}
|
|
1515
|
+
/** Wire data of a {@link SlackDelivery}. */
|
|
1516
|
+
export interface SlackDeliveryData {
|
|
1517
|
+
id: string;
|
|
1518
|
+
channel: "slack";
|
|
1519
|
+
app: string;
|
|
1520
|
+
type: string;
|
|
1521
|
+
eventType?: string;
|
|
1522
|
+
eventId?: string;
|
|
1523
|
+
payload?: unknown;
|
|
1524
|
+
attempts: DeliveryAttempt[];
|
|
1525
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
1526
|
+
}
|
|
1527
|
+
export declare class SlackDelivery {
|
|
1528
|
+
#private;
|
|
1529
|
+
readonly id: string;
|
|
1530
|
+
readonly channel: "slack";
|
|
1531
|
+
readonly app: string;
|
|
1532
|
+
readonly type: string;
|
|
1533
|
+
readonly eventType: string | undefined;
|
|
1534
|
+
readonly eventId: string | undefined;
|
|
1535
|
+
readonly payload: unknown | undefined;
|
|
1536
|
+
readonly attempts: DeliveryAttempt[];
|
|
1537
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
1538
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1539
|
+
constructor(ctx: HandleContext, data: SlackDeliveryData);
|
|
1540
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
1541
|
+
refresh(): Promise<SlackDelivery>;
|
|
1542
|
+
/** Send the delivery again, unchanged or forged: a wrong signature, or a timestamp outside the replay window. Experimental. */
|
|
1543
|
+
resend(options?: {
|
|
1544
|
+
badSignature?: boolean;
|
|
1545
|
+
stale?: boolean;
|
|
1546
|
+
headers?: Record<string, string>;
|
|
1547
|
+
}): Promise<DeliveryAttempt>;
|
|
1548
|
+
/** Retry the way Slack does: the same payload, with X-Slack-Retry-Num and X-Slack-Retry-Reason. Experimental. */
|
|
1549
|
+
retry(options?: {
|
|
1550
|
+
after?: Duration;
|
|
1551
|
+
reason?: "http_timeout" | "http_error" | "too_many_redirects";
|
|
1552
|
+
}): Promise<DeliveryAttempt>;
|
|
1553
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
1554
|
+
settled(options?: WaitOptions): Promise<SlackDelivery>;
|
|
1555
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1556
|
+
[QUIET](): Promise<QuietState>;
|
|
1557
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1558
|
+
[CONTEXT](): HandleContext;
|
|
1559
|
+
}
|
|
1560
|
+
/** Wire data of a {@link SlackStream}. */
|
|
1561
|
+
export interface SlackStreamData {
|
|
1562
|
+
channel: string;
|
|
1563
|
+
ts: string;
|
|
1564
|
+
state: "open" | "stopped" | "completed";
|
|
1565
|
+
chunks: string[];
|
|
1566
|
+
startedAt: string;
|
|
1567
|
+
endedAt?: string;
|
|
1568
|
+
}
|
|
1569
|
+
export declare class SlackStream {
|
|
1570
|
+
#private;
|
|
1571
|
+
readonly channel: string;
|
|
1572
|
+
readonly ts: string;
|
|
1573
|
+
readonly state: "open" | "stopped" | "completed";
|
|
1574
|
+
readonly chunks: string[];
|
|
1575
|
+
readonly startedAt: string;
|
|
1576
|
+
readonly endedAt: string | undefined;
|
|
1577
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1578
|
+
constructor(ctx: HandleContext, data: SlackStreamData);
|
|
1579
|
+
/** Re-read a streamed message's stream: its state and what was streamed so far. Experimental. */
|
|
1580
|
+
refresh(): Promise<SlackStream>;
|
|
1581
|
+
/** Wait for the stream to end, and resolve with the value as it is then. */
|
|
1582
|
+
ended(options?: WaitOptions): Promise<SlackStream>;
|
|
1583
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1584
|
+
[QUIET](): Promise<QuietState>;
|
|
1585
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1586
|
+
[CONTEXT](): HandleContext;
|
|
1587
|
+
}
|
|
1588
|
+
/** Wire data of a {@link SlackModal}. */
|
|
1589
|
+
export interface SlackModalData {
|
|
1590
|
+
viewId: string;
|
|
1591
|
+
user: SlackUserData;
|
|
1592
|
+
title: string;
|
|
1593
|
+
blocks: unknown[];
|
|
1594
|
+
open: boolean;
|
|
1595
|
+
errors: Record<string, string>;
|
|
1596
|
+
}
|
|
1597
|
+
export declare class SlackModal {
|
|
1598
|
+
#private;
|
|
1599
|
+
readonly viewId: string;
|
|
1600
|
+
readonly user: SlackUser;
|
|
1601
|
+
readonly title: string;
|
|
1602
|
+
readonly blocks: unknown[];
|
|
1603
|
+
readonly open: boolean;
|
|
1604
|
+
readonly errors: Record<string, string>;
|
|
1605
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1606
|
+
constructor(ctx: HandleContext, data: SlackModalData);
|
|
1607
|
+
/** What is filled in: each input by its label (or action_id), with the text a person sees in it. Experimental. */
|
|
1608
|
+
values(): Promise<SlackModalValues>;
|
|
1609
|
+
/** Fill in inputs, by label or `block_id.action_id`, and submit the modal. Experimental. */
|
|
1610
|
+
submit(values?: Record<string, string | string[]>): Promise<SlackDelivery>;
|
|
1611
|
+
/** Close the modal. The app is told only if it asked to be (`notify_on_close`). Experimental. */
|
|
1612
|
+
close(): Promise<SlackDelivery | undefined>;
|
|
1613
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1614
|
+
[QUIET](): Promise<QuietState>;
|
|
1615
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1616
|
+
[CONTEXT](): HandleContext;
|
|
1617
|
+
}
|
|
1618
|
+
/** Wire data of a {@link SlackFault}. */
|
|
1619
|
+
export interface SlackFaultData {
|
|
1620
|
+
id: string;
|
|
1621
|
+
}
|
|
1622
|
+
export declare class SlackFault implements AsyncDisposable {
|
|
1623
|
+
#private;
|
|
1624
|
+
readonly id: string;
|
|
1625
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1626
|
+
constructor(ctx: HandleContext, data: SlackFaultData);
|
|
1627
|
+
/** Remove a fault. Experimental. */
|
|
1628
|
+
undo(): Promise<void>;
|
|
1629
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
1630
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1631
|
+
[QUIET](): Promise<QuietState>;
|
|
1632
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1633
|
+
[CONTEXT](): HandleContext;
|
|
1634
|
+
}
|
|
1635
|
+
/** Wire data of a {@link GitHubFixture}. */
|
|
1636
|
+
export interface GitHubFixtureData {
|
|
1637
|
+
app: GitHubAppData;
|
|
1638
|
+
apiUrl: string;
|
|
1639
|
+
org: string;
|
|
1640
|
+
}
|
|
1641
|
+
export declare class GitHubFixture {
|
|
1642
|
+
#private;
|
|
1643
|
+
readonly app: GitHubApp;
|
|
1644
|
+
readonly apiUrl: string;
|
|
1645
|
+
readonly org: string;
|
|
1646
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1647
|
+
constructor(ctx: HandleContext, data: GitHubFixtureData);
|
|
1648
|
+
/** Create a person in the org. Experimental. */
|
|
1649
|
+
createUser(options: {
|
|
1650
|
+
login: string;
|
|
1651
|
+
id?: number;
|
|
1652
|
+
name?: string;
|
|
1653
|
+
email?: string;
|
|
1654
|
+
role?: "member" | "admin" | "outside_collaborator";
|
|
1655
|
+
token?: string;
|
|
1656
|
+
}): Promise<GitHubUser>;
|
|
1657
|
+
/** The people this session created. Experimental. */
|
|
1658
|
+
users(): Promise<GitHubUsers>;
|
|
1659
|
+
/** Create a repository in the org. The App hears about it only when it is listed in `apps`: an App must be installed on a repository. Experimental. */
|
|
1660
|
+
createRepo(options?: {
|
|
1661
|
+
name?: string;
|
|
1662
|
+
private?: boolean;
|
|
1663
|
+
defaultBranch?: string;
|
|
1664
|
+
files?: string | FileInput[];
|
|
1665
|
+
collaborators?: Array<GitHubUser | {
|
|
1666
|
+
user: GitHubUser;
|
|
1667
|
+
permission?: "read" | "triage" | "write" | "maintain" | "admin";
|
|
1668
|
+
}>;
|
|
1669
|
+
apps?: GitHubApp[];
|
|
1670
|
+
labels?: Array<string | {
|
|
1671
|
+
name: string;
|
|
1672
|
+
color?: string;
|
|
1673
|
+
description?: string;
|
|
1674
|
+
}>;
|
|
1675
|
+
}): Promise<GitHubRepo>;
|
|
1676
|
+
/** The repositories this session created. Experimental. */
|
|
1677
|
+
repos(): Promise<GitHubRepos>;
|
|
1678
|
+
/** The issues and pull requests in this session's repositories, read again from GitHub live, the most recently updated last. Experimental. */
|
|
1679
|
+
issues(): Promise<GitHubIssues>;
|
|
1680
|
+
/** The id of the built-in App's installation, for a repository it is installed on. The same as `github.app.installationId(repo)`. Experimental. */
|
|
1681
|
+
installationId(repo: GitHubRepo): Promise<number>;
|
|
1682
|
+
/** Make another GitHub App on the org, with its own App id, bot user, installation, private key and webhook secret (decision 0027), or return the one made with this name and settings. It reaches no repository until it is installed on one; its webhooks go to CHANNELSTACK_GITHUB_APP_<NAME>_WEBHOOK_URL. Experimental. */
|
|
1683
|
+
createApp(options: {
|
|
1684
|
+
name: string;
|
|
1685
|
+
permissions?: Record<string, "read" | "write">;
|
|
1686
|
+
events?: string[];
|
|
1687
|
+
}): Promise<GitHubApp>;
|
|
1688
|
+
/** The Apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
1689
|
+
apps(): Promise<GitHubApps>;
|
|
1690
|
+
/** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
1691
|
+
deliveries(options?: {
|
|
1692
|
+
type?: string;
|
|
1693
|
+
resource?: GitHubRepo;
|
|
1694
|
+
app?: GitHubApp;
|
|
1695
|
+
}): Promise<GitHubDeliveries>;
|
|
1696
|
+
/** The REST calls the agent made about this session's repositories. Calls about no repository (`GET /app`) are in no session. Experimental. */
|
|
1697
|
+
calls(options?: {
|
|
1698
|
+
operation?: string;
|
|
1699
|
+
error?: true | string;
|
|
1700
|
+
}): Promise<GitHubApiCalls>;
|
|
1701
|
+
/** The App's REST calls that are about no repository of any session: its own endpoints and the token exchange. They belong to no session, so every session reads the same list. Only calls that authenticated as the App or its installation are on it. Experimental. */
|
|
1702
|
+
appCalls(options?: {
|
|
1703
|
+
operation?: string;
|
|
1704
|
+
error?: true | string;
|
|
1705
|
+
}): Promise<GitHubAppCalls>;
|
|
1706
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
1707
|
+
waitForCall(filter?: {
|
|
1708
|
+
operation?: string;
|
|
1709
|
+
error?: true | string;
|
|
1710
|
+
}, options?: WaitOptions): Promise<GitHubApiCall>;
|
|
1711
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1712
|
+
[QUIET](): Promise<QuietState>;
|
|
1713
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1714
|
+
[CONTEXT](): HandleContext;
|
|
1715
|
+
}
|
|
1716
|
+
/** Wire data of a {@link GitHubApp}. */
|
|
1717
|
+
export interface GitHubAppData {
|
|
1718
|
+
id: string;
|
|
1719
|
+
name: string;
|
|
1720
|
+
kind: "app";
|
|
1721
|
+
slug: string;
|
|
1722
|
+
botLogin: string;
|
|
1723
|
+
botUserId: string;
|
|
1724
|
+
appId: number;
|
|
1725
|
+
privateKey: string;
|
|
1726
|
+
webhookSecret: string;
|
|
1727
|
+
}
|
|
1728
|
+
export declare class GitHubApp {
|
|
1729
|
+
#private;
|
|
1730
|
+
readonly id: string;
|
|
1731
|
+
readonly name: string;
|
|
1732
|
+
readonly kind: "app";
|
|
1733
|
+
readonly slug: string;
|
|
1734
|
+
readonly botLogin: string;
|
|
1735
|
+
readonly botUserId: string;
|
|
1736
|
+
readonly appId: number;
|
|
1737
|
+
readonly privateKey: string;
|
|
1738
|
+
readonly webhookSecret: string;
|
|
1739
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1740
|
+
constructor(ctx: HandleContext, data: GitHubAppData);
|
|
1741
|
+
/** The id of this App's installation, for a repository it is installed on. Experimental. */
|
|
1742
|
+
installationId(repo: GitHubRepo): Promise<number>;
|
|
1743
|
+
/** Push a commit to a branch (created from the default branch if it isn't there). Sends `push`, and `pull_request` `synchronize` for open pull requests from it. Experimental. */
|
|
1744
|
+
push(changes: FileInput[] | Record<string, string | null>, options: {
|
|
1745
|
+
repo: GitHubRepo;
|
|
1746
|
+
branch: string;
|
|
1747
|
+
message?: string;
|
|
1748
|
+
}): Promise<GitHubCommit>;
|
|
1749
|
+
/** Open an issue. Sends `issues` (action `opened`). Experimental. */
|
|
1750
|
+
openIssue(issue: {
|
|
1751
|
+
title: string;
|
|
1752
|
+
body?: string;
|
|
1753
|
+
labels?: string[];
|
|
1754
|
+
assignees?: Array<GitHubUser | GitHubApp>;
|
|
1755
|
+
}, options: {
|
|
1756
|
+
repo: GitHubRepo;
|
|
1757
|
+
}): Promise<GitHubIssue>;
|
|
1758
|
+
/** Open a pull request. With `changes`, they are pushed to `from` first; without, `from` is an existing branch. Sends `pull_request` (action `opened`). Experimental. */
|
|
1759
|
+
openPullRequest(pr: {
|
|
1760
|
+
from: string;
|
|
1761
|
+
to?: string;
|
|
1762
|
+
title?: string;
|
|
1763
|
+
body?: string;
|
|
1764
|
+
changes?: FileInput[] | Record<string, string | null>;
|
|
1765
|
+
draft?: boolean;
|
|
1766
|
+
reviewers?: Array<GitHubUser | GitHubApp>;
|
|
1767
|
+
}, options: {
|
|
1768
|
+
repo: GitHubRepo;
|
|
1769
|
+
}): Promise<GitHubPullRequest>;
|
|
1770
|
+
/** Edit the title or the body of an issue or a pull request. Sends `issues` or `pull_request` (action `edited`). Experimental. */
|
|
1771
|
+
editIssue(changes: {
|
|
1772
|
+
title?: string;
|
|
1773
|
+
body?: string;
|
|
1774
|
+
}, options: {
|
|
1775
|
+
issue: GitHubIssue;
|
|
1776
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1777
|
+
/** Close an issue or a pull request. Sends `issues` or `pull_request` (action `closed`). Experimental. */
|
|
1778
|
+
close(options: {
|
|
1779
|
+
issue: GitHubIssue;
|
|
1780
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1781
|
+
/** Reopen an issue or a pull request. Sends `issues` or `pull_request` (action `reopened`). Experimental. */
|
|
1782
|
+
reopen(options: {
|
|
1783
|
+
issue: GitHubIssue;
|
|
1784
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1785
|
+
/** Put labels on an issue or a pull request. Sends one `labeled` event per label. Experimental. */
|
|
1786
|
+
label(labels: string | string[], options: {
|
|
1787
|
+
issue: GitHubIssue;
|
|
1788
|
+
}): Promise<GitHubLabelDeliveries>;
|
|
1789
|
+
/** Take labels off an issue or a pull request. Sends one `unlabeled` event per label. Experimental. */
|
|
1790
|
+
unlabel(labels: string | string[], options: {
|
|
1791
|
+
issue: GitHubIssue;
|
|
1792
|
+
}): Promise<GitHubUnlabelDeliveries>;
|
|
1793
|
+
/** Assign people or the App's bot. Sends one `assigned` event per assignee. Experimental. */
|
|
1794
|
+
assign(assignees: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
|
|
1795
|
+
issue: GitHubIssue;
|
|
1796
|
+
}): Promise<GitHubAssignDeliveries>;
|
|
1797
|
+
/** Comment on an issue or a pull request's conversation. Sends `issue_comment` (action `created`). Experimental. */
|
|
1798
|
+
comment(body: string, options: {
|
|
1799
|
+
issue: GitHubIssue;
|
|
1800
|
+
}): Promise<GitHubComment>;
|
|
1801
|
+
/** Edit a conversation comment or a comment on the diff. Sends the comment's event with action `edited`. Experimental. */
|
|
1802
|
+
edit(body: string, options: {
|
|
1803
|
+
comment: GitHubComment | GitHubReviewComment;
|
|
1804
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1805
|
+
/** Delete a conversation comment or a comment on the diff. Sends the comment's event with action `deleted`. Experimental. */
|
|
1806
|
+
delete(options: {
|
|
1807
|
+
comment: GitHubComment | GitHubReviewComment;
|
|
1808
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1809
|
+
/** React to an issue, a pull request or a comment. GitHub sends no webhook for a reaction. Experimental. */
|
|
1810
|
+
react(content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes", options?: {
|
|
1811
|
+
issue?: GitHubIssue;
|
|
1812
|
+
comment?: GitHubComment | GitHubReviewComment;
|
|
1813
|
+
}): Promise<void>;
|
|
1814
|
+
/** Hide a comment as outdated, spam, off-topic or resolved. GitHub sends no webhook for it. Experimental. */
|
|
1815
|
+
minimize(options: {
|
|
1816
|
+
comment: GitHubComment;
|
|
1817
|
+
reason?: "OUTDATED" | "SPAM" | "OFF_TOPIC" | "RESOLVED";
|
|
1818
|
+
}): Promise<void>;
|
|
1819
|
+
/** Submit a review, with comments on the diff if any. Sends `pull_request_review`, and one `pull_request_review_comment` per comment. Experimental. */
|
|
1820
|
+
review(review: {
|
|
1821
|
+
pr: GitHubPullRequest;
|
|
1822
|
+
event: "COMMENT" | "APPROVE" | "REQUEST_CHANGES";
|
|
1823
|
+
body?: string;
|
|
1824
|
+
comments?: Array<{
|
|
1825
|
+
path: string;
|
|
1826
|
+
line: number;
|
|
1827
|
+
side?: "LEFT" | "RIGHT";
|
|
1828
|
+
startLine?: number;
|
|
1829
|
+
body: string;
|
|
1830
|
+
}>;
|
|
1831
|
+
}): Promise<GitHubReview>;
|
|
1832
|
+
/** One comment on the diff, outside a review. Sends `pull_request_review_comment`. Experimental. */
|
|
1833
|
+
reviewComment(body: string, options: {
|
|
1834
|
+
pr: GitHubPullRequest;
|
|
1835
|
+
path: string;
|
|
1836
|
+
line: number;
|
|
1837
|
+
side?: "LEFT" | "RIGHT";
|
|
1838
|
+
}): Promise<GitHubReviewComment>;
|
|
1839
|
+
/** Reply in a thread on the diff. Sends `pull_request_review_comment`. Experimental. */
|
|
1840
|
+
reply(body: string, options: {
|
|
1841
|
+
comment: GitHubReviewComment;
|
|
1842
|
+
}): Promise<GitHubReviewComment>;
|
|
1843
|
+
/** Resolve a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
|
|
1844
|
+
resolve(options: {
|
|
1845
|
+
comment: GitHubReviewComment;
|
|
1846
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1847
|
+
/** Reopen a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
|
|
1848
|
+
unresolve(options: {
|
|
1849
|
+
comment: GitHubReviewComment;
|
|
1850
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1851
|
+
/** Request a review from people or the App's bot. Sends `pull_request` (action `review_requested`) per reviewer. Experimental. */
|
|
1852
|
+
requestReview(reviewers: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
|
|
1853
|
+
pr: GitHubPullRequest;
|
|
1854
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1855
|
+
/** Mark a draft pull request as ready for review. Sends `pull_request` (action `ready_for_review`). Experimental. */
|
|
1856
|
+
markReady(options: {
|
|
1857
|
+
pr: GitHubPullRequest;
|
|
1858
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1859
|
+
/** Merge a pull request. Sends `push` for the base branch, then `pull_request` (action `closed`, merged). Experimental. */
|
|
1860
|
+
merge(options: {
|
|
1861
|
+
pr: GitHubPullRequest;
|
|
1862
|
+
method?: "merge" | "squash" | "rebase";
|
|
1863
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1864
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
1865
|
+
[QUIET](): Promise<QuietState>;
|
|
1866
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
1867
|
+
[CONTEXT](): HandleContext;
|
|
1868
|
+
}
|
|
1869
|
+
/** Wire data of a {@link GitHubUser}. */
|
|
1870
|
+
export interface GitHubUserData {
|
|
1871
|
+
id: string;
|
|
1872
|
+
name: string;
|
|
1873
|
+
kind: "user";
|
|
1874
|
+
login: string;
|
|
1875
|
+
numericId: number;
|
|
1876
|
+
displayName?: string;
|
|
1877
|
+
email?: string;
|
|
1878
|
+
role: "member" | "admin" | "outside_collaborator";
|
|
1879
|
+
}
|
|
1880
|
+
export declare class GitHubUser {
|
|
1881
|
+
#private;
|
|
1882
|
+
readonly id: string;
|
|
1883
|
+
readonly name: string;
|
|
1884
|
+
readonly kind: "user";
|
|
1885
|
+
readonly login: string;
|
|
1886
|
+
readonly numericId: number;
|
|
1887
|
+
readonly displayName: string | undefined;
|
|
1888
|
+
readonly email: string | undefined;
|
|
1889
|
+
readonly role: "member" | "admin" | "outside_collaborator";
|
|
1890
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
1891
|
+
constructor(ctx: HandleContext, data: GitHubUserData);
|
|
1892
|
+
/** Push a commit to a branch (created from the default branch if it isn't there). Sends `push`, and `pull_request` `synchronize` for open pull requests from it. Experimental. */
|
|
1893
|
+
push(changes: FileInput[] | Record<string, string | null>, options: {
|
|
1894
|
+
repo: GitHubRepo;
|
|
1895
|
+
branch: string;
|
|
1896
|
+
message?: string;
|
|
1897
|
+
}): Promise<GitHubCommit>;
|
|
1898
|
+
/** Open an issue. Sends `issues` (action `opened`). Experimental. */
|
|
1899
|
+
openIssue(issue: {
|
|
1900
|
+
title: string;
|
|
1901
|
+
body?: string;
|
|
1902
|
+
labels?: string[];
|
|
1903
|
+
assignees?: Array<GitHubUser | GitHubApp>;
|
|
1904
|
+
}, options: {
|
|
1905
|
+
repo: GitHubRepo;
|
|
1906
|
+
}): Promise<GitHubIssue>;
|
|
1907
|
+
/** Open a pull request. With `changes`, they are pushed to `from` first; without, `from` is an existing branch. Sends `pull_request` (action `opened`). Experimental. */
|
|
1908
|
+
openPullRequest(pr: {
|
|
1909
|
+
from: string;
|
|
1910
|
+
to?: string;
|
|
1911
|
+
title?: string;
|
|
1912
|
+
body?: string;
|
|
1913
|
+
changes?: FileInput[] | Record<string, string | null>;
|
|
1914
|
+
draft?: boolean;
|
|
1915
|
+
reviewers?: Array<GitHubUser | GitHubApp>;
|
|
1916
|
+
}, options: {
|
|
1917
|
+
repo: GitHubRepo;
|
|
1918
|
+
}): Promise<GitHubPullRequest>;
|
|
1919
|
+
/** Edit the title or the body of an issue or a pull request. Sends `issues` or `pull_request` (action `edited`). Experimental. */
|
|
1920
|
+
editIssue(changes: {
|
|
1921
|
+
title?: string;
|
|
1922
|
+
body?: string;
|
|
1923
|
+
}, options: {
|
|
1924
|
+
issue: GitHubIssue;
|
|
1925
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1926
|
+
/** Close an issue or a pull request. Sends `issues` or `pull_request` (action `closed`). Experimental. */
|
|
1927
|
+
close(options: {
|
|
1928
|
+
issue: GitHubIssue;
|
|
1929
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1930
|
+
/** Reopen an issue or a pull request. Sends `issues` or `pull_request` (action `reopened`). Experimental. */
|
|
1931
|
+
reopen(options: {
|
|
1932
|
+
issue: GitHubIssue;
|
|
1933
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1934
|
+
/** Put labels on an issue or a pull request. Sends one `labeled` event per label. Experimental. */
|
|
1935
|
+
label(labels: string | string[], options: {
|
|
1936
|
+
issue: GitHubIssue;
|
|
1937
|
+
}): Promise<GitHubLabelDeliveries>;
|
|
1938
|
+
/** Take labels off an issue or a pull request. Sends one `unlabeled` event per label. Experimental. */
|
|
1939
|
+
unlabel(labels: string | string[], options: {
|
|
1940
|
+
issue: GitHubIssue;
|
|
1941
|
+
}): Promise<GitHubUnlabelDeliveries>;
|
|
1942
|
+
/** Assign people or the App's bot. Sends one `assigned` event per assignee. Experimental. */
|
|
1943
|
+
assign(assignees: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
|
|
1944
|
+
issue: GitHubIssue;
|
|
1945
|
+
}): Promise<GitHubAssignDeliveries>;
|
|
1946
|
+
/** Comment on an issue or a pull request's conversation. Sends `issue_comment` (action `created`). Experimental. */
|
|
1947
|
+
comment(body: string, options: {
|
|
1948
|
+
issue: GitHubIssue;
|
|
1949
|
+
}): Promise<GitHubComment>;
|
|
1950
|
+
/** Edit a conversation comment or a comment on the diff. Sends the comment's event with action `edited`. Experimental. */
|
|
1951
|
+
edit(body: string, options: {
|
|
1952
|
+
comment: GitHubComment | GitHubReviewComment;
|
|
1953
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1954
|
+
/** Delete a conversation comment or a comment on the diff. Sends the comment's event with action `deleted`. Experimental. */
|
|
1955
|
+
delete(options: {
|
|
1956
|
+
comment: GitHubComment | GitHubReviewComment;
|
|
1957
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1958
|
+
/** React to an issue, a pull request or a comment. GitHub sends no webhook for a reaction. Experimental. */
|
|
1959
|
+
react(content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes", options?: {
|
|
1960
|
+
issue?: GitHubIssue;
|
|
1961
|
+
comment?: GitHubComment | GitHubReviewComment;
|
|
1962
|
+
}): Promise<void>;
|
|
1963
|
+
/** Hide a comment as outdated, spam, off-topic or resolved. GitHub sends no webhook for it. Experimental. */
|
|
1964
|
+
minimize(options: {
|
|
1965
|
+
comment: GitHubComment;
|
|
1966
|
+
reason?: "OUTDATED" | "SPAM" | "OFF_TOPIC" | "RESOLVED";
|
|
1967
|
+
}): Promise<void>;
|
|
1968
|
+
/** Submit a review, with comments on the diff if any. Sends `pull_request_review`, and one `pull_request_review_comment` per comment. Experimental. */
|
|
1969
|
+
review(review: {
|
|
1970
|
+
pr: GitHubPullRequest;
|
|
1971
|
+
event: "COMMENT" | "APPROVE" | "REQUEST_CHANGES";
|
|
1972
|
+
body?: string;
|
|
1973
|
+
comments?: Array<{
|
|
1974
|
+
path: string;
|
|
1975
|
+
line: number;
|
|
1976
|
+
side?: "LEFT" | "RIGHT";
|
|
1977
|
+
startLine?: number;
|
|
1978
|
+
body: string;
|
|
1979
|
+
}>;
|
|
1980
|
+
}): Promise<GitHubReview>;
|
|
1981
|
+
/** One comment on the diff, outside a review. Sends `pull_request_review_comment`. Experimental. */
|
|
1982
|
+
reviewComment(body: string, options: {
|
|
1983
|
+
pr: GitHubPullRequest;
|
|
1984
|
+
path: string;
|
|
1985
|
+
line: number;
|
|
1986
|
+
side?: "LEFT" | "RIGHT";
|
|
1987
|
+
}): Promise<GitHubReviewComment>;
|
|
1988
|
+
/** Reply in a thread on the diff. Sends `pull_request_review_comment`. Experimental. */
|
|
1989
|
+
reply(body: string, options: {
|
|
1990
|
+
comment: GitHubReviewComment;
|
|
1991
|
+
}): Promise<GitHubReviewComment>;
|
|
1992
|
+
/** Resolve a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
|
|
1993
|
+
resolve(options: {
|
|
1994
|
+
comment: GitHubReviewComment;
|
|
1995
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
1996
|
+
/** Reopen a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
|
|
1997
|
+
unresolve(options: {
|
|
1998
|
+
comment: GitHubReviewComment;
|
|
1999
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2000
|
+
/** Request a review from people or the App's bot. Sends `pull_request` (action `review_requested`) per reviewer. Experimental. */
|
|
2001
|
+
requestReview(reviewers: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
|
|
2002
|
+
pr: GitHubPullRequest;
|
|
2003
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2004
|
+
/** Mark a draft pull request as ready for review. Sends `pull_request` (action `ready_for_review`). Experimental. */
|
|
2005
|
+
markReady(options: {
|
|
2006
|
+
pr: GitHubPullRequest;
|
|
2007
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2008
|
+
/** Merge a pull request. Sends `push` for the base branch, then `pull_request` (action `closed`, merged). Experimental. */
|
|
2009
|
+
merge(options: {
|
|
2010
|
+
pr: GitHubPullRequest;
|
|
2011
|
+
method?: "merge" | "squash" | "rebase";
|
|
2012
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2013
|
+
/** Click "Re-run" on a check run. Sends `check_run` (action `rerequested`). Experimental. */
|
|
2014
|
+
rerun(options: {
|
|
2015
|
+
checkRun: GitHubCheckRun;
|
|
2016
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2017
|
+
/** Click one of the buttons the App put on a check run. Sends `check_run` (action `requested_action`). Experimental. */
|
|
2018
|
+
requestAction(identifier: string, options: {
|
|
2019
|
+
checkRun: GitHubCheckRun;
|
|
2020
|
+
}): Promise<GitHubDelivery | undefined>;
|
|
2021
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2022
|
+
[QUIET](): Promise<QuietState>;
|
|
2023
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2024
|
+
[CONTEXT](): HandleContext;
|
|
2025
|
+
}
|
|
2026
|
+
/** Wire data of a {@link GitHubRepo}. */
|
|
2027
|
+
export interface GitHubRepoData {
|
|
2028
|
+
id: string;
|
|
2029
|
+
owner: string;
|
|
2030
|
+
name: string;
|
|
2031
|
+
fullName: string;
|
|
2032
|
+
defaultBranch: string;
|
|
2033
|
+
private: boolean;
|
|
2034
|
+
}
|
|
2035
|
+
export declare class GitHubRepo {
|
|
2036
|
+
#private;
|
|
2037
|
+
readonly id: string;
|
|
2038
|
+
readonly owner: string;
|
|
2039
|
+
readonly name: string;
|
|
2040
|
+
readonly fullName: string;
|
|
2041
|
+
readonly defaultBranch: string;
|
|
2042
|
+
readonly private: boolean;
|
|
2043
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2044
|
+
constructor(ctx: HandleContext, data: GitHubRepoData);
|
|
2045
|
+
/** Install an App on this repository. Sends that App `installation_repositories`. Experimental. */
|
|
2046
|
+
installApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
|
|
2047
|
+
/** Take an App off this repository. Sends that App `installation_repositories`. Experimental. */
|
|
2048
|
+
uninstallApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
|
|
2049
|
+
/** An issue of this repository by its number. Experimental. */
|
|
2050
|
+
issue(number: number): Promise<GitHubIssue>;
|
|
2051
|
+
/** A pull request of this repository by its number. Experimental. */
|
|
2052
|
+
pullRequest(number: number): Promise<GitHubPullRequest>;
|
|
2053
|
+
/** A file's text as it is on a branch (the default branch without `ref`), or nothing when it isn't there. Experimental. */
|
|
2054
|
+
readFile(path: string, options?: {
|
|
2055
|
+
ref?: string;
|
|
2056
|
+
}): Promise<string | undefined>;
|
|
2057
|
+
/** The commits of a branch (the default branch without `branch`), newest first. Experimental. */
|
|
2058
|
+
commits(options?: {
|
|
2059
|
+
branch?: string;
|
|
2060
|
+
}): Promise<GitHubCommits>;
|
|
2061
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2062
|
+
[QUIET](): Promise<QuietState>;
|
|
2063
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2064
|
+
[CONTEXT](): HandleContext;
|
|
2065
|
+
}
|
|
2066
|
+
/** Wire data of a {@link GitHubIssue}. */
|
|
2067
|
+
export interface GitHubIssueData {
|
|
2068
|
+
repoId: string;
|
|
2069
|
+
number: number;
|
|
2070
|
+
repo: GitHubRepoData;
|
|
2071
|
+
url: string;
|
|
2072
|
+
author: GitHubUserData | GitHubAppData;
|
|
2073
|
+
}
|
|
2074
|
+
export declare class GitHubIssue {
|
|
2075
|
+
#private;
|
|
2076
|
+
readonly repoId: string;
|
|
2077
|
+
readonly number: number;
|
|
2078
|
+
readonly repo: GitHubRepo;
|
|
2079
|
+
readonly url: string;
|
|
2080
|
+
readonly author: GitHubUser | GitHubApp;
|
|
2081
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2082
|
+
constructor(ctx: HandleContext, data: GitHubIssueData);
|
|
2083
|
+
/** Read the issue again. Experimental. */
|
|
2084
|
+
refresh(): Promise<GitHubIssue>;
|
|
2085
|
+
/** The issue's title as it is now. Experimental. */
|
|
2086
|
+
title(): Promise<string>;
|
|
2087
|
+
/** Open or closed, once the agent is quiet. Experimental. */
|
|
2088
|
+
state(): Promise<"open" | "closed">;
|
|
2089
|
+
/** The names of the labels on it. Experimental. */
|
|
2090
|
+
labels(): Promise<string[]>;
|
|
2091
|
+
/** Who it is assigned to. Experimental. */
|
|
2092
|
+
assignees(): Promise<Array<GitHubUser | GitHubApp>>;
|
|
2093
|
+
/** The comments of the conversation, oldest first. Experimental. */
|
|
2094
|
+
comments(): Promise<GitHubComments>;
|
|
2095
|
+
/** The issue or pull request as a person reads it: description, comments, reviews and threads. Experimental. */
|
|
2096
|
+
transcript(): Promise<GitHubTranscript>;
|
|
2097
|
+
/** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
2098
|
+
waitForComment(options?: {
|
|
2099
|
+
from?: GitHubUser | GitHubApp | string;
|
|
2100
|
+
body?: string | RegExp;
|
|
2101
|
+
} & WaitOptions): Promise<GitHubComment>;
|
|
2102
|
+
/** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
|
|
2103
|
+
latestComment(options?: {
|
|
2104
|
+
from?: GitHubUser | GitHubApp | string;
|
|
2105
|
+
} & QuietOptions): Promise<GitHubComment>;
|
|
2106
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2107
|
+
[QUIET](): Promise<QuietState>;
|
|
2108
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2109
|
+
[CONTEXT](): HandleContext;
|
|
2110
|
+
}
|
|
2111
|
+
/** Wire data of a {@link GitHubDelivery}. */
|
|
2112
|
+
export interface GitHubDeliveryData {
|
|
2113
|
+
id: string;
|
|
2114
|
+
channel: "github";
|
|
2115
|
+
app: string;
|
|
2116
|
+
type: string;
|
|
2117
|
+
action?: string;
|
|
2118
|
+
guid: string;
|
|
2119
|
+
payload?: unknown;
|
|
2120
|
+
attempts: DeliveryAttempt[];
|
|
2121
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
2122
|
+
}
|
|
2123
|
+
export declare class GitHubDelivery {
|
|
2124
|
+
#private;
|
|
2125
|
+
readonly id: string;
|
|
2126
|
+
readonly channel: "github";
|
|
2127
|
+
readonly app: string;
|
|
2128
|
+
readonly type: string;
|
|
2129
|
+
readonly action: string | undefined;
|
|
2130
|
+
readonly guid: string;
|
|
2131
|
+
readonly payload: unknown | undefined;
|
|
2132
|
+
readonly attempts: DeliveryAttempt[];
|
|
2133
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
2134
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2135
|
+
constructor(ctx: HandleContext, data: GitHubDeliveryData);
|
|
2136
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
2137
|
+
refresh(): Promise<GitHubDelivery>;
|
|
2138
|
+
/** Redeliver from the App's delivery log, as GitHub's UI and API do: the same GUID, a new attempt. Experimental. */
|
|
2139
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
2140
|
+
/** Send the delivery again, unchanged or signed with a secret that isn't the App's. Experimental. */
|
|
2141
|
+
resend(options?: {
|
|
2142
|
+
badSignature?: boolean;
|
|
2143
|
+
}): Promise<DeliveryAttempt>;
|
|
2144
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
2145
|
+
settled(options?: WaitOptions): Promise<GitHubDelivery>;
|
|
2146
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2147
|
+
[QUIET](): Promise<QuietState>;
|
|
2148
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2149
|
+
[CONTEXT](): HandleContext;
|
|
2150
|
+
}
|
|
2151
|
+
/** Wire data of a {@link GitHubCommit}. */
|
|
2152
|
+
export interface GitHubCommitData {
|
|
2153
|
+
repoId: string;
|
|
2154
|
+
sha: string;
|
|
2155
|
+
message: string;
|
|
2156
|
+
author?: GitHubUserData | GitHubAppData;
|
|
2157
|
+
branch: string;
|
|
2158
|
+
committedAt: string;
|
|
2159
|
+
}
|
|
2160
|
+
export declare class GitHubCommit {
|
|
2161
|
+
#private;
|
|
2162
|
+
readonly repoId: string;
|
|
2163
|
+
readonly sha: string;
|
|
2164
|
+
readonly message: string;
|
|
2165
|
+
readonly author: GitHubUser | GitHubApp | undefined;
|
|
2166
|
+
readonly branch: string;
|
|
2167
|
+
readonly committedAt: string;
|
|
2168
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2169
|
+
constructor(ctx: HandleContext, data: GitHubCommitData);
|
|
2170
|
+
/** The check runs on this commit: the newest of each name. Experimental. */
|
|
2171
|
+
checkRuns(): Promise<GitHubCheckRuns>;
|
|
2172
|
+
/** The commit statuses on this commit: the newest of each context. Experimental. */
|
|
2173
|
+
statuses(): Promise<GitHubStatuses>;
|
|
2174
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2175
|
+
[QUIET](): Promise<QuietState>;
|
|
2176
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2177
|
+
[CONTEXT](): HandleContext;
|
|
2178
|
+
}
|
|
2179
|
+
/** Wire data of a {@link GitHubCheckRun}. */
|
|
2180
|
+
export interface GitHubCheckRunData {
|
|
2181
|
+
id: number;
|
|
2182
|
+
name: string;
|
|
2183
|
+
app: {
|
|
2184
|
+
slug: string;
|
|
2185
|
+
};
|
|
2186
|
+
headSha: string;
|
|
2187
|
+
status: "queued" | "in_progress" | "completed";
|
|
2188
|
+
conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required";
|
|
2189
|
+
title?: string;
|
|
2190
|
+
summary?: string;
|
|
2191
|
+
annotations: Array<{
|
|
2192
|
+
path: string;
|
|
2193
|
+
startLine: number;
|
|
2194
|
+
endLine: number;
|
|
2195
|
+
level: "notice" | "warning" | "failure";
|
|
2196
|
+
message: string;
|
|
2197
|
+
}>;
|
|
2198
|
+
actions: string[];
|
|
2199
|
+
}
|
|
2200
|
+
export declare class GitHubCheckRun {
|
|
2201
|
+
#private;
|
|
2202
|
+
readonly id: number;
|
|
2203
|
+
readonly name: string;
|
|
2204
|
+
readonly app: {
|
|
2205
|
+
slug: string;
|
|
2206
|
+
};
|
|
2207
|
+
readonly headSha: string;
|
|
2208
|
+
readonly status: "queued" | "in_progress" | "completed";
|
|
2209
|
+
readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined;
|
|
2210
|
+
readonly title: string | undefined;
|
|
2211
|
+
readonly summary: string | undefined;
|
|
2212
|
+
readonly annotations: Array<{
|
|
2213
|
+
path: string;
|
|
2214
|
+
startLine: number;
|
|
2215
|
+
endLine: number;
|
|
2216
|
+
level: "notice" | "warning" | "failure";
|
|
2217
|
+
message: string;
|
|
2218
|
+
}>;
|
|
2219
|
+
readonly actions: string[];
|
|
2220
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2221
|
+
constructor(ctx: HandleContext, data: GitHubCheckRunData);
|
|
2222
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2223
|
+
[QUIET](): Promise<QuietState>;
|
|
2224
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2225
|
+
[CONTEXT](): HandleContext;
|
|
2226
|
+
}
|
|
2227
|
+
/** Wire data of a {@link GitHubComment}. */
|
|
2228
|
+
export interface GitHubCommentData {
|
|
2229
|
+
id: number;
|
|
2230
|
+
url: string;
|
|
2231
|
+
issue: GitHubIssueData;
|
|
2232
|
+
author: GitHubUserData | GitHubAppData;
|
|
2233
|
+
body: string;
|
|
2234
|
+
createdAt: string;
|
|
2235
|
+
delivery?: GitHubDeliveryData;
|
|
2236
|
+
}
|
|
2237
|
+
export declare class GitHubComment {
|
|
2238
|
+
#private;
|
|
2239
|
+
readonly id: number;
|
|
2240
|
+
readonly url: string;
|
|
2241
|
+
readonly issue: GitHubIssue;
|
|
2242
|
+
readonly author: GitHubUser | GitHubApp;
|
|
2243
|
+
readonly body: string;
|
|
2244
|
+
readonly createdAt: string;
|
|
2245
|
+
readonly delivery: GitHubDelivery | undefined;
|
|
2246
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2247
|
+
constructor(ctx: HandleContext, data: GitHubCommentData);
|
|
2248
|
+
/** Read a conversation comment again. Experimental. */
|
|
2249
|
+
refresh(): Promise<GitHubComment>;
|
|
2250
|
+
/** The reactions on a conversation comment, by content. Experimental. */
|
|
2251
|
+
reactions(): Promise<GitHubReactions>;
|
|
2252
|
+
/** The `issue_comment` (`created`) delivery this comment caused to this App (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in App's. Experimental. */
|
|
2253
|
+
deliveryFor(app: GitHubApp): Promise<GitHubDelivery | undefined>;
|
|
2254
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2255
|
+
[QUIET](): Promise<QuietState>;
|
|
2256
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2257
|
+
[CONTEXT](): HandleContext;
|
|
2258
|
+
}
|
|
2259
|
+
/** Wire data of a {@link GitHubReviewComment}. */
|
|
2260
|
+
export interface GitHubReviewCommentData {
|
|
2261
|
+
id: number;
|
|
2262
|
+
pr: GitHubPullRequestData;
|
|
2263
|
+
author: GitHubUserData | GitHubAppData;
|
|
2264
|
+
path: string;
|
|
2265
|
+
line: number;
|
|
2266
|
+
side: "LEFT" | "RIGHT";
|
|
2267
|
+
body: string;
|
|
2268
|
+
delivery?: GitHubDeliveryData;
|
|
2269
|
+
}
|
|
2270
|
+
export declare class GitHubReviewComment {
|
|
2271
|
+
#private;
|
|
2272
|
+
readonly id: number;
|
|
2273
|
+
readonly pr: GitHubPullRequest;
|
|
2274
|
+
readonly author: GitHubUser | GitHubApp;
|
|
2275
|
+
readonly path: string;
|
|
2276
|
+
readonly line: number;
|
|
2277
|
+
readonly side: "LEFT" | "RIGHT";
|
|
2278
|
+
readonly body: string;
|
|
2279
|
+
readonly delivery: GitHubDelivery | undefined;
|
|
2280
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2281
|
+
constructor(ctx: HandleContext, data: GitHubReviewCommentData);
|
|
2282
|
+
/** The replies in this comment's thread, once the agent is quiet. Experimental. */
|
|
2283
|
+
replies(): Promise<GitHubReviewCommentReplies>;
|
|
2284
|
+
/** Is this comment's thread resolved?. Experimental. */
|
|
2285
|
+
resolved(): Promise<boolean>;
|
|
2286
|
+
/** This comment's thread as a person reads it. Experimental. */
|
|
2287
|
+
transcript(): Promise<GitHubTranscript>;
|
|
2288
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2289
|
+
[QUIET](): Promise<QuietState>;
|
|
2290
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2291
|
+
[CONTEXT](): HandleContext;
|
|
2292
|
+
}
|
|
2293
|
+
/** Wire data of a {@link LinearFixture}. */
|
|
2294
|
+
export interface LinearFixtureData {
|
|
2295
|
+
app: LinearAppData;
|
|
2296
|
+
apiUrl: string;
|
|
2297
|
+
}
|
|
2298
|
+
export declare class LinearFixture {
|
|
2299
|
+
#private;
|
|
2300
|
+
readonly app: LinearApp;
|
|
2301
|
+
readonly apiUrl: string;
|
|
2302
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2303
|
+
constructor(ctx: HandleContext, data: LinearFixtureData);
|
|
2304
|
+
/** Create a person in the workspace. Experimental. */
|
|
2305
|
+
createUser(options: {
|
|
2306
|
+
name: string;
|
|
2307
|
+
id?: string;
|
|
2308
|
+
displayName?: string;
|
|
2309
|
+
email?: string;
|
|
2310
|
+
admin?: boolean;
|
|
2311
|
+
guest?: boolean;
|
|
2312
|
+
token?: string;
|
|
2313
|
+
}): Promise<LinearUser>;
|
|
2314
|
+
/** The people this session created. Experimental. */
|
|
2315
|
+
users(): Promise<LinearUsers>;
|
|
2316
|
+
/** Make another OAuth app in the workspace, installed with `actor=app`: its own app user (mentionable and assignable), access token, client and webhook secret. Or return the one made with this name and settings. Its webhooks go to CHANNELSTACK_LINEAR_APP_<NAME>_WEBHOOK_URL. Experimental. */
|
|
2317
|
+
createApp(options: {
|
|
2318
|
+
name: string;
|
|
2319
|
+
events?: string[];
|
|
2320
|
+
}): Promise<LinearApp>;
|
|
2321
|
+
/** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
2322
|
+
apps(): Promise<LinearApps>;
|
|
2323
|
+
/** The teams this session created. Experimental. */
|
|
2324
|
+
teams(): Promise<LinearTeams>;
|
|
2325
|
+
/** Create a team: its members, workflow states and labels. Without a key one is made up, so parallel tests never share one. Experimental. */
|
|
2326
|
+
createTeam(options?: {
|
|
2327
|
+
key?: string;
|
|
2328
|
+
name?: string;
|
|
2329
|
+
members?: LinearUser[];
|
|
2330
|
+
states?: Array<{
|
|
2331
|
+
name: string;
|
|
2332
|
+
type: "backlog" | "unstarted" | "started" | "completed" | "canceled" | "triage";
|
|
2333
|
+
}>;
|
|
2334
|
+
labels?: string[];
|
|
2335
|
+
}): Promise<LinearTeam>;
|
|
2336
|
+
/** The issues in this session's teams, read again from Linear live, oldest first. Experimental. */
|
|
2337
|
+
issues(): Promise<LinearIssues>;
|
|
2338
|
+
/** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
2339
|
+
deliveries(options?: {
|
|
2340
|
+
type?: string;
|
|
2341
|
+
resource?: LinearIssue;
|
|
2342
|
+
app?: LinearApp;
|
|
2343
|
+
}): Promise<LinearDeliveries>;
|
|
2344
|
+
/** The GraphQL operations the agent sent about this session's issues and sessions, by root field (`agentActivityCreate`). Experimental. */
|
|
2345
|
+
calls(options?: {
|
|
2346
|
+
operation?: string;
|
|
2347
|
+
error?: true | string;
|
|
2348
|
+
}): Promise<LinearApiCalls>;
|
|
2349
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
2350
|
+
waitForCall(filter?: {
|
|
2351
|
+
operation?: string;
|
|
2352
|
+
error?: true | string;
|
|
2353
|
+
}, options?: WaitOptions): Promise<LinearApiCall>;
|
|
2354
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2355
|
+
[QUIET](): Promise<QuietState>;
|
|
2356
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2357
|
+
[CONTEXT](): HandleContext;
|
|
2358
|
+
}
|
|
2359
|
+
/** Wire data of a {@link LinearApp}. */
|
|
2360
|
+
export interface LinearAppData {
|
|
2361
|
+
id: string;
|
|
2362
|
+
name: string;
|
|
2363
|
+
kind: "app";
|
|
2364
|
+
botUserId: string;
|
|
2365
|
+
accessToken: string;
|
|
2366
|
+
webhookSecret: string;
|
|
2367
|
+
clientId: string;
|
|
2368
|
+
clientSecret: string;
|
|
2369
|
+
}
|
|
2370
|
+
export declare class LinearApp {
|
|
2371
|
+
#private;
|
|
2372
|
+
readonly id: string;
|
|
2373
|
+
readonly name: string;
|
|
2374
|
+
readonly kind: "app";
|
|
2375
|
+
readonly botUserId: string;
|
|
2376
|
+
readonly accessToken: string;
|
|
2377
|
+
readonly webhookSecret: string;
|
|
2378
|
+
readonly clientId: string;
|
|
2379
|
+
readonly clientSecret: string;
|
|
2380
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2381
|
+
constructor(ctx: HandleContext, data: LinearAppData);
|
|
2382
|
+
/** An app a test made comments on an issue, as its own `commentCreate` would. Its mention of another app is refused (to confirm, B6). Experimental. */
|
|
2383
|
+
comment(body: string, options: {
|
|
2384
|
+
issue: LinearIssue;
|
|
2385
|
+
}): Promise<LinearComment>;
|
|
2386
|
+
/** An app a test made replies in a comment's thread, as its own `commentCreate` with a `parentId` would. Experimental. */
|
|
2387
|
+
reply(body: string, options: {
|
|
2388
|
+
comment: LinearComment;
|
|
2389
|
+
}): Promise<LinearComment>;
|
|
2390
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2391
|
+
[QUIET](): Promise<QuietState>;
|
|
2392
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2393
|
+
[CONTEXT](): HandleContext;
|
|
2394
|
+
}
|
|
2395
|
+
/** Wire data of a {@link LinearUser}. */
|
|
2396
|
+
export interface LinearUserData {
|
|
2397
|
+
id: string;
|
|
2398
|
+
name: string;
|
|
2399
|
+
kind: "user";
|
|
2400
|
+
displayName: string;
|
|
2401
|
+
email?: string;
|
|
2402
|
+
admin: boolean;
|
|
2403
|
+
guest: boolean;
|
|
2404
|
+
}
|
|
2405
|
+
export declare class LinearUser {
|
|
2406
|
+
#private;
|
|
2407
|
+
readonly id: string;
|
|
2408
|
+
readonly name: string;
|
|
2409
|
+
readonly kind: "user";
|
|
2410
|
+
readonly displayName: string;
|
|
2411
|
+
readonly email: string | undefined;
|
|
2412
|
+
readonly admin: boolean;
|
|
2413
|
+
readonly guest: boolean;
|
|
2414
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2415
|
+
constructor(ctx: HandleContext, data: LinearUserData);
|
|
2416
|
+
/** Create an issue. Sends `Issue` (`create`); with `delegate`, it opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
|
|
2417
|
+
createIssue(issue: {
|
|
2418
|
+
title: string;
|
|
2419
|
+
description?: string;
|
|
2420
|
+
priority?: number;
|
|
2421
|
+
state?: string;
|
|
2422
|
+
labels?: string[];
|
|
2423
|
+
assignee?: LinearUser;
|
|
2424
|
+
delegate?: LinearApp;
|
|
2425
|
+
parent?: LinearIssue;
|
|
2426
|
+
}, options: {
|
|
2427
|
+
team: LinearTeam;
|
|
2428
|
+
}): Promise<LinearIssue>;
|
|
2429
|
+
/** Edit an issue's title, description or priority. Sends `Issue` (`update`). Experimental. */
|
|
2430
|
+
editIssue(changes: {
|
|
2431
|
+
title?: string;
|
|
2432
|
+
description?: string;
|
|
2433
|
+
priority?: number;
|
|
2434
|
+
}, options: {
|
|
2435
|
+
issue: LinearIssue;
|
|
2436
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2437
|
+
/** Take an issue back from the app. Sends `Issue` (`update`). Experimental. */
|
|
2438
|
+
undelegate(options: {
|
|
2439
|
+
issue: LinearIssue;
|
|
2440
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2441
|
+
/** Assign an issue to a person, or (with no one) unassign it. Sends `Issue` (`update`). Experimental. */
|
|
2442
|
+
assign(assignee: LinearUser | undefined, options: {
|
|
2443
|
+
issue: LinearIssue;
|
|
2444
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2445
|
+
/** Move an issue to a workflow state, by name. Sends `Issue` (`update`). Experimental. */
|
|
2446
|
+
setState(state: string, options: {
|
|
2447
|
+
issue: LinearIssue;
|
|
2448
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2449
|
+
/** Put labels on an issue, by name. Sends `Issue` (`update`). Experimental. */
|
|
2450
|
+
label(labels: string | string[], options: {
|
|
2451
|
+
issue: LinearIssue;
|
|
2452
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2453
|
+
/** Delegate an issue to an app. Opens that app's agent session and sends it `AgentSessionEvent` (`created`); an issue delegated to another app moves. Experimental. */
|
|
2454
|
+
delegate(app: LinearApp, options: {
|
|
2455
|
+
issue: LinearIssue;
|
|
2456
|
+
}): Promise<LinearAgentSession>;
|
|
2457
|
+
/** Comment on an issue. A mention of the app opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
|
|
2458
|
+
comment(body: string, options: {
|
|
2459
|
+
issue: LinearIssue;
|
|
2460
|
+
}): Promise<LinearComment>;
|
|
2461
|
+
/** Reply in a comment's thread. In an agent session's thread, it prompts the session (`AgentSessionEvent` `prompted`). Experimental. */
|
|
2462
|
+
reply(body: string, options: {
|
|
2463
|
+
comment: LinearComment;
|
|
2464
|
+
}): Promise<LinearComment>;
|
|
2465
|
+
/** Edit a comment. Sends `Comment` (`update`). Experimental. */
|
|
2466
|
+
edit(body: string, options: {
|
|
2467
|
+
comment: LinearComment;
|
|
2468
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2469
|
+
/** Delete a comment. Sends `Comment` (`remove`). Experimental. */
|
|
2470
|
+
delete(options: {
|
|
2471
|
+
comment: LinearComment;
|
|
2472
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2473
|
+
/** React to a comment with an emoji. Linear sends no webhook for it. Experimental. */
|
|
2474
|
+
react(emoji: string, options: {
|
|
2475
|
+
comment: LinearComment;
|
|
2476
|
+
}): Promise<void>;
|
|
2477
|
+
/** Send a follow-up in an agent session. Sends `AgentSessionEvent` (`prompted`). Experimental. */
|
|
2478
|
+
prompt(body: string, options: {
|
|
2479
|
+
session: LinearAgentSession;
|
|
2480
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2481
|
+
/** Answer a question the agent asked (an `elicitation` activity). Sends `AgentSessionEvent` (`prompted`). Experimental. */
|
|
2482
|
+
answer(body: string, options: {
|
|
2483
|
+
elicitation: LinearAgentActivity;
|
|
2484
|
+
}): Promise<LinearDelivery | undefined>;
|
|
2485
|
+
/** Press Stop on an agent session. Sends `AgentSessionEvent` (`prompted`) with the `stop` signal. Experimental. */
|
|
2486
|
+
stop(options: {
|
|
2487
|
+
session: LinearAgentSession;
|
|
2488
|
+
}): Promise<LinearDelivery>;
|
|
2489
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2490
|
+
[QUIET](): Promise<QuietState>;
|
|
2491
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2492
|
+
[CONTEXT](): HandleContext;
|
|
2493
|
+
}
|
|
2494
|
+
/** Wire data of a {@link LinearComment}. */
|
|
2495
|
+
export interface LinearCommentData {
|
|
2496
|
+
id: string;
|
|
2497
|
+
issue: LinearIssueData;
|
|
2498
|
+
author: LinearUserData | LinearAppData;
|
|
2499
|
+
body: string;
|
|
2500
|
+
createdAt: string;
|
|
2501
|
+
url: string;
|
|
2502
|
+
session?: LinearAgentSessionData;
|
|
2503
|
+
delivery?: LinearDeliveryData;
|
|
2504
|
+
}
|
|
2505
|
+
export declare class LinearComment {
|
|
2506
|
+
#private;
|
|
2507
|
+
readonly id: string;
|
|
2508
|
+
readonly issue: LinearIssue;
|
|
2509
|
+
readonly author: LinearUser | LinearApp;
|
|
2510
|
+
readonly body: string;
|
|
2511
|
+
readonly createdAt: string;
|
|
2512
|
+
readonly url: string;
|
|
2513
|
+
readonly session: LinearAgentSession | undefined;
|
|
2514
|
+
readonly delivery: LinearDelivery | undefined;
|
|
2515
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2516
|
+
constructor(ctx: HandleContext, data: LinearCommentData);
|
|
2517
|
+
/** The replies in a comment's thread, once the agent is quiet. Experimental. */
|
|
2518
|
+
replies(): Promise<LinearCommentReplies>;
|
|
2519
|
+
/** The `Comment` (`create`) delivery this comment caused to this app (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in app's. Experimental. */
|
|
2520
|
+
deliveryFor(app: LinearApp): Promise<LinearDelivery | undefined>;
|
|
2521
|
+
/** A comment's thread as a person reads it. Experimental. */
|
|
2522
|
+
transcript(): Promise<LinearTranscript>;
|
|
2523
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2524
|
+
[QUIET](): Promise<QuietState>;
|
|
2525
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2526
|
+
[CONTEXT](): HandleContext;
|
|
2527
|
+
}
|
|
2528
|
+
/** Wire data of a {@link LinearIssue}. */
|
|
2529
|
+
export interface LinearIssueData {
|
|
2530
|
+
id: string;
|
|
2531
|
+
identifier: string;
|
|
2532
|
+
url: string;
|
|
2533
|
+
team: LinearTeamData;
|
|
2534
|
+
creator: LinearUserData | LinearAppData;
|
|
2535
|
+
}
|
|
2536
|
+
export declare class LinearIssue {
|
|
2537
|
+
#private;
|
|
2538
|
+
readonly id: string;
|
|
2539
|
+
readonly identifier: string;
|
|
2540
|
+
readonly url: string;
|
|
2541
|
+
readonly team: LinearTeam;
|
|
2542
|
+
readonly creator: LinearUser | LinearApp;
|
|
2543
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2544
|
+
constructor(ctx: HandleContext, data: LinearIssueData);
|
|
2545
|
+
/** Read the issue again. Experimental. */
|
|
2546
|
+
refresh(): Promise<LinearIssue>;
|
|
2547
|
+
/** The issue's title as it is now. Experimental. */
|
|
2548
|
+
title(): Promise<string>;
|
|
2549
|
+
/** The issue's workflow state. Experimental. */
|
|
2550
|
+
state(): Promise<LinearIssueState>;
|
|
2551
|
+
/** Who the issue is assigned to, if anyone. Experimental. */
|
|
2552
|
+
assignee(): Promise<LinearUser | undefined>;
|
|
2553
|
+
/** The app the issue is delegated to, if any. Experimental. */
|
|
2554
|
+
delegatedTo(): Promise<LinearApp | undefined>;
|
|
2555
|
+
/** The names of the labels on the issue. Experimental. */
|
|
2556
|
+
labels(): Promise<string[]>;
|
|
2557
|
+
/** The comments on the issue, oldest first, without the one Linear writes to open a delegated session's thread. Experimental. */
|
|
2558
|
+
comments(): Promise<LinearComments>;
|
|
2559
|
+
/** The agent sessions on the issue, oldest first. Experimental. */
|
|
2560
|
+
sessions(): Promise<LinearAgentSessions>;
|
|
2561
|
+
/** The issue's latest agent session, waiting for one to be opened. Experimental. */
|
|
2562
|
+
session(): Promise<LinearAgentSession>;
|
|
2563
|
+
/** The issue as a person reads it: description, comments and the agent's sessions. Experimental. */
|
|
2564
|
+
transcript(): Promise<LinearTranscript>;
|
|
2565
|
+
/** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
2566
|
+
waitForComment(options?: {
|
|
2567
|
+
from?: LinearUser | LinearApp | string;
|
|
2568
|
+
body?: string | RegExp;
|
|
2569
|
+
} & WaitOptions): Promise<LinearComment>;
|
|
2570
|
+
/** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
|
|
2571
|
+
latestComment(options?: {
|
|
2572
|
+
from?: LinearUser | LinearApp | string;
|
|
2573
|
+
} & QuietOptions): Promise<LinearComment>;
|
|
2574
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2575
|
+
[QUIET](): Promise<QuietState>;
|
|
2576
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2577
|
+
[CONTEXT](): HandleContext;
|
|
2578
|
+
}
|
|
2579
|
+
/** Wire data of a {@link LinearTeam}. */
|
|
2580
|
+
export interface LinearTeamData {
|
|
2581
|
+
id: string;
|
|
2582
|
+
key: string;
|
|
2583
|
+
name: string;
|
|
2584
|
+
}
|
|
2585
|
+
export declare class LinearTeam {
|
|
2586
|
+
#private;
|
|
2587
|
+
readonly id: string;
|
|
2588
|
+
readonly key: string;
|
|
2589
|
+
readonly name: string;
|
|
2590
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2591
|
+
constructor(ctx: HandleContext, data: LinearTeamData);
|
|
2592
|
+
/** An issue of this team by its identifier (`ENG-12`). Experimental. */
|
|
2593
|
+
issue(identifier: string): Promise<LinearIssue>;
|
|
2594
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2595
|
+
[QUIET](): Promise<QuietState>;
|
|
2596
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2597
|
+
[CONTEXT](): HandleContext;
|
|
2598
|
+
}
|
|
2599
|
+
/** Wire data of a {@link LinearAgentSession}. */
|
|
2600
|
+
export interface LinearAgentSessionData {
|
|
2601
|
+
id: string;
|
|
2602
|
+
issue: LinearIssueData;
|
|
2603
|
+
app: LinearAppData;
|
|
2604
|
+
startedBy: LinearUserData;
|
|
2605
|
+
delivery?: LinearDeliveryData;
|
|
2606
|
+
}
|
|
2607
|
+
export declare class LinearAgentSession {
|
|
2608
|
+
#private;
|
|
2609
|
+
readonly id: string;
|
|
2610
|
+
readonly issue: LinearIssue;
|
|
2611
|
+
readonly app: LinearApp;
|
|
2612
|
+
readonly startedBy: LinearUser;
|
|
2613
|
+
readonly delivery: LinearDelivery | undefined;
|
|
2614
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2615
|
+
constructor(ctx: HandleContext, data: LinearAgentSessionData);
|
|
2616
|
+
/** The session's status. Experimental. */
|
|
2617
|
+
state(): Promise<"pending" | "active" | "stopping" | "awaitingInput" | "complete" | "error" | "stale">;
|
|
2618
|
+
/** The session's activities, oldest first: the agent's, and the prompts of people. Experimental. */
|
|
2619
|
+
activities(): Promise<LinearAgentActivities>;
|
|
2620
|
+
/** The links the agent attached to the session. Experimental. */
|
|
2621
|
+
externalUrls(): Promise<LinearExternalUrls>;
|
|
2622
|
+
/** The agent's plan: each step and its status. Experimental. */
|
|
2623
|
+
plan(): Promise<LinearPlan>;
|
|
2624
|
+
/** The session as a person reads it. Experimental. */
|
|
2625
|
+
transcript(): Promise<LinearTranscript>;
|
|
2626
|
+
/** Wait for the agent session to reach that state: one of the values given. Resolves with the value as it is then. */
|
|
2627
|
+
waitForState(wanted: "pending" | "active" | "stopping" | "awaitingInput" | "complete" | "error" | "stale" | Array<"pending" | "active" | "stopping" | "awaitingInput" | "complete" | "error" | "stale">, options?: WaitOptions): Promise<"pending" | "active" | "stopping" | "awaitingInput" | "complete" | "error" | "stale">;
|
|
2628
|
+
/** Wait for the next new activity, after the last one this handle saw. */
|
|
2629
|
+
waitForActivity(options?: {
|
|
2630
|
+
type?: string | RegExp;
|
|
2631
|
+
} & WaitOptions): Promise<LinearAgentActivity>;
|
|
2632
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2633
|
+
[QUIET](): Promise<QuietState>;
|
|
2634
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2635
|
+
[CONTEXT](): HandleContext;
|
|
2636
|
+
}
|
|
2637
|
+
/** Wire data of a {@link LinearDelivery}. */
|
|
2638
|
+
export interface LinearDeliveryData {
|
|
2639
|
+
id: string;
|
|
2640
|
+
channel: "linear";
|
|
2641
|
+
app: string;
|
|
2642
|
+
type: string;
|
|
2643
|
+
action: string;
|
|
2644
|
+
webhookId: string;
|
|
2645
|
+
payload?: unknown;
|
|
2646
|
+
attempts: DeliveryAttempt[];
|
|
2647
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
2648
|
+
}
|
|
2649
|
+
export declare class LinearDelivery {
|
|
2650
|
+
#private;
|
|
2651
|
+
readonly id: string;
|
|
2652
|
+
readonly channel: "linear";
|
|
2653
|
+
readonly app: string;
|
|
2654
|
+
readonly type: string;
|
|
2655
|
+
readonly action: string;
|
|
2656
|
+
readonly webhookId: string;
|
|
2657
|
+
readonly payload: unknown | undefined;
|
|
2658
|
+
readonly attempts: DeliveryAttempt[];
|
|
2659
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
2660
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2661
|
+
constructor(ctx: HandleContext, data: LinearDeliveryData);
|
|
2662
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
2663
|
+
refresh(): Promise<LinearDelivery>;
|
|
2664
|
+
/** Redeliver, as Linear retries: the same delivery, with a new `webhookTimestamp` and a new signature. Experimental. */
|
|
2665
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
2666
|
+
/** Send the delivery again: stale (its `webhookTimestamp` two minutes old), or signed with a secret that isn't the app's. Experimental. */
|
|
2667
|
+
resend(options?: {
|
|
2668
|
+
badSignature?: boolean;
|
|
2669
|
+
stale?: boolean;
|
|
2670
|
+
}): Promise<DeliveryAttempt>;
|
|
2671
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
2672
|
+
settled(options?: WaitOptions): Promise<LinearDelivery>;
|
|
2673
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2674
|
+
[QUIET](): Promise<QuietState>;
|
|
2675
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2676
|
+
[CONTEXT](): HandleContext;
|
|
2677
|
+
}
|
|
2678
|
+
/** Wire data of a {@link LinearAgentActivity}. */
|
|
2679
|
+
export interface LinearAgentActivityData {
|
|
2680
|
+
id: string;
|
|
2681
|
+
session: LinearAgentSessionData;
|
|
2682
|
+
type: "thought" | "action" | "elicitation" | "response" | "error" | "prompt";
|
|
2683
|
+
author: LinearUserData | LinearAppData;
|
|
2684
|
+
body?: string;
|
|
2685
|
+
action?: {
|
|
2686
|
+
action: string;
|
|
2687
|
+
parameter?: string;
|
|
2688
|
+
result?: string;
|
|
2689
|
+
};
|
|
2690
|
+
ephemeral: boolean;
|
|
2691
|
+
createdAt: string;
|
|
2692
|
+
}
|
|
2693
|
+
export declare class LinearAgentActivity {
|
|
2694
|
+
#private;
|
|
2695
|
+
readonly id: string;
|
|
2696
|
+
readonly session: LinearAgentSession;
|
|
2697
|
+
readonly type: "thought" | "action" | "elicitation" | "response" | "error" | "prompt";
|
|
2698
|
+
readonly author: LinearUser | LinearApp;
|
|
2699
|
+
readonly body: string | undefined;
|
|
2700
|
+
readonly action: {
|
|
2701
|
+
action: string;
|
|
2702
|
+
parameter?: string;
|
|
2703
|
+
result?: string;
|
|
2704
|
+
} | undefined;
|
|
2705
|
+
readonly ephemeral: boolean;
|
|
2706
|
+
readonly createdAt: string;
|
|
2707
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2708
|
+
constructor(ctx: HandleContext, data: LinearAgentActivityData);
|
|
2709
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2710
|
+
[QUIET](): Promise<QuietState>;
|
|
2711
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2712
|
+
[CONTEXT](): HandleContext;
|
|
2713
|
+
}
|
|
2714
|
+
/** Wire data of a {@link NotionFixture}. */
|
|
2715
|
+
export interface NotionFixtureData {
|
|
2716
|
+
app: NotionIntegrationData;
|
|
2717
|
+
apiUrl: string;
|
|
2718
|
+
}
|
|
2719
|
+
export declare class NotionFixture {
|
|
2720
|
+
#private;
|
|
2721
|
+
readonly app: NotionIntegration;
|
|
2722
|
+
readonly apiUrl: string;
|
|
2723
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2724
|
+
constructor(ctx: HandleContext, data: NotionFixtureData);
|
|
2725
|
+
/** Create a person in the workspace. Experimental. */
|
|
2726
|
+
createUser(options: {
|
|
2727
|
+
name: string;
|
|
2728
|
+
id?: string;
|
|
2729
|
+
email?: string;
|
|
2730
|
+
avatarUrl?: string;
|
|
2731
|
+
token?: string;
|
|
2732
|
+
}): Promise<NotionUser>;
|
|
2733
|
+
/** The people this session created. Experimental. */
|
|
2734
|
+
users(): Promise<NotionUsers>;
|
|
2735
|
+
/** Make another internal integration in the workspace, with its own bot user, token and webhook subscription (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_NOTION_APP_<NAME>_WEBHOOK_URL, and it sees only the pages connected to it. Experimental. */
|
|
2736
|
+
createApp(options: {
|
|
2737
|
+
name: string;
|
|
2738
|
+
capabilities?: NotionCapability[];
|
|
2739
|
+
events?: string[];
|
|
2740
|
+
}): Promise<NotionIntegration>;
|
|
2741
|
+
/** The integrations this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
2742
|
+
apps(): Promise<NotionIntegrations>;
|
|
2743
|
+
/** The pages this session created, a database's rows included, read again from Notion live, oldest first. Not those in the trash. Experimental. */
|
|
2744
|
+
pages(): Promise<NotionPages>;
|
|
2745
|
+
/** Create a page as seed data. The integration sees it only through `connections`, its own or a parent's. In the fake it sends no event; live, a real person makes it, so Notion sends `page.created` to a connected integration. A person creating the page sends the event in both worlds. Experimental. */
|
|
2746
|
+
createPage(options: {
|
|
2747
|
+
title: string;
|
|
2748
|
+
parent?: NotionPage;
|
|
2749
|
+
content?: string | {
|
|
2750
|
+
path: string;
|
|
2751
|
+
} | unknown[];
|
|
2752
|
+
icon?: string;
|
|
2753
|
+
connections?: NotionIntegration[];
|
|
2754
|
+
createdBy?: NotionUser;
|
|
2755
|
+
}): Promise<NotionPage>;
|
|
2756
|
+
/** Create a database with its property schema and rows, as seed data. Experimental. */
|
|
2757
|
+
createDatabase(options: {
|
|
2758
|
+
title: string;
|
|
2759
|
+
parent?: NotionPage;
|
|
2760
|
+
properties: Record<string, NotionPropertySchema>;
|
|
2761
|
+
rows?: Array<Record<string, NotionPropertyValue>>;
|
|
2762
|
+
connections?: NotionIntegration[];
|
|
2763
|
+
}): Promise<NotionDatabase>;
|
|
2764
|
+
/** How long Notion holds `page.content_updated` to batch edits, for this session (fake only). Default one second. Experimental. */
|
|
2765
|
+
setContentUpdateDelay(delay: Duration): Promise<void>;
|
|
2766
|
+
/** Send a subscription's verification request (`{ verification_token }`), as Notion does once when a subscription is created: the built-in integration's, or the one given's. Experimental. */
|
|
2767
|
+
sendVerification(options?: {
|
|
2768
|
+
app?: NotionIntegration;
|
|
2769
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2770
|
+
/** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
2771
|
+
deliveries(options?: {
|
|
2772
|
+
type?: string;
|
|
2773
|
+
resource?: NotionPage;
|
|
2774
|
+
app?: NotionIntegration;
|
|
2775
|
+
}): Promise<NotionDeliveries>;
|
|
2776
|
+
/** The REST calls the agent made about this session's pages, by the client's method name (`comments.create`). Experimental. */
|
|
2777
|
+
calls(options?: {
|
|
2778
|
+
operation?: string;
|
|
2779
|
+
error?: true | string;
|
|
2780
|
+
}): Promise<NotionApiCalls>;
|
|
2781
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
2782
|
+
waitForCall(filter?: {
|
|
2783
|
+
operation?: string;
|
|
2784
|
+
error?: true | string;
|
|
2785
|
+
}, options?: WaitOptions): Promise<NotionApiCall>;
|
|
2786
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2787
|
+
[QUIET](): Promise<QuietState>;
|
|
2788
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2789
|
+
[CONTEXT](): HandleContext;
|
|
2790
|
+
}
|
|
2791
|
+
/** Wire data of a {@link NotionIntegration}. */
|
|
2792
|
+
export interface NotionIntegrationData {
|
|
2793
|
+
id: string;
|
|
2794
|
+
name: string;
|
|
2795
|
+
kind: "app";
|
|
2796
|
+
channel: "notion";
|
|
2797
|
+
botUserId: string;
|
|
2798
|
+
token: string;
|
|
2799
|
+
webhookSecret: string;
|
|
2800
|
+
}
|
|
2801
|
+
export declare class NotionIntegration {
|
|
2802
|
+
#private;
|
|
2803
|
+
readonly id: string;
|
|
2804
|
+
readonly name: string;
|
|
2805
|
+
readonly kind: "app";
|
|
2806
|
+
readonly channel: "notion";
|
|
2807
|
+
readonly botUserId: string;
|
|
2808
|
+
readonly token: string;
|
|
2809
|
+
readonly webhookSecret: string;
|
|
2810
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2811
|
+
constructor(ctx: HandleContext, data: NotionIntegrationData);
|
|
2812
|
+
/** An integration a test made starts a discussion on a page, or anchored to the block with `anchor` in its text, as its own `comments.create` would: on a page connected to it, mentioning people only. Sends `comment.created` to every integration that sees the page. Experimental. */
|
|
2813
|
+
comment(text: string, options: {
|
|
2814
|
+
page: NotionPage;
|
|
2815
|
+
anchor?: string | RegExp;
|
|
2816
|
+
}): Promise<NotionComment>;
|
|
2817
|
+
/** An integration a test made replies in a discussion, as `comments.create` with `discussion_id` would. Sends `comment.created`. Experimental. */
|
|
2818
|
+
reply(text: string, options: {
|
|
2819
|
+
discussion: NotionDiscussion;
|
|
2820
|
+
}): Promise<NotionComment>;
|
|
2821
|
+
/** An integration a test made edits a page's body, as its own block calls would: append, or replace it. Sends one `page.content_updated` once Notion's batching delay is over. Experimental. */
|
|
2822
|
+
edit(change: {
|
|
2823
|
+
append?: string | {
|
|
2824
|
+
path: string;
|
|
2825
|
+
} | unknown[];
|
|
2826
|
+
replace?: string | {
|
|
2827
|
+
path: string;
|
|
2828
|
+
} | unknown[];
|
|
2829
|
+
}, options: {
|
|
2830
|
+
page: NotionPage;
|
|
2831
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2832
|
+
/** An integration a test made changes a page's title, as its own `pages.update` would. Sends `page.properties_updated`. Experimental. */
|
|
2833
|
+
rename(title: string, options: {
|
|
2834
|
+
page: NotionPage;
|
|
2835
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2836
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2837
|
+
[QUIET](): Promise<QuietState>;
|
|
2838
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2839
|
+
[CONTEXT](): HandleContext;
|
|
2840
|
+
}
|
|
2841
|
+
/** Wire data of a {@link NotionUser}. */
|
|
2842
|
+
export interface NotionUserData {
|
|
2843
|
+
id: string;
|
|
2844
|
+
name: string;
|
|
2845
|
+
kind: "user";
|
|
2846
|
+
channel: "notion";
|
|
2847
|
+
email?: string;
|
|
2848
|
+
}
|
|
2849
|
+
export declare class NotionUser {
|
|
2850
|
+
#private;
|
|
2851
|
+
readonly id: string;
|
|
2852
|
+
readonly name: string;
|
|
2853
|
+
readonly kind: "user";
|
|
2854
|
+
readonly channel: "notion";
|
|
2855
|
+
readonly email: string | undefined;
|
|
2856
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2857
|
+
constructor(ctx: HandleContext, data: NotionUserData);
|
|
2858
|
+
/** Start a discussion on a page, or anchored to the block with `anchor` in its text. Sends `comment.created` if the integration can see the page. Experimental. */
|
|
2859
|
+
comment(text: string, options: {
|
|
2860
|
+
page: NotionPage;
|
|
2861
|
+
anchor?: string | RegExp;
|
|
2862
|
+
}): Promise<NotionComment>;
|
|
2863
|
+
/** Reply in a discussion. Sends `comment.created`. Experimental. */
|
|
2864
|
+
reply(text: string, options: {
|
|
2865
|
+
discussion: NotionDiscussion;
|
|
2866
|
+
}): Promise<NotionComment>;
|
|
2867
|
+
/** Edit one of this person's comments. Sends `comment.updated`. Experimental. */
|
|
2868
|
+
editComment(text: string, options: {
|
|
2869
|
+
comment: NotionComment;
|
|
2870
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2871
|
+
/** Delete one of this person's comments. Sends `comment.deleted`. Experimental. */
|
|
2872
|
+
deleteComment(options: {
|
|
2873
|
+
comment: NotionComment;
|
|
2874
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2875
|
+
/** Resolve a discussion. Notion sends no event for it, and the API no longer lists its comments. Experimental. */
|
|
2876
|
+
resolve(options: {
|
|
2877
|
+
discussion: NotionDiscussion;
|
|
2878
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2879
|
+
/** Reopen a resolved discussion. Experimental. */
|
|
2880
|
+
reopen(options: {
|
|
2881
|
+
discussion: NotionDiscussion;
|
|
2882
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2883
|
+
/** Create a page as this person. Sends `page.created` if the integration can see it. Experimental. */
|
|
2884
|
+
createPage(page: {
|
|
2885
|
+
title: string;
|
|
2886
|
+
parent?: NotionPage;
|
|
2887
|
+
content?: string | {
|
|
2888
|
+
path: string;
|
|
2889
|
+
} | unknown[];
|
|
2890
|
+
icon?: string;
|
|
2891
|
+
connections?: NotionIntegration[];
|
|
2892
|
+
}): Promise<NotionPage>;
|
|
2893
|
+
/** Edit a page's body: append, or replace it. Sends one `page.content_updated` once Notion's batching delay is over. Experimental. */
|
|
2894
|
+
edit(change: {
|
|
2895
|
+
append?: string | {
|
|
2896
|
+
path: string;
|
|
2897
|
+
} | unknown[];
|
|
2898
|
+
replace?: string | {
|
|
2899
|
+
path: string;
|
|
2900
|
+
} | unknown[];
|
|
2901
|
+
}, options: {
|
|
2902
|
+
page: NotionPage;
|
|
2903
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2904
|
+
/** Change a page's title. Sends `page.properties_updated`. Experimental. */
|
|
2905
|
+
rename(title: string, options: {
|
|
2906
|
+
page: NotionPage;
|
|
2907
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2908
|
+
/** Mention the integration in the page body: in the block with `inBlock` in its text, or in a new paragraph. Sends `page.content_updated` after the batching delay. Experimental. */
|
|
2909
|
+
mention(integration: NotionIntegration, options: {
|
|
2910
|
+
page: NotionPage;
|
|
2911
|
+
inBlock?: string | RegExp;
|
|
2912
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2913
|
+
/** Set a property of a database row. Sends `page.properties_updated`. Experimental. */
|
|
2914
|
+
setProperty(name: string, value: NotionPropertyValue, options: {
|
|
2915
|
+
page: NotionPage;
|
|
2916
|
+
}): Promise<NotionDelivery | undefined>;
|
|
2917
|
+
/** Add a row to a database. Sends `page.created` if the integration can see the database. Experimental. */
|
|
2918
|
+
addRow(values: Record<string, NotionPropertyValue>, options: {
|
|
2919
|
+
database: NotionDatabase;
|
|
2920
|
+
}): Promise<NotionPage>;
|
|
2921
|
+
/** Connect the integration to a page (Share → Connections): it sees the page and everything under it. Experimental. */
|
|
2922
|
+
connect(integration: NotionIntegration, options: {
|
|
2923
|
+
page: NotionPage;
|
|
2924
|
+
}): Promise<void>;
|
|
2925
|
+
/** Remove the integration's connection from a page. Experimental. */
|
|
2926
|
+
disconnect(integration: NotionIntegration, options: {
|
|
2927
|
+
page: NotionPage;
|
|
2928
|
+
}): Promise<void>;
|
|
2929
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2930
|
+
[QUIET](): Promise<QuietState>;
|
|
2931
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2932
|
+
[CONTEXT](): HandleContext;
|
|
2933
|
+
}
|
|
2934
|
+
/** Wire data of a {@link NotionComment}. */
|
|
2935
|
+
export interface NotionCommentData {
|
|
2936
|
+
id: string;
|
|
2937
|
+
discussion: NotionDiscussionData;
|
|
2938
|
+
author: NotionUserData | NotionIntegrationData;
|
|
2939
|
+
text: string;
|
|
2940
|
+
createdAt: string;
|
|
2941
|
+
delivery?: NotionDeliveryData;
|
|
2942
|
+
}
|
|
2943
|
+
export declare class NotionComment {
|
|
2944
|
+
#private;
|
|
2945
|
+
readonly id: string;
|
|
2946
|
+
readonly discussion: NotionDiscussion;
|
|
2947
|
+
readonly author: NotionUser | NotionIntegration;
|
|
2948
|
+
readonly text: string;
|
|
2949
|
+
readonly createdAt: string;
|
|
2950
|
+
readonly delivery: NotionDelivery | undefined;
|
|
2951
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2952
|
+
constructor(ctx: HandleContext, data: NotionCommentData);
|
|
2953
|
+
/** The `comment.created` delivery this comment caused to this integration (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in integration's. Experimental. */
|
|
2954
|
+
deliveryFor(app: NotionIntegration): Promise<NotionDelivery | undefined>;
|
|
2955
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2956
|
+
[QUIET](): Promise<QuietState>;
|
|
2957
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2958
|
+
[CONTEXT](): HandleContext;
|
|
2959
|
+
}
|
|
2960
|
+
/** Wire data of a {@link NotionDiscussion}. */
|
|
2961
|
+
export interface NotionDiscussionData {
|
|
2962
|
+
id: string;
|
|
2963
|
+
page: NotionPageData;
|
|
2964
|
+
anchor?: string;
|
|
2965
|
+
}
|
|
2966
|
+
export declare class NotionDiscussion {
|
|
2967
|
+
#private;
|
|
2968
|
+
readonly id: string;
|
|
2969
|
+
readonly page: NotionPage;
|
|
2970
|
+
readonly anchor: string | undefined;
|
|
2971
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
2972
|
+
constructor(ctx: HandleContext, data: NotionDiscussionData);
|
|
2973
|
+
/** The discussion's comments, oldest first. Experimental. */
|
|
2974
|
+
comments(): Promise<NotionComments>;
|
|
2975
|
+
/** Whether the discussion is resolved. Experimental. */
|
|
2976
|
+
resolved(): Promise<boolean>;
|
|
2977
|
+
/** The discussion as a person reads it. Experimental. */
|
|
2978
|
+
transcript(): Promise<NotionTranscript>;
|
|
2979
|
+
/** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
2980
|
+
waitForComment(options?: {
|
|
2981
|
+
from?: NotionUser | NotionIntegration | string;
|
|
2982
|
+
} & WaitOptions): Promise<NotionComment>;
|
|
2983
|
+
/** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
|
|
2984
|
+
latestComment(options?: {
|
|
2985
|
+
from?: NotionUser | NotionIntegration | string;
|
|
2986
|
+
} & QuietOptions): Promise<NotionComment>;
|
|
2987
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
2988
|
+
[QUIET](): Promise<QuietState>;
|
|
2989
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
2990
|
+
[CONTEXT](): HandleContext;
|
|
2991
|
+
}
|
|
2992
|
+
/** Wire data of a {@link NotionPage}. */
|
|
2993
|
+
export interface NotionPageData {
|
|
2994
|
+
id: string;
|
|
2995
|
+
channel: "notion";
|
|
2996
|
+
title: string;
|
|
2997
|
+
url: string;
|
|
2998
|
+
}
|
|
2999
|
+
export declare class NotionPage {
|
|
3000
|
+
#private;
|
|
3001
|
+
readonly id: string;
|
|
3002
|
+
readonly channel: "notion";
|
|
3003
|
+
readonly title: string;
|
|
3004
|
+
readonly url: string;
|
|
3005
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3006
|
+
constructor(ctx: HandleContext, data: NotionPageData);
|
|
3007
|
+
/** The page's discussions: on the page itself, and on its blocks. Experimental. */
|
|
3008
|
+
discussions(): Promise<NotionDiscussions>;
|
|
3009
|
+
/** The page body as Markdown, once the agent is quiet. Experimental. */
|
|
3010
|
+
markdown(): Promise<string>;
|
|
3011
|
+
/** The page's blocks as the API has them, with nested blocks under `children`. Experimental. */
|
|
3012
|
+
blocks(): Promise<NotionBlocks>;
|
|
3013
|
+
/** A property's value as a person reads it: text, a number, option names, ids. Experimental. */
|
|
3014
|
+
property(name: string): Promise<NotionPropertyValue>;
|
|
3015
|
+
/** The pages directly under this page. Experimental. */
|
|
3016
|
+
children(): Promise<NotionChildPages>;
|
|
3017
|
+
/** The integrations that can see the page: connected to it or to a page above it. Experimental. */
|
|
3018
|
+
connections(): Promise<NotionConnections>;
|
|
3019
|
+
/** The page and its discussions as a person reads them. Experimental. */
|
|
3020
|
+
transcript(): Promise<NotionTranscript>;
|
|
3021
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3022
|
+
[QUIET](): Promise<QuietState>;
|
|
3023
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3024
|
+
[CONTEXT](): HandleContext;
|
|
3025
|
+
}
|
|
3026
|
+
/** Wire data of a {@link NotionDelivery}. */
|
|
3027
|
+
export interface NotionDeliveryData {
|
|
3028
|
+
id: string;
|
|
3029
|
+
channel: "notion";
|
|
3030
|
+
app: string;
|
|
3031
|
+
type: string;
|
|
3032
|
+
entity: {
|
|
3033
|
+
type: string;
|
|
3034
|
+
id: string;
|
|
3035
|
+
};
|
|
3036
|
+
payload?: unknown;
|
|
3037
|
+
attempts: DeliveryAttempt[];
|
|
3038
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3039
|
+
}
|
|
3040
|
+
export declare class NotionDelivery {
|
|
3041
|
+
#private;
|
|
3042
|
+
readonly id: string;
|
|
3043
|
+
readonly channel: "notion";
|
|
3044
|
+
readonly app: string;
|
|
3045
|
+
readonly type: string;
|
|
3046
|
+
readonly entity: {
|
|
3047
|
+
type: string;
|
|
3048
|
+
id: string;
|
|
3049
|
+
};
|
|
3050
|
+
readonly payload: unknown | undefined;
|
|
3051
|
+
readonly attempts: DeliveryAttempt[];
|
|
3052
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3053
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3054
|
+
constructor(ctx: HandleContext, data: NotionDeliveryData);
|
|
3055
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
3056
|
+
refresh(): Promise<NotionDelivery>;
|
|
3057
|
+
/** Send the same event again, as a retry does: the same body, the next `attempt_number`, signed again. Experimental. */
|
|
3058
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
3059
|
+
/** Send the delivery again, signed with a token that isn't the subscription's. Experimental. */
|
|
3060
|
+
resend(options?: {
|
|
3061
|
+
badSignature?: boolean;
|
|
3062
|
+
}): Promise<DeliveryAttempt>;
|
|
3063
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
3064
|
+
settled(options?: WaitOptions): Promise<NotionDelivery>;
|
|
3065
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3066
|
+
[QUIET](): Promise<QuietState>;
|
|
3067
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3068
|
+
[CONTEXT](): HandleContext;
|
|
3069
|
+
}
|
|
3070
|
+
/** Wire data of a {@link NotionDatabase}. */
|
|
3071
|
+
export interface NotionDatabaseData {
|
|
3072
|
+
id: string;
|
|
3073
|
+
channel: "notion";
|
|
3074
|
+
title: string;
|
|
3075
|
+
url: string;
|
|
3076
|
+
}
|
|
3077
|
+
export declare class NotionDatabase {
|
|
3078
|
+
#private;
|
|
3079
|
+
readonly id: string;
|
|
3080
|
+
readonly channel: "notion";
|
|
3081
|
+
readonly title: string;
|
|
3082
|
+
readonly url: string;
|
|
3083
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3084
|
+
constructor(ctx: HandleContext, data: NotionDatabaseData);
|
|
3085
|
+
/** The rows of a database, optionally only those whose properties have these values. Experimental. */
|
|
3086
|
+
rows(filter?: Record<string, NotionPropertyValue>): Promise<NotionRows>;
|
|
3087
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3088
|
+
[QUIET](): Promise<QuietState>;
|
|
3089
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3090
|
+
[CONTEXT](): HandleContext;
|
|
3091
|
+
}
|
|
3092
|
+
/** Wire data of a {@link ResendFixture}. */
|
|
3093
|
+
export interface ResendFixtureData {
|
|
3094
|
+
app: ResendAppData;
|
|
3095
|
+
apiUrl: string;
|
|
3096
|
+
}
|
|
3097
|
+
export declare class ResendFixture {
|
|
3098
|
+
#private;
|
|
3099
|
+
readonly app: ResendApp;
|
|
3100
|
+
readonly apiUrl: string;
|
|
3101
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3102
|
+
constructor(ctx: HandleContext, data: ResendFixtureData);
|
|
3103
|
+
/** Make another app: a team of its own, with its own address and credentials (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_RESEND_APP_<NAME>_WEBHOOK_URL. Experimental. */
|
|
3104
|
+
createApp(options: {
|
|
3105
|
+
name: string;
|
|
3106
|
+
domain?: string;
|
|
3107
|
+
}): Promise<ResendApp>;
|
|
3108
|
+
/** The teams this session used: the agent's first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
3109
|
+
apps(): Promise<ResendApps>;
|
|
3110
|
+
/** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
|
|
3111
|
+
createUser(options: {
|
|
3112
|
+
name: string;
|
|
3113
|
+
address?: string;
|
|
3114
|
+
token?: string;
|
|
3115
|
+
}): Promise<ResendUser>;
|
|
3116
|
+
/** The people this session created. Experimental. */
|
|
3117
|
+
users(): Promise<ResendUsers>;
|
|
3118
|
+
/** The threads this session's people started, oldest first. Experimental. */
|
|
3119
|
+
threads(): Promise<ResendThreads>;
|
|
3120
|
+
/** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
3121
|
+
deliveries(options?: {
|
|
3122
|
+
type?: string;
|
|
3123
|
+
resource?: ResendThread;
|
|
3124
|
+
app?: ResendApp;
|
|
3125
|
+
}): Promise<ResendDeliveries>;
|
|
3126
|
+
/** The REST calls the agent made about this session's emails, by the SDK's method name (`emails.send`). Experimental. */
|
|
3127
|
+
calls(options?: {
|
|
3128
|
+
operation?: string;
|
|
3129
|
+
error?: true | string;
|
|
3130
|
+
}): Promise<ResendApiCalls>;
|
|
3131
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
3132
|
+
waitForCall(filter?: {
|
|
3133
|
+
operation?: string;
|
|
3134
|
+
error?: true | string;
|
|
3135
|
+
}, options?: WaitOptions): Promise<ResendApiCall>;
|
|
3136
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3137
|
+
[QUIET](): Promise<QuietState>;
|
|
3138
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3139
|
+
[CONTEXT](): HandleContext;
|
|
3140
|
+
}
|
|
3141
|
+
/** Wire data of a {@link ResendApp}. */
|
|
3142
|
+
export interface ResendAppData {
|
|
3143
|
+
id: string;
|
|
3144
|
+
channel: "resend";
|
|
3145
|
+
kind: "app";
|
|
3146
|
+
name: string;
|
|
3147
|
+
botUserId: string;
|
|
3148
|
+
address: string;
|
|
3149
|
+
domain: string;
|
|
3150
|
+
apiKey: string;
|
|
3151
|
+
webhookSecret: string;
|
|
3152
|
+
}
|
|
3153
|
+
export declare class ResendApp {
|
|
3154
|
+
#private;
|
|
3155
|
+
readonly id: string;
|
|
3156
|
+
readonly channel: "resend";
|
|
3157
|
+
readonly kind: "app";
|
|
3158
|
+
readonly name: string;
|
|
3159
|
+
readonly botUserId: string;
|
|
3160
|
+
readonly address: string;
|
|
3161
|
+
readonly domain: string;
|
|
3162
|
+
readonly apiKey: string;
|
|
3163
|
+
readonly webhookSecret: string;
|
|
3164
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3165
|
+
constructor(ctx: HandleContext, data: ResendAppData);
|
|
3166
|
+
/** An app a test made sends an email, through its own team's API, as its own call would. Experimental. */
|
|
3167
|
+
send(options: {
|
|
3168
|
+
to: Array<ResendUser | ResendApp>;
|
|
3169
|
+
cc?: Array<ResendUser | ResendApp>;
|
|
3170
|
+
subject: string;
|
|
3171
|
+
text?: string;
|
|
3172
|
+
html?: string;
|
|
3173
|
+
headers?: Record<string, string>;
|
|
3174
|
+
}): Promise<ResendEmail>;
|
|
3175
|
+
/** An app a test made replies to an email, in its thread, as its own call would. Experimental. */
|
|
3176
|
+
reply(email: ResendEmail, options?: {
|
|
3177
|
+
text?: string;
|
|
3178
|
+
html?: string;
|
|
3179
|
+
all?: boolean;
|
|
3180
|
+
headers?: Record<string, string>;
|
|
3181
|
+
}): Promise<ResendEmail>;
|
|
3182
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3183
|
+
[QUIET](): Promise<QuietState>;
|
|
3184
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3185
|
+
[CONTEXT](): HandleContext;
|
|
3186
|
+
}
|
|
3187
|
+
/** Wire data of a {@link ResendEmail}. */
|
|
3188
|
+
export interface ResendEmailData {
|
|
3189
|
+
id: string;
|
|
3190
|
+
channel: "resend";
|
|
3191
|
+
thread: ResendThreadData;
|
|
3192
|
+
author: ResendPrincipal;
|
|
3193
|
+
from: string;
|
|
3194
|
+
to: string[];
|
|
3195
|
+
cc: string[];
|
|
3196
|
+
subject: string;
|
|
3197
|
+
text: string;
|
|
3198
|
+
at: string;
|
|
3199
|
+
messageId: string;
|
|
3200
|
+
headers: Record<string, string>;
|
|
3201
|
+
delivery?: ResendDeliveryData;
|
|
3202
|
+
}
|
|
3203
|
+
export declare class ResendEmail {
|
|
3204
|
+
#private;
|
|
3205
|
+
readonly id: string;
|
|
3206
|
+
readonly channel: "resend";
|
|
3207
|
+
readonly thread: ResendThread;
|
|
3208
|
+
readonly author: ResendPrincipal;
|
|
3209
|
+
readonly from: string;
|
|
3210
|
+
readonly to: string[];
|
|
3211
|
+
readonly cc: string[];
|
|
3212
|
+
readonly subject: string;
|
|
3213
|
+
readonly text: string;
|
|
3214
|
+
readonly at: string;
|
|
3215
|
+
readonly messageId: string;
|
|
3216
|
+
readonly headers: Record<string, string>;
|
|
3217
|
+
readonly delivery: ResendDelivery | undefined;
|
|
3218
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3219
|
+
constructor(ctx: HandleContext, data: ResendEmailData);
|
|
3220
|
+
/** Re-read an email. Experimental. */
|
|
3221
|
+
refresh(): Promise<ResendEmail>;
|
|
3222
|
+
/** The delivery that told this app of the email (decision 0027), or nothing when it wasn't told. Experimental. */
|
|
3223
|
+
deliveryFor(app: ResendApp): Promise<ResendDelivery | undefined>;
|
|
3224
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3225
|
+
[QUIET](): Promise<QuietState>;
|
|
3226
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3227
|
+
[CONTEXT](): HandleContext;
|
|
3228
|
+
}
|
|
3229
|
+
/** Wire data of a {@link ResendThread}. */
|
|
3230
|
+
export interface ResendThreadData {
|
|
3231
|
+
id: string;
|
|
3232
|
+
channel: "resend";
|
|
3233
|
+
subject: string;
|
|
3234
|
+
}
|
|
3235
|
+
export declare class ResendThread {
|
|
3236
|
+
#private;
|
|
3237
|
+
readonly id: string;
|
|
3238
|
+
readonly channel: "resend";
|
|
3239
|
+
readonly subject: string;
|
|
3240
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3241
|
+
constructor(ctx: HandleContext, data: ResendThreadData);
|
|
3242
|
+
/** Every email in the thread, oldest first. Experimental. */
|
|
3243
|
+
messages(): Promise<ResendMessages>;
|
|
3244
|
+
/** The thread's answers: every email after the first, oldest first. Experimental. */
|
|
3245
|
+
replies(): Promise<ResendReplies>;
|
|
3246
|
+
/** The thread as a person reads it: each email's own words, without the quoted history. Experimental. */
|
|
3247
|
+
transcript(): Promise<ResendTranscript>;
|
|
3248
|
+
/** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3249
|
+
waitForReply(options?: {
|
|
3250
|
+
from?: ResendPrincipal | string;
|
|
3251
|
+
} & WaitOptions): Promise<ResendEmail>;
|
|
3252
|
+
/** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
|
|
3253
|
+
latestReply(options?: {
|
|
3254
|
+
from?: ResendPrincipal | string;
|
|
3255
|
+
} & QuietOptions): Promise<ResendEmail>;
|
|
3256
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3257
|
+
[QUIET](): Promise<QuietState>;
|
|
3258
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3259
|
+
[CONTEXT](): HandleContext;
|
|
3260
|
+
}
|
|
3261
|
+
/** Wire data of a {@link ResendDelivery}. */
|
|
3262
|
+
export interface ResendDeliveryData {
|
|
3263
|
+
id: string;
|
|
3264
|
+
channel: "resend";
|
|
3265
|
+
app: string;
|
|
3266
|
+
type: string;
|
|
3267
|
+
email: string;
|
|
3268
|
+
payload?: unknown;
|
|
3269
|
+
attempts: DeliveryAttempt[];
|
|
3270
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3271
|
+
}
|
|
3272
|
+
export declare class ResendDelivery {
|
|
3273
|
+
#private;
|
|
3274
|
+
readonly id: string;
|
|
3275
|
+
readonly channel: "resend";
|
|
3276
|
+
readonly app: string;
|
|
3277
|
+
readonly type: string;
|
|
3278
|
+
readonly email: string;
|
|
3279
|
+
readonly payload: unknown | undefined;
|
|
3280
|
+
readonly attempts: DeliveryAttempt[];
|
|
3281
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3282
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3283
|
+
constructor(ctx: HandleContext, data: ResendDeliveryData);
|
|
3284
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
3285
|
+
refresh(): Promise<ResendDelivery>;
|
|
3286
|
+
/** Send the same webhook again, as Resend retries: the same `svix-id`, signed again. Experimental. */
|
|
3287
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
3288
|
+
/** Send the webhook again, forged: signed with a secret that isn't the webhook's, or with a timestamp past the five minutes receivers accept. Experimental. */
|
|
3289
|
+
resend(options?: {
|
|
3290
|
+
badSignature?: boolean;
|
|
3291
|
+
stale?: boolean;
|
|
3292
|
+
}): Promise<DeliveryAttempt>;
|
|
3293
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
3294
|
+
settled(options?: WaitOptions): Promise<ResendDelivery>;
|
|
3295
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3296
|
+
[QUIET](): Promise<QuietState>;
|
|
3297
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3298
|
+
[CONTEXT](): HandleContext;
|
|
3299
|
+
}
|
|
3300
|
+
/** Wire data of a {@link ResendUser}. */
|
|
3301
|
+
export interface ResendUserData {
|
|
3302
|
+
id: string;
|
|
3303
|
+
channel: "resend";
|
|
3304
|
+
kind: "user";
|
|
3305
|
+
name: string;
|
|
3306
|
+
address: string;
|
|
3307
|
+
}
|
|
3308
|
+
export declare class ResendUser {
|
|
3309
|
+
#private;
|
|
3310
|
+
readonly id: string;
|
|
3311
|
+
readonly channel: "resend";
|
|
3312
|
+
readonly kind: "user";
|
|
3313
|
+
readonly name: string;
|
|
3314
|
+
readonly address: string;
|
|
3315
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3316
|
+
constructor(ctx: HandleContext, data: ResendUserData);
|
|
3317
|
+
/** The person emails someone: the agent (`resend.app`), another app, or another person. Experimental. */
|
|
3318
|
+
send(options: {
|
|
3319
|
+
to: Array<ResendUser | ResendApp>;
|
|
3320
|
+
cc?: Array<ResendUser | ResendApp>;
|
|
3321
|
+
subject: string;
|
|
3322
|
+
text?: string;
|
|
3323
|
+
html?: string;
|
|
3324
|
+
}): Promise<ResendEmail>;
|
|
3325
|
+
/** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
|
|
3326
|
+
reply(email: ResendEmail, options?: {
|
|
3327
|
+
text?: string;
|
|
3328
|
+
html?: string;
|
|
3329
|
+
all?: boolean;
|
|
3330
|
+
}): Promise<ResendEmail>;
|
|
3331
|
+
/** What reached the person's mailbox, oldest first. Experimental. */
|
|
3332
|
+
inbox(): Promise<ResendInbox>;
|
|
3333
|
+
/** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3334
|
+
waitForEmail(options?: {
|
|
3335
|
+
from?: ResendPrincipal | string;
|
|
3336
|
+
} & WaitOptions): Promise<ResendEmail>;
|
|
3337
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3338
|
+
[QUIET](): Promise<QuietState>;
|
|
3339
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3340
|
+
[CONTEXT](): HandleContext;
|
|
3341
|
+
}
|
|
3342
|
+
/** Wire data of a {@link GoogleFixture}. */
|
|
3343
|
+
export interface GoogleFixtureData {
|
|
3344
|
+
app: GoogleAppData;
|
|
3345
|
+
apiUrl: string;
|
|
3346
|
+
}
|
|
3347
|
+
export declare class GoogleFixture {
|
|
3348
|
+
#private;
|
|
3349
|
+
readonly app: GoogleApp;
|
|
3350
|
+
readonly apiUrl: string;
|
|
3351
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3352
|
+
constructor(ctx: HandleContext, data: GoogleFixtureData);
|
|
3353
|
+
/** Make another app: a mailbox of its own, with its own address and credentials (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_GOOGLE_APP_<NAME>_WEBHOOK_URL. Experimental. */
|
|
3354
|
+
createApp(options: {
|
|
3355
|
+
name: string;
|
|
3356
|
+
}): Promise<GoogleApp>;
|
|
3357
|
+
/** The mailboxs this session used: the agent's first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
3358
|
+
apps(): Promise<GoogleApps>;
|
|
3359
|
+
/** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
|
|
3360
|
+
createUser(options: {
|
|
3361
|
+
name: string;
|
|
3362
|
+
address?: string;
|
|
3363
|
+
token?: string;
|
|
3364
|
+
}): Promise<GoogleUser>;
|
|
3365
|
+
/** The people this session created. Experimental. */
|
|
3366
|
+
users(): Promise<GoogleUsers>;
|
|
3367
|
+
/** The threads this session's people started, oldest first. Experimental. */
|
|
3368
|
+
threads(): Promise<GoogleThreads>;
|
|
3369
|
+
/** Every push channelstack sent the agent for this session, with every attempt. Experimental. */
|
|
3370
|
+
deliveries(options?: {
|
|
3371
|
+
type?: string;
|
|
3372
|
+
resource?: GoogleThread;
|
|
3373
|
+
app?: GoogleApp;
|
|
3374
|
+
}): Promise<GoogleDeliveries>;
|
|
3375
|
+
/** The Gmail calls the agent made about this session's mail, by the SDK's method name (`users.messages.send`). Experimental. */
|
|
3376
|
+
calls(options?: {
|
|
3377
|
+
operation?: string;
|
|
3378
|
+
error?: true | string;
|
|
3379
|
+
}): Promise<GoogleApiCalls>;
|
|
3380
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
3381
|
+
waitForCall(filter?: {
|
|
3382
|
+
operation?: string;
|
|
3383
|
+
error?: true | string;
|
|
3384
|
+
}, options?: WaitOptions): Promise<GoogleApiCall>;
|
|
3385
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3386
|
+
[QUIET](): Promise<QuietState>;
|
|
3387
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3388
|
+
[CONTEXT](): HandleContext;
|
|
3389
|
+
}
|
|
3390
|
+
/** Wire data of a {@link GoogleApp}. */
|
|
3391
|
+
export interface GoogleAppData {
|
|
3392
|
+
id: string;
|
|
3393
|
+
channel: "google";
|
|
3394
|
+
kind: "app";
|
|
3395
|
+
name: string;
|
|
3396
|
+
botUserId: string;
|
|
3397
|
+
address: string;
|
|
3398
|
+
clientId: string;
|
|
3399
|
+
clientSecret: string;
|
|
3400
|
+
refreshToken: string;
|
|
3401
|
+
}
|
|
3402
|
+
export declare class GoogleApp {
|
|
3403
|
+
#private;
|
|
3404
|
+
readonly id: string;
|
|
3405
|
+
readonly channel: "google";
|
|
3406
|
+
readonly kind: "app";
|
|
3407
|
+
readonly name: string;
|
|
3408
|
+
readonly botUserId: string;
|
|
3409
|
+
readonly address: string;
|
|
3410
|
+
readonly clientId: string;
|
|
3411
|
+
readonly clientSecret: string;
|
|
3412
|
+
readonly refreshToken: string;
|
|
3413
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3414
|
+
constructor(ctx: HandleContext, data: GoogleAppData);
|
|
3415
|
+
/** An app a test made sends an email, through its own mailbox's API, as its own call would. Experimental. */
|
|
3416
|
+
send(options: {
|
|
3417
|
+
to: Array<GoogleUser | GoogleApp>;
|
|
3418
|
+
cc?: Array<GoogleUser | GoogleApp>;
|
|
3419
|
+
subject: string;
|
|
3420
|
+
text?: string;
|
|
3421
|
+
html?: string;
|
|
3422
|
+
headers?: Record<string, string>;
|
|
3423
|
+
}): Promise<GoogleEmail>;
|
|
3424
|
+
/** An app a test made replies to an email, in its thread, as its own call would. Experimental. */
|
|
3425
|
+
reply(email: GoogleEmail, options?: {
|
|
3426
|
+
text?: string;
|
|
3427
|
+
html?: string;
|
|
3428
|
+
all?: boolean;
|
|
3429
|
+
headers?: Record<string, string>;
|
|
3430
|
+
}): Promise<GoogleEmail>;
|
|
3431
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3432
|
+
[QUIET](): Promise<QuietState>;
|
|
3433
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3434
|
+
[CONTEXT](): HandleContext;
|
|
3435
|
+
}
|
|
3436
|
+
/** Wire data of a {@link GoogleEmail}. */
|
|
3437
|
+
export interface GoogleEmailData {
|
|
3438
|
+
id: string;
|
|
3439
|
+
channel: "google";
|
|
3440
|
+
thread: GoogleThreadData;
|
|
3441
|
+
author: GooglePrincipal;
|
|
3442
|
+
from: string;
|
|
3443
|
+
to: string[];
|
|
3444
|
+
cc: string[];
|
|
3445
|
+
subject: string;
|
|
3446
|
+
text: string;
|
|
3447
|
+
at: string;
|
|
3448
|
+
messageId: string;
|
|
3449
|
+
headers: Record<string, string>;
|
|
3450
|
+
labels: string[];
|
|
3451
|
+
delivery?: GoogleDeliveryData;
|
|
3452
|
+
}
|
|
3453
|
+
export declare class GoogleEmail {
|
|
3454
|
+
#private;
|
|
3455
|
+
readonly id: string;
|
|
3456
|
+
readonly channel: "google";
|
|
3457
|
+
readonly thread: GoogleThread;
|
|
3458
|
+
readonly author: GooglePrincipal;
|
|
3459
|
+
readonly from: string;
|
|
3460
|
+
readonly to: string[];
|
|
3461
|
+
readonly cc: string[];
|
|
3462
|
+
readonly subject: string;
|
|
3463
|
+
readonly text: string;
|
|
3464
|
+
readonly at: string;
|
|
3465
|
+
readonly messageId: string;
|
|
3466
|
+
readonly headers: Record<string, string>;
|
|
3467
|
+
readonly labels: string[];
|
|
3468
|
+
readonly delivery: GoogleDelivery | undefined;
|
|
3469
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3470
|
+
constructor(ctx: HandleContext, data: GoogleEmailData);
|
|
3471
|
+
/** Re-read an email. Experimental. */
|
|
3472
|
+
refresh(): Promise<GoogleEmail>;
|
|
3473
|
+
/** The delivery that told this app of the email (decision 0027), or nothing when it wasn't told. Experimental. */
|
|
3474
|
+
deliveryFor(app: GoogleApp): Promise<GoogleDelivery | undefined>;
|
|
3475
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3476
|
+
[QUIET](): Promise<QuietState>;
|
|
3477
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3478
|
+
[CONTEXT](): HandleContext;
|
|
3479
|
+
}
|
|
3480
|
+
/** Wire data of a {@link GoogleThread}. */
|
|
3481
|
+
export interface GoogleThreadData {
|
|
3482
|
+
id: string;
|
|
3483
|
+
channel: "google";
|
|
3484
|
+
subject: string;
|
|
3485
|
+
}
|
|
3486
|
+
export declare class GoogleThread {
|
|
3487
|
+
#private;
|
|
3488
|
+
readonly id: string;
|
|
3489
|
+
readonly channel: "google";
|
|
3490
|
+
readonly subject: string;
|
|
3491
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3492
|
+
constructor(ctx: HandleContext, data: GoogleThreadData);
|
|
3493
|
+
/** Every email in the thread, oldest first. Experimental. */
|
|
3494
|
+
messages(): Promise<GoogleMessages>;
|
|
3495
|
+
/** The thread's answers: every email after the first, oldest first. Experimental. */
|
|
3496
|
+
replies(): Promise<GoogleReplies>;
|
|
3497
|
+
/** The thread as a person reads it: each email's own words, without the quoted history. Experimental. */
|
|
3498
|
+
transcript(): Promise<GoogleTranscript>;
|
|
3499
|
+
/** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3500
|
+
waitForReply(options?: {
|
|
3501
|
+
from?: GooglePrincipal | string;
|
|
3502
|
+
} & WaitOptions): Promise<GoogleEmail>;
|
|
3503
|
+
/** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
|
|
3504
|
+
latestReply(options?: {
|
|
3505
|
+
from?: GooglePrincipal | string;
|
|
3506
|
+
} & QuietOptions): Promise<GoogleEmail>;
|
|
3507
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3508
|
+
[QUIET](): Promise<QuietState>;
|
|
3509
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3510
|
+
[CONTEXT](): HandleContext;
|
|
3511
|
+
}
|
|
3512
|
+
/** Wire data of a {@link GoogleDelivery}. */
|
|
3513
|
+
export interface GoogleDeliveryData {
|
|
3514
|
+
id: string;
|
|
3515
|
+
channel: "google";
|
|
3516
|
+
app: string;
|
|
3517
|
+
type: string;
|
|
3518
|
+
emailAddress: string;
|
|
3519
|
+
historyId: string;
|
|
3520
|
+
payload?: unknown;
|
|
3521
|
+
attempts: DeliveryAttempt[];
|
|
3522
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3523
|
+
}
|
|
3524
|
+
export declare class GoogleDelivery {
|
|
3525
|
+
#private;
|
|
3526
|
+
readonly id: string;
|
|
3527
|
+
readonly channel: "google";
|
|
3528
|
+
readonly app: string;
|
|
3529
|
+
readonly type: string;
|
|
3530
|
+
readonly emailAddress: string;
|
|
3531
|
+
readonly historyId: string;
|
|
3532
|
+
readonly payload: unknown | undefined;
|
|
3533
|
+
readonly attempts: DeliveryAttempt[];
|
|
3534
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3535
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3536
|
+
constructor(ctx: HandleContext, data: GoogleDeliveryData);
|
|
3537
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
3538
|
+
refresh(): Promise<GoogleDelivery>;
|
|
3539
|
+
/** Push the same message again, as Pub/Sub does when a push isn't acknowledged: the same message id. Experimental. */
|
|
3540
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
3541
|
+
/** Push it again, forged: with a token signed by another key, one that has expired, or one for another audience than the push endpoint. Experimental. */
|
|
3542
|
+
resend(options?: {
|
|
3543
|
+
badSignature?: boolean;
|
|
3544
|
+
stale?: boolean;
|
|
3545
|
+
wrongAudience?: boolean;
|
|
3546
|
+
}): Promise<DeliveryAttempt>;
|
|
3547
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
3548
|
+
settled(options?: WaitOptions): Promise<GoogleDelivery>;
|
|
3549
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3550
|
+
[QUIET](): Promise<QuietState>;
|
|
3551
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3552
|
+
[CONTEXT](): HandleContext;
|
|
3553
|
+
}
|
|
3554
|
+
/** Wire data of a {@link GoogleUser}. */
|
|
3555
|
+
export interface GoogleUserData {
|
|
3556
|
+
id: string;
|
|
3557
|
+
channel: "google";
|
|
3558
|
+
kind: "user";
|
|
3559
|
+
name: string;
|
|
3560
|
+
address: string;
|
|
3561
|
+
}
|
|
3562
|
+
export declare class GoogleUser {
|
|
3563
|
+
#private;
|
|
3564
|
+
readonly id: string;
|
|
3565
|
+
readonly channel: "google";
|
|
3566
|
+
readonly kind: "user";
|
|
3567
|
+
readonly name: string;
|
|
3568
|
+
readonly address: string;
|
|
3569
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3570
|
+
constructor(ctx: HandleContext, data: GoogleUserData);
|
|
3571
|
+
/** The person emails someone: the agent (`google.app`), another app, or another person. Experimental. */
|
|
3572
|
+
send(options: {
|
|
3573
|
+
to: Array<GoogleUser | GoogleApp>;
|
|
3574
|
+
cc?: Array<GoogleUser | GoogleApp>;
|
|
3575
|
+
subject: string;
|
|
3576
|
+
text?: string;
|
|
3577
|
+
html?: string;
|
|
3578
|
+
}): Promise<GoogleEmail>;
|
|
3579
|
+
/** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
|
|
3580
|
+
reply(email: GoogleEmail, options?: {
|
|
3581
|
+
text?: string;
|
|
3582
|
+
html?: string;
|
|
3583
|
+
all?: boolean;
|
|
3584
|
+
}): Promise<GoogleEmail>;
|
|
3585
|
+
/** What reached the person's mailbox, oldest first. Experimental. */
|
|
3586
|
+
inbox(): Promise<GoogleInbox>;
|
|
3587
|
+
/** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3588
|
+
waitForEmail(options?: {
|
|
3589
|
+
from?: GooglePrincipal | string;
|
|
3590
|
+
} & WaitOptions): Promise<GoogleEmail>;
|
|
3591
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3592
|
+
[QUIET](): Promise<QuietState>;
|
|
3593
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3594
|
+
[CONTEXT](): HandleContext;
|
|
3595
|
+
}
|
|
3596
|
+
/** Wire data of a {@link DiscordFixture}. */
|
|
3597
|
+
export interface DiscordFixtureData {
|
|
3598
|
+
app: DiscordAppData;
|
|
3599
|
+
apiUrl: string;
|
|
3600
|
+
guild: DiscordGuild;
|
|
3601
|
+
gatewayConnections: number;
|
|
3602
|
+
}
|
|
3603
|
+
export declare class DiscordFixture {
|
|
3604
|
+
#private;
|
|
3605
|
+
readonly app: DiscordApp;
|
|
3606
|
+
readonly apiUrl: string;
|
|
3607
|
+
readonly guild: DiscordGuild;
|
|
3608
|
+
readonly gatewayConnections: number;
|
|
3609
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3610
|
+
constructor(ctx: HandleContext, data: DiscordFixtureData);
|
|
3611
|
+
/** Create a person in the guild. Experimental. */
|
|
3612
|
+
createUser(options: {
|
|
3613
|
+
name: string;
|
|
3614
|
+
id?: string;
|
|
3615
|
+
admin?: boolean;
|
|
3616
|
+
bot?: boolean;
|
|
3617
|
+
token?: string;
|
|
3618
|
+
}): Promise<DiscordUser>;
|
|
3619
|
+
/** The people this session created. Experimental. */
|
|
3620
|
+
users(): Promise<DiscordUsers>;
|
|
3621
|
+
/** Make another app in the guild, with its own application, bot user, token and Ed25519 key (decision 0027), or return the one made with this name and settings. Its bot connects to the Gateway with its own token; its interactions go to CHANNELSTACK_DISCORD_APP_<NAME>_WEBHOOK_URL, or over its Gateway connection. Experimental. */
|
|
3622
|
+
createApp(options: {
|
|
3623
|
+
name: string;
|
|
3624
|
+
privilegedIntents?: Array<"GUILD_MEMBERS" | "GUILD_PRESENCES" | "MESSAGE_CONTENT">;
|
|
3625
|
+
}): Promise<DiscordApp>;
|
|
3626
|
+
/** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
|
|
3627
|
+
apps(): Promise<DiscordApps>;
|
|
3628
|
+
/** Create a text channel. Only the listed participants see it (a private channel); include the app for the bot to hear it. Experimental. */
|
|
3629
|
+
createChannel(options?: {
|
|
3630
|
+
name?: string;
|
|
3631
|
+
participants?: Array<DiscordUser | DiscordApp>;
|
|
3632
|
+
readOnly?: boolean;
|
|
3633
|
+
topic?: string;
|
|
3634
|
+
}): Promise<DiscordChannel>;
|
|
3635
|
+
/** The session's channels, threads and DMs. Experimental. */
|
|
3636
|
+
channels(): Promise<DiscordChannels>;
|
|
3637
|
+
/** Discord's check of the app's interactions endpoint, as when it is saved in the developer portal: a PING it must answer with a PONG, and one with a bad signature it must refuse with 401. Experimental. */
|
|
3638
|
+
verifyEndpoint(): Promise<DiscordEndpointCheck>;
|
|
3639
|
+
/** Every Gateway dispatch and interaction channelstack sent the bot for this session, with every attempt. Experimental. */
|
|
3640
|
+
deliveries(options?: {
|
|
3641
|
+
type?: string;
|
|
3642
|
+
resource?: DiscordChannel;
|
|
3643
|
+
app?: DiscordApp;
|
|
3644
|
+
}): Promise<DiscordDeliveries>;
|
|
3645
|
+
/** The REST calls the bot made about this session's channels, messages and interactions, by route (`POST /channels/{channel.id}/messages`). Calls about nothing a session owns (`GET /gateway/bot`) are in no session. Experimental. */
|
|
3646
|
+
calls(options?: {
|
|
3647
|
+
operation?: string;
|
|
3648
|
+
error?: true | string;
|
|
3649
|
+
}): Promise<DiscordApiCalls>;
|
|
3650
|
+
/** Inject a fault: rate-limit the bot's calls of a route (removed when this session closes), or drop its Gateway connection just before the next dispatch. Experimental. */
|
|
3651
|
+
fault(options: {
|
|
3652
|
+
type: "rate_limit" | "drop_gateway";
|
|
3653
|
+
route?: string;
|
|
3654
|
+
retryAfter?: Duration;
|
|
3655
|
+
times?: number;
|
|
3656
|
+
app?: DiscordApp;
|
|
3657
|
+
}): Promise<DiscordFault>;
|
|
3658
|
+
/** Wait for the next new API call from the agent, after the last one this handle saw. */
|
|
3659
|
+
waitForCall(filter?: {
|
|
3660
|
+
operation?: string;
|
|
3661
|
+
error?: true | string;
|
|
3662
|
+
}, options?: WaitOptions): Promise<DiscordApiCall>;
|
|
3663
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3664
|
+
[QUIET](): Promise<QuietState>;
|
|
3665
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3666
|
+
[CONTEXT](): HandleContext;
|
|
3667
|
+
}
|
|
3668
|
+
/** Wire data of a {@link DiscordApp}. */
|
|
3669
|
+
export interface DiscordAppData {
|
|
3670
|
+
id: string;
|
|
3671
|
+
name: string;
|
|
3672
|
+
kind: "app";
|
|
3673
|
+
channel: "discord";
|
|
3674
|
+
botUserId: string;
|
|
3675
|
+
botToken: string;
|
|
3676
|
+
publicKey: string;
|
|
3677
|
+
guildId: string;
|
|
3678
|
+
}
|
|
3679
|
+
export declare class DiscordApp {
|
|
3680
|
+
#private;
|
|
3681
|
+
readonly id: string;
|
|
3682
|
+
readonly name: string;
|
|
3683
|
+
readonly kind: "app";
|
|
3684
|
+
readonly channel: "discord";
|
|
3685
|
+
readonly botUserId: string;
|
|
3686
|
+
readonly botToken: string;
|
|
3687
|
+
readonly publicKey: string;
|
|
3688
|
+
readonly guildId: string;
|
|
3689
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3690
|
+
constructor(ctx: HandleContext, data: DiscordAppData);
|
|
3691
|
+
/** An app a test made writes, as its own `POST /channels/{id}/messages` would: in a channel or thread its bot sees, or in a DM with the person in `to`. No bot writes to another bot in a DM (50007). Experimental. */
|
|
3692
|
+
say(text: string | DiscordMessageInput, options?: {
|
|
3693
|
+
channel?: DiscordChannel;
|
|
3694
|
+
to?: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>;
|
|
3695
|
+
}): Promise<DiscordMessage>;
|
|
3696
|
+
/** An app a test made replies to a message: Discord's reply, in the message's channel, which quotes it. Experimental. */
|
|
3697
|
+
reply(text: string | DiscordMessageInput, options: {
|
|
3698
|
+
message: DiscordMessage;
|
|
3699
|
+
}): Promise<DiscordMessage>;
|
|
3700
|
+
/** An app a test made reacts to a message. Experimental. */
|
|
3701
|
+
react(emoji: string, options: {
|
|
3702
|
+
message: DiscordMessage;
|
|
3703
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3704
|
+
/** An app a test made takes its reaction back. Experimental. */
|
|
3705
|
+
unreact(emoji: string, options: {
|
|
3706
|
+
message: DiscordMessage;
|
|
3707
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3708
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3709
|
+
[QUIET](): Promise<QuietState>;
|
|
3710
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3711
|
+
[CONTEXT](): HandleContext;
|
|
3712
|
+
}
|
|
3713
|
+
/** Wire data of a {@link DiscordUser}. */
|
|
3714
|
+
export interface DiscordUserData {
|
|
3715
|
+
id: string;
|
|
3716
|
+
name: string;
|
|
3717
|
+
kind: "user";
|
|
3718
|
+
channel: "discord";
|
|
3719
|
+
username: string;
|
|
3720
|
+
isAdmin: boolean;
|
|
3721
|
+
isBot: boolean;
|
|
3722
|
+
}
|
|
3723
|
+
export declare class DiscordUser {
|
|
3724
|
+
#private;
|
|
3725
|
+
readonly id: string;
|
|
3726
|
+
readonly name: string;
|
|
3727
|
+
readonly kind: "user";
|
|
3728
|
+
readonly channel: "discord";
|
|
3729
|
+
readonly username: string;
|
|
3730
|
+
readonly isAdmin: boolean;
|
|
3731
|
+
readonly isBot: boolean;
|
|
3732
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3733
|
+
constructor(ctx: HandleContext, data: DiscordUserData);
|
|
3734
|
+
/** Write a message in a channel or thread, or in a DM with the person or app in `to`. Experimental. */
|
|
3735
|
+
say(text: string | DiscordMessageInput, options?: {
|
|
3736
|
+
channel?: DiscordChannel;
|
|
3737
|
+
to?: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>;
|
|
3738
|
+
}): Promise<DiscordMessage>;
|
|
3739
|
+
/** Reply to a message: Discord's reply, in the message's channel, which quotes it. Experimental. */
|
|
3740
|
+
reply(text: string | DiscordMessageInput, options: {
|
|
3741
|
+
message: DiscordMessage;
|
|
3742
|
+
}): Promise<DiscordMessage>;
|
|
3743
|
+
/** Edit one of this person's own messages. Experimental. */
|
|
3744
|
+
edit(text: string | DiscordMessageInput, options: {
|
|
3745
|
+
message: DiscordMessage;
|
|
3746
|
+
}): Promise<DiscordMessage>;
|
|
3747
|
+
/** Delete a message: this person's own, or anyone's for an admin. Experimental. */
|
|
3748
|
+
delete(options: {
|
|
3749
|
+
message: DiscordMessage;
|
|
3750
|
+
}): Promise<void>;
|
|
3751
|
+
/** React to a message with an emoji. Experimental. */
|
|
3752
|
+
react(emoji: string, options: {
|
|
3753
|
+
message: DiscordMessage;
|
|
3754
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3755
|
+
/** Take this person's reaction off a message. Experimental. */
|
|
3756
|
+
unreact(emoji: string, options: {
|
|
3757
|
+
message: DiscordMessage;
|
|
3758
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3759
|
+
/** Start a thread: from a message, or in a channel. Experimental. */
|
|
3760
|
+
startThread(name: string, options?: {
|
|
3761
|
+
message?: DiscordMessage;
|
|
3762
|
+
channel?: DiscordChannel;
|
|
3763
|
+
}): Promise<DiscordChannel>;
|
|
3764
|
+
/** Open (or reuse) a DM with the app or another person. Experimental. */
|
|
3765
|
+
openDM(participant: DiscordUser | DiscordApp): Promise<DiscordChannel>;
|
|
3766
|
+
/** Let people or the app see a channel. The person must be an admin. Experimental. */
|
|
3767
|
+
invite(participants: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>, options: {
|
|
3768
|
+
channel: DiscordChannel;
|
|
3769
|
+
}): Promise<void>;
|
|
3770
|
+
/** Run one of an app's slash commands in a channel, e.g. `/deploy web staging` or `/deploy service:web`: the built-in app's, or `app`'s, as a person picks one app's command when several have it. Experimental. */
|
|
3771
|
+
runCommand(command: string, options: {
|
|
3772
|
+
channel: DiscordChannel;
|
|
3773
|
+
app?: DiscordApp;
|
|
3774
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3775
|
+
/** Press a button, found by its label or custom_id: on a message, or on the app's newest message in a channel or thread that has it. Experimental. */
|
|
3776
|
+
click(button: string | DiscordButtonRef, options?: {
|
|
3777
|
+
message?: DiscordMessage;
|
|
3778
|
+
channel?: DiscordChannel;
|
|
3779
|
+
}): Promise<DiscordDelivery | undefined>;
|
|
3780
|
+
/** Messages only this person sees: the app's ephemeral responses, and "This interaction failed". Experimental. */
|
|
3781
|
+
ephemeral(): Promise<DiscordEphemeralMessages>;
|
|
3782
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3783
|
+
[QUIET](): Promise<QuietState>;
|
|
3784
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3785
|
+
[CONTEXT](): HandleContext;
|
|
3786
|
+
}
|
|
3787
|
+
/** Wire data of a {@link DiscordMessage}. */
|
|
3788
|
+
export interface DiscordMessageData {
|
|
3789
|
+
id: string;
|
|
3790
|
+
channelId: string;
|
|
3791
|
+
channel: DiscordChannelData;
|
|
3792
|
+
author: DiscordUserData | DiscordAppData;
|
|
3793
|
+
text: string;
|
|
3794
|
+
content: string;
|
|
3795
|
+
embeds: unknown[];
|
|
3796
|
+
components: unknown[];
|
|
3797
|
+
postedAt: string;
|
|
3798
|
+
edited: boolean;
|
|
3799
|
+
replyTo?: string;
|
|
3800
|
+
thread?: DiscordChannelData;
|
|
3801
|
+
visibleTo?: DiscordUserData;
|
|
3802
|
+
delivery?: DiscordDeliveryData;
|
|
3803
|
+
}
|
|
3804
|
+
export declare class DiscordMessage {
|
|
3805
|
+
#private;
|
|
3806
|
+
readonly id: string;
|
|
3807
|
+
readonly channelId: string;
|
|
3808
|
+
readonly channel: DiscordChannel;
|
|
3809
|
+
readonly author: DiscordUser | DiscordApp;
|
|
3810
|
+
readonly text: string;
|
|
3811
|
+
readonly content: string;
|
|
3812
|
+
readonly embeds: unknown[];
|
|
3813
|
+
readonly components: unknown[];
|
|
3814
|
+
readonly postedAt: string;
|
|
3815
|
+
readonly edited: boolean;
|
|
3816
|
+
readonly replyTo: string | undefined;
|
|
3817
|
+
readonly thread: DiscordChannel | undefined;
|
|
3818
|
+
readonly visibleTo: DiscordUser | undefined;
|
|
3819
|
+
readonly delivery: DiscordDelivery | undefined;
|
|
3820
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3821
|
+
constructor(ctx: HandleContext, data: DiscordMessageData);
|
|
3822
|
+
/** Re-read a message: its latest text, edits and thread. Experimental. */
|
|
3823
|
+
refresh(): Promise<DiscordMessage>;
|
|
3824
|
+
/** What answers a message, oldest first: Discord's replies to it, and the messages of the thread started from it. Experimental. */
|
|
3825
|
+
replies(): Promise<DiscordReplies>;
|
|
3826
|
+
/** A message and what answers it, as a person reads them. Experimental. */
|
|
3827
|
+
transcript(options?: {
|
|
3828
|
+
as?: DiscordUser | DiscordApp;
|
|
3829
|
+
}): Promise<DiscordTranscript>;
|
|
3830
|
+
/** The reactions on a message, and who added each. Experimental. */
|
|
3831
|
+
reactions(): Promise<DiscordReactions>;
|
|
3832
|
+
/** The first Gateway dispatch this message caused to this app's bot (decision 0027), or nothing when it wasn't told. Experimental. */
|
|
3833
|
+
deliveryFor(app: DiscordApp): Promise<DiscordDelivery | undefined>;
|
|
3834
|
+
/** Every Gateway dispatch this message caused to the apps' bots. Experimental. */
|
|
3835
|
+
deliveries(): Promise<DiscordMessageDeliveries>;
|
|
3836
|
+
/** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3837
|
+
waitForReply(options?: {
|
|
3838
|
+
from?: DiscordUser | DiscordApp | string;
|
|
3839
|
+
} & WaitOptions): Promise<DiscordMessage>;
|
|
3840
|
+
/** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
|
|
3841
|
+
latestReply(options?: {
|
|
3842
|
+
from?: DiscordUser | DiscordApp | string;
|
|
3843
|
+
} & QuietOptions): Promise<DiscordMessage>;
|
|
3844
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3845
|
+
[QUIET](): Promise<QuietState>;
|
|
3846
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3847
|
+
[CONTEXT](): HandleContext;
|
|
3848
|
+
}
|
|
3849
|
+
/** Wire data of a {@link DiscordChannel}. */
|
|
3850
|
+
export interface DiscordChannelData {
|
|
3851
|
+
id: string;
|
|
3852
|
+
kind: "text" | "dm" | "public_thread";
|
|
3853
|
+
channel: "discord";
|
|
3854
|
+
name?: string;
|
|
3855
|
+
parentId?: string;
|
|
3856
|
+
starterId?: string;
|
|
3857
|
+
}
|
|
3858
|
+
export declare class DiscordChannel {
|
|
3859
|
+
#private;
|
|
3860
|
+
readonly id: string;
|
|
3861
|
+
readonly kind: "text" | "dm" | "public_thread";
|
|
3862
|
+
readonly channel: "discord";
|
|
3863
|
+
readonly name: string | undefined;
|
|
3864
|
+
readonly parentId: string | undefined;
|
|
3865
|
+
readonly starterId: string | undefined;
|
|
3866
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3867
|
+
constructor(ctx: HandleContext, data: DiscordChannelData);
|
|
3868
|
+
/** A channel's or thread's messages, oldest first. Experimental. */
|
|
3869
|
+
messages(): Promise<DiscordMessages>;
|
|
3870
|
+
/** Who sees a channel: a text channel's participants, a DM's two ends; a thread's are its channel's. Admins see every channel without being listed. Experimental. */
|
|
3871
|
+
members(): Promise<DiscordMembers>;
|
|
3872
|
+
/** The threads in a channel. Experimental. */
|
|
3873
|
+
threads(): Promise<DiscordThreads>;
|
|
3874
|
+
/** A channel or thread as a person reads it, each thread under the message that starts it. Experimental. */
|
|
3875
|
+
transcript(options?: {
|
|
3876
|
+
as?: DiscordUser | DiscordApp;
|
|
3877
|
+
}): Promise<DiscordTranscript>;
|
|
3878
|
+
/** Wait for the next new message matching `from` (anyone if omitted), after the last one this handle saw. */
|
|
3879
|
+
waitForMessage(options?: {
|
|
3880
|
+
from?: DiscordUser | DiscordApp | string;
|
|
3881
|
+
} & WaitOptions): Promise<DiscordMessage>;
|
|
3882
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3883
|
+
[QUIET](): Promise<QuietState>;
|
|
3884
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3885
|
+
[CONTEXT](): HandleContext;
|
|
3886
|
+
}
|
|
3887
|
+
/** Wire data of a {@link DiscordDelivery}. */
|
|
3888
|
+
export interface DiscordDeliveryData {
|
|
3889
|
+
id: string;
|
|
3890
|
+
channel: "discord";
|
|
3891
|
+
app: string;
|
|
3892
|
+
type: string;
|
|
3893
|
+
payload?: unknown;
|
|
3894
|
+
attempts: DeliveryAttempt[];
|
|
3895
|
+
status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3896
|
+
}
|
|
3897
|
+
export declare class DiscordDelivery {
|
|
3898
|
+
#private;
|
|
3899
|
+
readonly id: string;
|
|
3900
|
+
readonly channel: "discord";
|
|
3901
|
+
readonly app: string;
|
|
3902
|
+
readonly type: string;
|
|
3903
|
+
readonly payload: unknown | undefined;
|
|
3904
|
+
readonly attempts: DeliveryAttempt[];
|
|
3905
|
+
readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
|
|
3906
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3907
|
+
constructor(ctx: HandleContext, data: DiscordDeliveryData);
|
|
3908
|
+
/** Re-read a delivery: its attempts and status. Experimental. */
|
|
3909
|
+
refresh(): Promise<DiscordDelivery>;
|
|
3910
|
+
/** Dispatch the same event to the bot again, as a replay after a RESUME would. Experimental. */
|
|
3911
|
+
redeliver(): Promise<DeliveryAttempt>;
|
|
3912
|
+
/** Send an interaction again, forged: signed with a key that isn't the app's, which its endpoint must refuse with 401. Experimental. */
|
|
3913
|
+
resend(options?: {
|
|
3914
|
+
badSignature?: boolean;
|
|
3915
|
+
}): Promise<DeliveryAttempt>;
|
|
3916
|
+
/** Wait for the delivery to settle, and resolve with the value as it is then. */
|
|
3917
|
+
settled(options?: WaitOptions): Promise<DiscordDelivery>;
|
|
3918
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3919
|
+
[QUIET](): Promise<QuietState>;
|
|
3920
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3921
|
+
[CONTEXT](): HandleContext;
|
|
3922
|
+
}
|
|
3923
|
+
/** Wire data of a {@link DiscordFault}. */
|
|
3924
|
+
export interface DiscordFaultData {
|
|
3925
|
+
id: string;
|
|
3926
|
+
}
|
|
3927
|
+
export declare class DiscordFault implements AsyncDisposable {
|
|
3928
|
+
#private;
|
|
3929
|
+
readonly id: string;
|
|
3930
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3931
|
+
constructor(ctx: HandleContext, data: DiscordFaultData);
|
|
3932
|
+
/** Remove a fault. Experimental. */
|
|
3933
|
+
undo(): Promise<void>;
|
|
3934
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
3935
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3936
|
+
[QUIET](): Promise<QuietState>;
|
|
3937
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3938
|
+
[CONTEXT](): HandleContext;
|
|
3939
|
+
}
|
|
3940
|
+
/** Wire data of a {@link OpenAIFixture}. */
|
|
3941
|
+
export interface OpenAIFixtureData {
|
|
3942
|
+
baseUrl: string;
|
|
3943
|
+
}
|
|
3944
|
+
export declare class OpenAIFixture {
|
|
3945
|
+
#private;
|
|
3946
|
+
readonly baseUrl: string;
|
|
3947
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
3948
|
+
constructor(ctx: HandleContext, data: OpenAIFixtureData);
|
|
3949
|
+
/** Script what the model answers: turns used in order, one per matching call, or a responder the test answers. Scripts are tried in the order they were added. Experimental. */
|
|
3950
|
+
respond(turns?: OpenAITurnInput | OpenAITurnInput[] | Responder<OpenAIRequest, OpenAITurnInput>, options?: {
|
|
3951
|
+
when?: OpenAIMatch;
|
|
3952
|
+
times?: number;
|
|
3953
|
+
timing?: OpenAITiming;
|
|
3954
|
+
}): Promise<OpenAIScript>;
|
|
3955
|
+
/** Every model call attributed to this session, oldest first. Experimental. */
|
|
3956
|
+
calls(options?: {
|
|
3957
|
+
endpoint?: OpenAIEndpoint;
|
|
3958
|
+
error?: true | string;
|
|
3959
|
+
}): Promise<OpenAISessionCalls>;
|
|
3960
|
+
/** Every tool call the model made in this session, each with the result the agent sent back. Experimental. */
|
|
3961
|
+
toolCalls(options?: {
|
|
3962
|
+
name?: string;
|
|
3963
|
+
}): Promise<OpenAISessionToolCalls>;
|
|
3964
|
+
/** What went wrong with the model in this session: a call no script answered, a script that ran out or did what the real API can't, a responder that threw. Matchers fail at once on these. Experimental. */
|
|
3965
|
+
problems(): Promise<OpenAIProblems>;
|
|
3966
|
+
/** The calls that sent a secret channelstack knows to the model, and the kinds they sent (`slack.botToken`): never the values. Experimental. */
|
|
3967
|
+
sentSecrets(): Promise<OpenAISentSecrets>;
|
|
3968
|
+
/** Model calls no session could be given (the agent calling the model at startup, for example), oldest first: what a failing matcher names. Experimental. */
|
|
3969
|
+
unattributed(options?: {
|
|
3970
|
+
withinMs?: number | undefined;
|
|
3971
|
+
}): Promise<OpenAIUnattributedCalls>;
|
|
3972
|
+
/** Limit this session's model calls: requests and tokens per window, with truthful x-ratelimit-* headers. Experimental. */
|
|
3973
|
+
rateLimit(options?: {
|
|
3974
|
+
requests?: {
|
|
3975
|
+
limit: number;
|
|
3976
|
+
per?: Duration;
|
|
3977
|
+
};
|
|
3978
|
+
tokens?: {
|
|
3979
|
+
limit: number;
|
|
3980
|
+
per?: Duration;
|
|
3981
|
+
};
|
|
3982
|
+
error?: "rate_limit" | "slow_down";
|
|
3983
|
+
}): Promise<OpenAIRateLimit>;
|
|
3984
|
+
/** Wait for the next new model call from the agent, after the last one this handle saw. */
|
|
3985
|
+
waitForCall(filter?: {
|
|
3986
|
+
endpoint?: OpenAIEndpoint;
|
|
3987
|
+
error?: true | string;
|
|
3988
|
+
}, options?: WaitOptions): Promise<OpenAICall>;
|
|
3989
|
+
/** The latest model call from the agent, once the agent is quiet. Waits for at least one. */
|
|
3990
|
+
latestCall(filter?: {
|
|
3991
|
+
endpoint?: OpenAIEndpoint;
|
|
3992
|
+
error?: true | string;
|
|
3993
|
+
}, options?: QuietOptions): Promise<OpenAICall>;
|
|
3994
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
3995
|
+
[QUIET](): Promise<QuietState>;
|
|
3996
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
3997
|
+
[CONTEXT](): HandleContext;
|
|
3998
|
+
}
|
|
3999
|
+
/** Wire data of a {@link OpenAIScript}. */
|
|
4000
|
+
export interface OpenAIScriptData {
|
|
4001
|
+
id: string;
|
|
4002
|
+
responder: boolean;
|
|
4003
|
+
times: number;
|
|
4004
|
+
used: number;
|
|
4005
|
+
problems: string[];
|
|
4006
|
+
}
|
|
4007
|
+
export declare class OpenAIScript implements AsyncDisposable {
|
|
4008
|
+
#private;
|
|
4009
|
+
readonly id: string;
|
|
4010
|
+
readonly responder: boolean;
|
|
4011
|
+
readonly times: number;
|
|
4012
|
+
readonly used: number;
|
|
4013
|
+
readonly problems: string[];
|
|
4014
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
4015
|
+
constructor(ctx: HandleContext, data: OpenAIScriptData);
|
|
4016
|
+
/** Re-read a script: how many calls it answered, and its problems. Experimental. */
|
|
4017
|
+
refresh(): Promise<OpenAIScript>;
|
|
4018
|
+
/** Remove a script. Closing the session does it too. Experimental. */
|
|
4019
|
+
undo(): Promise<void>;
|
|
4020
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
4021
|
+
/** Let the streams this script holds at `pauseAfter` go on. Experimental. */
|
|
4022
|
+
resume(): Promise<void>;
|
|
4023
|
+
/** The calls this script answered. Experimental. */
|
|
4024
|
+
calls(): Promise<OpenAICalls>;
|
|
4025
|
+
/** The calls whose streams this script holds at `pauseAfter`. Experimental. */
|
|
4026
|
+
pausedCalls(): Promise<OpenAIPausedCalls>;
|
|
4027
|
+
/** The tool calls this script made, each with the result the agent sent back. Experimental. */
|
|
4028
|
+
toolCalls(options?: {
|
|
4029
|
+
name?: string;
|
|
4030
|
+
}): Promise<OpenAIToolCalls>;
|
|
4031
|
+
/** For a responder's SDK: the calls held for it since `since`, waiting up to `waitMs` for one. Experimental. */
|
|
4032
|
+
heldCalls(options?: {
|
|
4033
|
+
since?: string;
|
|
4034
|
+
waitMs?: number | undefined;
|
|
4035
|
+
}): Promise<OpenAIHeldPage>;
|
|
4036
|
+
/** For a responder's SDK: answer a held call with a turn, or report that the test's function threw. Experimental. */
|
|
4037
|
+
answerHeld(held: string, options?: {
|
|
4038
|
+
turn?: OpenAITurnInput;
|
|
4039
|
+
error?: string;
|
|
4040
|
+
}): Promise<void>;
|
|
4041
|
+
/** Wait for the next new model call this script answers, after the last one this handle saw. */
|
|
4042
|
+
waitForCall(options?: WaitOptions): Promise<OpenAICall>;
|
|
4043
|
+
/** Wait for the next new stream held at pauseAfter, after the last one this handle saw. */
|
|
4044
|
+
waitForPause(options?: WaitOptions): Promise<OpenAICall>;
|
|
4045
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
4046
|
+
[QUIET](): Promise<QuietState>;
|
|
4047
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
4048
|
+
[CONTEXT](): HandleContext;
|
|
4049
|
+
}
|
|
4050
|
+
/** Wire data of a {@link OpenAICall}. */
|
|
4051
|
+
export interface OpenAICallData {
|
|
4052
|
+
id: string;
|
|
4053
|
+
endpoint: OpenAIEndpoint;
|
|
4054
|
+
model: string;
|
|
4055
|
+
stream: boolean;
|
|
4056
|
+
at: string;
|
|
4057
|
+
durationMs: number;
|
|
4058
|
+
attempt: number;
|
|
4059
|
+
done: boolean;
|
|
4060
|
+
request: OpenAIRequest;
|
|
4061
|
+
response: {
|
|
4062
|
+
status: number;
|
|
4063
|
+
text?: string;
|
|
4064
|
+
finish?: string;
|
|
4065
|
+
error?: string;
|
|
4066
|
+
aborted: boolean;
|
|
4067
|
+
chunksSent?: number;
|
|
4068
|
+
end?: "completed" | "errored" | "dropped" | "stalled" | "aborted";
|
|
4069
|
+
};
|
|
4070
|
+
toolCalls: OpenAIToolCall[];
|
|
4071
|
+
script?: string;
|
|
4072
|
+
}
|
|
4073
|
+
export declare class OpenAICall {
|
|
4074
|
+
#private;
|
|
4075
|
+
readonly id: string;
|
|
4076
|
+
readonly endpoint: OpenAIEndpoint;
|
|
4077
|
+
readonly model: string;
|
|
4078
|
+
readonly stream: boolean;
|
|
4079
|
+
readonly at: string;
|
|
4080
|
+
readonly durationMs: number;
|
|
4081
|
+
readonly attempt: number;
|
|
4082
|
+
readonly done: boolean;
|
|
4083
|
+
readonly request: OpenAIRequest;
|
|
4084
|
+
readonly response: {
|
|
4085
|
+
status: number;
|
|
4086
|
+
text?: string;
|
|
4087
|
+
finish?: string;
|
|
4088
|
+
error?: string;
|
|
4089
|
+
aborted: boolean;
|
|
4090
|
+
chunksSent?: number;
|
|
4091
|
+
end?: "completed" | "errored" | "dropped" | "stalled" | "aborted";
|
|
4092
|
+
};
|
|
4093
|
+
readonly toolCalls: OpenAIToolCall[];
|
|
4094
|
+
readonly script: string | undefined;
|
|
4095
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
4096
|
+
constructor(ctx: HandleContext, data: OpenAICallData);
|
|
4097
|
+
/** Re-read a model call: whether it is done, how it ended. Experimental. */
|
|
4098
|
+
refresh(): Promise<OpenAICall>;
|
|
4099
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
4100
|
+
[QUIET](): Promise<QuietState>;
|
|
4101
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
4102
|
+
[CONTEXT](): HandleContext;
|
|
4103
|
+
}
|
|
4104
|
+
/** Wire data of a {@link OpenAIRateLimit}. */
|
|
4105
|
+
export interface OpenAIRateLimitData {
|
|
4106
|
+
id: string;
|
|
4107
|
+
requests?: number;
|
|
4108
|
+
tokens?: number;
|
|
4109
|
+
resetsInMs: number;
|
|
4110
|
+
}
|
|
4111
|
+
export declare class OpenAIRateLimit implements AsyncDisposable {
|
|
4112
|
+
#private;
|
|
4113
|
+
readonly id: string;
|
|
4114
|
+
readonly requests: number | undefined;
|
|
4115
|
+
readonly tokens: number | undefined;
|
|
4116
|
+
readonly resetsInMs: number;
|
|
4117
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
4118
|
+
constructor(ctx: HandleContext, data: OpenAIRateLimitData);
|
|
4119
|
+
/** What the rate limit's headers would say now. Experimental. */
|
|
4120
|
+
remaining(): Promise<OpenAIRateLimit>;
|
|
4121
|
+
/** Remove the rate limit. Experimental. */
|
|
4122
|
+
undo(): Promise<void>;
|
|
4123
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
4124
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
4125
|
+
[QUIET](): Promise<QuietState>;
|
|
4126
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
4127
|
+
[CONTEXT](): HandleContext;
|
|
4128
|
+
}
|
|
4129
|
+
/** Wire data of a {@link Place}. */
|
|
4130
|
+
export interface PlaceData {
|
|
4131
|
+
channel: string;
|
|
4132
|
+
title: string;
|
|
4133
|
+
id: string;
|
|
4134
|
+
name: string;
|
|
4135
|
+
active?: string;
|
|
4136
|
+
}
|
|
4137
|
+
export declare class Place {
|
|
4138
|
+
#private;
|
|
4139
|
+
readonly channel: string;
|
|
4140
|
+
readonly title: string;
|
|
4141
|
+
readonly id: string;
|
|
4142
|
+
readonly name: string;
|
|
4143
|
+
readonly active: string | undefined;
|
|
4144
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
4145
|
+
constructor(ctx: HandleContext, data: PlaceData);
|
|
4146
|
+
/** A place as a person reads it: the transcript its channel's own transcript route has. Experimental. */
|
|
4147
|
+
transcript(): Promise<PlaceTranscript>;
|
|
4148
|
+
/** @internal Is the agent quiet in this handle's session? Matchers ask this. */
|
|
4149
|
+
[QUIET](): Promise<QuietState>;
|
|
4150
|
+
/** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
|
|
4151
|
+
[CONTEXT](): HandleContext;
|
|
4152
|
+
}
|
|
4153
|
+
/** Wire data of a {@link GitHubPullRequest}. */
|
|
4154
|
+
export interface GitHubPullRequestData extends GitHubIssueData {
|
|
4155
|
+
head: string;
|
|
4156
|
+
base: string;
|
|
4157
|
+
}
|
|
4158
|
+
export declare class GitHubPullRequest extends GitHubIssue {
|
|
4159
|
+
#private;
|
|
4160
|
+
readonly head: string;
|
|
4161
|
+
readonly base: string;
|
|
4162
|
+
/** @internal Handles come from the SDK, never from `new`. */
|
|
4163
|
+
constructor(ctx: HandleContext, data: GitHubPullRequestData);
|
|
4164
|
+
/** Read the pull request again. Experimental. */
|
|
4165
|
+
refresh(): Promise<GitHubPullRequest>;
|
|
4166
|
+
/** The newest commit of the pull request's branch, once the agent is quiet. Experimental. */
|
|
4167
|
+
headCommit(): Promise<GitHubCommit>;
|
|
4168
|
+
/** The submitted reviews, oldest first. Experimental. */
|
|
4169
|
+
reviews(): Promise<GitHubReviews>;
|
|
4170
|
+
/** The comments on the diff, oldest first. Experimental. */
|
|
4171
|
+
reviewComments(): Promise<GitHubReviewComments>;
|
|
4172
|
+
/** The check runs on the pull request's newest commit: the newest of each name. Experimental. */
|
|
4173
|
+
checkRuns(): Promise<GitHubPullCheckRuns>;
|
|
4174
|
+
/** Has the pull request been merged?. Experimental. */
|
|
4175
|
+
merged(): Promise<boolean>;
|
|
4176
|
+
}
|
|
4177
|
+
/** Attach to a running channelstack server, or start one, and return the client. */
|
|
4178
|
+
export declare function connect(options?: LaunchOptions): Promise<Channelstack>;
|