pinokiod 6.0.108 → 6.0.110

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.
@@ -2,16 +2,16 @@ const fs = require('fs')
2
2
  const fetch = require('cross-fetch')
3
3
  const { rimraf } = require('rimraf')
4
4
  const decompress = require('decompress');
5
+ const NODE_VERSION = "22.21.1"
6
+
5
7
  class Node {
6
8
  cmd() {
7
- //return "nodejs=22.21.1 pnpm"
8
- return "nodejs=25.7.0 pnpm"
9
+ return `nodejs=${NODE_VERSION} pnpm`
9
10
  }
10
11
  async install(req, ondata) {
11
12
  await this.kernel.bin.exec({
12
13
  message: [
13
14
  "conda clean -y --all",
14
- //"conda install -y nodejs=20.17.0 pnpm -c conda-forge"
15
15
  `conda install -y -c conda-forge ${this.cmd()}`
16
16
  ]
17
17
  }, ondata)
@@ -19,8 +19,7 @@ class Node {
19
19
  async installed() {
20
20
  if (this.kernel.bin.installed.conda && this.kernel.bin.installed.conda_versions) {
21
21
  let version = this.kernel.bin.installed.conda_versions.nodejs
22
- //if (version !== "22.21.1") {
23
- if (version !== "25.7.0") {
22
+ if (version !== NODE_VERSION) {
24
23
  return false
25
24
  }
26
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "6.0.108",
3
+ "version": "6.0.110",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -659,7 +659,7 @@ class Server {
659
659
  let view_url = "/v/" + x.name
660
660
  let dev_url = browser_url + "/dev"
661
661
  let review_url = browser_url + "/review"
662
- let files_url = "/asset/api/" + x.name
662
+ let files_url = browser_url + "/files"
663
663
 
664
664
  let dns = this.kernel.pinokio_configs[x.name].dns
665
665
  let routes = dns["@"]
@@ -42,6 +42,9 @@ document.addEventListener("click", async (e) => {
42
42
  if (el) {
43
43
  e.preventDefault()
44
44
  e.stopPropagation()
45
+ if (typeof window.PinokioHomeCloseContextMenu === "function") {
46
+ window.PinokioHomeCloseContextMenu(el)
47
+ }
45
48
  let filepath = el.getAttribute("data-filepath")
46
49
  let command = el.getAttribute("data-command")
47
50
  await fetch("/openfs", {
@@ -168,6 +168,8 @@ body.dark .context-menu-wrapper {
168
168
  background: whitesmoke !important;
169
169
  border-radius: 10px;
170
170
  overflow: hidden;
171
+ min-width: 220px;
172
+ padding: 6px 0;
171
173
  }
172
174
  .menu-btns {
173
175
  position: relative;
@@ -193,12 +195,25 @@ body.dark .context-menu-wrapper {
193
195
  background: none !important;
194
196
  border: none !important;
195
197
  display: block;
196
- width: 80px;
197
- padding: 6px 10px !important;
198
+ width: 100%;
199
+ padding: 7px 14px !important;
198
200
  text-align: left;
199
201
  color: black;
200
202
  margin: 0 !important;
201
203
  }
204
+ .context-menu-section-title {
205
+ padding: 8px 14px 6px;
206
+ font-size: 11px;
207
+ font-weight: bold;
208
+ letter-spacing: 0.08em;
209
+ text-transform: uppercase;
210
+ color: rgba(0,0,0,0.45);
211
+ }
212
+ .context-menu-divider {
213
+ height: 1px;
214
+ margin: 6px 0;
215
+ background: rgba(0,0,0,0.08);
216
+ }
202
217
  body.dark .btn {
203
218
  background: rgba(255,255,255,0.05) !important;
204
219
  }
@@ -215,6 +230,12 @@ body.dark .context-menu .btn {
215
230
  color: white;
216
231
  background: none !important;
217
232
  }
233
+ body.dark .context-menu-section-title {
234
+ color: rgba(255,255,255,0.55);
235
+ }
236
+ body.dark .context-menu-divider {
237
+ background: rgba(255,255,255,0.08);
238
+ }
218
239
  body.dark .open-menu, body.dark .browse, body.dark .toggle-star {
219
240
  border: none !important;
220
241
  /*
@@ -242,6 +263,49 @@ body.dark .open-menu, body.dark .browse, body.dark .toggle-star {
242
263
  body.dark .toggle-star.is-starred i {
243
264
  color: #ffcc66;
244
265
  }
266
+ .noty_bar.home-star-toast {
267
+ max-width: 360px !important;
268
+ background: linear-gradient(180deg, rgba(24, 28, 39, 0.98), rgba(14, 17, 26, 0.98)) !important;
269
+ color: #f8f4ea !important;
270
+ border: 1px solid rgba(255, 214, 102, 0.22) !important;
271
+ border-radius: 14px !important;
272
+ box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28) !important;
273
+ }
274
+ .noty_bar.home-star-toast .noty_body {
275
+ padding: 12px 14px !important;
276
+ }
277
+ .home-star-toast__row {
278
+ display: flex;
279
+ align-items: flex-start;
280
+ gap: 10px;
281
+ }
282
+ .home-star-toast__icon {
283
+ width: 28px;
284
+ height: 28px;
285
+ border-radius: 999px;
286
+ display: inline-flex;
287
+ align-items: center;
288
+ justify-content: center;
289
+ flex: 0 0 auto;
290
+ background: rgba(255, 214, 102, 0.14);
291
+ color: #ffd666;
292
+ box-shadow: inset 0 0 0 1px rgba(255, 214, 102, 0.18);
293
+ }
294
+ .home-star-toast__content {
295
+ min-width: 0;
296
+ }
297
+ .home-star-toast__title {
298
+ font-size: 12px;
299
+ font-weight: 700;
300
+ letter-spacing: 0.01em;
301
+ color: #fff7d6;
302
+ }
303
+ .home-star-toast__text {
304
+ margin-top: 3px;
305
+ font-size: 12px;
306
+ line-height: 1.45;
307
+ color: rgba(248, 244, 234, 0.78);
308
+ }
245
309
  .open-menu.selected {
246
310
  border: none !important;
247
311
  /*
@@ -1032,20 +1096,12 @@ body.dark aside .current.selected {
1032
1096
  <i class="fa-<%=item.starred ? "solid" : "regular"%> fa-star"></i>
1033
1097
  <span><%=item.starred ? "Starred" : "Star"%></span>
1034
1098
  </button>
1035
- <button class='btn browse' data-src="<%=item.dev_url%>">
1036
- <i class="fa-solid fa-code"></i> Dev
1037
- </button>
1038
- <button class='btn browse' data-src="<%=item.view_url%>">
1039
- <i class="fa-regular fa-eye"></i> View
1040
- </button>
1041
1099
  <button class='btn open-menu' type='button' popovertarget="context-menu-running-<%=index%>" popovertargetaction="toggle" aria-haspopup="menu">
1042
1100
  <i class="fa-solid fa-bars"></i><span> Menu</span>
1043
1101
  </button>
1044
1102
  <div id='context-menu-running-<%=index%>' class='context-menu' popover>
1045
1103
  <div class='context-menu-wrapper'>
1046
- <button class='btn' data-filepath="<%=item.filepath%>">
1047
- <i class="fa-solid fa-folder-open"></i> Open</button>
1048
- </button>
1104
+ <div class='context-menu-section-title'>File</div>
1049
1105
  <button class='btn copy-menu'>
1050
1106
  <i class='fa-solid fa-copy'></i> Copy
1051
1107
  </button>
@@ -1058,6 +1114,20 @@ body.dark aside .current.selected {
1058
1114
  <button class='btn del' data-src="<%=item.url%>" data-disable="To delete the folder, the app should not be running.">
1059
1115
  <i class="fa-solid fa-trash-can"></i> Delete
1060
1116
  </button>
1117
+ <div class='context-menu-divider'></div>
1118
+ <div class='context-menu-section-title'>Open</div>
1119
+ <button class='btn browse' data-src="<%=item.view_url%>">
1120
+ <i class="fa-regular fa-eye"></i> Open without launching
1121
+ </button>
1122
+ <button class='btn browse' data-src="<%=item.dev_url%>">
1123
+ <i class="fa-solid fa-code"></i> Dev mode
1124
+ </button>
1125
+ <button class='btn browse' data-src="<%=item.files_url%>">
1126
+ <i class="fa-solid fa-file-lines"></i> Files mode
1127
+ </button>
1128
+ <button class='btn' data-filepath="<%=item.filepath%>">
1129
+ <i class="fa-solid fa-folder-open"></i> Open in file explorer
1130
+ </button>
1061
1131
  </div>
1062
1132
  </div>
1063
1133
  <% if (item.running_scripts) { %>
@@ -1124,20 +1194,12 @@ body.dark aside .current.selected {
1124
1194
  <i class="fa-<%=item.starred ? "solid" : "regular"%> fa-star"></i>
1125
1195
  <span><%=item.starred ? "Starred" : "Star"%></span>
1126
1196
  </button>
1127
- <button class='btn browse' data-src="<%=item.dev_url%>">
1128
- <i class="fa-solid fa-code"></i> Dev
1129
- </button>
1130
- <button class='btn browse' data-src="<%=item.view_url%>">
1131
- <i class="fa-regular fa-eye"></i> View
1132
- </button>
1133
1197
  <button class='btn open-menu' type='button' popovertarget="context-menu-not-running-<%=index%>" popovertargetaction="toggle" aria-haspopup="menu">
1134
1198
  <i class="fa-solid fa-bars"></i><span> Menu</span>
1135
1199
  </button>
1136
1200
  <div id='context-menu-not-running-<%=index%>' class='context-menu' popover>
1137
1201
  <div class='context-menu-wrapper'>
1138
- <button class='btn' data-filepath="<%=item.filepath%>">
1139
- <i class="fa-solid fa-folder-open"></i> Open</button>
1140
- </button>
1202
+ <div class='context-menu-section-title'>File</div>
1141
1203
  <button class='btn copy-menu'>
1142
1204
  <i class='fa-solid fa-copy'></i> Copy
1143
1205
  </button>
@@ -1150,6 +1212,20 @@ body.dark aside .current.selected {
1150
1212
  <button class='btn del' data-src="<%=item.url%>">
1151
1213
  <i class="fa-solid fa-trash-can"></i> Delete
1152
1214
  </button>
1215
+ <div class='context-menu-divider'></div>
1216
+ <div class='context-menu-section-title'>Open</div>
1217
+ <button class='btn browse' data-src="<%=item.view_url%>">
1218
+ <i class="fa-regular fa-eye"></i> Open without launching
1219
+ </button>
1220
+ <button class='btn browse' data-src="<%=item.dev_url%>">
1221
+ <i class="fa-solid fa-code"></i> Dev mode
1222
+ </button>
1223
+ <button class='btn browse' data-src="<%=item.files_url%>">
1224
+ <i class="fa-solid fa-file-lines"></i> Files mode
1225
+ </button>
1226
+ <button class='btn' data-filepath="<%=item.filepath%>">
1227
+ <i class="fa-solid fa-folder-open"></i> Open in file explorer
1228
+ </button>
1153
1229
  </div>
1154
1230
  </div>
1155
1231
  </div>
@@ -1773,6 +1849,24 @@ const getMenuDimensions = (menu) => {
1773
1849
  height: height || 0
1774
1850
  }
1775
1851
  }
1852
+ const closeContextMenuForNode = (node) => {
1853
+ const contextMenu = node && typeof node.closest === 'function'
1854
+ ? node.closest('.context-menu')
1855
+ : null
1856
+ if (!contextMenu) {
1857
+ return
1858
+ }
1859
+ const hasNativePopover = supportsNativePopovers && typeof contextMenu.hidePopover === 'function'
1860
+ if (hasNativePopover) {
1861
+ if (contextMenu.matches(':popover-open')) {
1862
+ contextMenu.hidePopover()
1863
+ }
1864
+ } else {
1865
+ contextMenu.style.display = 'none'
1866
+ contextMenu.dataset.open = 'false'
1867
+ }
1868
+ }
1869
+ window.PinokioHomeCloseContextMenu = closeContextMenuForNode
1776
1870
  const parseLineStarSortMeta = (line) => {
1777
1871
  if (!line) {
1778
1872
  return {
@@ -1872,6 +1966,34 @@ if (homeSortSelect) {
1872
1966
  })
1873
1967
  }
1874
1968
  }
1969
+ let homeStarToast = null
1970
+ const showHomeStarToast = () => {
1971
+ if (typeof n === "undefined" || !n || typeof n.Noty !== "function") {
1972
+ return
1973
+ }
1974
+ if (homeStarToast && typeof homeStarToast.close === "function") {
1975
+ homeStarToast.close()
1976
+ }
1977
+ homeStarToast = n.Noty({
1978
+ type: "notification",
1979
+ className: "home-star-toast",
1980
+ timeout: 5200,
1981
+ progressBar: false,
1982
+ closeWith: ["click"],
1983
+ silent: true,
1984
+ text: `
1985
+ <div class="home-star-toast__row">
1986
+ <div class="home-star-toast__icon">
1987
+ <i class="fa-solid fa-star"></i>
1988
+ </div>
1989
+ <div class="home-star-toast__content">
1990
+ <div class="home-star-toast__title">Starred apps get priority</div>
1991
+ <div class="home-star-toast__text">AI agents rank starred apps higher when searching for tools to use.</div>
1992
+ </div>
1993
+ </div>
1994
+ `
1995
+ })
1996
+ }
1875
1997
  document.addEventListener("click", async (e) => {
1876
1998
  if (e.target.classList.contains("toggle-star")) {
1877
1999
  target = e.target
@@ -1924,6 +2046,9 @@ document.addEventListener("click", async (e) => {
1924
2046
  line.setAttribute("data-last-launch-at", payload.preference.last_launch_at || "")
1925
2047
  }
1926
2048
  reorderHomeSectionsByPreference()
2049
+ if (payload.preference.starred) {
2050
+ showHomeStarToast()
2051
+ }
1927
2052
  } catch (error) {
1928
2053
  alert(error && error.message ? error.message : "Failed to update app star")
1929
2054
  } finally {
@@ -2075,6 +2200,7 @@ document.addEventListener("click", async (e) => {
2075
2200
  if (target) {
2076
2201
  e.preventDefault()
2077
2202
  e.stopPropagation()
2203
+ closeContextMenuForNode(target)
2078
2204
 
2079
2205
  let disable_message = target.getAttribute('data-disable')
2080
2206
  if (disable_message && disable_message.length > 0) {
@@ -2111,6 +2237,7 @@ document.addEventListener("click", async (e) => {
2111
2237
  if (target) {
2112
2238
  e.preventDefault()
2113
2239
  e.stopPropagation()
2240
+ closeContextMenuForNode(target)
2114
2241
  let line = target.closest(".line")
2115
2242
  let title = line.getAttribute("data-title")
2116
2243
  let icon = line.getAttribute("data-icon")
@@ -2140,6 +2267,7 @@ document.addEventListener("click", async (e) => {
2140
2267
  if (target) {
2141
2268
  e.preventDefault()
2142
2269
  e.stopPropagation()
2270
+ closeContextMenuForNode(target)
2143
2271
  let line = target.closest(".line")
2144
2272
  let title = line.getAttribute("data-title")
2145
2273
  let icon = line.getAttribute("data-icon")
@@ -2171,6 +2299,7 @@ document.addEventListener("click", async (e) => {
2171
2299
  if (target) {
2172
2300
  e.preventDefault()
2173
2301
  e.stopPropagation()
2302
+ closeContextMenuForNode(target)
2174
2303
  let src = target.getAttribute("data-src")
2175
2304
  if (window.PinokioHomeGuardNavigate) {
2176
2305
  window.PinokioHomeGuardNavigate(src)
@@ -2190,6 +2319,7 @@ document.addEventListener("click", async (e) => {
2190
2319
  if (target) {
2191
2320
  e.preventDefault()
2192
2321
  e.stopPropagation()
2322
+ closeContextMenuForNode(target)
2193
2323
 
2194
2324
  let disable_message = target.getAttribute('data-disable')
2195
2325
  if (disable_message && disable_message.length > 0) {