@classic-homes/theme-mcp 0.5.7 → 0.5.9

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.
@@ -6,8 +6,54 @@ import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
6
6
 
7
7
  // src/data/component-catalog.json
8
8
  var component_catalog_default = {
9
- version: "0.5.7",
9
+ version: "0.5.9",
10
10
  components: [
11
+ {
12
+ name: "AccessInspector",
13
+ description: "Admin-only overlay that shows which role or permission gates UI and data, lists denials including API 403s, and previews the page as another role",
14
+ category: "core",
15
+ importPath: "@classic-homes/access-inspector-svelte",
16
+ props: [
17
+ {
18
+ name: "config",
19
+ type: "AccessInspectorConfig",
20
+ default: "{}",
21
+ required: false,
22
+ description: "Who may use it and how it opens (see below)"
23
+ }
24
+ ],
25
+ variants: [],
26
+ slots: [
27
+ {
28
+ name: "children",
29
+ description: "Main content",
30
+ required: false
31
+ }
32
+ ],
33
+ events: [],
34
+ examples: [
35
+ {
36
+ title: "RequireAccess (gate and mark)",
37
+ code: `<script>
38
+ import { RequireAccess } from '@classic-homes/access-inspector-svelte';
39
+ </script>
40
+
41
+ <RequireAccess permissions={['reports:read']} label="Reports">
42
+ <ReportsCard />
43
+ {#snippet fallback()}
44
+ <p>Ask your manager for report access.</p>
45
+ {/snippet}
46
+ </RequireAccess>`
47
+ },
48
+ {
49
+ title: "use:requires (mark only)",
50
+ code: "<button use:requires={{ permissions: ['homes:update'], label: 'Edit' }}>Edit</button>"
51
+ }
52
+ ],
53
+ relatedComponents: [
54
+ "FeedbackWidget"
55
+ ]
56
+ },
11
57
  {
12
58
  name: "ActionHeader",
13
59
  description: "Responsive app page header with back link, badges and actions that fold into an overflow menu instead of wrapping",
@@ -5539,6 +5585,33 @@ var component_catalog_default = {
5539
5585
  required: false,
5540
5586
  description: "Collapsed sidebar width (px)"
5541
5587
  },
5588
+ {
5589
+ name: "sidebarResizable",
5590
+ type: "boolean",
5591
+ default: "true",
5592
+ required: false,
5593
+ description: "Drag the sidebar edge to resize it (desktop)"
5594
+ },
5595
+ {
5596
+ name: "sidebarMinWidth",
5597
+ type: "number",
5598
+ default: "200",
5599
+ required: false,
5600
+ description: "Narrowest dragged sidebar width (px); dragging well past it collapses"
5601
+ },
5602
+ {
5603
+ name: "sidebarMaxWidth",
5604
+ type: "number",
5605
+ default: "480",
5606
+ required: false,
5607
+ description: "Widest dragged sidebar width (px)"
5608
+ },
5609
+ {
5610
+ name: "onSidebarResize",
5611
+ type: "(width: number) => void",
5612
+ required: false,
5613
+ description: "Called with the sidebar width when a resize finishes"
5614
+ },
5542
5615
  {
5543
5616
  name: "searchable",
5544
5617
  type: "boolean",
@@ -9376,6 +9449,831 @@ var component_catalog_default = {
9376
9449
  "FileUpload"
9377
9450
  ]
9378
9451
  },
9452
+ {
9453
+ name: "FileBreadcrumbs",
9454
+ description: "Path bar from the drive root to the current folder; each crumb navigates",
9455
+ category: "data",
9456
+ importPath: "@classic-homes/files-svelte",
9457
+ props: [
9458
+ {
9459
+ name: "rootLabel",
9460
+ type: "string",
9461
+ required: true,
9462
+ description: "Label of the root crumb"
9463
+ },
9464
+ {
9465
+ name: "path",
9466
+ type: "string",
9467
+ required: true,
9468
+ description: "Current folder, root-relative"
9469
+ },
9470
+ {
9471
+ name: "onnavigate",
9472
+ type: "(path: string) => void",
9473
+ required: false,
9474
+ description: "Called with the crumb's path (`''` for the root)"
9475
+ },
9476
+ {
9477
+ name: "maxItems",
9478
+ type: "number",
9479
+ default: "4",
9480
+ required: false,
9481
+ description: 'Crumbs to show before the middle collapses into "\u2026"'
9482
+ },
9483
+ {
9484
+ name: "label",
9485
+ type: "string",
9486
+ default: "'Folder path'",
9487
+ required: false,
9488
+ description: "Accessible name of the nav landmark"
9489
+ },
9490
+ {
9491
+ name: "class",
9492
+ type: "string",
9493
+ required: false,
9494
+ description: "Classes for the nav element"
9495
+ }
9496
+ ],
9497
+ variants: [],
9498
+ slots: [],
9499
+ events: [],
9500
+ examples: [
9501
+ {
9502
+ title: "Basic Usage",
9503
+ code: `<script lang="ts">
9504
+ import { FileBreadcrumbs } from '@classic-homes/files-svelte';
9505
+
9506
+ let path = $state('105 BREWERY/Plans');
9507
+ </script>
9508
+
9509
+ <FileBreadcrumbs rootLabel="Land Development" {path} onnavigate={(p) => (path = p)} />`
9510
+ }
9511
+ ],
9512
+ relatedComponents: [
9513
+ "FileBrowser"
9514
+ ]
9515
+ },
9516
+ {
9517
+ name: "FileBrowser",
9518
+ description: "Browse, preview and download files on the company network drives, from CHAPI or any FilesSource",
9519
+ category: "data",
9520
+ importPath: "@classic-homes/files-svelte",
9521
+ props: [
9522
+ {
9523
+ name: "source",
9524
+ type: "FilesSource",
9525
+ required: true,
9526
+ description: "Where the data comes from (CHAPI adapter, in-memory source, or your own)"
9527
+ },
9528
+ {
9529
+ name: "rootId",
9530
+ type: "string",
9531
+ required: false,
9532
+ description: "Current root (bindable). Defaults to the first root the caller can read"
9533
+ },
9534
+ {
9535
+ name: "path",
9536
+ type: "string",
9537
+ default: "''",
9538
+ required: false,
9539
+ description: "Current folder, root-relative (bindable). `''` is the root"
9540
+ },
9541
+ {
9542
+ name: "onrootchange",
9543
+ type: "(rootId: string) => void",
9544
+ required: false,
9545
+ description: "The user picked another root"
9546
+ },
9547
+ {
9548
+ name: "onpathchange",
9549
+ type: "(path: string) => void",
9550
+ required: false,
9551
+ description: "The user opened another folder"
9552
+ },
9553
+ {
9554
+ name: "onnavigate",
9555
+ type: "(location: { rootId: string; path: string }) => void",
9556
+ required: false,
9557
+ description: "The drive and/or folder changed, in one call. Use it for URL sync"
9558
+ },
9559
+ {
9560
+ name: "viewers",
9561
+ type: "ViewerRegistry",
9562
+ default: "{}",
9563
+ required: false,
9564
+ description: "Document viewers for previews, as lazy imports keyed by format"
9565
+ },
9566
+ {
9567
+ name: "pageSize",
9568
+ type: "number",
9569
+ default: "200",
9570
+ required: false,
9571
+ description: "Entries per page"
9572
+ },
9573
+ {
9574
+ name: "autoLoad",
9575
+ type: "boolean",
9576
+ default: "false",
9577
+ required: false,
9578
+ description: "Load the next page when the end of the list scrolls into view"
9579
+ },
9580
+ {
9581
+ name: "showHidden",
9582
+ type: "boolean",
9583
+ default: "false",
9584
+ required: false,
9585
+ description: '"Show hidden files" (bindable); sent as `includeHidden`'
9586
+ },
9587
+ {
9588
+ name: "filter",
9589
+ type: "string",
9590
+ default: "''",
9591
+ required: false,
9592
+ description: "Filter text (bindable). Narrows the loaded entries, or searches when the source has `search()`"
9593
+ },
9594
+ {
9595
+ name: "maxPreviewBytes",
9596
+ type: "number",
9597
+ default: "104857600",
9598
+ required: false,
9599
+ description: "Larger files are not fetched for preview (100 MB, the viewers' cap)"
9600
+ },
9601
+ {
9602
+ name: "onunauthorized",
9603
+ type: "(error: unknown) => void",
9604
+ required: false,
9605
+ description: "A request got a 401: hand it to the app's auth"
9606
+ },
9607
+ {
9608
+ name: "onerror",
9609
+ type: "(error: unknown) => void",
9610
+ required: false,
9611
+ description: "Listing, folder-pane, preview, search and download errors, for logging"
9612
+ },
9613
+ {
9614
+ name: "onpreview",
9615
+ type: "(entry: FileEntry) => void",
9616
+ required: false,
9617
+ description: "A file was opened for preview"
9618
+ },
9619
+ {
9620
+ name: "toolbar",
9621
+ type: "Snippet<[FileBrowserContext]>",
9622
+ required: false,
9623
+ description: "Write toolbar; rendered only when the source can write and `root.canWrite` is true"
9624
+ },
9625
+ {
9626
+ name: "rowActions",
9627
+ type: "Snippet<[FileEntry, FileBrowserContext]>",
9628
+ required: false,
9629
+ description: "Per-row write actions, under the same rule"
9630
+ },
9631
+ {
9632
+ name: "navigationPane",
9633
+ type: "boolean",
9634
+ default: "true",
9635
+ required: false,
9636
+ description: 'Explorer-style folder tree beside the list; on phones it opens from a "Folders" button'
9637
+ },
9638
+ {
9639
+ name: "paneSize",
9640
+ type: "number",
9641
+ default: "25",
9642
+ required: false,
9643
+ description: "Starting width of the folder pane, in percent (bindable); drag the splitter to resize"
9644
+ },
9645
+ {
9646
+ name: "paneKey",
9647
+ type: "string",
9648
+ required: false,
9649
+ description: "Remember the pane width in localStorage under this key"
9650
+ },
9651
+ {
9652
+ name: "label",
9653
+ type: "string",
9654
+ default: "'File browser'",
9655
+ required: false,
9656
+ description: "Accessible name of the browser region"
9657
+ },
9658
+ {
9659
+ name: "locale",
9660
+ type: "string | string[]",
9661
+ required: false,
9662
+ description: "Locale for sizes and dates (defaults to the browser's)"
9663
+ },
9664
+ {
9665
+ name: "class",
9666
+ type: "string",
9667
+ required: false,
9668
+ description: "Classes for the outer element; give it a height"
9669
+ }
9670
+ ],
9671
+ variants: [],
9672
+ slots: [],
9673
+ events: [],
9674
+ examples: [
9675
+ {
9676
+ title: "Basic Usage",
9677
+ code: `<script lang="ts">
9678
+ import { FileBrowser, createChapiFilesSource } from '@classic-homes/files-svelte';
9679
+ import type { ViewerRegistry } from '@classic-homes/viewer-svelte';
9680
+ import { getAccessToken, getSessionToken, refreshSession } from '@classic-homes/auth/core';
9681
+
9682
+ const source = createChapiFilesSource({
9683
+ baseUrl: 'https://api.classichomes.com',
9684
+ getAccessToken,
9685
+ getHeaders: () => {
9686
+ const session = getSessionToken();
9687
+ return session ? { 'X-Session-Token': session } : undefined;
9688
+ },
9689
+ onUnauthorized: async () => (await refreshSession()) === 'refreshed',
9690
+ });
9691
+
9692
+ // Lazy imports: only formats listed here are bundled. Add \`dwg\` only if the app opts into viewer-dwg.
9693
+ const viewers: ViewerRegistry = {
9694
+ pdf: () => import('@classic-homes/viewer-svelte/pdf'),
9695
+ docx: () => import('@classic-homes/viewer-svelte/docx'),
9696
+ xlsx: () => import('@classic-homes/viewer-svelte/xlsx'),
9697
+ csv: () => import('@classic-homes/viewer-svelte/xlsx'),
9698
+ dxf: () => import('@classic-homes/viewer-svelte/cad'),
9699
+ };
9700
+ </script>
9701
+
9702
+ <FileBrowser {source} {viewers} class="h-[80vh]" />`
9703
+ }
9704
+ ],
9705
+ relatedComponents: [
9706
+ "FileTree",
9707
+ "FileList",
9708
+ "FilePreview",
9709
+ "FileBreadcrumbs",
9710
+ "FileIcon",
9711
+ "FileDetails",
9712
+ "FileErrorState",
9713
+ "DocumentViewer"
9714
+ ]
9715
+ },
9716
+ {
9717
+ name: "FileDetails",
9718
+ description: "Facts about a file or folder - name, location, type, size, modified - with a Copy path button",
9719
+ category: "data",
9720
+ importPath: "@classic-homes/files-svelte",
9721
+ props: [
9722
+ {
9723
+ name: "entry",
9724
+ type: "FileEntry",
9725
+ required: true,
9726
+ description: "The file or folder"
9727
+ },
9728
+ {
9729
+ name: "rootLabel",
9730
+ type: "string",
9731
+ required: true,
9732
+ description: 'Root label, for the location and "Copy path"'
9733
+ },
9734
+ {
9735
+ name: "locale",
9736
+ type: "string | string[]",
9737
+ required: false,
9738
+ description: "Locale for sizes and dates"
9739
+ },
9740
+ {
9741
+ name: "class",
9742
+ type: "string",
9743
+ required: false,
9744
+ description: "Classes for the outer element"
9745
+ }
9746
+ ],
9747
+ variants: [],
9748
+ slots: [],
9749
+ events: [],
9750
+ examples: [
9751
+ {
9752
+ title: "Basic Usage",
9753
+ code: '<FileDetails {entry} rootLabel="Land Development" />'
9754
+ }
9755
+ ],
9756
+ relatedComponents: [
9757
+ "FilePreview"
9758
+ ]
9759
+ },
9760
+ {
9761
+ name: "FileErrorState",
9762
+ description: "The right message and action for a FilesError - retry (honouring Retry-After), back to the root, or neither",
9763
+ category: "data",
9764
+ importPath: "@classic-homes/files-svelte",
9765
+ props: [
9766
+ {
9767
+ name: "error",
9768
+ type: "unknown",
9769
+ required: true,
9770
+ description: "The error, usually a `FilesError`"
9771
+ },
9772
+ {
9773
+ name: "onretry",
9774
+ type: "() => void",
9775
+ required: false,
9776
+ description: 'Offer "Try again" for retryable errors'
9777
+ },
9778
+ {
9779
+ name: "onroot",
9780
+ type: "() => void",
9781
+ required: false,
9782
+ description: 'Offer "Back to \u2026" for bad or missing paths'
9783
+ },
9784
+ {
9785
+ name: "rootLabel",
9786
+ type: "string",
9787
+ required: false,
9788
+ description: "Label of the root, for the back button"
9789
+ },
9790
+ {
9791
+ name: "size",
9792
+ type: "'sm' | 'md'",
9793
+ default: "'md'",
9794
+ required: false,
9795
+ description: "Size of the empty state"
9796
+ },
9797
+ {
9798
+ name: "class",
9799
+ type: "string",
9800
+ required: false,
9801
+ description: "Classes for the outer element"
9802
+ }
9803
+ ],
9804
+ variants: [
9805
+ {
9806
+ name: "size",
9807
+ values: [
9808
+ "sm",
9809
+ "md"
9810
+ ],
9811
+ default: "md"
9812
+ }
9813
+ ],
9814
+ slots: [],
9815
+ events: [],
9816
+ examples: [
9817
+ {
9818
+ title: "Basic Usage",
9819
+ code: `<FileErrorState {error} onretry={reload} onroot={() => (path = '')} rootLabel="Land Development" />`
9820
+ }
9821
+ ],
9822
+ relatedComponents: [
9823
+ "FileBrowser"
9824
+ ]
9825
+ },
9826
+ {
9827
+ name: "FileIcon",
9828
+ description: "Icon for a file by type - folder, PDF, Word, Excel, CSV, CAD, image, archive, text, generic, and a distinct one for shortcuts",
9829
+ category: "data",
9830
+ importPath: "@classic-homes/files-svelte",
9831
+ props: [
9832
+ {
9833
+ name: "kind",
9834
+ type: "FileKind",
9835
+ required: false,
9836
+ description: "Kind to show; derived from `name` and `type` if unset"
9837
+ },
9838
+ {
9839
+ name: "name",
9840
+ type: "string",
9841
+ default: "''",
9842
+ required: false,
9843
+ description: "File name, for the extension"
9844
+ },
9845
+ {
9846
+ name: "type",
9847
+ type: "FileEntryType",
9848
+ default: "'file'",
9849
+ required: false,
9850
+ description: "Entry type: `'file'`, `'dir'` or `'link'`"
9851
+ },
9852
+ {
9853
+ name: "size",
9854
+ type: "number",
9855
+ default: "20",
9856
+ required: false,
9857
+ description: "Pixel size"
9858
+ },
9859
+ {
9860
+ name: "label",
9861
+ type: "string",
9862
+ required: false,
9863
+ description: "Accessible label; omit for a decorative icon"
9864
+ },
9865
+ {
9866
+ name: "class",
9867
+ type: "string",
9868
+ required: false,
9869
+ description: "Classes for the wrapper"
9870
+ }
9871
+ ],
9872
+ variants: [],
9873
+ slots: [],
9874
+ events: [],
9875
+ examples: [
9876
+ {
9877
+ title: "Basic Usage",
9878
+ code: '<FileIcon name="Lot 14 site plan.dwg" />\n<FileIcon name="Plans" type="dir" />\n<FileIcon kind="pdf" size={32} label="PDF document" />'
9879
+ }
9880
+ ],
9881
+ relatedComponents: [
9882
+ "FileList"
9883
+ ]
9884
+ },
9885
+ {
9886
+ name: "FileList",
9887
+ description: "Accessible folder listing with type icons, relative dates, sizes, client sort, paging and keyboard navigation",
9888
+ category: "data",
9889
+ importPath: "@classic-homes/files-svelte",
9890
+ props: [
9891
+ {
9892
+ name: "entries",
9893
+ type: "FileEntry[]",
9894
+ required: true,
9895
+ description: "Entries in display order (the server's order unless `sort` is set)"
9896
+ },
9897
+ {
9898
+ name: "selected",
9899
+ type: "string",
9900
+ required: false,
9901
+ description: "Path of the selected (focused) row (bindable)"
9902
+ },
9903
+ {
9904
+ name: "onopen",
9905
+ type: "(entry: FileEntry) => void",
9906
+ required: false,
9907
+ description: "A folder or file was opened (click, tap or Enter). Never called for links"
9908
+ },
9909
+ {
9910
+ name: "onselect",
9911
+ type: "(entry: FileEntry | undefined) => void",
9912
+ required: false,
9913
+ description: "The selected row changed"
9914
+ },
9915
+ {
9916
+ name: "onup",
9917
+ type: "() => void",
9918
+ required: false,
9919
+ description: "Backspace or Alt+Up inside the list"
9920
+ },
9921
+ {
9922
+ name: "sort",
9923
+ type: "FileSort | null",
9924
+ default: "null",
9925
+ required: false,
9926
+ description: "Client sort over the loaded entries (bindable); `null` keeps the order"
9927
+ },
9928
+ {
9929
+ name: "sortable",
9930
+ type: "boolean",
9931
+ default: "true",
9932
+ required: false,
9933
+ description: "Offer sortable column headers"
9934
+ },
9935
+ {
9936
+ name: "loading",
9937
+ type: "boolean",
9938
+ default: "false",
9939
+ required: false,
9940
+ description: "First page loading: skeleton rows"
9941
+ },
9942
+ {
9943
+ name: "loadingMore",
9944
+ type: "boolean",
9945
+ default: "false",
9946
+ required: false,
9947
+ description: "A further page is loading"
9948
+ },
9949
+ {
9950
+ name: "hasMore",
9951
+ type: "boolean",
9952
+ default: "false",
9953
+ required: false,
9954
+ description: "More pages exist on the server"
9955
+ },
9956
+ {
9957
+ name: "onloadmore",
9958
+ type: "() => void",
9959
+ required: false,
9960
+ description: "Load the next page"
9961
+ },
9962
+ {
9963
+ name: "autoLoad",
9964
+ type: "boolean",
9965
+ default: "false",
9966
+ required: false,
9967
+ description: "Call `onloadmore` when the end of the list scrolls into view"
9968
+ },
9969
+ {
9970
+ name: "total",
9971
+ type: "number",
9972
+ required: false,
9973
+ description: 'Entries in the whole folder, for "Showing N of total"'
9974
+ },
9975
+ {
9976
+ name: "showCount",
9977
+ type: "boolean",
9978
+ default: "true",
9979
+ required: false,
9980
+ description: 'Show "Showing N of total" under the list'
9981
+ },
9982
+ {
9983
+ name: "label",
9984
+ type: "string",
9985
+ default: "'Files'",
9986
+ required: false,
9987
+ description: "Accessible name of the grid"
9988
+ },
9989
+ {
9990
+ name: "locale",
9991
+ type: "string | string[]",
9992
+ required: false,
9993
+ description: "Locale for sizes and dates"
9994
+ },
9995
+ {
9996
+ name: "now",
9997
+ type: "number",
9998
+ required: false,
9999
+ description: "Reference time for relative dates (tests)"
10000
+ },
10001
+ {
10002
+ name: "emptyTitle",
10003
+ type: "string",
10004
+ default: "'This folder is empty'",
10005
+ required: false,
10006
+ description: "Title of the empty state"
10007
+ },
10008
+ {
10009
+ name: "empty",
10010
+ type: "Snippet",
10011
+ required: false,
10012
+ description: "Replaces the empty state"
10013
+ },
10014
+ {
10015
+ name: "rowActions",
10016
+ type: "Snippet<[FileEntry]>",
10017
+ required: false,
10018
+ description: "Per-row actions, rendered at the end of each row; clicks and keys inside them don't open the row"
10019
+ },
10020
+ {
10021
+ name: "linkMessage",
10022
+ type: "string",
10023
+ required: false,
10024
+ description: "Explanation read out for links (default: the shortcut message)"
10025
+ },
10026
+ {
10027
+ name: "class",
10028
+ type: "string",
10029
+ required: false,
10030
+ description: "Classes for the outer element"
10031
+ }
10032
+ ],
10033
+ variants: [],
10034
+ slots: [],
10035
+ events: [],
10036
+ examples: [
10037
+ {
10038
+ title: "Basic Usage",
10039
+ code: `<script lang="ts">
10040
+ import { FileList, FilePreview, type FileEntry } from '@classic-homes/files-svelte';
10041
+
10042
+ let { source } = $props();
10043
+ let entries = $state<FileEntry[]>([]);
10044
+ let total = $state<number>();
10045
+ let loading = $state(true);
10046
+ let open = $state<FileEntry>();
10047
+
10048
+ $effect(() => {
10049
+ source.list('land-dev', '105 BREWERY/Plans').then((page) => {
10050
+ entries = page.entries;
10051
+ total = page.total;
10052
+ loading = false;
10053
+ });
10054
+ });
10055
+ </script>
10056
+
10057
+ <FileList {entries} {total} {loading} label="Lot 14 documents" onopen={(e) => (open = e)} />`
10058
+ }
10059
+ ],
10060
+ relatedComponents: [
10061
+ "FileBrowser",
10062
+ "FileIcon"
10063
+ ]
10064
+ },
10065
+ {
10066
+ name: "FilePreview",
10067
+ description: "Preview one network-drive file with the document viewers, or show its details with a Download button",
10068
+ category: "data",
10069
+ importPath: "@classic-homes/files-svelte",
10070
+ props: [
10071
+ {
10072
+ name: "source",
10073
+ type: "FilesSource",
10074
+ required: true,
10075
+ description: "Where the bytes come from"
10076
+ },
10077
+ {
10078
+ name: "rootId",
10079
+ type: "string",
10080
+ required: true,
10081
+ description: "Root of the entry"
10082
+ },
10083
+ {
10084
+ name: "rootLabel",
10085
+ type: "string",
10086
+ required: true,
10087
+ description: 'Root label, for details and "Copy path"'
10088
+ },
10089
+ {
10090
+ name: "entry",
10091
+ type: "FileEntry",
10092
+ required: true,
10093
+ description: "The file to preview"
10094
+ },
10095
+ {
10096
+ name: "viewers",
10097
+ type: "ViewerRegistry",
10098
+ default: "{}",
10099
+ required: false,
10100
+ description: "Document viewers, as lazy imports keyed by format. `dwg` only with viewer-dwg"
10101
+ },
10102
+ {
10103
+ name: "maxBytes",
10104
+ type: "number",
10105
+ default: "104857600",
10106
+ required: false,
10107
+ description: "Larger files are not fetched for preview (100 MB)"
10108
+ },
10109
+ {
10110
+ name: "showTitle",
10111
+ type: "boolean",
10112
+ default: "true",
10113
+ required: false,
10114
+ description: "Show the file name in the toolbar; turn off inside a titled dialog"
10115
+ },
10116
+ {
10117
+ name: "locale",
10118
+ type: "string | string[]",
10119
+ required: false,
10120
+ description: "Locale for sizes and dates"
10121
+ },
10122
+ {
10123
+ name: "ondownload",
10124
+ type: "(entry: FileEntry, error?: unknown) => void",
10125
+ required: false,
10126
+ description: "A download finished, or failed with `error`"
10127
+ },
10128
+ {
10129
+ name: "onerror",
10130
+ type: "(error: unknown) => void",
10131
+ required: false,
10132
+ description: "The file couldn't be loaded for preview (a 401 included)"
10133
+ },
10134
+ {
10135
+ name: "class",
10136
+ type: "string",
10137
+ required: false,
10138
+ description: "Classes for the outer element; give it a height"
10139
+ }
10140
+ ],
10141
+ variants: [],
10142
+ slots: [],
10143
+ events: [],
10144
+ examples: [
10145
+ {
10146
+ title: "Basic Usage",
10147
+ code: `<script lang="ts">
10148
+ import { FilePreview, type FileEntry } from '@classic-homes/files-svelte';
10149
+
10150
+ let {
10151
+ source,
10152
+ entry,
10153
+ }: { source: import('@classic-homes/files-svelte').FilesSource; entry: FileEntry } = $props();
10154
+
10155
+ const viewers = {
10156
+ pdf: () => import('@classic-homes/viewer-svelte/pdf'),
10157
+ };
10158
+ </script>
10159
+
10160
+ <FilePreview
10161
+ {source}
10162
+ rootId="land-dev"
10163
+ rootLabel="Land Development"
10164
+ {entry}
10165
+ {viewers}
10166
+ class="h-[70vh]"
10167
+ />`
10168
+ }
10169
+ ],
10170
+ relatedComponents: [
10171
+ "FileBrowser",
10172
+ "FileDetails",
10173
+ "DocumentViewer"
10174
+ ]
10175
+ },
10176
+ {
10177
+ name: "FileTree",
10178
+ description: "Explorer-style folder pane - drives at the top, folders loaded as they expand, the open folder highlighted with its parents expanded",
10179
+ category: "data",
10180
+ importPath: "@classic-homes/files-svelte",
10181
+ props: [
10182
+ {
10183
+ name: "source",
10184
+ type: "FilesSource",
10185
+ required: true,
10186
+ description: "Where folders are listed from"
10187
+ },
10188
+ {
10189
+ name: "roots",
10190
+ type: "FileRoot[]",
10191
+ required: true,
10192
+ description: "Drives shown at the top level"
10193
+ },
10194
+ {
10195
+ name: "rootId",
10196
+ type: "string",
10197
+ required: false,
10198
+ description: "Drive of the open folder"
10199
+ },
10200
+ {
10201
+ name: "path",
10202
+ type: "string",
10203
+ default: "''",
10204
+ required: false,
10205
+ description: "Open folder, root-relative (`''` = the drive)"
10206
+ },
10207
+ {
10208
+ name: "showHidden",
10209
+ type: "boolean",
10210
+ default: "false",
10211
+ required: false,
10212
+ description: "Include hidden folders"
10213
+ },
10214
+ {
10215
+ name: "onnavigate",
10216
+ type: "(rootId: string, path: string) => void",
10217
+ required: false,
10218
+ description: "A folder (or a drive, with path `''`) was chosen"
10219
+ },
10220
+ {
10221
+ name: "refreshKey",
10222
+ type: "unknown",
10223
+ required: false,
10224
+ description: "Change it to reload the expanded folders in place (FileBrowser passes its refresh counter)"
10225
+ },
10226
+ {
10227
+ name: "onerror",
10228
+ type: "(error: unknown) => void",
10229
+ required: false,
10230
+ description: "A folder failed to load (a 401 included)"
10231
+ },
10232
+ {
10233
+ name: "label",
10234
+ type: "string",
10235
+ default: "'Folders'",
10236
+ required: false,
10237
+ description: "Accessible name of the tree"
10238
+ },
10239
+ {
10240
+ name: "class",
10241
+ type: "string",
10242
+ required: false,
10243
+ description: "Classes for the tree element"
10244
+ }
10245
+ ],
10246
+ variants: [],
10247
+ slots: [],
10248
+ events: [],
10249
+ examples: [
10250
+ {
10251
+ title: "Basic Usage",
10252
+ code: `<script lang="ts">
10253
+ import { FileTree, type FileRoot, type FilesSource } from '@classic-homes/files-svelte';
10254
+
10255
+ let { source, roots }: { source: FilesSource; roots: FileRoot[] } = $props();
10256
+ let rootId = $state('land-dev');
10257
+ let path = $state('');
10258
+ </script>
10259
+
10260
+ <FileTree
10261
+ {source}
10262
+ {roots}
10263
+ {rootId}
10264
+ {path}
10265
+ onnavigate={(r, p) => {
10266
+ rootId = r;
10267
+ path = p;
10268
+ }}
10269
+ />`
10270
+ }
10271
+ ],
10272
+ relatedComponents: [
10273
+ "FileBrowser",
10274
+ "FileBreadcrumbs"
10275
+ ]
10276
+ },
9379
10277
  {
9380
10278
  name: "FileUpload",
9381
10279
  description: "File upload component with drag-and-drop support",
@@ -9675,6 +10573,307 @@ var component_catalog_default = {
9675
10573
  "ActionHeader"
9676
10574
  ]
9677
10575
  },
10576
+ {
10577
+ name: "Flipbook",
10578
+ description: "A magazine or catalog read one spread at a time, turned by a Flipboard-style fold or an ebook page hinge",
10579
+ category: "media",
10580
+ importPath: "@classic-homes/flipbook-svelte",
10581
+ props: [
10582
+ {
10583
+ name: "items",
10584
+ type: "T[]",
10585
+ required: true,
10586
+ description: "One entry per page"
10587
+ },
10588
+ {
10589
+ name: "page",
10590
+ type: "Snippet<[T, FlipPageContext]>",
10591
+ required: true,
10592
+ description: "Renders a page. See [Page context](#page-context)"
10593
+ },
10594
+ {
10595
+ name: "label",
10596
+ type: "string",
10597
+ required: true,
10598
+ description: "Accessible name of the book"
10599
+ },
10600
+ {
10601
+ name: "index",
10602
+ type: "number",
10603
+ default: "0",
10604
+ required: false,
10605
+ description: "Current page (bindable). Setting it jumps without a turn"
10606
+ },
10607
+ {
10608
+ name: "turning",
10609
+ type: "boolean",
10610
+ default: "false",
10611
+ required: false,
10612
+ description: "Read-only (bindable): true while a page is dragged or turning, the hint's lift and `intro` included. Hold `items` changes until it is false: a new page count lands a turn in flight back on its page"
10613
+ },
10614
+ {
10615
+ name: "axis",
10616
+ type: "'horizontal' | 'vertical' | 'auto'",
10617
+ default: "'auto'",
10618
+ required: false,
10619
+ description: "Fold axis. `auto` picks from the book's own size (`axisFor`)"
10620
+ },
10621
+ {
10622
+ name: "narrow",
10623
+ type: "'fold' | 'pages'",
10624
+ default: "'fold'",
10625
+ required: false,
10626
+ description: "How a narrow book turns: the Flipboard fold, or ebook pages hinged at their left edge"
10627
+ },
10628
+ {
10629
+ name: "controls",
10630
+ type: "boolean",
10631
+ default: "true",
10632
+ required: false,
10633
+ description: "The prev / indicator / next bar"
10634
+ },
10635
+ {
10636
+ name: "controlsStart",
10637
+ type: "Snippet",
10638
+ required: false,
10639
+ description: "Extra controls at the start (left end) of the controls bar, opposite the full-screen button: a host's Close when the book is its own screen"
10640
+ },
10641
+ {
10642
+ name: "wheel",
10643
+ type: "boolean",
10644
+ default: "true",
10645
+ required: false,
10646
+ description: "Wheel and trackpad scrolling turn pages. Turn it off for a book embedded in a page that scrolls past it"
10647
+ },
10648
+ {
10649
+ name: "intro",
10650
+ type: "boolean",
10651
+ default: "false",
10652
+ required: false,
10653
+ description: "Open the book when it first appears: the front cover turns over right to left"
10654
+ },
10655
+ {
10656
+ name: "hint",
10657
+ type: "boolean",
10658
+ default: "false",
10659
+ required: false,
10660
+ description: "First-visit hint: the next page lifts and falls back, with a pill saying how to turn"
10661
+ },
10662
+ {
10663
+ name: "hintLabel",
10664
+ type: "(turn: FlipAxis, pages: boolean) => string",
10665
+ default: "built in",
10666
+ required: false,
10667
+ description: 'The pill\'s text. Default: "Swipe left to turn the page" (`pages`), "Swipe up to turn the page" (vertical), "Drag the page or press \u2192 to turn it"'
10668
+ },
10669
+ {
10670
+ name: "onHintDone",
10671
+ type: "() => void",
10672
+ required: false,
10673
+ description: "The visitor acted while the hint showed. Remember it so the hint shows once"
10674
+ },
10675
+ {
10676
+ name: "liftTurns",
10677
+ type: "boolean",
10678
+ default: "false",
10679
+ required: false,
10680
+ description: "Draw turning pages in an overlay on `<body>`, so they swing past the book's bounds instead of being clipped"
10681
+ },
10682
+ {
10683
+ name: "fullscreen",
10684
+ type: "boolean",
10685
+ default: "false",
10686
+ required: false,
10687
+ description: "A full-screen button in the controls bar. Uses the Fullscreen API, or fixes the book over the viewport where the browser has none (iPhone Safari)"
10688
+ },
10689
+ {
10690
+ name: "expanded",
10691
+ type: "boolean",
10692
+ default: "false",
10693
+ required: false,
10694
+ description: "Read-only (bindable): true while the book fills the screen"
10695
+ },
10696
+ {
10697
+ name: "pageAlign",
10698
+ type: "(item: T) => 'left' | 'right' | undefined",
10699
+ required: false,
10700
+ description: "A bookend's side of the spine (`BookPage.align`), so the closed book is centred"
10701
+ },
10702
+ {
10703
+ name: "pageLabel",
10704
+ type: "(item: T, index: number) => string | undefined",
10705
+ required: false,
10706
+ description: 'Accessible name of a page, after "Page n of N"'
10707
+ },
10708
+ {
10709
+ name: "onPageChange",
10710
+ type: "(index: number, item: T) => void",
10711
+ required: false,
10712
+ description: "After a turn lands on a new page"
10713
+ },
10714
+ {
10715
+ name: "onAxisChange",
10716
+ type: "(axis: FlipAxis) => void",
10717
+ required: false,
10718
+ description: "Once the book is measured, then each time the fold axis changes (resize, rotation). Rebuild `paginate` pages from it"
10719
+ },
10720
+ {
10721
+ name: "onStageResize",
10722
+ type: "(size: { width: number; height: number }) => void",
10723
+ required: false,
10724
+ description: "The page area's size changed. Use it to measure and flow content to fit (`flowPages`)"
10725
+ },
10726
+ {
10727
+ name: "class",
10728
+ type: "string",
10729
+ required: false,
10730
+ description: "Extra classes on the book"
10731
+ }
10732
+ ],
10733
+ variants: [
10734
+ {
10735
+ name: "axis",
10736
+ values: [
10737
+ "horizontal",
10738
+ "vertical",
10739
+ "auto"
10740
+ ],
10741
+ default: "auto"
10742
+ },
10743
+ {
10744
+ name: "narrow",
10745
+ values: [
10746
+ "fold",
10747
+ "pages"
10748
+ ],
10749
+ default: "fold"
10750
+ }
10751
+ ],
10752
+ slots: [],
10753
+ events: [],
10754
+ examples: [
10755
+ {
10756
+ title: "Basic Usage",
10757
+ code: `<script>
10758
+ import { Flipbook } from '@classic-homes/flipbook-svelte';
10759
+
10760
+ const pages = ['Cover', 'Contents', 'Chapter one', 'Back cover'];
10761
+ let index = $state(0);
10762
+ </script>
10763
+
10764
+ <div style="height: 32rem">
10765
+ <Flipbook items={pages} bind:index label="Spring catalog">
10766
+ {#snippet page(title, { index, count })}
10767
+ <section class="h-full p-8">
10768
+ <h2>{title}</h2>
10769
+ <p>Page {index + 1} of {count}</p>
10770
+ </section>
10771
+ {/snippet}
10772
+ </Flipbook>
10773
+ </div>`
10774
+ },
10775
+ {
10776
+ title: "Magazine spreads",
10777
+ code: `<script lang="ts">
10778
+ import {
10779
+ Flipbook,
10780
+ FlipSpread,
10781
+ paginate,
10782
+ pageOfPanel,
10783
+ type BookPanel,
10784
+ type FlipAxis,
10785
+ } from '@classic-homes/flipbook-svelte';
10786
+
10787
+ const panels: BookPanel[] = [
10788
+ { key: 'cover', span: 'full' },
10789
+ { key: 'welcome' },
10790
+ { key: 'contents' },
10791
+ { key: 'home-1-hero', group: 'home-1' },
10792
+ { key: 'home-1-photos', group: 'home-1' },
10793
+ { key: 'back', span: 'full' },
10794
+ ];
10795
+
10796
+ let axis = $state<FlipAxis>('horizontal');
10797
+ let index = $state(0);
10798
+ const pages = $derived(paginate(panels, axis, { bookends: true }));
10799
+ </script>
10800
+
10801
+ <Flipbook
10802
+ items={pages}
10803
+ bind:index
10804
+ label="Catalog"
10805
+ intro
10806
+ narrow="pages"
10807
+ pageAlign={(p) => p.align}
10808
+ onAxisChange={(next) => {
10809
+ const key = pages[index]?.panels[0]?.key;
10810
+ axis = next;
10811
+ // Keep the reader on the same content after a re-flow
10812
+ if (key) index = Math.max(0, pageOfPanel(paginate(panels, next, { bookends: true }), key));
10813
+ }}
10814
+ >
10815
+ {#snippet page(p)}
10816
+ <FlipSpread panels={p.panels} align={p.align}>
10817
+ {#snippet panel(item, side)}
10818
+ <div class="h-full p-6" data-side={side}>{item.key}</div>
10819
+ {/snippet}
10820
+ </FlipSpread>
10821
+ {/snippet}
10822
+ </Flipbook>`
10823
+ }
10824
+ ],
10825
+ relatedComponents: [
10826
+ "FlipSpread",
10827
+ "Lightbox",
10828
+ "MediaCarousel"
10829
+ ]
10830
+ },
10831
+ {
10832
+ name: "FlipSpread",
10833
+ description: "Lays a Flipbook page out as a spread, one panel filling it or two either side of the spine",
10834
+ category: "media",
10835
+ importPath: "@classic-homes/flipbook-svelte",
10836
+ props: [
10837
+ {
10838
+ name: "panels",
10839
+ type: "P[]",
10840
+ required: true,
10841
+ description: "One panel (fills the page) or two (left, right of the spine)"
10842
+ },
10843
+ {
10844
+ name: "panel",
10845
+ type: "Snippet<[P, 'left' | 'right' | 'full']>",
10846
+ required: true,
10847
+ description: "Renders a panel with its side"
10848
+ },
10849
+ {
10850
+ name: "align",
10851
+ type: "'left' | 'right'",
10852
+ required: false,
10853
+ description: "A bookend: its one panel on that side, the other half left empty"
10854
+ }
10855
+ ],
10856
+ variants: [
10857
+ {
10858
+ name: "align",
10859
+ values: [
10860
+ "left",
10861
+ "right"
10862
+ ]
10863
+ }
10864
+ ],
10865
+ slots: [],
10866
+ events: [],
10867
+ examples: [
10868
+ {
10869
+ title: "Basic Usage",
10870
+ code: '<Flipbook items={pages} label="Catalog" pageAlign={(p) => p.align}>\n {#snippet page(p)}\n <FlipSpread panels={p.panels} align={p.align}>\n {#snippet panel(item, side)}\n <div class="h-full p-6" data-side={side}>{item.key}</div>\n {/snippet}\n </FlipSpread>\n {/snippet}\n</Flipbook>'
10871
+ }
10872
+ ],
10873
+ relatedComponents: [
10874
+ "Flipbook"
10875
+ ]
10876
+ },
9678
10877
  {
9679
10878
  name: "Footer",
9680
10879
  description: "Site footer with link sections and branding",
@@ -18659,6 +19858,46 @@ var component_catalog_default = {
18659
19858
  required: false,
18660
19859
  description: "Collapsed width (px)"
18661
19860
  },
19861
+ {
19862
+ name: "resizable",
19863
+ type: "boolean",
19864
+ default: "true",
19865
+ required: false,
19866
+ description: "Drag the right edge to resize (desktop)"
19867
+ },
19868
+ {
19869
+ name: "minWidth",
19870
+ type: "number",
19871
+ default: "200",
19872
+ required: false,
19873
+ description: "Narrowest dragged width (px)"
19874
+ },
19875
+ {
19876
+ name: "maxWidth",
19877
+ type: "number",
19878
+ default: "480",
19879
+ required: false,
19880
+ description: "Widest dragged width (px)"
19881
+ },
19882
+ {
19883
+ name: "resizeStep",
19884
+ type: "number",
19885
+ default: "16",
19886
+ required: false,
19887
+ description: "Arrow-key resize step (px)"
19888
+ },
19889
+ {
19890
+ name: "onCollapsedChange",
19891
+ type: "(collapsed: boolean) => void",
19892
+ required: false,
19893
+ description: "Resize collapsed/expanded it; enables snap-to-rail"
19894
+ },
19895
+ {
19896
+ name: "onResize",
19897
+ type: "(width: number) => void",
19898
+ required: false,
19899
+ description: "Called with the width when a resize finishes"
19900
+ },
18662
19901
  {
18663
19902
  name: "searchable",
18664
19903
  type: "boolean",
@@ -22682,7 +23921,7 @@ function registerComponentResources(server) {
22682
23921
 
22683
23922
  // src/data/token-definitions.json
22684
23923
  var token_definitions_default = {
22685
- version: "0.5.7",
23924
+ version: "0.5.9",
22686
23925
  colors: {
22687
23926
  brand: [
22688
23927
  {
@@ -23665,7 +24904,7 @@ function registerTokenResources(server) {
23665
24904
 
23666
24905
  // src/data/styles-catalog.json
23667
24906
  var styles_catalog_default = {
23668
- version: "0.5.7",
24907
+ version: "0.5.9",
23669
24908
  package: "@classic-homes/theme-styles",
23670
24909
  description: "Base CSS styles, accessibility features, and utility classes for the Classic Theme design system",
23671
24910
  integration: {
@@ -24048,7 +25287,7 @@ import { ResourceTemplate as ResourceTemplate2 } from "@modelcontextprotocol/sdk
24048
25287
 
24049
25288
  // src/data/pattern-library.json
24050
25289
  var pattern_library_default = {
24051
- version: "0.5.7",
25290
+ version: "0.5.9",
24052
25291
  layouts: [
24053
25292
  {
24054
25293
  id: "dashboard-page",
@@ -25142,7 +26381,7 @@ function registerLayoutResources(server) {
25142
26381
 
25143
26382
  // src/data/schema-catalog.json
25144
26383
  var schema_catalog_default = {
25145
- version: "0.5.7",
26384
+ version: "0.5.9",
25146
26385
  packageName: "@classic-homes/theme-svelte",
25147
26386
  importPath: "@classic-homes/theme-svelte",
25148
26387
  generatedFrom: "packages/svelte/src/lib/schemas/index.ts",
@@ -25950,7 +27189,7 @@ import { ResourceTemplate as ResourceTemplate3 } from "@modelcontextprotocol/sdk
25950
27189
 
25951
27190
  // src/data/auth-catalog.json
25952
27191
  var auth_catalog_default = {
25953
- version: "0.5.7",
27192
+ version: "0.5.9",
25954
27193
  packageName: "@classic-homes/auth",
25955
27194
  description: "Authentication services and Svelte bindings for Classic Theme apps",
25956
27195
  subpackages: {
@@ -26165,7 +27404,7 @@ var auth_catalog_default = {
26165
27404
  {
26166
27405
  name: "authApi.initiateSSOLogin",
26167
27406
  signature: "(options?: { callbackUrl?: string; redirectUrl?: string }) => void",
26168
- description: "Initiate SSO login by redirecting to the SSO provider"
27407
+ description: "Initiate SSO login by redirecting to the SSO provider. Sends a fresh client_state (kept in this tab's sessionStorage) that the callback page checks with verifySsoClientState / acceptMfaChallengeHash"
26169
27408
  },
26170
27409
  {
26171
27410
  name: "authApi.getProfile",
@@ -26310,7 +27549,13 @@ var auth_catalog_default = {
26310
27549
  {
26311
27550
  name: "authApi.linkSSOAccount",
26312
27551
  signature: "(provider?: string) => Promise<void>",
26313
- description: "Link an SSO account (redirects to SSO provider)"
27552
+ description: "Start linking an SSO account (redirects to the IdP). CHAPI links nothing until the /account page it returns to calls completeSSOLink(code)"
27553
+ },
27554
+ {
27555
+ name: "authApi.completeSSOLink",
27556
+ signature: "(code: string) => Promise<SSOLinkCompleteResponse>",
27557
+ description: "Finish an SSO account link with the one-time sso_link_code (POST /auth/sso/link/complete). Throws ApiError: 400 unknown/used code or SSO account linked to another user, 403 different user or IdP email unverified / not the account email. Also on authService.completeSSOLink",
27558
+ example: "import { authService, readSsoLinkResult } from '@classic-homes/auth/core';\n\nconst link = readSsoLinkResult(); // on /account; strips the code from the URL\nif (link?.status === 'pending') await authService.completeSSOLink(link.code);\nelse if (link?.status === 'error') showError(link.message ?? 'Linking failed');"
26314
27559
  },
26315
27560
  {
26316
27561
  name: "authApi.getSecurityEvents",
@@ -26416,6 +27661,48 @@ var auth_catalog_default = {
26416
27661
  }
26417
27662
  ]
26418
27663
  },
27664
+ sso: {
27665
+ description: "SSO login CSRF binding (client_state echoed in the callback hash), MFA challenge hash binding, and the SSO account-link return trip",
27666
+ functions: [
27667
+ {
27668
+ name: "verifySsoClientState",
27669
+ signature: "(input: string | URLSearchParams | null | undefined) => { result: 'ok' | 'mismatch' | 'missing'; accepted: boolean }",
27670
+ description: "On the SSO callback page: compare the hash's client_state with the one this tab stored (single-use, constant-time, 10-minute TTL). accepted is false for anything but 'ok' when sso.requireClientState is on",
27671
+ example: "import { verifySsoClientState } from '@classic-homes/auth/core';\n\nconst params = new URLSearchParams(window.location.hash.slice(1));\nconst { accepted, result } = verifySsoClientState(params);\nif (!accepted) throw new Error(`SSO sign-in could not be verified (${result})`);"
27672
+ },
27673
+ {
27674
+ name: "consumeSsoClientState",
27675
+ signature: "(received: string | null | undefined) => 'ok' | 'mismatch' | 'missing'",
27676
+ description: "Raw client_state check without the requireClientState policy; consumes the stored value"
27677
+ },
27678
+ {
27679
+ name: "createSsoClientState",
27680
+ signature: "() => string | null",
27681
+ description: "Generate and store a 32-byte base64url client_state for this tab (initiateSSOLogin calls it); null without sessionStorage"
27682
+ },
27683
+ {
27684
+ name: "acceptMfaChallengeHash",
27685
+ signature: "(input: URLSearchParams | string) => { result; accepted: boolean; token: string | null; via: 'sso' | 'password' | null }",
27686
+ description: "On the MFA challenge page: accept mfaChallengeToken from the hash only if it echoes this tab's client_state (SSO, consumed) or equals the token login() remembered (password). Same requireClientState policy; a hash without a token is never accepted",
27687
+ example: "import { acceptMfaChallengeHash } from '@classic-homes/auth/core';\n\nconst { accepted, token } = acceptMfaChallengeHash(window.location.hash);\nif (!accepted || !token) goto('/login');"
27688
+ },
27689
+ {
27690
+ name: "rememberMfaChallengeToken",
27691
+ signature: "(token: string) => boolean",
27692
+ description: "Remember a password-flow MFA challenge token for this tab (authService.login does this automatically on a challenge)"
27693
+ },
27694
+ {
27695
+ name: "clearMfaChallengeToken",
27696
+ signature: "() => void",
27697
+ description: "Forget the remembered MFA challenge token (authService.verifyMFAChallenge does this on success)"
27698
+ },
27699
+ {
27700
+ name: "readSsoLinkResult",
27701
+ signature: "(options?: { url?: string | URL; clear?: boolean }) => SSOLinkResult | null",
27702
+ description: "On /account after linkSSOAccount: read ?link=error&message or #sso_link_code and, by default, strip them from the address bar; null when the URL is not a link return"
27703
+ }
27704
+ ]
27705
+ },
26419
27706
  jwt: {
26420
27707
  description: "JWT token utilities",
26421
27708
  functions: [
@@ -26529,12 +27816,12 @@ var auth_catalog_default = {
26529
27816
  {
26530
27817
  name: "ROLE_NAMES",
26531
27818
  type: "readonly RoleName[]",
26532
- description: "Every role name, ordered most to least privileged: admin, manager, agent, builder, customer_service, demo, stormwater, accounting_staff, architecture_staff, construction_staff, crl_staff, design_staff, hr_staff, it_staff, landdev_staff, marketing_staff, purchasing_staff, sales_staff, stormwater_staff, warranty_staff, hotsheet_editor, office_admin, employee, user, vendor, customer, subcontractor, guest. Order is load-bearing - computePrimaryRole takes the first match."
27819
+ description: "Every role name, ordered most to least privileged: admin, manager, agent, builder, customer_service, demo, stormwater, accounting_staff, architecture_staff, construction_staff, crl_staff, design_staff, hr_staff, it_staff, landdev_staff, marketing_staff, purchasing_staff, sales_staff, stormwater_staff, warranty_staff, hotsheet_editor, office_admin, area_manager, project_manager, employee, user, vendor, customer, subcontractor, guest. Order is load-bearing - computePrimaryRole takes the first match."
26533
27820
  },
26534
27821
  {
26535
27822
  name: "ROLE_HIERARCHY",
26536
27823
  type: "Record<string, number>",
26537
- description: "Privilege level per role: guest 0; user/vendor/customer/subcontractor 1; employee/agent/builder/customer_service/demo/stormwater, every <department>_staff, hotsheet_editor and office_admin 2; manager 3; admin 4."
27824
+ description: "Privilege level per role: guest 0; user/vendor/customer/subcontractor 1; employee/agent/builder/customer_service/demo/stormwater, every <department>_staff, hotsheet_editor, office_admin, area_manager and project_manager 2; manager 3; admin 4."
26538
27825
  }
26539
27826
  ],
26540
27827
  types: [
@@ -26557,6 +27844,17 @@ var auth_catalog_default = {
26557
27844
  name: "isRoleDeniedError",
26558
27845
  signature: "(error: unknown) => error is RoleDeniedError",
26559
27846
  description: "Type guard to check if an error is a RoleDeniedError"
27847
+ },
27848
+ {
27849
+ name: "ApiError",
27850
+ signature: "class extends Error { status: number; code?: string; details?: Record<string, unknown>; method: string; endpoint: string }",
27851
+ description: "Thrown by apiRequest/api.* on any non-2xx response. message is the server's message (unchanged from the old plain Error); a CHAPI 403 carries details.required (and details.mode).",
27852
+ example: "import { api, isApiError } from '@classic-homes/auth/core';\n\ntry {\n await api.put('/homes/42', body, true);\n} catch (e) {\n if (isApiError(e) && e.status === 403) {\n console.log(e.details?.required); // ['homes:update']\n }\n}"
27853
+ },
27854
+ {
27855
+ name: "isApiError",
27856
+ signature: "(error: unknown) => error is ApiError",
27857
+ description: "Type guard for ApiError"
26560
27858
  }
26561
27859
  ],
26562
27860
  types: [
@@ -26686,6 +27984,139 @@ formatUserRoles(user, { lowercase: true }); // "admin, manager"`
26686
27984
  ]
26687
27985
  }
26688
27986
  ]
27987
+ },
27988
+ "access-probe": {
27989
+ description: "Inert hooks for permission troubleshooting tools (the Access Inspector). setAccessProbe receives every role/permission decision; setAccessSubject previews the UI as another role set for the signed-in user only. Browser-only; UI decisions only (the API still authorizes with the real token).",
27990
+ functions: [
27991
+ {
27992
+ name: "setAccessProbe",
27993
+ signature: "(probe: ((event: AccessCheckEvent) => void) | null) => AccessProbe | null",
27994
+ description: "Install the function that receives every decision: core hasRole*, store has*, checkAuth ('route'), filterByAccess/canAccess ('nav'), API 403s ('http', path only), fields the API redacted ('redacted': informational, allowed true, fields: { name, permission }[]; permission '*' = unconfigured, default-deny). While installed, requests to the API origin only send X-Access-Debug: 1 and read X-Access-Redacted (admin sessions; absent on older CHAPI). One probe at a time; no-op on the server."
27995
+ },
27996
+ {
27997
+ name: "setAccessSubject",
27998
+ signature: "(userId: string, subject: { roles: string[]; permissions: string[] }) => void",
27999
+ description: "'View as': access checks for this user id use the given roles/permissions. Checks for other users, authStore.user and sign-in allowedRoles gating are unaffected. Cleared on any login/logout/expiry."
28000
+ },
28001
+ {
28002
+ name: "clearAccessSubject",
28003
+ signature: "() => void",
28004
+ description: "End the 'view as' preview"
28005
+ },
28006
+ {
28007
+ name: "effectiveSubject",
28008
+ signature: "(user) => { roles; permissions; simulated }",
28009
+ description: "Roles/permissions to decide access with: the override when it targets this user, else the user's own"
28010
+ },
28011
+ {
28012
+ name: "evaluateAccess",
28013
+ signature: "(subject: AccessSubject, requirement: AccessRequirement) => { allowed: boolean; missing: { roles: string[]; permissions: string[] } }",
28014
+ description: "Shared any/all decision used by checkAuth and the inspector. Roles and permissions must both pass; empty lists are no restriction; exact membership.",
28015
+ example: "import { evaluateAccess, effectiveSubject } from '@classic-homes/auth/core';\n\nevaluateAccess(effectiveSubject(user), { permissions: ['homes:update'] });"
28016
+ },
28017
+ {
28018
+ name: "parseRedactedHeader",
28019
+ signature: "(value: string | null | undefined) => { fields: RedactedField[]; omitted: number }",
28020
+ description: "Parse X-Access-Redacted ('taxId=vendors:read:sensitive, notes=*'): skips malformed entries, keeps a repeated name's first permission, keeps at most 100 fields (omitted counts the rest)"
28021
+ },
28022
+ {
28023
+ name: "requirementFromDenial",
28024
+ signature: "(code: string | undefined, details: unknown) => AccessRequirement | null",
28025
+ description: "Read what a CHAPI 403 required (requirePermissions: string[] + INSUFFICIENT_PERMISSIONS; requireRole: string + FORBIDDEN)"
28026
+ }
28027
+ ],
28028
+ types: [
28029
+ {
28030
+ name: "AccessRequirement",
28031
+ description: "What UI or a request requires",
28032
+ properties: [
28033
+ {
28034
+ name: "roles",
28035
+ type: "string[]",
28036
+ required: false,
28037
+ description: "Any one of these roles (all with requireAllRoles)"
28038
+ },
28039
+ {
28040
+ name: "permissions",
28041
+ type: "string[]",
28042
+ required: false,
28043
+ description: "Any one of these permissions (all with requireAllPermissions)"
28044
+ },
28045
+ {
28046
+ name: "requireAllRoles",
28047
+ type: "boolean",
28048
+ required: false,
28049
+ description: "Require every listed role"
28050
+ },
28051
+ {
28052
+ name: "requireAllPermissions",
28053
+ type: "boolean",
28054
+ required: false,
28055
+ description: "Require every listed permission"
28056
+ }
28057
+ ]
28058
+ },
28059
+ {
28060
+ name: "AccessCheckEvent",
28061
+ description: "One reported decision",
28062
+ properties: [
28063
+ {
28064
+ name: "source",
28065
+ type: "'check' | 'route' | 'nav' | 'http' | 'element' | 'redacted'",
28066
+ required: true,
28067
+ description: "Where the decision came from"
28068
+ },
28069
+ {
28070
+ name: "requirement",
28071
+ type: "AccessRequirement",
28072
+ required: true,
28073
+ description: "What was required"
28074
+ },
28075
+ {
28076
+ name: "allowed",
28077
+ type: "boolean",
28078
+ required: true,
28079
+ description: "Outcome"
28080
+ },
28081
+ {
28082
+ name: "missing",
28083
+ type: "{ roles: string[]; permissions: string[] }",
28084
+ required: true,
28085
+ description: "What the subject lacked"
28086
+ },
28087
+ {
28088
+ name: "subjectId",
28089
+ type: "string | null",
28090
+ required: true,
28091
+ description: "User checked (checks also run for other users)"
28092
+ },
28093
+ {
28094
+ name: "simulated",
28095
+ type: "boolean",
28096
+ required: true,
28097
+ description: "Decided against the 'view as' subject"
28098
+ },
28099
+ {
28100
+ name: "label",
28101
+ type: "string",
28102
+ required: false,
28103
+ description: "Nav item id/href, route path or 'METHOD /path'"
28104
+ },
28105
+ {
28106
+ name: "fields",
28107
+ type: "{ name: string; permission: string }[]",
28108
+ required: false,
28109
+ description: "'redacted' events: top-level response fields the API withheld and the permission each needs ('*' = not configured, default-deny). Reflects the real token, never 'view as'"
28110
+ },
28111
+ {
28112
+ name: "fieldsOmitted",
28113
+ type: "number",
28114
+ required: false,
28115
+ description: "'redacted' events: entries left out (X-Access-Redacted-Truncated plus the parser's 100-field cap)"
28116
+ }
28117
+ ]
28118
+ }
28119
+ ]
26689
28120
  }
26690
28121
  },
26691
28122
  types: [
@@ -27373,6 +28804,48 @@ formatUserRoles(user, { lowercase: true }); // "admin, manager"`
27373
28804
  }
27374
28805
  ]
27375
28806
  },
28807
+ {
28808
+ name: "SSOLinkCompleteResponse",
28809
+ description: "Result of completeSSOLink",
28810
+ properties: [
28811
+ {
28812
+ name: "linked",
28813
+ type: "true",
28814
+ required: true,
28815
+ description: "The link is written"
28816
+ },
28817
+ {
28818
+ name: "provider",
28819
+ type: "string",
28820
+ required: true,
28821
+ description: "SSO provider name"
28822
+ }
28823
+ ]
28824
+ },
28825
+ {
28826
+ name: "SSOLinkResult",
28827
+ description: "readSsoLinkResult() outcome: { status: 'pending'; code } (call completeSSOLink) or { status: 'error'; message: string | null }",
28828
+ properties: [
28829
+ {
28830
+ name: "status",
28831
+ type: "'pending' | 'error'",
28832
+ required: true,
28833
+ description: "Where the link round trip left the /account page"
28834
+ },
28835
+ {
28836
+ name: "code",
28837
+ type: "string",
28838
+ required: false,
28839
+ description: "One-time link code (pending only)"
28840
+ },
28841
+ {
28842
+ name: "message",
28843
+ type: "string | null",
28844
+ required: false,
28845
+ description: "Server's reason (error only)"
28846
+ }
28847
+ ]
28848
+ },
27376
28849
  {
27377
28850
  name: "SecurityEvent",
27378
28851
  description: "Security event log entry",
@@ -28974,6 +30447,37 @@ function registerAuthResources(server) {
28974
30447
  code: "import { authService, RoleDeniedError } from '@classic-homes/auth/core';\n\ntry {\n await authService.login(credentials, { allowedRoles: ['admin', 'agent'] });\n} catch (e) {\n if (e instanceof RoleDeniedError) {\n // User authenticated but lacks role\n }\n}",
28975
30448
  description: "Validate roles during login and handle access denial"
28976
30449
  },
30450
+ accessInspector: {
30451
+ code: `<!-- +layout.svelte (once). Admins: Ctrl+Shift+A or ?access-inspector=1 -->
30452
+ <script>
30453
+ import { AccessInspector, RequireAccess, requires } from '@classic-homes/access-inspector-svelte';
30454
+ </script>
30455
+
30456
+ <AccessInspector />
30457
+
30458
+ <RequireAccess permissions={['reports:read']} label="Reports">
30459
+ <ReportsCard />
30460
+ {#snippet fallback()}<p>No access</p>{/snippet}
30461
+ </RequireAccess>
30462
+
30463
+ <button use:requires={{ permissions: ['homes:update'] }}>Edit</button>`,
30464
+ description: "Admin permission troubleshooting: outlines gated UI, lists denials incl. API 403s with the roles that grant each permission (CHAPI /auth/access-catalog), and previews as another role. Import @classic-homes/access-inspector-core/styles.css once."
30465
+ },
30466
+ accessInspectorReact: {
30467
+ code: `// App root (once). Admins: Ctrl+Shift+A or ?access-inspector=1
30468
+ import { AccessInspector, RequireAccess, useRequires } from '@classic-homes/access-inspector-react';
30469
+
30470
+ <AccessInspector />
30471
+
30472
+ <RequireAccess permissions={['reports:read']} label="Reports" fallback={<p>No access</p>}>
30473
+ <ReportsCard />
30474
+ </RequireAccess>
30475
+
30476
+ const ref = useRef<HTMLButtonElement>(null);
30477
+ useRequires(ref, { permissions: ['homes:update'] });
30478
+ <button ref={ref}>Edit</button>`,
30479
+ description: "React binding of the Access Inspector (same markup and .chai- styles). Reads the session from authStore in @classic-homes/auth; useAccessInspector() gives state and open/close/setViewAs."
30480
+ },
28977
30481
  testing: {
28978
30482
  code: "import { setupTestAuth, mockUser, assertAuthenticated } from '@classic-homes/auth/testing';\n\nconst ctx = setupTestAuth();\n// Run tests\nctx.cleanup();",
28979
30483
  description: "Set up mocks for testing auth flows"
@@ -28992,7 +30496,7 @@ import { ResourceTemplate as ResourceTemplate4 } from "@modelcontextprotocol/sdk
28992
30496
 
28993
30497
  // src/data/notifications-catalog.json
28994
30498
  var notifications_catalog_default = {
28995
- version: "0.5.7",
30499
+ version: "0.5.9",
28996
30500
  packageName: "@classic-homes/notifications",
28997
30501
  description: "Notification services and Svelte bindings for Classic Theme apps",
28998
30502
  subpackages: {
@@ -29904,7 +31408,7 @@ function registerNotificationsResources(server) {
29904
31408
 
29905
31409
  // src/data/docs-catalog.json
29906
31410
  var docs_catalog_default = {
29907
- version: "0.5.7",
31411
+ version: "0.5.9",
29908
31412
  packageName: "@classic-homes/theme-docs",
29909
31413
  description: "Markdown documentation components for the Classic theme system",
29910
31414
  exports: {
@@ -31582,7 +33086,7 @@ function registerDocsResources(server) {
31582
33086
 
31583
33087
  // src/data/charts-catalog.json
31584
33088
  var charts_catalog_default = {
31585
- version: "0.5.7",
33089
+ version: "0.5.9",
31586
33090
  packageName: "@classic-homes/charts-core",
31587
33091
  description: "Core utilities, types, and themes for Classic Theme chart components",
31588
33092
  subpackages: {
@@ -35820,7 +37324,7 @@ interface SankeyData {
35820
37324
 
35821
37325
  // src/data/gantt-catalog.json
35822
37326
  var gantt_catalog_default = {
35823
- version: "0.5.7",
37327
+ version: "0.5.9",
35824
37328
  packageName: "@classic-homes/gantt-core",
35825
37329
  description: "Framework-agnostic Gantt engine: working calendars, a critical-path scheduler, an editable project model with undo/redo, timeline geometry, drag math, accessible descriptions and import/export. No DOM, no framework, no runtime dependencies. @classic-homes/gantt-svelte renders it; a React package (@classic-homes/gantt-react) is planned.",
35826
37330
  packages: {
@@ -36803,7 +38307,7 @@ function registerGanttResources(server) {
36803
38307
 
36804
38308
  // src/data/maps-catalog.json
36805
38309
  var maps_catalog_default = {
36806
- version: "0.5.7",
38310
+ version: "0.5.9",
36807
38311
  packageName: "@classic-homes/maps-core",
36808
38312
  description: "Core utilities, types, and themes for Classic Theme MapLibre GL components",
36809
38313
  subpackages: {
@@ -37446,12 +38950,12 @@ var maps_catalog_default = {
37446
38950
  ]
37447
38951
  },
37448
38952
  fingerprint: {
37449
- description: "Fast O(1) GeoJSON equality checking via fingerprinting",
38953
+ description: "GeoJSON change detection: count, first/last id and a content hash of every feature",
37450
38954
  functions: [
37451
38955
  {
37452
38956
  name: "createGeoJSONFingerprint",
37453
38957
  signature: "(data: GeoJSONFeatureCollection | GeoJSON.GeoJSON | string | null | undefined) => GeoJSONFingerprint",
37454
- description: "Create a lightweight fingerprint for fast equality comparison without deep comparison"
38958
+ description: "Fingerprint a FeatureCollection (count, first/last id, hash of every id, geometry and properties) in one pass"
37455
38959
  },
37456
38960
  {
37457
38961
  name: "fingerprintEqual",
@@ -39727,7 +41231,7 @@ var maps_catalog_default = {
39727
41231
  },
39728
41232
  {
39729
41233
  name: "GeoJSONFingerprint",
39730
- description: "Lightweight fingerprint for fast GeoJSON equality checking",
41234
+ description: "Fingerprint for GeoJSON change detection: count, first/last id and a content hash",
39731
41235
  properties: [
39732
41236
  {
39733
41237
  name: "count",
@@ -39746,6 +41250,12 @@ var maps_catalog_default = {
39746
41250
  type: "string | number | undefined",
39747
41251
  required: true,
39748
41252
  description: "ID of the last feature (undefined if no features or no ID)"
41253
+ },
41254
+ {
41255
+ name: "hash",
41256
+ type: "number",
41257
+ required: true,
41258
+ description: "Hash of every feature's id, geometry and properties (0 for no features)"
39749
41259
  }
39750
41260
  ]
39751
41261
  },
@@ -42429,7 +43939,7 @@ ${catalog6.quickReference.tailwindConfig}
42429
43939
 
42430
43940
  // src/data/native-catalog.json
42431
43941
  var native_catalog_default = {
42432
- version: "0.5.7",
43942
+ version: "0.5.9",
42433
43943
  packageName: "@classic-homes/native",
42434
43944
  description: "Native device APIs for iOS and Android mobile apps. Uses Capacitor for native functionality with web fallbacks.",
42435
43945
  subpackages: {
@@ -44139,7 +45649,7 @@ import { NativeGuard, usePlatformCheck } from '@classic-homes/native/react';
44139
45649
 
44140
45650
  // src/data/viewer-catalog.json
44141
45651
  var viewer_catalog_default = {
44142
- version: "0.5.7",
45652
+ version: "0.5.9",
44143
45653
  packageName: "@classic-homes/viewer-svelte",
44144
45654
  description: "Client-side, view-only document viewers: PDF, Word (.docx), Excel (.xlsx), CSV/TSV and CAD (DXF; DWG through the separate GPL package). Files are parsed and rendered in the browser; nothing is uploaded or converted on a server. Each format is a lazy-loaded subpath with an optional peer dependency, so apps only bundle what they register. Svelte 5 only; a React package (viewer-react) is planned.",
44145
45655
  packages: {
@@ -45198,7 +46708,7 @@ function registerPrompts(server) {
45198
46708
  // package.json
45199
46709
  var package_default = {
45200
46710
  name: "@classic-homes/theme-mcp",
45201
- version: "0.5.7",
46711
+ version: "0.5.9",
45202
46712
  description: "MCP server for Classic Theme design system - enables AI assistants to understand and correctly use components, tokens, and patterns",
45203
46713
  type: "module",
45204
46714
  main: "dist/index.js",
@@ -45297,4 +46807,4 @@ function createServer() {
45297
46807
  export {
45298
46808
  createServer
45299
46809
  };
45300
- //# sourceMappingURL=chunk-CJQWK7TC.js.map
46810
+ //# sourceMappingURL=chunk-QMLYHNH4.js.map