@aginies/webuikit 0.2.0 → 0.4.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
@@ -30,6 +30,10 @@ export function App() {
30
30
  the provider renders its `fallback`; if the platform refuses the token or the origin,
31
31
  nothing renders and one warning is logged.
32
32
 
33
+ ## Hosted pages
34
+
35
+ The platform's own chat page runs the same widget without a key: `new AginiesClient({ baseUrl, hosted: true })` (or `init({ baseUrl, hosted: true })`). The platform accepts that activation only from its own origin.
36
+
33
37
  ## Activation keys
34
38
 
35
39
  Two kinds of token work with `init()`:
@@ -60,6 +64,8 @@ Two kinds of token work with `init()`:
60
64
 
61
65
  - `ChatWidget` — `identifier`, `mode` (`bubble` | `inline` | `full`), `position`, `launcherLabel`, `theme` (`dark` | `light` | `auto`). Streams replies, renders them as Markdown (headings, emphasis, code, links, lists, quotes, tables; never raw HTML), renders structured replies (text, buttons, table, cards, pie, image), lets visitors attach up to five files of 10 MB, and handles password and e-mail protected chats. E-mail protection follows the platform's two-step flow: the address receives a six-digit code, which the widget verifies.
62
66
  - `Markdown` — the same renderer on its own: `<Markdown text={reply} />`.
67
+ - Voice — when the platform reports speech for the chat (`voice: { stt, tts }` in the chat configuration) and the browser can record, the composer gains a dictation button (the transcript lands in the draft) and a hands-free conversation: the widget listens, sends what it heard, reads the reply aloud and listens again; a tap interrupts. Recording uses the browser's recorder and transcription runs on the platform's own model, so it works in every browser and no audio leaves the platform. Turn it off with `voice={false}`.
68
+ - `useVoice({ identifier, onTranscript })` — the recorder and player on their own: `state`, `level`, `startListening`, `stopListening`, `speak(text)`, `stopSpeaking`.
63
69
  - `AgentRunner` — `workflowId`, `apiKey` (an `execute`-scoped key for that agent only; it is visible to the page), `fields` (form spec) and `onResult`. Posts the form as the agent's input, streams text and steps, shows the final output. `useAgentRun(workflowId, apiKey)` for a custom UI.
64
70
  - `useChat(identifier)` — the same state for a custom UI: `messages`, `send`, `stop`, `busy`, `authNeed`, `authenticate`.
65
71
  - `ApprovalPanel` — `workflowId`, `executionId` (from the resume link a "Human in the Loop" block sends), optional `contextId`, `onResumed`. Shows what the agent proposes, renders the approver's form the block author configured (string, number, boolean, JSON, select), validates it and resumes the run; queued resumes are reported as such. `useApproval(workflowId, executionId)` for a custom UI; the `approval` module must be enabled on the key.