pinokiod 8.0.39 → 8.0.41
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/api/hf/index.js +2 -2
- package/kernel/api/index.js +12 -3
- package/kernel/connect/index.js +2 -2
- package/kernel/connect/providers/huggingface/index.js +14 -5
- package/kernel/index.js +14 -2
- package/kernel/shell.js +3 -2
- package/kernel/shells.js +6 -0
- package/kernel/vault/constants.js +13 -0
- package/kernel/vault/hash_worker.js +9 -2
- package/kernel/vault/index.js +1856 -316
- package/kernel/vault/registry.js +526 -52
- package/kernel/vault/snapshot.js +29 -0
- package/kernel/vault/sweeper.js +480 -210
- package/kernel/vault/walker.js +142 -0
- package/package.json +1 -1
- package/server/index.js +79 -90
- package/server/lib/privacy_filter_cache.js +4 -1
- package/server/public/storage-size.js +12 -0
- package/server/public/style.css +13 -0
- package/server/public/tab-link-popover.js +3 -0
- package/server/public/vault-nav.js +96 -0
- package/server/public/vault.css +1079 -0
- package/server/public/vault.js +1835 -0
- package/server/views/app.ejs +93 -16
- package/server/views/connect/huggingface.ejs +7 -9
- package/server/views/partials/main_sidebar.ejs +6 -1
- package/server/views/partials/vault_workspace.ejs +55 -0
- package/server/views/vault.ejs +5 -1532
- package/server/views/vault_app.ejs +22 -0
- package/test/hf-api.test.js +4 -2
- package/test/huggingface-connect.test.js +7 -11
- package/test/huggingface-token-validity.test.js +135 -0
- package/test/plugin-action-functions.test.js +19 -0
- package/test/privacy-filter-cache.test.js +1 -0
- package/test/vault-engine.test.js +1276 -26
- package/test/vault-sweep.test.js +1043 -35
- package/test/vault-ui.test.js +2184 -65
package/server/views/app.ejs
CHANGED
|
@@ -2624,6 +2624,71 @@ body.dark .appcanvas > aside .menu-actions .header-item {
|
|
|
2624
2624
|
color: var(--pinokio-sidebar-tab-active-color) !important;
|
|
2625
2625
|
box-shadow: none;
|
|
2626
2626
|
}
|
|
2627
|
+
#save-space-tab .save-space-copy {
|
|
2628
|
+
display: flex;
|
|
2629
|
+
flex: 1 1 auto;
|
|
2630
|
+
min-width: 0;
|
|
2631
|
+
flex-direction: column;
|
|
2632
|
+
gap: 2px;
|
|
2633
|
+
}
|
|
2634
|
+
#save-space-tab .save-space-prompt {
|
|
2635
|
+
display: none;
|
|
2636
|
+
min-width: 0;
|
|
2637
|
+
color: var(--pinokio-sidebar-tab-muted);
|
|
2638
|
+
font-size: 10px;
|
|
2639
|
+
font-weight: 400;
|
|
2640
|
+
line-height: 1.25;
|
|
2641
|
+
overflow-wrap: break-word;
|
|
2642
|
+
white-space: normal;
|
|
2643
|
+
}
|
|
2644
|
+
#save-space-tab .save-space-status {
|
|
2645
|
+
min-width: 28px;
|
|
2646
|
+
height: 15px;
|
|
2647
|
+
margin-left: auto;
|
|
2648
|
+
padding: 0 5px;
|
|
2649
|
+
box-sizing: border-box;
|
|
2650
|
+
border-radius: 999px;
|
|
2651
|
+
display: inline-flex;
|
|
2652
|
+
flex: 0 0 auto;
|
|
2653
|
+
align-items: center;
|
|
2654
|
+
justify-content: center;
|
|
2655
|
+
background: rgba(15, 23, 42, 0.07);
|
|
2656
|
+
color: rgba(31, 41, 55, 0.62);
|
|
2657
|
+
font-size: 9px;
|
|
2658
|
+
font-weight: 700;
|
|
2659
|
+
line-height: 1;
|
|
2660
|
+
white-space: nowrap;
|
|
2661
|
+
}
|
|
2662
|
+
#save-space-tab .save-space-status[hidden] {
|
|
2663
|
+
display: none !important;
|
|
2664
|
+
}
|
|
2665
|
+
#save-space-tab .save-space-status[data-state="new"] {
|
|
2666
|
+
border: 1px solid rgba(71, 85, 105, 0.22);
|
|
2667
|
+
background: transparent;
|
|
2668
|
+
color: rgba(31, 41, 55, 0.72);
|
|
2669
|
+
}
|
|
2670
|
+
.appcanvas.vertical #save-space-tab {
|
|
2671
|
+
width: 100%;
|
|
2672
|
+
max-width: none;
|
|
2673
|
+
}
|
|
2674
|
+
.appcanvas.vertical #save-space-tab[data-vault-state="new"] {
|
|
2675
|
+
background: var(--pinokio-sidebar-tab-hover) !important;
|
|
2676
|
+
}
|
|
2677
|
+
.appcanvas.vertical #save-space-tab[data-vault-state="new"] .tab {
|
|
2678
|
+
align-items: flex-start;
|
|
2679
|
+
}
|
|
2680
|
+
.appcanvas.vertical #save-space-tab[data-vault-state="new"] .save-space-prompt:not([hidden]) {
|
|
2681
|
+
display: block;
|
|
2682
|
+
}
|
|
2683
|
+
body.dark #save-space-tab .save-space-status {
|
|
2684
|
+
background: rgba(255, 255, 255, 0.08);
|
|
2685
|
+
color: rgba(229, 231, 235, 0.7);
|
|
2686
|
+
}
|
|
2687
|
+
body.dark #save-space-tab .save-space-status[data-state="new"] {
|
|
2688
|
+
border-color: rgba(226, 232, 240, 0.22);
|
|
2689
|
+
background: transparent;
|
|
2690
|
+
color: rgba(248, 250, 252, 0.76);
|
|
2691
|
+
}
|
|
2627
2692
|
body.dark .appcanvas > aside .menu-actions .header-item:hover,
|
|
2628
2693
|
body.dark .appcanvas > aside .menu-actions .header-item:focus-visible {
|
|
2629
2694
|
background: var(--pinokio-sidebar-tab-hover) !important;
|
|
@@ -8143,6 +8208,7 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8143
8208
|
<script src="/sweetalert2.js"></script>
|
|
8144
8209
|
<script src="/nav.js"></script>
|
|
8145
8210
|
<script src="/common.js"></script>
|
|
8211
|
+
<script src="/storage-size.js"></script>
|
|
8146
8212
|
<script src="/opener.js"></script>
|
|
8147
8213
|
<script src="/report.js"></script>
|
|
8148
8214
|
<script src="/normalize.js"></script>
|
|
@@ -8162,6 +8228,9 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8162
8228
|
<script src="/tippy-bundle.umd.min.js"></script>
|
|
8163
8229
|
<script src="/tab-link-popover.js"></script>
|
|
8164
8230
|
<script src="/browser-popout-surface.js"></script>
|
|
8231
|
+
<% if (typeof vault_enabled !== 'undefined' && vault_enabled) { %>
|
|
8232
|
+
<script src="/vault-nav.js" defer></script>
|
|
8233
|
+
<% } %>
|
|
8165
8234
|
<script>
|
|
8166
8235
|
(function() {
|
|
8167
8236
|
try {
|
|
@@ -8459,6 +8528,18 @@ body.dark .pinokio-custom-terminal-header {
|
|
|
8459
8528
|
<div class='flexible'></div>
|
|
8460
8529
|
</div>
|
|
8461
8530
|
</button>
|
|
8531
|
+
<% if (typeof vault_enabled !== 'undefined' && vault_enabled) { %>
|
|
8532
|
+
<a id='save-space-tab' data-mode="refresh" target="app-vault" href="/vault/app/<%=encodeURIComponent(name)%>" class="btn header-item frame-link" data-index="vault" data-static="retain" data-tab-link-popover="false" data-app-vault-tab data-app-vault-name="<%=name%>">
|
|
8533
|
+
<div class='tab'>
|
|
8534
|
+
<i class="fa-solid fa-hard-drive menu-action-leading-icon"></i>
|
|
8535
|
+
<div class="save-space-copy">
|
|
8536
|
+
<div class='display'>Save space</div>
|
|
8537
|
+
<div class="save-space-prompt" data-app-vault-prompt hidden>Find duplicate files and use less disk</div>
|
|
8538
|
+
</div>
|
|
8539
|
+
<span class="save-space-status" data-app-vault-status aria-hidden="true" hidden></span>
|
|
8540
|
+
</div>
|
|
8541
|
+
</a>
|
|
8542
|
+
<% } %>
|
|
8462
8543
|
<% if (typeof autolaunch_app !== 'undefined' && autolaunch_app) { %>
|
|
8463
8544
|
<div class="app-autolaunch" data-app-autolaunch data-app-id="<%=name%>">
|
|
8464
8545
|
<button type="button" class="app-autolaunch-row" data-app-autolaunch-button data-enabled="<%= autolaunch_app.autolaunch_enabled ? 'true' : 'false' %>" aria-haspopup="dialog" aria-expanded="false">
|
|
@@ -12570,19 +12651,7 @@ const rerenderMenuSection = (container, html) => {
|
|
|
12570
12651
|
return res.json()
|
|
12571
12652
|
}).then((res) => {
|
|
12572
12653
|
if (res.du > 0) {
|
|
12573
|
-
|
|
12574
|
-
//let k = 1024
|
|
12575
|
-
let k = 1000
|
|
12576
|
-
if (res.du > k * k * k) {
|
|
12577
|
-
// GB
|
|
12578
|
-
val = `${Math.floor(res.du/k/k/k * 100) / 100} GB`
|
|
12579
|
-
} else if (res.du > k * k) {
|
|
12580
|
-
// MB
|
|
12581
|
-
val = `${Math.floor(res.du/k/k * 100) / 100} MB`
|
|
12582
|
-
} else {
|
|
12583
|
-
// KB
|
|
12584
|
-
val = `${Math.floor(res.du/k * 100) / 100} KB`
|
|
12585
|
-
}
|
|
12654
|
+
const val = window.PinokioFormatStorageSize(res.du)
|
|
12586
12655
|
els.forEach((el) => {
|
|
12587
12656
|
const metricLabel = el.getAttribute("data-metric-label")
|
|
12588
12657
|
el.innerHTML = `<i class="fa-solid fa-database"></i> ${metricLabel ? `${metricLabel} ` : ""}${val}`
|
|
@@ -16320,10 +16389,18 @@ const rerenderMenuSection = (container, html) => {
|
|
|
16320
16389
|
? (selected_tab.getAttribute("target") || "")
|
|
16321
16390
|
: ""
|
|
16322
16391
|
if (!selected_tab || !targetsMatch(selectedTarget, frameName)) {
|
|
16323
|
-
|
|
16392
|
+
document.querySelectorAll(".frame-link").forEach((link) => {
|
|
16393
|
+
link.classList.remove("selected")
|
|
16394
|
+
})
|
|
16395
|
+
match.classList.add("selected")
|
|
16396
|
+
syncActiveNestedPath({ selectedLink: match })
|
|
16397
|
+
if (typeof syncLogsSelectedState === "function") {
|
|
16398
|
+
syncLogsSelectedState(match)
|
|
16399
|
+
}
|
|
16400
|
+
if (shouldPersistFrameLink(match)) {
|
|
16401
|
+
persistFrameLinkSelection(match)
|
|
16402
|
+
}
|
|
16324
16403
|
}
|
|
16325
|
-
} else if (selected_tab) {
|
|
16326
|
-
selected_tab.click()
|
|
16327
16404
|
}
|
|
16328
16405
|
} else if (selected_tab) {
|
|
16329
16406
|
selected_tab.click()
|
|
@@ -168,9 +168,9 @@
|
|
|
168
168
|
<script>
|
|
169
169
|
const LOGIN_URL = "/connect/huggingface/login"
|
|
170
170
|
const LOGOUT_URL = "/connect/huggingface/logout"
|
|
171
|
-
const
|
|
171
|
+
const STATUS_URL = "/connect/status/huggingface"
|
|
172
172
|
const PROFILE_URL = "/connect/huggingface/profile"
|
|
173
|
-
const POLL_INTERVAL =
|
|
173
|
+
const POLL_INTERVAL = 5000
|
|
174
174
|
const POLL_TIMEOUT = 120000
|
|
175
175
|
|
|
176
176
|
const badgeElement = document.getElementById("hf-badge")
|
|
@@ -261,9 +261,9 @@
|
|
|
261
261
|
return res.json()
|
|
262
262
|
}
|
|
263
263
|
|
|
264
|
-
async function
|
|
265
|
-
const json = await
|
|
266
|
-
return json && json.
|
|
264
|
+
async function isConnected() {
|
|
265
|
+
const json = await fetch(STATUS_URL, { cache: "no-store" }).then((res) => res.json())
|
|
266
|
+
return Boolean(json && json.connected)
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
async function showConnected() {
|
|
@@ -326,8 +326,7 @@
|
|
|
326
326
|
}
|
|
327
327
|
|
|
328
328
|
async function pollLoginStatus() {
|
|
329
|
-
|
|
330
|
-
if (token) {
|
|
329
|
+
if (await isConnected()) {
|
|
331
330
|
await showConnected()
|
|
332
331
|
}
|
|
333
332
|
}
|
|
@@ -415,8 +414,7 @@
|
|
|
415
414
|
|
|
416
415
|
window.addEventListener("load", async () => {
|
|
417
416
|
try {
|
|
418
|
-
|
|
419
|
-
if (token) {
|
|
417
|
+
if (await isConnected()) {
|
|
420
418
|
await showConnected()
|
|
421
419
|
return
|
|
422
420
|
}
|
|
@@ -25,8 +25,10 @@
|
|
|
25
25
|
|
|
26
26
|
<div class='main-sidebar-section' aria-label="Manage">
|
|
27
27
|
<div class="main-sidebar-section-title">Manage</div>
|
|
28
|
+
<% if (typeof vaultEnabled === "undefined" || vaultEnabled) { %>
|
|
29
|
+
<a class="tab <%= sidebarSelected === 'vault' ? 'selected' : '' %>" href="/vault" data-main-sidebar-vault-tab><i class="fa-solid fa-hard-drive"></i><div class='caption'>Save space</div><span class="main-sidebar-status-badge" data-main-sidebar-vault-status aria-hidden="true" hidden></span></a>
|
|
30
|
+
<% } %>
|
|
28
31
|
<a class="tab <%= sidebarSelected === 'checkpoints' ? 'selected' : '' %>" href="/checkpoints"><i class="fa-solid fa-clock-rotate-left"></i><div class='caption'>Checkpoints</div></a>
|
|
29
|
-
<a class="tab <%= sidebarSelected === 'vault' ? 'selected' : '' %>" href="/vault"><i class="fa-solid fa-hard-drive"></i><div class='caption'>Vault</div></a>
|
|
30
32
|
<a class="tab <%= sidebarSelected === 'tools' ? 'selected' : '' %>" href="/tools"><i class="fa-solid fa-toolbox"></i><div class='caption'>Tools</div></a>
|
|
31
33
|
<a class="tab <%= sidebarSelected === 'plugins' ? 'selected' : '' %>" href="/plugins"><i class="fa-solid fa-plug-circle-bolt"></i><div class='caption'>Plugins</div></a>
|
|
32
34
|
<a class="tab <%= sidebarSelected === 'tasks' ? 'selected' : '' %>" href="/tasks"><i class="fa-solid fa-list-check"></i><div class='caption'>Tasks</div></a>
|
|
@@ -49,6 +51,9 @@
|
|
|
49
51
|
</div>
|
|
50
52
|
</nav>
|
|
51
53
|
</aside>
|
|
54
|
+
<% if (typeof vaultEnabled === "undefined" || vaultEnabled) { %>
|
|
55
|
+
<script src="/vault-nav.js"></script>
|
|
56
|
+
<% } %>
|
|
52
57
|
<script>
|
|
53
58
|
(() => {
|
|
54
59
|
const body = document.body;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<section class='task-shell vault-shell'>
|
|
2
|
+
<div class='task-shell-body'>
|
|
3
|
+
<div class='vault-body'>
|
|
4
|
+
<section class='vault-overview'>
|
|
5
|
+
<div class='vault-metrics' id='vault-metrics'></div>
|
|
6
|
+
<div class='vault-overview-actions'>
|
|
7
|
+
<label class='vault-candidate-size' for='vault-candidate-size'>
|
|
8
|
+
<span id='vault-candidate-size-label'></span>
|
|
9
|
+
<select id='vault-candidate-size'></select>
|
|
10
|
+
</label>
|
|
11
|
+
<button class='vault-button primary' id='btn-scan' type='button'></button>
|
|
12
|
+
<% if (!appMode) { %>
|
|
13
|
+
<details class='vault-advanced' id='vault-advanced'>
|
|
14
|
+
<summary class='vault-icon-button' id='btn-vault-options'><i class='fa-solid fa-ellipsis'></i></summary>
|
|
15
|
+
<div class='vault-advanced-menu'>
|
|
16
|
+
<div class='vault-storage-details' id='vault-storage-details'></div>
|
|
17
|
+
<div class='vault-advanced-divider'></div>
|
|
18
|
+
<div class='vault-advanced-title' id='vault-repair-title'></div>
|
|
19
|
+
<p class='vault-advanced-copy' id='vault-repair-description'></p>
|
|
20
|
+
<button class='vault-button' id='btn-repair' type='button'></button>
|
|
21
|
+
</div>
|
|
22
|
+
</details>
|
|
23
|
+
<% } %>
|
|
24
|
+
</div>
|
|
25
|
+
</section>
|
|
26
|
+
<div class='vault-scan-state' id='vault-scan-state' aria-live='polite'></div>
|
|
27
|
+
<div class='vault-result' id='vault-result' role='status' aria-live='polite'></div>
|
|
28
|
+
<div class='vault-feedback' id='vault-feedback' role='status' aria-live='polite'></div>
|
|
29
|
+
<div class='vault-cloud-warning' id='vault-cloud-warning' role='status'></div>
|
|
30
|
+
<section class='vault-explorer' id='vault-explorer'>
|
|
31
|
+
<aside class='vault-rail'>
|
|
32
|
+
<div class='vault-rail-section'>
|
|
33
|
+
<div class='vault-rail-label' id='views-label'></div>
|
|
34
|
+
<div class='vault-nav-list' id='vault-views'></div>
|
|
35
|
+
</div>
|
|
36
|
+
<div class='vault-rail-section'>
|
|
37
|
+
<div class='vault-rail-heading'>
|
|
38
|
+
<div class='vault-rail-label' id='locations-label'></div>
|
|
39
|
+
<% if (!appMode) { %>
|
|
40
|
+
<button class='vault-rail-add' id='btn-add-source' type='button'><i class='fa-solid fa-plus'></i></button>
|
|
41
|
+
<% } %>
|
|
42
|
+
</div>
|
|
43
|
+
<div id='vault-locations'></div>
|
|
44
|
+
</div>
|
|
45
|
+
<div class='vault-rail-footer' id='vault-rail-footer'></div>
|
|
46
|
+
</aside>
|
|
47
|
+
<section class='vault-pane' id='vault-pane'>
|
|
48
|
+
<div class='vault-toolbar' id='vault-toolbar'></div>
|
|
49
|
+
<div class='vault-table-wrap' id='vault-table-wrap'></div>
|
|
50
|
+
<footer class='vault-pane-footer' id='vault-pane-footer'></footer>
|
|
51
|
+
</section>
|
|
52
|
+
</section>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</section>
|