Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

feat(astra): gate RTVI tools through app permissions

David87eeb4ed8ff4
diff --git a/e2e/astra-proof.html b/e2e/astra-proof.html
new file mode 100644
index 00000000..45b0ab87
--- /dev/null
+++ b/e2e/astra-proof.html
@@ -0,0 +1,8 @@
+<!doctype html>
+<html lang="en">
+<head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Astra tool permission proof</title></head>
+<body>
+<div id="root"></div><output id="executions">0</output>
+<script type="module">import { mount } from './support/astra-fixture.ts'; mount();</script>
+</body>
+</html>
diff --git a/e2e/astra-tool-permissions.spec.ts b/e2e/astra-tool-permissions.spec.ts
new file mode 100644
index 00000000..090d2fe0
--- /dev/null
+++ b/e2e/astra-tool-permissions.spec.ts
@@ -0,0 +1,20 @@
+import { expect, test } from '@playwright/test'
+
+test('RTVI tool request requires a visible approval and Stop blocks further requests', async ({ page }) => {
+ await page.goto('/e2e/astra-proof.html')
+ const status = page.getByRole('region', { name: 'Voice tool controls' }).getByRole('status')
+ await expect(status).toContainText('connected')
+ await page.evaluate(() => dispatchEvent(new Event('proof-call')))
+ await expect(page.getByText('Allow file_write for this call?')).toBeVisible()
+ await expect(page.locator('pre')).toContainText('report.txt')
+ await expect(page.locator('#executions')).toHaveText('0')
+ await page.getByRole('button', { name: 'Allow this call' }).click()
+ await expect(page.locator('#executions')).toHaveText('1')
+ await page.evaluate(() => dispatchEvent(new Event('proof-call')))
+ await expect(page.getByRole('button', { name: 'Deny', exact: true })).toBeVisible()
+ await page.getByRole('button', { name: 'Stop voice tools' }).click()
+ await expect(status).toContainText('stopped')
+ await page.evaluate(() => dispatchEvent(new Event('proof-call')))
+ await expect(page.locator('#executions')).toHaveText('1')
+ await expect(page.getByRole('button', { name: 'Allow this call' })).toHaveCount(0)
+})
diff --git a/e2e/support/astra-fixture.ts b/e2e/support/astra-fixture.ts
new file mode 100644
index 00000000..ca127e79
--- /dev/null
+++ b/e2e/support/astra-fixture.ts
@@ -0,0 +1,28 @@
+import { createElement } from 'react'
+import { createRoot } from 'react-dom/client'
+import { PipecatClient, RTVIMessage, RTVIMessageType } from '@pipecat-ai/client-js'
+import { VoiceToolSession } from '../../src/components/astra/VoiceToolSession'
+import { VoiceTestTransport } from '../../src/api/__tests__/helpers/voice-transport'
+import { ToolRegistry } from '../../src/api/mcp/tool-registry'
+import { DEFAULT_PERMISSIONS } from '../../src/api/mcp/types'
+import type { AgentRunContext } from '../../src/api/agent-context'
+
+export function mount() {
+ const transport = new VoiceTestTransport()
+ const client = new PipecatClient({ transport, enableMic: false, enableCam: false })
+ const registry = new ToolRegistry()
+ let calls = 0
+ registry.registerBuiltin({ name: 'file_write', category: 'filesystem', source: 'builtin', description: 'Proof-only executor',
+ inputSchema: { type: 'object', properties: { path: { type: 'string' } }, required: ['path'] } }, async () => {
+ document.getElementById('executions')!.textContent = String(++calls)
+ return 'Proof-only result, no file written.'
+ })
+ const run: AgentRunContext = { token: 'browser-proof', chatId: 'proof', conversationId: 'proof', workspace: null,
+ artifactMode: false, readOnlyShellTurn: false, mode: null, artifacts: [] }
+ const options = { registry, run, offeredTools: ['file_write'],
+ permissions: () => ({ categories: DEFAULT_PERMISSIONS, overrides: {} }) }
+ createRoot(document.getElementById('root')!).render(createElement(VoiceToolSession, { client, options, profile: 'local' }))
+ let id = 0
+ window.addEventListener('proof-call', () => transport.receive(new RTVIMessage(RTVIMessageType.LLM_FUNCTION_CALL_IN_PROGRESS,
+ { tool_call_id: `call-${++id}`, function_name: 'file_write', arguments: { path: 'report.txt' } })))
+}
diff --git a/package-lock.json b/package-lock.json
index 3f5675d0..80862abf 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -9,6 +9,8 @@
"version": "2.6.9",
"license": "AGPL-3.0-only",
"dependencies": {
+ "@pipecat-ai/client-js": "1.13.1",
+ "@pipecat-ai/client-react": "1.8.2",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.5.0",
"@supabase/supabase-js": "^2.110.0",
@@ -118,7 +120,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz",
"integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/helper-validator-identifier": "^7.29.7",
@@ -133,7 +135,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz",
"integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -143,7 +145,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz",
"integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.29.7",
@@ -174,7 +176,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz",
"integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.29.7",
@@ -191,7 +193,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz",
"integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/compat-data": "^7.29.7",
@@ -208,7 +210,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz",
"integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -218,7 +220,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz",
"integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/traverse": "^7.29.7",
@@ -232,7 +234,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz",
"integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.29.7",
@@ -250,7 +252,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz",
"integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -260,7 +262,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz",
"integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -270,7 +272,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz",
"integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -280,7 +282,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz",
"integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/template": "^7.29.7",
@@ -294,7 +296,7 @@
"version": "7.29.8",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.8.tgz",
"integrity": "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.29.8"
@@ -319,7 +321,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz",
"integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.29.7",
@@ -334,7 +336,7 @@
"version": "7.29.7",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz",
"integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.29.7",
@@ -353,7 +355,7 @@
"version": "7.29.8",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz",
"integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"dependencies": {
"@babel/helper-string-parser": "^7.29.7",
@@ -1159,6 +1161,47 @@
"url": "https://github.com/sponsors/Boshen"
}
},
+ "node_modules/@pipecat-ai/client-js": {
+ "version": "1.13.1",
+ "resolved": "https://registry.npmjs.org/@pipecat-ai/client-js/-/client-js-1.13.1.tgz",
+ "integrity": "sha512-kRzNWBouHrYyoc6iN60RO97kBhB+uAPSXzf3M1tL//w59X8lkPGCL1onM0crh28C64nxP4hJ0+v6Spf5amJKIg==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "@types/events": "^3.0.3",
+ "bowser": "^2.11.0",
+ "clone-deep": "^4.0.1",
+ "events": "^3.3.0",
+ "typed-emitter": "^2.1.0",
+ "uuid": "^11.1.1"
+ }
+ },
+ "node_modules/@pipecat-ai/client-js/node_modules/uuid": {
+ "version": "11.1.1",
+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.1.1.tgz",
+ "integrity": "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ==",
+ "funding": [
+ "https://github.com/sponsors/broofa",
+ "https://github.com/sponsors/ctavan"
+ ],
+ "license": "MIT",
+ "bin": {
+ "uuid": "dist/esm/bin/uuid"
+ }
+ },
+ "node_modules/@pipecat-ai/client-react": {
+ "version": "1.8.2",
+ "resolved": "https://registry.npmjs.org/@pipecat-ai/client-react/-/client-react-1.8.2.tgz",
+ "integrity": "sha512-F6Uf5lkjiYfv2UlwMnJkDleAZpX7ljWTPkp6Z1z5fIjy9+/DbyKdX0Otli6HuotgkVAPhbLjxGT+XKmOVvECxQ==",
+ "license": "BSD-2-Clause",
+ "dependencies": {
+ "jotai": "^2.9.0"
+ },
+ "peerDependencies": {
+ "@pipecat-ai/client-js": "*",
+ "react": ">=18",
+ "react-dom": ">=18"
+ }
+ },
"node_modules/@playwright/test": {
"version": "1.61.1",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.61.1.tgz",
@@ -2316,6 +2359,12 @@
"@types/estree": "*"
}
},
+ "node_modules/@types/events": {
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.3.tgz",
+ "integrity": "sha512-trOc4AAUThEz9hapPtSd7wf5tiQKvTtu5b371UxXdTuqzIh0ArcRspRP0i0Viu+LXstIQ1z96t1nsPxT9ol01g==",
+ "license": "MIT"
+ },
"node_modules/@types/hast": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz",
@@ -3171,7 +3220,7 @@
"version": "2.10.38",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.38.tgz",
"integrity": "sha512-31/02mVB4yuQU6adKk5SlY6m+mxDwUq5KZkyYgnLrrKl7TEm1+3PyDtDBz2kOv/wxZz41GHsvV1A/u6RmiyBvw==",
- "dev": true,
+ "devOptional": true,
"license": "Apache-2.0",
"bin": {
"baseline-browser-mapping": "dist/cli.cjs"
@@ -3247,6 +3296,12 @@
"integrity": "sha512-iD3898SR7sWVRHbiQv+sHUtHnMvC1o3nW5rAcqnq3uOn07DSAppZYUkIGslDz6gXC7HfunPe7YVBgoEJASPcHA==",
"license": "MIT"
},
+ "node_modules/bowser": {
+ "version": "2.14.1",
+ "resolved": "https://registry.npmjs.org/bowser/-/bowser-2.14.1.tgz",
+ "integrity": "sha512-tzPjzCxygAKWFOJP011oxFHs57HzIhOEracIgAePE4pqB3LikALKnSzUyU4MGs9/iCEUuHlAJTjTc5M+u7YEGg==",
+ "license": "MIT"
+ },
"node_modules/brace-expansion": {
"version": "1.1.13",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.13.tgz",
@@ -3262,7 +3317,7 @@
"version": "4.28.2",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.2.tgz",
"integrity": "sha512-48xSriZYYg+8qXna9kwqjIVzuQxi+KYWp2+5nCYnYKPTr0LvD89Jqk2Or5ogxz0NUMfIjhh2lIUX/LyX9B4oIg==",
- "dev": true,
+ "devOptional": true,
"funding": [
{
"type": "opencollective",
@@ -3343,7 +3398,7 @@
"version": "1.0.30001799",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz",
"integrity": "sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw==",
- "dev": true,
+ "devOptional": true,
"funding": [
{
"type": "opencollective",
@@ -3473,6 +3528,20 @@
"node": ">=0.8"
}
},
+ "node_modules/clone-deep": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz",
+ "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==",
+ "license": "MIT",
+ "dependencies": {
+ "is-plain-object": "^2.0.4",
+ "kind-of": "^6.0.2",
+ "shallow-clone": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
"node_modules/color-convert": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
@@ -3530,7 +3599,7 @@
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
"integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/core-util-is": {
@@ -4107,7 +4176,7 @@
"version": "1.5.376",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.376.tgz",
"integrity": "sha512-cUVA7/RvbFTEuw/i3obUwDTRIXojaxkResf+ibByPFxjc6XK3VNtcQXV0NSbAlJ0FMjcJGgftVVB4Qo184EXvA==",
- "dev": true,
+ "devOptional": true,
"license": "ISC"
},
"node_modules/enhanced-resolve": {
@@ -4156,7 +4225,7 @@
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
"integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6"
@@ -4415,6 +4484,15 @@
"node": ">=0.10.0"
}
},
+ "node_modules/events": {
+ "version": "3.3.0",
+ "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz",
+ "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.x"
+ }
+ },
"node_modules/expect-type": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/expect-type/-/expect-type-1.3.0.tgz",
@@ -4638,7 +4716,7 @@
"version": "1.0.0-beta.2",
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
"integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=6.9.0"
@@ -5177,6 +5255,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/is-plain-object": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+ "license": "MIT",
+ "dependencies": {
+ "isobject": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/is-potential-custom-element-name": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
@@ -5238,6 +5328,15 @@
"integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
"license": "ISC"
},
+ "node_modules/isobject": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+ "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/its-fine": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/its-fine/-/its-fine-2.0.0.tgz",
@@ -5259,11 +5358,40 @@
"jiti": "lib/jiti-cli.mjs"
}
},
+ "node_modules/jotai": {
+ "version": "2.20.3",
+ "resolved": "https://registry.npmjs.org/jotai/-/jotai-2.20.3.tgz",
+ "integrity": "sha512-N8L9FUbeGDP+0qNJw1FebOxt+5hk+jTOwUA2LlRE4C081jUcY6F1T/FSETp4DT2/INMtiSRZyNm2D+yZdzrSgA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12.20.0"
+ },
+ "peerDependencies": {
+ "@babel/core": ">=7.0.0",
+ "@babel/template": ">=7.0.0",
+ "@types/react": ">=17.0.0",
+ "react": ">=17.0.0"
+ },
+ "peerDependenciesMeta": {
+ "@babel/core": {
+ "optional": true
+ },
+ "@babel/template": {
+ "optional": true
+ },
+ "@types/react": {
+ "optional": true
+ },
+ "react": {
+ "optional": true
+ }
+ }
+ },
"node_modules/js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
- "dev": true,
+ "devOptional": true,
"license": "MIT"
},
"node_modules/js-yaml": {
@@ -5370,7 +5498,7 @@
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz",
"integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"bin": {
"jsesc": "bin/jsesc"
@@ -5404,7 +5532,7 @@
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
"integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"bin": {
"json5": "lib/cli.js"
@@ -5451,6 +5579,15 @@
"json-buffer": "3.0.1"
}
},
+ "node_modules/kind-of": {
+ "version": "6.0.3",
+ "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+ "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
"node_modules/levn": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
@@ -5802,7 +5939,7 @@
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
"integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
- "dev": true,
+ "devOptional": true,
"license": "ISC",
"dependencies": {
"yallist": "^3.0.2"
@@ -6988,7 +7125,7 @@
"version": "2.0.48",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.48.tgz",
"integrity": "sha512-1uz8041X6LoI6ZSdZacM9lVY28vuzDlSKitnpbSNK0RfKoIJkX29NBPVEFXhnuSuEOA9Ww0xnPJ+ILWbGAv8DA==",
- "dev": true,
+ "devOptional": true,
"license": "MIT",
"engines": {
"node": ">=18"
@@ -7906,6 +8043,16 @@
"integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",
"license": "MIT"
},
+ "node_modules/rxjs": {
+ "version": "7.8.2",
+ "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz",
+ "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==",
+ "license": "Apache-2.0",
+ "optional": true,
+ "dependencies": {
+ "tslib": "^2.1.0"
+ }
+ },
"node_modules/safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
@@ -7962,7 +8109,7 @@
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
"integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
- "dev": true,
+ "devOptional": true,
"license": "ISC",
"bin": {
"semver": "bin/semver.js"
@@ -7974,6 +8121,18 @@
"integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==",
"license": "MIT"
},
+ "node_modules/shallow-clone": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz",
+ "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==",
+ "license": "MIT",
+ "dependencies": {
+ "kind-of": "^6.0.2"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
@@ -8561,6 +8720,15 @@
"node": ">= 0.8.0"
}
},
+ "node_modules/typed-emitter": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/typed-emitter/-/typed-emitter-2.1.0.tgz",
+ "integrity": "sha512-g/KzbYKbH5C2vPkaXGu8DJlHrGKHLsM25Zg9WuC9pMGfuvT+X25tZQWo5fK1BjBm8+UrVE9LDCvaY0CQk+fXDA==",
+ "license": "MIT",
+ "optionalDependencies": {
+ "rxjs": "*"
+ }
+ },
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
@@ -8741,7 +8909,7 @@
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz",
"integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==",
- "dev": true,
+ "devOptional": true,
"funding": [
{
"type": "opencollective",
@@ -9177,7 +9345,7 @@
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
"integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
- "dev": true,
+ "devOptional": true,
"license": "ISC"
},
"node_modules/yocto-queue": {
diff --git a/package.json b/package.json
index f99f0484..2991cda1 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,8 @@
"test:e2e": "playwright test"
},
"dependencies": {
+ "@pipecat-ai/client-js": "1.13.1",
+ "@pipecat-ai/client-react": "1.8.2",
"@react-three/drei": "^10.7.7",
"@react-three/fiber": "^9.5.0",
"@supabase/supabase-js": "^2.110.0",
diff --git a/src/api/__tests__/helpers/voice-transport.ts b/src/api/__tests__/helpers/voice-transport.ts
new file mode 100644
index 00000000..23ac97d3
--- /dev/null
+++ b/src/api/__tests__/helpers/voice-transport.ts
@@ -0,0 +1,36 @@
+import { Transport, RTVIMessage } from '@pipecat-ai/client-js'
+import type { PipecatClientOptions, TransportState } from '@pipecat-ai/client-js'
+
+// Test-only transport. Actual SDK parsing and dispatch, no network or devices.
+export class VoiceTestTransport extends Transport {
+ sent: RTVIMessage[] = []
+ receive: (message: RTVIMessage) => void = () => {}
+ initialize(_options: PipecatClientOptions, handler: (message: RTVIMessage) => void) {
+ this.receive = handler
+ this._state = 'ready'
+ }
+ async initDevices() {}
+ _validateConnectionParams(value: unknown) { return value }
+ async _connect() { this._state = 'ready' }
+ async _disconnect() { this._state = 'disconnected' }
+ sendReadyMessage() {}
+ get state() { return this._state }
+ set state(value: TransportState) { this._state = value }
+ async getAllMics() { return [] }
+ async getAllCams() { return [] }
+ async getAllSpeakers() { return [] }
+ updateMic() {}
+ updateCam() {}
+ updateSpeaker() {}
+ get selectedMic() { return {} }
+ get selectedCam() { return {} }
+ get selectedSpeaker() { return {} }
+ enableMic() {}
+ enableCam() {}
+ enableScreenShare() {}
+ get isCamEnabled() { return false }
+ get isMicEnabled() { return false }
+ get isSharingScreen() { return false }
+ sendMessage(message: RTVIMessage) { this.sent.push(message) }
+ tracks() { return { local: {} } }
+}
diff --git a/src/api/__tests__/voice-tool-bridge.test.ts b/src/api/__tests__/voice-tool-bridge.test.ts
new file mode 100644
index 00000000..b0041223
--- /dev/null
+++ b/src/api/__tests__/voice-tool-bridge.test.ts
@@ -0,0 +1,178 @@
+// @vitest-environment jsdom
+import { afterEach, expect, it, vi } from 'vitest'
+import { createElement } from 'react'
+import { render, screen, fireEvent, cleanup, waitFor, act } from '@testing-library/react'
+import { PipecatClient, RTVIMessage, RTVIMessageType } from '@pipecat-ai/client-js'
+import { VoiceTestTransport } from './helpers/voice-transport'
+import { VoiceToolBridge } from '../voice-tool-bridge'
+import type { VoiceToolBridgeOptions } from '../voice-tool-bridge'
+import { ToolRegistry } from '../mcp/tool-registry'
+import { DEFAULT_PERMISSIONS } from '../mcp/types'
+import type { PermissionLevel } from '../mcp/types'
+import type { AgentRunContext } from '../agent-context'
+import { createVoiceLoopStore } from '../../stores/voiceLoopStore'
+import { VoiceToolSession } from '../../components/astra/VoiceToolSession'
+
+const bridges: VoiceToolBridge[] = []
+afterEach(() => { cleanup(); for (const b of bridges.splice(0)) b.stop() })
+
+function setup(attach = true) {
+ const transport = new VoiceTestTransport()
+ const client = new PipecatClient({ transport, enableMic: false, enableCam: false })
+ const registry = new ToolRegistry()
+ const execute = vi.fn(async (_args: Record<string, unknown>, _run?: AgentRunContext, _signal?: AbortSignal) => 'done')
+ for (const [name, category] of [['file_write', 'filesystem'], ['web_fetch', 'web']] as const) {
+ registry.registerBuiltin({ name, category, source: 'builtin', description: 'Test tool',
+ inputSchema: { type: 'object', properties: { value: { type: 'string' } }, required: ['value'] } }, execute)
+ }
+ const store = createVoiceLoopStore('local', 'assistant')
+ const parent = new AbortController()
+ const run: AgentRunContext = { token: 'voice-test', chatId: 'chat-1', conversationId: 'chat-1', workspace: null,
+ artifactMode: false, readOnlyShellTurn: false, mode: null, artifacts: [], abortSignal: parent.signal }
+ const permissions = { categories: { ...DEFAULT_PERMISSIONS }, overrides: {} as Record<string, PermissionLevel> }
+ const options: VoiceToolBridgeOptions = { client, registry, run, store, offeredTools: ['file_write', 'web_fetch'], permissions: () => permissions }
+ const bridge = attach ? new VoiceToolBridge(options) : null
+ if (bridge) bridges.push(bridge)
+ const call = (id = 'call-1', name = 'file_write', args: Record<string, unknown> = { value: 'hello' }) =>
+ transport.receive(new RTVIMessage(RTVIMessageType.LLM_FUNCTION_CALL_IN_PROGRESS, { tool_call_id: id, function_name: name, arguments: args }))
+ return { transport, client, execute, store, parent, run, permissions, options, bridge, call }
+}
+
+it('uses actual SDK events and result envelopes, then executes a permitted read in its run', async () => {
+ const s = setup()
+ s.call('read-1', 'web_fetch')
+ await waitFor(() => expect(s.transport.sent).toHaveLength(1))
+ expect(s.execute).toHaveBeenCalledTimes(1)
+ expect(s.execute.mock.calls[0][1]?.conversationId).toBe('chat-1')
+ expect(s.transport.sent[0]).toMatchObject({ label: 'rtvi-ai', type: 'llm-function-call-result',
+ data: { tool_call_id: 'read-1', result: { status: 'completed', text: 'done' } } })
+})
+
+it('requires confirmation and does not execute a duplicate call twice', async () => {
+ const s = setup()
+ s.call(); s.call()
+ await waitFor(() => expect(s.store.getState().pendingApproval?.name).toBe('file_write'))
+ expect(s.execute).not.toHaveBeenCalled()
+ s.bridge!.answer(true)
+ await waitFor(() => expect(s.execute).toHaveBeenCalledTimes(1))
+ s.call()
+ await waitFor(() => expect(s.transport.sent).toHaveLength(1))
+ expect(s.execute).toHaveBeenCalledTimes(1)
+})
+
+it('stops on reuse of a call ID with different arguments', async () => {
+ const s = setup()
+ s.call(); s.call('call-1', 'file_write', { value: 'changed' })
+ expect(s.store.getState().status).toBe('error')
+ await Promise.resolve()
+ expect(s.execute).not.toHaveBeenCalled()
+})
+
+for (const reason of ['blocked', 'not-offered', 'invalid-schema', 'denied', 'revoked', 'read-only'] as const) {
+ it(`does not dispatch a ${reason} call`, async () => {
+ const s = setup()
+ if (reason === 'blocked') s.permissions.categories.filesystem = 'blocked'
+ if (reason === 'read-only') s.run.readOnlyShellTurn = true
+ s.call('call-1', reason === 'not-offered' ? 'shell_execute' : 'file_write', reason === 'invalid-schema' ? {} : { value: 'x' })
+ if (reason === 'denied' || reason === 'revoked') {
+ await waitFor(() => expect(s.store.getState().pendingApproval).not.toBeNull())
+ if (reason === 'revoked') s.permissions.categories.filesystem = 'blocked'
+ s.bridge!.answer(reason === 'revoked')
+ }
+ await waitFor(() => expect(s.transport.sent).toHaveLength(1))
+ expect(s.execute).not.toHaveBeenCalled()
+ })
+}
+
+it('parent stop clears approvals and prevents queued work and late results', async () => {
+ const s = setup()
+ s.call(); s.call('call-2', 'web_fetch')
+ await waitFor(() => expect(s.store.getState().pendingApproval).not.toBeNull())
+ s.parent.abort(); s.bridge!.answer(true)
+ await Promise.resolve()
+ expect(s.store.getState().pendingApproval).toBeNull()
+ expect(s.store.getState().status).toBe('stopped')
+ expect(s.execute).not.toHaveBeenCalled()
+ expect(s.transport.sent).toHaveLength(0)
+})
+
+it('honors per-call cancellation while waiting for approval', async () => {
+ const s = setup()
+ s.call()
+ await waitFor(() => expect(s.store.getState().pendingApproval).not.toBeNull())
+ s.transport.receive(new RTVIMessage(RTVIMessageType.LLM_FUNCTION_CALL_STOPPED, { tool_call_id: 'call-1', cancelled: true }))
+ await waitFor(() => expect(s.transport.sent).toHaveLength(1))
+ expect(s.execute).not.toHaveBeenCalled()
+ expect(s.store.getState().pendingApproval).toBeNull()
+})
+
+it('forwards stop to an already running tool', async () => {
+ const s = setup()
+ let signal: AbortSignal | undefined
+ s.execute.mockImplementation(async (_args, _run, abort) => {
+ signal = abort
+ return new Promise((resolve) => abort!.addEventListener('abort', () => resolve('cancelled'), { once: true }))
+ })
+ s.call('read-1', 'web_fetch')
+ await waitFor(() => expect(signal).toBeDefined())
+ s.bridge!.stop()
+ expect(signal!.aborted).toBe(true)
+ await Promise.resolve()
+ expect(s.transport.sent).toHaveLength(0)
+})
+
+it('never enables tools in Live mode and bounds oversized arguments', () => {
+ const live = setup()
+ live.store.setState({ mode: 'live' }); live.call()
+ expect(live.store.getState().status).toBe('error')
+ const large = setup()
+ large.call('call-1', 'file_write', { value: 'x'.repeat(17000) })
+ expect(large.store.getState().status).toBe('error')
+ expect(large.execute).not.toHaveBeenCalled()
+})
+
+it('requires confirmation for mutations even when the category is auto in a supervised session', async () => {
+ const s = setup()
+ s.permissions.categories.filesystem = 'auto'
+ s.call()
+ await waitFor(() => expect(s.store.getState().pendingApproval).not.toBeNull())
+ expect(s.execute).not.toHaveBeenCalled()
+ s.bridge!.answer(false)
+ await waitFor(() => expect(s.transport.sent).toHaveLength(1))
+})
+
+it('fails closed when the inbound queue exceeds its bound', async () => {
+ const s = setup()
+ for (let i = 0; i < 17; i++) s.call(`call-${i}`)
+ expect(s.store.getState().status).toBe('error')
+ await Promise.resolve()
+ expect(s.execute).not.toHaveBeenCalled()
+})
+
+it('does not let an old bridge cleanup overwrite a replacement session store', async () => {
+ const s = setup()
+ s.call()
+ await waitFor(() => expect(s.store.getState().pendingApproval).not.toBeNull())
+ s.bridge!.stop()
+ const next = new VoiceToolBridge(s.options)
+ bridges.push(next)
+ s.call('next-call')
+ await waitFor(() => expect(s.store.getState().pendingApproval?.id).toBe('next-call'))
+ expect(s.store.getState().generation).toBe(2)
+ expect(s.store.getState().status).toBe('connected')
+ expect(s.store.getState().currentTool).toBe('file_write')
+})
+
+it('renders actual React SDK bindings, displays the full payload and allows one approved call', async () => {
+ const s = setup(false)
+ render(createElement(VoiceToolSession, { client: s.client, options: s.options, profile: 'local' }))
+ act(() => s.call('ui-call', 'file_write', { value: '<script>not markup</script>' }))
+ const allow = await screen.findByRole('button', { name: 'Allow this call' })
+ expect(screen.getByText(/<script>not markup<\/script>/)).toBeTruthy()
+ expect(document.querySelector('section script')).toBeNull()
+ expect(s.execute).not.toHaveBeenCalled()
+ fireEvent.click(allow)
+ await waitFor(() => expect(s.execute).toHaveBeenCalledTimes(1))
+ fireEvent.click(screen.getByRole('button', { name: 'Stop voice tools' }))
+ await waitFor(() => expect(screen.getByRole('status').textContent).toContain('stopped'))
+})
diff --git a/src/api/voice-tool-bridge.ts b/src/api/voice-tool-bridge.ts
new file mode 100644
index 00000000..373e506d
--- /dev/null
+++ b/src/api/voice-tool-bridge.ts
@@ -0,0 +1,208 @@
+import { RTVIEvent, RTVIMessage, RTVIMessageType, messageSizeWithinLimit } from '@pipecat-ai/client-js'
+import type { PipecatClient, LLMFunctionCallInProgressData, LLMFunctionCallStoppedData } from '@pipecat-ai/client-js'
+import { executeParallel } from './agents/tool-executor'
+import { stableArgsHash } from './agents/block-helpers'
+import type { AgentRunContext } from './agent-context'
+import type { ToolRegistry } from './mcp/tool-registry'
+import type { PermissionMap, PermissionLevel } from './mcp/types'
+import { resolveApprovalLevel } from '../lib/agent-approval-policy'
+import { MUTATING_TOOLS } from '../lib/mutating-tools'
+import type { VoiceLoopStore, VoiceLoopState } from '../stores/voiceLoopStore'
+
+type Client = Pick<PipecatClient, 'on' | 'off' | 'transport' | 'connected'>
+export interface VoiceToolPermissions {
+ categories: PermissionMap
+ overrides: Record<string, PermissionLevel>
+}
+export interface VoiceToolBridgeOptions {
+ client: Client
+ registry: ToolRegistry
+ run: AgentRunContext
+ store: VoiceLoopStore
+ // Both values originate in the app, never from an RTVI message.
+ offeredTools: readonly string[]
+ permissions: () => VoiceToolPermissions
+ autonomous?: boolean
+ toolTimeoutMs?: number
+}
+
+// Only the app executes tools. This bridge owns one session and is not reused
+// after stop/disconnect. Bounded receipts prevent duplicate side effects.
+export class VoiceToolBridge {
+ private readonly options: VoiceToolBridgeOptions
+ private readonly generation: number
+ private readonly abort = new AbortController()
+ private readonly offered: Set<string>
+ private readonly receipts = new Map<string, string>()
+ private readonly calls = new Map<string, AbortController>()
+ private queue: Promise<void> = Promise.resolve()
+ private resolveApproval: ((approved: boolean) => void) | null = null
+ private readonly parentAbort = () => this.stop()
+ private readonly connected = () => this.update({ status: 'connected' })
+
+ constructor(options: VoiceToolBridgeOptions) {
+ this.options = options
+ this.generation = options.store.getState().generation + 1
+ options.store.setState({ generation: this.generation, error: null })
+ this.offered = new Set(options.offeredTools)
+ options.client.on(RTVIEvent.LLMFunctionCallInProgress, this.receive)
+ options.client.on(RTVIEvent.LLMFunctionCallStopped, this.cancel)
+ options.client.on(RTVIEvent.Disconnected, this.parentAbort)
+ options.client.on(RTVIEvent.Connected, this.connected)
+ options.run.abortSignal?.addEventListener('abort', this.parentAbort, { once: true })
+ options.store.setState({ status: options.client.connected ? 'connected' : 'idle' })
+ if (options.run.abortSignal?.aborted) this.stop()
+ }
+
+ answer(approved: boolean): void {
+ this.resolveApproval?.(approved)
+ }
+
+ private update(state: Partial<VoiceLoopState>): void {
+ if (this.options.store.getState().generation === this.generation) this.options.store.setState(state)
+ }
+
+ stop(): void {
+ if (this.abort.signal.aborted) return
+ this.abort.abort()
+ this.resolveApproval?.(false)
+ const { client, run } = this.options
+ client.off(RTVIEvent.LLMFunctionCallInProgress, this.receive)
+ client.off(RTVIEvent.LLMFunctionCallStopped, this.cancel)
+ client.off(RTVIEvent.Disconnected, this.parentAbort)
+ client.off(RTVIEvent.Connected, this.connected)
+ run.abortSignal?.removeEventListener('abort', this.parentAbort)
+ this.calls.clear()
+ this.receipts.clear()
+ this.update({ status: 'stopped', pendingApproval: null, currentTool: null })
+ }
+
+ private fail(): void {
+ this.stop()
+ this.update({ status: 'error', error: 'The voice tool session stopped safely. Start a new session to continue.' })
+ }
+
+ private cancel = (data: LLMFunctionCallStoppedData): void => {
+ if (data.cancelled) this.calls.get(data.tool_call_id)?.abort()
+ }
+
+ private receive = (data: LLMFunctionCallInProgressData): void => {
+ if (this.abort.signal.aborted) return
+ if (!this.options.client.connected || this.options.store.getState().mode !== 'assistant') {
+ this.fail()
+ return
+ }
+ const id = data?.tool_call_id
+ const name = data?.function_name
+ const args = data?.arguments
+ if (typeof id !== 'string' || !/^[A-Za-z0-9_-]{1,200}$/.test(id)
+ || typeof name !== 'string' || !/^[A-Za-z0-9_-]{1,100}$/.test(name)
+ || !args || typeof args !== 'object' || Array.isArray(args)) {
+ this.fail()
+ return
+ }
+ let snapshot: Record<string, unknown>
+ let fingerprint: string
+ try {
+ const serialized = JSON.stringify(args)
+ if (new TextEncoder().encode(serialized).byteLength > 16_384) throw new Error('Oversized arguments')
+ snapshot = JSON.parse(serialized) as Record<string, unknown>
+ fingerprint = name + ':' + stableArgsHash(snapshot)
+ } catch {
+ this.fail()
+ return
+ }
+ const prior = this.receipts.get(id)
+ if (prior) {
+ if (prior !== fingerprint) this.fail()
+ return
+ }
+ // Never evict a receipt and allow an old mutation to run again.
+ if (this.receipts.size >= 256 || this.calls.size >= 16) {
+ this.fail()
+ return
+ }
+ this.receipts.set(id, fingerprint)
+ const control = new AbortController()
+ this.calls.set(id, control)
+ // One serial app queue also orders calls arriving in different RTVI events.
+ this.queue = this.queue.then(() => this.execute(id, name, snapshot, control))
+ .catch(() => this.fail())
+ }
+
+ private level(name: string): PermissionLevel {
+ const { registry, permissions, run, autonomous } = this.options
+ const tool = registry.getToolByName(name)
+ if (!tool || !this.offered.has(name)) return 'blocked'
+ const p = permissions()
+ const level = resolveApprovalLevel(name, {
+ categoryLevel: p.categories[tool.category], override: p.overrides[name],
+ codexMode: run.mode, execConfirm: run.execApproval?.confirmExec,
+ readOnlyRun: run.readOnlyShellTurn,
+ })
+ if (level === 'auto' && !autonomous && MUTATING_TOOLS.has(name)) return 'confirm'
+ return level
+ }
+
+ private async approve(id: string, name: string, args: Record<string, unknown>, signal: AbortSignal): Promise<boolean> {
+ if (signal.aborted) return false
+ const level = this.level(name)
+ if (level === 'blocked') return false
+ if (level === 'auto') return true
+ return new Promise<boolean>((resolve) => {
+ const finish = (approved: boolean) => {
+ signal.removeEventListener('abort', aborted)
+ this.resolveApproval = null
+ this.update({ pendingApproval: null })
+ resolve(approved && !signal.aborted && this.level(name) !== 'blocked')
+ }
+ const aborted = () => finish(false)
+ this.resolveApproval = finish
+ signal.addEventListener('abort', aborted, { once: true })
+ this.update({ pendingApproval: { id, name, args } })
+ })
+ }
+
+ private async execute(id: string, name: string, args: Record<string, unknown>, control: AbortController): Promise<void> {
+ const { registry, run, client } = this.options
+ if (this.abort.signal.aborted) return
+ const signal = AbortSignal.any([this.abort.signal, control.signal])
+ const timeout = Math.min(600_000, Math.max(100, this.options.toolTimeoutMs ?? 120_000))
+ const timer = setTimeout(() => control.abort(), timeout)
+ this.update({ currentTool: name })
+ let approvalLevel: PermissionLevel = 'blocked'
+ try {
+ const [result] = await executeParallel([{ id, toolName: name, args, run: { ...run, abortSignal: signal } }], {
+ getTool: (toolName) => this.offered.has(toolName) ? registry.getToolByName(toolName) : undefined,
+ awaitApproval: (request) => {
+ approvalLevel = this.level(name)
+ return this.approve(id, name, request.args, signal)
+ },
+ execute: async (toolName, validatedArgs, context) => {
+ const current = this.level(toolName)
+ if (signal.aborted || current === 'blocked' || (current === 'confirm' && approvalLevel !== 'confirm')) {
+ return 'Error: Tool permission changed before dispatch.'
+ }
+ return registry.execute(toolName, validatedArgs, 0, context, signal)
+ },
+ }, { abortSignal: signal })
+ if (!this.abort.signal.aborted) {
+ const message = new RTVIMessage(RTVIMessageType.LLM_FUNCTION_CALL_RESULT, {
+ function_name: name, tool_call_id: id, arguments: args,
+ result: result.status === 'completed'
+ ? { status: 'completed', text: (result.result ?? '').slice(0, 65_536), truncated: (result.result?.length ?? 0) > 65_536 }
+ : { status: result.status, error: 'The tool did not complete. It may have been denied, cancelled or failed validation.' },
+ })
+ if (!messageSizeWithinLimit(message, client.transport.maxMessageSize)) {
+ this.fail()
+ return
+ }
+ client.transport.sendMessage(message)
+ }
+ } finally {
+ clearTimeout(timer)
+ this.calls.delete(id)
+ this.update({ currentTool: null })
+ }
+ }
+}
diff --git a/src/components/astra/VoiceToolControls.tsx b/src/components/astra/VoiceToolControls.tsx
new file mode 100644
index 00000000..9afa0ff6
--- /dev/null
+++ b/src/components/astra/VoiceToolControls.tsx
@@ -0,0 +1,22 @@
+import { useStore } from 'zustand'
+import type { VoiceLoopStore } from '../../stores/voiceLoopStore'
+
+export function VoiceToolControls({ store, answer, stop }: {
+ store: VoiceLoopStore
+ answer: (approved: boolean) => void
+ stop: () => void
+}) {
+ const state = useStore(store)
+ return <section aria-label="Voice tool controls">
+ <p role="status">{state.error ?? (state.currentTool ? `Tool: ${state.currentTool}` : `Voice session: ${state.status}`)}</p>
+ {state.pendingApproval && <div role="group" aria-label="Approve voice tool">
+ <p>Allow {state.pendingApproval.name} for this call?</p>
+ <pre tabIndex={0} style={{ maxHeight: 240, overflow: 'auto', whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }}>
+ {JSON.stringify(state.pendingApproval.args, null, 2)}
+ </pre>
+ <button type="button" onClick={() => answer(true)}>Allow this call</button>
+ <button type="button" onClick={() => answer(false)}>Deny</button>
+ </div>}
+ <button type="button" onClick={stop} disabled={state.status === 'stopped' || state.status === 'idle'}>Stop voice tools</button>
+ </section>
+}
diff --git a/src/components/astra/VoiceToolSession.tsx b/src/components/astra/VoiceToolSession.tsx
new file mode 100644
index 00000000..b2e2e9d7
--- /dev/null
+++ b/src/components/astra/VoiceToolSession.tsx
@@ -0,0 +1,36 @@
+import { useEffect, useMemo, useRef } from 'react'
+import { PipecatClientProvider, usePipecatClient } from '@pipecat-ai/client-react'
+import type { PipecatClient } from '@pipecat-ai/client-js'
+import { VoiceToolBridge } from '../../api/voice-tool-bridge'
+import type { VoiceToolBridgeOptions } from '../../api/voice-tool-bridge'
+import { createVoiceLoopStore } from '../../stores/voiceLoopStore'
+import type { VoiceLoopState } from '../../stores/voiceLoopStore'
+import { VoiceToolControls } from './VoiceToolControls'
+
+type Options = Omit<VoiceToolBridgeOptions, 'client' | 'store'>
+
+function BoundTools({ options, profile }: { options: Options; profile: VoiceLoopState['profile'] }) {
+ const client = usePipecatClient()
+ const store = useMemo(() => createVoiceLoopStore(profile, 'assistant'), [profile])
+ const bridge = useRef<VoiceToolBridge | null>(null)
+ useEffect(() => {
+ if (!client) return
+ const session = new VoiceToolBridge({ ...options, client, store })
+ bridge.current = session
+ return () => { session.stop(); bridge.current = null }
+ }, [client, options, store])
+ return <VoiceToolControls store={store} answer={(value) => bridge.current?.answer(value)} stop={() => {
+ bridge.current?.stop()
+ void client?.disconnect().catch(() => store.setState({ error: 'Voice connection cleanup failed. Tools are stopped.' }))
+ }} />
+}
+
+// The caller supplies an authenticated transport and a stable per-run options
+// object. Mount once per session. There is no provider credential in this UI.
+export function VoiceToolSession({ client, options, profile }: {
+ client: PipecatClient; options: Options; profile: VoiceLoopState['profile']
+}) {
+ return <PipecatClientProvider client={client}>
+ <BoundTools key={options.run.token} options={options} profile={profile} />
+ </PipecatClientProvider>
+}
diff --git a/src/stores/voiceLoopStore.ts b/src/stores/voiceLoopStore.ts
new file mode 100644
index 00000000..6cfe11df
--- /dev/null
+++ b/src/stores/voiceLoopStore.ts
@@ -0,0 +1,26 @@
+import { createStore } from 'zustand/vanilla'
+import type { ToolArgs } from '../api/mcp/types'
+
+export interface VoiceApproval {
+ id: string
+ name: string
+ args: ToolArgs
+}
+
+export interface VoiceLoopState {
+ generation: number
+ status: 'idle' | 'connected' | 'stopped' | 'error'
+ profile: 'local' | 'hybrid' | 'cloud'
+ mode: 'assistant' | 'live'
+ pendingApproval: VoiceApproval | null
+ currentTool: string | null
+ error: string | null
+}
+
+// A separate, non-persisted store per voice session. Never store auth tokens.
+export const createVoiceLoopStore = (profile: VoiceLoopState['profile'], mode: VoiceLoopState['mode']) =>
+ createStore<VoiceLoopState>(() => ({
+ generation: 0, status: 'idle', profile, mode, pendingApproval: null, currentTool: null, error: null,
+ }))
+
+export type VoiceLoopStore = ReturnType<typeof createVoiceLoopStore>
diff --git a/third-party/ASTRA-CLIENT-NOTICES.md b/third-party/ASTRA-CLIENT-NOTICES.md
new file mode 100644
index 00000000..1dd722a8
--- /dev/null
+++ b/third-party/ASTRA-CLIENT-NOTICES.md
@@ -0,0 +1,545 @@
+# Astra client dependency notices
+
+Pinned versions from package-lock.json. These notices must accompany distributions containing the Astra client. Pipecat client license text is from the upstream pipecat-client-web LICENSE.md; other texts are supplied by the installed packages.
+
+## node_modules/@pipecat-ai/client-js 1.13.1 (BSD-2-Clause)
+
+BSD 2-Clause License
+
+Copyright (c) 2024, Daily
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+## node_modules/@pipecat-ai/client-js/node_modules/uuid 11.1.1 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2010-2020 Robert Kieffer and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+## node_modules/@pipecat-ai/client-react 1.8.2 (BSD-2-Clause)
+
+BSD 2-Clause License
+
+Copyright (c) 2024, Daily
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+2. Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+## node_modules/@types/events 3.0.3 (MIT)
+
+ MIT License
+
+ Copyright (c) Microsoft Corporation.
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in all
+ copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE
+
+
+## node_modules/bowser 2.14.1 (MIT)
+
+Copyright 2015, Dustin Diaz (the "Original Author")
+All rights reserved.
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+Distributions of all or part of the Software intended to be used
+by the recipients as they would use the unmodified Software,
+containing modifications that substantially alter, remove, or
+disable functionality of the Software, outside of the documented
+configuration mechanisms provided by the Software, shall be
+modified such that the Original Author's bug reporting email
+addresses and urls are either replaced with the contact information
+of the parties responsible for the changes, or removed entirely.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+
+Except where noted, this license applies to any and all software
+programs and associated documentation files created by the
+Original Author, when distributed with the Software.
+
+
+## node_modules/clone-deep 4.0.1 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2018, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+## node_modules/events 3.3.0 (MIT)
+
+MIT
+
+Copyright Joyent, Inc. and other Node contributors.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+## node_modules/is-plain-object 2.0.4 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+## node_modules/isobject 3.0.1 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+## node_modules/jotai 2.20.3 (MIT)
+
+MIT License
+
+Copyright (c) 2020 Poimandres
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+
+## node_modules/kind-of 6.0.3 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2014-2017, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+## node_modules/rxjs 7.8.2 (Apache-2.0)
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright (c) 2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+
+
+## node_modules/shallow-clone 3.0.1 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2015-present, Jon Schlinkert.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+
+
+## node_modules/typed-emitter 2.1.0 (MIT)
+
+The MIT License (MIT)
+
+Copyright (c) 2018 Andy Wermke
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/tsconfig.e2e.json b/tsconfig.e2e.json
index d959135d..8a607a57 100644
--- a/tsconfig.e2e.json
+++ b/tsconfig.e2e.json
@@ -27,6 +27,7 @@
"target": "ES2023",
"lib": ["ES2023", "DOM", "DOM.Iterable"],
"module": "ESNext",
+ "jsx": "react-jsx",
/* `node` fuer process.env in playwright.config.ts, `vite/client` fuer die
src-Dateien, die die Spezifikationen mitziehen. */
"types": ["node", "vite/client"],