pinokiod 8.0.51 → 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 +34 -13
- package/kernel/vault/automatic_scans.js +1028 -0
- package/kernel/vault/constants.js +6 -4
- package/kernel/vault/folder_finder.js +425 -0
- package/kernel/vault/index.js +3032 -1725
- package/kernel/vault/operation_errors.js +41 -0
- package/kernel/vault/registry.js +152 -500
- package/kernel/vault/registry_core.js +5407 -0
- package/kernel/vault/registry_worker.js +25 -0
- package/kernel/vault/scanner.js +158 -0
- package/kernel/vault/snapshot.js +11 -4
- package/kernel/vault/sweeper.js +478 -579
- package/kernel/vault/walker.js +34 -15
- package/package.json +2 -1
- package/server/index.js +119 -5
- package/server/public/layout.js +331 -2
- package/server/public/vault.css +1193 -224
- package/server/public/vault.js +2824 -636
- package/server/views/app.ejs +23 -1
- package/server/views/layout.ejs +269 -1
- package/server/views/partials/main_sidebar.ejs +1 -1
- package/server/views/partials/vault_workspace.ejs +62 -22
- package/server/views/vault_app.ejs +1 -1
- package/test/vault-automatic-scan-ui.test.js +270 -0
- package/test/vault-automatic-scans.test.js +1733 -0
- package/test/vault-engine.test.js +1748 -1498
- package/test/vault-sweep.test.js +1570 -1030
- package/test/vault-ui.test.js +2064 -2642
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
|
}
|
|
@@ -1217,21 +1247,12 @@ class Kernel {
|
|
|
1217
1247
|
await this.git.loadCheckpoints()
|
|
1218
1248
|
console.timeEnd("git.loadCheckpoints")
|
|
1219
1249
|
|
|
1220
|
-
// Shared model store:
|
|
1221
|
-
//
|
|
1250
|
+
// Shared model store: startup reads only the enable flag. Registry and
|
|
1251
|
+
// filesystem initialization are deferred until a Vault page or action
|
|
1252
|
+
// calls ensureInitialized().
|
|
1222
1253
|
this.vault = new Vault(this)
|
|
1223
1254
|
if (this.homedir) {
|
|
1224
|
-
this.vault.ready = this.vault.init({
|
|
1225
|
-
if (result && result.enabled && this.vault.initialized) {
|
|
1226
|
-
this.vault.verificationPending = true
|
|
1227
|
-
await this.vault.runExclusive(async () => {
|
|
1228
|
-
await this.vault.verify()
|
|
1229
|
-
await this.vault.registry.flush()
|
|
1230
|
-
})
|
|
1231
|
-
this.vault.verificationPending = false
|
|
1232
|
-
}
|
|
1233
|
-
return result
|
|
1234
|
-
}).catch((err) => {
|
|
1255
|
+
this.vault.ready = this.vault.init({ deferStorage: true }).catch((err) => {
|
|
1235
1256
|
// Keep an enabled Vault retryable after transient registry or
|
|
1236
1257
|
// filesystem errors. A genuinely disabled Vault already has
|
|
1237
1258
|
// enabled=false from its environment check.
|