pinokiod 3.9.0 → 3.9.3

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 (119) hide show
  1. package/:w +1247 -0
  2. package/kernel/api/filepicker/index.js +59 -0
  3. package/kernel/api/fs/index.js +6 -4
  4. package/kernel/api/index.js +123 -37
  5. package/kernel/api/input/index.js +2 -0
  6. package/kernel/api/web/index.js +6 -0
  7. package/kernel/bin/caddy.js +127 -0
  8. package/kernel/bin/cloudflared.js +1 -0
  9. package/kernel/bin/conda.js +10 -2
  10. package/kernel/bin/cuda.js +0 -16
  11. package/kernel/bin/ffmpeg.js +4 -6
  12. package/kernel/bin/git.js +55 -29
  13. package/kernel/bin/gxx.js +8 -6
  14. package/kernel/bin/huggingface.js +4 -5
  15. package/kernel/bin/index.js +347 -88
  16. package/kernel/bin/node.js +13 -6
  17. package/kernel/bin/py.js +1 -1
  18. package/kernel/bin/setup.js +146 -0
  19. package/kernel/bin/uv.js +4 -5
  20. package/kernel/bin/zip.js +7 -8
  21. package/kernel/connect/index.js +25 -0
  22. package/kernel/connect/providers/github/README.md +11 -0
  23. package/kernel/connect/providers/x/README.md +96 -0
  24. package/kernel/connect/providers/x/index.js +152 -0
  25. package/kernel/environment.js +50 -1
  26. package/kernel/index.js +152 -32
  27. package/kernel/info.js +4 -2
  28. package/kernel/kv.js +38 -0
  29. package/kernel/loader.js +13 -3
  30. package/kernel/peer.js +161 -0
  31. package/kernel/procs.js +116 -0
  32. package/kernel/prototype.js +62 -0
  33. package/kernel/router/common.js +42 -0
  34. package/kernel/router/connector.js +81 -0
  35. package/kernel/router/index.js +235 -0
  36. package/kernel/router/localhost_home_router.js +84 -0
  37. package/kernel/router/localhost_port_router.js +15 -0
  38. package/kernel/router/localhost_variable_router.js +37 -0
  39. package/kernel/router/peer_home_router.js +15 -0
  40. package/kernel/router/peer_peer_router.js +26 -0
  41. package/kernel/router/peer_port_router.js +45 -0
  42. package/kernel/router/peer_variable_router.js +46 -0
  43. package/kernel/router/processor.js +31 -0
  44. package/kernel/shell.js +141 -60
  45. package/kernel/shells.js +32 -17
  46. package/kernel/store.js +58 -0
  47. package/kernel/sysinfo.js +0 -1
  48. package/kernel/util.js +143 -36
  49. package/package.json +4 -1
  50. package/pipe/index.js +0 -2
  51. package/script/index.js +12 -0
  52. package/server/index.js +1473 -553
  53. package/server/public/Socket.js +5 -1
  54. package/server/public/SourceCodePro-Regular.ttf +0 -0
  55. package/server/public/SpaceMono-Bold.ttf +0 -0
  56. package/server/public/SpaceMono-BoldItalic.ttf +0 -0
  57. package/server/public/SpaceMono-Italic.ttf +0 -0
  58. package/server/public/SpaceMono-Regular.ttf +0 -0
  59. package/server/public/commander.js +40 -0
  60. package/server/public/common.js +60 -0
  61. package/server/public/dropzone-min.js +2 -0
  62. package/server/public/dropzone.css +1 -0
  63. package/server/public/filepond-plugin-file-validate-type.min.js +9 -0
  64. package/server/public/filepond-plugin-image-crop.min.js +9 -0
  65. package/server/public/filepond-plugin-image-edit.min.css +8 -0
  66. package/server/public/filepond-plugin-image-edit.min.js +9 -0
  67. package/server/public/filepond-plugin-image-exif-orientation.min.js +9 -0
  68. package/server/public/filepond-plugin-image-preview.min.css +8 -0
  69. package/server/public/filepond-plugin-image-preview.min.js +9 -0
  70. package/server/public/filepond-plugin-image-resize.min.js +9 -0
  71. package/server/public/filepond-plugin-image-transform.min.js +9 -0
  72. package/server/public/filepond.min.css +8 -0
  73. package/server/public/filepond.min.js +9 -0
  74. package/server/public/fscreator.js +174 -0
  75. package/server/public/fseditor.js +212 -0
  76. package/server/public/github.png +0 -0
  77. package/server/public/highlight-js.js +81 -0
  78. package/server/public/highlight.css +9 -0
  79. package/server/public/highlight.js +1244 -0
  80. package/server/public/install.js +17 -20
  81. package/server/public/modalinput.js +105 -9
  82. package/server/public/opener.js +3 -1
  83. package/server/public/pinokio-black.png +0 -0
  84. package/server/public/pinokio-black2.png +0 -0
  85. package/server/public/redoc.standalone.js +1832 -0
  86. package/server/public/style.css +215 -17
  87. package/server/public/swagger-ui-bundle.js +2 -0
  88. package/server/public/swagger-ui.css +3 -0
  89. package/server/public/x.js +63 -0
  90. package/server/socket.js +136 -39
  91. package/server/views/404.ejs +0 -1
  92. package/server/views/app.ejs +368 -98
  93. package/server/views/bootstrap.ejs +22 -19
  94. package/server/views/connect/x.ejs +324 -0
  95. package/server/views/connect.ejs +197 -0
  96. package/server/views/download.ejs +7 -1
  97. package/server/views/editor.ejs +68 -9
  98. package/server/views/explore.ejs +13 -10
  99. package/server/views/file_explorer.ejs +10 -37
  100. package/server/views/github.ejs +218 -0
  101. package/server/views/help.ejs +4 -3
  102. package/server/views/index.ejs +275 -121
  103. package/server/views/install.ejs +56 -29
  104. package/server/views/keys.ejs +276 -0
  105. package/server/views/network.ejs +889 -0
  106. package/server/views/partials/dynamic.ejs +9 -0
  107. package/server/views/partials/menu.ejs +7 -1
  108. package/server/views/prototype/index.ejs +311 -0
  109. package/server/views/prototype/show.ejs +383 -0
  110. package/server/views/redoc.ejs +18 -0
  111. package/server/views/required_env_editor.ejs +11 -2
  112. package/server/views/settings.ejs +38 -10
  113. package/server/views/setup.ejs +254 -0
  114. package/server/views/setup_home.ejs +192 -0
  115. package/server/views/shell.ejs +781 -0
  116. package/server/views/swaggerui.ejs +19 -0
  117. package/server/views/terminal.ejs +174 -42
  118. package/LICENSE +0 -7
  119. package/server/views/proxy.ejs +0 -405
@@ -1,405 +0,0 @@
1
- <html>
2
- <head>
3
- <title>Pinokio</title>
4
- <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
6
- <link href="/xterm.min.css" rel="stylesheet" />
7
- <link href="/css/fontawesome.min.css" rel="stylesheet">
8
- <link href="/css/solid.min.css" rel="stylesheet">
9
- <link href="/css/regular.min.css" rel="stylesheet">
10
- <link href="/css/brands.min.css" rel="stylesheet">
11
- <link href="/markdown.css" rel="stylesheet"/>
12
- <link href="/noty.css" rel="stylesheet"/>
13
- <link href="/style.css" rel="stylesheet"/>
14
- <script src="/sweetalert2.js"></script>
15
- <% if (agent === "electron") { %>
16
- <link href="/electron.css" rel="stylesheet"/>
17
- <% } %>
18
- <style>
19
- .line2 {
20
- display: flex;
21
- align-items: center;
22
- cursor: pointer;
23
- background: rgba(0,0,100,0.04);
24
- }
25
- .line2 a {
26
- text-decoration: none;
27
- color: black;
28
- }
29
- .status {
30
- padding: 10px;
31
- margin: 10px;
32
- border-radius: 10px;
33
- }
34
- .status.offline {
35
- background: silver;
36
- }
37
- .status.online {
38
- background: yellowgreen;
39
- }
40
- .switch {
41
- padding: 10px;
42
- margin: 10px 0;
43
- }
44
- .switch[data-online=true] {
45
- color: yellowgreen;
46
- }
47
- .button {
48
- padding: 10px;
49
- }
50
- .on, .off {
51
- display: flex;
52
- align-items: center;
53
- }
54
- header .runner {
55
- padding: 10px 0 0;
56
- }
57
- .proxy {
58
- padding: 0 10px;
59
- text-align: right;
60
- }
61
- .proxy a {
62
- text-decoration: none;
63
- display: inline-block;
64
- padding: 5px 10px;
65
- border-radius: 2px;
66
- background: black;
67
- color: white;
68
- }
69
- .browser-options-btns {
70
- display: flex;
71
- padding-top: 5px;
72
- }
73
- .browser-options-row {
74
- border-top: 1px solid rgba(0,0,0,0.1);
75
- border-bottom: 1px solid rgba(0,0,0,0.1);
76
- display: flex;
77
- padding: 20px 0;
78
- align-items: flex-start;
79
- }
80
- .browser-options-row h3 {
81
- margin: 0;
82
- font-size: 14px;
83
- margin-bottom: 3px;
84
- }
85
- .browser-options-row .btn.disabled {
86
- opacity: 0.7;
87
- }
88
- .browser-options-row .btn {
89
- font-weight: bold;
90
- width: 100px;
91
- text-align: center;
92
- display: block;
93
- margin-right: 10px;
94
- flex-shrink: 0;
95
- padding: 5px;
96
- }
97
- .badge {
98
- font-size: 12px;
99
- padding: 5px 10px;
100
- background: rgba(0,0,100,0.1);
101
- border-radius: 5px;
102
- display: inline-block;
103
- margin-top: 5px;
104
- }
105
- a.badge {
106
- color: royalblue;
107
- text-decoration: none;
108
- cursor: pointer;
109
- }
110
- .badge a {
111
- color: royalblue;
112
- text-decoration: none;
113
- }
114
- body.dark .btn {
115
- color: white;
116
- border: 1px solid rgba(255,255,255,0.3);
117
- }
118
- body.dark .badge {
119
- background: rgba(255,255,255,0.1);
120
- }
121
- body.dark .browser-options-row {
122
- border-top: 1px solid rgba(255,255,255,0.05);
123
- border-bottom: 1px solid rgba(255,255,255,0.05);
124
- }
125
- .description a {
126
- color: royalblue;
127
- text-decoration: none;
128
- }
129
- .line.align-top h3 {
130
- /*
131
- align-items: flex-start;
132
- */
133
- align-items: center;
134
- }
135
- .line a:hover {
136
- color: red;
137
- }
138
- .line img {
139
- width: 40px;
140
- height: 40px;
141
- }
142
- .btn-container {
143
- margin-top: 10px;
144
- }
145
- .header-label {
146
- font-size: 50px;
147
- letter-spacing: -1px;
148
- padding: 50px;
149
- text-align: center;
150
- text-transform: capitalize;
151
- }
152
- .header-label-sub {
153
- font-size: 25px;
154
- letter-spacing: -1px;
155
- padding: 15px;
156
- font-weight: bold;
157
- }
158
- .container {
159
- display: grid;
160
- grid-template-columns: repeat(2, 1fr);
161
- }
162
- .dark .container-row {
163
- background: rgba(255, 255, 255, 0.04);
164
- }
165
- .container-row {
166
- margin: 10px;
167
- background: rgba(0, 0, 100, 0.04);
168
- padding: 20px;
169
- box-sizing: border-box;
170
- }
171
- @media only screen and (max-width: 480px) {
172
- .btn2 {
173
- padding: 5px;
174
- font-size: 11px;
175
- }
176
- .nav-btns {
177
- flex-grow: 1;
178
- justify-content: center;
179
- padding: 0;
180
- }
181
- }
182
- </style>
183
- <body class='<%=theme%>'>
184
- <header class='navheader grabbable'>
185
- <h1>
186
- <a class='home' href="/"><i class="fa-solid fa-house"></i></a>
187
- <button class='btn2' id='back'><i class="fa-solid fa-chevron-left"></i></button>
188
- <button class='btn2' id='forward'><i class="fa-solid fa-chevron-right"></i></button>
189
- <div class='flexible'></div>
190
- <div class='nav-btns'>
191
- <a class='btn2' id='explore'><div><i class="fa-solid fa-globe"></i></div><div>Discover</div></a>
192
- <a class='btn2' href="https://portal.pinokio.computer/" target="_blank"><div><i class="fa-solid fa-face-smile-beam"></i></div><div>Community</div></a>
193
- <button class='btn2' id='genlog'><div><i class="fa-solid fa-laptop-code"></i></div><div>Debug</div></button>
194
- <a id='downloadlogs' download class='hidden btn2' href="/pinokio/logs.zip"><div><i class="fa-solid fa-download"></i></div><div>Download logs</div></a>
195
- <a class='btn2' href="/?mode=settings"><div><i class="fa-solid fa-gear"></i></div><div>Settings</div></a>
196
- <button id='new-window' title='open a new window' class='btn2'><div><i class="fa-solid fa-plus"></i></div><div>Window</div></button>
197
- </div>
198
- </h1>
199
- </header>
200
- <main>
201
- <div class='header-label'><i class='fa-solid fa-wifi'></i> Local Sharing</div>
202
- <div class='container'>
203
- <div class='container-row'>
204
- <div class='header-label-sub'><i class="fa-solid fa-microchip"></i> System Programs</div>
205
- <div class='line align-top'>
206
- <h3>
207
- <img class='icon' src="<%=icon%>">
208
- <div class='col'>
209
- <div class='title'>Pinokio</div>
210
- <% if (proxy) { %>
211
- <div class='description'><a href="<%=proxy.proxy%>" target="_blank"><%=proxy.proxy%></a> → <a href="<%=localhost%>" target="_blank"><%=localhost%></a></div>
212
- <a class='wifi-qr badge' data-qr="<%=qr%>" data-url="<%=proxy.proxy%>"><i class="fa-solid fa-qrcode"></i> Scan QR Code</a>
213
- <% } else { %>
214
- <div class='description'>Share Pinokio <a href="<%=localhost%>" target="_blank"><%=localhost%></a> with other devices on the same network</div>
215
- <% } %>
216
- <div class='btn-container'>
217
- <% if (proxy) { %>
218
- <div id='wifi-stop' data-proxy="<%=proxy.proxy%>" class='btn'><div><i class="fa-solid fa-stop"></i> Stop</div></div>
219
- <% } else { %>
220
- <div id='wifi' class='btn'><div><i class="fa-solid fa-play"></i> Start</div></div>
221
- <div id='wifi-starting' class='btn disabled hidden'><div><i class="fa-solid fa-circle-notch fa-spin"></i> Starting</div></div>
222
- <% } %>
223
- </div>
224
- </div>
225
- </h3>
226
- </div>
227
- <% items.forEach((item) => { %>
228
- <div class='line align-top'>
229
- <h3>
230
- <img class='icon' src="<%=item.icon%>">
231
- <div class='col'>
232
- <div class='title'><%=item.name%></div>
233
- <% if (item.proxy) { %>
234
- <div class='description'><a href="<%=item.proxy%>" target="_blank"><%=item.proxy%></a> → <a href="<%=item.target%>" target="_blank"><%=item.target%></a></div>
235
- <a class='wifi-qr badge' data-qr="<%=item.qr%>" data-url="<%=item.proxy%>"><i class="fa-solid fa-qrcode"></i> Scan QR Code</a>
236
- <% } else { %>
237
- <div class='description'>Share <%=item.target%> with other devices on the same network</div>
238
- <% } %>
239
- <div class='btn-container'>
240
- <% if (item.running) { %>
241
- <div data-port="<%=item.port%>" data-name="<%=item.name%>" data-target="<%=item.target%>" class='stop btn'><i class="fa-solid fa-stop"></i> Stop</div>
242
- <% } else { %>
243
- <div data-port="<%=item.port%>" data-name="<%=item.name%>" data-target="<%=item.target%>" class='start btn'><i class="fa-solid fa-play"></i> Start at port <%=item.port%></div>
244
- <% } %>
245
- </div>
246
- </div>
247
- </h3>
248
- </div>
249
- <% }) %>
250
- </div>
251
- <div class='container-row'>
252
- <div class='header-label-sub'><i class="fa-solid fa-dice-d6"></i> Application Programs</div>
253
- <% apps.forEach((item) => { %>
254
- <a class='line align-top' href="<%=item.link%>">
255
- <h3>
256
- <% if (item.icon) { %>
257
- <img class='icon' src="<%=item.icon%>">
258
- <% } else { %>
259
- <% if (theme === 'dark') { %>
260
- <img class='icon' src="/pinokio-white.png">
261
- <% } else { %>
262
- <img class='icon' src="/pinokio-black.png">
263
- <% } %>
264
- <% } %>
265
- <div class='col'>
266
- <div class='title'><%=item.name%></div>
267
- <div class='description'><%=item.description%></div>
268
- </div>
269
- <div class='spinner'>
270
- <i class="fa-solid fa-chevron-right"></i>
271
- </div>
272
- </h3>
273
- </a>
274
- <% }) %>
275
- </div>
276
- </div>
277
- </main>
278
- <script>
279
- document.querySelector(".container").addEventListener("click", async (e) => {
280
- let target
281
- if (e.target.classList.contains("stop")) {
282
- target = e.target
283
- } else {
284
- target = e.target.closest(".stop")
285
- }
286
- if (target) {
287
- // stop
288
- let res = await fetch("/proxy", {
289
- method: "post",
290
- headers: {
291
- "Content-Type": "application/json"
292
- },
293
- body: JSON.stringify({
294
- action: "stop",
295
- target: target.getAttribute("data-target"),
296
- name: target.getAttribute("data-name")
297
- })
298
- }).then((res) => {
299
- return res.json()
300
- })
301
- location.href = location.href
302
- return
303
- }
304
-
305
- if (e.target.classList.contains("start")) {
306
- target = e.target
307
- } else {
308
- target = e.target.closest(".start")
309
- }
310
- if (target) {
311
- let res = await fetch("/proxy", {
312
- method: "post",
313
- headers: {
314
- "Content-Type": "application/json"
315
- },
316
- body: JSON.stringify({
317
- action: "start",
318
- target: target.getAttribute("data-target"),
319
- name: target.getAttribute("data-name"),
320
- port: target.getAttribute("data-port")
321
- })
322
- }).then((res) => {
323
- return res.json()
324
- })
325
- location.href = location.href
326
- }
327
-
328
- if (e.target.classList.contains("wifi-qr")) {
329
- target = e.target
330
- } else {
331
- target = e.target.closest(".wifi-qr")
332
- }
333
- if (target) {
334
- let url = target.getAttribute("data-url")
335
- let qr = target.getAttribute("data-qr")
336
- console.log({ url, qr })
337
- await Swal.fire({
338
- title: "Local Share",
339
- customClass: {
340
- popup: "min-popup",
341
- title: "min-title"
342
- },
343
- showConfirmButton: false,
344
- html: `<div class='min-modal'>
345
- <div>Access Pinokio from</div>
346
- <div>any local network device</div>
347
- <div><img src="${qr}"></div>
348
- <a href="${url}" target="_blank">${url}</a>
349
- </div>`
350
- })
351
- }
352
-
353
- })
354
- if (document.querySelector("#back")) {
355
- document.querySelector("#back").addEventListener("click", (e) => {
356
- history.back()
357
- })
358
- }
359
- if (document.querySelector("#forward")) {
360
- document.querySelector("#forward").addEventListener("click", (e) => {
361
- history.forward()
362
- })
363
- }
364
- <% if (proxy) { %>
365
- if (document.querySelector("#wifi-stop")) {
366
- document.querySelector("#wifi-stop").addEventListener("click", async (e) => {
367
- let res = await fetch("/unpublish", {
368
- method: "post",
369
- headers: {
370
- "Content-Type": "application/json"
371
- },
372
- body: JSON.stringify({
373
- type: "local"
374
- })
375
- }).then((res) => {
376
- return res.json()
377
- })
378
- console.log(res)
379
- location.href = location.href
380
- })
381
- }
382
- <% } else { %>
383
- if (document.querySelector("#wifi")) {
384
- document.querySelector("#wifi").addEventListener("click", async (e) => {
385
- document.querySelector("#wifi").classList.add("hidden")
386
- document.querySelector("#wifi-starting").classList.remove("hidden")
387
- let res = await fetch("/publish", {
388
- method: "post",
389
- headers: {
390
- "Content-Type": "application/json"
391
- },
392
- body: JSON.stringify({
393
- type: "local"
394
- })
395
- }).then((res) => {
396
- return res.json()
397
- })
398
- console.log(res)
399
- location.href = location.href
400
- })
401
- }
402
- <% } %>
403
- </script>
404
- </body>
405
- </html>