@ai4b-team/fsaos-gateway-sdk 5.7.1 → 5.8.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 +16 -0
- package/dist/iife/gateway.js +4 -4
- package/dist/iife/gateway.js.map +3 -3
- package/dist/iife/ui.js +1 -1
- package/dist/index.cjs +141 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +54 -1
- package/dist/index.d.ts +54 -1
- package/dist/index.js +140 -1
- package/dist/index.js.map +1 -1
- package/dist/ui.d.cts +1 -1
- package/dist/ui.d.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -241,6 +241,7 @@ The typed surface of the membership doors (Agent System Master Spec D13–D21).
|
|
|
241
241
|
| `useAsset(idOrPath)` | Resolve an asset URL |
|
|
242
242
|
| `useComponent(path, { version }?)` | Dynamically load a component from the edge |
|
|
243
243
|
| `usePublishedComponent(item)` | Load a component's published in-app version, read through the kernel |
|
|
244
|
+
| `useCompiledComponent(build)` | Load a component's compiled build (one an agent made during a reply), read through the kernel |
|
|
244
245
|
| `useTheme()` | Read theme CSS custom properties |
|
|
245
246
|
|
|
246
247
|
`useComponent` loads a component bundle and runs it on the host page's own
|
|
@@ -268,6 +269,21 @@ session is at most four kernel calls and two file reads; after that it is held
|
|
|
268
269
|
until the session ends. `loadPublishedBundle(item)` gives the same script and
|
|
269
270
|
stylesheet to a host that is not React.
|
|
270
271
|
|
|
272
|
+
`useCompiledComponent(build)` is the same loader for a build no release sealed:
|
|
273
|
+
a component an agent wrote and the Script Worker compiled during a reply. The
|
|
274
|
+
build is one `file` item under the component holding the JSON
|
|
275
|
+
`{ js, css, scope }`; pass `{ fileId, sha256 }` as the card that shows it names
|
|
276
|
+
them (and `scopePath` when the file is read in another scope). The file is read through the kernel as
|
|
277
|
+
the signed-in person, bytes that are not the ones named are never run, and the
|
|
278
|
+
script runs on the host page's own React and SDK: a `require('@fsaos/gateway')`
|
|
279
|
+
in it answers with this SDK, so the component can use every hook and call. It
|
|
280
|
+
returns `{ Component, scopeClass, status, error }`, where `status` is `loading`,
|
|
281
|
+
`ready` or `error`. Wrap the component in an element that carries `scopeClass`:
|
|
282
|
+
it is the class the compile scoped the stylesheet under, so the stylesheet
|
|
283
|
+
styles the component and nothing else on the page. One read serves every view
|
|
284
|
+
of a build. `loadCompiledBundle(build)`
|
|
285
|
+
gives the script and stylesheet to a host that is not React.
|
|
286
|
+
|
|
271
287
|
`useInfiniteItems(filter, { realtime: true })` uses the existing WebSocket event
|
|
272
288
|
dispatch and reconnect recovery. As with the other realtime hooks, the host
|
|
273
289
|
must hold an SDK account or path subscription (directly or via SDK bootstrap).
|