pinokiod 3.316.0 → 3.321.0
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/bin/caddy.js +6 -0
- package/package.json +1 -1
- package/server/public/style.css +20 -0
- package/server/views/agents.ejs +330 -1
package/kernel/bin/caddy.js
CHANGED
|
@@ -191,14 +191,19 @@ class Caddy {
|
|
|
191
191
|
async installed() {
|
|
192
192
|
try {
|
|
193
193
|
let version = this.kernel.bin.installed.conda_versions.caddy
|
|
194
|
+
console.log("caddy version", version)
|
|
194
195
|
let coerced = semver.coerce(version)
|
|
196
|
+
console.log("caddy coerced", coerced)
|
|
195
197
|
let requirement = "<2.10.0"
|
|
196
198
|
let satisfied = semver.satisfies(coerced, requirement)
|
|
199
|
+
console.log("caddy satisfied?", satisfied)
|
|
197
200
|
if (!satisfied) {
|
|
198
201
|
return false
|
|
199
202
|
}
|
|
200
203
|
let e = await this.kernel.exists(this.kernel.path("cache/XDG_DATA_HOME/caddy/pki/authorities/local/root.crt"))
|
|
204
|
+
console.log("root.crt exists?", e)
|
|
201
205
|
if (e) {
|
|
206
|
+
console.log('conda has caddy?', this.kernel.bin.installed.conda.has("caddy"))
|
|
202
207
|
if (this.kernel.platform === "win32") {
|
|
203
208
|
return this.kernel.bin.installed.conda.has("caddy")
|
|
204
209
|
} else {
|
|
@@ -208,6 +213,7 @@ class Caddy {
|
|
|
208
213
|
return false
|
|
209
214
|
}
|
|
210
215
|
} catch (e) {
|
|
216
|
+
console.log("caddy installed check error", e)
|
|
211
217
|
return false
|
|
212
218
|
}
|
|
213
219
|
}
|
package/package.json
CHANGED
package/server/public/style.css
CHANGED
|
@@ -358,6 +358,26 @@ footer pre {
|
|
|
358
358
|
.swal2-title.full-title {
|
|
359
359
|
text-align: left;
|
|
360
360
|
}
|
|
361
|
+
.swal2-popup.standard-popup {
|
|
362
|
+
padding: 20px !important;
|
|
363
|
+
}
|
|
364
|
+
.swal2-popup.standard-popup > * {
|
|
365
|
+
width: 100% !important;
|
|
366
|
+
box-sizing: border-box !important;
|
|
367
|
+
text-align: left;
|
|
368
|
+
margin: 5px 0 !important;
|
|
369
|
+
display: block;
|
|
370
|
+
font-size: 14px;
|
|
371
|
+
}
|
|
372
|
+
.swal2-popup.standard-popup .swal2-actions {
|
|
373
|
+
padding: 0 !important;
|
|
374
|
+
}
|
|
375
|
+
.swal2-popup.standard-popup > .standard-title {
|
|
376
|
+
text-align: left;
|
|
377
|
+
padding: 0 !important;;
|
|
378
|
+
font-size: 20px !important;
|
|
379
|
+
margin: 0;
|
|
380
|
+
}
|
|
361
381
|
.swal2-popup.min-popup2 a {
|
|
362
382
|
outline: none;
|
|
363
383
|
}
|
package/server/views/agents.ejs
CHANGED
|
@@ -543,6 +543,32 @@ body.dark .plugin-option:hover {
|
|
|
543
543
|
gap: 8px;
|
|
544
544
|
}
|
|
545
545
|
}
|
|
546
|
+
.pinokio-install-modal.swal2-popup {
|
|
547
|
+
padding: 30px;
|
|
548
|
+
text-align: left;
|
|
549
|
+
}
|
|
550
|
+
.pinokio-install-modal .swal2-title {
|
|
551
|
+
text-align: left;
|
|
552
|
+
padding: 0;
|
|
553
|
+
margin-bottom: 20px;
|
|
554
|
+
font-size: 20px;
|
|
555
|
+
}
|
|
556
|
+
.pinokio-install-modal .swal2-input-label {
|
|
557
|
+
text-align: left;
|
|
558
|
+
justify-content: flex-start;
|
|
559
|
+
margin: 0 0 10px 0;
|
|
560
|
+
font-size: 14px;
|
|
561
|
+
font-weight: 600;
|
|
562
|
+
}
|
|
563
|
+
.pinokio-install-modal .swal2-input {
|
|
564
|
+
margin: 0 0 20px 0;
|
|
565
|
+
height: 44px;
|
|
566
|
+
font-size: 14px;
|
|
567
|
+
}
|
|
568
|
+
.pinokio-install-modal .swal2-actions {
|
|
569
|
+
justify-content: flex-end;
|
|
570
|
+
margin: 0;
|
|
571
|
+
}
|
|
546
572
|
</style>
|
|
547
573
|
<% const serializedPlugins = pluginMenu.map((plugin) => {
|
|
548
574
|
const hrefValue = plugin.href || ''
|
|
@@ -609,13 +635,21 @@ body.dark .plugin-option:hover {
|
|
|
609
635
|
</header>
|
|
610
636
|
<main class='plugin-main'>
|
|
611
637
|
<div class='plugin-container container'>
|
|
612
|
-
<h1
|
|
638
|
+
<h1 style="display: flex; align-items: center;">
|
|
639
|
+
<div><i class="fa-solid fa-robot"></i>Agents</div>
|
|
640
|
+
<button class="btn" onclick="installAgent(event)" style="margin-left: auto; display: flex; align-items: center; gap: 5px;">
|
|
641
|
+
<i class="fa-solid fa-download"></i> Install
|
|
642
|
+
</button>
|
|
643
|
+
</h1>
|
|
613
644
|
<% const pluginCategories = pluginMenu.reduce((acc, pluginItem, index) => {
|
|
614
645
|
const runs = Array.isArray(pluginItem.run) ? pluginItem.run : []
|
|
615
646
|
const hasExec = runs.some((step) => step && step.method === 'exec')
|
|
616
647
|
const hasShellRun = runs.some((step) => step && step.method === 'shell.run')
|
|
648
|
+
const hasAppLaunch = runs.some((step) => step && step.method === 'app.launch')
|
|
617
649
|
if (hasExec) {
|
|
618
650
|
acc.ide.push({ pluginItem, index })
|
|
651
|
+
} else if (hasAppLaunch) {
|
|
652
|
+
acc.ide.push({ pluginItem, index })
|
|
619
653
|
} else if (hasShellRun) {
|
|
620
654
|
acc.cli.push({ pluginItem, index })
|
|
621
655
|
} else {
|
|
@@ -1184,6 +1218,301 @@ body.dark .plugin-option:hover {
|
|
|
1184
1218
|
})
|
|
1185
1219
|
})()
|
|
1186
1220
|
</script>
|
|
1221
|
+
|
|
1222
|
+
<script>
|
|
1223
|
+
const installAgentModal = (() => {
|
|
1224
|
+
let overlay
|
|
1225
|
+
let inputEl
|
|
1226
|
+
let errorEl
|
|
1227
|
+
let formEl
|
|
1228
|
+
|
|
1229
|
+
function ensureStyles() {
|
|
1230
|
+
if (document.getElementById('install-agent-styles')) return
|
|
1231
|
+
const style = document.createElement('style')
|
|
1232
|
+
style.id = 'install-agent-styles'
|
|
1233
|
+
style.textContent = `
|
|
1234
|
+
.install-agent-overlay {
|
|
1235
|
+
position: fixed;
|
|
1236
|
+
inset: 0;
|
|
1237
|
+
display: none;
|
|
1238
|
+
align-items: center;
|
|
1239
|
+
justify-content: center;
|
|
1240
|
+
padding: 18px;
|
|
1241
|
+
background: rgba(8, 12, 20, 0.55);
|
|
1242
|
+
backdrop-filter: blur(4px);
|
|
1243
|
+
z-index: 2200;
|
|
1244
|
+
}
|
|
1245
|
+
.install-agent-overlay.is-visible {
|
|
1246
|
+
display: flex;
|
|
1247
|
+
}
|
|
1248
|
+
.install-agent-dialog {
|
|
1249
|
+
width: min(540px, 100%);
|
|
1250
|
+
background: #ffffff;
|
|
1251
|
+
color: #0f172a;
|
|
1252
|
+
border-radius: 16px;
|
|
1253
|
+
padding: 22px 22px 18px;
|
|
1254
|
+
box-shadow: 0 20px 70px rgba(0, 0, 0, 0.22);
|
|
1255
|
+
border: 1px solid rgba(15, 23, 42, 0.06);
|
|
1256
|
+
}
|
|
1257
|
+
body.dark .install-agent-dialog {
|
|
1258
|
+
background: #0b1221;
|
|
1259
|
+
color: #e5e7eb;
|
|
1260
|
+
border-color: rgba(255, 255, 255, 0.08);
|
|
1261
|
+
box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
|
|
1262
|
+
}
|
|
1263
|
+
.install-agent-header {
|
|
1264
|
+
display: flex;
|
|
1265
|
+
align-items: flex-start;
|
|
1266
|
+
gap: 12px;
|
|
1267
|
+
margin-bottom: 16px;
|
|
1268
|
+
}
|
|
1269
|
+
.install-agent-icon {
|
|
1270
|
+
width: 44px;
|
|
1271
|
+
height: 44px;
|
|
1272
|
+
border-radius: 12px;
|
|
1273
|
+
background: linear-gradient(135deg, #22c55e, #0ea5e9);
|
|
1274
|
+
color: #0b1221;
|
|
1275
|
+
display: inline-flex;
|
|
1276
|
+
align-items: center;
|
|
1277
|
+
justify-content: center;
|
|
1278
|
+
font-size: 18px;
|
|
1279
|
+
box-shadow: 0 12px 30px rgba(14, 165, 233, 0.25);
|
|
1280
|
+
}
|
|
1281
|
+
.install-agent-heading {
|
|
1282
|
+
display: flex;
|
|
1283
|
+
flex-direction: column;
|
|
1284
|
+
gap: 4px;
|
|
1285
|
+
flex: 1;
|
|
1286
|
+
min-width: 0;
|
|
1287
|
+
}
|
|
1288
|
+
.install-agent-title {
|
|
1289
|
+
font-size: 18px;
|
|
1290
|
+
font-weight: 700;
|
|
1291
|
+
margin: 0;
|
|
1292
|
+
}
|
|
1293
|
+
.install-agent-subtitle {
|
|
1294
|
+
margin: 0;
|
|
1295
|
+
opacity: 0.72;
|
|
1296
|
+
font-size: 13px;
|
|
1297
|
+
}
|
|
1298
|
+
.install-agent-close {
|
|
1299
|
+
background: none;
|
|
1300
|
+
border: none;
|
|
1301
|
+
color: inherit;
|
|
1302
|
+
opacity: 0.6;
|
|
1303
|
+
cursor: pointer;
|
|
1304
|
+
padding: 6px;
|
|
1305
|
+
border-radius: 8px;
|
|
1306
|
+
transition: opacity 0.15s ease, background 0.15s ease;
|
|
1307
|
+
}
|
|
1308
|
+
.install-agent-close:hover,
|
|
1309
|
+
.install-agent-close:focus-visible {
|
|
1310
|
+
opacity: 1;
|
|
1311
|
+
background: rgba(15, 23, 42, 0.07);
|
|
1312
|
+
}
|
|
1313
|
+
body.dark .install-agent-close:hover,
|
|
1314
|
+
body.dark .install-agent-close:focus-visible {
|
|
1315
|
+
background: rgba(255, 255, 255, 0.08);
|
|
1316
|
+
}
|
|
1317
|
+
.install-agent-body {
|
|
1318
|
+
display: flex;
|
|
1319
|
+
flex-direction: column;
|
|
1320
|
+
gap: 10px;
|
|
1321
|
+
margin-top: 4px;
|
|
1322
|
+
}
|
|
1323
|
+
.install-agent-label {
|
|
1324
|
+
font-weight: 600;
|
|
1325
|
+
font-size: 13px;
|
|
1326
|
+
}
|
|
1327
|
+
.install-agent-body input {
|
|
1328
|
+
width: 100%;
|
|
1329
|
+
padding: 12px 14px;
|
|
1330
|
+
border-radius: 10px;
|
|
1331
|
+
border: 1px solid rgba(15, 23, 42, 0.12);
|
|
1332
|
+
background: #f8fafc;
|
|
1333
|
+
color: #0f172a;
|
|
1334
|
+
font-size: 14px;
|
|
1335
|
+
transition: border-color 0.15s ease, box-shadow 0.15s ease;
|
|
1336
|
+
}
|
|
1337
|
+
.install-agent-body input:focus-visible {
|
|
1338
|
+
outline: none;
|
|
1339
|
+
border-color: #0ea5e9;
|
|
1340
|
+
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
|
|
1341
|
+
}
|
|
1342
|
+
body.dark .install-agent-body input {
|
|
1343
|
+
background: #111827;
|
|
1344
|
+
border-color: rgba(255, 255, 255, 0.08);
|
|
1345
|
+
color: #e5e7eb;
|
|
1346
|
+
}
|
|
1347
|
+
body.dark .install-agent-body input:focus-visible {
|
|
1348
|
+
border-color: #38bdf8;
|
|
1349
|
+
box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
|
|
1350
|
+
}
|
|
1351
|
+
.install-agent-hint {
|
|
1352
|
+
font-size: 12px;
|
|
1353
|
+
opacity: 0.65;
|
|
1354
|
+
}
|
|
1355
|
+
.install-agent-error {
|
|
1356
|
+
color: #ef4444;
|
|
1357
|
+
font-size: 12px;
|
|
1358
|
+
min-height: 16px;
|
|
1359
|
+
}
|
|
1360
|
+
body.dark .install-agent-error {
|
|
1361
|
+
color: #f87171;
|
|
1362
|
+
}
|
|
1363
|
+
.install-agent-actions {
|
|
1364
|
+
display: flex;
|
|
1365
|
+
justify-content: flex-end;
|
|
1366
|
+
gap: 8px;
|
|
1367
|
+
margin-top: 6px;
|
|
1368
|
+
}
|
|
1369
|
+
.install-agent-button {
|
|
1370
|
+
border: none;
|
|
1371
|
+
border-radius: 10px;
|
|
1372
|
+
padding: 10px 14px;
|
|
1373
|
+
font-weight: 600;
|
|
1374
|
+
font-size: 14px;
|
|
1375
|
+
cursor: pointer;
|
|
1376
|
+
transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
|
|
1377
|
+
}
|
|
1378
|
+
.install-agent-button.primary {
|
|
1379
|
+
background: linear-gradient(135deg, #0ea5e9, #22c55e);
|
|
1380
|
+
color: #0b1221;
|
|
1381
|
+
box-shadow: 0 12px 30px rgba(14, 165, 233, 0.22);
|
|
1382
|
+
}
|
|
1383
|
+
.install-agent-button.primary:hover {
|
|
1384
|
+
transform: translateY(-1px);
|
|
1385
|
+
}
|
|
1386
|
+
.install-agent-button.ghost {
|
|
1387
|
+
background: transparent;
|
|
1388
|
+
color: inherit;
|
|
1389
|
+
border: 1px solid rgba(15, 23, 42, 0.12);
|
|
1390
|
+
}
|
|
1391
|
+
body.dark .install-agent-button.ghost {
|
|
1392
|
+
border-color: rgba(255, 255, 255, 0.12);
|
|
1393
|
+
}
|
|
1394
|
+
.install-agent-button:focus-visible {
|
|
1395
|
+
outline: none;
|
|
1396
|
+
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.25);
|
|
1397
|
+
}
|
|
1398
|
+
`
|
|
1399
|
+
document.head.appendChild(style)
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
function handleKeydown(event) {
|
|
1403
|
+
if (event.key === 'Escape') {
|
|
1404
|
+
event.preventDefault()
|
|
1405
|
+
close()
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
function showError(message) {
|
|
1410
|
+
if (!errorEl) return
|
|
1411
|
+
errorEl.textContent = message || ''
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
function close() {
|
|
1415
|
+
if (!overlay) return
|
|
1416
|
+
overlay.classList.remove('is-visible')
|
|
1417
|
+
if (formEl) formEl.reset()
|
|
1418
|
+
showError('')
|
|
1419
|
+
document.removeEventListener('keydown', handleKeydown, true)
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
function handleSubmit() {
|
|
1423
|
+
if (!inputEl) return
|
|
1424
|
+
const value = (inputEl.value || '').trim()
|
|
1425
|
+
if (!value) {
|
|
1426
|
+
showError('Please enter a Git URL to continue.')
|
|
1427
|
+
inputEl.focus()
|
|
1428
|
+
return
|
|
1429
|
+
}
|
|
1430
|
+
try {
|
|
1431
|
+
new URL(value)
|
|
1432
|
+
} catch (err) {
|
|
1433
|
+
showError('That URL does not look valid.')
|
|
1434
|
+
inputEl.focus()
|
|
1435
|
+
return
|
|
1436
|
+
}
|
|
1437
|
+
close()
|
|
1438
|
+
window.location.href = `/?mode=download&uri=${encodeURIComponent(value)}&path=plugin`
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
function createModal() {
|
|
1442
|
+
ensureStyles()
|
|
1443
|
+
overlay = document.createElement('div')
|
|
1444
|
+
overlay.className = 'install-agent-overlay'
|
|
1445
|
+
overlay.innerHTML = `
|
|
1446
|
+
<div class="install-agent-dialog" role="dialog" aria-modal="true" aria-labelledby="install-agent-title">
|
|
1447
|
+
<div class="install-agent-header">
|
|
1448
|
+
<div class="install-agent-icon"><i class="fa-solid fa-plug"></i></div>
|
|
1449
|
+
<div class="install-agent-heading">
|
|
1450
|
+
<div class="install-agent-title" id="install-agent-title">Install Agent</div>
|
|
1451
|
+
<p class="install-agent-subtitle">Add an agent directly from a Git repository URL.</p>
|
|
1452
|
+
</div>
|
|
1453
|
+
<button class="install-agent-close" type="button" data-install-close aria-label="Close install dialog">
|
|
1454
|
+
<i class="fa-solid fa-xmark"></i>
|
|
1455
|
+
</button>
|
|
1456
|
+
</div>
|
|
1457
|
+
<form class="install-agent-body" novalidate>
|
|
1458
|
+
<label class="install-agent-label" for="install-agent-url">Git URL</label>
|
|
1459
|
+
<input id="install-agent-url" type="url" name="agentUrl" placeholder="https://github.com/user/repo.git" autocomplete="off" required />
|
|
1460
|
+
<div class="install-agent-hint">The agent will be downloaded into <code>~/pinokio/plugin</code>.</div>
|
|
1461
|
+
<div class="install-agent-error" data-install-error></div>
|
|
1462
|
+
<div class="install-agent-actions">
|
|
1463
|
+
<button class="install-agent-button ghost" type="button" data-install-cancel>Cancel</button>
|
|
1464
|
+
<button class="install-agent-button primary" type="submit">Install</button>
|
|
1465
|
+
</div>
|
|
1466
|
+
</form>
|
|
1467
|
+
</div>
|
|
1468
|
+
`
|
|
1469
|
+
document.body.appendChild(overlay)
|
|
1470
|
+
inputEl = overlay.querySelector('#install-agent-url')
|
|
1471
|
+
errorEl = overlay.querySelector('[data-install-error]')
|
|
1472
|
+
formEl = overlay.querySelector('form')
|
|
1473
|
+
const closeButtons = overlay.querySelectorAll('[data-install-close], [data-install-cancel]')
|
|
1474
|
+
closeButtons.forEach((button) => {
|
|
1475
|
+
button.addEventListener('click', close)
|
|
1476
|
+
})
|
|
1477
|
+
overlay.addEventListener('click', (event) => {
|
|
1478
|
+
if (event.target === overlay) {
|
|
1479
|
+
close()
|
|
1480
|
+
}
|
|
1481
|
+
})
|
|
1482
|
+
formEl.addEventListener('submit', (event) => {
|
|
1483
|
+
event.preventDefault()
|
|
1484
|
+
handleSubmit()
|
|
1485
|
+
})
|
|
1486
|
+
inputEl.addEventListener('input', () => {
|
|
1487
|
+
showError('')
|
|
1488
|
+
})
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
function open() {
|
|
1492
|
+
if (!overlay) createModal()
|
|
1493
|
+
overlay.classList.add('is-visible')
|
|
1494
|
+
document.addEventListener('keydown', handleKeydown, true)
|
|
1495
|
+
requestAnimationFrame(() => {
|
|
1496
|
+
if (inputEl) {
|
|
1497
|
+
inputEl.focus()
|
|
1498
|
+
inputEl.select()
|
|
1499
|
+
}
|
|
1500
|
+
})
|
|
1501
|
+
}
|
|
1502
|
+
|
|
1503
|
+
return {
|
|
1504
|
+
open
|
|
1505
|
+
}
|
|
1506
|
+
})()
|
|
1507
|
+
|
|
1508
|
+
function installAgent(e) {
|
|
1509
|
+
if (e) {
|
|
1510
|
+
e.preventDefault()
|
|
1511
|
+
e.stopPropagation()
|
|
1512
|
+
}
|
|
1513
|
+
installAgentModal.open()
|
|
1514
|
+
}
|
|
1515
|
+
</script>
|
|
1187
1516
|
<script src="/opener.js"></script>
|
|
1188
1517
|
</body>
|
|
1189
1518
|
</html>
|