@learnpack/learnpack 2.1.53 → 2.1.56

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 === "")
@@ -223,7 +224,10 @@ actions = [actions]
223
224
  this.log((type + "-success") as TSuccessType, [stdout])
224
225
  },
225
226
  error: function (type: TStatus, stdout: string) {
226
- queue.dispatcher().enqueue(queue.events.OPEN_TERMINAL, "")
227
+ if (!this.config?.editor.hideTerminal) {
228
+ queue.dispatcher().enqueue(queue.events.OPEN_TERMINAL, "")
229
+ }
230
+
227
231
  this.log(type, [stdout])
228
232
 
229
233
  if (this.isTestingEnvironment) {
@@ -235,6 +239,14 @@ this.log((type + "-success") as TSuccessType, [stdout])
235
239
  complete: function () {
236
240
  console.log("complete")
237
241
  },
242
+ dialog: function (message: string, format = "md") {
243
+ if (!this.socket) {
244
+ this.fatal("Socket is not initialized")
245
+ return
246
+ }
247
+
248
+ this.emit("dialog", "talk", [], undefined, undefined, { message, format })
249
+ },
238
250
 
239
251
  fatal: function (msg: string) {
240
252
  this.log("internal-error", [msg])