pinokiod 7.5.26 → 7.5.28

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.
Files changed (38) hide show
  1. package/kernel/index.js +2 -5
  2. package/kernel/info.js +20 -0
  3. package/kernel/shell.js +2 -54
  4. package/kernel/sysinfo.js +2 -2
  5. package/package.json +1 -1
  6. package/server/public/common.js +42 -0
  7. package/server/public/style.css +142 -14
  8. package/server/public/task-launcher.css +11 -0
  9. package/server/views/app.ejs +173 -15
  10. package/server/views/app_search_test.ejs +3 -0
  11. package/server/views/connect/x.ejs +3 -0
  12. package/server/views/container.ejs +3 -0
  13. package/server/views/download.ejs +3 -0
  14. package/server/views/explore.ejs +3 -0
  15. package/server/views/form.ejs +3 -0
  16. package/server/views/frame.ejs +3 -0
  17. package/server/views/help.ejs +3 -0
  18. package/server/views/index.ejs +21 -66
  19. package/server/views/index2.ejs +3 -0
  20. package/server/views/init/index.ejs +3 -0
  21. package/server/views/mini.ejs +3 -0
  22. package/server/views/net.ejs +3 -0
  23. package/server/views/network.ejs +3 -0
  24. package/server/views/network2.ejs +3 -0
  25. package/server/views/old_network.ejs +3 -0
  26. package/server/views/partials/app_navheader.ejs +3 -0
  27. package/server/views/partials/home_action_modal.ejs +18 -31
  28. package/server/views/partials/main_sidebar.ejs +101 -4
  29. package/server/views/prototype/index.ejs +3 -0
  30. package/server/views/review.ejs +3 -0
  31. package/server/views/screenshots.ejs +3 -0
  32. package/server/views/settings.ejs +3 -0
  33. package/server/views/setup_home.ejs +3 -0
  34. package/server/views/terminal.ejs +3 -0
  35. package/server/views/terminals.ejs +3 -0
  36. package/test/info-ready.test.js +88 -0
  37. package/test/launch-settings-ui.test.js +3 -0
  38. package/test/shell-cleaned-log.test.js +66 -0
package/kernel/index.js CHANGED
@@ -697,7 +697,6 @@ class Kernel {
697
697
  async clearLog(group) {
698
698
  let relativePath = path.relative(this.homedir, group)
699
699
  for(let type of ["info", "buf", "cleaned"]) {
700
- //for(let type of ["info", "cleaned"]) {
701
700
  let logPath = path.resolve(this.homedir, "logs", "shell", type, relativePath)
702
701
  let logFolder = path.dirname(logPath)
703
702
  let filename = path.basename(logPath)
@@ -775,8 +774,7 @@ class Kernel {
775
774
  let relativePath = path.relative(this.homedir, group)
776
775
 
777
776
  if (!path.isAbsolute(relativePath)) {
778
- //for(let type of ["info", "buf", "cleaned"]) {
779
- for(let type of ["info", "cleaned"]) {
777
+ for(let type of ["cleaned"]) {
780
778
  let logPath = path.resolve(this.homedir, "logs", "shell", type, relativePath + "." + info.index + ".txt")
781
779
  let logFolder = path.dirname(logPath)
782
780
  await fs.promises.mkdir(logFolder, { recursive: true }).catch((e) => { })
@@ -784,8 +782,7 @@ class Kernel {
784
782
  }
785
783
  }
786
784
  } else {
787
- //for(let type of ["info", "buf", "cleaned"]) {
788
- for(let type of ["info", "cleaned"]) {
785
+ for(let type of ["cleaned"]) {
789
786
  let logPath = path.resolve(this.homedir, "logs", "shell", type, "index.txt")
790
787
  let logFolder = path.dirname(logPath)
791
788
  await fs.promises.mkdir(logFolder, { recursive: true }).catch((e) => { })
package/kernel/info.js CHANGED
@@ -2,6 +2,7 @@
2
2
  info.local(...args)
3
3
  info.running(...args)
4
4
  info.exists(...args)
5
+ info.ready(...args)
5
6
  info.path(...args)
6
7
  */
7
8
  const path = require('path')
@@ -57,6 +58,25 @@ class Info {
57
58
  let exists = fs.existsSync(resolved_path)
58
59
  return exists ? exists: false
59
60
  }
61
+ ready(...args) {
62
+ if (!this.kernel || typeof this.kernel.isScriptReady !== "function") {
63
+ return false
64
+ }
65
+ let cwd = path.dirname(this.caller())
66
+ let resolved_path = path.resolve(cwd, ...args)
67
+ if (this.kernel.isScriptReady(resolved_path)) {
68
+ return true
69
+ }
70
+ if (!this.kernel.script || typeof this.kernel.script.resolve !== "function") {
71
+ return false
72
+ }
73
+ try {
74
+ let script_path = this.kernel.script.resolve(...args)
75
+ return script_path ? this.kernel.isScriptReady(script_path) : false
76
+ } catch (e) {
77
+ return false
78
+ }
79
+ }
60
80
  local(...args) {
61
81
  let cwd = path.dirname(this.caller())
62
82
  let resolved_path = path.resolve(cwd, ...args)
package/kernel/shell.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const { Terminal } = require('@xterm/headless');
2
2
  const { SerializeAddon } = require("xterm-addon-serialize");
3
3
  const sanitize = require("sanitize-filename");
4
- const YAML = require('yaml')
5
4
  const kill = require('kill-sync')
6
5
  const fastq = require('fastq')
7
6
  const normalize = require('normalize-path');
@@ -1749,59 +1748,10 @@ class Shell {
1749
1748
  this.nudgeRestoreTimer = null
1750
1749
  }, 100)
1751
1750
  }
1752
- _log(buf, cleaned) {
1753
-
1754
-
1755
- /*
1756
-
1757
- /logs
1758
- /shell
1759
- /[...group]
1760
- ### info
1761
-
1762
- ### stdout
1763
-
1764
- */
1765
- let info = {
1766
- path: this.path,
1767
- cmd: this.cmd,
1768
- index: this.index,
1769
- group: this.group,
1770
- env: ShellRunTemplate.redactEnvArgs(this.env),
1771
- done: this.done,
1772
- ready: this.ready,
1773
- id: this.id,
1774
- ts: Date.now()
1775
- }
1776
-
1751
+ _log(_buf, cleaned) {
1777
1752
  let time = `${new Date().toLocaleString()} (${Date.now()})`
1778
1753
 
1779
- let infoYAML = YAML.stringify(info)
1780
1754
  let data = {}
1781
- data.info = `######################################################################
1782
- #
1783
- # group: ${this.group}
1784
- # id: ${this.id}
1785
- # index: ${this.index}
1786
- # cmd: ${this.cmd}
1787
- # timestamp: ${time}
1788
-
1789
- ${infoYAML}
1790
-
1791
- `
1792
-
1793
- data.buf = `######################################################################
1794
- #
1795
- # group: ${this.group}
1796
- # id: ${this.id}
1797
- # index: ${this.index}
1798
- # cmd: ${this.cmd}
1799
- # timestamp: ${time}
1800
- #
1801
-
1802
- ${buf}
1803
-
1804
- `
1805
1755
 
1806
1756
  data.cleaned = `######################################################################
1807
1757
  #
@@ -1815,9 +1765,7 @@ ${cleaned}
1815
1765
 
1816
1766
  `
1817
1767
 
1818
- this.kernel.log(data, this.group, info)
1819
-
1820
-
1768
+ this.kernel.log(data, this.group, { index: this.index })
1821
1769
  }
1822
1770
  stream(msg, callback) {
1823
1771
  if (msg === "\u0007") {
package/kernel/sysinfo.js CHANGED
@@ -12,8 +12,8 @@ class Sysinfo {
12
12
  // await this.refresh()
13
13
  }
14
14
  async static() {
15
- //await Promise.all([this.gpus(), this.system(), this.cpu(), this.os(), this.audio(), this.env()])
16
- await Promise.all([this.gpus(), this.system(), this.cpu(), this.os(), this.audio(), this.env(), this.memory()])
15
+ //await Promise.all([this.gpus(), this.system(), this.cpu(), this.os(), this.audio(), this.env(), this.memory()])
16
+ await Promise.all([this.gpus(), this.system(), this.cpu(), this.os(), this.audio(), this.memory()])
17
17
  // await this.gpus()
18
18
  // await this.system()
19
19
  // await this.cpu()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "7.5.26",
3
+ "version": "7.5.28",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2887,7 +2887,49 @@ function updateAllTooltips() {
2887
2887
  tippyInstances.forEach(updateTippyPlacement);
2888
2888
  }
2889
2889
 
2890
+ function ensureExploreNavButton() {
2891
+ const header = document.querySelector("header.navheader");
2892
+ if (!header) {
2893
+ return;
2894
+ }
2895
+
2896
+ let button = header.querySelector("[data-pinokio-explore-nav]");
2897
+ if (!button) {
2898
+ const headerRow = header.querySelector("h1") || header;
2899
+ const anchor =
2900
+ header.querySelector("#sidebar-toggle") ||
2901
+ header.querySelector(".main-sidebar-header-toggle") ||
2902
+ header.querySelector("#minimize-header");
2903
+
2904
+ if (!anchor || !headerRow.contains(anchor)) {
2905
+ return;
2906
+ }
2907
+
2908
+ button = document.createElement("a");
2909
+ button.innerHTML = '<div><i class="fa-solid fa-globe" aria-hidden="true"></i></div>';
2910
+ anchor.insertAdjacentElement("afterend", button);
2911
+ }
2912
+
2913
+ button.classList.add("btn2", "pinokio-explore-nav-button");
2914
+ button.href = "/home?mode=explore";
2915
+ button.setAttribute("data-pinokio-explore-nav", "true");
2916
+ button.setAttribute("data-tippy-content", "Explore");
2917
+ button.setAttribute("title", "Explore");
2918
+ button.setAttribute("aria-label", "Explore");
2919
+
2920
+ const params = new URLSearchParams(window.location.search || "");
2921
+ if (window.location.pathname === "/home" && params.get("mode") === "explore") {
2922
+ button.classList.add("selected");
2923
+ button.setAttribute("aria-current", "page");
2924
+ } else {
2925
+ button.classList.remove("selected");
2926
+ button.removeAttribute("aria-current");
2927
+ }
2928
+ }
2929
+
2890
2930
  document.addEventListener("DOMContentLoaded", () => {
2931
+ ensureExploreNavButton();
2932
+
2891
2933
  if (typeof initUrlDropdown === 'function' && !window.PinokioUrlDropdown) {
2892
2934
  try {
2893
2935
  initUrlDropdown();
@@ -451,6 +451,14 @@ body.dark .swal2-popup.pinokio-input-modal .swal2-html-container .pinokio-input-
451
451
  background: var(--pinokio-input-modal-surface-muted) !important;
452
452
  color: var(--pinokio-input-modal-text) !important;
453
453
  }
454
+ body.dark .swal2-popup.pinokio-input-modal .swal2-html-container select.pinokio-input-modal-control option {
455
+ background: #ffffff;
456
+ color: #111827;
457
+ }
458
+ body.dark select.pinokio-modal-input option {
459
+ background: #ffffff;
460
+ color: #111827;
461
+ }
454
462
 
455
463
  .swal2-popup.pinokio-input-modal .swal2-html-container .pinokio-input-modal-control::placeholder {
456
464
  color: var(--pinokio-input-modal-muted);
@@ -1289,6 +1297,34 @@ body.main-sidebar-page .navheader .sidebar-toggle {
1289
1297
  body.dark.main-sidebar-page .navheader .sidebar-toggle {
1290
1298
  color: rgba(248, 250, 252, 0.92);
1291
1299
  }
1300
+ header.navheader .pinokio-explore-nav-button {
1301
+ text-decoration: none;
1302
+ }
1303
+ body.main-sidebar-page .navheader .pinokio-explore-nav-button,
1304
+ body.app-page .navheader .pinokio-explore-nav-button {
1305
+ color: #0f172a;
1306
+ position: relative;
1307
+ width: 40px;
1308
+ height: 30px;
1309
+ padding: 0;
1310
+ border-radius: 9px;
1311
+ box-sizing: border-box;
1312
+ transition: background-color 140ms cubic-bezier(0.25, 1, 0.5, 1), box-shadow 140ms cubic-bezier(0.25, 1, 0.5, 1), color 140ms cubic-bezier(0.25, 1, 0.5, 1);
1313
+ }
1314
+ body.dark.main-sidebar-page .navheader .pinokio-explore-nav-button,
1315
+ body.dark.app-page .navheader .pinokio-explore-nav-button {
1316
+ color: rgba(248, 250, 252, 0.92);
1317
+ }
1318
+ body.main-sidebar-page .navheader .pinokio-explore-nav-button.selected,
1319
+ body.app-page .navheader .pinokio-explore-nav-button.selected {
1320
+ background: rgba(15, 23, 42, 0.08);
1321
+ box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
1322
+ }
1323
+ body.dark.main-sidebar-page .navheader .pinokio-explore-nav-button.selected,
1324
+ body.dark.app-page .navheader .pinokio-explore-nav-button.selected {
1325
+ background: rgba(255, 255, 255, 0.1);
1326
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
1327
+ }
1292
1328
  body.main-sidebar-page .navheader .sidebar-toggle[aria-expanded="true"] {
1293
1329
  background: rgba(15, 23, 42, 0.08);
1294
1330
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
@@ -1335,20 +1371,10 @@ body.main-sidebar-page .sidebar-toggle-content {
1335
1371
  box-shadow: 0 3.8px 0 currentColor, 0 7.6px 0 currentColor;
1336
1372
  transition: opacity 150ms cubic-bezier(0.25, 1, 0.5, 1), transform 150ms cubic-bezier(0.25, 1, 0.5, 1);
1337
1373
  }
1338
- body.main-sidebar-page .navheader .sidebar-toggle[aria-expanded="false"] .sidebar-toggle-panel {
1339
- background: transparent;
1340
- outline: 1.5px solid currentColor;
1341
- outline-offset: -1px;
1342
- opacity: 0.35;
1343
- transform: translateX(-1px) scaleX(0.8);
1344
- }
1345
- body.main-sidebar-page .navheader .sidebar-toggle[aria-expanded="false"] .sidebar-toggle-content {
1346
- opacity: 0.42;
1347
- transform: translateX(-2px);
1348
- }
1349
1374
  body.main-sidebar-page main {
1350
1375
  display: flex;
1351
1376
  align-items: stretch;
1377
+ position: relative;
1352
1378
  }
1353
1379
  body.main-sidebar-page main > :not(.main-sidebar) {
1354
1380
  flex: 1 1 auto;
@@ -1882,8 +1908,83 @@ body.dark .main-sidebar-peer-dialog-surface {
1882
1908
  padding-left: 0;
1883
1909
  }
1884
1910
 
1911
+ @media (min-width: 769px) and (hover: hover) and (pointer: fine) {
1912
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar {
1913
+ position: absolute;
1914
+ top: 0;
1915
+ bottom: 0;
1916
+ left: 0;
1917
+ z-index: 10000020;
1918
+ flex: none;
1919
+ width: 180px;
1920
+ min-width: 180px;
1921
+ max-width: 180px;
1922
+ padding: 8px 5px;
1923
+ border-right-width: 1px;
1924
+ border-right-color: var(--pinokio-sidebar-separator);
1925
+ background: var(--pinokio-sidebar-tabbar-bg);
1926
+ opacity: 0;
1927
+ pointer-events: none;
1928
+ overflow-x: hidden;
1929
+ overflow-y: auto;
1930
+ transform: translateX(-100%);
1931
+ }
1932
+
1933
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar-peek-trigger {
1934
+ display: block;
1935
+ position: absolute;
1936
+ top: 0;
1937
+ bottom: 0;
1938
+ left: 0;
1939
+ z-index: 10000021;
1940
+ width: 14px;
1941
+ padding: 0;
1942
+ border: 0;
1943
+ border-radius: 0;
1944
+ background: transparent;
1945
+ cursor: default;
1946
+ }
1947
+
1948
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar-peek-trigger::after {
1949
+ content: "";
1950
+ position: absolute;
1951
+ top: 50%;
1952
+ left: 4px;
1953
+ width: 3px;
1954
+ height: 36px;
1955
+ border-radius: 999px;
1956
+ background: var(--pinokio-sidebar-separator-hover);
1957
+ opacity: 0;
1958
+ transform: translateY(-50%);
1959
+ transition: opacity 140ms cubic-bezier(0.25, 1, 0.5, 1);
1960
+ }
1961
+
1962
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar-peek-trigger:hover::after,
1963
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar-peek-trigger:focus-visible::after,
1964
+ body.main-sidebar-page.main-sidebar-peeking .main-sidebar-peek-trigger::after {
1965
+ opacity: 1;
1966
+ }
1967
+
1968
+ body.main-sidebar-page.main-sidebar-peeking .main-sidebar-peek-trigger {
1969
+ z-index: 10000019;
1970
+ }
1971
+
1972
+ body.main-sidebar-page.main-sidebar-collapsed.main-sidebar-peeking .main-sidebar {
1973
+ box-shadow: 20px 0 42px rgba(15, 23, 42, 0.16);
1974
+ opacity: 1;
1975
+ pointer-events: auto;
1976
+ transform: translateX(0);
1977
+ }
1978
+
1979
+ body.dark.main-sidebar-page.main-sidebar-collapsed.main-sidebar-peeking .main-sidebar {
1980
+ box-shadow: 22px 0 46px rgba(0, 0, 0, 0.38);
1981
+ }
1982
+ }
1983
+
1885
1984
  @media (prefers-reduced-motion: reduce) {
1886
1985
  body.main-sidebar-page .navheader .sidebar-toggle,
1986
+ body.main-sidebar-page .navheader .pinokio-explore-nav-button,
1987
+ body.app-page .navheader .pinokio-explore-nav-button,
1887
1988
  body.main-sidebar-page .sidebar-toggle-panel,
1888
1989
  body.main-sidebar-page .sidebar-toggle-content,
1889
1990
  body.main-sidebar-page.main-sidebar-motion-ready .main-sidebar,
@@ -4299,6 +4400,7 @@ aside .qr {
4299
4400
  padding: 15px;
4300
4401
  }
4301
4402
 
4403
+ .main-sidebar-peek-trigger,
4302
4404
  .main-sidebar-mobile-toggle,
4303
4405
  .main-sidebar-mobile-backdrop {
4304
4406
  display: none;
@@ -4390,12 +4492,30 @@ aside .qr {
4390
4492
  box-shadow: 24px 0 52px rgba(0, 0, 0, 0.38);
4391
4493
  }
4392
4494
 
4393
- body.main-sidebar-page.main-sidebar-mobile-open .main-sidebar {
4495
+ body.main-sidebar-page.main-sidebar-mobile-open .main-sidebar {
4496
+ transform: translateX(0);
4497
+ }
4498
+
4499
+ body.main-sidebar-page.main-sidebar-collapsed .main-sidebar {
4500
+ flex: 0 0 auto;
4501
+ width: min(280px, calc(100vw - 40px));
4502
+ min-width: 0;
4503
+ max-width: 100%;
4504
+ padding: calc(12px + env(safe-area-inset-top)) 12px 18px;
4505
+ border-right-width: 1px;
4506
+ border-right-color: var(--pinokio-sidebar-separator);
4507
+ opacity: 1;
4508
+ pointer-events: none;
4509
+ transform: translateX(-100%);
4510
+ }
4511
+
4512
+ body.main-sidebar-page.main-sidebar-collapsed.main-sidebar-mobile-open .main-sidebar {
4513
+ pointer-events: auto;
4394
4514
  transform: translateX(0);
4395
4515
  }
4396
4516
 
4397
- body.main-sidebar-page .main-sidebar-nav,
4398
- body.main-sidebar-page .main-sidebar-section {
4517
+ body.main-sidebar-page .main-sidebar-nav,
4518
+ body.main-sidebar-page .main-sidebar-section {
4399
4519
  gap: 4px;
4400
4520
  }
4401
4521
 
@@ -5552,6 +5672,10 @@ body.dark .logs-session-picker select {
5552
5672
  background: rgba(255,255,255,0.07);
5553
5673
  color: rgba(248, 250, 252, 0.82);
5554
5674
  }
5675
+ body.dark .logs-session-picker select option {
5676
+ background: #ffffff;
5677
+ color: #111827;
5678
+ }
5555
5679
  .logs-review-file-list {
5556
5680
  display: flex;
5557
5681
  flex-direction: column;
@@ -5633,6 +5757,10 @@ body.dark .logs-section-mode {
5633
5757
  background: rgba(255,255,255,0.07);
5634
5758
  color: rgba(248, 250, 252, 0.82);
5635
5759
  }
5760
+ body.dark .logs-section-mode option {
5761
+ background: #ffffff;
5762
+ color: #111827;
5763
+ }
5636
5764
  .logs-review-file,
5637
5765
  .logs-review-empty {
5638
5766
  min-width: 0;
@@ -1344,6 +1344,17 @@ body.dark .task-badge-warning {
1344
1344
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--task-accent) 18%, transparent);
1345
1345
  }
1346
1346
 
1347
+ body.dark .task-select option {
1348
+ background: #ffffff;
1349
+ color: #111827;
1350
+ }
1351
+
1352
+ body.dark.settings-page .item select option,
1353
+ body.dark.settings-page .debug-shell-controls select option {
1354
+ background: #ffffff;
1355
+ color: #111827;
1356
+ }
1357
+
1347
1358
  .task-textarea {
1348
1359
  min-height: 160px;
1349
1360
  resize: vertical;