@ai4b-team/fsaos-gateway-sdk 4.3.1 → 5.1.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
@@ -187,9 +187,35 @@ The typed surface of the membership doors (Agent System Master Spec D13–D21).
187
187
  | `useAccounts()` | Account memberships, switcher accounts, and the accounts mounted under each |
188
188
  | `usePrincipal()` / `useUpdatePrincipal()` | Current principal identity / update |
189
189
  | `useAsset(idOrPath)` | Resolve an asset URL |
190
- | `useComponent(path)` | Dynamically load a component from the edge |
190
+ | `useComponent(path, { version }?)` | Dynamically load a component from the edge |
191
+ | `usePublishedComponent(item)` | Load a component's published in-app version, read through the kernel |
191
192
  | `useTheme()` | Read theme CSS custom properties |
192
193
 
194
+ `useComponent` loads a component bundle and runs it on the host page's own
195
+ React and SDK: the bundle's `require` answers to `react`, to the SDK
196
+ (`@ai4b-team/fsaos-gateway-sdk`, `@fsaos/gateway`) and to the UI primitives
197
+ (`@ai4b-team/fsaos-gateway-sdk/ui`, `@fsaos/ui`). Pass `{ version }` to load
198
+ exactly that published version: read the live version from the component item
199
+ with `useItem`, which a change event keeps current, and the new version
200
+ replaces the one on screen when the number changes, with no timer. Pass a null
201
+ path until the version is known. A component's stylesheet is on the page only
202
+ while the component is mounted. To run a tool from a component, call `callTool`.
203
+
204
+ `usePublishedComponent(item)` loads the in-app version of a component a RevDev
205
+ project published. Pass the component item as read with `useItem` (null until
206
+ it is known). The hook reads the release the item names as live, then the
207
+ script and stylesheet that release's build sealed (`embed/bundle.js`,
208
+ `embed/bundle.css`), through the kernel as the signed-in person: they are
209
+ ordinary `file` items, so whoever may read them may load the bundle, and no
210
+ public address serves them. Bytes that are not the ones the release sealed are
211
+ never run. It returns `{ Component, status, error, version }`, where `status` is
212
+ `loading`, `ready`, `unpublished`, `no_in_app_version` or `error`. A publish
213
+ replaces the version on screen when the item changes, with no timer; a version
214
+ that fails to load leaves the one on screen. The first load of a release in a
215
+ session is at most four kernel calls and two file reads; after that it is held
216
+ until the session ends. `loadPublishedBundle(item)` gives the same script and
217
+ stylesheet to a host that is not React.
218
+
193
219
  `useInfiniteItems(filter, { realtime: true })` uses the existing WebSocket event
194
220
  dispatch and reconnect recovery. As with the other realtime hooks, the host
195
221
  must hold an SDK account or path subscription (directly or via SDK bootstrap).