channelstack 0.0.0-stage → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -2
  3. package/bin/channelstack.mjs +31 -0
  4. package/dist/integrations/checks/checks.test.d.ts +1 -0
  5. package/dist/integrations/checks/checks.test.js +31 -0
  6. package/dist/integrations/checks/index.d.ts +69 -0
  7. package/dist/integrations/checks/index.js +578 -0
  8. package/dist/integrations/matchers-core/index.d.ts +138 -0
  9. package/dist/integrations/matchers-core/index.js +458 -0
  10. package/dist/integrations/matchers-core/matchers.test.d.ts +1 -0
  11. package/dist/integrations/matchers-core/matchers.test.js +159 -0
  12. package/dist/integrations/vitest/global-setup.d.ts +3 -0
  13. package/dist/integrations/vitest/global-setup.js +19 -0
  14. package/dist/integrations/vitest/index.d.ts +80 -0
  15. package/dist/integrations/vitest/index.js +42 -0
  16. package/dist/integrations/vitest/plugin.test.d.ts +1 -0
  17. package/dist/integrations/vitest/plugin.test.js +19 -0
  18. package/dist/integrations/vitest/refused.d.ts +22 -0
  19. package/dist/integrations/vitest/refused.js +49 -0
  20. package/dist/integrations/vitest/setup.d.ts +1 -0
  21. package/dist/integrations/vitest/setup.js +109 -0
  22. package/dist/sdks/typescript/client.d.ts +13 -0
  23. package/dist/sdks/typescript/client.js +11 -0
  24. package/dist/sdks/typescript/generated/channels.d.ts +24 -0
  25. package/dist/sdks/typescript/generated/channels.js +2 -0
  26. package/dist/sdks/typescript/generated/index.d.ts +2747 -0
  27. package/dist/sdks/typescript/generated/index.js +3039 -0
  28. package/dist/sdks/typescript/runtime/client.d.ts +47 -0
  29. package/dist/sdks/typescript/runtime/client.js +69 -0
  30. package/dist/sdks/typescript/runtime/credentials.d.ts +7 -0
  31. package/dist/sdks/typescript/runtime/credentials.js +20 -0
  32. package/dist/sdks/typescript/runtime/duration.d.ts +4 -0
  33. package/dist/sdks/typescript/runtime/duration.js +13 -0
  34. package/dist/sdks/typescript/runtime/files.d.ts +32 -0
  35. package/dist/sdks/typescript/runtime/files.js +45 -0
  36. package/dist/sdks/typescript/runtime/launcher.d.ts +24 -0
  37. package/dist/sdks/typescript/runtime/launcher.js +121 -0
  38. package/dist/sdks/typescript/runtime/transport.d.ts +43 -0
  39. package/dist/sdks/typescript/runtime/transport.js +95 -0
  40. package/dist/sdks/typescript/runtime/wait.d.ts +82 -0
  41. package/dist/sdks/typescript/runtime/wait.js +136 -0
  42. package/dist/sdks/typescript/types.d.ts +72 -0
  43. package/dist/sdks/typescript/types.js +1 -0
  44. package/package.json +80 -4
@@ -0,0 +1,2747 @@
1
+ import { ClientBase, type HandleContext, QUIET } from "../runtime/client.ts";
2
+ import { type Duration } from "../runtime/duration.ts";
3
+ import { type FileInput } from "../runtime/files.ts";
4
+ import type { LaunchOptions } from "../runtime/launcher.ts";
5
+ import { ChannelstackError, type Transport } from "../runtime/transport.ts";
6
+ import { type QuietOptions, type WaitOptions, type QuietState } from "../runtime/wait.ts";
7
+ /** The server version this SDK was generated for. */
8
+ export declare const VERSION = "0.1.1";
9
+ export declare class AccountInactiveError extends ChannelstackError {
10
+ }
11
+ export declare class ActionRequiresError extends ChannelstackError {
12
+ }
13
+ export declare class AlreadyInChannelError extends ChannelstackError {
14
+ }
15
+ export declare class AlreadyReactedError extends ChannelstackError {
16
+ }
17
+ export declare class CantDeleteMessageError extends ChannelstackError {
18
+ }
19
+ export declare class CantUpdateMessageError extends ChannelstackError {
20
+ }
21
+ export declare class CrossWorkspaceCredentialError extends ChannelstackError {
22
+ }
23
+ export declare class DispatchFailedError extends ChannelstackError {
24
+ }
25
+ export declare class FakeActorInLiveWorldError extends ChannelstackError {
26
+ }
27
+ export declare class ForbiddenError extends ChannelstackError {
28
+ }
29
+ export declare class InternalError extends ChannelstackError {
30
+ }
31
+ export declare class InvalidArgumentError extends ChannelstackError {
32
+ }
33
+ export declare class InvalidAuthError extends ChannelstackError {
34
+ }
35
+ export declare class LiveMisconfiguredError extends ChannelstackError {
36
+ }
37
+ export declare class LiveNotAllowlistedError extends ChannelstackError {
38
+ }
39
+ export declare class MsgTooLongError extends ChannelstackError {
40
+ }
41
+ export declare class NameTakenError extends ChannelstackError {
42
+ }
43
+ export declare class NoReactionError extends ChannelstackError {
44
+ }
45
+ export declare class NoTextError extends ChannelstackError {
46
+ }
47
+ export declare class NotAllowedError extends ChannelstackError {
48
+ }
49
+ export declare class NotFoundError extends ChannelstackError {
50
+ }
51
+ export declare class NotInChannelError extends ChannelstackError {
52
+ }
53
+ export declare class NotInRoomError extends ChannelstackError {
54
+ }
55
+ export declare class SessionNotFoundError extends ChannelstackError {
56
+ }
57
+ export declare class SplitViewUnavailableError extends ChannelstackError {
58
+ }
59
+ export declare class StopUnavailableError extends ChannelstackError {
60
+ }
61
+ export declare class UnauthorizedError extends ChannelstackError {
62
+ }
63
+ export declare class UnsupportedInFakeError extends ChannelstackError {
64
+ }
65
+ export declare class UnsupportedInLiveError extends ChannelstackError {
66
+ }
67
+ export declare class ValidationFailedError extends ChannelstackError {
68
+ }
69
+ export interface Status {
70
+ ready: boolean;
71
+ version: string;
72
+ drivers: string[];
73
+ }
74
+ export interface EventPage {
75
+ events: LogEvent[];
76
+ cursor: string;
77
+ }
78
+ export interface LogEvent {
79
+ at: string;
80
+ driver: string;
81
+ kind: "action" | "delivery" | "delivery_attempt" | "api_call";
82
+ data: Record<string, unknown>;
83
+ summary?: {
84
+ text: string;
85
+ outcome: string;
86
+ ok: boolean;
87
+ };
88
+ }
89
+ export interface Quiet {
90
+ busy: boolean;
91
+ quietForMs: number;
92
+ open: string[];
93
+ }
94
+ export type Env = Record<string, string>;
95
+ export interface EchoMessage {
96
+ id: string;
97
+ room: string;
98
+ author: EchoPrincipal;
99
+ text: string;
100
+ at: string;
101
+ delivery?: string;
102
+ }
103
+ export interface EchoPrincipal {
104
+ id: string;
105
+ name: string;
106
+ kind: "user" | "app";
107
+ }
108
+ export interface EchoMessagePage {
109
+ messages: EchoMessage[];
110
+ cursor: string;
111
+ }
112
+ export interface EchoTranscript {
113
+ entries: EchoTranscriptEntry[];
114
+ }
115
+ export interface EchoTranscriptEntry {
116
+ id: string;
117
+ author: EchoPrincipal;
118
+ at: string;
119
+ text: string;
120
+ controls: string[];
121
+ edited: boolean;
122
+ depth: number;
123
+ }
124
+ export type Capabilities = Record<string, Capability>;
125
+ export interface Capability {
126
+ fake: boolean;
127
+ live: boolean;
128
+ liveRequires: string[];
129
+ }
130
+ export interface SlackTeam {
131
+ id: string;
132
+ name: string;
133
+ }
134
+ export type SlackUsers = SlackUser[];
135
+ export type SlackUsersWire = SlackUserData[];
136
+ export type SlackConversations = SlackConversation[];
137
+ export type SlackConversationsWire = SlackConversationData[];
138
+ export interface DeliveryAttempt {
139
+ number: number;
140
+ sentAt: string;
141
+ transport: "http" | "socket";
142
+ url?: string;
143
+ requestHeaders: Record<string, string>;
144
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
145
+ responseStatus?: number;
146
+ responseBody?: string;
147
+ durationMs?: number;
148
+ forgedSignature: boolean;
149
+ }
150
+ export interface SlackMessageInput {
151
+ text?: string;
152
+ blocks?: unknown[];
153
+ metadata?: SlackMessageMetadata;
154
+ }
155
+ export interface SlackMessageMetadata {
156
+ event_type: string;
157
+ event_payload: Record<string, unknown>;
158
+ }
159
+ export interface SlackButtonRef {
160
+ label?: string;
161
+ actionId?: string;
162
+ value?: string;
163
+ }
164
+ export interface SlackMenuRef {
165
+ label?: string;
166
+ actionId?: string;
167
+ }
168
+ export type SlackSuggestedPrompts = Array<{
169
+ title: string;
170
+ message: string;
171
+ }>;
172
+ export type SlackModals = SlackModal[];
173
+ export type SlackModalsWire = SlackModalData[];
174
+ export type SlackModalValues = Record<string, string | string[] | undefined>;
175
+ export type SlackModalValuesWire = Record<string, string | string[] | null>;
176
+ export type SlackMessages = SlackMessage[];
177
+ export type SlackMessagesWire = SlackMessageData[];
178
+ export type SlackMembers = Array<SlackUser | SlackApp>;
179
+ export type SlackMembersWire = Array<SlackUserData | SlackAppData>;
180
+ export type SlackReplies = SlackMessage[];
181
+ export type SlackRepliesWire = SlackMessageData[];
182
+ export type SlackReactions = SlackReaction[];
183
+ export type SlackReactionsWire = SlackReactionWire[];
184
+ export interface SlackReaction {
185
+ emoji: string;
186
+ by: Array<SlackUser | SlackApp>;
187
+ }
188
+ export interface SlackReactionWire {
189
+ emoji: string;
190
+ by: Array<SlackUserData | SlackAppData>;
191
+ }
192
+ export interface SlackThreadStatus {
193
+ state: "working" | "streaming" | "stopped" | "idle";
194
+ text?: string;
195
+ sessionStatus?: "active" | "processing" | "suspended" | "closed";
196
+ }
197
+ export interface SlackTranscript {
198
+ entries: SlackTranscriptEntry[];
199
+ text: string;
200
+ toString(): string;
201
+ }
202
+ export interface SlackTranscriptWire {
203
+ entries: SlackTranscriptEntry[];
204
+ text: string;
205
+ }
206
+ export interface SlackTranscriptEntry {
207
+ id: string;
208
+ author: SlackPrincipal;
209
+ at: string;
210
+ text: string;
211
+ controls: string[];
212
+ edited: boolean;
213
+ depth: number;
214
+ files: string[];
215
+ alsoInChannel?: true;
216
+ streaming?: "open" | "stopped" | "completed";
217
+ visibleTo?: SlackPrincipal;
218
+ }
219
+ export interface SlackPrincipal {
220
+ id: string;
221
+ name: string;
222
+ kind: "user" | "app";
223
+ }
224
+ export type SlackEphemeralMessages = SlackMessage[];
225
+ export type SlackEphemeralMessagesWire = SlackMessageData[];
226
+ export type SlackMessageDeliveries = SlackDelivery[];
227
+ export type SlackMessageDeliveriesWire = SlackDeliveryData[];
228
+ export type SlackDeliveries = SlackDelivery[];
229
+ export type SlackDeliveriesWire = SlackDeliveryData[];
230
+ export type SlackApiCalls = SlackApiCall[];
231
+ export interface SlackApiCall {
232
+ id: string;
233
+ channel: "slack";
234
+ operation: string;
235
+ method: string;
236
+ path: string;
237
+ at: string;
238
+ durationMs: number;
239
+ request?: unknown;
240
+ responseStatus: number;
241
+ response?: unknown;
242
+ error?: string;
243
+ }
244
+ export type SlackUninstallDeliveries = SlackDelivery[];
245
+ export type SlackUninstallDeliveriesWire = SlackDeliveryData[];
246
+ export type GitHubCommits = GitHubCommit[];
247
+ export type GitHubCommitsWire = GitHubCommitData[];
248
+ export type GitHubCheckRuns = GitHubCheckRun[];
249
+ export type GitHubCheckRunsWire = GitHubCheckRunData[];
250
+ export type GitHubStatuses = Array<{
251
+ context: string;
252
+ state: "pending" | "success" | "failure" | "error";
253
+ author: GitHubUser | GitHubApp;
254
+ }>;
255
+ export type GitHubStatusesWire = Array<{
256
+ context: string;
257
+ state: "pending" | "success" | "failure" | "error";
258
+ author: GitHubUserData | GitHubAppData;
259
+ }>;
260
+ export type GitHubLabelDeliveries = GitHubDelivery[];
261
+ export type GitHubLabelDeliveriesWire = GitHubDeliveryData[];
262
+ export type GitHubUnlabelDeliveries = GitHubDelivery[];
263
+ export type GitHubUnlabelDeliveriesWire = GitHubDeliveryData[];
264
+ export type GitHubAssignDeliveries = GitHubDelivery[];
265
+ export type GitHubAssignDeliveriesWire = GitHubDeliveryData[];
266
+ export interface GitHubReview {
267
+ id: number;
268
+ author: GitHubUser | GitHubApp;
269
+ state: "COMMENTED" | "APPROVED" | "CHANGES_REQUESTED" | "DISMISSED" | "PENDING";
270
+ body: string;
271
+ comments: GitHubReviewComment[];
272
+ delivery?: GitHubDelivery;
273
+ }
274
+ export interface GitHubReviewWire {
275
+ id: number;
276
+ author: GitHubUserData | GitHubAppData;
277
+ state: "COMMENTED" | "APPROVED" | "CHANGES_REQUESTED" | "DISMISSED" | "PENDING";
278
+ body: string;
279
+ comments: GitHubReviewCommentData[];
280
+ delivery?: GitHubDeliveryData;
281
+ }
282
+ export type GitHubComments = GitHubComment[];
283
+ export type GitHubCommentsWire = GitHubCommentData[];
284
+ export interface GitHubTranscript {
285
+ entries: GitHubTranscriptEntry[];
286
+ text: string;
287
+ toString(): string;
288
+ }
289
+ export interface GitHubTranscriptWire {
290
+ entries: GitHubTranscriptEntry[];
291
+ text: string;
292
+ }
293
+ export interface GitHubTranscriptEntry {
294
+ id: string;
295
+ author: GitHubPrincipal;
296
+ at: string;
297
+ text: string;
298
+ controls: string[];
299
+ edited: boolean;
300
+ depth: number;
301
+ }
302
+ export interface GitHubPrincipal {
303
+ id: string;
304
+ name: string;
305
+ kind: "user" | "app";
306
+ }
307
+ export type GitHubReviews = GitHubReview[];
308
+ export type GitHubReviewsWire = GitHubReviewWire[];
309
+ export type GitHubReviewComments = GitHubReviewComment[];
310
+ export type GitHubReviewCommentsWire = GitHubReviewCommentData[];
311
+ export type GitHubPullCheckRuns = GitHubCheckRun[];
312
+ export type GitHubPullCheckRunsWire = GitHubCheckRunData[];
313
+ export type GitHubReactions = GitHubReaction[];
314
+ export type GitHubReactionsWire = GitHubReactionWire[];
315
+ export interface GitHubReaction {
316
+ content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes";
317
+ by: Array<GitHubUser | GitHubApp>;
318
+ }
319
+ export interface GitHubReactionWire {
320
+ content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes";
321
+ by: Array<GitHubUserData | GitHubAppData>;
322
+ }
323
+ export type GitHubReviewCommentReplies = GitHubReviewComment[];
324
+ export type GitHubReviewCommentRepliesWire = GitHubReviewCommentData[];
325
+ export type GitHubDeliveries = GitHubDelivery[];
326
+ export type GitHubDeliveriesWire = GitHubDeliveryData[];
327
+ export type GitHubApiCalls = GitHubApiCall[];
328
+ export interface GitHubApiCall {
329
+ id: string;
330
+ channel: "github";
331
+ operation: string;
332
+ method: string;
333
+ path: string;
334
+ at: string;
335
+ durationMs: number;
336
+ request?: unknown;
337
+ responseStatus: number;
338
+ response?: unknown;
339
+ error?: string;
340
+ }
341
+ export type GitHubAppCalls = GitHubApiCall[];
342
+ export interface LinearIssueState {
343
+ name: string;
344
+ type: "backlog" | "unstarted" | "started" | "completed" | "canceled" | "triage" | "duplicate";
345
+ }
346
+ export type LinearComments = LinearComment[];
347
+ export type LinearCommentsWire = LinearCommentData[];
348
+ export type LinearAgentSessions = LinearAgentSession[];
349
+ export type LinearAgentSessionsWire = LinearAgentSessionData[];
350
+ export interface LinearTranscript {
351
+ entries: LinearTranscriptEntry[];
352
+ text: string;
353
+ toString(): string;
354
+ }
355
+ export interface LinearTranscriptWire {
356
+ entries: LinearTranscriptEntry[];
357
+ text: string;
358
+ }
359
+ export interface LinearTranscriptEntry {
360
+ id: string;
361
+ author: LinearPrincipal;
362
+ at: string;
363
+ text: string;
364
+ controls: string[];
365
+ edited: boolean;
366
+ depth: number;
367
+ }
368
+ export interface LinearPrincipal {
369
+ id: string;
370
+ name: string;
371
+ kind: "user" | "app";
372
+ }
373
+ export type LinearCommentReplies = LinearComment[];
374
+ export type LinearCommentRepliesWire = LinearCommentData[];
375
+ export type LinearAgentActivities = LinearAgentActivity[];
376
+ export type LinearAgentActivitiesWire = LinearAgentActivityData[];
377
+ export type LinearExternalUrls = Array<{
378
+ label: string;
379
+ url: string;
380
+ }>;
381
+ export type LinearPlan = Array<{
382
+ content: string;
383
+ status: "pending" | "inProgress" | "completed" | "canceled";
384
+ }>;
385
+ export type LinearDeliveries = LinearDelivery[];
386
+ export type LinearDeliveriesWire = LinearDeliveryData[];
387
+ export type LinearApiCalls = LinearApiCall[];
388
+ export interface LinearApiCall {
389
+ id: string;
390
+ channel: "linear";
391
+ operation: string;
392
+ method: string;
393
+ path: string;
394
+ at: string;
395
+ durationMs: number;
396
+ request?: unknown;
397
+ responseStatus: number;
398
+ response?: unknown;
399
+ error?: string;
400
+ }
401
+ export type NotionPropertySchema = "title" | "rich_text" | "number" | "checkbox" | "date" | "people" | "url" | "email" | {
402
+ select: string[];
403
+ } | {
404
+ multi_select: string[];
405
+ } | {
406
+ status: string[];
407
+ } | {
408
+ relation: NotionDatabase;
409
+ };
410
+ export type NotionPropertyValue = string | number | boolean | string[] | {
411
+ start: string;
412
+ end?: string;
413
+ } | undefined;
414
+ export type NotionPropertyValueWire = string | number | boolean | string[] | {
415
+ start: string;
416
+ end?: string;
417
+ } | null;
418
+ export type NotionDiscussions = NotionDiscussion[];
419
+ export type NotionDiscussionsWire = NotionDiscussionData[];
420
+ export type NotionBlocks = unknown[];
421
+ export type NotionChildPages = NotionPage[];
422
+ export type NotionChildPagesWire = NotionPageData[];
423
+ export type NotionConnections = NotionIntegration[];
424
+ export type NotionConnectionsWire = NotionIntegrationData[];
425
+ export interface NotionTranscript {
426
+ entries: NotionTranscriptEntry[];
427
+ text: string;
428
+ toString(): string;
429
+ }
430
+ export interface NotionTranscriptWire {
431
+ entries: NotionTranscriptEntry[];
432
+ text: string;
433
+ }
434
+ export interface NotionTranscriptEntry {
435
+ id: string;
436
+ author: NotionPrincipal;
437
+ at: string;
438
+ text: string;
439
+ controls: string[];
440
+ edited: boolean;
441
+ depth: number;
442
+ }
443
+ export interface NotionPrincipal {
444
+ id: string;
445
+ name: string;
446
+ kind: "user" | "app";
447
+ }
448
+ export type NotionRows = NotionPage[];
449
+ export type NotionRowsWire = NotionPageData[];
450
+ export type NotionComments = NotionComment[];
451
+ export type NotionCommentsWire = NotionCommentData[];
452
+ export type NotionDeliveries = NotionDelivery[];
453
+ export type NotionDeliveriesWire = NotionDeliveryData[];
454
+ export type NotionApiCalls = NotionApiCall[];
455
+ export interface NotionApiCall {
456
+ id: string;
457
+ channel: "notion";
458
+ operation: string;
459
+ method: string;
460
+ path: string;
461
+ at: string;
462
+ durationMs: number;
463
+ request?: unknown;
464
+ responseStatus: number;
465
+ response?: unknown;
466
+ error?: string;
467
+ }
468
+ export interface ResendPrincipal {
469
+ id: string;
470
+ name: string;
471
+ kind: "user" | "app";
472
+ }
473
+ export type ResendInbox = ResendEmail[];
474
+ export type ResendInboxWire = ResendEmailData[];
475
+ export type ResendMessages = ResendEmail[];
476
+ export type ResendMessagesWire = ResendEmailData[];
477
+ export type ResendReplies = ResendEmail[];
478
+ export type ResendRepliesWire = ResendEmailData[];
479
+ export interface ResendTranscript {
480
+ entries: ResendTranscriptEntry[];
481
+ text: string;
482
+ toString(): string;
483
+ }
484
+ export interface ResendTranscriptWire {
485
+ entries: ResendTranscriptEntry[];
486
+ text: string;
487
+ }
488
+ export interface ResendTranscriptEntry {
489
+ id: string;
490
+ author: ResendPrincipal;
491
+ at: string;
492
+ text: string;
493
+ controls: string[];
494
+ edited: boolean;
495
+ depth: number;
496
+ }
497
+ export type ResendDeliveries = ResendDelivery[];
498
+ export type ResendDeliveriesWire = ResendDeliveryData[];
499
+ export type ResendApiCalls = ResendApiCall[];
500
+ export interface ResendApiCall {
501
+ id: string;
502
+ channel: "resend";
503
+ operation: string;
504
+ method: string;
505
+ path: string;
506
+ at: string;
507
+ durationMs: number;
508
+ request?: unknown;
509
+ responseStatus: number;
510
+ response?: unknown;
511
+ error?: string;
512
+ }
513
+ export interface GooglePrincipal {
514
+ id: string;
515
+ name: string;
516
+ kind: "user" | "app";
517
+ }
518
+ export type GoogleInbox = GoogleEmail[];
519
+ export type GoogleInboxWire = GoogleEmailData[];
520
+ export type GoogleMessages = GoogleEmail[];
521
+ export type GoogleMessagesWire = GoogleEmailData[];
522
+ export type GoogleReplies = GoogleEmail[];
523
+ export type GoogleRepliesWire = GoogleEmailData[];
524
+ export interface GoogleTranscript {
525
+ entries: GoogleTranscriptEntry[];
526
+ text: string;
527
+ toString(): string;
528
+ }
529
+ export interface GoogleTranscriptWire {
530
+ entries: GoogleTranscriptEntry[];
531
+ text: string;
532
+ }
533
+ export interface GoogleTranscriptEntry {
534
+ id: string;
535
+ author: GooglePrincipal;
536
+ at: string;
537
+ text: string;
538
+ controls: string[];
539
+ edited: boolean;
540
+ depth: number;
541
+ }
542
+ export type GoogleDeliveries = GoogleDelivery[];
543
+ export type GoogleDeliveriesWire = GoogleDeliveryData[];
544
+ export type GoogleApiCalls = GoogleApiCall[];
545
+ export interface GoogleApiCall {
546
+ id: string;
547
+ channel: "google";
548
+ operation: string;
549
+ method: string;
550
+ path: string;
551
+ at: string;
552
+ durationMs: number;
553
+ request?: unknown;
554
+ responseStatus: number;
555
+ response?: unknown;
556
+ error?: string;
557
+ }
558
+ export interface UiLoginLink {
559
+ url: string;
560
+ }
561
+ export declare class Channelstack extends ClientBase {
562
+ #private;
563
+ /** @internal Handles come from the SDK, never from `new`. */
564
+ constructor(transport: Transport, stop: () => Promise<void>);
565
+ /** Server health, version and loaded drivers. */
566
+ status(): Promise<Status>;
567
+ /** Open a session: a scope in the shared world that owns what it creates. */
568
+ openSession(options?: {
569
+ name?: string;
570
+ }): Promise<Session>;
571
+ /** Drop the whole world. Avoid in parallel suites. */
572
+ reset(): Promise<void>;
573
+ /** 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. */
574
+ env(options?: {
575
+ proxy?: boolean;
576
+ }): Promise<Env>;
577
+ /** A new one-time link that opens the UI in a browser (what `channelstack ui` prints). Experimental. */
578
+ uiLoginLink(): Promise<UiLoginLink>;
579
+ }
580
+ /** Wire data of a {@link Session}. */
581
+ export interface SessionData {
582
+ sessionId: string;
583
+ drivers: string[];
584
+ }
585
+ export declare class Session implements AsyncDisposable {
586
+ #private;
587
+ readonly sessionId: string;
588
+ readonly drivers: string[];
589
+ /** @internal Handles come from the SDK, never from `new`. */
590
+ constructor(ctx: HandleContext, data: SessionData);
591
+ /** Close a session and remove everything it created. */
592
+ close(): Promise<void>;
593
+ [Symbol.asyncDispose](): Promise<void>;
594
+ /** The session's event log: actions, deliveries with every attempt, and the agent's API calls. */
595
+ events(options?: {
596
+ since?: string;
597
+ }): Promise<EventPage>;
598
+ /** Is the agent idle in this session, and for how long? Negative and exact-count matchers wait for this. */
599
+ quiet(): Promise<Quiet>;
600
+ /** The echo fixture: the agent's app and where it reaches the fake. Experimental. */
601
+ echo(): Promise<EchoFixture>;
602
+ /** The Slack fixture: the agent's app, the workspace, and where the agent reaches the fake. Experimental. */
603
+ slack(): Promise<SlackFixture>;
604
+ /** The GitHub fixture: the agent's App, the org, and where the agent reaches the fake. Experimental. */
605
+ github(): Promise<GitHubFixture>;
606
+ /** The Linear fixture: the agent's app, and where the agent reaches the fake. Experimental. */
607
+ linear(): Promise<LinearFixture>;
608
+ /** The Notion fixture: the agent's integration, and where the agent reaches the fake. Experimental. */
609
+ notion(): Promise<NotionFixture>;
610
+ /** The Resend fixture: the agent's team, and where the agent reaches the fake. Experimental. */
611
+ resend(): Promise<ResendFixture>;
612
+ /** The Google fixture: the agent's mailbox, and where the agent reaches the fake. Experimental. */
613
+ google(): Promise<GoogleFixture>;
614
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
615
+ [QUIET](): Promise<QuietState>;
616
+ }
617
+ /** Wire data of a {@link EchoFixture}. */
618
+ export interface EchoFixtureData {
619
+ app: EchoAppData;
620
+ apiUrl: string;
621
+ }
622
+ export declare class EchoFixture {
623
+ #private;
624
+ readonly app: EchoApp;
625
+ readonly apiUrl: string;
626
+ /** @internal Handles come from the SDK, never from `new`. */
627
+ constructor(ctx: HandleContext, data: EchoFixtureData);
628
+ /** Create a person. Experimental. */
629
+ createUser(options: {
630
+ name: string;
631
+ }): Promise<EchoUser>;
632
+ /** Create a room. Only the listed participants are members; include the app for it to receive events. Experimental. */
633
+ createRoom(options?: {
634
+ name?: string;
635
+ participants?: Array<EchoUser | EchoApp>;
636
+ }): Promise<EchoRoom>;
637
+ /** Per action: works in the fake, works live, and what live needs. Experimental. */
638
+ capabilities(): Promise<Capabilities>;
639
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
640
+ [QUIET](): Promise<QuietState>;
641
+ }
642
+ /** Wire data of a {@link EchoApp}. */
643
+ export interface EchoAppData {
644
+ id: string;
645
+ name: string;
646
+ kind: "app";
647
+ }
648
+ export declare class EchoApp {
649
+ #private;
650
+ readonly id: string;
651
+ readonly name: string;
652
+ readonly kind: "app";
653
+ /** @internal Handles come from the SDK, never from `new`. */
654
+ constructor(ctx: HandleContext, data: EchoAppData);
655
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
656
+ [QUIET](): Promise<QuietState>;
657
+ }
658
+ /** Wire data of a {@link EchoUser}. */
659
+ export interface EchoUserData {
660
+ id: string;
661
+ name: string;
662
+ kind: "user";
663
+ }
664
+ export declare class EchoUser {
665
+ #private;
666
+ readonly id: string;
667
+ readonly name: string;
668
+ readonly kind: "user";
669
+ /** @internal Handles come from the SDK, never from `new`. */
670
+ constructor(ctx: HandleContext, data: EchoUserData);
671
+ /** Post a message in a room as this person. Experimental. */
672
+ say(text: string, options: {
673
+ room: EchoRoom;
674
+ }): Promise<EchoMessage>;
675
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
676
+ [QUIET](): Promise<QuietState>;
677
+ }
678
+ /** Wire data of a {@link EchoRoom}. */
679
+ export interface EchoRoomData {
680
+ id: string;
681
+ name: string;
682
+ members: string[];
683
+ }
684
+ export declare class EchoRoom {
685
+ #private;
686
+ readonly id: string;
687
+ readonly name: string;
688
+ readonly members: string[];
689
+ /** @internal Handles come from the SDK, never from `new`. */
690
+ constructor(ctx: HandleContext, data: EchoRoomData);
691
+ /** The room's messages, oldest first, with a cursor for the next read. Experimental. */
692
+ messages(options?: {
693
+ since?: string;
694
+ }): Promise<EchoMessagePage>;
695
+ /** The room as a person would read it. Experimental. */
696
+ transcript(): Promise<EchoTranscript>;
697
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
698
+ [QUIET](): Promise<QuietState>;
699
+ }
700
+ /** Wire data of a {@link SlackFixture}. */
701
+ export interface SlackFixtureData {
702
+ app: SlackAppData;
703
+ apiUrl: string;
704
+ team: SlackTeam;
705
+ socketConnections: number;
706
+ }
707
+ export declare class SlackFixture {
708
+ #private;
709
+ readonly app: SlackApp;
710
+ readonly apiUrl: string;
711
+ readonly team: SlackTeam;
712
+ readonly socketConnections: number;
713
+ /** @internal Handles come from the SDK, never from `new`. */
714
+ constructor(ctx: HandleContext, data: SlackFixtureData);
715
+ /** Create a person in the workspace. Experimental. */
716
+ createUser(options: {
717
+ name: string;
718
+ id?: string;
719
+ displayName?: string;
720
+ realName?: string;
721
+ email?: string;
722
+ timezone?: string;
723
+ admin?: boolean;
724
+ owner?: boolean;
725
+ guest?: boolean;
726
+ bot?: boolean;
727
+ token?: string;
728
+ browser?: {
729
+ storageState: string;
730
+ };
731
+ }): Promise<SlackUser>;
732
+ /** The people this session created. Experimental. */
733
+ users(): Promise<SlackUsers>;
734
+ /** The session's conversations, the one with the newest message last. Experimental. */
735
+ conversations(): Promise<SlackConversations>;
736
+ /** Create a channel. Only the listed participants are members; include the app for it to receive events. Experimental. */
737
+ createChannel(options?: {
738
+ name?: string;
739
+ private?: boolean;
740
+ participants?: Array<SlackUser | SlackApp>;
741
+ topic?: string;
742
+ purpose?: string;
743
+ shared?: boolean;
744
+ }): Promise<SlackConversation>;
745
+ /** Every event channelstack sent the agent for this session, with every attempt. Experimental. */
746
+ deliveries(): Promise<SlackDeliveries>;
747
+ /** 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. */
748
+ calls(options?: {
749
+ operation?: string;
750
+ error?: true | string;
751
+ }): Promise<SlackApiCalls>;
752
+ /** The workspace uninstalls the app. Undone when this session closes; run such tests on their own. Experimental. */
753
+ uninstallApp(): Promise<SlackUninstallDeliveries>;
754
+ /** Inject a fault: into the agent's Web API calls (removed when this session closes), or drop its Socket Mode connection once. Experimental. */
755
+ fault(options: {
756
+ type: "rate_limit" | "latency" | "error" | "drop_socket";
757
+ operation?: string;
758
+ retryAfter?: Duration;
759
+ delay?: Duration;
760
+ after?: Duration;
761
+ error?: string;
762
+ times?: number;
763
+ }): Promise<SlackFault>;
764
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
765
+ waitForCall(filter: {
766
+ operation?: string;
767
+ error?: true | string;
768
+ }, options?: WaitOptions): Promise<SlackApiCall>;
769
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
770
+ [QUIET](): Promise<QuietState>;
771
+ }
772
+ /** Wire data of a {@link SlackApp}. */
773
+ export interface SlackAppData {
774
+ id: string;
775
+ name: string;
776
+ kind: "app";
777
+ botUserId: string;
778
+ botId: string;
779
+ botToken: string;
780
+ appToken: string;
781
+ signingSecret: string;
782
+ scopes: string[];
783
+ }
784
+ export declare class SlackApp {
785
+ #private;
786
+ readonly id: string;
787
+ readonly name: string;
788
+ readonly kind: "app";
789
+ readonly botUserId: string;
790
+ readonly botId: string;
791
+ readonly botToken: string;
792
+ readonly appToken: string;
793
+ readonly signingSecret: string;
794
+ readonly scopes: string[];
795
+ /** @internal Handles come from the SDK, never from `new`. */
796
+ constructor(ctx: HandleContext, data: SlackAppData);
797
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
798
+ [QUIET](): Promise<QuietState>;
799
+ }
800
+ /** Wire data of a {@link SlackUser}. */
801
+ export interface SlackUserData {
802
+ id: string;
803
+ name: string;
804
+ kind: "user";
805
+ displayName: string;
806
+ realName: string;
807
+ email?: string;
808
+ isAdmin: boolean;
809
+ isBot: boolean;
810
+ }
811
+ export declare class SlackUser {
812
+ #private;
813
+ readonly id: string;
814
+ readonly name: string;
815
+ readonly kind: "user";
816
+ readonly displayName: string;
817
+ readonly realName: string;
818
+ readonly email: string | undefined;
819
+ readonly isAdmin: boolean;
820
+ readonly isBot: boolean;
821
+ /** @internal Handles come from the SDK, never from `new`. */
822
+ constructor(ctx: HandleContext, data: SlackUserData);
823
+ /** Post a top-level message in a conversation, or in a DM with the people in `to`. Experimental. */
824
+ say(message: string | SlackMessageInput, options?: {
825
+ channel?: SlackConversation;
826
+ to?: SlackUser | SlackApp | Array<SlackUser | SlackApp>;
827
+ files?: string | FileInput[];
828
+ }): Promise<SlackMessage>;
829
+ /** Reply in a thread: pass the message that starts it, or any reply in it. Experimental. */
830
+ reply(message: string | SlackMessageInput, options: {
831
+ thread: SlackThread | SlackMessage;
832
+ alsoSendToChannel?: boolean;
833
+ files?: string | FileInput[];
834
+ }): Promise<SlackMessage>;
835
+ /** Edit one of this person's own messages. Experimental. */
836
+ edit(text: string | SlackMessageInput, options: {
837
+ message: SlackMessage;
838
+ }): Promise<SlackMessage>;
839
+ /** Delete a message: this person's own, or anyone's for an admin. Experimental. */
840
+ delete(options: {
841
+ message: SlackMessage;
842
+ }): Promise<void>;
843
+ /** 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. */
844
+ click(button: string | SlackButtonRef, options?: {
845
+ message?: SlackMessage;
846
+ thread?: SlackThread | SlackMessage;
847
+ channel?: SlackConversation;
848
+ }): Promise<SlackDelivery | undefined>;
849
+ /** Choose from a select menu on a message: options by their text or value, the menu by its placeholder or action_id. Experimental. */
850
+ select(option: string | string[], options: {
851
+ menu: string | SlackMenuRef;
852
+ message: SlackMessage;
853
+ }): Promise<SlackDelivery>;
854
+ /** Run a message shortcut on a message. Experimental. */
855
+ shortcut(callbackId: string, options: {
856
+ message: SlackMessage;
857
+ }): Promise<SlackDelivery>;
858
+ /** Run a slash command in a conversation, e.g. `/deploy web staging`. Experimental. */
859
+ runCommand(command: string, options: {
860
+ channel: SlackConversation;
861
+ }): Promise<SlackDelivery>;
862
+ /** Press Stop on the app's work in a thread: what is streaming there ends, and the app is told. Experimental. */
863
+ stop(options: {
864
+ thread: SlackThread | SlackMessage;
865
+ }): Promise<SlackDelivery>;
866
+ /** Open the app's split view: a new thread in this person's DM with the app, started from the channel they are looking at. Experimental. */
867
+ openAgentThread(options?: {
868
+ from?: SlackConversation;
869
+ }): Promise<SlackThread>;
870
+ /** Pick one of the prompts the app suggested in a thread: this person says its message there. Experimental. */
871
+ pickPrompt(title: string, options: {
872
+ thread: SlackThread | SlackMessage;
873
+ }): Promise<SlackMessage>;
874
+ /** Look at another channel while the split view stays open: the app is told the new context. Experimental. */
875
+ switchContext(channel: SlackConversation, options: {
876
+ thread: SlackThread | SlackMessage;
877
+ }): Promise<SlackDelivery>;
878
+ /** The modals the app opened for this person, in the order it opened them; `open` says which are still up. Experimental. */
879
+ modals(): Promise<SlackModals>;
880
+ /** Add an emoji reaction to a message. Experimental. */
881
+ react(emoji: string, options: {
882
+ message: SlackMessage;
883
+ }): Promise<SlackDelivery | undefined>;
884
+ /** Remove this person's emoji reaction from a message. Experimental. */
885
+ unreact(emoji: string, options: {
886
+ message: SlackMessage;
887
+ }): Promise<SlackDelivery | undefined>;
888
+ /** Open (or reuse) a DM with the app, another person, or several. Experimental. */
889
+ openDM(participants: SlackUser | SlackApp | Array<SlackUser | SlackApp>): Promise<SlackConversation>;
890
+ /** Invite people or the app to a channel. Experimental. */
891
+ invite(participants: SlackUser | SlackApp | Array<SlackUser | SlackApp>, options: {
892
+ channel: SlackConversation;
893
+ }): Promise<void>;
894
+ /** Remove someone from a channel. Experimental. */
895
+ kick(participant: SlackUser | SlackApp, options: {
896
+ channel: SlackConversation;
897
+ }): Promise<void>;
898
+ /** Messages only this person can see. Experimental. */
899
+ ephemeral(): Promise<SlackEphemeralMessages>;
900
+ /** Wait for the next new open modal from the agent, after the last one this handle saw. */
901
+ waitForModal(options?: {
902
+ title?: string | RegExp;
903
+ } & WaitOptions): Promise<SlackModal>;
904
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
905
+ [QUIET](): Promise<QuietState>;
906
+ }
907
+ /** Wire data of a {@link SlackConversation}. */
908
+ export interface SlackConversationData {
909
+ id: string;
910
+ kind: "channel" | "private_channel" | "im" | "mpim";
911
+ name?: string;
912
+ }
913
+ export declare class SlackConversation {
914
+ #private;
915
+ readonly id: string;
916
+ readonly kind: "channel" | "private_channel" | "im" | "mpim";
917
+ readonly name: string | undefined;
918
+ /** @internal Handles come from the SDK, never from `new`. */
919
+ constructor(ctx: HandleContext, data: SlackConversationData);
920
+ /** The newest message of a conversation, replies included. Experimental. */
921
+ latestMessage(): Promise<SlackMessage>;
922
+ /** Top-level messages of a conversation, oldest first. Experimental. */
923
+ messages(): Promise<SlackMessages>;
924
+ /** The people and apps in a conversation. Experimental. */
925
+ members(): Promise<SlackMembers>;
926
+ /** The conversation as a person would read it, threads included. Experimental. */
927
+ transcript(options?: {
928
+ as?: SlackUser | SlackApp;
929
+ }): Promise<SlackTranscript>;
930
+ /** Wait for the next new message matching `from` (anyone if omitted), after the last one this handle saw. */
931
+ waitForMessage(options?: {
932
+ from?: SlackUser | SlackApp | string;
933
+ } & WaitOptions): Promise<SlackMessage>;
934
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
935
+ [QUIET](): Promise<QuietState>;
936
+ }
937
+ /** Wire data of a {@link SlackMessage}. */
938
+ export interface SlackMessageData {
939
+ channel: string;
940
+ ts: string;
941
+ conversation: SlackConversationData;
942
+ author: SlackUserData | SlackAppData;
943
+ text: string;
944
+ blocks: unknown[];
945
+ postedAt: string;
946
+ threadTs?: string;
947
+ edited: boolean;
948
+ visibleTo?: SlackUserData;
949
+ thread: SlackThreadData;
950
+ delivery?: SlackDeliveryData;
951
+ stream?: SlackStreamData;
952
+ }
953
+ export declare class SlackMessage {
954
+ #private;
955
+ readonly channel: string;
956
+ readonly ts: string;
957
+ readonly conversation: SlackConversation;
958
+ readonly author: SlackUser | SlackApp;
959
+ readonly text: string;
960
+ readonly blocks: unknown[];
961
+ readonly postedAt: string;
962
+ readonly threadTs: string | undefined;
963
+ readonly edited: boolean;
964
+ readonly visibleTo: SlackUser | undefined;
965
+ readonly thread: SlackThread;
966
+ readonly delivery: SlackDelivery | undefined;
967
+ readonly stream: SlackStream | undefined;
968
+ /** @internal Handles come from the SDK, never from `new`. */
969
+ constructor(ctx: HandleContext, data: SlackMessageData);
970
+ /** Re-read a message: its latest text, edits and deliveries. Experimental. */
971
+ refresh(): Promise<SlackMessage>;
972
+ /** The reactions on a message, and who added each. Experimental. */
973
+ reactions(): Promise<SlackReactions>;
974
+ /** A message and the replies under it as a person would read them. Experimental. */
975
+ transcript(options?: {
976
+ as?: SlackUser | SlackApp;
977
+ }): Promise<SlackTranscript>;
978
+ /** Every delivery this message caused to the agent. Experimental. */
979
+ deliveries(): Promise<SlackMessageDeliveries>;
980
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
981
+ [QUIET](): Promise<QuietState>;
982
+ }
983
+ /** Wire data of a {@link SlackThread}. */
984
+ export interface SlackThreadData {
985
+ channel: string;
986
+ ts: string;
987
+ conversation: SlackConversationData;
988
+ }
989
+ export declare class SlackThread {
990
+ #private;
991
+ readonly channel: string;
992
+ readonly ts: string;
993
+ readonly conversation: SlackConversation;
994
+ /** @internal Handles come from the SDK, never from `new`. */
995
+ constructor(ctx: HandleContext, data: SlackThreadData);
996
+ /** The prompts the app suggested in a thread. Experimental. */
997
+ suggestedPrompts(): Promise<SlackSuggestedPrompts>;
998
+ /** The message that starts a thread, as it is now. Experimental. */
999
+ root(): Promise<SlackMessage>;
1000
+ /** Replies in a thread, oldest first, without the message that starts it. Experimental. */
1001
+ replies(): Promise<SlackReplies>;
1002
+ /** What the agent is doing in a thread: its status line, an open stream, or idle. Experimental. */
1003
+ status(): Promise<SlackThreadStatus>;
1004
+ /** A thread as a person would read it. Experimental. */
1005
+ transcript(options?: {
1006
+ as?: SlackUser | SlackApp;
1007
+ }): Promise<SlackTranscript>;
1008
+ /** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
1009
+ waitForReply(options?: {
1010
+ from?: SlackUser | SlackApp | string;
1011
+ } & WaitOptions): Promise<SlackMessage>;
1012
+ /** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
1013
+ latestReply(options?: {
1014
+ from?: SlackUser | SlackApp | string;
1015
+ } & QuietOptions): Promise<SlackMessage>;
1016
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1017
+ [QUIET](): Promise<QuietState>;
1018
+ }
1019
+ /** Wire data of a {@link SlackDelivery}. */
1020
+ export interface SlackDeliveryData {
1021
+ id: string;
1022
+ channel: "slack";
1023
+ type: string;
1024
+ eventType?: string;
1025
+ eventId?: string;
1026
+ payload?: unknown;
1027
+ attempts: DeliveryAttempt[];
1028
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1029
+ }
1030
+ export declare class SlackDelivery {
1031
+ #private;
1032
+ readonly id: string;
1033
+ readonly channel: "slack";
1034
+ readonly type: string;
1035
+ readonly eventType: string | undefined;
1036
+ readonly eventId: string | undefined;
1037
+ readonly payload: unknown | undefined;
1038
+ readonly attempts: DeliveryAttempt[];
1039
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1040
+ /** @internal Handles come from the SDK, never from `new`. */
1041
+ constructor(ctx: HandleContext, data: SlackDeliveryData);
1042
+ /** Re-read a delivery: its attempts and status. Experimental. */
1043
+ refresh(): Promise<SlackDelivery>;
1044
+ /** Send the delivery again, unchanged or forged: a wrong signature, or a timestamp outside the replay window. Experimental. */
1045
+ resend(options?: {
1046
+ badSignature?: boolean;
1047
+ stale?: boolean;
1048
+ headers?: Record<string, string>;
1049
+ }): Promise<DeliveryAttempt>;
1050
+ /** Retry the way Slack does: the same payload, with X-Slack-Retry-Num and X-Slack-Retry-Reason. Experimental. */
1051
+ retry(options?: {
1052
+ after?: Duration;
1053
+ reason?: "http_timeout" | "http_error" | "too_many_redirects";
1054
+ }): Promise<DeliveryAttempt>;
1055
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
1056
+ settled(options?: WaitOptions): Promise<SlackDelivery>;
1057
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1058
+ [QUIET](): Promise<QuietState>;
1059
+ }
1060
+ /** Wire data of a {@link SlackStream}. */
1061
+ export interface SlackStreamData {
1062
+ channel: string;
1063
+ ts: string;
1064
+ state: "open" | "stopped" | "completed";
1065
+ chunks: string[];
1066
+ startedAt: string;
1067
+ endedAt?: string;
1068
+ }
1069
+ export declare class SlackStream {
1070
+ #private;
1071
+ readonly channel: string;
1072
+ readonly ts: string;
1073
+ readonly state: "open" | "stopped" | "completed";
1074
+ readonly chunks: string[];
1075
+ readonly startedAt: string;
1076
+ readonly endedAt: string | undefined;
1077
+ /** @internal Handles come from the SDK, never from `new`. */
1078
+ constructor(ctx: HandleContext, data: SlackStreamData);
1079
+ /** Re-read a streamed message's stream: its state and what was streamed so far. Experimental. */
1080
+ refresh(): Promise<SlackStream>;
1081
+ /** Wait for the stream to end, and resolve with the value as it is then. */
1082
+ ended(options?: WaitOptions): Promise<SlackStream>;
1083
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1084
+ [QUIET](): Promise<QuietState>;
1085
+ }
1086
+ /** Wire data of a {@link SlackModal}. */
1087
+ export interface SlackModalData {
1088
+ viewId: string;
1089
+ user: SlackUserData;
1090
+ title: string;
1091
+ blocks: unknown[];
1092
+ open: boolean;
1093
+ errors: Record<string, string>;
1094
+ }
1095
+ export declare class SlackModal {
1096
+ #private;
1097
+ readonly viewId: string;
1098
+ readonly user: SlackUser;
1099
+ readonly title: string;
1100
+ readonly blocks: unknown[];
1101
+ readonly open: boolean;
1102
+ readonly errors: Record<string, string>;
1103
+ /** @internal Handles come from the SDK, never from `new`. */
1104
+ constructor(ctx: HandleContext, data: SlackModalData);
1105
+ /** What is filled in: each input by its label (or action_id), with the text a person sees in it. Experimental. */
1106
+ values(): Promise<SlackModalValues>;
1107
+ /** Fill in inputs, by label or `block_id.action_id`, and submit the modal. Experimental. */
1108
+ submit(values?: Record<string, string | string[]>): Promise<SlackDelivery>;
1109
+ /** Close the modal. The app is told only if it asked to be (`notify_on_close`). Experimental. */
1110
+ close(): Promise<SlackDelivery | undefined>;
1111
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1112
+ [QUIET](): Promise<QuietState>;
1113
+ }
1114
+ /** Wire data of a {@link SlackFault}. */
1115
+ export interface SlackFaultData {
1116
+ id: string;
1117
+ }
1118
+ export declare class SlackFault implements AsyncDisposable {
1119
+ #private;
1120
+ readonly id: string;
1121
+ /** @internal Handles come from the SDK, never from `new`. */
1122
+ constructor(ctx: HandleContext, data: SlackFaultData);
1123
+ /** Remove a fault. Experimental. */
1124
+ undo(): Promise<void>;
1125
+ [Symbol.asyncDispose](): Promise<void>;
1126
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1127
+ [QUIET](): Promise<QuietState>;
1128
+ }
1129
+ /** Wire data of a {@link GitHubFixture}. */
1130
+ export interface GitHubFixtureData {
1131
+ app: GitHubAppData;
1132
+ apiUrl: string;
1133
+ org: string;
1134
+ }
1135
+ export declare class GitHubFixture {
1136
+ #private;
1137
+ readonly app: GitHubApp;
1138
+ readonly apiUrl: string;
1139
+ readonly org: string;
1140
+ /** @internal Handles come from the SDK, never from `new`. */
1141
+ constructor(ctx: HandleContext, data: GitHubFixtureData);
1142
+ /** Create a person in the org. Experimental. */
1143
+ createUser(options: {
1144
+ login: string;
1145
+ id?: number;
1146
+ name?: string;
1147
+ email?: string;
1148
+ role?: "member" | "admin" | "outside_collaborator";
1149
+ token?: string;
1150
+ }): Promise<GitHubUser>;
1151
+ /** 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. */
1152
+ createRepo(options?: {
1153
+ name?: string;
1154
+ private?: boolean;
1155
+ defaultBranch?: string;
1156
+ files?: string | FileInput[];
1157
+ collaborators?: Array<GitHubUser | {
1158
+ user: GitHubUser;
1159
+ permission?: "read" | "triage" | "write" | "maintain" | "admin";
1160
+ }>;
1161
+ apps?: GitHubApp[];
1162
+ labels?: Array<string | {
1163
+ name: string;
1164
+ color?: string;
1165
+ description?: string;
1166
+ }>;
1167
+ }): Promise<GitHubRepo>;
1168
+ /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
1169
+ deliveries(options?: {
1170
+ type?: string;
1171
+ resource?: GitHubRepo;
1172
+ }): Promise<GitHubDeliveries>;
1173
+ /** The REST calls the agent made about this session's repositories. Calls about no repository (`GET /app`) are in no session. Experimental. */
1174
+ calls(options?: {
1175
+ operation?: string;
1176
+ error?: true | string;
1177
+ }): Promise<GitHubApiCalls>;
1178
+ /** 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. */
1179
+ appCalls(options?: {
1180
+ operation?: string;
1181
+ error?: true | string;
1182
+ }): Promise<GitHubAppCalls>;
1183
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
1184
+ waitForCall(filter: {
1185
+ operation?: string;
1186
+ error?: true | string;
1187
+ }, options?: WaitOptions): Promise<GitHubApiCall>;
1188
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1189
+ [QUIET](): Promise<QuietState>;
1190
+ }
1191
+ /** Wire data of a {@link GitHubApp}. */
1192
+ export interface GitHubAppData {
1193
+ id: string;
1194
+ name: string;
1195
+ kind: "app";
1196
+ slug: string;
1197
+ botLogin: string;
1198
+ botUserId: string;
1199
+ appId: number;
1200
+ privateKey: string;
1201
+ webhookSecret: string;
1202
+ }
1203
+ export declare class GitHubApp {
1204
+ #private;
1205
+ readonly id: string;
1206
+ readonly name: string;
1207
+ readonly kind: "app";
1208
+ readonly slug: string;
1209
+ readonly botLogin: string;
1210
+ readonly botUserId: string;
1211
+ readonly appId: number;
1212
+ readonly privateKey: string;
1213
+ readonly webhookSecret: string;
1214
+ /** @internal Handles come from the SDK, never from `new`. */
1215
+ constructor(ctx: HandleContext, data: GitHubAppData);
1216
+ /** The id of the App's installation, for a repository it is installed on. Experimental. */
1217
+ installationId(repo: GitHubRepo): Promise<number>;
1218
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1219
+ [QUIET](): Promise<QuietState>;
1220
+ }
1221
+ /** Wire data of a {@link GitHubUser}. */
1222
+ export interface GitHubUserData {
1223
+ id: string;
1224
+ name: string;
1225
+ kind: "user";
1226
+ login: string;
1227
+ numericId: number;
1228
+ displayName?: string;
1229
+ email?: string;
1230
+ role: "member" | "admin" | "outside_collaborator";
1231
+ }
1232
+ export declare class GitHubUser {
1233
+ #private;
1234
+ readonly id: string;
1235
+ readonly name: string;
1236
+ readonly kind: "user";
1237
+ readonly login: string;
1238
+ readonly numericId: number;
1239
+ readonly displayName: string | undefined;
1240
+ readonly email: string | undefined;
1241
+ readonly role: "member" | "admin" | "outside_collaborator";
1242
+ /** @internal Handles come from the SDK, never from `new`. */
1243
+ constructor(ctx: HandleContext, data: GitHubUserData);
1244
+ /** 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. */
1245
+ push(changes: FileInput[] | Record<string, string | null>, options: {
1246
+ repo: GitHubRepo;
1247
+ branch: string;
1248
+ message?: string;
1249
+ }): Promise<GitHubCommit>;
1250
+ /** Open an issue. Sends `issues` (action `opened`). Experimental. */
1251
+ openIssue(issue: {
1252
+ title: string;
1253
+ body?: string;
1254
+ labels?: string[];
1255
+ assignees?: Array<GitHubUser | GitHubApp>;
1256
+ }, options: {
1257
+ repo: GitHubRepo;
1258
+ }): Promise<GitHubIssue>;
1259
+ /** Open a pull request. With `changes`, they are pushed to `from` first; without, `from` is an existing branch. Sends `pull_request` (action `opened`). Experimental. */
1260
+ openPullRequest(pr: {
1261
+ from: string;
1262
+ to?: string;
1263
+ title?: string;
1264
+ body?: string;
1265
+ changes?: FileInput[] | Record<string, string | null>;
1266
+ draft?: boolean;
1267
+ reviewers?: Array<GitHubUser | GitHubApp>;
1268
+ }, options: {
1269
+ repo: GitHubRepo;
1270
+ }): Promise<GitHubPullRequest>;
1271
+ /** Edit the title or the body of an issue or a pull request. Sends `issues` or `pull_request` (action `edited`). Experimental. */
1272
+ editIssue(changes: {
1273
+ title?: string;
1274
+ body?: string;
1275
+ }, options: {
1276
+ issue: GitHubIssue;
1277
+ }): Promise<GitHubDelivery | undefined>;
1278
+ /** Close an issue or a pull request. Sends `issues` or `pull_request` (action `closed`). Experimental. */
1279
+ close(options: {
1280
+ issue: GitHubIssue;
1281
+ }): Promise<GitHubDelivery | undefined>;
1282
+ /** Reopen an issue or a pull request. Sends `issues` or `pull_request` (action `reopened`). Experimental. */
1283
+ reopen(options: {
1284
+ issue: GitHubIssue;
1285
+ }): Promise<GitHubDelivery | undefined>;
1286
+ /** Put labels on an issue or a pull request. Sends one `labeled` event per label. Experimental. */
1287
+ label(labels: string | string[], options: {
1288
+ issue: GitHubIssue;
1289
+ }): Promise<GitHubLabelDeliveries>;
1290
+ /** Take labels off an issue or a pull request. Sends one `unlabeled` event per label. Experimental. */
1291
+ unlabel(labels: string | string[], options: {
1292
+ issue: GitHubIssue;
1293
+ }): Promise<GitHubUnlabelDeliveries>;
1294
+ /** Assign people or the App's bot. Sends one `assigned` event per assignee. Experimental. */
1295
+ assign(assignees: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
1296
+ issue: GitHubIssue;
1297
+ }): Promise<GitHubAssignDeliveries>;
1298
+ /** Comment on an issue or a pull request's conversation. Sends `issue_comment` (action `created`). Experimental. */
1299
+ comment(body: string, options: {
1300
+ issue: GitHubIssue;
1301
+ }): Promise<GitHubComment>;
1302
+ /** Edit a conversation comment or a comment on the diff. Sends the comment's event with action `edited`. Experimental. */
1303
+ edit(body: string, options: {
1304
+ comment: GitHubComment | GitHubReviewComment;
1305
+ }): Promise<GitHubDelivery | undefined>;
1306
+ /** Delete a conversation comment or a comment on the diff. Sends the comment's event with action `deleted`. Experimental. */
1307
+ delete(options: {
1308
+ comment: GitHubComment | GitHubReviewComment;
1309
+ }): Promise<GitHubDelivery | undefined>;
1310
+ /** React to an issue, a pull request or a comment. GitHub sends no webhook for a reaction. Experimental. */
1311
+ react(content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes", options?: {
1312
+ issue?: GitHubIssue;
1313
+ comment?: GitHubComment | GitHubReviewComment;
1314
+ }): Promise<void>;
1315
+ /** Hide a comment as outdated, spam, off-topic or resolved. GitHub sends no webhook for it. Experimental. */
1316
+ minimize(options: {
1317
+ comment: GitHubComment;
1318
+ reason?: "OUTDATED" | "SPAM" | "OFF_TOPIC" | "RESOLVED";
1319
+ }): Promise<void>;
1320
+ /** Submit a review, with comments on the diff if any. Sends `pull_request_review`, and one `pull_request_review_comment` per comment. Experimental. */
1321
+ review(review: {
1322
+ pr: GitHubPullRequest;
1323
+ event: "COMMENT" | "APPROVE" | "REQUEST_CHANGES";
1324
+ body?: string;
1325
+ comments?: Array<{
1326
+ path: string;
1327
+ line: number;
1328
+ side?: "LEFT" | "RIGHT";
1329
+ startLine?: number;
1330
+ body: string;
1331
+ }>;
1332
+ }): Promise<GitHubReview>;
1333
+ /** One comment on the diff, outside a review. Sends `pull_request_review_comment`. Experimental. */
1334
+ reviewComment(body: string, options: {
1335
+ pr: GitHubPullRequest;
1336
+ path: string;
1337
+ line: number;
1338
+ side?: "LEFT" | "RIGHT";
1339
+ }): Promise<GitHubReviewComment>;
1340
+ /** Reply in a thread on the diff. Sends `pull_request_review_comment`. Experimental. */
1341
+ reply(body: string, options: {
1342
+ comment: GitHubReviewComment;
1343
+ }): Promise<GitHubReviewComment>;
1344
+ /** Resolve a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
1345
+ resolve(options: {
1346
+ comment: GitHubReviewComment;
1347
+ }): Promise<GitHubDelivery | undefined>;
1348
+ /** Reopen a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
1349
+ unresolve(options: {
1350
+ comment: GitHubReviewComment;
1351
+ }): Promise<GitHubDelivery | undefined>;
1352
+ /** Request a review from people or the App's bot. Sends `pull_request` (action `review_requested`) per reviewer. Experimental. */
1353
+ requestReview(reviewers: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
1354
+ pr: GitHubPullRequest;
1355
+ }): Promise<GitHubDelivery | undefined>;
1356
+ /** Mark a draft pull request as ready for review. Sends `pull_request` (action `ready_for_review`). Experimental. */
1357
+ markReady(options: {
1358
+ pr: GitHubPullRequest;
1359
+ }): Promise<GitHubDelivery | undefined>;
1360
+ /** Merge a pull request. Sends `push` for the base branch, then `pull_request` (action `closed`, merged). Experimental. */
1361
+ merge(options: {
1362
+ pr: GitHubPullRequest;
1363
+ method?: "merge" | "squash" | "rebase";
1364
+ }): Promise<GitHubDelivery | undefined>;
1365
+ /** Click "Re-run" on a check run. Sends `check_run` (action `rerequested`). Experimental. */
1366
+ rerun(options: {
1367
+ checkRun: GitHubCheckRun;
1368
+ }): Promise<GitHubDelivery | undefined>;
1369
+ /** Click one of the buttons the App put on a check run. Sends `check_run` (action `requested_action`). Experimental. */
1370
+ requestAction(identifier: string, options: {
1371
+ checkRun: GitHubCheckRun;
1372
+ }): Promise<GitHubDelivery | undefined>;
1373
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1374
+ [QUIET](): Promise<QuietState>;
1375
+ }
1376
+ /** Wire data of a {@link GitHubRepo}. */
1377
+ export interface GitHubRepoData {
1378
+ id: string;
1379
+ owner: string;
1380
+ name: string;
1381
+ fullName: string;
1382
+ defaultBranch: string;
1383
+ private: boolean;
1384
+ }
1385
+ export declare class GitHubRepo {
1386
+ #private;
1387
+ readonly id: string;
1388
+ readonly owner: string;
1389
+ readonly name: string;
1390
+ readonly fullName: string;
1391
+ readonly defaultBranch: string;
1392
+ readonly private: boolean;
1393
+ /** @internal Handles come from the SDK, never from `new`. */
1394
+ constructor(ctx: HandleContext, data: GitHubRepoData);
1395
+ /** Install the App on this repository. Sends `installation_repositories`. Experimental. */
1396
+ installApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
1397
+ /** Take the App off this repository. Sends `installation_repositories`. Experimental. */
1398
+ uninstallApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
1399
+ /** An issue of this repository by its number. Experimental. */
1400
+ issue(number: number): Promise<GitHubIssue>;
1401
+ /** A pull request of this repository by its number. Experimental. */
1402
+ pullRequest(number: number): Promise<GitHubPullRequest>;
1403
+ /** A file's text as it is on a branch (the default branch without `ref`), or nothing when it isn't there. Experimental. */
1404
+ readFile(path: string, options?: {
1405
+ ref?: string;
1406
+ }): Promise<string | undefined>;
1407
+ /** The commits of a branch (the default branch without `branch`), newest first. Experimental. */
1408
+ commits(options?: {
1409
+ branch?: string;
1410
+ }): Promise<GitHubCommits>;
1411
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1412
+ [QUIET](): Promise<QuietState>;
1413
+ }
1414
+ /** Wire data of a {@link GitHubDelivery}. */
1415
+ export interface GitHubDeliveryData {
1416
+ id: string;
1417
+ channel: "github";
1418
+ type: string;
1419
+ action?: string;
1420
+ guid: string;
1421
+ payload?: unknown;
1422
+ attempts: DeliveryAttempt[];
1423
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1424
+ }
1425
+ export declare class GitHubDelivery {
1426
+ #private;
1427
+ readonly id: string;
1428
+ readonly channel: "github";
1429
+ readonly type: string;
1430
+ readonly action: string | undefined;
1431
+ readonly guid: string;
1432
+ readonly payload: unknown | undefined;
1433
+ readonly attempts: DeliveryAttempt[];
1434
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1435
+ /** @internal Handles come from the SDK, never from `new`. */
1436
+ constructor(ctx: HandleContext, data: GitHubDeliveryData);
1437
+ /** Re-read a delivery: its attempts and status. Experimental. */
1438
+ refresh(): Promise<GitHubDelivery>;
1439
+ /** Redeliver from the App's delivery log, as GitHub's UI and API do: the same GUID, a new attempt. Experimental. */
1440
+ redeliver(): Promise<DeliveryAttempt>;
1441
+ /** Send the delivery again, unchanged or signed with a secret that isn't the App's. Experimental. */
1442
+ resend(options?: {
1443
+ badSignature?: boolean;
1444
+ }): Promise<DeliveryAttempt>;
1445
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
1446
+ settled(options?: WaitOptions): Promise<GitHubDelivery>;
1447
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1448
+ [QUIET](): Promise<QuietState>;
1449
+ }
1450
+ /** Wire data of a {@link GitHubIssue}. */
1451
+ export interface GitHubIssueData {
1452
+ repoId: string;
1453
+ number: number;
1454
+ repo: GitHubRepoData;
1455
+ url: string;
1456
+ author: GitHubUserData | GitHubAppData;
1457
+ }
1458
+ export declare class GitHubIssue {
1459
+ #private;
1460
+ readonly repoId: string;
1461
+ readonly number: number;
1462
+ readonly repo: GitHubRepo;
1463
+ readonly url: string;
1464
+ readonly author: GitHubUser | GitHubApp;
1465
+ /** @internal Handles come from the SDK, never from `new`. */
1466
+ constructor(ctx: HandleContext, data: GitHubIssueData);
1467
+ /** Read the issue again. Experimental. */
1468
+ refresh(): Promise<GitHubIssue>;
1469
+ /** The issue's title as it is now. Experimental. */
1470
+ title(): Promise<string>;
1471
+ /** Open or closed, once the agent is quiet. Experimental. */
1472
+ state(): Promise<"open" | "closed">;
1473
+ /** The names of the labels on it. Experimental. */
1474
+ labels(): Promise<string[]>;
1475
+ /** Who it is assigned to. Experimental. */
1476
+ assignees(): Promise<Array<GitHubUser | GitHubApp>>;
1477
+ /** The comments of the conversation, oldest first. Experimental. */
1478
+ comments(): Promise<GitHubComments>;
1479
+ /** The issue or pull request as a person reads it: description, comments, reviews and threads. Experimental. */
1480
+ transcript(): Promise<GitHubTranscript>;
1481
+ /** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
1482
+ waitForComment(options?: {
1483
+ from?: GitHubUser | GitHubApp | string;
1484
+ body?: string | RegExp;
1485
+ } & WaitOptions): Promise<GitHubComment>;
1486
+ /** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
1487
+ latestComment(options?: {
1488
+ from?: GitHubUser | GitHubApp | string;
1489
+ } & QuietOptions): Promise<GitHubComment>;
1490
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1491
+ [QUIET](): Promise<QuietState>;
1492
+ }
1493
+ /** Wire data of a {@link GitHubCommit}. */
1494
+ export interface GitHubCommitData {
1495
+ repoId: string;
1496
+ sha: string;
1497
+ message: string;
1498
+ author?: GitHubUserData | GitHubAppData;
1499
+ branch: string;
1500
+ committedAt: string;
1501
+ }
1502
+ export declare class GitHubCommit {
1503
+ #private;
1504
+ readonly repoId: string;
1505
+ readonly sha: string;
1506
+ readonly message: string;
1507
+ readonly author: GitHubUser | GitHubApp | undefined;
1508
+ readonly branch: string;
1509
+ readonly committedAt: string;
1510
+ /** @internal Handles come from the SDK, never from `new`. */
1511
+ constructor(ctx: HandleContext, data: GitHubCommitData);
1512
+ /** The check runs on this commit: the newest of each name. Experimental. */
1513
+ checkRuns(): Promise<GitHubCheckRuns>;
1514
+ /** The commit statuses on this commit: the newest of each context. Experimental. */
1515
+ statuses(): Promise<GitHubStatuses>;
1516
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1517
+ [QUIET](): Promise<QuietState>;
1518
+ }
1519
+ /** Wire data of a {@link GitHubCheckRun}. */
1520
+ export interface GitHubCheckRunData {
1521
+ id: number;
1522
+ name: string;
1523
+ app: {
1524
+ slug: string;
1525
+ };
1526
+ headSha: string;
1527
+ status: "queued" | "in_progress" | "completed";
1528
+ conclusion?: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required";
1529
+ title?: string;
1530
+ summary?: string;
1531
+ annotations: Array<{
1532
+ path: string;
1533
+ startLine: number;
1534
+ endLine: number;
1535
+ level: "notice" | "warning" | "failure";
1536
+ message: string;
1537
+ }>;
1538
+ actions: string[];
1539
+ }
1540
+ export declare class GitHubCheckRun {
1541
+ #private;
1542
+ readonly id: number;
1543
+ readonly name: string;
1544
+ readonly app: {
1545
+ slug: string;
1546
+ };
1547
+ readonly headSha: string;
1548
+ readonly status: "queued" | "in_progress" | "completed";
1549
+ readonly conclusion: "success" | "failure" | "neutral" | "cancelled" | "skipped" | "timed_out" | "action_required" | undefined;
1550
+ readonly title: string | undefined;
1551
+ readonly summary: string | undefined;
1552
+ readonly annotations: Array<{
1553
+ path: string;
1554
+ startLine: number;
1555
+ endLine: number;
1556
+ level: "notice" | "warning" | "failure";
1557
+ message: string;
1558
+ }>;
1559
+ readonly actions: string[];
1560
+ /** @internal Handles come from the SDK, never from `new`. */
1561
+ constructor(ctx: HandleContext, data: GitHubCheckRunData);
1562
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1563
+ [QUIET](): Promise<QuietState>;
1564
+ }
1565
+ /** Wire data of a {@link GitHubComment}. */
1566
+ export interface GitHubCommentData {
1567
+ id: number;
1568
+ url: string;
1569
+ issue: GitHubIssueData;
1570
+ author: GitHubUserData | GitHubAppData;
1571
+ body: string;
1572
+ createdAt: string;
1573
+ delivery?: GitHubDeliveryData;
1574
+ }
1575
+ export declare class GitHubComment {
1576
+ #private;
1577
+ readonly id: number;
1578
+ readonly url: string;
1579
+ readonly issue: GitHubIssue;
1580
+ readonly author: GitHubUser | GitHubApp;
1581
+ readonly body: string;
1582
+ readonly createdAt: string;
1583
+ readonly delivery: GitHubDelivery | undefined;
1584
+ /** @internal Handles come from the SDK, never from `new`. */
1585
+ constructor(ctx: HandleContext, data: GitHubCommentData);
1586
+ /** Read a conversation comment again. Experimental. */
1587
+ refresh(): Promise<GitHubComment>;
1588
+ /** The reactions on a conversation comment, by content. Experimental. */
1589
+ reactions(): Promise<GitHubReactions>;
1590
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1591
+ [QUIET](): Promise<QuietState>;
1592
+ }
1593
+ /** Wire data of a {@link GitHubReviewComment}. */
1594
+ export interface GitHubReviewCommentData {
1595
+ id: number;
1596
+ pr: GitHubPullRequestData;
1597
+ author: GitHubUserData | GitHubAppData;
1598
+ path: string;
1599
+ line: number;
1600
+ side: "LEFT" | "RIGHT";
1601
+ body: string;
1602
+ delivery?: GitHubDeliveryData;
1603
+ }
1604
+ export declare class GitHubReviewComment {
1605
+ #private;
1606
+ readonly id: number;
1607
+ readonly pr: GitHubPullRequest;
1608
+ readonly author: GitHubUser | GitHubApp;
1609
+ readonly path: string;
1610
+ readonly line: number;
1611
+ readonly side: "LEFT" | "RIGHT";
1612
+ readonly body: string;
1613
+ readonly delivery: GitHubDelivery | undefined;
1614
+ /** @internal Handles come from the SDK, never from `new`. */
1615
+ constructor(ctx: HandleContext, data: GitHubReviewCommentData);
1616
+ /** The replies in this comment's thread, once the agent is quiet. Experimental. */
1617
+ replies(): Promise<GitHubReviewCommentReplies>;
1618
+ /** Is this comment's thread resolved?. Experimental. */
1619
+ resolved(): Promise<boolean>;
1620
+ /** This comment's thread as a person reads it. Experimental. */
1621
+ transcript(): Promise<GitHubTranscript>;
1622
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1623
+ [QUIET](): Promise<QuietState>;
1624
+ }
1625
+ /** Wire data of a {@link LinearFixture}. */
1626
+ export interface LinearFixtureData {
1627
+ app: LinearAppData;
1628
+ apiUrl: string;
1629
+ }
1630
+ export declare class LinearFixture {
1631
+ #private;
1632
+ readonly app: LinearApp;
1633
+ readonly apiUrl: string;
1634
+ /** @internal Handles come from the SDK, never from `new`. */
1635
+ constructor(ctx: HandleContext, data: LinearFixtureData);
1636
+ /** Create a person in the workspace. Experimental. */
1637
+ createUser(options: {
1638
+ name: string;
1639
+ id?: string;
1640
+ displayName?: string;
1641
+ email?: string;
1642
+ admin?: boolean;
1643
+ guest?: boolean;
1644
+ token?: string;
1645
+ }): Promise<LinearUser>;
1646
+ /** Create a team: its members, workflow states and labels. Without a key one is made up, so parallel tests never share one. Experimental. */
1647
+ createTeam(options?: {
1648
+ key?: string;
1649
+ name?: string;
1650
+ members?: LinearUser[];
1651
+ states?: Array<{
1652
+ name: string;
1653
+ type: "backlog" | "unstarted" | "started" | "completed" | "canceled" | "triage";
1654
+ }>;
1655
+ labels?: string[];
1656
+ }): Promise<LinearTeam>;
1657
+ /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
1658
+ deliveries(options?: {
1659
+ type?: string;
1660
+ resource?: LinearIssue;
1661
+ }): Promise<LinearDeliveries>;
1662
+ /** The GraphQL operations the agent sent about this session's issues and sessions, by root field (`agentActivityCreate`). Experimental. */
1663
+ calls(options?: {
1664
+ operation?: string;
1665
+ error?: true | string;
1666
+ }): Promise<LinearApiCalls>;
1667
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
1668
+ waitForCall(filter: {
1669
+ operation?: string;
1670
+ error?: true | string;
1671
+ }, options?: WaitOptions): Promise<LinearApiCall>;
1672
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1673
+ [QUIET](): Promise<QuietState>;
1674
+ }
1675
+ /** Wire data of a {@link LinearApp}. */
1676
+ export interface LinearAppData {
1677
+ id: string;
1678
+ name: string;
1679
+ kind: "app";
1680
+ botUserId: string;
1681
+ accessToken: string;
1682
+ webhookSecret: string;
1683
+ clientId: string;
1684
+ clientSecret: string;
1685
+ }
1686
+ export declare class LinearApp {
1687
+ #private;
1688
+ readonly id: string;
1689
+ readonly name: string;
1690
+ readonly kind: "app";
1691
+ readonly botUserId: string;
1692
+ readonly accessToken: string;
1693
+ readonly webhookSecret: string;
1694
+ readonly clientId: string;
1695
+ readonly clientSecret: string;
1696
+ /** @internal Handles come from the SDK, never from `new`. */
1697
+ constructor(ctx: HandleContext, data: LinearAppData);
1698
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1699
+ [QUIET](): Promise<QuietState>;
1700
+ }
1701
+ /** Wire data of a {@link LinearUser}. */
1702
+ export interface LinearUserData {
1703
+ id: string;
1704
+ name: string;
1705
+ kind: "user";
1706
+ displayName: string;
1707
+ email?: string;
1708
+ admin: boolean;
1709
+ guest: boolean;
1710
+ }
1711
+ export declare class LinearUser {
1712
+ #private;
1713
+ readonly id: string;
1714
+ readonly name: string;
1715
+ readonly kind: "user";
1716
+ readonly displayName: string;
1717
+ readonly email: string | undefined;
1718
+ readonly admin: boolean;
1719
+ readonly guest: boolean;
1720
+ /** @internal Handles come from the SDK, never from `new`. */
1721
+ constructor(ctx: HandleContext, data: LinearUserData);
1722
+ /** Create an issue. Sends `Issue` (`create`); with `delegate`, it opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
1723
+ createIssue(issue: {
1724
+ title: string;
1725
+ description?: string;
1726
+ priority?: number;
1727
+ state?: string;
1728
+ labels?: string[];
1729
+ assignee?: LinearUser;
1730
+ delegate?: LinearApp;
1731
+ parent?: LinearIssue;
1732
+ }, options: {
1733
+ team: LinearTeam;
1734
+ }): Promise<LinearIssue>;
1735
+ /** Edit an issue's title, description or priority. Sends `Issue` (`update`). Experimental. */
1736
+ editIssue(changes: {
1737
+ title?: string;
1738
+ description?: string;
1739
+ priority?: number;
1740
+ }, options: {
1741
+ issue: LinearIssue;
1742
+ }): Promise<LinearDelivery | undefined>;
1743
+ /** Take an issue back from the app. Sends `Issue` (`update`). Experimental. */
1744
+ undelegate(options: {
1745
+ issue: LinearIssue;
1746
+ }): Promise<LinearDelivery | undefined>;
1747
+ /** Assign an issue to a person, or (with no one) unassign it. Sends `Issue` (`update`). Experimental. */
1748
+ assign(assignee: LinearUser | undefined, options: {
1749
+ issue: LinearIssue;
1750
+ }): Promise<LinearDelivery | undefined>;
1751
+ /** Move an issue to a workflow state, by name. Sends `Issue` (`update`). Experimental. */
1752
+ setState(state: string, options: {
1753
+ issue: LinearIssue;
1754
+ }): Promise<LinearDelivery | undefined>;
1755
+ /** Put labels on an issue, by name. Sends `Issue` (`update`). Experimental. */
1756
+ label(labels: string | string[], options: {
1757
+ issue: LinearIssue;
1758
+ }): Promise<LinearDelivery | undefined>;
1759
+ /** Delegate an issue to the app. Opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
1760
+ delegate(app: LinearApp, options: {
1761
+ issue: LinearIssue;
1762
+ }): Promise<LinearAgentSession>;
1763
+ /** Comment on an issue. A mention of the app opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
1764
+ comment(body: string, options: {
1765
+ issue: LinearIssue;
1766
+ }): Promise<LinearComment>;
1767
+ /** Reply in a comment's thread. In an agent session's thread, it prompts the session (`AgentSessionEvent` `prompted`). Experimental. */
1768
+ reply(body: string, options: {
1769
+ comment: LinearComment;
1770
+ }): Promise<LinearComment>;
1771
+ /** Edit a comment. Sends `Comment` (`update`). Experimental. */
1772
+ edit(body: string, options: {
1773
+ comment: LinearComment;
1774
+ }): Promise<LinearDelivery | undefined>;
1775
+ /** Delete a comment. Sends `Comment` (`remove`). Experimental. */
1776
+ delete(options: {
1777
+ comment: LinearComment;
1778
+ }): Promise<LinearDelivery | undefined>;
1779
+ /** React to a comment with an emoji. Linear sends no webhook for it. Experimental. */
1780
+ react(emoji: string, options: {
1781
+ comment: LinearComment;
1782
+ }): Promise<void>;
1783
+ /** Send a follow-up in an agent session. Sends `AgentSessionEvent` (`prompted`). Experimental. */
1784
+ prompt(body: string, options: {
1785
+ session: LinearAgentSession;
1786
+ }): Promise<LinearDelivery | undefined>;
1787
+ /** Answer a question the agent asked (an `elicitation` activity). Sends `AgentSessionEvent` (`prompted`). Experimental. */
1788
+ answer(body: string, options: {
1789
+ elicitation: LinearAgentActivity;
1790
+ }): Promise<LinearDelivery | undefined>;
1791
+ /** Press Stop on an agent session. Sends `AgentSessionEvent` (`prompted`) with the `stop` signal. Experimental. */
1792
+ stop(options: {
1793
+ session: LinearAgentSession;
1794
+ }): Promise<LinearDelivery>;
1795
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1796
+ [QUIET](): Promise<QuietState>;
1797
+ }
1798
+ /** Wire data of a {@link LinearTeam}. */
1799
+ export interface LinearTeamData {
1800
+ id: string;
1801
+ key: string;
1802
+ name: string;
1803
+ }
1804
+ export declare class LinearTeam {
1805
+ #private;
1806
+ readonly id: string;
1807
+ readonly key: string;
1808
+ readonly name: string;
1809
+ /** @internal Handles come from the SDK, never from `new`. */
1810
+ constructor(ctx: HandleContext, data: LinearTeamData);
1811
+ /** An issue of this team by its identifier (`ENG-12`). Experimental. */
1812
+ issue(identifier: string): Promise<LinearIssue>;
1813
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1814
+ [QUIET](): Promise<QuietState>;
1815
+ }
1816
+ /** Wire data of a {@link LinearIssue}. */
1817
+ export interface LinearIssueData {
1818
+ id: string;
1819
+ identifier: string;
1820
+ url: string;
1821
+ team: LinearTeamData;
1822
+ creator: LinearUserData | LinearAppData;
1823
+ }
1824
+ export declare class LinearIssue {
1825
+ #private;
1826
+ readonly id: string;
1827
+ readonly identifier: string;
1828
+ readonly url: string;
1829
+ readonly team: LinearTeam;
1830
+ readonly creator: LinearUser | LinearApp;
1831
+ /** @internal Handles come from the SDK, never from `new`. */
1832
+ constructor(ctx: HandleContext, data: LinearIssueData);
1833
+ /** Read the issue again. Experimental. */
1834
+ refresh(): Promise<LinearIssue>;
1835
+ /** The issue's title as it is now. Experimental. */
1836
+ title(): Promise<string>;
1837
+ /** The issue's workflow state. Experimental. */
1838
+ state(): Promise<LinearIssueState>;
1839
+ /** Who the issue is assigned to, if anyone. Experimental. */
1840
+ assignee(): Promise<LinearUser | undefined>;
1841
+ /** The app the issue is delegated to, if any. Experimental. */
1842
+ delegatedTo(): Promise<LinearApp | undefined>;
1843
+ /** The names of the labels on the issue. Experimental. */
1844
+ labels(): Promise<string[]>;
1845
+ /** The comments on the issue, oldest first, without the one Linear writes to open a delegated session's thread. Experimental. */
1846
+ comments(): Promise<LinearComments>;
1847
+ /** The agent sessions on the issue, oldest first. Experimental. */
1848
+ sessions(): Promise<LinearAgentSessions>;
1849
+ /** The issue's latest agent session, waiting for one to be opened. Experimental. */
1850
+ session(): Promise<LinearAgentSession>;
1851
+ /** The issue as a person reads it: description, comments and the agent's sessions. Experimental. */
1852
+ transcript(): Promise<LinearTranscript>;
1853
+ /** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
1854
+ waitForComment(options?: {
1855
+ from?: LinearUser | LinearApp | string;
1856
+ body?: string | RegExp;
1857
+ } & WaitOptions): Promise<LinearComment>;
1858
+ /** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
1859
+ latestComment(options?: {
1860
+ from?: LinearUser | LinearApp | string;
1861
+ } & QuietOptions): Promise<LinearComment>;
1862
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1863
+ [QUIET](): Promise<QuietState>;
1864
+ }
1865
+ /** Wire data of a {@link LinearDelivery}. */
1866
+ export interface LinearDeliveryData {
1867
+ id: string;
1868
+ channel: "linear";
1869
+ type: string;
1870
+ action: string;
1871
+ webhookId: string;
1872
+ payload?: unknown;
1873
+ attempts: DeliveryAttempt[];
1874
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1875
+ }
1876
+ export declare class LinearDelivery {
1877
+ #private;
1878
+ readonly id: string;
1879
+ readonly channel: "linear";
1880
+ readonly type: string;
1881
+ readonly action: string;
1882
+ readonly webhookId: string;
1883
+ readonly payload: unknown | undefined;
1884
+ readonly attempts: DeliveryAttempt[];
1885
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1886
+ /** @internal Handles come from the SDK, never from `new`. */
1887
+ constructor(ctx: HandleContext, data: LinearDeliveryData);
1888
+ /** Re-read a delivery: its attempts and status. Experimental. */
1889
+ refresh(): Promise<LinearDelivery>;
1890
+ /** Redeliver, as Linear retries: the same delivery, with a new `webhookTimestamp` and a new signature. Experimental. */
1891
+ redeliver(): Promise<DeliveryAttempt>;
1892
+ /** Send the delivery again: stale (its `webhookTimestamp` two minutes old), or signed with a secret that isn't the app's. Experimental. */
1893
+ resend(options?: {
1894
+ badSignature?: boolean;
1895
+ stale?: boolean;
1896
+ }): Promise<DeliveryAttempt>;
1897
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
1898
+ settled(options?: WaitOptions): Promise<LinearDelivery>;
1899
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1900
+ [QUIET](): Promise<QuietState>;
1901
+ }
1902
+ /** Wire data of a {@link LinearAgentSession}. */
1903
+ export interface LinearAgentSessionData {
1904
+ id: string;
1905
+ issue: LinearIssueData;
1906
+ app: LinearAppData;
1907
+ startedBy: LinearUserData;
1908
+ delivery?: LinearDeliveryData;
1909
+ }
1910
+ export declare class LinearAgentSession {
1911
+ #private;
1912
+ readonly id: string;
1913
+ readonly issue: LinearIssue;
1914
+ readonly app: LinearApp;
1915
+ readonly startedBy: LinearUser;
1916
+ readonly delivery: LinearDelivery | undefined;
1917
+ /** @internal Handles come from the SDK, never from `new`. */
1918
+ constructor(ctx: HandleContext, data: LinearAgentSessionData);
1919
+ /** The session's status. Experimental. */
1920
+ state(): Promise<"pending" | "active" | "stopping" | "awaitingInput" | "complete" | "error" | "stale">;
1921
+ /** The session's activities, oldest first: the agent's, and the prompts of people. Experimental. */
1922
+ activities(): Promise<LinearAgentActivities>;
1923
+ /** The links the agent attached to the session. Experimental. */
1924
+ externalUrls(): Promise<LinearExternalUrls>;
1925
+ /** The agent's plan: each step and its status. Experimental. */
1926
+ plan(): Promise<LinearPlan>;
1927
+ /** The session as a person reads it. Experimental. */
1928
+ transcript(): Promise<LinearTranscript>;
1929
+ /** Wait for the agent session to reach that state: one of the values given. Resolves with the value as it is then. */
1930
+ 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">;
1931
+ /** Wait for the next new activity, after the last one this handle saw. */
1932
+ waitForActivity(options?: {
1933
+ type?: string | RegExp;
1934
+ } & WaitOptions): Promise<LinearAgentActivity>;
1935
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1936
+ [QUIET](): Promise<QuietState>;
1937
+ }
1938
+ /** Wire data of a {@link LinearComment}. */
1939
+ export interface LinearCommentData {
1940
+ id: string;
1941
+ issue: LinearIssueData;
1942
+ author: LinearUserData | LinearAppData;
1943
+ body: string;
1944
+ createdAt: string;
1945
+ url: string;
1946
+ session?: LinearAgentSessionData;
1947
+ delivery?: LinearDeliveryData;
1948
+ }
1949
+ export declare class LinearComment {
1950
+ #private;
1951
+ readonly id: string;
1952
+ readonly issue: LinearIssue;
1953
+ readonly author: LinearUser | LinearApp;
1954
+ readonly body: string;
1955
+ readonly createdAt: string;
1956
+ readonly url: string;
1957
+ readonly session: LinearAgentSession | undefined;
1958
+ readonly delivery: LinearDelivery | undefined;
1959
+ /** @internal Handles come from the SDK, never from `new`. */
1960
+ constructor(ctx: HandleContext, data: LinearCommentData);
1961
+ /** The replies in a comment's thread, once the agent is quiet. Experimental. */
1962
+ replies(): Promise<LinearCommentReplies>;
1963
+ /** A comment's thread as a person reads it. Experimental. */
1964
+ transcript(): Promise<LinearTranscript>;
1965
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1966
+ [QUIET](): Promise<QuietState>;
1967
+ }
1968
+ /** Wire data of a {@link LinearAgentActivity}. */
1969
+ export interface LinearAgentActivityData {
1970
+ id: string;
1971
+ session: LinearAgentSessionData;
1972
+ type: "thought" | "action" | "elicitation" | "response" | "error" | "prompt";
1973
+ author: LinearUserData | LinearAppData;
1974
+ body?: string;
1975
+ action?: {
1976
+ action: string;
1977
+ parameter?: string;
1978
+ result?: string;
1979
+ };
1980
+ ephemeral: boolean;
1981
+ createdAt: string;
1982
+ }
1983
+ export declare class LinearAgentActivity {
1984
+ #private;
1985
+ readonly id: string;
1986
+ readonly session: LinearAgentSession;
1987
+ readonly type: "thought" | "action" | "elicitation" | "response" | "error" | "prompt";
1988
+ readonly author: LinearUser | LinearApp;
1989
+ readonly body: string | undefined;
1990
+ readonly action: {
1991
+ action: string;
1992
+ parameter?: string;
1993
+ result?: string;
1994
+ } | undefined;
1995
+ readonly ephemeral: boolean;
1996
+ readonly createdAt: string;
1997
+ /** @internal Handles come from the SDK, never from `new`. */
1998
+ constructor(ctx: HandleContext, data: LinearAgentActivityData);
1999
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2000
+ [QUIET](): Promise<QuietState>;
2001
+ }
2002
+ /** Wire data of a {@link NotionFixture}. */
2003
+ export interface NotionFixtureData {
2004
+ app: NotionIntegrationData;
2005
+ apiUrl: string;
2006
+ }
2007
+ export declare class NotionFixture {
2008
+ #private;
2009
+ readonly app: NotionIntegration;
2010
+ readonly apiUrl: string;
2011
+ /** @internal Handles come from the SDK, never from `new`. */
2012
+ constructor(ctx: HandleContext, data: NotionFixtureData);
2013
+ /** Create a person in the workspace. Experimental. */
2014
+ createUser(options: {
2015
+ name: string;
2016
+ id?: string;
2017
+ email?: string;
2018
+ avatarUrl?: string;
2019
+ token?: string;
2020
+ }): Promise<NotionUser>;
2021
+ /** 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. */
2022
+ createPage(options: {
2023
+ title: string;
2024
+ parent?: NotionPage;
2025
+ content?: string | {
2026
+ path: string;
2027
+ } | unknown[];
2028
+ icon?: string;
2029
+ connections?: NotionIntegration[];
2030
+ createdBy?: NotionUser;
2031
+ }): Promise<NotionPage>;
2032
+ /** Create a database with its property schema and rows, as seed data. Experimental. */
2033
+ createDatabase(options: {
2034
+ title: string;
2035
+ parent?: NotionPage;
2036
+ properties: Record<string, NotionPropertySchema>;
2037
+ rows?: Array<Record<string, NotionPropertyValue>>;
2038
+ connections?: NotionIntegration[];
2039
+ }): Promise<NotionDatabase>;
2040
+ /** How long Notion holds `page.content_updated` to batch edits, for this session (fake only). Default one second. Experimental. */
2041
+ setContentUpdateDelay(delay: Duration): Promise<void>;
2042
+ /** Send the subscription's verification request (`{ verification_token }`), as Notion does once when a subscription is created. Experimental. */
2043
+ sendVerification(): Promise<NotionDelivery | undefined>;
2044
+ /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
2045
+ deliveries(options?: {
2046
+ type?: string;
2047
+ resource?: NotionPage;
2048
+ }): Promise<NotionDeliveries>;
2049
+ /** The REST calls the agent made about this session's pages, by the client's method name (`comments.create`). Experimental. */
2050
+ calls(options?: {
2051
+ operation?: string;
2052
+ error?: true | string;
2053
+ }): Promise<NotionApiCalls>;
2054
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
2055
+ waitForCall(filter: {
2056
+ operation?: string;
2057
+ error?: true | string;
2058
+ }, options?: WaitOptions): Promise<NotionApiCall>;
2059
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2060
+ [QUIET](): Promise<QuietState>;
2061
+ }
2062
+ /** Wire data of a {@link NotionIntegration}. */
2063
+ export interface NotionIntegrationData {
2064
+ id: string;
2065
+ name: string;
2066
+ kind: "app";
2067
+ channel: "notion";
2068
+ botUserId: string;
2069
+ token: string;
2070
+ webhookSecret: string;
2071
+ }
2072
+ export declare class NotionIntegration {
2073
+ #private;
2074
+ readonly id: string;
2075
+ readonly name: string;
2076
+ readonly kind: "app";
2077
+ readonly channel: "notion";
2078
+ readonly botUserId: string;
2079
+ readonly token: string;
2080
+ readonly webhookSecret: string;
2081
+ /** @internal Handles come from the SDK, never from `new`. */
2082
+ constructor(ctx: HandleContext, data: NotionIntegrationData);
2083
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2084
+ [QUIET](): Promise<QuietState>;
2085
+ }
2086
+ /** Wire data of a {@link NotionUser}. */
2087
+ export interface NotionUserData {
2088
+ id: string;
2089
+ name: string;
2090
+ kind: "user";
2091
+ channel: "notion";
2092
+ email?: string;
2093
+ }
2094
+ export declare class NotionUser {
2095
+ #private;
2096
+ readonly id: string;
2097
+ readonly name: string;
2098
+ readonly kind: "user";
2099
+ readonly channel: "notion";
2100
+ readonly email: string | undefined;
2101
+ /** @internal Handles come from the SDK, never from `new`. */
2102
+ constructor(ctx: HandleContext, data: NotionUserData);
2103
+ /** 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. */
2104
+ comment(text: string, options: {
2105
+ page: NotionPage;
2106
+ anchor?: string | RegExp;
2107
+ }): Promise<NotionComment>;
2108
+ /** Reply in a discussion. Sends `comment.created`. Experimental. */
2109
+ reply(text: string, options: {
2110
+ discussion: NotionDiscussion;
2111
+ }): Promise<NotionComment>;
2112
+ /** Edit one of this person's comments. Sends `comment.updated`. Experimental. */
2113
+ editComment(text: string, options: {
2114
+ comment: NotionComment;
2115
+ }): Promise<NotionDelivery | undefined>;
2116
+ /** Delete one of this person's comments. Sends `comment.deleted`. Experimental. */
2117
+ deleteComment(options: {
2118
+ comment: NotionComment;
2119
+ }): Promise<NotionDelivery | undefined>;
2120
+ /** Resolve a discussion. Notion sends no event for it, and the API no longer lists its comments. Experimental. */
2121
+ resolve(options: {
2122
+ discussion: NotionDiscussion;
2123
+ }): Promise<NotionDelivery | undefined>;
2124
+ /** Reopen a resolved discussion. Experimental. */
2125
+ reopen(options: {
2126
+ discussion: NotionDiscussion;
2127
+ }): Promise<NotionDelivery | undefined>;
2128
+ /** Create a page as this person. Sends `page.created` if the integration can see it. Experimental. */
2129
+ createPage(page: {
2130
+ title: string;
2131
+ parent?: NotionPage;
2132
+ content?: string | {
2133
+ path: string;
2134
+ } | unknown[];
2135
+ icon?: string;
2136
+ connections?: NotionIntegration[];
2137
+ }): Promise<NotionPage>;
2138
+ /** Edit a page's body: append, or replace it. Sends one `page.content_updated` once Notion's batching delay is over. Experimental. */
2139
+ edit(change: {
2140
+ append?: string | {
2141
+ path: string;
2142
+ } | unknown[];
2143
+ replace?: string | {
2144
+ path: string;
2145
+ } | unknown[];
2146
+ }, options: {
2147
+ page: NotionPage;
2148
+ }): Promise<NotionDelivery | undefined>;
2149
+ /** Change a page's title. Sends `page.properties_updated`. Experimental. */
2150
+ rename(title: string, options: {
2151
+ page: NotionPage;
2152
+ }): Promise<NotionDelivery | undefined>;
2153
+ /** 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. */
2154
+ mention(integration: NotionIntegration, options: {
2155
+ page: NotionPage;
2156
+ inBlock?: string | RegExp;
2157
+ }): Promise<NotionDelivery | undefined>;
2158
+ /** Set a property of a database row. Sends `page.properties_updated`. Experimental. */
2159
+ setProperty(name: string, value: NotionPropertyValue, options: {
2160
+ page: NotionPage;
2161
+ }): Promise<NotionDelivery | undefined>;
2162
+ /** Add a row to a database. Sends `page.created` if the integration can see the database. Experimental. */
2163
+ addRow(values: Record<string, NotionPropertyValue>, options: {
2164
+ database: NotionDatabase;
2165
+ }): Promise<NotionPage>;
2166
+ /** Connect the integration to a page (Share → Connections): it sees the page and everything under it. Experimental. */
2167
+ connect(integration: NotionIntegration, options: {
2168
+ page: NotionPage;
2169
+ }): Promise<void>;
2170
+ /** Remove the integration's connection from a page. Experimental. */
2171
+ disconnect(integration: NotionIntegration, options: {
2172
+ page: NotionPage;
2173
+ }): Promise<void>;
2174
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2175
+ [QUIET](): Promise<QuietState>;
2176
+ }
2177
+ /** Wire data of a {@link NotionPage}. */
2178
+ export interface NotionPageData {
2179
+ id: string;
2180
+ channel: "notion";
2181
+ title: string;
2182
+ url: string;
2183
+ }
2184
+ export declare class NotionPage {
2185
+ #private;
2186
+ readonly id: string;
2187
+ readonly channel: "notion";
2188
+ readonly title: string;
2189
+ readonly url: string;
2190
+ /** @internal Handles come from the SDK, never from `new`. */
2191
+ constructor(ctx: HandleContext, data: NotionPageData);
2192
+ /** The page's discussions: on the page itself, and on its blocks. Experimental. */
2193
+ discussions(): Promise<NotionDiscussions>;
2194
+ /** The page body as Markdown, once the agent is quiet. Experimental. */
2195
+ markdown(): Promise<string>;
2196
+ /** The page's blocks as the API has them, with nested blocks under `children`. Experimental. */
2197
+ blocks(): Promise<NotionBlocks>;
2198
+ /** A property's value as a person reads it: text, a number, option names, ids. Experimental. */
2199
+ property(name: string): Promise<NotionPropertyValue>;
2200
+ /** The pages directly under this page. Experimental. */
2201
+ children(): Promise<NotionChildPages>;
2202
+ /** The integrations that can see the page: connected to it or to a page above it. Experimental. */
2203
+ connections(): Promise<NotionConnections>;
2204
+ /** The page and its discussions as a person reads them. Experimental. */
2205
+ transcript(): Promise<NotionTranscript>;
2206
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2207
+ [QUIET](): Promise<QuietState>;
2208
+ }
2209
+ /** Wire data of a {@link NotionDatabase}. */
2210
+ export interface NotionDatabaseData {
2211
+ id: string;
2212
+ channel: "notion";
2213
+ title: string;
2214
+ url: string;
2215
+ }
2216
+ export declare class NotionDatabase {
2217
+ #private;
2218
+ readonly id: string;
2219
+ readonly channel: "notion";
2220
+ readonly title: string;
2221
+ readonly url: string;
2222
+ /** @internal Handles come from the SDK, never from `new`. */
2223
+ constructor(ctx: HandleContext, data: NotionDatabaseData);
2224
+ /** The rows of a database, optionally only those whose properties have these values. Experimental. */
2225
+ rows(filter?: Record<string, NotionPropertyValue>): Promise<NotionRows>;
2226
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2227
+ [QUIET](): Promise<QuietState>;
2228
+ }
2229
+ /** Wire data of a {@link NotionDelivery}. */
2230
+ export interface NotionDeliveryData {
2231
+ id: string;
2232
+ channel: "notion";
2233
+ type: string;
2234
+ entity: {
2235
+ type: string;
2236
+ id: string;
2237
+ };
2238
+ payload?: unknown;
2239
+ attempts: DeliveryAttempt[];
2240
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2241
+ }
2242
+ export declare class NotionDelivery {
2243
+ #private;
2244
+ readonly id: string;
2245
+ readonly channel: "notion";
2246
+ readonly type: string;
2247
+ readonly entity: {
2248
+ type: string;
2249
+ id: string;
2250
+ };
2251
+ readonly payload: unknown | undefined;
2252
+ readonly attempts: DeliveryAttempt[];
2253
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2254
+ /** @internal Handles come from the SDK, never from `new`. */
2255
+ constructor(ctx: HandleContext, data: NotionDeliveryData);
2256
+ /** Re-read a delivery: its attempts and status. Experimental. */
2257
+ refresh(): Promise<NotionDelivery>;
2258
+ /** Send the same event again, as a retry does: the same body, the next `attempt_number`, signed again. Experimental. */
2259
+ redeliver(): Promise<DeliveryAttempt>;
2260
+ /** Send the delivery again, signed with a token that isn't the subscription's. Experimental. */
2261
+ resend(options?: {
2262
+ badSignature?: boolean;
2263
+ }): Promise<DeliveryAttempt>;
2264
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
2265
+ settled(options?: WaitOptions): Promise<NotionDelivery>;
2266
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2267
+ [QUIET](): Promise<QuietState>;
2268
+ }
2269
+ /** Wire data of a {@link NotionComment}. */
2270
+ export interface NotionCommentData {
2271
+ id: string;
2272
+ discussion: NotionDiscussionData;
2273
+ author: NotionUserData | NotionIntegrationData;
2274
+ text: string;
2275
+ createdAt: string;
2276
+ delivery?: NotionDeliveryData;
2277
+ }
2278
+ export declare class NotionComment {
2279
+ #private;
2280
+ readonly id: string;
2281
+ readonly discussion: NotionDiscussion;
2282
+ readonly author: NotionUser | NotionIntegration;
2283
+ readonly text: string;
2284
+ readonly createdAt: string;
2285
+ readonly delivery: NotionDelivery | undefined;
2286
+ /** @internal Handles come from the SDK, never from `new`. */
2287
+ constructor(ctx: HandleContext, data: NotionCommentData);
2288
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2289
+ [QUIET](): Promise<QuietState>;
2290
+ }
2291
+ /** Wire data of a {@link NotionDiscussion}. */
2292
+ export interface NotionDiscussionData {
2293
+ id: string;
2294
+ page: NotionPageData;
2295
+ anchor?: string;
2296
+ }
2297
+ export declare class NotionDiscussion {
2298
+ #private;
2299
+ readonly id: string;
2300
+ readonly page: NotionPage;
2301
+ readonly anchor: string | undefined;
2302
+ /** @internal Handles come from the SDK, never from `new`. */
2303
+ constructor(ctx: HandleContext, data: NotionDiscussionData);
2304
+ /** The discussion's comments, oldest first. Experimental. */
2305
+ comments(): Promise<NotionComments>;
2306
+ /** Whether the discussion is resolved. Experimental. */
2307
+ resolved(): Promise<boolean>;
2308
+ /** The discussion as a person reads it. Experimental. */
2309
+ transcript(): Promise<NotionTranscript>;
2310
+ /** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
2311
+ waitForComment(options?: {
2312
+ from?: NotionUser | NotionIntegration | string;
2313
+ } & WaitOptions): Promise<NotionComment>;
2314
+ /** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
2315
+ latestComment(options?: {
2316
+ from?: NotionUser | NotionIntegration | string;
2317
+ } & QuietOptions): Promise<NotionComment>;
2318
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2319
+ [QUIET](): Promise<QuietState>;
2320
+ }
2321
+ /** Wire data of a {@link ResendFixture}. */
2322
+ export interface ResendFixtureData {
2323
+ app: ResendAppData;
2324
+ apiUrl: string;
2325
+ }
2326
+ export declare class ResendFixture {
2327
+ #private;
2328
+ readonly app: ResendApp;
2329
+ readonly apiUrl: string;
2330
+ /** @internal Handles come from the SDK, never from `new`. */
2331
+ constructor(ctx: HandleContext, data: ResendFixtureData);
2332
+ /** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
2333
+ createUser(options: {
2334
+ name: string;
2335
+ address?: string;
2336
+ token?: string;
2337
+ }): Promise<ResendUser>;
2338
+ /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
2339
+ deliveries(options?: {
2340
+ type?: string;
2341
+ resource?: ResendThread;
2342
+ }): Promise<ResendDeliveries>;
2343
+ /** The REST calls the agent made about this session's emails, by the SDK's method name (`emails.send`). Experimental. */
2344
+ calls(options?: {
2345
+ operation?: string;
2346
+ error?: true | string;
2347
+ }): Promise<ResendApiCalls>;
2348
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
2349
+ waitForCall(filter: {
2350
+ operation?: string;
2351
+ error?: true | string;
2352
+ }, options?: WaitOptions): Promise<ResendApiCall>;
2353
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2354
+ [QUIET](): Promise<QuietState>;
2355
+ }
2356
+ /** Wire data of a {@link ResendApp}. */
2357
+ export interface ResendAppData {
2358
+ id: string;
2359
+ channel: "resend";
2360
+ kind: "app";
2361
+ name: string;
2362
+ botUserId: string;
2363
+ address: string;
2364
+ }
2365
+ export declare class ResendApp {
2366
+ #private;
2367
+ readonly id: string;
2368
+ readonly channel: "resend";
2369
+ readonly kind: "app";
2370
+ readonly name: string;
2371
+ readonly botUserId: string;
2372
+ readonly address: string;
2373
+ /** @internal Handles come from the SDK, never from `new`. */
2374
+ constructor(ctx: HandleContext, data: ResendAppData);
2375
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2376
+ [QUIET](): Promise<QuietState>;
2377
+ }
2378
+ /** Wire data of a {@link ResendUser}. */
2379
+ export interface ResendUserData {
2380
+ id: string;
2381
+ channel: "resend";
2382
+ kind: "user";
2383
+ name: string;
2384
+ address: string;
2385
+ }
2386
+ export declare class ResendUser {
2387
+ #private;
2388
+ readonly id: string;
2389
+ readonly channel: "resend";
2390
+ readonly kind: "user";
2391
+ readonly name: string;
2392
+ readonly address: string;
2393
+ /** @internal Handles come from the SDK, never from `new`. */
2394
+ constructor(ctx: HandleContext, data: ResendUserData);
2395
+ /** The person emails someone: the agent (`resend.app`), or another person. Experimental. */
2396
+ send(options: {
2397
+ to: Array<ResendUser | ResendApp>;
2398
+ cc?: Array<ResendUser | ResendApp>;
2399
+ subject: string;
2400
+ text?: string;
2401
+ html?: string;
2402
+ }): Promise<ResendEmail>;
2403
+ /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
2404
+ reply(email: ResendEmail, options?: {
2405
+ text?: string;
2406
+ html?: string;
2407
+ all?: boolean;
2408
+ }): Promise<ResendEmail>;
2409
+ /** What reached the person's mailbox, oldest first. Experimental. */
2410
+ inbox(): Promise<ResendInbox>;
2411
+ /** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
2412
+ waitForEmail(options?: {
2413
+ from?: ResendPrincipal | string;
2414
+ } & WaitOptions): Promise<ResendEmail>;
2415
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2416
+ [QUIET](): Promise<QuietState>;
2417
+ }
2418
+ /** Wire data of a {@link ResendEmail}. */
2419
+ export interface ResendEmailData {
2420
+ id: string;
2421
+ channel: "resend";
2422
+ thread: ResendThreadData;
2423
+ author: ResendPrincipal;
2424
+ from: string;
2425
+ to: string[];
2426
+ cc: string[];
2427
+ subject: string;
2428
+ text: string;
2429
+ at: string;
2430
+ messageId: string;
2431
+ delivery?: ResendDeliveryData;
2432
+ }
2433
+ export declare class ResendEmail {
2434
+ #private;
2435
+ readonly id: string;
2436
+ readonly channel: "resend";
2437
+ readonly thread: ResendThread;
2438
+ readonly author: ResendPrincipal;
2439
+ readonly from: string;
2440
+ readonly to: string[];
2441
+ readonly cc: string[];
2442
+ readonly subject: string;
2443
+ readonly text: string;
2444
+ readonly at: string;
2445
+ readonly messageId: string;
2446
+ readonly delivery: ResendDelivery | undefined;
2447
+ /** @internal Handles come from the SDK, never from `new`. */
2448
+ constructor(ctx: HandleContext, data: ResendEmailData);
2449
+ /** Re-read an email. Experimental. */
2450
+ refresh(): Promise<ResendEmail>;
2451
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2452
+ [QUIET](): Promise<QuietState>;
2453
+ }
2454
+ /** Wire data of a {@link ResendThread}. */
2455
+ export interface ResendThreadData {
2456
+ id: string;
2457
+ channel: "resend";
2458
+ subject: string;
2459
+ }
2460
+ export declare class ResendThread {
2461
+ #private;
2462
+ readonly id: string;
2463
+ readonly channel: "resend";
2464
+ readonly subject: string;
2465
+ /** @internal Handles come from the SDK, never from `new`. */
2466
+ constructor(ctx: HandleContext, data: ResendThreadData);
2467
+ /** Every email in the thread, oldest first. Experimental. */
2468
+ messages(): Promise<ResendMessages>;
2469
+ /** The thread's answers: every email after the first, oldest first. Experimental. */
2470
+ replies(): Promise<ResendReplies>;
2471
+ /** The thread as a person reads it: each email's own words, without the quoted history. Experimental. */
2472
+ transcript(): Promise<ResendTranscript>;
2473
+ /** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
2474
+ waitForReply(options?: {
2475
+ from?: ResendPrincipal | string;
2476
+ } & WaitOptions): Promise<ResendEmail>;
2477
+ /** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
2478
+ latestReply(options?: {
2479
+ from?: ResendPrincipal | string;
2480
+ } & QuietOptions): Promise<ResendEmail>;
2481
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2482
+ [QUIET](): Promise<QuietState>;
2483
+ }
2484
+ /** Wire data of a {@link ResendDelivery}. */
2485
+ export interface ResendDeliveryData {
2486
+ id: string;
2487
+ channel: "resend";
2488
+ type: string;
2489
+ email: string;
2490
+ payload?: unknown;
2491
+ attempts: DeliveryAttempt[];
2492
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2493
+ }
2494
+ export declare class ResendDelivery {
2495
+ #private;
2496
+ readonly id: string;
2497
+ readonly channel: "resend";
2498
+ readonly type: string;
2499
+ readonly email: string;
2500
+ readonly payload: unknown | undefined;
2501
+ readonly attempts: DeliveryAttempt[];
2502
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2503
+ /** @internal Handles come from the SDK, never from `new`. */
2504
+ constructor(ctx: HandleContext, data: ResendDeliveryData);
2505
+ /** Re-read a delivery: its attempts and status. Experimental. */
2506
+ refresh(): Promise<ResendDelivery>;
2507
+ /** Send the same webhook again, as Resend retries: the same `svix-id`, signed again. Experimental. */
2508
+ redeliver(): Promise<DeliveryAttempt>;
2509
+ /** 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. */
2510
+ resend(options?: {
2511
+ badSignature?: boolean;
2512
+ stale?: boolean;
2513
+ }): Promise<DeliveryAttempt>;
2514
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
2515
+ settled(options?: WaitOptions): Promise<ResendDelivery>;
2516
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2517
+ [QUIET](): Promise<QuietState>;
2518
+ }
2519
+ /** Wire data of a {@link GoogleFixture}. */
2520
+ export interface GoogleFixtureData {
2521
+ app: GoogleAppData;
2522
+ apiUrl: string;
2523
+ }
2524
+ export declare class GoogleFixture {
2525
+ #private;
2526
+ readonly app: GoogleApp;
2527
+ readonly apiUrl: string;
2528
+ /** @internal Handles come from the SDK, never from `new`. */
2529
+ constructor(ctx: HandleContext, data: GoogleFixtureData);
2530
+ /** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
2531
+ createUser(options: {
2532
+ name: string;
2533
+ address?: string;
2534
+ token?: string;
2535
+ }): Promise<GoogleUser>;
2536
+ /** Every push channelstack sent the agent for this session, with every attempt. Experimental. */
2537
+ deliveries(options?: {
2538
+ type?: string;
2539
+ resource?: GoogleThread;
2540
+ }): Promise<GoogleDeliveries>;
2541
+ /** The Gmail calls the agent made about this session's mail, by the SDK's method name (`users.messages.send`). Experimental. */
2542
+ calls(options?: {
2543
+ operation?: string;
2544
+ error?: true | string;
2545
+ }): Promise<GoogleApiCalls>;
2546
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
2547
+ waitForCall(filter: {
2548
+ operation?: string;
2549
+ error?: true | string;
2550
+ }, options?: WaitOptions): Promise<GoogleApiCall>;
2551
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2552
+ [QUIET](): Promise<QuietState>;
2553
+ }
2554
+ /** Wire data of a {@link GoogleApp}. */
2555
+ export interface GoogleAppData {
2556
+ id: string;
2557
+ channel: "google";
2558
+ kind: "app";
2559
+ name: string;
2560
+ botUserId: string;
2561
+ address: string;
2562
+ }
2563
+ export declare class GoogleApp {
2564
+ #private;
2565
+ readonly id: string;
2566
+ readonly channel: "google";
2567
+ readonly kind: "app";
2568
+ readonly name: string;
2569
+ readonly botUserId: string;
2570
+ readonly address: string;
2571
+ /** @internal Handles come from the SDK, never from `new`. */
2572
+ constructor(ctx: HandleContext, data: GoogleAppData);
2573
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2574
+ [QUIET](): Promise<QuietState>;
2575
+ }
2576
+ /** Wire data of a {@link GoogleUser}. */
2577
+ export interface GoogleUserData {
2578
+ id: string;
2579
+ channel: "google";
2580
+ kind: "user";
2581
+ name: string;
2582
+ address: string;
2583
+ }
2584
+ export declare class GoogleUser {
2585
+ #private;
2586
+ readonly id: string;
2587
+ readonly channel: "google";
2588
+ readonly kind: "user";
2589
+ readonly name: string;
2590
+ readonly address: string;
2591
+ /** @internal Handles come from the SDK, never from `new`. */
2592
+ constructor(ctx: HandleContext, data: GoogleUserData);
2593
+ /** The person emails someone: the agent (`google.app`), or another person. Experimental. */
2594
+ send(options: {
2595
+ to: Array<GoogleUser | GoogleApp>;
2596
+ cc?: Array<GoogleUser | GoogleApp>;
2597
+ subject: string;
2598
+ text?: string;
2599
+ html?: string;
2600
+ }): Promise<GoogleEmail>;
2601
+ /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
2602
+ reply(email: GoogleEmail, options?: {
2603
+ text?: string;
2604
+ html?: string;
2605
+ all?: boolean;
2606
+ }): Promise<GoogleEmail>;
2607
+ /** What reached the person's mailbox, oldest first. Experimental. */
2608
+ inbox(): Promise<GoogleInbox>;
2609
+ /** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
2610
+ waitForEmail(options?: {
2611
+ from?: GooglePrincipal | string;
2612
+ } & WaitOptions): Promise<GoogleEmail>;
2613
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2614
+ [QUIET](): Promise<QuietState>;
2615
+ }
2616
+ /** Wire data of a {@link GoogleEmail}. */
2617
+ export interface GoogleEmailData {
2618
+ id: string;
2619
+ channel: "google";
2620
+ thread: GoogleThreadData;
2621
+ author: GooglePrincipal;
2622
+ from: string;
2623
+ to: string[];
2624
+ cc: string[];
2625
+ subject: string;
2626
+ text: string;
2627
+ at: string;
2628
+ messageId: string;
2629
+ labels: string[];
2630
+ delivery?: GoogleDeliveryData;
2631
+ }
2632
+ export declare class GoogleEmail {
2633
+ #private;
2634
+ readonly id: string;
2635
+ readonly channel: "google";
2636
+ readonly thread: GoogleThread;
2637
+ readonly author: GooglePrincipal;
2638
+ readonly from: string;
2639
+ readonly to: string[];
2640
+ readonly cc: string[];
2641
+ readonly subject: string;
2642
+ readonly text: string;
2643
+ readonly at: string;
2644
+ readonly messageId: string;
2645
+ readonly labels: string[];
2646
+ readonly delivery: GoogleDelivery | undefined;
2647
+ /** @internal Handles come from the SDK, never from `new`. */
2648
+ constructor(ctx: HandleContext, data: GoogleEmailData);
2649
+ /** Re-read an email. Experimental. */
2650
+ refresh(): Promise<GoogleEmail>;
2651
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2652
+ [QUIET](): Promise<QuietState>;
2653
+ }
2654
+ /** Wire data of a {@link GoogleThread}. */
2655
+ export interface GoogleThreadData {
2656
+ id: string;
2657
+ channel: "google";
2658
+ subject: string;
2659
+ }
2660
+ export declare class GoogleThread {
2661
+ #private;
2662
+ readonly id: string;
2663
+ readonly channel: "google";
2664
+ readonly subject: string;
2665
+ /** @internal Handles come from the SDK, never from `new`. */
2666
+ constructor(ctx: HandleContext, data: GoogleThreadData);
2667
+ /** Every email in the thread, oldest first. Experimental. */
2668
+ messages(): Promise<GoogleMessages>;
2669
+ /** The thread's answers: every email after the first, oldest first. Experimental. */
2670
+ replies(): Promise<GoogleReplies>;
2671
+ /** The thread as a person reads it: each email's own words, without the quoted history. Experimental. */
2672
+ transcript(): Promise<GoogleTranscript>;
2673
+ /** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
2674
+ waitForReply(options?: {
2675
+ from?: GooglePrincipal | string;
2676
+ } & WaitOptions): Promise<GoogleEmail>;
2677
+ /** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
2678
+ latestReply(options?: {
2679
+ from?: GooglePrincipal | string;
2680
+ } & QuietOptions): Promise<GoogleEmail>;
2681
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2682
+ [QUIET](): Promise<QuietState>;
2683
+ }
2684
+ /** Wire data of a {@link GoogleDelivery}. */
2685
+ export interface GoogleDeliveryData {
2686
+ id: string;
2687
+ channel: "google";
2688
+ type: string;
2689
+ emailAddress: string;
2690
+ historyId: string;
2691
+ payload?: unknown;
2692
+ attempts: DeliveryAttempt[];
2693
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2694
+ }
2695
+ export declare class GoogleDelivery {
2696
+ #private;
2697
+ readonly id: string;
2698
+ readonly channel: "google";
2699
+ readonly type: string;
2700
+ readonly emailAddress: string;
2701
+ readonly historyId: string;
2702
+ readonly payload: unknown | undefined;
2703
+ readonly attempts: DeliveryAttempt[];
2704
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2705
+ /** @internal Handles come from the SDK, never from `new`. */
2706
+ constructor(ctx: HandleContext, data: GoogleDeliveryData);
2707
+ /** Re-read a delivery: its attempts and status. Experimental. */
2708
+ refresh(): Promise<GoogleDelivery>;
2709
+ /** Push the same message again, as Pub/Sub does when a push isn't acknowledged: the same message id. Experimental. */
2710
+ redeliver(): Promise<DeliveryAttempt>;
2711
+ /** 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. */
2712
+ resend(options?: {
2713
+ badSignature?: boolean;
2714
+ stale?: boolean;
2715
+ wrongAudience?: boolean;
2716
+ }): Promise<DeliveryAttempt>;
2717
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
2718
+ settled(options?: WaitOptions): Promise<GoogleDelivery>;
2719
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2720
+ [QUIET](): Promise<QuietState>;
2721
+ }
2722
+ /** Wire data of a {@link GitHubPullRequest}. */
2723
+ export interface GitHubPullRequestData extends GitHubIssueData {
2724
+ head: string;
2725
+ base: string;
2726
+ }
2727
+ export declare class GitHubPullRequest extends GitHubIssue {
2728
+ #private;
2729
+ readonly head: string;
2730
+ readonly base: string;
2731
+ /** @internal Handles come from the SDK, never from `new`. */
2732
+ constructor(ctx: HandleContext, data: GitHubPullRequestData);
2733
+ /** Read the pull request again. Experimental. */
2734
+ refresh(): Promise<GitHubPullRequest>;
2735
+ /** The newest commit of the pull request's branch, once the agent is quiet. Experimental. */
2736
+ headCommit(): Promise<GitHubCommit>;
2737
+ /** The submitted reviews, oldest first. Experimental. */
2738
+ reviews(): Promise<GitHubReviews>;
2739
+ /** The comments on the diff, oldest first. Experimental. */
2740
+ reviewComments(): Promise<GitHubReviewComments>;
2741
+ /** The check runs on the pull request's newest commit: the newest of each name. Experimental. */
2742
+ checkRuns(): Promise<GitHubPullCheckRuns>;
2743
+ /** Has the pull request been merged?. Experimental. */
2744
+ merged(): Promise<boolean>;
2745
+ }
2746
+ /** Attach to a running channelstack server, or start one, and return the client. */
2747
+ export declare function connect(options?: LaunchOptions): Promise<Channelstack>;