@ai4b-team/fsaos-gateway-sdk 3.34.0 → 3.34.2
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/README.md +6 -0
- package/dist/iife/gateway.js +5 -5
- package/dist/iife/gateway.js.map +4 -4
- package/dist/iife/ui.js +1 -1
- package/dist/index.cjs +343 -141
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +89 -67
- package/dist/index.d.ts +89 -67
- package/dist/index.js +340 -142
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -349,12 +349,14 @@ declare class EnforcementDeniedError extends Error {
|
|
|
349
349
|
type PersonalItemOrderKey = 'channel-order' | 'project-order';
|
|
350
350
|
/** Order a supplied complete collection using the selected Space member's arrangement.
|
|
351
351
|
* Does not discover items, provision preferences, or change an item's parent.
|
|
352
|
+
* Channels without a saved position appear first, newest creation first.
|
|
352
353
|
* Unknown saved IDs retain their positions when the visible subset is reordered.
|
|
353
354
|
* Paginated collection reads must apply arrangement order on the server before
|
|
354
355
|
* cutting pages; this hook is not a substitute for that read contract.
|
|
355
356
|
*/
|
|
356
357
|
declare function usePersonalItemOrder<T extends {
|
|
357
358
|
id: string;
|
|
359
|
+
createdAt?: string;
|
|
358
360
|
}>(key: PersonalItemOrderKey, items: readonly T[]): {
|
|
359
361
|
items: T[];
|
|
360
362
|
ready: boolean;
|
|
@@ -405,24 +407,6 @@ declare function trackAction(actionId: string, properties?: Record<string, unkno
|
|
|
405
407
|
/** Start only the browser adapters declared by the exact published source. */
|
|
406
408
|
declare function startTracking(options?: StartTrackingOptions): () => void;
|
|
407
409
|
|
|
408
|
-
interface InitializeFsaosOptions {
|
|
409
|
-
/** Resolve the registered hostname to its governed FSAOS scope. */
|
|
410
|
-
session?: boolean;
|
|
411
|
-
/** Start first-party page/action tracking, or provide adapter options. */
|
|
412
|
-
tracking?: boolean | StartTrackingOptions;
|
|
413
|
-
}
|
|
414
|
-
interface FsaosRuntime {
|
|
415
|
-
session: SessionEntry | null;
|
|
416
|
-
/** Stops the browser tracking adapter started by this runtime. */
|
|
417
|
-
dispose(): void;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Canonical one-call SDK bootstrap for RevDev pages and external React apps.
|
|
421
|
-
* Configuration must be provided through window.__FSAOS_CONFIG__ before the
|
|
422
|
-
* SDK module or IIFE loads, so every subsystem sees the same registered host.
|
|
423
|
-
*/
|
|
424
|
-
declare function initializeFsaos(options?: InitializeFsaosOptions): Promise<FsaosRuntime>;
|
|
425
|
-
|
|
426
410
|
/**
|
|
427
411
|
* @fsaos/gateway — Session Management
|
|
428
412
|
*
|
|
@@ -502,7 +486,9 @@ declare function isAnchorReady(): boolean;
|
|
|
502
486
|
* Elect the home anchor at login. Sets the anchor to it as well.
|
|
503
487
|
* Calling twice in one session is a programming error (logout re-elects).
|
|
504
488
|
*/
|
|
505
|
-
declare function electHomeAnchor(ref: MountRef
|
|
489
|
+
declare function electHomeAnchor(ref: MountRef, options?: {
|
|
490
|
+
activate?: boolean;
|
|
491
|
+
}): void;
|
|
506
492
|
declare function getHomeAnchor(): MountRef | null;
|
|
507
493
|
type MountListener = () => void;
|
|
508
494
|
declare function getMounts(): MountRef[];
|
|
@@ -527,6 +513,80 @@ declare const awaitScopeReady: typeof awaitAnchorReady;
|
|
|
527
513
|
/** @deprecated use isAnchorReady */
|
|
528
514
|
declare const isScopeReady: typeof isAnchorReady;
|
|
529
515
|
|
|
516
|
+
interface AccountInfo {
|
|
517
|
+
accountId: string;
|
|
518
|
+
path: string;
|
|
519
|
+
name: string;
|
|
520
|
+
role: string;
|
|
521
|
+
typeData: Record<string, unknown>;
|
|
522
|
+
joinedAt: string;
|
|
523
|
+
via?: 'direct' | 'cascade';
|
|
524
|
+
placement?: 'switcher_entry' | 'mount_only';
|
|
525
|
+
subordinateTo?: string | null;
|
|
526
|
+
cascadeAnchorId?: string | null;
|
|
527
|
+
isAccount?: boolean;
|
|
528
|
+
isSpace?: boolean;
|
|
529
|
+
isOwner?: boolean;
|
|
530
|
+
billingResponsible?: boolean;
|
|
531
|
+
grantedVia?: 'self_provisioned' | 'invitation' | 'purchase' | 'seat_assignment' | null;
|
|
532
|
+
grantedUnderAccountId?: string | null;
|
|
533
|
+
membershipPath?: string | null;
|
|
534
|
+
personalSpaceId?: string | null;
|
|
535
|
+
personalSpacePath?: string | null;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface WorkspaceOptions {
|
|
539
|
+
/** The authenticated account path returned by the host's token exchange. */
|
|
540
|
+
accountPath: string;
|
|
541
|
+
}
|
|
542
|
+
interface WorkspaceSession {
|
|
543
|
+
home: MountRef;
|
|
544
|
+
defaultSpace: MountRef;
|
|
545
|
+
memberships: AccountInfo[];
|
|
546
|
+
}
|
|
547
|
+
/** Shared bootstrap for external-token hosts as well as native-auth clients.
|
|
548
|
+
* This performs one membership read and one declaration read. It does not load
|
|
549
|
+
* channels, items, trees, or an aggregate Account view. Use useMounts() afterward.
|
|
550
|
+
* A token refresh must call this with the same account, not reset the session. */
|
|
551
|
+
declare function initializeWorkspace(options: WorkspaceOptions): Promise<WorkspaceSession>;
|
|
552
|
+
|
|
553
|
+
interface InitializeFsaosOptions {
|
|
554
|
+
/** Resolve the registered hostname to its governed FSAOS scope. */
|
|
555
|
+
session?: boolean;
|
|
556
|
+
/** Start first-party page/action tracking, or provide adapter options. */
|
|
557
|
+
tracking?: boolean | StartTrackingOptions;
|
|
558
|
+
/** Opt in to the mounted workspace lifecycle after host authentication. */
|
|
559
|
+
workspace?: WorkspaceOptions;
|
|
560
|
+
}
|
|
561
|
+
interface FsaosRuntime {
|
|
562
|
+
session: SessionEntry | null;
|
|
563
|
+
workspace?: WorkspaceSession;
|
|
564
|
+
/** Stops the browser tracking adapter started by this runtime. */
|
|
565
|
+
dispose(): void;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Canonical one-call SDK bootstrap for RevDev pages and external React apps.
|
|
569
|
+
* Configuration must be provided through window.__FSAOS_CONFIG__ before the
|
|
570
|
+
* SDK module or IIFE loads, so every subsystem sees the same registered host.
|
|
571
|
+
*/
|
|
572
|
+
declare function initializeFsaos(options?: InitializeFsaosOptions): Promise<FsaosRuntime>;
|
|
573
|
+
|
|
574
|
+
interface LoadMountsOptions {
|
|
575
|
+
/** Verified default working Space, used only when no declaration exists. */
|
|
576
|
+
initialAnchor?: MountRef;
|
|
577
|
+
}
|
|
578
|
+
/** One shared declaration read per session. Failures remain retryable and visible.
|
|
579
|
+
* Existing saved exclusions are retained; restoration never mounts newly joined
|
|
580
|
+
* Spaces. A fresh default is saved once before it is published. */
|
|
581
|
+
declare function loadMounts(memberSpacePath: string, resolveRef: (id: string) => MountRef | null, options?: LoadMountsOptions): Promise<MountRef[]>;
|
|
582
|
+
declare function mount$1(ref: MountRef): Promise<void>;
|
|
583
|
+
declare function unmount(id: string): Promise<void>;
|
|
584
|
+
/** Open a membership; retain the other mounts and save last_anchor. */
|
|
585
|
+
declare function selectMount(ref: MountRef): Promise<void>;
|
|
586
|
+
/** One explicit batch action (e.g. Account mount-all), never a render effect.
|
|
587
|
+
* Consumers must separately implement a backend-supported aggregate read filter. */
|
|
588
|
+
declare function replaceMounts(refs: MountRef[], anchor: MountRef): Promise<void>;
|
|
589
|
+
|
|
530
590
|
/**
|
|
531
591
|
* @fsaos/gateway — Gateway Call (RPC Dispatcher)
|
|
532
592
|
*
|
|
@@ -1396,35 +1456,13 @@ declare const auth: {
|
|
|
1396
1456
|
* Reads window.__FSAOS_COMPONENT__, wraps in QueryClientProvider,
|
|
1397
1457
|
* and renders via React 18+ createRoot.
|
|
1398
1458
|
*/
|
|
1399
|
-
declare function mount
|
|
1459
|
+
declare function mount(): void;
|
|
1400
1460
|
/**
|
|
1401
1461
|
* Set up the require() shim and window globals.
|
|
1402
1462
|
* Called by the build script's footer after the IIFE assigns window.__FSAOS_GATEWAY__.
|
|
1403
1463
|
*/
|
|
1404
1464
|
declare function setupRequireShim(): void;
|
|
1405
1465
|
|
|
1406
|
-
/**
|
|
1407
|
-
* @fsaos/gateway — Mount Persistence (the session fstab)
|
|
1408
|
-
*
|
|
1409
|
-
* The mount set is a DECLARATION, not device state: one settings item per
|
|
1410
|
-
* member space — <member>/space/settings item named 'mounts' —
|
|
1411
|
-
* type_data = { mounts: [item IDs], last_anchor: id }. IDs, not paths
|
|
1412
|
-
* (rename-stable). The kernel reads the same declaration when deriving the
|
|
1413
|
-
* confinement set (kernel_caller_confinement), so what the UI shows and what
|
|
1414
|
-
* the kernel serves agree by construction.
|
|
1415
|
-
*
|
|
1416
|
-
* Mountability (v1) = membership only:
|
|
1417
|
-
* - accounts: active member items within the HOME anchor's subtree
|
|
1418
|
-
* - spaces: active space member items, grouped by granted_under_account_id
|
|
1419
|
-
* The declaration can only NARROW what membership grants — the kernel
|
|
1420
|
-
* intersects; a stale or hostile declaration cannot widen visibility.
|
|
1421
|
-
*/
|
|
1422
|
-
|
|
1423
|
-
/** Mount: add to the working set and persist the declaration. */
|
|
1424
|
-
declare function mount(ref: MountRef): Promise<void>;
|
|
1425
|
-
/** Unmount: remove from the working set (anchor falls back to home) and persist. */
|
|
1426
|
-
declare function unmount(id: string): Promise<void>;
|
|
1427
|
-
|
|
1428
1466
|
/**
|
|
1429
1467
|
* Returns whether scope has been established. Useful for gating UI that
|
|
1430
1468
|
* depends on scope-aware data.
|
|
@@ -1907,26 +1945,7 @@ interface ScopeResult {
|
|
|
1907
1945
|
}
|
|
1908
1946
|
/** Returns the current scope session via initSession(). */
|
|
1909
1947
|
declare function useScope(): ScopeResult;
|
|
1910
|
-
|
|
1911
|
-
accountId: string;
|
|
1912
|
-
path: string;
|
|
1913
|
-
name: string;
|
|
1914
|
-
role: string;
|
|
1915
|
-
typeData: Record<string, unknown>;
|
|
1916
|
-
joinedAt: string;
|
|
1917
|
-
via?: 'direct' | 'cascade';
|
|
1918
|
-
placement?: 'switcher_entry' | 'mount_only';
|
|
1919
|
-
subordinateTo?: string | null;
|
|
1920
|
-
cascadeAnchorId?: string | null;
|
|
1921
|
-
isAccount?: boolean;
|
|
1922
|
-
isSpace?: boolean;
|
|
1923
|
-
isOwner?: boolean;
|
|
1924
|
-
billingResponsible?: boolean;
|
|
1925
|
-
grantedVia?: 'self_provisioned' | 'invitation' | 'purchase' | 'seat_assignment' | null;
|
|
1926
|
-
grantedUnderAccountId?: string | null;
|
|
1927
|
-
personalSpaceId?: string | null;
|
|
1928
|
-
personalSpacePath?: string | null;
|
|
1929
|
-
}
|
|
1948
|
+
|
|
1930
1949
|
interface AccountsState {
|
|
1931
1950
|
/** Election candidates — accounts the user can log into (top-level forest first). */
|
|
1932
1951
|
accounts: AccountInfo[];
|
|
@@ -1937,9 +1956,9 @@ interface AccountsState {
|
|
|
1937
1956
|
/** @deprecated read useMounts() — kept until compass migrates this sprint. */
|
|
1938
1957
|
mountedScope: string | null;
|
|
1939
1958
|
/** Elect the HOME anchor (login) or move the anchor (in-session step-into). */
|
|
1940
|
-
switchAccount: (accountPath: string) => void
|
|
1959
|
+
switchAccount: (accountPath: string) => Promise<void>;
|
|
1941
1960
|
/** Mount a membership into the working set (persists the declaration). */
|
|
1942
|
-
mountScope: (scopePath: string) => void
|
|
1961
|
+
mountScope: (scopePath: string) => Promise<void>;
|
|
1943
1962
|
loading: boolean;
|
|
1944
1963
|
error: Error | null;
|
|
1945
1964
|
}
|
|
@@ -1950,8 +1969,9 @@ declare function useMounts(): {
|
|
|
1950
1969
|
mounts: MountRef[];
|
|
1951
1970
|
homeAnchor: MountRef | null;
|
|
1952
1971
|
anchor: MountRef | null;
|
|
1953
|
-
setAnchor: typeof
|
|
1954
|
-
|
|
1972
|
+
setAnchor: typeof selectMount;
|
|
1973
|
+
replaceMounts: typeof replaceMounts;
|
|
1974
|
+
mount: typeof mount$1;
|
|
1955
1975
|
unmount: typeof unmount;
|
|
1956
1976
|
};
|
|
1957
1977
|
interface AuthState {
|
|
@@ -2157,6 +2177,8 @@ interface Channel {
|
|
|
2157
2177
|
isPrivate: boolean;
|
|
2158
2178
|
isDm: boolean;
|
|
2159
2179
|
messageCount: number;
|
|
2180
|
+
/** Canonical creation time, used for channels without a saved manual position. */
|
|
2181
|
+
createdAt?: string;
|
|
2160
2182
|
updatedAt: string;
|
|
2161
2183
|
chatScopePath: string;
|
|
2162
2184
|
contextId: string;
|
|
@@ -3184,4 +3206,4 @@ declare function usePinnedItems(): {
|
|
|
3184
3206
|
reorder: (ids: string[]) => Promise<any>;
|
|
3185
3207
|
};
|
|
3186
3208
|
|
|
3187
|
-
export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayResponse, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type TimelineEvent, type TimelineHistoryEvent, type TimelineHistoryOptions, type TrackEventOptions, type TurnQueueEntry, type TurnQueueEntryState, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UpdatePrincipalParams, type UploadItem, type UploadOptions, type UploadResult, type UseArtifactStreamReturn, type UseFileUploadReturn, type UseTimelineHistoryReturn, type VFSEdge, type VFSItem, type WorkCorrelation, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, electHomeAnchor, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchResolvedItems, fetchTimelineHistory, fetchTurnQueueEntries, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAnchor, getAnchorRef, getAnchorVersion, getAssetUrl, getDefaultSort, getHomeAnchor, getMountVersion, getMounts, getPathSubscriptionState, getQueryClient, getRequiredFormFields, getScope, getScopeVersion, getServerClockOffsetMs, getServerClockSyncedAt, getSessionEntry, hasServerClock, initSession, initVfsRealtimeWs, initializeFsaos, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren,
|
|
3209
|
+
export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayResponse, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type LoadMountsOptions, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type TimelineEvent, type TimelineHistoryEvent, type TimelineHistoryOptions, type TrackEventOptions, type TurnQueueEntry, type TurnQueueEntryState, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UpdatePrincipalParams, type UploadItem, type UploadOptions, type UploadResult, type UseArtifactStreamReturn, type UseFileUploadReturn, type UseTimelineHistoryReturn, type VFSEdge, type VFSItem, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, electHomeAnchor, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchResolvedItems, fetchTimelineHistory, fetchTurnQueueEntries, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAnchor, getAnchorRef, getAnchorVersion, getAssetUrl, getDefaultSort, getHomeAnchor, getMountVersion, getMounts, getPathSubscriptionState, getQueryClient, getRequiredFormFields, getScope, getScopeVersion, getServerClockOffsetMs, getServerClockSyncedAt, getSessionEntry, hasServerClock, initSession, initVfsRealtimeWs, initializeFsaos, initializeWorkspace, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren, loadMounts, mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, ping, pushChanges, queryClient, readItem, refreshQuery, registerCleanup, replaceMounts, resetAllSdkState, resolvePrincipalId, resubscribePath, selectMount, serverDeadlinePassed, serverMsUntil, serverNow, setAnchor, setCachedToken, setQueryClient, setScope, setupRequireShim, signal, startTracking, steerTurn, submitForm, subscribeAnchor, subscribeArtifactStream, subscribeMounts, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, trackAction, trackEvent, trackPageView, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAgentTimeline, useAllChannels, useArrangement, useArtifactStream, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
|
package/dist/index.d.ts
CHANGED
|
@@ -349,12 +349,14 @@ declare class EnforcementDeniedError extends Error {
|
|
|
349
349
|
type PersonalItemOrderKey = 'channel-order' | 'project-order';
|
|
350
350
|
/** Order a supplied complete collection using the selected Space member's arrangement.
|
|
351
351
|
* Does not discover items, provision preferences, or change an item's parent.
|
|
352
|
+
* Channels without a saved position appear first, newest creation first.
|
|
352
353
|
* Unknown saved IDs retain their positions when the visible subset is reordered.
|
|
353
354
|
* Paginated collection reads must apply arrangement order on the server before
|
|
354
355
|
* cutting pages; this hook is not a substitute for that read contract.
|
|
355
356
|
*/
|
|
356
357
|
declare function usePersonalItemOrder<T extends {
|
|
357
358
|
id: string;
|
|
359
|
+
createdAt?: string;
|
|
358
360
|
}>(key: PersonalItemOrderKey, items: readonly T[]): {
|
|
359
361
|
items: T[];
|
|
360
362
|
ready: boolean;
|
|
@@ -405,24 +407,6 @@ declare function trackAction(actionId: string, properties?: Record<string, unkno
|
|
|
405
407
|
/** Start only the browser adapters declared by the exact published source. */
|
|
406
408
|
declare function startTracking(options?: StartTrackingOptions): () => void;
|
|
407
409
|
|
|
408
|
-
interface InitializeFsaosOptions {
|
|
409
|
-
/** Resolve the registered hostname to its governed FSAOS scope. */
|
|
410
|
-
session?: boolean;
|
|
411
|
-
/** Start first-party page/action tracking, or provide adapter options. */
|
|
412
|
-
tracking?: boolean | StartTrackingOptions;
|
|
413
|
-
}
|
|
414
|
-
interface FsaosRuntime {
|
|
415
|
-
session: SessionEntry | null;
|
|
416
|
-
/** Stops the browser tracking adapter started by this runtime. */
|
|
417
|
-
dispose(): void;
|
|
418
|
-
}
|
|
419
|
-
/**
|
|
420
|
-
* Canonical one-call SDK bootstrap for RevDev pages and external React apps.
|
|
421
|
-
* Configuration must be provided through window.__FSAOS_CONFIG__ before the
|
|
422
|
-
* SDK module or IIFE loads, so every subsystem sees the same registered host.
|
|
423
|
-
*/
|
|
424
|
-
declare function initializeFsaos(options?: InitializeFsaosOptions): Promise<FsaosRuntime>;
|
|
425
|
-
|
|
426
410
|
/**
|
|
427
411
|
* @fsaos/gateway — Session Management
|
|
428
412
|
*
|
|
@@ -502,7 +486,9 @@ declare function isAnchorReady(): boolean;
|
|
|
502
486
|
* Elect the home anchor at login. Sets the anchor to it as well.
|
|
503
487
|
* Calling twice in one session is a programming error (logout re-elects).
|
|
504
488
|
*/
|
|
505
|
-
declare function electHomeAnchor(ref: MountRef
|
|
489
|
+
declare function electHomeAnchor(ref: MountRef, options?: {
|
|
490
|
+
activate?: boolean;
|
|
491
|
+
}): void;
|
|
506
492
|
declare function getHomeAnchor(): MountRef | null;
|
|
507
493
|
type MountListener = () => void;
|
|
508
494
|
declare function getMounts(): MountRef[];
|
|
@@ -527,6 +513,80 @@ declare const awaitScopeReady: typeof awaitAnchorReady;
|
|
|
527
513
|
/** @deprecated use isAnchorReady */
|
|
528
514
|
declare const isScopeReady: typeof isAnchorReady;
|
|
529
515
|
|
|
516
|
+
interface AccountInfo {
|
|
517
|
+
accountId: string;
|
|
518
|
+
path: string;
|
|
519
|
+
name: string;
|
|
520
|
+
role: string;
|
|
521
|
+
typeData: Record<string, unknown>;
|
|
522
|
+
joinedAt: string;
|
|
523
|
+
via?: 'direct' | 'cascade';
|
|
524
|
+
placement?: 'switcher_entry' | 'mount_only';
|
|
525
|
+
subordinateTo?: string | null;
|
|
526
|
+
cascadeAnchorId?: string | null;
|
|
527
|
+
isAccount?: boolean;
|
|
528
|
+
isSpace?: boolean;
|
|
529
|
+
isOwner?: boolean;
|
|
530
|
+
billingResponsible?: boolean;
|
|
531
|
+
grantedVia?: 'self_provisioned' | 'invitation' | 'purchase' | 'seat_assignment' | null;
|
|
532
|
+
grantedUnderAccountId?: string | null;
|
|
533
|
+
membershipPath?: string | null;
|
|
534
|
+
personalSpaceId?: string | null;
|
|
535
|
+
personalSpacePath?: string | null;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface WorkspaceOptions {
|
|
539
|
+
/** The authenticated account path returned by the host's token exchange. */
|
|
540
|
+
accountPath: string;
|
|
541
|
+
}
|
|
542
|
+
interface WorkspaceSession {
|
|
543
|
+
home: MountRef;
|
|
544
|
+
defaultSpace: MountRef;
|
|
545
|
+
memberships: AccountInfo[];
|
|
546
|
+
}
|
|
547
|
+
/** Shared bootstrap for external-token hosts as well as native-auth clients.
|
|
548
|
+
* This performs one membership read and one declaration read. It does not load
|
|
549
|
+
* channels, items, trees, or an aggregate Account view. Use useMounts() afterward.
|
|
550
|
+
* A token refresh must call this with the same account, not reset the session. */
|
|
551
|
+
declare function initializeWorkspace(options: WorkspaceOptions): Promise<WorkspaceSession>;
|
|
552
|
+
|
|
553
|
+
interface InitializeFsaosOptions {
|
|
554
|
+
/** Resolve the registered hostname to its governed FSAOS scope. */
|
|
555
|
+
session?: boolean;
|
|
556
|
+
/** Start first-party page/action tracking, or provide adapter options. */
|
|
557
|
+
tracking?: boolean | StartTrackingOptions;
|
|
558
|
+
/** Opt in to the mounted workspace lifecycle after host authentication. */
|
|
559
|
+
workspace?: WorkspaceOptions;
|
|
560
|
+
}
|
|
561
|
+
interface FsaosRuntime {
|
|
562
|
+
session: SessionEntry | null;
|
|
563
|
+
workspace?: WorkspaceSession;
|
|
564
|
+
/** Stops the browser tracking adapter started by this runtime. */
|
|
565
|
+
dispose(): void;
|
|
566
|
+
}
|
|
567
|
+
/**
|
|
568
|
+
* Canonical one-call SDK bootstrap for RevDev pages and external React apps.
|
|
569
|
+
* Configuration must be provided through window.__FSAOS_CONFIG__ before the
|
|
570
|
+
* SDK module or IIFE loads, so every subsystem sees the same registered host.
|
|
571
|
+
*/
|
|
572
|
+
declare function initializeFsaos(options?: InitializeFsaosOptions): Promise<FsaosRuntime>;
|
|
573
|
+
|
|
574
|
+
interface LoadMountsOptions {
|
|
575
|
+
/** Verified default working Space, used only when no declaration exists. */
|
|
576
|
+
initialAnchor?: MountRef;
|
|
577
|
+
}
|
|
578
|
+
/** One shared declaration read per session. Failures remain retryable and visible.
|
|
579
|
+
* Existing saved exclusions are retained; restoration never mounts newly joined
|
|
580
|
+
* Spaces. A fresh default is saved once before it is published. */
|
|
581
|
+
declare function loadMounts(memberSpacePath: string, resolveRef: (id: string) => MountRef | null, options?: LoadMountsOptions): Promise<MountRef[]>;
|
|
582
|
+
declare function mount$1(ref: MountRef): Promise<void>;
|
|
583
|
+
declare function unmount(id: string): Promise<void>;
|
|
584
|
+
/** Open a membership; retain the other mounts and save last_anchor. */
|
|
585
|
+
declare function selectMount(ref: MountRef): Promise<void>;
|
|
586
|
+
/** One explicit batch action (e.g. Account mount-all), never a render effect.
|
|
587
|
+
* Consumers must separately implement a backend-supported aggregate read filter. */
|
|
588
|
+
declare function replaceMounts(refs: MountRef[], anchor: MountRef): Promise<void>;
|
|
589
|
+
|
|
530
590
|
/**
|
|
531
591
|
* @fsaos/gateway — Gateway Call (RPC Dispatcher)
|
|
532
592
|
*
|
|
@@ -1396,35 +1456,13 @@ declare const auth: {
|
|
|
1396
1456
|
* Reads window.__FSAOS_COMPONENT__, wraps in QueryClientProvider,
|
|
1397
1457
|
* and renders via React 18+ createRoot.
|
|
1398
1458
|
*/
|
|
1399
|
-
declare function mount
|
|
1459
|
+
declare function mount(): void;
|
|
1400
1460
|
/**
|
|
1401
1461
|
* Set up the require() shim and window globals.
|
|
1402
1462
|
* Called by the build script's footer after the IIFE assigns window.__FSAOS_GATEWAY__.
|
|
1403
1463
|
*/
|
|
1404
1464
|
declare function setupRequireShim(): void;
|
|
1405
1465
|
|
|
1406
|
-
/**
|
|
1407
|
-
* @fsaos/gateway — Mount Persistence (the session fstab)
|
|
1408
|
-
*
|
|
1409
|
-
* The mount set is a DECLARATION, not device state: one settings item per
|
|
1410
|
-
* member space — <member>/space/settings item named 'mounts' —
|
|
1411
|
-
* type_data = { mounts: [item IDs], last_anchor: id }. IDs, not paths
|
|
1412
|
-
* (rename-stable). The kernel reads the same declaration when deriving the
|
|
1413
|
-
* confinement set (kernel_caller_confinement), so what the UI shows and what
|
|
1414
|
-
* the kernel serves agree by construction.
|
|
1415
|
-
*
|
|
1416
|
-
* Mountability (v1) = membership only:
|
|
1417
|
-
* - accounts: active member items within the HOME anchor's subtree
|
|
1418
|
-
* - spaces: active space member items, grouped by granted_under_account_id
|
|
1419
|
-
* The declaration can only NARROW what membership grants — the kernel
|
|
1420
|
-
* intersects; a stale or hostile declaration cannot widen visibility.
|
|
1421
|
-
*/
|
|
1422
|
-
|
|
1423
|
-
/** Mount: add to the working set and persist the declaration. */
|
|
1424
|
-
declare function mount(ref: MountRef): Promise<void>;
|
|
1425
|
-
/** Unmount: remove from the working set (anchor falls back to home) and persist. */
|
|
1426
|
-
declare function unmount(id: string): Promise<void>;
|
|
1427
|
-
|
|
1428
1466
|
/**
|
|
1429
1467
|
* Returns whether scope has been established. Useful for gating UI that
|
|
1430
1468
|
* depends on scope-aware data.
|
|
@@ -1907,26 +1945,7 @@ interface ScopeResult {
|
|
|
1907
1945
|
}
|
|
1908
1946
|
/** Returns the current scope session via initSession(). */
|
|
1909
1947
|
declare function useScope(): ScopeResult;
|
|
1910
|
-
|
|
1911
|
-
accountId: string;
|
|
1912
|
-
path: string;
|
|
1913
|
-
name: string;
|
|
1914
|
-
role: string;
|
|
1915
|
-
typeData: Record<string, unknown>;
|
|
1916
|
-
joinedAt: string;
|
|
1917
|
-
via?: 'direct' | 'cascade';
|
|
1918
|
-
placement?: 'switcher_entry' | 'mount_only';
|
|
1919
|
-
subordinateTo?: string | null;
|
|
1920
|
-
cascadeAnchorId?: string | null;
|
|
1921
|
-
isAccount?: boolean;
|
|
1922
|
-
isSpace?: boolean;
|
|
1923
|
-
isOwner?: boolean;
|
|
1924
|
-
billingResponsible?: boolean;
|
|
1925
|
-
grantedVia?: 'self_provisioned' | 'invitation' | 'purchase' | 'seat_assignment' | null;
|
|
1926
|
-
grantedUnderAccountId?: string | null;
|
|
1927
|
-
personalSpaceId?: string | null;
|
|
1928
|
-
personalSpacePath?: string | null;
|
|
1929
|
-
}
|
|
1948
|
+
|
|
1930
1949
|
interface AccountsState {
|
|
1931
1950
|
/** Election candidates — accounts the user can log into (top-level forest first). */
|
|
1932
1951
|
accounts: AccountInfo[];
|
|
@@ -1937,9 +1956,9 @@ interface AccountsState {
|
|
|
1937
1956
|
/** @deprecated read useMounts() — kept until compass migrates this sprint. */
|
|
1938
1957
|
mountedScope: string | null;
|
|
1939
1958
|
/** Elect the HOME anchor (login) or move the anchor (in-session step-into). */
|
|
1940
|
-
switchAccount: (accountPath: string) => void
|
|
1959
|
+
switchAccount: (accountPath: string) => Promise<void>;
|
|
1941
1960
|
/** Mount a membership into the working set (persists the declaration). */
|
|
1942
|
-
mountScope: (scopePath: string) => void
|
|
1961
|
+
mountScope: (scopePath: string) => Promise<void>;
|
|
1943
1962
|
loading: boolean;
|
|
1944
1963
|
error: Error | null;
|
|
1945
1964
|
}
|
|
@@ -1950,8 +1969,9 @@ declare function useMounts(): {
|
|
|
1950
1969
|
mounts: MountRef[];
|
|
1951
1970
|
homeAnchor: MountRef | null;
|
|
1952
1971
|
anchor: MountRef | null;
|
|
1953
|
-
setAnchor: typeof
|
|
1954
|
-
|
|
1972
|
+
setAnchor: typeof selectMount;
|
|
1973
|
+
replaceMounts: typeof replaceMounts;
|
|
1974
|
+
mount: typeof mount$1;
|
|
1955
1975
|
unmount: typeof unmount;
|
|
1956
1976
|
};
|
|
1957
1977
|
interface AuthState {
|
|
@@ -2157,6 +2177,8 @@ interface Channel {
|
|
|
2157
2177
|
isPrivate: boolean;
|
|
2158
2178
|
isDm: boolean;
|
|
2159
2179
|
messageCount: number;
|
|
2180
|
+
/** Canonical creation time, used for channels without a saved manual position. */
|
|
2181
|
+
createdAt?: string;
|
|
2160
2182
|
updatedAt: string;
|
|
2161
2183
|
chatScopePath: string;
|
|
2162
2184
|
contextId: string;
|
|
@@ -3184,4 +3206,4 @@ declare function usePinnedItems(): {
|
|
|
3184
3206
|
reorder: (ids: string[]) => Promise<any>;
|
|
3185
3207
|
};
|
|
3186
3208
|
|
|
3187
|
-
export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayResponse, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type TimelineEvent, type TimelineHistoryEvent, type TimelineHistoryOptions, type TrackEventOptions, type TurnQueueEntry, type TurnQueueEntryState, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UpdatePrincipalParams, type UploadItem, type UploadOptions, type UploadResult, type UseArtifactStreamReturn, type UseFileUploadReturn, type UseTimelineHistoryReturn, type VFSEdge, type VFSItem, type WorkCorrelation, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, electHomeAnchor, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchResolvedItems, fetchTimelineHistory, fetchTurnQueueEntries, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAnchor, getAnchorRef, getAnchorVersion, getAssetUrl, getDefaultSort, getHomeAnchor, getMountVersion, getMounts, getPathSubscriptionState, getQueryClient, getRequiredFormFields, getScope, getScopeVersion, getServerClockOffsetMs, getServerClockSyncedAt, getSessionEntry, hasServerClock, initSession, initVfsRealtimeWs, initializeFsaos, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren,
|
|
3209
|
+
export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayResponse, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type LoadMountsOptions, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type TimelineEvent, type TimelineHistoryEvent, type TimelineHistoryOptions, type TrackEventOptions, type TurnQueueEntry, type TurnQueueEntryState, type TypeDefinition, type TypeHelpers, type TypeSchema, type UnreadCountsOptions, type UpdateParams, type UpdatePrincipalParams, type UploadItem, type UploadOptions, type UploadResult, type UseArtifactStreamReturn, type UseFileUploadReturn, type UseTimelineHistoryReturn, type VFSEdge, type VFSItem, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, createItem, disconnectSSE, disposeVfsRealtimeWs, electHomeAnchor, emitEvent, fetchChannelMessages, fetchChannelMessagesPage, fetchChannelMessagesWithCards, fetchEdgesForItem, fetchItemHistory, fetchItemVersions, fetchItems, fetchMemberFocus, fetchOpenEnvelope, fetchRecentActivity, fetchResolvedItems, fetchTimelineHistory, fetchTurnQueueEntries, fetchTypeDefinitions, fetchVfsChildren, fetchVfsChildrenPage, fetchVfsItem, fetchVfsItemById, fetchVfsTree, gatewayCall, getAccessToken, getAnchor, getAnchorRef, getAnchorVersion, getAssetUrl, getDefaultSort, getHomeAnchor, getMountVersion, getMounts, getPathSubscriptionState, getQueryClient, getRequiredFormFields, getScope, getScopeVersion, getServerClockOffsetMs, getServerClockSyncedAt, getSessionEntry, hasServerClock, initSession, initVfsRealtimeWs, initializeFsaos, initializeWorkspace, interpretSchema, invalidateAllVfs, invalidateChannelMessages, invalidateChildren, invalidateItem, invalidateOpenEnvelope, invalidatePathAndParent, invalidateSubtree, invalidateTypes, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren, loadMounts, mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, ping, pushChanges, queryClient, readItem, refreshQuery, registerCleanup, replaceMounts, resetAllSdkState, resolvePrincipalId, resubscribePath, selectMount, serverDeadlinePassed, serverMsUntil, serverNow, setAnchor, setCachedToken, setQueryClient, setScope, setupRequireShim, signal, startTracking, steerTurn, submitForm, subscribeAnchor, subscribeArtifactStream, subscribeMounts, subscribeScope, subscribeToEvents, subscribeToPath, subscribeToScope, trackAction, trackEvent, trackPageView, unmountRealtimeScope, updateItem, uploadFile, useAccounts, useAgentTimeline, useAllChannels, useArrangement, useArtifactStream, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
|