@ai4b-team/fsaos-gateway-sdk 3.36.0 → 3.38.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/README.md CHANGED
@@ -138,6 +138,7 @@ The SDK does not decide when AI should respond, spawn agents, or infer agent ide
138
138
  | `useList(path)` / `useChildren(path)` | Children of a path (location) |
139
139
  | `useItems(filter)` | Items by type with filters (location; account-scoped, **not** frame-aware) |
140
140
  | `useInfiniteItems(filter, { realtime? })` | Kernel-filtered infinite pages; optional event-driven refresh, cached items, load more and refetch. No polling. |
141
+ | `useIncrementalItems(filter, { shouldReadUpdate? })` | Live created-at feed: query pages once, point-read inserts and selected updates, reconcile after deletes/reconnect. No polling. |
141
142
  | `useInfiniteChildren(path)` | Infinite-scroll directory listing |
142
143
  | `useTree(path, depth?)` | Recursive tree |
143
144
  | `useSearch(query, types?)` | Keyword search |
@@ -168,6 +169,15 @@ loaded items moving out still refresh their former list. Closed lists are marked
168
169
  stale without fetching, and unchanged lists reopen from cache. All consumers of
169
170
  the same filtered query should use the same realtime setting.
170
171
 
172
+ For a high-traffic message feed, `useIncrementalItems` avoids reloading every
173
+ loaded page whenever a reply changes. It supports one item `type`, an explicit
174
+ `scope`, `sort_by: 'created_at'`, and optional `parent_id`, `fields`, or
175
+ `field_in`. It returns the same list and pagination fields as
176
+ `useInfiniteItems`. Inserts cost one item read; updates are ignored unless
177
+ `shouldReadUpdate(change, loadedItems)` selects them; deletes and reconnects
178
+ reconcile the pages. More complex filters fall back to the ordinary realtime
179
+ listing. The host still needs its normal account or path WebSocket subscription.
180
+
171
181
  A filter names one `type`, or `any_of`: 1-10 groups, each with an `item_type`,
172
182
  `fields` and `field_in`, so one listing spans item types with one total and one
173
183
  page order. `discovery: 'catalog'` keeps only what the kernel classes as a
@@ -319,3 +329,22 @@ and reconciles through the existing coalesced arrangement refresh. No polling,
319
329
  item reads or parent changes are involved. For paged collections, apply ordering
320
330
  in the backend before pagination; this hook does not discover Project folders
321
331
  or provide that paged read contract.
332
+
333
+ ### Personal sidebar Sections
334
+
335
+ `usePersonalSections(contextId, 'channels' | 'chats' | 'projects')` reads personal
336
+ reference groups. Use a Space ID for channels/projects or a channel ID for chats.
337
+ The hook returns `sections`, `ready`, `change`, `destination`, and loading/error
338
+ state. `change` supports create, rename, delete, assign, remove and reorder
339
+ operations; it preserves canonical item locations. Supply a stable client UUID
340
+ for `section_id` on create so a retry cannot create a duplicate Section.
341
+
342
+ Capture `destination(sectionId)` before starting a new channel or chat, then call
343
+ `assignPersonalSection(destination, savedItemId)` once the canonical item has
344
+ been saved. Retry that filing separately from creation/sending. The captured
345
+ Space and context isolate late results after navigation. Versioned snapshots
346
+ prevent late responses from replacing newer organization; refresh uses existing
347
+ coalesced item-change events and reconnects, with no polling.
348
+
349
+ Requires the `personal-sections` kernel method from migration `0793523446ad`.
350
+ Projects are protocol-ready; a consumer must supply its Project UI separately.