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