@juzi/wechaty 1.0.146 → 1.0.147

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 (131) hide show
  1. package/dist/cjs/src/mods/impls.d.ts +2 -2
  2. package/dist/cjs/src/mods/impls.d.ts.map +1 -1
  3. package/dist/cjs/src/mods/impls.js +2 -1
  4. package/dist/cjs/src/mods/impls.js.map +1 -1
  5. package/dist/cjs/src/mods/users.d.ts +2 -1
  6. package/dist/cjs/src/mods/users.d.ts.map +1 -1
  7. package/dist/cjs/src/package-json.js +4 -4
  8. package/dist/cjs/src/package-json.js.map +1 -1
  9. package/dist/cjs/src/schemas/call-events.d.ts +20 -0
  10. package/dist/cjs/src/schemas/call-events.d.ts.map +1 -0
  11. package/dist/cjs/src/schemas/call-events.js +7 -0
  12. package/dist/cjs/src/schemas/call-events.js.map +1 -0
  13. package/dist/cjs/src/schemas/mod.d.ts +3 -2
  14. package/dist/cjs/src/schemas/mod.d.ts.map +1 -1
  15. package/dist/cjs/src/schemas/mod.js +3 -1
  16. package/dist/cjs/src/schemas/mod.js.map +1 -1
  17. package/dist/cjs/src/schemas/wechaty-events.d.ts +23 -2
  18. package/dist/cjs/src/schemas/wechaty-events.d.ts.map +1 -1
  19. package/dist/cjs/src/schemas/wechaty-events.js +6 -0
  20. package/dist/cjs/src/schemas/wechaty-events.js.map +1 -1
  21. package/dist/cjs/src/user-modules/call.d.ts +158 -0
  22. package/dist/cjs/src/user-modules/call.d.ts.map +1 -1
  23. package/dist/cjs/src/user-modules/call.js +289 -1
  24. package/dist/cjs/src/user-modules/call.js.map +1 -1
  25. package/dist/cjs/src/user-modules/call.spec.d.ts +7 -0
  26. package/dist/cjs/src/user-modules/call.spec.d.ts.map +1 -0
  27. package/dist/cjs/src/user-modules/call.spec.js +759 -0
  28. package/dist/cjs/src/user-modules/call.spec.js.map +1 -0
  29. package/dist/cjs/src/user-modules/contact.d.ts +16 -0
  30. package/dist/cjs/src/user-modules/contact.d.ts.map +1 -1
  31. package/dist/cjs/src/user-modules/contact.js +16 -0
  32. package/dist/cjs/src/user-modules/contact.js.map +1 -1
  33. package/dist/cjs/src/user-modules/mod.d.ts +5 -4
  34. package/dist/cjs/src/user-modules/mod.d.ts.map +1 -1
  35. package/dist/cjs/src/user-modules/mod.js +2 -1
  36. package/dist/cjs/src/user-modules/mod.js.map +1 -1
  37. package/dist/cjs/src/wechaty/wechaty-base.d.ts +66 -7
  38. package/dist/cjs/src/wechaty/wechaty-base.d.ts.map +1 -1
  39. package/dist/cjs/src/wechaty/wechaty-base.js +28 -0
  40. package/dist/cjs/src/wechaty/wechaty-base.js.map +1 -1
  41. package/dist/cjs/src/wechaty/wechaty-impl.spec.js +10 -8
  42. package/dist/cjs/src/wechaty/wechaty-impl.spec.js.map +1 -1
  43. package/dist/cjs/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  44. package/dist/cjs/src/wechaty-mixins/io-mixin.d.ts +2 -2
  45. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts +15 -5
  46. package/dist/cjs/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  47. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts +15 -5
  48. package/dist/cjs/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  49. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts +32 -6
  50. package/dist/cjs/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  51. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts +39 -5
  52. package/dist/cjs/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  53. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js +149 -0
  54. package/dist/cjs/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  55. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +5 -3
  56. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  57. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js +3 -0
  58. package/dist/cjs/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  59. package/dist/esm/src/mods/impls.d.ts +2 -2
  60. package/dist/esm/src/mods/impls.d.ts.map +1 -1
  61. package/dist/esm/src/mods/impls.js +1 -1
  62. package/dist/esm/src/mods/impls.js.map +1 -1
  63. package/dist/esm/src/mods/users.d.ts +2 -1
  64. package/dist/esm/src/mods/users.d.ts.map +1 -1
  65. package/dist/esm/src/package-json.js +4 -4
  66. package/dist/esm/src/package-json.js.map +1 -1
  67. package/dist/esm/src/schemas/call-events.d.ts +20 -0
  68. package/dist/esm/src/schemas/call-events.d.ts.map +1 -0
  69. package/dist/esm/src/schemas/call-events.js +4 -0
  70. package/dist/esm/src/schemas/call-events.js.map +1 -0
  71. package/dist/esm/src/schemas/mod.d.ts +3 -2
  72. package/dist/esm/src/schemas/mod.d.ts.map +1 -1
  73. package/dist/esm/src/schemas/mod.js +2 -1
  74. package/dist/esm/src/schemas/mod.js.map +1 -1
  75. package/dist/esm/src/schemas/wechaty-events.d.ts +23 -2
  76. package/dist/esm/src/schemas/wechaty-events.d.ts.map +1 -1
  77. package/dist/esm/src/schemas/wechaty-events.js +6 -0
  78. package/dist/esm/src/schemas/wechaty-events.js.map +1 -1
  79. package/dist/esm/src/user-modules/call.d.ts +158 -0
  80. package/dist/esm/src/user-modules/call.d.ts.map +1 -1
  81. package/dist/esm/src/user-modules/call.js +289 -1
  82. package/dist/esm/src/user-modules/call.js.map +1 -1
  83. package/dist/esm/src/user-modules/call.spec.d.ts +7 -0
  84. package/dist/esm/src/user-modules/call.spec.d.ts.map +1 -0
  85. package/dist/esm/src/user-modules/call.spec.js +734 -0
  86. package/dist/esm/src/user-modules/call.spec.js.map +1 -0
  87. package/dist/esm/src/user-modules/contact.d.ts +16 -0
  88. package/dist/esm/src/user-modules/contact.d.ts.map +1 -1
  89. package/dist/esm/src/user-modules/contact.js +16 -0
  90. package/dist/esm/src/user-modules/contact.js.map +1 -1
  91. package/dist/esm/src/user-modules/mod.d.ts +5 -4
  92. package/dist/esm/src/user-modules/mod.d.ts.map +1 -1
  93. package/dist/esm/src/user-modules/mod.js +2 -2
  94. package/dist/esm/src/user-modules/mod.js.map +1 -1
  95. package/dist/esm/src/wechaty/wechaty-base.d.ts +66 -7
  96. package/dist/esm/src/wechaty/wechaty-base.d.ts.map +1 -1
  97. package/dist/esm/src/wechaty/wechaty-base.js +28 -0
  98. package/dist/esm/src/wechaty/wechaty-base.js.map +1 -1
  99. package/dist/esm/src/wechaty/wechaty-impl.spec.js +10 -8
  100. package/dist/esm/src/wechaty/wechaty-impl.spec.js.map +1 -1
  101. package/dist/esm/src/wechaty-mixins/gerror-mixin.d.ts +1 -1
  102. package/dist/esm/src/wechaty-mixins/io-mixin.d.ts +2 -2
  103. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts +15 -5
  104. package/dist/esm/src/wechaty-mixins/login-mixin.d.ts.map +1 -1
  105. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts +15 -5
  106. package/dist/esm/src/wechaty-mixins/misc-mixin.d.ts.map +1 -1
  107. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts +32 -6
  108. package/dist/esm/src/wechaty-mixins/plugin-mixin.d.ts.map +1 -1
  109. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts +39 -5
  110. package/dist/esm/src/wechaty-mixins/puppet-mixin.d.ts.map +1 -1
  111. package/dist/esm/src/wechaty-mixins/puppet-mixin.js +149 -0
  112. package/dist/esm/src/wechaty-mixins/puppet-mixin.js.map +1 -1
  113. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts +5 -3
  114. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.d.ts.map +1 -1
  115. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js +4 -1
  116. package/dist/esm/src/wechaty-mixins/wechatify-user-module-mixin.js.map +1 -1
  117. package/package.json +3 -3
  118. package/src/mods/impls.ts +2 -0
  119. package/src/mods/users.ts +6 -0
  120. package/src/package-json.ts +4 -4
  121. package/src/schemas/call-events.ts +35 -0
  122. package/src/schemas/mod.ts +6 -0
  123. package/src/schemas/wechaty-events.ts +28 -0
  124. package/src/user-modules/call.spec.ts +929 -0
  125. package/src/user-modules/call.ts +373 -0
  126. package/src/user-modules/contact.ts +18 -0
  127. package/src/user-modules/mod.ts +11 -0
  128. package/src/wechaty/wechaty-base.ts +40 -1
  129. package/src/wechaty/wechaty-impl.spec.ts +4 -0
  130. package/src/wechaty-mixins/puppet-mixin.ts +184 -0
  131. package/src/wechaty-mixins/wechatify-user-module-mixin.ts +6 -0
@@ -15,7 +15,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
15
15
  init(): Promise<void>;
16
16
  start(): Promise<void>;
17
17
  stop(): Promise<void>;
18
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
18
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
19
19
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
20
20
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
21
21
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -65,7 +65,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
65
65
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
66
66
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
67
67
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
68
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
68
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
69
69
  addListener<E_10 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_10, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_10]): any;
70
70
  once<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
71
71
  prependListener<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
@@ -82,12 +82,15 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
82
82
  setMaxListeners(maxListeners: number): any;
83
83
  __events: import("../schemas/wechaty-events.js").WechatyEventListeners;
84
84
  __puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
85
+ __callPool: Map<string, import("../user-modules/call.js").CallImpl>;
85
86
  readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
86
87
  readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
87
88
  __loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
88
89
  __puppetMixinInited: boolean;
89
90
  ready(): Promise<void>;
90
91
  __setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
92
+ __finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
93
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
91
94
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
92
95
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
93
96
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -96,6 +99,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
96
99
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
97
100
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
98
101
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
102
+ /**
103
+ * Return the function to uninstall all plugins
104
+ */
99
105
  __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
100
106
  __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
101
107
  __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
@@ -114,6 +120,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
114
120
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
115
121
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
116
122
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
123
+ readonly Call: import("../user-modules/call.js").CallConstructor;
117
124
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
118
125
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
119
126
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -149,6 +156,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
149
156
  readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
150
157
  }) & ((abstract new (...args: any[]) => {
151
158
  __puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
159
+ __callPool: Map<string, import("../user-modules/call.js").CallImpl>;
152
160
  readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
153
161
  readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
154
162
  __loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
@@ -158,6 +166,8 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
158
166
  ready(): Promise<void>;
159
167
  init(): Promise<void>;
160
168
  __setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
169
+ __finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
170
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
161
171
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
162
172
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
163
173
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -166,6 +176,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
166
176
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
167
177
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
168
178
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
179
+ /**
180
+ * Return the function to uninstall all plugins
181
+ */
169
182
  __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
170
183
  __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
171
184
  __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
@@ -184,6 +197,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
184
197
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
185
198
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
186
199
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
200
+ readonly Call: import("../user-modules/call.js").CallConstructor;
187
201
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
188
202
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
189
203
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -215,7 +229,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
215
229
  __memory?: import("memory-card").MemoryCard | undefined;
216
230
  readonly memory: import("memory-card").MemoryCard;
217
231
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
218
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
232
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
219
233
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
220
234
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
221
235
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -239,6 +253,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
239
253
  }) & {
240
254
  readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
241
255
  }) & ((abstract new (...args: any[]) => {
256
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
242
257
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
243
258
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
244
259
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -247,6 +262,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
247
262
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
248
263
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
249
264
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
265
+ /**
266
+ * Return the function to uninstall all plugins
267
+ */
250
268
  __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
251
269
  __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
252
270
  __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
@@ -265,6 +283,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
265
283
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
266
284
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
267
285
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
286
+ readonly Call: import("../user-modules/call.js").CallConstructor;
268
287
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
269
288
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
270
289
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -299,7 +318,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
299
318
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
300
319
  start(): Promise<void>;
301
320
  stop(): Promise<void>;
302
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
321
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
303
322
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
304
323
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
305
324
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -329,7 +348,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
329
348
  readonly memory: import("memory-card").MemoryCard;
330
349
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
331
350
  init(): Promise<void>;
332
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
351
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
333
352
  addListener<E_32 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_32, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_32]): any;
334
353
  once<E_33 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_33, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_33]): any;
335
354
  prependListener<E_34 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_34, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_34]): any;
@@ -378,7 +397,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
378
397
  init: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
379
398
  start: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
380
399
  stop: (() => Promise<void>) & (() => Promise<void>) & (() => Promise<void>);
381
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
400
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
382
401
  addListener<E_39 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_39, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_39]): any;
383
402
  once<E_40 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_40, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_40]): any;
384
403
  prependListener<E_41 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_41, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_41]): any;
@@ -421,12 +440,15 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
421
440
  sleep(milliseconds: number): Promise<void>;
422
441
  ding(data?: string | undefined): void;
423
442
  __puppet?: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface | undefined;
443
+ __callPool: Map<string, import("../user-modules/call.js").CallImpl>;
424
444
  readonly puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface;
425
445
  readonly __readyState: import("state-switch/dist/esm/src/interfaces.js").StateSwitchInterface;
426
446
  __loginIndicator: import("state-switch/dist/esm/src/boolean-indicator.js").BooleanIndicator;
427
447
  __puppetMixinInited: boolean;
428
448
  ready(): Promise<void>;
429
449
  __setupPuppetEvents(puppet: import("@juzi/wechaty-puppet/dist/esm/src/puppet/puppet-interface.js").PuppetInterface): void;
450
+ __finalizeIfEnded(call: import("../user-modules/call.js").CallImpl, force?: boolean): Promise<void>;
451
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
430
452
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
431
453
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
432
454
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -435,6 +457,9 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
435
457
  __wechatifiedLocation?: import("../user-modules/location.js").LocationConstructor | undefined;
436
458
  __wechatifiedMessage?: import("../user-modules/message.js").MessageConstructor | undefined;
437
459
  __wechatifiedMiniProgram?: import("../user-modules/mini-program.js").MiniProgramConstructor | undefined;
460
+ /**
461
+ * Return the function to uninstall all plugins
462
+ */
438
463
  __wechatifiedPost?: import("../user-modules/post.js").PostConstructor | undefined;
439
464
  __wechatifiedRoom?: import("../user-modules/room.js").RoomConstructor | undefined;
440
465
  __wechatifiedRoomInvitation?: import("../user-modules/room-invitation.js").RoomInvitationConstructor | undefined;
@@ -453,6 +478,7 @@ declare const pluginMixin: <MixinBase extends typeof WechatySkeleton & ((abstrac
453
478
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
454
479
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
455
480
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
481
+ readonly Call: import("../user-modules/call.js").CallConstructor;
456
482
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
457
483
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
458
484
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/plugin-mixin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACzB,MAAkC,cAAc,CAAA;AAKjD,OAAO,KAAK,EACV,eAAe,EAChB,MAA4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Indicator, StateSwitchInterface } from 'state-switch';
3
+ import type { CallImpl } from '../user-modules/mod.js';
3
4
  /**
4
5
  * Huan(202111): `puppetMixin` must extend `pluginMixin`
5
6
  * because the `wechaty-redux` plugin need to be installed before
@@ -9,6 +10,7 @@ import { BooleanIndicator, StateSwitchInterface } from 'state-switch';
9
10
  * because the Io need the puppet instance to be ready when it starts
10
11
  */
11
12
  declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) => {
13
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
12
14
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
13
15
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
14
16
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -35,6 +37,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
35
37
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
36
38
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
37
39
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
40
+ readonly Call: import("../user-modules/call.js").CallConstructor;
38
41
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
39
42
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
40
43
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -69,7 +72,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
69
72
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
70
73
  start(): Promise<void>;
71
74
  stop(): Promise<void>;
72
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
75
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
73
76
  addListener<E extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E]): any;
74
77
  once<E_1 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_1, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_1]): any;
75
78
  prependListener<E_2 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_2, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_2]): any;
@@ -99,7 +102,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
99
102
  init(): Promise<void>;
100
103
  start(): Promise<void>;
101
104
  stop(): Promise<void>;
102
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
105
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
103
106
  addListener<E_11 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_11, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_11]): any;
104
107
  once<E_12 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_12, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_12]): any;
105
108
  prependListener<E_13 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_13, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_13]): any;
@@ -128,7 +131,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
128
131
  readonly memory: import("memory-card").MemoryCard;
129
132
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
130
133
  init(): Promise<void>;
131
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
134
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
132
135
  addListener<E_18 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_18, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_18]): any;
133
136
  once<E_19 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_19, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_19]): any;
134
137
  prependListener<E_20 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_20, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_20]): any;
@@ -150,6 +153,8 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
150
153
  readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
151
154
  })>(mixinBase: MixinBase) => ((abstract new (...args: any[]) => {
152
155
  __puppet?: PUPPET.impls.PuppetInterface | undefined;
156
+ /** Registry of active Call instances keyed by callId. */
157
+ __callPool: Map<string, CallImpl>;
153
158
  readonly puppet: PUPPET.impls.PuppetInterface;
154
159
  readonly __readyState: StateSwitchInterface;
155
160
  __loginIndicator: BooleanIndicator;
@@ -159,6 +164,34 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
159
164
  ready(): Promise<void>;
160
165
  init(): Promise<void>;
161
166
  __setupPuppetEvents(puppet: PUPPET.impls.PuppetInterface): void;
167
+ /**
168
+ * Decide whether a call has reached its terminal state and, if so, drive
169
+ * the local lifecycle to ended by invoking {@link CallImpl.__markEnded},
170
+ * which routes through __finalize and is responsible for emitting both
171
+ * the object 'ended' and the bot 'call-ended' lifecycle events as well
172
+ * as evicting the call from the pool. This method does NOT emit
173
+ * 'call-ended' directly — that would risk a double-emit if a local
174
+ * control path (reject/cancel/hangup) finalizes the call before the
175
+ * puppet echo reaches here. The `__endedEmitted` sentinel inside
176
+ * __finalize makes the joint behavior idempotent.
177
+ *
178
+ * Strategy:
179
+ * - `force=true` short-circuits when the caller already knows the call is
180
+ * over (Cancel from the receiver's perspective).
181
+ * - Otherwise, refresh the payload via dirty + ready and check
182
+ * `endTime`, with a short retry budget so transient puppet hiccups do
183
+ * not strand a Call in the pool.
184
+ * - As a last-resort heuristic, an ended-leaning signal (Reject / Hangup)
185
+ * on a strict 1v1 call (participants.length === 2: the starter plus
186
+ * exactly one invitee) is treated as terminal even if sync never
187
+ * recovered: in 1v1 the protocol has no other peer to keep the
188
+ * session alive. Other roster shapes (length 0/1/3+) fall through
189
+ * and wait for the next dirty signal — length<=1 is a stranded-but-
190
+ * recoverable shape (empty roster from a sync hiccup, or a multi-
191
+ * party call whose other members already left).
192
+ */
193
+ __finalizeIfEnded(call: CallImpl, force?: boolean): Promise<void>;
194
+ __wechatifiedCall?: import("../user-modules/call.js").CallConstructor | undefined;
162
195
  __wechatifiedContact?: import("../user-modules/contact.js").ContactConstructor | undefined;
163
196
  __wechatifiedContactSelf?: import("../user-modules/contact-self.js").ContactSelfConstructor | undefined;
164
197
  __wechatifiedDelay?: import("../user-modules/delay.js").DelayConstructor | undefined;
@@ -185,6 +218,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
185
218
  __wechatifiedImSpecific?: import("../user-modules/im-specific.js").ImSpecificConstructor | undefined;
186
219
  __wechatifiedWxxdProduct?: import("../user-modules/wxxd-product.js").WxxdProductConstructor | undefined;
187
220
  __wechatifiedWxxdOrder?: import("../user-modules/wxxd-order.js").WxxdOrderConstructor | undefined;
221
+ readonly Call: import("../user-modules/call.js").CallConstructor;
188
222
  readonly Contact: import("../user-modules/contact.js").ContactConstructor;
189
223
  readonly ContactSelf: import("../user-modules/contact-self.js").ContactSelfConstructor;
190
224
  readonly Delay: import("../user-modules/delay.js").DelayConstructor;
@@ -216,7 +250,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
216
250
  __memory?: import("memory-card").MemoryCard | undefined;
217
251
  readonly memory: import("memory-card").MemoryCard;
218
252
  __options: import("../schemas/wechaty-options.js").WechatyOptions;
219
- on(event: "error" | "ready" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order", listener: (...args: any[]) => any): any;
253
+ on(event: "error" | "ready" | "call" | "tag" | "login" | "start" | "stop" | "logout" | "room-invite" | "room-join" | "room-leave" | "room-topic" | "room-announce" | "dong" | "friendship" | "heartbeat" | "message" | "post" | "puppet" | "scan" | "tag-group" | "post-comment" | "post-tap" | "verify-code" | "dirty" | "login-url" | "intent-comment" | "verify-slide" | "contact-enter-conversation" | "contact-lead-filled" | "wxxd-shop" | "wxxd-product" | "wxxd-order" | "call-ringing" | "call-accept" | "call-reject" | "call-cancel" | "call-hangup" | "call-ended", listener: (...args: any[]) => any): any;
220
254
  addListener<E_25 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_25, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_25]): any;
221
255
  once<E_26 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_26, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_26]): any;
222
256
  prependListener<E_27 extends keyof import("../schemas/wechaty-events.js").WechatyEventListeners>(event: E_27, listener: import("../schemas/wechaty-events.js").WechatyEventListeners[E_27]): any;
@@ -241,7 +275,7 @@ declare const puppetMixin: <MixinBase extends ((abstract new (...args: any[]) =>
241
275
  readonly log: import("brolog/dist/esm/src/logger.js").Loggable;
242
276
  }) & MixinBase;
243
277
  declare type PuppetMixin = ReturnType<typeof puppetMixin>;
244
- declare type ProtectedPropertyPuppetMixin = '__puppet' | '__readyState' | '__setupPuppetEvents' | '__loginIndicator';
278
+ declare type ProtectedPropertyPuppetMixin = '__puppet' | '__callPool' | '__readyState' | '__setupPuppetEvents' | '__finalizeIfEnded' | '__loginIndicator';
245
279
  export type { PuppetMixin, ProtectedPropertyPuppetMixin, };
246
280
  export { puppetMixin, };
247
281
  //# sourceMappingURL=puppet-mixin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","sources":["../../../../src/wechaty-mixins/puppet-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAW,sBAAsB,CAAA;AAQnD,OAAO,EAEL,gBAAgB,EAChB,oBAAoB,EACrB,MAAO,cAAc,CAAA;AA0BtB;;;;;;;GAOG;AACH,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sDAqBS,GAAG,EAAE;;;2BANH,oBAAoB;sBAE1B,gBAAgB;;aAmBT,QAAQ,IAAI,CAAC;YA+Cd,QAAQ,IAAI,CAAC;aAuBrB,QAAQ,IAAI,CAAC;YAML,QAAQ,IAAI,CAAC;gCA8CR,OAAO,KAAK,CAAC,eAAe,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA4lBnE,CAAA;AAED,aAAK,WAAW,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;AAEjD,aAAK,4BAA4B,GAC7B,UAAU,GACV,cAAc,GACd,qBAAqB,GACrB,kBAAkB,CAAA;AAEtB,YAAY,EACV,WAAW,EACX,4BAA4B,GAC7B,CAAA;AACD,OAAO,EACL,WAAW,GACZ,CAAA"}
1
+ {"version":3,"file":"puppet-mixin.d.ts","sourceRoot":"","s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ixinBase.name);
20
20
  class PuppetMixin extends mixinBase {
21
21
  __puppet;
22
+ /** Registry of active Call instances keyed by callId. */
23
+ __callPool = new Map();
22
24
  get puppet() {
23
25
  if (!this.__puppet) {
24
26
  throw new Error('NOPUPPET');
@@ -99,6 +101,7 @@ const puppetMixin = (mixinBase) => {
99
101
  log.verbose('WechatyPuppetMixin', 'stop() super.stop() ...');
100
102
  await super.stop();
101
103
  log.verbose('WechatyPuppetMixin', 'stop() super.stop() ... done');
104
+ this.__callPool.clear();
102
105
  }
103
106
  async ready() {
104
107
  log.verbose('WechatyPuppetMixin', 'ready()');
@@ -636,6 +639,29 @@ const puppetMixin = (mixinBase) => {
636
639
  await order?.ready(true);
637
640
  break;
638
641
  }
642
+ case PUPPET.types.Payload.Call: {
643
+ /**
644
+ * Invalidate the puppet-side cache so the next callPayload()
645
+ * pull reflects the latest server state, then refresh the
646
+ * user-layer Call payload so getters (media / participants /
647
+ * endTime) reflect the new view immediately. Whether the
648
+ * call is still alive is still decided by the call-event
649
+ * handler via __finalizeIfEnded; we do not touch the pool
650
+ * here, and we do not emit a synthetic user event — the
651
+ * UI is expected to read getters when it needs the value.
652
+ */
653
+ await this.puppet.callPayloadDirty(payloadId);
654
+ const call = this.__callPool.get(payloadId);
655
+ if (call) {
656
+ try {
657
+ await call.ready(true);
658
+ }
659
+ catch (e) {
660
+ log.warn('WechatyPuppetMixin', 'dirty(Call) ready failed for callId=%s: %s', payloadId, e.message);
661
+ }
662
+ }
663
+ break;
664
+ }
639
665
  case PUPPET.types.Payload.Unspecified:
640
666
  default:
641
667
  log.warn('unknown payload type: ' + payloadType);
@@ -676,6 +702,68 @@ const puppetMixin = (mixinBase) => {
676
702
  this.emit('wxxd-order', payload?.payload);
677
703
  });
678
704
  break;
705
+ case 'call':
706
+ puppet.on('call', async (payload) => {
707
+ try {
708
+ if (payload.signal === PUPPET.types.CallSignal.Invite) {
709
+ if (this.__callPool.has(payload.callId)) {
710
+ log.warn('WechatyPuppetMixin', '__setupPuppetEvents() duplicate Invite for callId=%s, ignoring', payload.callId);
711
+ return;
712
+ }
713
+ const call = new this.Call({
714
+ id: payload.callId,
715
+ direction: 'incoming',
716
+ });
717
+ await call.ready();
718
+ this.__callPool.set(call.id, call);
719
+ this.emit('call', call);
720
+ return;
721
+ }
722
+ const call = this.__callPool.get(payload.callId);
723
+ if (!call) {
724
+ // Under the protocol-mints-id model, signals for an unknown callId
725
+ // are expected within race windows (e.g. a Ringing ack arriving
726
+ // before callInvite returns) or after the Call has been finalized
727
+ // and removed from the pool. Drop silently — log.warn, not error.
728
+ log.warn('WechatyPuppetMixin', '__setupPuppetEvents() call event for unknown callId=%s, dropping', payload.callId);
729
+ return;
730
+ }
731
+ const actor = await this.Contact.find({ id: payload.contactId });
732
+ if (!actor) {
733
+ log.warn('WechatyPuppetMixin', '__setupPuppetEvents() actor contact not found for callId=%s contactId=%s, dropping', payload.callId, payload.contactId);
734
+ return;
735
+ }
736
+ call.__handleSignal(payload.signal, actor, payload.reason);
737
+ switch (payload.signal) {
738
+ case PUPPET.types.CallSignal.Ringing:
739
+ this.emit('call-ringing', call);
740
+ break;
741
+ case PUPPET.types.CallSignal.Accept:
742
+ this.emit('call-accept', call, actor);
743
+ break;
744
+ case PUPPET.types.CallSignal.Reject:
745
+ this.emit('call-reject', call, actor, payload.reason);
746
+ await this.__finalizeIfEnded(call);
747
+ break;
748
+ case PUPPET.types.CallSignal.Cancel:
749
+ this.emit('call-cancel', call, payload.reason);
750
+ // Cancel is a peer-side terminal action on the receiving side:
751
+ // the caller has withdrawn, so the local call necessarily ends.
752
+ await this.__finalizeIfEnded(call, /* force */ true);
753
+ break;
754
+ case PUPPET.types.CallSignal.Hangup:
755
+ this.emit('call-hangup', call, actor, payload.reason);
756
+ await this.__finalizeIfEnded(call);
757
+ break;
758
+ default:
759
+ break;
760
+ }
761
+ }
762
+ catch (e) {
763
+ this.emit('error', GError.from(e));
764
+ }
765
+ });
766
+ break;
679
767
  default:
680
768
  /**
681
769
  * Check: The eventName here should have the type `never`
@@ -685,6 +773,67 @@ const puppetMixin = (mixinBase) => {
685
773
  }
686
774
  log.verbose('WechatyPuppetMixin', '__setupPuppetEvents() ... done');
687
775
  }
776
+ /**
777
+ * Decide whether a call has reached its terminal state and, if so, drive
778
+ * the local lifecycle to ended by invoking {@link CallImpl.__markEnded},
779
+ * which routes through __finalize and is responsible for emitting both
780
+ * the object 'ended' and the bot 'call-ended' lifecycle events as well
781
+ * as evicting the call from the pool. This method does NOT emit
782
+ * 'call-ended' directly — that would risk a double-emit if a local
783
+ * control path (reject/cancel/hangup) finalizes the call before the
784
+ * puppet echo reaches here. The `__endedEmitted` sentinel inside
785
+ * __finalize makes the joint behavior idempotent.
786
+ *
787
+ * Strategy:
788
+ * - `force=true` short-circuits when the caller already knows the call is
789
+ * over (Cancel from the receiver's perspective).
790
+ * - Otherwise, refresh the payload via dirty + ready and check
791
+ * `endTime`, with a short retry budget so transient puppet hiccups do
792
+ * not strand a Call in the pool.
793
+ * - As a last-resort heuristic, an ended-leaning signal (Reject / Hangup)
794
+ * on a strict 1v1 call (participants.length === 2: the starter plus
795
+ * exactly one invitee) is treated as terminal even if sync never
796
+ * recovered: in 1v1 the protocol has no other peer to keep the
797
+ * session alive. Other roster shapes (length 0/1/3+) fall through
798
+ * and wait for the next dirty signal — length<=1 is a stranded-but-
799
+ * recoverable shape (empty roster from a sync hiccup, or a multi-
800
+ * party call whose other members already left).
801
+ */
802
+ async __finalizeIfEnded(call, force = false) {
803
+ let ended = force;
804
+ if (!ended) {
805
+ for (let attempt = 0; attempt < 3 && !ended; attempt++) {
806
+ try {
807
+ await call.sync();
808
+ ended = !!call.endTime();
809
+ }
810
+ catch (e) {
811
+ log.warn('WechatyPuppetMixin', '__finalizeIfEnded() sync attempt %d failed for callId=%s: %s', attempt + 1, call.id, e.message);
812
+ }
813
+ if (!ended && attempt < 2) {
814
+ await new Promise(resolve => setTimeout(resolve, 500));
815
+ }
816
+ }
817
+ }
818
+ if (!ended) {
819
+ try {
820
+ const participants = await call.participants();
821
+ if (participants.length === 2) {
822
+ log.warn('WechatyPuppetMixin', '__finalizeIfEnded() 1v1 fallback after sync failure for callId=%s (rosterLength=%d)', call.id, participants.length);
823
+ ended = true;
824
+ }
825
+ else {
826
+ log.error('WechatyPuppetMixin', '__finalizeIfEnded() sync failed, leaving callId=%s in pool for next dirty signal (rosterLength=%d)', call.id, participants.length);
827
+ }
828
+ }
829
+ catch (e) {
830
+ log.error('WechatyPuppetMixin', '__finalizeIfEnded() participants lookup failed for callId=%s: %s', call.id, e.message);
831
+ }
832
+ }
833
+ if (ended) {
834
+ call.__markEnded();
835
+ }
836
+ }
688
837
  }
689
838
  return PuppetMixin;
690
839
  };