@dudko.dev/agent-web-react 0.0.4 → 0.0.5
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 +13 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -342,6 +342,19 @@ from one place.
|
|
|
342
342
|
> Ship only the **user's own** key to the browser — shared/app keys belong
|
|
343
343
|
> behind a proxy or the gateway.
|
|
344
344
|
|
|
345
|
+
## Browser tests
|
|
346
|
+
|
|
347
|
+
`npm run test:e2e` builds the demo and drives it in Chromium: connecting to a
|
|
348
|
+
remote MCP server, the full OAuth redirect round-trip (authorize → come back
|
|
349
|
+
with a code → connected), reuse of the stored tokens after a reload, and the
|
|
350
|
+
error path for an unreachable server. The MCP and authorization servers it
|
|
351
|
+
talks to are started on loopback by [`e2e/servers.ts`](e2e/servers.ts), CORS
|
|
352
|
+
headers included — so the test also pins the deployment requirement that the
|
|
353
|
+
challenge header be exposed.
|
|
354
|
+
|
|
355
|
+
These cover what unit tests structurally cannot: effect ordering across a real
|
|
356
|
+
render, a real navigation away and back, and IndexedDB.
|
|
357
|
+
|
|
345
358
|
## Demo & deployment
|
|
346
359
|
|
|
347
360
|
The [`demo/`](demo/) app (Vite + React) is deployed to GitHub Pages by
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dudko.dev/agent-web-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "React bindings for @dudko.dev/agent-web: a headless useAgent hook, an AgentProvider context, and optional pre-styled components (chat panel, plan/step view, BYOK key form, WebLLM load bar) that connect the in-browser LLM agent to any React site. UI you can drop in — or a headless reducer you can build your own around.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -38,7 +38,8 @@
|
|
|
38
38
|
"format:check": "prettier --check \"src/**/*.{ts,tsx,css}\" \"tests/**/*.ts\"",
|
|
39
39
|
"test": "node --test --experimental-strip-types --disable-warning=ExperimentalWarning tests/*.test.ts",
|
|
40
40
|
"prepublishOnly": "npm run typecheck && npm test && npm run build",
|
|
41
|
-
"pretest": "npm run build"
|
|
41
|
+
"pretest": "npm run build",
|
|
42
|
+
"test:e2e": "playwright test"
|
|
42
43
|
},
|
|
43
44
|
"keywords": [
|
|
44
45
|
"agent",
|
|
@@ -111,6 +112,7 @@
|
|
|
111
112
|
"devDependencies": {
|
|
112
113
|
"@dudko.dev/agent-web": "^0.0.12",
|
|
113
114
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
115
|
+
"@playwright/test": "^1.62.1",
|
|
114
116
|
"@types/node": "^22.9.0",
|
|
115
117
|
"@types/react": "^19.2.18",
|
|
116
118
|
"@types/react-dom": "^19.2.4",
|