From a397c69a42dcd50e1f3037c0f7c6b6c06b0d6184 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Tue, 17 Nov 2026 20:47:52 +0000 Subject: [PATCH] Show a sub agent as a card with its run inside A sub agent that an agent started was invisible: the Claude adapter sent its tool calls as flat rows of the thread, Codex sent only start and end rows, and opencode sent nothing. The adapters now report a sub agent as a session of its own, and the thread shows it as a closed card at the point where the agent started it. The card names the sub agent, shows a spinner while it runs, and holds the text, the tool calls and the nested sub agents of its run. A permission request of a sub agent renders inside the card. The gateway declares the native sub agent sessions of the AIR contract, records the thread of each sub agent session and routes its updates and permission requests to that thread. The child session notifications of opencode are translated into the same form. The dashboard did not show the output of a Codex command, because the adapter sends it in output chunks beside the content. The gateway declares that chunk channel, and the card of a command shows the chunks. The harnesses move to the versions that report sub agents: claude-agent-acp 0.108, codex-acp 2.7 with Codex 0.169, and opencode 2.3.0 from the @opencode/cli package. Codex 0.169 ignores commit_attribution and warns about it, so the box config drops the setting. opencode 2 reads no OPENCODE_DISABLE_LSP_DOWNLOAD and installs no plugin package at its start, so the harness and the home seed drop both. The ACP SDK of the orchestrator and assistant-ui follow. --- box-image/Dockerfile | 29 +- box-image/codex-config.toml | 3 - box-image/opencode.sh | 8 +- dashboard/e2e/stub-gateway.ts | 40 +- dashboard/e2e/thread.test.ts | 78 ++ dashboard/package-lock.json | 1016 +++++++++-------- dashboard/package.json | 4 +- dashboard/src/components/SubagentCard.tsx | 112 ++ .../assistant-ui/elements/thread.aui.tsx | 11 +- .../elements/tool-fallback.aui.tsx | 48 +- dashboard/src/lib/approvals.ts | 23 + dashboard/src/stores/thread/acp-types.ts | 22 + dashboard/src/stores/thread/convert.test.ts | 60 + dashboard/src/stores/thread/convert.ts | 34 +- dashboard/src/stores/thread/thread-store.ts | 2 +- dashboard/src/stores/thread/translate.test.ts | 173 +++ dashboard/src/stores/thread/translate.ts | 181 ++- dashboard/src/views/BoxThread.tsx | 217 ++-- doc/acp.md | 27 +- doc/threads.md | 23 + orchestrator/package-lock.json | 16 +- orchestrator/package.json | 2 +- orchestrator/src/boxenv.test.ts | 1 - orchestrator/src/gateway/adapter.test.ts | 56 + orchestrator/src/gateway/adapter.ts | 174 ++- orchestrator/src/gateway/broadcast.ts | 5 +- orchestrator/src/gateway/upstream.test.ts | 149 +++ orchestrator/src/gateway/upstream.ts | 50 +- orchestrator/src/harness.test.ts | 1 - orchestrator/src/harness.ts | 7 +- shared/acp.ts | 7 + 31 files changed, 1820 insertions(+), 759 deletions(-) create mode 100644 dashboard/src/components/SubagentCard.tsx create mode 100644 dashboard/src/lib/approvals.ts create mode 100644 dashboard/src/stores/thread/convert.test.ts create mode 100644 orchestrator/src/gateway/adapter.test.ts diff --git a/box-image/Dockerfile b/box-image/Dockerfile index 71aa8f92..550d604d 100644 --- a/box-image/Dockerfile +++ b/box-image/Dockerfile @@ -25,8 +25,8 @@ # only after it names it again with a bare ARG. ARG NODE_MAJOR=26 ARG NIX_VERSION=2.34.8 -ARG CODEX_VERSION=0.156.1 -ARG OPENCODE_VERSION=1.19.3 +ARG CODEX_VERSION=0.169.0 +ARG OPENCODE_VERSION=2.3.0 # The agent's own account, and the defaults of the orchestrator's BOX_UID and # BOX_GID. 1020 keeps clear of the ubuntu user at 1000, which is often a @@ -157,7 +157,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends libicu78 \ # /usr/local. RUN npm install -g --prefix /usr/local \ @anthropic-ai/claude-code@^2 \ - @agentclientprotocol/claude-agent-acp@^0.81.0 \ + @agentclientprotocol/claude-agent-acp@^0.108.0 \ && npm cache clean --force # The Codex CLI and its ACP adapter, both pinned exactly. @@ -170,7 +170,7 @@ RUN npm install -g --prefix /usr/local \ ARG CODEX_VERSION RUN npm install -g --prefix /usr/local @openai/codex@${CODEX_VERSION} \ && npm install -g --prefix /usr/local --omit=optional \ - @agentclientprotocol/codex-acp@1.13.0 \ + @agentclientprotocol/codex-acp@2.7.0 \ && npm cache clean --force ENV CODEX_PATH=/usr/local/bin/codex @@ -179,17 +179,11 @@ COPY box-image/codex-config.toml /etc/codex/config.toml # opencode, pinned exactly. It is its own ACP adapter. # -# The postinstall script of opencode-ai selects the platform binary by the CPU -# of the build host. The install skips the script. The start script selects -# the binary by the CPU of the host that runs the box. -# -# opencode installs @opencode-ai/plugin in its own version into -# ~/.config/opencode at its start, when the folder has no node_modules. The -# home seed holds that install, so a new box does not download it. +# The postinstall script of @opencode/cli selects the platform binary by the +# CPU of the build host. The install skips the script. The start script +# selects the binary by the CPU of the host that runs the box. ARG OPENCODE_VERSION -RUN npm install -g --prefix /usr/local --ignore-scripts opencode-ai@${OPENCODE_VERSION} \ - && npm install --prefix /usr/local/share/boxes/home/.config/opencode --ignore-scripts --save-exact \ - @opencode-ai/plugin@${OPENCODE_VERSION} \ +RUN npm install -g --prefix /usr/local --ignore-scripts @opencode/cli@${OPENCODE_VERSION} \ && npm cache clean --force COPY box-image/opencode.sh /usr/local/bin/opencode RUN chmod 0755 /usr/local/bin/opencode @@ -328,11 +322,10 @@ RUN test "$(id -u)" = "${AGENT_UID}" \ && test "$(command -v codex)" = "/usr/local/bin/codex" \ && codex --version | grep -qF "${CODEX_VERSION}" \ && test "$(command -v opencode)" = "/usr/local/bin/opencode" \ - && opencode --version | grep -qxF "${OPENCODE_VERSION}" \ + && opencode --version | grep -qxF "opencode v${OPENCODE_VERSION}" \ && { test "$(dpkg --print-architecture)" != amd64 \ - || /usr/local/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64-baseline/bin/opencode \ - --version | grep -qxF "${OPENCODE_VERSION}"; } \ - && test -f /home/agent/.config/opencode/node_modules/@opencode-ai/plugin/package.json \ + || /usr/local/lib/node_modules/@opencode/cli/node_modules/@opencode/cli-linux-x64-baseline/bin/opencode \ + --version | grep -qxF "opencode v${OPENCODE_VERSION}"; } \ && test "$(command -v boxes-files)" = "/usr/local/bin/boxes-files" \ && boxes-files /dev/null; then - build=opencode-linux-x64 + build=cli-linux-x64 else - build=opencode-linux-x64-baseline + build=cli-linux-x64-baseline fi ;; - aarch64) build=opencode-linux-arm64 ;; + aarch64) build=cli-linux-arm64 ;; *) echo "opencode: no build for $(uname -m)" >&2 exit 1 diff --git a/dashboard/e2e/stub-gateway.ts b/dashboard/e2e/stub-gateway.ts index bbf6ddba..c2871f93 100644 --- a/dashboard/e2e/stub-gateway.ts +++ b/dashboard/e2e/stub-gateway.ts @@ -11,6 +11,7 @@ import { import type { ThreadConfigOption, ThreadModeState, + ThreadNotification, ThreadUpdate, } from '../src/stores/thread/acp-types.ts'; @@ -166,8 +167,9 @@ export interface StubGateway { * * @param update The update. * @param threadId The ACP id of the thread. Defaults to the default thread. + * @param sessionId The session the update names, which is the thread or a sub agent of it. */ - emit: (update: ThreadUpdate, threadId?: string) => void; + emit: (update: ThreadUpdate, threadId?: string, sessionId?: string) => void; /** Closes every socket and the server. */ close: () => void; } @@ -234,7 +236,7 @@ export function attachStubGateway( /** Every attached socket, each recording the thread it is pinned to. */ const sockets = new Map(); /** One transcript per thread, which is what session/load replays. */ - const threads = new Map([[THREAD_ID, []]]); + const threads = new Map([[THREAD_ID, []]]); /** The thread a socket naming none is pinned to. */ let current = THREAD_ID; let nextThread = 2; @@ -259,7 +261,7 @@ export function attachStubGateway( * @param threadId The ACP id of the thread. * @returns The transcript. */ - const historyOf = (threadId: string): ThreadUpdate[] => { + const historyOf = (threadId: string): ThreadNotification[] => { let found = threads.get(threadId); if (!found) { found = []; @@ -304,15 +306,17 @@ export function attachStubGateway( * * @param update The update. * @param threadId The ACP id of the thread. Defaults to the default thread. + * @param sessionId The session the update names, which is the thread or a sub agent of it. */ - const emit = (update: ThreadUpdate, threadId: string = current): void => { - historyOf(threadId).push(update); + const emit = ( + update: ThreadUpdate, + threadId: string = current, + sessionId: string = threadId, + ): void => { + const params = { sessionId, update }; + historyOf(threadId).push(params); for (const ws of watchers(threadId)) { - send(ws, { - jsonrpc: '2.0', - method: 'session/update', - params: { sessionId: threadId, update }, - }); + send(ws, { jsonrpc: '2.0', method: 'session/update', params }); } }; @@ -324,7 +328,13 @@ export function attachStubGateway( */ const mint = (from: string | null): string => { const id = `acp-thread-${nextThread++}`; - threads.set(id, from ? [...historyOf(from)] : []); + // The fork's own updates name the fork, as the gateway replays them. + threads.set( + id, + from + ? historyOf(from).map((p) => ({ ...p, sessionId: p.sessionId === from ? id : p.sessionId })) + : [], + ); // The new thread becomes the default. Sockets stay pinned to their threads. current = id; return id; @@ -425,12 +435,8 @@ export function attachStubGateway( send(ws, { jsonrpc: '2.0', method: REPLAY_METHOD, params: notice }); } // The replay goes to this socket only. - for (const update of historyOf(threadId).slice(dropped)) { - send(ws, { - jsonrpc: '2.0', - method: 'session/update', - params: { sessionId: threadId, update }, - }); + for (const params of historyOf(threadId).slice(dropped)) { + send(ws, { jsonrpc: '2.0', method: 'session/update', params }); } // The real gateway sends the turn state after the replay. turnState(threadId, ws); diff --git a/dashboard/e2e/thread.test.ts b/dashboard/e2e/thread.test.ts index 279e59c3..99ff4ef5 100644 --- a/dashboard/e2e/thread.test.ts +++ b/dashboard/e2e/thread.test.ts @@ -858,3 +858,81 @@ test('a cut thread offers its full history at the top, and loads it in place', a await close(); } }); + +test('a sub agent is a closed card that shows its run when opened', async () => { + await start(); + + const { page, errors, close } = await openPage( + stub.url, + `/boxes/${BOX.id}/threads/${BOX.threadId}`, + 'dark', + 'desktop', + ); + try { + await expect.poll(() => page.getByText('connected').isVisible()).toBe(true); + + stub.gateway.emit({ + sessionUpdate: 'agent_message_chunk', + content: { type: 'text', text: 'I ask a sub agent to read the file.' }, + } as ThreadUpdate); + stub.gateway.emit({ + sessionUpdate: 'subagent_spawned', + subagentSessionId: 'child-1', + name: 'Find the words', + task: 'Read words.txt and report the words in it.', + } as ThreadUpdate); + // The run of the sub agent arrives on its own session. + stub.gateway.emit( + { + sessionUpdate: 'tool_call', + toolCallId: 'tc-child', + title: 'Read words.txt', + kind: 'read', + status: 'completed', + content: [{ type: 'content', content: { type: 'text', text: 'alpha\nbeta\ngamma' } }], + } as ThreadUpdate, + undefined, + 'child-1', + ); + stub.gateway.emit( + { + sessionUpdate: 'agent_message_chunk', + content: { type: 'text', text: 'The file has three words.' }, + } as ThreadUpdate, + undefined, + 'child-1', + ); + + // The card names the sub agent and is closed, so the run inside is not shown. + const card = page.locator('[data-slot="tool-fallback-trigger"]', { hasText: 'Find the words' }); + await expect.poll(() => card.isVisible()).toBe(true); + expect(await card.textContent()).toContain('Sub agent'); + expect(await page.getByText('The file has three words.').isVisible()).toBe(false); + + await card.click(); + await expect.poll(() => page.getByText('The file has three words.').isVisible()).toBe(true); + await expect.poll(() => page.getByText('Read words.txt and report').isVisible()).toBe(true); + // The tool call of the sub agent is a card of its own inside, in a tool group like in the thread. + const run = page.locator('[data-slot="subagent-run"]'); + await run.locator('[data-slot="tool-group-trigger"]').click(); + const inner = run.locator('[data-slot="tool-fallback-trigger"]', { + hasText: 'Read words.txt', + }); + await expect.poll(() => inner.isVisible()).toBe(true); + // The row shimmers while the sub agent runs, and stops when it ends. + const label = card.locator('[data-slot="tool-fallback-trigger-label"]'); + const shimmers = () => label.evaluate((el) => el.classList.contains('shimmer')); + expect(await shimmers()).toBe(true); + + stub.gateway.emit({ + sessionUpdate: 'subagent_state_update', + subagentSessionId: 'child-1', + state: 'completed', + } as ThreadUpdate); + await expect.poll(shimmers).toBe(false); + await shoot(page, 'thread-subagent'); + expect(errors).toEqual([]); + } finally { + await close(); + } +}); diff --git a/dashboard/package-lock.json b/dashboard/package-lock.json index 85b4528d..44fd32fa 100644 --- a/dashboard/package-lock.json +++ b/dashboard/package-lock.json @@ -8,8 +8,8 @@ "name": "boxes-dashboard", "version": "1.0.0", "dependencies": { - "@assistant-ui/react": "0.15.21", - "@assistant-ui/react-markdown": "0.14.16", + "@assistant-ui/react": "0.15.36", + "@assistant-ui/react-markdown": "0.14.26", "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", "class-variance-authority": "^0.7.1", @@ -66,37 +66,34 @@ } }, "node_modules/@assistant-ui/core": { - "version": "0.3.20", - "resolved": "https://registry.npmjs.org/@assistant-ui/core/-/core-0.3.20.tgz", - "integrity": "sha512-gSY7kI5crnbaXFaF2tObBVekXvQCpBz0D8CqzEkDJrKOwe57gn2K52qBr2hL0o36Ssyg0DmiEAi0LjPG5ZSGqQ==", + "version": "0.3.36", + "resolved": "https://registry.npmjs.org/@assistant-ui/core/-/core-0.3.36.tgz", + "integrity": "sha512-/LTpkA5tDBWcJoitUYihDtDFjMfSdQvh+40S1HLrrNfuUoGc9Qq16qtiAcO//9l0pALRxs9YxX0CEPw6WYA0Aw==", "license": "MIT", "dependencies": { - "assistant-stream": "^0.3.44", - "nanoid": "^6.0.1" + "assistant-cloud": "^0.2.12", + "assistant-stream": "^0.3.57", + "nanoid": "^6.0.2" }, "peerDependencies": { - "@assistant-ui/store": "^0.3.14", - "@assistant-ui/tap": "^0.9.18", + "@assistant-ui/store": "^0.3.23", + "@assistant-ui/tap": "^0.9.26", "@types/react": "*", - "assistant-cloud": "^0.2.1", "react": "^18 || ^19" }, "peerDependenciesMeta": { "@types/react": { "optional": true }, - "assistant-cloud": { - "optional": true - }, "react": { "optional": true } } }, "node_modules/@assistant-ui/core/node_modules/nanoid": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-6.0.1.tgz", - "integrity": "sha512-3wVS3i51pE2pi1k5FFL/95BGfVS0kSsvDVuGXHOtxox/TywUmtgq+3qiTOTbs9J7KfHaXPiN171k/A6dBnaXFw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-6.0.2.tgz", + "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", "funding": [ { "type": "github", @@ -112,21 +109,21 @@ } }, "node_modules/@assistant-ui/react": { - "version": "0.15.21", - "resolved": "https://registry.npmjs.org/@assistant-ui/react/-/react-0.15.21.tgz", - "integrity": "sha512-5VID3r2YpYFbx6LLfyOSWwRVf4WOJXYsfSN/C67sbCsJsqqBbxeQpn4MB9g73HcyriBkRwqvHY5XXCguyNqP6Q==", + "version": "0.15.36", + "resolved": "https://registry.npmjs.org/@assistant-ui/react/-/react-0.15.36.tgz", + "integrity": "sha512-cFaOFrPIRTZgzHMh7tCUEf6fjLcodUZU/fynDq6eZhlZFVldJYORPU025/GZbw+fkNIyoJs8V7Nq89MpFYFQzg==", "license": "MIT", "dependencies": { - "@assistant-ui/core": "^0.3.20", - "@assistant-ui/store": "^0.3.14", - "@assistant-ui/tap": "^0.9.18", - "assistant-cloud": "^0.2.2", - "assistant-stream": "^0.3.44", - "radix-ui": "^1.6.7", + "@assistant-ui/core": "^0.3.35", + "@assistant-ui/store": "^0.3.23", + "@assistant-ui/tap": "^0.9.25", + "assistant-cloud": "^0.2.11", + "assistant-stream": "^0.3.57", + "radix-ui": "^1.8.1", "react-textarea-autosize": "^8.5.9", - "safe-content-frame": "^0.0.31", - "zod": "^4.6.5", - "zustand": "^5.0.15" + "safe-content-frame": "^0.0.34", + "zod": "^4.6.7", + "zustand": "^5.0.16" }, "peerDependencies": { "@types/react": "*", @@ -144,15 +141,15 @@ } }, "node_modules/@assistant-ui/react-markdown": { - "version": "0.14.16", - "resolved": "https://registry.npmjs.org/@assistant-ui/react-markdown/-/react-markdown-0.14.16.tgz", - "integrity": "sha512-RhzvQT7h8ArNcgnOxWAGwRdcOMs7N90ua/PZJiEd5LgK6/9GdGgnTJAoMJa+oneqxFiv6e/jiL2dapHvOrONCA==", + "version": "0.14.26", + "resolved": "https://registry.npmjs.org/@assistant-ui/react-markdown/-/react-markdown-0.14.26.tgz", + "integrity": "sha512-gOW2h4LFoLV5zu/frTJsbiU1SWgL6ky9vD6WqmAbEQE6gkoDAktWhWLa44pD3PF0XxgXLJJ85AM/diz5ncgFyA==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "^2.1.10", - "@radix-ui/react-use-callback-ref": "^1.1.4", + "@radix-ui/react-primitive": "^2.2.0", "@types/hast": "^3.0.5", "classnames": "^2.5.1", + "micromark-util-html-tag-name": "^2.0.1", "react-markdown": "^10.1.0" }, "peerDependencies": { @@ -167,12 +164,12 @@ } }, "node_modules/@assistant-ui/store": { - "version": "0.3.14", - "resolved": "https://registry.npmjs.org/@assistant-ui/store/-/store-0.3.14.tgz", - "integrity": "sha512-GqHYBD4TfSBTynyBYs2DDnyskfTVNtKHNaXws6dG5//18fb5PJyTYhXjkOSvDqF+dKX5rlOk9Bbd7G0CfJ+xkQ==", + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/@assistant-ui/store/-/store-0.3.23.tgz", + "integrity": "sha512-s0//CJ0miZO+LydznY8rcYD6cA9KnnMXeupaBXnGBPUNgFIwDFMtieTxnBvT8Io8PUGqDDcVEzQrLSLy8v4fRw==", "license": "MIT", "peerDependencies": { - "@assistant-ui/tap": "^0.9.18", + "@assistant-ui/tap": "^0.9.25", "@types/react": "*", "react": "^18 || ^19" }, @@ -186,9 +183,9 @@ } }, "node_modules/@assistant-ui/tap": { - "version": "0.9.18", - "resolved": "https://registry.npmjs.org/@assistant-ui/tap/-/tap-0.9.18.tgz", - "integrity": "sha512-JowBf+JbzQRarun3DWy/4H6XZ7v/1fJ154By00Kn7b30thmlA/bh2lOPa9hPPeYaMcsTiYYYu6yWEM+AFMvdIw==", + "version": "0.9.26", + "resolved": "https://registry.npmjs.org/@assistant-ui/tap/-/tap-0.9.26.tgz", + "integrity": "sha512-Rbau9i+EfPPNfXZBv0rXqZxbexR572xfKMnRXOrudRLfTYbzT2nfkyDh5NCpEutUV9uAJi1bBRoZqKrSQBpAKQ==", "license": "MIT", "peerDependencies": { "@types/react": "*", @@ -389,18 +386,18 @@ "license": "MIT" }, "node_modules/@radix-ui/primitive": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.7.tgz", - "integrity": "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.2.0.tgz", + "integrity": "sha512-KABY+VMIRPJL+Vyzv/335FEhXXD/xDv8BMb1kl48/aXJZMH0LtHCTx5ga5RnxaEP3nZHtmTLf1P9vanmFX46bw==", "license": "MIT" }, "node_modules/@radix-ui/react-accessible-icon": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.1.15.tgz", - "integrity": "sha512-WTQwcAvQf5sOcuUyi90lKPbhwcvQ+j55cjrSmeaN+L2vKU3DooOvlKw2MDeiJ5IkV5N905KW0/fGojKOBhD11A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-accessible-icon/-/react-accessible-icon-1.2.0.tgz", + "integrity": "sha512-BB4+HHkFl3HipEAhm/mLhrpXV+2kRX7MvY4AaImUcQVeWQt5KhV1JEByNs8NGfJOcr95RcQGijt9+OrCo68xGA==", "license": "MIT", "dependencies": { - "@radix-ui/react-visually-hidden": "1.2.11" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -418,20 +415,20 @@ } }, "node_modules/@radix-ui/react-accordion": { - "version": "1.2.20", - "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.2.20.tgz", - "integrity": "sha512-jDhG9FvAEnlhnjrsINbNXcUa4G+L1KqSkJSunkbKEzFRcAb52jvM0PjPxPRvhe1HNc5F5yc0yzzWeeqlH4yBIg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-accordion/-/react-accordion-1.3.1.tgz", + "integrity": "sha512-lCZ6sbGS/7WO0j84yx4srIgOf0MRJ/sZ13RonADXxvKBym8xrxNCq5f6DibGcr38sIlwPk8/52uYdXeOPsbEDw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collapsible": "1.1.20", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collapsible": "1.2.1", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -449,16 +446,16 @@ } }, "node_modules/@radix-ui/react-alert-dialog": { - "version": "1.1.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.23.tgz", - "integrity": "sha512-VAYOiQRqj3GPpYJE0I9J+X8Ip05cyVlNdKOFeiGS2Ou1HHGfpl0BxOyZm6nmVDyU+W+NF3/XLzmjHmVGydhwgA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.2.1.tgz", + "integrity": "sha512-MWC4N7RY+qsbNrFNo7yQ9ZbdoZEW+B5DtpWxJfUnVCqcQxxqqg3qis3RMPTDbCNaTIdHJSn5XDkl9ZdVWXknLg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dialog": "1.1.23", - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -476,12 +473,12 @@ } }, "node_modules/@radix-ui/react-arrow": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.15.tgz", - "integrity": "sha512-v4zggRcjadnI+ClKDuijlQEW4tw3NoaeHc/PwpKnLoLLKNUG4InLegkstooLcRIUWCs+8L22dGURCVuFfOKfnA==", + "version": "1.1.17", + "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.17.tgz", + "integrity": "sha512-67jjcVvxjXCCStnTW3Z+M7jmaFMuMR7M2JgpDzH4w7JSRrikmzhjfYgP/09ECb8n7whnsgh1ifJ+Ie96qEj+pQ==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -499,12 +496,12 @@ } }, "node_modules/@radix-ui/react-aspect-ratio": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.1.15.tgz", - "integrity": "sha512-fy+dyVR+90nelK8rqIznFlxzx7uPcGbhxH8Nfr2bHb4UfSe+e3hklOC0luK0hDwVwnRX7xTRySpsrQVeW+/oNQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-aspect-ratio/-/react-aspect-ratio-1.2.0.tgz", + "integrity": "sha512-gHEU+Lx8DlT/FYIjZQvvBJrFSwUngXTjh7FeL9QvJaNALDLez6pgDj2axCUihBjtPBy82LN0gNb25+sTcSXNmA==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -522,15 +519,15 @@ } }, "node_modules/@radix-ui/react-avatar": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.2.6.tgz", - "integrity": "sha512-4ULOTJ/mqy2hT9GlWa/MFHxHSvH3nJzHnZM1waNsc5Bonv7i70aNenghXmD97S6OJ81ekXONGGt4nT1r0PfEdA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-avatar/-/react-avatar-1.3.1.tgz", + "integrity": "sha512-ssZOkfQNkFpYVmCPQlr978xSaU7moSrGXdwg4j2Xs2WlGl/1KsSZtfpK+WnLnx0Rwll1BAh6oUrAy/uR31SBvQ==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-is-hydrated": "0.1.3", "@radix-ui/react-use-layout-effect": "1.1.4" }, @@ -550,18 +547,18 @@ } }, "node_modules/@radix-ui/react-checkbox": { - "version": "1.3.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.3.11.tgz", - "integrity": "sha512-Gnptr9pDDQxD3hgq2dtPbtrp/c2qH1mBwIzw3X/ivrMb2e1t0jMTi606fVEqFPaQR1ggXIVQWKj3P2WW9v7zGQ==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-checkbox/-/react-checkbox-1.4.1.tgz", + "integrity": "sha512-KWtwhh+98ML3seZ9vO9yRY2OwaQG90dCiDAxjpSNY2AaZ3Hik3B0dsk6m0ILywo/no3A9/SozadyPMNweVT8yw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6", - "@radix-ui/react-use-size": "1.1.4" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -579,18 +576,18 @@ } }, "node_modules/@radix-ui/react-collapsible": { - "version": "1.1.20", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.1.20.tgz", - "integrity": "sha512-mcGesGplBnzN2sbvJETzpCNfSMyPnb29q1GRLU+Ib7bJrpIG2ywmRoh2V5VbA2uNvKikKUlVbAPks7JDjz4A8Q==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collapsible/-/react-collapsible-1.2.1.tgz", + "integrity": "sha512-fSzLb/qy1wuZSxQBcxpW0hNXYHDMWiIXDGyJGdA4+FSLknOWZsNRrTCUavxb4PI8b8lvHo/CysO6NVi5zLpo5g==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", + "@radix-ui/react-context": "1.3.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -609,15 +606,16 @@ } }, "node_modules/@radix-ui/react-collection": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.1.15.tgz", - "integrity": "sha512-9W+B9NPF0NaaPh/1NJd3+KqsnlLqU9H7T2rvww+fp+T/evVXdNAyYcnfRQZFOjkR1ajQp3yORlqnI8soawLvNA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-collection/-/react-collection-1.2.0.tgz", + "integrity": "sha512-+yiQzqcc7Sy7/5s0jrMCjpPRFB3538VNrXPWdTLZhE/SCfgEws4aI6lHWN/vvcnyhHndROWBzqmqB4QBrITZ9Q==", "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", @@ -650,9 +648,9 @@ } }, "node_modules/@radix-ui/react-context": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.2.2.tgz", - "integrity": "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.3.0.tgz", + "integrity": "sha512-v5AYEocMISkbJ+1fTXzZpiFv7NRr3D2WiYbLIKf+FkmJ8VkP6d503eV2n34MFussHXY1pcoq3yfJiQH77dc4Mg==", "license": "MIT", "peerDependencies": { "@types/react": "*", @@ -665,16 +663,16 @@ } }, "node_modules/@radix-ui/react-context-menu": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-context-menu/-/react-context-menu-2.3.7.tgz", - "integrity": "sha512-CtXP35dxaB5T3zXSd+E3uHe/QpXcpYnZmxp6OaIbfthtfW4wyb77M23BG+bwIJDtsMwEP/YssdsmNyZu7jhWew==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context-menu/-/react-context-menu-2.4.1.tgz", + "integrity": "sha512-Pddn3Z8lio3/ChxyXaEP3jHTTo1LTHCWwF8+mG1chQlWijP+ttVHBKwezrQTiV6Mj670ojvumqvuGh+mdv33iQ==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-menu": "2.1.24", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -692,23 +690,23 @@ } }, "node_modules/@radix-ui/react-dialog": { - "version": "1.1.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.1.23.tgz", - "integrity": "sha512-Ksw4WeROkO4rC9k/onilX/Ao2Cr1ku1unMNH+XSCcP4jSXYu7HDsg9n4ojMjVb22XpYjAQ9qfrFlVbru1vXDUA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.3.1.tgz", + "integrity": "sha512-+0E4qvVTwjAWra9sEhJ+9BTsvHE00zkUuNw1VGh7S+Gc13dfYk+S1PVQdchWDj+XYHhAai7Z7IpzXVDCGsDplg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" @@ -729,9 +727,9 @@ } }, "node_modules/@radix-ui/react-direction": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.1.4.tgz", - "integrity": "sha512-5pzg4FGQNpExhnhT2zlrP1wZFaYCd1K0nYWoFAdcYoYK868IEigqMX3B3f8yIoRlAhAeDWciLI6ZdCKHF9P4Vg==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-direction/-/react-direction-1.2.0.tgz", + "integrity": "sha512-FtRA52a/r+LKStFT+neLUm+8vSe7wbzkbQGGeU8ixFiwC8NU14Evoq9ATECqL3eGbcUzJR4fyfA4KkK/q6dfqg==", "license": "MIT", "peerDependencies": { "@types/react": "*", @@ -744,15 +742,15 @@ } }, "node_modules/@radix-ui/react-dismissable-layer": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.1.19.tgz", - "integrity": "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.2.1.tgz", + "integrity": "sha512-KIfDcAsx+oVylFZ4xryVKusJUrLLhTQmfnJW4kwk4Km5myvhHCrj04hnWWUC166+xD4DHdH8tQGylwYX1h6+Pg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-effect-event": "0.0.5" }, "peerDependencies": { @@ -771,18 +769,18 @@ } }, "node_modules/@radix-ui/react-dropdown-menu": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.1.24.tgz", - "integrity": "sha512-geq8l2rJkxvkXsT9RMgtUE3P8pITFpTsvYpbySi1IH4fZEABD/Gp85myayFgxk0ktljGMJnCbeFkyTusvSvv7g==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.2.1.tgz", + "integrity": "sha512-XsHcmYG2AcqnvTqrOXXWcMrhquEIlqucizuDH1MV/qMRW+DndpBCMvNeTRXOxqmG1H5j89M/+I0/34Zdd+zDcQ==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", + "@radix-ui/react-context": "1.3.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-menu": "2.1.24", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -800,9 +798,9 @@ } }, "node_modules/@radix-ui/react-focus-guards": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.1.6.tgz", - "integrity": "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.2.0.tgz", + "integrity": "sha512-MPm5R0iRGUDrDnPNxmLBkv+X7pN4XKzt+MbWJEuJQsH3NFH4omrbpXpucyYCCKTSt+na/ZxGhEWQrWTZ0285cA==", "license": "MIT", "peerDependencies": { "@types/react": "*", @@ -815,14 +813,14 @@ } }, "node_modules/@radix-ui/react-focus-scope": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.1.16.tgz", - "integrity": "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.3.1.tgz", + "integrity": "sha512-ugeMhbXt4y5S2T1GnIqbWDKEN962PDwnX1fN0eKOOgf5f63Dh2mn8F1FUySlgW0iF6GiVsRF32DzuDIWTUyQJg==", "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4" + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -840,17 +838,17 @@ } }, "node_modules/@radix-ui/react-form": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.1.16.tgz", - "integrity": "sha512-Q4TLEn2A7TAypxwmd6R9EwrlXDvkfYSDMrq9/887AXAGh+G1rH+kYJKSTv+Si9Y0JPKTwKYv6PviAJosysNimA==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-form/-/react-form-0.3.0.tgz", + "integrity": "sha512-KnmrCM27m7Jo1R8S6cFDPrEeq20Jfn5dqde0SZrJr2lVXlj6/QZSUCyFoYh1d8ti0uUrMNK5Lx6dUDuINT+f4Q==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", + "@radix-ui/react-context": "1.3.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-label": "2.1.15", - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-label": "2.1.17", + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -868,20 +866,21 @@ } }, "node_modules/@radix-ui/react-hover-card": { - "version": "1.1.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.1.23.tgz", - "integrity": "sha512-H8qONfZd3ltrU3+jHCIgITbWo6e1iTKvP9DHdrvYbX48ooRM5FjEDTn16AMwdfuOGkWdZEhpl3PLL/Wk/AnHDQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-hover-card/-/react-hover-card-1.2.1.tgz", + "integrity": "sha512-4QooHxgmpCKRjj1Pft+hETKidYcrbPKcVwMGtk2Oa5DcWY2IH1fHuQt9LG6q5hUQBBV2MhQxSvtx6B/C1xfiTw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -917,12 +916,12 @@ } }, "node_modules/@radix-ui/react-label": { - "version": "2.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.15.tgz", - "integrity": "sha512-o/rdYEwZTTo5tjknnPeyQFU45kUC4i/XyeDPP+HGyi6XqpOP6Zf5Ya5vh/Yfe9Id5JiuWnnAx2XqIeD3UYZt0g==", + "version": "2.1.17", + "resolved": "https://registry.npmjs.org/@radix-ui/react-label/-/react-label-2.1.17.tgz", + "integrity": "sha512-xmj7MN/drx1oUAXkfiFIvyDmGNUIN/omGobvA5oAoNqu9zO2MkISYGZOkBcqSzs/UZXXwV+/3ACRE7q7mGcmkA==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -940,27 +939,27 @@ } }, "node_modules/@radix-ui/react-menu": { - "version": "2.1.24", - "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.1.24.tgz", - "integrity": "sha512-uW7RVuU6Lp/ZtfeY4b3kL32zccgEWvPv1+cf17ubYzHa9cL8AHokmk36cG/XEiH/smbQvumnieXX9j/e9RqJWA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-menu/-/react-menu-2.2.1.tgz", + "integrity": "sha512-G34BsU90SBj5foYpz8pQqq/Q0Dlfyyl6KitWEfRwXC0QvfwhWNAwS49DWP2+rRJ0iwv20Z2Qx7Sk+T03bGo5JA==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, @@ -980,21 +979,21 @@ } }, "node_modules/@radix-ui/react-menubar": { - "version": "1.1.24", - "resolved": "https://registry.npmjs.org/@radix-ui/react-menubar/-/react-menubar-1.1.24.tgz", - "integrity": "sha512-eeVs0vf7cuqXaM0qLQCPcufImiJNVBXdJDLu7ZGYl2732UH23Qat/foNGrr6vYV3/DdTsBqASoggUFgH14OcZA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-menubar/-/react-menubar-1.2.1.tgz", + "integrity": "sha512-bRTYtS9JITV2dUYqYZb7+N5SooQBkZrNRejfmyrSKe3Y57aXhKgx//kBUP0kY7pEpsWR/U1AHsAJRzjwCrK3PA==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-menu": "2.1.24", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -1012,25 +1011,26 @@ } }, "node_modules/@radix-ui/react-navigation-menu": { - "version": "1.2.22", - "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.2.22.tgz", - "integrity": "sha512-ou7iLEJ+yrhQndkkA4U21XIdS/CS45F4iXIkTZcb6/Ne9EMsOuDudVmCwmDnfFZZ+y1FZqXRNSIgBy+YMvZVZg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-navigation-menu/-/react-navigation-menu-1.4.1.tgz", + "integrity": "sha512-XPPZjkeyCSMNNvt0FyDv/PUauG7Ow4GwHQ/XZSwW36F/TS7rR4HFTsXH8ewLnXTOLn3x96/pmTPNQIVoTX/86g==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.19", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", "@radix-ui/react-use-previous": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.11" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -1048,20 +1048,20 @@ } }, "node_modules/@radix-ui/react-one-time-password-field": { - "version": "0.1.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.1.16.tgz", - "integrity": "sha512-Tj9P6ntAJEw52oq/F0AGknXR4XncxEt7XU47O3xJQOiWfLzEy3d9gtgKfvjSzGxzHkfL+VzvxGu2KTFsloJqXw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-one-time-password-field/-/react-one-time-password-field-0.2.1.tgz", + "integrity": "sha512-KtHdcgnaAK6rohQ/MMJoGYcbgSRJsIuGBdHrFeTB1/9SaKlDs14oSOniW6BL6M43HqvgCO3u4WuVdFLkuc6sqw==", "license": "MIT", "dependencies": { "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-effect-event": "0.0.5", "@radix-ui/react-use-is-hydrated": "0.1.3", "@radix-ui/react-use-layout-effect": "1.1.4" @@ -1082,17 +1082,17 @@ } }, "node_modules/@radix-ui/react-password-toggle-field": { - "version": "0.1.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.1.11.tgz", - "integrity": "sha512-4gvFnmDXu3dgj21CqsufzIameRvlRd4SBqaWhcrlrNhRo0Y5i/49AmRJYe1fdAM3G2VNBbmin4b0D6cdQocwgw==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-password-toggle-field/-/react-password-toggle-field-0.2.1.tgz", + "integrity": "sha512-vu4+ZoJAaFjdI7l1lDSZRs+4dEv83Jmu7lyzajPrAeQzX74y84n0rUNWbWSgN9XB5NE8IY86Z02kGH6oRrzR+w==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", + "@radix-ui/react-context": "1.3.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-effect-event": "0.0.5", "@radix-ui/react-use-is-hydrated": "0.1.3" }, @@ -1112,24 +1112,25 @@ } }, "node_modules/@radix-ui/react-popover": { - "version": "1.1.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.23.tgz", - "integrity": "sha512-mw58MrBlyHWFisTOYignD0vf/3gdcgAR+9of1s9G/38CbFiUwH1nCDkc0AUM9IrXFgN5Ue8n45j9WCgyM1sbiQ==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.3.1.tgz", + "integrity": "sha512-ZNxvXRx5W2Wos4fXCXb5lpdqN0Z5chf+mStOUOTr4ik7d+62MRvoe9rzCA/eGNg36lxXqSrKEKmwuZEcUrIstw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-layout-effect": "1.1.4", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, @@ -1149,20 +1150,20 @@ } }, "node_modules/@radix-ui/react-popper": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.3.7.tgz", - "integrity": "sha512-UsJrrd7w4wuKKTdvd/DNERVlwSlUcyXzjhyDwBk+3aPOsCjOY6ZSbxuw8E6lZTjjfP8Cpd0J8VVkrYUWyGYXyg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.4.0.tgz", + "integrity": "sha512-yCWRvLeGv9Pz3+efwHqGPp70mZ56r3kfIgQVF56Oj2aAa4uP/Tb+IE59wNcc+758rctqbCKx4LbK8II/r7Bn0Q==", "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^2.0.0", - "@radix-ui/react-arrow": "1.1.15", + "@radix-ui/react-arrow": "1.1.17", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-layout-effect": "1.1.4", "@radix-ui/react-use-rect": "1.1.4", - "@radix-ui/react-use-size": "1.1.4", + "@radix-ui/react-use-size": "1.1.5", "@radix-ui/rect": "1.1.3" }, "peerDependencies": { @@ -1181,12 +1182,12 @@ } }, "node_modules/@radix-ui/react-portal": { - "version": "1.1.17", - "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.1.17.tgz", - "integrity": "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.2.0.tgz", + "integrity": "sha512-StX7xXnaRU41VvFtMm9zlhVGz8XF6GmWWTXftkQaY+tqVkbs/R9UmAp5mLzHHapk5hM9RMZQvO/3usyIP/g42g==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10", + "@radix-ui/react-primitive": "2.2.0", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -1205,9 +1206,9 @@ } }, "node_modules/@radix-ui/react-presence": { - "version": "1.1.10", - "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.10.tgz", - "integrity": "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw==", + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.1.11.tgz", + "integrity": "sha512-Z7/atlkab36Z8hm+V8zYc79r0W+tiOB1o0tun1By94JyadkekLQmtEAnBSP9XKXBNQsStoStS4+gX10JpS5akA==", "license": "MIT", "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.4" @@ -1228,12 +1229,12 @@ } }, "node_modules/@radix-ui/react-primitive": { - "version": "2.1.10", - "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.1.10.tgz", - "integrity": "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-2.2.0.tgz", + "integrity": "sha512-HCTSPMNqv55Qk0IX4geJbpyXazmqulcimwuyjxTkKi29v+QZbG2Zho9BnbBq4YS2PF+KlNb2CXoLz66uUmblkg==", "license": "MIT", "dependencies": { - "@radix-ui/react-slot": "1.3.3" + "@radix-ui/react-slot": "1.5.0" }, "peerDependencies": { "@types/react": "*", @@ -1251,13 +1252,13 @@ } }, "node_modules/@radix-ui/react-progress": { - "version": "1.1.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.16.tgz", - "integrity": "sha512-5XnomAsoZZCY+KNTxbIghpGqPruZvKFNlvcAljVAOdDRDsH4/OZQxhtwo5wdtoDM5R6MhJBb2sPnDuRFep3lzg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.2.1.tgz", + "integrity": "sha512-yQBiM6J3YM8Ums1orkEFpbznK47geKxa0igikzcaS1xHgdba3DdAQBsGbCTt5BVfR8zhEvgxQ0poGcINaD3lvw==", "license": "MIT", "dependencies": { - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -1275,20 +1276,20 @@ } }, "node_modules/@radix-ui/react-radio-group": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.4.7.tgz", - "integrity": "sha512-cgYFEkntCxppHZgtSZ+7vh0wbZQ+IC7PPMw8DSnRG27B6kDd32/Zw0OJt7dGDigCoprMuWHjg2PvUn3PYvPFoQ==", + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-radio-group/-/react-radio-group-1.5.1.tgz", + "integrity": "sha512-QbyVT1ddnjqB9H+CUYKkNWdU9fIK3QHCYtjf7mS6ekSqiuXkWtWn5UZW9mhA8qtl3vrVyIsmR9gePstAtKrqkw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-use-controllable-state": "1.2.6", - "@radix-ui/react-use-size": "1.1.4" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -1306,20 +1307,20 @@ } }, "node_modules/@radix-ui/react-roving-focus": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.19.tgz", - "integrity": "sha512-V9jI6hDjT7l3jsCQD9bLNvDLM3tH/gdbOTp7Tefp3hbbgCGQoK7tUvrWiRlcoBHIZ809ElXwNQwVo0B98LuTXQ==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.2.1.tgz", + "integrity": "sha512-UwraORzVUeEPMclhO1p0vz0qI+TbdDLO9i+FiOqhJyHKwdpCRCck9yVEscUnAMIzCiuNoQa8D4A9bIpOPXGt6Q==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-is-hydrated": "0.1.3", "@radix-ui/react-use-layout-effect": "1.1.4" }, @@ -1339,19 +1340,20 @@ } }, "node_modules/@radix-ui/react-scroll-area": { - "version": "1.2.18", - "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.2.18.tgz", - "integrity": "sha512-Zn5Cd171wxsO3Dfg8HaW6RifTb9CYTKQJHs/G4+LN1GfmJpaQMZQyQxMprVPHpaz7QY4l9BxK2JwQuzHsXC8nA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-scroll-area/-/react-scroll-area-1.4.0.tgz", + "integrity": "sha512-CFrLqHNejWq5FhKAcj9V/WPGRsol76HBQto81NdOBVFEOqIEkJkKIJt0Z824A/9hHLCtoiR/Kw3euRgzXP2pxg==", "license": "MIT", "dependencies": { "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { @@ -1370,31 +1372,30 @@ } }, "node_modules/@radix-ui/react-select": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.3.7.tgz", - "integrity": "sha512-WFGImkmbzcfxeIwq/+4HvRN0pizBwbwQUED4I13ezQsDdfl38ZntN6TmR8XaSzPBqoCToe8rF75j6NPNDSzhbg==", + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-select/-/react-select-2.4.1.tgz", + "integrity": "sha512-888ZwW0Md6GyptuqYABRX9nLKgoYfcooCyBBvVaX5Jp3e+8Jp2i4Zo/Uy50Hm+Ysn2JfloQXstW4U36w8teVtg==", "license": "MIT", "dependencies": { "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-callback-ref": "1.1.4", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-previous": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.11", + "@radix-ui/react-visually-hidden": "1.2.13", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, @@ -1414,12 +1415,12 @@ } }, "node_modules/@radix-ui/react-separator": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.1.15.tgz", - "integrity": "sha512-jOLO4lssEzWpoDu7G+Ze4VjwMRUBt291pnZD0gmalREZipnTX3wadQo7Fy48GCTfe14/YRN6rw/rOJqrE85Wxw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-separator/-/react-separator-1.2.0.tgz", + "integrity": "sha512-1jUAap0wZEqVP05Ou7kJgRxe/W+Qftng+rUNWGa0qkKbv9r5pWTG3E7a3ELKo2eJoHKMECnzuYrZpSyO1YgcYQ==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -1437,22 +1438,21 @@ } }, "node_modules/@radix-ui/react-slider": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.4.7.tgz", - "integrity": "sha512-mTSLf1GC/C0moWjTbvCM6Qn/gBjvlFt1azuWF2v7MN5C3Zq2U2J2lN3ZEYkpujuOU5Ro7A28wkviSxaKnG0BYg==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slider/-/react-slider-1.6.1.tgz", + "integrity": "sha512-IRNRR90moPqxfwCJ0XbMJIxo70W0/1ZExT/sNCxEHMaPx0SF9HoQrcPEC75+H28cFKa0b+KH63anfLYJmwKacw==", "license": "MIT", "dependencies": { "@radix-ui/number": "1.1.3", - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-previous": "1.1.4", - "@radix-ui/react-use-size": "1.1.4" + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -1470,9 +1470,9 @@ } }, "node_modules/@radix-ui/react-slot": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.3.3.tgz", - "integrity": "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.5.0.tgz", + "integrity": "sha512-tyYd9ddPXAysAbdbD9eYxgwpCSv6f3PncqVSNKQFSR5lcJVLz3cb/pANDoYrLiHBpXv7skortyUgGUWsYuPPFQ==", "license": "MIT", "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" @@ -1488,17 +1488,17 @@ } }, "node_modules/@radix-ui/react-switch": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.3.7.tgz", - "integrity": "sha512-48tB/4dn2UVLBCYhTu9AuR63IHl73l/qLbLgxd86noTUor4/K4LFDAcYjK+isP5313qxaFpjPVogE7+Y0/V3Kw==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-switch/-/react-switch-1.4.1.tgz", + "integrity": "sha512-NpBGwc40rY02ZmSvuyeKk0Bvc8ZsNeTMi4qHvJ+ZH4EiYCv0zIXEgdCW4bVdzgIUeP9xxbLJSxKOUfqITYNmkA==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6", - "@radix-ui/react-use-size": "1.1.4" + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0", + "@radix-ui/react-use-size": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -1516,19 +1516,19 @@ } }, "node_modules/@radix-ui/react-tabs": { - "version": "1.1.21", - "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.1.21.tgz", - "integrity": "sha512-UKxJlZid7FVtsk/WTxj4i4uSEgj2Au+KBbS7SQyTlzMhhn+86Cz3tISZdTa87bfEfcuvZezf2ZsxD4xuEKtkog==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tabs/-/react-tabs-1.2.1.tgz", + "integrity": "sha512-hRoJlode+hg5ZNlR+3tkfkUliIybdTpD5lkAvHQ9yaXseGf7XVO9Ib2GPEIOuaJJbo7YWYbNpDDRfo8Dhf6/xA==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -1546,23 +1546,23 @@ } }, "node_modules/@radix-ui/react-toast": { - "version": "1.2.23", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.2.23.tgz", - "integrity": "sha512-ofhyAsYaocRGOs/n0XWdUOSVzEAG6BfrMVM8z0c0kLEWY38w/0WuMFPTJP/HVaZPYkMvHZoKIIhNcjbTCBILPg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toast/-/react-toast-1.3.1.tgz", + "integrity": "sha512-iQvL0J7XK4HtJNGkkWMyYrboNseI7vtotFeUkIno8YNxVA9oM7B6//fh0Mc6TSKI96+zioLWi98lQLso88yJmQ==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-collection": "1.1.15", + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-callback-ref": "1.1.4", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.11" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -1580,14 +1580,14 @@ } }, "node_modules/@radix-ui/react-toggle": { - "version": "1.1.18", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.1.18.tgz", - "integrity": "sha512-7lonPlKfSacd20GlOBx2ltuVKz9oqWYZz+oMQyOltw6t1y2nyftj2ZmwwUHYn49kqfDWcp8dNZm5NgV+5Z+mug==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle/-/react-toggle-1.2.1.tgz", + "integrity": "sha512-+3MUq+WyiBplXYqQ0EIYlq8R4sLQ0T5NbOK7DMdDLCKO93pe2uE0DUJTWWfTBprpJJXxfoF3eMW0xpakVZrYsg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -1605,18 +1605,18 @@ } }, "node_modules/@radix-ui/react-toggle-group": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.1.19.tgz", - "integrity": "sha512-OtnwuSVjd1Ofi+AdnvhsjQdyuhCDwYs1w9RyB5BN/OavXOVQo42SYqQjwUnbPnaiPFBpQ9aX70dWeee+v2oBLA==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toggle-group/-/react-toggle-group-1.2.1.tgz", + "integrity": "sha512-O8Ldx5ao4p4KoW+DO8/PmkOe5mdKNi3F2SseqjVj88wvDGDHe60cUmO0Zm/uHsKrvNgQGV8Efpuh95Tht/h4vw==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-toggle": "1.1.18", - "@radix-ui/react-use-controllable-state": "1.2.6" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-toggle": "1.2.1", + "@radix-ui/react-use-controllable-state": "1.3.0" }, "peerDependencies": { "@types/react": "*", @@ -1634,18 +1634,18 @@ } }, "node_modules/@radix-ui/react-toolbar": { - "version": "1.1.19", - "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.1.19.tgz", - "integrity": "sha512-Ph0IvtYw4VB12ZnZg+YtrGs8yJQsnizwo/zu0R4Y/nWugtJzA7Pg1eWeuDR9+LSqn+xjamss+UOSOJJJ4gx8jw==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-toolbar/-/react-toolbar-1.2.1.tgz", + "integrity": "sha512-Cm8m7JTEeUdbfA6T9xgyu8HfOpyvSx8pB/wj0DlEuWaJe9FilIs4Az9wci/lU9RbthV/UkltszMw5WnnD+m/Ug==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-separator": "1.1.15", - "@radix-ui/react-toggle-group": "1.1.19" + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-separator": "1.2.0", + "@radix-ui/react-toggle-group": "1.2.1" }, "peerDependencies": { "@types/react": "*", @@ -1663,24 +1663,25 @@ } }, "node_modules/@radix-ui/react-tooltip": { - "version": "1.2.16", - "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.2.16.tgz", - "integrity": "sha512-6EamKFRRnlpdadndbZ6LMwycfwkwPte1B42hs6QA0gYhjaOKqW4PZ4pjaW9UrlDX5eVt/OjncE7BFTPL5nmZhg==", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-tooltip/-/react-tooltip-1.4.1.tgz", + "integrity": "sha512-NxLFGSFtZ78zVfcoOhTwR1xwqo5qx1Jh8Pw6FMZ9McCaqfRzz7/gIRahs2Oy5XlPgQ+8QkUcKbN5B0U44J/kCg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-dismissable-layer": "1.1.19", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-focus-scope": "1.3.1", "@radix-ui/react-id": "1.1.4", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.11" + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -1698,10 +1699,13 @@ } }, "node_modules/@radix-ui/react-use-callback-ref": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.4.tgz", - "integrity": "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.1.5.tgz", + "integrity": "sha512-Y5GBf4NKeADoXI1geiMlMuMoURT3k9MizzzKhGb/m55H94aGigZ01PIpkvsO6lML13BA6XYAXSJ6gza7vTn5nw==", "license": "MIT", + "dependencies": { + "@radix-ui/react-use-layout-effect": "1.1.4" + }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" @@ -1713,12 +1717,12 @@ } }, "node_modules/@radix-ui/react-use-controllable-state": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.2.6.tgz", - "integrity": "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.3.0.tgz", + "integrity": "sha512-TAcBI7bw2ljYCbv4+zuTSd6zICu8pRt6SDN2vJ/Z06K2MXh6I9WYFe/A9ovlFDtR5HVHGm5iDxDoABm/++dbKg==", "license": "MIT", "dependencies": { - "@radix-ui/primitive": "1.1.7", + "@radix-ui/primitive": "1.2.0", "@radix-ui/react-use-effect-event": "0.0.5", "@radix-ui/react-use-layout-effect": "1.1.4" }, @@ -1751,12 +1755,12 @@ } }, "node_modules/@radix-ui/react-use-escape-keydown": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.5.tgz", - "integrity": "sha512-ge3ipobwSXTj4JyVtswQ7qZj0ZHdtbGuOno/LrgAAeSxtsJ6Vs4Gz5IkPH2bmqpjcLUFoqGhA/mueuIf63UXlA==", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.1.6.tgz", + "integrity": "sha512-9cRullnQRv+kqnRmFlmh0WC3kAPuGmHiQ9VwsXdrYk//sBhgCKEttcpPEPgIQbyx6TGUmooVEHYTyohwz/lSJg==", "license": "MIT", "dependencies": { - "@radix-ui/react-use-callback-ref": "1.1.4" + "@radix-ui/react-use-callback-ref": "1.1.5" }, "peerDependencies": { "@types/react": "*", @@ -1832,9 +1836,9 @@ } }, "node_modules/@radix-ui/react-use-size": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.4.tgz", - "integrity": "sha512-D3anSY15EJoxrihpsXI6SMrmmonnQtR2ni7arO+Lfdg3O95b9hNXxONk8jA5C8ANdF/h5HMAxejgs8PWJ6rlhw==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-size/-/react-use-size-1.1.5.tgz", + "integrity": "sha512-V1McDQkMGzgivwqdu7u96APs7oi0Jvj9LTzgq3WWrDZqxWdAqU9yZnZQqk5OizGFR8badUQwZsrlao7MOlWYOA==", "license": "MIT", "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.4" @@ -1850,12 +1854,12 @@ } }, "node_modules/@radix-ui/react-visually-hidden": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.11.tgz", - "integrity": "sha512-NFS86RYYZb4/exihaESBGOpMJFz8MGLAfu3mOBSGByVnVPC9JPASfYubxd/8KbkQK0sYAv8lVQDEQukDX/qXvQ==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.2.13.tgz", + "integrity": "sha512-feijiN1oPk4rck4u9Dm9tsU4mT6Wp9oeEEhaz1WUEs1VuqLf8xzsFG+Qk+uWq6TnMH9O+WRECRg0NftyP9E4Fw==", "license": "MIT", "dependencies": { - "@radix-ui/react-primitive": "2.1.10" + "@radix-ui/react-primitive": "2.2.0" }, "peerDependencies": { "@types/react": "*", @@ -3640,12 +3644,12 @@ } }, "node_modules/assistant-cloud": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/assistant-cloud/-/assistant-cloud-0.2.2.tgz", - "integrity": "sha512-rScC4VNkUMPnRogMM92mkS87f0qf3Vtc+V7gfaliA0biD64slfvvsmbges3CupoVzJ8Pc4iMP1YhIa+oIjzpzg==", + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/assistant-cloud/-/assistant-cloud-0.2.12.tgz", + "integrity": "sha512-ZxDFzaSbmQf7PzM1X5eD9WLF6bioBtRu+IlQsZONt/SAHvoJt0ivqPv5fzLNfZX+6U2Vif1V9YvZjunq6p99pg==", "license": "MIT", "dependencies": { - "assistant-stream": "^0.3.44" + "assistant-stream": "^0.3.57" }, "peerDependencies": { "@opentelemetry/api": "^1.9.0", @@ -3669,21 +3673,25 @@ } }, "node_modules/assistant-stream": { - "version": "0.3.44", - "resolved": "https://registry.npmjs.org/assistant-stream/-/assistant-stream-0.3.44.tgz", - "integrity": "sha512-418FRutG6g6WUd8EckGG+ZVOn/rmgop36oyzAMk1bRqktZOlY2RdtBl0yoUpDM/IDPWVNe7baYtSKN3UvjQzoA==", + "version": "0.3.57", + "resolved": "https://registry.npmjs.org/assistant-stream/-/assistant-stream-0.3.57.tgz", + "integrity": "sha512-R+dAUoKcAGGjoTzbgSUhaVer2H8rNu/cY1GwdeRZ+gbsrV+DDc7QXuYDpKOp6HGO9o2Q5+7l3Dvp4qYNx8UpSg==", "license": "MIT", "dependencies": { "@standard-schema/spec": "^1.1.0", "@types/json-schema": "^7.0.15", - "nanoid": "^6.0.1", - "secure-json-parse": "^4.1.0" + "nanoid": "^6.0.2", + "secure-json-parse": "^4.1.1" }, "peerDependencies": { + "ai": "^6.0.0 || ^7.0.0", "ioredis": "^5.10.1 || ^6.0.0", "redis": "^5.12.1" }, "peerDependenciesMeta": { + "ai": { + "optional": true + }, "ioredis": { "optional": true }, @@ -3693,9 +3701,9 @@ } }, "node_modules/assistant-stream/node_modules/nanoid": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-6.0.1.tgz", - "integrity": "sha512-3wVS3i51pE2pi1k5FFL/95BGfVS0kSsvDVuGXHOtxox/TywUmtgq+3qiTOTbs9J7KfHaXPiN171k/A6dBnaXFw==", + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-6.0.2.tgz", + "integrity": "sha512-hIvVOb9Qr1p/9CNNLOe0OlWvgx/ziTsVwKN/GDSsuArN2K0wDiafP3s0SWmsm7o2BdnyS8Z9Z64NFBUbn6ziBg==", "funding": [ { "type": "github", @@ -6201,66 +6209,66 @@ } }, "node_modules/radix-ui": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.6.7.tgz", - "integrity": "sha512-QBdhh1arIEUvPC0dQ5+nwWAxt7+N+oP/9jPwjJkGFoSk/sqxg32gJtSXGtFh8frAIcS6oC9cx2Q+7KYCQLOAeA==", - "license": "MIT", - "dependencies": { - "@radix-ui/primitive": "1.1.7", - "@radix-ui/react-accessible-icon": "1.1.15", - "@radix-ui/react-accordion": "1.2.20", - "@radix-ui/react-alert-dialog": "1.1.23", - "@radix-ui/react-arrow": "1.1.15", - "@radix-ui/react-aspect-ratio": "1.1.15", - "@radix-ui/react-avatar": "1.2.6", - "@radix-ui/react-checkbox": "1.3.11", - "@radix-ui/react-collapsible": "1.1.20", - "@radix-ui/react-collection": "1.1.15", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/radix-ui/-/radix-ui-1.8.1.tgz", + "integrity": "sha512-HPfpVGizO9xANlsFSauruLhRe/3+iOt3vPX0MXYle/UQi3gorQrSYtBcdiv0BZYewcl2rvL59qrIuLFMGAmUrw==", + "license": "MIT", + "dependencies": { + "@radix-ui/primitive": "1.2.0", + "@radix-ui/react-accessible-icon": "1.2.0", + "@radix-ui/react-accordion": "1.3.1", + "@radix-ui/react-alert-dialog": "1.2.1", + "@radix-ui/react-arrow": "1.1.17", + "@radix-ui/react-aspect-ratio": "1.2.0", + "@radix-ui/react-avatar": "1.3.1", + "@radix-ui/react-checkbox": "1.4.1", + "@radix-ui/react-collapsible": "1.2.1", + "@radix-ui/react-collection": "1.2.0", "@radix-ui/react-compose-refs": "1.1.5", - "@radix-ui/react-context": "1.2.2", - "@radix-ui/react-context-menu": "2.3.7", - "@radix-ui/react-dialog": "1.1.23", - "@radix-ui/react-direction": "1.1.4", - "@radix-ui/react-dismissable-layer": "1.1.19", - "@radix-ui/react-dropdown-menu": "2.1.24", - "@radix-ui/react-focus-guards": "1.1.6", - "@radix-ui/react-focus-scope": "1.1.16", - "@radix-ui/react-form": "0.1.16", - "@radix-ui/react-hover-card": "1.1.23", - "@radix-ui/react-label": "2.1.15", - "@radix-ui/react-menu": "2.1.24", - "@radix-ui/react-menubar": "1.1.24", - "@radix-ui/react-navigation-menu": "1.2.22", - "@radix-ui/react-one-time-password-field": "0.1.16", - "@radix-ui/react-password-toggle-field": "0.1.11", - "@radix-ui/react-popover": "1.1.23", - "@radix-ui/react-popper": "1.3.7", - "@radix-ui/react-portal": "1.1.17", - "@radix-ui/react-presence": "1.1.10", - "@radix-ui/react-primitive": "2.1.10", - "@radix-ui/react-progress": "1.1.16", - "@radix-ui/react-radio-group": "1.4.7", - "@radix-ui/react-roving-focus": "1.1.19", - "@radix-ui/react-scroll-area": "1.2.18", - "@radix-ui/react-select": "2.3.7", - "@radix-ui/react-separator": "1.1.15", - "@radix-ui/react-slider": "1.4.7", - "@radix-ui/react-slot": "1.3.3", - "@radix-ui/react-switch": "1.3.7", - "@radix-ui/react-tabs": "1.1.21", - "@radix-ui/react-toast": "1.2.23", - "@radix-ui/react-toggle": "1.1.18", - "@radix-ui/react-toggle-group": "1.1.19", - "@radix-ui/react-toolbar": "1.1.19", - "@radix-ui/react-tooltip": "1.2.16", - "@radix-ui/react-use-callback-ref": "1.1.4", - "@radix-ui/react-use-controllable-state": "1.2.6", + "@radix-ui/react-context": "1.3.0", + "@radix-ui/react-context-menu": "2.4.1", + "@radix-ui/react-dialog": "1.3.1", + "@radix-ui/react-direction": "1.2.0", + "@radix-ui/react-dismissable-layer": "1.2.1", + "@radix-ui/react-dropdown-menu": "2.2.1", + "@radix-ui/react-focus-guards": "1.2.0", + "@radix-ui/react-focus-scope": "1.3.1", + "@radix-ui/react-form": "0.3.0", + "@radix-ui/react-hover-card": "1.2.1", + "@radix-ui/react-label": "2.1.17", + "@radix-ui/react-menu": "2.2.1", + "@radix-ui/react-menubar": "1.2.1", + "@radix-ui/react-navigation-menu": "1.4.1", + "@radix-ui/react-one-time-password-field": "0.2.1", + "@radix-ui/react-password-toggle-field": "0.2.1", + "@radix-ui/react-popover": "1.3.1", + "@radix-ui/react-popper": "1.4.0", + "@radix-ui/react-portal": "1.2.0", + "@radix-ui/react-presence": "1.1.11", + "@radix-ui/react-primitive": "2.2.0", + "@radix-ui/react-progress": "1.2.1", + "@radix-ui/react-radio-group": "1.5.1", + "@radix-ui/react-roving-focus": "1.2.1", + "@radix-ui/react-scroll-area": "1.4.0", + "@radix-ui/react-select": "2.4.1", + "@radix-ui/react-separator": "1.2.0", + "@radix-ui/react-slider": "1.6.1", + "@radix-ui/react-slot": "1.5.0", + "@radix-ui/react-switch": "1.4.1", + "@radix-ui/react-tabs": "1.2.1", + "@radix-ui/react-toast": "1.3.1", + "@radix-ui/react-toggle": "1.2.1", + "@radix-ui/react-toggle-group": "1.2.1", + "@radix-ui/react-toolbar": "1.2.1", + "@radix-ui/react-tooltip": "1.4.1", + "@radix-ui/react-use-callback-ref": "1.1.5", + "@radix-ui/react-use-controllable-state": "1.3.0", "@radix-ui/react-use-effect-event": "0.0.5", - "@radix-ui/react-use-escape-keydown": "1.1.5", + "@radix-ui/react-use-escape-keydown": "1.1.6", "@radix-ui/react-use-is-hydrated": "0.1.3", "@radix-ui/react-use-layout-effect": "1.1.4", - "@radix-ui/react-use-size": "1.1.4", - "@radix-ui/react-visually-hidden": "1.2.11" + "@radix-ui/react-use-size": "1.1.5", + "@radix-ui/react-visually-hidden": "1.2.13" }, "peerDependencies": { "@types/react": "*", @@ -6582,9 +6590,9 @@ "license": "BSD-3-Clause" }, "node_modules/safe-content-frame": { - "version": "0.0.31", - "resolved": "https://registry.npmjs.org/safe-content-frame/-/safe-content-frame-0.0.31.tgz", - "integrity": "sha512-q5oK9CnNBlsCaYSpMjTkveO9BiQU25PHeMykRyh59hlSkr0g0SSeL7P+dtTljKwNt0+m1qWD8982xUcN5jmPPQ==", + "version": "0.0.34", + "resolved": "https://registry.npmjs.org/safe-content-frame/-/safe-content-frame-0.0.34.tgz", + "integrity": "sha512-js/Tt/SWUGdBi+pt8NuMlg5OkDLD+5Q8sTItzAFr4Xr+geHkTOc0Vl2LA+BUsPFZ3fdT4hbRjWaPb9DoPEvHDw==", "license": "MIT" }, "node_modules/safer-buffer": { @@ -6600,9 +6608,9 @@ "license": "MIT" }, "node_modules/secure-json-parse": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.0.tgz", - "integrity": "sha512-l4KnYfEyqYJxDwlNVyRfO2E4NTHfMKAWdUuA8J0yve2Dz/E/PdBepY03RvyJpssIpRFwJoCD55wA+mEDs6ByWA==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.1.tgz", + "integrity": "sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==", "funding": [ { "type": "github", @@ -7302,18 +7310,18 @@ } }, "node_modules/zod": { - "version": "4.6.5", - "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz", - "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==", + "version": "4.6.7", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.7.tgz", + "integrity": "sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/colinhacks" } }, "node_modules/zustand": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.15.tgz", - "integrity": "sha512-MpSEjRiBkA9crSYeOUH32rJC7SVqAbm0Fqcqge/bUi2PPoLcBWKOsG+C8mevmpr8TwXHBVkChbbJiyvkE+i/3A==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.1.0.tgz", + "integrity": "sha512-ciJZlP48M1PTQbVQq81CGVFxHTLpZNrFjKqwjtCU34AWuXTZT/jrF3p9+fI84Cf1eSCMLapxqBy/SNTfwOBuqA==", "license": "MIT", "engines": { "node": ">=12.20.0" diff --git a/dashboard/package.json b/dashboard/package.json index 5cc208f6..620c189b 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -11,8 +11,8 @@ "test": "vitest run" }, "dependencies": { - "@assistant-ui/react": "0.15.21", - "@assistant-ui/react-markdown": "0.14.16", + "@assistant-ui/react": "0.15.36", + "@assistant-ui/react-markdown": "0.14.26", "@xterm/addon-fit": "^0.11.0", "@xterm/xterm": "^6.0.0", "class-variance-authority": "^0.7.1", diff --git a/dashboard/src/components/SubagentCard.tsx b/dashboard/src/components/SubagentCard.tsx new file mode 100644 index 00000000..51552489 --- /dev/null +++ b/dashboard/src/components/SubagentCard.tsx @@ -0,0 +1,112 @@ +/** The card of a sub agent, with its name and its state in the row and its run inside. */ + +import { + makeAssistantToolUI, + ReadonlyThreadProvider, + type ThreadMessage as RunMessage, + ThreadPrimitive, + type ToolCallMessagePartProps, + type ToolCallMessagePartStatus, + useAuiState, +} from '@assistant-ui/react'; +import { useState } from 'react'; +import { ThreadMessage } from '@/components/assistant-ui/elements/thread.aui'; +import { + ToolFallbackContent, + ToolFallbackRoot, + ToolFallbackTrigger, +} from '@/components/assistant-ui/elements/tool-fallback.aui'; +import { SUBAGENT_TOOL } from '../stores/thread/translate.ts'; + +/** The arguments of the card, which the thread model fills from the announcement of the sub agent. */ +interface SubagentArgs { + /** The name the agent gave the sub agent. */ + name?: string; + /** The task the agent gave the sub agent. */ + task?: string; +} + +/** + * Checks if a tool call in the run waits for an answer of the user, through any number of sub agents. + * + * @param messages The messages of the run. + * @returns True when a call waits. + */ +function awaitsAnswer(messages: readonly RunMessage[]): boolean { + return messages.some( + (message) => + message.role === 'assistant' && + message.content.some( + (part) => + part.type === 'tool-call' && + ((part.approval !== undefined && + part.approval.approved === undefined && + part.approval.resolution === undefined) || + awaitsAnswer(part.messages ?? [])), + ), + ); +} + +/** + * The card. It is closed by default and opens itself while a call inside it waits for an answer. + * + * The runtime derives the status of a tool call from its message, which is wrong for a sub agent that runs on + * after the turn ended. The card has no result until the sub agent ends, so a missing result means that it runs. + * + * @param args The name and the task of the sub agent. + * @param result Set once the sub agent has ended. + * @param isError True when the sub agent failed or was cancelled. + */ +const SubagentCardImpl = ({ args, result, isError }: ToolCallMessagePartProps) => { + const messages = useAuiState((s) => (s.part.type === 'tool-call' ? s.part.messages : undefined)); + const asking = awaitsAnswer(messages ?? []); + const [open, setOpen] = useState(asking); + const [wasAsking, setWasAsking] = useState(asking); + if (asking !== wasAsking) { + setWasAsking(asking); + if (asking) setOpen(true); + } + + const status: ToolCallMessagePartStatus = + result === undefined + ? { type: 'running' } + : isError + ? { type: 'incomplete', reason: 'error' } + : { type: 'complete' }; + + return ( + + + + {args.task && ( +

+ {args.task} +

+ )} + {isError && typeof result === 'string' && result && ( +

+ {result} +

+ )} + {messages && messages.length > 0 && ( + +
+ {() => } +
+
+ )} +
+
+ ); +}; + +/** Registers the card for the sub agent parts of the thread while it is mounted. */ +export const SubagentToolUI = makeAssistantToolUI({ + toolName: SUBAGENT_TOOL, + render: SubagentCardImpl, +}); diff --git a/dashboard/src/components/assistant-ui/elements/thread.aui.tsx b/dashboard/src/components/assistant-ui/elements/thread.aui.tsx index 387dbd0d..97c3f29c 100644 --- a/dashboard/src/components/assistant-ui/elements/thread.aui.tsx +++ b/dashboard/src/components/assistant-ui/elements/thread.aui.tsx @@ -30,6 +30,7 @@ import { Button } from "@/components/ui/button"; import { Skeleton } from "@/components/ui/skeleton"; import { useFollowOutput } from "@/hooks/use-follow-output"; import { TASK_NOTIFICATION_PART } from "@/lib/task-notifications"; +import { SUBAGENT_TOOL } from "@/stores/thread/translate"; import { cn } from "@/lib/utils"; import { ActionBarMorePrimitive, @@ -352,8 +353,11 @@ const isTaskNotification = (s: AssistantState) => (part) => part.type === "data" && part.name === TASK_NOTIFICATION_PART, ); -/** One message, rendered by its role. Boxes edit: task notifications get their own row. */ -const ThreadMessage: FC = () => { +/** + * One message, rendered by its role. Boxes edit: task notifications get their own row, and the card of a sub + * agent renders the messages of its run with this component. + */ +export const ThreadMessage: FC = () => { const { AssistantMessage: AssistantMessageComponent = AssistantMessage } = useContext(ThreadComponentsContext); const role = useAuiState((s) => s.message.role); @@ -593,6 +597,9 @@ const AssistantMessage: FC = () => { groupBy={groupPartByType({ reasoning: ["group-chainOfThought", "group-reasoning"], "tool-call": ["group-chainOfThought", "group-tool"], + // Boxes edit: the card of a sub agent stands on its own, outside + // the tool group. + [`tool-call:${SUBAGENT_TOOL}`]: [], "standalone-tool-call": [], })} > diff --git a/dashboard/src/components/assistant-ui/elements/tool-fallback.aui.tsx b/dashboard/src/components/assistant-ui/elements/tool-fallback.aui.tsx index 5f581919..2f04974a 100644 --- a/dashboard/src/components/assistant-ui/elements/tool-fallback.aui.tsx +++ b/dashboard/src/components/assistant-ui/elements/tool-fallback.aui.tsx @@ -1,6 +1,6 @@ "use client"; -import { memo, useCallback, useRef, useState } from "react"; +import { memo, useCallback, useContext, useRef, useState } from "react"; import { AlertCircleIcon, CheckIcon, @@ -21,6 +21,7 @@ import { CollapsibleTrigger, } from "@/components/ui/collapsible"; import { useDisclosureLock } from "@/hooks/use-disclosure-lock"; +import { ApprovalResponderContext } from "@/lib/approvals"; import { cn } from "@/lib/utils"; import { Button } from "@/components/ui/button"; import { Spinner } from "@/components/Spinner"; @@ -157,6 +158,7 @@ function ToolFallbackDuration({ * @param toolName The name of the tool. * @param status The status of the call. Absent counts as complete. * @param asking True when this call puts a question to the user. + * @param label Boxes edit: the text before the name, in place of the one the status gives. * @param className Extra classes. * @param props The other collapsible trigger props. */ @@ -164,6 +166,7 @@ function ToolFallbackTrigger({ toolName, status, asking, + label: givenLabel, className, ...props }: React.ComponentProps & { @@ -173,6 +176,8 @@ function ToolFallbackTrigger({ status?: ToolCallMessagePartStatus; /** True when this call puts a question to the user. */ asking?: boolean; + /** The text before the name, in place of the one the status gives. */ + label?: string; }) { const statusType = status?.type ?? "complete"; const isRunning = statusType === "running"; @@ -183,15 +188,17 @@ function ToolFallbackTrigger({ // Boxes edit: a call with no result inherits the status of its message, so // requires-action alone does not mean the call wants to run. `asking` tells // the two apart. - const label = isCancelled - ? "Cancelled tool" - : statusType === "requires-action" - ? asking - ? "Wants to run" - : "Unfinished tool" - : isRunning - ? "Running tool" - : "Used tool"; + const label = + givenLabel ?? + (isCancelled + ? "Cancelled tool" + : statusType === "requires-action" + ? asking + ? "Wants to run" + : "Unfinished tool" + : isRunning + ? "Running tool" + : "Used tool"); return ( (null); + // Boxes edit: the thread view answers in place of the runtime when it + // provides a responder. The runtime of a readonly thread, in which the + // calls of a sub agent render, drops an answer. + const respondOutside = useContext(ApprovalResponderContext); + const answer = + respondOutside && approval + ? (response: { approved?: boolean; optionId?: string }) => + respondOutside({ approvalId: approval.id, ...response }) + : respondToApproval; if ( approval != null && @@ -518,16 +534,12 @@ function ToolFallbackApproval({ // A declared option list limits the choices. The component adds no way to // approve beyond the list, and it always keeps a way to refuse. - const declaredOptions = respondToApproval ? approval?.options : undefined; + const declaredOptions = answer ? approval?.options : undefined; const respond = (approved: boolean) => { if (submitted) return; - if ( - approval != null && - approval.approved === undefined && - respondToApproval - ) { - respondToApproval({ approved }); + if (approval != null && approval.approved === undefined && answer) { + answer({ approved }); } else if (interrupt) { resume?.({ approved }); } else if ( @@ -545,7 +557,7 @@ function ToolFallbackApproval({ if (submitted) return; // The runtime cannot derive a decision from a custom kind, and it throws // when the answer has none. A picked option is an answer, so it counts as approved. - respondToApproval?.( + answer?.( isKnownKind(option.kind) ? { optionId: option.id } : { optionId: option.id, approved: true }, diff --git a/dashboard/src/lib/approvals.ts b/dashboard/src/lib/approvals.ts new file mode 100644 index 00000000..bee076c4 --- /dev/null +++ b/dashboard/src/lib/approvals.ts @@ -0,0 +1,23 @@ +/** The answer to a permission request, as a card passes it on. */ + +import { createContext } from 'react'; + +/** One answer to the permission request of a tool call. */ +export interface ApprovalAnswer { + /** The id of the request, as the thread store numbered it. */ + approvalId: string; + /** True for an answer that lets the call run, when the request offered no options. */ + approved?: boolean; + /** The option the user picked, when the request offered options. */ + optionId?: string; +} + +/** + * Answers a permission request outside the runtime. + * + * The cards inside a sub agent render in a readonly thread, whose runtime drops an answer. The thread view + * provides the function, and a card uses it in place of the runtime when it is there. + */ +export const ApprovalResponderContext = createContext<((answer: ApprovalAnswer) => void) | null>( + null, +); diff --git a/dashboard/src/stores/thread/acp-types.ts b/dashboard/src/stores/thread/acp-types.ts index 27acc96e..bd468be2 100644 --- a/dashboard/src/stores/thread/acp-types.ts +++ b/dashboard/src/stores/thread/acp-types.ts @@ -63,11 +63,31 @@ interface ToolCall { rawInput?: unknown; /** The tool's raw result. */ rawOutput?: unknown; + /** Extension fields, such as the output chunk of a command. */ + _meta?: Record | null; } /** A change to a tool call. Every field but the id is optional. */ export type ToolCallUpdate = Partial & { toolCallId: string }; +/** A sub agent that the agent started. Its updates arrive on the session that `subagentSessionId` names. */ +export interface SubagentSpawned { + /** The adapter's id for the session of the sub agent. */ + subagentSessionId: string; + /** The name the agent gave the sub agent. */ + name?: string | null; + /** The task the agent gave the sub agent. */ + task?: string | null; +} + +/** The end of a sub agent. */ +export interface SubagentState { + /** The adapter's id for the session of the sub agent. */ + subagentSessionId: string; + /** `completed`, `failed`, `cancelled` or `disconnected`. */ + state?: string; +} + /** One mode the adapter can operate in. */ interface ThreadMode { /** The mode's id. */ @@ -160,6 +180,8 @@ export type ThreadUpdate = | { sessionUpdate: typeof UPDATE_KIND.currentMode; currentModeId: string } | { sessionUpdate: typeof UPDATE_KIND.availableCommands; availableCommands?: AvailableCommand[] } | { sessionUpdate: typeof UPDATE_KIND.configOption; configOptions?: ThreadConfigOption[] } + | (SubagentSpawned & { sessionUpdate: typeof UPDATE_KIND.subagentSpawned }) + | (SubagentState & { sessionUpdate: typeof UPDATE_KIND.subagentState }) // Forward compatibility, because an adapter can send a kind that is newer than this build. | { sessionUpdate: string; [key: string]: unknown }; diff --git a/dashboard/src/stores/thread/convert.test.ts b/dashboard/src/stores/thread/convert.test.ts new file mode 100644 index 00000000..e3d02840 --- /dev/null +++ b/dashboard/src/stores/thread/convert.test.ts @@ -0,0 +1,60 @@ +import assert from 'node:assert/strict'; +import { beforeEach, test } from 'vitest'; +import type { ThreadUpdate } from './acp-types.ts'; +import { convertMessage } from './convert.ts'; +import { applyUpdate, emptyModel, resetIds } from './translate.ts'; + +beforeEach(() => resetIds()); + +/** + * A text chunk of the agent. + * + * @param text The text. + * @returns The update. + */ +function said(text: string): ThreadUpdate { + return { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text } } as ThreadUpdate; +} + +test('the card of a sub agent carries the run as the messages of a nested thread', () => { + const model = emptyModel(); + applyUpdate(model, said('Let me look.')); + applyUpdate(model, { + sessionUpdate: 'subagent_spawned', + subagentSessionId: 'child-1', + name: 'Find the words', + task: 'Read words.txt', + } as ThreadUpdate); + applyUpdate(model, said('Reading.'), 'child-1'); + applyUpdate( + model, + { sessionUpdate: 'tool_call', toolCallId: 'toolu_1', title: 'Read' } as ThreadUpdate, + 'child-1', + ); + + const card = convertMessage(model.messages[0]!).content[1] as { + toolName: string; + args: unknown; + result?: unknown; + messages?: { id: string; status?: { type: string }; content: { type: string }[] }[]; + }; + assert.equal(card.toolName, 'boxes_subagent'); + assert.deepEqual(card.args, { name: 'Find the words', task: 'Read words.txt' }); + // No result while the sub agent runs, which is how the card knows. + assert.equal(card.result, undefined); + assert.deepEqual( + card.messages?.map((m) => m.content.map((p) => p.type)), + [['text', 'tool-call']], + ); + // The last message of a running sub agent runs, so the nested thread shows it as such. + assert.equal(card.messages?.[0]?.status?.type, 'running'); + + applyUpdate(model, { + sessionUpdate: 'subagent_state_update', + subagentSessionId: 'child-1', + state: 'completed', + } as ThreadUpdate); + const done = convertMessage(model.messages[0]!).content[1] as typeof card; + assert.equal(done.result, ''); + assert.equal(done.messages?.[0]?.status?.type, 'complete'); +}); diff --git a/dashboard/src/stores/thread/convert.ts b/dashboard/src/stores/thread/convert.ts index 3ae63c8c..2680a25a 100644 --- a/dashboard/src/stores/thread/convert.ts +++ b/dashboard/src/stores/thread/convert.ts @@ -1,6 +1,11 @@ /** Converts the thread's message model into the shape the assistant-ui runtime reads. */ -import type { ThreadMessageLike, ToolApprovalOption } from '@assistant-ui/react'; +import { + fromThreadMessageLike, + type ThreadMessage, + type ThreadMessageLike, + type ToolApprovalOption, +} from '@assistant-ui/react'; import { isThumbnailable } from '../../lib/attachments.ts'; import { workspaceFileUrl } from '../../lib/files.ts'; import { TASK_NOTIFICATION_PART } from '../../lib/task-notifications.ts'; @@ -102,7 +107,7 @@ function awaitingApproval(part: ToolPart): boolean { * @param part The tool part. * @returns The tool-call part. */ -function toolPart(part: ToolPart) { +function toolPart(part: ToolPart, boxId?: string) { const output = toolOutputText(part); // A call that awaits permission gets no result, even with content, because // the runtime treats any result as a finished call and then hides the @@ -119,9 +124,32 @@ function toolPart(part: ToolPart) { ...(finished ? { result: output } : {}), ...(part.status === 'failed' ? { isError: true } : {}), ...(part.approval ? { approval: approval(part.approval) } : {}), + ...(part.messages ? { messages: subagentMessages(part, boxId) } : {}), }; } +/** + * Converts the run of a sub agent into the messages of the nested thread that its card shows. + * + * The runtime derives the status of a message of the thread itself, but a nested message needs it set. The last + * message of a running sub agent is running. + * + * @param part The card of the sub agent. + * @param boxId The box that attachments load from. + * @returns The messages, in the shape the runtime reads. + */ +function subagentMessages(part: ToolPart, boxId?: string): ThreadMessage[] { + const run = part.messages ?? []; + return run.map((message, i) => { + const last = i === run.length - 1 && part.status === 'in_progress'; + return fromThreadMessageLike( + convertMessage(message, boxId), + message.id, + last ? { type: 'running' } : { type: 'complete', reason: 'unknown' }, + ); + }); +} + /** * Turns an image source into an image part, in the shape that the runtime reads. * @@ -216,7 +244,7 @@ export function convertMessage(message: Message, boxId?: string): ThreadMessageL if (part.type === 'image') return [imagePart(part.src)]; if (part.type === 'attachment') return [attachmentPart(part, boxId)]; if (part.type === 'task') return [taskPart(part)]; - return [toolPart(part), ...toolImages(part)]; + return [toolPart(part, boxId), ...toolImages(part)]; }), }; } diff --git a/dashboard/src/stores/thread/thread-store.ts b/dashboard/src/stores/thread/thread-store.ts index b64807ce..1409f819 100644 --- a/dashboard/src/stores/thread/thread-store.ts +++ b/dashboard/src/stores/thread/thread-store.ts @@ -456,7 +456,7 @@ export class ThreadStore { * @param params The notification params. */ private onUpdate(params: ThreadNotification): void { - const touched = applyUpdate(this.model, params.update); + const touched = applyUpdate(this.model, params.update, params.sessionId); // flushReplay publishes what a replay built. if (this.replaying) return; if ( diff --git a/dashboard/src/stores/thread/translate.test.ts b/dashboard/src/stores/thread/translate.test.ts index e184381f..d978e48b 100644 --- a/dashboard/src/stores/thread/translate.test.ts +++ b/dashboard/src/stores/thread/translate.test.ts @@ -521,3 +521,176 @@ test('a truncated model plus the rest is the model the whole thread builds', () // A reconnect can take the tail alone, because the result is the same. assert.deepEqual(resumed.messages, whole.messages); }); + +/** + * The announcement of a sub agent. + * + * @param child The adapter's id for the session of the sub agent. + * @param name The name of the sub agent. + * @returns The update. + */ +function spawned(child: string, name = 'Find the words'): ThreadUpdate { + return { + sessionUpdate: 'subagent_spawned', + subagentSessionId: child, + name, + task: 'Read words.txt', + } as ThreadUpdate; +} + +/** + * Finds the card of a sub agent in a message. + * + * @param message The message. + * @param child The adapter's id for the session of the sub agent. + * @returns The card. + */ +function cardOf( + message: { parts: readonly { type: string; toolCallId?: string }[] }, + child: string, +): ToolPart { + const part = message.parts.find((p) => p.type === 'tool' && p.toolCallId === child); + assert.ok(part, `no card for ${child}`); + return part as ToolPart; +} + +test('a sub agent becomes a card, and its updates go into the run of the card', () => { + const model = fold(chunk('agent_message_chunk', 'Let me look.', 'msg_1'), spawned('child-1')); + applyUpdate(model, chunk('agent_message_chunk', 'Reading the file.'), 'child-1'); + applyUpdate( + model, + { sessionUpdate: 'tool_call', toolCallId: 'toolu_1', title: 'Read' } as ThreadUpdate, + 'child-1', + ); + applyUpdate(model, chunk('agent_message_chunk', 'Done after the sub agent.', 'msg_2')); + + assert.deepEqual( + model.messages.map((m) => m.id), + ['msg_1', 'msg_2'], + ); + const card = cardOf(model.messages[0]!, 'child-1'); + assert.equal(card.name, 'boxes_subagent'); + assert.equal(card.title, 'Find the words'); + assert.deepEqual(card.rawInput, { name: 'Find the words', task: 'Read words.txt' }); + assert.equal(card.status, 'in_progress'); + // The run holds the text and the tool call of the sub agent, and nothing of the thread. + assert.deepEqual( + card.messages?.map((m) => m.parts.map((p) => p.type)), + [['text', 'tool']], + ); + // A tool call of the sub agent is found by its id, which is how a permission request finds its card. + assert.equal(findTool(model, 'toolu_1')?.title, 'Read'); +}); + +test('a change inside a sub agent refreshes the message of the thread that holds the card', () => { + const model = fold(chunk('agent_message_chunk', 'Let me look.', 'msg_1'), spawned('child-1')); + const touched = applyUpdate(model, chunk('agent_message_chunk', 'Reading.'), 'child-1'); + assert.equal(touched, model.messages[0]); +}); + +test('a sub agent of a sub agent is a card inside the run', () => { + const model = fold(spawned('child-1')); + applyUpdate(model, spawned('child-2', 'Count the words'), 'child-1'); + applyUpdate(model, chunk('agent_message_chunk', 'three'), 'child-2'); + + const outer = cardOf(model.messages[0]!, 'child-1'); + const inner = cardOf(outer.messages![0]!, 'child-2'); + assert.equal(inner.title, 'Count the words'); + assert.deepEqual( + inner.messages?.map((m) => m.parts), + [[{ type: 'text', text: 'three' }]], + ); + // The whole chain refreshes the one message of the thread. + assert.equal(applyUpdate(model, chunk('agent_message_chunk', '!'), 'child-2'), model.messages[0]); +}); + +test('the end of a sub agent sets the status of its card', () => { + const model = fold(spawned('child-1'), spawned('child-2')); + applyUpdate(model, { + sessionUpdate: 'subagent_state_update', + subagentSessionId: 'child-1', + state: 'completed', + } as ThreadUpdate); + applyUpdate(model, { + sessionUpdate: 'subagent_state_update', + subagentSessionId: 'child-2', + state: 'cancelled', + } as ThreadUpdate); + + assert.equal(cardOf(model.messages[0]!, 'child-1').status, 'completed'); + const cancelled = cardOf(model.messages[0]!, 'child-2'); + assert.equal(cancelled.status, 'failed'); + assert.equal(toolOutputText(cancelled), 'cancelled'); +}); + +test('the thoughts of a sub agent are dropped, and an announcement sent again changes nothing', () => { + const model = fold(spawned('child-1')); + assert.equal(applyUpdate(model, chunk('agent_thought_chunk', 'hmm'), 'child-1'), null); + assert.equal(applyUpdate(model, spawned('child-1')), null); + + const card = cardOf(model.messages[0]!, 'child-1'); + assert.deepEqual(card.messages, []); + assert.equal(model.messages[0]!.parts.length, 1); +}); + +test('truncating drops the sub agents of the dropped messages', () => { + const model = fold(chunk('user_message_chunk', 'first', 'msg_1'), spawned('child-1')); + applyUpdate( + model, + { sessionUpdate: 'tool_call', toolCallId: 'toolu_1', title: 'Read' } as ThreadUpdate, + 'child-1', + ); + + truncateFrom(model, model.messages[1]!.id); + + assert.equal(findTool(model, 'child-1'), undefined); + assert.equal(findTool(model, 'toolu_1'), undefined); + // A late update of the dropped sub agent lands in the thread, like any update of an unknown session. + applyUpdate(model, chunk('agent_message_chunk', 'late'), 'child-1'); + assert.deepEqual( + model.messages.map((m) => m.parts.map((p) => p.type)), + [['text'], ['text']], + ); +}); + +test('the output of a command arrives in chunks beside the terminal, and its exit code can fail it', () => { + const model = fold( + { + sessionUpdate: 'tool_call', + toolCallId: 'exec-1', + title: 'ls', + content: [{ type: 'terminal', terminalId: 'exec-1' }], + } as ThreadUpdate, + { + sessionUpdate: 'tool_call_update', + toolCallId: 'exec-1', + _meta: { terminal_output_delta: { data: 'a\n', terminal_id: 'exec-1' } }, + } as ThreadUpdate, + { + sessionUpdate: 'tool_call_update', + toolCallId: 'exec-1', + status: 'completed', + _meta: { + terminal_output_delta: { data: 'b\n', terminal_id: 'exec-1' }, + terminal_exit: { exit_code: 2, signal: null, terminal_id: 'exec-1' }, + }, + } as ThreadUpdate, + ); + + const part = findTool(model, 'exec-1')!; + assert.equal(toolOutputText(part), 'a\nb\n'); + assert.equal(part.status, 'failed'); +}); + +test('a raw text result stands in when the content gives no text', () => { + const model = fold( + { sessionUpdate: 'tool_call', toolCallId: 'read-1', title: 'cat words.txt' } as ThreadUpdate, + { + sessionUpdate: 'tool_call_update', + toolCallId: 'read-1', + status: 'completed', + rawOutput: 'alpha\nbeta\n', + } as ThreadUpdate, + ); + assert.equal(toolOutputText(findTool(model, 'read-1')!), 'alpha\nbeta\n'); +}); diff --git a/dashboard/src/stores/thread/translate.ts b/dashboard/src/stores/thread/translate.ts index 901d793b..e623f0aa 100644 --- a/dashboard/src/stores/thread/translate.ts +++ b/dashboard/src/stores/thread/translate.ts @@ -118,11 +118,38 @@ export interface ToolPart { locations: ToolCallLocation[]; /** The permission request on this call, while one exists. */ approval?: ApprovalState; + /** The output of a command so far, from the chunks that the adapter sends beside the content. */ + output?: string; + /** The raw result of the call, which stands in when the content gives no text. */ + rawOutput?: unknown; + /** + * The messages of a sub agent, in order. Only the card of a sub agent, the part named {@link SUBAGENT_TOOL}, + * has them. + */ + messages?: Message[]; } +/** The tool name of the card of a sub agent. No adapter uses it. */ +export const SUBAGENT_TOOL = 'boxes_subagent'; + /** A part of a message. */ export type Part = TextPart | ReasoningPart | ImagePart | AttachmentPart | TaskPart | ToolPart; +/** + * The run of one sub agent, as the model holds it. + * + * `owner` is the message of the thread itself that holds the card, through any number of sub agents in between, so + * a change inside the run refreshes that message. + */ +interface SubagentRun { + /** The card of the sub agent. */ + part: ToolPart; + /** The messages of the sub agent, the same list as `part.messages`. */ + messages: Message[]; + /** The message of the thread that holds the card. */ + owner: Message; +} + /** One message in the thread. */ export interface Message { /** The message id from the adapter, or an id that this model generated. */ @@ -160,12 +187,14 @@ export interface ThreadModel { */ unknown: Set; /** - * Every tool call in the thread with the message that holds it, by the - * adapter's id for the call. + * Every tool call in the thread with the message of the thread that holds it, by the + * adapter's id for the call. For a call of a sub agent, that is the message that holds the card. * * A long thread holds thousands of calls, so lookups use this index. */ tools: Map; + /** The run of every sub agent, by the adapter's id for its session. */ + subagents: Map; } /** @@ -182,6 +211,7 @@ export function emptyModel(): ThreadModel { commands: [], unknown: new Set(), tools: new Map(), + subagents: new Map(), }; } @@ -212,17 +242,17 @@ function newMessage(role: Message['role'], id?: string | null): Message { * are one message, and a change starts a new one. Without a messageId, a role * change starts a new message. * - * @param model The thread model. + * @param messages The messages of the thread or of a sub agent. * @param role The role of the chunk. * @param messageId The adapter's id for the message of the chunk, if any. - * @returns The message, which is the last one in the model. + * @returns The message, which is the last one in the list. */ function messageFor( - model: ThreadModel, + messages: Message[], role: Message['role'], messageId: string | null | undefined, ): Message { - const last = model.messages.at(-1); + const last = messages.at(-1); if (last) { if (messageId) { if (last.id === messageId) return last; @@ -231,10 +261,25 @@ function messageFor( } } const created = newMessage(role, messageId); - model.messages.push(created); + messages.push(created); return created; } +/** + * The messages that an update of a session goes into, which are the thread's own or the run of a sub agent. + * + * @param model The thread model. + * @param sessionId The adapter's id for the session of the update, if known. + * @returns The messages, and for a sub agent the message of the thread that holds its card. + */ +function scopeOf( + model: ThreadModel, + sessionId: string | undefined, +): { messages: Message[]; owner?: Message } { + const run = sessionId === undefined ? undefined : model.subagents.get(sessionId); + return run ? { messages: run.messages, owner: run.owner } : { messages: model.messages }; +} + /** * Appends text to the last part when that part has the given kind, or starts a new part. * @@ -321,14 +366,15 @@ function appendBlock(message: Message, kind: 'text' | 'reasoning', content: Cont export function truncateFrom(model: ThreadModel, messageId: string): Message[] { const from = model.messages.findIndex((m) => m.id === messageId); if (from < 0) return []; - const dropped = model.messages.splice(from); - // The tool index loses the calls of the dropped messages. - for (const message of dropped) { - for (const part of message.parts) { - if (part.type === 'tool') model.tools.delete(part.toolCallId); - } + const dropped = new Set(model.messages.splice(from)); + // The indexes lose the calls and the sub agents of the dropped messages. + for (const [id, entry] of model.tools) { + if (dropped.has(entry.message)) model.tools.delete(id); + } + for (const [id, run] of model.subagents) { + if (dropped.has(run.owner)) model.subagents.delete(id); } - return dropped; + return [...dropped]; } /** @@ -360,28 +406,39 @@ export function messageOfTool(model: ThreadModel, toolCallId: string): Message | * noted by name and otherwise ignored, so a newer adapter does not break an * older dashboard. * + * An update of a sub agent goes into the run of that sub agent, and the changed message is the message of the + * thread that holds its card. The thoughts of a sub agent are dropped. + * * @param model The thread model. * @param update The update. + * @param sessionId The adapter's id for the session of the update. Without it, or for a session that is no sub + * agent, the update is the thread's own. * @returns The changed message, so a caller can refresh only that message, or * null when the update changed no message. */ -export function applyUpdate(model: ThreadModel, update: ThreadUpdate): Message | null { +export function applyUpdate( + model: ThreadModel, + update: ThreadUpdate, + sessionId?: string, +): Message | null { + const { messages, owner } = scopeOf(model, sessionId); switch (update.sessionUpdate) { case UPDATE_KIND.userMessageChunk: { const u = update as UpdateOf; - const message = messageFor(model, 'user', u.messageId); + const message = messageFor(messages, 'user', u.messageId); appendBlock(message, 'text', u.content); - return message; + return owner ?? message; } case UPDATE_KIND.agentMessageChunk: { const u = update as UpdateOf; - const message = messageFor(model, 'assistant', u.messageId); + const message = messageFor(messages, 'assistant', u.messageId); appendBlock(message, 'text', u.content); - return message; + return owner ?? message; } case UPDATE_KIND.agentThoughtChunk: { + if (owner) return null; const u = update as UpdateOf; - const message = messageFor(model, 'assistant', u.messageId); + const message = messageFor(messages, 'assistant', u.messageId); appendBlock(message, 'reasoning', u.content); return message; } @@ -389,14 +446,49 @@ export function applyUpdate(model: ThreadModel, update: ThreadUpdate): Message | const u = update as UpdateOf; // A call announced again is an update and not a second card, because an // adapter can send a call again, and a replay always does. - return openTool(model, u, u.title); + return openTool(model, messages, owner, u, u.title); } case UPDATE_KIND.toolCallUpdate: { const u = update as UpdateOf; // An update can arrive before the call that it belongs to, and dropping // it would lose the result of the tool. The update can lack a title, so // the id stands in until the announcement brings one. - return openTool(model, u, u.title ?? u.toolCallId); + return openTool(model, messages, owner, u, u.title ?? u.toolCallId); + } + case UPDATE_KIND.subagentSpawned: { + const u = update as UpdateOf; + // A replay announces a sub agent again. + if (model.subagents.has(u.subagentSessionId)) return null; + const message = messageFor(messages, 'assistant', null); + const run: Message[] = []; + const part: ToolPart = { + type: 'tool', + toolCallId: u.subagentSessionId, + title: u.name || 'Sub agent', + name: SUBAGENT_TOOL, + status: 'in_progress', + rawInput: { name: u.name || 'Sub agent', ...(u.task ? { task: u.task } : {}) }, + content: [], + locations: [], + messages: run, + }; + message.parts.push(part); + model.tools.set(u.subagentSessionId, { part, message: owner ?? message }); + model.subagents.set(u.subagentSessionId, { part, messages: run, owner: owner ?? message }); + return owner ?? message; + } + case UPDATE_KIND.subagentState: { + const u = update as UpdateOf; + const run = model.subagents.get(u.subagentSessionId); + if (!run) return null; + if (u.state === 'completed') run.part.status = 'completed'; + else { + run.part.status = 'failed'; + run.part.content = [ + { type: 'content', content: { type: 'text', text: u.state ?? 'failed' } }, + ]; + } + return run.owner; } case UPDATE_KIND.plan: { const u = update as UpdateOf; @@ -434,17 +526,25 @@ export function applyUpdate(model: ThreadModel, update: ThreadUpdate): Message | * caller passes the title for a new card. * * @param model The thread model. + * @param messages The messages of the thread or of the sub agent that made the call. + * @param owner The message of the thread that holds the card of the sub agent, for a call of a sub agent. * @param u The tool call or the update. * @param title The title for a new card. - * @returns The message that holds the call. + * @returns The message of the thread that holds the call. */ -function openTool(model: ThreadModel, u: ToolCallUpdate, title: string): Message | null { +function openTool( + model: ThreadModel, + messages: Message[], + owner: Message | undefined, + u: ToolCallUpdate, + title: string, +): Message | null { const indexed = model.tools.get(u.toolCallId); if (indexed) { mergeTool(indexed.part, u); return indexed.message; } - const message = messageFor(model, 'assistant', null); + const message = messageFor(messages, 'assistant', null); const part: ToolPart = { type: 'tool', toolCallId: u.toolCallId, @@ -456,9 +556,10 @@ function openTool(model: ThreadModel, u: ToolCallUpdate, title: string): Message content: u.content ?? [], locations: u.locations ?? [], }; + mergeMeta(part, u); message.parts.push(part); - model.tools.set(u.toolCallId, { part, message }); - return message; + model.tools.set(u.toolCallId, { part, message: owner ?? message }); + return owner ?? message; } /** @@ -480,6 +581,24 @@ function mergeTool(part: ToolPart, u: ToolCallUpdate): void { // in the schema an update carries the whole collection. if (u.content != null) part.content = u.content; if (u.locations != null) part.locations = u.locations; + if (u.rawOutput !== undefined) part.rawOutput = u.rawOutput; + mergeMeta(part, u); +} + +/** + * Reads the extension fields of a tool call, which are the output chunk of a command and its exit. The Codex + * adapter sends the output of a command only in these chunks. + * + * @param part The existing part. + * @param u The tool call or the update. + */ +function mergeMeta(part: ToolPart, u: ToolCallUpdate): void { + const meta = u._meta; + if (!meta) return; + const delta = meta.terminal_output_delta as { data?: unknown } | undefined; + if (typeof delta?.data === 'string') part.output = (part.output ?? '') + delta.data; + const exit = meta.terminal_exit as { exit_code?: unknown } | undefined; + if (typeof exit?.exit_code === 'number' && exit.exit_code !== 0) part.status = 'failed'; } /** @@ -493,16 +612,20 @@ function mergeTool(part: ToolPart, u: ToolCallUpdate): void { * @returns The text, one line per content entry. */ export function toolOutputText(part: ToolPart): string { - return part.content + const text = part.content .map((c) => { if (c.type === 'content') { return c.content?.type === 'image' ? imageFallbackText(c.content) : blockText(c.content); } if (c.type === 'diff') return diffText(c); - return `[terminal ${c.terminalId}]`; + // A terminal stands for the output of a command, which arrives in chunks. + return part.output ?? ''; }) .filter(Boolean) .join('\n'); + if (text) return text; + // A search or list command of Codex has its output only here. + return typeof part.rawOutput === 'string' ? part.rawOutput : ''; } /** diff --git a/dashboard/src/views/BoxThread.tsx b/dashboard/src/views/BoxThread.tsx index c84804ac..6b3b54a6 100644 --- a/dashboard/src/views/BoxThread.tsx +++ b/dashboard/src/views/BoxThread.tsx @@ -12,6 +12,7 @@ import { FullHistoryButton } from '@/components/FullHistoryButton'; import { Notice } from '@/components/Notice'; import { Shelf } from '@/components/Shelf'; import { SlashCommandsProvider } from '@/components/SlashCommands'; +import { SubagentToolUI } from '@/components/SubagentCard'; import { ThreadHeader } from '@/components/ThreadHeader'; import { ThreadLoading } from '@/components/ThreadLoading'; import { TooltipProvider } from '@/components/ui/tooltip'; @@ -20,6 +21,7 @@ import { useDocumentTitle } from '@/hooks/use-document-title'; import { useScrollAway } from '@/hooks/use-scroll-away'; import { useUp } from '@/hooks/use-up'; import { useViewportLock } from '@/hooks/use-viewport-lock'; +import { type ApprovalAnswer, ApprovalResponderContext } from '@/lib/approvals'; import { type AttachmentEntry, buildEnvelope, formatBytes } from '@/lib/attachments'; import { harnessLabel } from '@/lib/harness'; import { takeStagedPrompt } from '@/lib/staged-prompt'; @@ -269,6 +271,17 @@ export function BoxThread() { // Bound to the box, because the attachment URLs name the box. const convert = useCallback((message: Message) => convertMessage(message, id), [id]); + /** + * Answers a permission request, from the runtime or from a card inside a sub agent. No option id means a + * refusal to choose, and the store then sends the cancelled outcome of ACP. + */ + const respondToApproval = useCallback( + ({ approvalId, approved, optionId }: ApprovalAnswer) => { + store?.respondToApproval(approvalId, approved || optionId ? optionId : undefined); + }, + [store], + ); + // The runtime keeps every message it was given as a branch. A rebuild can // bring messages back under other ids, so each rebuild gets a new repository. const repository = useMemo(() => new INTERNAL.MessageRepository(), [state.rebuilds]); @@ -284,10 +297,7 @@ export function BoxThread() { onCancel: async () => store?.cancel(), onRefetchThread: async () => store?.refetch(), adapters: { attachments: attachmentAdapter }, - onRespondToToolApproval: ({ approvalId, approved, optionId }) => { - // No option id means a refusal to choose. The store sends the cancelled outcome of ACP. - store?.respondToApproval(approvalId, approved || optionId ? optionId : undefined); - }, + onRespondToToolApproval: respondToApproval, }); // The runtime changes on every message, so the ref limits the effect to one @@ -302,105 +312,112 @@ export function BoxThread() { return ( - -
- {/* Only the header hides on scroll. The notices below it stay. */} - - void store?.setMode(modeId)} - onSetConfigOption={(configId, value) => - void store?.setConfigOption(configId, value) - } - /> - - {forked ? ( -
- - {threadName(forked)} branched from this conversation. It opens on everything said - here so far and goes its own way from there. - - {/* A plain link, so a popup blocker does not stop the new tab. */} - - Open it in a new tab - - -
- ) : null} - {forkError ? ( - - Could not fork this thread: {forkError} - - ) : null} - {state.error ? {state.error} : null} -
- {/* A box that could not be read has no token, so the page shows no composer. */} - {loadError ? ( -
-

{loadError.message}

-

{loadError.detail}

- {/* Goes back in the same way as the back button of the header. */} - - Back to boxes - -
- ) : state.loading ? ( - // The box may still be starting. The conversation appears in one - // piece once it has been read. - - ) : ( - void store?.loadFullHistory()} - /> - ) : null - } - aboveComposer={ - void stopBackground(thread.id, processId) - : undefined - } - /> + + + +
+ {/* Only the header hides on scroll. The notices below it stay. */} + + void store?.setMode(modeId)} + onSetConfigOption={(configId, value) => + void store?.setConfigOption(configId, value) } /> - )} + + {forked ? ( +
+ + {threadName(forked)} branched from this conversation. It opens on everything + said here so far and goes its own way from there. + + {/* A plain link, so a popup blocker does not stop the new tab. */} + + Open it in a new tab + + +
+ ) : null} + {forkError ? ( + + Could not fork this thread: {forkError} + + ) : null} + {state.error ? {state.error} : null} +
+ {/* A box that could not be read has no token, so the page shows no composer. */} + {loadError ? ( +
+

{loadError.message}

+

{loadError.detail}

+ {/* Goes back in the same way as the back button of the header. */} + + Back to boxes + +
+ ) : state.loading ? ( + // The box may still be starting. The conversation appears in one + // piece once it has been read. + + ) : ( + void store?.loadFullHistory()} + /> + ) : null + } + aboveComposer={ + void stopBackground(thread.id, processId) + : undefined + } + /> + } + /> + )} +
-
- + + ); diff --git a/doc/acp.md b/doc/acp.md index 9e909a28..80d88d7a 100644 --- a/doc/acp.md +++ b/doc/acp.md @@ -136,15 +136,32 @@ The ACP gateway is the part of the orchestrator that connects the browsers and t `upstream.ts` holds the gateway state of one box: one `AdapterConnection` per harness its threads use (`adapter.ts`), the attached browsers, the unanswered permission requests, and the probe that reads the container's process table. -The `initialize` handshake advertises one client capability: the async-task extension. The connection keeps the +The `initialize` handshake advertises the client capabilities of the extensions that Boxes uses. The async-task +extension and the native sub agent sessions are AIR capabilities, which the Claude and Codex adapters implement. The +`terminal_output_delta` capability makes the Codex adapter send the output of a command in chunks. The capability +`opencode/child-session-updates` makes opencode send the updates of its child sessions. The connection keeps the adapter's `initialize` response and answers each browser's `initialize` with it, so the browser sees the capabilities of the agent that holds its conversation. The orchestrator parses the protocol with the ACP SDK (`@agentclientprotocol/sdk`). The SDK accepts only the -`session/update` kinds that its schema defines, and the async-task extension adds kinds outside that schema. The -connection therefore removes the async-task updates from the adapter's output stream before the SDK parses it, and -delivers them itself. - +`session/update` kinds that its schema defines, and the extensions add kinds outside that schema. The connection +therefore removes the async-task updates, the sub agent updates and the child session notifications of opencode from the +adapter's output stream before the SDK parses it, and delivers them itself. + +### Sub agent sessions + +An adapter reports a sub agent as a session of its own. A `subagent_spawned` on the session of the parent names the new +session. Every update and permission request of the sub agent then names that session, and a `subagent_state_update` on +the session of the parent ends it. The Claude and Codex adapters send this form to an AIR client. opencode sends its own +`opencode/session/child_update` notification, and the connection translates it into the same form. A created child +becomes a `subagent_spawned`, an update of the child becomes an update on the session of the child, and an end state +becomes a `subagent_state_update`. + +The connection records the thread of each sub agent session when the `subagent_spawned` arrives. The gateway resolves +the thread of every adapter message through that record. So the updates of a sub agent go into the log of its thread and +to the browsers of that thread, and a permission request of a sub agent goes to a browser of that thread. The messages +keep the session id of the sub agent, and the dashboard tells the sub agents apart by it. The record ends with the +adapter process, and a replay announces the sub agents again. ### Downstream: one connection per browser `downstream.ts` serves the WebSocket connections described above. The upgrade path is diff --git a/doc/threads.md b/doc/threads.md index 52801097..3e9a5469 100644 --- a/doc/threads.md +++ b/doc/threads.md @@ -72,6 +72,16 @@ Some tool calls need a decision. The question renders on the tool call that caus All browsers on the thread show the question; the first answer removes it from the others. When nobody watches the thread, the orchestrator can send a push notification. See [notifications](notifications.md). +## Sub agents + +An agent can give part of its work to a sub agent. The sub agent shows as a card at the point where the agent started +it. The card shows the name of the sub agent, a spinner while it runs, and a check or an error mark when it ends. The +card is closed. Open it to read the task that the agent gave the sub agent, the text of the sub agent and its tool +calls. A sub agent that starts a sub agent shows a card inside the card. The reasoning of a sub agent is not shown. + +A permission request of a sub agent renders on its tool call inside the card, and the card opens itself for it. + +The `subagent` tool call of opencode stays a row of its own above the card. ## Marking a thread done Select the **Mark this thread done** button in the thread header to mark the thread done. The box list strikes the @@ -149,6 +159,19 @@ For the same reason, the events cannot answer whether the box is busy: the orche known resident helper counts as work and prevents the idle reaper from stopping the box. The box-level stop reads the table again, sends TERM to the deepest processes first, and sends KILL to what survives shortly after, without waiting. +### Sub agents + +The gateway sends the updates of a sub agent with the session id of the sub agent, as described in [sub agent +sessions](acp.md#sub-agent-sessions). The thread model of the dashboard (`stores/thread/translate.ts`) turns the +announcement of a sub agent into a tool part with the name `boxes_subagent`. The part holds the messages of the sub +agent, and the model applies the updates of that session to those messages. The tool index of the model covers the calls +of every sub agent, so a permission request finds its call. A change inside a sub agent refreshes the message of the +thread that holds the card. + +`components/SubagentCard.tsx` registers the card for that tool name. The card renders the messages of the sub agent in a +readonly thread of assistant-ui with the same message components as the thread. The runtime of a readonly thread drops +the answer to a permission request. The thread view therefore provides the answer function through a React context, and +the approval buttons use it. ### Forking The adapter branches the conversation in full but writes no transcript for the fork until its first prompt. So the fork diff --git a/orchestrator/package-lock.json b/orchestrator/package-lock.json index 07d80e39..a598dbde 100644 --- a/orchestrator/package-lock.json +++ b/orchestrator/package-lock.json @@ -8,7 +8,7 @@ "name": "boxes-orchestrator", "version": "1.0.0", "dependencies": { - "@agentclientprotocol/sdk": "1.5.0", + "@agentclientprotocol/sdk": "2.7.0", "@fastify/compress": "^9.2.0", "@kubernetes/client-node": "^2.0.0", "better-sqlite3": "^13.0.3", @@ -33,12 +33,18 @@ } }, "node_modules/@agentclientprotocol/sdk": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-1.5.0.tgz", - "integrity": "sha512-524jwbB2iYWA+kWWyv9fhKbhU89dH/lu9u5EXwVNmfYzopV8BujCDxByBDZhxRUkB7RWIJzISCnwivdDk+bdVg==", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-2.7.0.tgz", + "integrity": "sha512-oXdQq0plWv3iOg01zJghNZRSuyWeMYxOgWIaSdwg1BZe2ZAC9LRhNDi023lNYxXq1zVIpQjIp8P6AfsxpvxF6g==", "license": "Apache-2.0", "peerDependencies": { - "zod": "^3.25.0 || ^4.0.0" + "@modelcontextprotocol/server": "^2.4.0", + "zod": "^3.25.76 || ^4.0.0" + }, + "peerDependenciesMeta": { + "@modelcontextprotocol/server": { + "optional": true + } } }, "node_modules/@balena/dockerignore": { diff --git a/orchestrator/package.json b/orchestrator/package.json index 3f899715..08352129 100644 --- a/orchestrator/package.json +++ b/orchestrator/package.json @@ -11,7 +11,7 @@ "dev": "vite-node --watch src/index.ts" }, "dependencies": { - "@agentclientprotocol/sdk": "1.5.0", + "@agentclientprotocol/sdk": "2.7.0", "@fastify/compress": "^9.2.0", "@kubernetes/client-node": "^2.0.0", "better-sqlite3": "^13.0.3", diff --git a/orchestrator/src/boxenv.test.ts b/orchestrator/src/boxenv.test.ts index 54a3233b..e5453352 100644 --- a/orchestrator/src/boxenv.test.ts +++ b/orchestrator/src/boxenv.test.ts @@ -229,7 +229,6 @@ describe('boxEnv', () => { // opencode runs on the API keys, which keep their own names. expect(env.OPENROUTER_API_KEY).toBe('sk-or-v1-placeholder'); expect(env.OPENCODE_DISABLE_AUTOUPDATE).toBe('1'); - expect(env.OPENCODE_DISABLE_LSP_DOWNLOAD).toBe('1'); expect(env.OPENCODE_DISABLE_CLAUDE_CODE).toBe('1'); expect(asked).not.toContain(null); expect(asked).toEqual(expect.arrayContaining(['claude', 'openai'])); diff --git a/orchestrator/src/gateway/adapter.test.ts b/orchestrator/src/gateway/adapter.test.ts new file mode 100644 index 00000000..d8149d8d --- /dev/null +++ b/orchestrator/src/gateway/adapter.test.ts @@ -0,0 +1,56 @@ +import assert from 'node:assert/strict'; +import { test } from 'vitest'; +import { translateChildUpdate } from './adapter.ts'; + +/** The fields every child notification of opencode carries. */ +const child = { + rootSessionId: 'root', + childSessionId: 'ses-child', + parentSessionId: 'ses-parent', + depth: 2, + title: 'Read the word list', +}; + +test('a created child becomes a sub agent of its parent', () => { + assert.deepEqual(translateChildUpdate({ ...child, type: 'status', status: 'created' }), { + sessionId: 'ses-parent', + update: { + sessionUpdate: 'subagent_spawned', + subagentSessionId: 'ses-child', + name: 'Read the word list', + capabilities: {}, + }, + }); + // A child without a title gets a plain name. + const { title: _title, ...untitled } = child; + const spawned = translateChildUpdate({ ...untitled, type: 'status', status: 'created' }) as { + update: { name: string }; + }; + assert.equal(spawned.update.name, 'subagent'); +}); + +test('an update of a child goes on the session of the child', () => { + const update = { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: 'hi' } }; + assert.deepEqual(translateChildUpdate({ ...child, type: 'update', update }), { + sessionId: 'ses-child', + update, + }); +}); + +test('an end state becomes the state of the sub agent, and a running state nothing', () => { + const state = (status: string): unknown => + ( + translateChildUpdate({ ...child, type: 'status', status }) as { + update?: { state?: string }; + } | null + )?.update?.state ?? null; + assert.equal(state('completed'), 'completed'); + assert.equal(state('failed'), 'failed'); + assert.equal(state('interrupted'), 'cancelled'); + assert.equal(state('running'), null); +}); + +test('a notification without the sessions is dropped', () => { + assert.equal(translateChildUpdate({ type: 'status', status: 'created' }), null); + assert.equal(translateChildUpdate({ ...child, type: 'update' }), null); +}); diff --git a/orchestrator/src/gateway/adapter.ts b/orchestrator/src/gateway/adapter.ts index aa472492..8495e07d 100644 --- a/orchestrator/src/gateway/adapter.ts +++ b/orchestrator/src/gateway/adapter.ts @@ -1,7 +1,7 @@ import { PassThrough, Readable } from 'node:stream'; import type { McpServer, Stream } from '@agentclientprotocol/sdk'; import { client as acpClient, type ClientConnection, ndJsonStream } from '@agentclientprotocol/sdk'; -import { ACP_METHOD } from '../../../shared/acp.ts'; +import { ACP_METHOD, UPDATE_KIND } from '../../../shared/acp.ts'; import type { BackgroundProcess, ThreadConfigOption, @@ -38,7 +38,71 @@ const raw = (params: unknown): T => params as T; * Update kinds the SDK's schema does not know, which * {@link AdapterConnection.siftExtensions} takes off the stream. */ -const EXTENSION_UPDATE = /^async_task_/; +const EXTENSION_UPDATE = /^(async_task_|subagent_)/; + +/** The notification opencode sends for a child session. */ +const CHILD_UPDATE_METHOD = 'opencode/session/child_update'; + +/** The text that marks a line of the adapter's output as a possible extension notification. */ +const EXTENSION_MARK = /async_task_|subagent_|opencode\/session\/child_update/; + +/** The end states of an opencode child session, as the `state` of a `subagent_state_update`. */ +const CHILD_END_STATES: Record = { + completed: 'completed', + failed: 'failed', + interrupted: 'cancelled', +}; + +/** One `opencode/session/child_update` notification. */ +interface ChildUpdate { + /** The child session. */ + childSessionId?: unknown; + /** The session that started the child. */ + parentSessionId?: unknown; + /** The title opencode gave the child. */ + title?: unknown; + /** `status` for a change of the child's state, `update` for one of its updates. */ + type?: unknown; + /** The new state, with `type: 'status'`. */ + status?: unknown; + /** The `update` of a `session/update` of the child, with `type: 'update'`. */ + update?: unknown; +} + +/** + * Turns one opencode child notification into the `session/update` params of the AIR form, which the Claude and + * Codex adapters send for a sub agent. A running state has no counterpart and gives nothing. + * + * @param notification The params of the notification. + * @returns The params of the `session/update`, or null when the notification has no counterpart. + */ +export function translateChildUpdate(notification: ChildUpdate): unknown { + const { childSessionId: child, parentSessionId: parent } = notification; + if (typeof child !== 'string' || typeof parent !== 'string') return null; + if (notification.type === 'update') { + return notification.update ? { sessionId: child, update: notification.update } : null; + } + if (notification.type !== 'status') return null; + if (notification.status === 'created') { + const name = typeof notification.title === 'string' ? notification.title : 'subagent'; + return { + sessionId: parent, + update: { + sessionUpdate: UPDATE_KIND.subagentSpawned, + subagentSessionId: child, + name, + capabilities: {}, + }, + }; + } + const state = + typeof notification.status === 'string' ? CHILD_END_STATES[notification.status] : undefined; + if (!state) return null; + return { + sessionId: parent, + update: { sessionUpdate: UPDATE_KIND.subagentState, subagentSessionId: child, state }, + }; +} /** Wait before each retry, in milliseconds, by retry number. */ const SPAWN_BACKOFF_MS = [1000, 3000]; @@ -61,12 +125,17 @@ const MAX_INHERIT_HOPS = 32; /** * The client capabilities Boxes sends at `initialize`. * - * The capabilities hold only the async-task extension, which both adapters need before they send async-task - * updates. With no filesystem or terminal capability, the adapter sends the client only `session/update` and - * `session/request_permission`. + * The AIR capabilities select the async-task updates and the sub agent sessions of the Claude and Codex adapters. + * `terminal_output_delta` selects the output chunks of a Codex command. The opencode key selects the child session + * updates of opencode. With no filesystem or terminal capability, the adapter sends the client only + * `session/update`, `session/request_permission` and the notifications of these extensions. */ const CLIENT_CAPABILITIES = { - _meta: { jetbrains: { air: { version: 1, capabilities: ['asyncTasks'] } } }, + _meta: { + jetbrains: { air: { version: 1, capabilities: ['asyncTasks', 'nativeSubagentSessions'] } }, + terminal_output_delta: true, + 'opencode/child-session-updates': true, + }, } as const; /** The error for a thread id that names none of the box's threads. The API turns it into a 404. */ @@ -225,16 +294,24 @@ export interface AdapterHost { * * @param harness The harness whose adapter sent the update. * @param params The params of the `session/update` notification. + * @param thread The adapter's id for the thread of the update, or undefined when the update names no session. + * The update of a sub agent names the session of the sub agent and belongs to the thread of its root. * @param replaying True when the update is part of a replay. */ - onUpdate(harness: HarnessId, params: unknown, replaying: boolean): void; + onUpdate( + harness: HarnessId, + params: unknown, + thread: string | undefined, + replaying: boolean, + ): void; /** * Answers a permission request. The adapter blocks until it resolves. * * @param params The params of the `session/request_permission` request. + * @param thread The adapter's id for the thread that asks, or undefined when the request names no session. * @returns The answer for the adapter. */ - onPermission(params: unknown): Promise; + onPermission(params: unknown, thread: string | undefined): Promise; /** * Reports the conversations lost when the adapter process exited. * @@ -328,6 +405,12 @@ export class AdapterConnection { * load in flight is part of a replay. */ private readonly replaying = new Map(); + /** + * The thread of each sub agent session, by the session id of the sub agent. A `subagent_spawned` adds the + * session under the thread of its parent, which can itself be a sub agent. The teardown empties the map, because + * the next adapter process announces its sub agents again. + */ + private readonly roots = new Map(); /** * The conversations this adapter process holds, which are the ones it has minted or loaded. * @@ -578,11 +661,11 @@ export class AdapterConnection { const stream = this.makeStream(exec); const app = acpClient({ name: `boxes-${this.host.boxId}` }) - .onNotification(ACP_METHOD.sessionUpdate as string, raw, ({ params }) => { - this.host.onUpdate(this.harness.id, params, this.isReplaying(params)); - }) + .onNotification(ACP_METHOD.sessionUpdate as string, raw, ({ params }) => + this.deliverUpdate(params), + ) .onRequest(ACP_METHOD.sessionRequestPermission as string, raw, ({ params }) => - this.host.onPermission(params), + this.host.onPermission(params, this.threadOf(params)), ); const conn = app.connect(stream); @@ -1090,14 +1173,52 @@ export class AdapterConnection { } /** - * Checks if an update is part of a thread's transcript replay. + * Passes one update to the host, under the thread it belongs to. + * + * A `subagent_spawned` first records the sub agent under the thread of its parent, so the updates of the sub + * agent find their thread. * * @param params The params of the `session/update` notification. - * @returns True while a load of the update's thread is in flight. */ - private isReplaying(params: unknown): boolean { - const thread = threadOf(params); - return thread !== undefined && this.replaying.has(thread); + private deliverUpdate(params: unknown): void { + const update = (params as { update?: { sessionUpdate?: unknown; subagentSessionId?: unknown } }) + ?.update; + const parent = threadOf(params); + if ( + update?.sessionUpdate === UPDATE_KIND.subagentSpawned && + typeof update.subagentSessionId === 'string' && + parent !== undefined + ) { + this.roots.set(update.subagentSessionId, this.rootOf(parent)); + } + const thread = parent === undefined ? undefined : this.rootOf(parent); + this.host.onUpdate( + this.harness.id, + params, + thread, + thread !== undefined && this.replaying.has(thread), + ); + } + + /** + * The thread of a session, which is the session itself unless the session is a sub agent. + * + * @param acpSessionId The adapter's id for the session. + * @returns The adapter's id for the thread. + */ + private rootOf(acpSessionId: string): string { + return this.roots.get(acpSessionId) ?? acpSessionId; + } + + /** + * The thread an adapter message belongs to. + * + * @param params The params of the message. + * @returns The adapter's id for the thread, or undefined when the message names no session. + */ + private threadOf(params: unknown): string | undefined { + const session = threadOf(params); + return session === undefined ? undefined : this.rootOf(session); } /** @@ -1166,8 +1287,9 @@ export class AdapterConnection { } /** - * Takes the async-task extension's notifications off the stream before the - * SDK parses it, and passes them to {@link AdapterHost.onUpdate} directly. + * Takes the notifications of the extensions off the stream before the SDK parses it, and passes them to + * {@link AdapterHost.onUpdate} directly. These are the async-task and sub agent updates, and the child session + * notifications of opencode, which become sub agent updates. * * The SDK's session-update router checks each `session/update` against its * schema, and drops an update kind it does not know before any handler @@ -1213,7 +1335,7 @@ export class AdapterConnection { * @returns True when the line was an extension notification. Any other line stays on the stream. */ private consumeExtension(line: string): boolean { - if (!line.includes('async_task_')) return false; + if (!EXTENSION_MARK.test(line)) return false; let message: { id?: unknown; method?: unknown; @@ -1224,10 +1346,16 @@ export class AdapterConnection { } catch { return false; } - if (message.id !== undefined || message.method !== ACP_METHOD.sessionUpdate) return false; + if (message.id !== undefined) return false; + if (message.method === CHILD_UPDATE_METHOD) { + const params = translateChildUpdate((message.params ?? {}) as ChildUpdate); + if (params) this.deliverUpdate(params); + return true; + } + if (message.method !== ACP_METHOD.sessionUpdate) return false; const kind = message.params?.update?.sessionUpdate; if (typeof kind !== 'string' || !EXTENSION_UPDATE.test(kind)) return false; - this.host.onUpdate(this.harness.id, message.params, this.isReplaying(message.params)); + this.deliverUpdate(message.params); return true; } @@ -1280,6 +1408,8 @@ export class AdapterConnection { this.live.clear(); // A leftover count would mark every later update of its thread as replay. this.replaying.clear(); + // A fresh adapter announces its sub agents again. + this.roots.clear(); // Nothing announces the old process's tasks again. this.tasks.clear(); try { diff --git a/orchestrator/src/gateway/broadcast.ts b/orchestrator/src/gateway/broadcast.ts index c170531d..cd70900a 100644 --- a/orchestrator/src/gateway/broadcast.ts +++ b/orchestrator/src/gateway/broadcast.ts @@ -112,9 +112,10 @@ export class Broadcast { * watching that thread. * * @param params The params of the `session/update` notification. + * @param thread The adapter's id for the thread of the update. The update of a sub agent names the session of + * the sub agent and belongs to the thread of its root. */ - update(params: unknown): void { - const thread = threadOf(params); + update(params: unknown, thread: string | undefined = threadOf(params)): void { // An update that names no thread goes to nobody. if (!thread) return; const history = this.logs.get(thread); diff --git a/orchestrator/src/gateway/upstream.test.ts b/orchestrator/src/gateway/upstream.test.ts index 74521990..033b338e 100644 --- a/orchestrator/src/gateway/upstream.test.ts +++ b/orchestrator/src/gateway/upstream.test.ts @@ -26,6 +26,7 @@ import { Notifier, type NotifyEvent } from '../notify.ts'; import { DockerRuntime } from '../runtime/docker.ts'; import { setRuntime } from '../runtime/runtime.ts'; import * as ws from '../workspaces.ts'; +import { threadOf } from './broadcast.ts'; import { type DownstreamHandle, HISTORY_LOADING, THREAD_WORKING } from './upstream.ts'; // A turn is announced once its thread has gone quiet, so these tests wait for the quiet. Set to the shortest the @@ -3429,3 +3430,151 @@ test('an MCP server without a stored secret is left out', async () => { ]); assert.ok(written.some((line) => line.includes('left out an MCP server'))); }); + +/** + * A `subagent_spawned`, as either adapter sends one for a client with native sub agent sessions. + * + * @param acpSessionId The session that started the sub agent. + * @param child The session of the sub agent. + * @returns The params of the `session/update` notification. + */ +function subagentSpawned(acpSessionId: string, child: string): unknown { + return { + sessionId: acpSessionId, + update: { + sessionUpdate: 'subagent_spawned', + subagentSessionId: child, + name: 'Find the words', + task: 'Read words.txt', + capabilities: {}, + }, + }; +} + +/** + * A text chunk of one session. + * + * @param acpSessionId The session. + * @param text The text. + * @returns The params of the `session/update` notification. + */ +function chunk(acpSessionId: string, text: string): unknown { + return { + sessionId: acpSessionId, + update: { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text } }, + }; +} + +test('the updates of a sub agent reach the browsers of its thread, as sent', async () => { + const adapter = new FakeAdapter((msg) => { + if (msg.method === 'initialize') return { protocolVersion: 1, agentCapabilities: {} }; + return {}; + }); + fakeDocker(adapter); + + const up = manager.upstream('s1'); + await up.ensureStarted(); + const watcher = fakeHandle(1, 'acp-gone'); + const elsewhere = fakeHandle(2, 'acp-kept'); + up.attach(watcher); + up.attach(elsewhere); + + adapter.notify('session/update', subagentSpawned('acp-gone', 'child-1')); + // A sub agent of the sub agent belongs to the same thread. + adapter.notify('session/update', subagentSpawned('child-1', 'child-2')); + adapter.notify('session/update', chunk('child-1', 'from the sub agent')); + adapter.notify('session/update', chunk('child-2', 'from the nested sub agent')); + + await expect + .poll(() => watcher.told.filter((p) => (p as { update?: unknown }).update).length) + .toBe(4); + // The session ids stay the sub agents' own, which is how the dashboard tells them apart. + assert.deepEqual( + watcher.told.flatMap((p) => ((p as { update?: unknown }).update ? [threadOf(p)] : [])), + ['acp-gone', 'child-1', 'child-1', 'child-2'], + ); + assert.equal(elsewhere.told.filter((p) => (p as { update?: unknown }).update).length, 0); +}); + +test('a permission request of a sub agent goes to the browser of its thread', async () => { + const adapter = new FakeAdapter((msg) => { + if (msg.method === 'initialize') return { protocolVersion: 1, agentCapabilities: {} }; + return {}; + }); + fakeDocker(adapter); + + const up = manager.upstream('s1'); + await up.ensureStarted(); + const watcher = fakeHandle(1, 'acp-gone'); + up.attach(watcher); + + adapter.notify('session/update', subagentSpawned('acp-gone', 'child-1')); + adapter.push(permissionFrame('child-1')); + + await expect.poll(() => watcher.asked.length).toBe(1); + assert.equal(threadOf(watcher.asked[0]), 'child-1'); + assert.equal(manager.pending.countForBox('s1'), 0); +}); + +test('a child session of opencode arrives as a sub agent session', async () => { + const adapter = new FakeAdapter((msg) => { + if (msg.method === 'initialize') return { protocolVersion: 1, agentCapabilities: {} }; + return {}; + }); + fakeDocker(adapter); + + const up = manager.upstream('s1'); + await up.ensureStarted(); + const watcher = fakeHandle(1, 'acp-gone'); + up.attach(watcher); + + const child = { + rootSessionId: 'acp-gone', + childSessionId: 'ses-child', + parentSessionId: 'acp-gone', + depth: 1, + title: 'Read the word list', + }; + adapter.notify('opencode/session/child_update', { ...child, type: 'status', status: 'created' }); + adapter.notify('opencode/session/child_update', { ...child, type: 'status', status: 'running' }); + adapter.notify('opencode/session/child_update', { + ...child, + type: 'update', + update: { sessionUpdate: 'tool_call', toolCallId: 'ses-child:call-1', title: 'read' }, + }); + adapter.notify('opencode/session/child_update', { + ...child, + type: 'status', + status: 'interrupted', + }); + + await expect + .poll(() => watcher.told.filter((p) => (p as { update?: unknown }).update).length) + .toBe(3); + assert.deepEqual( + watcher.told.filter((p) => (p as { update?: unknown }).update), + [ + { + sessionId: 'acp-gone', + update: { + sessionUpdate: 'subagent_spawned', + subagentSessionId: 'ses-child', + name: 'Read the word list', + capabilities: {}, + }, + }, + { + sessionId: 'ses-child', + update: { sessionUpdate: 'tool_call', toolCallId: 'ses-child:call-1', title: 'read' }, + }, + { + sessionId: 'acp-gone', + update: { + sessionUpdate: 'subagent_state_update', + subagentSessionId: 'ses-child', + state: 'cancelled', + }, + }, + ], + ); +}); diff --git a/orchestrator/src/gateway/upstream.ts b/orchestrator/src/gateway/upstream.ts index b3afbfd1..ff0f7a5d 100644 --- a/orchestrator/src/gateway/upstream.ts +++ b/orchestrator/src/gateway/upstream.ts @@ -903,17 +903,23 @@ export class UpstreamBox implements AdapterHost { * * @param harnessId The harness whose adapter sent the update. * @param params The params of the `session/update` notification. + * @param thread The adapter's id for the thread of the update, which differs from the session of the update for + * a sub agent. * @param replaying True when the update is part of a replay on that adapter. */ - onUpdate(harnessId: HarnessId, params: unknown, replaying: boolean): void { + onUpdate( + harnessId: HarnessId, + params: unknown, + thread: string | undefined, + replaying: boolean, + ): void { this.touch(); - const thread = threadOf(params); const update = (params as { update?: unknown })?.update; // A replay is not the agent talking. if (!replaying && thread) this.activity.observe(thread, update, harnessId); - this.recordThreadInfo(harnessId, params, replaying); + this.recordThreadInfo(harnessId, params, thread, replaying); this.tap('up', ACP_METHOD.sessionUpdate, params); - this.downstreams.update(params); + this.downstreams.update(params, thread); // After the update, so the transcript and the task bar agree. Task // updates are forwarded to browsers as well. if (thread !== undefined && this.connection(harnessId).noteTask(thread, update)) { @@ -929,16 +935,25 @@ export class UpstreamBox implements AdapterHost { * when a plan is accepted. A replayed update does not count as the thread * being heard from, so opening a thread does not move it up the list. * + * An update of a sub agent counts as the thread being heard from, but the title, the mode and the settings of + * a sub agent are not the thread's. + * * @param harnessId The harness whose adapter sent the update. * @param params The params of the `session/update` notification. + * @param thread The adapter's id for the thread of the update. * @param replaying True when the update is part of a replay. */ - private recordThreadInfo(harnessId: HarnessId, params: unknown, replaying: boolean): void { - const acpSessionId = (params as { sessionId?: string })?.sessionId; - if (!acpSessionId) return; - const row = threadByAcpId(this.db, this.boxId, harnessId, acpSessionId); + private recordThreadInfo( + harnessId: HarnessId, + params: unknown, + thread: string | undefined, + replaying: boolean, + ): void { + if (!thread) return; + const row = threadByAcpId(this.db, this.boxId, harnessId, thread); if (!row) return; if (!replaying) touchThread(this.db, row.id); + if (threadOf(params) !== thread) return; const update = ( params as { @@ -966,7 +981,7 @@ export class UpstreamBox implements AdapterHost { return; case UPDATE_KIND.configOption: if (Array.isArray(update.configOptions)) { - this.connection(harnessId).recordConfigOptions(acpSessionId, update.configOptions); + this.connection(harnessId).recordConfigOptions(thread, update.configOptions); } return; default: @@ -980,13 +995,14 @@ export class UpstreamBox implements AdapterHost { * until the answer arrives. * * @param params The params of the `session/request_permission` request. + * @param thread The adapter's id for the thread that asks, which differs from the session of the request for a + * sub agent. * @returns The answer for the adapter. */ - onPermission(params: unknown): Promise { + onPermission(params: unknown, thread: string | undefined): Promise { this.touch(); this.tap('up', ACP_METHOD.sessionRequestPermission, params); - const thread = threadOf(params); const target = thread ? this.downstreams.byRecency(thread)[0] : undefined; if (target) { return target.request(ACP_METHOD.sessionRequestPermission, params).catch((err) => { @@ -994,23 +1010,24 @@ export class UpstreamBox implements AdapterHost { this.slog.warn('permission forward failed; queueing', { error: (err as Error).message, }); - return this.queuePermission(params); + return this.queuePermission(params, thread); }); } - return this.queuePermission(params); + return this.queuePermission(params, thread); } /** * Holds a permission request for a browser to answer, and sends a notification. * * @param params The params of the `session/request_permission` request. + * @param thread The adapter's id for the thread that asks. * @returns The answer for the adapter, from a browser or from the fallback. */ - private queuePermission(params: unknown): Promise { + private queuePermission(params: unknown, thread: string | undefined): Promise { return new Promise((resolve, reject) => { const entry = this.pending.add( this.boxId, - threadOf(params) ?? null, + thread ?? null, ACP_METHOD.sessionRequestPermission, params, { resolve, reject }, @@ -1018,8 +1035,7 @@ export class UpstreamBox implements AdapterHost { (timedOut) => this.applyPermissionFallback(timedOut.row.id, params, resolve), ); this.slog.info('permission request queued', { pendingId: entry.row.id }); - const thread = threadOf(params) ?? null; - if (this.mayAnnounceApproval(thread)) this.announce('approval', thread); + if (this.mayAnnounceApproval(thread ?? null)) this.announce('approval', thread ?? null); }); } diff --git a/orchestrator/src/harness.test.ts b/orchestrator/src/harness.test.ts index b1844295..ae714aff 100644 --- a/orchestrator/src/harness.test.ts +++ b/orchestrator/src/harness.test.ts @@ -158,7 +158,6 @@ test('the opencode entry runs on the API keys of the user', () => { assert.equal(h.credentialId, null); assert.deepEqual(h.env('', null), { OPENCODE_DISABLE_AUTOUPDATE: '1', - OPENCODE_DISABLE_LSP_DOWNLOAD: '1', OPENCODE_DISABLE_CLAUDE_CODE: '1', }); assert.deepEqual(h.layout, { agentsMd: '.config/opencode/AGENTS.md', skills: '.agents/skills' }); diff --git a/orchestrator/src/harness.ts b/orchestrator/src/harness.ts index 7b6fe70f..c56c1ae5 100644 --- a/orchestrator/src/harness.ts +++ b/orchestrator/src/harness.ts @@ -202,13 +202,12 @@ export const HARNESSES: Readonly> = { */ credentialId: null, /** - * Turns off the self-update and the download of language servers. opencode - * also stops reading the Claude Code instructions and skills, because the - * agent set has its own copy for opencode. + * Turns off the self-update. opencode also stops reading the Claude Code + * instructions and skills, because the agent set has its own copy for + * opencode. */ env: () => ({ OPENCODE_DISABLE_AUTOUPDATE: '1', - OPENCODE_DISABLE_LSP_DOWNLOAD: '1', OPENCODE_DISABLE_CLAUDE_CODE: '1', }), /** Skills go in the harness-neutral `~/.agents/skills`, the same folder as for Codex. */ diff --git a/shared/acp.ts b/shared/acp.ts index af1487f7..2e73e5f8 100644 --- a/shared/acp.ts +++ b/shared/acp.ts @@ -80,6 +80,13 @@ export const UPDATE_KIND = { * the conversation so far. */ usage: 'usage_update', + /** + * A sub agent that the agent started, sent on the session of its parent. The updates of the sub agent then + * arrive on the session that `subagentSessionId` names. + */ + subagentSpawned: 'subagent_spawned', + /** The end of a sub agent, sent on the session of its parent. */ + subagentState: 'subagent_state_update', } as const; /** One of the values of {@link UPDATE_KIND}. */