channelstack 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/README.md +1 -1
  2. package/dist/integrations/checks/index.d.ts +40 -7
  3. package/dist/integrations/checks/index.js +525 -69
  4. package/dist/integrations/matchers-core/index.d.ts +90 -11
  5. package/dist/integrations/matchers-core/index.js +356 -15
  6. package/dist/integrations/matchers-core/matchers.test.js +251 -3
  7. package/dist/integrations/vitest/index.d.ts +4 -2
  8. package/dist/integrations/vitest/setup.js +33 -3
  9. package/dist/sdks/typescript/client.d.ts +5 -4
  10. package/dist/sdks/typescript/client.js +4 -4
  11. package/dist/sdks/typescript/generated/channels.d.ts +17 -9
  12. package/dist/sdks/typescript/generated/channels.js +3 -1
  13. package/dist/sdks/typescript/generated/index.d.ts +1744 -313
  14. package/dist/sdks/typescript/generated/index.js +1991 -422
  15. package/dist/sdks/typescript/generated/normalisation.d.ts +18 -0
  16. package/dist/sdks/typescript/generated/normalisation.js +14 -0
  17. package/dist/sdks/typescript/runtime/client.d.ts +9 -0
  18. package/dist/sdks/typescript/runtime/client.js +5 -0
  19. package/dist/sdks/typescript/runtime/files.d.ts +17 -2
  20. package/dist/sdks/typescript/runtime/files.js +11 -3
  21. package/dist/sdks/typescript/runtime/launcher.d.ts +5 -2
  22. package/dist/sdks/typescript/runtime/launcher.js +6 -3
  23. package/dist/sdks/typescript/runtime/responder.d.ts +26 -0
  24. package/dist/sdks/typescript/runtime/responder.js +42 -0
  25. package/dist/sdks/typescript/runtime/wait.d.ts +14 -0
  26. package/dist/sdks/typescript/runtime/wait.js +23 -0
  27. package/dist/sdks/typescript/types.d.ts +16 -6
  28. package/package.json +9 -7
@@ -1,11 +1,12 @@
1
- import { ClientBase, type HandleContext, QUIET } from "../runtime/client.ts";
1
+ import { ClientBase, CONTEXT, type HandleContext, QUIET } from "../runtime/client.ts";
2
2
  import { type Duration } from "../runtime/duration.ts";
3
- import { type FileInput } from "../runtime/files.ts";
3
+ import { type FileInput, type MediaSource } from "../runtime/files.ts";
4
4
  import type { LaunchOptions } from "../runtime/launcher.ts";
5
+ import { type Responder } from "../runtime/responder.ts";
5
6
  import { ChannelstackError, type Transport } from "../runtime/transport.ts";
6
7
  import { type QuietOptions, type WaitOptions, type QuietState } from "../runtime/wait.ts";
7
8
  /** The server version this SDK was generated for. */
8
- export declare const VERSION = "0.1.1";
9
+ export declare const VERSION = "0.2.0";
9
10
  export declare class AccountInactiveError extends ChannelstackError {
10
11
  }
11
12
  export declare class ActionRequiresError extends ChannelstackError {
@@ -14,6 +15,12 @@ export declare class AlreadyInChannelError extends ChannelstackError {
14
15
  }
15
16
  export declare class AlreadyReactedError extends ChannelstackError {
16
17
  }
18
+ export declare class CannotDmBotError extends ChannelstackError {
19
+ }
20
+ export declare class CannotEditOthersMessageError extends ChannelstackError {
21
+ }
22
+ export declare class CannotMessageUserError extends ChannelstackError {
23
+ }
17
24
  export declare class CantDeleteMessageError extends ChannelstackError {
18
25
  }
19
26
  export declare class CantUpdateMessageError extends ChannelstackError {
@@ -22,6 +29,8 @@ export declare class CrossWorkspaceCredentialError extends ChannelstackError {
22
29
  }
23
30
  export declare class DispatchFailedError extends ChannelstackError {
24
31
  }
32
+ export declare class EmptyMessageError extends ChannelstackError {
33
+ }
25
34
  export declare class FakeActorInLiveWorldError extends ChannelstackError {
26
35
  }
27
36
  export declare class ForbiddenError extends ChannelstackError {
@@ -32,10 +41,18 @@ export declare class InvalidArgumentError extends ChannelstackError {
32
41
  }
33
42
  export declare class InvalidAuthError extends ChannelstackError {
34
43
  }
44
+ export declare class InvalidFormBodyError extends ChannelstackError {
45
+ }
35
46
  export declare class LiveMisconfiguredError extends ChannelstackError {
36
47
  }
37
48
  export declare class LiveNotAllowlistedError extends ChannelstackError {
38
49
  }
50
+ export declare class MethodNotSupportedForChannelTypeError extends ChannelstackError {
51
+ }
52
+ export declare class MissingAccessError extends ChannelstackError {
53
+ }
54
+ export declare class MissingPermissionsError extends ChannelstackError {
55
+ }
39
56
  export declare class MsgTooLongError extends ChannelstackError {
40
57
  }
41
58
  export declare class NameTakenError extends ChannelstackError {
@@ -52,18 +69,26 @@ export declare class NotInChannelError extends ChannelstackError {
52
69
  }
53
70
  export declare class NotInRoomError extends ChannelstackError {
54
71
  }
72
+ export declare class ObjectNotFoundError extends ChannelstackError {
73
+ }
74
+ export declare class RestrictedResourceError extends ChannelstackError {
75
+ }
55
76
  export declare class SessionNotFoundError extends ChannelstackError {
56
77
  }
57
78
  export declare class SplitViewUnavailableError extends ChannelstackError {
58
79
  }
59
80
  export declare class StopUnavailableError extends ChannelstackError {
60
81
  }
82
+ export declare class ThreadAlreadyCreatedError extends ChannelstackError {
83
+ }
61
84
  export declare class UnauthorizedError extends ChannelstackError {
62
85
  }
63
86
  export declare class UnsupportedInFakeError extends ChannelstackError {
64
87
  }
65
88
  export declare class UnsupportedInLiveError extends ChannelstackError {
66
89
  }
90
+ export declare class ValidationErrorError extends ChannelstackError {
91
+ }
67
92
  export declare class ValidationFailedError extends ChannelstackError {
68
93
  }
69
94
  export interface Status {
@@ -78,7 +103,7 @@ export interface EventPage {
78
103
  export interface LogEvent {
79
104
  at: string;
80
105
  driver: string;
81
- kind: "action" | "delivery" | "delivery_attempt" | "api_call";
106
+ kind: "action" | "delivery" | "delivery_attempt" | "api_call" | "bot_loop";
82
107
  data: Record<string, unknown>;
83
108
  summary?: {
84
109
  text: string;
@@ -90,8 +115,12 @@ export interface Quiet {
90
115
  busy: boolean;
91
116
  quietForMs: number;
92
117
  open: string[];
118
+ problems: string[];
119
+ loops?: string[];
93
120
  }
94
121
  export type Env = Record<string, string>;
122
+ export type EchoApps = EchoApp[];
123
+ export type EchoAppsWire = EchoAppData[];
95
124
  export interface EchoMessage {
96
125
  id: string;
97
126
  room: string;
@@ -131,10 +160,8 @@ export interface SlackTeam {
131
160
  id: string;
132
161
  name: string;
133
162
  }
134
- export type SlackUsers = SlackUser[];
135
- export type SlackUsersWire = SlackUserData[];
136
- export type SlackConversations = SlackConversation[];
137
- export type SlackConversationsWire = SlackConversationData[];
163
+ export type SlackApps = SlackApp[];
164
+ export type SlackAppsWire = SlackAppData[];
138
165
  export interface DeliveryAttempt {
139
166
  number: number;
140
167
  sentAt: string;
@@ -156,6 +183,10 @@ export interface SlackMessageMetadata {
156
183
  event_type: string;
157
184
  event_payload: Record<string, unknown>;
158
185
  }
186
+ export type SlackUsers = SlackUser[];
187
+ export type SlackUsersWire = SlackUserData[];
188
+ export type SlackConversations = SlackConversation[];
189
+ export type SlackConversationsWire = SlackConversationData[];
159
190
  export interface SlackButtonRef {
160
191
  label?: string;
161
192
  actionId?: string;
@@ -243,6 +274,24 @@ export interface SlackApiCall {
243
274
  }
244
275
  export type SlackUninstallDeliveries = SlackDelivery[];
245
276
  export type SlackUninstallDeliveriesWire = SlackDeliveryData[];
277
+ export type GitHubUsers = GitHubUser[];
278
+ export type GitHubUsersWire = GitHubUserData[];
279
+ export type GitHubRepos = GitHubRepo[];
280
+ export type GitHubReposWire = GitHubRepoData[];
281
+ export type GitHubIssues = GitHubIssueListing[];
282
+ export type GitHubIssuesWire = GitHubIssueListingWire[];
283
+ export interface GitHubIssueListing {
284
+ issue: GitHubIssue;
285
+ title: string;
286
+ pullRequest: boolean;
287
+ }
288
+ export interface GitHubIssueListingWire {
289
+ issue: GitHubIssueData;
290
+ title: string;
291
+ pullRequest: boolean;
292
+ }
293
+ export type GitHubApps = GitHubApp[];
294
+ export type GitHubAppsWire = GitHubAppData[];
246
295
  export type GitHubCommits = GitHubCommit[];
247
296
  export type GitHubCommitsWire = GitHubCommitData[];
248
297
  export type GitHubCheckRuns = GitHubCheckRun[];
@@ -339,6 +388,22 @@ export interface GitHubApiCall {
339
388
  error?: string;
340
389
  }
341
390
  export type GitHubAppCalls = GitHubApiCall[];
391
+ export type LinearApps = LinearApp[];
392
+ export type LinearAppsWire = LinearAppData[];
393
+ export type LinearUsers = LinearUser[];
394
+ export type LinearUsersWire = LinearUserData[];
395
+ export type LinearTeams = LinearTeam[];
396
+ export type LinearTeamsWire = LinearTeamData[];
397
+ export type LinearIssues = LinearIssueListing[];
398
+ export type LinearIssuesWire = LinearIssueListingWire[];
399
+ export interface LinearIssueListing {
400
+ issue: LinearIssue;
401
+ title: string;
402
+ }
403
+ export interface LinearIssueListingWire {
404
+ issue: LinearIssueData;
405
+ title: string;
406
+ }
342
407
  export interface LinearIssueState {
343
408
  name: string;
344
409
  type: "backlog" | "unstarted" | "started" | "completed" | "canceled" | "triage" | "duplicate";
@@ -398,6 +463,13 @@ export interface LinearApiCall {
398
463
  response?: unknown;
399
464
  error?: string;
400
465
  }
466
+ export type NotionCapability = "read_content" | "update_content" | "insert_content" | "read_comments" | "insert_comments" | "read_user_info";
467
+ export type NotionIntegrations = NotionIntegration[];
468
+ export type NotionIntegrationsWire = NotionIntegrationData[];
469
+ export type NotionUsers = NotionUser[];
470
+ export type NotionUsersWire = NotionUserData[];
471
+ export type NotionPages = NotionPage[];
472
+ export type NotionPagesWire = NotionPageData[];
401
473
  export type NotionPropertySchema = "title" | "rich_text" | "number" | "checkbox" | "date" | "people" | "url" | "email" | {
402
474
  select: string[];
403
475
  } | {
@@ -465,11 +537,17 @@ export interface NotionApiCall {
465
537
  response?: unknown;
466
538
  error?: string;
467
539
  }
540
+ export type ResendApps = ResendApp[];
541
+ export type ResendAppsWire = ResendAppData[];
468
542
  export interface ResendPrincipal {
469
543
  id: string;
470
544
  name: string;
471
545
  kind: "user" | "app";
472
546
  }
547
+ export type ResendUsers = ResendUser[];
548
+ export type ResendUsersWire = ResendUserData[];
549
+ export type ResendThreads = ResendThread[];
550
+ export type ResendThreadsWire = ResendThreadData[];
473
551
  export type ResendInbox = ResendEmail[];
474
552
  export type ResendInboxWire = ResendEmailData[];
475
553
  export type ResendMessages = ResendEmail[];
@@ -510,11 +588,17 @@ export interface ResendApiCall {
510
588
  response?: unknown;
511
589
  error?: string;
512
590
  }
591
+ export type GoogleApps = GoogleApp[];
592
+ export type GoogleAppsWire = GoogleAppData[];
513
593
  export interface GooglePrincipal {
514
594
  id: string;
515
595
  name: string;
516
596
  kind: "user" | "app";
517
597
  }
598
+ export type GoogleUsers = GoogleUser[];
599
+ export type GoogleUsersWire = GoogleUserData[];
600
+ export type GoogleThreads = GoogleThread[];
601
+ export type GoogleThreadsWire = GoogleThreadData[];
518
602
  export type GoogleInbox = GoogleEmail[];
519
603
  export type GoogleInboxWire = GoogleEmailData[];
520
604
  export type GoogleMessages = GoogleEmail[];
@@ -555,6 +639,341 @@ export interface GoogleApiCall {
555
639
  response?: unknown;
556
640
  error?: string;
557
641
  }
642
+ export interface DiscordGuild {
643
+ id: string;
644
+ name: string;
645
+ }
646
+ export type DiscordApps = DiscordApp[];
647
+ export type DiscordAppsWire = DiscordAppData[];
648
+ export interface DiscordMessageInput {
649
+ content?: string;
650
+ embeds?: unknown[];
651
+ }
652
+ export type DiscordUsers = DiscordUser[];
653
+ export type DiscordUsersWire = DiscordUserData[];
654
+ export type DiscordChannels = DiscordChannel[];
655
+ export type DiscordChannelsWire = DiscordChannelData[];
656
+ export interface DiscordButtonRef {
657
+ label?: string;
658
+ customId?: string;
659
+ }
660
+ export type DiscordEphemeralMessages = DiscordMessage[];
661
+ export type DiscordEphemeralMessagesWire = DiscordMessageData[];
662
+ export type DiscordMessages = DiscordMessage[];
663
+ export type DiscordMessagesWire = DiscordMessageData[];
664
+ export type DiscordMembers = Array<DiscordUser | DiscordApp>;
665
+ export type DiscordMembersWire = Array<DiscordUserData | DiscordAppData>;
666
+ export type DiscordThreads = DiscordChannel[];
667
+ export type DiscordThreadsWire = DiscordChannelData[];
668
+ export interface DiscordTranscript {
669
+ entries: DiscordTranscriptEntry[];
670
+ text: string;
671
+ toString(): string;
672
+ }
673
+ export interface DiscordTranscriptWire {
674
+ entries: DiscordTranscriptEntry[];
675
+ text: string;
676
+ }
677
+ export interface DiscordTranscriptEntry {
678
+ id: string;
679
+ author: DiscordPrincipal;
680
+ at: string;
681
+ text: string;
682
+ controls: string[];
683
+ edited: boolean;
684
+ depth: number;
685
+ replyTo?: string;
686
+ streaming?: "open";
687
+ visibleTo?: DiscordPrincipal;
688
+ }
689
+ export interface DiscordPrincipal {
690
+ id: string;
691
+ name: string;
692
+ kind: "user" | "app";
693
+ }
694
+ export type DiscordReplies = DiscordMessage[];
695
+ export type DiscordRepliesWire = DiscordMessageData[];
696
+ export type DiscordReactions = DiscordReaction[];
697
+ export type DiscordReactionsWire = DiscordReactionWire[];
698
+ export interface DiscordReaction {
699
+ emoji: string;
700
+ by: Array<DiscordUser | DiscordApp>;
701
+ }
702
+ export interface DiscordReactionWire {
703
+ emoji: string;
704
+ by: Array<DiscordUserData | DiscordAppData>;
705
+ }
706
+ export type DiscordMessageDeliveries = DiscordDelivery[];
707
+ export type DiscordMessageDeliveriesWire = DiscordDeliveryData[];
708
+ export interface DiscordEndpointCheck {
709
+ valid: boolean;
710
+ problems: string[];
711
+ deliveries: string[];
712
+ }
713
+ export type DiscordDeliveries = DiscordDelivery[];
714
+ export type DiscordDeliveriesWire = DiscordDeliveryData[];
715
+ export type DiscordApiCalls = DiscordApiCall[];
716
+ export interface DiscordApiCall {
717
+ id: string;
718
+ channel: "discord";
719
+ operation: string;
720
+ method: string;
721
+ path: string;
722
+ at: string;
723
+ durationMs: number;
724
+ request?: unknown;
725
+ responseStatus: number;
726
+ response?: unknown;
727
+ error?: string;
728
+ }
729
+ export type OpenAITurnInput = string | OpenAITurn;
730
+ export interface OpenAITurn {
731
+ text?: string | string[];
732
+ toolCalls?: OpenAIToolCallSpec[];
733
+ citations?: Array<{
734
+ quote: string;
735
+ url?: string;
736
+ title?: string;
737
+ file?: string;
738
+ }>;
739
+ image?: OpenAIMediaSource | OpenAIMediaSource[];
740
+ audio?: OpenAIMediaSource;
741
+ reasoning?: {
742
+ summary?: string | string[];
743
+ tokens?: number;
744
+ };
745
+ refusal?: string;
746
+ finish?: "stop" | "length" | "content_filter";
747
+ usage?: {
748
+ input?: number;
749
+ output?: number;
750
+ reasoning?: number;
751
+ cached?: number;
752
+ };
753
+ timing?: OpenAITiming;
754
+ failAfter?: {
755
+ chunks: number;
756
+ how?: "error" | "drop" | "stall";
757
+ };
758
+ pauseAfter?: number;
759
+ error?: "rate_limit" | "slow_down" | "insufficient_quota" | "credit_balance_exhausted" | "organization_spend_limit_exceeded" | "project_spend_limit_exceeded" | "organization_usage_limit_exceeded" | "server_error" | "overloaded" | "timeout" | "context_length_exceeded" | "content_policy" | "invalid_api_key" | "not_in_organization" | "ip_not_authorized" | "unsupported_region";
760
+ retryAfter?: number | string;
761
+ shouldRetry?: boolean;
762
+ message?: string;
763
+ }
764
+ export interface OpenAIToolCallSpec {
765
+ name?: string;
766
+ arguments?: Record<string, unknown> | string;
767
+ input?: string;
768
+ webSearch?: {
769
+ query: string;
770
+ action?: "search" | "open_page" | "find_in_page";
771
+ url?: string;
772
+ pattern?: string;
773
+ sources?: Array<{
774
+ url: string;
775
+ title?: string;
776
+ }>;
777
+ };
778
+ fileSearch?: {
779
+ queries: string[];
780
+ results?: Array<{
781
+ file: string;
782
+ text: string;
783
+ score?: number;
784
+ }>;
785
+ };
786
+ codeInterpreter?: {
787
+ code: string;
788
+ logs?: string;
789
+ files?: OpenAIMediaSource[];
790
+ };
791
+ imageGeneration?: {
792
+ image: OpenAIMediaSource;
793
+ revisedPrompt?: string;
794
+ };
795
+ mcp?: {
796
+ server: string;
797
+ tool: string;
798
+ arguments?: Record<string, unknown>;
799
+ output?: string;
800
+ error?: string;
801
+ approval?: boolean;
802
+ };
803
+ shell?: {
804
+ commands: string[];
805
+ output?: string;
806
+ };
807
+ computer?: {
808
+ actions: OpenAIComputerAction[];
809
+ };
810
+ applyPatch?: {
811
+ operations: OpenAIPatchOperation[];
812
+ };
813
+ }
814
+ export type OpenAIMediaSource = MediaSource;
815
+ export interface OpenAIComputerAction {
816
+ type: string;
817
+ }
818
+ export interface OpenAIPatchOperation {
819
+ type: "create_file" | "update_file" | "delete_file";
820
+ path: string;
821
+ diff?: string;
822
+ }
823
+ export interface OpenAITiming {
824
+ firstToken?: number | string;
825
+ betweenChunks?: number | string;
826
+ }
827
+ export interface OpenAIMatch {
828
+ text?: string | RegExp;
829
+ prompt?: string | RegExp;
830
+ tools?: string[];
831
+ toolResult?: boolean | string;
832
+ endpoint?: "chat.completions" | "responses" | "images.generations" | "images.edits" | "audio.speech" | "audio.transcriptions" | "audio.translations";
833
+ model?: string | RegExp;
834
+ stream?: boolean;
835
+ from?: SlackUser | GitHubUser | LinearUser | NotionUser | ResendUser | GoogleUser | DiscordUser;
836
+ in?: SlackConversation | GitHubRepo | LinearTeam | NotionPage | NotionDatabase | ResendThread | GoogleThread | DiscordChannel;
837
+ approval?: boolean;
838
+ }
839
+ export type OpenAICalls = OpenAICall[];
840
+ export type OpenAICallsWire = OpenAICallData[];
841
+ export type OpenAIEndpoint = "chat.completions" | "responses" | "images.generations" | "images.edits" | "audio.speech" | "audio.transcriptions" | "audio.translations";
842
+ export interface OpenAIRequest {
843
+ endpoint: OpenAIEndpoint;
844
+ model: string;
845
+ stream: boolean;
846
+ prompt?: string;
847
+ file?: OpenAIPart;
848
+ instructions?: string;
849
+ messages: OpenAIMessage[];
850
+ tools: OpenAITool[];
851
+ toolChoice?: unknown;
852
+ responseFormat?: unknown;
853
+ lastUserText?: string;
854
+ lastToolResults: Array<{
855
+ callId: string;
856
+ name?: string;
857
+ text: string;
858
+ }>;
859
+ text: string;
860
+ context: OpenAIContext;
861
+ body?: unknown;
862
+ headers: Record<string, string>;
863
+ }
864
+ export interface OpenAIPart {
865
+ type: "image" | "file" | "audio";
866
+ from: "data" | "file_id" | "url";
867
+ url?: string;
868
+ fileId?: string;
869
+ mediaType?: string;
870
+ bytes?: number;
871
+ sha256?: string;
872
+ filename?: string;
873
+ }
874
+ export interface OpenAIMessage {
875
+ role: "system" | "developer" | "user" | "assistant" | "tool";
876
+ text: string;
877
+ toolCalls?: Array<{
878
+ id: string;
879
+ name: string;
880
+ arguments?: unknown;
881
+ }>;
882
+ callId?: string;
883
+ name?: string;
884
+ parts?: OpenAIPart[];
885
+ }
886
+ export interface OpenAITool {
887
+ type: string;
888
+ name?: string;
889
+ description?: string;
890
+ parameters?: unknown;
891
+ strict?: boolean;
892
+ settings?: Record<string, unknown>;
893
+ }
894
+ export interface OpenAIContext {
895
+ channel?: string;
896
+ from?: OpenAIRef;
897
+ conversation?: OpenAIRef;
898
+ thread?: OpenAIRef;
899
+ message?: OpenAIRef;
900
+ attributedBy?: "minted_id" | "tag" | "owned_id" | "text" | "order";
901
+ matched?: string;
902
+ tiedWith?: string[];
903
+ }
904
+ export interface OpenAIRef {
905
+ id: string;
906
+ }
907
+ export interface OpenAIToolCall {
908
+ id: string;
909
+ type: "function" | "custom" | "web_search" | "file_search" | "code_interpreter" | "image_generation" | "mcp" | "shell" | "computer" | "apply_patch";
910
+ hosted: boolean;
911
+ name: string;
912
+ arguments?: unknown;
913
+ madeIn: string;
914
+ result?: {
915
+ text: string;
916
+ sentIn: string;
917
+ };
918
+ }
919
+ export type OpenAIPausedCalls = OpenAICall[];
920
+ export type OpenAIPausedCallsWire = OpenAICallData[];
921
+ export type OpenAIToolCalls = OpenAIToolCall[];
922
+ export interface OpenAIHeldPage {
923
+ held: OpenAIHeldCall[];
924
+ cursor: string;
925
+ }
926
+ export interface OpenAIHeldCall {
927
+ id: string;
928
+ request: OpenAIRequest;
929
+ }
930
+ export type OpenAISessionCalls = OpenAICall[];
931
+ export type OpenAISessionCallsWire = OpenAICallData[];
932
+ export type OpenAISessionToolCalls = OpenAIToolCall[];
933
+ export type OpenAIProblems = string[];
934
+ export type OpenAISentSecrets = OpenAISentSecret[];
935
+ export interface OpenAISentSecret {
936
+ call: string;
937
+ kinds: string[];
938
+ }
939
+ export type OpenAIUnattributedCalls = OpenAIUnattributedCall[];
940
+ export interface OpenAIUnattributedCall {
941
+ id: string;
942
+ endpoint: OpenAIEndpoint;
943
+ model: string;
944
+ at: string;
945
+ lastUserText?: string;
946
+ tools: string[];
947
+ sinceMs: number;
948
+ message: string;
949
+ }
950
+ export type Places = Place[];
951
+ export type PlacesWire = PlaceData[];
952
+ export interface PlaceTranscript {
953
+ entries: PlaceTranscriptEntry[];
954
+ text: string;
955
+ toString(): string;
956
+ }
957
+ export interface PlaceTranscriptWire {
958
+ entries: PlaceTranscriptEntry[];
959
+ text: string;
960
+ }
961
+ export interface PlaceTranscriptEntry {
962
+ id: string;
963
+ author: PlacePrincipal;
964
+ at: string;
965
+ text: string;
966
+ controls: string[];
967
+ edited: boolean;
968
+ depth: number;
969
+ streaming?: "open" | "stopped" | "completed";
970
+ visibleTo?: PlacePrincipal;
971
+ }
972
+ export interface PlacePrincipal {
973
+ id: string;
974
+ name: string;
975
+ kind: "user" | "app";
976
+ }
558
977
  export interface UiLoginLink {
559
978
  url: string;
560
979
  }
@@ -573,6 +992,8 @@ export declare class Channelstack extends ClientBase {
573
992
  /** Env vars for the agent: fake tokens, signing secrets and API URLs (what `channelstack env` prints). With `proxy`, the proxy and the CA instead of the API URLs. */
574
993
  env(options?: {
575
994
  proxy?: boolean;
995
+ app?: string;
996
+ channel?: string;
576
997
  }): Promise<Env>;
577
998
  /** A new one-time link that opens the UI in a browser (what `channelstack ui` prints). Experimental. */
578
999
  uiLoginLink(): Promise<UiLoginLink>;
@@ -611,8 +1032,16 @@ export declare class Session implements AsyncDisposable {
611
1032
  resend(): Promise<ResendFixture>;
612
1033
  /** The Google fixture: the agent's mailbox, and where the agent reaches the fake. Experimental. */
613
1034
  google(): Promise<GoogleFixture>;
1035
+ /** The Discord fixture: the agent's app, the guild, and where the agent reaches the fake. Experimental. */
1036
+ discord(): Promise<DiscordFixture>;
1037
+ /** The OpenAI fixture: where the agent reaches the fake model. Experimental. */
1038
+ openai(): Promise<OpenAIFixture>;
1039
+ /** Every channel's places in the session, as the dev tools name them (a Slack channel, a GitHub issue, a Notion page, an email thread, a Discord channel), the most recently active last. Experimental. */
1040
+ places(): Promise<Places>;
614
1041
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
615
1042
  [QUIET](): Promise<QuietState>;
1043
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1044
+ [CONTEXT](): HandleContext;
616
1045
  }
617
1046
  /** Wire data of a {@link EchoFixture}. */
618
1047
  export interface EchoFixtureData {
@@ -629,6 +1058,12 @@ export declare class EchoFixture {
629
1058
  createUser(options: {
630
1059
  name: string;
631
1060
  }): Promise<EchoUser>;
1061
+ /** Make another app (decision 0027), or return the one with this name. Its events go to CHANNELSTACK_ECHO_APP_<NAME>_WEBHOOK_URL. Experimental. */
1062
+ createApp(options: {
1063
+ name: string;
1064
+ }): Promise<EchoApp>;
1065
+ /** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
1066
+ apps(): Promise<EchoApps>;
632
1067
  /** Create a room. Only the listed participants are members; include the app for it to receive events. Experimental. */
633
1068
  createRoom(options?: {
634
1069
  name?: string;
@@ -638,6 +1073,8 @@ export declare class EchoFixture {
638
1073
  capabilities(): Promise<Capabilities>;
639
1074
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
640
1075
  [QUIET](): Promise<QuietState>;
1076
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1077
+ [CONTEXT](): HandleContext;
641
1078
  }
642
1079
  /** Wire data of a {@link EchoApp}. */
643
1080
  export interface EchoAppData {
@@ -652,8 +1089,14 @@ export declare class EchoApp {
652
1089
  readonly kind: "app";
653
1090
  /** @internal Handles come from the SDK, never from `new`. */
654
1091
  constructor(ctx: HandleContext, data: EchoAppData);
1092
+ /** An app a test made posts in a room it is a member of, as its own call would. Experimental. */
1093
+ say(text: string, options: {
1094
+ room: EchoRoom;
1095
+ }): Promise<EchoMessage>;
655
1096
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
656
1097
  [QUIET](): Promise<QuietState>;
1098
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1099
+ [CONTEXT](): HandleContext;
657
1100
  }
658
1101
  /** Wire data of a {@link EchoUser}. */
659
1102
  export interface EchoUserData {
@@ -674,6 +1117,8 @@ export declare class EchoUser {
674
1117
  }): Promise<EchoMessage>;
675
1118
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
676
1119
  [QUIET](): Promise<QuietState>;
1120
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1121
+ [CONTEXT](): HandleContext;
677
1122
  }
678
1123
  /** Wire data of a {@link EchoRoom}. */
679
1124
  export interface EchoRoomData {
@@ -696,6 +1141,8 @@ export declare class EchoRoom {
696
1141
  transcript(): Promise<EchoTranscript>;
697
1142
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
698
1143
  [QUIET](): Promise<QuietState>;
1144
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1145
+ [CONTEXT](): HandleContext;
699
1146
  }
700
1147
  /** Wire data of a {@link SlackFixture}. */
701
1148
  export interface SlackFixtureData {
@@ -731,6 +1178,14 @@ export declare class SlackFixture {
731
1178
  }): Promise<SlackUser>;
732
1179
  /** The people this session created. Experimental. */
733
1180
  users(): Promise<SlackUsers>;
1181
+ /** Make another app in the workspace, with its own bot user, tokens and signing secret (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_SLACK_APP_<NAME>_WEBHOOK_URL, or over its own Socket Mode connection. Experimental. */
1182
+ createApp(options: {
1183
+ name: string;
1184
+ scopes?: string[];
1185
+ botEvents?: string[];
1186
+ }): Promise<SlackApp>;
1187
+ /** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
1188
+ apps(): Promise<SlackApps>;
734
1189
  /** The session's conversations, the one with the newest message last. Experimental. */
735
1190
  conversations(): Promise<SlackConversations>;
736
1191
  /** Create a channel. Only the listed participants are members; include the app for it to receive events. Experimental. */
@@ -743,14 +1198,18 @@ export declare class SlackFixture {
743
1198
  shared?: boolean;
744
1199
  }): Promise<SlackConversation>;
745
1200
  /** Every event channelstack sent the agent for this session, with every attempt. Experimental. */
746
- deliveries(): Promise<SlackDeliveries>;
1201
+ deliveries(options?: {
1202
+ app?: SlackApp;
1203
+ }): Promise<SlackDeliveries>;
747
1204
  /** The Web API calls the agent made about this session's conversations, people and files. Calls about nothing a session owns (auth.test, users.list) are in no session. Experimental. */
748
1205
  calls(options?: {
749
1206
  operation?: string;
750
1207
  error?: true | string;
751
1208
  }): Promise<SlackApiCalls>;
752
- /** The workspace uninstalls the app. Undone when this session closes; run such tests on their own. Experimental. */
753
- uninstallApp(): Promise<SlackUninstallDeliveries>;
1209
+ /** The workspace uninstalls an app: the built-in one, or the one given. Undone when this session closes; run such tests on their own. Experimental. */
1210
+ uninstallApp(options?: {
1211
+ app?: SlackApp;
1212
+ }): Promise<SlackUninstallDeliveries>;
754
1213
  /** Inject a fault: into the agent's Web API calls (removed when this session closes), or drop its Socket Mode connection once. Experimental. */
755
1214
  fault(options: {
756
1215
  type: "rate_limit" | "latency" | "error" | "drop_socket";
@@ -760,14 +1219,17 @@ export declare class SlackFixture {
760
1219
  after?: Duration;
761
1220
  error?: string;
762
1221
  times?: number;
1222
+ app?: SlackApp;
763
1223
  }): Promise<SlackFault>;
764
1224
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
765
- waitForCall(filter: {
1225
+ waitForCall(filter?: {
766
1226
  operation?: string;
767
1227
  error?: true | string;
768
1228
  }, options?: WaitOptions): Promise<SlackApiCall>;
769
1229
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
770
1230
  [QUIET](): Promise<QuietState>;
1231
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1232
+ [CONTEXT](): HandleContext;
771
1233
  }
772
1234
  /** Wire data of a {@link SlackApp}. */
773
1235
  export interface SlackAppData {
@@ -794,8 +1256,27 @@ export declare class SlackApp {
794
1256
  readonly scopes: string[];
795
1257
  /** @internal Handles come from the SDK, never from `new`. */
796
1258
  constructor(ctx: HandleContext, data: SlackAppData);
1259
+ /** An app a test made writes a top-level message, as its own chat.postMessage would: in a conversation it is a member of, or in a DM with the people in `to`. Experimental. */
1260
+ say(message: string | SlackMessageInput, options?: {
1261
+ channel?: SlackConversation;
1262
+ to?: SlackUser | SlackApp | Array<SlackUser | SlackApp>;
1263
+ }): Promise<SlackMessage>;
1264
+ /** An app a test made replies in a thread: pass the message that starts it, or any reply in it. Experimental. */
1265
+ reply(message: string | SlackMessageInput, options: {
1266
+ thread: SlackThread | SlackMessage;
1267
+ }): Promise<SlackMessage>;
1268
+ /** An app a test made reacts to a message. Experimental. */
1269
+ react(emoji: string, options: {
1270
+ message: SlackMessage;
1271
+ }): Promise<SlackDelivery | undefined>;
1272
+ /** An app a test made takes its reaction back. Experimental. */
1273
+ unreact(emoji: string, options: {
1274
+ message: SlackMessage;
1275
+ }): Promise<SlackDelivery | undefined>;
797
1276
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
798
1277
  [QUIET](): Promise<QuietState>;
1278
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1279
+ [CONTEXT](): HandleContext;
799
1280
  }
800
1281
  /** Wire data of a {@link SlackUser}. */
801
1282
  export interface SlackUserData {
@@ -851,21 +1332,24 @@ export declare class SlackUser {
851
1332
  menu: string | SlackMenuRef;
852
1333
  message: SlackMessage;
853
1334
  }): Promise<SlackDelivery>;
854
- /** Run a message shortcut on a message. Experimental. */
1335
+ /** Run an app's message shortcut on a message: it goes to that app alone. Experimental. */
855
1336
  shortcut(callbackId: string, options: {
856
1337
  message: SlackMessage;
1338
+ app?: SlackApp;
857
1339
  }): Promise<SlackDelivery>;
858
- /** Run a slash command in a conversation, e.g. `/deploy web staging`. Experimental. */
1340
+ /** Run an app's slash command in a conversation, e.g. `/deploy web staging`: it goes to that app alone. Experimental. */
859
1341
  runCommand(command: string, options: {
860
1342
  channel: SlackConversation;
1343
+ app?: SlackApp;
861
1344
  }): Promise<SlackDelivery>;
862
1345
  /** Press Stop on the app's work in a thread: what is streaming there ends, and the app is told. Experimental. */
863
1346
  stop(options: {
864
1347
  thread: SlackThread | SlackMessage;
865
1348
  }): 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. */
1349
+ /** Open an app's split view: a new thread in this person's DM with that app, started from the channel they are looking at. Experimental. */
867
1350
  openAgentThread(options?: {
868
1351
  from?: SlackConversation;
1352
+ app?: SlackApp;
869
1353
  }): Promise<SlackThread>;
870
1354
  /** Pick one of the prompts the app suggested in a thread: this person says its message there. Experimental. */
871
1355
  pickPrompt(title: string, options: {
@@ -903,36 +1387,8 @@ export declare class SlackUser {
903
1387
  } & WaitOptions): Promise<SlackModal>;
904
1388
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
905
1389
  [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>;
1390
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1391
+ [CONTEXT](): HandleContext;
936
1392
  }
937
1393
  /** Wire data of a {@link SlackMessage}. */
938
1394
  export interface SlackMessageData {
@@ -942,6 +1398,7 @@ export interface SlackMessageData {
942
1398
  author: SlackUserData | SlackAppData;
943
1399
  text: string;
944
1400
  blocks: unknown[];
1401
+ files: string[];
945
1402
  postedAt: string;
946
1403
  threadTs?: string;
947
1404
  edited: boolean;
@@ -958,6 +1415,7 @@ export declare class SlackMessage {
958
1415
  readonly author: SlackUser | SlackApp;
959
1416
  readonly text: string;
960
1417
  readonly blocks: unknown[];
1418
+ readonly files: string[];
961
1419
  readonly postedAt: string;
962
1420
  readonly threadTs: string | undefined;
963
1421
  readonly edited: boolean;
@@ -975,10 +1433,46 @@ export declare class SlackMessage {
975
1433
  transcript(options?: {
976
1434
  as?: SlackUser | SlackApp;
977
1435
  }): Promise<SlackTranscript>;
1436
+ /** The first delivery this message caused to this app (decision 0027), or nothing when it wasn't told. Experimental. */
1437
+ deliveryFor(app: SlackApp): Promise<SlackDelivery | undefined>;
978
1438
  /** Every delivery this message caused to the agent. Experimental. */
979
1439
  deliveries(): Promise<SlackMessageDeliveries>;
980
1440
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
981
1441
  [QUIET](): Promise<QuietState>;
1442
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1443
+ [CONTEXT](): HandleContext;
1444
+ }
1445
+ /** Wire data of a {@link SlackConversation}. */
1446
+ export interface SlackConversationData {
1447
+ id: string;
1448
+ kind: "channel" | "private_channel" | "im" | "mpim";
1449
+ name?: string;
1450
+ }
1451
+ export declare class SlackConversation {
1452
+ #private;
1453
+ readonly id: string;
1454
+ readonly kind: "channel" | "private_channel" | "im" | "mpim";
1455
+ readonly name: string | undefined;
1456
+ /** @internal Handles come from the SDK, never from `new`. */
1457
+ constructor(ctx: HandleContext, data: SlackConversationData);
1458
+ /** The newest message of a conversation, replies included. Experimental. */
1459
+ latestMessage(): Promise<SlackMessage>;
1460
+ /** Top-level messages of a conversation, oldest first. Experimental. */
1461
+ messages(): Promise<SlackMessages>;
1462
+ /** The people and apps in a conversation. Experimental. */
1463
+ members(): Promise<SlackMembers>;
1464
+ /** The conversation as a person would read it, threads included. Experimental. */
1465
+ transcript(options?: {
1466
+ as?: SlackUser | SlackApp;
1467
+ }): Promise<SlackTranscript>;
1468
+ /** Wait for the next new message matching `from` (anyone if omitted), after the last one this handle saw. */
1469
+ waitForMessage(options?: {
1470
+ from?: SlackUser | SlackApp | string;
1471
+ } & WaitOptions): Promise<SlackMessage>;
1472
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1473
+ [QUIET](): Promise<QuietState>;
1474
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1475
+ [CONTEXT](): HandleContext;
982
1476
  }
983
1477
  /** Wire data of a {@link SlackThread}. */
984
1478
  export interface SlackThreadData {
@@ -1015,11 +1509,14 @@ export declare class SlackThread {
1015
1509
  } & QuietOptions): Promise<SlackMessage>;
1016
1510
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1017
1511
  [QUIET](): Promise<QuietState>;
1512
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1513
+ [CONTEXT](): HandleContext;
1018
1514
  }
1019
1515
  /** Wire data of a {@link SlackDelivery}. */
1020
1516
  export interface SlackDeliveryData {
1021
1517
  id: string;
1022
1518
  channel: "slack";
1519
+ app: string;
1023
1520
  type: string;
1024
1521
  eventType?: string;
1025
1522
  eventId?: string;
@@ -1031,6 +1528,7 @@ export declare class SlackDelivery {
1031
1528
  #private;
1032
1529
  readonly id: string;
1033
1530
  readonly channel: "slack";
1531
+ readonly app: string;
1034
1532
  readonly type: string;
1035
1533
  readonly eventType: string | undefined;
1036
1534
  readonly eventId: string | undefined;
@@ -1056,6 +1554,8 @@ export declare class SlackDelivery {
1056
1554
  settled(options?: WaitOptions): Promise<SlackDelivery>;
1057
1555
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1058
1556
  [QUIET](): Promise<QuietState>;
1557
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1558
+ [CONTEXT](): HandleContext;
1059
1559
  }
1060
1560
  /** Wire data of a {@link SlackStream}. */
1061
1561
  export interface SlackStreamData {
@@ -1082,6 +1582,8 @@ export declare class SlackStream {
1082
1582
  ended(options?: WaitOptions): Promise<SlackStream>;
1083
1583
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1084
1584
  [QUIET](): Promise<QuietState>;
1585
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1586
+ [CONTEXT](): HandleContext;
1085
1587
  }
1086
1588
  /** Wire data of a {@link SlackModal}. */
1087
1589
  export interface SlackModalData {
@@ -1110,6 +1612,8 @@ export declare class SlackModal {
1110
1612
  close(): Promise<SlackDelivery | undefined>;
1111
1613
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1112
1614
  [QUIET](): Promise<QuietState>;
1615
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1616
+ [CONTEXT](): HandleContext;
1113
1617
  }
1114
1618
  /** Wire data of a {@link SlackFault}. */
1115
1619
  export interface SlackFaultData {
@@ -1125,6 +1629,8 @@ export declare class SlackFault implements AsyncDisposable {
1125
1629
  [Symbol.asyncDispose](): Promise<void>;
1126
1630
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1127
1631
  [QUIET](): Promise<QuietState>;
1632
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1633
+ [CONTEXT](): HandleContext;
1128
1634
  }
1129
1635
  /** Wire data of a {@link GitHubFixture}. */
1130
1636
  export interface GitHubFixtureData {
@@ -1148,6 +1654,8 @@ export declare class GitHubFixture {
1148
1654
  role?: "member" | "admin" | "outside_collaborator";
1149
1655
  token?: string;
1150
1656
  }): Promise<GitHubUser>;
1657
+ /** The people this session created. Experimental. */
1658
+ users(): Promise<GitHubUsers>;
1151
1659
  /** Create a repository in the org. The App hears about it only when it is listed in `apps`: an App must be installed on a repository. Experimental. */
1152
1660
  createRepo(options?: {
1153
1661
  name?: string;
@@ -1165,10 +1673,25 @@ export declare class GitHubFixture {
1165
1673
  description?: string;
1166
1674
  }>;
1167
1675
  }): Promise<GitHubRepo>;
1676
+ /** The repositories this session created. Experimental. */
1677
+ repos(): Promise<GitHubRepos>;
1678
+ /** The issues and pull requests in this session's repositories, read again from GitHub live, the most recently updated last. Experimental. */
1679
+ issues(): Promise<GitHubIssues>;
1680
+ /** The id of the built-in App's installation, for a repository it is installed on. The same as `github.app.installationId(repo)`. Experimental. */
1681
+ installationId(repo: GitHubRepo): Promise<number>;
1682
+ /** Make another GitHub App on the org, with its own App id, bot user, installation, private key and webhook secret (decision 0027), or return the one made with this name and settings. It reaches no repository until it is installed on one; its webhooks go to CHANNELSTACK_GITHUB_APP_<NAME>_WEBHOOK_URL. Experimental. */
1683
+ createApp(options: {
1684
+ name: string;
1685
+ permissions?: Record<string, "read" | "write">;
1686
+ events?: string[];
1687
+ }): Promise<GitHubApp>;
1688
+ /** The Apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
1689
+ apps(): Promise<GitHubApps>;
1168
1690
  /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
1169
1691
  deliveries(options?: {
1170
1692
  type?: string;
1171
1693
  resource?: GitHubRepo;
1694
+ app?: GitHubApp;
1172
1695
  }): Promise<GitHubDeliveries>;
1173
1696
  /** The REST calls the agent made about this session's repositories. Calls about no repository (`GET /app`) are in no session. Experimental. */
1174
1697
  calls(options?: {
@@ -1181,12 +1704,14 @@ export declare class GitHubFixture {
1181
1704
  error?: true | string;
1182
1705
  }): Promise<GitHubAppCalls>;
1183
1706
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
1184
- waitForCall(filter: {
1707
+ waitForCall(filter?: {
1185
1708
  operation?: string;
1186
1709
  error?: true | string;
1187
1710
  }, options?: WaitOptions): Promise<GitHubApiCall>;
1188
1711
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1189
1712
  [QUIET](): Promise<QuietState>;
1713
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1714
+ [CONTEXT](): HandleContext;
1190
1715
  }
1191
1716
  /** Wire data of a {@link GitHubApp}. */
1192
1717
  export interface GitHubAppData {
@@ -1213,34 +1738,8 @@ export declare class GitHubApp {
1213
1738
  readonly webhookSecret: string;
1214
1739
  /** @internal Handles come from the SDK, never from `new`. */
1215
1740
  constructor(ctx: HandleContext, data: GitHubAppData);
1216
- /** The id of the App's installation, for a repository it is installed on. Experimental. */
1741
+ /** The id of this App's installation, for a repository it is installed on. Experimental. */
1217
1742
  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
1743
  /** Push a commit to a branch (created from the default branch if it isn't there). Sends `push`, and `pull_request` `synchronize` for open pull requests from it. Experimental. */
1245
1744
  push(changes: FileInput[] | Record<string, string | null>, options: {
1246
1745
  repo: GitHubRepo;
@@ -1362,25 +1861,176 @@ export declare class GitHubUser {
1362
1861
  pr: GitHubPullRequest;
1363
1862
  method?: "merge" | "squash" | "rebase";
1364
1863
  }): 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
1864
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1374
1865
  [QUIET](): Promise<QuietState>;
1866
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
1867
+ [CONTEXT](): HandleContext;
1375
1868
  }
1376
- /** Wire data of a {@link GitHubRepo}. */
1377
- export interface GitHubRepoData {
1869
+ /** Wire data of a {@link GitHubUser}. */
1870
+ export interface GitHubUserData {
1378
1871
  id: string;
1379
- owner: string;
1380
1872
  name: string;
1381
- fullName: string;
1382
- defaultBranch: string;
1383
- private: boolean;
1873
+ kind: "user";
1874
+ login: string;
1875
+ numericId: number;
1876
+ displayName?: string;
1877
+ email?: string;
1878
+ role: "member" | "admin" | "outside_collaborator";
1879
+ }
1880
+ export declare class GitHubUser {
1881
+ #private;
1882
+ readonly id: string;
1883
+ readonly name: string;
1884
+ readonly kind: "user";
1885
+ readonly login: string;
1886
+ readonly numericId: number;
1887
+ readonly displayName: string | undefined;
1888
+ readonly email: string | undefined;
1889
+ readonly role: "member" | "admin" | "outside_collaborator";
1890
+ /** @internal Handles come from the SDK, never from `new`. */
1891
+ constructor(ctx: HandleContext, data: GitHubUserData);
1892
+ /** Push a commit to a branch (created from the default branch if it isn't there). Sends `push`, and `pull_request` `synchronize` for open pull requests from it. Experimental. */
1893
+ push(changes: FileInput[] | Record<string, string | null>, options: {
1894
+ repo: GitHubRepo;
1895
+ branch: string;
1896
+ message?: string;
1897
+ }): Promise<GitHubCommit>;
1898
+ /** Open an issue. Sends `issues` (action `opened`). Experimental. */
1899
+ openIssue(issue: {
1900
+ title: string;
1901
+ body?: string;
1902
+ labels?: string[];
1903
+ assignees?: Array<GitHubUser | GitHubApp>;
1904
+ }, options: {
1905
+ repo: GitHubRepo;
1906
+ }): Promise<GitHubIssue>;
1907
+ /** Open a pull request. With `changes`, they are pushed to `from` first; without, `from` is an existing branch. Sends `pull_request` (action `opened`). Experimental. */
1908
+ openPullRequest(pr: {
1909
+ from: string;
1910
+ to?: string;
1911
+ title?: string;
1912
+ body?: string;
1913
+ changes?: FileInput[] | Record<string, string | null>;
1914
+ draft?: boolean;
1915
+ reviewers?: Array<GitHubUser | GitHubApp>;
1916
+ }, options: {
1917
+ repo: GitHubRepo;
1918
+ }): Promise<GitHubPullRequest>;
1919
+ /** Edit the title or the body of an issue or a pull request. Sends `issues` or `pull_request` (action `edited`). Experimental. */
1920
+ editIssue(changes: {
1921
+ title?: string;
1922
+ body?: string;
1923
+ }, options: {
1924
+ issue: GitHubIssue;
1925
+ }): Promise<GitHubDelivery | undefined>;
1926
+ /** Close an issue or a pull request. Sends `issues` or `pull_request` (action `closed`). Experimental. */
1927
+ close(options: {
1928
+ issue: GitHubIssue;
1929
+ }): Promise<GitHubDelivery | undefined>;
1930
+ /** Reopen an issue or a pull request. Sends `issues` or `pull_request` (action `reopened`). Experimental. */
1931
+ reopen(options: {
1932
+ issue: GitHubIssue;
1933
+ }): Promise<GitHubDelivery | undefined>;
1934
+ /** Put labels on an issue or a pull request. Sends one `labeled` event per label. Experimental. */
1935
+ label(labels: string | string[], options: {
1936
+ issue: GitHubIssue;
1937
+ }): Promise<GitHubLabelDeliveries>;
1938
+ /** Take labels off an issue or a pull request. Sends one `unlabeled` event per label. Experimental. */
1939
+ unlabel(labels: string | string[], options: {
1940
+ issue: GitHubIssue;
1941
+ }): Promise<GitHubUnlabelDeliveries>;
1942
+ /** Assign people or the App's bot. Sends one `assigned` event per assignee. Experimental. */
1943
+ assign(assignees: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
1944
+ issue: GitHubIssue;
1945
+ }): Promise<GitHubAssignDeliveries>;
1946
+ /** Comment on an issue or a pull request's conversation. Sends `issue_comment` (action `created`). Experimental. */
1947
+ comment(body: string, options: {
1948
+ issue: GitHubIssue;
1949
+ }): Promise<GitHubComment>;
1950
+ /** Edit a conversation comment or a comment on the diff. Sends the comment's event with action `edited`. Experimental. */
1951
+ edit(body: string, options: {
1952
+ comment: GitHubComment | GitHubReviewComment;
1953
+ }): Promise<GitHubDelivery | undefined>;
1954
+ /** Delete a conversation comment or a comment on the diff. Sends the comment's event with action `deleted`. Experimental. */
1955
+ delete(options: {
1956
+ comment: GitHubComment | GitHubReviewComment;
1957
+ }): Promise<GitHubDelivery | undefined>;
1958
+ /** React to an issue, a pull request or a comment. GitHub sends no webhook for a reaction. Experimental. */
1959
+ react(content: "+1" | "-1" | "laugh" | "confused" | "heart" | "hooray" | "rocket" | "eyes", options?: {
1960
+ issue?: GitHubIssue;
1961
+ comment?: GitHubComment | GitHubReviewComment;
1962
+ }): Promise<void>;
1963
+ /** Hide a comment as outdated, spam, off-topic or resolved. GitHub sends no webhook for it. Experimental. */
1964
+ minimize(options: {
1965
+ comment: GitHubComment;
1966
+ reason?: "OUTDATED" | "SPAM" | "OFF_TOPIC" | "RESOLVED";
1967
+ }): Promise<void>;
1968
+ /** Submit a review, with comments on the diff if any. Sends `pull_request_review`, and one `pull_request_review_comment` per comment. Experimental. */
1969
+ review(review: {
1970
+ pr: GitHubPullRequest;
1971
+ event: "COMMENT" | "APPROVE" | "REQUEST_CHANGES";
1972
+ body?: string;
1973
+ comments?: Array<{
1974
+ path: string;
1975
+ line: number;
1976
+ side?: "LEFT" | "RIGHT";
1977
+ startLine?: number;
1978
+ body: string;
1979
+ }>;
1980
+ }): Promise<GitHubReview>;
1981
+ /** One comment on the diff, outside a review. Sends `pull_request_review_comment`. Experimental. */
1982
+ reviewComment(body: string, options: {
1983
+ pr: GitHubPullRequest;
1984
+ path: string;
1985
+ line: number;
1986
+ side?: "LEFT" | "RIGHT";
1987
+ }): Promise<GitHubReviewComment>;
1988
+ /** Reply in a thread on the diff. Sends `pull_request_review_comment`. Experimental. */
1989
+ reply(body: string, options: {
1990
+ comment: GitHubReviewComment;
1991
+ }): Promise<GitHubReviewComment>;
1992
+ /** Resolve a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
1993
+ resolve(options: {
1994
+ comment: GitHubReviewComment;
1995
+ }): Promise<GitHubDelivery | undefined>;
1996
+ /** Reopen a thread on the diff. Sends `pull_request_review_thread`. Experimental. */
1997
+ unresolve(options: {
1998
+ comment: GitHubReviewComment;
1999
+ }): Promise<GitHubDelivery | undefined>;
2000
+ /** Request a review from people or the App's bot. Sends `pull_request` (action `review_requested`) per reviewer. Experimental. */
2001
+ requestReview(reviewers: GitHubUser | GitHubApp | Array<GitHubUser | GitHubApp>, options: {
2002
+ pr: GitHubPullRequest;
2003
+ }): Promise<GitHubDelivery | undefined>;
2004
+ /** Mark a draft pull request as ready for review. Sends `pull_request` (action `ready_for_review`). Experimental. */
2005
+ markReady(options: {
2006
+ pr: GitHubPullRequest;
2007
+ }): Promise<GitHubDelivery | undefined>;
2008
+ /** Merge a pull request. Sends `push` for the base branch, then `pull_request` (action `closed`, merged). Experimental. */
2009
+ merge(options: {
2010
+ pr: GitHubPullRequest;
2011
+ method?: "merge" | "squash" | "rebase";
2012
+ }): Promise<GitHubDelivery | undefined>;
2013
+ /** Click "Re-run" on a check run. Sends `check_run` (action `rerequested`). Experimental. */
2014
+ rerun(options: {
2015
+ checkRun: GitHubCheckRun;
2016
+ }): Promise<GitHubDelivery | undefined>;
2017
+ /** Click one of the buttons the App put on a check run. Sends `check_run` (action `requested_action`). Experimental. */
2018
+ requestAction(identifier: string, options: {
2019
+ checkRun: GitHubCheckRun;
2020
+ }): Promise<GitHubDelivery | undefined>;
2021
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2022
+ [QUIET](): Promise<QuietState>;
2023
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2024
+ [CONTEXT](): HandleContext;
2025
+ }
2026
+ /** Wire data of a {@link GitHubRepo}. */
2027
+ export interface GitHubRepoData {
2028
+ id: string;
2029
+ owner: string;
2030
+ name: string;
2031
+ fullName: string;
2032
+ defaultBranch: string;
2033
+ private: boolean;
1384
2034
  }
1385
2035
  export declare class GitHubRepo {
1386
2036
  #private;
@@ -1392,9 +2042,9 @@ export declare class GitHubRepo {
1392
2042
  readonly private: boolean;
1393
2043
  /** @internal Handles come from the SDK, never from `new`. */
1394
2044
  constructor(ctx: HandleContext, data: GitHubRepoData);
1395
- /** Install the App on this repository. Sends `installation_repositories`. Experimental. */
2045
+ /** Install an App on this repository. Sends that App `installation_repositories`. Experimental. */
1396
2046
  installApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
1397
- /** Take the App off this repository. Sends `installation_repositories`. Experimental. */
2047
+ /** Take an App off this repository. Sends that App `installation_repositories`. Experimental. */
1398
2048
  uninstallApp(app: GitHubApp): Promise<GitHubDelivery | undefined>;
1399
2049
  /** An issue of this repository by its number. Experimental. */
1400
2050
  issue(number: number): Promise<GitHubIssue>;
@@ -1410,42 +2060,8 @@ export declare class GitHubRepo {
1410
2060
  }): Promise<GitHubCommits>;
1411
2061
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1412
2062
  [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>;
2063
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2064
+ [CONTEXT](): HandleContext;
1449
2065
  }
1450
2066
  /** Wire data of a {@link GitHubIssue}. */
1451
2067
  export interface GitHubIssueData {
@@ -1489,6 +2105,48 @@ export declare class GitHubIssue {
1489
2105
  } & QuietOptions): Promise<GitHubComment>;
1490
2106
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1491
2107
  [QUIET](): Promise<QuietState>;
2108
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2109
+ [CONTEXT](): HandleContext;
2110
+ }
2111
+ /** Wire data of a {@link GitHubDelivery}. */
2112
+ export interface GitHubDeliveryData {
2113
+ id: string;
2114
+ channel: "github";
2115
+ app: string;
2116
+ type: string;
2117
+ action?: string;
2118
+ guid: string;
2119
+ payload?: unknown;
2120
+ attempts: DeliveryAttempt[];
2121
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2122
+ }
2123
+ export declare class GitHubDelivery {
2124
+ #private;
2125
+ readonly id: string;
2126
+ readonly channel: "github";
2127
+ readonly app: string;
2128
+ readonly type: string;
2129
+ readonly action: string | undefined;
2130
+ readonly guid: string;
2131
+ readonly payload: unknown | undefined;
2132
+ readonly attempts: DeliveryAttempt[];
2133
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
2134
+ /** @internal Handles come from the SDK, never from `new`. */
2135
+ constructor(ctx: HandleContext, data: GitHubDeliveryData);
2136
+ /** Re-read a delivery: its attempts and status. Experimental. */
2137
+ refresh(): Promise<GitHubDelivery>;
2138
+ /** Redeliver from the App's delivery log, as GitHub's UI and API do: the same GUID, a new attempt. Experimental. */
2139
+ redeliver(): Promise<DeliveryAttempt>;
2140
+ /** Send the delivery again, unchanged or signed with a secret that isn't the App's. Experimental. */
2141
+ resend(options?: {
2142
+ badSignature?: boolean;
2143
+ }): Promise<DeliveryAttempt>;
2144
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
2145
+ settled(options?: WaitOptions): Promise<GitHubDelivery>;
2146
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2147
+ [QUIET](): Promise<QuietState>;
2148
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2149
+ [CONTEXT](): HandleContext;
1492
2150
  }
1493
2151
  /** Wire data of a {@link GitHubCommit}. */
1494
2152
  export interface GitHubCommitData {
@@ -1515,6 +2173,8 @@ export declare class GitHubCommit {
1515
2173
  statuses(): Promise<GitHubStatuses>;
1516
2174
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1517
2175
  [QUIET](): Promise<QuietState>;
2176
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2177
+ [CONTEXT](): HandleContext;
1518
2178
  }
1519
2179
  /** Wire data of a {@link GitHubCheckRun}. */
1520
2180
  export interface GitHubCheckRunData {
@@ -1561,6 +2221,8 @@ export declare class GitHubCheckRun {
1561
2221
  constructor(ctx: HandleContext, data: GitHubCheckRunData);
1562
2222
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1563
2223
  [QUIET](): Promise<QuietState>;
2224
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2225
+ [CONTEXT](): HandleContext;
1564
2226
  }
1565
2227
  /** Wire data of a {@link GitHubComment}. */
1566
2228
  export interface GitHubCommentData {
@@ -1587,8 +2249,12 @@ export declare class GitHubComment {
1587
2249
  refresh(): Promise<GitHubComment>;
1588
2250
  /** The reactions on a conversation comment, by content. Experimental. */
1589
2251
  reactions(): Promise<GitHubReactions>;
2252
+ /** The `issue_comment` (`created`) delivery this comment caused to this App (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in App's. Experimental. */
2253
+ deliveryFor(app: GitHubApp): Promise<GitHubDelivery | undefined>;
1590
2254
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1591
2255
  [QUIET](): Promise<QuietState>;
2256
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2257
+ [CONTEXT](): HandleContext;
1592
2258
  }
1593
2259
  /** Wire data of a {@link GitHubReviewComment}. */
1594
2260
  export interface GitHubReviewCommentData {
@@ -1621,6 +2287,8 @@ export declare class GitHubReviewComment {
1621
2287
  transcript(): Promise<GitHubTranscript>;
1622
2288
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1623
2289
  [QUIET](): Promise<QuietState>;
2290
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2291
+ [CONTEXT](): HandleContext;
1624
2292
  }
1625
2293
  /** Wire data of a {@link LinearFixture}. */
1626
2294
  export interface LinearFixtureData {
@@ -1643,6 +2311,17 @@ export declare class LinearFixture {
1643
2311
  guest?: boolean;
1644
2312
  token?: string;
1645
2313
  }): Promise<LinearUser>;
2314
+ /** The people this session created. Experimental. */
2315
+ users(): Promise<LinearUsers>;
2316
+ /** Make another OAuth app in the workspace, installed with `actor=app`: its own app user (mentionable and assignable), access token, client and webhook secret. Or return the one made with this name and settings. Its webhooks go to CHANNELSTACK_LINEAR_APP_<NAME>_WEBHOOK_URL. Experimental. */
2317
+ createApp(options: {
2318
+ name: string;
2319
+ events?: string[];
2320
+ }): Promise<LinearApp>;
2321
+ /** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
2322
+ apps(): Promise<LinearApps>;
2323
+ /** The teams this session created. Experimental. */
2324
+ teams(): Promise<LinearTeams>;
1646
2325
  /** Create a team: its members, workflow states and labels. Without a key one is made up, so parallel tests never share one. Experimental. */
1647
2326
  createTeam(options?: {
1648
2327
  key?: string;
@@ -1654,10 +2333,13 @@ export declare class LinearFixture {
1654
2333
  }>;
1655
2334
  labels?: string[];
1656
2335
  }): Promise<LinearTeam>;
2336
+ /** The issues in this session's teams, read again from Linear live, oldest first. Experimental. */
2337
+ issues(): Promise<LinearIssues>;
1657
2338
  /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
1658
2339
  deliveries(options?: {
1659
2340
  type?: string;
1660
2341
  resource?: LinearIssue;
2342
+ app?: LinearApp;
1661
2343
  }): Promise<LinearDeliveries>;
1662
2344
  /** The GraphQL operations the agent sent about this session's issues and sessions, by root field (`agentActivityCreate`). Experimental. */
1663
2345
  calls(options?: {
@@ -1665,12 +2347,14 @@ export declare class LinearFixture {
1665
2347
  error?: true | string;
1666
2348
  }): Promise<LinearApiCalls>;
1667
2349
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
1668
- waitForCall(filter: {
2350
+ waitForCall(filter?: {
1669
2351
  operation?: string;
1670
2352
  error?: true | string;
1671
2353
  }, options?: WaitOptions): Promise<LinearApiCall>;
1672
2354
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1673
2355
  [QUIET](): Promise<QuietState>;
2356
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2357
+ [CONTEXT](): HandleContext;
1674
2358
  }
1675
2359
  /** Wire data of a {@link LinearApp}. */
1676
2360
  export interface LinearAppData {
@@ -1695,8 +2379,18 @@ export declare class LinearApp {
1695
2379
  readonly clientSecret: string;
1696
2380
  /** @internal Handles come from the SDK, never from `new`. */
1697
2381
  constructor(ctx: HandleContext, data: LinearAppData);
2382
+ /** An app a test made comments on an issue, as its own `commentCreate` would. Its mention of another app is refused (to confirm, B6). Experimental. */
2383
+ comment(body: string, options: {
2384
+ issue: LinearIssue;
2385
+ }): Promise<LinearComment>;
2386
+ /** An app a test made replies in a comment's thread, as its own `commentCreate` with a `parentId` would. Experimental. */
2387
+ reply(body: string, options: {
2388
+ comment: LinearComment;
2389
+ }): Promise<LinearComment>;
1698
2390
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1699
2391
  [QUIET](): Promise<QuietState>;
2392
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2393
+ [CONTEXT](): HandleContext;
1700
2394
  }
1701
2395
  /** Wire data of a {@link LinearUser}. */
1702
2396
  export interface LinearUserData {
@@ -1756,7 +2450,7 @@ export declare class LinearUser {
1756
2450
  label(labels: string | string[], options: {
1757
2451
  issue: LinearIssue;
1758
2452
  }): Promise<LinearDelivery | undefined>;
1759
- /** Delegate an issue to the app. Opens an agent session and sends `AgentSessionEvent` (`created`). Experimental. */
2453
+ /** Delegate an issue to an app. Opens that app's agent session and sends it `AgentSessionEvent` (`created`); an issue delegated to another app moves. Experimental. */
1760
2454
  delegate(app: LinearApp, options: {
1761
2455
  issue: LinearIssue;
1762
2456
  }): Promise<LinearAgentSession>;
@@ -1794,24 +2488,42 @@ export declare class LinearUser {
1794
2488
  }): Promise<LinearDelivery>;
1795
2489
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1796
2490
  [QUIET](): Promise<QuietState>;
2491
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2492
+ [CONTEXT](): HandleContext;
1797
2493
  }
1798
- /** Wire data of a {@link LinearTeam}. */
1799
- export interface LinearTeamData {
2494
+ /** Wire data of a {@link LinearComment}. */
2495
+ export interface LinearCommentData {
1800
2496
  id: string;
1801
- key: string;
1802
- name: string;
2497
+ issue: LinearIssueData;
2498
+ author: LinearUserData | LinearAppData;
2499
+ body: string;
2500
+ createdAt: string;
2501
+ url: string;
2502
+ session?: LinearAgentSessionData;
2503
+ delivery?: LinearDeliveryData;
1803
2504
  }
1804
- export declare class LinearTeam {
2505
+ export declare class LinearComment {
1805
2506
  #private;
1806
2507
  readonly id: string;
1807
- readonly key: string;
1808
- readonly name: string;
2508
+ readonly issue: LinearIssue;
2509
+ readonly author: LinearUser | LinearApp;
2510
+ readonly body: string;
2511
+ readonly createdAt: string;
2512
+ readonly url: string;
2513
+ readonly session: LinearAgentSession | undefined;
2514
+ readonly delivery: LinearDelivery | undefined;
1809
2515
  /** @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>;
2516
+ constructor(ctx: HandleContext, data: LinearCommentData);
2517
+ /** The replies in a comment's thread, once the agent is quiet. Experimental. */
2518
+ replies(): Promise<LinearCommentReplies>;
2519
+ /** The `Comment` (`create`) delivery this comment caused to this app (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in app's. Experimental. */
2520
+ deliveryFor(app: LinearApp): Promise<LinearDelivery | undefined>;
2521
+ /** A comment's thread as a person reads it. Experimental. */
2522
+ transcript(): Promise<LinearTranscript>;
1813
2523
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1814
2524
  [QUIET](): Promise<QuietState>;
2525
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2526
+ [CONTEXT](): HandleContext;
1815
2527
  }
1816
2528
  /** Wire data of a {@link LinearIssue}. */
1817
2529
  export interface LinearIssueData {
@@ -1861,43 +2573,28 @@ export declare class LinearIssue {
1861
2573
  } & QuietOptions): Promise<LinearComment>;
1862
2574
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1863
2575
  [QUIET](): Promise<QuietState>;
2576
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2577
+ [CONTEXT](): HandleContext;
1864
2578
  }
1865
- /** Wire data of a {@link LinearDelivery}. */
1866
- export interface LinearDeliveryData {
2579
+ /** Wire data of a {@link LinearTeam}. */
2580
+ export interface LinearTeamData {
1867
2581
  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";
2582
+ key: string;
2583
+ name: string;
1875
2584
  }
1876
- export declare class LinearDelivery {
2585
+ export declare class LinearTeam {
1877
2586
  #private;
1878
2587
  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";
2588
+ readonly key: string;
2589
+ readonly name: string;
1886
2590
  /** @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>;
2591
+ constructor(ctx: HandleContext, data: LinearTeamData);
2592
+ /** An issue of this team by its identifier (`ENG-12`). Experimental. */
2593
+ issue(identifier: string): Promise<LinearIssue>;
1899
2594
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1900
2595
  [QUIET](): Promise<QuietState>;
2596
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2597
+ [CONTEXT](): HandleContext;
1901
2598
  }
1902
2599
  /** Wire data of a {@link LinearAgentSession}. */
1903
2600
  export interface LinearAgentSessionData {
@@ -1934,36 +2631,49 @@ export declare class LinearAgentSession {
1934
2631
  } & WaitOptions): Promise<LinearAgentActivity>;
1935
2632
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1936
2633
  [QUIET](): Promise<QuietState>;
2634
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2635
+ [CONTEXT](): HandleContext;
1937
2636
  }
1938
- /** Wire data of a {@link LinearComment}. */
1939
- export interface LinearCommentData {
2637
+ /** Wire data of a {@link LinearDelivery}. */
2638
+ export interface LinearDeliveryData {
1940
2639
  id: string;
1941
- issue: LinearIssueData;
1942
- author: LinearUserData | LinearAppData;
1943
- body: string;
1944
- createdAt: string;
1945
- url: string;
1946
- session?: LinearAgentSessionData;
1947
- delivery?: LinearDeliveryData;
2640
+ channel: "linear";
2641
+ app: string;
2642
+ type: string;
2643
+ action: string;
2644
+ webhookId: string;
2645
+ payload?: unknown;
2646
+ attempts: DeliveryAttempt[];
2647
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1948
2648
  }
1949
- export declare class LinearComment {
2649
+ export declare class LinearDelivery {
1950
2650
  #private;
1951
2651
  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;
2652
+ readonly channel: "linear";
2653
+ readonly app: string;
2654
+ readonly type: string;
2655
+ readonly action: string;
2656
+ readonly webhookId: string;
2657
+ readonly payload: unknown | undefined;
2658
+ readonly attempts: DeliveryAttempt[];
2659
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
1959
2660
  /** @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>;
2661
+ constructor(ctx: HandleContext, data: LinearDeliveryData);
2662
+ /** Re-read a delivery: its attempts and status. Experimental. */
2663
+ refresh(): Promise<LinearDelivery>;
2664
+ /** Redeliver, as Linear retries: the same delivery, with a new `webhookTimestamp` and a new signature. Experimental. */
2665
+ redeliver(): Promise<DeliveryAttempt>;
2666
+ /** Send the delivery again: stale (its `webhookTimestamp` two minutes old), or signed with a secret that isn't the app's. Experimental. */
2667
+ resend(options?: {
2668
+ badSignature?: boolean;
2669
+ stale?: boolean;
2670
+ }): Promise<DeliveryAttempt>;
2671
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
2672
+ settled(options?: WaitOptions): Promise<LinearDelivery>;
1965
2673
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
1966
2674
  [QUIET](): Promise<QuietState>;
2675
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2676
+ [CONTEXT](): HandleContext;
1967
2677
  }
1968
2678
  /** Wire data of a {@link LinearAgentActivity}. */
1969
2679
  export interface LinearAgentActivityData {
@@ -1998,6 +2708,8 @@ export declare class LinearAgentActivity {
1998
2708
  constructor(ctx: HandleContext, data: LinearAgentActivityData);
1999
2709
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2000
2710
  [QUIET](): Promise<QuietState>;
2711
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2712
+ [CONTEXT](): HandleContext;
2001
2713
  }
2002
2714
  /** Wire data of a {@link NotionFixture}. */
2003
2715
  export interface NotionFixtureData {
@@ -2018,6 +2730,18 @@ export declare class NotionFixture {
2018
2730
  avatarUrl?: string;
2019
2731
  token?: string;
2020
2732
  }): Promise<NotionUser>;
2733
+ /** The people this session created. Experimental. */
2734
+ users(): Promise<NotionUsers>;
2735
+ /** Make another internal integration in the workspace, with its own bot user, token and webhook subscription (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_NOTION_APP_<NAME>_WEBHOOK_URL, and it sees only the pages connected to it. Experimental. */
2736
+ createApp(options: {
2737
+ name: string;
2738
+ capabilities?: NotionCapability[];
2739
+ events?: string[];
2740
+ }): Promise<NotionIntegration>;
2741
+ /** The integrations this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
2742
+ apps(): Promise<NotionIntegrations>;
2743
+ /** The pages this session created, a database's rows included, read again from Notion live, oldest first. Not those in the trash. Experimental. */
2744
+ pages(): Promise<NotionPages>;
2021
2745
  /** Create a page as seed data. The integration sees it only through `connections`, its own or a parent's. In the fake it sends no event; live, a real person makes it, so Notion sends `page.created` to a connected integration. A person creating the page sends the event in both worlds. Experimental. */
2022
2746
  createPage(options: {
2023
2747
  title: string;
@@ -2039,12 +2763,15 @@ export declare class NotionFixture {
2039
2763
  }): Promise<NotionDatabase>;
2040
2764
  /** How long Notion holds `page.content_updated` to batch edits, for this session (fake only). Default one second. Experimental. */
2041
2765
  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>;
2766
+ /** Send a subscription's verification request (`{ verification_token }`), as Notion does once when a subscription is created: the built-in integration's, or the one given's. Experimental. */
2767
+ sendVerification(options?: {
2768
+ app?: NotionIntegration;
2769
+ }): Promise<NotionDelivery | undefined>;
2044
2770
  /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
2045
2771
  deliveries(options?: {
2046
2772
  type?: string;
2047
2773
  resource?: NotionPage;
2774
+ app?: NotionIntegration;
2048
2775
  }): Promise<NotionDeliveries>;
2049
2776
  /** The REST calls the agent made about this session's pages, by the client's method name (`comments.create`). Experimental. */
2050
2777
  calls(options?: {
@@ -2052,12 +2779,14 @@ export declare class NotionFixture {
2052
2779
  error?: true | string;
2053
2780
  }): Promise<NotionApiCalls>;
2054
2781
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
2055
- waitForCall(filter: {
2782
+ waitForCall(filter?: {
2056
2783
  operation?: string;
2057
2784
  error?: true | string;
2058
2785
  }, options?: WaitOptions): Promise<NotionApiCall>;
2059
2786
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2060
2787
  [QUIET](): Promise<QuietState>;
2788
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2789
+ [CONTEXT](): HandleContext;
2061
2790
  }
2062
2791
  /** Wire data of a {@link NotionIntegration}. */
2063
2792
  export interface NotionIntegrationData {
@@ -2080,8 +2809,34 @@ export declare class NotionIntegration {
2080
2809
  readonly webhookSecret: string;
2081
2810
  /** @internal Handles come from the SDK, never from `new`. */
2082
2811
  constructor(ctx: HandleContext, data: NotionIntegrationData);
2812
+ /** An integration a test made starts a discussion on a page, or anchored to the block with `anchor` in its text, as its own `comments.create` would: on a page connected to it, mentioning people only. Sends `comment.created` to every integration that sees the page. Experimental. */
2813
+ comment(text: string, options: {
2814
+ page: NotionPage;
2815
+ anchor?: string | RegExp;
2816
+ }): Promise<NotionComment>;
2817
+ /** An integration a test made replies in a discussion, as `comments.create` with `discussion_id` would. Sends `comment.created`. Experimental. */
2818
+ reply(text: string, options: {
2819
+ discussion: NotionDiscussion;
2820
+ }): Promise<NotionComment>;
2821
+ /** An integration a test made edits a page's body, as its own block calls would: append, or replace it. Sends one `page.content_updated` once Notion's batching delay is over. Experimental. */
2822
+ edit(change: {
2823
+ append?: string | {
2824
+ path: string;
2825
+ } | unknown[];
2826
+ replace?: string | {
2827
+ path: string;
2828
+ } | unknown[];
2829
+ }, options: {
2830
+ page: NotionPage;
2831
+ }): Promise<NotionDelivery | undefined>;
2832
+ /** An integration a test made changes a page's title, as its own `pages.update` would. Sends `page.properties_updated`. Experimental. */
2833
+ rename(title: string, options: {
2834
+ page: NotionPage;
2835
+ }): Promise<NotionDelivery | undefined>;
2083
2836
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2084
2837
  [QUIET](): Promise<QuietState>;
2838
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2839
+ [CONTEXT](): HandleContext;
2085
2840
  }
2086
2841
  /** Wire data of a {@link NotionUser}. */
2087
2842
  export interface NotionUserData {
@@ -2173,6 +2928,66 @@ export declare class NotionUser {
2173
2928
  }): Promise<void>;
2174
2929
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2175
2930
  [QUIET](): Promise<QuietState>;
2931
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2932
+ [CONTEXT](): HandleContext;
2933
+ }
2934
+ /** Wire data of a {@link NotionComment}. */
2935
+ export interface NotionCommentData {
2936
+ id: string;
2937
+ discussion: NotionDiscussionData;
2938
+ author: NotionUserData | NotionIntegrationData;
2939
+ text: string;
2940
+ createdAt: string;
2941
+ delivery?: NotionDeliveryData;
2942
+ }
2943
+ export declare class NotionComment {
2944
+ #private;
2945
+ readonly id: string;
2946
+ readonly discussion: NotionDiscussion;
2947
+ readonly author: NotionUser | NotionIntegration;
2948
+ readonly text: string;
2949
+ readonly createdAt: string;
2950
+ readonly delivery: NotionDelivery | undefined;
2951
+ /** @internal Handles come from the SDK, never from `new`. */
2952
+ constructor(ctx: HandleContext, data: NotionCommentData);
2953
+ /** The `comment.created` delivery this comment caused to this integration (decision 0027), or nothing when it wasn't told. The comment's `delivery` is the built-in integration's. Experimental. */
2954
+ deliveryFor(app: NotionIntegration): Promise<NotionDelivery | undefined>;
2955
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2956
+ [QUIET](): Promise<QuietState>;
2957
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2958
+ [CONTEXT](): HandleContext;
2959
+ }
2960
+ /** Wire data of a {@link NotionDiscussion}. */
2961
+ export interface NotionDiscussionData {
2962
+ id: string;
2963
+ page: NotionPageData;
2964
+ anchor?: string;
2965
+ }
2966
+ export declare class NotionDiscussion {
2967
+ #private;
2968
+ readonly id: string;
2969
+ readonly page: NotionPage;
2970
+ readonly anchor: string | undefined;
2971
+ /** @internal Handles come from the SDK, never from `new`. */
2972
+ constructor(ctx: HandleContext, data: NotionDiscussionData);
2973
+ /** The discussion's comments, oldest first. Experimental. */
2974
+ comments(): Promise<NotionComments>;
2975
+ /** Whether the discussion is resolved. Experimental. */
2976
+ resolved(): Promise<boolean>;
2977
+ /** The discussion as a person reads it. Experimental. */
2978
+ transcript(): Promise<NotionTranscript>;
2979
+ /** Wait for the next new comment matching `from` (anyone if omitted), after the last one this handle saw. */
2980
+ waitForComment(options?: {
2981
+ from?: NotionUser | NotionIntegration | string;
2982
+ } & WaitOptions): Promise<NotionComment>;
2983
+ /** The latest comment matching `from`, once the agent is quiet. Waits for at least one. */
2984
+ latestComment(options?: {
2985
+ from?: NotionUser | NotionIntegration | string;
2986
+ } & QuietOptions): Promise<NotionComment>;
2987
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2988
+ [QUIET](): Promise<QuietState>;
2989
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
2990
+ [CONTEXT](): HandleContext;
2176
2991
  }
2177
2992
  /** Wire data of a {@link NotionPage}. */
2178
2993
  export interface NotionPageData {
@@ -2205,31 +3020,14 @@ export declare class NotionPage {
2205
3020
  transcript(): Promise<NotionTranscript>;
2206
3021
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2207
3022
  [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>;
3023
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3024
+ [CONTEXT](): HandleContext;
2228
3025
  }
2229
3026
  /** Wire data of a {@link NotionDelivery}. */
2230
3027
  export interface NotionDeliveryData {
2231
3028
  id: string;
2232
3029
  channel: "notion";
3030
+ app: string;
2233
3031
  type: string;
2234
3032
  entity: {
2235
3033
  type: string;
@@ -2243,6 +3041,7 @@ export declare class NotionDelivery {
2243
3041
  #private;
2244
3042
  readonly id: string;
2245
3043
  readonly channel: "notion";
3044
+ readonly app: string;
2246
3045
  readonly type: string;
2247
3046
  readonly entity: {
2248
3047
  type: string;
@@ -2265,58 +3064,30 @@ export declare class NotionDelivery {
2265
3064
  settled(options?: WaitOptions): Promise<NotionDelivery>;
2266
3065
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2267
3066
  [QUIET](): Promise<QuietState>;
3067
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3068
+ [CONTEXT](): HandleContext;
2268
3069
  }
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 {
3070
+ /** Wire data of a {@link NotionDatabase}. */
3071
+ export interface NotionDatabaseData {
2293
3072
  id: string;
2294
- page: NotionPageData;
2295
- anchor?: string;
3073
+ channel: "notion";
3074
+ title: string;
3075
+ url: string;
2296
3076
  }
2297
- export declare class NotionDiscussion {
3077
+ export declare class NotionDatabase {
2298
3078
  #private;
2299
3079
  readonly id: string;
2300
- readonly page: NotionPage;
2301
- readonly anchor: string | undefined;
3080
+ readonly channel: "notion";
3081
+ readonly title: string;
3082
+ readonly url: string;
2302
3083
  /** @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>;
3084
+ constructor(ctx: HandleContext, data: NotionDatabaseData);
3085
+ /** The rows of a database, optionally only those whose properties have these values. Experimental. */
3086
+ rows(filter?: Record<string, NotionPropertyValue>): Promise<NotionRows>;
2318
3087
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2319
3088
  [QUIET](): Promise<QuietState>;
3089
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3090
+ [CONTEXT](): HandleContext;
2320
3091
  }
2321
3092
  /** Wire data of a {@link ResendFixture}. */
2322
3093
  export interface ResendFixtureData {
@@ -2329,16 +3100,28 @@ export declare class ResendFixture {
2329
3100
  readonly apiUrl: string;
2330
3101
  /** @internal Handles come from the SDK, never from `new`. */
2331
3102
  constructor(ctx: HandleContext, data: ResendFixtureData);
3103
+ /** Make another app: a team of its own, with its own address and credentials (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_RESEND_APP_<NAME>_WEBHOOK_URL. Experimental. */
3104
+ createApp(options: {
3105
+ name: string;
3106
+ domain?: string;
3107
+ }): Promise<ResendApp>;
3108
+ /** The teams this session used: the agent's first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
3109
+ apps(): Promise<ResendApps>;
2332
3110
  /** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
2333
3111
  createUser(options: {
2334
3112
  name: string;
2335
3113
  address?: string;
2336
3114
  token?: string;
2337
3115
  }): Promise<ResendUser>;
3116
+ /** The people this session created. Experimental. */
3117
+ users(): Promise<ResendUsers>;
3118
+ /** The threads this session's people started, oldest first. Experimental. */
3119
+ threads(): Promise<ResendThreads>;
2338
3120
  /** Every webhook channelstack sent the agent for this session, with every attempt. Experimental. */
2339
3121
  deliveries(options?: {
2340
3122
  type?: string;
2341
3123
  resource?: ResendThread;
3124
+ app?: ResendApp;
2342
3125
  }): Promise<ResendDeliveries>;
2343
3126
  /** The REST calls the agent made about this session's emails, by the SDK's method name (`emails.send`). Experimental. */
2344
3127
  calls(options?: {
@@ -2346,12 +3129,14 @@ export declare class ResendFixture {
2346
3129
  error?: true | string;
2347
3130
  }): Promise<ResendApiCalls>;
2348
3131
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
2349
- waitForCall(filter: {
3132
+ waitForCall(filter?: {
2350
3133
  operation?: string;
2351
3134
  error?: true | string;
2352
3135
  }, options?: WaitOptions): Promise<ResendApiCall>;
2353
3136
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2354
3137
  [QUIET](): Promise<QuietState>;
3138
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3139
+ [CONTEXT](): HandleContext;
2355
3140
  }
2356
3141
  /** Wire data of a {@link ResendApp}. */
2357
3142
  export interface ResendAppData {
@@ -2361,6 +3146,9 @@ export interface ResendAppData {
2361
3146
  name: string;
2362
3147
  botUserId: string;
2363
3148
  address: string;
3149
+ domain: string;
3150
+ apiKey: string;
3151
+ webhookSecret: string;
2364
3152
  }
2365
3153
  export declare class ResendApp {
2366
3154
  #private;
@@ -2370,50 +3158,31 @@ export declare class ResendApp {
2370
3158
  readonly name: string;
2371
3159
  readonly botUserId: string;
2372
3160
  readonly address: string;
3161
+ readonly domain: string;
3162
+ readonly apiKey: string;
3163
+ readonly webhookSecret: string;
2373
3164
  /** @internal Handles come from the SDK, never from `new`. */
2374
3165
  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. */
3166
+ /** An app a test made sends an email, through its own team's API, as its own call would. Experimental. */
2396
3167
  send(options: {
2397
3168
  to: Array<ResendUser | ResendApp>;
2398
3169
  cc?: Array<ResendUser | ResendApp>;
2399
3170
  subject: string;
2400
3171
  text?: string;
2401
3172
  html?: string;
3173
+ headers?: Record<string, string>;
2402
3174
  }): Promise<ResendEmail>;
2403
- /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
3175
+ /** An app a test made replies to an email, in its thread, as its own call would. Experimental. */
2404
3176
  reply(email: ResendEmail, options?: {
2405
3177
  text?: string;
2406
3178
  html?: string;
2407
3179
  all?: boolean;
3180
+ headers?: Record<string, string>;
2408
3181
  }): 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
3182
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2416
3183
  [QUIET](): Promise<QuietState>;
3184
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3185
+ [CONTEXT](): HandleContext;
2417
3186
  }
2418
3187
  /** Wire data of a {@link ResendEmail}. */
2419
3188
  export interface ResendEmailData {
@@ -2428,6 +3197,7 @@ export interface ResendEmailData {
2428
3197
  text: string;
2429
3198
  at: string;
2430
3199
  messageId: string;
3200
+ headers: Record<string, string>;
2431
3201
  delivery?: ResendDeliveryData;
2432
3202
  }
2433
3203
  export declare class ResendEmail {
@@ -2443,13 +3213,18 @@ export declare class ResendEmail {
2443
3213
  readonly text: string;
2444
3214
  readonly at: string;
2445
3215
  readonly messageId: string;
3216
+ readonly headers: Record<string, string>;
2446
3217
  readonly delivery: ResendDelivery | undefined;
2447
3218
  /** @internal Handles come from the SDK, never from `new`. */
2448
3219
  constructor(ctx: HandleContext, data: ResendEmailData);
2449
3220
  /** Re-read an email. Experimental. */
2450
3221
  refresh(): Promise<ResendEmail>;
3222
+ /** The delivery that told this app of the email (decision 0027), or nothing when it wasn't told. Experimental. */
3223
+ deliveryFor(app: ResendApp): Promise<ResendDelivery | undefined>;
2451
3224
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2452
3225
  [QUIET](): Promise<QuietState>;
3226
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3227
+ [CONTEXT](): HandleContext;
2453
3228
  }
2454
3229
  /** Wire data of a {@link ResendThread}. */
2455
3230
  export interface ResendThreadData {
@@ -2480,11 +3255,14 @@ export declare class ResendThread {
2480
3255
  } & QuietOptions): Promise<ResendEmail>;
2481
3256
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2482
3257
  [QUIET](): Promise<QuietState>;
3258
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3259
+ [CONTEXT](): HandleContext;
2483
3260
  }
2484
3261
  /** Wire data of a {@link ResendDelivery}. */
2485
3262
  export interface ResendDeliveryData {
2486
3263
  id: string;
2487
3264
  channel: "resend";
3265
+ app: string;
2488
3266
  type: string;
2489
3267
  email: string;
2490
3268
  payload?: unknown;
@@ -2495,6 +3273,7 @@ export declare class ResendDelivery {
2495
3273
  #private;
2496
3274
  readonly id: string;
2497
3275
  readonly channel: "resend";
3276
+ readonly app: string;
2498
3277
  readonly type: string;
2499
3278
  readonly email: string;
2500
3279
  readonly payload: unknown | undefined;
@@ -2515,6 +3294,50 @@ export declare class ResendDelivery {
2515
3294
  settled(options?: WaitOptions): Promise<ResendDelivery>;
2516
3295
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2517
3296
  [QUIET](): Promise<QuietState>;
3297
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3298
+ [CONTEXT](): HandleContext;
3299
+ }
3300
+ /** Wire data of a {@link ResendUser}. */
3301
+ export interface ResendUserData {
3302
+ id: string;
3303
+ channel: "resend";
3304
+ kind: "user";
3305
+ name: string;
3306
+ address: string;
3307
+ }
3308
+ export declare class ResendUser {
3309
+ #private;
3310
+ readonly id: string;
3311
+ readonly channel: "resend";
3312
+ readonly kind: "user";
3313
+ readonly name: string;
3314
+ readonly address: string;
3315
+ /** @internal Handles come from the SDK, never from `new`. */
3316
+ constructor(ctx: HandleContext, data: ResendUserData);
3317
+ /** The person emails someone: the agent (`resend.app`), another app, or another person. Experimental. */
3318
+ send(options: {
3319
+ to: Array<ResendUser | ResendApp>;
3320
+ cc?: Array<ResendUser | ResendApp>;
3321
+ subject: string;
3322
+ text?: string;
3323
+ html?: string;
3324
+ }): Promise<ResendEmail>;
3325
+ /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
3326
+ reply(email: ResendEmail, options?: {
3327
+ text?: string;
3328
+ html?: string;
3329
+ all?: boolean;
3330
+ }): Promise<ResendEmail>;
3331
+ /** What reached the person's mailbox, oldest first. Experimental. */
3332
+ inbox(): Promise<ResendInbox>;
3333
+ /** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
3334
+ waitForEmail(options?: {
3335
+ from?: ResendPrincipal | string;
3336
+ } & WaitOptions): Promise<ResendEmail>;
3337
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3338
+ [QUIET](): Promise<QuietState>;
3339
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3340
+ [CONTEXT](): HandleContext;
2518
3341
  }
2519
3342
  /** Wire data of a {@link GoogleFixture}. */
2520
3343
  export interface GoogleFixtureData {
@@ -2527,16 +3350,27 @@ export declare class GoogleFixture {
2527
3350
  readonly apiUrl: string;
2528
3351
  /** @internal Handles come from the SDK, never from `new`. */
2529
3352
  constructor(ctx: HandleContext, data: GoogleFixtureData);
3353
+ /** Make another app: a mailbox of its own, with its own address and credentials (decision 0027), or return the one made with this name and settings. Its events go to CHANNELSTACK_GOOGLE_APP_<NAME>_WEBHOOK_URL. Experimental. */
3354
+ createApp(options: {
3355
+ name: string;
3356
+ }): Promise<GoogleApp>;
3357
+ /** The mailboxs this session used: the agent's first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
3358
+ apps(): Promise<GoogleApps>;
2530
3359
  /** Create a person: a mailbox, at `<name>@example.com` unless a test gives the address. Experimental. */
2531
3360
  createUser(options: {
2532
3361
  name: string;
2533
3362
  address?: string;
2534
3363
  token?: string;
2535
3364
  }): Promise<GoogleUser>;
3365
+ /** The people this session created. Experimental. */
3366
+ users(): Promise<GoogleUsers>;
3367
+ /** The threads this session's people started, oldest first. Experimental. */
3368
+ threads(): Promise<GoogleThreads>;
2536
3369
  /** Every push channelstack sent the agent for this session, with every attempt. Experimental. */
2537
3370
  deliveries(options?: {
2538
3371
  type?: string;
2539
3372
  resource?: GoogleThread;
3373
+ app?: GoogleApp;
2540
3374
  }): Promise<GoogleDeliveries>;
2541
3375
  /** The Gmail calls the agent made about this session's mail, by the SDK's method name (`users.messages.send`). Experimental. */
2542
3376
  calls(options?: {
@@ -2544,12 +3378,14 @@ export declare class GoogleFixture {
2544
3378
  error?: true | string;
2545
3379
  }): Promise<GoogleApiCalls>;
2546
3380
  /** Wait for the next new API call from the agent, after the last one this handle saw. */
2547
- waitForCall(filter: {
3381
+ waitForCall(filter?: {
2548
3382
  operation?: string;
2549
3383
  error?: true | string;
2550
3384
  }, options?: WaitOptions): Promise<GoogleApiCall>;
2551
3385
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2552
3386
  [QUIET](): Promise<QuietState>;
3387
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3388
+ [CONTEXT](): HandleContext;
2553
3389
  }
2554
3390
  /** Wire data of a {@link GoogleApp}. */
2555
3391
  export interface GoogleAppData {
@@ -2559,6 +3395,9 @@ export interface GoogleAppData {
2559
3395
  name: string;
2560
3396
  botUserId: string;
2561
3397
  address: string;
3398
+ clientId: string;
3399
+ clientSecret: string;
3400
+ refreshToken: string;
2562
3401
  }
2563
3402
  export declare class GoogleApp {
2564
3403
  #private;
@@ -2568,50 +3407,31 @@ export declare class GoogleApp {
2568
3407
  readonly name: string;
2569
3408
  readonly botUserId: string;
2570
3409
  readonly address: string;
3410
+ readonly clientId: string;
3411
+ readonly clientSecret: string;
3412
+ readonly refreshToken: string;
2571
3413
  /** @internal Handles come from the SDK, never from `new`. */
2572
3414
  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. */
3415
+ /** An app a test made sends an email, through its own mailbox's API, as its own call would. Experimental. */
2594
3416
  send(options: {
2595
3417
  to: Array<GoogleUser | GoogleApp>;
2596
3418
  cc?: Array<GoogleUser | GoogleApp>;
2597
3419
  subject: string;
2598
3420
  text?: string;
2599
3421
  html?: string;
3422
+ headers?: Record<string, string>;
2600
3423
  }): Promise<GoogleEmail>;
2601
- /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
3424
+ /** An app a test made replies to an email, in its thread, as its own call would. Experimental. */
2602
3425
  reply(email: GoogleEmail, options?: {
2603
3426
  text?: string;
2604
3427
  html?: string;
2605
3428
  all?: boolean;
3429
+ headers?: Record<string, string>;
2606
3430
  }): 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
3431
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2614
3432
  [QUIET](): Promise<QuietState>;
3433
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3434
+ [CONTEXT](): HandleContext;
2615
3435
  }
2616
3436
  /** Wire data of a {@link GoogleEmail}. */
2617
3437
  export interface GoogleEmailData {
@@ -2626,6 +3446,7 @@ export interface GoogleEmailData {
2626
3446
  text: string;
2627
3447
  at: string;
2628
3448
  messageId: string;
3449
+ headers: Record<string, string>;
2629
3450
  labels: string[];
2630
3451
  delivery?: GoogleDeliveryData;
2631
3452
  }
@@ -2642,14 +3463,19 @@ export declare class GoogleEmail {
2642
3463
  readonly text: string;
2643
3464
  readonly at: string;
2644
3465
  readonly messageId: string;
3466
+ readonly headers: Record<string, string>;
2645
3467
  readonly labels: string[];
2646
3468
  readonly delivery: GoogleDelivery | undefined;
2647
3469
  /** @internal Handles come from the SDK, never from `new`. */
2648
3470
  constructor(ctx: HandleContext, data: GoogleEmailData);
2649
3471
  /** Re-read an email. Experimental. */
2650
3472
  refresh(): Promise<GoogleEmail>;
3473
+ /** The delivery that told this app of the email (decision 0027), or nothing when it wasn't told. Experimental. */
3474
+ deliveryFor(app: GoogleApp): Promise<GoogleDelivery | undefined>;
2651
3475
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2652
3476
  [QUIET](): Promise<QuietState>;
3477
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3478
+ [CONTEXT](): HandleContext;
2653
3479
  }
2654
3480
  /** Wire data of a {@link GoogleThread}. */
2655
3481
  export interface GoogleThreadData {
@@ -2680,11 +3506,14 @@ export declare class GoogleThread {
2680
3506
  } & QuietOptions): Promise<GoogleEmail>;
2681
3507
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2682
3508
  [QUIET](): Promise<QuietState>;
3509
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3510
+ [CONTEXT](): HandleContext;
2683
3511
  }
2684
3512
  /** Wire data of a {@link GoogleDelivery}. */
2685
3513
  export interface GoogleDeliveryData {
2686
3514
  id: string;
2687
3515
  channel: "google";
3516
+ app: string;
2688
3517
  type: string;
2689
3518
  emailAddress: string;
2690
3519
  historyId: string;
@@ -2696,6 +3525,7 @@ export declare class GoogleDelivery {
2696
3525
  #private;
2697
3526
  readonly id: string;
2698
3527
  readonly channel: "google";
3528
+ readonly app: string;
2699
3529
  readonly type: string;
2700
3530
  readonly emailAddress: string;
2701
3531
  readonly historyId: string;
@@ -2718,6 +3548,607 @@ export declare class GoogleDelivery {
2718
3548
  settled(options?: WaitOptions): Promise<GoogleDelivery>;
2719
3549
  /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
2720
3550
  [QUIET](): Promise<QuietState>;
3551
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3552
+ [CONTEXT](): HandleContext;
3553
+ }
3554
+ /** Wire data of a {@link GoogleUser}. */
3555
+ export interface GoogleUserData {
3556
+ id: string;
3557
+ channel: "google";
3558
+ kind: "user";
3559
+ name: string;
3560
+ address: string;
3561
+ }
3562
+ export declare class GoogleUser {
3563
+ #private;
3564
+ readonly id: string;
3565
+ readonly channel: "google";
3566
+ readonly kind: "user";
3567
+ readonly name: string;
3568
+ readonly address: string;
3569
+ /** @internal Handles come from the SDK, never from `new`. */
3570
+ constructor(ctx: HandleContext, data: GoogleUserData);
3571
+ /** The person emails someone: the agent (`google.app`), another app, or another person. Experimental. */
3572
+ send(options: {
3573
+ to: Array<GoogleUser | GoogleApp>;
3574
+ cc?: Array<GoogleUser | GoogleApp>;
3575
+ subject: string;
3576
+ text?: string;
3577
+ html?: string;
3578
+ }): Promise<GoogleEmail>;
3579
+ /** The person replies to an email, in its thread: `Re:` its subject, with `In-Reply-To` and `References`. Experimental. */
3580
+ reply(email: GoogleEmail, options?: {
3581
+ text?: string;
3582
+ html?: string;
3583
+ all?: boolean;
3584
+ }): Promise<GoogleEmail>;
3585
+ /** What reached the person's mailbox, oldest first. Experimental. */
3586
+ inbox(): Promise<GoogleInbox>;
3587
+ /** Wait for the next new email matching `from` (anyone if omitted), after the last one this handle saw. */
3588
+ waitForEmail(options?: {
3589
+ from?: GooglePrincipal | string;
3590
+ } & WaitOptions): Promise<GoogleEmail>;
3591
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3592
+ [QUIET](): Promise<QuietState>;
3593
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3594
+ [CONTEXT](): HandleContext;
3595
+ }
3596
+ /** Wire data of a {@link DiscordFixture}. */
3597
+ export interface DiscordFixtureData {
3598
+ app: DiscordAppData;
3599
+ apiUrl: string;
3600
+ guild: DiscordGuild;
3601
+ gatewayConnections: number;
3602
+ }
3603
+ export declare class DiscordFixture {
3604
+ #private;
3605
+ readonly app: DiscordApp;
3606
+ readonly apiUrl: string;
3607
+ readonly guild: DiscordGuild;
3608
+ readonly gatewayConnections: number;
3609
+ /** @internal Handles come from the SDK, never from `new`. */
3610
+ constructor(ctx: HandleContext, data: DiscordFixtureData);
3611
+ /** Create a person in the guild. Experimental. */
3612
+ createUser(options: {
3613
+ name: string;
3614
+ id?: string;
3615
+ admin?: boolean;
3616
+ bot?: boolean;
3617
+ token?: string;
3618
+ }): Promise<DiscordUser>;
3619
+ /** The people this session created. Experimental. */
3620
+ users(): Promise<DiscordUsers>;
3621
+ /** Make another app in the guild, with its own application, bot user, token and Ed25519 key (decision 0027), or return the one made with this name and settings. Its bot connects to the Gateway with its own token; its interactions go to CHANNELSTACK_DISCORD_APP_<NAME>_WEBHOOK_URL, or over its Gateway connection. Experimental. */
3622
+ createApp(options: {
3623
+ name: string;
3624
+ privilegedIntents?: Array<"GUILD_MEMBERS" | "GUILD_PRESENCES" | "MESSAGE_CONTENT">;
3625
+ }): Promise<DiscordApp>;
3626
+ /** The apps this session used: the built-in one first, then each it got from `createApp`, in the order it first did. Another session's are `not_found` here. Experimental. */
3627
+ apps(): Promise<DiscordApps>;
3628
+ /** Create a text channel. Only the listed participants see it (a private channel); include the app for the bot to hear it. Experimental. */
3629
+ createChannel(options?: {
3630
+ name?: string;
3631
+ participants?: Array<DiscordUser | DiscordApp>;
3632
+ readOnly?: boolean;
3633
+ topic?: string;
3634
+ }): Promise<DiscordChannel>;
3635
+ /** The session's channels, threads and DMs. Experimental. */
3636
+ channels(): Promise<DiscordChannels>;
3637
+ /** Discord's check of the app's interactions endpoint, as when it is saved in the developer portal: a PING it must answer with a PONG, and one with a bad signature it must refuse with 401. Experimental. */
3638
+ verifyEndpoint(): Promise<DiscordEndpointCheck>;
3639
+ /** Every Gateway dispatch and interaction channelstack sent the bot for this session, with every attempt. Experimental. */
3640
+ deliveries(options?: {
3641
+ type?: string;
3642
+ resource?: DiscordChannel;
3643
+ app?: DiscordApp;
3644
+ }): Promise<DiscordDeliveries>;
3645
+ /** The REST calls the bot made about this session's channels, messages and interactions, by route (`POST /channels/{channel.id}/messages`). Calls about nothing a session owns (`GET /gateway/bot`) are in no session. Experimental. */
3646
+ calls(options?: {
3647
+ operation?: string;
3648
+ error?: true | string;
3649
+ }): Promise<DiscordApiCalls>;
3650
+ /** Inject a fault: rate-limit the bot's calls of a route (removed when this session closes), or drop its Gateway connection just before the next dispatch. Experimental. */
3651
+ fault(options: {
3652
+ type: "rate_limit" | "drop_gateway";
3653
+ route?: string;
3654
+ retryAfter?: Duration;
3655
+ times?: number;
3656
+ app?: DiscordApp;
3657
+ }): Promise<DiscordFault>;
3658
+ /** Wait for the next new API call from the agent, after the last one this handle saw. */
3659
+ waitForCall(filter?: {
3660
+ operation?: string;
3661
+ error?: true | string;
3662
+ }, options?: WaitOptions): Promise<DiscordApiCall>;
3663
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3664
+ [QUIET](): Promise<QuietState>;
3665
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3666
+ [CONTEXT](): HandleContext;
3667
+ }
3668
+ /** Wire data of a {@link DiscordApp}. */
3669
+ export interface DiscordAppData {
3670
+ id: string;
3671
+ name: string;
3672
+ kind: "app";
3673
+ channel: "discord";
3674
+ botUserId: string;
3675
+ botToken: string;
3676
+ publicKey: string;
3677
+ guildId: string;
3678
+ }
3679
+ export declare class DiscordApp {
3680
+ #private;
3681
+ readonly id: string;
3682
+ readonly name: string;
3683
+ readonly kind: "app";
3684
+ readonly channel: "discord";
3685
+ readonly botUserId: string;
3686
+ readonly botToken: string;
3687
+ readonly publicKey: string;
3688
+ readonly guildId: string;
3689
+ /** @internal Handles come from the SDK, never from `new`. */
3690
+ constructor(ctx: HandleContext, data: DiscordAppData);
3691
+ /** An app a test made writes, as its own `POST /channels/{id}/messages` would: in a channel or thread its bot sees, or in a DM with the person in `to`. No bot writes to another bot in a DM (50007). Experimental. */
3692
+ say(text: string | DiscordMessageInput, options?: {
3693
+ channel?: DiscordChannel;
3694
+ to?: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>;
3695
+ }): Promise<DiscordMessage>;
3696
+ /** An app a test made replies to a message: Discord's reply, in the message's channel, which quotes it. Experimental. */
3697
+ reply(text: string | DiscordMessageInput, options: {
3698
+ message: DiscordMessage;
3699
+ }): Promise<DiscordMessage>;
3700
+ /** An app a test made reacts to a message. Experimental. */
3701
+ react(emoji: string, options: {
3702
+ message: DiscordMessage;
3703
+ }): Promise<DiscordDelivery | undefined>;
3704
+ /** An app a test made takes its reaction back. Experimental. */
3705
+ unreact(emoji: string, options: {
3706
+ message: DiscordMessage;
3707
+ }): Promise<DiscordDelivery | undefined>;
3708
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3709
+ [QUIET](): Promise<QuietState>;
3710
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3711
+ [CONTEXT](): HandleContext;
3712
+ }
3713
+ /** Wire data of a {@link DiscordUser}. */
3714
+ export interface DiscordUserData {
3715
+ id: string;
3716
+ name: string;
3717
+ kind: "user";
3718
+ channel: "discord";
3719
+ username: string;
3720
+ isAdmin: boolean;
3721
+ isBot: boolean;
3722
+ }
3723
+ export declare class DiscordUser {
3724
+ #private;
3725
+ readonly id: string;
3726
+ readonly name: string;
3727
+ readonly kind: "user";
3728
+ readonly channel: "discord";
3729
+ readonly username: string;
3730
+ readonly isAdmin: boolean;
3731
+ readonly isBot: boolean;
3732
+ /** @internal Handles come from the SDK, never from `new`. */
3733
+ constructor(ctx: HandleContext, data: DiscordUserData);
3734
+ /** Write a message in a channel or thread, or in a DM with the person or app in `to`. Experimental. */
3735
+ say(text: string | DiscordMessageInput, options?: {
3736
+ channel?: DiscordChannel;
3737
+ to?: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>;
3738
+ }): Promise<DiscordMessage>;
3739
+ /** Reply to a message: Discord's reply, in the message's channel, which quotes it. Experimental. */
3740
+ reply(text: string | DiscordMessageInput, options: {
3741
+ message: DiscordMessage;
3742
+ }): Promise<DiscordMessage>;
3743
+ /** Edit one of this person's own messages. Experimental. */
3744
+ edit(text: string | DiscordMessageInput, options: {
3745
+ message: DiscordMessage;
3746
+ }): Promise<DiscordMessage>;
3747
+ /** Delete a message: this person's own, or anyone's for an admin. Experimental. */
3748
+ delete(options: {
3749
+ message: DiscordMessage;
3750
+ }): Promise<void>;
3751
+ /** React to a message with an emoji. Experimental. */
3752
+ react(emoji: string, options: {
3753
+ message: DiscordMessage;
3754
+ }): Promise<DiscordDelivery | undefined>;
3755
+ /** Take this person's reaction off a message. Experimental. */
3756
+ unreact(emoji: string, options: {
3757
+ message: DiscordMessage;
3758
+ }): Promise<DiscordDelivery | undefined>;
3759
+ /** Start a thread: from a message, or in a channel. Experimental. */
3760
+ startThread(name: string, options?: {
3761
+ message?: DiscordMessage;
3762
+ channel?: DiscordChannel;
3763
+ }): Promise<DiscordChannel>;
3764
+ /** Open (or reuse) a DM with the app or another person. Experimental. */
3765
+ openDM(participant: DiscordUser | DiscordApp): Promise<DiscordChannel>;
3766
+ /** Let people or the app see a channel. The person must be an admin. Experimental. */
3767
+ invite(participants: DiscordUser | DiscordApp | Array<DiscordUser | DiscordApp>, options: {
3768
+ channel: DiscordChannel;
3769
+ }): Promise<void>;
3770
+ /** Run one of an app's slash commands in a channel, e.g. `/deploy web staging` or `/deploy service:web`: the built-in app's, or `app`'s, as a person picks one app's command when several have it. Experimental. */
3771
+ runCommand(command: string, options: {
3772
+ channel: DiscordChannel;
3773
+ app?: DiscordApp;
3774
+ }): Promise<DiscordDelivery | undefined>;
3775
+ /** Press a button, found by its label or custom_id: on a message, or on the app's newest message in a channel or thread that has it. Experimental. */
3776
+ click(button: string | DiscordButtonRef, options?: {
3777
+ message?: DiscordMessage;
3778
+ channel?: DiscordChannel;
3779
+ }): Promise<DiscordDelivery | undefined>;
3780
+ /** Messages only this person sees: the app's ephemeral responses, and "This interaction failed". Experimental. */
3781
+ ephemeral(): Promise<DiscordEphemeralMessages>;
3782
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3783
+ [QUIET](): Promise<QuietState>;
3784
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3785
+ [CONTEXT](): HandleContext;
3786
+ }
3787
+ /** Wire data of a {@link DiscordMessage}. */
3788
+ export interface DiscordMessageData {
3789
+ id: string;
3790
+ channelId: string;
3791
+ channel: DiscordChannelData;
3792
+ author: DiscordUserData | DiscordAppData;
3793
+ text: string;
3794
+ content: string;
3795
+ embeds: unknown[];
3796
+ components: unknown[];
3797
+ postedAt: string;
3798
+ edited: boolean;
3799
+ replyTo?: string;
3800
+ thread?: DiscordChannelData;
3801
+ visibleTo?: DiscordUserData;
3802
+ delivery?: DiscordDeliveryData;
3803
+ }
3804
+ export declare class DiscordMessage {
3805
+ #private;
3806
+ readonly id: string;
3807
+ readonly channelId: string;
3808
+ readonly channel: DiscordChannel;
3809
+ readonly author: DiscordUser | DiscordApp;
3810
+ readonly text: string;
3811
+ readonly content: string;
3812
+ readonly embeds: unknown[];
3813
+ readonly components: unknown[];
3814
+ readonly postedAt: string;
3815
+ readonly edited: boolean;
3816
+ readonly replyTo: string | undefined;
3817
+ readonly thread: DiscordChannel | undefined;
3818
+ readonly visibleTo: DiscordUser | undefined;
3819
+ readonly delivery: DiscordDelivery | undefined;
3820
+ /** @internal Handles come from the SDK, never from `new`. */
3821
+ constructor(ctx: HandleContext, data: DiscordMessageData);
3822
+ /** Re-read a message: its latest text, edits and thread. Experimental. */
3823
+ refresh(): Promise<DiscordMessage>;
3824
+ /** What answers a message, oldest first: Discord's replies to it, and the messages of the thread started from it. Experimental. */
3825
+ replies(): Promise<DiscordReplies>;
3826
+ /** A message and what answers it, as a person reads them. Experimental. */
3827
+ transcript(options?: {
3828
+ as?: DiscordUser | DiscordApp;
3829
+ }): Promise<DiscordTranscript>;
3830
+ /** The reactions on a message, and who added each. Experimental. */
3831
+ reactions(): Promise<DiscordReactions>;
3832
+ /** The first Gateway dispatch this message caused to this app's bot (decision 0027), or nothing when it wasn't told. Experimental. */
3833
+ deliveryFor(app: DiscordApp): Promise<DiscordDelivery | undefined>;
3834
+ /** Every Gateway dispatch this message caused to the apps' bots. Experimental. */
3835
+ deliveries(): Promise<DiscordMessageDeliveries>;
3836
+ /** Wait for the next new reply matching `from` (anyone if omitted), after the last one this handle saw. */
3837
+ waitForReply(options?: {
3838
+ from?: DiscordUser | DiscordApp | string;
3839
+ } & WaitOptions): Promise<DiscordMessage>;
3840
+ /** The latest reply matching `from`, once the agent is quiet. Waits for at least one. */
3841
+ latestReply(options?: {
3842
+ from?: DiscordUser | DiscordApp | string;
3843
+ } & QuietOptions): Promise<DiscordMessage>;
3844
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3845
+ [QUIET](): Promise<QuietState>;
3846
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3847
+ [CONTEXT](): HandleContext;
3848
+ }
3849
+ /** Wire data of a {@link DiscordChannel}. */
3850
+ export interface DiscordChannelData {
3851
+ id: string;
3852
+ kind: "text" | "dm" | "public_thread";
3853
+ channel: "discord";
3854
+ name?: string;
3855
+ parentId?: string;
3856
+ starterId?: string;
3857
+ }
3858
+ export declare class DiscordChannel {
3859
+ #private;
3860
+ readonly id: string;
3861
+ readonly kind: "text" | "dm" | "public_thread";
3862
+ readonly channel: "discord";
3863
+ readonly name: string | undefined;
3864
+ readonly parentId: string | undefined;
3865
+ readonly starterId: string | undefined;
3866
+ /** @internal Handles come from the SDK, never from `new`. */
3867
+ constructor(ctx: HandleContext, data: DiscordChannelData);
3868
+ /** A channel's or thread's messages, oldest first. Experimental. */
3869
+ messages(): Promise<DiscordMessages>;
3870
+ /** Who sees a channel: a text channel's participants, a DM's two ends; a thread's are its channel's. Admins see every channel without being listed. Experimental. */
3871
+ members(): Promise<DiscordMembers>;
3872
+ /** The threads in a channel. Experimental. */
3873
+ threads(): Promise<DiscordThreads>;
3874
+ /** A channel or thread as a person reads it, each thread under the message that starts it. Experimental. */
3875
+ transcript(options?: {
3876
+ as?: DiscordUser | DiscordApp;
3877
+ }): Promise<DiscordTranscript>;
3878
+ /** Wait for the next new message matching `from` (anyone if omitted), after the last one this handle saw. */
3879
+ waitForMessage(options?: {
3880
+ from?: DiscordUser | DiscordApp | string;
3881
+ } & WaitOptions): Promise<DiscordMessage>;
3882
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3883
+ [QUIET](): Promise<QuietState>;
3884
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3885
+ [CONTEXT](): HandleContext;
3886
+ }
3887
+ /** Wire data of a {@link DiscordDelivery}. */
3888
+ export interface DiscordDeliveryData {
3889
+ id: string;
3890
+ channel: "discord";
3891
+ app: string;
3892
+ type: string;
3893
+ payload?: unknown;
3894
+ attempts: DeliveryAttempt[];
3895
+ status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
3896
+ }
3897
+ export declare class DiscordDelivery {
3898
+ #private;
3899
+ readonly id: string;
3900
+ readonly channel: "discord";
3901
+ readonly app: string;
3902
+ readonly type: string;
3903
+ readonly payload: unknown | undefined;
3904
+ readonly attempts: DeliveryAttempt[];
3905
+ readonly status: "pending" | "acknowledged" | "failed" | "timed_out" | "unreachable";
3906
+ /** @internal Handles come from the SDK, never from `new`. */
3907
+ constructor(ctx: HandleContext, data: DiscordDeliveryData);
3908
+ /** Re-read a delivery: its attempts and status. Experimental. */
3909
+ refresh(): Promise<DiscordDelivery>;
3910
+ /** Dispatch the same event to the bot again, as a replay after a RESUME would. Experimental. */
3911
+ redeliver(): Promise<DeliveryAttempt>;
3912
+ /** Send an interaction again, forged: signed with a key that isn't the app's, which its endpoint must refuse with 401. Experimental. */
3913
+ resend(options?: {
3914
+ badSignature?: boolean;
3915
+ }): Promise<DeliveryAttempt>;
3916
+ /** Wait for the delivery to settle, and resolve with the value as it is then. */
3917
+ settled(options?: WaitOptions): Promise<DiscordDelivery>;
3918
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3919
+ [QUIET](): Promise<QuietState>;
3920
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3921
+ [CONTEXT](): HandleContext;
3922
+ }
3923
+ /** Wire data of a {@link DiscordFault}. */
3924
+ export interface DiscordFaultData {
3925
+ id: string;
3926
+ }
3927
+ export declare class DiscordFault implements AsyncDisposable {
3928
+ #private;
3929
+ readonly id: string;
3930
+ /** @internal Handles come from the SDK, never from `new`. */
3931
+ constructor(ctx: HandleContext, data: DiscordFaultData);
3932
+ /** Remove a fault. Experimental. */
3933
+ undo(): Promise<void>;
3934
+ [Symbol.asyncDispose](): Promise<void>;
3935
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3936
+ [QUIET](): Promise<QuietState>;
3937
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3938
+ [CONTEXT](): HandleContext;
3939
+ }
3940
+ /** Wire data of a {@link OpenAIFixture}. */
3941
+ export interface OpenAIFixtureData {
3942
+ baseUrl: string;
3943
+ }
3944
+ export declare class OpenAIFixture {
3945
+ #private;
3946
+ readonly baseUrl: string;
3947
+ /** @internal Handles come from the SDK, never from `new`. */
3948
+ constructor(ctx: HandleContext, data: OpenAIFixtureData);
3949
+ /** Script what the model answers: turns used in order, one per matching call, or a responder the test answers. Scripts are tried in the order they were added. Experimental. */
3950
+ respond(turns?: OpenAITurnInput | OpenAITurnInput[] | Responder<OpenAIRequest, OpenAITurnInput>, options?: {
3951
+ when?: OpenAIMatch;
3952
+ times?: number;
3953
+ timing?: OpenAITiming;
3954
+ }): Promise<OpenAIScript>;
3955
+ /** Every model call attributed to this session, oldest first. Experimental. */
3956
+ calls(options?: {
3957
+ endpoint?: OpenAIEndpoint;
3958
+ error?: true | string;
3959
+ }): Promise<OpenAISessionCalls>;
3960
+ /** Every tool call the model made in this session, each with the result the agent sent back. Experimental. */
3961
+ toolCalls(options?: {
3962
+ name?: string;
3963
+ }): Promise<OpenAISessionToolCalls>;
3964
+ /** What went wrong with the model in this session: a call no script answered, a script that ran out or did what the real API can't, a responder that threw. Matchers fail at once on these. Experimental. */
3965
+ problems(): Promise<OpenAIProblems>;
3966
+ /** The calls that sent a secret channelstack knows to the model, and the kinds they sent (`slack.botToken`): never the values. Experimental. */
3967
+ sentSecrets(): Promise<OpenAISentSecrets>;
3968
+ /** Model calls no session could be given (the agent calling the model at startup, for example), oldest first: what a failing matcher names. Experimental. */
3969
+ unattributed(options?: {
3970
+ withinMs?: number | undefined;
3971
+ }): Promise<OpenAIUnattributedCalls>;
3972
+ /** Limit this session's model calls: requests and tokens per window, with truthful x-ratelimit-* headers. Experimental. */
3973
+ rateLimit(options?: {
3974
+ requests?: {
3975
+ limit: number;
3976
+ per?: Duration;
3977
+ };
3978
+ tokens?: {
3979
+ limit: number;
3980
+ per?: Duration;
3981
+ };
3982
+ error?: "rate_limit" | "slow_down";
3983
+ }): Promise<OpenAIRateLimit>;
3984
+ /** Wait for the next new model call from the agent, after the last one this handle saw. */
3985
+ waitForCall(filter?: {
3986
+ endpoint?: OpenAIEndpoint;
3987
+ error?: true | string;
3988
+ }, options?: WaitOptions): Promise<OpenAICall>;
3989
+ /** The latest model call from the agent, once the agent is quiet. Waits for at least one. */
3990
+ latestCall(filter?: {
3991
+ endpoint?: OpenAIEndpoint;
3992
+ error?: true | string;
3993
+ }, options?: QuietOptions): Promise<OpenAICall>;
3994
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
3995
+ [QUIET](): Promise<QuietState>;
3996
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
3997
+ [CONTEXT](): HandleContext;
3998
+ }
3999
+ /** Wire data of a {@link OpenAIScript}. */
4000
+ export interface OpenAIScriptData {
4001
+ id: string;
4002
+ responder: boolean;
4003
+ times: number;
4004
+ used: number;
4005
+ problems: string[];
4006
+ }
4007
+ export declare class OpenAIScript implements AsyncDisposable {
4008
+ #private;
4009
+ readonly id: string;
4010
+ readonly responder: boolean;
4011
+ readonly times: number;
4012
+ readonly used: number;
4013
+ readonly problems: string[];
4014
+ /** @internal Handles come from the SDK, never from `new`. */
4015
+ constructor(ctx: HandleContext, data: OpenAIScriptData);
4016
+ /** Re-read a script: how many calls it answered, and its problems. Experimental. */
4017
+ refresh(): Promise<OpenAIScript>;
4018
+ /** Remove a script. Closing the session does it too. Experimental. */
4019
+ undo(): Promise<void>;
4020
+ [Symbol.asyncDispose](): Promise<void>;
4021
+ /** Let the streams this script holds at `pauseAfter` go on. Experimental. */
4022
+ resume(): Promise<void>;
4023
+ /** The calls this script answered. Experimental. */
4024
+ calls(): Promise<OpenAICalls>;
4025
+ /** The calls whose streams this script holds at `pauseAfter`. Experimental. */
4026
+ pausedCalls(): Promise<OpenAIPausedCalls>;
4027
+ /** The tool calls this script made, each with the result the agent sent back. Experimental. */
4028
+ toolCalls(options?: {
4029
+ name?: string;
4030
+ }): Promise<OpenAIToolCalls>;
4031
+ /** For a responder's SDK: the calls held for it since `since`, waiting up to `waitMs` for one. Experimental. */
4032
+ heldCalls(options?: {
4033
+ since?: string;
4034
+ waitMs?: number | undefined;
4035
+ }): Promise<OpenAIHeldPage>;
4036
+ /** For a responder's SDK: answer a held call with a turn, or report that the test's function threw. Experimental. */
4037
+ answerHeld(held: string, options?: {
4038
+ turn?: OpenAITurnInput;
4039
+ error?: string;
4040
+ }): Promise<void>;
4041
+ /** Wait for the next new model call this script answers, after the last one this handle saw. */
4042
+ waitForCall(options?: WaitOptions): Promise<OpenAICall>;
4043
+ /** Wait for the next new stream held at pauseAfter, after the last one this handle saw. */
4044
+ waitForPause(options?: WaitOptions): Promise<OpenAICall>;
4045
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
4046
+ [QUIET](): Promise<QuietState>;
4047
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
4048
+ [CONTEXT](): HandleContext;
4049
+ }
4050
+ /** Wire data of a {@link OpenAICall}. */
4051
+ export interface OpenAICallData {
4052
+ id: string;
4053
+ endpoint: OpenAIEndpoint;
4054
+ model: string;
4055
+ stream: boolean;
4056
+ at: string;
4057
+ durationMs: number;
4058
+ attempt: number;
4059
+ done: boolean;
4060
+ request: OpenAIRequest;
4061
+ response: {
4062
+ status: number;
4063
+ text?: string;
4064
+ finish?: string;
4065
+ error?: string;
4066
+ aborted: boolean;
4067
+ chunksSent?: number;
4068
+ end?: "completed" | "errored" | "dropped" | "stalled" | "aborted";
4069
+ };
4070
+ toolCalls: OpenAIToolCall[];
4071
+ script?: string;
4072
+ }
4073
+ export declare class OpenAICall {
4074
+ #private;
4075
+ readonly id: string;
4076
+ readonly endpoint: OpenAIEndpoint;
4077
+ readonly model: string;
4078
+ readonly stream: boolean;
4079
+ readonly at: string;
4080
+ readonly durationMs: number;
4081
+ readonly attempt: number;
4082
+ readonly done: boolean;
4083
+ readonly request: OpenAIRequest;
4084
+ readonly response: {
4085
+ status: number;
4086
+ text?: string;
4087
+ finish?: string;
4088
+ error?: string;
4089
+ aborted: boolean;
4090
+ chunksSent?: number;
4091
+ end?: "completed" | "errored" | "dropped" | "stalled" | "aborted";
4092
+ };
4093
+ readonly toolCalls: OpenAIToolCall[];
4094
+ readonly script: string | undefined;
4095
+ /** @internal Handles come from the SDK, never from `new`. */
4096
+ constructor(ctx: HandleContext, data: OpenAICallData);
4097
+ /** Re-read a model call: whether it is done, how it ended. Experimental. */
4098
+ refresh(): Promise<OpenAICall>;
4099
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
4100
+ [QUIET](): Promise<QuietState>;
4101
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
4102
+ [CONTEXT](): HandleContext;
4103
+ }
4104
+ /** Wire data of a {@link OpenAIRateLimit}. */
4105
+ export interface OpenAIRateLimitData {
4106
+ id: string;
4107
+ requests?: number;
4108
+ tokens?: number;
4109
+ resetsInMs: number;
4110
+ }
4111
+ export declare class OpenAIRateLimit implements AsyncDisposable {
4112
+ #private;
4113
+ readonly id: string;
4114
+ readonly requests: number | undefined;
4115
+ readonly tokens: number | undefined;
4116
+ readonly resetsInMs: number;
4117
+ /** @internal Handles come from the SDK, never from `new`. */
4118
+ constructor(ctx: HandleContext, data: OpenAIRateLimitData);
4119
+ /** What the rate limit's headers would say now. Experimental. */
4120
+ remaining(): Promise<OpenAIRateLimit>;
4121
+ /** Remove the rate limit. Experimental. */
4122
+ undo(): Promise<void>;
4123
+ [Symbol.asyncDispose](): Promise<void>;
4124
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
4125
+ [QUIET](): Promise<QuietState>;
4126
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
4127
+ [CONTEXT](): HandleContext;
4128
+ }
4129
+ /** Wire data of a {@link Place}. */
4130
+ export interface PlaceData {
4131
+ channel: string;
4132
+ title: string;
4133
+ id: string;
4134
+ name: string;
4135
+ active?: string;
4136
+ }
4137
+ export declare class Place {
4138
+ #private;
4139
+ readonly channel: string;
4140
+ readonly title: string;
4141
+ readonly id: string;
4142
+ readonly name: string;
4143
+ readonly active: string | undefined;
4144
+ /** @internal Handles come from the SDK, never from `new`. */
4145
+ constructor(ctx: HandleContext, data: PlaceData);
4146
+ /** A place as a person reads it: the transcript its channel's own transcript route has. Experimental. */
4147
+ transcript(): Promise<PlaceTranscript>;
4148
+ /** @internal Is the agent quiet in this handle's session? Matchers ask this. */
4149
+ [QUIET](): Promise<QuietState>;
4150
+ /** @internal The server and session this handle lives in: what a failing matcher reads the session's model calls with. */
4151
+ [CONTEXT](): HandleContext;
2721
4152
  }
2722
4153
  /** Wire data of a {@link GitHubPullRequest}. */
2723
4154
  export interface GitHubPullRequestData extends GitHubIssueData {