@personaai/react 0.16.0 → 0.17.1
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 +45 -4
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/docs/.nojekyll +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
React SDK for [Persona](https://persona.hasanraiyan.me) — hooks and a context provider for building chat UIs against any Persona backend.
|
|
4
4
|
|
|
5
|
-
> **v0.
|
|
5
|
+
> **v0.17.0.** Requires React 18+. Client-side only — never holds a credential.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -48,7 +48,7 @@ function Chat() {
|
|
|
48
48
|
|
|
49
49
|
| Hook | Purpose |
|
|
50
50
|
| -------------------- | ----------------------------------------------------------------------------------------------- |
|
|
51
|
-
| `useChat` | Streaming chat — messages, send, stop, reload, interrupts, workspace
|
|
51
|
+
| `useChat` | Streaming chat — messages, send, stop, reload, interrupts, live workspace/todo state, sandbox commands, ephemeral new chat |
|
|
52
52
|
| `useArchitectChat` | Streaming chat with the Agent Architect co-pilot — same mechanics as `useChat`, no `agentId` |
|
|
53
53
|
| `useWorkflowStream` | Live streaming workflow execution — real-time node state tracking, cancellation, and resume |
|
|
54
54
|
| `useWorkflows` | Workflow discovery & creation — list, paginate, filter, and create workflows |
|
|
@@ -57,10 +57,51 @@ function Chat() {
|
|
|
57
57
|
| `useVoice` | Real-time voice calls (Gemini Live) — start/stop/mute, live transcript, tool calls |
|
|
58
58
|
| `useThreads` | Thread CRUD — list, create, delete, rename, reset, archive |
|
|
59
59
|
| `useFiles` | Upload management — list, upload, delete |
|
|
60
|
-
| `useMemory` | Persistent memory —
|
|
61
|
-
| `
|
|
60
|
+
| `useMemory` | Persistent memory CRUD — `scope: "user" \| "agent" \| "workspace"` (an Agent's own `/workspace/` files) |
|
|
61
|
+
| `useWorkspaceFiles` | Thin wrapper over `useMemory` (`scope: "workspace"`) scoped to one Agent — list/get/write/delete |
|
|
62
|
+
| `useAgents` | Agent discovery — list available agents (`visibility: "public"` or self-owned only) |
|
|
63
|
+
| `useSkills` | Skill CRUD — list, create, update, delete, usage |
|
|
64
|
+
| `useKnowledgeBases` | Knowledge base CRUD + document upload/search |
|
|
65
|
+
| `useRcpSources` | RCP source CRUD + test connection |
|
|
66
|
+
| `useMcpAdmin` | Self-serve MCP connector CRUD (`scope: "mine"` only) |
|
|
67
|
+
| `useMcp` | MCP discovery + tool listing |
|
|
68
|
+
| `useMcpConnections` | End-user MCP OAuth connect/disconnect flow |
|
|
62
69
|
| `useConnection` | Health check — backend connectivity status |
|
|
63
70
|
|
|
71
|
+
## Memory & an Agent's `/workspace/` files
|
|
72
|
+
|
|
73
|
+
```tsx
|
|
74
|
+
const { memory, getFile, writeFile, deleteFile } = useMemory();
|
|
75
|
+
|
|
76
|
+
// memory.userFiles (shared across every Agent), memory.agentMemories, and
|
|
77
|
+
// memory.agentWorkspaces are each PersonaMemoryAgentGroup[] — grouped one entry per Agent.
|
|
78
|
+
await writeFile({ path: "/preferences.md", content: "Prefers concise answers.", scope: "user" });
|
|
79
|
+
|
|
80
|
+
// An Agent's own /workspace/ files — the SAME persistent store its `write_file`/`read_file` tool
|
|
81
|
+
// calls use (NOT a Thread's live/checkpointed state, a different, much narrower thing). Shared
|
|
82
|
+
// across every Thread this Subject has with that Agent, not private to one conversation.
|
|
83
|
+
const report = await getFile({ path: "/outputs/report.md", scope: "workspace", agentId });
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`useWorkspaceFiles(agentId)` is a thinner wrapper over the same `scope: "workspace"` calls, scoped
|
|
87
|
+
to one Agent up front — handy for a dedicated file-explorer UI that isn't inside an active chat:
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
const { files, isLoading, writeFile, deleteFile } = useWorkspaceFiles(agentId);
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`useChat()`'s own `files`/`todos` are a different, read-only, per-Thread live snapshot (from
|
|
94
|
+
`STATE_SNAPSHOT` events during a run) — use `useWorkspaceFiles`/`useMemory` for CRUD independent of
|
|
95
|
+
an active chat session.
|
|
96
|
+
|
|
97
|
+
## Sandbox terminal
|
|
98
|
+
|
|
99
|
+
If an Agent has `sandboxEnabled: true` (check the active Thread's populated `agentId` — see
|
|
100
|
+
`@personaai/sdk`'s README), its `execute` tool calls are real shell commands in an isolated VM, not
|
|
101
|
+
simulated. `useChat()`'s `sandboxCommands: PersonaSandboxCommand[]` is a pure derived view over the
|
|
102
|
+
same tool-call stream already backing `messages` — `{ toolCallId, command, output, exitCode,
|
|
103
|
+
status }` — enough to build a read-only terminal-style replay with no separate fetch or polling.
|
|
104
|
+
|
|
64
105
|
## Voice
|
|
65
106
|
|
|
66
107
|
Real-time voice calls with an Agent, powered by Gemini Live. Requires your backend to be running
|
package/dist/index.cjs
CHANGED
|
@@ -4358,7 +4358,7 @@ function useWorkflowRuns(workflowId, options) {
|
|
|
4358
4358
|
|
|
4359
4359
|
// src/index.ts
|
|
4360
4360
|
var import_logger2 = require("@personaai/logger");
|
|
4361
|
-
var VERSION = "0.
|
|
4361
|
+
var VERSION = "0.17.0";
|
|
4362
4362
|
// Annotate the CommonJS export names for ESM import in node:
|
|
4363
4363
|
0 && (module.exports = {
|
|
4364
4364
|
ARCHITECT_AGENT_ID,
|