@personaai/react 0.9.0 → 0.10.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 +23 -0
- package/dist/index.cjs +905 -347
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +79 -2
- package/dist/index.d.ts +79 -2
- package/dist/index.js +903 -347
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,6 +49,7 @@ function Chat() {
|
|
|
49
49
|
| Hook | Purpose |
|
|
50
50
|
| -------------------- | ----------------------------------------------------------------------------------------------- |
|
|
51
51
|
| `useChat` | Streaming chat — messages, send, stop, reload, interrupts, workspace files, ephemeral new chat |
|
|
52
|
+
| `useArchitectChat` | Streaming chat with the Agent Architect co-pilot — same mechanics as `useChat`, no `agentId` |
|
|
52
53
|
| `useWorkflowStream` | Live streaming workflow execution — real-time node state tracking, cancellation, and resume |
|
|
53
54
|
| `useWorkflows` | Workflow discovery & creation — list, paginate, filter, and create workflows |
|
|
54
55
|
| `useWorkflow` | Single workflow authoring — drafts, publishing, versions, and Mermaid diagrams |
|
|
@@ -153,6 +154,28 @@ await chat.sendMessage("Hello") // auto POST /threads if threadId is undefined
|
|
|
153
154
|
|
|
154
155
|
`sendMessage` and `reload` now return `Promise<boolean>` (`true` sent, `false` dropped while streaming). `startNewChat()`, `currentThreadId` and `isEphemeral` are new returns on `useChat`.
|
|
155
156
|
|
|
157
|
+
## Agent Architect chat (0.10.0+)
|
|
158
|
+
|
|
159
|
+
`useArchitectChat` runs the Agent Architect co-pilot — a conversational agent that creates/edits
|
|
160
|
+
your own Agents via tool calls (`manage_agent`, `manage_skill`, ...). Same shape as `useChat` (same
|
|
161
|
+
streaming/interrupt/reload/ephemeral-thread mechanics), minus `agentId` (fixed target) and
|
|
162
|
+
`voice`/`sandboxCommands` (the Architect has neither):
|
|
163
|
+
|
|
164
|
+
```tsx
|
|
165
|
+
import { useArchitectChat } from "@personaai/react";
|
|
166
|
+
|
|
167
|
+
const architect = useArchitectChat({ threadId });
|
|
168
|
+
|
|
169
|
+
await architect.sendMessage("Create a support bot that...");
|
|
170
|
+
if (architect.interrupt?.kind === "hitl") {
|
|
171
|
+
await architect.resumeInterrupt({ decisions: [{ type: "approve" }] }, "Approved");
|
|
172
|
+
}
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
`threadId` resume only has an effect when the underlying credential asserts an external user
|
|
176
|
+
(`x-persona-external-user-id`) — a bare Project credential has no Subject for a Thread to belong to,
|
|
177
|
+
so the backend keeps its single deterministic per-Project conversation either way.
|
|
178
|
+
|
|
156
179
|
## Devtools
|
|
157
180
|
|
|
158
181
|
Floating panel for local debugging — inspect hooks, messages and threads with zero runtime changes. Dev-only, not bundled to production unless imported.
|