pinokiod 8.0.53 → 8.0.54

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.
package/kernel/index.js CHANGED
@@ -148,6 +148,32 @@ class Kernel {
148
148
  this.launchRequirements.hasRuntimeForLaunchPath(launchPath)
149
149
  )
150
150
  }
151
+ notifyVaultAppLifecycle(method, launchPath) {
152
+ const automaticScans = this.vault && this.vault.automaticScans
153
+ if (!automaticScans || typeof automaticScans[method] !== "function") {
154
+ return
155
+ }
156
+ try {
157
+ const pending = automaticScans[method](launchPath)
158
+ if (pending && typeof pending.catch === "function") {
159
+ pending.catch((error) => {
160
+ console.warn("[Vault Automatic Scan] " + JSON.stringify({
161
+ time: new Date().toISOString(),
162
+ event: "lifecycle-error",
163
+ method,
164
+ message: error && error.message ? error.message : String(error)
165
+ }))
166
+ })
167
+ }
168
+ } catch (error) {
169
+ console.warn("[Vault Automatic Scan] " + JSON.stringify({
170
+ time: new Date().toISOString(),
171
+ event: "lifecycle-error",
172
+ method,
173
+ message: error && error.message ? error.message : String(error)
174
+ }))
175
+ }
176
+ }
151
177
  markAppLaunchStarted(launchPath) {
152
178
  const status = this.readyState.markStarted(launchPath)
153
179
  const appId = this.readyState.getAppIdForLaunchPath(launchPath)
@@ -157,6 +183,8 @@ class Kernel {
157
183
  }
158
184
  this.launchRequirements.markStarted(launchPath)
159
185
  }
186
+ Kernel.prototype.notifyVaultAppLifecycle.call(
187
+ this, "handleStarted", launchPath)
160
188
  return status
161
189
  }
162
190
  markAppLaunchProgress(launchPath, current, total) {
@@ -182,6 +210,8 @@ class Kernel {
182
210
  }
183
211
  markAppLaunchStopped(launchPath, options = {}) {
184
212
  const status = this.readyState.markStopped(launchPath)
213
+ Kernel.prototype.notifyVaultAppLifecycle.call(
214
+ this, "handleStopped", launchPath)
185
215
  if (options && options.internal_completion) {
186
216
  return status
187
217
  }