@ai4b-team/fsaos-gateway-sdk 4.1.0 → 4.2.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
@@ -170,8 +170,16 @@ interface CreateParams {
170
170
  type_data?: Record<string, any>;
171
171
  [key: string]: unknown;
172
172
  }
173
+ /**
174
+ * `type_data` MERGES at the top level: each key sent replaces that whole key,
175
+ * keys not sent are kept. `{ type_data: { ai_mode: 'strict' } }` changes the
176
+ * mode and nothing else; `{ type_data: { _remove_keys: ['x'] } }` deletes a
177
+ * key. A channel's `name` (its path) is governed and refused — change
178
+ * `type_data.display_name` instead.
179
+ */
173
180
  interface UpdateParams {
174
- path: string;
181
+ path?: string;
182
+ id?: string;
175
183
  name?: string;
176
184
  type_data?: Record<string, any>;
177
185
  [key: string]: unknown;
@@ -191,6 +199,11 @@ interface LinkParams {
191
199
  target_id: string;
192
200
  edge_type?: string;
193
201
  weight?: number;
202
+ /**
203
+ * Edge context. For `has_member` (a seat on a chat or breakout) `context.role`
204
+ * is the member's ladder role on that chat — viewer, commenter, editor, admin
205
+ * or owner; absent reads as editor. There is no `metadata` field on an edge.
206
+ */
194
207
  context?: Record<string, any>;
195
208
  [key: string]: unknown;
196
209
  }
@@ -2846,6 +2859,177 @@ declare function useMintedAsset(params: {
2846
2859
  scopePath?: string | null;
2847
2860
  }): MintedAsset;
2848
2861
 
2862
+ /** The ladder: what a member may do in a scope or on a chat. */
2863
+ type MemberRole = 'viewer' | 'commenter' | 'editor' | 'admin' | 'owner';
2864
+ interface InviteMemberParams {
2865
+ /** The person to invite. */
2866
+ email: string;
2867
+ /** The account (or space) they are invited into. */
2868
+ target_scope_id: string;
2869
+ /**
2870
+ * Their standing in that scope — a ladder role, default `editor`. The kernel
2871
+ * refuses `ROLE_ABOVE_INVITER` when it is above the inviter's own role.
2872
+ */
2873
+ role?: MemberRole;
2874
+ [key: string]: unknown;
2875
+ }
2876
+ interface InviteMemberResult {
2877
+ success: true;
2878
+ /** The member item the invite minted — `pending` until the person accepts. */
2879
+ member_id: string;
2880
+ member_path?: string;
2881
+ status: 'pending' | 'active';
2882
+ role: MemberRole;
2883
+ email: string;
2884
+ /** `invited_to_scope` for an account, `invited_to_space` for a space. */
2885
+ action: string;
2886
+ /** True when the email already belongs to a principal (they are seated on accept all the same). */
2887
+ principal_exists?: boolean;
2888
+ [key: string]: unknown;
2889
+ }
2890
+ /**
2891
+ * Invite a person into an account or space. Errors: `ROLE_ABOVE_INVITER`,
2892
+ * `TARGET_SCOPE_NOT_FOUND`, `INVITE_TARGET_INVALID`.
2893
+ */
2894
+ declare function inviteMember(params: InviteMemberParams): Promise<InviteMemberResult>;
2895
+ interface AcceptInviteParams {
2896
+ /** The `member_id` the invite returned. */
2897
+ member_id: string;
2898
+ [key: string]: unknown;
2899
+ }
2900
+ interface AcceptInviteResult {
2901
+ success: true;
2902
+ action: 'accepted' | 'already_active';
2903
+ member_id: string;
2904
+ [key: string]: unknown;
2905
+ }
2906
+ /**
2907
+ * Accept an invite as the signed-in person: the member item turns `active`
2908
+ * and every seat already linked to it (see `seatMember`) opens at once —
2909
+ * `can_do` on those chats is false before this call and true after it.
2910
+ */
2911
+ declare function acceptInvite(params: AcceptInviteParams): Promise<AcceptInviteResult>;
2912
+ interface SeatMemberParams {
2913
+ /** The chat (a channel) or the breakout (a thread root message) to seat them on. */
2914
+ chat_id: string;
2915
+ /** The member item: the invite's `member_id`, or any member of the account. */
2916
+ member_id: string;
2917
+ /**
2918
+ * Their role on this one chat. Absent or off the ladder reads as `editor`.
2919
+ * Separate from the invite's `role`, which is their standing in the account.
2920
+ */
2921
+ role?: MemberRole;
2922
+ }
2923
+ /**
2924
+ * Seat a member on a chat: one `has_member` edge from the chat to the member
2925
+ * item, the role in the edge context. Seat an invited member right after
2926
+ * `inviteMember`; the seat shows on the roster as pending and opens on accept.
2927
+ */
2928
+ declare function seatMember(params: SeatMemberParams): Promise<{
2929
+ success: true;
2930
+ edge_id: string;
2931
+ [key: string]: unknown;
2932
+ }>;
2933
+ interface CreateAgentParams {
2934
+ /** The agent's name, ≤80 characters. Its @handle is this, slugged, unique among your agents. */
2935
+ display_name: string;
2936
+ /** One line, ≤400 characters; rendered into its identity line. */
2937
+ description?: string;
2938
+ /**
2939
+ * The path of a live `role` item the agent wears account-wide. It must
2940
+ * already exist (`ROLE_NOT_FOUND` otherwise); nothing is created. Omit it
2941
+ * for the declared user-default role.
2942
+ */
2943
+ role_path?: string;
2944
+ /** Its face from the character registry. */
2945
+ character?: {
2946
+ character_id: string;
2947
+ asset_version?: string;
2948
+ configuration?: Record<string, unknown>;
2949
+ };
2950
+ /** Its face from an upload. */
2951
+ upload?: {
2952
+ upload_object_key: string;
2953
+ };
2954
+ /** One prompt block each, in the agent's own `instructions/`. */
2955
+ instructions?: {
2956
+ persona?: string;
2957
+ purpose?: string;
2958
+ responsibilities?: string;
2959
+ examples?: string;
2960
+ };
2961
+ [key: string]: unknown;
2962
+ }
2963
+ interface CreateAgentResult {
2964
+ success: true;
2965
+ /** The agent's principal id — what `create-channel`'s `member_ids` takes. */
2966
+ principal_id: string;
2967
+ display_name: string;
2968
+ /** The @handle people and agents mention it by. */
2969
+ handle: string;
2970
+ /** Its home member item in your account. */
2971
+ member_id: string;
2972
+ member_path: string;
2973
+ account_id: string;
2974
+ role_path: string;
2975
+ instructions: Array<{
2976
+ name: string;
2977
+ id: string;
2978
+ [key: string]: unknown;
2979
+ }>;
2980
+ /** The space seats it was given: every space its owner is seated in. */
2981
+ seats: Array<{
2982
+ [key: string]: unknown;
2983
+ }>;
2984
+ ms: number;
2985
+ }
2986
+ /**
2987
+ * Make an agent of your own (one transaction: identity, home member item,
2988
+ * instructions, account-wide role, seats). Only a person may call it. Errors:
2989
+ * `DISPLAY_NAME_REQUIRED`, `DISPLAY_NAME_TOO_LONG`, `DESCRIPTION_TOO_LONG`,
2990
+ * `INSTRUCTIONS_INVALID`, `OWNER_MUST_BE_A_PERSON`, `SCOPE_REQUIRED`,
2991
+ * `ROLE_NOT_FOUND`.
2992
+ *
2993
+ * Creating an agent creates no chat. To talk to it, create one: `create-channel`
2994
+ * with `member_ids: [principal_id]` births a DM (`auto_thread: false`) with you
2995
+ * and the agent on the roster.
2996
+ */
2997
+ declare function createAgent(params: CreateAgentParams): Promise<CreateAgentResult>;
2998
+ interface AnswerInputParams {
2999
+ /** The step that is `awaiting_input`. */
3000
+ step_id: string;
3001
+ /** What the person answered, in their own words or the shape the request asked for. */
3002
+ answer: unknown;
3003
+ /** The id `await_input` returned (`step.type_data.input_request.request_id`) … */
3004
+ input_request_id?: string;
3005
+ /** … or the exact `input_request` object read from the step. One of the two is required. */
3006
+ input_request?: Record<string, unknown>;
3007
+ [key: string]: unknown;
3008
+ }
3009
+ /**
3010
+ * Answer a step's input request. The kernel records the answer as
3011
+ * `input_response`, returns the step to `pending` and wakes the assignee; the
3012
+ * agent decides what to do next. Nothing mechanical reads the answer as yes
3013
+ * or no. Errors: `TODO_INPUT_ID_REQUIRED`, `TODO_INPUT_CHANGED` (read the step again), `TODO_INPUT_ANSWER_REQUIRED`.
3014
+ */
3015
+ declare function answerInput(params: AnswerInputParams): Promise<{
3016
+ success: true;
3017
+ [key: string]: unknown;
3018
+ }>;
3019
+ declare function useInviteMember(): _tanstack_react_query.UseMutationResult<InviteMemberResult, Error, InviteMemberParams, unknown>;
3020
+ declare function useAcceptInvite(): _tanstack_react_query.UseMutationResult<AcceptInviteResult, Error, AcceptInviteParams, unknown>;
3021
+ /** Seat a member on a chat; invalidates the edges of both ends (the roster reads them). */
3022
+ declare function useSeatMember(): _tanstack_react_query.UseMutationResult<{
3023
+ [key: string]: unknown;
3024
+ success: true;
3025
+ edge_id: string;
3026
+ }, Error, SeatMemberParams, unknown>;
3027
+ declare function useCreateAgent(): _tanstack_react_query.UseMutationResult<CreateAgentResult, Error, CreateAgentParams, unknown>;
3028
+ declare function useAnswerInput(): _tanstack_react_query.UseMutationResult<{
3029
+ [key: string]: unknown;
3030
+ success: true;
3031
+ }, Error, AnswerInputParams, unknown>;
3032
+
2849
3033
  /**
2850
3034
  * @fsaos/gateway — Schema Interpretation Utilities
2851
3035
  *
@@ -3467,4 +3651,4 @@ declare function usePersonalSections(contextId: string | null, collection: Secti
3467
3651
  contextKey: string;
3468
3652
  };
3469
3653
 
3470
- export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, CHANNEL_AI_MODES, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelAiMode, 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 GatewayRequestOptions, type GatewayResponse, type IncrementalItemsOptions, 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 PersonalSection, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ReadPriority, type ReadTiming, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SectionChange, type SectionCollection, type SectionDestination, type SectionSnapshot, type SectionTarget, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type SwitcherAccount, 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 VfsItemChange, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, 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, personalSectionsKey, 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, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
3654
+ export { type AcceptInviteParams, type AcceptInviteResult, type AccountInfo, type AnswerInputParams, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, CHANNEL_AI_MODES, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelAiMode, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateAgentParams, type CreateAgentResult, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayRequestOptions, type GatewayResponse, type IncrementalItemsOptions, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type InviteMemberParams, type InviteMemberResult, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type LoadMountsOptions, type MemberRole, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PersonalSection, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ReadPriority, type ReadTiming, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SeatMemberParams, type SectionChange, type SectionCollection, type SectionDestination, type SectionSnapshot, type SectionTarget, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type SwitcherAccount, 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 VfsItemChange, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, acceptInvite, answerInput, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, createAgent, 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, inviteMember, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren, loadMounts, mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, personalSectionsKey, ping, pushChanges, queryClient, readItem, refreshQuery, registerCleanup, replaceMounts, resetAllSdkState, resolvePrincipalId, resubscribePath, seatMember, 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, useAcceptInvite, useAccounts, useAgentTimeline, useAllChannels, useAnswerInput, useArrangement, useArtifactStream, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useCreateAgent, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useInviteMember, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useSeatMember, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
package/dist/index.d.ts CHANGED
@@ -170,8 +170,16 @@ interface CreateParams {
170
170
  type_data?: Record<string, any>;
171
171
  [key: string]: unknown;
172
172
  }
173
+ /**
174
+ * `type_data` MERGES at the top level: each key sent replaces that whole key,
175
+ * keys not sent are kept. `{ type_data: { ai_mode: 'strict' } }` changes the
176
+ * mode and nothing else; `{ type_data: { _remove_keys: ['x'] } }` deletes a
177
+ * key. A channel's `name` (its path) is governed and refused — change
178
+ * `type_data.display_name` instead.
179
+ */
173
180
  interface UpdateParams {
174
- path: string;
181
+ path?: string;
182
+ id?: string;
175
183
  name?: string;
176
184
  type_data?: Record<string, any>;
177
185
  [key: string]: unknown;
@@ -191,6 +199,11 @@ interface LinkParams {
191
199
  target_id: string;
192
200
  edge_type?: string;
193
201
  weight?: number;
202
+ /**
203
+ * Edge context. For `has_member` (a seat on a chat or breakout) `context.role`
204
+ * is the member's ladder role on that chat — viewer, commenter, editor, admin
205
+ * or owner; absent reads as editor. There is no `metadata` field on an edge.
206
+ */
194
207
  context?: Record<string, any>;
195
208
  [key: string]: unknown;
196
209
  }
@@ -2846,6 +2859,177 @@ declare function useMintedAsset(params: {
2846
2859
  scopePath?: string | null;
2847
2860
  }): MintedAsset;
2848
2861
 
2862
+ /** The ladder: what a member may do in a scope or on a chat. */
2863
+ type MemberRole = 'viewer' | 'commenter' | 'editor' | 'admin' | 'owner';
2864
+ interface InviteMemberParams {
2865
+ /** The person to invite. */
2866
+ email: string;
2867
+ /** The account (or space) they are invited into. */
2868
+ target_scope_id: string;
2869
+ /**
2870
+ * Their standing in that scope — a ladder role, default `editor`. The kernel
2871
+ * refuses `ROLE_ABOVE_INVITER` when it is above the inviter's own role.
2872
+ */
2873
+ role?: MemberRole;
2874
+ [key: string]: unknown;
2875
+ }
2876
+ interface InviteMemberResult {
2877
+ success: true;
2878
+ /** The member item the invite minted — `pending` until the person accepts. */
2879
+ member_id: string;
2880
+ member_path?: string;
2881
+ status: 'pending' | 'active';
2882
+ role: MemberRole;
2883
+ email: string;
2884
+ /** `invited_to_scope` for an account, `invited_to_space` for a space. */
2885
+ action: string;
2886
+ /** True when the email already belongs to a principal (they are seated on accept all the same). */
2887
+ principal_exists?: boolean;
2888
+ [key: string]: unknown;
2889
+ }
2890
+ /**
2891
+ * Invite a person into an account or space. Errors: `ROLE_ABOVE_INVITER`,
2892
+ * `TARGET_SCOPE_NOT_FOUND`, `INVITE_TARGET_INVALID`.
2893
+ */
2894
+ declare function inviteMember(params: InviteMemberParams): Promise<InviteMemberResult>;
2895
+ interface AcceptInviteParams {
2896
+ /** The `member_id` the invite returned. */
2897
+ member_id: string;
2898
+ [key: string]: unknown;
2899
+ }
2900
+ interface AcceptInviteResult {
2901
+ success: true;
2902
+ action: 'accepted' | 'already_active';
2903
+ member_id: string;
2904
+ [key: string]: unknown;
2905
+ }
2906
+ /**
2907
+ * Accept an invite as the signed-in person: the member item turns `active`
2908
+ * and every seat already linked to it (see `seatMember`) opens at once —
2909
+ * `can_do` on those chats is false before this call and true after it.
2910
+ */
2911
+ declare function acceptInvite(params: AcceptInviteParams): Promise<AcceptInviteResult>;
2912
+ interface SeatMemberParams {
2913
+ /** The chat (a channel) or the breakout (a thread root message) to seat them on. */
2914
+ chat_id: string;
2915
+ /** The member item: the invite's `member_id`, or any member of the account. */
2916
+ member_id: string;
2917
+ /**
2918
+ * Their role on this one chat. Absent or off the ladder reads as `editor`.
2919
+ * Separate from the invite's `role`, which is their standing in the account.
2920
+ */
2921
+ role?: MemberRole;
2922
+ }
2923
+ /**
2924
+ * Seat a member on a chat: one `has_member` edge from the chat to the member
2925
+ * item, the role in the edge context. Seat an invited member right after
2926
+ * `inviteMember`; the seat shows on the roster as pending and opens on accept.
2927
+ */
2928
+ declare function seatMember(params: SeatMemberParams): Promise<{
2929
+ success: true;
2930
+ edge_id: string;
2931
+ [key: string]: unknown;
2932
+ }>;
2933
+ interface CreateAgentParams {
2934
+ /** The agent's name, ≤80 characters. Its @handle is this, slugged, unique among your agents. */
2935
+ display_name: string;
2936
+ /** One line, ≤400 characters; rendered into its identity line. */
2937
+ description?: string;
2938
+ /**
2939
+ * The path of a live `role` item the agent wears account-wide. It must
2940
+ * already exist (`ROLE_NOT_FOUND` otherwise); nothing is created. Omit it
2941
+ * for the declared user-default role.
2942
+ */
2943
+ role_path?: string;
2944
+ /** Its face from the character registry. */
2945
+ character?: {
2946
+ character_id: string;
2947
+ asset_version?: string;
2948
+ configuration?: Record<string, unknown>;
2949
+ };
2950
+ /** Its face from an upload. */
2951
+ upload?: {
2952
+ upload_object_key: string;
2953
+ };
2954
+ /** One prompt block each, in the agent's own `instructions/`. */
2955
+ instructions?: {
2956
+ persona?: string;
2957
+ purpose?: string;
2958
+ responsibilities?: string;
2959
+ examples?: string;
2960
+ };
2961
+ [key: string]: unknown;
2962
+ }
2963
+ interface CreateAgentResult {
2964
+ success: true;
2965
+ /** The agent's principal id — what `create-channel`'s `member_ids` takes. */
2966
+ principal_id: string;
2967
+ display_name: string;
2968
+ /** The @handle people and agents mention it by. */
2969
+ handle: string;
2970
+ /** Its home member item in your account. */
2971
+ member_id: string;
2972
+ member_path: string;
2973
+ account_id: string;
2974
+ role_path: string;
2975
+ instructions: Array<{
2976
+ name: string;
2977
+ id: string;
2978
+ [key: string]: unknown;
2979
+ }>;
2980
+ /** The space seats it was given: every space its owner is seated in. */
2981
+ seats: Array<{
2982
+ [key: string]: unknown;
2983
+ }>;
2984
+ ms: number;
2985
+ }
2986
+ /**
2987
+ * Make an agent of your own (one transaction: identity, home member item,
2988
+ * instructions, account-wide role, seats). Only a person may call it. Errors:
2989
+ * `DISPLAY_NAME_REQUIRED`, `DISPLAY_NAME_TOO_LONG`, `DESCRIPTION_TOO_LONG`,
2990
+ * `INSTRUCTIONS_INVALID`, `OWNER_MUST_BE_A_PERSON`, `SCOPE_REQUIRED`,
2991
+ * `ROLE_NOT_FOUND`.
2992
+ *
2993
+ * Creating an agent creates no chat. To talk to it, create one: `create-channel`
2994
+ * with `member_ids: [principal_id]` births a DM (`auto_thread: false`) with you
2995
+ * and the agent on the roster.
2996
+ */
2997
+ declare function createAgent(params: CreateAgentParams): Promise<CreateAgentResult>;
2998
+ interface AnswerInputParams {
2999
+ /** The step that is `awaiting_input`. */
3000
+ step_id: string;
3001
+ /** What the person answered, in their own words or the shape the request asked for. */
3002
+ answer: unknown;
3003
+ /** The id `await_input` returned (`step.type_data.input_request.request_id`) … */
3004
+ input_request_id?: string;
3005
+ /** … or the exact `input_request` object read from the step. One of the two is required. */
3006
+ input_request?: Record<string, unknown>;
3007
+ [key: string]: unknown;
3008
+ }
3009
+ /**
3010
+ * Answer a step's input request. The kernel records the answer as
3011
+ * `input_response`, returns the step to `pending` and wakes the assignee; the
3012
+ * agent decides what to do next. Nothing mechanical reads the answer as yes
3013
+ * or no. Errors: `TODO_INPUT_ID_REQUIRED`, `TODO_INPUT_CHANGED` (read the step again), `TODO_INPUT_ANSWER_REQUIRED`.
3014
+ */
3015
+ declare function answerInput(params: AnswerInputParams): Promise<{
3016
+ success: true;
3017
+ [key: string]: unknown;
3018
+ }>;
3019
+ declare function useInviteMember(): _tanstack_react_query.UseMutationResult<InviteMemberResult, Error, InviteMemberParams, unknown>;
3020
+ declare function useAcceptInvite(): _tanstack_react_query.UseMutationResult<AcceptInviteResult, Error, AcceptInviteParams, unknown>;
3021
+ /** Seat a member on a chat; invalidates the edges of both ends (the roster reads them). */
3022
+ declare function useSeatMember(): _tanstack_react_query.UseMutationResult<{
3023
+ [key: string]: unknown;
3024
+ success: true;
3025
+ edge_id: string;
3026
+ }, Error, SeatMemberParams, unknown>;
3027
+ declare function useCreateAgent(): _tanstack_react_query.UseMutationResult<CreateAgentResult, Error, CreateAgentParams, unknown>;
3028
+ declare function useAnswerInput(): _tanstack_react_query.UseMutationResult<{
3029
+ [key: string]: unknown;
3030
+ success: true;
3031
+ }, Error, AnswerInputParams, unknown>;
3032
+
2849
3033
  /**
2850
3034
  * @fsaos/gateway — Schema Interpretation Utilities
2851
3035
  *
@@ -3467,4 +3651,4 @@ declare function usePersonalSections(contextId: string | null, collection: Secti
3467
3651
  contextKey: string;
3468
3652
  };
3469
3653
 
3470
- export { type AccountInfo, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, CHANNEL_AI_MODES, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelAiMode, 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 GatewayRequestOptions, type GatewayResponse, type IncrementalItemsOptions, 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 PersonalSection, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ReadPriority, type ReadTiming, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SectionChange, type SectionCollection, type SectionDestination, type SectionSnapshot, type SectionTarget, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type SwitcherAccount, 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 VfsItemChange, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, 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, personalSectionsKey, 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, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
3654
+ export { type AcceptInviteParams, type AcceptInviteResult, type AccountInfo, type AnswerInputParams, type ArtifactDeltaEvent, type ArtifactDoneEvent, type ArtifactEvent, type ArtifactOpenedEvent, type ArtifactState, type ArtifactStatus, type ArtifactStreamState, type ArtifactSurfaceType, CHANNEL_AI_MODES, type CancelQueuedTurnOptions, type CancelQueuedTurnResponse, type CancelQueuedTurnState, type CancelTurnOptions, type CancelTurnResponse, type CancelTurnState, type Channel, type ChannelAiMode, type ChannelCard, type ChannelMessage, type ChannelMessagesOptions, type ChannelMessagesPage, type ChannelMessagesResponse, type ChannelsOptions, type ComponentOpener, ComponentRenderer, type ConnectionState, type CreateAgentParams, type CreateAgentResult, type CreateParams, type DeleteParams, EnforcementDeniedError, type EnforcementPayload, type FieldDescriptor, type FileRef, FormSubmissionError, type FormSubmissionReceipt, type FsaosRuntime, type GatewayParams, GatewayRequestError, type GatewayRequestOptions, type GatewayResponse, type IncrementalItemsOptions, type InfiniteChannelMessagesOptions, type InfiniteItemsOptions, type InitializeFsaosOptions, type InteractionReceipt, InteractionTrackingError, type InviteMemberParams, type InviteMemberResult, type ItemVersionsOptions, type ItemVersionsResult, type ItemsDiscovery, type ItemsFilter, type ItemsFilterGroup, KernelProvider, type LinkParams, type LoadMountsOptions, type MemberRole, type MintedAsset, type MintedAssetState, type MountRef, type MoveParams, type Notification, type NotificationsOptions, type OpenEnvelope, type OpenOptions, type PathSubscriptionState, type PersonalItemOrderKey, type PersonalSection, type PinTarget, type PinnedItem, type PrincipalData, type PublicSourceConfig, type ReadPriority, type ReadTiming, type ResolveItemsResponse, type ResolveParams, type ResolveResponse, type ResolveResultItem, type ResolvedItem, type SeatMemberParams, type SectionChange, type SectionCollection, type SectionDestination, type SectionSnapshot, type SectionTarget, type SessionEntry, type SourceCaptureAdapter, type SourceIdentityStorage, type StartTrackingOptions, type SteerTurnOptions, type SteerTurnResponse, type SteerTurnState, type SubmitFormOptions, type SwitcherAccount, 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 VfsItemChange, type WorkCorrelation, type WorkspaceOptions, type WorkspaceSession, acceptInvite, answerInput, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, createAgent, 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, inviteMember, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren, loadMounts, mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, personalSectionsKey, ping, pushChanges, queryClient, readItem, refreshQuery, registerCleanup, replaceMounts, resetAllSdkState, resolvePrincipalId, resubscribePath, seatMember, 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, useAcceptInvite, useAccounts, useAgentTimeline, useAllChannels, useAnswerInput, useArrangement, useArtifactStream, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useCreateAgent, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useInviteMember, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useSeatMember, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
package/dist/index.js CHANGED
@@ -23,6 +23,8 @@ __export(src_exports, {
23
23
  InteractionTrackingError: () => InteractionTrackingError,
24
24
  KernelProvider: () => KernelProvider,
25
25
  QueryClientProvider: () => QueryClientProvider,
26
+ acceptInvite: () => acceptInvite,
27
+ answerInput: () => answerInput,
26
28
  assignPersonalSection: () => assignPersonalSection,
27
29
  auth: () => auth,
28
30
  awaitAnchorReady: () => awaitAnchorReady,
@@ -33,6 +35,7 @@ __export(src_exports, {
33
35
  clearCachedToken: () => clearCachedToken,
34
36
  clearSession: () => clearSession,
35
37
  configureGatewayReads: () => configureGatewayReads,
38
+ createAgent: () => createAgent,
36
39
  createItem: () => createItem,
37
40
  disconnectSSE: () => disconnectSSE,
38
41
  disposeVfsRealtimeWs: () => disposeVfsRealtimeWs,
@@ -89,6 +92,7 @@ __export(src_exports, {
89
92
  invalidatePathAndParent: () => invalidatePathAndParent,
90
93
  invalidateSubtree: () => invalidateSubtree,
91
94
  invalidateTypes: () => invalidateTypes,
95
+ inviteMember: () => inviteMember,
92
96
  isAnchorReady: () => isAnchorReady,
93
97
  isChannelPath: () => isChannelPath,
94
98
  isListableItemsFilter: () => isListableItemsFilter,
@@ -112,6 +116,7 @@ __export(src_exports, {
112
116
  resetAllSdkState: () => resetAllSdkState,
113
117
  resolvePrincipalId: () => resolvePrincipalId,
114
118
  resubscribePath: () => resubscribePath,
119
+ seatMember: () => seatMember,
115
120
  selectMount: () => selectMount,
116
121
  serverDeadlinePassed: () => serverDeadlinePassed,
117
122
  serverMsUntil: () => serverMsUntil,
@@ -138,9 +143,11 @@ __export(src_exports, {
138
143
  unmountRealtimeScope: () => unmountRealtimeScope,
139
144
  updateItem: () => updateItem,
140
145
  uploadFile: () => uploadFile,
146
+ useAcceptInvite: () => useAcceptInvite,
141
147
  useAccounts: () => useAccounts,
142
148
  useAgentTimeline: () => useAgentTimeline,
143
149
  useAllChannels: () => useAllChannels,
150
+ useAnswerInput: () => useAnswerInput,
144
151
  useArrangement: () => useArrangement,
145
152
  useArtifactStream: () => useArtifactStream,
146
153
  useAsset: () => useAsset,
@@ -150,6 +157,7 @@ __export(src_exports, {
150
157
  useChildren: () => useChildren,
151
158
  useComponent: () => useComponent,
152
159
  useCreate: () => useCreate,
160
+ useCreateAgent: () => useCreateAgent,
153
161
  useDelete: () => useDelete,
154
162
  useDmChannels: () => useDmChannels,
155
163
  useEdges: () => useEdges,
@@ -159,6 +167,7 @@ __export(src_exports, {
159
167
  useInfiniteChannelMessages: () => useInfiniteChannelMessages,
160
168
  useInfiniteChildren: () => useInfiniteChildren,
161
169
  useInfiniteItems: () => useInfiniteItems,
170
+ useInviteMember: () => useInviteMember,
162
171
  useItem: () => useItem,
163
172
  useItemById: () => useItemById,
164
173
  useItemHistory: () => useItemHistory,
@@ -186,6 +195,7 @@ __export(src_exports, {
186
195
  useScope: () => useScope,
187
196
  useScopeReady: () => useScopeReady,
188
197
  useSearch: () => useSearch,
198
+ useSeatMember: () => useSeatMember,
189
199
  useTheme: () => useTheme,
190
200
  useTimelineHistory: () => useTimelineHistory,
191
201
  useTool: () => useTool,
@@ -5454,6 +5464,71 @@ function setupRequireShim() {
5454
5464
  };
5455
5465
  window.__FSAOS_MOUNT__ = gateway.mount;
5456
5466
  }
5467
+ function inviteMember(params) {
5468
+ return gatewayCall("invite-member", params);
5469
+ }
5470
+ function acceptInvite(params) {
5471
+ return gatewayCall("accept-invite", params);
5472
+ }
5473
+ function seatMember(params) {
5474
+ const context = {};
5475
+ if (params.role) context.role = params.role;
5476
+ return gatewayCall("link", {
5477
+ source_id: params.chat_id,
5478
+ target_id: params.member_id,
5479
+ edge_type: "has_member",
5480
+ context
5481
+ });
5482
+ }
5483
+ function createAgent(params) {
5484
+ return gatewayCall("create-agent", params);
5485
+ }
5486
+ function answerInput(params) {
5487
+ if (!params.input_request_id && !params.input_request) {
5488
+ return Promise.reject(new Error("answerInput needs input_request_id or the input_request object read from the step."));
5489
+ }
5490
+ return gatewayCall("todo-control", { action: "answer_input", ...params });
5491
+ }
5492
+ function useInviteMember() {
5493
+ return useMutation$1({ mutationFn: inviteMember });
5494
+ }
5495
+ function useAcceptInvite() {
5496
+ const qc = useQueryClient();
5497
+ return useMutation$1({
5498
+ mutationFn: acceptInvite,
5499
+ onSuccess: () => {
5500
+ qc.invalidateQueries({ queryKey: ["memberships"] });
5501
+ }
5502
+ });
5503
+ }
5504
+ function useSeatMember() {
5505
+ const qc = useQueryClient();
5506
+ return useMutation$1({
5507
+ mutationFn: seatMember,
5508
+ onSuccess: (_data, variables) => {
5509
+ qc.invalidateQueries({ queryKey: vfsKeys.edges(variables.chat_id) });
5510
+ qc.invalidateQueries({ queryKey: vfsKeys.edges(variables.member_id) });
5511
+ }
5512
+ });
5513
+ }
5514
+ function useCreateAgent() {
5515
+ const qc = useQueryClient();
5516
+ return useMutation$1({
5517
+ mutationFn: createAgent,
5518
+ onSuccess: () => {
5519
+ qc.invalidateQueries({ queryKey: ["memberships"] });
5520
+ }
5521
+ });
5522
+ }
5523
+ function useAnswerInput() {
5524
+ const qc = useQueryClient();
5525
+ return useMutation$1({
5526
+ mutationFn: answerInput,
5527
+ onSuccess: (_data, variables) => {
5528
+ qc.invalidateQueries({ queryKey: vfsKeys.itemById(variables.step_id) });
5529
+ }
5530
+ });
5531
+ }
5457
5532
 
5458
5533
  // src/schema-utils.ts
5459
5534
  function keyToLabel(key) {
@@ -6253,6 +6328,6 @@ function usePersonalSections(contextId, collection) {
6253
6328
  // src/index.ts
6254
6329
  __registerSdkExports(src_exports);
6255
6330
 
6256
- export { CHANNEL_AI_MODES, ComponentRenderer, EnforcementDeniedError, FormSubmissionError, GatewayRequestError, InteractionTrackingError, KernelProvider, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, 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, mount2 as mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, personalSectionsKey, 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, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
6331
+ export { CHANNEL_AI_MODES, ComponentRenderer, EnforcementDeniedError, FormSubmissionError, GatewayRequestError, InteractionTrackingError, KernelProvider, acceptInvite, answerInput, assignPersonalSection, auth, awaitAnchorReady, awaitScopeReady, callTool, cancelQueuedTurn, cancelTurn, clearCachedToken, clearSession, configureGatewayReads, createAgent, 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, inviteMember, isAnchorReady, isChannelPath, isListableItemsFilter, isScopeReady, itemsFilterFromQueryFilter, listChildren, loadMounts, mount2 as mount, mountRealtimeScope, normalizeItem, onConnectionStateChange, pathSubscriptionMatches, personalSectionsKey, ping, pushChanges, queryClient, readItem, refreshQuery, registerCleanup, replaceMounts, resetAllSdkState, resolvePrincipalId, resubscribePath, seatMember, 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, useAcceptInvite, useAccounts, useAgentTimeline, useAllChannels, useAnswerInput, useArrangement, useArtifactStream, useAsset, useAuth, useChannelMessages, useChannels, useChildren, useComponent, useCreate, useCreateAgent, useDelete, useDmChannels, useEdges, useEventStream, useFileUpload, useIncrementalItems, useInfiniteChannelMessages, useInfiniteChildren, useInfiniteItems, useInviteMember, useItem, useItemById, useItemHistory, useItemVersions, useItems, useLink, useList, useMemberFocus, useMintedAsset, useMounts, useMove, useMutation, useNotifications, useOpen, usePermission, usePermissions, usePersonalItemOrder, usePersonalSections, usePinnedItems, usePrincipal, useRealtimeQuery, useRecentActivity, useResolve, useResolvedItems, useScope, useScopeReady, useSearch, useSeatMember, useTheme, useTimelineHistory, useTool, useTree, useType, useTypeHelpers, useTypes, useUnreadCounts, useUpdate, useUpdatePrincipal, vfsKeys, waitForPathReady };
6257
6332
  //# sourceMappingURL=index.js.map
6258
6333
  //# sourceMappingURL=index.js.map