@learnpack/learnpack 2.1.52 → 2.1.54

Sign up to get free protection for your applications and to get access to all the features.
@@ -213,6 +213,7 @@ actions = [actions]
213
213
  },
214
214
  success: function (type: TSuccessType, stdout: string) {
215
215
  const types = ["compiler", "testing"]
216
+
216
217
  if (!types.includes(type))
217
218
  this.fatal(`Invalid socket success type "${type}" on socket`)
218
219
  else if (stdout === "")
@@ -235,6 +236,14 @@ this.log((type + "-success") as TSuccessType, [stdout])
235
236
  complete: function () {
236
237
  console.log("complete")
237
238
  },
239
+ dialog: function (message: string, format = "md") {
240
+ if (!this.socket) {
241
+ this.fatal("Socket is not initialized")
242
+ return
243
+ }
244
+
245
+ this.emit("dialog", "talk", [], undefined, undefined, { message, format })
246
+ },
238
247
 
239
248
  fatal: function (msg: string) {
240
249
  this.log("internal-error", [msg])