@ai4b-team/fsaos-gateway-sdk 5.7.1 → 5.9.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
@@ -52,6 +52,7 @@ Rule of thumb: if the answer should differ depending on *who is asking* or *whic
52
52
 
53
53
  ### File Uploads
54
54
  - `uploadFile(file, { parentPath, name? })` and `useFileUpload()` save a new file item. If its name is taken, the kernel atomically chooses a numbered sibling such as `photo-2.png` and the SDK returns that item's actual ID and path. Retrying the same upload reuses its item.
55
+ - Files above 100 MiB travel in sequential parts. For a draft with a Retry button, keep the object returned by `createFileUpload(file, options)` and call `attempt.run(onProgress, signal)` again. The active draft retains acknowledged parts. Progress reaches 100 when the gateway confirms the saved file.
55
56
  - A caller that treats the filename as a fixed address can pass `collisionPolicy: 'fail'` to retain `NAME_TAKEN`. For example, a version snapshot that later reads `version-<id>.json` by exact path must use this policy.
56
57
  - Naming and replay are kernel decisions. The SDK makes no list request or client-side retry loop to choose a name.
57
58
 
@@ -241,6 +242,7 @@ The typed surface of the membership doors (Agent System Master Spec D13–D21).
241
242
  | `useAsset(idOrPath)` | Resolve an asset URL |
242
243
  | `useComponent(path, { version }?)` | Dynamically load a component from the edge |
243
244
  | `usePublishedComponent(item)` | Load a component's published in-app version, read through the kernel |
245
+ | `useCompiledComponent(build)` | Load a component's compiled build (one an agent made during a reply), read through the kernel |
244
246
  | `useTheme()` | Read theme CSS custom properties |
245
247
 
246
248
  `useComponent` loads a component bundle and runs it on the host page's own
@@ -268,6 +270,21 @@ session is at most four kernel calls and two file reads; after that it is held
268
270
  until the session ends. `loadPublishedBundle(item)` gives the same script and
269
271
  stylesheet to a host that is not React.
270
272
 
273
+ `useCompiledComponent(build)` is the same loader for a build no release sealed:
274
+ a component an agent wrote and the Script Worker compiled during a reply. The
275
+ build is one `file` item under the component holding the JSON
276
+ `{ js, css, scope }`; pass `{ fileId, sha256 }` as the card that shows it names
277
+ them (and `scopePath` when the file is read in another scope). The file is read through the kernel as
278
+ the signed-in person, bytes that are not the ones named are never run, and the
279
+ script runs on the host page's own React and SDK: a `require('@fsaos/gateway')`
280
+ in it answers with this SDK, so the component can use every hook and call. It
281
+ returns `{ Component, scopeClass, status, error }`, where `status` is `loading`,
282
+ `ready` or `error`. Wrap the component in an element that carries `scopeClass`:
283
+ it is the class the compile scoped the stylesheet under, so the stylesheet
284
+ styles the component and nothing else on the page. One read serves every view
285
+ of a build. `loadCompiledBundle(build)`
286
+ gives the script and stylesheet to a host that is not React.
287
+
271
288
  `useInfiniteItems(filter, { realtime: true })` uses the existing WebSocket event
272
289
  dispatch and reconnect recovery. As with the other realtime hooks, the host
273
290
  must hold an SDK account or path subscription (directly or via SDK bootstrap).