@ai4b-team/fsaos-gateway-sdk 4.0.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
  }
@@ -1185,7 +1198,14 @@ interface ChannelMessage {
1185
1198
  principal_id?: string;
1186
1199
  /** The sender's member item id, when the kernel recorded one (agent replies carry it). */
1187
1200
  member_id?: string;
1201
+ /** Replies under this message. Above zero, a top-level message is a thread (a side conversation inside the chat). */
1188
1202
  reply_count: number;
1203
+ /**
1204
+ * Members of this message's own (has_member edges on the root). Above zero, the thread is a
1205
+ * breakout: only those members (and the owners above it) read and post in it, and the kernel
1206
+ * hides it from everyone else. Agent System Master Spec D21.
1207
+ */
1208
+ member_count: number;
1189
1209
  parent_message_id?: string;
1190
1210
  intent_card?: Record<string, unknown>;
1191
1211
  /** Full message metadata from type_data.metadata (launch cards, custom card payloads, etc.). */
@@ -2280,6 +2300,8 @@ declare function useChannelMessages(options: ChannelMessagesOptions): {
2280
2300
  /** Cards that are direct siblings of the channel (not nested under a message). */
2281
2301
  siblingCards: ChannelCard[];
2282
2302
  threads: ChannelMessage[];
2303
+ /** Top-level messages with members of their own: breakouts (Agent System Master Spec D21). */
2304
+ breakouts: ChannelMessage[];
2283
2305
  isLoading: boolean;
2284
2306
  isFetching: boolean;
2285
2307
  error: Error | null;
@@ -2323,6 +2345,8 @@ declare function useInfiniteChannelMessages(options: InfiniteChannelMessagesOpti
2323
2345
  /** Cards that are direct siblings of the channel (not nested under a message). */
2324
2346
  siblingCards: ChannelCard[];
2325
2347
  threads: ChannelMessage[];
2348
+ /** Top-level messages with members of their own: breakouts (Agent System Master Spec D21). */
2349
+ breakouts: ChannelMessage[];
2326
2350
  isLoading: boolean;
2327
2351
  isFetching: boolean;
2328
2352
  error: Error | null;
@@ -2835,6 +2859,177 @@ declare function useMintedAsset(params: {
2835
2859
  scopePath?: string | null;
2836
2860
  }): MintedAsset;
2837
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
+
2838
3033
  /**
2839
3034
  * @fsaos/gateway — Schema Interpretation Utilities
2840
3035
  *
@@ -3456,4 +3651,4 @@ declare function usePersonalSections(contextId: string | null, collection: Secti
3456
3651
  contextKey: string;
3457
3652
  };
3458
3653
 
3459
- 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
  }
@@ -1185,7 +1198,14 @@ interface ChannelMessage {
1185
1198
  principal_id?: string;
1186
1199
  /** The sender's member item id, when the kernel recorded one (agent replies carry it). */
1187
1200
  member_id?: string;
1201
+ /** Replies under this message. Above zero, a top-level message is a thread (a side conversation inside the chat). */
1188
1202
  reply_count: number;
1203
+ /**
1204
+ * Members of this message's own (has_member edges on the root). Above zero, the thread is a
1205
+ * breakout: only those members (and the owners above it) read and post in it, and the kernel
1206
+ * hides it from everyone else. Agent System Master Spec D21.
1207
+ */
1208
+ member_count: number;
1189
1209
  parent_message_id?: string;
1190
1210
  intent_card?: Record<string, unknown>;
1191
1211
  /** Full message metadata from type_data.metadata (launch cards, custom card payloads, etc.). */
@@ -2280,6 +2300,8 @@ declare function useChannelMessages(options: ChannelMessagesOptions): {
2280
2300
  /** Cards that are direct siblings of the channel (not nested under a message). */
2281
2301
  siblingCards: ChannelCard[];
2282
2302
  threads: ChannelMessage[];
2303
+ /** Top-level messages with members of their own: breakouts (Agent System Master Spec D21). */
2304
+ breakouts: ChannelMessage[];
2283
2305
  isLoading: boolean;
2284
2306
  isFetching: boolean;
2285
2307
  error: Error | null;
@@ -2323,6 +2345,8 @@ declare function useInfiniteChannelMessages(options: InfiniteChannelMessagesOpti
2323
2345
  /** Cards that are direct siblings of the channel (not nested under a message). */
2324
2346
  siblingCards: ChannelCard[];
2325
2347
  threads: ChannelMessage[];
2348
+ /** Top-level messages with members of their own: breakouts (Agent System Master Spec D21). */
2349
+ breakouts: ChannelMessage[];
2326
2350
  isLoading: boolean;
2327
2351
  isFetching: boolean;
2328
2352
  error: Error | null;
@@ -2835,6 +2859,177 @@ declare function useMintedAsset(params: {
2835
2859
  scopePath?: string | null;
2836
2860
  }): MintedAsset;
2837
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
+
2838
3033
  /**
2839
3034
  * @fsaos/gateway — Schema Interpretation Utilities
2840
3035
  *
@@ -3456,4 +3651,4 @@ declare function usePersonalSections(contextId: string | null, collection: Secti
3456
3651
  contextKey: string;
3457
3652
  };
3458
3653
 
3459
- 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 };