pinokiod 7.5.21 → 7.5.23
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/plugin_sources.js +8 -0
- package/package.json +1 -1
- package/server/index.js +113 -13
- package/server/lib/plugin_delete.js +89 -0
- package/server/public/common.js +6 -2
- package/server/public/plugin-detail.js +131 -1
- package/server/public/task-launcher.css +221 -17
- package/server/public/universal-launcher.js +2 -1
- package/server/socket.js +59 -99
- package/server/views/app.ejs +141 -20
- package/server/views/plugin_detail.ejs +52 -20
- package/server/views/plugins.ejs +14 -1
- package/server/views/terminal.ejs +11 -5
- package/test/plugin-delete.test.js +143 -0
- package/test/plugin-detail-ui.test.js +269 -0
- package/test/plugin-detail-view.test.js +160 -0
- package/test/plugin-sources.test.js +19 -0
- package/test/terminal-log-paths.test.js +238 -0
- package/test/universal-launcher.smoke.spec.js +50 -0
|
@@ -276,6 +276,10 @@ body.task-page .task-shell {
|
|
|
276
276
|
padding-top: 18px;
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
+
.task-detail-layout-single {
|
|
280
|
+
grid-template-columns: minmax(0, 1fr);
|
|
281
|
+
}
|
|
282
|
+
|
|
279
283
|
.task-detail-main {
|
|
280
284
|
min-width: 0;
|
|
281
285
|
}
|
|
@@ -374,6 +378,52 @@ body.connect-page .task-shell {
|
|
|
374
378
|
text-transform: uppercase;
|
|
375
379
|
}
|
|
376
380
|
|
|
381
|
+
.task-breadcrumb {
|
|
382
|
+
display: flex;
|
|
383
|
+
align-items: center;
|
|
384
|
+
gap: 8px;
|
|
385
|
+
min-width: 0;
|
|
386
|
+
margin-bottom: 8px;
|
|
387
|
+
padding: 0;
|
|
388
|
+
min-height: 0;
|
|
389
|
+
background: transparent;
|
|
390
|
+
color: var(--task-muted);
|
|
391
|
+
font-size: 12px;
|
|
392
|
+
font-weight: 600;
|
|
393
|
+
line-height: 1.2;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
body.task-launcher-page .task-breadcrumb {
|
|
397
|
+
background: transparent;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.task-breadcrumb-link {
|
|
401
|
+
display: inline-flex;
|
|
402
|
+
align-items: center;
|
|
403
|
+
min-width: 0;
|
|
404
|
+
padding: 0;
|
|
405
|
+
color: inherit;
|
|
406
|
+
text-decoration: none;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
.task-breadcrumb-link:hover,
|
|
410
|
+
.task-breadcrumb-link:focus-visible {
|
|
411
|
+
color: var(--task-text);
|
|
412
|
+
text-decoration: none;
|
|
413
|
+
outline: none;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.task-breadcrumb-separator {
|
|
417
|
+
color: var(--task-border-strong);
|
|
418
|
+
font-size: 11px;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.task-breadcrumb-current {
|
|
422
|
+
overflow: hidden;
|
|
423
|
+
text-overflow: ellipsis;
|
|
424
|
+
white-space: nowrap;
|
|
425
|
+
}
|
|
426
|
+
|
|
377
427
|
.task-back-link {
|
|
378
428
|
display: inline-flex;
|
|
379
429
|
align-items: center;
|
|
@@ -2566,16 +2616,57 @@ body.connect-page .connect-service-open {
|
|
|
2566
2616
|
max-width: none;
|
|
2567
2617
|
}
|
|
2568
2618
|
|
|
2619
|
+
.plugin-detail-page .task-shell-header {
|
|
2620
|
+
padding: 12px 28px 14px;
|
|
2621
|
+
}
|
|
2622
|
+
|
|
2623
|
+
.plugin-detail-page .task-shell-body {
|
|
2624
|
+
padding: 18px 28px 24px;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
.plugin-detail-page .task-detail-layout {
|
|
2628
|
+
grid-template-columns: minmax(0, 1fr) 320px;
|
|
2629
|
+
gap: 32px;
|
|
2630
|
+
max-width: 1520px;
|
|
2631
|
+
padding-top: 4px;
|
|
2632
|
+
}
|
|
2633
|
+
|
|
2634
|
+
.plugin-detail-page .task-detail-sidebar {
|
|
2635
|
+
padding-left: 28px;
|
|
2636
|
+
}
|
|
2637
|
+
|
|
2638
|
+
.plugin-detail-page .task-detail-sidebar::before {
|
|
2639
|
+
left: 0;
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
.plugin-detail-page .task-header-badges {
|
|
2643
|
+
margin-top: 8px;
|
|
2644
|
+
}
|
|
2645
|
+
|
|
2646
|
+
.plugin-detail-breadcrumb .task-breadcrumb-link:first-child {
|
|
2647
|
+
color: var(--task-muted);
|
|
2648
|
+
}
|
|
2649
|
+
|
|
2650
|
+
.plugin-detail-breadcrumb .task-breadcrumb-link:first-child:hover,
|
|
2651
|
+
.plugin-detail-breadcrumb .task-breadcrumb-link:first-child:focus-visible {
|
|
2652
|
+
color: var(--task-text);
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
.plugin-detail-breadcrumb .task-breadcrumb-current {
|
|
2656
|
+
color: var(--task-text);
|
|
2657
|
+
font-weight: 650;
|
|
2658
|
+
}
|
|
2659
|
+
|
|
2569
2660
|
.plugin-detail-title-row {
|
|
2570
2661
|
display: flex;
|
|
2571
2662
|
align-items: center;
|
|
2572
|
-
gap:
|
|
2663
|
+
gap: 10px;
|
|
2573
2664
|
}
|
|
2574
2665
|
|
|
2575
2666
|
.plugin-detail-title-art {
|
|
2576
|
-
width:
|
|
2577
|
-
height:
|
|
2578
|
-
border-radius:
|
|
2667
|
+
width: 38px;
|
|
2668
|
+
height: 38px;
|
|
2669
|
+
border-radius: 9px;
|
|
2579
2670
|
object-fit: cover;
|
|
2580
2671
|
flex-shrink: 0;
|
|
2581
2672
|
border: 1px solid var(--task-border);
|
|
@@ -2587,7 +2678,7 @@ body.connect-page .connect-service-open {
|
|
|
2587
2678
|
align-items: center;
|
|
2588
2679
|
justify-content: center;
|
|
2589
2680
|
color: var(--task-accent);
|
|
2590
|
-
font-size:
|
|
2681
|
+
font-size: 18px;
|
|
2591
2682
|
}
|
|
2592
2683
|
|
|
2593
2684
|
.plugin-detail-page .task-detail-sidebar .task-meta-row-compact {
|
|
@@ -2598,14 +2689,77 @@ body.connect-page .connect-service-open {
|
|
|
2598
2689
|
grid-template-columns: minmax(0, 1fr);
|
|
2599
2690
|
}
|
|
2600
2691
|
|
|
2692
|
+
.plugin-detail-status-list {
|
|
2693
|
+
display: grid;
|
|
2694
|
+
border-top: 1px solid var(--task-border);
|
|
2695
|
+
border-bottom: 1px solid var(--task-border);
|
|
2696
|
+
}
|
|
2697
|
+
|
|
2698
|
+
.plugin-detail-status-row {
|
|
2699
|
+
display: grid;
|
|
2700
|
+
grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
|
|
2701
|
+
gap: 12px;
|
|
2702
|
+
align-items: baseline;
|
|
2703
|
+
min-height: 0;
|
|
2704
|
+
padding: 8px 0;
|
|
2705
|
+
border-top: 1px solid var(--task-border);
|
|
2706
|
+
}
|
|
2707
|
+
|
|
2708
|
+
.plugin-detail-status-row:first-child {
|
|
2709
|
+
border-top: 0;
|
|
2710
|
+
}
|
|
2711
|
+
|
|
2712
|
+
.plugin-detail-status-label {
|
|
2713
|
+
min-width: 0;
|
|
2714
|
+
color: var(--task-muted);
|
|
2715
|
+
font-size: 12px;
|
|
2716
|
+
line-height: 1.35;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
.plugin-detail-status-value {
|
|
2720
|
+
min-width: 0;
|
|
2721
|
+
color: var(--task-text);
|
|
2722
|
+
font-size: 12px;
|
|
2723
|
+
font-weight: 650;
|
|
2724
|
+
line-height: 1.35;
|
|
2725
|
+
text-align: right;
|
|
2726
|
+
word-break: break-word;
|
|
2727
|
+
}
|
|
2728
|
+
|
|
2729
|
+
.plugin-detail-page .task-detail-status-actions {
|
|
2730
|
+
gap: 8px;
|
|
2731
|
+
align-items: center;
|
|
2732
|
+
}
|
|
2733
|
+
|
|
2734
|
+
.plugin-detail-page .task-side-group {
|
|
2735
|
+
gap: 12px;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
.plugin-detail-page .task-share-next-step-main {
|
|
2739
|
+
gap: 8px;
|
|
2740
|
+
padding-top: 0;
|
|
2741
|
+
border-top: 0;
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
.plugin-detail-page .task-share-next-step-title {
|
|
2745
|
+
font-size: 15px;
|
|
2746
|
+
line-height: 1.2;
|
|
2747
|
+
}
|
|
2748
|
+
|
|
2601
2749
|
.plugin-detail-actions-section .task-section-subcopy {
|
|
2602
2750
|
max-width: 56ch;
|
|
2603
2751
|
}
|
|
2604
2752
|
|
|
2753
|
+
.plugin-detail-actions-section .task-section-head {
|
|
2754
|
+
margin-bottom: 8px;
|
|
2755
|
+
}
|
|
2756
|
+
|
|
2605
2757
|
.plugin-detail-action-grid {
|
|
2606
2758
|
display: grid;
|
|
2607
|
-
gap:
|
|
2608
|
-
margin-top:
|
|
2759
|
+
gap: 0;
|
|
2760
|
+
margin-top: 10px;
|
|
2761
|
+
border-top: 1px solid var(--task-border);
|
|
2762
|
+
border-bottom: 1px solid var(--task-border);
|
|
2609
2763
|
}
|
|
2610
2764
|
|
|
2611
2765
|
.plugin-detail-next-step-banner {
|
|
@@ -2625,21 +2779,37 @@ body.connect-page .connect-service-open {
|
|
|
2625
2779
|
grid-template-columns: minmax(0, 1fr) auto;
|
|
2626
2780
|
align-items: center;
|
|
2627
2781
|
gap: 14px;
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
border
|
|
2631
|
-
|
|
2782
|
+
min-height: 0;
|
|
2783
|
+
padding: 9px 12px;
|
|
2784
|
+
border: 0;
|
|
2785
|
+
border-top: 1px solid var(--task-border);
|
|
2786
|
+
border-radius: 0;
|
|
2787
|
+
background: transparent;
|
|
2788
|
+
}
|
|
2789
|
+
|
|
2790
|
+
.plugin-detail-action-card:first-child {
|
|
2791
|
+
border-top: 0;
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
.plugin-detail-action-card:hover,
|
|
2795
|
+
.plugin-detail-action-card:focus-within {
|
|
2796
|
+
background: color-mix(in srgb, var(--task-soft) 64%, transparent);
|
|
2632
2797
|
}
|
|
2633
2798
|
|
|
2634
2799
|
.plugin-detail-action-card.is-recommended {
|
|
2635
|
-
|
|
2636
|
-
|
|
2800
|
+
background: color-mix(in srgb, var(--task-accent) 7%, transparent);
|
|
2801
|
+
box-shadow: inset 2px 0 0 color-mix(in srgb, var(--task-accent) 42%, var(--task-border));
|
|
2802
|
+
}
|
|
2803
|
+
|
|
2804
|
+
.plugin-detail-action-card.is-recommended:hover,
|
|
2805
|
+
.plugin-detail-action-card.is-recommended:focus-within {
|
|
2806
|
+
background: color-mix(in srgb, var(--task-accent) 10%, transparent);
|
|
2637
2807
|
}
|
|
2638
2808
|
|
|
2639
2809
|
.plugin-detail-action-copy {
|
|
2640
2810
|
min-width: 0;
|
|
2641
2811
|
display: grid;
|
|
2642
|
-
gap:
|
|
2812
|
+
gap: 2px;
|
|
2643
2813
|
}
|
|
2644
2814
|
|
|
2645
2815
|
.plugin-detail-next-step-chip {
|
|
@@ -2659,7 +2829,7 @@ body.connect-page .connect-service-open {
|
|
|
2659
2829
|
}
|
|
2660
2830
|
|
|
2661
2831
|
.plugin-detail-action-label {
|
|
2662
|
-
font-size:
|
|
2832
|
+
font-size: 13px;
|
|
2663
2833
|
font-weight: 700;
|
|
2664
2834
|
letter-spacing: -0.02em;
|
|
2665
2835
|
line-height: 1.2;
|
|
@@ -2667,8 +2837,8 @@ body.connect-page .connect-service-open {
|
|
|
2667
2837
|
|
|
2668
2838
|
.plugin-detail-action-meta {
|
|
2669
2839
|
color: var(--task-muted);
|
|
2670
|
-
font-size:
|
|
2671
|
-
line-height: 1.
|
|
2840
|
+
font-size: 11px;
|
|
2841
|
+
line-height: 1.35;
|
|
2672
2842
|
}
|
|
2673
2843
|
|
|
2674
2844
|
.plugin-share-static-actions {
|
|
@@ -3053,6 +3223,13 @@ body.dark .plugin-option .option-icon {
|
|
|
3053
3223
|
padding-top: 10px;
|
|
3054
3224
|
}
|
|
3055
3225
|
|
|
3226
|
+
.plugin-detail-page .task-detail-layout {
|
|
3227
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3228
|
+
gap: 18px;
|
|
3229
|
+
max-width: none;
|
|
3230
|
+
padding-top: 8px;
|
|
3231
|
+
}
|
|
3232
|
+
|
|
3056
3233
|
.task-detail-sidebar {
|
|
3057
3234
|
margin-top: 0;
|
|
3058
3235
|
padding: 18px 0 0;
|
|
@@ -3063,6 +3240,10 @@ body.dark .plugin-option .option-icon {
|
|
|
3063
3240
|
display: none;
|
|
3064
3241
|
}
|
|
3065
3242
|
|
|
3243
|
+
.plugin-detail-page .task-detail-sidebar {
|
|
3244
|
+
padding: 18px 0 0;
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3066
3247
|
.task-shell {
|
|
3067
3248
|
width: min(100vw - 20px, 100%);
|
|
3068
3249
|
margin: 12px auto 20px;
|
|
@@ -3075,6 +3256,14 @@ body.dark .plugin-option .option-icon {
|
|
|
3075
3256
|
padding-right: 18px;
|
|
3076
3257
|
}
|
|
3077
3258
|
|
|
3259
|
+
.plugin-detail-page .task-shell-header {
|
|
3260
|
+
padding: 12px 18px 14px;
|
|
3261
|
+
}
|
|
3262
|
+
|
|
3263
|
+
.plugin-detail-page .task-shell-body {
|
|
3264
|
+
padding: 16px 18px 22px;
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3078
3267
|
.task-shell-header {
|
|
3079
3268
|
grid-template-columns: minmax(0, 1fr);
|
|
3080
3269
|
}
|
|
@@ -3125,6 +3314,21 @@ body.dark .plugin-option .option-icon {
|
|
|
3125
3314
|
.plugin-detail-action-card {
|
|
3126
3315
|
grid-template-columns: minmax(0, 1fr);
|
|
3127
3316
|
align-items: stretch;
|
|
3317
|
+
justify-items: start;
|
|
3318
|
+
}
|
|
3319
|
+
|
|
3320
|
+
.plugin-detail-action-card .task-button,
|
|
3321
|
+
.plugin-detail-action-card .task-link-button {
|
|
3322
|
+
justify-self: start;
|
|
3323
|
+
}
|
|
3324
|
+
|
|
3325
|
+
.plugin-detail-status-row {
|
|
3326
|
+
grid-template-columns: minmax(0, 1fr);
|
|
3327
|
+
gap: 3px;
|
|
3328
|
+
}
|
|
3329
|
+
|
|
3330
|
+
.plugin-detail-status-value {
|
|
3331
|
+
text-align: left;
|
|
3128
3332
|
}
|
|
3129
3333
|
|
|
3130
3334
|
.setup-layout {
|
|
@@ -4393,6 +4393,7 @@
|
|
|
4393
4393
|
const prompt = typeof options.prompt === 'string' ? options.prompt : '';
|
|
4394
4394
|
const name = typeof options.name === 'string' ? options.name.trim() : '';
|
|
4395
4395
|
const tool = typeof options.tool === 'string' ? options.tool.trim().replace(/^\/+|\/+$/g, '') : '';
|
|
4396
|
+
const mode = options.mode === 'download' ? 'download' : 'primary';
|
|
4396
4397
|
|
|
4397
4398
|
ui.error.textContent = '';
|
|
4398
4399
|
ui.promptDrafts = {
|
|
@@ -4428,7 +4429,7 @@
|
|
|
4428
4429
|
ui.intentWrap.setAttribute('aria-hidden', hasPresetIntent ? 'true' : 'false');
|
|
4429
4430
|
}
|
|
4430
4431
|
ui.setIntent(type);
|
|
4431
|
-
ui.setMode(
|
|
4432
|
+
ui.setMode(mode);
|
|
4432
4433
|
if (name) {
|
|
4433
4434
|
ui.nameInput.value = name;
|
|
4434
4435
|
scheduleNameValidation(ui);
|
package/server/socket.js
CHANGED
|
@@ -681,26 +681,62 @@ class Socket {
|
|
|
681
681
|
return false
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
+
homeRelativePath(targetPath) {
|
|
685
|
+
const home = this.parent && this.parent.kernel ? this.parent.kernel.homedir : ''
|
|
686
|
+
if (!home || !targetPath || !path.isAbsolute(targetPath)) return null
|
|
687
|
+
const relative = path.relative(path.resolve(home), path.resolve(targetPath))
|
|
688
|
+
if (relative === '..' || relative.startsWith('..' + path.sep) || path.isAbsolute(relative)) return null
|
|
689
|
+
return relative
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
validLogCwd(cwd) {
|
|
693
|
+
if (typeof cwd !== 'string') return ''
|
|
694
|
+
const trimmed = cwd.trim()
|
|
695
|
+
if (!trimmed || trimmed.toLowerCase() === 'undefined' || trimmed.toLowerCase() === 'null') return ''
|
|
696
|
+
if (this.homeRelativePath(trimmed) === null) return ''
|
|
697
|
+
return path.resolve(trimmed)
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
async appLogRootFromCwd(cwd) {
|
|
701
|
+
cwd = this.validLogCwd(cwd)
|
|
702
|
+
if (!cwd) return ''
|
|
703
|
+
const relative = this.homeRelativePath(cwd)
|
|
704
|
+
if (relative === null) return ''
|
|
705
|
+
const parts = relative.split(path.sep).filter(Boolean)
|
|
706
|
+
if (parts[0] !== "api" || !parts[1]) return ''
|
|
707
|
+
const appDir = this.parent.kernel.path("api", parts[1])
|
|
708
|
+
const root = await Environment.get_root({ path: appDir }, this.parent.kernel)
|
|
709
|
+
const appRoot = root.root
|
|
710
|
+
if (path.resolve(cwd) !== path.resolve(appDir) && path.resolve(cwd) !== path.resolve(appRoot)) return ''
|
|
711
|
+
return appRoot
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
async appLogRootFromKey(key) {
|
|
715
|
+
let m = /\?.*$/.exec(key)
|
|
716
|
+
if (!m || m.length === 0) return ''
|
|
717
|
+
let paramStr = m[0]
|
|
718
|
+
let cwd = new URL("http://localhost" + paramStr).searchParams.get("cwd")
|
|
719
|
+
return this.appLogRootFromCwd(cwd)
|
|
720
|
+
}
|
|
721
|
+
|
|
684
722
|
async resolveLogDir(key) {
|
|
685
723
|
if (path.isAbsolute(key)) {
|
|
686
724
|
let p = key.replace(/\?.*$/, '')
|
|
687
|
-
let relative =
|
|
688
|
-
if (relative
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
let root = await Environment.get_root({ path: cwd }, this.parent.kernel)
|
|
694
|
-
cwd = root.root
|
|
695
|
-
return path.resolve(cwd, "logs/dev", relative)
|
|
696
|
-
}
|
|
697
|
-
} else if (relative.startsWith("api")) {
|
|
698
|
-
let filepath_chunks = relative.split(path.sep).slice(2)
|
|
699
|
-
let cwd = this.parent.kernel.path(...relative.split(path.sep).slice(0, 2))
|
|
725
|
+
let relative = this.homeRelativePath(p)
|
|
726
|
+
if (relative === null) return null
|
|
727
|
+
let relative_parts = relative.split(path.sep).filter(Boolean)
|
|
728
|
+
if (relative_parts[0] === "api" && relative_parts[1]) {
|
|
729
|
+
let filepath_chunks = relative_parts.slice(2)
|
|
730
|
+
let cwd = this.parent.kernel.path(...relative_parts.slice(0, 2))
|
|
700
731
|
let root = await Environment.get_root({ path: cwd }, this.parent.kernel)
|
|
701
732
|
cwd = root.root
|
|
702
733
|
return path.resolve(cwd, "logs/api", ...filepath_chunks)
|
|
703
734
|
}
|
|
735
|
+
let appRoot = await this.appLogRootFromKey(key)
|
|
736
|
+
if (appRoot) {
|
|
737
|
+
return path.resolve(appRoot, "logs/dev", relative)
|
|
738
|
+
}
|
|
739
|
+
return path.resolve(this.parent.kernel.homedir, "logs", relative)
|
|
704
740
|
} else {
|
|
705
741
|
if (typeof key === 'string' && key.startsWith("shell/")) {
|
|
706
742
|
let unix_id = key.slice(6)
|
|
@@ -772,94 +808,18 @@ class Socket {
|
|
|
772
808
|
|
|
773
809
|
async log_buffer(key, buf, meta) {
|
|
774
810
|
const resolvedMeta = meta || this.logMeta[key] || { source: 'shell', method: 'shell' }
|
|
811
|
+
const logpath = await this.resolveLogDir(key)
|
|
812
|
+
if (!logpath) return
|
|
813
|
+
let session = this.sessions[key]
|
|
775
814
|
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
/Users/x/pinokio/plugin/dev/claude.json?cwd=/Users/x/pinokio/api/audioplay
|
|
780
|
-
/Users/x/pinokio/plugin/dev/gemini.json?cwd=/Users/x/pinokio/api/audioplay
|
|
781
|
-
|
|
782
|
-
api
|
|
783
|
-
/Users/x/pinokio/api/audioplay/start.json
|
|
784
|
-
|
|
785
|
-
shell
|
|
786
|
-
facefusion-pinokio.git_0.0_a56eb7d48c9e96d8a5217d625d83d204
|
|
787
|
-
facefusion-pinokio.git_0.0_a56eb7d48c9e96d8a5217d625d83d204
|
|
788
|
-
audioplay_0.0_a56eb7d48c9e96d8a5217d625d83d204
|
|
789
|
-
*/
|
|
790
|
-
|
|
791
|
-
// 1. dev
|
|
792
|
-
if (path.isAbsolute(key)) {
|
|
793
|
-
let p = key.replace(/\?.*$/, '')
|
|
794
|
-
let relative = path.relative(this.parent.kernel.homedir, p)
|
|
795
|
-
if (relative.startsWith("plugin")) {
|
|
796
|
-
// dev
|
|
797
|
-
let m = /\?.*$/.exec(key)
|
|
798
|
-
if (m && m.length > 0) {
|
|
799
|
-
/*
|
|
800
|
-
DEV Changed {
|
|
801
|
-
cwd: '/Users/x/pinokio/api/audioplay',
|
|
802
|
-
relative: 'plugin/dev/claude.json'
|
|
803
|
-
}
|
|
804
|
-
*/
|
|
805
|
-
let paramStr = m[0]
|
|
806
|
-
let cwd = new URL("http://localhost" + paramStr).searchParams.get("cwd")
|
|
807
|
-
let root = await Environment.get_root({ path: cwd }, this.parent.kernel)
|
|
808
|
-
cwd = root.root
|
|
809
|
-
let session = this.sessions[key]
|
|
810
|
-
//let logpath = path.resolve(cwd, "logs/dev", path.parse(relative).base)
|
|
811
|
-
let logpath = path.resolve(cwd, "logs/dev", relative)
|
|
812
|
-
const raw = this.rawLog[key] || ""
|
|
813
|
-
const tagged = buf ? this.tagLines(resolvedMeta, buf) : ""
|
|
814
|
-
const content = [raw, tagged].filter(Boolean).join("\n")
|
|
815
|
-
await Util.log(logpath, content, session)
|
|
816
|
-
}
|
|
817
|
-
} else if (relative.startsWith("api")) {
|
|
818
|
-
// api
|
|
819
|
-
/*
|
|
820
|
-
API Changed {
|
|
821
|
-
cwd: '/Users/x/pinokio/api/audioplay/start.json',
|
|
822
|
-
filepath: [ 'start.json' ]
|
|
823
|
-
}
|
|
824
|
-
*/
|
|
825
|
-
let filepath_chunks = relative.split(path.sep).slice(2)
|
|
826
|
-
let cwd = this.parent.kernel.path(...relative.split(path.sep).slice(0, 2))
|
|
827
|
-
let root = await Environment.get_root({ path: cwd }, this.parent.kernel)
|
|
828
|
-
cwd = root.root
|
|
829
|
-
let session = this.sessions[key]
|
|
830
|
-
let logpath = path.resolve(cwd, "logs/api", ...filepath_chunks)
|
|
831
|
-
const raw = this.rawLog[key] || ""
|
|
832
|
-
const tagged = buf ? this.tagLines(resolvedMeta, buf) : ""
|
|
833
|
-
const content = [raw, tagged].filter(Boolean).join("\n")
|
|
834
|
-
await Util.log(logpath, content, session)
|
|
835
|
-
}
|
|
815
|
+
if (typeof key === 'string' && key.startsWith("shell/")) {
|
|
816
|
+
const content = buf || ""
|
|
817
|
+
await Util.log(logpath, content, session)
|
|
836
818
|
} else {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
key: facefusion-pinokio.git_0.0_a56eb7d48c9e96d8a5217d625d83d204
|
|
842
|
-
key: audioplay_0.0_a56eb7d48c9e96d8a5217d625d83d204
|
|
843
|
-
|
|
844
|
-
key: shell:/Users/x/pinokio/api/comfy.git_0.0.0_session_6e89dd5ef73b94e728634729d08a3cf1
|
|
845
|
-
|
|
846
|
-
*/
|
|
847
|
-
|
|
848
|
-
if (key.startsWith("shell/")) {
|
|
849
|
-
let unix_id = key.slice(6)
|
|
850
|
-
let unix_path = unix_id.split("_")[0]
|
|
851
|
-
let native_path = Util.u2p(unix_path)
|
|
852
|
-
let native_path_exists = await new Promise(r=>fs.access(native_path, fs.constants.F_OK, e => r(!e)))
|
|
853
|
-
if (native_path_exists) {
|
|
854
|
-
let cwd = native_path
|
|
855
|
-
let root = await Environment.get_root({ path: cwd }, this.parent.kernel)
|
|
856
|
-
cwd = root.root
|
|
857
|
-
let session = this.sessions[key]
|
|
858
|
-
let logpath = path.resolve(cwd, "logs/shell")
|
|
859
|
-
const content = buf || ""
|
|
860
|
-
await Util.log(logpath, content, session)
|
|
861
|
-
}
|
|
862
|
-
}
|
|
819
|
+
const raw = this.rawLog[key] || ""
|
|
820
|
+
const tagged = buf ? this.tagLines(resolvedMeta, buf) : ""
|
|
821
|
+
const content = [raw, tagged].filter(Boolean).join("\n")
|
|
822
|
+
await Util.log(logpath, content, session)
|
|
863
823
|
}
|
|
864
824
|
}
|
|
865
825
|
}
|