@ai4b-team/fsaos-gateway-sdk 3.3.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1742,6 +1742,249 @@ declare function useRealtimeQuery<T>(options: {
1742
1742
  enabled?: boolean;
1743
1743
  debounceMs?: number;
1744
1744
  }): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<T>, Error>;
1745
+ /**
1746
+ * Resolve an arrangement by semantic key with scope cascade.
1747
+ *
1748
+ * Calls `resolve-arrangement` with `{ key }` — the kernel cascades:
1749
+ * member scope → fractal scope → system scope → empty.
1750
+ *
1751
+ * Returns the fully resolved children (symlinks dereferenced, order/hidden
1752
+ * applied, can_do gated). The FE renders directly from `resolvedChildren`.
1753
+ *
1754
+ * For backward compatibility, passing a `parentPath` still works via the
1755
+ * legacy `item_id`/`path` resolution mode in the kernel.
1756
+ *
1757
+ * @example
1758
+ * // New key-based usage (recommended):
1759
+ * const { resolvedChildren, resolutionLevel } = useArrangement({ key: 'dock' });
1760
+ *
1761
+ * // Legacy path-based usage (backward compat):
1762
+ * const { resolvedChildren } = useArrangement({ path: '/root/system/arrangements/dock' });
1763
+ *
1764
+ * // Legacy string shorthand (backward compat):
1765
+ * const { resolvedChildren } = useArrangement('/root/system/arrangements/dock');
1766
+ */
1767
+ declare function useArrangement(paramsOrPath: string | {
1768
+ key?: string;
1769
+ path?: string;
1770
+ item_id?: string;
1771
+ } | null | undefined): {
1772
+ arrangement: any;
1773
+ resolvedChildren: any[];
1774
+ resolutionLevel: string | null;
1775
+ order: string[] | null;
1776
+ sourceScopeId: any;
1777
+ applyTo: <T extends {
1778
+ id?: string;
1779
+ name?: string;
1780
+ }>(children: T[]) => T[];
1781
+ data: any;
1782
+ error: Error;
1783
+ isError: true;
1784
+ isPending: false;
1785
+ isLoading: false;
1786
+ isLoadingError: false;
1787
+ isRefetchError: true;
1788
+ isSuccess: false;
1789
+ isPlaceholderData: false;
1790
+ status: "error";
1791
+ dataUpdatedAt: number;
1792
+ errorUpdatedAt: number;
1793
+ failureCount: number;
1794
+ failureReason: Error | null;
1795
+ errorUpdateCount: number;
1796
+ isFetched: boolean;
1797
+ isFetchedAfterMount: boolean;
1798
+ isFetching: boolean;
1799
+ isInitialLoading: boolean;
1800
+ isPaused: boolean;
1801
+ isRefetching: boolean;
1802
+ isStale: boolean;
1803
+ isEnabled: boolean;
1804
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1805
+ fetchStatus: _tanstack_react_query.FetchStatus;
1806
+ promise: Promise<any>;
1807
+ } | {
1808
+ arrangement: any;
1809
+ resolvedChildren: any[];
1810
+ resolutionLevel: string | null;
1811
+ order: string[] | null;
1812
+ sourceScopeId: any;
1813
+ applyTo: <T extends {
1814
+ id?: string;
1815
+ name?: string;
1816
+ }>(children: T[]) => T[];
1817
+ data: any;
1818
+ error: null;
1819
+ isError: false;
1820
+ isPending: false;
1821
+ isLoading: false;
1822
+ isLoadingError: false;
1823
+ isRefetchError: false;
1824
+ isSuccess: true;
1825
+ isPlaceholderData: false;
1826
+ status: "success";
1827
+ dataUpdatedAt: number;
1828
+ errorUpdatedAt: number;
1829
+ failureCount: number;
1830
+ failureReason: Error | null;
1831
+ errorUpdateCount: number;
1832
+ isFetched: boolean;
1833
+ isFetchedAfterMount: boolean;
1834
+ isFetching: boolean;
1835
+ isInitialLoading: boolean;
1836
+ isPaused: boolean;
1837
+ isRefetching: boolean;
1838
+ isStale: boolean;
1839
+ isEnabled: boolean;
1840
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1841
+ fetchStatus: _tanstack_react_query.FetchStatus;
1842
+ promise: Promise<any>;
1843
+ } | {
1844
+ arrangement: any;
1845
+ resolvedChildren: any[];
1846
+ resolutionLevel: string | null;
1847
+ order: string[] | null;
1848
+ sourceScopeId: any;
1849
+ applyTo: <T extends {
1850
+ id?: string;
1851
+ name?: string;
1852
+ }>(children: T[]) => T[];
1853
+ data: undefined;
1854
+ error: Error;
1855
+ isError: true;
1856
+ isPending: false;
1857
+ isLoading: false;
1858
+ isLoadingError: true;
1859
+ isRefetchError: false;
1860
+ isSuccess: false;
1861
+ isPlaceholderData: false;
1862
+ status: "error";
1863
+ dataUpdatedAt: number;
1864
+ errorUpdatedAt: number;
1865
+ failureCount: number;
1866
+ failureReason: Error | null;
1867
+ errorUpdateCount: number;
1868
+ isFetched: boolean;
1869
+ isFetchedAfterMount: boolean;
1870
+ isFetching: boolean;
1871
+ isInitialLoading: boolean;
1872
+ isPaused: boolean;
1873
+ isRefetching: boolean;
1874
+ isStale: boolean;
1875
+ isEnabled: boolean;
1876
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1877
+ fetchStatus: _tanstack_react_query.FetchStatus;
1878
+ promise: Promise<any>;
1879
+ } | {
1880
+ arrangement: any;
1881
+ resolvedChildren: any[];
1882
+ resolutionLevel: string | null;
1883
+ order: string[] | null;
1884
+ sourceScopeId: any;
1885
+ applyTo: <T extends {
1886
+ id?: string;
1887
+ name?: string;
1888
+ }>(children: T[]) => T[];
1889
+ data: undefined;
1890
+ error: null;
1891
+ isError: false;
1892
+ isPending: true;
1893
+ isLoading: true;
1894
+ isLoadingError: false;
1895
+ isRefetchError: false;
1896
+ isSuccess: false;
1897
+ isPlaceholderData: false;
1898
+ status: "pending";
1899
+ dataUpdatedAt: number;
1900
+ errorUpdatedAt: number;
1901
+ failureCount: number;
1902
+ failureReason: Error | null;
1903
+ errorUpdateCount: number;
1904
+ isFetched: boolean;
1905
+ isFetchedAfterMount: boolean;
1906
+ isFetching: boolean;
1907
+ isInitialLoading: boolean;
1908
+ isPaused: boolean;
1909
+ isRefetching: boolean;
1910
+ isStale: boolean;
1911
+ isEnabled: boolean;
1912
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1913
+ fetchStatus: _tanstack_react_query.FetchStatus;
1914
+ promise: Promise<any>;
1915
+ } | {
1916
+ arrangement: any;
1917
+ resolvedChildren: any[];
1918
+ resolutionLevel: string | null;
1919
+ order: string[] | null;
1920
+ sourceScopeId: any;
1921
+ applyTo: <T extends {
1922
+ id?: string;
1923
+ name?: string;
1924
+ }>(children: T[]) => T[];
1925
+ data: undefined;
1926
+ error: null;
1927
+ isError: false;
1928
+ isPending: true;
1929
+ isLoadingError: false;
1930
+ isRefetchError: false;
1931
+ isSuccess: false;
1932
+ isPlaceholderData: false;
1933
+ status: "pending";
1934
+ dataUpdatedAt: number;
1935
+ errorUpdatedAt: number;
1936
+ failureCount: number;
1937
+ failureReason: Error | null;
1938
+ errorUpdateCount: number;
1939
+ isFetched: boolean;
1940
+ isFetchedAfterMount: boolean;
1941
+ isFetching: boolean;
1942
+ isLoading: boolean;
1943
+ isInitialLoading: boolean;
1944
+ isPaused: boolean;
1945
+ isRefetching: boolean;
1946
+ isStale: boolean;
1947
+ isEnabled: boolean;
1948
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1949
+ fetchStatus: _tanstack_react_query.FetchStatus;
1950
+ promise: Promise<any>;
1951
+ } | {
1952
+ arrangement: any;
1953
+ resolvedChildren: any[];
1954
+ resolutionLevel: string | null;
1955
+ order: string[] | null;
1956
+ sourceScopeId: any;
1957
+ applyTo: <T extends {
1958
+ id?: string;
1959
+ name?: string;
1960
+ }>(children: T[]) => T[];
1961
+ data: any;
1962
+ isError: false;
1963
+ error: null;
1964
+ isPending: false;
1965
+ isLoading: false;
1966
+ isLoadingError: false;
1967
+ isRefetchError: false;
1968
+ isSuccess: true;
1969
+ isPlaceholderData: true;
1970
+ status: "success";
1971
+ dataUpdatedAt: number;
1972
+ errorUpdatedAt: number;
1973
+ failureCount: number;
1974
+ failureReason: Error | null;
1975
+ errorUpdateCount: number;
1976
+ isFetched: boolean;
1977
+ isFetchedAfterMount: boolean;
1978
+ isFetching: boolean;
1979
+ isInitialLoading: boolean;
1980
+ isPaused: boolean;
1981
+ isRefetching: boolean;
1982
+ isStale: boolean;
1983
+ isEnabled: boolean;
1984
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1985
+ fetchStatus: _tanstack_react_query.FetchStatus;
1986
+ promise: Promise<any>;
1987
+ };
1745
1988
 
1746
1989
  /**
1747
1990
  * @fsaos/gateway — Schema Interpretation Utilities
@@ -1931,4 +2174,4 @@ declare function uploadFile(file: File | Blob, options: UploadOptions, onProgres
1931
2174
  */
1932
2175
  declare function useFileUpload(): UseFileUploadReturn;
1933
2176
 
1934
- export { type AccountInfo, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, type GatewayParams, type GatewayResponse, type InfiniteChannelMessagesOptions, type ItemVersionsOptions, type ItemVersionsResult, type ItemsFilter, KernelProvider, type LinkParams, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PrincipalData, type ResolveParams, type ResolveResponse, type ResolveResultItem, type SessionEntry, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UploadItem, type UploadOptions, type UploadResult, type UseFileUploadReturn, type VFSEdge, type VFSItem, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
2177
+ export { type AccountInfo, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, type GatewayParams, type GatewayResponse, type InfiniteChannelMessagesOptions, type ItemVersionsOptions, type ItemVersionsResult, type ItemsFilter, KernelProvider, type LinkParams, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PrincipalData, type ResolveParams, type ResolveResponse, type ResolveResultItem, type SessionEntry, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UploadItem, type UploadOptions, type UploadResult, type UseFileUploadReturn, type VFSEdge, type VFSItem, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useArrangement, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
package/dist/index.d.ts CHANGED
@@ -1742,6 +1742,249 @@ declare function useRealtimeQuery<T>(options: {
1742
1742
  enabled?: boolean;
1743
1743
  debounceMs?: number;
1744
1744
  }): _tanstack_react_query.UseQueryResult<_tanstack_react_query.NoInfer<T>, Error>;
1745
+ /**
1746
+ * Resolve an arrangement by semantic key with scope cascade.
1747
+ *
1748
+ * Calls `resolve-arrangement` with `{ key }` — the kernel cascades:
1749
+ * member scope → fractal scope → system scope → empty.
1750
+ *
1751
+ * Returns the fully resolved children (symlinks dereferenced, order/hidden
1752
+ * applied, can_do gated). The FE renders directly from `resolvedChildren`.
1753
+ *
1754
+ * For backward compatibility, passing a `parentPath` still works via the
1755
+ * legacy `item_id`/`path` resolution mode in the kernel.
1756
+ *
1757
+ * @example
1758
+ * // New key-based usage (recommended):
1759
+ * const { resolvedChildren, resolutionLevel } = useArrangement({ key: 'dock' });
1760
+ *
1761
+ * // Legacy path-based usage (backward compat):
1762
+ * const { resolvedChildren } = useArrangement({ path: '/root/system/arrangements/dock' });
1763
+ *
1764
+ * // Legacy string shorthand (backward compat):
1765
+ * const { resolvedChildren } = useArrangement('/root/system/arrangements/dock');
1766
+ */
1767
+ declare function useArrangement(paramsOrPath: string | {
1768
+ key?: string;
1769
+ path?: string;
1770
+ item_id?: string;
1771
+ } | null | undefined): {
1772
+ arrangement: any;
1773
+ resolvedChildren: any[];
1774
+ resolutionLevel: string | null;
1775
+ order: string[] | null;
1776
+ sourceScopeId: any;
1777
+ applyTo: <T extends {
1778
+ id?: string;
1779
+ name?: string;
1780
+ }>(children: T[]) => T[];
1781
+ data: any;
1782
+ error: Error;
1783
+ isError: true;
1784
+ isPending: false;
1785
+ isLoading: false;
1786
+ isLoadingError: false;
1787
+ isRefetchError: true;
1788
+ isSuccess: false;
1789
+ isPlaceholderData: false;
1790
+ status: "error";
1791
+ dataUpdatedAt: number;
1792
+ errorUpdatedAt: number;
1793
+ failureCount: number;
1794
+ failureReason: Error | null;
1795
+ errorUpdateCount: number;
1796
+ isFetched: boolean;
1797
+ isFetchedAfterMount: boolean;
1798
+ isFetching: boolean;
1799
+ isInitialLoading: boolean;
1800
+ isPaused: boolean;
1801
+ isRefetching: boolean;
1802
+ isStale: boolean;
1803
+ isEnabled: boolean;
1804
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1805
+ fetchStatus: _tanstack_react_query.FetchStatus;
1806
+ promise: Promise<any>;
1807
+ } | {
1808
+ arrangement: any;
1809
+ resolvedChildren: any[];
1810
+ resolutionLevel: string | null;
1811
+ order: string[] | null;
1812
+ sourceScopeId: any;
1813
+ applyTo: <T extends {
1814
+ id?: string;
1815
+ name?: string;
1816
+ }>(children: T[]) => T[];
1817
+ data: any;
1818
+ error: null;
1819
+ isError: false;
1820
+ isPending: false;
1821
+ isLoading: false;
1822
+ isLoadingError: false;
1823
+ isRefetchError: false;
1824
+ isSuccess: true;
1825
+ isPlaceholderData: false;
1826
+ status: "success";
1827
+ dataUpdatedAt: number;
1828
+ errorUpdatedAt: number;
1829
+ failureCount: number;
1830
+ failureReason: Error | null;
1831
+ errorUpdateCount: number;
1832
+ isFetched: boolean;
1833
+ isFetchedAfterMount: boolean;
1834
+ isFetching: boolean;
1835
+ isInitialLoading: boolean;
1836
+ isPaused: boolean;
1837
+ isRefetching: boolean;
1838
+ isStale: boolean;
1839
+ isEnabled: boolean;
1840
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1841
+ fetchStatus: _tanstack_react_query.FetchStatus;
1842
+ promise: Promise<any>;
1843
+ } | {
1844
+ arrangement: any;
1845
+ resolvedChildren: any[];
1846
+ resolutionLevel: string | null;
1847
+ order: string[] | null;
1848
+ sourceScopeId: any;
1849
+ applyTo: <T extends {
1850
+ id?: string;
1851
+ name?: string;
1852
+ }>(children: T[]) => T[];
1853
+ data: undefined;
1854
+ error: Error;
1855
+ isError: true;
1856
+ isPending: false;
1857
+ isLoading: false;
1858
+ isLoadingError: true;
1859
+ isRefetchError: false;
1860
+ isSuccess: false;
1861
+ isPlaceholderData: false;
1862
+ status: "error";
1863
+ dataUpdatedAt: number;
1864
+ errorUpdatedAt: number;
1865
+ failureCount: number;
1866
+ failureReason: Error | null;
1867
+ errorUpdateCount: number;
1868
+ isFetched: boolean;
1869
+ isFetchedAfterMount: boolean;
1870
+ isFetching: boolean;
1871
+ isInitialLoading: boolean;
1872
+ isPaused: boolean;
1873
+ isRefetching: boolean;
1874
+ isStale: boolean;
1875
+ isEnabled: boolean;
1876
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1877
+ fetchStatus: _tanstack_react_query.FetchStatus;
1878
+ promise: Promise<any>;
1879
+ } | {
1880
+ arrangement: any;
1881
+ resolvedChildren: any[];
1882
+ resolutionLevel: string | null;
1883
+ order: string[] | null;
1884
+ sourceScopeId: any;
1885
+ applyTo: <T extends {
1886
+ id?: string;
1887
+ name?: string;
1888
+ }>(children: T[]) => T[];
1889
+ data: undefined;
1890
+ error: null;
1891
+ isError: false;
1892
+ isPending: true;
1893
+ isLoading: true;
1894
+ isLoadingError: false;
1895
+ isRefetchError: false;
1896
+ isSuccess: false;
1897
+ isPlaceholderData: false;
1898
+ status: "pending";
1899
+ dataUpdatedAt: number;
1900
+ errorUpdatedAt: number;
1901
+ failureCount: number;
1902
+ failureReason: Error | null;
1903
+ errorUpdateCount: number;
1904
+ isFetched: boolean;
1905
+ isFetchedAfterMount: boolean;
1906
+ isFetching: boolean;
1907
+ isInitialLoading: boolean;
1908
+ isPaused: boolean;
1909
+ isRefetching: boolean;
1910
+ isStale: boolean;
1911
+ isEnabled: boolean;
1912
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1913
+ fetchStatus: _tanstack_react_query.FetchStatus;
1914
+ promise: Promise<any>;
1915
+ } | {
1916
+ arrangement: any;
1917
+ resolvedChildren: any[];
1918
+ resolutionLevel: string | null;
1919
+ order: string[] | null;
1920
+ sourceScopeId: any;
1921
+ applyTo: <T extends {
1922
+ id?: string;
1923
+ name?: string;
1924
+ }>(children: T[]) => T[];
1925
+ data: undefined;
1926
+ error: null;
1927
+ isError: false;
1928
+ isPending: true;
1929
+ isLoadingError: false;
1930
+ isRefetchError: false;
1931
+ isSuccess: false;
1932
+ isPlaceholderData: false;
1933
+ status: "pending";
1934
+ dataUpdatedAt: number;
1935
+ errorUpdatedAt: number;
1936
+ failureCount: number;
1937
+ failureReason: Error | null;
1938
+ errorUpdateCount: number;
1939
+ isFetched: boolean;
1940
+ isFetchedAfterMount: boolean;
1941
+ isFetching: boolean;
1942
+ isLoading: boolean;
1943
+ isInitialLoading: boolean;
1944
+ isPaused: boolean;
1945
+ isRefetching: boolean;
1946
+ isStale: boolean;
1947
+ isEnabled: boolean;
1948
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1949
+ fetchStatus: _tanstack_react_query.FetchStatus;
1950
+ promise: Promise<any>;
1951
+ } | {
1952
+ arrangement: any;
1953
+ resolvedChildren: any[];
1954
+ resolutionLevel: string | null;
1955
+ order: string[] | null;
1956
+ sourceScopeId: any;
1957
+ applyTo: <T extends {
1958
+ id?: string;
1959
+ name?: string;
1960
+ }>(children: T[]) => T[];
1961
+ data: any;
1962
+ isError: false;
1963
+ error: null;
1964
+ isPending: false;
1965
+ isLoading: false;
1966
+ isLoadingError: false;
1967
+ isRefetchError: false;
1968
+ isSuccess: true;
1969
+ isPlaceholderData: true;
1970
+ status: "success";
1971
+ dataUpdatedAt: number;
1972
+ errorUpdatedAt: number;
1973
+ failureCount: number;
1974
+ failureReason: Error | null;
1975
+ errorUpdateCount: number;
1976
+ isFetched: boolean;
1977
+ isFetchedAfterMount: boolean;
1978
+ isFetching: boolean;
1979
+ isInitialLoading: boolean;
1980
+ isPaused: boolean;
1981
+ isRefetching: boolean;
1982
+ isStale: boolean;
1983
+ isEnabled: boolean;
1984
+ refetch: (options?: _tanstack_react_query.RefetchOptions) => Promise<_tanstack_react_query.QueryObserverResult<any, Error>>;
1985
+ fetchStatus: _tanstack_react_query.FetchStatus;
1986
+ promise: Promise<any>;
1987
+ };
1745
1988
 
1746
1989
  /**
1747
1990
  * @fsaos/gateway — Schema Interpretation Utilities
@@ -1931,4 +2174,4 @@ declare function uploadFile(file: File | Blob, options: UploadOptions, onProgres
1931
2174
  */
1932
2175
  declare function useFileUpload(): UseFileUploadReturn;
1933
2176
 
1934
- export { type AccountInfo, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, type GatewayParams, type GatewayResponse, type InfiniteChannelMessagesOptions, type ItemVersionsOptions, type ItemVersionsResult, type ItemsFilter, KernelProvider, type LinkParams, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PrincipalData, type ResolveParams, type ResolveResponse, type ResolveResultItem, type SessionEntry, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UploadItem, type UploadOptions, type UploadResult, type UseFileUploadReturn, type VFSEdge, type VFSItem, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
2177
+ export { type AccountInfo, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, type GatewayParams, type GatewayResponse, type InfiniteChannelMessagesOptions, type ItemVersionsOptions, type ItemVersionsResult, type ItemsFilter, KernelProvider, type LinkParams, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PrincipalData, type ResolveParams, type ResolveResponse, type ResolveResultItem, type SessionEntry, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UploadItem, type UploadOptions, type UploadResult, type UseFileUploadReturn, type VFSEdge, type VFSItem, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useArrangement, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
package/dist/index.js CHANGED
@@ -88,6 +88,7 @@ __export(src_exports, {
88
88
  uploadFile: () => uploadFile,
89
89
  useAccounts: () => useAccounts,
90
90
  useAllChannels: () => useAllChannels,
91
+ useArrangement: () => useArrangement,
91
92
  useAsset: () => useAsset,
92
93
  useAuth: () => useAuth,
93
94
  useChannelMessages: () => useChannelMessages,
@@ -2911,6 +2912,64 @@ function useRealtimeQuery(options) {
2911
2912
  }, [eventType, enabled, debounceMs, qc, JSON.stringify(queryKey)]);
2912
2913
  return query;
2913
2914
  }
2915
+ function useArrangement(paramsOrPath) {
2916
+ useScopeKey();
2917
+ const resolvedParams = useMemo(() => {
2918
+ if (!paramsOrPath) return null;
2919
+ if (typeof paramsOrPath === "string") return { path: paramsOrPath };
2920
+ return paramsOrPath;
2921
+ }, [typeof paramsOrPath === "string" ? paramsOrPath : JSON.stringify(paramsOrPath)]);
2922
+ const enabled = !!resolvedParams && !!(resolvedParams.key || resolvedParams.path || resolvedParams.item_id);
2923
+ const cacheKey = resolvedParams?.key ?? resolvedParams?.path ?? resolvedParams?.item_id ?? "";
2924
+ const query = useQuery({
2925
+ queryKey: ["vfs", getScope() ?? "__unscoped__", "arrangement", cacheKey],
2926
+ queryFn: async () => {
2927
+ if (!resolvedParams) return null;
2928
+ const response = await gatewayCall("resolve-arrangement", resolvedParams);
2929
+ if (response?.success === false) {
2930
+ console.warn("[useArrangement] resolve-arrangement failed:", response?.error);
2931
+ return null;
2932
+ }
2933
+ return response ?? null;
2934
+ },
2935
+ enabled
2936
+ });
2937
+ const arrangement = query.data ?? null;
2938
+ const resolvedChildren = useMemo(
2939
+ () => arrangement?.resolved_children ?? [],
2940
+ [arrangement]
2941
+ );
2942
+ const resolutionLevel = arrangement?.resolution_level ?? null;
2943
+ const order = useMemo(() => {
2944
+ const td = arrangement?.type_data ?? null;
2945
+ const o = td?.order;
2946
+ return Array.isArray(o) ? o : null;
2947
+ }, [arrangement]);
2948
+ const applyTo = useCallback(
2949
+ (children) => {
2950
+ if (!order || !children?.length) return children ?? [];
2951
+ const key = (c) => c.id ?? c.name ?? "";
2952
+ const rank = new Map(order.map((k, i) => [k, i]));
2953
+ const listed = [];
2954
+ const rest = [];
2955
+ for (const c of children) {
2956
+ (rank.has(key(c)) ? listed : rest).push(c);
2957
+ }
2958
+ listed.sort((a, b) => rank.get(key(a)) - rank.get(key(b)));
2959
+ return [...listed, ...rest];
2960
+ },
2961
+ [order]
2962
+ );
2963
+ return {
2964
+ ...query,
2965
+ arrangement,
2966
+ resolvedChildren,
2967
+ resolutionLevel,
2968
+ order,
2969
+ sourceScopeId: arrangement?.scope_item_id ?? null,
2970
+ applyTo
2971
+ };
2972
+ }
2914
2973
 
2915
2974
  // src/schema-utils.ts
2916
2975
  function keyToLabel(key) {
@@ -3298,6 +3357,6 @@ function useFileUpload() {
3298
3357
  // src/index.ts
3299
3358
  __registerSdkExports(src_exports);
3300
3359
 
3301
- export { ComponentRenderer, EnforcementDeniedError, KernelProvider, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
3360
+ export { ComponentRenderer, EnforcementDeniedError, KernelProvider, auth, awaitScopeReady, callTool, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAssetUrl, getDefaultSort, getRequiredFormFields, getScope, getScopeVersion, getSessionEntry, initSession, initVfsRealtimeWs, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isScopeReady, listChildren, mount, mountRealtimeScope, normalizeItem, ping, pushChanges, queryClient, readItem, registerCleanup, resetAllSdkState, resolvePrincipalId, setCachedToken, setScope, setupRequireShim, signal, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAllChannels, useArrangement, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useScope, useScopeReady, useSearch, useTheme, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, vfsKeys };
3302
3361
  //# sourceMappingURL=index.js.map
3303
3362
  //# sourceMappingURL=index.js.map