Skip to content
This repository was archived by the owner on Jun 14, 2026. It is now read-only.

Commit 3f5edbd

Browse files
committed
feat(react): add useChat hook package
1 parent fac47ee commit 3f5edbd

10 files changed

Lines changed: 771 additions & 0 deletions

File tree

packages/react/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## @agentic-kit/react
2+
3+
Headless React bindings for `agentic-kit`.
4+
5+
Currently exposes a single hook:
6+
7+
- `useChat({ api, body, initialMessages, onMessage, onFinish, onDecisionPending })`
8+
POSTs `messages` to `api`, parses the SSE response into `AgentEvent`s, and
9+
folds them into a `Message[]`. Surfaces pause/resume via `pendingDecision` +
10+
`respondWithDecision(toolCallId, value)`.
11+
12+
The hook ships no UI. State lives in messages — there is no separate run
13+
store, no `runId`. Resumption after a tool decision re-POSTs to the same `api`
14+
endpoint with the augmented message log.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true,
5+
"rootDir": "../../..",
6+
"baseUrl": "../../..",
7+
"paths": {
8+
"@test/*": ["tools/test/*"],
9+
"agentic-kit": ["packages/agentic-kit/src"],
10+
"@agentic-kit/agent": ["packages/agent/src"],
11+
"@agentic-kit/react": ["packages/react/src"]
12+
},
13+
"types": ["jest", "node"]
14+
},
15+
"include": [
16+
"./**/*.ts",
17+
"./**/*.tsx",
18+
"../src/**/*.ts",
19+
"../src/**/*.tsx",
20+
"../../../tools/test/**/*.ts"
21+
],
22+
"exclude": ["../dist", "../node_modules"]
23+
}

0 commit comments

Comments
 (0)