@ai4b-team/fsaos-gateway-sdk 3.32.0 → 3.34.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
@@ -101,7 +101,8 @@ The SDK does not decide when AI should respond, spawn agents, or infer agent ide
101
101
  - `fetchVfsItem(path)` — Fetch a single item
102
102
  - `fetchVfsItemById(id)` — Fetch a single item by UUID
103
103
  - `fetchVfsChildren(path)` — Fetch children (also warms item cache)
104
- - `fetchItems(filter)` — Fetch items by type with structured filters
104
+ - `fetchItems(filter)` — Fetch items with structured filters: one `type`, or `any_of` groups spanning types; `fields`, `field_in`, `discovery`, sort and offset
105
+ - `itemsFilterFromQueryFilter(typeData, { scope?, limit? })` — Turn a stored saved filter (a `query_filter` child of an arrangement) into the filter `useInfiniteItems` takes
105
106
  - `fetchTypeDefinitions(scopeId?)` — Fetch type definitions as `Map<string, TypeDefinition>`
106
107
  - `fetchEdgesForItem(itemId)` — Fetch edges (incoming + outgoing)
107
108
  - `fetchVfsTree(path, depth?, types?, limit?)` — Fetch recursive tree
@@ -167,6 +168,22 @@ loaded items moving out still refresh their former list. Closed lists are marked
167
168
  stale without fetching, and unchanged lists reopen from cache. All consumers of
168
169
  the same filtered query should use the same realtime setting.
169
170
 
171
+ A filter names one `type`, or `any_of`: 1-10 groups, each with an `item_type`,
172
+ `fields` and `field_in`, so one listing spans item types with one total and one
173
+ page order. `discovery: 'catalog'` keeps only what the kernel classes as a
174
+ person's own standalone things; the kernel applies it before paging. A menu's
175
+ stored sections are run without building a filter by hand:
176
+
177
+ ```ts
178
+ const { resolvedChildren } = useArrangement({ key: 'library' });
179
+ const section = resolvedChildren.find(child => child.child_type === 'query_filter');
180
+ const list = useInfiniteItems(
181
+ itemsFilterFromQueryFilter(section?.type_data, { scope: accountPath, limit: 50 }),
182
+ { realtime: true },
183
+ );
184
+ // list.allItems, list.fetchNextPage(), list.isExhausted, list.totalHint
185
+ ```
186
+
170
187
  A relevant burst refreshes the loaded pages once, using the existing
171
188
  `refreshQuery` protection against overlapping loads. Multiple pages are read
172
189
  again together so offset pagination stays consistent after inserts/deletes.
@@ -183,6 +200,7 @@ reconciles the remaining count. No background polling is used.
183
200
  | `useChannelMessages(opts)` | Channel messages + bundled cards |
184
201
  | `useInfiniteChannelMessages(opts)` | Cursor-paginated messages (live tail) |
185
202
  | `useAllChannels()` / `useChannels()` / `useDmChannels()` | Channel lists (all / public / DM) |
203
+ | `usePersonalItemOrder('channel-order' \| 'project-order', items)` | Apply and save the selected Space member's personal order through existing arrangements. |
186
204
  | `useNotifications(opts?)` | Notifications feed |
187
205
  | `useUnreadCounts(opts?)` | Aggregated unread counts |
188
206
 
@@ -278,3 +296,20 @@ This SDK has **zero** references to "kernel" in source, bundle, or type declarat
278
296
  and use this package as a dependency in your own applications, but you may **not**
279
297
  copy, modify, or redistribute it as a standalone library. All rights reserved by
280
298
  AI4B Team.
299
+
300
+ ### Personal channel and project ordering
301
+
302
+ `usePersonalItemOrder(key, items)` reuses `resolve-arrangement` and the ordinary
303
+ `update` primitive. Supply a complete collection of canonical IDs; render the
304
+ returned `items` and call `reorder(ids)` once at drop. It returns `contextKey`
305
+ for resetting in-progress UI gestures when the Space changes, plus `ready`,
306
+ `supported`, `isLoading`, `isSaving`, `error`, `saveError` and `refetch`.
307
+
308
+ The hook reads only the selected Space member's provisioned `channel-order` or
309
+ `project-order` arrangement. Account mounts are unsupported and make no requests.
310
+ It never creates a missing arrangement or falls back to a shared blueprint.
311
+ A save preserves unseen IDs, rejects stale Space callbacks and invalid lists,
312
+ and reconciles through the existing coalesced arrangement refresh. No polling,
313
+ item reads or parent changes are involved. For paged collections, apply ordering
314
+ in the backend before pagination; this hook does not discover Project folders
315
+ or provide that paged read contract.