pinokiod 8.0.65 → 8.0.67
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 +28 -5
- package/kernel/vault/automatic_scans.js +415 -214
- package/kernel/vault/index.js +39 -33
- package/kernel/vault/registry_core.js +79 -79
- package/package.json +1 -1
- package/server/index.js +31 -2
- package/server/public/app-vault-mode.js +201 -15
- package/server/public/layout.js +96 -467
- package/server/public/vault.css +39 -18
- package/server/public/vault.js +137 -104
- package/server/views/app.ejs +71 -4
- package/server/views/layout.ejs +4 -282
- package/test/vault-automatic-scan-ui.test.js +371 -596
- package/test/vault-automatic-scans.test.js +560 -180
- package/test/vault-engine.test.js +115 -22
- package/test/vault-sweep.test.js +108 -0
- package/test/vault-ui.test.js +365 -42
package/kernel/index.js
CHANGED
|
@@ -1062,6 +1062,19 @@ class Kernel {
|
|
|
1062
1062
|
kill() {
|
|
1063
1063
|
process.kill(process.pid, "SIGTERM")
|
|
1064
1064
|
}
|
|
1065
|
+
async disposeVaultAutomaticScans() {
|
|
1066
|
+
const vault = this.vault
|
|
1067
|
+
if (!vault || !vault.automaticScans) return false
|
|
1068
|
+
if (vault.ready) await Promise.resolve(vault.ready).catch(() => {})
|
|
1069
|
+
try {
|
|
1070
|
+
await vault.automaticScans.dispose()
|
|
1071
|
+
return true
|
|
1072
|
+
} catch (error) {
|
|
1073
|
+
console.warn("Vault automatic cleanup error:",
|
|
1074
|
+
error && error.message ? error.message : error)
|
|
1075
|
+
return false
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1065
1078
|
/// async fileserver() {
|
|
1066
1079
|
/// await this.exec({
|
|
1067
1080
|
/// message: `npx -y filexplorer --serveDirectory ${this.homedir}`
|
|
@@ -1079,6 +1092,8 @@ class Kernel {
|
|
|
1079
1092
|
})
|
|
1080
1093
|
|
|
1081
1094
|
let home = this.store.get("home") || process.env.PINOKIO_HOME
|
|
1095
|
+
await this.disposeVaultAutomaticScans()
|
|
1096
|
+
this.vault = null
|
|
1082
1097
|
this.homedir = home
|
|
1083
1098
|
|
|
1084
1099
|
// reset shells if they exist
|
|
@@ -1247,12 +1262,20 @@ class Kernel {
|
|
|
1247
1262
|
await this.git.loadCheckpoints()
|
|
1248
1263
|
console.timeEnd("git.loadCheckpoints")
|
|
1249
1264
|
|
|
1250
|
-
//
|
|
1251
|
-
//
|
|
1252
|
-
//
|
|
1253
|
-
|
|
1265
|
+
// Disk Saver startup reads the enable flag and, where supported, starts
|
|
1266
|
+
// its native API-directory watcher. Registry and scan initialization
|
|
1267
|
+
// remain deferred until a Disk Saver page or action needs them.
|
|
1268
|
+
const vault = new Vault(this)
|
|
1269
|
+
this.vault = vault
|
|
1254
1270
|
if (this.homedir) {
|
|
1255
|
-
|
|
1271
|
+
vault.ready = vault.init({ deferStorage: true }).then(
|
|
1272
|
+
async (result) => {
|
|
1273
|
+
if (result && result.enabled) {
|
|
1274
|
+
await vault.automaticScans.startWatcher()
|
|
1275
|
+
}
|
|
1276
|
+
return result
|
|
1277
|
+
}
|
|
1278
|
+
).catch((err) => {
|
|
1256
1279
|
// Keep an enabled Vault retryable after transient registry or
|
|
1257
1280
|
// filesystem errors. A genuinely disabled Vault already has
|
|
1258
1281
|
// enabled=false from its environment check.
|