@abraca/cli 1.6.0 → 1.8.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.
@@ -2849,40 +2849,138 @@ registerCommand({
2849
2849
  if (!raw) return `Document ${docId} not found.`;
2850
2850
  const entry = toPlain(raw);
2851
2851
  const metaKeys = new Set([
2852
- "icon",
2853
2852
  "color",
2853
+ "icon",
2854
+ "subtitle",
2855
+ "note",
2856
+ "datetimeStart",
2857
+ "datetimeEnd",
2858
+ "allDay",
2859
+ "dateStart",
2860
+ "dateEnd",
2861
+ "timeStart",
2862
+ "timeEnd",
2863
+ "dateTaken",
2864
+ "checked",
2854
2865
  "priority",
2855
2866
  "status",
2856
- "checked",
2867
+ "taskProgress",
2857
2868
  "rating",
2858
2869
  "tags",
2859
- "dateStart",
2860
- "dateEnd",
2861
- "datetimeStart",
2862
- "datetimeEnd",
2863
- "allDay",
2870
+ "members",
2864
2871
  "url",
2865
2872
  "email",
2866
2873
  "phone",
2867
2874
  "number",
2868
2875
  "unit",
2869
- "subtitle",
2870
- "note",
2871
- "taskProgress",
2872
2876
  "coverUploadId",
2877
+ "coverDocId",
2878
+ "coverMimeType",
2873
2879
  "geoType",
2874
2880
  "geoLat",
2875
2881
  "geoLng",
2882
+ "geoDescription",
2876
2883
  "deskX",
2877
2884
  "deskY",
2885
+ "deskZ",
2878
2886
  "deskMode",
2887
+ "mmX",
2888
+ "mmY",
2889
+ "graphX",
2890
+ "graphY",
2891
+ "graphPinned",
2879
2892
  "spShape",
2880
- "spColor",
2881
- "chartType",
2893
+ "spOpacity",
2894
+ "spX",
2895
+ "spY",
2896
+ "spZ",
2897
+ "spRX",
2898
+ "spRY",
2899
+ "spRZ",
2900
+ "spSX",
2901
+ "spSY",
2902
+ "spSZ",
2903
+ "spModelUploadId",
2904
+ "spModelDocId",
2905
+ "slidesTransition",
2906
+ "fileType",
2907
+ "entry",
2908
+ "bold",
2909
+ "italic",
2910
+ "textColor",
2911
+ "bgColor",
2912
+ "align",
2913
+ "formula",
2882
2914
  "kanbanColumnWidth",
2883
2915
  "galleryColumns",
2916
+ "galleryAspect",
2917
+ "galleryCardStyle",
2918
+ "galleryShowLabels",
2919
+ "gallerySortBy",
2884
2920
  "calendarView",
2885
- "tableMode"
2921
+ "calendarWeekStart",
2922
+ "calendarShowWeekNumbers",
2923
+ "tableMode",
2924
+ "tableSortKey",
2925
+ "tableSortDir",
2926
+ "timelineZoom",
2927
+ "timelinePixelsPerDay",
2928
+ "timelineCenterDate",
2929
+ "checklistFilter",
2930
+ "checklistSort",
2931
+ "mapShowLabels",
2932
+ "graphSpacing",
2933
+ "graphShowLabels",
2934
+ "graphEdgeThickness",
2935
+ "showRefEdges",
2936
+ "mmSpacing",
2937
+ "spatialGridVisible",
2938
+ "slidesTheme",
2939
+ "chartType",
2940
+ "chartMetric",
2941
+ "chartColorScheme",
2942
+ "chartLimit",
2943
+ "chartShowLegend",
2944
+ "chartShowValues",
2945
+ "sheetsDefaultColWidth",
2946
+ "sheetsDefaultRowHeight",
2947
+ "sheetsShowGridlines",
2948
+ "sheetsFreezeRows",
2949
+ "sheetsFreezeCols",
2950
+ "mediaRepeat",
2951
+ "mediaShuffle"
2952
+ ]);
2953
+ const numericKeys = new Set([
2954
+ "priority",
2955
+ "rating",
2956
+ "number",
2957
+ "taskProgress",
2958
+ "geoLat",
2959
+ "geoLng",
2960
+ "deskX",
2961
+ "deskY",
2962
+ "deskZ",
2963
+ "mmX",
2964
+ "mmY",
2965
+ "graphX",
2966
+ "graphY",
2967
+ "spOpacity",
2968
+ "spX",
2969
+ "spY",
2970
+ "spZ",
2971
+ "spRX",
2972
+ "spRY",
2973
+ "spRZ",
2974
+ "spSX",
2975
+ "spSY",
2976
+ "spSZ",
2977
+ "galleryColumns",
2978
+ "chartLimit",
2979
+ "timelinePixelsPerDay",
2980
+ "sheetsDefaultColWidth",
2981
+ "sheetsDefaultRowHeight",
2982
+ "sheetsFreezeRows",
2983
+ "sheetsFreezeCols"
2886
2984
  ]);
2887
2985
  const updates = {};
2888
2986
  let hasUpdates = false;
@@ -2890,17 +2988,7 @@ registerCommand({
2890
2988
  if (value === "null") updates[key] = null;
2891
2989
  else if (value === "true") updates[key] = true;
2892
2990
  else if (value === "false") updates[key] = false;
2893
- else if ([
2894
- "priority",
2895
- "rating",
2896
- "number",
2897
- "taskProgress",
2898
- "geoLat",
2899
- "geoLng",
2900
- "deskX",
2901
- "deskY",
2902
- "galleryColumns"
2903
- ].includes(key)) updates[key] = parseFloat(value);
2991
+ else if (numericKeys.has(key)) updates[key] = parseFloat(value);
2904
2992
  else if (key === "tags") updates[key] = value.split(",").map((s) => s.trim());
2905
2993
  else updates[key] = value;
2906
2994
  hasUpdates = true;
@@ -3210,6 +3298,801 @@ registerCommand({
3210
3298
  }
3211
3299
  });
3212
3300
 
3301
+ //#endregion
3302
+ //#region packages/mcp/src/converters/page-types.ts
3303
+ const PAGE_TYPES = {
3304
+ doc: {
3305
+ key: "doc",
3306
+ label: "Document",
3307
+ icon: "file-text",
3308
+ description: "Rich text document with real-time collaboration",
3309
+ core: true,
3310
+ supportsChildren: true
3311
+ },
3312
+ kanban: {
3313
+ key: "kanban",
3314
+ label: "Kanban",
3315
+ icon: "kanban",
3316
+ description: "Drag-and-drop task board with columns and cards",
3317
+ core: true,
3318
+ supportsChildren: true,
3319
+ childLabel: "Column",
3320
+ grandchildLabel: "Card",
3321
+ defaultMetaFields: [{
3322
+ type: "select",
3323
+ key: "kanbanColumnWidth",
3324
+ options: [
3325
+ "narrow",
3326
+ "default",
3327
+ "wide"
3328
+ ],
3329
+ label: "Column Width"
3330
+ }]
3331
+ },
3332
+ gallery: {
3333
+ key: "gallery",
3334
+ label: "Gallery",
3335
+ icon: "images",
3336
+ description: "Visual grid of items with rich content",
3337
+ core: true,
3338
+ supportsChildren: true,
3339
+ childLabel: "Item",
3340
+ metaSchema: [
3341
+ {
3342
+ type: "location",
3343
+ latKey: "geoLat",
3344
+ lngKey: "geoLng",
3345
+ label: "Location"
3346
+ },
3347
+ {
3348
+ type: "datetime",
3349
+ key: "datetimeStart",
3350
+ label: "Date"
3351
+ },
3352
+ {
3353
+ type: "tags",
3354
+ key: "tags",
3355
+ label: "Tags"
3356
+ },
3357
+ {
3358
+ type: "rating",
3359
+ key: "rating",
3360
+ max: 5,
3361
+ label: "Rating"
3362
+ },
3363
+ {
3364
+ type: "icon",
3365
+ key: "icon",
3366
+ label: "Icon"
3367
+ },
3368
+ {
3369
+ type: "colorPreset",
3370
+ key: "color",
3371
+ presets: [
3372
+ "#6366f1",
3373
+ "#ec4899",
3374
+ "#f97316",
3375
+ "#22c55e",
3376
+ "#3b82f6",
3377
+ "#a855f7"
3378
+ ],
3379
+ label: "Color"
3380
+ }
3381
+ ],
3382
+ defaultMetaFields: [
3383
+ {
3384
+ type: "number",
3385
+ key: "galleryColumns",
3386
+ min: 1,
3387
+ max: 6,
3388
+ step: 1,
3389
+ label: "Columns"
3390
+ },
3391
+ {
3392
+ type: "select",
3393
+ key: "galleryAspect",
3394
+ options: [
3395
+ "square",
3396
+ "4:3",
3397
+ "3:2",
3398
+ "16:9",
3399
+ "free"
3400
+ ],
3401
+ label: "Aspect Ratio"
3402
+ },
3403
+ {
3404
+ type: "select",
3405
+ key: "galleryCardStyle",
3406
+ options: [
3407
+ "default",
3408
+ "compact",
3409
+ "detailed"
3410
+ ],
3411
+ label: "Card Style"
3412
+ },
3413
+ {
3414
+ type: "toggle",
3415
+ key: "galleryShowLabels",
3416
+ label: "Show Labels"
3417
+ },
3418
+ {
3419
+ type: "select",
3420
+ key: "gallerySortBy",
3421
+ options: [
3422
+ "manual",
3423
+ "date",
3424
+ "name",
3425
+ "rating"
3426
+ ],
3427
+ label: "Sort"
3428
+ }
3429
+ ]
3430
+ },
3431
+ table: {
3432
+ key: "table",
3433
+ label: "Table",
3434
+ icon: "table",
3435
+ description: "Collaborative spreadsheet with custom fields",
3436
+ core: true,
3437
+ supportsChildren: true,
3438
+ childLabel: "Column",
3439
+ grandchildLabel: "Row",
3440
+ defaultMetaFields: [{
3441
+ type: "select",
3442
+ key: "tableMode",
3443
+ options: ["hierarchy", "flat"],
3444
+ label: "Mode"
3445
+ }, {
3446
+ type: "select",
3447
+ key: "tableSortDir",
3448
+ options: ["asc", "desc"],
3449
+ label: "Sort Direction"
3450
+ }]
3451
+ },
3452
+ outline: {
3453
+ key: "outline",
3454
+ label: "Outline",
3455
+ icon: "list-tree",
3456
+ description: "Hierarchical outline with keyboard navigation",
3457
+ core: true,
3458
+ supportsChildren: true,
3459
+ childLabel: "Item",
3460
+ defaultDepth: -1
3461
+ },
3462
+ checklist: {
3463
+ key: "checklist",
3464
+ label: "Checklist",
3465
+ icon: "check-square",
3466
+ description: "Collaborative checklist with sub-tasks, drag-and-drop, and due dates",
3467
+ core: true,
3468
+ supportsChildren: true,
3469
+ childLabel: "Task",
3470
+ defaultDepth: -1,
3471
+ metaSchema: [
3472
+ {
3473
+ type: "toggle",
3474
+ key: "checked",
3475
+ label: "Done"
3476
+ },
3477
+ {
3478
+ type: "select",
3479
+ key: "priority",
3480
+ options: [
3481
+ "none",
3482
+ "low",
3483
+ "medium",
3484
+ "high"
3485
+ ],
3486
+ label: "Priority"
3487
+ },
3488
+ {
3489
+ type: "date",
3490
+ key: "dateEnd",
3491
+ label: "Due date"
3492
+ }
3493
+ ],
3494
+ defaultMetaFields: [{
3495
+ type: "select",
3496
+ key: "checklistFilter",
3497
+ options: [
3498
+ "all",
3499
+ "active",
3500
+ "completed"
3501
+ ],
3502
+ label: "Filter"
3503
+ }, {
3504
+ type: "select",
3505
+ key: "checklistSort",
3506
+ options: [
3507
+ "manual",
3508
+ "priority",
3509
+ "due"
3510
+ ],
3511
+ label: "Sort"
3512
+ }]
3513
+ },
3514
+ graph: {
3515
+ key: "graph",
3516
+ label: "Graph",
3517
+ icon: "git-fork",
3518
+ description: "Force-directed knowledge graph — full document tree as nodes & edges",
3519
+ core: true,
3520
+ supportsChildren: true,
3521
+ childLabel: "Node",
3522
+ defaultMetaFields: [{
3523
+ type: "toggle",
3524
+ key: "showRefEdges",
3525
+ label: "Show Ref Edges",
3526
+ default: true
3527
+ }]
3528
+ },
3529
+ timeline: {
3530
+ key: "timeline",
3531
+ label: "Timeline",
3532
+ icon: "gantt-chart",
3533
+ description: "Gantt-style project timeline with epics and tasks",
3534
+ core: true,
3535
+ supportsChildren: true,
3536
+ childLabel: "Epic",
3537
+ grandchildLabel: "Task",
3538
+ metaSchema: [
3539
+ {
3540
+ type: "daterange",
3541
+ startKey: "dateStart",
3542
+ endKey: "dateEnd"
3543
+ },
3544
+ {
3545
+ type: "slider",
3546
+ key: "taskProgress",
3547
+ min: 0,
3548
+ max: 100,
3549
+ label: "Progress"
3550
+ },
3551
+ {
3552
+ type: "colorPreset",
3553
+ key: "color",
3554
+ presets: [
3555
+ "#6366f1",
3556
+ "#818cf8",
3557
+ "#f97316",
3558
+ "#22c55e",
3559
+ "#3b82f6",
3560
+ "#a855f7"
3561
+ ],
3562
+ label: "Color"
3563
+ }
3564
+ ]
3565
+ },
3566
+ calendar: {
3567
+ key: "calendar",
3568
+ label: "Calendar",
3569
+ icon: "calendar",
3570
+ description: "Event calendar with month, week, and day views",
3571
+ core: true,
3572
+ supportsChildren: true,
3573
+ childLabel: "Event",
3574
+ metaSchema: [
3575
+ {
3576
+ type: "datetimerange",
3577
+ startKey: "datetimeStart",
3578
+ endKey: "datetimeEnd",
3579
+ allDayKey: "allDay"
3580
+ },
3581
+ {
3582
+ type: "colorPreset",
3583
+ key: "color",
3584
+ presets: [
3585
+ "#6366f1",
3586
+ "#ec4899",
3587
+ "#f97316",
3588
+ "#22c55e",
3589
+ "#3b82f6",
3590
+ "#a855f7"
3591
+ ],
3592
+ label: "Color"
3593
+ },
3594
+ {
3595
+ type: "icon",
3596
+ key: "icon",
3597
+ label: "Icon"
3598
+ }
3599
+ ],
3600
+ defaultMetaFields: [
3601
+ {
3602
+ type: "select",
3603
+ key: "calendarWeekStart",
3604
+ options: ["sun", "mon"],
3605
+ label: "Week Starts"
3606
+ },
3607
+ {
3608
+ type: "select",
3609
+ key: "calendarView",
3610
+ options: [
3611
+ "month",
3612
+ "week",
3613
+ "day"
3614
+ ],
3615
+ label: "Default View"
3616
+ },
3617
+ {
3618
+ type: "toggle",
3619
+ key: "calendarShowWeekNumbers",
3620
+ label: "Show Week Numbers"
3621
+ }
3622
+ ]
3623
+ },
3624
+ map: {
3625
+ key: "map",
3626
+ label: "Map",
3627
+ icon: "map",
3628
+ description: "Collaborative world map with shared markers",
3629
+ core: true,
3630
+ supportsChildren: true,
3631
+ childLabel: "Location",
3632
+ defaultMetaFields: [{
3633
+ type: "toggle",
3634
+ key: "mapShowLabels",
3635
+ label: "Show Labels",
3636
+ default: true
3637
+ }]
3638
+ },
3639
+ dashboard: {
3640
+ key: "dashboard",
3641
+ label: "Dashboard",
3642
+ icon: "layout-dashboard",
3643
+ description: "Arrange documents as draggable icons with optional widget views",
3644
+ core: true,
3645
+ supportsChildren: true,
3646
+ childLabel: "Item"
3647
+ },
3648
+ call: {
3649
+ key: "call",
3650
+ label: "Call",
3651
+ icon: "phone",
3652
+ description: "Video call room with live audio and screen sharing",
3653
+ core: true,
3654
+ supportsChildren: false
3655
+ },
3656
+ chart: {
3657
+ key: "chart",
3658
+ label: "Chart",
3659
+ icon: "bar-chart-3",
3660
+ description: "Charts — manual data points or aggregation over document trees",
3661
+ core: true,
3662
+ supportsChildren: true,
3663
+ childLabel: "Data Point",
3664
+ grandchildLabel: "Data Point",
3665
+ metaSchema: [
3666
+ {
3667
+ type: "number",
3668
+ key: "number",
3669
+ step: .01,
3670
+ label: "Value"
3671
+ },
3672
+ {
3673
+ type: "colorPreset",
3674
+ key: "color",
3675
+ presets: [
3676
+ "#6366f1",
3677
+ "#ec4899",
3678
+ "#f97316",
3679
+ "#22c55e",
3680
+ "#3b82f6",
3681
+ "#a855f7",
3682
+ "#14b8a6",
3683
+ "#eab308"
3684
+ ],
3685
+ label: "Color"
3686
+ },
3687
+ {
3688
+ type: "tags",
3689
+ key: "tags",
3690
+ label: "Tags"
3691
+ }
3692
+ ],
3693
+ defaultMetaFields: [
3694
+ {
3695
+ type: "select",
3696
+ key: "chartType",
3697
+ options: [
3698
+ "bar",
3699
+ "stacked bar",
3700
+ "line",
3701
+ "donut",
3702
+ "treemap"
3703
+ ],
3704
+ label: "Chart Type"
3705
+ },
3706
+ {
3707
+ type: "select",
3708
+ key: "chartMetric",
3709
+ options: [
3710
+ "value",
3711
+ "type",
3712
+ "tag",
3713
+ "status",
3714
+ "priority",
3715
+ "activity",
3716
+ "completion"
3717
+ ],
3718
+ label: "Metric"
3719
+ },
3720
+ {
3721
+ type: "select",
3722
+ key: "chartColorScheme",
3723
+ options: [
3724
+ "default",
3725
+ "warm",
3726
+ "cool",
3727
+ "mono"
3728
+ ],
3729
+ label: "Colors"
3730
+ },
3731
+ {
3732
+ type: "number",
3733
+ key: "chartLimit",
3734
+ min: 3,
3735
+ max: 30,
3736
+ step: 1,
3737
+ label: "Max Items"
3738
+ },
3739
+ {
3740
+ type: "toggle",
3741
+ key: "chartShowLegend",
3742
+ label: "Show Legend",
3743
+ default: true
3744
+ },
3745
+ {
3746
+ type: "toggle",
3747
+ key: "chartShowValues",
3748
+ label: "Show Values"
3749
+ }
3750
+ ]
3751
+ },
3752
+ sheets: {
3753
+ key: "sheets",
3754
+ label: "Sheets",
3755
+ icon: "grid-3x3",
3756
+ description: "Spreadsheet — cells, formulas, and formatting in a collaborative grid",
3757
+ core: true,
3758
+ supportsChildren: true,
3759
+ childLabel: "Column",
3760
+ grandchildLabel: "Cell",
3761
+ defaultMetaFields: [
3762
+ {
3763
+ type: "number",
3764
+ key: "sheetsDefaultColWidth",
3765
+ min: 40,
3766
+ max: 500,
3767
+ step: 10,
3768
+ label: "Column Width"
3769
+ },
3770
+ {
3771
+ type: "number",
3772
+ key: "sheetsDefaultRowHeight",
3773
+ min: 20,
3774
+ max: 100,
3775
+ step: 2,
3776
+ label: "Row Height"
3777
+ },
3778
+ {
3779
+ type: "toggle",
3780
+ key: "sheetsShowGridlines",
3781
+ label: "Gridlines"
3782
+ }
3783
+ ]
3784
+ },
3785
+ slides: {
3786
+ key: "slides",
3787
+ label: "Slides",
3788
+ icon: "presentation",
3789
+ description: "Presentation slides with two-axis navigation",
3790
+ core: true,
3791
+ supportsChildren: true,
3792
+ childLabel: "Slide",
3793
+ grandchildLabel: "Sub-slide",
3794
+ metaSchema: [{
3795
+ type: "select",
3796
+ key: "slidesTransition",
3797
+ options: [
3798
+ "none",
3799
+ "fade",
3800
+ "slide"
3801
+ ],
3802
+ label: "Transition"
3803
+ }, {
3804
+ type: "colorPreset",
3805
+ key: "color",
3806
+ presets: [
3807
+ "#6366f1",
3808
+ "#ec4899",
3809
+ "#f97316",
3810
+ "#22c55e",
3811
+ "#3b82f6",
3812
+ "#a855f7"
3813
+ ],
3814
+ label: "Accent"
3815
+ }],
3816
+ defaultMetaFields: [{
3817
+ type: "select",
3818
+ key: "slidesTheme",
3819
+ options: ["dark", "light"],
3820
+ label: "Theme"
3821
+ }]
3822
+ },
3823
+ overview: {
3824
+ key: "overview",
3825
+ label: "Overview",
3826
+ icon: "radar",
3827
+ description: "Space home — activity, people, stats, and health at a glance",
3828
+ core: true,
3829
+ supportsChildren: true,
3830
+ childLabel: "Page"
3831
+ },
3832
+ spatial: {
3833
+ key: "spatial",
3834
+ label: "Spatial",
3835
+ icon: "box",
3836
+ description: "3D scene with collaborative objects and real-time presence",
3837
+ core: false,
3838
+ plugin: "spatial",
3839
+ supportsChildren: true,
3840
+ childLabel: "Object",
3841
+ grandchildLabel: "Part",
3842
+ defaultDepth: -1,
3843
+ metaSchema: [
3844
+ {
3845
+ type: "select",
3846
+ key: "spShape",
3847
+ options: [
3848
+ "box",
3849
+ "sphere",
3850
+ "cylinder",
3851
+ "cone",
3852
+ "plane",
3853
+ "torus",
3854
+ "glb"
3855
+ ],
3856
+ label: "Shape"
3857
+ },
3858
+ {
3859
+ type: "colorPreset",
3860
+ key: "color",
3861
+ presets: [
3862
+ "#6366f1",
3863
+ "#ef4444",
3864
+ "#22c55e",
3865
+ "#3b82f6",
3866
+ "#f97316",
3867
+ "#a855f7",
3868
+ "#ec4899",
3869
+ "#14b8a6"
3870
+ ],
3871
+ label: "Color"
3872
+ },
3873
+ {
3874
+ type: "slider",
3875
+ key: "spOpacity",
3876
+ min: 0,
3877
+ max: 100,
3878
+ label: "Opacity"
3879
+ },
3880
+ {
3881
+ type: "number",
3882
+ key: "spX",
3883
+ step: .1,
3884
+ label: "X"
3885
+ },
3886
+ {
3887
+ type: "number",
3888
+ key: "spY",
3889
+ step: .1,
3890
+ label: "Y"
3891
+ },
3892
+ {
3893
+ type: "number",
3894
+ key: "spZ",
3895
+ step: .1,
3896
+ label: "Z"
3897
+ },
3898
+ {
3899
+ type: "number",
3900
+ key: "spRX",
3901
+ min: -180,
3902
+ max: 180,
3903
+ step: 1,
3904
+ label: "Rot X"
3905
+ },
3906
+ {
3907
+ type: "number",
3908
+ key: "spRY",
3909
+ min: -180,
3910
+ max: 180,
3911
+ step: 1,
3912
+ label: "Rot Y"
3913
+ },
3914
+ {
3915
+ type: "number",
3916
+ key: "spRZ",
3917
+ min: -180,
3918
+ max: 180,
3919
+ step: 1,
3920
+ label: "Rot Z"
3921
+ },
3922
+ {
3923
+ type: "number",
3924
+ key: "spSX",
3925
+ min: .01,
3926
+ max: 100,
3927
+ step: .1,
3928
+ label: "Scale X"
3929
+ },
3930
+ {
3931
+ type: "number",
3932
+ key: "spSY",
3933
+ min: .01,
3934
+ max: 100,
3935
+ step: .1,
3936
+ label: "Scale Y"
3937
+ },
3938
+ {
3939
+ type: "number",
3940
+ key: "spSZ",
3941
+ min: .01,
3942
+ max: 100,
3943
+ step: .1,
3944
+ label: "Scale Z"
3945
+ }
3946
+ ],
3947
+ defaultMetaFields: [{
3948
+ type: "toggle",
3949
+ key: "spatialGridVisible",
3950
+ label: "Show Grid",
3951
+ default: true
3952
+ }]
3953
+ },
3954
+ media: {
3955
+ key: "media",
3956
+ label: "Media",
3957
+ icon: "disc-3",
3958
+ description: "Media player with synced listening and playlists",
3959
+ core: false,
3960
+ plugin: "media",
3961
+ supportsChildren: true,
3962
+ childLabel: "Track",
3963
+ defaultDepth: -1,
3964
+ metaSchema: [{
3965
+ type: "tags",
3966
+ key: "tags",
3967
+ label: "Tags"
3968
+ }],
3969
+ defaultMetaFields: [{
3970
+ type: "select",
3971
+ key: "mediaRepeat",
3972
+ options: [
3973
+ "off",
3974
+ "all",
3975
+ "one"
3976
+ ],
3977
+ label: "Repeat"
3978
+ }, {
3979
+ type: "toggle",
3980
+ key: "mediaShuffle",
3981
+ label: "Shuffle"
3982
+ }]
3983
+ },
3984
+ coder: {
3985
+ key: "coder",
3986
+ label: "Coder",
3987
+ icon: "code-2",
3988
+ description: "Collaborative multi-file coding environment",
3989
+ core: false,
3990
+ plugin: "coder",
3991
+ supportsChildren: true,
3992
+ childLabel: "File",
3993
+ defaultDepth: -1,
3994
+ metaSchema: [{
3995
+ type: "select",
3996
+ key: "fileType",
3997
+ options: [
3998
+ "vue",
3999
+ "ts",
4000
+ "js",
4001
+ "css",
4002
+ "json",
4003
+ "folder"
4004
+ ],
4005
+ label: "Type"
4006
+ }, {
4007
+ type: "toggle",
4008
+ key: "entry",
4009
+ label: "Entry Point"
4010
+ }]
4011
+ }
4012
+ };
4013
+ const TYPE_ALIASES = { desktop: "dashboard" };
4014
+ function resolvePageType(key) {
4015
+ if (!key) return void 0;
4016
+ return PAGE_TYPES[TYPE_ALIASES[key] ?? key];
4017
+ }
4018
+
4019
+ //#endregion
4020
+ //#region packages/cli/src/commands/page-types.ts
4021
+ /**
4022
+ * page-types / type-info commands: enumerate Abracadabra page types and their
4023
+ * metadata schemas. Works without a server connection — the catalog is static.
4024
+ */
4025
+ function describeField(f) {
4026
+ const bits = [];
4027
+ bits.push(f.type);
4028
+ if (f.key) bits.push(`key=${f.key}`);
4029
+ if (f.latKey) bits.push(`latKey=${f.latKey},lngKey=${f.lngKey}`);
4030
+ if (f.startKey) bits.push(`startKey=${f.startKey},endKey=${f.endKey}${f.allDayKey ? `,allDayKey=${f.allDayKey}` : ""}`);
4031
+ if (f.options) bits.push(`options=[${f.options.join(", ")}]`);
4032
+ if (f.presets) bits.push(`presets=${f.presets.length}`);
4033
+ if (typeof f.min === "number" || typeof f.max === "number") bits.push(`range=${f.min ?? "?"}..${f.max ?? "?"}`);
4034
+ if (f.step) bits.push(`step=${f.step}`);
4035
+ if (f.unit) bits.push(`unit=${f.unit}`);
4036
+ if (f.default !== void 0) bits.push(`default=${f.default}`);
4037
+ return bits.join(" ");
4038
+ }
4039
+ registerCommand({
4040
+ name: "page-types",
4041
+ aliases: ["types", "doctypes"],
4042
+ description: "List Abracadabra page types and their metadata schemas.",
4043
+ usage: "page-types [key=<type>] [--format=json]",
4044
+ async run(_conn, args) {
4045
+ const key = args.params["key"] || args.params["type"] || args.positional[0];
4046
+ const asJson = args.flags.has("json") || args.params["format"] === "json";
4047
+ if (key) {
4048
+ const info = resolvePageType(key);
4049
+ if (!info) return `Unknown page type "${key}". Run 'abracadabra page-types' to list all.`;
4050
+ if (asJson) return printJson(info);
4051
+ const lines = [
4052
+ `${info.label} (${info.key})${info.core ? "" : ` [plugin: ${info.plugin}]`}`,
4053
+ info.description ? ` ${info.description}` : "",
4054
+ ` icon: ${info.icon}`,
4055
+ ` supportsChildren: ${info.supportsChildren}`
4056
+ ];
4057
+ if (info.childLabel) lines.push(` childLabel: ${info.childLabel}`);
4058
+ if (info.grandchildLabel) lines.push(` grandchildLabel: ${info.grandchildLabel}`);
4059
+ if (info.defaultDepth !== void 0) lines.push(` defaultDepth: ${info.defaultDepth === -1 ? "unlimited" : info.defaultDepth}`);
4060
+ if (info.metaSchema?.length) {
4061
+ lines.push("", ` metaSchema (applies to descendants):`);
4062
+ for (const f of info.metaSchema) lines.push(` - ${describeField(f)}${f.label ? ` "${f.label}"` : ""}`);
4063
+ }
4064
+ if (info.defaultMetaFields?.length) {
4065
+ lines.push("", ` defaultMetaFields (renderer config on this doc):`);
4066
+ for (const f of info.defaultMetaFields) lines.push(` - ${describeField(f)}${f.label ? ` "${f.label}"` : ""}`);
4067
+ }
4068
+ return lines.filter(Boolean).join("\n");
4069
+ }
4070
+ const types = Object.values(PAGE_TYPES);
4071
+ if (asJson) return printJson({
4072
+ types,
4073
+ aliases: TYPE_ALIASES
4074
+ });
4075
+ const coreTypes = types.filter((t) => t.core);
4076
+ const pluginTypes = types.filter((t) => !t.core);
4077
+ const lines = ["Core page types:"];
4078
+ for (const t of coreTypes) {
4079
+ const depth = t.defaultDepth === -1 ? "∞" : t.grandchildLabel ? "2" : t.supportsChildren ? "1" : "0";
4080
+ const nesting = [t.childLabel, t.grandchildLabel].filter(Boolean).join(" → ");
4081
+ lines.push(` ${t.key.padEnd(12)}${(nesting || "—").padEnd(28)}depth=${depth}`);
4082
+ }
4083
+ lines.push("", "Plugin page types (require plugin):");
4084
+ for (const t of pluginTypes) {
4085
+ const depth = t.defaultDepth === -1 ? "∞" : t.grandchildLabel ? "2" : t.supportsChildren ? "1" : "0";
4086
+ const nesting = [t.childLabel, t.grandchildLabel].filter(Boolean).join(" → ");
4087
+ lines.push(` ${t.key.padEnd(12)}${(nesting || "—").padEnd(28)}depth=${depth} [plugin: ${t.plugin}]`);
4088
+ }
4089
+ lines.push("", "Aliases:");
4090
+ for (const [from, to] of Object.entries(TYPE_ALIASES)) lines.push(` ${from} → ${to}`);
4091
+ lines.push("", `Run 'abracadabra page-types <key>' for field-level detail.`);
4092
+ return lines.join("\n");
4093
+ }
4094
+ });
4095
+
3213
4096
  //#endregion
3214
4097
  //#region packages/cli/src/index.ts
3215
4098
  /**
@@ -3230,7 +4113,10 @@ const NO_CONNECT_COMMANDS = new Set([
3230
4113
  "h",
3231
4114
  "?",
3232
4115
  "version",
3233
- "v"
4116
+ "v",
4117
+ "page-types",
4118
+ "types",
4119
+ "doctypes"
3234
4120
  ]);
3235
4121
  async function main() {
3236
4122
  const args = parseArgs(process.argv);