Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.
OpenBot
David McKay40cef1565909
diff --git a/.env.example b/.env.examplenew file mode 100644index 00000000..231933bf--- /dev/null+++ b/.env.example@@ -0,0 +1,151 @@+DATABASE_URL=postgres://openbot:openbot@localhost:5432/openbot+# Credential vault encryption key. The example value is public and only suitable for local+# development. Production refuses to start with this key.+# openssl rand -base64 32+KEY_ENCRYPTION_KEY=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=+PORT=3001+TENANT_PACKAGE_DIR=../examples/fintech+# What this deployment calls itself, when more than one shares an Intelligence project. A copy of a+# deployment made for development uses the same project key, and threads are listed per Bot with+# nothing to say which deployment a conversation came from. The name goes into every thread id this+# deployment mints, so its own conversations stay identifiable. Unset, the tenant package's id is+# used, which tells two packages apart but not two copies of one.+# DEPLOYMENT_ID=+# Google sign-in. Leave commented for local development with OPENBOT_DEV_NO_AUTH; uncomment all five+# settings together so authentication is either fully configured or absent.+#+# BETTER_AUTH_SECRET must be a high-entropy secret of at least 32 characters. Generate one:+# openssl rand -base64 32+# TRUSTED_ORIGINS is where the app is served from, which is port 3010 locally.+# BETTER_AUTH_URL=http://localhost:3001+# BETTER_AUTH_SECRET=+# GOOGLE_OAUTH_CLIENT_ID=+# GOOGLE_OAUTH_CLIENT_SECRET=++# Local development only. This admits every request as one local administrator. Keep it explicit and+# never expose a deployment to the internet in this state; production refuses to start with it.+OPENBOT_DEV_NO_AUTH=true+TRUSTED_ORIGINS=http://localhost:3010++# CopilotKit Intelligence. Required: the server refuses to start without all four because+# Intelligence owns durable threads and memory and a deployment without it forgets every+# conversation. There is no degraded mode.+#+# Do not run Intelligence yourself. These two point at the managed service and should be left+# unchanged; the CLI below provisions a free licence for it. Running Intelligence on your own+# infrastructure is an Enterprise Intelligence Platform feature deployed by Helm chart, and is not+# self-serve: https://docs.showcase.copilotkit.ai/premium/self-hosting+INTELLIGENCE_API_URL=https://api.intelligence.copilotkit.ai+INTELLIGENCE_GATEWAY_WS_URL=wss://realtime.intelligence.copilotkit.ai+#+# Get both of the next two from the CopilotKit CLI:+#+# npx --yes copilotkit@latest login # browser sign-in+# npx --yes copilotkit@latest project select # prints the cpk-... runtime key -> INTELLIGENCE_API_KEY+# npx --yes copilotkit@latest license --write # writes COPILOTKIT_LICENSE_TOKEN into this file+#+# The runtime key is also under "API Keys" in your project at https://intelligence.copilotkit.ai+INTELLIGENCE_API_KEY=+COPILOTKIT_LICENSE_TOKEN=++# Model key. Required by the proof-of-concept Bot, which speaks OpenAI's API directly, and by the+# framework Bot unless you point it at another provider below.+OPENAI_API_KEY=++# Framework Bot provider: openai, anthropic or google. It reads that provider's own+# key and refuses to start without it, so a deployment on Anthropic never needs an OpenAI key for it.+# The proof-of-concept Bot is OpenAI only by construction: it speaks that API directly.+# BOT_PROVIDER=openai+# ANTHROPIC_API_KEY=+# GOOGLE_API_KEY=++# Which model. Defaults per provider: gpt-5.5, claude-sonnet-4-5, gemini-2.5-flash.+# BOT_MODEL=gpt-5.5++# OpenAI only. Its newer models require the Responses API, which the framework Bot handles and the+# proof-of-concept one cannot.+# BOT_RESPONSES_API=false++# The Bot computer. Absent means the feature is off and its routes are not mounted.+AGENT_COMPUTER_URL=http://localhost:4100+# Secret every computer requires from its caller. `agent-computer` drives a browser holding real+# logins, while policy, audit and sign-in live in the API server. The computer refuses to start+# without this value and refuses every request that does not present it. Use a long random value;+# `scripts/start.sh` sets a development one for you.+COMPUTER_TOKEN=+# Local only. Lets a Bot browse this machine's own services; never set this in a deployment.+AGENT_COMPUTER_ALLOW_PRIVATE_HOSTS=true+#+# What a Bot may do on its computer, as one JSON object. Absent uses the built-in default, which+# permits the acting tools and forbids nothing, and records every action either way.+#+# `deny` is evaluated first and beats `allow`. An empty `allow` permits nothing, a missing policy+# permits nothing, and a rule that fails to parse denies rather than letting the action through. The+# server refuses to start if this is set and malformed, so an invalid restriction never falls back to+# permissive behavior.+#+# Workspace and browser profile per Bot. Each Bot's computer is its own container with its own+# volumes, so one Bot cannot read another's files or use another's logins, and every action records+# which Bot took it. A rule can still restrict a single Bot with `bot.id`.+#+# Attributes: tool.name, bot.id, actor.id, page.url, page.host, element.ref/role/name/type,+# key, file.path, file.name, file.extension.+#+# Name every route to the same effect. A form submits from a keypress in any of its fields, so a rule+# that only blocks a Submit button does not block Enter from another field. The example below refuses+# Enter outright for that reason.+# Functions: contains(haystack, needle) and matches(value, pattern), both case-insensitive.+# `enforce` blocks; `dry-run` decides and records but lets everything through, so a new rule can be+# tried against real traffic before it starts refusing anybody's work.+#+# AGENT_COMPUTER_POLICY={"mode":"enforce","deny":["(intent == \"activate\" && contains(element.name, \"submit\")) || (tool.name == \"computer_key\" && key == \"Enter\")"],"allow":["true"]}++# How long one action waits for its element, in ms. Read by agent-computer, not the server.+# ACTION_TIMEOUT_MS=10000++# ---------------------------------------------------------------------------+# The computer's profile and where its traffic leaves from+# ---------------------------------------------------------------------------++# Chromium profile directory inside agent-computer, mounted from the `agent-profiles` volume in+# docker-compose.yml. Pointing it somewhere unmounted disables login persistence.+# PROFILES_DIR=/profiles++# Which Bot this computer belongs to, and therefore which profile directory it uses.+# COMPUTER_BOT_ID=shared++# Per-Bot egress identity. A proxy the Bot's browser sends everything through, so the far side sees a+# stable address it can allow-list or attribute to that Bot. `EGRESS_PROXY_<BOT>` names one Bot,+# `EGRESS_PROXY_DEFAULT` covers the rest, and absent means the browser goes out directly.+#+# Credentials may be in the URL and are split out before Playwright sees them. Only the HOST is ever+# reported back on the admin page or the API, so the password does not end up on a screen.+#+# This is attribution, not anonymity, and it is not a boundary by itself: it gives a security team a+# per-Bot address for network rules alongside AGENT_COMPUTER_POLICY.+# EGRESS_PROXY_DEFAULT=http://user:[email protected]:8080+# EGRESS_PROXY_SALES_BOT=http://sales.proxy.internal:8080+++# The managed teammate AG-UI endpoint. Required: use an HTTP(S) URL.+MANAGED_AGENT_AG_UI_URL=http://localhost:4200/ag-ui++# The second Bot in the box runs on http://localhost:4201/ag-ui, on a framework rather than+# proof of concept, and is reached the same way: point MANAGED_AGENT_AG_UI_URL at it, or add it as a+# Bot of its own in the tenant package or at /agents.++# Which model the Bots use. agent-bot speaks /v1/chat/completions and cannot use gpt-5.6-*, which+# require the Responses API. agent-langgraph can: set BOT_RESPONSES_API=true and give it a 5.6 model.+# BOT_RESPONSES_API=false++# One computer per Bot. Unset, every Bot shares the computer at AGENT_COMPUTER_URL, suitable on a+# laptop and explicit about being one shared machine. Set, the supervisor gives each Bot a container+# of its own, with its own /workspace and its own browser profile.+COMPUTER_SUPERVISOR_URL=+# Shared with the supervisor. Not the security boundary, its four verbs are, but it keeps anything+# else that can reach the port from cycling a Bot's computer.+SUPERVISOR_TOKEN=+# Set to runsc to run every computer under gVisor, if the host has it. Unset, a computer is an+# ordinary container and shares the host kernel, which is worth knowing when the Bot is not ours.+COMPUTER_RUNTIME=diff --git a/.github/CODEOWNERS b/.github/CODEOWNERSnew file mode 100644index 00000000..5674d7bd--- /dev/null+++ b/.github/CODEOWNERS@@ -0,0 +1,16 @@+# Who can approve a change, and who can land it.+#+# Both powers belong to the people named here and to nobody else. GitHub does+# not count an approving review from anyone without write access, the branch+# rule on `main` requires the approval to come from an owner in this file, and+# it restricts merging to the same accounts. A passer-by can open a pull+# request and comment on one, which is the point of a public repository, and+# can neither approve nor land it.+#+# Nobody can approve their own pull request, so this list needs enough people+# that work does not stall when one of them is away.+#+# Adding a name here grants both powers. Add people who know this codebase well+# enough to say no.++* @davidmckayv @guidovizoso @tylerslaton @MikeRyanDevdiff --git a/.gitignore b/.gitignorenew file mode 100644index 00000000..3ba208a9--- /dev/null+++ b/.gitignore@@ -0,0 +1,19 @@+.worktrees/+.superpowers/+docs/superpowers/++docs/specs/+docs/plans/+.env+.env.*+!.env.example+node_modules/+**/dist/+app/src/lib/generated/application-config.ts+.logs/+.demo-logs/+**/.impeccable+.wave-state.md++# TanStack Router scratch output+app/.tanstack/diff --git a/LICENSE b/LICENSEnew file mode 100644index 00000000..3b2206e4--- /dev/null+++ b/LICENSE@@ -0,0 +1,21 @@+MIT License++Copyright (c) 2026 CopilotKit++Permission is hereby granted, free of charge, to any person obtaining a copy+of this software and associated documentation files (the "Software"), to deal+in the Software without restriction, including without limitation the rights+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell+copies of the Software, and to permit persons to whom the Software is+furnished to do so, subject to the following conditions:++The above copyright notice and this permission notice shall be included in all+copies or substantial portions of the Software.++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE+SOFTWARE.diff --git a/agent-bot/Dockerfile b/agent-bot/Dockerfilenew file mode 100644index 00000000..4cd1f207--- /dev/null+++ b/agent-bot/Dockerfile@@ -0,0 +1,15 @@+# The built-in Bot only speaks AG-UI and a model provider; the browser runs in a separate computer+# container so either side can be replaced independently.+FROM oven/bun:1.3-alpine++WORKDIR /app+COPY agent-bot/package.json ./agent-bot/+RUN cd agent-bot && bun install++# Preserve the repo layout so `../../shared/bot-prompt` resolves the same in the image and locally.+COPY shared ./shared+COPY agent-bot/src ./agent-bot/src++ENV PORT=4200+EXPOSE 4200+CMD ["bun", "agent-bot/src/index.ts"]diff --git a/agent-bot/src/index.ts b/agent-bot/src/index.tsnew file mode 100644index 00000000..bfbe3444--- /dev/null+++ b/agent-bot/src/index.ts@@ -0,0 +1,221 @@+import type { BaseEvent, RunAgentInput } from "@ag-ui/core";+import { EventEncoder } from "@ag-ui/encoder";+import { serve } from "bun";+import OpenAI from "openai";+import { SYSTEM_PROMPT } from "../../shared/bot-prompt";++/**+ * The built-in Bot is an AG-UI HTTP service registered the same way as any customer-provided Bot.+ *+ * It publishes no tools of its own. Every callable tool arrives in `input.tools`, forwarded by the+ * runtime from the surface registration.+ *+ * The loop runs on the client. When this emits a tool call it ends the run; the surface executes the+ * tool, appends the result, and starts a new run with the fuller conversation. That keeps the tool+ * running where its effects are visible to the person watching.+ */++const PORT = Number.parseInt(process.env.PORT ?? "4200", 10);+/**+ * Which model drives the Bot.+ *+ * `gpt-5.5` works through `/v1/chat/completions`, which is the API this file uses.+ *+ * `gpt-5.6-*` models require the Responses API for tool use and cannot be used by this+ * chat-completions streaming loop.+ */+const MODEL = process.env.BOT_MODEL ?? "gpt-5.5";++const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });++/** Translate the conversation AG-UI carries into the shape the model provider expects. */+function toProviderMessages(input: RunAgentInput) {+ const messages: OpenAI.Chat.ChatCompletionMessageParam[] = [+ { role: "system", content: SYSTEM_PROMPT },+ ];++ for (const message of input.messages) {+ if (message.role === "user") {+ messages.push({ role: "user", content: String(message.content ?? "") });+ continue;+ }+ if (message.role === "system" || message.role === "developer") {+ messages.push({ role: "system", content: String(message.content ?? "") });+ continue;+ }+ if (message.role === "tool") {+ // Tool results are appended so the model can continue from the completed call.+ messages.push({+ role: "tool",+ tool_call_id: message.toolCallId,+ content: String(message.content ?? ""),+ });+ continue;+ }+ if (message.role === "assistant") {+ const toolCalls = message.toolCalls?.map((call) => ({+ id: call.id,+ type: "function" as const,+ function: {+ name: call.function.name,+ arguments: call.function.arguments,+ },+ }));+ messages.push({+ role: "assistant",+ content: message.content ?? null,+ ...(toolCalls?.length ? { tool_calls: toolCalls } : {}),+ });+ }+ }++ return messages;+}++/** Every tool comes from the caller. This service publishes none of its own, on purpose. */+function toProviderTools(input: RunAgentInput) {+ if (!input.tools?.length) return undefined;+ return input.tools.map((tool) => ({+ type: "function" as const,+ function: {+ name: tool.name,+ description: tool.description,+ parameters: tool.parameters as Record<string, unknown>,+ },+ }));+}++async function runAgent(input: RunAgentInput): Promise<Response> {+ const encoder = new EventEncoder();+ const stream = new ReadableStream<Uint8Array>({+ async start(controller) {+ const utf8 = new TextEncoder();+ const send = (event: BaseEvent) =>+ controller.enqueue(utf8.encode(encoder.encodeSSE(event)));++ send({+ type: "RUN_STARTED",+ threadId: input.threadId,+ runId: input.runId,+ } as BaseEvent);++ try {+ const completion = await openai.chat.completions.create({+ model: MODEL,+ messages: toProviderMessages(input),+ tools: toProviderTools(input),+ stream: true,+ });++ const messageId = `msg_${input.runId}`;+ let textOpen = false;+ // Providers stream a tool call's arguments in fragments across many chunks, keyed only by+ // index. Buffering per index is what turns that back into one call the surface can run.+ const toolCalls = new Map<+ number,+ { id: string; name: string; args: string }+ >();++ for await (const chunk of completion) {+ const delta = chunk.choices[0]?.delta;+ if (!delta) continue;++ if (delta.content) {+ if (!textOpen) {+ send({+ type: "TEXT_MESSAGE_START",+ messageId,+ role: "assistant",+ } as BaseEvent);+ textOpen = true;+ }+ send({+ type: "TEXT_MESSAGE_CONTENT",+ messageId,+ delta: delta.content,+ } as BaseEvent);+ }++ for (const call of delta.tool_calls ?? []) {+ const existing = toolCalls.get(call.index) ?? {+ id: call.id ?? `call_${input.runId}_${call.index}`,+ name: "",+ args: "",+ };+ if (call.id) existing.id = call.id;+ if (call.function?.name) existing.name = call.function.name;+ if (call.function?.arguments)+ existing.args += call.function.arguments;+ toolCalls.set(call.index, existing);+ }+ }++ if (textOpen) {+ send({ type: "TEXT_MESSAGE_END", messageId } as BaseEvent);+ }++ for (const call of toolCalls.values()) {+ send({+ type: "TOOL_CALL_START",+ toolCallId: call.id,+ toolCallName: call.name,+ parentMessageId: messageId,+ } as BaseEvent);+ send({+ type: "TOOL_CALL_ARGS",+ toolCallId: call.id,+ delta: call.args || "{}",+ } as BaseEvent);+ send({ type: "TOOL_CALL_END", toolCallId: call.id } as BaseEvent);+ }++ send({+ type: "RUN_FINISHED",+ threadId: input.threadId,+ runId: input.runId,+ } as BaseEvent);+ } catch (error) {+ // Reported as a run error rather than a dropped connection, so the transcript can say what+ // went wrong. A stream that simply ends leaves the surface waiting forever with no reason.+ send({+ type: "RUN_ERROR",+ message:+ error instanceof Error+ ? error.message+ : "The Bot could not answer.",+ } as BaseEvent);+ } finally {+ controller.close();+ }+ },+ });++ return new Response(stream, {+ headers: {+ "content-type": encoder.getContentType(),+ "cache-control": "no-cache",+ connection: "keep-alive",+ },+ });+}++serve({+ port: PORT,+ idleTimeout: 120,+ async fetch(request) {+ const url = new URL(request.url);++ if (url.pathname === "/health") {+ return Response.json({ status: "ok", model: MODEL });+ }++ if (url.pathname === "/ag-ui" && request.method === "POST") {+ const input = (await request.json()) as RunAgentInput;+ return runAgent(input);+ }++ return Response.json({ error: "Not found." }, { status: 404 });+ },+});++console.info(`agent-bot listening on http://localhost:${PORT}/ag-ui`);diff --git a/agent-computer/package.json b/agent-computer/package.jsonnew file mode 100644index 00000000..4a21501a--- /dev/null+++ b/agent-computer/package.json@@ -0,0 +1,19 @@+{+ "name": "@openbot/agent-computer",+ "license": "MIT",+ "private": true,+ "type": "module",+ "scripts": {+ "dev": "bun --watch src/index.ts",+ "start": "bun src/index.ts",+ "typecheck": "tsc --noEmit"+ },+ "dependencies": {+ "playwright": "1.62.1",+ "spiffe": "^0.5.1",+ "yaml": "^2.9.0"+ },+ "devDependencies": {+ "typescript": "^5.9.3"+ }+}diff --git a/agent-computer/src/authorisation.ts b/agent-computer/src/authorisation.tsnew file mode 100644index 00000000..667f2d44--- /dev/null+++ b/agent-computer/src/authorisation.ts@@ -0,0 +1,49 @@+/**+ * Who may speak to a computer at all.+ *+ * This check is the boundary in front of the browser process. Policy, audit and sign-in live in the+ * API server and are not on the direct computer port.+ *+ * It lives here rather than in `index.ts` because that file imports Playwright at module scope, so+ * anything in it needs Chrome merely to be imported by a test. The same reasoning moved the control+ * state machine out: if a decision matters, it does not belong next to `chromium.launch()`.+ */++/**+ * Does this secret match?+ *+ * Constant-time comparison prevents prefix timing leaks. Length still leaks, but not token content.+ */+export function matchesToken(expected: string, offered: string): boolean {+ if (expected.length === 0) return false;+ if (offered.length !== expected.length) return false;+ let difference = 0;+ for (let index = 0; index < offered.length; index += 1) {+ difference |= offered.charCodeAt(index) ^ expected.charCodeAt(index);+ }+ return difference === 0;+}++/**+ * The secret a caller offered, however it could carry it.+ *+ * WebSocket clients cannot set upgrade headers, so the stream also accepts the token as a query+ * parameter.+ */+export function offeredToken(headers: Headers, url: URL): string {+ if (url.pathname === "/stream") return url.searchParams.get("token") ?? "";+ const header = headers.get("x-openbot-computer-token")?.trim();+ if (header) return header;+ const authorization = headers.get("authorization")?.trim() ?? "";+ return authorization.replace(/^Bearer /i, "");+}++/**+ * Health is the one thing an unauthenticated caller may ask.+ *+ * An orchestrator has to be able to check whether this process is up without holding a secret, and+ * the answer names no Bot, touches no browser and reveals nothing about what is running.+ */+export function isOpenPath(pathname: string): boolean {+ return pathname === "/health";+}diff --git a/agent-computer/src/control.ts b/agent-computer/src/control.tsnew file mode 100644index 00000000..1baceb09--- /dev/null+++ b/agent-computer/src/control.ts@@ -0,0 +1,206 @@+/**+ * Who has the wheel.+ *+ * One browser has at most one driver. When a Bot meets a login wall it can ask for+ * help; a person takes control, does the part only they can do, and hands back. While a person holds+ * control every acting call from the Bot is refused, because two drivers on one page is how a Bot+ * clicks "Confirm" on a form a human was still filling in.+ *+ * State lives in this process rather than in the server because this process owns the browser, and a+ * takeover that the browser does not know about is not a takeover. The server records it and decides+ * who may ask for it; this decides whether the next action happens.+ *+ * This module has no Playwright import, so state-machine tests do not need a browser. Browser work+ * stays in `index.ts`.+ */++export type ControlState = {+ holder: "bot" | "human";+ since: string;+ /** Why the Bot asked, so the person knows what they are being handed. Set when the Bot requests. */+ reason?: string;+ /** True once the Bot has asked for help and no person has taken the wheel yet. */+ requested: boolean;+ /**+ * A secret the Bot is waiting for, described by its label only.+ *+ * Secret entry is scoped rather than a full takeover. The Bot names the field, says what it needs,+ * and the person types into a masked box that goes straight to the page.+ *+ * The label is all that is ever stored. The value passes through one request and is not kept here,+ * not returned, and not on any path the model reads.+ */+ secretWanted?: string;+ /**+ * Which field the secret goes in, as a ref from the Bot's snapshot.+ *+ * Required so a secret cannot be sent to whichever field happens to have focus.+ */+ secretRef?: string;+ secretSnapshotId?: number;+};++/** Refusal because a person is driving. Distinct from a failure, so the Bot can be told to wait. */+export class ControlError extends Error {+ constructor(message: string) {+ super(message);+ this.name = "ControlError";+ }+}++/** What a caller must say to ask for a secret. Rejected as a request error, not thrown. */+export class ControlRequestError extends Error {+ constructor(message: string) {+ super(message);+ this.name = "ControlRequestError";+ }+}++export const NO_SECRET_PENDING = "Nothing is waiting for a secret.";+export const HUMAN_HAS_CONTROL =+ "A person has control of the computer right now. Wait for them to hand it back before acting.";+export const TAKE_CONTROL_FIRST =+ "Take control before driving the computer yourself.";++/**+ * The wheel, as a state machine.+ *+ * A factory rather than a module-level `let` so a test can have its own, and so two of these cannot+ * accidentally share state. `now` is injected for the same reason: `since` is part of the published+ * state, and a test that cannot control the clock has to either skip it or match it loosely.+ */+export function createControl(+ now: () => string = () => new Date().toISOString(),+) {+ let state: ControlState = {+ holder: "bot",+ since: now(),+ requested: false,+ };++ return {+ /** The current state, as the surface polls it. A copy, so a caller cannot mutate the machine. */+ get(): ControlState {+ return { ...state };+ },++ /**+ * The Bot asking for help.+ *+ * It does not take control: it says it is stuck and why, and a person decides. A Bot that could+ * hand itself to a human could also hand a human a page they never asked to see.+ */+ requestHelp(reason: unknown): ControlState {+ state = {+ ...state,+ requested: true,+ reason:+ typeof reason === "string" && reason.trim()+ ? reason.trim()+ : "The assistant needs a person to continue.",+ };+ return this.get();+ },++ /** The Bot asking for one value it must not be told, naming the field it goes in. */+ requestSecret(input: {+ label?: unknown;+ ref?: unknown;+ snapshotId?: unknown;+ }): ControlState {+ if (typeof input.ref !== "string" || !input.ref.trim()) {+ throw new ControlRequestError(+ "Say which field the value goes in, using a ref from your snapshot.",+ );+ }+ state = {+ ...state,+ secretWanted:+ typeof input.label === "string" && input.label.trim()+ ? input.label.trim()+ : "the value this page is asking for",+ secretRef: input.ref.trim(),+ secretSnapshotId:+ typeof input.snapshotId === "number" ? input.snapshotId : undefined,+ };+ return this.get();+ },++ /**+ * The pending secret request, or null.+ *+ * Read before typing so the caller can refuse when nothing asked for one: this is what keeps the+ * masked box from being a general-purpose way to type into the page.+ */+ pendingSecret(): { ref: string; snapshotId?: number } | null {+ if (!state.secretWanted || !state.secretRef) return null;+ return { ref: state.secretRef, snapshotId: state.secretSnapshotId };+ },++ /**+ * The secret landed, so the request is closed.+ *+ * Called only after the value reaches the field. A failure leaves the request open so the person+ * can try again.+ */+ secretSupplied(): void {+ state = {+ ...state,+ secretWanted: undefined,+ secretRef: undefined,+ secretSnapshotId: undefined,+ };+ },++ /**+ * A person taking the wheel.+ *+ * `reason` survives, because it is the thing they were just asked to do. Any pending secret is+ * cleared: a person with full browser control can type the password into the page, and a masked+ * box left open behind them no longer corresponds to an active request.+ */+ take(): ControlState {+ state = {+ holder: "human",+ since: now(),+ reason: state.reason,+ requested: false,+ };+ return this.get();+ },++ /**+ * A person handing back.+ *+ * `reason` is dropped: it described the thing the person was asked to do, and once they have done+ * it, leaving it set would have the surface still showing the old request. Any pending secret goes+ * with it, a person who took the whole wheel and handed it back has dealt with the login, and a+ * secret box left open afterwards is asking for a password nothing is waiting for.+ */+ release(): ControlState {+ state = {+ holder: "bot",+ since: now(),+ requested: false,+ };+ return this.get();+ },++ /**+ * The Bot may not act while a person holds the wheel.+ *+ * Refused rather than queued. A queued click lands after the person has moved on and is worse than+ * a refusal, which the Bot can explain and wait out.+ */+ assertBotMayAct(): void {+ if (state.holder === "human") throw new ControlError(HUMAN_HAS_CONTROL);+ },++ /** Whether a person's input should be applied. The socket being open is not permission. */+ humanMayDrive(): boolean {+ return state.holder === "human";+ },+ };+}++export type Control = ReturnType<typeof createControl>;diff --git a/agent-computer/src/egress.ts b/agent-computer/src/egress.tsnew file mode 100644index 00000000..12b9261b--- /dev/null+++ b/agent-computer/src/egress.ts@@ -0,0 +1,88 @@+/**+ * Where a Bot's traffic leaves from.+ *+ * Per-Bot egress identity makes traffic attributable to the Bot that caused it. With a distinct+ * upstream proxy per Bot, the far side sees a different address for each Bot and can enforce network+ * rules alongside application policy.+ *+ * This does not anonymise anything and it is not a security boundary by itself. It+ * gives the far side a stable, per-Bot address to allow-list or attribute, which is what a security+ * team actually asks for. A Bot with no proxy configured goes out directly, which is the right default+ * for a laptop and the wrong one for a deployment that cares.+ *+ * This module has no Playwright import, so proxy parsing tests can run outside the browser image.+ */++/** A proxy as Playwright wants it: credentials separated from the URL. */+export type Egress = {+ server: string;+ username?: string;+ password?: string;+};++/**+ * The environment variable naming a Bot's proxy.+ *+ * Upper-cased with anything unusual replaced, because a bot id is a free-form string and an+ * environment variable name is not. `sales-bot` reads `EGRESS_PROXY_SALES_BOT`.+ */+export function egressVariableFor(botId: string): string {+ return `EGRESS_PROXY_${botId.replace(/[^a-zA-Z0-9]/g, "_").toUpperCase()}`;+}++/**+ * Resolve a Bot's proxy from the environment, or null for direct.+ *+ * `EGRESS_PROXY_<BOT>` names one Bot's proxy; `EGRESS_PROXY_DEFAULT` covers the rest.+ */+export function egressFor(+ botId: string,+ env: Record<string, string | undefined>,+): Egress | null {+ const raw = env[egressVariableFor(botId)] ?? env.EGRESS_PROXY_DEFAULT;+ if (!raw?.trim()) return null;++ // Credentials commonly arrive inside the URL, which is how proxies are handed out. They are split+ // out so that the server string this returns can be shown to a person without leaking a password.+ try {+ const url = new URL(raw.trim());+ const username = url.username+ ? decodeURIComponent(url.username)+ : undefined;+ const password = url.password+ ? decodeURIComponent(url.password)+ : undefined;+ url.username = "";+ url.password = "";+ return {+ server: url.toString().replace(/\/$/, ""),+ ...(username ? { username } : {}),+ ...(password ? { password } : {}),+ };+ } catch {+ // Not a URL. Passed through as a bare `host:port`, which Playwright also accepts, so an operator+ // who writes the obvious thing is not told they are wrong.+ return { server: raw.trim() };+ }+}++/**+ * The label for a Bot's egress, for people and for the admin list.+ *+ * Host only. A proxy URL routinely carries a password, and this string is rendered in a browser and+ * returned by an API.+ */+export function egressLabel(+ botId: string,+ env: Record<string, string | undefined>,+): string | null {+ const proxy = egressFor(botId, env);+ if (!proxy) return null;+ try {+ // `||` handles bare `proxy.internal:8080`, which URL parses as a scheme plus path and an empty+ // host rather than throwing.+ return new URL(proxy.server).host || proxy.server;+ } catch {+ return proxy.server;+ }+}diff --git a/agent-computer/tests/egress.test.ts b/agent-computer/tests/egress.test.tsnew file mode 100644index 00000000..53447081--- /dev/null+++ b/agent-computer/tests/egress.test.ts@@ -0,0 +1,88 @@+import { describe, expect, test } from "bun:test";+import { egressFor, egressLabel, egressVariableFor } from "../src/egress";++/**+ * Per-Bot egress, tested on the paths an operator will actually take.+ *+ * The case that matters most is the last one: a proxy URL usually carries a password, and the label is+ * rendered on an admin page and returned by an API. A test that only checked the happy parse would+ * have been perfectly green while publishing credentials.+ */++describe("naming the variable", () => {+ test("a bot id becomes a usable environment variable name", () => {+ expect(egressVariableFor("sales-bot")).toBe("EGRESS_PROXY_SALES_BOT");+ // A bot id is a free-form string and an environment variable name is not.+ expect(egressVariableFor("Sales Bot #2")).toBe("EGRESS_PROXY_SALES_BOT__2");+ });+});++describe("resolving a Bot's proxy", () => {+ test("no configuration means direct, not a broken proxy", () => {+ expect(egressFor("sales", {})).toBeNull();+ expect(egressLabel("sales", {})).toBeNull();+ });++ test("blank configuration is treated as absent", () => {+ // An operator who sets the variable and leaves it empty means "no proxy". Passing "" to Playwright+ // as a server would fail every request instead.+ expect(egressFor("sales", { EGRESS_PROXY_SALES: " " })).toBeNull();+ });++ test("the Bot's own variable wins over the default", () => {+ const env = {+ EGRESS_PROXY_DEFAULT: "http://shared.proxy:8080",+ EGRESS_PROXY_SALES: "http://sales.proxy:8080",+ };+ expect(egressFor("sales", env)?.server).toBe("http://sales.proxy:8080");+ // And a Bot without its own falls back, so one variable covers a fleet.+ expect(egressFor("research", env)?.server).toBe("http://shared.proxy:8080");+ });++ test("credentials in the URL are split out, as Playwright wants them", () => {+ const proxy = egressFor("sales", {+ EGRESS_PROXY_SALES: "http://bot:[email protected]:8080",+ });+ expect(proxy).toEqual({+ server: "http://proxy.internal:8080",+ username: "bot",+ password: "s3cret",+ });+ });++ test("percent-encoded credentials are decoded", () => {+ // A password with an @ or a colon in it has to be encoded to fit in a URL, and handing Playwright+ // the still-encoded form authenticates with the wrong password and looks like a proxy fault.+ const proxy = egressFor("sales", {+ EGRESS_PROXY_SALES: "http://bot:p%40ss%[email protected]:8080",+ });+ expect(proxy?.password).toBe("p@ss:word");+ });++ test("a bare host:port is accepted rather than rejected", () => {+ // What an operator writes when they are not thinking about URLs. Playwright accepts it too.+ expect(+ egressFor("sales", { EGRESS_PROXY_SALES: "proxy.internal:8080" }),+ ).toEqual({+ server: "proxy.internal:8080",+ });+ });+});++describe("what gets shown to people", () => {+ test("the label is the host only, never the credentials", () => {+ // The label goes into an admin page and an API response. Returning the+ // server string verbatim would publish the password to anyone who can read either.+ const env = { EGRESS_PROXY_SALES: "http://bot:[email protected]:8080" };+ const label = egressLabel("sales", env);+ expect(label).toBe("proxy.internal:8080");+ expect(label).not.toContain("s3cret");+ expect(label).not.toContain("bot:");+ });++ test("a bare host:port labels as itself", () => {+ expect(+ egressLabel("sales", { EGRESS_PROXY_SALES: "proxy.internal:8080" }),+ ).toBe("proxy.internal:8080");+ });+});diff --git a/agent-computer/tests/workspace.test.ts b/agent-computer/tests/workspace.test.tsnew file mode 100644index 00000000..47eb97fb--- /dev/null+++ b/agent-computer/tests/workspace.test.ts@@ -0,0 +1,235 @@+import { afterEach, beforeEach, describe, expect, test } from "bun:test";+import { mkdir, mkdtemp, rm, symlink, writeFile } from "node:fs/promises";+import { tmpdir } from "node:os";+import { join } from "node:path";+import {+ createWorkspace,+ WorkspaceFileError,+ WorkspacePathError,+} from "../src/workspace";++/**+ * The confinement, exercised against a real filesystem.+ *+ * Uses a real temporary directory rather than a mocked fs: two of the three layers of protection here+ * only mean anything against real inodes. A symlink test with a fake filesystem tests the fake.+ *+ * The escape attempts below are the ones an actual attempt would use, in the order it would use them,+ * and each one has to be tried with the guard in its shipping configuration. A deny-list test that+ * never runs with the escape hatch on proves nothing about the configuration people actually use.+ */++let root: string;+let outside: string;++beforeEach(async () => {+ const base = await mkdtemp(join(tmpdir(), "openbot-workspace-"));+ root = join(base, "workspace");+ outside = join(base, "outside");+ await mkdir(root, { recursive: true });+ await mkdir(outside, { recursive: true });+ await writeFile(join(outside, "secret.txt"), "a private key", "utf8");+});++afterEach(async () => {+ await rm(join(root, ".."), { recursive: true, force: true });+});++function workspace() {+ return createWorkspace(root);+}++describe("reading and writing inside the workspace", () => {+ test("writes a file and reads it back", async () => {+ const ws = workspace();+ const written = await ws.write("notes.md", "# Findings\nAll good.");+ expect(written).toMatchObject({ path: "notes.md", appended: false });++ const read = await ws.read("notes.md");+ expect(read.text).toBe("# Findings\nAll good.");+ expect(read.truncated).toBe(false);+ });++ test("creates parent directories inside the workspace", async () => {+ const ws = workspace();+ await ws.write("reports/august/summary.csv", "a,b\n1,2\n");+ expect((await ws.read("reports/august/summary.csv")).text).toBe(+ "a,b\n1,2\n",+ );+ });++ test("appends when asked, and overwrites when not", async () => {+ const ws = workspace();+ await ws.write("log.txt", "one\n");+ await ws.write("log.txt", "two\n", { append: true });+ expect((await ws.read("log.txt")).text).toBe("one\ntwo\n");++ await ws.write("log.txt", "fresh\n");+ expect((await ws.read("log.txt")).text).toBe("fresh\n");+ });++ test("a read is bounded and says so", async () => {+ const ws = createWorkspace(root, {+ readBytes: 10,+ writeBytes: 1000,+ listEntries: 500,+ });+ await ws.write("long.txt", "0123456789ABCDEF");+ const read = await ws.read("long.txt");+ expect(read.text).toBe("0123456789");+ expect(read.truncated).toBe(true);+ // The true size is reported even though the contents were cut, so the Bot can say so rather+ // than believing it has the whole file.+ expect(read.bytes).toBe(16);+ });++ test("a write that exceeds the limit is refused before it touches the disk", async () => {+ const ws = createWorkspace(root, {+ readBytes: 1000,+ writeBytes: 8,+ listEntries: 500,+ });+ await expect(ws.write("big.txt", "far too long")).rejects.toThrow(+ WorkspaceFileError,+ );+ await expect(ws.read("big.txt")).rejects.toThrow();+ });++ test("reading something that is not there says so plainly", async () => {+ await expect(workspace().read("nope.txt")).rejects.toThrow(+ WorkspaceFileError,+ );+ });++ test("reading a directory is refused rather than returning nonsense", async () => {+ const ws = workspace();+ await ws.write("folder/file.txt", "x");+ await expect(ws.read("folder")).rejects.toThrow(WorkspaceFileError);+ });+});++describe("listing the workspace", () => {+ test("lists files and folders, recursively, relative to the root", async () => {+ const ws = workspace();+ await ws.write("notes.md", "top level");+ await ws.write("reports/august/summary.csv", "nested");++ const listing = await ws.list();+ const paths = listing.entries.map((e) => e.path).sort();+ // Folders included, so a Bot can see the shape rather than only the leaves.+ expect(paths).toEqual([+ "notes.md",+ "reports",+ "reports/august",+ "reports/august/summary.csv",+ ]);+ expect(listing.truncated).toBe(false);+ });++ test("reports sizes for files and marks folders", async () => {+ const ws = workspace();+ await ws.write("a/b.txt", "12345");+ const byPath = new Map((await ws.list()).entries.map((e) => [e.path, e]));+ expect(byPath.get("a")).toMatchObject({ kind: "folder" });+ expect(byPath.get("a/b.txt")).toMatchObject({ kind: "file", bytes: 5 });+ });++ test("an empty workspace lists nothing, rather than failing", async () => {+ // The behaviour that matters: a Bot must be able to tell "no files" from "I could not look".+ const listing = await workspace().list();+ expect(listing.entries).toEqual([]);+ });++ test("can list a subfolder", async () => {+ const ws = workspace();+ await ws.write("reports/one.txt", "1");+ await ws.write("elsewhere/two.txt", "2");+ const paths = (await ws.list("reports")).entries.map((e) => e.path);+ expect(paths).toEqual(["reports/one.txt"]);+ });++ test("listing is bounded and says when it was cut", async () => {+ const ws = createWorkspace(root, {+ readBytes: 1000,+ writeBytes: 1000,+ listEntries: 3,+ });+ for (const n of [1, 2, 3, 4, 5]) await ws.write(`f${n}.txt`, "x");+ const listing = await ws.list();+ expect(listing.entries).toHaveLength(3);+ expect(listing.truncated).toBe(true);+ });++ test("listing cannot escape the workspace either", async () => {+ await expect(workspace().list("../outside")).rejects.toThrow(+ WorkspacePathError,+ );+ await expect(workspace().list("/etc")).rejects.toThrow(WorkspacePathError);+ });++ test("listing a file rather than a folder says so", async () => {+ const ws = workspace();+ await ws.write("notes.md", "x");+ await expect(ws.list("notes.md")).rejects.toThrow(WorkspaceFileError);+ });+});++describe("escaping the workspace", () => {+ test.each([+ ["parent traversal", "../outside/secret.txt"],+ ["deep traversal", "../../../../etc/passwd"],+ ["traversal in the middle", "reports/../../outside/secret.txt"],+ ["absolute path", "/etc/passwd"],+ ["absolute path into the sibling", "/tmp"],+ ["backslash traversal", "..\\outside\\secret.txt"],+ ["bare parent", ".."],+ ])("refuses %s", async (_label, path) => {+ await expect(workspace().read(path)).rejects.toThrow(WorkspacePathError);+ await expect(workspace().write(path, "owned")).rejects.toThrow(+ WorkspacePathError,+ );+ });++ test("refuses to read THROUGH a symlink that points outside", async () => {+ // The layer people miss. This path contains no "..", is not absolute, and resolves inside the+ // workspace lexically. Only following the link reveals where it goes.+ await symlink(join(outside, "secret.txt"), join(root, "innocent.txt"));+ await expect(workspace().read("innocent.txt")).rejects.toThrow(+ WorkspacePathError,+ );+ });++ test("refuses to write THROUGH a symlinked directory that points outside", async () => {+ await symlink(outside, join(root, "escape"));+ await expect(workspace().write("escape/owned.txt", "x")).rejects.toThrow(+ WorkspacePathError,+ );+ });++ test("a symlink pointing back INSIDE the workspace still works", async () => {+ // The guard must confine, not merely forbid symlinks: refusing every link would be easier and+ // would break legitimate use.+ const ws = workspace();+ await ws.write("real/data.txt", "inside");+ await symlink(join(root, "real"), join(root, "alias"));+ expect((await ws.read("alias/data.txt")).text).toBe("inside");+ });++ test("a sibling directory sharing the root's name prefix is still outside", async () => {+ // `/tmp/x/workspace-evil` shares a string prefix with `/tmp/x/workspace`, so a containment check+ // written with startsWith would let it through.+ const evil = `${root}-evil`;+ await mkdir(evil, { recursive: true });+ await writeFile(join(evil, "loot.txt"), "nope", "utf8");+ await expect(+ workspace().read("../workspace-evil/loot.txt"),+ ).rejects.toThrow(WorkspacePathError);+ });++ test("an empty or blank path is refused", async () => {+ await expect(workspace().read("")).rejects.toThrow(WorkspacePathError);+ await expect(workspace().write(" ", "x")).rejects.toThrow(+ WorkspacePathError,+ );+ });+});diff --git a/agent-computer/tsconfig.json b/agent-computer/tsconfig.jsonnew file mode 100644index 00000000..1172f877--- /dev/null+++ b/agent-computer/tsconfig.json@@ -0,0 +1,7 @@+{+ "extends": "../tsconfig.base.json",+ "compilerOptions": {+ "types": ["bun"]+ },+ "include": ["src"]+}diff --git a/agent-langgraph/bun.lock b/agent-langgraph/bun.locknew file mode 100644index 00000000..466f3dd5--- /dev/null+++ b/agent-langgraph/bun.lock@@ -0,0 +1,97 @@+{+ "lockfileVersion": 1,+ "configVersion": 1,+ "workspaces": {+ "": {+ "name": "@openbot/agent-langgraph",+ "dependencies": {+ "@ag-ui/core": "0.0.57",+ "@ag-ui/encoder": "0.0.57",+ "@langchain/anthropic": "^1.5.6",+ "@langchain/core": "^1.2.8",+ "@langchain/google-genai": "^2.2.0",+ "@langchain/langgraph": "^1.4.10",+ "@langchain/openai": "^1.5.8",+ },+ },+ },+ "packages": {+ "@ag-ui/core": ["@ag-ui/[email protected]", "", { "dependencies": { "zod": "^3.22.4" } }, "sha512-gho1OWjNE6E3Rl7ZEZ1wr2CEpUHjLFU0FqzCZZk439TicLu+BfLCMkMokB07bMGlRmbJ60hM6LW60iOVauCx+Q=="],++ "@ag-ui/encoder": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.57", "@ag-ui/proto": "0.0.57" } }, "sha512-ifD9NctR4xyPDR58xF9GK1bj/S8oECFkTeDfuYD8tXdbcOstIJ2TOqU2zhiCKnw7Vw+zR9Qv3TbsM9E7Gi9X3Q=="],++ "@ag-ui/proto": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.57", "@bufbuild/protobuf": "^2.2.5", "@protobuf-ts/protoc": "^2.11.1" } }, "sha512-pPENOZt0P6ibH8sCTgq05wLYXi5t3P9B5r/1bWYehXjUxtyOdnukSlWM++SsCIwUXsQdm/b3aBgGjEeTF7RenA=="],++ "@anthropic-ai/sdk": ["@anthropic-ai/[email protected]", "", { "dependencies": { "json-schema-to-ts": "^3.1.1", "standardwebhooks": "^1.0.0" }, "peerDependencies": { "zod": "^3.25.0 || ^4.0.0" }, "optionalPeers": ["zod"], "bin": { "anthropic-ai-sdk": "bin/cli" } }, "sha512-BJrFIVyjNuU8lfDyIJTvlRYzgQg+zEl78BxE7fq8esULsGz9IRQvGtW5spq3tydmtjQb/GFdooKGdGsetpx+lQ=="],++ "@babel/runtime": ["@babel/[email protected]", "", {}, "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw=="],++ "@bufbuild/protobuf": ["@bufbuild/[email protected]", "", {}, "sha512-C3UGsiCwSprE2NKIIFA3hCDlpXTMCAXRZuEVp88L1GY36Y41+rYL5fryE+nOFhp4p4JPQvdV8PQ4DWgHgeTE+w=="],++ "@cfworker/json-schema": ["@cfworker/[email protected]", "", {}, "sha512-gAmrUZSGtKc3AiBL71iNWxDsyUC5uMaKKGdvzYsBoTW/xi42JQHl7eKV2OYzCUqvc+D2RCcf7EXY2iCyFIk6og=="],++ "@google/generative-ai": ["@google/[email protected]", "", {}, "sha512-MqO+MLfM6kjxcKoy0p1wRzG3b4ZZXtPI+z2IE26UogS2Cm/XHO+7gGRBh6gcJsOiIVoH93UwKvW4HdgiOZCy9Q=="],++ "@langchain/anthropic": ["@langchain/[email protected]", "", { "dependencies": { "@anthropic-ai/sdk": "^0.115.0", "zod": "^3.25.76 || ^4" }, "peerDependencies": { "@langchain/core": "^1.2.8" } }, "sha512-k0L/x1RIGw1XhOuK/ML80YYmQGWRRzyvhTf09IgNusImBEBe10kzuvQaS/UgoyyV8zQnPhnkm9AuYAqn76BuWw=="],++ "@langchain/core": ["@langchain/[email protected]", "", { "dependencies": { "@cfworker/json-schema": "^4.0.2", "@standard-schema/spec": "^1.1.0", "js-tiktoken": "^1.0.12", "langsmith": ">=0.5.0 <1.0.0", "mustache": "^4.2.0", "p-queue": "^6.6.2", "zod": "^3.25.76 || ^4" } }, "sha512-ppi2UaCYKqM4LEY8NWQ/JZ0Of0MAngHRvclceVeEQklcD/M6QKanlHPWblDnLO2m4vz7987b1Z4r33Ps6lf/ig=="],++ "@langchain/google-genai": ["@langchain/[email protected]", "", { "dependencies": { "@google/generative-ai": "^0.24.1" }, "peerDependencies": { "@langchain/core": "^1.2.0" } }, "sha512-1mDqbmB6+iC6ZBQY15r5xJg9wPErnQ774inpKh6qi6BrrjadDwaPHoklJW5IXU94edKiDpm1akIzJCrQDWe6yA=="],++ "@langchain/langgraph": ["@langchain/[email protected]", "", { "dependencies": { "@langchain/langgraph-checkpoint": "^1.1.3", "@langchain/langgraph-sdk": "~1.9.29", "@langchain/protocol": "^0.0.18", "@standard-schema/spec": "1.1.0" }, "peerDependencies": { "@langchain/core": "^1.1.48", "zod": "^3.25.32 || ^4.2.0" } }, "sha512-QBNbbIWDp3pcyvaINGEYHdekGYSQm6ZYuC9/h7arEAZckAl5mRLaoRGw5t61V4Bf+rspEj2VcylqNAN3fcdBNQ=="],++ "@langchain/langgraph-checkpoint": ["@langchain/[email protected]", "", { "peerDependencies": { "@langchain/core": "^1.1.48" } }, "sha512-wgzdQNeEsdw1e+4lvlj0tdq/RYR/k1vPin10g0ymGoehZDDgd9nvIllGXSXN4TFgF9sf5qQP/KTkOcLfeseIhA=="],++ "@langchain/langgraph-sdk": ["@langchain/[email protected]", "", { "dependencies": { "@langchain/protocol": "^0.0.18", "@types/json-schema": "^7.0.15", "p-queue": "^9.0.1", "p-retry": "^7.1.1" }, "peerDependencies": { "@langchain/core": "^1.1.48", "react": "^18 || ^19", "react-dom": "^18 || ^19", "svelte": "^4.0.0 || ^5.0.0", "vue": "^3.0.0" }, "optionalPeers": ["react", "react-dom", "svelte", "vue"] }, "sha512-W+ccugM5EzBHvaOieyYxlSbhAy6HWF8Tyn6b/BlTWuFd8xtcnQOz2WuFyofcAc9+aQHE+6yHJfIywGOvjxS+bA=="],++ "@langchain/openai": ["@langchain/[email protected]", "", { "dependencies": { "js-tiktoken": "^1.0.12", "openai": "^6.41.0", "zod": "^3.25.76 || ^4" }, "peerDependencies": { "@langchain/core": "^1.2.8" } }, "sha512-BKzIgWYSXQ03V9F9u46vC12vZjHy8wyOt8H7VUrTWt6VdwSnnxXmjeEUEIkLjpU/bqVkGzHLXGCSMEHYbDSi5Q=="],++ "@langchain/protocol": ["@langchain/[email protected]", "", {}, "sha512-XW1egQtPfsGI41w2AMZNFZrUIwFSQHTjVMZs0OaTpCAvht/QLoaPN8FQcsysMVypOhupG28J29yOorrc70otBQ=="],++ "@protobuf-ts/protoc": ["@protobuf-ts/[email protected]", "", { "bin": { "protoc": "protoc.js" } }, "sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg=="],++ "@stablelib/base64": ["@stablelib/[email protected]", "", {}, "sha512-1bnPQqSxSuc3Ii6MhBysoWCg58j97aUjuCSZrGSmDxNqtytIi0k8utUenAwTZN4V5mXXYGsVUI9zeBqy+jBOSQ=="],++ "@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],++ "@types/json-schema": ["@types/[email protected]", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],++ "base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],++ "eventemitter3": ["[email protected]", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="],++ "fast-sha256": ["[email protected]", "", {}, "sha512-n11RGP/lrWEFI/bWdygLxhI+pVeo1ZYIVwvvPkW7azl/rOy+F3HYRZ2K5zeE9mmkhQppyv9sQFx0JM9UabnpPQ=="],++ "is-network-error": ["[email protected]", "", {}, "sha512-PhBY86zaxNZUuWP6h13Vu5oFe0XY6/UlKzQnYFELzGVHygP3MxmvTfYSG7GN3aIab/iWudSMgjSnG9Dq+nHrgA=="],++ "js-tiktoken": ["[email protected]", "", { "dependencies": { "base64-js": "^1.5.1" } }, "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g=="],++ "json-schema-to-ts": ["[email protected]", "", { "dependencies": { "@babel/runtime": "^7.18.3", "ts-algebra": "^2.0.0" } }, "sha512-+DWg8jCJG2TEnpy7kOm/7/AxaYoaRbjVB4LFZLySZlWn8exGs3A4OLJR966cVvU26N7X9TWxl+Jsw7dzAqKT6g=="],++ "langsmith": ["[email protected]", "", { "dependencies": { "p-queue": "6.6.2" }, "peerDependencies": { "@opentelemetry/api": "*", "@opentelemetry/exporter-trace-otlp-proto": "*", "@opentelemetry/sdk-trace-base": "*", "openai": "*", "ws": ">=7" }, "optionalPeers": ["@opentelemetry/api", "@opentelemetry/exporter-trace-otlp-proto", "@opentelemetry/sdk-trace-base", "openai", "ws"] }, "sha512-dNKtyEiNS6L10qsRGKExQVHoMsRGBJt+xiBHn6G8JxslapedUhXVkvcDkhi00EuiIMeil+RevAVG8k6VM0B9ew=="],++ "mustache": ["[email protected]", "", { "bin": { "mustache": "bin/mustache" } }, "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ=="],++ "openai": ["[email protected]", "", { "peerDependencies": { "@aws-sdk/credential-provider-node": ">=3.972.0 <4", "@smithy/hash-node": ">=4.3.0 <5", "@smithy/signature-v4": ">=5.4.0 <6", "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["@aws-sdk/credential-provider-node", "@smithy/hash-node", "@smithy/signature-v4", "ws", "zod"] }, "sha512-aYCc0C6L864eR6WSYIwQGyXriw/nIyZx0ObvhzOEVuk0zoBDpynjSbrionWI7q65B5H8jJX0DXR9snEzM6bfPg=="],++ "p-finally": ["[email protected]", "", {}, "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="],++ "p-queue": ["[email protected]", "", { "dependencies": { "eventemitter3": "^4.0.4", "p-timeout": "^3.2.0" } }, "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="],++ "p-retry": ["[email protected]", "", { "dependencies": { "is-network-error": "^1.1.0" } }, "sha512-J5ApzjyRkkf601HpEeykoiCvzHQjWxPAHhyjFcEUP2SWq0+35NKh8TLhpLw+Dkq5TZBFvUM6UigdE9hIVYTl5w=="],++ "p-timeout": ["[email protected]", "", { "dependencies": { "p-finally": "^1.0.0" } }, "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg=="],++ "standardwebhooks": ["[email protected]", "", { "dependencies": { "@stablelib/base64": "^1.0.0", "fast-sha256": "^1.3.0" } }, "sha512-BbHGOQK9olHPMvQNHWul6MYlrRTAOKn03rOe4A8O3CLWhNf4YHBqq2HJKKC+sfqpxiBY52pNeesD6jIiLDz8jg=="],++ "ts-algebra": ["[email protected]", "", {}, "sha512-FPAhNPFMrkwz76P7cdjdmiShwMynZYN6SgOujD1urY4oNm80Ou9oMdmbR45LotcKOXoy7wSmHkRFE6Mxbrhefw=="],++ "zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@langchain/langgraph-sdk/p-queue": ["[email protected]", "", { "dependencies": { "eventemitter3": "^5.0.4", "p-timeout": "^7.0.0" } }, "sha512-NXAOdnEe5FsZJfT4oK84lE1Y5cFFdWlRuOo5tww8DyNMxyRXwn39fIkUtNLKppcPC+UYU/bXujNCUGDv01y7CA=="],++ "@langchain/langgraph-sdk/p-queue/eventemitter3": ["[email protected]", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="],++ "@langchain/langgraph-sdk/p-queue/p-timeout": ["[email protected]", "", {}, "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg=="],+ }+}diff --git a/app/components.json b/app/components.jsonnew file mode 100644index 00000000..52a3b2ad--- /dev/null+++ b/app/components.json@@ -0,0 +1,25 @@+{+ "$schema": "https://ui.shadcn.com/schema.json",+ "style": "base-nova",+ "rsc": false,+ "tsx": true,+ "tailwind": {+ "config": "",+ "css": "src/styles.css",+ "baseColor": "neutral",+ "cssVariables": true,+ "prefix": ""+ },+ "iconLibrary": "tabler",+ "rtl": false,+ "menuColor": "default",+ "menuAccent": "subtle",+ "aliases": {+ "components": "@/components",+ "utils": "@/lib/utils",+ "ui": "@/components/ui",+ "lib": "@/lib",+ "hooks": "@/hooks"+ },+ "registries": {}+}diff --git a/app/index.html b/app/index.htmlnew file mode 100644index 00000000..cd14d719--- /dev/null+++ b/app/index.html@@ -0,0 +1,12 @@+<!doctype html>+<html lang="en">+ <head>+ <meta charset="UTF-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />+ <title>OpenBot</title>+ </head>+ <body>+ <div id="root"></div>+ <script type="module" src="/src/main.tsx"></script>+ </body>+</html>diff --git a/app/package.json b/app/package.jsonnew file mode 100644index 00000000..60e4f996--- /dev/null+++ b/app/package.json@@ -0,0 +1,53 @@+{+ "name": "app",+ "license": "MIT",+ "private": true,+ "version": "0.0.0",+ "type": "module",+ "scripts": {+ "build": "vite build",+ "dev": "vite",+ "prebuild": "bun run --cwd .. generate:app-config",+ "predev": "bun run --cwd .. generate:app-config",+ "pretypecheck": "bun run --cwd .. generate:app-config",+ "typecheck": "tsc --noEmit"+ },+ "dependencies": {+ "@ag-ui/core": "0.0.57",+ "@base-ui/react": "^1.6.0",+ "@copilotkit/react-core": "1.67.1",+ "@fontsource-variable/inter": "^5.3.0",+ "@shadcn/react": "^0.3.0",+ "@tabler/icons-react": "^3.36.1",+ "@tanstack/react-form": "^1.33.5",+ "@tanstack/react-query": "^5.101.4",+ "@tanstack/react-router": "^1.170.27",+ "better-auth": "^1.6.27",+ "boring-avatars": "^2.0.4",+ "class-variance-authority": "^0.7.1",+ "clsx": "^2.1.1",+ "motion": "^13.1.0",+ "prompt-area": "^0.6.3",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "shadcn": "^4.17.0",+ "streamdown": "^2.5.0",+ "tailwind-merge": "^3.6.0",+ "tw-animate-css": "^1.4.0",+ "zod": "^4.4.3"+ },+ "devDependencies": {+ "@happy-dom/global-registrator": "^20.11.2",+ "@tailwindcss/vite": "^4.3.3",+ "@tanstack/router-plugin": "^1.168.30",+ "@testing-library/react": "^16.3.2",+ "@testing-library/user-event": "^14.6.4",+ "@types/node": "^26.2.0",+ "@types/react": "^19.2.0",+ "@types/react-dom": "^19.2.0",+ "@vitejs/plugin-react": "^5.0.4",+ "happy-dom": "^20.11.2",+ "tailwindcss": "^4.3.3",+ "vite": "^7.1.12"+ }+}diff --git a/app/src/components/agents/abstract-avatar.tsx b/app/src/components/agents/abstract-avatar.tsxnew file mode 100644index 00000000..b65b039e--- /dev/null+++ b/app/src/components/agents/abstract-avatar.tsx@@ -0,0 +1,25 @@+import Avatar from "boring-avatars";++export function AbstractAvatar({+ name,+ seed,+ size = 40,+}: {+ name: string;+ seed: string;+ size?: number;+}) {+ return (+ <span+ role="img"+ aria-label={name}+ className="inline-flex shrink-0 overflow-hidden rounded-full"+ style={{ height: size, width: size }}+ >+ {/* The drawing carries its own role; hidden so the teammate is announced once, by name. */}+ <span aria-hidden="true" className="contents">+ <Avatar name={seed} size={size} />+ </span>+ </span>+ );+}diff --git a/app/src/components/agents/agent-card.tsx b/app/src/components/agents/agent-card.tsxnew file mode 100644index 00000000..0a76128c--- /dev/null+++ b/app/src/components/agents/agent-card.tsx@@ -0,0 +1,19 @@+import Avatar from "boring-avatars";+import type { AgentProfile } from "@/lib/agents/queries";++export function AgentCard({ agent }: { agent: AgentProfile }) {+ return (+ <div className="h-[180px] bg-foreground/10 rounded-2xl w-[144px] relative overflow-hidden">+ <div className="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2">+ <Avatar name={agent.avatarSeed} size={250} />+ </div>+ <div className="absolute top-0 left-0 w-full h-full bg-background/40 dark:bg-background/50" />+ <div className="absolute top-0 left-0 w-full h-full flex flex-col justify-end p-3 gap-2">+ <span className="text-sm font-medium line-clamp-1">{agent.name}</span>+ <span className="text-xs text-foreground dark:text-foreground/80 line-clamp-3">+ {agent.roleDescription}+ </span>+ </div>+ </div>+ );+}diff --git a/app/src/components/agents/agent-fields.tsx b/app/src/components/agents/agent-fields.tsxnew file mode 100644index 00000000..ccc0b8fd--- /dev/null+++ b/app/src/components/agents/agent-fields.tsx@@ -0,0 +1,313 @@+import { useForm } from "@tanstack/react-form";+import { useState } from "react";+import { Button } from "@/components/ui/button";+import {+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+} from "@/components/ui/field";+import { Input } from "@/components/ui/input";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";+import { Textarea } from "@/components/ui/textarea";+import { type AgentFormValues, agentFormSchema } from "@/lib/agents/form";++/** What the server said when it tried the endpoint. */+type ConnectionVerdict =+ | { ok: true; events: string[] }+ | { ok: false; reason: string };++export function AgentFields({+ defaultValues,+ hasAuth = false,+ submitLabel,+ onSubmit,+ error,+ onCancel,+}: {+ defaultValues: AgentFormValues;+ /** Whether this teammate already has a key, so the field can say so without showing it. */+ hasAuth?: boolean;+ submitLabel: string;+ onSubmit: (values: AgentFormValues) => Promise<unknown>;+ error?: Error | null;+ onCancel?: () => void;+}) {+ const form = useForm({+ defaultValues,+ validators: { onSubmit: agentFormSchema },+ onSubmit: async ({ value }) => {+ await onSubmit(value);+ },+ });++ const [connection, setConnection] = useState<ConnectionVerdict | null>(null);+ const [testing, setTesting] = useState(false);++ /** Test endpoint reachability from the server, which is what runs will use. */+ const testConnection = async (endpoint: string, key: string) => {+ setTesting(true);+ setConnection(null);+ try {+ const response = await fetch("/api/agents/test-connection", {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ // Include the unsaved key so the test matches the pending form state.+ body: JSON.stringify({+ endpoint,+ ...(key.trim() ? { headers: { Authorization: key.trim() } } : {}),+ }),+ });+ const body = (await response.json().catch(() => null)) as+ | ConnectionVerdict+ | { error?: string }+ | null;+ if (body && "ok" in body) {+ setConnection(body);+ } else {+ setConnection({+ ok: false,+ reason:+ (body as { error?: string } | null)?.error ??+ "The connection could not be tested.",+ });+ }+ } catch {+ setConnection({+ ok: false,+ reason: "The connection could not be tested.",+ });+ } finally {+ setTesting(false);+ }+ };++ return (+ <form+ noValidate+ onSubmit={(event) => {+ event.preventDefault();+ form.handleSubmit();+ }}+ >+ <FieldGroup>+ <form.Field name="name">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Name</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="Expense Manager"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="title">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Title</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="Finance Operations"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="roleDescription">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Role</FieldLabel>+ <Textarea+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="Review receipts, categorize expenses, and prepare reimbursement reports."+ rows={4}+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="visibility">+ {(field) => (+ <Field>+ <FieldLabel htmlFor={field.name}>Visibility</FieldLabel>+ <Select+ onValueChange={(value) =>+ field.handleChange(value as AgentFormValues["visibility"])+ }+ value={field.state.value}+ >+ <SelectTrigger id={field.name}>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectGroup>+ <SelectItem value="private">+ Private, only you can see it+ </SelectItem>+ <SelectItem value="public">+ Public, everybody can see it+ </SelectItem>+ </SelectGroup>+ </SelectContent>+ </Select>+ </Field>+ )}+ </form.Field>+ <form.Field name="endpoint">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>+ Agent endpoint (optional)+ </FieldLabel>+ <div className="flex gap-2">+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => {+ setConnection(null);+ field.handleChange(event.target.value);+ }}+ placeholder="https://your-agent.example.com/ag-ui"+ value={field.state.value}+ />+ <Button+ disabled={!field.state.value || testing}+ onClick={() =>+ void testConnection(+ field.state.value,+ form.getFieldValue("authValue") ?? "",+ )+ }+ type="button"+ variant="outline"+ >+ {testing ? "Testing…" : "Test"}+ </Button>+ </div>+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ {connection ? (+ <p+ className={`text-sm ${connection.ok ? "text-muted-foreground" : "text-destructive"}`}+ role="status"+ >+ {connection.ok+ ? `It answered: ${connection.events.join(", ")}`+ : connection.reason}+ </p>+ ) : (+ <p className="text-muted-foreground text-sm">+ Leave empty to use the built-in Bot. Anything that speaks+ AG-UI works. This server dials your agent, so an agent on+ your own machine has to be reachable from here.+ </p>+ )}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="authValue">+ {(field) => (+ <Field>+ <FieldLabel htmlFor={field.name}>+ Key for that agent (optional)+ </FieldLabel>+ <Input+ autoComplete="off"+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder={+ hasAuth+ ? "A key is set. Type a new one to replace it."+ : "Bearer …"+ }+ // Never repopulated; `hasAuth` communicates that a key exists without exposing it.+ type="password"+ value={field.state.value}+ />+ <p className="text-muted-foreground text-sm">+ Sent as an <code>Authorization</code> header on every run, and+ kept in the credential vault. Leave empty to keep the current+ key.+ </p>+ </Field>+ )}+ </form.Field>+ </FieldGroup>++ {error ? (+ <p className="mt-4 text-sm text-destructive" role="alert">+ {error.message}+ </p>+ ) : null}++ <div className="mt-4 flex gap-2">+ <form.Subscribe+ selector={(state) => [state.canSubmit, state.isSubmitting]}+ >+ {([canSubmit, isSubmitting]) => (+ <Button disabled={!canSubmit || isSubmitting} type="submit">+ {isSubmitting ? "Saving…" : submitLabel}+ </Button>+ )}+ </form.Subscribe>+ {onCancel ? (+ <Button onClick={onCancel} type="button" variant="outline">+ Cancel+ </Button>+ ) : null}+ </div>+ </form>+ );+}diff --git a/app/src/components/agents/new-agent.tsx b/app/src/components/agents/new-agent.tsxnew file mode 100644index 00000000..f4c8f222--- /dev/null+++ b/app/src/components/agents/new-agent.tsx@@ -0,0 +1,35 @@+import { useMutation, useQueryClient } from "@tanstack/react-query";+import { useNavigate } from "@tanstack/react-router";+import { AgentFields } from "@/components/agents/agent-fields";+import { agentInputFrom, emptyAgentForm } from "@/lib/agents/form";+import { createAgentMutationOptions } from "@/lib/agents/mutations";++export function NewAgent() {+ const queryClient = useQueryClient();+ const navigate = useNavigate();+ const createAgent = useMutation(createAgentMutationOptions(queryClient));++ return (+ <div className="mx-auto flex w-full max-w-xl flex-col gap-6 p-8">+ <header>+ <h1 className="text-2xl font-semibold">New teammate</h1>+ <p className="mt-1 text-sm text-muted-foreground">+ The role you write here applies in every channel this teammate works+ in.+ </p>+ </header>++ <AgentFields+ defaultValues={emptyAgentForm}+ error={createAgent.error}+ onSubmit={async (values) => {+ // The panel swaps from the form to the new teammate's profile, and the roster behind it+ // picks up the new card: the next thing to do is start a channel with it.+ const agent = await createAgent.mutateAsync(agentInputFrom(values));+ await navigate({ search: { agent: agent.id }, to: "/agents" });+ }}+ submitLabel="Create teammate"+ />+ </div>+ );+}diff --git a/app/src/components/app-sidebar/channel.tsx b/app/src/components/app-sidebar/channel.tsxnew file mode 100644index 00000000..74314781--- /dev/null+++ b/app/src/components/app-sidebar/channel.tsx@@ -0,0 +1,50 @@+import { Link } from "@tanstack/react-router";+import { memo } from "react";+import { ChannelAvatar } from "../channels/avatar";++/**+ * Memoized roster row. `use-channel-events` preserves unchanged row identity, and+ * `content-visibility` keeps off-screen rows cheap without virtualization.+ */+export const Channel = memo(function Channel({+ channelId,+ participantIds,+ name,+ lastMessage,+ lastMessageAt,+}: {+ channelId: string;+ participantIds: string[];+ name: string;+ lastMessage?: string;+ lastMessageAt?: string;+}) {+ return (+ <Link+ to="/channel/$channelId"+ params={{ channelId }}+ type="button"+ className="flex flex-row py-2 px-2 gap-2 items-center w-full hover:bg-foreground/5 rounded-lg [contain-intrinsic-size:auto_3.25rem] [content-visibility:auto]"+ activeProps={{+ className: "bg-foreground/5",+ }}+ >+ <div className="">+ <ChannelAvatar participantIds={participantIds} size={32} />+ </div>+ <div className="flex-col min-w-0 flex-1">+ <div className="flex flex-row items-center justify-between gap-2">+ <span className="text-[14px] tracking-[-1%] truncate">{name}</span>+ <div className="text-[12px] text-muted-foreground/70">+ {lastMessageAt}+ </div>+ </div>+ <div className="mt-px flex h-4 items-center gap-1.5">+ <span className="min-w-0 flex-1 truncate text-[12px] leading-4 text-muted-foreground">+ {lastMessage}+ </span>+ </div>+ </div>+ </Link>+ );+});diff --git a/app/src/components/channels/avatar.tsx b/app/src/components/channels/avatar.tsxnew file mode 100644index 00000000..ae5de378--- /dev/null+++ b/app/src/components/channels/avatar.tsx@@ -0,0 +1,56 @@+import Avatar from "boring-avatars";+import { memo } from "react";++/**+ * Memoized roster avatar. Row updates usually change preview/timestamp only, and+ * `use-channel-events` preserves participant id arrays for unchanged rows.+ *+ * `size-full` opts the generated SVG out of ancestor icon selectors such as+ * `[&_svg:not([class*='size-'])]:size-4`.+ */+export const ChannelAvatar = memo(function ChannelAvatar({+ participantIds,+ size = 32,+}: {+ participantIds: string[];+ size?: number;+}) {+ const channelSize = participantIds?.length;++ if (channelSize === 1) {+ return (+ <div className="" style={{ height: size, width: size }}>+ <Avatar className="size-full" name={participantIds[0]} size={size} />+ </div>+ );+ }++ const firstThree = participantIds.slice(0, 3);++ return (+ <div+ className="flex flex-row items-center"+ style={{ height: size, width: size }}+ >+ {firstThree.map((c, i) => {+ return (+ <div+ key={c}+ className="shrink-0 border-2 border-sidebar rounded-full flex items-center justify-center"+ style={{+ height: size / (firstThree.length / 2),+ width: size / (firstThree.length / 2),+ transform: `translateX(${i * -75}%)`,+ }}+ >+ <Avatar+ className="size-full"+ name={c}+ size={size / (firstThree.length / 2)}+ />+ </div>+ );+ })}+ </div>+ );+});diff --git a/app/src/components/channels/chat-messages.ts b/app/src/components/channels/chat-messages.tsnew file mode 100644index 00000000..aba4af7e--- /dev/null+++ b/app/src/components/channels/chat-messages.ts@@ -0,0 +1,72 @@+import type { Message, ToolCall } from "@ag-ui/core";++/**+ * Transcript projection that pairs assistant tool calls with later tool-result messages.+ */++export type VisibleChatItem =+ | { kind: "text"; id: string; role: "user" | "assistant"; text: string }+ | {+ kind: "tool";+ id: string;+ toolCall: ToolCall;+ /** The result, once there is one. Absent means the call is still in flight. */+ result?: string;+ };++/** A tool result, as it arrives, its own message, pointing back at the call it answers. */+type ToolResultMessage = { role: "tool"; toolCallId: string; content?: string };++function isToolResult(+ message: Readonly<Message>,+): message is Readonly<Message> & ToolResultMessage {+ return message.role === "tool" && "toolCallId" in message;+}++export function toVisibleChatItems(+ messages: ReadonlyArray<Readonly<Message>>,+): VisibleChatItem[] {+ // Gather results first so calls render with their current completion state in the same pass.+ const results = new Map<string, string | undefined>();+ for (const message of messages) {+ if (isToolResult(message)) results.set(message.toolCallId, message.content);+ }++ return messages.flatMap((message): VisibleChatItem[] => {+ if (message.role === "assistant") {+ const items: VisibleChatItem[] = [];+ if (message.content) {+ items.push({+ kind: "text",+ id: message.id,+ role: "assistant",+ text: message.content,+ });+ }+ for (const toolCall of message.toolCalls ?? []) {+ items.push({+ kind: "tool",+ // One assistant message can carry multiple tool calls.+ id: toolCall.id,+ toolCall,+ ...(results.has(toolCall.id)+ ? { result: results.get(toolCall.id) }+ : {}),+ });+ }+ return items;+ }++ if (message.role !== "user") return [];++ const text =+ typeof message.content === "string"+ ? message.content+ : message.content+ .filter((part) => part.type === "text")+ .map((part) => part.text)+ .join("\n");++ return text ? [{ kind: "text", id: message.id, role: "user", text }] : [];+ });+}diff --git a/app/src/components/channels/chat-transcript.tsx b/app/src/components/channels/chat-transcript.tsxnew file mode 100644index 00000000..20d4c0c7--- /dev/null+++ b/app/src/components/channels/chat-transcript.tsx@@ -0,0 +1,445 @@+import type { Message } from "@ag-ui/core";+import { IconBox } from "@tabler/icons-react";+import { useRenderToolCall } from "@copilotkit/react-core/v2";+import { motion, useReducedMotion } from "motion/react";+import { memo, useEffect, useMemo, useRef } from "react";+import { Streamdown } from "streamdown";+import { markdownComponents } from "@/lib/markdown";+import { EASE_OUT, ENTRANCE_SECONDS } from "@/lib/motion";+import { Bubble, BubbleContent } from "@/components/ui/bubble";+import { MessageContent, Message as MessageRow } from "@/components/ui/message";+import {+ MessageScroller,+ MessageScrollerButton,+ MessageScrollerContent,+ MessageScrollerItem,+ MessageScrollerProvider,+ MessageScrollerViewport,+} from "@/components/ui/message-scroller";+import { toVisibleChatItems } from "./chat-messages";+import { ToolLine } from "./tool-line";+import { ToolRenderBoundary } from "./tool-boundary";++type ChatTranscriptProps = {+ busy?: boolean;+ /** Comma-separated `/` command names, used to tell a skill chip from a leading slash. */+ commandNames?: string;+ messages: ReadonlyArray<Readonly<Message>>;+};++/**+ * Split a person's message into the skill they invoked and the rest of what they typed.+ *+ * ONLY A KNOWN COMMAND COUNTS. "/etc/hosts is broken" is a sentence, not a skill, and drawing a chip+ * around it would invent a thing that never happened. The names come from the same list the `/` menu+ * was built from, so this stays true as skills are granted and revoked.+ *+ * The trigger only opens at the start of a line, so the chip is the first token or there is none.+ */+function splitSkillChip(+ text: string,+ commandNames: string,+): { chip: string; rest: string } | null {+ const match = /^\/([a-z0-9][a-z0-9-]*)(\s|$)/.exec(text);+ if (!match) {+ return null;+ }+ const known = commandNames.split(",").filter(Boolean);+ if (!known.includes(match[1])) {+ return null;+ }+ return { chip: match[1], rest: text.slice(match[0].length) };+}++/**+ * The Bot has the turn and has produced nothing yet.+ *+ * THE GAP THIS FILLS IS THE WORST ONE IN THE CONVERSATION. Between pressing send and the first token+ * there was `aria-busy` and nothing else: announced to a screen reader, invisible to everybody else.+ * A person who has just asked something watches their own message sit there, and a Bot that is+ * thinking is indistinguishable from a Bot that failed silently — which this app has shipped before.+ *+ * It borrows the shimmer a running tool line uses, so "working on it" reads the same whether the+ * work is a tool call or a model that has not spoken yet.+ */+function Thinking() {+ return (+ <p+ className="tool-line-running text-muted-foreground text-sm"+ // `status` rather than `alert`: this is progress, not something that interrupts what somebody+ // is doing. The text says it, so a screen reader is told the same thing the shimmer implies.+ role="status"+ >+ Thinking+ </p>+ );+}++/**+ * How many of the newest turns cascade when a channel is opened, and how far apart.+ *+ * The tail rather than the head: opening a channel lands you at the bottom, so these are the ones+ * actually on screen. Staggering from the top of a long history would spend the whole budget on+ * messages nobody can see and leave the visible ones arriving last.+ *+ * Twelve at 40ms is 440ms of cascade before the last one starts. Past roughly half a second this+ * stops reading as settling and starts reading as waiting.+ */+const FIRST_PAINT_STAGGER_COUNT = 12;+const FIRST_PAINT_STAGGER_SECONDS = 0.04;++/**+ * Decide, once per message, whether it waits its turn.+ *+ * FROZEN PER ID ON PURPOSE. `delay` is a prop on a memoised component, so a value that changed+ * between renders would break the memo that makes the streaming path cheap — and worse, a message+ * whose delay changed could replay its entrance mid-stream. Each id is decided the first time it is+ * seen and never revisited.+ *+ * `settled` flips after the first render that has any items, which is NOT the first render: history+ * is restored asynchronously, so a channel's transcript is empty for a beat. Anything appearing+ * after that is a live turn and is given no delay at all.+ */+function createFirstPaintDelays() {+ const decided = new Map<string, number>();+ let settled = false;++ return {+ settle() {+ settled = true;+ },+ delayFor(id: string, index: number, total: number): number {+ const known = decided.get(id);+ if (known !== undefined) {+ return known;+ }+ const offset = total - FIRST_PAINT_STAGGER_COUNT;+ const place = index - Math.max(0, offset);+ const delay =+ settled || place < 0 ? 0 : place * FIRST_PAINT_STAGGER_SECONDS;+ decided.set(id, delay);+ return delay;+ },+ };+}++/**+ * A turn arriving in the transcript.+ *+ * WHY IT ANIMATES AT ALL: a message currently pops into existence at full opacity, and the eye has+ * nothing to follow from the composer to the transcript. This bridges that, and nothing more — it+ * is not decoration on something the reader is trying to read.+ *+ * IT RUNS ONCE, ON MOUNT. `initial`/`animate` fire when the element mounts, and the memoised parents+ * mean a streaming answer re-renders without remounting — so the fade plays when the message first+ * appears and never again while its text is still arriving. Animating per chunk would strobe.+ *+ * TRANSFORM AND OPACITY ONLY, so the scroller can still measure. `MessageScroller` sizes items and+ * places its anchor and spacer from layout; a transform is composited and changes no layout box, so+ * a message can fade in without moving the thing the scroller just measured.+ *+ * The full transform string rather than motion's `y` shorthand: the shorthand is not hardware+ * accelerated and drops frames exactly when the main thread is busy, which here is while a reply is+ * streaming.+ *+ * STAGGERED ONLY ON THE FIRST PAINT OF A CHANNEL. A turn sent mid-conversation arrives alone and+ * must not wait behind anything, so `delay` is zero for it. Opening a channel is the one moment the+ * whole history mounts at once, and cascading the last few reads as the conversation settling+ * rather than as a page appearing all at once. `createFirstPaintDelays` decides which is which.+ */+function Arriving({+ children,+ delay = 0,+}: {+ children: React.ReactNode;+ delay?: number;+}) {+ const shouldReduceMotion = useReducedMotion();++ return (+ <motion.div+ animate={{ opacity: 1, transform: "translateY(0px)" }}+ /*+ * `data-slot` IS LOAD-BEARING, NOT DECORATION. `MessageContent` right-aligns a person's own+ * message with `group-data-[align=end]/message:*:data-slot:self-end` — a selector that reaches+ * DIRECT CHILDREN CARRYING A data-slot. Wrapping the bubble in a plain div made this the direct+ * child, the selector matched nothing, and every message a person sent quietly moved to the+ * left column and read as though the Bot had said it.+ */+ data-slot="message-arriving"+ /*+ * FULL WIDTH, AND A FLEX COLUMN, because that is what it displaced. `Bubble` is+ * `w-fit max-w-[80%]` and aligns itself with `group-data-[align=end]/message:self-end`. Both+ * need the parent this wrapper replaced: against a shrink-to-fit box the 80% resolves against+ * the bubble's own width and short messages wrap for no reason, and `self-end` does nothing at+ * all outside a flex container.+ */+ className="flex w-full flex-col"+ initial={{+ opacity: 0,+ // Reduced motion keeps the fade and drops the movement: gentler, not absent.+ transform: shouldReduceMotion ? "none" : "translateY(8px)",+ }}+ transition={{+ // Reduced motion gets the fade with no queue: a cascade is movement too, just spread over+ // time, and somebody who asked for less of it should not wait for their history to arrive.+ delay: shouldReduceMotion ? 0 : delay,+ duration: ENTRANCE_SECONDS,+ ease: EASE_OUT,+ }}+ >+ {children}+ </motion.div>+ );+}++/**+ * One drawn message, and it is memoised on PRIMITIVES ON PURPOSE.+ *+ * A streamed answer changes `messages` on every chunk, and `toVisibleChatItems` builds fresh objects+ * from it each time — so a memo comparing item objects would miss on every single one and buy+ * nothing. Passing role and text means an untouched message compares equal and is skipped.+ *+ * MEASURED, BEFORE AND AFTER. One reply into a 25-message thread cost 76 transcript renders and+ * 1,890 message renders, because every message in the history re-parsed its markdown on every+ * chunk. That is the jank: the scroll was following a list that rebuilt itself 76 times.+ *+ * It is also what keeps the entrance honest — no remount means no replay of the fade.+ */+const TranscriptMessage = memo(function TranscriptMessage({+ commandNames = "",+ delay,+ role,+ text,+}: {+ commandNames?: string;+ delay: number;+ role: "user" | "assistant";+ text: string;+}) {+ const isUser = role === "user";+ const align = isUser ? "end" : "start";+ const invoked = isUser ? splitSkillChip(text, commandNames) : null;++ return (+ <MessageRow align={align}>+ <MessageContent>+ <Arriving delay={delay}>+ <Bubble align={align} variant={isUser ? "muted" : "ghost"}>+ <BubbleContent>+ {isUser ? (+ // A person's own message is shown exactly as they typed it. Rendering it as markdown+ // would silently reformat what they said, and an asterisk in a sentence is not+ // emphasis. The chip is the one exception, and it is not reformatting: it is drawing+ // the thing that was already a chip in the composer as a chip here too, so the+ // transcript shows a skill was used rather than a slash that was typed.+ <span className="whitespace-pre-wrap">+ {invoked ? (+ <>+ {/*+ * The same icon the sidebar uses for Skills, so the badge says WHAT KIND of+ * thing was invoked before it says which one. `inline-flex` with+ * `align-middle` rather than a block: this sits mid-sentence, and a badge that+ * breaks the line it is in reads as a separate message.+ */}+ <span className="mr-1 inline-flex items-center gap-1 rounded bg-foreground/10 px-1.5 py-0.5 align-middle font-mono text-foreground/80 text-xs">+ <IconBox className="size-3 shrink-0" />/{invoked.chip}+ </span>+ {invoked.rest}+ </>+ ) : (+ text+ )}+ </span>+ ) : (+ /*+ * A Bot's prose is markdown, and it arrives in pieces.+ *+ * Rendered with a streaming-aware renderer rather than an ordinary one: half a fenced+ * code block or an unclosed bold marker is the NORMAL state for most of a run, and a+ * plain markdown parser draws that as literal asterisks and backticks until the+ * closing token arrives, so the answer visibly rewrites itself as it lands. This+ * closes them for the duration.+ */+ <Streamdown components={markdownComponents}>{text}</Streamdown>+ )}+ </BubbleContent>+ </Bubble>+ </Arriving>+ </MessageContent>+ </MessageRow>+ );+});++/**+ * One drawn tool call, memoised on the same terms.+ *+ * The `toolCall` object is rebuilt here from its parts rather than passed down, because the one on+ * the message is a new object on every chunk and would defeat the memo exactly as the text items+ * did. A finished chart re-rendering on every token of the sentence after it is not free.+ *+ * `useRenderToolCall` is called HERE rather than passed in as a prop: a function whose identity the+ * parent cannot guarantee is the classic way to make a memo boundary useless.+ */+const TranscriptToolCall = memo(function TranscriptToolCall({+ delay,+ toolCallId,+ name,+ args,+ result,+}: {+ delay: number;+ toolCallId: string;+ name: string;+ args: string;+ result?: string;+}) {+ const renderToolCall = useRenderToolCall();+ const toolCall = useMemo(+ () => ({+ id: toolCallId,+ type: "function" as const,+ function: { name, arguments: args },+ }),+ [toolCallId, name, args],+ );++ const drawn = renderToolCall({+ toolCall,+ ...(result === undefined+ ? {}+ : {+ toolMessage: {+ id: `${toolCallId}-result`,+ role: "tool",+ toolCallId,+ content: result,+ },+ }),+ });++ return (+ <Arriving delay={delay}>+ <ToolRenderBoundary name={name}>+ {/*+ * A TOOL WITH NO REGISTERED RENDERER STILL HAPPENED. `renderToolCall` draws whatever was+ * registered for the name and nothing at all for anything else, which left a Bot that called+ * something the app does not know about looking like a Bot that did nothing — the same+ * failure `ToolRenderBoundary` exists to prevent, arriving by a different route.+ *+ * The fallback is a plain tool line: what was called, shimmering until its result lands. It+ * is the same line the computer and MCP tools draw, so an unrecognised call reads as an+ * ordinary event rather than as damage.+ */}+ {drawn ?? <ToolLine label={name} running={result === undefined} />}+ </ToolRenderBoundary>+ </Arriving>+ );+});++export function ChatTranscript({+ busy = false,+ commandNames = "",+ messages,+}: ChatTranscriptProps) {+ /*+ * NOT MEMOISED, AND THAT IS DELIBERATE. `useMemo` keyed on `messages` looks obviously right and+ * silently broke the transcript: the agent hands back the SAME array and mutates it, so the+ * dependency never changed, the cached items were kept forever and a reply never appeared. A Bot+ * that answered looked like a Bot that had not.+ *+ * It was never the expensive part either. Rebuilding this list is a flatMap over messages; the+ * cost was markdown parsing and chart SVGs, and those are skipped by the memoised children below,+ * which is where the 25x came from. This runs per render and is not worth guarding.+ */+ const items = toVisibleChatItems(messages);++ /*+ * ONLY WHILE THERE IS NOTHING ELSE TO LOOK AT. Once a reply starts streaming, or a tool line+ * appears, the transcript is already saying the Bot is working — a second indicator under a+ * half-written answer would claim it had stopped and started again.+ *+ * So: the turn is in flight AND the last thing in the conversation is still the person's own+ * message. A tool call that is running shimmers on its own line and needs nothing from here.+ */+ const lastItem = items.at(-1);+ const waitingOnFirstToken =+ busy && lastItem?.kind === "text" && lastItem.role === "user";++ /*+ * One decider per mounted transcript, so opening a different channel starts the cascade over and+ * a message never inherits a delay from a conversation it was not in.+ */+ const delaysRef = useRef<ReturnType<typeof createFirstPaintDelays> | null>(+ null,+ );+ if (delaysRef.current === null) {+ delaysRef.current = createFirstPaintDelays();+ }+ const delays = delaysRef.current;++ /*+ * Settled AFTER the render that first had items, not on mount: history arrives asynchronously, so+ * on mount there is nothing to stagger yet and marking it settled then would mean the history+ * cascade never happens.+ */+ const hasItems = items.length > 0;+ useEffect(() => {+ if (hasItems) {+ delays.settle();+ }+ }, [hasItems, delays]);++ return (+ <MessageScrollerProvider autoScroll scrollPreviousItemPeek={48}>+ <MessageScroller>+ <MessageScrollerViewport>+ <MessageScrollerContent+ aria-busy={busy}+ className="mx-auto w-full max-w-2xl px-4 py-6"+ >+ {/*+ * The memo boundary is INSIDE the scroller item, not around it. `MessageScrollerItem`+ * reads the scroller's context, so it re-renders whenever the scroll state moves and+ * memoising it would achieve nothing. Its child is what costs — markdown parsing and+ * chart SVGs — and that is what is skipped.+ */}+ {items.map((item, index) =>+ item.kind === "tool" ? (+ <MessageScrollerItem key={item.id} messageId={item.id}>+ <TranscriptToolCall+ args={item.toolCall.function.arguments}+ delay={delays.delayFor(item.id, index, items.length)}+ name={item.toolCall.function.name}+ result={item.result}+ toolCallId={item.toolCall.id}+ />+ </MessageScrollerItem>+ ) : (+ <MessageScrollerItem+ key={item.id}+ messageId={item.id}+ scrollAnchor={item.role === "user"}+ >+ <TranscriptMessage+ commandNames={commandNames}+ delay={delays.delayFor(item.id, index, items.length)}+ role={item.role}+ text={item.text}+ />+ </MessageScrollerItem>+ ),+ )}+ {/*+ * Outside the item list, so it is not a message. It has no id, is never anchored, and+ * disappears the moment the answer starts — giving it a `MessageScrollerItem` would ask+ * the scroller to measure and anchor something that exists for a second and a half.+ */}+ {waitingOnFirstToken ? <Thinking /> : null}+ </MessageScrollerContent>+ </MessageScrollerViewport>+ <MessageScrollerButton />+ </MessageScroller>+ </MessageScrollerProvider>+ );+}diff --git a/app/src/components/channels/compose-state.ts b/app/src/components/channels/compose-state.tsnew file mode 100644index 00000000..1010a2d3--- /dev/null+++ b/app/src/components/channels/compose-state.ts@@ -0,0 +1,43 @@+/**+ * The rules a compose screen follows before there is a channel to hold them.+ *+ * Pure helpers so recipient-cap and sendability behavior stay testable without rendering.+ */++export type Recipient = {+ id: string;+ name: string;+};++/**+ * One teammate per channel.+ *+ * Matches the chat screen's current one-teammate render contract.+ */+export const MAX_RECIPIENTS = 1;++/** Add a teammate, replacing the oldest once the channel recipient cap is reached. */+export function addRecipient(+ current: readonly Recipient[],+ next: Recipient,+): Recipient[] {+ if (current.some((recipient) => recipient.id === next.id)) {+ return [...current];+ }+ return [...current, next].slice(-MAX_RECIPIENTS);+}++export function removeRecipient(+ current: readonly Recipient[],+ id: string,+): Recipient[] {+ return current.filter((recipient) => recipient.id !== id);+}++/** Whether this draft can start a channel. */+export function canSend(+ recipients: readonly Recipient[],+ text: string,+): boolean {+ return recipients.length === MAX_RECIPIENTS && text.trim().length > 0;+}diff --git a/app/src/components/channels/composer/composer.tsx b/app/src/components/channels/composer/composer.tsxnew file mode 100644index 00000000..5a1584f0--- /dev/null+++ b/app/src/components/channels/composer/composer.tsx@@ -0,0 +1,287 @@+import {+ IconArrowUp,+ IconPlayerStopFilled,+ IconPlus,+} from "@tabler/icons-react";+import { PromptArea, type PromptAreaHandle } from "prompt-area";+import type { Segment } from "prompt-area/helpers";+import {+ type FormEvent,+ useCallback,+ useEffect,+ useMemo,+ useRef,+ useState,+} from "react";+import { cn } from "@/lib/utils";+import { Button } from "../../ui/button";+import {+ applyCommandChips,+ type CommandOption,+ type ComposerDraft,+ enforceSingleAgent,+ toDraft,+} from "./draft";+import { PLACEHOLDER_COMMANDS } from "./sources";+import { type AgentOption, buildTriggers } from "./triggers";++const MAX_HEIGHT_PX = 220;+/**+ * Tracks the compact `text-sm` line box so PromptArea stays vertically centered in one row.+ */+const COMPACT_MIN_HEIGHT_PX = 19;+const COMPACT_MAX_HEIGHT_PX = 96;++export type ComposerProps = {+ className?: string;+ compact?: boolean;+ /** Agents that `@` can address. Empty means the mention menu reports an empty channel. */+ agents?: readonly AgentOption[];+ commands?: readonly CommandOption[];+ /**+ * Receives the whole draft rather than a string, so a mention or a command reaches the caller as+ * structured data instead of something it would have to re-parse out of the text.+ */+ onSubmit?: (draft: ComposerDraft) => void | Promise<void>;+ /** Stop the Bot mid-answer; while pending, the send button becomes a stop button. */+ onStop?: () => void;+ /**+ * The conversation cannot take another message at all, which is a property of the conversation+ * rather than of the moment: a channel whose teammate was deleted. This is the only thing that+ * stops a person typing.+ */+ disabled?: boolean;+ /**+ * A run is in flight. It gates sending, not writing: a channel is `pending` while it is still+ * connecting and restoring its history, and the composer is on screen throughout.+ */+ pending?: boolean;+};++export function Composer({+ className,+ compact = false,+ agents = [],+ commands = PLACEHOLDER_COMMANDS,+ onSubmit,+ onStop,+ disabled = false,+ pending = false,+}: ComposerProps) {+ const [value, setValue] = useState<Segment[]>([]);+ const [isSubmitting, setIsSubmitting] = useState(false);+ const submitInFlight = useRef(false);+ const promptAreaRef = useRef<PromptAreaHandle>(null);+ /** A send has completed and the caret is owed back, as soon as the editor will take it. */+ const wantsFocus = useRef(false);++ const isBusy = pending || isSubmitting;+ const triggers = useMemo(+ () => buildTriggers({ agents, commands }),+ [agents, commands],+ );+ const draft = useMemo(() => toDraft(value), [value]);++ const handleChange = useCallback(+ (next: Segment[]) => {+ const { segments, actions } = applyCommandChips(+ enforceSingleAgent(next),+ commands,+ );+ setValue(segments);+ // Run after the commit so an action that navigates or opens a panel is not fighting the+ // editor's own state update for the same tick.+ for (const action of actions) {+ action();+ }+ },+ [commands],+ );++ /**+ * The single submit path for Enter, the send button, and the form.+ *+ * `submitInFlight` is a ref rather than `isSubmitting` because a second Enter can land before+ * React has re-rendered with the new state, which would send the message twice.+ */+ const submitDraft = useCallback(+ async (segments: Segment[]) => {+ const submitted = toDraft(segments);+ if (+ submitted.isEmpty ||+ disabled ||+ isBusy ||+ submitInFlight.current ||+ !onSubmit+ ) {+ return;+ }++ submitInFlight.current = true;+ setIsSubmitting(true);+ // Clear optimistically; restore if the send fails before becoming a message.+ setValue([]);+ try {+ await onSubmit(submitted);+ } catch (error) {+ setValue(segments);+ throw error;+ } finally {+ submitInFlight.current = false;+ setIsSubmitting(false);+ // Asked for here, performed in the effect below, which runs after the commit that clears+ // `isSubmitting` and so after the render the caret would otherwise be placed against.+ wantsFocus.current = true;+ }+ },+ [disabled, isBusy, onSubmit],+ );++ /**+ * Put the caret back the moment the composer can accept it again.+ *+ * Keyed off the editor becoming interactive rather than off the send resolving, so it survives+ * whatever the parent does with `pending` in between — and it runs after the commit, which is the+ * only point at which the element is enabled and focusable.+ */+ useEffect(() => {+ if (!wantsFocus.current || disabled || isBusy) {+ return;+ }+ wantsFocus.current = false;+ promptAreaRef.current?.focus();+ }, [disabled, isBusy]);++ const handleFormSubmit = (event: FormEvent<HTMLFormElement>) => {+ event.preventDefault();+ void submitDraft(value);+ };++ const canSend = !disabled && !isBusy && !draft.isEmpty;+ /** Stop is available only once the agent run is actually pending. */+ const canStop = Boolean(onStop) && pending;++ if (compact) {+ return (+ <form+ aria-busy={isBusy}+ className={cn(+ /*+ * `py-3` IS LOAD-BEARING ONCE THE TEXT WRAPS. On one line `min-h-14` and `items-center`+ * fake the vertical padding, so it read as correct for as long as nobody typed a+ * paragraph. Past that the row grows to fit its content exactly and the glyphs sit+ * against the border.+ *+ * It goes on the form rather than on the editor because the editor scrolls internally at+ * COMPACT_MAX_HEIGHT_PX: padding inside that box would scroll away with the text, so the+ * first visible line would still touch the top edge on a long message.+ */+ "flex min-h-14 items-center gap-3 rounded-2xl border border-border bg-card px-3 py-3 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50",+ className,+ )}+ onSubmit={handleFormSubmit}+ >+ <Button+ aria-label="More message options unavailable"+ className="disabled:opacity-100"+ disabled+ size="icon"+ type="button"+ variant="ghost"+ >+ <IconPlus className="size-5" />+ </Button>+ <PromptArea+ aria-label="Message"+ className="min-w-0 flex-1 border-0 bg-transparent p-0 text-sm shadow-none"+ disabled={disabled}+ maxHeight={COMPACT_MAX_HEIGHT_PX}+ minHeight={COMPACT_MIN_HEIGHT_PX}+ onChange={handleChange}+ onSubmit={submitDraft}+ placeholder="Ask anything"+ ref={promptAreaRef}+ triggers={triggers}+ value={value}+ />+ {canStop ? (+ <Button+ aria-label="Stop the Bot"+ className="size-8 rounded-full p-0"+ data-testid="composer-stop"+ onClick={onStop}+ size="icon"+ type="button"+ >+ <IconPlayerStopFilled className="size-3" />+ </Button>+ ) : (+ <Button+ aria-label="Send message"+ className="size-8 rounded-full p-0"+ disabled={!canSend}+ size="icon"+ type="submit"+ >+ <IconArrowUp className="size-3.5" />+ </Button>+ )}+ </form>+ );+ }++ return (+ <div className={cn("w-xl", className)}>+ <form+ aria-busy={isBusy}+ className="overflow-hidden rounded-2xl border border-border bg-card"+ onSubmit={handleFormSubmit}+ >+ <input className="sr-only" multiple onChange={() => {}} type="file" />++ <div className="grow px-3 pt-3 pb-2">+ <PromptArea+ aria-label="Message"+ autoGrow+ className="w-full border-0 bg-transparent p-0 text-sm shadow-none"+ disabled={disabled}+ maxHeight={MAX_HEIGHT_PX}+ onChange={handleChange}+ onSubmit={submitDraft}+ placeholder="Ask anything"+ ref={promptAreaRef}+ triggers={triggers}+ value={value}+ />+ </div>++ <div className="mb-2 flex items-center justify-between px-2">+ <div />++ <div>+ {canStop ? (+ <Button+ aria-label="Stop the Bot"+ className="size-7 rounded-full bg-primary p-0"+ data-testid="composer-stop"+ onClick={onStop}+ type="button"+ >+ <IconPlayerStopFilled className="size-3" />+ </Button>+ ) : (+ <Button+ aria-label="Send message"+ className="size-7 rounded-full bg-primary p-0 disabled:cursor-not-allowed disabled:opacity-50"+ disabled={!canSend}+ type="submit"+ >+ <IconArrowUp className="size-3.5 fill-primary" />+ </Button>+ )}+ </div>+ </div>+ </form>+ </div>+ );+}diff --git a/app/src/components/channels/composer/draft.test.ts b/app/src/components/channels/composer/draft.test.tsnew file mode 100644index 00000000..73c714af--- /dev/null+++ b/app/src/components/channels/composer/draft.test.ts@@ -0,0 +1,128 @@+import { describe, expect, test } from "bun:test";+import { chip, type Segment, text } from "prompt-area/helpers";+import {+ applyCommandChips,+ type CommandOption,+ enforceSingleAgent,+ toDraft,+} from "./draft";++function agent(id: string, name: string) {+ return chip({ trigger: "@", value: id, displayText: name });+}++function command(id: string, name: string) {+ return chip({ trigger: "/", value: id, displayText: name });+}++describe("toDraft", () => {+ test("flattens chips back into the plain text sent to the runtime", () => {+ const draft = toDraft([+ agent("knowledge", "Knowledge"),+ text(" what changed last week?"),+ ]);++ expect(draft.text).toBe("@Knowledge what changed last week?");+ expect(draft.agentId).toBe("knowledge");+ expect(draft.isEmpty).toBe(false);+ });++ test("reports no agent when the message does not address one", () => {+ expect(toDraft([text("hello")]).agentId).toBeNull();+ });++ test("collects command chips in the order they were typed", () => {+ const draft = toDraft([+ command("search", "search"),+ text(" "),+ command("summarize", "summarize"),+ ]);++ expect(draft.commandIds).toEqual(["search", "summarize"]);+ });++ test("treats whitespace-only content as empty", () => {+ expect(toDraft([text(" ")]).isEmpty).toBe(true);+ expect(toDraft([]).isEmpty).toBe(true);+ });+});++describe("enforceSingleAgent", () => {+ test("keeps the most recent mention when a second agent is added", () => {+ const segments: Segment[] = [+ agent("knowledge", "Knowledge"),+ text(" and "),+ agent("computer", "Computer"),+ text(" check this"),+ ];++ const result = enforceSingleAgent(segments);++ expect(toDraft(result).agentId).toBe("computer");+ expect(toDraft(result).text).toBe("and @Computer check this");+ });++ test("returns the same array when there is nothing to collapse", () => {+ const segments: Segment[] = [agent("knowledge", "Knowledge"), text(" hi")];+ expect(enforceSingleAgent(segments)).toBe(segments);+ });+});++describe("applyCommandChips", () => {+ const commands: CommandOption[] = [+ { id: "search", name: "search", kind: "chip" },+ {+ id: "summarize",+ name: "summarize",+ kind: "prompt",+ prompt: "Summarize this channel.",+ },+ { id: "clear", name: "clear", kind: "action" },+ ];++ test("expands a prompt command into editable text", () => {+ const { segments, actions } = applyCommandChips(+ [command("summarize", "summarize")],+ commands,+ );++ expect(toDraft(segments).text).toBe("Summarize this channel.");+ expect(toDraft(segments).commandIds).toEqual([]);+ expect(actions).toHaveLength(0);+ });++ test("removes an action command and defers its side effect", () => {+ let ran = false;+ const { segments, actions } = applyCommandChips(+ [command("clear", "clear")],+ commands.map((entry) =>+ entry.id === "clear" ? { ...entry, run: () => (ran = true) } : entry,+ ),+ );++ expect(toDraft(segments).isEmpty).toBe(true);+ expect(actions).toHaveLength(1);+ expect(ran).toBe(false);++ for (const action of actions) {+ action();+ }+ expect(ran).toBe(true);+ });++ test("leaves chip commands alone and returns the same array", () => {+ const segments: Segment[] = [+ command("search", "search"),+ text(" invoices"),+ ];+ const result = applyCommandChips(segments, commands);++ expect(result.segments).toBe(segments);+ expect(result.actions).toHaveLength(0);+ });++ test("keeps a chip for a command that is no longer registered", () => {+ const { segments } = applyCommandChips([command("search", "search")], []);+ expect(toDraft(segments).commandIds).toEqual(["search"]);+ });+});diff --git a/app/src/components/channels/composer/index.ts b/app/src/components/channels/composer/index.tsnew file mode 100644index 00000000..2e930ffe--- /dev/null+++ b/app/src/components/channels/composer/index.ts@@ -0,0 +1,10 @@+export { Composer, type ComposerProps } from "./composer";+export {+ AGENT_TRIGGER,+ COMMAND_TRIGGER,+ type CommandKind,+ type CommandOption,+ type ComposerDraft,+} from "./draft";+export { PLACEHOLDER_COMMANDS } from "./sources";+export { type AgentOption, toAgentOptions } from "./triggers";diff --git a/app/src/components/channels/composer/sources.ts b/app/src/components/channels/composer/sources.tsnew file mode 100644index 00000000..548ab507--- /dev/null+++ b/app/src/components/channels/composer/sources.ts@@ -0,0 +1,21 @@+import type { CommandOption } from "./draft";++/**+ * Placeholder slash commands.+ *+ * Channels can carry seeded suggested prompts, but nothing serves them to the browser+ * yet, `AgentChannel` currently stops at `agentIds`. These stand in so `/` is exercisable, and+ * `commands` is a plain prop on `<Composer>`, so replacing them is a call site change.+ *+ * Agents are deliberately not placeheld: `agentListQueryOptions` already returns the real roster,+ * so the `@` source is wired to it at the call sites.+ */+export const PLACEHOLDER_COMMANDS: CommandOption[] = [+ {+ id: "summarize",+ name: "summarize",+ description: "Summarize this conversation",+ kind: "prompt",+ prompt: "Summarize what we covered in this channel so far.",+ },+];diff --git a/app/src/components/channels/composer/triggers.ts b/app/src/components/channels/composer/triggers.tsnew file mode 100644index 00000000..7a0a9d7a--- /dev/null+++ b/app/src/components/channels/composer/triggers.ts@@ -0,0 +1,105 @@+import type { TriggerConfig, TriggerSuggestion } from "prompt-area/helpers";+import { commandTrigger, mentionTrigger } from "prompt-area/helpers";+import { AGENT_TRIGGER, COMMAND_TRIGGER, type CommandOption } from "./draft";++/**+ * The composer's trigger registry.+ *+ * Adding a trigger means adding a factory here and passing its source down; composer rendering stays+ * independent of trigger semantics.+ */++export type AgentOption = {+ id: string;+ name: string;+ description?: string;+};++/**+ * Narrows the agent roster to mention options, scoped to a channel's permitted agents when+ * `permittedIds` is given.+ *+ * Takes a structural shape so the composer stays independent of the queries module.+ */+export function toAgentOptions(+ profiles: readonly { id: string; name: string; title?: string }[] | undefined,+ permittedIds?: readonly string[],+): AgentOption[] {+ if (!profiles) {+ return [];+ }+ const permitted = permittedIds ? new Set(permittedIds) : null;+ return profiles+ .filter((profile) => !permitted || permitted.has(profile.id))+ .map((profile) => ({+ id: profile.id,+ name: profile.name,+ description: profile.title,+ }));+}++function matches(query: string, ...fields: (string | undefined)[]): boolean {+ if (!query) {+ return true;+ }+ const needle = query.toLowerCase();+ return fields.some((field) => field?.toLowerCase().includes(needle));+}++/**+ * `@` selects the agent that answers this message.+ *+ * `reopenOnChipClick` keeps an inserted mention editable without deleting and retyping.+ */+export function agentTrigger(agents: readonly AgentOption[]): TriggerConfig {+ return mentionTrigger({+ char: AGENT_TRIGGER,+ accessibilityLabel: "agent",+ reopenOnChipClick: true,+ emptyMessage: "No agents in this channel",+ onSearch: (query): TriggerSuggestion[] =>+ agents+ .filter((agent) => matches(query, agent.name, agent.description))+ .map((agent) => ({+ value: agent.id,+ label: agent.name,+ description: agent.description,+ })),+ onSelect: (suggestion) => suggestion.label,+ });+}++/**+ * `/` is restricted to the start of a line, so a URL or a date in the middle of a sentence never+ * opens the dropdown. Selection resolves to a chip; `applyCommandChips` then rewrites the ones that+ * are really prompts or client actions.+ */+export function slashCommandTrigger(+ commands: readonly CommandOption[],+): TriggerConfig {+ return commandTrigger({+ char: COMMAND_TRIGGER,+ position: "start",+ accessibilityLabel: "command",+ emptyMessage: "No matching commands",+ onSearch: (query): TriggerSuggestion[] =>+ commands+ .filter((command) => matches(query, command.name, command.description))+ .map((command) => ({+ value: command.id,+ label: command.name,+ description: command.description,+ })),+ onSelect: (suggestion) => suggestion.label,+ });+}++export function buildTriggers({+ agents,+ commands,+}: {+ agents: readonly AgentOption[];+ commands: readonly CommandOption[];+}): TriggerConfig[] {+ return [agentTrigger(agents), slashCommandTrigger(commands)];+}diff --git a/app/src/components/channels/recipient-field.tsx b/app/src/components/channels/recipient-field.tsxnew file mode 100644index 00000000..46a90f00--- /dev/null+++ b/app/src/components/channels/recipient-field.tsx@@ -0,0 +1,106 @@+import { useQuery } from "@tanstack/react-query";+import { useState } from "react";+import { ChannelAvatar } from "@/components/channels/avatar";+import {+ addRecipient,+ MAX_RECIPIENTS,+ type Recipient,+ removeRecipient,+} from "@/components/channels/compose-state";+import { Button } from "@/components/ui/button";+import {+ InputGroup,+ InputGroupAddon,+ InputGroupInput,+} from "@/components/ui/input-group";+import { agentListQueryOptions } from "@/lib/agents/queries";++/**+ * Who a conversation that does not exist yet is with.+ *+ * Uses the same recipient list model as compose state, even while channels are capped at one+ * teammate.+ */+export function RecipientField({+ recipients,+ onChange,+}: {+ recipients: readonly Recipient[];+ onChange: (next: Recipient[]) => void;+}) {+ const { data: profiles } = useQuery(agentListQueryOptions());+ const [search, setSearch] = useState("");++ const chosen = new Set(recipients.map((recipient) => recipient.id));+ const matches = (profiles ?? [])+ .filter((profile) => !chosen.has(profile.id))+ .filter((profile) =>+ profile.name.toLowerCase().includes(search.trim().toLowerCase()),+ );+ const isFull = recipients.length >= MAX_RECIPIENTS;++ return (+ <div className="border-b border-border px-4 py-2">+ <div className="mx-auto flex w-full max-w-2xl flex-wrap items-center gap-1.5">+ <span className="text-sm text-muted-foreground">To:</span>++ {recipients.map((recipient) => (+ <Button+ key={recipient.id}+ onClick={() => onChange(removeRecipient(recipients, recipient.id))}+ size="xs"+ variant="secondary"+ >+ <ChannelAvatar participantIds={[recipient.id]} size={16} />+ {recipient.name}+ <span aria-hidden>×</span>+ <span className="sr-only">Remove {recipient.name}</span>+ </Button>+ ))}++ {isFull ? null : (+ <InputGroup className="h-8 w-56 border-none bg-transparent">+ <InputGroupInput+ aria-label="Choose a teammate"+ onChange={(event) => setSearch(event.target.value)}+ placeholder="Choose a teammate…"+ value={search}+ />+ <InputGroupAddon />+ </InputGroup>+ )}+ </div>++ {isFull || search.trim().length === 0 ? null : (+ <ul className="mx-auto mt-1 w-full max-w-2xl">+ {matches.map((profile) => (+ <li key={profile.id}>+ <button+ className="flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent"+ onClick={() => {+ onChange(+ addRecipient(recipients, {+ id: profile.id,+ name: profile.name,+ }),+ );+ setSearch("");+ }}+ type="button"+ >+ <ChannelAvatar participantIds={[profile.id]} size={18} />+ <span>{profile.name}</span>+ <span className="text-muted-foreground">{profile.title}</span>+ </button>+ </li>+ ))}+ {matches.length === 0 ? (+ <li className="px-2 py-1.5 text-sm text-muted-foreground">+ No teammate by that name.+ </li>+ ) : null}+ </ul>+ )}+ </div>+ );+}diff --git a/app/src/components/computer/computer-view.tsx b/app/src/components/computer/computer-view.tsxnew file mode 100644index 00000000..77878f27--- /dev/null+++ b/app/src/components/computer/computer-view.tsx@@ -0,0 +1,433 @@+import { useEffect, useRef, useState } from "react";+import { createPortal } from "react-dom";+import { LiveScreen } from "./live-screen";+import { ComputerPlaceholder } from "./placeholder";+import {+ type ControlState,+ readControl,+ releaseControl,+ supplySecret,+ takeControl,+} from "./take-the-wheel";++type Screenshot = {+ base64: string;+ width: number;+ height: number;+ capturedAt: string;+ /** `about:blank` when the browser has not been sent anywhere yet. Absent on older computers. */+ url?: string;+};++/** Explicit blank-browser URLs use placeholder artwork; missing URL fields are treated as real pages. */+function isBlankBrowser(shot: Screenshot): boolean {+ if (shot.url === undefined) return false;+ const url = shot.url.trim();+ return url === "" || url === "about:blank";+}++/** Default browser viewport ratio, reserved before the first screenshot arrives. */+const DEFAULT_ASPECT_RATIO = 1280 / 800;++/** Minimum readable inline screen size. */+const DEFAULT_MIN_WIDTH = 320;+const DEFAULT_MIN_HEIGHT = 200;++/** Preload without failing the poll loop when a frame cannot be decoded early. */+async function preloadFrame(base64: string): Promise<void> {+ try {+ const image = new Image();+ image.src = `data:image/png;base64,${base64}`;+ await image.decode();+ } catch {+ // Let the visible image element handle decode failures.+ }+}++/** Identical frames in a row that mean the page has stopped changing. */+const SETTLED_FRAMES = 3;++/** Hard cap for post-action polling on pages that never settle. */+const SETTLE_TIMEOUT_MS = 30_000;++/** Short confirmation window after a secret is sent to the page. */+const SECRET_CONFIRM_MS = 6_000;++type Props = {+ /** Which computer to watch. One shared computer unless each Bot has been given its own. */+ computerId: string;+ /** Off by default so idle Bot screens do not poll indefinitely. */+ active?: boolean;+ intervalMs?: number;+ /** Width divided by height. Overridable for a Bot whose computer is not the default shape. */+ aspectRatio?: number;+ minWidth?: number;+ minHeight?: number;+};++export function ComputerView({+ computerId,+ active = true,+ intervalMs = 1000,+ aspectRatio = DEFAULT_ASPECT_RATIO,+ minWidth = DEFAULT_MIN_WIDTH,+ minHeight = DEFAULT_MIN_HEIGHT,+}: Props) {+ const [shot, setShot] = useState<Screenshot | null>(null);+ const [problem, setProblem] = useState<string | null>(null);+ const [expanded, setExpanded] = useState(false);+ const [control, setControl] = useState<ControlState | null>(null);+ /** Held only until it is sent. Never lifted into a URL, a log, or anything that outlives this form. */+ const [secret, setSecret] = useState("");+ const [secretProblem, setSecretProblem] = useState<string | null>(null);+ const [sendingSecret, setSendingSecret] = useState(false);+ const driving = control?.holder === "human";+ /** Read by the polling loop without restarting it on control changes. */+ const drivingRef = useRef(false);+ drivingRef.current = driving;++ /** Release control; the Bot's waiting tool call resumes from this state change. */+ const handBack = async () => {+ const state = await releaseControl(computerId);+ if (state) setControl(state);+ };+ /** Secret prompts keep the screen live even though the human does not hold the wheel. */+ const secretPending = Boolean(control?.secretWanted);+ const secretPendingRef = useRef(false);+ secretPendingRef.current = secretPending;+ // Held in a ref so a slow response cannot overwrite a newer frame after the component moved on.+ const generation = useRef(0);+ /** Force a short watch window after non-Bot actions such as secret entry. */+ const watchUntil = useRef(0);++ // biome-ignore lint/correctness/useExhaustiveDependencies: `secretPending` intentionally restarts settled polling.+ useEffect(() => {+ const mine = ++generation.current;+ let timer: ReturnType<typeof setTimeout>;+ // Consecutive identical frames observed during post-action settling.+ let unchanged = 0;+ let lastFrame = "";+ const graceStartedAt = Date.now();++ /** Continue while active, human-driven, secret-pending, or not yet visually settled. */+ const shouldContinue = () => {+ if (active) return true;+ if (drivingRef.current) return true;+ if (secretPendingRef.current) return true;+ if (Date.now() < watchUntil.current) return true;+ if (Date.now() - graceStartedAt > SETTLE_TIMEOUT_MS) return false;+ return unchanged < SETTLED_FRAMES;+ };++ // Always fetch at least one frame; only repeated refreshes are conditional.+ const tick = async () => {+ try {+ const response = await fetch(+ `/api/computers/${computerId}/screenshot`,+ {+ credentials: "include",+ },+ );+ if (generation.current !== mine) return;++ if (!response.ok) {+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ setProblem(body?.error ?? "The screen is not available right now.");+ } else {+ const next = (await response.json()) as Screenshot;+ // Exact byte comparison is the settling signal.+ unchanged = next.base64 === lastFrame ? unchanged + 1 : 0;+ lastFrame = next.base64;+ // Decode before swapping to avoid blanking the visible image during data URL changes.+ await preloadFrame(next.base64);+ if (generation.current !== mine) return;+ setShot(next);+ setProblem(null);+ }+ } catch {+ if (generation.current !== mine) return;+ setProblem("The screen is not available right now.");+ } finally {+ if (generation.current === mine && shouldContinue()) {+ timer = setTimeout(tick, intervalMs);+ }+ }+ };++ void tick();+ return () => {+ generation.current++;+ clearTimeout(timer);+ };+ }, [computerId, active, intervalMs, secretPending]);++ /** Poll control state independently from screenshot polling so help/secret prompts surface. */+ useEffect(() => {+ let live = true;+ let timer: ReturnType<typeof setTimeout>;+ const tick = async () => {+ const state = await readControl(computerId);+ if (!live) return;+ if (state) setControl(state);+ timer = setTimeout(tick, 1000);+ };+ void tick();+ return () => {+ live = false;+ clearTimeout(timer);+ };+ }, [computerId]);++ // Input forwarding lives in LiveScreen on the socket.+ // Escape is bound to the window so it works regardless of overlay focus.+ useEffect(() => {+ if (!expanded) return;+ const onKey = (event: KeyboardEvent) => {+ if (event.key === "Escape") setExpanded(false);+ };+ window.addEventListener("keydown", onKey);+ return () => window.removeEventListener("keydown", onKey);+ }, [expanded]);++ // Sized from the ratio, never from the payload, so the frame is identical in all three states.+ const frameStyle = { aspectRatio, minWidth, minHeight };++ // Always render the card frame; help/secret controls live below the conditional picture.+ const blankBrowser = shot ? isBlankBrowser(shot) : false;+ /** Blank browser placeholders should not be opened as readable screens. */+ const showScreen = shot !== null && !blankBrowser;++ const polledScreen = showScreen ? (+ <img+ src={`data:image/png;base64,${shot.base64}`}+ alt="What the assistant is looking at"+ // Keep unexpected screenshot dimensions inside the reserved frame.+ className="absolute inset-0 h-full w-full object-contain opacity-100 transition-opacity duration-300 starting:opacity-0"+ />+ ) : null;++ return (+ <>+ <figure className="overflow-hidden rounded-2xl border">+ {/* Inline preview remains in transcript; click opens a readable full-size view. */}+ <button+ type="button"+ onClick={() => setExpanded(true)}+ // Disabled while blank/waiting but still reserves the frame.+ disabled={!showScreen}+ className="relative block w-full bg-muted enabled:cursor-zoom-in"+ style={frameStyle}+ aria-label="Open the assistant's screen full size"+ >+ {polledScreen}++ {blankBrowser ? (+ <ComputerPlaceholder className="absolute inset-0 h-full w-full" />+ ) : null}++ {showScreen ? null : (+ <span+ className={`absolute inset-0 flex flex-col items-center justify-center gap-1 p-4 text-center text-sm ${+ blankBrowser+ ? "bg-black/25 text-white"+ : "text-muted-foreground"+ }`}+ >+ {problem ? (+ <>+ <span className="font-medium">+ You cannot see the screen right now+ </span>+ <span>{problem}</span>+ <span className={blankBrowser ? "text-white/80" : undefined}>+ The assistant may still be working. An administrator can+ check whether its computer is running.+ </span>+ </>+ ) : blankBrowser ? (+ <span>The assistant has not opened a page yet.</span>+ ) : (+ <span>Waiting for the assistant's screen…</span>+ )}+ </span>+ )}+ </button>++ {/*+ Secret values go directly to the page path and are never included in the conversation.+ Audit records that a secret was supplied, not the value.+ */}+ {control?.secretWanted ? (+ <form+ className="border-t bg-muted/40 px-3 py-2 text-sm"+ onSubmit={async (event) => {+ event.preventDefault();+ if (!secret || sendingSecret) return;+ setSendingSecret(true);+ watchUntil.current = Date.now() + SECRET_CONFIRM_MS;+ const result = await supplySecret(computerId, secret);+ setSendingSecret(false);+ // Clear even on failure so plaintext is not left in the DOM.+ setSecret("");+ setSecretProblem(result.ok ? null : (result.error ?? null));+ const state = await readControl(computerId);+ if (state) setControl(state);+ }}+ >+ <label className="block" htmlFor="openbot-secret">+ <span className="font-medium">The assistant needs </span>+ <span>{control.secretWanted}</span>+ </label>+ <div className="mt-1.5 flex gap-2">+ <input+ id="openbot-secret"+ type="password"+ value={secret}+ onChange={(event) => setSecret(event.target.value)}+ autoComplete="off"+ autoCorrect="off"+ spellCheck={false}+ placeholder="Typed here, never shown to the assistant"+ className="min-w-0 flex-1 rounded-md border bg-background px-2 py-1 text-sm"+ />+ <button+ type="submit"+ disabled={!secret || sendingSecret}+ className="shrink-0 rounded-md bg-primary px-3 py-1 text-xs font-medium text-primary-foreground disabled:opacity-50"+ >+ {sendingSecret ? "Sending…" : "Send to the page"}+ </button>+ </div>+ <p className="mt-1 text-xs text-muted-foreground">+ This goes straight to the page. It is not shown in the+ conversation and the assistant never receives it.+ </p>+ {secretProblem ? (+ <p className="mt-1 text-xs text-destructive">{secretProblem}</p>+ ) : null}+ </form>+ ) : null}++ {driving ? (+ <div className="flex items-center justify-between gap-3 border-t bg-muted/40 px-3 py-2 text-sm">+ <span>You have control of this browser.</span>+ <span className="flex shrink-0 gap-2">+ <button+ type="button"+ onClick={() => setExpanded(true)}+ className="rounded-md border px-3 py-1 text-xs font-medium"+ >+ Open full size+ </button>+ <button+ type="button"+ onClick={() => void handBack()}+ className="rounded-md bg-primary px-3 py-1 text-xs font-medium text-primary-foreground"+ >+ Hand back+ </button>+ </span>+ </div>+ ) : null}++ {control?.requested && !driving ? (+ <div className="flex items-start justify-between gap-3 border-t bg-amber-500/10 px-3 py-2 text-sm">+ <span>+ <strong className="font-medium">The assistant needs you.</strong>{" "}+ {control.reason}+ </span>+ <button+ type="button"+ onClick={async () => {+ const state = await takeControl(computerId);+ if (state) setControl(state);+ setExpanded(true);+ }}+ className="shrink-0 rounded-md bg-primary px-3 py-1 text-xs font-medium text-primary-foreground"+ >+ Take control+ </button>+ </div>+ ) : null}+ </figure>++ {/*+ Portal to body so fixed positioning is measured against the viewport, not containing panes.+ */}+ {expanded && typeof document !== "undefined"+ ? createPortal(+ <div+ role="dialog"+ aria-modal="true"+ aria-label="The assistant's screen"+ className="fixed inset-0 z-50 flex flex-col p-4 sm:p-8"+ >+ {/* Backdrop closes only while read-only; during driving, Escape remains the exit. */}+ <button+ type="button"+ onClick={() => !driving && setExpanded(false)}+ aria-label="Close the assistant's screen"+ aria-hidden={driving}+ tabIndex={driving ? -1 : 0}+ className={`absolute inset-0 bg-black/80 ${driving ? "cursor-default" : "cursor-zoom-out"}`}+ />+ <div className="relative mb-3 flex items-center justify-between gap-4 text-sm text-white">+ <span className="pointer-events-none">+ {driving ? (+ <>+ <strong className="font-medium">You have control.</strong>{" "}+ Click and type on the page as you normally would.+ {control?.reason ? ` ${control.reason}` : null}+ </>+ ) : (+ <>The assistant's screen{active ? ", updating live" : ""}</>+ )}+ </span>+ <span className="flex shrink-0 items-center gap-3">+ {driving ? (+ <button+ type="button"+ onClick={() => {+ setExpanded(false);+ void handBack();+ }}+ className="rounded-md bg-white px-3 py-1 text-xs font-medium text-black"+ >+ Hand back to the assistant+ </button>+ ) : control?.requested ? (+ <button+ type="button"+ onClick={async () => {+ const state = await takeControl(computerId);+ if (state) setControl(state);+ }}+ className="rounded-md bg-white px-3 py-1 text-xs font-medium text-black"+ >+ Take control+ </button>+ ) : null}+ <span className="pointer-events-none text-white/70">+ {driving+ ? "Press Escape to close"+ : "Click anywhere or press Escape to close"}+ </span>+ </span>+ </div>+ {/* Overlay uses the live socket; the inline card keeps low-cost polling. */}+ <div className="relative min-h-0 flex-1 overflow-auto rounded-lg bg-black">+ <LiveScreen+ computerId={computerId}+ driving={driving}+ onProblem={setProblem}+ />+ </div>+ </div>,+ document.body,+ )+ : null}+ </>+ );+}diff --git a/app/src/components/computer/live-screen.tsx b/app/src/components/computer/live-screen.tsxnew file mode 100644index 00000000..bbc98938--- /dev/null+++ b/app/src/components/computer/live-screen.tsx@@ -0,0 +1,261 @@+import { useCallback, useEffect, useRef, useState } from "react";+import { pageCoordinates } from "./take-the-wheel";++/**+ * Low-latency screencast used while a human is driving the Bot's browser.+ *+ * The inline card keeps using cheap polling for passive watching. This view uses Chrome's+ * screencast socket so input and visual feedback stay synchronized during takeover.+ *+ * Follows Chrome DevTools' own `InputModel.ts` (BSD-3) for the event translation and+ * `steel-dev/steel-browser`'s casting handler (Apache-2.0) for the frame loop, because no maintained+ * library publishes this and every real implementation is one app-internal file.+ */++/**+ * CDP's modifier bitmask. Alt 1, Control 2, Meta 4, Shift 8.+ *+ * Needed or a capital letter typed with Shift arrives lower-case, and Ctrl+A selects nothing.+ */+function modifierBits(event: {+ altKey: boolean;+ ctrlKey: boolean;+ metaKey: boolean;+ shiftKey: boolean;+}): number {+ return (+ (event.altKey ? 1 : 0) |+ (event.ctrlKey ? 2 : 0) |+ (event.metaKey ? 4 : 0) |+ (event.shiftKey ? 8 : 0)+ );+}++type Props = {+ /**+ * Computer identity is part of the stream URL so input and frames stay scoped to the active Bot.+ */+ computerId: string;+ /** Whether the user currently holds the wheel. Input is only sent when true. */+ driving: boolean;+ /** Called with a human-readable reason when the stream cannot be established. */+ onProblem?: (problem: string | null) => void;+};++export function LiveScreen({ computerId, driving, onProblem }: Props) {+ const canvasRef = useRef<HTMLCanvasElement | null>(null);+ const socketRef = useRef<WebSocket | null>(null);+ /** The size of the frames Chrome is sending, which is what input coordinates are relative to. */+ const frameSize = useRef<{ width: number; height: number } | null>(null);+ const [connected, setConnected] = useState(false);++ useEffect(() => {+ // Same origin, so the scheme follows the page: wss when the app is served over https.+ const scheme = window.location.protocol === "https:" ? "wss" : "ws";+ const socket = new WebSocket(+ `${scheme}://${window.location.host}/api/computers/${encodeURIComponent(computerId)}/stream`,+ );+ socketRef.current = socket;+ let closed = false;++ socket.onopen = () => {+ setConnected(true);+ onProblem?.(null);+ };++ socket.onmessage = async (event) => {+ let message: {+ type: string;+ data?: string;+ width?: number;+ height?: number;+ error?: string;+ };+ try {+ message = JSON.parse(String(event.data));+ } catch {+ return;+ }+ if (message.type === "error") {+ onProblem?.(message.error ?? "The screen could not be shown.");+ return;+ }+ if (message.type !== "frame" || !message.data) return;++ const canvas = canvasRef.current;+ if (!canvas || closed) return;++ frameSize.current = {+ width: message.width ?? 1280,+ height: message.height ?? 800,+ };++ /**+ * Decoded off the main thread and drawn as a bitmap.+ *+ * `createImageBitmap` rather than assigning a data URI to an `<img>`: the image path decodes+ * synchronously on the main thread for every frame, which at screencast rates is the difference+ * between a smooth page and one that stutters while you are trying to click something on it.+ */+ try {+ const binary = Uint8Array.from(atob(message.data), (c) =>+ c.charCodeAt(0),+ );+ const bitmap = await createImageBitmap(+ new Blob([binary], { type: "image/jpeg" }),+ );+ if (closed) {+ bitmap.close();+ return;+ }+ canvas.width = bitmap.width;+ canvas.height = bitmap.height;+ canvas.getContext("2d")?.drawImage(bitmap, 0, 0);+ bitmap.close();+ } catch {+ // Ignore a single corrupt frame; the next frame replaces it.+ }+ };++ socket.onerror = () => onProblem?.("The live screen could not be reached.");+ socket.onclose = () => setConnected(false);++ return () => {+ closed = true;+ socket.close();+ socketRef.current = null;+ };+ // The socket is per Bot; switching Bot must close this stream and open the next one.+ }, [computerId, onProblem]);++ const send = useCallback(+ (message: Record<string, unknown>) => {+ const socket = socketRef.current;+ if (!driving || socket?.readyState !== WebSocket.OPEN) return;+ socket.send(JSON.stringify(message));+ },+ [driving],+ );++ /**+ * Convert from displayed canvas coordinates to page coordinates with the shared, tested helper.+ * A screencast frame is the viewport, so its frame size stands in for natural image size.+ */+ const at = useCallback((event: React.MouseEvent) => {+ const canvas = canvasRef.current;+ const size = frameSize.current;+ if (!canvas || !size) return null;+ return pageCoordinates(+ { naturalWidth: size.width, naturalHeight: size.height },+ canvas.getBoundingClientRect(),+ event,+ );+ }, []);++ const onMouse = useCallback(+ (kind: "pressed" | "released" | "moved") =>+ (event: React.MouseEvent<HTMLCanvasElement>) => {+ const point = at(event);+ if (!point) return;+ send({+ type: "mouse",+ event: kind,+ ...point,+ button:+ event.button === 2+ ? "right"+ : event.button === 1+ ? "middle"+ : "left",+ clickCount: kind === "moved" ? 0 : 1,+ modifiers: modifierBits(event),+ });+ },+ [at, send],+ );++ /**+ * Keystrokes, forwarded while driving.+ *+ * Listen on window because canvas cannot hold focus. `preventDefault` keeps Tab and typing directed+ * at the remote page while takeover is active.+ */+ useEffect(() => {+ if (!driving) return;+ const onKeyDown = (event: KeyboardEvent) => {+ if (event.key === "Escape") return; // Escape still closes the view.+ event.preventDefault();+ send({+ type: "key",+ event: "down",+ key: event.key,+ code: event.code,+ // Only a printable character carries text. Sending text for Backspace makes Chrome insert a+ // character instead of deleting one.+ ...(event.key.length === 1 ? { text: event.key } : {}),+ modifiers: modifierBits(event),+ });+ };+ const onKeyUp = (event: KeyboardEvent) => {+ if (event.key === "Escape") return;+ event.preventDefault();+ send({+ type: "key",+ event: "up",+ key: event.key,+ code: event.code,+ modifiers: modifierBits(event),+ });+ };+ /** Paste arrives as one block; CDP inserts it as text rather than key events. */+ const onPaste = (event: ClipboardEvent) => {+ const text = event.clipboardData?.getData("text");+ if (!text) return;+ event.preventDefault();+ send({ type: "text", text });+ };++ window.addEventListener("keydown", onKeyDown);+ window.addEventListener("keyup", onKeyUp);+ window.addEventListener("paste", onPaste);+ return () => {+ window.removeEventListener("keydown", onKeyDown);+ window.removeEventListener("keyup", onKeyUp);+ window.removeEventListener("paste", onPaste);+ };+ }, [driving, send]);++ return (+ <canvas+ ref={canvasRef}+ className={`block h-auto w-full ${driving ? "cursor-crosshair" : ""}`}+ // Only forward input during takeover.+ {...(driving+ ? {+ onMouseDown: onMouse("pressed"),+ onMouseUp: onMouse("released"),+ onMouseMove: onMouse("moved"),+ onContextMenu: (event: React.MouseEvent) => event.preventDefault(),+ onWheel: (event: React.WheelEvent<HTMLCanvasElement>) => {+ const point = at(event);+ if (!point) return;+ event.preventDefault();+ send({+ type: "wheel",+ ...point,+ deltaX: event.deltaX,+ deltaY: event.deltaY,+ modifiers: modifierBits(event),+ });+ },+ }+ : {})}+ aria-label={+ driving+ ? "The assistant's screen. You have control: click and type here."+ : "The assistant's screen, live"+ }+ data-connected={connected}+ />+ );+}diff --git a/app/src/components/computer/needs-you.ts b/app/src/components/computer/needs-you.tsnew file mode 100644index 00000000..cbed6777--- /dev/null+++ b/app/src/components/computer/needs-you.ts@@ -0,0 +1,37 @@+import { useEffect, useState } from "react";+import { readControl } from "./take-the-wheel";++/**+ * Poll closed screens for control/secret prompts so blocked Bots can surface outside the screen.+ */++const INTERVAL_MS = 3_000;++export function useNeedsYou(botId: string | undefined, when: boolean): boolean {+ const [needed, setNeeded] = useState(false);++ useEffect(() => {+ if (!botId || !when) {+ setNeeded(false);+ return;+ }++ let live = true;+ const check = async () => {+ const state = await readControl(botId).catch(() => null);+ if (!live) return;+ setNeeded(+ Boolean(state && (state.requested || state.secretWanted !== undefined)),+ );+ };++ void check();+ const timer = setInterval(() => void check(), INTERVAL_MS);+ return () => {+ live = false;+ clearInterval(timer);+ };+ }, [botId, when]);++ return needed;+}diff --git a/app/src/components/gallery/activity.tsx b/app/src/components/gallery/activity.tsxnew file mode 100644index 00000000..a0c66743--- /dev/null+++ b/app/src/components/gallery/activity.tsx@@ -0,0 +1,285 @@+import { useEffect, useState } from "react";+import { z } from "zod";+import { Button } from "@/components/ui/button";+import { callComponentFunction } from "@/lib/components/queries";+import { useActiveBotId } from "@/lib/copilot/active-bot";+import { useConversation } from "@/lib/copilot/conversation";+import type { GalleryComponent } from "@/lib/copilot/gallery-registry";+import { GalleryFrame } from "./frame";+import { seriesColour } from "./palette";++/**+ * Server-filled report component. The model chooses report arguments; data and permissions come+ * from the deployment.+ */++export const ActivityReportProps = z.object({+ report: z+ .enum(["activity", "refusals"])+ .describe(+ "Which report to show: 'activity' for how much each Bot has done, 'refusals' for what this deployment recently refused",+ ),+ title: z+ .string()+ .optional()+ .describe("A heading for the report, in a few words"),+ days: z+ .number()+ .optional()+ .describe(+ "For the activity report: how many days back to count. Defaults to 7",+ ),+});++type ActivityArgs = z.infer<typeof ActivityReportProps>;++/** Which server-side function each report reads. Not the model's choice. */+const FUNCTION_FOR: Record<string, string> = {+ activity: "botActivity",+ refusals: "recentRefusals",+};++type ActivityRow = { bot: string; actions: number };+type RefusalRow = {+ at: string;+ bot: string | null;+ what: string;+ reason: string | null;+};++type State =+ | { status: "reading" }+ | { status: "refused"; reason: string }+ | { status: "read"; data: unknown };++export function ActivityReportCard({+ report,+ title,+ days,+}: Partial<ActivityArgs>) {+ const botId = useActiveBotId();+ const conversation = useConversation();+ const [state, setState] = useState<State>({ status: "reading" });++ const functionName = report ? FUNCTION_FOR[report] : undefined;++ useEffect(() => {+ // Nothing to read until the arguments have finished streaming in.+ if (!functionName) return;+ let current = true;++ void callComponentFunction(+ "showActivityReport",+ functionName,+ days === undefined ? {} : { days },+ botId,+ ).then((result) => {+ if (!current) return;+ setState(+ result.allowed && result.data !== undefined+ ? { status: "read", data: result.data }+ : {+ status: "refused",+ reason:+ result.reason ?? result.error ?? "That data could not be read.",+ },+ );+ });++ return () => {+ current = false;+ };+ }, [functionName, days, botId]);++ if (!report) {+ return (+ <GalleryFrame title="Report">+ <p className="text-sm text-muted-foreground">Choosing a report…</p>+ </GalleryFrame>+ );+ }++ if (state.status === "reading") {+ return (+ <GalleryFrame+ caption="Reading from this deployment"+ title={title ?? "Report"}+ >+ <p className="text-sm text-muted-foreground">Reading…</p>+ </GalleryFrame>+ );+ }++ if (state.status === "refused") {+ return (+ <GalleryFrame title={title ?? "Report"}>+ <p className="text-sm text-destructive">Not shown</p>+ <p className="mt-1 text-sm text-foreground/80">{state.reason}</p>+ </GalleryFrame>+ );+ }++ return report === "activity" ? (+ <ActivityChart+ ask={conversation?.ask}+ data={state.data as { days: number; rows: ActivityRow[] }}+ title={title}+ />+ ) : (+ <RefusalList+ ask={conversation?.ask}+ data={state.data as { rows: RefusalRow[] }}+ title={title}+ />+ );+}++function ActivityChart({+ data,+ title,+ ask,+}: {+ data: { days: number; rows: ActivityRow[] };+ title?: string;+ ask?: (text: string) => void;+}) {+ const rows = data?.rows ?? [];+ if (rows.length === 0) {+ return (+ <GalleryFrame title={title ?? "Bot activity"}>+ <p className="text-sm text-muted-foreground">+ No Bot has done anything in the last {data?.days ?? 7} days.+ </p>+ </GalleryFrame>+ );+ }++ const busiest = rows[0];+ const most = Math.max(...rows.map((row) => row.actions));++ return (+ <GalleryFrame+ action={+ ask && busiest ? (+ <Button+ onClick={() =>+ ask(+ `What has ${busiest.bot} actually been doing? Look at the audit trail and summarise it.`,+ )+ }+ size="sm"+ variant="outline"+ >+ Ask about the busiest+ </Button>+ ) : undefined+ }+ caption={`Counted from this deployment's audit trail, last ${data.days} days`}+ title={title ?? "Bot activity"}+ >+ <ul className="flex flex-col gap-2">+ {rows.map((row, index) => (+ <li className="flex items-center gap-3" key={row.bot}>+ <span className="w-40 shrink-0 truncate text-xs text-muted-foreground">+ {row.bot}+ </span>+ <span className="h-4 flex-1 overflow-hidden rounded bg-foreground/5">+ <span+ className="block h-full rounded"+ style={{+ backgroundColor: seriesColour(index),+ // Normalize to the busiest Bot so relative activity stays readable across ranges.+ width: `${most === 0 ? 0 : Math.round((row.actions / most) * 100)}%`,+ }}+ />+ </span>+ <span className="w-12 shrink-0 text-right text-xs tabular-nums">+ {row.actions}+ </span>+ </li>+ ))}+ </ul>+ </GalleryFrame>+ );+}++function RefusalList({+ data,+ title,+ ask,+}: {+ data: { rows: RefusalRow[] };+ title?: string;+ ask?: (text: string) => void;+}) {+ const rows = data?.rows ?? [];+ if (rows.length === 0) {+ return (+ <GalleryFrame title={title ?? "Recent refusals"}>+ <p className="text-sm text-muted-foreground">+ This deployment has refused nothing.+ </p>+ </GalleryFrame>+ );+ }++ return (+ <GalleryFrame+ action={+ ask ? (+ <Button+ onClick={() =>+ ask(+ "Explain the most recent refusal in that list, and what would have to change for it to be allowed.",+ )+ }+ size="sm"+ variant="outline"+ >+ Explain the latest+ </Button>+ ) : undefined+ }+ caption="Read from this deployment's audit trail"+ title={title ?? "Recent refusals"}+ >+ <ul className="flex flex-col gap-2">+ {rows.map((row) => (+ <li className="text-sm" key={`${row.at}-${row.what}`}>+ <div className="flex items-baseline gap-2">+ <span className="font-medium">{row.what}</span>+ {row.bot ? (+ <span className="text-xs text-muted-foreground">{row.bot}</span>+ ) : null}+ <span className="ml-auto text-xs text-muted-foreground">+ {new Date(row.at).toLocaleString()}+ </span>+ </div>+ {row.reason ? (+ <p className="text-xs text-muted-foreground">{row.reason}</p>+ ) : null}+ </li>+ ))}+ </ul>+ </GalleryFrame>+ );+}++export const GALLERY: GalleryComponent[] = [+ {+ name: "showActivityReport",+ title: "Activity report",+ kind: "card",+ description:+ "Show what this deployment has actually been doing, read from its own records rather than from anything you know. Use for 'what have the Bots been up to' and 'what has been refused'. You choose the report and the period; the figures are read for you and you will not see them.",+ parameters: ActivityReportProps,+ Component: ActivityReportCard as GalleryComponent["Component"],+ confirmation:+ "The report is on screen for the person, filled with figures read from this deployment. You were not given the figures.",+ reads: (args) => {+ const report = typeof args.report === "string" ? args.report : undefined;+ const functionName = report ? FUNCTION_FOR[report] : undefined;+ return functionName ? [functionName] : [];+ },+ },+];diff --git a/app/src/components/gallery/cards.tsx b/app/src/components/gallery/cards.tsxnew file mode 100644index 00000000..24c51f22--- /dev/null+++ b/app/src/components/gallery/cards.tsx@@ -0,0 +1,265 @@+import { z } from "zod";+import type { GalleryComponent } from "@/lib/copilot/gallery-registry";+import { Badge, GalleryFrame, type Tone } from "./frame";++const tone = z+ .enum(["neutral", "positive", "caution", "negative"])+ .describe(+ "How this reads at a glance. Use negative and caution sparingly, for a refusal, a breach or a failure, not for anything merely notable",+ );++export const RecordCardProps = z.object({+ title: z.string().describe("What this record is, e.g. a person or an order"),+ subtitle: z+ .string()+ .optional()+ .describe("One line of context under the title"),+ status: z.string().optional().describe("A short status word, e.g. Approved"),+ statusTone: tone.optional(),+ fields: z+ .array(+ z.object({+ label: z.string(),+ value: z.string().describe("Already formatted for a person to read"),+ }),+ )+ .describe("The fields, in the order they should be read"),+});++export function RecordCard({+ title,+ subtitle,+ status,+ statusTone,+ fields: given,+}: Partial<z.infer<typeof RecordCardProps>>) {+ const fields = given ?? [];+ return (+ <GalleryFrame+ action={+ status ? <Badge tone={statusTone as Tone}>{status}</Badge> : undefined+ }+ caption={subtitle}+ title={title}+ >+ <dl className="grid grid-cols-[minmax(0,10rem)_1fr] gap-x-4 gap-y-2 text-sm">+ {fields.map((field) => (+ <div className="contents" key={field.label}>+ <dt className="truncate text-muted-foreground">{field.label}</dt>+ {/* Field values wrap because truncation can hide the reported data. */}+ <dd className="min-w-0 break-words">{field.value}</dd>+ </div>+ ))}+ </dl>+ </GalleryFrame>+ );+}++export const MetricsCardProps = z.object({+ title: z.string().describe("What these figures are about"),+ caption: z.string().optional(),+ metrics: z+ .array(+ z.object({+ label: z.string(),+ value: z+ .string()+ .describe("Already formatted, including any unit or currency"),+ change: z+ .string()+ .optional()+ .describe("The movement, e.g. '+12% on last month'"),+ changeTone: tone.optional(),+ }),+ )+ .max(6)+ .describe("Up to six figures. More than that wanted a table"),+});++export function MetricsCard({+ title,+ caption,+ metrics: given,+}: Partial<z.infer<typeof MetricsCardProps>>) {+ const metrics = given ?? [];+ return (+ <GalleryFrame caption={caption} title={title}>+ <div className="grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3">+ {metrics.map((metric) => (+ <div key={metric.label}>+ <p className="truncate text-xs text-muted-foreground">+ {metric.label}+ </p>+ <p className="mt-0.5 text-xl font-semibold tabular-nums">+ {metric.value}+ </p>+ {metric.change ? (+ <p className="mt-0.5">+ <Badge tone={metric.changeTone as Tone}>{metric.change}</Badge>+ </p>+ ) : null}+ </div>+ ))}+ </div>+ </GalleryFrame>+ );+}++export const ChecklistCardProps = z.object({+ title: z.string().describe("What this list is"),+ caption: z.string().optional(),+ items: z+ .array(+ z.object({+ text: z.string(),+ done: z.boolean().describe("Whether this one is already finished"),+ note: z+ .string()+ .optional()+ .describe("A short aside, e.g. who it is waiting on"),+ }),+ )+ .describe("The items, in the order they should be done"),+});++/**+ * A read-only checklist. Interactive decisions use the approval components where answers go back+ * to the Bot.+ */+export function ChecklistCard({+ title,+ caption,+ items: given,+}: Partial<z.infer<typeof ChecklistCardProps>>) {+ const items = given ?? [];+ const done = items.filter((item) => item.done).length;+ return (+ <GalleryFrame+ action={+ <Badge+ tone={+ done === items.length && items.length > 0 ? "positive" : "neutral"+ }+ >+ {done} of {items.length}+ </Badge>+ }+ caption={caption}+ title={title}+ >+ <ul className="space-y-2">+ {items.map((item) => (+ <li className="flex items-start gap-2.5 text-sm" key={item.text}>+ <span+ aria-hidden="true"+ className={`mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-[5px] border text-[10px] ${+ item.done+ ? "border-transparent bg-emerald-500 text-white"+ : "border-border"+ }`}+ >+ {item.done ? "✓" : ""}+ </span>+ <span className="min-w-0">+ <span+ className={+ item.done ? "text-muted-foreground line-through" : ""+ }+ >+ {item.text}+ </span>+ {item.note ? (+ <span className="block text-xs text-muted-foreground">+ {item.note}+ </span>+ ) : null}+ </span>+ </li>+ ))}+ </ul>+ </GalleryFrame>+ );+}++export const NoticeCardProps = z.object({+ title: z.string().describe("The headline, in a few words"),+ body: z.string().describe("The explanation, in one or two sentences"),+ tone: tone.optional(),+ points: z+ .array(z.string())+ .optional()+ .describe("Supporting points, if there are any"),+});++export function NoticeCard({+ title,+ body,+ tone: noticeTone,+ points,+}: Partial<z.infer<typeof NoticeCardProps>>) {+ return (+ <GalleryFrame+ action={+ noticeTone && noticeTone !== "neutral" ? (+ <Badge tone={noticeTone}>{noticeTone}</Badge>+ ) : undefined+ }+ title={title}+ >+ <p className="text-sm">{body}</p>+ {points?.length ? (+ <ul className="mt-2 space-y-1 text-sm text-muted-foreground">+ {points.map((entry) => (+ <li className="flex gap-2" key={entry}>+ <span aria-hidden="true">·</span>+ <span className="min-w-0">{entry}</span>+ </li>+ ))}+ </ul>+ ) : null}+ </GalleryFrame>+ );+}++export const GALLERY: GalleryComponent[] = [+ {+ name: "showRecord",+ title: "Record",+ kind: "card",+ description:+ "Show one thing and its fields, an order, a person, a ticket. Use instead of describing a record in prose.",+ parameters: RecordCardProps,+ Component: RecordCard as GalleryComponent["Component"],+ confirmation: "The record is now on screen for the person.",+ },+ {+ name: "showMetrics",+ title: "Headline figures",+ kind: "card",+ description:+ "Show up to six headline figures, each with an optional movement. Use for a summary somebody reads at a glance.",+ parameters: MetricsCardProps,+ Component: MetricsCard as GalleryComponent["Component"],+ confirmation: "The figures are now on screen for the person.",+ },+ {+ name: "showChecklist",+ title: "Checklist",+ kind: "card",+ description:+ "Show a list of things and which are done. Reporting only, the person cannot tick these, so do not use it to ask for anything.",+ parameters: ChecklistCardProps,+ Component: ChecklistCard as GalleryComponent["Component"],+ confirmation: "The checklist is now on screen for the person.",+ },+ {+ name: "showNotice",+ title: "Notice",+ kind: "card",+ description:+ "Show a headline, a short explanation and optional supporting points. Use instead of writing several paragraphs of prose.",+ parameters: NoticeCardProps,+ Component: NoticeCard as GalleryComponent["Component"],+ confirmation: "The notice is now on screen for the person.",+ },+];diff --git a/app/src/components/gallery/frame.tsx b/app/src/components/gallery/frame.tsxnew file mode 100644index 00000000..a19eab3c--- /dev/null+++ b/app/src/components/gallery/frame.tsx@@ -0,0 +1,62 @@+import type { ReactNode } from "react";++export function GalleryFrame({+ title,+ caption,+ action,+ children,+}: {+ title?: string;+ /** One line under the title. The Bot's reason for showing this, not a description of the widget. */+ caption?: string;+ /** Buttons that act on what is shown, drawn beside the title rather than under the body. */+ action?: ReactNode;+ children: ReactNode;+}) {+ return (+ <figure className="my-2 w-full max-w-2xl overflow-hidden rounded-xl border border-border bg-card">+ {(title || action) && (+ <figcaption className="flex items-start justify-between gap-4 border-b border-border px-4 py-3">+ <div className="min-w-0">+ {title ? (+ <p className="truncate text-sm font-medium">{title}</p>+ ) : null}+ {caption ? (+ <p className="mt-0.5 text-xs text-muted-foreground">{caption}</p>+ ) : null}+ </div>+ {action ? <div className="shrink-0">{action}</div> : null}+ </figcaption>+ )}+ <div className="px-4 py-3">{children}</div>+ </figure>+ );+}++/** Fixed semantic tone vocabulary for model-filled components. */+export type Tone = "neutral" | "positive" | "caution" | "negative";++const TONES: Record<Tone, string> = {+ neutral: "bg-foreground/5 text-foreground/70",+ positive:+ "bg-emerald-500/10 text-emerald-700 dark:text-emerald-400 dark:bg-emerald-500/15",+ caution:+ "bg-amber-500/10 text-amber-700 dark:text-amber-400 dark:bg-amber-500/15",+ negative: "bg-red-500/10 text-red-700 dark:text-red-400 dark:bg-red-500/15",+};++export function Badge({+ tone = "neutral",+ children,+}: {+ tone?: Tone;+ children: ReactNode;+}) {+ return (+ <span+ className={`inline-flex items-center rounded-md px-1.5 py-0.5 text-xs font-medium ${TONES[tone]}`}+ >+ {children}+ </span>+ );+}diff --git a/app/src/components/gallery/quote.tsx b/app/src/components/gallery/quote.tsxnew file mode 100644index 00000000..d912c430--- /dev/null+++ b/app/src/components/gallery/quote.tsx@@ -0,0 +1,60 @@+import { z } from "zod";+import type { GalleryComponent } from "@/lib/copilot/gallery-registry";+import { GalleryFrame } from "./frame";++export const QuoteCardProps = z.object({+ quote: z+ .string()+ .describe("The quotation itself, without surrounding quote marks"),+ attribution: z+ .string()+ .describe(+ "Who said or wrote it, e.g. 'Grace Hopper' or 'the 2026 annual report'",+ ),+ context: z+ .string()+ .optional()+ .describe(+ "One short line of context: where it is from, or why it matters here",+ ),+});++type QuoteArgs = z.infer<typeof QuoteCardProps>;++export function QuoteCard({ quote, attribution, context }: Partial<QuoteArgs>) {+ if (!quote) {+ return (+ <GalleryFrame title="Quotation">+ <p className="text-sm text-muted-foreground">+ There is nothing to quote.+ </p>+ </GalleryFrame>+ );+ }++ return (+ <GalleryFrame caption={context} title="Quotation">+ <blockquote className="border-l-2 border-border pl-4">+ <p className="text-sm leading-relaxed">{quote}</p>+ {attribution ? (+ <footer className="mt-2 text-xs text-muted-foreground">+ , {attribution}+ </footer>+ ) : null}+ </blockquote>+ </GalleryFrame>+ );+}++export const GALLERY: GalleryComponent[] = [+ {+ name: "showQuote",+ title: "Quotation",+ kind: "card",+ description:+ "Show a quotation with its attribution. Use when the exact words matter, something a person said, or a line from a document you were given.",+ parameters: QuoteCardProps,+ Component: QuoteCard as GalleryComponent["Component"],+ confirmation: "The quotation is now on screen for the person.",+ },+];diff --git a/app/src/components/gallery/refused.tsx b/app/src/components/gallery/refused.tsxnew file mode 100644index 00000000..9fe3f3e7--- /dev/null+++ b/app/src/components/gallery/refused.tsx@@ -0,0 +1,22 @@+/**+ * Visible component refusal, using the same blocked-action semantics as computer policy refusals.+ */+export function RefusedCard({+ title,+ reason,+}: {+ /** The component's own title where we know it, so a person is not shown a tool name. */+ title: string;+ reason: string;+}) {+ return (+ <div+ className="my-2 w-full max-w-2xl rounded-xl border border-destructive/30 bg-destructive/5 px-4 py-3"+ data-testid="component-refused"+ role="status"+ >+ <p className="text-sm font-medium text-destructive">Not shown: {title}</p>+ <p className="mt-1 text-sm text-foreground/80">{reason}</p>+ </div>+ );+}diff --git a/app/src/components/layout/page-shell.tsx b/app/src/components/layout/page-shell.tsxnew file mode 100644index 00000000..d2e5e646--- /dev/null+++ b/app/src/components/layout/page-shell.tsx@@ -0,0 +1,145 @@+import type * as React from "react";++import { cn } from "@/lib/utils";++/**+ * The frame every configuration screen sits in.+ *+ * WHAT THIS IS FIXING. Admin was nine pages that shared no layout: four container widths plus three+ * pages with no container at all, four heading sizes, four padding schemes, and a sidebar 20px wider+ * than the rest of the app. Three of those pages imported nothing from `components/ui` and drew+ * their own buttons, inputs and tables. The result did not read as a different screen, it read as a+ * different application — which is the impression an administrator forms at exactly the moment they+ * are deciding whether to trust it with credentials.+ *+ * The shape was never in doubt: Skills and Settings already had it. So this is that shape, extracted+ * once and used everywhere, INCLUDING by Skills and Settings. Leaving those two as hand-written+ * copies would mean three dialects rather than two, and the next screen somebody writes copies+ * whichever it happened to see first.+ */++/**+ * `prose` is the default because configuration is mostly reading. A measure of around 65 characters+ * is where prose stays comfortable, and a row of label-and-control has no business being wider than+ * the sentence explaining it.+ *+ * `wide` exists for one page. An audit log is a table you scan, and forcing it into the prose column+ * would wrap every row. It is not a licence for anything else to be wide.+ */+type ShellWidth = "prose" | "wide";++const WIDTHS: Record<ShellWidth, string> = {+ prose: "max-w-2xl",+ wide: "max-w-5xl",+};++export function PageShell({+ action,+ children,+ className,+ description,+ title,+ width = "prose",+}: {+ /** Sits on the title's baseline. For the page's one primary verb, if it has one. */+ action?: React.ReactNode;+ children: React.ReactNode;+ className?: string;+ description?: React.ReactNode;+ title: string;+ width?: ShellWidth;+}) {+ return (+ <div+ className={cn(+ "mx-auto flex w-full flex-col px-4 py-12",+ WIDTHS[width],+ className,+ )}+ >+ <header className="flex flex-col gap-2">+ <div className="flex flex-row items-center justify-between gap-4">+ <h1 className="font-bold text-2xl">{title}</h1>+ {action}+ </div>+ {description ? (+ <p className="max-w-prose text-pretty text-muted-foreground text-sm leading-relaxed">+ {description}+ </p>+ ) : null}+ </header>+ {children}+ </div>+ );+}++/**+ * A titled group of rows.+ *+ * The gap above a section is deliberately large. These pages are lists of unrelated decisions, and+ * the space is what stops the eye running two of them together — it is doing the work a divider+ * would otherwise do, without drawing a line.+ */+export function PageSection({+ action,+ children,+ className,+ description,+ title,+}: {+ action?: React.ReactNode;+ children?: React.ReactNode;+ className?: string;+ description?: React.ReactNode;+ title?: string;+}) {+ return (+ <section className={cn("mt-12", className)}>+ {title ? (+ <div className="flex min-h-8 flex-row items-center justify-between gap-4">+ <h2 className="font-bold text-lg">{title}</h2>+ {action}+ </div>+ ) : null}+ {description ? (+ <p className="mt-1 max-w-prose text-pretty text-muted-foreground text-sm leading-relaxed">+ {description}+ </p>+ ) : null}+ {children}+ </section>+ );+}++/**+ * The card that rows live in.+ *+ * Rows are `<Item size="sm">` with a `<Separator />` between them; this is only the border around+ * them. Rendering nothing when there is nothing is deliberate — an empty bordered box reads as a+ * thing that failed to load, where absence reads as nothing to see yet.+ */+export function PageRows({+ children,+ className,+}: {+ children: React.ReactNode;+ className?: string;+}) {+ return (+ <div+ className={cn("mt-4 rounded-lg border border-border bg-card", className)}+ >+ {children}+ </div>+ );+}++/**+ * What a section says when it has nothing to list.+ *+ * Said in a sentence rather than drawn as an illustration with a heading: on a configuration screen+ * "nothing here yet" is a fact, not an event, and the page already told you what the section is for.+ */+export function PageEmpty({ children }: { children: React.ReactNode }) {+ return <p className="mt-4 text-muted-foreground text-sm">{children}</p>;+}diff --git a/app/src/components/settings/settings-sidebar.tsx b/app/src/components/settings/settings-sidebar.tsxnew file mode 100644index 00000000..471e58f5--- /dev/null+++ b/app/src/components/settings/settings-sidebar.tsx@@ -0,0 +1,72 @@+import { IconArrowLeft } from "@tabler/icons-react";+import { Link, type LinkOptions } from "@tanstack/react-router";+import type * as React from "react";+import {+ Sidebar,+ SidebarContent,+ SidebarGroup,+ SidebarHeader,+ SidebarMenu,+ SidebarMenuButton,+ SidebarMenuItem,+ SidebarRail,+} from "@/components/ui/sidebar";++const appLinkOptions = { to: "/" } satisfies LinkOptions;++const ITEMS = [+ {+ title: "General",+ linkOptions: { to: "/settings" },+ },+];++export function SettingsSidebar({+ ...props+}: React.ComponentProps<typeof Sidebar>) {+ return (+ <Sidebar {...props}>+ <SidebarHeader>+ <SidebarMenu>+ <SidebarMenuItem>+ <SidebarMenuButton+ size="lg"+ render={(props) => (+ <Link {...appLinkOptions} {...props}>+ <IconArrowLeft className="mr-2 h-4 w-4" />+ Back to app+ </Link>+ )}+ />+ </SidebarMenuItem>+ </SidebarMenu>+ </SidebarHeader>+ <SidebarContent>+ <SidebarMenu>+ <SidebarGroup>+ {ITEMS.map((option) => {+ return (+ <SidebarMenuItem key={option.title}>+ <SidebarMenuButton+ render={(props) => (+ <Link+ {...option.linkOptions}+ activeProps={{+ className: "bg-foreground/5",+ }}+ {...props}+ >+ {option.title}+ </Link>+ )}+ />+ </SidebarMenuItem>+ );+ })}+ </SidebarGroup>+ </SidebarMenu>+ </SidebarContent>+ <SidebarRail />+ </Sidebar>+ );+}diff --git a/app/src/components/skills/new-skill.tsx b/app/src/components/skills/new-skill.tsxnew file mode 100644index 00000000..a81c9cf6--- /dev/null+++ b/app/src/components/skills/new-skill.tsx@@ -0,0 +1,65 @@+import { useMutation, useQueryClient } from "@tanstack/react-query";+import { useNavigate } from "@tanstack/react-router";+import { SkillFields } from "@/components/skills/skill-fields";+import { pluginKeys } from "@/lib/plugins/queries";+import { emptySkillForm, type SkillFormValues } from "@/lib/skills/form";++/**+ * Writing a skill, in the detail panel beside the list.+ *+ * The panel rather than a page of its own, so the skills you already have stay on screen while you+ * write the next one — the usual reason to open this is to make a variant of one that exists.+ */+export function NewSkill() {+ const queryClient = useQueryClient();+ const navigate = useNavigate();++ const createSkill = useMutation({+ mutationFn: async (values: SkillFormValues) => {+ const response = await fetch("/api/plugins/skills", {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(values),+ });+ if (!response.ok) {+ /*+ * The server's sentence, not one invented here. It refuses for reasons this form cannot+ * check — a slug somebody else already owns is the common one — and paraphrasing that into+ * "That did not work" would throw away the only part worth reading.+ */+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ throw new Error(body?.error ?? "The skill could not be saved.");+ }+ return response.json();+ },+ onSuccess: () =>+ queryClient.invalidateQueries({ queryKey: pluginKeys.all }),+ });++ return (+ <div className="mx-auto flex w-full max-w-xl flex-col gap-6 p-8">+ <header>+ <h1 className="text-2xl font-semibold">New skill</h1>+ <p className="mt-1 text-sm text-muted-foreground">+ A named instruction you invoke with <code>/</code>. It goes on the+ Bots you own, and nobody else sees it.+ </p>+ </header>++ <SkillFields+ defaultValues={emptySkillForm}+ error={createSkill.error}+ onSubmit={async (values) => {+ await createSkill.mutateAsync(values);+ // Panel closed rather than swapped for a detail view: there is nothing more to say about a+ // skill than the form just said, and the new row is already behind it in the list.+ await navigate({ search: {}, to: "/skills" });+ }}+ submitLabel="Save skill"+ />+ </div>+ );+}diff --git a/app/src/components/skills/skill-agents.tsx b/app/src/components/skills/skill-agents.tsxnew file mode 100644index 00000000..5c1eb2c8--- /dev/null+++ b/app/src/components/skills/skill-agents.tsx@@ -0,0 +1,99 @@+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { Button } from "@/components/ui/button";+import { agentListQueryOptions } from "@/lib/agents/queries";+import { pluginKeys } from "@/lib/plugins/queries";++/**+ * Which of your Agents carry this skill.+ *+ * WITHOUT THIS THE SKILL DOES NOTHING. A skill reaches a Bot's `/` menu only through a grant: the+ * menu is fed by `GET /api/plugins/for/:agentId`, which returns what that Bot HOLDS, and a row in+ * `plugin_grants` IS the grant — absence is the refusal. A skill nobody granted is written, listed,+ * and invisible everywhere it would actually be used.+ *+ * ONLY BOTS THIS PERSON OWNS. The server's rule is that somebody may put THEIR OWN skill on a Bot+ * THEY OWN, and neither half alone is enough — a skill one person wrote would otherwise change how a+ * shared Bot answers everybody. Offering the others here and having them refused on click would be+ * a worse answer than not offering them.+ */+export function SkillAgents({+ slug,+ grantedTo,+}: {+ slug: string;+ grantedTo: string[];+}) {+ const queryClient = useQueryClient();+ const { data: agents } = useQuery(agentListQueryOptions());+ const mine = (agents ?? []).filter((agent) => agent.mine);+ const held = new Set(grantedTo);++ const toggle = useMutation({+ mutationFn: async ({ agentId, on }: { agentId: string; on: boolean }) => {+ const response = on+ ? await fetch(+ `/api/plugins/grants?kind=skill&ref=${encodeURIComponent(slug)}&agentId=${encodeURIComponent(agentId)}`,+ { method: "DELETE", credentials: "include" },+ )+ : await fetch("/api/plugins/grants", {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ kind: "skill", ref: slug, agentId }),+ });+ if (!response.ok) {+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ // The server's sentence: it knows why it refused and this component does not.+ throw new Error(body?.error ?? "That Agent could not be changed.");+ }+ },+ onSuccess: () =>+ queryClient.invalidateQueries({ queryKey: pluginKeys.all }),+ });++ return (+ <div className="flex flex-col gap-2">+ <h2 className="text-sm font-medium">Agents</h2>+ {mine.length === 0 ? (+ <p className="text-muted-foreground text-xs">+ You do not own an Agent to put this on yet.+ </p>+ ) : (+ <>+ <div className="flex flex-wrap gap-2">+ {mine.map((agent) => {+ const on = held.has(agent.id);+ return (+ <Button+ disabled={toggle.isPending}+ key={agent.id}+ onClick={() => toggle.mutate({ agentId: agent.id, on })}+ size="sm"+ type="button"+ /*+ * The state is the fill, not a tick alone: a row of outline buttons where one+ * carries a small mark reads as a list of choices rather than as a set of+ * switches, and which are on has to survive a glance.+ */+ variant={on ? "default" : "outline"}+ >+ {agent.name}+ </Button>+ );+ })}+ </div>+ <p className="text-muted-foreground text-xs">+ An Agent carrying this offers <code>/{slug}</code> in its composer.+ </p>+ </>+ )}+ {toggle.error ? (+ <p className="text-destructive text-xs" role="alert">+ {toggle.error.message}+ </p>+ ) : null}+ </div>+ );+}diff --git a/app/src/components/skills/skill-fields.tsx b/app/src/components/skills/skill-fields.tsxnew file mode 100644index 00000000..f2c15597--- /dev/null+++ b/app/src/components/skills/skill-fields.tsx@@ -0,0 +1,227 @@+import { useForm } from "@tanstack/react-form";+import { Button } from "@/components/ui/button";+import {+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+} from "@/components/ui/field";+import { Input } from "@/components/ui/input";+import { Textarea } from "@/components/ui/textarea";+import { type SkillFormValues, skillFormSchema } from "@/lib/skills/form";++/**+ * The four things a person decides about a skill: what they type, what it is called, what it is+ * for, and what the Bot is actually told.+ *+ * Written as its own component rather than inline in the panel because creating and editing a skill+ * are the same four fields, and the second one is coming — a skill whose instructions can only be+ * set once is a skill nobody will correct.+ */+export function SkillFields({+ defaultValues,+ submitLabel,+ onSubmit,+ error,+ onCancel,+ footer,+ slugLocked = false,+}: {+ defaultValues: SkillFormValues;+ submitLabel: string;+ onSubmit: (values: SkillFormValues) => Promise<unknown>;+ error?: Error | null;+ onCancel?: () => void;+ /** Anything that belongs with the skill but saves on its own, shown above the submit button. */+ footer?: React.ReactNode;+ /**+ * Editing, where the command cannot change.+ *+ * THE SLUG IS THE KEY, so saving under a different one would not rename anything: it would write a+ * SECOND skill and leave the first behind, and the person would be looking at a duplicate they did+ * not ask for. Renaming is a create and a delete, which is a decision rather than a typo, so the+ * field is read-only here and the form says why.+ */+ slugLocked?: boolean;+}) {+ const form = useForm({+ defaultValues,+ validators: { onSubmit: skillFormSchema },+ onSubmit: async ({ value }) => {+ await onSubmit(value);+ },+ });++ return (+ <form+ noValidate+ onSubmit={(event) => {+ event.preventDefault();+ form.handleSubmit();+ }}+ >+ <FieldGroup>+ <form.Field name="slug">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Command</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ disabled={slugLocked}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ /*+ * Lower-cased as they type rather than refused afterwards. The server's pattern+ * has no capitals in it, and "Standup" is a reasonable thing to type and a+ * pointless thing to be told off for.+ */+ onChange={(event) =>+ field.handleChange(event.target.value.toLowerCase())+ }+ placeholder="standup"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : (+ <p className="text-muted-foreground text-xs">+ {slugLocked ? (+ "A command cannot be changed. To rename a skill, write a new one and delete this."+ ) : (+ <>+ What you type after a slash.{" "}+ <code>+ /{"{"}command{"}"}+ </code>+ </>+ )}+ </p>+ )}+ </Field>+ );+ }}+ </form.Field>++ <form.Field name="title">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Title</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="My standup skill"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>++ <form.Field name="summary">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>One-liner</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="Turns yesterday's work into a standup update"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : (+ <p className="text-muted-foreground text-xs">+ Shown beside the command in this list and in the{" "}+ <code>/</code> menu. Optional.+ </p>+ )}+ </Field>+ );+ }}+ </form.Field>++ <form.Field name="instructions">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Instructions</FieldLabel>+ <Textarea+ aria-invalid={isInvalid}+ className="min-h-40"+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) => field.handleChange(event.target.value)}+ placeholder="Summarise what I did yesterday from the channel, then list what is left."+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : (+ <p className="text-muted-foreground text-xs">+ Added to the run when the command is used. Write it as+ instructions to the Bot, not as a description of them.+ </p>+ )}+ </Field>+ );+ }}+ </form.Field>+ </FieldGroup>++ {/*+ * Rendered by the caller, between the fields and the buttons, so granting sits with the rest+ * of the skill rather than after the point where the form is finished with.+ *+ * IT IS NOT PART OF THE FORM'S STATE. Each toggle saves the moment it is pressed, while+ * everything above waits for the submit button — so it must not look like a field, and+ * pressing one is never undone by closing the panel without saving.+ */}+ {footer ? <div className="mt-6">{footer}</div> : null}++ {error ? (+ <p className="mt-4 text-sm text-destructive" role="alert">+ {error.message}+ </p>+ ) : null}++ <div className="mt-4 flex gap-2">+ <form.Subscribe+ selector={(state) => [state.canSubmit, state.isSubmitting]}+ >+ {([canSubmit, isSubmitting]) => (+ <Button disabled={!canSubmit || isSubmitting} type="submit">+ {isSubmitting ? "Saving…" : submitLabel}+ </Button>+ )}+ </form.Subscribe>+ {onCancel ? (+ <Button onClick={onCancel} type="button" variant="outline">+ Cancel+ </Button>+ ) : null}+ </div>+ </form>+ );+}diff --git a/app/src/components/ui/button.tsx b/app/src/components/ui/button.tsxnew file mode 100644index 00000000..f71ec13d--- /dev/null+++ b/app/src/components/ui/button.tsx@@ -0,0 +1,58 @@+import { Button as ButtonPrimitive } from "@base-ui/react/button"+import { cva, type VariantProps } from "class-variance-authority"++import { cn } from "@/lib/utils"++const buttonVariants = cva(+ "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-[color,background-color,border-color,box-shadow,translate,opacity] duration-150 ease-out outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ {+ variants: {+ variant: {+ default: "bg-primary text-primary-foreground hover:bg-primary/80",+ outline:+ "border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",+ secondary:+ "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",+ ghost:+ "hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",+ destructive:+ "bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",+ link: "text-primary underline-offset-4 hover:underline",+ },+ size: {+ default:+ "h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",+ xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",+ sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",+ lg: "h-10 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",+ icon: "size-8",+ "icon-xs":+ "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3",+ "icon-sm":+ "size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg",+ "icon-lg": "size-9",+ },+ },+ defaultVariants: {+ variant: "default",+ size: "default",+ },+ }+)++function Button({+ className,+ variant = "default",+ size = "default",+ ...props+}: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {+ return (+ <ButtonPrimitive+ data-slot="button"+ className={cn(buttonVariants({ variant, size, className }))}+ {...props}+ />+ )+}++export { Button, buttonVariants }diff --git a/app/src/components/ui/dropdown-menu.tsx b/app/src/components/ui/dropdown-menu.tsxnew file mode 100644index 00000000..46ef9f2f--- /dev/null+++ b/app/src/components/ui/dropdown-menu.tsx@@ -0,0 +1,266 @@+import * as React from "react"+import { Menu as MenuPrimitive } from "@base-ui/react/menu"++import { cn } from "@/lib/utils"+import { IconChevronRight, IconCheck } from "@tabler/icons-react"++function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {+ return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />+}++function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {+ return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />+}++function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {+ return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />+}++function DropdownMenuContent({+ align = "start",+ alignOffset = 0,+ side = "bottom",+ sideOffset = 4,+ className,+ ...props+}: MenuPrimitive.Popup.Props &+ Pick<+ MenuPrimitive.Positioner.Props,+ "align" | "alignOffset" | "side" | "sideOffset"+ >) {+ return (+ <MenuPrimitive.Portal>+ <MenuPrimitive.Positioner+ className="isolate z-50 outline-none"+ align={align}+ alignOffset={alignOffset}+ side={side}+ sideOffset={sideOffset}+ >+ <MenuPrimitive.Popup+ data-slot="dropdown-menu-content"+ className={cn("z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ {...props}+ />+ </MenuPrimitive.Positioner>+ </MenuPrimitive.Portal>+ )+}++function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {+ return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />+}++function DropdownMenuLabel({+ className,+ inset,+ ...props+}: MenuPrimitive.GroupLabel.Props & {+ inset?: boolean+}) {+ return (+ <MenuPrimitive.GroupLabel+ data-slot="dropdown-menu-label"+ data-inset={inset}+ className={cn(+ "px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7",+ className+ )}+ {...props}+ />+ )+}++function DropdownMenuItem({+ className,+ inset,+ variant = "default",+ ...props+}: MenuPrimitive.Item.Props & {+ inset?: boolean+ variant?: "default" | "destructive"+}) {+ return (+ <MenuPrimitive.Item+ data-slot="dropdown-menu-item"+ data-inset={inset}+ data-variant={variant}+ className={cn(+ "group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive",+ className+ )}+ {...props}+ />+ )+}++function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {+ return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />+}++function DropdownMenuSubTrigger({+ className,+ inset,+ children,+ ...props+}: MenuPrimitive.SubmenuTrigger.Props & {+ inset?: boolean+}) {+ return (+ <MenuPrimitive.SubmenuTrigger+ data-slot="dropdown-menu-sub-trigger"+ data-inset={inset}+ className={cn(+ "flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-popup-open:bg-accent data-popup-open:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ className+ )}+ {...props}+ >+ {children}+ <IconChevronRight className="ml-auto" />+ </MenuPrimitive.SubmenuTrigger>+ )+}++function DropdownMenuSubContent({+ align = "start",+ alignOffset = -3,+ side = "right",+ sideOffset = 0,+ className,+ ...props+}: React.ComponentProps<typeof DropdownMenuContent>) {+ return (+ <DropdownMenuContent+ data-slot="dropdown-menu-sub-content"+ className={cn("w-auto min-w-[96px] rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}+ align={align}+ alignOffset={alignOffset}+ side={side}+ sideOffset={sideOffset}+ {...props}+ />+ )+}++function DropdownMenuCheckboxItem({+ className,+ children,+ checked,+ inset,+ ...props+}: MenuPrimitive.CheckboxItem.Props & {+ inset?: boolean+}) {+ return (+ <MenuPrimitive.CheckboxItem+ data-slot="dropdown-menu-checkbox-item"+ data-inset={inset}+ className={cn(+ "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ className+ )}+ checked={checked}+ {...props}+ >+ <span+ className="pointer-events-none absolute right-2 flex items-center justify-center"+ data-slot="dropdown-menu-checkbox-item-indicator"+ >+ <MenuPrimitive.CheckboxItemIndicator>+ <IconCheck+ />+ </MenuPrimitive.CheckboxItemIndicator>+ </span>+ {children}+ </MenuPrimitive.CheckboxItem>+ )+}++function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {+ return (+ <MenuPrimitive.RadioGroup+ data-slot="dropdown-menu-radio-group"+ {...props}+ />+ )+}++function DropdownMenuRadioItem({+ className,+ children,+ inset,+ ...props+}: MenuPrimitive.RadioItem.Props & {+ inset?: boolean+}) {+ return (+ <MenuPrimitive.RadioItem+ data-slot="dropdown-menu-radio-item"+ data-inset={inset}+ className={cn(+ "relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ className+ )}+ {...props}+ >+ <span+ className="pointer-events-none absolute right-2 flex items-center justify-center"+ data-slot="dropdown-menu-radio-item-indicator"+ >+ <MenuPrimitive.RadioItemIndicator>+ <IconCheck+ />+ </MenuPrimitive.RadioItemIndicator>+ </span>+ {children}+ </MenuPrimitive.RadioItem>+ )+}++function DropdownMenuSeparator({+ className,+ ...props+}: MenuPrimitive.Separator.Props) {+ return (+ <MenuPrimitive.Separator+ data-slot="dropdown-menu-separator"+ className={cn("-mx-1 my-1 h-px bg-border", className)}+ {...props}+ />+ )+}++function DropdownMenuShortcut({+ className,+ ...props+}: React.ComponentProps<"span">) {+ return (+ <span+ data-slot="dropdown-menu-shortcut"+ className={cn(+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground",+ className+ )}+ {...props}+ />+ )+}++export {+ DropdownMenu,+ DropdownMenuPortal,+ DropdownMenuTrigger,+ DropdownMenuContent,+ DropdownMenuGroup,+ DropdownMenuLabel,+ DropdownMenuItem,+ DropdownMenuCheckboxItem,+ DropdownMenuRadioGroup,+ DropdownMenuRadioItem,+ DropdownMenuSeparator,+ DropdownMenuShortcut,+ DropdownMenuSub,+ DropdownMenuSubTrigger,+ DropdownMenuSubContent,+}diff --git a/app/src/components/ui/empty.tsx b/app/src/components/ui/empty.tsxnew file mode 100644index 00000000..b23187b0--- /dev/null+++ b/app/src/components/ui/empty.tsx@@ -0,0 +1,104 @@+import { cva, type VariantProps } from "class-variance-authority"++import { cn } from "@/lib/utils"++function Empty({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty"+ className={cn(+ "flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-xl border-dashed p-6 text-center text-balance",+ className+ )}+ {...props}+ />+ )+}++function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty-header"+ className={cn("flex max-w-sm flex-col items-center gap-2", className)}+ {...props}+ />+ )+}++const emptyMediaVariants = cva(+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",+ {+ variants: {+ variant: {+ default: "bg-transparent",+ icon: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-4",+ },+ },+ defaultVariants: {+ variant: "default",+ },+ }+)++function EmptyMedia({+ className,+ variant = "default",+ ...props+}: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {+ return (+ <div+ data-slot="empty-icon"+ data-variant={variant}+ className={cn(emptyMediaVariants({ variant, className }))}+ {...props}+ />+ )+}++function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty-title"+ className={cn(+ "font-heading text-sm font-medium tracking-tight",+ className+ )}+ {...props}+ />+ )+}++function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {+ return (+ <div+ data-slot="empty-description"+ className={cn(+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",+ className+ )}+ {...props}+ />+ )+}++function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="empty-content"+ className={cn(+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-2.5 text-sm text-balance",+ className+ )}+ {...props}+ />+ )+}++export {+ Empty,+ EmptyHeader,+ EmptyTitle,+ EmptyDescription,+ EmptyContent,+ EmptyMedia,+}diff --git a/app/src/components/ui/field.tsx b/app/src/components/ui/field.tsxnew file mode 100644index 00000000..68e319c6--- /dev/null+++ b/app/src/components/ui/field.tsx@@ -0,0 +1,236 @@+import { useMemo } from "react";+import { cva, type VariantProps } from "class-variance-authority";++import { cn } from "@/lib/utils";+import { Label } from "@/components/ui/label";+import { Separator } from "@/components/ui/separator";++function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {+ return (+ <fieldset+ data-slot="field-set"+ className={cn(+ "flex flex-col gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",+ className,+ )}+ {...props}+ />+ );+}++function FieldLegend({+ className,+ variant = "legend",+ ...props+}: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {+ return (+ <legend+ data-slot="field-legend"+ data-variant={variant}+ className={cn(+ "mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base",+ className,+ )}+ {...props}+ />+ );+}++function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="field-group"+ className={cn(+ "group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4",+ className,+ )}+ {...props}+ />+ );+}++const fieldVariants = cva(+ "group/field flex w-full gap-2 data-[invalid=true]:text-destructive",+ {+ variants: {+ orientation: {+ vertical: "flex-col *:w-full [&>.sr-only]:w-auto",+ horizontal:+ "flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",+ responsive:+ "flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",+ },+ },+ defaultVariants: {+ orientation: "vertical",+ },+ },+);++function Field({+ className,+ orientation = "vertical",+ ...props+}: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {+ return (+ <div+ role="group"+ data-slot="field"+ data-orientation={orientation}+ className={cn(fieldVariants({ orientation }), className)}+ {...props}+ />+ );+}++function FieldContent({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="field-content"+ className={cn(+ "group/field-content flex flex-1 flex-col gap-0.5 leading-snug",+ className,+ )}+ {...props}+ />+ );+}++function FieldLabel({+ className,+ ...props+}: React.ComponentProps<typeof Label>) {+ return (+ <Label+ data-slot="field-label"+ className={cn(+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10",+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",+ className,+ )}+ {...props}+ />+ );+}++function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="field-label"+ className={cn(+ "flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50",+ className,+ )}+ {...props}+ />+ );+}++function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {+ return (+ <p+ data-slot="field-description"+ className={cn(+ "text-left text-sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5",+ "last:mt-0 nth-last-2:-mt-1",+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",+ className,+ )}+ {...props}+ />+ );+}++function FieldSeparator({+ children,+ className,+ ...props+}: React.ComponentProps<"div"> & {+ children?: React.ReactNode;+}) {+ return (+ <div+ data-slot="field-separator"+ data-content={!!children}+ className={cn(+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",+ className,+ )}+ {...props}+ >+ <Separator className="absolute inset-0 top-1/2" />+ {children && (+ <span+ className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"+ data-slot="field-separator-content"+ >+ {children}+ </span>+ )}+ </div>+ );+}++function FieldError({+ className,+ children,+ errors,+ ...props+}: React.ComponentProps<"div"> & {+ errors?: Array<{ message?: string } | undefined>;+}) {+ const content = useMemo(() => {+ if (children) {+ return children;+ }++ if (!errors?.length) {+ return null;+ }++ const uniqueErrors = [+ ...new Map(errors.map((error) => [error?.message, error])).values(),+ ];++ if (uniqueErrors?.length == 1) {+ return uniqueErrors[0]?.message;+ }++ return (+ <ul className="ml-4 flex list-disc flex-col gap-1">+ {uniqueErrors.map(+ (error, index) =>+ error?.message && <li key={index}>{error.message}</li>,+ )}+ </ul>+ );+ }, [children, errors]);++ if (!content) {+ return null;+ }++ return (+ <div+ role="alert"+ data-slot="field-error"+ className={cn("text-sm font-normal text-destructive", className)}+ {...props}+ >+ {content}+ </div>+ );+}++export {+ Field,+ FieldLabel,+ FieldDescription,+ FieldError,+ FieldGroup,+ FieldLegend,+ FieldSeparator,+ FieldSet,+ FieldContent,+ FieldTitle,+};diff --git a/app/src/components/ui/message-scroller.tsx b/app/src/components/ui/message-scroller.tsxnew file mode 100644index 00000000..48374192--- /dev/null+++ b/app/src/components/ui/message-scroller.tsx@@ -0,0 +1,131 @@+import * as React from "react"+import {+ MessageScroller as MessageScrollerPrimitive,+ useMessageScroller,+ useMessageScrollerScrollable,+ useMessageScrollerVisibility,+} from "@shadcn/react/message-scroller"++import { cn } from "@/lib/utils"+import { Button } from "@/components/ui/button"+import { IconArrowDown } from "@tabler/icons-react"++function MessageScrollerProvider(+ props: React.ComponentProps<typeof MessageScrollerPrimitive.Provider>+) {+ return <MessageScrollerPrimitive.Provider {...props} />+}++function MessageScroller({+ className,+ ...props+}: React.ComponentProps<typeof MessageScrollerPrimitive.Root>) {+ return (+ <MessageScrollerPrimitive.Root+ data-slot="message-scroller"+ className={cn(+ "group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden",+ className+ )}+ {...props}+ />+ )+}++function MessageScrollerViewport({+ className,+ ...props+}: React.ComponentProps<typeof MessageScrollerPrimitive.Viewport>) {+ return (+ <MessageScrollerPrimitive.Viewport+ data-slot="message-scroller-viewport"+ className={cn(+ "size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent",+ className+ )}+ {...props}+ />+ )+}++function MessageScrollerContent({+ className,+ ...props+}: React.ComponentProps<typeof MessageScrollerPrimitive.Content>) {+ return (+ <MessageScrollerPrimitive.Content+ data-slot="message-scroller-content"+ className={cn("flex h-max min-h-full flex-col gap-6", className)}+ {...props}+ />+ )+}++function MessageScrollerItem({+ className,+ scrollAnchor = false,+ ...props+}: React.ComponentProps<typeof MessageScrollerPrimitive.Item>) {+ return (+ <MessageScrollerPrimitive.Item+ data-slot="message-scroller-item"+ scrollAnchor={scrollAnchor}+ className={cn(+ // Do not use `content-visibility: auto`: short transcripts can reserve item height without+ // painting the message until a scroll/resize forces it.+ "min-w-0 shrink-0",+ className+ )}+ {...props}+ />+ )+}++function MessageScrollerButton({+ direction = "end",+ className,+ children,+ render,+ variant = "secondary",+ size = "icon-sm",+ ...props+}: React.ComponentProps<typeof MessageScrollerPrimitive.Button> &+ Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {+ return (+ <MessageScrollerPrimitive.Button+ data-slot="message-scroller-button"+ data-direction={direction}+ data-variant={variant}+ data-size={size}+ direction={direction}+ className={cn(+ "absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180",+ className+ )}+ render={render ?? <Button variant={variant} size={size} />}+ {...props}+ >+ {children ?? (+ <>+ <IconArrowDown+ />+ <span className="sr-only">+ {direction === "end" ? "Scroll to end" : "Scroll to start"}+ </span>+ </>+ )}+ </MessageScrollerPrimitive.Button>+ )+}++export {+ MessageScrollerProvider,+ MessageScroller,+ MessageScrollerViewport,+ MessageScrollerContent,+ MessageScrollerItem,+ MessageScrollerButton,+ useMessageScroller,+ useMessageScrollerScrollable,+ useMessageScrollerVisibility,+}diff --git a/app/src/components/ui/message.tsx b/app/src/components/ui/message.tsxnew file mode 100644index 00000000..53437e8d--- /dev/null+++ b/app/src/components/ui/message.tsx@@ -0,0 +1,92 @@+import * as React from "react"++import { cn } from "@/lib/utils"++function MessageGroup({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="message-group"+ className={cn("flex min-w-0 flex-col gap-2", className)}+ {...props}+ />+ )+}++function Message({+ className,+ align = "start",+ ...props+}: React.ComponentProps<"div"> & { align?: "start" | "end" }) {+ return (+ <div+ data-slot="message"+ data-align={align}+ className={cn(+ "group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse",+ className+ )}+ {...props}+ />+ )+}++function MessageAvatar({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="message-avatar"+ className={cn(+ "flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8",+ className+ )}+ {...props}+ />+ )+}++function MessageContent({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="message-content"+ className={cn(+ "flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end",+ className+ )}+ {...props}+ />+ )+}++function MessageHeader({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="message-header"+ className={cn(+ "flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0",+ className+ )}+ {...props}+ />+ )+}++function MessageFooter({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="message-footer"+ className={cn(+ "flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0 group-data-[align=end]/message:justify-end",+ className+ )}+ {...props}+ />+ )+}++export {+ MessageGroup,+ Message,+ MessageAvatar,+ MessageContent,+ MessageFooter,+ MessageHeader,+}diff --git a/app/src/components/ui/select.tsx b/app/src/components/ui/select.tsxnew file mode 100644index 00000000..e89995e3--- /dev/null+++ b/app/src/components/ui/select.tsx@@ -0,0 +1,205 @@+import * as React from "react";+import { Select as SelectPrimitive } from "@base-ui/react/select";++import { cn } from "@/lib/utils";+import {+ IconSelector,+ IconCheck,+ IconChevronUp,+ IconChevronDown,+} from "@tabler/icons-react";++const Select = SelectPrimitive.Root;++function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {+ return (+ <SelectPrimitive.Group+ data-slot="select-group"+ className={cn("scroll-my-1 p-1", className)}+ {...props}+ />+ );+}++function SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {+ return (+ <SelectPrimitive.Value+ data-slot="select-value"+ className={cn("flex flex-1 text-left", className)}+ {...props}+ />+ );+}++function SelectTrigger({+ className,+ size = "default",+ children,+ ...props+}: SelectPrimitive.Trigger.Props & {+ size?: "sm" | "default";+}) {+ return (+ <SelectPrimitive.Trigger+ data-slot="select-trigger"+ data-size={size}+ className={cn(+ "flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",+ className,+ )}+ {...props}+ >+ {children}+ <SelectPrimitive.Icon+ render={+ <IconSelector className="pointer-events-none size-4 text-muted-foreground" />+ }+ />+ </SelectPrimitive.Trigger>+ );+}++function SelectContent({+ className,+ children,+ side = "bottom",+ sideOffset = 4,+ align = "center",+ alignOffset = 0,+ alignItemWithTrigger = true,+ ...props+}: SelectPrimitive.Popup.Props &+ Pick<+ SelectPrimitive.Positioner.Props,+ "align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger"+ >) {+ return (+ <SelectPrimitive.Portal>+ <SelectPrimitive.Positioner+ side={side}+ sideOffset={sideOffset}+ align={align}+ alignOffset={alignOffset}+ alignItemWithTrigger={alignItemWithTrigger}+ className="isolate z-50"+ >+ <SelectPrimitive.Popup+ data-slot="select-content"+ data-align-trigger={alignItemWithTrigger}+ className={cn(+ "relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ className,+ )}+ {...props}+ >+ <SelectScrollUpButton />+ <SelectPrimitive.List>{children}</SelectPrimitive.List>+ <SelectScrollDownButton />+ </SelectPrimitive.Popup>+ </SelectPrimitive.Positioner>+ </SelectPrimitive.Portal>+ );+}++function SelectLabel({+ className,+ ...props+}: SelectPrimitive.GroupLabel.Props) {+ return (+ <SelectPrimitive.GroupLabel+ data-slot="select-label"+ className={cn("px-1.5 py-1 text-xs text-muted-foreground", className)}+ {...props}+ />+ );+}++function SelectItem({+ className,+ children,+ ...props+}: SelectPrimitive.Item.Props) {+ return (+ <SelectPrimitive.Item+ data-slot="select-item"+ className={cn(+ "relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",+ className,+ )}+ {...props}+ >+ <SelectPrimitive.ItemText className="flex flex-1 shrink-0 gap-2 whitespace-nowrap">+ {children}+ </SelectPrimitive.ItemText>+ <SelectPrimitive.ItemIndicator+ render={+ <span className="pointer-events-none absolute right-2 flex size-4 items-center justify-center" />+ }+ >+ <IconCheck className="pointer-events-none" />+ </SelectPrimitive.ItemIndicator>+ </SelectPrimitive.Item>+ );+}++function SelectSeparator({+ className,+ ...props+}: SelectPrimitive.Separator.Props) {+ return (+ <SelectPrimitive.Separator+ data-slot="select-separator"+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}+ {...props}+ />+ );+}++function SelectScrollUpButton({+ className,+ ...props+}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {+ return (+ <SelectPrimitive.ScrollUpArrow+ data-slot="select-scroll-up-button"+ className={cn(+ "top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",+ className,+ )}+ {...props}+ >+ <IconChevronUp />+ </SelectPrimitive.ScrollUpArrow>+ );+}++function SelectScrollDownButton({+ className,+ ...props+}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {+ return (+ <SelectPrimitive.ScrollDownArrow+ data-slot="select-scroll-down-button"+ className={cn(+ "bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",+ className,+ )}+ {...props}+ >+ <IconChevronDown />+ </SelectPrimitive.ScrollDownArrow>+ );+}++export {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectLabel,+ SelectScrollDownButton,+ SelectScrollUpButton,+ SelectSeparator,+ SelectTrigger,+ SelectValue,+};diff --git a/app/src/components/ui/sidebar.tsx b/app/src/components/ui/sidebar.tsxnew file mode 100644index 00000000..b639c56f--- /dev/null+++ b/app/src/components/ui/sidebar.tsx@@ -0,0 +1,723 @@+"use client";++import * as React from "react";+import { mergeProps } from "@base-ui/react/merge-props";+import { useRender } from "@base-ui/react/use-render";+import { cva, type VariantProps } from "class-variance-authority";++import { useIsMobile } from "@/hooks/use-mobile";+import { cn } from "@/lib/utils";+import { Button } from "@/components/ui/button";+import { Input } from "@/components/ui/input";+import { Separator } from "@/components/ui/separator";+import {+ Sheet,+ SheetContent,+ SheetDescription,+ SheetHeader,+ SheetTitle,+} from "@/components/ui/sheet";+import { Skeleton } from "@/components/ui/skeleton";+import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from "@/components/ui/tooltip";+import { IconLayoutSidebar } from "@tabler/icons-react";++const SIDEBAR_COOKIE_NAME = "sidebar_state";+const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;+const SIDEBAR_WIDTH = "16rem";+const SIDEBAR_WIDTH_MOBILE = "18rem";+const SIDEBAR_WIDTH_ICON = "3rem";+const SIDEBAR_KEYBOARD_SHORTCUT = "b";++type SidebarContextProps = {+ state: "expanded" | "collapsed";+ open: boolean;+ setOpen: (open: boolean) => void;+ openMobile: boolean;+ setOpenMobile: (open: boolean) => void;+ isMobile: boolean;+ toggleSidebar: () => void;+};++const SidebarContext = React.createContext<SidebarContextProps | null>(null);++function useSidebar() {+ const context = React.useContext(SidebarContext);+ if (!context) {+ throw new Error("useSidebar must be used within a SidebarProvider.");+ }++ return context;+}++function SidebarProvider({+ defaultOpen = true,+ open: openProp,+ onOpenChange: setOpenProp,+ className,+ style,+ children,+ ...props+}: React.ComponentProps<"div"> & {+ defaultOpen?: boolean;+ open?: boolean;+ onOpenChange?: (open: boolean) => void;+}) {+ const isMobile = useIsMobile();+ const [openMobile, setOpenMobile] = React.useState(false);++ // This is the internal state of the sidebar.+ // We use openProp and setOpenProp for control from outside the component.+ const [_open, _setOpen] = React.useState(defaultOpen);+ const open = openProp ?? _open;+ const setOpen = React.useCallback(+ (value: boolean | ((value: boolean) => boolean)) => {+ const openState = typeof value === "function" ? value(open) : value;+ if (setOpenProp) {+ setOpenProp(openState);+ } else {+ _setOpen(openState);+ }++ // This sets the cookie to keep the sidebar state.+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;+ },+ [setOpenProp, open],+ );++ // Helper to toggle the sidebar.+ const toggleSidebar = React.useCallback(() => {+ return isMobile ? setOpenMobile((open) => !open) : setOpen((open) => !open);+ }, [isMobile, setOpen, setOpenMobile]);++ // Adds a keyboard shortcut to toggle the sidebar.+ React.useEffect(() => {+ const handleKeyDown = (event: KeyboardEvent) => {+ if (+ event.key === SIDEBAR_KEYBOARD_SHORTCUT &&+ (event.metaKey || event.ctrlKey)+ ) {+ event.preventDefault();+ toggleSidebar();+ }+ };++ window.addEventListener("keydown", handleKeyDown);+ return () => window.removeEventListener("keydown", handleKeyDown);+ }, [toggleSidebar]);++ // We add a state so that we can do data-state="expanded" or "collapsed".+ // This makes it easier to style the sidebar with Tailwind classes.+ const state = open ? "expanded" : "collapsed";++ const contextValue = React.useMemo<SidebarContextProps>(+ () => ({+ state,+ open,+ setOpen,+ isMobile,+ openMobile,+ setOpenMobile,+ toggleSidebar,+ }),+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],+ );++ return (+ <SidebarContext.Provider value={contextValue}>+ <div+ data-slot="sidebar-wrapper"+ style={+ {+ "--sidebar-width": SIDEBAR_WIDTH,+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,+ ...style,+ } as React.CSSProperties+ }+ className={cn(+ "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",+ className,+ )}+ {...props}+ >+ {children}+ </div>+ </SidebarContext.Provider>+ );+}++function Sidebar({+ side = "left",+ variant = "sidebar",+ collapsible = "offcanvas",+ className,+ children,+ dir,+ ...props+}: React.ComponentProps<"div"> & {+ side?: "left" | "right";+ variant?: "sidebar" | "floating" | "inset";+ collapsible?: "offcanvas" | "icon" | "none";+}) {+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();++ if (collapsible === "none") {+ return (+ <div+ data-slot="sidebar"+ className={cn(+ "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",+ className,+ )}+ {...props}+ >+ {children}+ </div>+ );+ }++ if (isMobile) {+ return (+ <Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>+ <SheetContent+ dir={dir}+ data-sidebar="sidebar"+ data-slot="sidebar"+ data-mobile="true"+ className="w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"+ style={+ {+ "--sidebar-width": SIDEBAR_WIDTH_MOBILE,+ } as React.CSSProperties+ }+ side={side}+ >+ <SheetHeader className="sr-only">+ <SheetTitle>Sidebar</SheetTitle>+ <SheetDescription>Displays the mobile sidebar.</SheetDescription>+ </SheetHeader>+ <div className="flex h-full w-full flex-col">{children}</div>+ </SheetContent>+ </Sheet>+ );+ }++ return (+ <div+ className="group peer hidden text-sidebar-foreground md:block"+ data-state={state}+ data-collapsible={state === "collapsed" ? collapsible : ""}+ data-variant={variant}+ data-side={side}+ data-slot="sidebar"+ >+ {/* Desktop layout spacer for the fixed sidebar container. */}+ <div+ data-slot="sidebar-gap"+ className={cn(+ "relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear",+ "group-data-[collapsible=offcanvas]:w-0",+ "group-data-[side=right]:rotate-180",+ variant === "floating" || variant === "inset"+ ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",+ )}+ />+ <div+ data-slot="sidebar-container"+ data-side={side}+ className={cn(+ "fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",+ // Adjust the padding for floating and inset variants.+ variant === "floating" || variant === "inset"+ ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",+ className,+ )}+ {...props}+ >+ <div+ data-sidebar="sidebar"+ data-slot="sidebar-inner"+ className="flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border"+ >+ {children}+ </div>+ </div>+ </div>+ );+}++function SidebarTrigger({+ className,+ onClick,+ ...props+}: React.ComponentProps<typeof Button>) {+ const { toggleSidebar } = useSidebar();++ return (+ <Button+ data-sidebar="trigger"+ data-slot="sidebar-trigger"+ variant="ghost"+ size="icon-sm"+ className={cn(className)}+ onClick={(event) => {+ onClick?.(event);+ toggleSidebar();+ }}+ {...props}+ >+ <IconLayoutSidebar />+ <span className="sr-only">Toggle Sidebar</span>+ </Button>+ );+}++function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {+ const { toggleSidebar } = useSidebar();++ return (+ <button+ data-sidebar="rail"+ data-slot="sidebar-rail"+ aria-label="Toggle Sidebar"+ tabIndex={-1}+ onClick={toggleSidebar}+ title="Toggle Sidebar"+ className={cn(+ "absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2",+ "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize",+ "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",+ "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",+ "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",+ "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",+ className,+ )}+ {...props}+ />+ );+}++function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {+ return (+ <main+ data-slot="sidebar-inset"+ className={cn(+ "relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",+ className,+ )}+ {...props}+ />+ );+}++function SidebarInput({+ className,+ ...props+}: React.ComponentProps<typeof Input>) {+ return (+ <Input+ data-slot="sidebar-input"+ data-sidebar="input"+ className={cn("h-9 w-full bg-background shadow-none", className)}+ {...props}+ />+ );+}++function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-header"+ data-sidebar="header"+ className={cn("flex flex-col gap-2 p-2", className)}+ {...props}+ />+ );+}++function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-footer"+ data-sidebar="footer"+ className={cn("flex flex-col gap-2 p-2", className)}+ {...props}+ />+ );+}++function SidebarSeparator({+ className,+ ...props+}: React.ComponentProps<typeof Separator>) {+ return (+ <Separator+ data-slot="sidebar-separator"+ data-sidebar="separator"+ className={cn("mx-2 w-auto bg-sidebar-border", className)}+ {...props}+ />+ );+}++function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-content"+ data-sidebar="content"+ className={cn(+ "no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",+ className,+ )}+ {...props}+ />+ );+}++function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-group"+ data-sidebar="group"+ className={cn("relative flex w-full min-w-0 flex-col p-2", className)}+ {...props}+ />+ );+}++function SidebarGroupLabel({+ className,+ render,+ ...props+}: useRender.ComponentProps<"div"> & React.ComponentProps<"div">) {+ return useRender({+ defaultTagName: "div",+ props: mergeProps<"div">(+ {+ className: cn(+ "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",+ className,+ ),+ },+ props,+ ),+ render,+ state: {+ slot: "sidebar-group-label",+ sidebar: "group-label",+ },+ });+}++function SidebarGroupAction({+ className,+ render,+ ...props+}: useRender.ComponentProps<"button"> & React.ComponentProps<"button">) {+ return useRender({+ defaultTagName: "button",+ props: mergeProps<"button">(+ {+ className: cn(+ "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",+ className,+ ),+ },+ props,+ ),+ render,+ state: {+ slot: "sidebar-group-action",+ sidebar: "group-action",+ },+ });+}++function SidebarGroupContent({+ className,+ ...props+}: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-group-content"+ data-sidebar="group-content"+ className={cn("w-full text-sm", className)}+ {...props}+ />+ );+}++function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {+ return (+ <ul+ data-slot="sidebar-menu"+ data-sidebar="menu"+ className={cn("flex w-full min-w-0 flex-col gap-0", className)}+ {...props}+ />+ );+}++function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {+ return (+ <li+ data-slot="sidebar-menu-item"+ data-sidebar="menu-item"+ className={cn("group/menu-item relative", className)}+ {...props}+ />+ );+}++const sidebarMenuButtonVariants = cva(+ "peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",+ {+ variants: {+ variant: {+ default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",+ outline:+ "bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]",+ },+ size: {+ default: "h-8 text-sm",+ sm: "h-7 text-xs",+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!",+ },+ },+ defaultVariants: {+ variant: "default",+ size: "default",+ },+ },+);++function SidebarMenuButton({+ render,+ isActive = false,+ variant = "default",+ size = "default",+ tooltip,+ className,+ ...props+}: useRender.ComponentProps<"button"> &+ React.ComponentProps<"button"> & {+ isActive?: boolean;+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;+ } & VariantProps<typeof sidebarMenuButtonVariants>) {+ const { isMobile, state } = useSidebar();+ const comp = useRender({+ defaultTagName: "button",+ props: mergeProps<"button">(+ {+ className: cn(sidebarMenuButtonVariants({ variant, size }), className),+ },+ props,+ ),+ render: !tooltip ? render : <TooltipTrigger render={render} />,+ state: {+ slot: "sidebar-menu-button",+ sidebar: "menu-button",+ size,+ active: isActive,+ },+ });++ if (!tooltip) {+ return comp;+ }++ if (typeof tooltip === "string") {+ tooltip = {+ children: tooltip,+ };+ }++ return (+ <Tooltip>+ {comp}+ <TooltipContent+ side="right"+ align="center"+ hidden={state !== "collapsed" || isMobile}+ {...tooltip}+ />+ </Tooltip>+ );+}++function SidebarMenuAction({+ className,+ render,+ showOnHover = false,+ ...props+}: useRender.ComponentProps<"button"> &+ React.ComponentProps<"button"> & {+ showOnHover?: boolean;+ }) {+ return useRender({+ defaultTagName: "button",+ props: mergeProps<"button">(+ {+ className: cn(+ "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",+ showOnHover &&+ "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",+ className,+ ),+ },+ props,+ ),+ render,+ state: {+ slot: "sidebar-menu-action",+ sidebar: "menu-action",+ },+ });+}++function SidebarMenuBadge({+ className,+ ...props+}: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="sidebar-menu-badge"+ data-sidebar="menu-badge"+ className={cn(+ "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",+ className,+ )}+ {...props}+ />+ );+}++function SidebarMenuSkeleton({+ className,+ showIcon = false,+ ...props+}: React.ComponentProps<"div"> & {+ showIcon?: boolean;+}) {+ // Random width between 50 to 90%.+ const [width] = React.useState(() => {+ return `${Math.floor(Math.random() * 40) + 50}%`;+ });++ return (+ <div+ data-slot="sidebar-menu-skeleton"+ data-sidebar="menu-skeleton"+ className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}+ {...props}+ >+ {showIcon && (+ <Skeleton+ className="size-4 rounded-md"+ data-sidebar="menu-skeleton-icon"+ />+ )}+ <Skeleton+ className="h-4 max-w-(--skeleton-width) flex-1"+ data-sidebar="menu-skeleton-text"+ style={+ {+ "--skeleton-width": width,+ } as React.CSSProperties+ }+ />+ </div>+ );+}++function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {+ return (+ <ul+ data-slot="sidebar-menu-sub"+ data-sidebar="menu-sub"+ className={cn(+ "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",+ className,+ )}+ {...props}+ />+ );+}++function SidebarMenuSubItem({+ className,+ ...props+}: React.ComponentProps<"li">) {+ return (+ <li+ data-slot="sidebar-menu-sub-item"+ data-sidebar="menu-sub-item"+ className={cn("group/menu-sub-item relative", className)}+ {...props}+ />+ );+}++function SidebarMenuSubButton({+ render,+ size = "md",+ isActive = false,+ className,+ ...props+}: useRender.ComponentProps<"a"> &+ React.ComponentProps<"a"> & {+ size?: "sm" | "md";+ isActive?: boolean;+ }) {+ return useRender({+ defaultTagName: "a",+ props: mergeProps<"a">(+ {+ className: cn(+ "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",+ className,+ ),+ },+ props,+ ),+ render,+ state: {+ slot: "sidebar-menu-sub-button",+ sidebar: "menu-sub-button",+ size,+ active: isActive,+ },+ });+}++export {+ Sidebar,+ SidebarContent,+ SidebarFooter,+ SidebarGroup,+ SidebarGroupAction,+ SidebarGroupContent,+ SidebarGroupLabel,+ SidebarHeader,+ SidebarInput,+ SidebarInset,+ SidebarMenu,+ SidebarMenuAction,+ SidebarMenuBadge,+ SidebarMenuButton,+ SidebarMenuItem,+ SidebarMenuSkeleton,+ SidebarMenuSub,+ SidebarMenuSubButton,+ SidebarMenuSubItem,+ SidebarProvider,+ SidebarRail,+ SidebarSeparator,+ SidebarTrigger,+ useSidebar,+};diff --git a/app/src/components/ui/skeleton.tsx b/app/src/components/ui/skeleton.tsxnew file mode 100644index 00000000..26bc059d--- /dev/null+++ b/app/src/components/ui/skeleton.tsx@@ -0,0 +1,13 @@+import { cn } from "@/lib/utils";++function Skeleton({ className, ...props }: React.ComponentProps<"div">) {+ return (+ <div+ data-slot="skeleton"+ className={cn("animate-pulse rounded-md bg-muted", className)}+ {...props}+ />+ );+}++export { Skeleton };diff --git a/app/src/components/ui/switch.tsx b/app/src/components/ui/switch.tsxnew file mode 100644index 00000000..7ed946b8--- /dev/null+++ b/app/src/components/ui/switch.tsx@@ -0,0 +1,30 @@+import { Switch as SwitchPrimitive } from "@base-ui/react/switch"++import { cn } from "@/lib/utils"++function Switch({+ className,+ size = "default",+ ...props+}: SwitchPrimitive.Root.Props & {+ size?: "sm" | "default"+}) {+ return (+ <SwitchPrimitive.Root+ data-slot="switch"+ data-size={size}+ className={cn(+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-[background-color,border-color,box-shadow] duration-150 ease-out outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",+ className+ )}+ {...props}+ >+ <SwitchPrimitive.Thumb+ data-slot="switch-thumb"+ className="pointer-events-none block rounded-full bg-background ring-0 transition-transform duration-150 ease-out group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"+ />+ </SwitchPrimitive.Root>+ )+}++export { Switch }diff --git a/app/src/components/ui/textarea.tsx b/app/src/components/ui/textarea.tsxnew file mode 100644index 00000000..04d27f7d--- /dev/null+++ b/app/src/components/ui/textarea.tsx@@ -0,0 +1,18 @@+import * as React from "react"++import { cn } from "@/lib/utils"++function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {+ return (+ <textarea+ data-slot="textarea"+ className={cn(+ "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",+ className+ )}+ {...props}+ />+ )+}++export { Textarea }diff --git a/app/src/components/ui/tooltip.tsx b/app/src/components/ui/tooltip.tsxnew file mode 100644index 00000000..086477b3--- /dev/null+++ b/app/src/components/ui/tooltip.tsx@@ -0,0 +1,66 @@+"use client";++import { Tooltip as TooltipPrimitive } from "@base-ui/react/tooltip";++import { cn } from "@/lib/utils";++function TooltipProvider({+ delay = 0,+ ...props+}: TooltipPrimitive.Provider.Props) {+ return (+ <TooltipPrimitive.Provider+ data-slot="tooltip-provider"+ delay={delay}+ {...props}+ />+ );+}++function Tooltip({ ...props }: TooltipPrimitive.Root.Props) {+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;+}++function TooltipTrigger({ ...props }: TooltipPrimitive.Trigger.Props) {+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;+}++function TooltipContent({+ className,+ side = "top",+ sideOffset = 4,+ align = "center",+ alignOffset = 0,+ children,+ ...props+}: TooltipPrimitive.Popup.Props &+ Pick<+ TooltipPrimitive.Positioner.Props,+ "align" | "alignOffset" | "side" | "sideOffset"+ >) {+ return (+ <TooltipPrimitive.Portal>+ <TooltipPrimitive.Positioner+ align={align}+ alignOffset={alignOffset}+ side={side}+ sideOffset={sideOffset}+ className="isolate z-50"+ >+ <TooltipPrimitive.Popup+ data-slot="tooltip-content"+ className={cn(+ "z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",+ className,+ )}+ {...props}+ >+ {children}+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5" />+ </TooltipPrimitive.Popup>+ </TooltipPrimitive.Positioner>+ </TooltipPrimitive.Portal>+ );+}++export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };diff --git a/app/src/lib/agents/bot-names.ts b/app/src/lib/agents/bot-names.tsnew file mode 100644index 00000000..3ebd2a53--- /dev/null+++ b/app/src/lib/agents/bot-names.ts@@ -0,0 +1,21 @@+import { useQuery } from "@tanstack/react-query";+import { useCallback } from "react";+import { type AgentProfile, agentListQueryOptions } from "./queries";++/**+ * Map visible Bot ids to names for admin read surfaces; deleted or hidden ids fall back to the+ * immutable id recorded in the event.+ */++/** Stable query selector so the id-to-name map only rebuilds when the roster changes. */+const toNames = (agents: AgentProfile[]): Map<string, string> =>+ new Map(agents.map((agent) => [agent.id, agent.name]));++export function useBotNames(): (botId: string) => string {+ const { data: names } = useQuery({+ ...agentListQueryOptions(),+ select: toNames,+ });++ return useCallback((botId: string) => names?.get(botId) ?? botId, [names]);+}diff --git a/app/src/lib/agents/queries.ts b/app/src/lib/agents/queries.tsnew file mode 100644index 00000000..2e9d5476--- /dev/null+++ b/app/src/lib/agents/queries.ts@@ -0,0 +1,67 @@+import { queryOptions } from "@tanstack/react-query";++export type AgentVisibility = "public" | "private";++/**+ * A teammate as the browser sees it.+ *+ * `canManage` and `systemOwned` are server-decided authorization facts; components render from the+ * returned flags rather than recomputing ownership rules.+ */+export type AgentProfile = {+ id: string;+ name: string;+ title: string;+ roleDescription: string;+ avatarSeed: string;+ visibility: AgentVisibility;+ /** Where this teammate runs. Null for the Bot in the box. */+ endpoint: string | null;+ /** Whether a key is set for it. Never the key itself. */+ hasAuth: boolean;+ hidden: boolean;+ systemOwned: boolean;+ canManage: boolean;+ /**+ * Whether the signed-in person created this teammate.+ *+ * Separate from `canManage`, which is also true for administrators on everybody's teammates. Split+ * a roster on `canManage` and an administrator's "mine" fills up with other people's work.+ */+ mine: boolean;+};++export const agentKeys = {+ all: ["agents"] as const,+ list: (hidden = false) => ["agents", "list", { hidden }] as const,+ detail: (agentId: string) => ["agents", "detail", agentId] as const,+};++export function agentListQueryOptions(hidden = false) {+ return queryOptions({+ queryKey: agentKeys.list(hidden),+ queryFn: async (): Promise<AgentProfile[]> => {+ const response = await fetch(+ `/api/agents${hidden ? "?hidden=true" : ""}`,+ {+ credentials: "include",+ },+ );+ if (!response.ok) throw new Error("Could not load teammates");+ return ((await response.json()) as { agents: AgentProfile[] }).agents;+ },+ });+}++export function agentQueryOptions(agentId: string) {+ return queryOptions({+ queryKey: agentKeys.detail(agentId),+ queryFn: async (): Promise<AgentProfile> => {+ const response = await fetch(`/api/agents/${agentId}`, {+ credentials: "include",+ });+ if (!response.ok) throw new Error("Could not load this teammate");+ return ((await response.json()) as { agent: AgentProfile }).agent;+ },+ });+}diff --git a/app/src/lib/audit/queries.ts b/app/src/lib/audit/queries.tsnew file mode 100644index 00000000..9f0d0627--- /dev/null+++ b/app/src/lib/audit/queries.ts@@ -0,0 +1,16 @@+import { queryOptions } from "@tanstack/react-query";++export const auditKeys = { all: ["audit-events"] as const };++export function auditEventsQueryOptions(search = "") {+ return queryOptions({+ queryKey: [...auditKeys.all, search] as const,+ queryFn: async () => {+ const response = await fetch(`/api/admin/audit-events${search}`, {+ credentials: "include",+ });+ if (!response.ok) throw new Error("Could not load audit events");+ return response.json();+ },+ });+}diff --git a/app/src/lib/auth/client.ts b/app/src/lib/auth/client.tsnew file mode 100644index 00000000..ff1f39bd--- /dev/null+++ b/app/src/lib/auth/client.ts@@ -0,0 +1,14 @@+import { createAuthClient } from "better-auth/react";++export const authClient = createAuthClient();++export async function signInWithGoogle() {+ const result = await authClient.signIn.social({+ provider: "google" as never,+ callbackURL: window.location.origin,+ });++ if (result.error) {+ throw new Error(result.error.message ?? "Could not start Google sign-in.");+ }+}diff --git a/app/src/lib/channels/start.ts b/app/src/lib/channels/start.tsnew file mode 100644index 00000000..de2c2551--- /dev/null+++ b/app/src/lib/channels/start.ts@@ -0,0 +1,31 @@+import { useMutation, useQueryClient } from "@tanstack/react-query";+import { useNavigate } from "@tanstack/react-router";+import { stashFirstMessage } from "@/components/channels/transcript-messages";+import { createChannelMutationOptions } from "./mutations";+import { channelKeys } from "./queries";++/**+ * Start a channel from a just-submitted first message, then navigate there.+ *+ * Ordering matters: create, seed the channel cache, stash the first message, then navigate. That+ * keeps the first message visible while the channel thread joins.+ */+export function useStartChannel() {+ const queryClient = useQueryClient();+ const navigate = useNavigate();+ const createChannel = useMutation(createChannelMutationOptions(queryClient));++ return {+ pending: createChannel.isPending,+ start: async (agentId: string, text: string) => {+ const channel = await createChannel.mutateAsync([agentId]);+ queryClient.setQueryData(channelKeys.detail(channel.id), channel);+ stashFirstMessage(channel.id, text);+ await navigate({+ params: { channelId: channel.id },+ replace: true,+ to: "/channel/$channelId",+ });+ },+ };+}diff --git a/app/src/lib/channels/use-channel-events.ts b/app/src/lib/channels/use-channel-events.tsnew file mode 100644index 00000000..4d4efe7e--- /dev/null+++ b/app/src/lib/channels/use-channel-events.ts@@ -0,0 +1,118 @@+import { useQueryClient } from "@tanstack/react-query";+import { useEffect } from "react";+import { type ChannelSummary, channelKeys } from "./queries";++/**+ * Keep the roster live.+ *+ * The query remains the source of truth; socket events only patch its cache. Reconnects refetch the+ * list to recover events missed while disconnected.+ */++type ChannelActivityEvent = {+ channelId: string;+ lastMessage: string | null;+ lastMessageAt: string | null;+ lastMessageAgentId: string | null;+};++const FIRST_RETRY_MS = 500;+const MAX_RETRY_MS = 30_000;++function socketUrl() {+ const url = new URL("/api/channels/events", window.location.href);+ url.protocol = url.protocol === "https:" ? "wss:" : "ws:";+ return url.toString();+}++export function useChannelEvents() {+ const queryClient = useQueryClient();++ useEffect(() => {+ let socket: WebSocket | undefined;+ let retryTimer: number | undefined;+ let retryDelay = FIRST_RETRY_MS;+ let stopped = false;++ const connect = () => {+ if (stopped) return;+ socket = new WebSocket(socketUrl());++ socket.onopen = () => {+ retryDelay = FIRST_RETRY_MS;+ // Recover events missed while the socket was disconnected.+ void queryClient.invalidateQueries({ queryKey: channelKeys.list() });+ };++ socket.onmessage = (message) => {+ let activity: ChannelActivityEvent;+ try {+ activity = JSON.parse(message.data as string);+ } catch {+ return;+ }++ queryClient.setQueryData(+ channelKeys.list(),+ (channels: ChannelSummary[] | undefined) => {+ if (!channels) return channels;+ // Unknown channel ids mean the roster is stale; refetch the list instead of patching.+ if (!channels.some((c) => c.id === activity.channelId)) {+ void queryClient.invalidateQueries({+ queryKey: channelKeys.list(),+ });+ return channels;+ }+ // Preserve object identity for unchanged rows so memoized rows do not re-render.+ const index = channels.findIndex(+ (channel) => channel.id === activity.channelId,+ );+ const previous = channels[index];+ if (!previous) return channels;++ const patched = { ...previous, ...activity };+ const next = channels.slice();+ next[index] = patched;+ next.sort(byRecency);++ // An event that changes nothing visible, a duplicate, or a report the server ignored+ // as stale, returns the original array, so React re-renders nothing at all.+ return next.every((channel, at) => channel === channels[at])+ ? channels+ : next;+ },+ );+ };++ // WebSocket needs explicit reconnect handling.+ socket.onclose = () => {+ if (stopped) return;+ retryTimer = window.setTimeout(connect, retryDelay);+ retryDelay = Math.min(retryDelay * 2, MAX_RETRY_MS);+ };+ };++ connect();++ return () => {+ stopped = true;+ if (retryTimer !== undefined) window.clearTimeout(retryTimer);+ // Cleared first: the close below must not schedule a reconnect for a screen that is gone.+ if (socket) socket.onclose = null;+ socket?.close();+ };+ }, [queryClient]);+}++/**+ * Most recent first, where starting a conversation counts as activity.+ *+ * Deliberately the same rule the roster query uses, `coalesce(last_message_at, created_at) desc` in+ * channels/routes.ts. If these two disagree the list reorders itself the moment an event arrives,+ * which looks like rows jumping for no reason.+ */+function byRecency(left: ChannelSummary, right: ChannelSummary) {+ const at = (channel: ChannelSummary) =>+ channel.lastMessageAt ?? channel.createdAt;+ return at(right).localeCompare(at(left));+}diff --git a/app/src/lib/components/queries.ts b/app/src/lib/components/queries.tsnew file mode 100644index 00000000..2170dd32--- /dev/null+++ b/app/src/lib/components/queries.ts@@ -0,0 +1,196 @@+import { queryOptions } from "@tanstack/react-query";++/** A component as the Admin surface sees it: its state, its versions and who is held back from it. */+export type ComponentRecord = {+ name: string;+ title: string;+ kind: string;+ draftDescription: string;+ publishedDescription: string | null;+ published: boolean;+ publishedAt: string | null;+ updatedBy: string | null;+ updatedAt: string;+ hasUnpublishedChanges: boolean;+ /** The Bots held back from this. Every other Bot may answer with it. */+ withheldFrom: string[];+ /** The data functions this component may read. Empty means it draws only what the model hands it. */+ functions: string[];+};++/** A component as a Bot holds it: the name to register, and what the model is told about it. */+export type GrantedComponent = {+ name: string;+ description: string;+};++export const componentKeys = {+ all: ["components"] as const,+ list: () => ["components", "list"] as const,+ forAgent: (agentId: string) => ["components", "for-agent", agentId] as const,+};++export function componentListQueryOptions() {+ return queryOptions({+ queryKey: componentKeys.list(),+ queryFn: async (): Promise<ComponentRecord[]> => {+ const response = await fetch("/api/components", {+ credentials: "include",+ });+ if (!response.ok) throw new Error("The components could not be loaded.");+ return (await response.json()).components ?? [];+ },+ });+}++/**+ * What one Bot may answer with.+ *+ * Polled so open conversations stop offering revoked components; call-time checks still enforce+ * the grant.+ */+export function agentComponentsQueryOptions(agentId: string | undefined) {+ return queryOptions({+ queryKey: componentKeys.forAgent(agentId ?? ""),+ enabled: Boolean(agentId),+ refetchInterval: 5_000,+ // Refetched when the tab is looked at again, so a grant changed on another screen is not waiting+ // out an interval before it shows.+ refetchOnWindowFocus: true,+ queryFn: async (): Promise<GrantedComponent[]> => {+ const response = await fetch(+ `/api/components/for-agent/${encodeURIComponent(agentId ?? "")}`,+ { credentials: "include" },+ );+ if (!response.ok) {+ throw new Error("This Bot's components could not be loaded.");+ }+ return (await response.json()).components ?? [];+ },+ });+}++/** Announce the compiled gallery catalogue to the server; additive failures do not block UI use. */+export async function announceGallery(+ components: {+ name: string;+ title: string;+ kind: string;+ description: string;+ }[],+): Promise<string[]> {+ try {+ const response = await fetch("/api/components/catalogue", {+ method: "PUT",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ components }),+ });+ if (!response.ok) return [];+ return (await response.json()).added ?? [];+ } catch {+ return [];+ }+}++/** A data function this build ships, as an administrator sees it. */+export type DataFunctionSummary = {+ name: string;+ description: string;+ reads: string;+};++export function dataFunctionsQueryOptions() {+ return queryOptions({+ queryKey: ["components", "functions"] as const,+ queryFn: async (): Promise<DataFunctionSummary[]> => {+ const response = await fetch("/api/components/functions", {+ credentials: "include",+ });+ if (!response.ok)+ throw new Error("The data functions could not be loaded.");+ return (await response.json()).functions ?? [];+ },+ });+}++/**+ * A component reading real data for itself.+ *+ * Data is fetched from the deployment after the server checks this component's data-function grant.+ * Failure to check the grant fails closed.+ */+export async function callComponentFunction(+ component: string,+ functionName: string,+ args: Record<string, unknown>,+ agentId: string,+): Promise<{+ allowed: boolean;+ data?: unknown;+ reason?: string;+ error?: string;+}> {+ try {+ const response = await fetch(+ `/api/components/${encodeURIComponent(component)}/call`,+ {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ agentId, args, function: functionName }),+ },+ );+ const payload = await response.json().catch(() => null);+ if (payload && typeof payload === "object") {+ return payload as { allowed: boolean; data?: unknown; reason?: string };+ }+ return {+ allowed: false,+ reason: "This deployment could not be asked for that data.",+ };+ } catch {+ return {+ allowed: false,+ reason: "This deployment could not be reached to read that data.",+ };+ }+}++/**+ * Ask the server whether this Bot may use this component right now; failures fail closed.+ *+ * `functions` are the data functions the component will read with these arguments. Naming them here+ * makes the verdict cover what the component will do rather than only its name.+ */+export async function decideComponent(+ name: string,+ agentId: string,+ functions: readonly string[] = [],+): Promise<{ allowed: boolean; reason?: string }> {+ try {+ const response = await fetch(+ `/api/components/${encodeURIComponent(name)}/decision`,+ {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ agentId, functions }),+ },+ );+ if (!response.ok) {+ return {+ allowed: false,+ reason:+ "This deployment could not be asked whether that component is allowed, so it was not shown.",+ };+ }+ return await response.json();+ } catch {+ return {+ allowed: false,+ reason:+ "This deployment could not be reached to check whether that component is allowed, so it was not shown.",+ };+ }+}diff --git a/app/src/lib/connectors/queries.ts b/app/src/lib/connectors/queries.tsnew file mode 100644index 00000000..ac0e08f3--- /dev/null+++ b/app/src/lib/connectors/queries.ts@@ -0,0 +1,28 @@+import { queryOptions } from "@tanstack/react-query";++export type ConnectorStatus = {+ id: string;+ type: "google_drive" | "onedrive";+ name: string;+ roots: string[];+ configured: boolean;+};++export const connectorKeys = {+ all: ["connectors"] as const,+ list: () => [...connectorKeys.all, "list"] as const,+};++export function connectorListQueryOptions() {+ return queryOptions({+ queryKey: connectorKeys.list(),+ queryFn: async (): Promise<ConnectorStatus[]> => {+ const response = await fetch("/api/admin/connectors", {+ credentials: "include",+ });+ if (!response.ok) throw new Error("Could not load connectors");+ return ((await response.json()) as { connectors: ConnectorStatus[] })+ .connectors;+ },+ });+}diff --git a/app/src/lib/copilot/active-bot.tsx b/app/src/lib/copilot/active-bot.tsxnew file mode 100644index 00000000..b66da3aa--- /dev/null+++ b/app/src/lib/copilot/active-bot.tsx@@ -0,0 +1,75 @@+import {+ createContext,+ type ReactNode,+ useContext,+ useEffect,+ useRef,+ useState,+} from "react";++/**+ * Which Bot the surface in front of you is driving.+ *+ * The computer tools are registered once for the whole app, but a computer belongs to a Bot, and a supervisor gives+ * each one its own browser profile and its own egress, and the server picks which by the id in the+ * URL.+ *+ * Tool handlers read the ref because a handler outlives the render that registered it. Components+ * read state because grants and renderers must re-render when the active Bot changes.+ */++const DEFAULT_BOT_ID = "default";++type BotHolder = { current: string };++const ActiveBotContext = createContext<BotHolder | null>(null);+const ActiveBotValueContext = createContext<{+ botId: string;+ announce: (botId: string) => void;+} | null>(null);++export function ActiveBotProvider({ children }: { children: ReactNode }) {+ const holder = useRef<BotHolder>({ current: DEFAULT_BOT_ID });+ const [botId, setBotId] = useState(DEFAULT_BOT_ID);+ const value = useRef({ botId, announce: setBotId });+ value.current = { botId, announce: setBotId };++ return (+ <ActiveBotContext.Provider value={holder.current}>+ <ActiveBotValueContext.Provider value={value.current}>+ {children}+ </ActiveBotValueContext.Provider>+ </ActiveBotContext.Provider>+ );+}++/**+ * Declare the Bot this surface drives, for as long as it is mounted.+ *+ * Restores what it found on unmount, so leaving a channel does not leave its Bot addressed by+ * whatever mounts next.+ */+export function useActiveBot(botId: string | undefined): void {+ const holder = useContext(ActiveBotContext);+ const value = useContext(ActiveBotValueContext);+ useEffect(() => {+ if (!holder) return;+ const previous = holder.current;+ holder.current = botId ?? DEFAULT_BOT_ID;+ value?.announce(botId ?? DEFAULT_BOT_ID);+ return () => {+ holder.current = previous;+ value?.announce(previous);+ };+ }, [holder, value, botId]);+}++/** The holder itself, to be read inside a handler at the moment it runs. */+export function useActiveBotHolder(): BotHolder {+ return useContext(ActiveBotContext) ?? { current: DEFAULT_BOT_ID };+}++/** The active Bot as a value, for anything that has to re-render when it changes. */+export function useActiveBotId(): string {+ return useContext(ActiveBotValueContext)?.botId ?? DEFAULT_BOT_ID;+}diff --git a/app/src/lib/copilot/repair-history.ts b/app/src/lib/copilot/repair-history.tsnew file mode 100644index 00000000..424d438b--- /dev/null+++ b/app/src/lib/copilot/repair-history.ts@@ -0,0 +1,60 @@+import type { Message } from "@ag-ui/core";++/**+ * Insert explanatory tool results for unanswered tool calls before sending history to providers.+ */++const UNANSWERED =+ "This call produced no result: the surface was interrupted before it could answer. Do not assume it succeeded.";++/** A tool result message, which AG-UI models as its own role. */+type ToolResult = { role: "tool"; toolCallId: string };++function isToolResult(message: Message): message is Message & ToolResult {+ return message.role === "tool" && "toolCallId" in message;+}++/**+ * The same messages, with a result inserted for any tool call that has none.+ *+ * Returns the original array when no repair is needed.+ */+export function repairUnansweredToolCalls(+ messages: ReadonlyArray<Message>,+ newId: () => string = () => crypto.randomUUID(),+): ReadonlyArray<Message> {+ const answered = new Set<string>();+ for (const message of messages) {+ if (isToolResult(message)) answered.add(message.toolCallId);+ }++ const missing = messages.some(+ (message) =>+ message.role === "assistant" &&+ (message.toolCalls ?? []).some((call) => !answered.has(call.id)),+ );+ if (!missing) return messages;++ const repaired: Message[] = [];+ for (const message of messages) {+ repaired.push(message);+ if (message.role !== "assistant") continue;++ for (const call of message.toolCalls ?? []) {+ if (answered.has(call.id)) continue;+ // Immediately after the assistant message that made the call, and before any later message:+ // OpenAI requires the results to follow their calls, and some providers require the order to+ // match the `tool_calls` array as well.+ repaired.push({+ id: newId(),+ role: "tool",+ toolCallId: call.id,+ content: UNANSWERED,+ } as Message);+ // A duplicated call id may only receive one repair result.+ answered.add(call.id);+ }+ }++ return repaired;+}diff --git a/app/src/lib/copilot/sandboxed-tools.tsx b/app/src/lib/copilot/sandboxed-tools.tsxnew file mode 100644index 00000000..5b570c01--- /dev/null+++ b/app/src/lib/copilot/sandboxed-tools.tsx@@ -0,0 +1,148 @@+import {+ OpenGenerativeUIActivityRenderer,+ useFrontendTool,+} from "@copilotkit/react-core/v2";+import { useQuery } from "@tanstack/react-query";+import { useCallback, useState } from "react";+import * as z from "zod";+import { ToolLine } from "@/components/channels/tool-line";+import { RefusedCard } from "@/components/gallery/refused";+import {+ agentComponentsQueryOptions,+ decideComponent,+ type GrantedComponent,+} from "@/lib/components/queries";+import { useActiveBotId } from "@/lib/copilot/active-bot";+import {+ type PublishedSandboxed,+ publishedSandboxedQueryOptions,+} from "@/lib/sandboxed/queries";++/**+ * Browser-authored components use the same component grants as compiled gallery components, but+ * render published runtime markup in the SDK sandbox.+ */+export function SandboxedTools() {+ const botId = useActiveBotId();+ const { data: published } = useQuery(publishedSandboxedQueryOptions());+ const { data: granted } = useQuery(agentComponentsQueryOptions(botId));++ const held = new Map(+ (granted ?? []).map((component: GrantedComponent) => [+ component.name,+ component.description,+ ]),+ );++ return (+ <>+ {(published ?? []).map((component) => (+ <SandboxedTool+ botId={botId}+ component={component}+ description={held.get(component.name)}+ key={component.name}+ />+ ))}+ </>+ );+}++/** Convert an author's JSON Schema to SDK parameters; unreadable schemas fall back to catchall. */+function parametersFor(schema: Record<string, unknown>) {+ try {+ const converted = z.fromJSONSchema(schema as never);+ if (converted instanceof z.ZodObject) return converted;+ } catch {+ // Unreadable author schemas fall back to permissive arguments and server-side checks.+ }+ return z.object({}).catchall(z.unknown());+}++function SandboxedTool({+ component,+ description,+ botId,+}: {+ component: PublishedSandboxed;+ description: string | undefined;+ botId: string;+}) {+ const [refusals, setRefusals] = useState<Map<string, string>>(new Map());+ const isHeld = description !== undefined;++ const render = useCallback(+ (props: {+ args?: Record<string, unknown>;+ status?: string;+ toolCall?: { id?: string };+ }) => {+ const refusal = props.toolCall?.id+ ? refusals.get(props.toolCall.id)+ : undefined;+ if (refusal) {+ return <RefusedCard reason={refusal} title={component.name} />;+ }+ if (!isHeld) {+ return (+ <RefusedCard+ reason={`${component.name} is not available to this Bot at the moment. An administrator grants components per Bot.`}+ title={component.name}+ />+ );+ }++ // Wait for complete arguments because sandbox source is injected once per keyed instance.+ if (props.status !== "complete") {+ return <ToolLine label="Drawing" detail={component.name} running />;+ }++ return (+ <div className="my-2">+ <OpenGenerativeUIActivityRenderer+ activityType="open-generative-ui"+ agent={null}+ content={{+ css: component.css,+ cssComplete: true,+ html: [component.html],+ htmlComplete: true,+ jsFunctions: `window.__args = ${JSON.stringify(props.args ?? {})};\n${component.jsFunctions}`,+ jsFunctionsComplete: true,+ generating: false,+ }}+ key={JSON.stringify(props.args ?? {})}+ message={null}+ />+ </div>+ );+ },+ [component, isHeld, refusals],+ );++ useFrontendTool({+ name: component.name,+ description:+ description ??+ `A component authored in this deployment: ${component.name}.`,+ parameters: parametersFor(component.argumentSchema),+ // Keep the hook mounted and hide revoked grants from the model to preserve hook order.+ available: isHeld,+ handler: async (+ _args: unknown,+ context: { toolCall?: { id?: string } } = {},+ ) => {+ const decision = await decideComponent(component.name, botId);+ if (!decision.allowed) {+ const reason = decision.reason ?? "That component is not allowed here.";+ const id = context?.toolCall?.id;+ if (id) setRefusals((current) => new Map(current).set(id, reason));+ return reason;+ }+ return "It is now on screen for the person.";+ },+ render,+ });++ return null;+}diff --git a/app/src/lib/plugins/queries.ts b/app/src/lib/plugins/queries.tsnew file mode 100644index 00000000..aad4c73a--- /dev/null+++ b/app/src/lib/plugins/queries.ts@@ -0,0 +1,166 @@+import { queryOptions } from "@tanstack/react-query";++/** A tool one server offers, as the Plugins page sees it. */+export type PluginTool = {+ serverId: string;+ name: string;+ description: string;+ inputSchema: Record<string, unknown>;+ /** `<serverId>/<name>`. What a grant names. */+ ref: string;+ /** Whether it changes something. Anything not positively known to be a read is a write. */+ effect: "read" | "write";+ grantedTo: string[];+};++export type PluginServer = {+ id: string;+ title: string;+ vendor: string;+ url: string;+ summary: string;+ docsUrl: string;+ /** `first-party` for a reviewed entry, `custom` for one an administrator added by URL. */+ provenance: string;+ hasCredential: boolean;+ toolsRefreshedAt: string | null;+ lastError: string | null;+ addedBy: string | null;+ tools: PluginTool[];+};++export type PluginSkill = {+ id: string;+ slug: string;+ /** Whose it is. Null means the deployment's: an administrator looks after it. */+ ownerUserId: string | null;+ title: string;+ summary: string;+ instructions: string;+ origin: string;+ installedBy: string | null;+ grantedTo: string[];+};++export type CatalogueItem = {+ key: string;+ title: string;+ vendor: string;+ summary: string;+ docsUrl: string;+ needsCredential: boolean;+ /** True for a vendor that gives every customer their own hostname. */+ perInstance: boolean;+};++export type PluginsPage = {+ catalogue: CatalogueItem[];+ servers: PluginServer[];+ skills: PluginSkill[];+};++/** What one Bot holds, which is all the runtime needs to offer it. */+export type GrantedPlugins = {+ tools: {+ ref: string;+ toolName: string;+ description: string;+ inputSchema: Record<string, unknown>;+ }[];+ skills: {+ slug: string;+ title: string;+ summary: string;+ instructions: string;+ }[];+};++export const pluginKeys = {+ all: ["plugins"] as const,+ page: () => ["plugins", "page"] as const,+ forAgent: (agentId: string) => ["plugins", "for-agent", agentId] as const,+};++export function pluginsPageQueryOptions() {+ return queryOptions({+ queryKey: pluginKeys.page(),+ queryFn: async (): Promise<PluginsPage> => {+ const response = await fetch("/api/plugins", { credentials: "include" });+ if (!response.ok) throw new Error("Plugins could not be loaded.");+ return response.json();+ },+ });+}++/**+ * Polled grant snapshot for what the active Bot should be offered; call-time checks still enforce.+ */+export function agentPluginsQueryOptions(agentId: string) {+ return queryOptions({+ queryKey: pluginKeys.forAgent(agentId),+ enabled: agentId.length > 0,+ refetchInterval: 15_000,+ queryFn: async (): Promise<GrantedPlugins> => {+ const response = await fetch(+ `/api/plugins/for/${encodeURIComponent(agentId)}`,+ { credentials: "include" },+ );+ if (!response.ok)+ throw new Error("This Bot's plugins could not be read.");+ return response.json();+ },+ });+}++export type PluginCallOutcome =+ | { ok: true; text: string; isError: boolean }+ /** The deployment decided against it. `rule` names the expression, when one decided. */+ | { ok: false; refused: true; reason: string; rule: string | null }+ /** Remote server failure; distinct from a policy refusal. */+ | { ok: false; refused: false; reason: string };++/**+ * Call a tool as a Bot, with server-side grant and policy rechecks for mid-run revocations.+ */+export async function callPluginTool(+ ref: string,+ args: Record<string, unknown>,+ agentId: string,+ signal?: AbortSignal,+): Promise<PluginCallOutcome> {+ const response = await fetch("/api/plugins/call", {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ ref, args, agentId }),+ ...(signal ? { signal } : {}),+ });++ const body = (await response.json().catch(() => null)) as {+ text?: string;+ isError?: boolean;+ error?: string;+ rule?: string | null;+ } | null;++ if (response.ok) {+ return {+ ok: true,+ text: body?.text ?? "",+ isError: body?.isError === true,+ };+ }+ if (response.status === 403) {+ return {+ ok: false,+ refused: true,+ reason: body?.error ?? "That tool is not allowed here.",+ rule: body?.rule ?? null,+ };+ }+ return {+ ok: false,+ refused: false,+ reason: body?.error ?? "The server did not answer.",+ };+}diff --git a/app/src/lib/plugins/skill-commands.ts b/app/src/lib/plugins/skill-commands.tsnew file mode 100644index 00000000..37ecd9ba--- /dev/null+++ b/app/src/lib/plugins/skill-commands.ts@@ -0,0 +1,38 @@+import { useQuery } from "@tanstack/react-query";+import { useMemo } from "react";+import type { CommandOption } from "@/components/channels/composer";+import { agentPluginsQueryOptions } from "@/lib/plugins/queries";++/**+ * Granted skills as `/` menu commands. Each one inserts a chip, not composer text.+ */+export function useSkillCommands(agentId: string): CommandOption[] {+ const { data } = useQuery(agentPluginsQueryOptions(agentId));++ return useMemo(+ () =>+ (data?.skills ?? []).map((skill) => ({+ id: skill.slug,+ name: skill.slug,+ description: skill.summary || skill.title,+ /*+ * A CHIP, NOT AN EXPANSION. `prompt` used to paste the skill's whole instruction into the+ * box, which meant a person watched a paragraph they did not write appear over the message+ * they were typing, and had to scroll past it to reach their own words.+ *+ * The chip stays, one token wide, and `channel-chat` reads `draft.commandIds` on send and+ * puts the instruction in front of the run. Nothing is hidden by this that was not already:+ * the instruction is the skill's own text, visible on the skills page, and a skill is an+ * instruction rather than a capability — it can only ask for tools the Bot already holds.+ */+ kind: "chip" as const,+ /*+ * Carried on the option rather than looked up again at send time. `applyCommandChips` only+ * substitutes `prompt` for `kind: "prompt"`, so on a chip this is inert payload, and the+ * alternative is a second query racing the first for the same rows.+ */+ prompt: skill.instructions,+ })),+ [data],+ );+}diff --git a/app/src/lib/theme.ts b/app/src/lib/theme.tsnew file mode 100644index 00000000..b6424541--- /dev/null+++ b/app/src/lib/theme.ts@@ -0,0 +1,15 @@+export const THEME_STORAGE_KEY = "openbot-theme";++export function parseStoredDarkTheme(value: string | null) {+ return value === "dark";+}++type ThemeEffects = {+ setStoredValue: (key: string, value: string) => void;+ toggleRootClass: (name: string, force: boolean) => void;+};++export function applyDarkTheme(dark: boolean, effects: ThemeEffects) {+ effects.setStoredValue(THEME_STORAGE_KEY, dark ? "dark" : "light");+ effects.toggleRootClass("dark", dark);+}diff --git a/app/src/lib/utils.ts b/app/src/lib/utils.tsnew file mode 100644index 00000000..365058ce--- /dev/null+++ b/app/src/lib/utils.ts@@ -0,0 +1,6 @@+import { type ClassValue, clsx } from "clsx";+import { twMerge } from "tailwind-merge";++export function cn(...inputs: ClassValue[]) {+ return twMerge(clsx(inputs));+}diff --git a/app/src/query-client.ts b/app/src/query-client.tsnew file mode 100644index 00000000..6bc5929d--- /dev/null+++ b/app/src/query-client.ts@@ -0,0 +1,10 @@+import { QueryClient } from "@tanstack/react-query";++export const queryClient = new QueryClient({+ defaultOptions: {+ queries: {+ retry: 1,+ refetchOnWindowFocus: false,+ },+ },+});diff --git a/app/src/routes/__root.tsx b/app/src/routes/__root.tsxnew file mode 100644index 00000000..645f935d--- /dev/null+++ b/app/src/routes/__root.tsx@@ -0,0 +1,21 @@+import { createRootRouteWithContext, Outlet } from "@tanstack/react-router";+import { ThemeProvider } from "@/components/theme-provider";+import { TooltipProvider } from "@/components/ui/tooltip";+import type { RouterContext } from "../router-context";+import "@fontsource-variable/inter/wght.css";++export const Route = createRootRouteWithContext<RouterContext>()({+ component: RootComponent,+});++function RootComponent() {+ return (+ <div className="min-h-dvh w-full antialiased">+ <ThemeProvider>+ <TooltipProvider>+ <Outlet />+ </TooltipProvider>+ </ThemeProvider>+ </div>+ );+}diff --git a/app/src/routes/_authed/_app.tsx b/app/src/routes/_authed/_app.tsxnew file mode 100644index 00000000..7b46a490--- /dev/null+++ b/app/src/routes/_authed/_app.tsx@@ -0,0 +1,28 @@+import { createFileRoute, Outlet } from "@tanstack/react-router";+import { AppSidebar } from "@/components/app-sidebar/app-sidebar";+import { SidebarProvider } from "@/components/ui/sidebar";++export const Route = createFileRoute("/_authed/_app")({+ component: RouteComponent,+});++function RouteComponent() {+ return (+ // One viewport, never scrolls: panes scroll inside it. A growable shell lets the transcript's+ // scroller size against the page, grow it, and grow again.+ <SidebarProvider+ className="h-svh overflow-hidden"+ style={+ {+ "--sidebar-width": "340px",+ "--sidebar-width-mobile": "20rem",+ } as React.CSSProperties+ }+ >+ <AppSidebar />+ <main className="flex-1 flex flex-col min-h-0 overflow-hidden">+ <Outlet />+ </main>+ </SidebarProvider>+ );+}diff --git a/app/src/routes/_authed/_app/agents/index.tsx b/app/src/routes/_authed/_app/agents/index.tsxnew file mode 100644index 00000000..6259c761--- /dev/null+++ b/app/src/routes/_authed/_app/agents/index.tsx@@ -0,0 +1,110 @@+import { IconPlus } from "@tabler/icons-react";+import { useQuery } from "@tanstack/react-query";+import { createFileRoute, Link } from "@tanstack/react-router";+import { z } from "zod";+import { AgentCard } from "@/components/agents/agent-card";+import { StaggerItem } from "@/components/layout/stagger";+import { AgentProfile as AgentProfileDetail } from "@/components/agents/agent-profile";+import { NewAgent } from "@/components/agents/new-agent";+import { DetailPanel } from "@/components/layout/detail-panel";+import { Button } from "@/components/ui/button";+import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";+import { agentListQueryOptions } from "@/lib/agents/queries";++/**+ * Creating and inspecting a teammate are search-parameter states so the roster remains mounted and+ * Back closes the detail pane.+ */+const agentsSearchSchema = z.object({+ new: z.boolean().optional(),+ agent: z.string().optional(),+});++export const Route = createFileRoute("/_authed/_app/agents/")({+ validateSearch: agentsSearchSchema,+ component: AgentsScreen,+});++function AgentsScreen() {+ const { new: isCreating, agent: selectedAgentId } = Route.useSearch();+ const navigate = Route.useNavigate();+ const { data: agents } = useQuery(agentListQueryOptions());+ const mine = agents?.filter((a) => a.mine);+ const explore = agents?.filter((a) => !a.mine && a.visibility === "public");++ // Creating wins if both are somehow set: it is the more recent intent.+ const showCreate = isCreating === true;+ const showProfile = !showCreate && selectedAgentId !== undefined;+ const close = () => navigate({ search: {} });++ return (+ <DetailPanel+ onClose={close}+ open={showCreate || showProfile}+ detail={+ showCreate ? (+ <NewAgent />+ ) : selectedAgentId ? (+ <AgentProfileDetail agentId={selectedAgentId} />+ ) : null+ }+ >+ <div className="max-w-2xl px-4 w-full mx-auto">+ <div className="mt-12 w-full max-w-2xl">+ <div className="flex flex-row w-full items-center justify-between">+ <h2 className="font-bold text-lg">Your agents</h2>+ <Button+ variant="ghost"+ size="sm"+ render={(props) => (+ <Link to="/agents" search={{ new: true }} {...props} />+ )}+ >+ <IconPlus />+ New agent+ </Button>+ </div>+ <div className="flex flex-row mt-4">+ {!!mine?.length && (+ <div className="grid grid-cols-4 gap-4">+ {mine.map((agent, index) => {+ return (+ <StaggerItem index={index} key={agent.id}>+ <Link to="/agents" search={{ agent: agent.id }}>+ <AgentCard agent={agent} />+ </Link>+ </StaggerItem>+ );+ })}+ </div>+ )}+ {!mine?.length && (+ <Empty className="border border-dashed h-[180px]">+ <EmptyHeader>+ <EmptyTitle className="text-muted-foreground">+ You don't have any agents created.+ </EmptyTitle>+ </EmptyHeader>+ </Empty>+ )}+ </div>+ </div>+ <div className="mt-8 w-full max-w-2xl">+ <h2 className="font-bold text-lg">Explore agents</h2>+ <div className="grid grid-cols-4 gap-4 mt-4">+ {!!explore?.length &&+ explore.map((agent, index) => {+ return (+ <StaggerItem index={index} key={agent.id}>+ <Link to="/agents" search={{ agent: agent.id }}>+ <AgentCard agent={agent} />+ </Link>+ </StaggerItem>+ );+ })}+ </div>+ </div>+ </div>+ </DetailPanel>+ );+}diff --git a/app/src/routes/_authed/_app/bot.tsx b/app/src/routes/_authed/_app/bot.tsxnew file mode 100644index 00000000..a0d56770--- /dev/null+++ b/app/src/routes/_authed/_app/bot.tsx@@ -0,0 +1,37 @@+import { CopilotChat } from "@copilotkit/react-core/v2";+import { createFileRoute } from "@tanstack/react-router";+import { useActiveBot } from "@/lib/copilot/active-bot";+import { useBotThread } from "@/lib/copilot/bot-thread";++export const Route = createFileRoute("/_authed/_app/bot")({+ component: RouteComponent,+ validateSearch: (search: Record<string, unknown>): { agent?: string } => ({+ ...(typeof search.agent === "string" ? { agent: search.agent } : {}),+ }),+});++function RouteComponent() {+ const { agent } = Route.useSearch();+ const agentId = agent ?? "risk-analyst";++ // Tool calls here act on this Bot's own computer.+ useActiveBot(agentId);+ // Minted by this deployment rather than by the chat, and the same one on the next visit.+ const threadId = useBotThread(agentId);+ return (+ <div className="flex h-screen flex-col">+ <header className="border-b px-6 py-3">+ <h1 className="text-lg font-semibold">Browser Bot</h1>+ <p className="text-sm text-muted-foreground">+ Ask it to open a page and watch it work.+ </p>+ </header>+ <div className="min-h-0 flex-1">+ {/* Remount when switching Bots so chat state stays bound to the selected agent. */}+ {threadId ? (+ <CopilotChat agentId={agentId} key={agentId} threadId={threadId} />+ ) : null}+ </div>+ </div>+ );+}diff --git a/app/src/routes/_authed/_app/channel/$channelId.tsx b/app/src/routes/_authed/_app/channel/$channelId.tsxnew file mode 100644index 00000000..717d33b6--- /dev/null+++ b/app/src/routes/_authed/_app/channel/$channelId.tsx@@ -0,0 +1,247 @@+import { IconDeviceDesktop, IconSettings } from "@tabler/icons-react";+import { useQuery } from "@tanstack/react-query";+import { createFileRoute } from "@tanstack/react-router";+import { motion, useReducedMotion } from "motion/react";+import { useEffect, useRef } from "react";+import { z } from "zod";+import { AgentProfile } from "@/components/agents/agent-profile";+import { ChannelAvatar } from "@/components/channels/avatar";+import { ChannelChat } from "@/components/channels/channel-chat";+import { ComputerView } from "@/components/computer/computer-view";+import { useNeedsYou } from "@/components/computer/needs-you";+import { DetailPanel } from "@/components/layout/detail-panel";+import { Button } from "@/components/ui/button";+import { type AgentChannel, channelQueryOptions } from "@/lib/channels/queries";+import { onComputerActivity } from "@/lib/copilot/computer-activity";++const chatSearchSchema = z.object({+ settings: z.boolean().optional(),+ /** Opens the Bot's screen in the shared detail pane. */+ watch: z.boolean().optional(),+});++const EASE_OUT = [0.23, 1, 0.32, 1] as const;++const HEADING_ENTRANCE_SECONDS = 0.18;+const HEADING_ENTRANCE_OFFSET = "translateY(4px)";++/** Shared detail pane width for the live screen view. */+const SCREEN_PANEL_WIDTH = 400;++export const Route = createFileRoute("/_authed/_app/channel/$channelId")({+ validateSearch: chatSearchSchema,+ component: RouteComponent,+});++function ComputerViewPanel({+ agentId,+ name,+}: {+ agentId: string;+ name?: string;+}) {+ return (+ <div className="px-4 mt-4">+ <div className="p-4">+ <ComputerView active computerId={agentId} />+ <span className="flex items-center justify-center w-full text-center text-muted-foreground mt-4 text-sm">+ {name || "Agent"}'s screen+ </span>+ </div>+ </div>+ );+}++function RouteComponent() {+ const { channelId } = Route.useParams();+ const { settings, watch } = Route.useSearch();+ const channel = useQuery(channelQueryOptions(channelId));+ const navigate = Route.useNavigate();+ const isSettingsOpen = settings === true;+ const prefersReducedMotion = useReducedMotion();+ const isWatching = watch === true;+ /** Channel routing currently supports one teammate. */+ const agentId = channel.data?.agentIds[0];+ /** Needs-you state is rendered by the screen when the screen is already open. */+ const needsYou = useNeedsYou(agentId, !isWatching);++ // Needs-you prompts auto-open the screen because the actionable prompt is rendered there.+ useEffect(() => {+ if (!needsYou) return;+ show("watch");+ });++ // Browser activity may auto-open the screen once per run unless this run was dismissed.+ const dismissedEpoch = useRef<number | null>(null);+ const runEpoch = useRef<number | null>(null);+ useEffect(() => {+ if (!agentId) return;+ return onComputerActivity((activity) => {+ if (activity.botId !== agentId) return;+ runEpoch.current = activity.epoch;+ if (dismissedEpoch.current === activity.epoch) return;+ navigate({+ search: (previous) =>+ previous.watch === true || previous.settings === true+ ? previous+ : { ...previous, settings: undefined, watch: true },+ });+ });+ }, [agentId, navigate]);++ // Settings and watch share one pane; opening either clears the other URL flag.+ const show = (next: "settings" | "watch" | null) => {+ // Dismissal applies only to the current browser-activity run.+ if (next !== "watch" && isWatching)+ dismissedEpoch.current = runEpoch.current;+ return navigate({+ search: (previous) => ({+ ...previous,+ settings: next === "settings" ? true : undefined,+ watch: next === "watch" ? true : undefined,+ }),+ });+ };++ return (+ <DetailPanel+ onClose={() => show(null)}+ open={(isSettingsOpen || isWatching) && agentId !== undefined}+ detailWidth={isWatching ? SCREEN_PANEL_WIDTH : undefined}+ detail={+ agentId === undefined ? null : isWatching ? (+ // Manual watch remains active even when there is no current browser action.+ <ComputerViewPanel agentId={agentId} name={channel?.data?.name} />+ ) : (+ <AgentProfile agentId={agentId} />+ )+ }+ >+ <div className="flex flex-col">+ <div className="h-12 border-b border-border sticky top-0 flex flex-row items-center justify-between px-3 gap-2">+ {/* Keyed on the displayed name so cold channel loads animate the resolved name, not the id. */}+ <div className="flex min-w-0 items-center gap-1.5">+ <motion.div+ animate={{ opacity: 1 }}+ className="shrink-0"+ initial={{ opacity: 0 }}+ key={`avatar:${channel.data?.name ?? channelId}`}+ transition={{+ duration: HEADING_ENTRANCE_SECONDS,+ ease: EASE_OUT,+ }}+ >+ <ChannelAvatar+ participantIds={channel.data?.agentIds ?? []}+ size={22}+ />+ </motion.div>+ <motion.span+ animate={+ prefersReducedMotion+ ? { opacity: 1 }+ : { opacity: 1, transform: "translateY(0px)" }+ }+ className="min-w-0 text-sm tracking-tight truncate"+ initial={+ prefersReducedMotion+ ? { opacity: 0 }+ : { opacity: 0, transform: HEADING_ENTRANCE_OFFSET }+ }+ key={`name:${channel.data?.name ?? channelId}`}+ transition={{+ duration: HEADING_ENTRANCE_SECONDS,+ ease: EASE_OUT,+ }}+ >+ {channel.data?.name ?? "Channel"}+ </motion.span>+ </div>+ <div className="flex flex-row gap-1.5">+ <Button+ aria-label={+ needsYou+ ? "This Bot is waiting for you. Open its screen"+ : "Watch this Bot's screen"+ }+ aria-pressed={isWatching}+ className={`relative ${isWatching ? "bg-foreground/5" : ""}`}+ disabled={agentId === undefined}+ onClick={() => show(isWatching ? null : "watch")}+ variant="ghost"+ size="icon"+ >+ <IconDeviceDesktop className="size-4.5" />+ {/* Mirrors needs-you state outside the hidden screen pane. */}+ {needsYou ? (+ <span className="absolute right-1 top-1 size-2 rounded-full bg-amber-500" />+ ) : null}+ </Button>+ <Button+ aria-label="Channel teammate"+ aria-pressed={isSettingsOpen}+ className={isSettingsOpen ? "bg-foreground/5" : undefined}+ disabled={agentId === undefined}+ onClick={() => show(isSettingsOpen ? null : "settings")}+ variant="ghost"+ size="icon"+ >+ <IconSettings className="size-4.5" />+ </Button>+ </div>+ </div>+ </div>+ <ChannelBody+ channel={channel.data}+ isPending={channel.isPending}+ hasError={Boolean(channel.error)}+ />+ </DetailPanel>+ );+}++/**+ * A channel holds exactly one teammate. More than one is not supported yet, and rendering a shared+ * transcript for several agents before the runtime can route between them would look like it works.+ */+function ChannelBody({+ channel,+ isPending,+ hasError,+}: {+ channel: AgentChannel | undefined;+ isPending: boolean;+ hasError: boolean;+}) {+ if (isPending) {+ return (+ <p className="p-8 text-sm text-muted-foreground">Loading channel…</p>+ );+ }+ if (hasError || !channel) {+ return (+ <p className="p-8 text-sm text-destructive" role="alert">+ Could not load this channel.+ </p>+ );+ }++ const runtimeAgentId =+ channel.agentIds.length === 1 ? channel.agentIds[0] : undefined;+ if (!runtimeAgentId) {+ return (+ <p className="p-8 text-sm text-muted-foreground">+ This channel has more than one teammate, which is not supported yet.+ </p>+ );+ }++ // Remount on channel changes so CopilotKit agent/thread state cannot leak between channels.+ return (+ <ChannelChat+ channel={channel}+ key={channel.id}+ runtimeAgentId={runtimeAgentId}+ />+ );+}diff --git a/app/src/routes/_authed/_app/channel/new.tsx b/app/src/routes/_authed/_app/channel/new.tsxnew file mode 100644index 00000000..0d95b76d--- /dev/null+++ b/app/src/routes/_authed/_app/channel/new.tsx@@ -0,0 +1,144 @@+import type { Message } from "@ag-ui/core";+import { useQuery } from "@tanstack/react-query";+import { createFileRoute } from "@tanstack/react-router";+import { useState } from "react";+import { ChannelAvatar } from "@/components/channels/avatar";+import { canSend, type Recipient } from "@/components/channels/compose-state";+import { ConversationView } from "@/components/channels/conversation-view";+import { seedMessage } from "@/components/channels/transcript-messages";+import {+ Combobox,+ ComboboxContent,+ ComboboxEmpty,+ ComboboxInput,+ ComboboxItem,+ ComboboxList,+} from "@/components/ui/combobox";+import {+ type AgentProfile,+ agentListQueryOptions,+ agentQueryOptions,+} from "@/lib/agents/queries";+import { useStartChannel } from "@/lib/channels/start";+import { useSkillCommands } from "@/lib/plugins/skill-commands";++/**+ * Creates the channel on first send. The selected teammate stays in the URL so profile links and+ * reloads preserve the pending recipient without creating an empty channel.+ */+export const Route = createFileRoute("/_authed/_app/channel/new")({+ validateSearch: (search: Record<string, unknown>): { agent?: string } => ({+ ...(typeof search.agent === "string" ? { agent: search.agent } : {}),+ }),+ component: RouteComponent,+});++function RouteComponent() {+ const { agent } = Route.useSearch();+ const navigate = Route.useNavigate();+ const { start, pending } = useStartChannel();+ const { data: profiles } = useQuery(agentListQueryOptions());++ const [error, setError] = useState<string | null>(null);+ // Optimistic seed shown before the first channel record exists.+ const [sent, setSent] = useState<Message | null>(null);++ // Stale or private `?agent=` values are ignored because the roster is permission-filtered.+ const listed = profiles?.find((profile) => profile.id === agent);+ /**+ * Hidden teammates are omitted from the roster but may still be valid recipients from a profile+ * link, so fetch the URL-selected teammate when it is absent from the visible list.+ */+ const { data: fetched } = useQuery({+ ...agentQueryOptions(agent ?? ""),+ enabled: Boolean(agent) && !listed,+ retry: false,+ });+ const chosen = listed ?? (fetched?.id === agent ? fetched : undefined);+ const recipients: Recipient[] = chosen+ ? [{ id: chosen.id, name: chosen.name }]+ : [];+ const skillCommands = useSkillCommands(chosen?.id ?? "");++ return (+ <div className="flex h-full flex-col">+ <div className="h-12 border-b border-border sticky top-0 flex flex-row px-2 items-center">+ <span className="text-sm text-muted-foreground">To:</span>+ <Combobox+ // Do not auto-open when the recipient came from the URL; the field is already answered.+ defaultOpen={!agent}+ autoHighlight+ items={profiles ?? []}+ isItemEqualToValue={(item: AgentProfile, value: AgentProfile) =>+ item.id === value.id+ }+ itemToStringLabel={(item: AgentProfile) => item.name}+ itemToStringValue={(item: AgentProfile) => item.id}+ onValueChange={(next) => {+ // Recipient changes are not separate navigation history entries.+ void navigate({+ replace: true,+ search: next ? { agent: next.id } : {},+ });+ }}+ value={chosen ?? null}+ >+ <ComboboxInput+ placeholder="Choose a teammate…"+ // InputGroup owns focus rings via `has-[…:focus-visible]`; disable that wrapper ring here.+ className="border-none w-full bg-transparent! text-sm has-[[data-slot=input-group-control]:focus-visible]:ring-0"+ />+ {/* Allow max-w to constrain the popup even though its anchor is full-width. */}+ <ComboboxContent className="min-w-0 max-w-lg" sideOffset={12}>+ <ComboboxEmpty>No agents found.</ComboboxEmpty>+ <ComboboxList>+ {(item: AgentProfile) => (+ <ComboboxItem key={item.id} value={item} className="h-10">+ <ChannelAvatar participantIds={[item.id]} size={24} />+ {item.name}+ <span className="truncate text-muted-foreground ml-1">+ {item.title}+ </span>+ </ComboboxItem>+ )}+ </ComboboxList>+ </ComboboxContent>+ </Combobox>+ </div>+ <ConversationView+ // Commands must be loaded before the first channel message is sent.+ commands={skillCommands}+ disabled={recipients.length === 0}+ messages={sent ? [sent] : []}+ notice={+ error ? (+ <p className="pb-2 text-sm text-destructive" role="alert">+ {error}+ </p>+ ) : null+ }+ onSubmit={async (draft) => {+ const recipient = recipients[0];+ if (!recipient || !canSend(recipients, draft.text)) return;++ setError(null);+ setSent(seedMessage(draft.text, crypto.randomUUID()));++ try {+ await start(recipient.id, draft.text);+ } catch (caught) {+ // Preserve the unsent draft when channel creation fails.+ setSent(null);+ setError(+ caught instanceof Error+ ? caught.message+ : "Could not start the conversation.",+ );+ throw caught;+ }+ }}+ pending={pending}+ />+ </div>+ );+}diff --git a/app/src/routes/_authed/_app/index.tsx b/app/src/routes/_authed/_app/index.tsxnew file mode 100644index 00000000..e75d3481--- /dev/null+++ b/app/src/routes/_authed/_app/index.tsx@@ -0,0 +1,92 @@+import { useQuery } from "@tanstack/react-query";+import { createFileRoute, Link } from "@tanstack/react-router";+import { useState } from "react";+import { AgentCard } from "@/components/agents/agent-card";+import { Composer, toAgentOptions } from "@/components/channels/composer";+import { agentListQueryOptions } from "@/lib/agents/queries";+import { useStartChannel } from "@/lib/channels/start";+import { appConfig } from "@/lib/generated/application-config";++export const Route = createFileRoute("/_authed/_app/")({+ component: RouteComponent,+});++function RouteComponent() {+ const { data: agents } = useQuery(agentListQueryOptions());+ const explore = agents?.filter((a) => !a.mine && a.visibility === "public");+ const { start, pending } = useStartChannel();+ const [error, setError] = useState<string | null>(null);++ /** Default recipient when the composer draft has no mention. */+ const fallback = explore?.[0] ?? agents?.[0];++ return (+ <div className="flex-1 flex flex-col items-center justify-center w-full p-4 mt-8">+ <div className="flex flex-col items-center">+ <h2 className="text-sm uppercase text-muted-foreground font-medium tracking-tight text-center">+ {appConfig.brand.productName}+ </h2>+ <h1 className="text-2xl font-bold tracking-tight mt-1.5 text-center">+ Start a new channel+ </h1>+ </div>+ <div className="mt-8 w-full flex flex-col items-center">+ <Composer+ agents={toAgentOptions(agents)}+ className="w-full max-w-2xl"+ disabled={!fallback}+ onSubmit={async (draft) => {+ // A channel is pinned to one teammate for the life of its thread.+ const agentId = draft.agentId ?? fallback?.id;+ if (!agentId) return;++ setError(null);+ try {+ await start(agentId, draft.text);+ } catch (caught) {+ setError(+ caught instanceof Error+ ? caught.message+ : "Could not start the conversation.",+ );+ throw caught;+ }+ }}+ pending={pending}+ />+ {fallback ? (+ // Said out loud: a message that silently reaches somebody you did not choose is the+ // kind of surprise that costs trust the first time it happens.+ <p className="mt-2 w-full max-w-2xl text-xs text-muted-foreground text-center">+ Goes to {fallback.name}. Type <code>@</code> to reach somebody else.+ </p>+ ) : null}+ {error ? (+ <p+ className="mt-2 w-full max-w-2xl text-sm text-destructive"+ role="alert"+ >+ {error}+ </p>+ ) : null}+ </div>+ <div className="mt-10 w-full max-w-2xl">+ <h2 className="font-bold text-lg">Explore agents</h2>+ <div className="flex flex-row gap-4 mt-4">+ {!!explore?.length &&+ explore.map((agent) => (+ <Link+ key={agent.id}+ to="/channel/new"+ search={{+ agent: agent.id,+ }}+ >+ <AgentCard agent={agent} />+ </Link>+ ))}+ </div>+ </div>+ </div>+ );+}diff --git a/app/src/routes/_authed/_app/skills.tsx b/app/src/routes/_authed/_app/skills.tsxnew file mode 100644index 00000000..f53a18cb--- /dev/null+++ b/app/src/routes/_authed/_app/skills.tsx@@ -0,0 +1,338 @@+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { createFileRoute, Link } from "@tanstack/react-router";+import { useState } from "react";+import { z } from "zod";+import { IconPlus } from "@tabler/icons-react";+import { DetailPanel } from "@/components/layout/detail-panel";+import {+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { StaggerItem } from "@/components/layout/stagger";+import { EditSkill } from "@/components/skills/edit-skill";+import { NewSkill } from "@/components/skills/new-skill";+import { Button } from "@/components/ui/button";+import { currentUserQueryOptions } from "@/lib/auth/queries";+import { pluginKeys, pluginsPageQueryOptions } from "@/lib/plugins/queries";+import {+ Item,+ ItemActions,+ ItemContent,+ ItemDescription,+ ItemTitle,+} from "@/components/ui/item";+import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuGroup,+ DropdownMenuItem,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { IconDots } from "@tabler/icons-react";+import { Separator } from "@/components/ui/separator";++/**+ * Personal `/` skills. They are instructions, not capabilities, and can only be granted to Bots the+ * signed-in user owns.+ */++/**+ * Writing a skill is a search parameter rather than a route, so the list stays on screen behind the+ * panel and the form is linkable, reloadable, and closed by Back — the same contract the agents+ * roster makes.+ */+const skillsSearchSchema = z.object({+ new: z.boolean().optional(),+ /** The slug being edited. Absent means nothing is. */+ edit: z.string().optional(),+});++export const Route = createFileRoute("/_authed/_app/skills")({+ validateSearch: skillsSearchSchema,+ component: SkillsPage,+});++function SkillsPage() {+ const queryClient = useQueryClient();+ const { new: isCreating, edit: editingSlug } = Route.useSearch();+ const navigate = Route.useNavigate();+ // Creating wins if both are somehow set: it is the more recent intent, the same rule the agents+ // roster uses when `new` and `agent` arrive together.+ const showCreate = isCreating === true;+ const showEdit = !showCreate && editingSlug !== undefined;+ const { data } = useQuery(pluginsPageQueryOptions());+ const { data: me } = useQuery(currentUserQueryOptions());+ const [error, setError] = useState<string | null>(null);++ const mutate = useMutation({+ mutationFn: async (run: () => Promise<Response>) => {+ const response = await run();+ if (!response.ok) {+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ throw new Error(body?.error ?? "That did not work.");+ }+ },+ onError: (caught: Error) => setError(caught.message),+ onSuccess: () => {+ setError(null);+ void queryClient.invalidateQueries({ queryKey: pluginKeys.all });+ },+ });++ /*+ * The server has ALREADY excluded skills this person may not see — `listSkills` scopes the query+ * to `owner_user_id is null or owner_user_id = me`, so somebody else's private skill is never read+ * into the process. These two lines only sort what arrived into the two things the page draws.+ *+ * ONE CASE FALLS THROUGH ON PURPOSE, FOR NOW: an administrator receives everybody's skills, and+ * another person's lands in neither list. Not a leak, but an administrator cannot see here what+ * they are entitled to. Worth an owner column or a third section before this page is called done.+ */+ const skills = data?.skills ?? [];+ const mine = skills.filter((skill) => skill.ownerUserId === me?.id);+ const deployment = skills.filter((skill) => skill.ownerUserId === null);++ return (+ <DetailPanel+ detail={+ showCreate ? (+ <NewSkill />+ ) : editingSlug ? (+ <EditSkill slug={editingSlug} />+ ) : null+ }+ onClose={() => navigate({ search: {} })}+ open={showCreate || showEdit}+ >+ <PageShell+ description={+ <>+ A skill is a named instruction you invoke with <code>/</code> and a+ Bot follows. Yours are yours alone, and go on the Bots you own.+ </>+ }+ title="Agent Skills"+ >+ {error ? (+ <p className="text-sm text-destructive" role="alert">+ {error}+ </p>+ ) : null}++ <PageSection+ action={+ <Button+ render={(props) => (+ <Link search={{ new: true }} to="/skills" {...props} />+ )}+ size="sm"+ variant="ghost"+ >+ <IconPlus />+ New skill+ </Button>+ }+ title="Your skills"+ >+ {!!mine?.length && (+ <PageRows>+ {mine.map((skill, index) => (+ <StaggerItem index={index} key={skill.id}>+ <Item size="sm">+ <ItemContent>+ <ItemTitle>{skill.title}</ItemTitle>+ {/*+ * THE COMMAND FIRST, because it is the only part a person has to know. The title+ * says what the skill is for; `/slug` is what they actually type, and a page that+ * lists skills without showing how to invoke one leaves them guessing at it.+ *+ * The interpunct only appears when there is a summary to separate it from —+ * a trailing "· " on a skill written without one reads as something missing.+ */}+ <ItemDescription>+ <code className="font-mono text-foreground/80 text-xs">+ /{skill.slug}+ </code>+ {skill.summary ? ` · ${skill.summary}` : null}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <DropdownMenu>+ <DropdownMenuTrigger+ render={+ <Button variant="ghost" size="icon-sm">+ <IconDots />+ </Button>+ }+ ></DropdownMenuTrigger>+ <DropdownMenuContent>+ <DropdownMenuGroup>+ <DropdownMenuItem+ onClick={() =>+ navigate({ search: { edit: skill.slug } })+ }+ >+ Edit+ </DropdownMenuItem>+ {/*+ * Deleting is immediate and there is no undo. It is behind a menu rather+ * than sitting on the row for that reason, and the slug is named in the+ * label so the destructive item says WHICH skill it destroys — a menu+ * opened over the wrong row is the ordinary way this goes wrong.+ */}+ <DropdownMenuItem+ onClick={() =>+ mutate.mutate(() =>+ fetch(+ `/api/plugins/skills/${encodeURIComponent(skill.slug)}`,+ {+ method: "DELETE",+ credentials: "include",+ },+ ),+ )+ }+ variant="destructive"+ >+ Delete /{skill.slug}+ </DropdownMenuItem>+ </DropdownMenuGroup>+ </DropdownMenuContent>+ </DropdownMenu>+ </ItemActions>+ </Item>+ {index !== mine?.length - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ )}+ </PageSection>++ {/*+ * NO MENU ON THESE ROWS, AND THAT IS THE POINT. A workspace skill belongs to the deployment,+ * not to the person reading this page: they cannot edit it, delete it, or choose which Bots+ * carry it. Drawing the same dropdown here and refusing on click would be a worse answer than+ * not offering it — the server refuses either way, and an affordance that only ever fails is+ * a promise the page cannot keep.+ *+ * Hidden entirely when there are none, rather than shown empty: an administrator who has+ * written nothing yet is the normal case, and a permanently empty section reads as broken.+ */}+ {deployment.length > 0 ? (+ <PageSection+ description="Written for everyone by an administrator. Which Bots carry them is decided in Admin."+ title="Workspace skills"+ >+ <PageRows>+ {deployment.map((skill, index) => (+ <StaggerItem index={index} key={skill.id}>+ <Item size="sm">+ <ItemContent>+ <ItemTitle>{skill.title}</ItemTitle>+ {/*+ * THE COMMAND FIRST, because it is the only part a person has to know. The title+ * says what the skill is for; `/slug` is what they actually type, and a page that+ * lists skills without showing how to invoke one leaves them guessing at it.+ *+ * The interpunct only appears when there is a summary to separate it from —+ * a trailing "· " on a skill written without one reads as something missing.+ */}+ <ItemDescription>+ <code className="font-mono text-foreground/80">+ /{skill.slug}+ </code>+ {skill.summary ? ` · ${skill.summary}` : null}+ </ItemDescription>+ </ItemContent>+ </Item>+ {index !== deployment.length - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ </PageSection>+ ) : null}++ {/*+ * The commented write-a-skill form that used to sit here is gone: the detail panel above is+ * the real one now. `SkillRow` below is still parked, because its per-Bot grant toggles have+ * no equivalent in the redesigned rows yet.+ */}+ </PageShell>+ </DetailPanel>+ );+}++/*+ * Parked, not deleted. Its only callers are the commented sections above, and it still holds the+ * per-Bot grant toggles — the one piece of the old page the new one has no equivalent for yet.+ * Whoever adds granting to the redesigned rows should start from this rather than reinvent it.+ *+ * function SkillRow({+ * skill,+ * bots,+ * onToggle,+ * onDelete,+ * }: {+ * skill: PluginSkill;+ * bots: { id: string; name: string }[];+ * onToggle?: (agentId: string, held: boolean) => void;+ * onDelete?: () => void;+ * }) {+ * const held = new Set(skill.grantedTo);+ *+ * return (+ * <li className="rounded-xl border border-border p-4">+ * <div className="flex items-start justify-between gap-4">+ * <div className="min-w-0">+ * <div className="flex items-baseline gap-2">+ * <code className="font-medium">/{skill.slug}</code>+ * <span className="text-sm text-muted-foreground">{skill.title}</span>+ * </div>+ * {skill.summary ? (+ * <p className="mt-0.5 text-sm text-muted-foreground">+ * {skill.summary}+ * </p>+ * ) : null}+ * </div>+ * {onDelete ? (+ * <Button onClick={onDelete} size="sm" variant="outline">+ * Delete+ * </Button>+ * ) : null}+ * </div>+ *+ * {onToggle ? (+ * <div className="mt-3 flex flex-wrap items-center gap-2">+ * {bots.length === 0 ? (+ * <p className="text-sm text-muted-foreground">+ * You do not own a Bot to put this on yet.+ * </p>+ * ) : (+ * bots.map((bot) => {+ * const on = held.has(bot.id);+ * return (+ * <button+ * className={`rounded-lg border px-2.5 py-1.5 text-sm transition-colors ${+ * on+ * ? "border-primary/40 bg-primary/10 text-foreground"+ * : "border-border text-muted-foreground hover:text-foreground"+ * }`}+ * key={bot.id}+ * onClick={() => onToggle(bot.id, on)}+ * type="button"+ * >+ * {on ? "✓ " : ""}+ * {bot.name}+ * </button>+ * );+ * })+ * )}+ * </div>+ * ) : null}+ * </li>+ * );+ * }+ */diff --git a/app/src/routes/_authed/admin/audit.tsx b/app/src/routes/_authed/admin/audit.tsxnew file mode 100644index 00000000..d6f44e58--- /dev/null+++ b/app/src/routes/_authed/admin/audit.tsx@@ -0,0 +1,299 @@+import { IconRefresh } from "@tabler/icons-react";+import { useQuery } from "@tanstack/react-query";+import { createFileRoute } from "@tanstack/react-router";+import { useState } from "react";+import {+ PageEmpty,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { Button } from "@/components/ui/button";+import { useBotNames } from "@/lib/agents/bot-names";+import { auditEventsQueryOptions } from "@/lib/audit/queries";++/**+ * Read surface for policy, computer, component, MCP, and credential audit events.+ */+export const Route = createFileRoute("/_authed/admin/audit")({+ component: AuditPage,+});++/** One row as the API returns it. */+type AuditEvent = {+ id: string;+ actorUserId: string | null;+ eventType: string;+ targetType: string;+ targetId: string | null;+ payload: Record<string, unknown>;+ createdAt: string;+};++const FILTERS = [+ { label: "Everything", search: "" },+ { label: "Computer actions", search: "?eventType=computer.action_allowed" },+ {+ label: "Blocked",+ // Include every refusal family, not only browser policy refusals.+ search:+ "?eventType=computer.action_refused,mcp.call_rejected,component.refused,component.function_refused",+ },+ { label: "Did not happen", search: "?eventType=computer.action_failed" },+] as const;++function AuditPage() {+ const [search, setSearch] = useState<string>(FILTERS[0].search);+ const events = useQuery(auditEventsQueryOptions(search));+ const rows = (events.data?.events ?? []) as AuditEvent[];+ const nameFor = useBotNames();++ return (+ /*+ * THE ONE WIDE PAGE IN ADMIN, and the one that keeps a table. Five columns of short values is+ * what a log is; rows of prose would make every entry a paragraph and the scanning this page+ * exists for impossible. It takes the same header and the same type scale as everything else,+ * and differs only where the content forces it to.+ */+ <PageShell+ action={+ <Button onClick={() => events.refetch()} size="sm" variant="ghost">+ <IconRefresh />+ Refresh+ </Button>+ }+ description="Every action a Bot took, and every one this deployment's policy refused."+ title="Audit"+ width="wide"+ >+ <PageSection>+ <div className="flex flex-wrap gap-2">+ {FILTERS.map((filter) => (+ <Button+ key={filter.label}+ onClick={() => setSearch(filter.search)}+ size="sm"+ type="button"+ /* The fill is the state, as on every other set of switches in the app. */+ variant={search === filter.search ? "default" : "outline"}+ >+ {filter.label}+ </Button>+ ))}+ </div>++ {events.isPending ? (+ <PageEmpty>Loading the trail…</PageEmpty>+ ) : events.isError ? (+ <p className="mt-4 text-destructive text-sm" role="alert">+ The audit trail could not be loaded.+ </p>+ ) : rows.length === 0 ? (+ <PageEmpty>No events match this filter yet.</PageEmpty>+ ) : (+ <div className="mt-4 overflow-x-auto rounded-lg border border-border bg-card">+ <table className="w-full text-left text-sm">+ <thead className="text-muted-foreground text-xs uppercase">+ <tr className="border-border border-b">+ <th className="px-4 py-2 font-medium">When</th>+ <th className="px-4 py-2 font-medium">What</th>+ <th className="px-4 py-2 font-medium">On</th>+ <th className="px-4 py-2 font-medium">Bot</th>+ <th className="px-4 py-2 font-medium">Decision</th>+ </tr>+ </thead>+ <tbody>+ {rows.map((event) => (+ <Row event={event} key={event.id} nameFor={nameFor} />+ ))}+ </tbody>+ </table>+ </div>+ )}+ </PageSection>+ </PageShell>+ );+}++function Row({+ event,+ nameFor,+}: {+ event: AuditEvent;+ nameFor: (botId: string) => string;+}) {+ const payload = event.payload ?? {};+ const decision = (payload.decision ?? {}) as {+ allowed?: boolean;+ mode?: string;+ rule?: string | null;+ carriedOut?: boolean;+ };+ const element = payload.element as+ | { role?: string; name?: string }+ | string+ | undefined;+ const refused =+ event.eventType === "computer.action_refused" ||+ event.eventType === "component.refused" ||+ event.eventType === "component.function_refused" ||+ event.eventType === "mcp.call_rejected";+ // Allowed by policy but not carried out.+ const failed = event.eventType === "computer.action_failed";++ return (+ <tr className="border-border border-t align-top">+ <td className="whitespace-nowrap px-4 py-2 text-muted-foreground">+ {new Date(event.createdAt).toLocaleTimeString()}+ </td>+ <td className="px-4 py-2 font-medium">+ {/* Strip the internal computer tool namespace for display. */}+ {typeof payload.action === "string"+ ? payload.action.replace("computer_", "")+ : event.eventType}+ </td>+ <td className="px-4 py-2">+ {/* Named targets and file paths are the audit subject before page elements. */}+ {NAMED_TARGETS.has(event.targetType) && event.targetId ? (+ <span className="font-mono text-xs">+ {event.targetId}+ {typeof payload.function === "string" ? (+ <span className="text-muted-foreground">+ {" "}+ · {payload.function}+ </span>+ ) : null}+ </span>+ ) : typeof payload.file === "string" ? (+ <span className="font-mono text-xs">{payload.file}</span>+ ) : typeof element === "object" && element?.name ? (+ <span>+ {element.name}+ {element.role ? (+ <span className="text-muted-foreground"> ({element.role})</span>+ ) : null}+ </span>+ ) : typeof element === "string" ? (+ <span className="text-muted-foreground">{element}</span>+ ) : (+ <span className="text-muted-foreground">-</span>+ )}+ {/* Page host is meaningful only for browser actions, not workspace file actions. */}+ {typeof payload.file !== "string" &&+ typeof payload.page === "string" &&+ payload.page ? (+ <div className="text-xs text-muted-foreground">+ {hostOf(payload.page)}+ </div>+ ) : null}+ </td>+ <td className="px-4 py-2 text-muted-foreground">+ {typeof payload.bot === "string" ? (+ // Keep the immutable bot id available even when names collide.+ <span title={payload.bot}>{nameFor(payload.bot)}</span>+ ) : (+ "-"+ )}+ </td>+ <td className="px-4 py-2">+ <span+ className={+ refused+ ? "font-medium text-destructive"+ : failed+ ? "font-medium text-amber-600 dark:text-amber-500"+ : "text-muted-foreground"+ }+ >+ {DECISIONS[event.eventType] ??+ (refused ? "Blocked" : failed ? "Did not happen" : "Allowed")}+ </span>+ {/* Refusal reasons mirror the conversation-facing reason. */}+ {(event.eventType === "component.refused" ||+ event.eventType === "component.function_refused" ||+ event.eventType === "mcp.call_rejected") &&+ typeof payload.reason === "string" ? (+ <div className="mt-0.5 text-xs text-muted-foreground">+ {payload.reason}+ </div>+ ) : null}+ {event.eventType === "bot.declined" &&+ typeof payload.reason === "string" ? (+ <div className="mt-0.5 text-xs text-muted-foreground">+ {payload.reason}+ <span className="italic">, reported by the Bot itself</span>+ </div>+ ) : null}+ {failed && typeof payload.failure === "string" ? (+ <div className="mt-0.5 text-xs text-muted-foreground">+ {payload.failure}+ </div>+ ) : null}+ {/* Show concrete policy rules, but suppress the uninformative default `true` allow rule. */}+ {decision.rule && decision.rule !== "true" ? (+ <div className="mt-0.5 font-mono text-xs text-muted-foreground">+ {decision.rule}+ </div>+ ) : null}+ {decision.mode === "dry-run" && decision.carriedOut ? (+ <div className="text-xs text-muted-foreground">+ dry-run: recorded, not enforced+ </div>+ ) : null}+ </td>+ </tr>+ );+}++/**+ * Target types whose id is a name worth putting on screen.+ *+ * Anything else falls through to the element or file subject.+ */+const NAMED_TARGETS = new Set([+ "component",+ "mcp_tool",+ "mcp_server",+ "skill",+ "credential",+]);++const DECISIONS: Record<string, string> = {+ "bot.declined": "The Bot declined",+ "computer.policy_loaded": "Boundary at start-up",+ "computer.isolation_loaded": "Isolation at start-up",+ "computer.control_taken": "A person took the wheel",+ "computer.control_released": "The wheel was handed back",+ "computer.help_requested": "The Bot asked for help",+ "computer.secret_requested": "The Bot asked for a secret",+ "computer.secret_supplied": "A person supplied a secret",+ "computer.reset": "The computer was reset",+ "computer.stopped": "A person pressed stop",++ "component.granted": "Granted to this Bot",+ "component.revoked": "Taken away from this Bot",+ "component.published": "Published, so every Bot may use it",+ "component.unpublished": "Unpublished, so no Bot may use it",+ "component.draft_saved": "Draft saved, not yet published",+ "component.refused": "Refused",+ "component.function_granted": "May read this",+ "component.function_revoked": "May no longer read this",+ "component.function_called": "Read real data",+ "component.function_refused": "Refused",+ // A function failure is execution failure, not a policy refusal.+ "component.function_failed": "Could not be read",++ "mcp.call_succeeded": "Called on this Bot's behalf",+ "mcp.call_rejected": "Blocked",+ "mcp.call_failed": "The server did not answer",++ "configuration.changed": "Configuration changed",+ "credential.created": "Credential saved",+};++function hostOf(url: string): string {+ try {+ return new URL(url).host;+ } catch {+ return url;+ }+}diff --git a/app/src/routes/_authed/admin/computers.tsx b/app/src/routes/_authed/admin/computers.tsxnew file mode 100644index 00000000..3676ea93--- /dev/null+++ b/app/src/routes/_authed/admin/computers.tsx@@ -0,0 +1,249 @@+import { createFileRoute, Link } from "@tanstack/react-router";+import { useCallback, useEffect, useState } from "react";+import {+ PageEmpty,+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { StaggerItem } from "@/components/layout/stagger";+import { Button } from "@/components/ui/button";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import {+ Item,+ ItemActions,+ ItemContent,+ ItemDescription,+ ItemTitle,+} from "@/components/ui/item";+import { Separator } from "@/components/ui/separator";+import { useBotNames } from "@/lib/agents/bot-names";++type ComputerProfile = {+ botId: string;+ running: boolean;+ startedAt: string | null;+ egress: string | null;+};++/** API placeholder id; the list endpoint returns all computers. */+const COMPUTER_ID = "openbot-computer";++export const Route = createFileRoute("/_authed/admin/computers")({+ component: ComputersPage,+});++function ComputersPage() {+ const [computers, setComputers] = useState<ComputerProfile[] | null>(null);+ /** Whether each Bot has an isolated browser profile. */+ const [isolation, setIsolation] = useState<"per-bot" | "shared" | null>(null);+ const [problem, setProblem] = useState<string | null>(null);+ /** Bot id currently running a stop/reset request. */+ const [busy, setBusy] = useState<string | null>(null);+ /** Reset deletes the browser profile, so it requires confirmation. */+ const [confirming, setConfirming] = useState<string | null>(null);+ const nameFor = useBotNames();++ const load = useCallback(async () => {+ try {+ const response = await fetch(`/api/computers/${COMPUTER_ID}/computers`, {+ credentials: "include",+ });+ if (!response.ok) {+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ setProblem(body?.error ?? "The computers could not be listed.");+ return;+ }+ const body = (await response.json()) as {+ computers: ComputerProfile[];+ isolation?: "per-bot" | "shared";+ };+ setComputers(body.computers);+ setIsolation(body.isolation ?? null);+ setProblem(null);+ } catch {+ setProblem("The computers could not be reached.");+ }+ }, []);++ useEffect(() => {+ void load();+ }, [load]);++ const run = useCallback(+ async (botId: string, action: "stop" | "reset") => {+ setBusy(botId);+ setConfirming(null);+ try {+ const response = await fetch(+ `/api/computers/${encodeURIComponent(botId)}/computers/${action}`,+ { method: "POST", credentials: "include" },+ );+ if (!response.ok) {+ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ setProblem(body?.error ?? `The computer could not be ${action}.`);+ } else {+ setProblem(null);+ }+ } catch {+ setProblem("The computer could not be reached.");+ } finally {+ setBusy(null);+ await load();+ }+ },+ [load],+ );++ return (+ <PageShell+ description="Each Bot's browser and the profile it keeps. A profile is what makes a Bot still signed in tomorrow, and resetting one signs it out of everything."+ title="Computers"+ >+ {problem ? (+ <p+ className="mt-4 rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm"+ role="alert"+ >+ {problem}+ </p>+ ) : null}++ {isolation === "shared" ? (+ <p className="mt-4 rounded-md border border-amber-500/40 bg-amber-500/10 px-3 py-2 text-sm">+ <span className="font-medium">+ Every Bot is sharing one computer.+ </span>{" "}+ They share its logins, its files and its session, so a Bot can reach+ what another signed into. Set <code>COMPUTER_SUPERVISOR_URL</code> to+ give each Bot its own.+ </p>+ ) : isolation === "per-bot" ? (+ <p className="mt-4 rounded-md border border-border bg-muted/40 px-3 py-2 text-muted-foreground text-sm">+ Each Bot has a computer of its own: its own container, its own files+ and its own browser profile.+ </p>+ ) : null}++ <PageSection title="Computers in this deployment">+ {computers === null && problem ? (+ <PageEmpty>The list could not be loaded.</PageEmpty>+ ) : computers === null ? (+ <PageEmpty>Loading…</PageEmpty>+ ) : computers.length === 0 ? (+ <PageEmpty>+ No computers yet. One appears the first time a Bot opens a page.+ </PageEmpty>+ ) : (+ <PageRows>+ {computers.map((computer, index) => (+ <StaggerItem index={index} key={computer.botId}>+ <Item size="sm">+ <ItemContent>+ <ItemTitle title={computer.botId}>+ {nameFor(computer.botId)}+ </ItemTitle>+ <ItemDescription>+ {computer.running+ ? `Browser running since ${new Date(computer.startedAt ?? "").toLocaleTimeString()}`+ : "No browser running. It starts when the Bot next needs it."}+ {" · "}+ {computer.egress+ ? `Leaves through ${computer.egress}`+ : "Leaves directly"}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <Button+ disabled={busy === computer.botId || !computer.running}+ onClick={() => void run(computer.botId, "stop")}+ size="sm"+ variant="outline"+ >+ {busy === computer.botId ? "Working…" : "Stop browser"}+ </Button>+ <Button+ disabled={busy === computer.botId}+ onClick={() => setConfirming(computer.botId)}+ size="sm"+ variant="outline"+ >+ Reset+ </Button>+ </ItemActions>+ </Item>+ {index !== computers.length - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ )}+ </PageSection>++ {/*+ * A DIALOG RATHER THAN AN INLINE CONFIRM. Resetting signs a Bot out of everything it has ever+ * logged into and cannot be undone, and the row it was confirmed on was one of several+ * identical-looking rows. The dialog names the Bot, so the sentence somebody agrees to says+ * which computer it destroys.+ */}+ <Dialog+ onOpenChange={(open) => {+ if (!open) setConfirming(null);+ }}+ open={confirming !== null}+ >+ <DialogContent>+ <DialogHeader>+ <DialogTitle>+ Reset {confirming ? nameFor(confirming) : ""}'s computer?+ </DialogTitle>+ <DialogDescription>+ Its profile is deleted, so the Bot is signed out of every service+ it had logged into and starts clean. This cannot be undone.+ </DialogDescription>+ </DialogHeader>+ <DialogFooter>+ <Button+ onClick={() => setConfirming(null)}+ size="sm"+ variant="ghost"+ >+ Cancel+ </Button>+ <Button+ disabled={busy === confirming}+ onClick={() => {+ if (confirming) void run(confirming, "reset");+ }}+ size="sm"+ variant="destructive"+ >+ {busy === confirming ? "Resetting…" : "Reset it"}+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>++ <p className="mt-4 text-muted-foreground text-sm">+ <strong>Stop</strong> closes the browser and keeps its logins: the next+ thing the Bot does starts it again where it left off.{" "}+ <strong>Reset</strong> deletes the profile, so the Bot is signed out of+ everything and starts clean. Both are recorded in{" "}+ <Link className="underline" to="/admin/audit">+ Audit+ </Link>+ .+ </p>+ </PageShell>+ );+}diff --git a/app/src/routes/_authed/admin/connectors.tsx b/app/src/routes/_authed/admin/connectors.tsxnew file mode 100644index 00000000..dd699db5--- /dev/null+++ b/app/src/routes/_authed/admin/connectors.tsx@@ -0,0 +1,89 @@+import { IconBrandGoogleDrive, IconCloud } from "@tabler/icons-react";+import { useQuery } from "@tanstack/react-query";+import { createFileRoute, Link } from "@tanstack/react-router";+import {+ PageEmpty,+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { StaggerItem } from "@/components/layout/stagger";+import { Button } from "@/components/ui/button";+import {+ Item,+ ItemActions,+ ItemContent,+ ItemDescription,+ ItemMedia,+ ItemTitle,+} from "@/components/ui/item";+import { Separator } from "@/components/ui/separator";+import { connectorListQueryOptions } from "@/lib/connectors/queries";++export const Route = createFileRoute("/_authed/admin/connectors")({+ component: ConnectorsPage,+});++function ConnectorsPage() {+ const connectors = useQuery(connectorListQueryOptions());+ return (+ <PageShell+ description="Available integrations are defined by this deployment’s knowledge sources."+ title="Connectors"+ >+ <PageSection title="Available">+ {connectors.isPending ? (+ <PageEmpty>Loading connectors…</PageEmpty>+ ) : connectors.error ? (+ <p className="mt-4 text-destructive text-sm" role="alert">+ Could not load connectors.+ </p>+ ) : connectors.data?.length === 0 ? (+ <PageEmpty>+ No connectors. They come from this deployment's knowledge sources.+ </PageEmpty>+ ) : (+ <PageRows>+ {connectors.data?.map((connector, index) => (+ <StaggerItem index={index} key={connector.id}>+ <Item size="sm">+ <ItemMedia variant="icon">+ {connector.type === "google_drive" ? (+ <IconBrandGoogleDrive />+ ) : (+ <IconCloud />+ )}+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{connector.name}</ItemTitle>+ <ItemDescription>+ Roots: {connector.roots.join(", ")} ·{" "}+ {connector.configured ? "Configured" : "Not configured"}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ {connector.type === "google_drive" ? (+ <Button+ render={<Link to="/admin/connectors/google-drive" />}+ size="sm"+ variant="outline"+ >+ Set up+ </Button>+ ) : (+ // Said rather than left blank, which would read as a control yet to arrive.+ <span className="text-muted-foreground text-sm">+ No setup screen yet+ </span>+ )}+ </ItemActions>+ </Item>+ {index !== (connectors.data?.length ?? 0) - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ )}+ </PageSection>+ </PageShell>+ );+}diff --git a/app/src/routes/_authed/admin/credentials.tsx b/app/src/routes/_authed/admin/credentials.tsxnew file mode 100644index 00000000..a20e262a--- /dev/null+++ b/app/src/routes/_authed/admin/credentials.tsx@@ -0,0 +1,311 @@+import { IconPlus } from "@tabler/icons-react";+import { useForm } from "@tanstack/react-form";+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { createFileRoute } from "@tanstack/react-router";+import { useState } from "react";+import {+ PageEmpty,+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { StaggerItem } from "@/components/layout/stagger";+import { Button } from "@/components/ui/button";+import {+ Dialog,+ DialogBody,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import {+ Item,+ ItemActions,+ ItemContent,+ ItemDescription,+ ItemTitle,+} from "@/components/ui/item";+import { Separator } from "@/components/ui/separator";+import {+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+} from "@/components/ui/field";+import { Input } from "@/components/ui/input";+import {+ Select,+ SelectContent,+ SelectGroup,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from "@/components/ui/select";+import {+ type CredentialFormValues,+ credentialFormSchema,+} from "@/lib/credentials/form";+import {+ createCredentialMutationOptions,+ revokeCredentialMutationOptions,+} from "@/lib/credentials/mutations";+import { credentialListQueryOptions } from "@/lib/credentials/queries";++export const Route = createFileRoute("/_authed/admin/credentials")({+ component: CredentialsPage,+});++function CredentialsPage() {+ const [adding, setAdding] = useState(false);+ const queryClient = useQueryClient();+ const credentials = useQuery(credentialListQueryOptions());+ const createCredential = useMutation(+ createCredentialMutationOptions(queryClient),+ );+ const revokeCredential = useMutation(+ revokeCredentialMutationOptions(queryClient),+ );+ const defaultValues: CredentialFormValues = {+ kind: "model",+ provider: "",+ keyId: "",+ plaintext: "",+ };+ const form = useForm({+ defaultValues,+ validators: { onSubmit: credentialFormSchema },+ onSubmit: async ({ value }) => {+ await createCredential.mutateAsync({ ...value, metadata: {} });+ form.reset();+ setAdding(false);+ },+ });++ return (+ <PageShell+ action={+ <Button onClick={() => setAdding(true)} size="sm" variant="ghost">+ <IconPlus />+ Add credential+ </Button>+ }+ description="Credentials are write-only. OpenBot never displays their secret values."+ title="Credentials"+ >+ {/*+ * THE FORM IS NOT ON THE PAGE. A credential is added once and then lived with, so a permanent+ * four-field form sat above the list somebody actually came to read, and the secret field+ * invited a password manager to fill it on every visit.+ */}+ <Dialog onOpenChange={setAdding} open={adding}>+ <DialogContent>+ <form+ noValidate+ onSubmit={(event) => {+ event.preventDefault();+ form.handleSubmit();+ }}+ >+ <DialogHeader>+ <DialogTitle>Add credential</DialogTitle>+ <DialogDescription>+ Held for this deployment and never shown again once saved.+ </DialogDescription>+ </DialogHeader>+ <DialogBody className="mt-4">+ <FieldGroup className="sm:grid sm:grid-cols-2">+ <form.Field name="kind">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Type</FieldLabel>+ <Select+ onValueChange={(value) =>+ field.handleChange(value as "model" | "connector")+ }+ value={field.state.value}+ >+ <SelectTrigger+ aria-invalid={isInvalid}+ id={field.name}+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectGroup>+ <SelectItem value="model">Model</SelectItem>+ <SelectItem value="connector">+ Connector+ </SelectItem>+ </SelectGroup>+ </SelectContent>+ </Select>+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="provider">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Provider</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) =>+ field.handleChange(event.target.value)+ }+ placeholder="OpenAI"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="keyId">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Key ID</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) =>+ field.handleChange(event.target.value)+ }+ placeholder="production"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ <form.Field name="plaintext">+ {(field) => {+ const isInvalid =+ field.state.meta.isTouched && !field.state.meta.isValid;+ return (+ <Field data-invalid={isInvalid}>+ <FieldLabel htmlFor={field.name}>Secret</FieldLabel>+ <Input+ aria-invalid={isInvalid}+ autoComplete="off"+ id={field.name}+ name={field.name}+ onBlur={field.handleBlur}+ onChange={(event) =>+ field.handleChange(event.target.value)+ }+ type="password"+ value={field.state.value}+ />+ {isInvalid ? (+ <FieldError errors={field.state.meta.errors} />+ ) : null}+ </Field>+ );+ }}+ </form.Field>+ </FieldGroup>+ {createCredential.error ? (+ <p className="text-destructive text-sm" role="alert">+ Could not save the credential. Try again.+ </p>+ ) : null}+ </DialogBody>+ <DialogFooter className="mt-4">+ <Button+ onClick={() => setAdding(false)}+ size="sm"+ type="button"+ variant="ghost"+ >+ Cancel+ </Button>+ <form.Subscribe+ selector={(state) => [state.canSubmit, state.isSubmitting]}+ >+ {([canSubmit, isSubmitting]) => (+ <Button+ disabled={+ !canSubmit || isSubmitting || createCredential.isPending+ }+ size="sm"+ type="submit"+ >+ {isSubmitting || createCredential.isPending+ ? "Saving…"+ : "Save credential"}+ </Button>+ )}+ </form.Subscribe>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog>++ <PageSection title="Configured credentials">+ {credentials.isPending ? (+ <PageEmpty>Loading credentials…</PageEmpty>+ ) : credentials.error ? (+ <p className="mt-4 text-destructive text-sm" role="alert">+ Could not load credentials.+ </p>+ ) : credentials.data?.length === 0 ? (+ <PageEmpty>No credentials are configured.</PageEmpty>+ ) : (+ <PageRows>+ {credentials.data?.map((credential, index) => (+ <StaggerItem index={index} key={credential.id}>+ <Item size="sm">+ <ItemContent>+ <ItemTitle>{credential.provider}</ItemTitle>+ <ItemDescription>+ {credential.kind} · {credential.keyId} ·{" "}+ {credential.revokedAt ? "revoked" : "active"}+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <Button+ disabled={+ Boolean(credential.revokedAt) ||+ revokeCredential.isPending+ }+ onClick={() => revokeCredential.mutate(credential.id)}+ size="sm"+ variant="outline"+ >+ Revoke+ </Button>+ </ItemActions>+ </Item>+ {index !== (credentials.data?.length ?? 0) - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ )}+ </PageSection>+ </PageShell>+ );+}diff --git a/app/src/routes/_authed/admin/index.tsx b/app/src/routes/_authed/admin/index.tsxnew file mode 100644index 00000000..ed7f4886--- /dev/null+++ b/app/src/routes/_authed/admin/index.tsx@@ -0,0 +1,161 @@+import {+ IconChevronRight,+ IconCode,+ IconDeviceDesktop,+ IconKey,+ IconLayoutGrid,+ IconListDetails,+ IconPlugConnected,+ IconPuzzle,+ IconShieldCheck,+} from "@tabler/icons-react";+import {+ createFileRoute,+ Link,+ type LinkOptions,+} from "@tanstack/react-router";+import {+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { StaggerItem } from "@/components/layout/stagger";+import {+ Item,+ ItemContent,+ ItemDescription,+ ItemMedia,+ ItemTitle,+} from "@/components/ui/item";+import { Separator } from "@/components/ui/separator";++export const Route = createFileRoute("/_authed/admin/")({+ component: RouteComponent,+});++/**+ * Grouped by what the decision is about rather than by how the code is organised.+ *+ * "What Bots can reach" is the group an administrator arrives worrying about, so it goes first.+ * Everything in it either grants a capability or fences one in.+ */+const SECTIONS: {+ title: string;+ description: string;+ items: {+ description: string;+ icon: React.ComponentType<{ className?: string }>;+ linkOptions: LinkOptions;+ title: string;+ }[];+}[] = [+ {+ title: "What Bots can reach",+ description:+ "Everything a Bot can touch outside this app, and the limits on it.",+ items: [+ {+ title: "Connectors",+ description: "The services Bots can read from, and who connected them.",+ icon: IconPlugConnected,+ linkOptions: { to: "/admin/connectors" },+ },+ {+ title: "Credentials",+ description: "Keys and tokens held for this deployment.",+ icon: IconKey,+ linkOptions: { to: "/admin/credentials" },+ },+ {+ title: "Boundaries",+ description: "Rules that decide what a Bot may never do.",+ icon: IconShieldCheck,+ linkOptions: { to: "/admin/boundaries" },+ },+ {+ title: "Computers",+ description: "The machines Bots run their tools on.",+ icon: IconDeviceDesktop,+ linkOptions: { to: "/admin/computers" },+ },+ ],+ },+ {+ title: "What Bots can do",+ description: "Capabilities and interface pieces available across Bots.",+ items: [+ {+ title: "Plugins",+ description: "Skills and tools installed for the whole workspace.",+ icon: IconPuzzle,+ linkOptions: { to: "/admin/plugins" },+ },+ {+ title: "Components",+ description: "Custom pieces a Bot can draw in a conversation.",+ icon: IconLayoutGrid,+ linkOptions: { to: "/admin/components" },+ },+ {+ title: "Playground",+ description: "Write a component and watch it render as you type.",+ icon: IconCode,+ linkOptions: { to: "/admin/playground" },+ },+ ],+ },+ {+ title: "What happened",+ description: "",+ items: [+ {+ title: "Audit",+ description: "Every action taken in this deployment, and by whom.",+ icon: IconListDetails,+ linkOptions: { to: "/admin/audit" },+ },+ ],+ },+];++function RouteComponent() {+ return (+ <PageShell+ description="Settings that apply to everybody in this deployment. Anything here affects every person and every Bot, which is what separates it from your own preferences."+ title="Admin"+ >+ {SECTIONS.map((section) => (+ <PageSection+ description={section.description || undefined}+ key={section.title}+ title={section.title}+ >+ <PageRows>+ {section.items.map((item, index) => (+ <StaggerItem index={index} key={item.title}>+ {/*+ * The whole row is the link, not a chevron somebody has to aim at: every row here+ * goes exactly one place, so there is nothing else the row could mean.+ */}+ <Item+ render={(props) => <Link {...item.linkOptions} {...props} />}+ size="sm"+ >+ <ItemMedia>+ <item.icon className="size-4 text-muted-foreground" />+ </ItemMedia>+ <ItemContent>+ <ItemTitle>{item.title}</ItemTitle>+ <ItemDescription>{item.description}</ItemDescription>+ </ItemContent>+ <IconChevronRight className="size-4 shrink-0 text-muted-foreground" />+ </Item>+ {index !== section.items.length - 1 && <Separator />}+ </StaggerItem>+ ))}+ </PageRows>+ </PageSection>+ ))}+ </PageShell>+ );+}diff --git a/app/src/routes/_authed/admin/playground.tsx b/app/src/routes/_authed/admin/playground.tsxnew file mode 100644index 00000000..4a934734--- /dev/null+++ b/app/src/routes/_authed/admin/playground.tsx@@ -0,0 +1,413 @@+import { OpenGenerativeUIActivityRenderer } from "@copilotkit/react-core/v2";+import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";+import { createFileRoute } from "@tanstack/react-router";+import { useId, useState } from "react";+import { Button } from "@/components/ui/button";+import {+ Dialog,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+} from "@/components/ui/dialog";+import { Field, FieldLabel } from "@/components/ui/field";+import { Input } from "@/components/ui/input";+import { Textarea } from "@/components/ui/textarea";+import {+ type SandboxedRecord,+ sandboxedKeys,+ sandboxedListQueryOptions,+} from "@/lib/sandboxed/queries";++/**+ * Browser-authored components are edited as drafts, previewed in the production sandbox renderer,+ * and used by conversations only after publishing.+ */+export const Route = createFileRoute("/_authed/admin/playground")({+ component: PlaygroundPage,+});++const STARTER = {+ slug: "",+ title: "",+ description: "",+ html: `<div class="card">\n <h3 id="title">Untitled</h3>\n <p id="body"></p>\n</div>`,+ css: `.card { font: 14px system-ui; border: 1px solid #e5e5e5; border-radius: 8px; padding: 12px; }\n.card h3 { margin: 0 0 4px; font-size: 15px; }`,+ jsFunctions: `// The arguments are on window.__args by the time this runs.\nconst args = window.__args || {};\ndocument.getElementById("title").textContent = args.title || "Untitled";\ndocument.getElementById("body").textContent = args.body || "";`,+ argumentSchema: `{\n "type": "object",\n "properties": {\n "title": { "type": "string" },\n "body": { "type": "string" }\n }\n}`,+ sampleArguments: `{\n "title": "A worked example",\n "body": "Edit the panels on the left and this redraws."\n}`,+};++type Draft = typeof STARTER;++function PlaygroundPage() {+ const [deleting, setDeleting] = useState<string | null>(null);+ const queryClient = useQueryClient();+ const { data: components } = useQuery(sandboxedListQueryOptions());+ const [draft, setDraft] = useState<Draft>(STARTER);+ const [error, setError] = useState<string | null>(null);++ const set = (field: keyof Draft) => (value: string) =>+ setDraft((current) => ({ ...current, [field]: value }));++ const parsed = (raw: string): Record<string, unknown> | null => {+ try {+ const value = JSON.parse(raw);+ return typeof value === "object" && value !== null+ ? (value as Record<string, unknown>)+ : null;+ } catch {+ return null;+ }+ };++ const sample = parsed(draft.sampleArguments);+ const schema = parsed(draft.argumentSchema);++ const mutate = useMutation({+ mutationFn: async (action: () => Promise<Response>) => {+ setError(null);+ const response = await action();+ if (!response.ok) {+ const detail = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ throw new Error(detail?.error ?? "That did not work.");+ }+ return response.json();+ },+ onSuccess: () =>+ queryClient.invalidateQueries({ queryKey: sandboxedKeys.all }),+ onError: (thrown: Error) => setError(thrown.message),+ });++ const saveDraft = () =>+ fetch("/api/sandboxed", {+ method: "POST",+ credentials: "include",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ slug: draft.slug,+ title: draft.title,+ description: draft.description,+ html: draft.html,+ css: draft.css,+ jsFunctions: draft.jsFunctions,+ argumentSchema: schema ?? {},+ sampleArguments: sample ?? {},+ }),+ });++ const save = () => mutate.mutate(saveDraft);++ /**+ * Publish what is on screen.+ *+ * Saved first, because publishing acts on the stored draft rather than on the editors.+ */+ const publish = () =>+ mutate.mutate(async () => {+ const saved = await saveDraft();+ if (!saved.ok) return saved;+ return fetch(+ `/api/sandboxed/${encodeURIComponent(`custom_${draft.slug}`)}/publish`,+ { method: "POST", credentials: "include" },+ );+ });++ const load = (component: SandboxedRecord) =>+ setDraft({+ slug: component.name.replace(/^custom_/, ""),+ title: component.title,+ description: component.draftDescription,+ html: component.draftHtml,+ css: component.draftCss,+ jsFunctions: component.draftJsFunctions,+ argumentSchema: JSON.stringify(component.draftArgumentSchema, null, 2),+ sampleArguments: JSON.stringify(component.sampleArguments, null, 2),+ });++ return (+ /*+ * THE ONE PAGE THAT KEEPS ITS OWN GEOMETRY. Everything else in admin is a column you scroll;+ * this is an editor beside a live preview, and the preview is the entire point — put it in the+ * standard prose column and it lands below the fold, so you would be typing at something you+ * cannot see. It takes the header and the controls, and keeps the two panes.+ */+ <div className="flex h-screen flex-col">+ <header className="flex flex-wrap items-start justify-between gap-4 border-border border-b px-6 py-4">+ <div>+ <h1 className="font-bold text-2xl">Playground</h1>+ <p className="mt-1 max-w-prose text-pretty text-muted-foreground text-sm leading-relaxed">+ Write a component here and publish it without a deployment. What you+ edit is a draft; a conversation only ever draws what is published.+ </p>+ </div>+ <div className="flex gap-2">+ <Button+ disabled={!(draft.slug && draft.title)}+ onClick={save}+ size="sm"+ type="button"+ variant="outline"+ >+ Save draft+ </Button>+ <Button+ /* `publish` saves first, since publishing acts on the stored draft, not the editors. */+ disabled={!(draft.slug && draft.title)}+ onClick={publish}+ size="sm"+ type="button"+ >+ Publish+ </Button>+ </div>+ </header>++ {error ? (+ <div+ className="border-border border-b bg-destructive/10 px-6 py-2 text-destructive text-sm"+ role="alert"+ >+ {error}+ </div>+ ) : null}++ <div className="grid min-h-0 flex-1 grid-cols-1 gap-4 overflow-auto px-6 py-4 lg:grid-cols-2">+ <div className="space-y-3">+ <div className="grid gap-2 md:grid-cols-2">+ <TextField+ label="Name"+ onChange={set("slug")}+ placeholder="refund_card"+ value={draft.slug}+ />+ <TextField+ label="Title"+ onChange={set("title")}+ placeholder="Refund card"+ value={draft.title}+ />+ </div>+ <TextField+ label="What the model is told about it"+ onChange={set("description")}+ placeholder="Show a refund with its amount, reason and status."+ value={draft.description}+ />+ <CodeField label="HTML" onChange={set("html")} value={draft.html} />+ <CodeField label="CSS" onChange={set("css")} value={draft.css} />+ <CodeField+ label="JavaScript"+ onChange={set("jsFunctions")}+ value={draft.jsFunctions}+ />+ <CodeField+ invalid={schema === null}+ label="Arguments (JSON Schema)"+ onChange={set("argumentSchema")}+ value={draft.argumentSchema}+ />+ <CodeField+ invalid={sample === null}+ label="Sample arguments"+ onChange={set("sampleArguments")}+ value={draft.sampleArguments}+ />+ </div>++ <div className="space-y-4">+ <div className="rounded-lg border p-4">+ <div className="mb-2 text-sm font-medium">Preview</div>+ {sample === null ? (+ <p className="text-sm text-destructive">+ The sample arguments are not valid JSON, so there is nothing to+ draw with.+ </p>+ ) : (+ <OpenGenerativeUIActivityRenderer+ activityType="open-generative-ui"+ agent={null}+ content={{+ css: draft.css,+ cssComplete: true,+ html: [draft.html],+ htmlComplete: true,+ // Provide sample args in the same sandbox evaluation as the component code.+ jsFunctions: `window.__args = ${JSON.stringify(sample)};\n${draft.jsFunctions}`,+ jsFunctionsComplete: true,+ generating: false,+ }}+ key={`${draft.html}${draft.css}${draft.jsFunctions}${draft.sampleArguments}`}+ message={null}+ />+ )}+ </div>++ <div className="rounded-lg border border-border bg-card">+ <div className="border-border border-b px-4 py-2 font-medium text-sm">+ Saved here+ </div>+ {(components ?? []).length === 0 ? (+ <p className="px-4 py-3 text-muted-foreground text-sm">+ Nothing yet.+ </p>+ ) : (+ <ul className="divide-y divide-border">+ {(components ?? []).map((component) => (+ <li+ className="flex items-center justify-between px-4 py-2 text-sm"+ key={component.name}+ >+ <div>+ <div className="font-mono text-xs">{component.name}</div>+ <div className="text-xs text-muted-foreground">+ {component.published+ ? `published, revision ${component.revision}`+ : "draft only, no Bot can draw it"}+ {component.hasUnpublishedChanges+ ? " · edited since publishing"+ : ""}+ </div>+ </div>+ <div className="flex gap-2">+ <Button+ onClick={() => load(component)}+ size="sm"+ type="button"+ variant="outline"+ >+ Open+ </Button>+ <Button+ onClick={() => setDeleting(component.name)}+ size="sm"+ type="button"+ variant="ghost"+ >+ Delete+ </Button>+ </div>+ </li>+ ))}+ </ul>+ )}+ <p className="border-border border-t px-4 py-2 text-muted-foreground text-xs">+ Publishing makes it available to every Bot. Switch it off for a+ particular Bot on the Components page, the same as for a component+ this build ships.+ </p>+ </div>+ </div>+ </div>++ {/*+ * Deleting was a bare button on a row of one-line entries, and it does not come back. The+ * dialog names the component, so what is agreed to says which one it removes.+ */}+ <Dialog+ onOpenChange={(open) => {+ if (!open) setDeleting(null);+ }}+ open={deleting !== null}+ >+ <DialogContent>+ <DialogHeader>+ <DialogTitle>Delete {deleting}?</DialogTitle>+ <DialogDescription>+ It is removed from this deployment. Any Bot that could draw it no+ longer can, and this cannot be undone.+ </DialogDescription>+ </DialogHeader>+ <DialogFooter>+ <Button onClick={() => setDeleting(null)} size="sm" variant="ghost">+ Cancel+ </Button>+ <Button+ onClick={() => {+ const name = deleting;+ setDeleting(null);+ if (name) {+ mutate.mutate(() =>+ fetch(`/api/sandboxed/${encodeURIComponent(name)}`, {+ method: "DELETE",+ credentials: "include",+ }),+ );+ }+ }}+ size="sm"+ variant="destructive"+ >+ Delete it+ </Button>+ </DialogFooter>+ </DialogContent>+ </Dialog>+ </div>+ );+}++function TextField({+ label,+ value,+ onChange,+ placeholder,+}: {+ label: string;+ value: string;+ onChange: (value: string) => void;+ placeholder?: string;+}) {+ /*+ * An explicit `htmlFor`, not a wrapping label. The label used to wrap a bare `<input>`; now that+ * the control is a component the association has to be written down rather than implied by+ * nesting, or it exists for sighted people only.+ */+ const id = useId();+ return (+ <Field>+ <FieldLabel htmlFor={id}>{label}</FieldLabel>+ <Input+ id={id}+ onChange={(event) => onChange(event.target.value)}+ placeholder={placeholder}+ value={value}+ />+ </Field>+ );+}++function CodeField({+ label,+ value,+ onChange,+ invalid,+}: {+ label: string;+ value: string;+ onChange: (value: string) => void;+ invalid?: boolean;+}) {+ const id = useId();+ return (+ <Field data-invalid={invalid}>+ <FieldLabel htmlFor={id}>+ {label}+ {invalid ? (+ <span className="ml-2 text-destructive">not valid JSON</span>+ ) : null}+ </FieldLabel>+ <Textarea+ aria-invalid={invalid}+ className="h-32 font-mono text-xs"+ id={id}+ onChange={(event) => onChange(event.target.value)}+ spellCheck={false}+ value={value}+ />+ </Field>+ );+}diff --git a/app/src/routes/_authed/settings/index.tsx b/app/src/routes/_authed/settings/index.tsxnew file mode 100644index 00000000..cf2c8597--- /dev/null+++ b/app/src/routes/_authed/settings/index.tsx@@ -0,0 +1,55 @@+import { createFileRoute } from "@tanstack/react-router";+import {+ PageRows,+ PageSection,+ PageShell,+} from "@/components/layout/page-shell";+import { useTheme } from "@/components/theme-provider";+import {+ Item,+ ItemActions,+ ItemContent,+ ItemDescription,+ ItemTitle,+} from "@/components/ui/item";+import { Switch } from "@/components/ui/switch";++export const Route = createFileRoute("/_authed/settings/")({+ component: RouteComponent,+});++function RouteComponent() {+ const { dark, setDark } = useTheme();++ /*+ * The measurements that used to be written out here now live in `PageShell`, which Skills, Admin+ * and this screen all render through. The reason they match is no longer that somebody remembered+ * to copy them.+ */+ return (+ <PageShell+ description="How OpenBot looks and behaves for you. These apply to your account alone, on every deployment you sign in to."+ title="Preferences"+ >+ <PageSection title="General">+ <PageRows>+ <Item size="sm">+ <ItemContent>+ <ItemTitle>Dark theme</ItemTitle>+ <ItemDescription>+ Use the dark appearance across OpenBot.+ </ItemDescription>+ </ItemContent>+ <ItemActions>+ <Switch+ aria-label="Dark theme"+ checked={dark}+ onCheckedChange={setDark}+ />+ </ItemActions>+ </Item>+ </PageRows>+ </PageSection>+ </PageShell>+ );+}diff --git a/app/src/routes/_authed/settings/route.tsx b/app/src/routes/_authed/settings/route.tsxnew file mode 100644index 00000000..9aae2f3e--- /dev/null+++ b/app/src/routes/_authed/settings/route.tsx@@ -0,0 +1,29 @@+import { createFileRoute, Outlet } from "@tanstack/react-router";+import { SettingsSidebar } from "@/components/settings/settings-sidebar";+import { SidebarProvider } from "@/components/ui/sidebar";++export const Route = createFileRoute("/_authed/settings")({+ component: RouteComponent,+});++function RouteComponent() {+ return (+ <SidebarProvider+ /*+ * The same 340px the app shell uses. Settings is a different screen, not a different product,+ * and a rail that changes width on the way in makes the whole frame look like it moved.+ */+ style={+ {+ "--sidebar-width": "340px",+ "--sidebar-width-mobile": "20rem",+ } as React.CSSProperties+ }+ >+ <SettingsSidebar />+ <main className="flex-1">+ <Outlet />+ </main>+ </SidebarProvider>+ );+}diff --git a/app/src/vite-env.d.ts b/app/src/vite-env.d.tsnew file mode 100644index 00000000..d602da50--- /dev/null+++ b/app/src/vite-env.d.ts@@ -0,0 +1,4 @@+/// <reference types="vite/client" />++// Vite's own ambient types, which is where `import.meta.glob` is declared. Needed because the+// component gallery discovers its files rather than listing them (see lib/copilot/gallery-registry).diff --git a/app/tests/auth-client.test.ts b/app/tests/auth-client.test.tsnew file mode 100644index 00000000..94c4f3e3--- /dev/null+++ b/app/tests/auth-client.test.ts@@ -0,0 +1,7 @@+import { expect, test } from "bun:test";+import { authClient, signInWithGoogle } from "@/lib/auth/client";++test("starts the Google social sign-in flow through the Better Auth client", () => {+ expect(authClient.signIn.social).toBeFunction();+ expect(signInWithGoogle).toBeFunction();+});diff --git a/app/tests/query-client.test.ts b/app/tests/query-client.test.tsnew file mode 100644index 00000000..3a004c61--- /dev/null+++ b/app/tests/query-client.test.ts@@ -0,0 +1,6 @@+import { expect, test } from "bun:test";+import { queryClient } from "../src/query-client";++test("provides a shared query client for application server state", () => {+ expect(queryClient.getDefaultOptions().queries?.retry).toBe(1);+});diff --git a/app/tests/repair-history.test.ts b/app/tests/repair-history.test.tsnew file mode 100644index 00000000..c697efe2--- /dev/null+++ b/app/tests/repair-history.test.ts@@ -0,0 +1,125 @@+import { describe, expect, test } from "bun:test";+import type { Message } from "@ag-ui/core";+import { repairUnansweredToolCalls } from "../src/lib/copilot/repair-history";++/**+ * A stored thread must remain provider-valid even when a tool call lost its result.+ */++const call = (id: string, name = "showBarChart") => ({+ id,+ type: "function" as const,+ function: { name, arguments: "{}" },+});++let counter = 0;+const ids = () => `fixed_${++counter}`;++describe("repairing a history before it is sent", () => {+ test("a tool call with no result is answered", () => {+ const messages = [+ { id: "u1", role: "user", content: "chart it" },+ { id: "a1", role: "assistant", content: "", toolCalls: [call("c1")] },+ ] as Message[];++ const repaired = repairUnansweredToolCalls(messages, ids);++ expect(repaired).toHaveLength(3);+ const result = repaired[2] as {+ role: string;+ toolCallId: string;+ content: string;+ };+ expect(result.role).toBe("tool");+ expect(result.toolCallId).toBe("c1");+ // Insert an explanatory result, not an empty one.+ expect(result.content.length).toBeGreaterThan(0);+ expect(result.content).toContain("no result");+ });++ test("a result is placed immediately after the call that asked for it", () => {+ const messages = [+ { id: "a1", role: "assistant", content: "", toolCalls: [call("c1")] },+ { id: "u1", role: "user", content: "and again" },+ ] as Message[];++ const repaired = repairUnansweredToolCalls(messages, ids);++ // Providers require the result immediately after the call it answers.+ expect(repaired.map((message) => message.role)).toEqual([+ "assistant",+ "tool",+ "user",+ ]);+ });++ test("a history that is already complete is returned untouched", () => {+ const messages = [+ { id: "a1", role: "assistant", content: "", toolCalls: [call("c1")] },+ { id: "t1", role: "tool", toolCallId: "c1", content: "done" },+ ] as Message[];++ // Healthy histories keep identity to avoid churn on every send.+ expect(repairUnansweredToolCalls(messages, ids)).toBe(messages);+ });++ test("only the unanswered call in a batch is repaired", () => {+ const messages = [+ {+ id: "a1",+ role: "assistant",+ content: "",+ toolCalls: [call("c1"), call("c2"), call("c3")],+ },+ { id: "t2", role: "tool", toolCallId: "c2", content: "real result" },+ ] as Message[];++ const repaired = repairUnansweredToolCalls(messages, ids);+ const results = repaired.filter((message) => message.role === "tool") as {+ toolCallId: string;+ content: string;+ }[];++ expect(results.map((result) => result.toolCallId).sort()).toEqual([+ "c1",+ "c2",+ "c3",+ ]);+ // The real one is left exactly as it was.+ expect(results.find((r) => r.toolCallId === "c2")?.content).toBe(+ "real result",+ );+ });++ test("an empty-string result already counts as answered", () => {+ const messages = [+ { id: "a1", role: "assistant", content: "", toolCalls: [call("c1")] },+ { id: "t1", role: "tool", toolCallId: "c1", content: "" },+ ] as Message[];++ // Empty string is a valid protocol result.+ expect(repairUnansweredToolCalls(messages, ids)).toBe(messages);+ });++ test("the same call id across two messages is answered once", () => {+ const messages = [+ { id: "a1", role: "assistant", content: "", toolCalls: [call("c1")] },+ { id: "a2", role: "assistant", content: "", toolCalls: [call("c1")] },+ ] as Message[];++ const repaired = repairUnansweredToolCalls(messages, ids);+ const results = repaired.filter((message) => message.role === "tool");++ // Two results for one id is its own protocol error, so a duplicated call must not produce one.+ expect(results).toHaveLength(1);+ });++ test("a conversation with no tool calls at all is untouched", () => {+ const messages = [+ { id: "u1", role: "user", content: "hello" },+ { id: "a1", role: "assistant", content: "hello back" },+ ] as Message[];++ expect(repairUnansweredToolCalls(messages, ids)).toBe(messages);+ });+});diff --git a/app/tests/take-the-wheel.test.ts b/app/tests/take-the-wheel.test.tsnew file mode 100644index 00000000..a76c872f--- /dev/null+++ b/app/tests/take-the-wheel.test.ts@@ -0,0 +1,85 @@+import { describe, expect, test } from "bun:test";+import { pageCoordinates } from "../src/components/computer/take-the-wheel";++/**+ * Coordinate conversion cases for scaled, offset, and not-yet-loaded screenshots.+ */++const VIEWPORT = { naturalWidth: 1280, naturalHeight: 800 };++describe("pageCoordinates", () => {+ test("maps a click through a half-size image", () => {+ // 640x400 on screen, so every on-screen pixel is two page pixels.+ const at = pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 640, height: 400 },+ { clientX: 100, clientY: 50 },+ );+ expect(at).toEqual({ x: 200, y: 100 });+ });++ test("maps a click through an image drawn larger than the viewport", () => {+ const at = pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 2560, height: 1600 },+ { clientX: 1000, clientY: 400 },+ );+ expect(at).toEqual({ x: 500, y: 200 });+ });++ test("subtracts where the image sits on screen", () => {+ // The overlay pads the picture away from the window edge; a click is in window coordinates.+ const at = pageCoordinates(+ VIEWPORT,+ { left: 200, top: 120, width: 1280, height: 800 },+ { clientX: 260, clientY: 140 },+ );+ expect(at).toEqual({ x: 60, y: 20 });+ });++ test("1:1 is the identity, minus the offset", () => {+ const at = pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 1280, height: 800 },+ { clientX: 655, clientY: 155 },+ );+ expect(at).toEqual({ x: 655, y: 155 });+ });++ test("the far corner maps to the far corner", () => {+ const at = pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 640, height: 400 },+ { clientX: 640, clientY: 400 },+ );+ expect(at).toEqual({ x: 1280, y: 800 });+ });++ test("returns nothing rather than NaN before the picture has loaded", () => {+ // Degenerate first-render sizes produce no request.+ expect(+ pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 0, height: 0 },+ { clientX: 10, clientY: 10 },+ ),+ ).toBeNull();+ expect(+ pageCoordinates(+ { naturalWidth: 0, naturalHeight: 0 },+ { left: 0, top: 0, width: 640, height: 400 },+ { clientX: 10, clientY: 10 },+ ),+ ).toBeNull();+ });++ test("a non-square scale on each axis is handled independently", () => {+ // X and Y scale independently when the displayed image is not proportional.+ const at = pageCoordinates(+ VIEWPORT,+ { left: 0, top: 0, width: 1280, height: 400 },+ { clientX: 640, clientY: 200 },+ );+ expect(at).toEqual({ x: 640, y: 400 });+ });+});diff --git a/app/tests/theme-preference.test.ts b/app/tests/theme-preference.test.tsnew file mode 100644index 00000000..52eeaf40--- /dev/null+++ b/app/tests/theme-preference.test.ts@@ -0,0 +1,27 @@+import { describe, expect, test } from "bun:test";+import {+ applyDarkTheme,+ parseStoredDarkTheme,+ THEME_STORAGE_KEY,+} from "../src/lib/theme";++describe("theme preference", () => {+ test("only the stored dark value enables dark theme", () => {+ expect(parseStoredDarkTheme("dark")).toBe(true);+ expect(parseStoredDarkTheme("light")).toBe(false);+ expect(parseStoredDarkTheme(null)).toBe(false);+ });++ test("persists and applies the selected theme", () => {+ const writes: Array<[string, string]> = [];+ const toggles: Array<[string, boolean]> = [];++ applyDarkTheme(true, {+ setStoredValue: (key, value) => writes.push([key, value]),+ toggleRootClass: (name, force) => toggles.push([name, force]),+ });++ expect(writes).toEqual([[THEME_STORAGE_KEY, "dark"]]);+ expect(toggles).toEqual([["dark", true]]);+ });+});diff --git a/app/tsconfig.json b/app/tsconfig.jsonnew file mode 100644index 00000000..6bf334e8--- /dev/null+++ b/app/tsconfig.json@@ -0,0 +1,12 @@+{+ "extends": "../tsconfig.base.json",+ "compilerOptions": {+ "baseUrl": ".",+ "paths": {+ "@/*": ["./src/*"]+ },+ "jsx": "react-jsx",+ "lib": ["ES2024", "DOM", "DOM.Iterable"]+ },+ "include": ["src", "vite.config.ts"]+}diff --git a/assets/architecture-light.svg b/assets/architecture-light.svgnew file mode 100644index 00000000..35a25885--- /dev/null+++ b/assets/architecture-light.svg@@ -0,0 +1,111 @@+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1420 852" width="1420" height="852" role="img">+<title>OpenBot architecture</title>+<desc>A turn goes from the app to the server, which sends it to a Bot over AG-UI. Every tool call the Bot makes returns through the gateway, which resolves the target, decides it against the configured policy, records an audit row, and only then acts, or refuses and names the rule. Allowed actions reach that Bot's own computer, one container each holding its own Chromium, logins and workspace, created by the supervisor. Every decision lands in PostgreSQL; threads and memory live in CopilotKit Intelligence.</desc>+<rect width="1420" height="852" fill="#fffefb"/>+<text x="64" y="56" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="26" font-weight="700" fill="#1f2328" text-anchor="start" >OpenBot</text>+<text x="64" y="82" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="400" fill="#5b6570" text-anchor="start" >Every action a Bot takes is decided before it happens and recorded after.</text>+<text x="372" y="112" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="11.5" font-weight="700" fill="#aeb6bf" text-anchor="start" letter-spacing="1.6" >BOTS</text>+<path d="M372.45948094712605 127.30841256267783 C414.7755442572661 127.75903135748119, 457.83286860453444 127.65882468778416, 583.2534497483199 127.48647627032261 M371.3140529838797 126.25305205691443 C447.72572458904966 123.9519227893986, 521.8518146289691 124.77442959051916, 583.301331734899 125.43840807013089 M585.1795945325866 127.4076824894175 C581.847053746193 154.68777022492142, 584.3807238557034 180.293101147376, 581.7226641872898 219.5229846647009 M584.6959414626472 125.99034344153479 C586.2008775441483 148.55480810673907, 584.7765252946451 172.6183714543469, 584.6120601291768 216.95449549453332 M582.4079195029753 219.59986556144858 C539.6645271206439 218.16499517496968, 492.9976075144399 219.16803866177213, 370.50071936248077 218.14642846906054 M583.0778632240084 217.97157046942752 C513.369715478166 220.62198963016272, 442.9750986091751 220.1870753748219, 372.59735064701084 217.68948141927538 M370.0545847216621 219.85909935142845 C370.40988783358114 190.42915744464844, 371.2971799981453 160.60501292403785, 370.0050049165264 126.59232564475387 M371.60366226090116 217.7809959609993 C372.10964423407614 196.38327897908167, 373.1112794189602 173.91049686120823, 371.39012604309244 126.77422611610965" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="390" y="160" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >agent-bot :4200</text>+<text x="390" y="184" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >proof-of-concept AG-UI Bot</text>+<path d="M604.7753654003266 126.8011153209389 C658.5685705694083 124.3594185872323, 709.4449551140856 123.36327777270502, 818.8914099322726 126.35842553141956 M605.5771367399276 125.36737724572752 C679.3664301281144 123.25026774481103, 752.6020563115502 123.12215808494332, 818.6802942479658 126.11360655659315 M816.2142244100571 124.2264978647232 C819.30247336092 143.21962234973907, 818.5918479031562 161.63718531131744, 819.5268792867661 216.19005148410798 M819.0730095982551 125.24631737470627 C818.1067322034836 152.7386737704277, 817.1768581647873 180.28970936536788, 817.7298718571662 217.34441727399826 M816.4182673476415 217.164418486368 C751.8307319376827 214.65393328507872, 687.0144165939447 213.82085376244598, 606.6934201704665 218.2228808325322 M817.783109710816 218.31246875807645 C761.1317898762758 214.7547609320527, 702.329790426672 214.28422255920648, 606.9569271120084 217.52542780000655 M603.9443071126938 218.84863684177398 C607.7744201186181 180.81723568439483, 606.6089606764793 145.4805855035782, 604.7424600362777 124.88841116428375 M605.181710922718 218.56795052289962 C604.5324182857514 185.13760660886766, 604.5576956142426 150.41828564405444, 604.9790272831917 127.02598694562911" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="624" y="160" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >agent-langgraph :4201</text>+<text x="624" y="184" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >LangGraph AG-UI Bot</text>+<path d="M839.9061374464202 125.51945454854727 C917.2687686544856 128.1001170505689, 995.6132896015037 128.58872971696562, 1089.889862179768 125.00798557547179 M839.220793117005 126.90326414473529 C898.4226071404934 127.69702946847653, 957.6754931871812 126.53741045013717, 1089.8668724811935 125.32284189147505 M1087.7255521953107 124.33001983761787 C1088.1943130253076 156.99140072464945, 1089.9960092304468 184.3063765823841, 1089.873804873228 216.83503559231758 M1089.6582227140666 125.96863070428371 C1089.1201610215664 156.89218319356442, 1091.0488646157742 189.55568624436856, 1090.7836889654398 217.05005074441434 M1088.6110016661858 219.7226520476661 C1012.7272750091281 219.7210496936133, 934.8393010308669 220.149361834302, 838.3537535762667 217.38680557246659 M1090.6522105214349 217.4901317856483 C991.3425187622314 219.8864853116917, 890.4661024125554 220.45001686733917, 840.7712908044833 218.14438281684852 M839.382125300169 218.97036445736885 C838.285890841937 197.4238574564457, 838.3870133166074 177.49383605122566, 838.4411567866803 125.87924984097481 M840.2367629438638 218.08406325280666 C841.7402005732536 192.56462548673153, 840.6851090014458 167.96306796967983, 840.6045936971902 125.64235707223415" fill="none" stroke="#6366f1" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/>+<text x="858" y="160" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#6366f1" text-anchor="start" >your agent</text>+<text x="858" y="184" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >any AG-UI endpoint, any framework</text>+<text x="858" y="205" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#6366f1" text-anchor="start" font-style="italic" >bring your own</text>+<path d="M63.298027720887 297.379370376289 C127.12290222325379 296.37010186649417, 191.55082946703172 295.1311413595876, 297.4038765435721 297.74717876822547 M64.66566603363925 296.5664660805724 C112.3242162041618 296.54714619175, 160.37152977972096 297.47249089731633, 295.5689448278131 295.0486315646933 M295.9449029803276 295.2117633938789 C299.22578607020375 371.00392719507215, 295.5845083755016 443.0246188282967, 297.01521052122115 493.42706986665723 M296.5299957334995 296.52405175566673 C298.56670567722324 364.90128549933434, 296.52104508609773 432.8036107957363, 295.10531864762305 491.93643941283227 M297.69664504102525 492.7352395694955 C224.9711276443222 490.88477516847996, 153.5332478905928 489.4009804780285, 63.43303564825135 490.9080976207972 M295.6022046899739 491.99013265221384 C211.5102041934872 492.82316114880143, 126.36933880875581 493.2890257798121, 63.697564484611625 491.7713455276677 M65.7992814898491 492.5167965054512 C62.78387622284889 439.72076536417006, 61.52514247345924 387.80716830492014, 61.942220866680145 297.343455517292 M64.6392383635044 491.875044721365 C64.12494536314011 439.87314400076866, 64.66594248685837 388.6631317079067, 63.21203442215919 295.21359204649923" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="82" y="332" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="18" font-weight="700" fill="#1f2328" text-anchor="start" >you</text>+<text x="82" y="354" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >app :3010</text>+<text x="82" y="388" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >channels and chat</text>+<text x="82" y="409" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >the Bot's live screen</text>+<text x="82" y="430" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >take the wheel</text>+<text x="82" y="451" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >/admin</text>+<path d="M62.61822949567632 558.2329232313932 C140.5492669278654 559.4735470740345, 219.3145233572884 559.7075471963932, 294.3663793568414 559.8895392112034 M64.03002701887954 560.6700206544464 C128.76601080175504 563.4009772834773, 192.67508495743937 562.609880969618, 296.84948056865164 559.7971136221261 M295.2138950169086 559.3263611972332 C298.0993197143316 595.1830051362514, 298.64605490567686 631.3952337920666, 294.50468652844427 714.3234145343304 M296.0540162652731 559.219140997529 C296.1110535814762 618.911117759347, 296.66814405465124 680.9038666158915, 297.13905721604823 715.630875864625 M297.0798158502172 715.4356488733929 C224.63005169925074 713.3100660506027, 152.94604805536196 713.7511055650658, 62.575253519678164 715.5227113445166 M296.7724666242812 715.5834463993095 C216.57326604904515 714.3889101719773, 136.85927690794603 714.2340261806985, 64.77291417463192 715.767248457231 M65.4573829472065 717.532244604826 C63.09935324032306 657.9304899632931, 61.58220903713703 604.658929413557, 65.74403627514839 561.7750376880169 M63.45034786164761 716.5416295915842 C64.65608487710954 678.2791013389826, 63.682322078800205 641.2706654936075, 63.249078997969626 560.2923109918833" fill="none" stroke="#5b6570" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="82" y="594" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >when it needs you</text>+<text x="82" y="622" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >it stops and asks,</text>+<text x="82" y="644" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >you take the wheel</text>+<text x="82" y="666" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >in its browser,</text>+<text x="82" y="688" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >and hand it back</text>+<path d="M372.66621589244374 296.113936231446 C472.135099323839 294.18999407969784, 573.4626744626171 293.81774314049494, 847.5364319760095 295.2817677900874 M372.24244511832126 295.9468995267602 C534.9349017423283 296.6148733090316, 698.1762702448312 296.7009495838577, 848.2497789713334 295.80987227311334 M849.1369309403922 296.56044935135645 C850.056186801107 378.3564538642972, 852.0590960553928 463.11466890126127, 848.8262762519998 599.3279800450027 M848.2609713273171 295.5274586002608 C851.0322105410625 381.47048719763814, 849.9805697025621 467.87784025456625, 848.6835504474409 600.3399499011036 M848.6640543357665 601.0064121040998 C715.9015159861755 603.3054752482482, 584.8079464264672 602.0103013666235, 372.8168763928478 599.4291859554755 M848.3734663323435 600.3746715931871 C749.184542848704 598.5892555184859, 650.1334649223106 598.9945010763978, 371.91340987297275 600.1832966287982 M371.5698358894083 599.0543529881606 C373.879922371359 492.7903756964529, 372.02787776462924 388.1307250962686, 373.06425273796907 294.5759009061038 M372.0840445313832 600.8101141179719 C369.066405300502 529.7116726961306, 369.75944933813446 460.5921184700899, 372.7269533599055 295.70492091979145" fill="none" stroke="#1f2328" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>+<text x="394" y="332" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="18" font-weight="700" fill="#1f2328" text-anchor="start" >server :3001</text>+<text x="394" y="354" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13" font-weight="400" fill="#5b6570" text-anchor="start" >CopilotKit runtime, auth, roles, teammates</text>+<path d="M392.99490505291766 377.1790007470653 C519.3360949498855 374.0940089685583, 643.5004716145095 372.98248862387567, 825.3126639961062 378.20087315801743 M394.64713985393547 377.6755641991004 C558.9012461603247 383.00060959921046, 724.2774428466357 382.76585394104393, 825.3510824832397 377.3081348621009 M823.4570766448975 380.54672584533694 C826.7098966163635 436.62927570343015, 827.2525846046448 494.80909118652346, 823.5976406097412 572.5098728179931 M826.9837327957154 378.56578197479246 C827.6427371284485 436.46261138916014, 827.5880923530578 494.99518299102783, 825.4635484695434 571.3481733322144 M825.7097201331227 572.3462659663915 C719.0456922334889 573.7884970780856, 612.0911418715114 573.8587154449655, 395.1979898666237 571.1646588320311 M826.1879792775048 571.6315735545155 C739.2576037778392 569.25899671261, 651.7875863130956 569.1295028161624, 394.17050143915276 571.5799295026721 M394.91144676208495 569.2466526031494 C388.6894978355408 516.6690221786499, 391.21734207382207 465.31365737915036, 395.4074794769287 379.24183082580566 M394.23955554962157 571.5859357833863 C394.84703612899784 500.40575675964357, 394.5435632286072 428.8988199234009, 394.77288684844973 378.8210615158081" fill="none" stroke="#f59e0b" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/>+<text x="412" y="410" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="16" font-weight="700" fill="#f59e0b" text-anchor="start" >the gateway</text>+<text x="412" y="440" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >1. resolve the target</text>+<text x="412" y="466" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >2. decide · your CEL policy, deny before allow</text>+<text x="412" y="492" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >3. record · an audit row, allowed or refused</text>+<text x="412" y="518" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="13.5" font-weight="400" fill="#5b6570" text-anchor="start" >4. act, or refuse and name the rule</text>+<text x="412" y="554" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12" font-weight="400" fill="#aeb6bf" text-anchor="start" >browser · files · MCP · components</text>+<text x="1076" y="282" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="11.5" font-weight="700" fill="#aeb6bf" text-anchor="start" letter-spacing="1.6" >A COMPUTER EACH</text>+<path d="M1076.7625788604055 295.23202943289476 C1140.3169584729706 295.76059539141596, 1202.8444943100824 296.8345436675912, 1376.6369959445162 294.77395934457485 M1075.4071073434554 295.990113740448 C1161.641309680067 296.38894656675996, 1246.8642830195054 297.2259860613036, 1375.1719409092252 296.61556920945503 M1374.2633885391056 293.82817116901276 C1377.8737740792662 321.8738661073148, 1376.5540497817428 348.47884983345864, 1373.8401287324727 379.8540451876819 M1375.5280464824289 295.8317533258349 C1375.132431273794 328.5740893576294, 1376.0838425329684 359.5766064349562, 1374.8668627794832 380.9332284335047 M1374.5181193482247 379.20885255324663 C1285.5344521662269 376.81998223416207, 1190.8356217231312 377.32701176171366, 1077.074520970345 379.23730472843073 M1376.0209721610274 380.4014649525919 C1312.6469879006384 378.6272419869272, 1248.6624188429296 377.81925461733056, 1075.7931273657268 380.2687511994904 M1076.4718986041844 379.81752258464695 C1075.8256441749782 358.2047201119363, 1073.4501505293101 336.8908060364425, 1073.923518253118 296.14959624931214 M1075.4052730020135 380.53308019675313 C1075.71691927678 357.42651932574813, 1076.5423211670577 335.36698032058774, 1075.8574674423785 295.11091104783117" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="1094" y="326" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >risk-analyst</text>+<text x="1094" y="348" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >Chromium · its own logins</text>+<text x="1094" y="366" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >/workspace · its own files</text>+<path d="M1076.8829378630178 396.5130117344034 C1140.3475692222037 396.24523646232535, 1202.0383308866628 396.0934507807518, 1375.538895983422 397.48070335843295 M1076.240215542272 396.23306600689347 C1188.4029698675251 392.5774181733133, 1302.9415895917043 393.1280723321176, 1376.6804146069235 395.9085719989314 M1377.2247769355774 398.00745725631714 C1374.7543839206696 426.0746512413025, 1376.882908700943 456.1655756950379, 1375.9197262763978 478.30708799362185 M1375.5653512477875 395.67008194923403 C1375.3706738708495 422.0383997440338, 1375.6445218322754 449.67688355445864, 1375.0572076320648 480.56960740089414 M1376.5756606439627 479.6854735220133 C1311.6465884012441 481.2853289943392, 1247.368099751299 483.89728829675005, 1076.3746694311635 478.8249428979959 M1375.8313875772878 480.3264844579127 C1315.245997033547 480.08698949873406, 1253.2943809449819 480.2308230311712, 1076.5697021616659 480.46810477084915 M1074.662966632843 478.0623339653015 C1075.6142169475556 445.9564253807068, 1074.764421415329 414.8679972648621, 1078.2229550361633 396.0625506401062 M1075.8276528835297 479.73234086036683 C1074.3145914909364 447.44559960365297, 1075.3229121086122 415.7821493625641, 1075.222927236557 396.620635843277" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="1094" y="426" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >knowledge</text>+<text x="1094" y="448" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >Chromium · its own logins</text>+<text x="1094" y="466" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >/workspace · its own files</text>+<path d="M1074.439511465849 495.52421239392453 C1164.4674815573844 499.7642296831155, 1252.1221597610418 499.593763528227, 1375.8364550819122 494.69987498589956 M1076.5133221139097 495.3942301312693 C1151.9033013803664 495.3905557506075, 1226.5849989363678 494.8643998085297, 1376.337556134708 496.1595102860905 M1376.1104820668697 497.67984986901286 C1376.4202193617582 524.4391814529896, 1378.9412446379424 558.6374351561069, 1374.684690707922 577.905162101984 M1376.6655828744174 495.6509309977293 C1376.7288790668488 528.9940876454115, 1376.2341791118622 559.9980078428983, 1376.1181041032075 579.3031659334898 M1377.5027423641925 579.2342999406615 C1268.27696543833 576.9839161557857, 1163.9841974284955 576.9001258529723, 1076.244851983796 579.724100213862 M1376.2918811389504 579.7368834765592 C1300.099905557754 580.9626693569039, 1222.0236566578992 582.0253991354682, 1075.3666058023146 579.6820371308067 M1077.2311863362788 578.5956385195256 C1076.9636584423304 558.200550633669, 1078.1491002224207 541.4619629919529, 1074.96114448905 494.005630928278 M1075.077572658658 579.2098060816527 C1074.6183349195958 559.5909568756819, 1074.973360306406 539.5959571570158, 1075.498019912839 495.4192126482725" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="1094" y="526" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="15" font-weight="650" fill="#1f2328" text-anchor="start" >your agent</text>+<text x="1094" y="548" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >Chromium · its own logins</text>+<text x="1094" y="566" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >/workspace · its own files</text>+<path d="M1077.3574142853201 656.2595966941807 C1194.1999862133332 656.7320105479064, 1312.8508099436654 653.8253777967948, 1376.1171042022659 655.3335251775646 M1075.6462710070678 656.045230964574 C1135.8478064911708 657.0721983690852, 1197.5647282204031 657.0174887411071, 1376.6144162124194 656.0425126935303 M1374.266309273243 656.8149287104607 C1374.406236836791 677.9908762097359, 1375.6347185109855 701.8085107207298, 1376.9544886708259 746.5226294398308 M1375.7827475965023 657.0092307627201 C1375.2105778473617 687.7035482704639, 1373.8418600815535 720.7853230535984, 1376.990852111578 746.9222779810428 M1377.0853813000588 746.6376583345937 C1273.8570473421646 749.6109480175596, 1172.1602612787774 747.0843713779227, 1076.5430074130493 744.7435349024014 M1375.263570612992 745.783627132832 C1313.941447511542 748.6532385402439, 1251.0053212216276 749.9929601381691, 1075.6093379066492 745.9585840644982 M1076.8820784687996 747.2097674250602 C1075.5358215061426 727.3576533913613, 1074.6557826725243 702.762070119381, 1076.1196963429452 656.2621703028678 M1075.6586947858334 745.756006962061 C1075.5946337381602 716.3840447247028, 1075.2038090387582 686.0483678877354, 1076.0629785001279 655.4351796686649" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="1094" y="686" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="14.5" font-weight="650" fill="#1f2328" text-anchor="start" >supervisor :4500</text>+<text x="1094" y="710" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >the only process that</text>+<text x="1094" y="728" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >creates a computer</text>+<text x="1076" y="782" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" font-style="italic" >no Bot can read another's files</text>+<text x="1076" y="802" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" font-style="italic" >or reuse another's sign-ins</text>+<path d="M371.77719738941863 658.8046111064875 C417.776188965833 658.4117011528149, 468.0858579875452 657.0151969704732, 599.7057869143761 658.7018603264935 M371.1782658615275 659.4576557152258 C437.21810109504145 655.9872136278071, 504.35238132742984 656.8110725535373, 597.4351052316795 660.4399887976508 M599.3834805130958 659.1878476500511 C595.0489515401124 686.3556809544563, 599.3574945546388 710.4904454112052, 599.3446564316749 779.9106133818626 M598.0706528365612 659.5830736458302 C598.9616066992999 704.3041988909245, 599.2178851187945 750.4497687160969, 598.9248396575451 777.935109359026 M597.9866673797949 776.7276626399834 C525.1357208267116 777.3597026026896, 452.39324470423855 774.8390503212951, 373.67811312519177 776.700432292831 M598.8010006398623 778.6105373547597 C509.30977625291786 776.7332297686188, 420.6744100196916 776.5683482503597, 372.96476227909136 778.843197860217 M372.2056675553322 778.9785634398461 C369.88993355071545 740.8438836693764, 373.2377099636793 700.2691038012505, 369.8595436692238 658.632457101345 M371.6618725478649 777.0497579872608 C373.47795639111996 732.1855323851108, 373.2218446738959 686.5805169880391, 372.99138895869254 659.2364250481129" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="390" y="692" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="14.5" font-weight="650" fill="#1f2328" text-anchor="start" >PostgreSQL :5432</text>+<text x="390" y="718" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >the audit trail</text>+<text x="390" y="737" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >policy, grants</text>+<text x="390" y="756" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >credentials, encrypted</text>+<path d="M622.3432034638697 660.7815759763811 C681.2598863875551 661.6487524956707, 737.2153987088575 662.2306085694048, 848.9228949392103 661.3572990213335 M621.3508487794204 659.9248976428028 C678.0095467088095 659.7162817255381, 733.7937468872024 658.4204990121964, 847.1432577807052 660.0704368209027 M847.0395777702331 658.2585469245911 C847.0160150228501 689.5354117393495, 847.9101709066391 717.4768273353576, 847.6376704216003 777.1889210700989 M846.9091913700104 659.4766217708587 C849.0430674993515 691.4443385601044, 850.0115901433945 721.216498708725, 849.1319468021393 777.1040860652923 M847.1600099308595 778.9045973184149 C776.3056037505262 774.2220893286756, 704.5834341253102 775.9160679548316, 623.6368516426844 778.8761569006329 M847.9145462777419 778.7994555215321 C789.707846430798 776.0533092502134, 730.5650780341078 774.7863878487858, 622.4515771264096 777.0613130753742 M621.8370814323425 779.7578206062317 C623.5139980005264 733.240727519989, 622.8942866968155 687.8444352149963, 622.4935725212097 661.8391713142395 M621.5919336795807 777.4306470394134 C621.7114059022904 749.1202331066132, 622.1790496400833 722.1361375331878, 622.3120523929596 660.3810605525971" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="640" y="692" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="14.5" font-weight="650" fill="#1f2328" text-anchor="start" >CopilotKit Intelligence</text>+<text x="640" y="718" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >durable threads</text>+<text x="640" y="737" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >memory</text>+<text x="640" y="756" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="400" fill="#5b6570" text-anchor="start" >external service</text>+<path d="M300.4589563369751 371.08134212493894 C322.4827579498291 370.67456152439115, 341.7028486251831 371.4913400888443, 362.7868432998657 372.91292781829833 M302.5622073173523 371.7094159126282 C322.3822106361389 372.8722309827805, 340.8900069236755 372.7094959974289, 363.176144695282 372.8805859565735" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M362.9678628921509 372.9096670150757 L353.06632849426273 376.3547240474282 L350.7515518829346 365.9711468479575" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M364.2473675441742 371.6587248325348 C360.72612594599997 372.49661110629955, 359.4484773349184 375.03055016652996, 352.68894075126656 376.6909818770944 M364.4178992509842 372.4447442579269 C361.3568441725256 373.16223622908075, 357.5450789331829 374.3659758966915, 352.1774862215043 377.4793757226525 M351.5137414664773 377.30446636981617 C352.7259723290091 374.7929712867012, 352.52782648272773 371.40237811588946, 352.102064091789 366.021968827131 M352.4162832408995 377.5075972153414 C352.49687079458624 374.74450538997775, 351.90183308830274 372.19484669472683, 352.45169311981834 367.0644621463056 M351.9116027996064 366.1489455101432 C355.56486014911656 367.27013510095117, 357.8859029989133 369.15061231784307, 363.57628142356873 371.84059708595277 M352.0922709199906 366.64978457664864 C356.5112412024035 368.738349992971, 360.632844880422 370.4800200653484, 363.9503051042557 371.9376875257492" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="334" y="358" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#5b6570" text-anchor="middle" >a turn</text>+<path d="M363.06768131256104 427.64463863372805 C345.60298919677734 428.0882730093002, 325.86896114349366 429.6389382925033, 302.32984561920165 427.1778844833374 M364.2176348686218 428.6527432441711 C350.26705598831177 427.86236346149445, 336.7620825767517 427.9584663667679, 301.7495898246765 427.45042695999143" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M302.92279148101807 426.8675802230835 L315.2351046874999 423.3263928196372 L314.0407382324218 432.66501152301413" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M301.92954237937926 428.52019501686095 C304.79288386502833 427.18655614896795, 308.4517605843644 425.1879104061075, 313.04280010490413 423.47188633655924 M302.12414459705354 428.233844370842 C305.4893178830789 426.50072893092255, 308.5525928473983 424.91137882332794, 314.0481626680374 423.028171341175 M314.6077485598149 422.87655064112795 C313.2775485589355 425.0211347352721, 313.37255619696845 429.1739470248059, 313.47809755208027 433.8836053009152 M313.64688933629947 422.50825980291046 C313.80491590017397 426.68348899338304, 313.93007912105344 430.64890870620667, 314.17312294142823 433.51127182541785 M314.09034984855646 433.46733395839317 C308.65362103445705 430.6942903745198, 304.9135354266112 428.9210310198945, 302.0551505947113 427.51435730934145 M314.1346832063674 433.162848851925 C311.250723403787 432.4704772499669, 308.92765499495573 431.51531593601715, 302.3494923448563 427.854978556633" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="334" y="452" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#5b6570" text-anchor="middle" >the answer</text>+<path d="M513.535615837574 289.7120955348015 C511.43523221319913 275.7941893339157, 512.6541069537998 260.66679826974865, 511.95747443437574 225.24842175245286 M512.6501725614071 287.6797116816044 C512.0717100945114 264.1241998374462, 512.1881668892503 240.90360620617867, 512.8325507581234 225.45764537453653" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M512.1271914958954 225.26069836616517 L516.4717190482675 239.15754984169 L507.2764307281913 237.12062204627983" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M511.8462630200386 225.10224028348924 C513.550627646963 228.90806219283047, 514.1570964391071 232.1887907036983, 516.5023272087633 238.24406513242715 M511.8151494157314 225.62744677186012 C513.4450024617086 229.82506810256982, 515.4246924327559 232.80594179374526, 516.8861921277105 237.45756763367646 M516.6424425813752 237.84094070300748 C513.4365347124357 237.79306264632856, 510.45946049657965 237.9900024957744, 507.00756885632757 237.31277637055038 M516.9963717772587 237.9199856034357 C514.665394087938 237.5342690133185, 512.0765029345126 238.00892502138757, 506.7087621733783 237.53792523972842 M507.0489624879302 237.62119640378947 C508.4444797270679 233.50497077049428, 511.2427158986141 228.94911610172284, 511.4628635907173 225.6083875155449 M506.9752967748584 237.98356071381562 C508.3435558049127 233.27965982906105, 510.72943525740004 228.18041683669213, 511.64488196730616 225.76744383454323" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="464" y="260" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#5b6570" text-anchor="middle" >AG-UI</text>+<path d="M691.261342382431 224.65814232826233 C690.9974284112454 237.76992988586426, 694.1827631890774 250.27571158409117, 690.6501592159271 286.23551201820374 M691.7376458406449 226.70237376689911 C691.691084428072 240.55584805011748, 692.8150063946248 254.0619346380234, 691.980505490303 288.38052241802217" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M692.6419188976288 289.2671074390411 L688.0423040649832 276.4521498844147 L698.539048073536 277.4566161319733" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M692.821620323658 288.8146432948113 C691.5225116954753 285.6028560452307, 689.439141907445 282.06427103664487, 686.6641311166228 276.4257595774651 M691.7170006406308 288.25792388558386 C689.6218874246238 283.17723843173644, 687.9333506890358 278.5805225580172, 686.3352629671039 276.58131414742473 M685.9998919722063 275.7786568250619 C689.9052072313199 275.97270721862105, 694.3973730069316 275.6641022537231, 696.733445800338 275.542785359459 M686.9388449957193 276.2395023469212 C688.7334756114781 276.1432438587372, 691.4478798138389 276.1767428271771, 697.4378097915028 276.22694129537314 M696.8579677918016 275.57033652753836 C696.8769181374319 279.4521075763257, 695.2801896451626 280.883434706799, 692.6444483113289 288.72443615674973 M697.68847971583 276.07142130227095 C695.7587153006039 279.4219475965277, 693.9825308424774 282.3836596133788, 691.8644056165218 288.35351512551307" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="762" y="260" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#5b6570" text-anchor="middle" >a tool call</text>+<path d="M939.6294221401215 226.23612580299377 C901.2059477994442 246.44452034330368, 861.8407785603999 261.7696726927757, 809.7884416103363 286.26497254371645 M939.6551470994949 226.00563971996309 C908.7303154594898 242.25298728322983, 876.1763555176258 256.53093857145313, 808.1555812120438 288.4606865644455" fill="none" stroke="#6366f1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M808.0513820171357 287.46134915351865 L816.0754153181531 279.1837334443285 L821.1501581935993 286.64929806856145" fill="#6366f1" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M808.6129750943184 287.3607778429985 C811.6034839611037 284.42302766700766, 813.8365670941434 280.4076334340751, 816.7312903930165 278.76947217714326 M808.3478196847439 288.10400227189064 C810.4194820740441 285.31187835066254, 813.4256506225627 282.21102423192895, 816.7182088436105 277.94000079762475 M817.0369460381397 278.20829256200517 C818.3094872455987 280.65640456967054, 818.3916963909146 283.0056948450495, 821.5361908342514 288.22631436180086 M816.8501003078945 278.0113184754133 C817.9697993819223 281.48104331432216, 819.415628139766 285.01453633519156, 820.7130515482277 287.79011410009866 M821.641190510284 287.6902567568206 C816.8225786220888 287.5897645994946, 811.5762727008183 288.5705933894383, 808.6193693661689 288.4386743426323 M821.0707693688979 287.67134091166486 C817.9919982599058 288.0463210607311, 814.8068597961388 287.9213748519242, 807.7684854638577 288.2718258726597" fill="none" stroke="#6366f1" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M854.7993141115337 435.4194701420519 C909.6614246835694 408.64727548265677, 964.7751447953005 384.1619943035359, 1067.1792520846798 337.71081995706476 M855.9358530400605 436.2722291473019 C937.5556241104103 400.1695073374866, 1017.6200629721171 361.9767069724101, 1065.8468730273335 338.2595625859164" fill="none" stroke="#10b981" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M1066.701243686676 338.53399953842165 L1057.3768513073546 348.59840583014653 L1052.220026735143 336.98540266619966" fill="#10b981" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M1066.8558643484116 337.4279621744156 C1064.16106148945 340.0311762415441, 1062.2329667767594 342.1200625822082, 1057.3302016749008 347.55399764704873 M1066.2062844777108 338.33802357435223 C1064.4139991985471 340.7132528559796, 1062.367407960205 342.40591753845337, 1057.112523278199 347.77011045384575 M1057.9015156575708 347.384173700705 C1056.0141285920538 344.7003594587259, 1054.3956930142115 341.4921864580483, 1052.7362656911407 338.72219998559 M1057.191815714298 348.12955812780996 C1056.0731273532606 344.8664278878027, 1054.8717668424003 341.97290000888023, 1053.1247192889532 338.51809121393364 M1053.7504930389682 338.78435462104125 C1057.7107979607088 338.81512071943627, 1060.1256772299025 337.57237350184016, 1065.1344930410385 337.21358397006986 M1053.2170098174374 338.19576810227676 C1057.763295274532 338.21636091777384, 1062.097367004719 338.2055662340223, 1066.3574767231942 338.3389053034782" fill="none" stroke="#10b981" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="962" y="404" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#10b981" text-anchor="middle" >allowed</text>+<path d="M854.8099720954895 529.3630213737488 C898.9000613212585 529.6622056875228, 939.5140763282776 528.349916258812, 971.4004048347473 528.941778087616 M856.782378911972 528.4124598026276 C889.3653441905975 527.8813306188583, 922.048065328598 527.7233884191512, 972.1837201595306 527.7558207035065" fill="none" stroke="#ef4444" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M976.055222606659 517.2504460334778 C980.7192995166778 521.4918698978424, 987.7688469028473 527.3464160633088, 997.7029734611511 537.0319432258606 M976.9844622135163 518.9755086421967 C981.1551886177062 522.9660432434082, 985.3225464439391 528.5704036331177, 995.2429354190826 537.9356145381928" fill="none" stroke="#ef4444" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M994.1753439903259 519.2297570228577 C990.5665754795074 522.413532705307, 981.1364471912384 531.819491071701, 974.9504263877868 540.0321648597717 M996.2589260578155 518.419736814499 C988.2719931221009 524.4775390434265, 981.8140583610534 532.0862306404114, 975.3050030231476 537.6009303569793" fill="none" stroke="#ef4444" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/>+<text x="986" y="568" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#ef4444" text-anchor="middle" >refused,</text>+<text x="986" y="585" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#ef4444" text-anchor="middle" >naming the rule</text>+<path d="M484.5807391151786 607.6578287854791 C483.8011029495448 619.4157871589065, 482.9964200748652 631.9538984254003, 485.0042393192649 653.6361802354455 M484.7255058415234 608.0924761764705 C484.37438361124697 620.2974729202688, 483.58798717932405 632.7147735886276, 484.86746400669216 651.955067037791" fill="none" stroke="#f59e0b" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M483.2399926185608 651.2836905479431 L478.9255538723411 639.4036008522035 L488.8287142016946 639.9302884742738" fill="#f59e0b" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M483.6343744421005 651.4286946344375 C481.1267800451878 646.8058904295602, 479.4869578511247 643.835654713795, 478.1661544153632 639.3324130746842 M483.9916476559639 651.9540010333061 C482.19137606972333 647.995683684648, 480.41367428490696 644.4091772217809, 478.7521009538116 639.8477705142021 M479.14565602480985 639.4201850587914 C483.25449401775626 640.245970195003, 486.2215191193866 640.648206942389, 489.651910590198 640.2674289765492 M478.6358359021419 640.2099464891736 C481.1446891767963 640.3109631267564, 482.93442862002695 640.2130282569676, 489.646916213338 640.3741715512205 M489.8271814134179 639.5610655710221 C486.70383722130293 643.6690525037284, 485.94690594470023 648.4006899363209, 483.6204750585556 652.0715515375138 M489.66037427449805 640.2036627718926 C487.7422723694384 643.0497985245672, 486.6269619887687 646.0776151649009, 483.78764886140823 651.8381890368462" fill="none" stroke="#f59e0b" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="466" y="634" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#f59e0b" text-anchor="end" >always</text>+<path d="M734.1900509834289 606.9510210990906 C733.3949409341811 617.578503894806, 734.3690711832046 625.8390921592712, 736.5218167304993 653.6153979301453 M735.4145257472992 608.7723478794098 C735.683249367714 623.7266811847687, 734.8413258447647 638.9714930057526, 735.2090676784516 651.305906534195" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M736.1262467384338 652.2563109397888 L728.8844886562765 640.5445562049866 L741.6845483996926 639.7028600379945" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M735.8033355093003 652.8883694314957 C732.9840294779686 648.1411157433967, 731.8383959612097 644.1379963659712, 729.941767093891 639.7120182916642 M734.7307825398445 652.3139808344841 C733.3066197299117 647.9225848375085, 731.5611870770211 643.7528234136763, 729.3617674539031 640.5193964335442 M730.3208794382797 640.384192684257 C732.5211890184993 640.0174674833047, 736.011881241047 639.7637325434472, 740.8977046353988 639.9128800617814 M729.9810015387136 640.2739138635828 C732.5551671047716 640.2588448128057, 735.5364500251277 640.0170962358633, 740.0646532974783 640.4241425679886 M740.4825121095239 640.469097301674 C737.9871870179797 645.2478047651368, 735.6241273421705 649.0686772238463, 735.1834729909897 652.3047480630875 M740.5751329376756 640.5390930125237 C738.6715435763239 643.1938560286961, 737.9060666059473 646.2039529106606, 735.1168063282967 651.9982732081413" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M734.4738057136535 606.8756037712097 L739.7705259540139 619.2656971290588 L730.654139306301 620.6913959815978" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M735.3768719434738 607.2655834245681 C737.2422511240071 612.3176822040065, 738.3857183278676 615.1100655499689, 739.7609955956995 619.4057709291458 M734.6431294655799 607.8024330115318 C737.0373863419555 612.0511232763067, 738.8225689773151 616.4740206436944, 740.373403554207 619.6003360465049 M740.3623793428582 619.7245317522915 C736.2875304820554 620.4086151620754, 732.1478182421523 620.3161780525089, 729.1104450439215 620.1545573845086 M740.0112943072055 619.643000810411 C736.2435457462348 619.8249675084759, 732.7604350862887 620.005170613105, 729.4065726480728 619.7371761407687 M729.0202716371955 620.5651405885695 C731.2850468184646 615.8648750146943, 734.5726140089304 611.188253565721, 735.7051667737961 607.6453379106522 M729.5686188504637 619.7534722617148 C732.2940294106684 615.4436331187704, 734.1606342825339 610.4200118136272, 734.6532728219032 607.8523860907554" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M1226.4556588172914 647.1067694664001 C1226.4614660787581 633.2277256965638, 1227.031848769188 618.5181155204773, 1224.5386818885804 587.113443660736 M1226.6747180461884 648.1148075580597 C1226.1123440885544 636.6520590305329, 1226.343290438652 623.3334999561309, 1226.7066195964812 587.2345417499542" fill="none" stroke="#1f2328" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M1227.074082660675 587.444113445282 L1230.5010030963479 600.7278347328186 L1220.8984103939474 599.3010677650451" fill="#1f2328" stroke="none" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"/>+<path d="M1225.6195672941208 587.9328545045853 C1227.3865277309958 590.3322650308326, 1227.7664523150954 593.5211854859836, 1232.176382596737 600.5716980150222 M1225.7589848542214 588.3078981184959 C1227.5939428332115 590.3299217042119, 1228.5959042548177 593.924050407063, 1231.431106477028 599.4681235411643 M1230.6359814037864 599.6455276356471 C1227.178705646877 600.0213370219184, 1224.5465355559552 599.2885099307022, 1220.7471745703872 599.9169278812652 M1231.297150944469 599.9167493526844 C1227.5916588358375 599.8881056892864, 1224.6766665121647 599.5949238951871, 1221.0581011145807 599.9358697813874 M1221.2533698198736 600.3475166490554 C1222.2968688851975 596.5196384977254, 1225.3434537856078 590.4824223810056, 1225.354784731865 588.4737918519974 M1220.9636282918395 600.0242169096946 C1222.5365324620584 596.2511592016077, 1224.0541081898384 592.1468651604293, 1226.1500907349587 587.6098671889305" fill="none" stroke="#1f2328" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"/>+<text x="1242" y="634" font-family='ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif' font-size="12.5" font-weight="500" fill="#5b6570" text-anchor="start" >creates one each</text>+</svg>\ No newline at end of filediff --git a/bun.lock b/bun.locknew file mode 100644index 00000000..f62f688e--- /dev/null+++ b/bun.lock@@ -0,0 +1,2844 @@+{+ "lockfileVersion": 1,+ "configVersion": 1,+ "workspaces": {+ "": {+ "name": "openbot",+ "devDependencies": {+ "@biomejs/biome": "^2.3.8",+ "@types/bun": "^1.3.3",+ "roughjs": "^4.6.6",+ "typescript": "^5.9.3",+ "yaml": "^2.9.0",+ },+ },+ "app": {+ "name": "app",+ "version": "0.0.0",+ "dependencies": {+ "@ag-ui/core": "0.0.57",+ "@base-ui/react": "^1.6.0",+ "@copilotkit/react-core": "1.67.1",+ "@fontsource-variable/inter": "^5.3.0",+ "@shadcn/react": "^0.3.0",+ "@tabler/icons-react": "^3.36.1",+ "@tanstack/react-form": "^1.33.5",+ "@tanstack/react-query": "^5.101.4",+ "@tanstack/react-router": "^1.170.27",+ "better-auth": "^1.6.27",+ "boring-avatars": "^2.0.4",+ "class-variance-authority": "^0.7.1",+ "clsx": "^2.1.1",+ "motion": "^13.1.0",+ "prompt-area": "^0.6.3",+ "react": "^19.2.0",+ "react-dom": "^19.2.0",+ "shadcn": "^4.17.0",+ "streamdown": "^2.5.0",+ "tailwind-merge": "^3.6.0",+ "tw-animate-css": "^1.4.0",+ "zod": "^4.4.3",+ },+ "devDependencies": {+ "@happy-dom/global-registrator": "^20.11.2",+ "@tailwindcss/vite": "^4.3.3",+ "@tanstack/router-plugin": "^1.168.30",+ "@testing-library/react": "^16.3.2",+ "@testing-library/user-event": "^14.6.4",+ "@types/node": "^26.2.0",+ "@types/react": "^19.2.0",+ "@types/react-dom": "^19.2.0",+ "@vitejs/plugin-react": "^5.0.4",+ "happy-dom": "^20.11.2",+ "tailwindcss": "^4.3.3",+ "vite": "^7.1.12",+ },+ },+ "server": {+ "name": "server",+ "version": "0.0.0",+ "dependencies": {+ "@ag-ui/client": "0.0.57",+ "@better-auth/drizzle-adapter": "^1.6.27",+ "@copilotkit/runtime": "1.67.1",+ "@modelcontextprotocol/sdk": "^1.30.0",+ "better-auth": "^1.6.27",+ "cel-js": "^0.8.2",+ "drizzle-orm": "^0.45.2",+ "hono": "^4.10.0",+ "postgres": "^3.4.9",+ "yaml": "^2.9.0",+ },+ "devDependencies": {+ "@copilotkit/aimock": "^1.38.0",+ "drizzle-kit": "^0.31.10",+ "eventsource": "3.0.7",+ },+ },+ "worker": {+ "name": "worker",+ "version": "0.0.0",+ },+ },+ "packages": {+ "@0no-co/graphql.web": ["@0no-co/[email protected]", "", { "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" }, "optionalPeers": ["graphql"] }, "sha512-4gFGBdyaFmQ6n9euhp5JtIGS4ZeivwDr1tCPENUxTvy5wyv532yOtFCr9zzYAJh1s6uibgC+TRXUcay+mxzCoQ=="],++ "@a2ui/web_core": ["@a2ui/[email protected]", "", { "dependencies": { "@preact/signals-core": "^1.14.2", "date-fns": "^4.4.0", "zod": "^3.25.76", "zod-to-json-schema": "^3.25.2" } }, "sha512-sahOUSKZIGv9ZtnHjfzWR8o/F1XfSTp4sQAX5/auSenQYBYDRaY0+vrZIkddc/IEzpXJob6cFJT2r5/mLzAvqg=="],++ "@ag-ui/a2ui-middleware": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/a2ui-toolkit": "0.0.4", "clarinet": "^0.12.6" }, "peerDependencies": { "@ag-ui/client": ">=0.0.40", "rxjs": "7.8.1" } }, "sha512-2BQFUQ9vJzUAQSR0dNW/ijhyH8KpiRWISSLTP6mIe6ENyQ2cM1/XLG38/Dcb69olcs36gtZADZzAQWcno5H6fA=="],++ "@ag-ui/a2ui-toolkit": ["@ag-ui/[email protected]", "", {}, "sha512-9VPmgpCAsFVICk7z23kh+Kp/BwYMxw0D0KGjOiKXhm1MAH+Wid2iC3yKsXso+q7UZZiyhWgeDUSgaAkltyLmGg=="],++ "@ag-ui/client": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.57", "@ag-ui/encoder": "0.0.57", "@ag-ui/proto": "0.0.57", "@types/uuid": "^10.0.0", "compare-versions": "^6.1.1", "fast-json-patch": "^3.1.1", "rxjs": "7.8.1", "untruncate-json": "^0.0.1", "uuid": "^11.1.0", "zod": "^3.22.4" } }, "sha512-Xap2alG9Z0/j5kb3x4D7oTpe2sw1dfrC9rgJJr2NZu5vKcm8dzIPNd31mF2B4zS3BKqYIu245yxKPhEtT30MHw=="],++ "@ag-ui/core": ["@ag-ui/[email protected]", "", { "dependencies": { "zod": "^3.22.4" } }, "sha512-gho1OWjNE6E3Rl7ZEZ1wr2CEpUHjLFU0FqzCZZk439TicLu+BfLCMkMokB07bMGlRmbJ60hM6LW60iOVauCx+Q=="],++ "@ag-ui/encoder": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.57", "@ag-ui/proto": "0.0.57" } }, "sha512-ifD9NctR4xyPDR58xF9GK1bj/S8oECFkTeDfuYD8tXdbcOstIJ2TOqU2zhiCKnw7Vw+zR9Qv3TbsM9E7Gi9X3Q=="],++ "@ag-ui/langgraph": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/a2ui-toolkit": "0.0.4", "@langchain/core": "^1.1.40", "@langchain/langgraph-sdk": "^1.8.8", "langchain": ">=1.2.0", "partial-json": "^0.1.7", "rxjs": "7.8.1" }, "peerDependencies": { "@ag-ui/client": ">=0.0.42", "@ag-ui/core": ">=0.0.42" } }, "sha512-dXasEbGQFJcasdoy5khYyDHZHYoD1/i7hioaP8cejfw+Dss4tLvN8ndzD6c5j0hmANaKscekl+zkF7UQq3sI9w=="],++ "@ag-ui/mcp-apps-middleware": ["@ag-ui/[email protected]", "", { "dependencies": { "@modelcontextprotocol/sdk": "^1.0.0", "rxjs": "7.8.1" }, "peerDependencies": { "@ag-ui/client": ">=0.0.40" } }, "sha512-Z+NZQXj4J+Y/2PLNsiyhNzRWFtTT2sAoC5dztoAlIsdfzvLvYEa52YGdHesNTN85JJqaIrYxQ8e31IBpKjrnoA=="],++ "@ag-ui/mcp-middleware": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.54", "@modelcontextprotocol/sdk": "^1.0.0" }, "peerDependencies": { "rxjs": "7.8.1" } }, "sha512-TayUu7kB+jXUTPRUJesNvJYrP+0weTL9F2VJJ8QQ4sWxY/Ihjo+GgFYgJZYNcLwbo1DKgmVJtdm2XUouPCbxeg=="],++ "@ag-ui/proto": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.57", "@bufbuild/protobuf": "^2.2.5", "@protobuf-ts/protoc": "^2.11.1" } }, "sha512-pPENOZt0P6ibH8sCTgq05wLYXi5t3P9B5r/1bWYehXjUxtyOdnukSlWM++SsCIwUXsQdm/b3aBgGjEeTF7RenA=="],++ "@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-rNkamQCeAUOUGr5Npg5pXZyYFH4fS1U6Mbdy3dF/NNBEI3D2Chc/ruRrwNegP0gfpX3cllP3O4jSibGBbWPZ7A=="],++ "@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FSH+0q6wKNq6/WjWy10m3gbeW8MR6D7Qt380evNQinpfG88mOT2sP3x1U82tBsLlKe9O306LPfgQ3NDXy7HNbA=="],++ "@ai-sdk/google": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-kwvYpRNghqt0VRKE7Hx1UWZQCUJJFqUITj24baxy+ApS0Hru0PkBJHD75a36Wc+e6e+wHcKR2MconTeJiBZigA=="],++ "@ai-sdk/google-vertex": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/anthropic": "2.0.95", "@ai-sdk/google": "2.0.88", "@ai-sdk/openai-compatible": "1.0.48", "@ai-sdk/provider": "2.0.3", "@ai-sdk/provider-utils": "3.0.32", "google-auth-library": "^10.5.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-0JuayxQV4TgAkhoNjMX4jPDmGvq3hV24ijE8PO1VlnFoSwMOsm4NmVse0eemM9WJ98SmHMV65Syu72meo+2JJA=="],++ "@ai-sdk/mcp": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45", "pkce-challenge": "^5.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-rgbR+UZQF2DTsYUxgqTFjpFMaqXvQoGo9hS9q27qNpnNu5Pfv0qzUCg41YyED19cv3/LmF4tcpBY0YALsfdMxQ=="],++ "@ai-sdk/openai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Pex8vOj1y05j7jtBS39cJJRDjJbMIyCY9+01cSIp1hwEJTKImrFejMgsAazMWXSi/HU+B9ZE6ElftCOwvg4mmQ=="],++ "@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.3", "@ai-sdk/provider-utils": "3.0.32" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-Zl5+5VHId7g344LVSjZvPuFuRVej+u+MB+0ibFVGaXG1qUykyjKu2ptHinK5RjDdviCm+Bs+t3ZLegB39e8VyA=="],++ "@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-XeZW1CcDF2GMbH4wejW6xBRI2QCOgnkVYUnxoeDadB1mf85riL2bMUeDoh+6gJ/r4mjNfzUPW8OjLjvwTP0u1Q=="],++ "@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.15", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.8", "undici": "^5.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-7u5B/E2uZmU65SlJhhQGFHZwRCN0xOz4HHtFc4sEGV9PHbX3fGiEiZBpc/SABay1dGeJgK3VD60rvLGoWdWPXA=="],++ "@antfu/install-pkg": ["@antfu/[email protected]", "", { "dependencies": { "package-manager-detector": "^1.3.0", "tinyexec": "^1.0.1" } }, "sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ=="],++ "@azure/abort-controller": ["@azure/[email protected]", "", { "dependencies": { "tslib": "^2.6.2" } }, "sha512-fNAjWnA/nZ2jz31kxR/AqRaUT8ewHBw/WuBIosK0moMy1C9e5ValbDfFdIxJzVOOYaYkV/b2F1S4H/aHiqfVQg=="],++ "@azure/core-auth": ["@azure/[email protected]", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@azure/core-util": "^1.13.0", "tslib": "^2.6.2" } }, "sha512-ykRMW8PjVAn+RS6ww5cmK9U2CyH9p4Q88YJwvUslfuMmN98w/2rdGRLPqJYObapBCdzBVeDgYWdJnFPFb7qzpg=="],++ "@azure/core-util": ["@azure/[email protected]", "", { "dependencies": { "@azure/abort-controller": "^2.1.2", "@typespec/ts-http-runtime": "^0.3.0", "tslib": "^2.6.2" } }, "sha512-9n2pWK61veAuN0V20t9lOuoV4CFMdyAZ1ygZzvBGk/pBBJRib/PjL9PLXa/aI2CcPpyHfqVsxxqLCYl6uZlfDw=="],++ "@azure/msal-common": ["@azure/[email protected]", "", {}, "sha512-GkDEL6TYo3HgT3UuqakdgE9PZfc1hMki6+Hwgy1uddb/EauvAKfu85vVhuofRSo22D1xTnWt8Ucwfg4vSCVwvA=="],++ "@azure/msal-node": ["@azure/[email protected]", "", { "dependencies": { "@azure/msal-common": "16.5.2", "jsonwebtoken": "^9.0.0" } }, "sha512-ObTeMoNPmq19X3z40et9Xvs4ZoWVeJg43PZMRLG5iwVL+2nCtAerG3YTDItqPp1CfXNwmCXBbg8jn1DOx65c3g=="],++ "@babel/code-frame": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.29.7", "js-tokens": "^4.0.0", "picocolors": "^1.1.1" } }, "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw=="],++ "@babel/compat-data": ["@babel/[email protected]", "", {}, "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg=="],++ "@babel/core": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA=="],++ "@babel/generator": ["@babel/[email protected]", "", { "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg=="],++ "@babel/helper-annotate-as-pure": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-OoK6239jHPuSQOoS0kfTVKn0b/rVTk0seKq4Gd2UMLtmOVLjDC0ki3e+c90Trqv2gMfvJFqkiljrr568+qddiw=="],++ "@babel/helper-compilation-targets": ["@babel/[email protected]", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g=="],++ "@babel/helper-create-class-features-plugin": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/helper-replace-supers": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", "@babel/traverse": "^7.29.7", "semver": "^6.3.1" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-IY3ZD9Tmooqr3TUhc3DUWxiuo8xx1DWLhd5M7hQ+ZWJamqM2BbalrBJb2MisSLoYorOj75U03qULCxQTY9r3hg=="],++ "@babel/helper-globals": ["@babel/[email protected]", "", {}, "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA=="],++ "@babel/helper-member-expression-to-functions": ["@babel/[email protected]", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-j+7JYmk1JYDtACIGj0QJqqWZjoUpMoEikQGADMaHgCMCSDqd2+P32rfcibUNrGOMWrlzK1WJBdxrB3JJQZwWtg=="],++ "@babel/helper-module-imports": ["@babel/[email protected]", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g=="],++ "@babel/helper-module-transforms": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-module-imports": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg=="],++ "@babel/helper-optimise-call-expression": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.29.7" } }, "sha512-+kmGVjcT9RGYzoDwdwEqEvGgKe3BYq+O1iGzjFubaNgZHwYHP6lsF2Yghf4kEuv9BV7tYDZ913aBW9am6YKong=="],++ "@babel/helper-plugin-utils": ["@babel/[email protected]", "", {}, "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw=="],++ "@babel/helper-replace-supers": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-member-expression-to-functions": "^7.29.7", "@babel/helper-optimise-call-expression": "^7.29.7", "@babel/traverse": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0" } }, "sha512-atfGXWSeCiF4DnKZIfmJfQRkSw9b9gNNXR1kqKjbhG4pGYCOnkp8OcTB8E3NXjBu8NpheSnOeNKz8KT7UNFTmQ=="],++ "@babel/helper-skip-transparent-expression-wrappers": ["@babel/[email protected]", "", { "dependencies": { "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-brcMGQaVzIeUb+6/bs1Av0f8YuNNjKY2JyvfRCsFuFsdKccEQ5Ges2y74D74NZ1Rz8lKJ9ksJkfqwQFJ/iNEyQ=="],++ "@babel/helper-string-parser": ["@babel/[email protected]", "", {}, "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw=="],++ "@babel/helper-validator-identifier": ["@babel/[email protected]", "", {}, "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg=="],++ "@babel/helper-validator-option": ["@babel/[email protected]", "", {}, "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw=="],++ "@babel/helpers": ["@babel/[email protected]", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg=="],++ "@babel/parser": ["@babel/[email protected]", "", { "dependencies": { "@babel/types": "^7.29.8" }, "bin": "./bin/babel-parser.js" }, "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA=="],++ "@babel/plugin-syntax-jsx": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A=="],++ "@babel/plugin-syntax-typescript": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA=="],++ "@babel/plugin-transform-modules-commonjs": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-module-transforms": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-j0vCldybPC5b5dwCQOJ21uKtHzt7hxLygJTg9eF1ScfaikEDNfzn94XoW5Fi+seBR0nCyL23xaBFFkq7dTM8XQ=="],++ "@babel/plugin-transform-react-jsx-self": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-TL0hMc9xzy86VD31nUiwzd5otRAcyEPcsegCxolO0PvcXuH1v0kECe/UIznYFihpkvU5wg/jk4v0TTEFfm53fw=="],++ "@babel/plugin-transform-react-jsx-source": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-06IyK09H3wi4cGbhDBwp5gUGo0IKtnYa8tyTiephirPCK6fbobVGiXMMI5zLQ4aKEYP3wZ3ArU44o+8KMrSG/Q=="],++ "@babel/plugin-transform-typescript": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-annotate-as-pure": "^7.29.7", "@babel/helper-create-class-features-plugin": "^7.29.7", "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-skip-transparent-expression-wrappers": "^7.29.7", "@babel/plugin-syntax-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-jK52h8LaLc7JarhQV2ofeFMts4H7vnOXnqZNA6fYglBTZewRBE51KWt3BUltW1P+KoPsYkHoJeXePuz4zo2LMw=="],++ "@babel/preset-typescript": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-plugin-utils": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "@babel/plugin-syntax-jsx": "^7.29.7", "@babel/plugin-transform-modules-commonjs": "^7.29.7", "@babel/plugin-transform-typescript": "^7.29.7" }, "peerDependencies": { "@babel/core": "^7.0.0-0" } }, "sha512-/Foi8vKY2EVbed/1eZx0gJEEwHAIxogrySI7rULcRIvhZzbvoE/b5qG5Ghc0WKAFKOHA9SD1x7RsFlOYdutIiQ=="],++ "@babel/runtime": ["@babel/[email protected]", "", {}, "sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw=="],++ "@babel/template": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="],++ "@babel/traverse": ["@babel/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" } }, "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg=="],++ "@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg=="],++ "@base-ui/react": ["@base-ui/[email protected]", "", { "dependencies": { "@babel/runtime": "^7.29.2", "@base-ui/utils": "0.3.2", "@floating-ui/react-dom": "^2.1.9", "@floating-ui/utils": "^0.2.12", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "@date-fns/tz": "^1.2.0", "@types/react": "^17 || ^18 || ^19", "date-fns": "^4.0.0", "react": "^17 || ^18 || ^19", "react-dom": "^17 || ^18 || ^19" }, "optionalPeers": ["@date-fns/tz", "@types/react", "date-fns"] }, "sha512-j+8QjX44C32jrXD/qyEAGpFr70FRpGL2CY61mQd9nBPWN737CK0xxD1ceJ055rW4RtdvFDT1e7otzdlfxvsYug=="],++ "@base-ui/utils": ["@base-ui/[email protected]", "", { "dependencies": { "@babel/runtime": "^7.29.2", "@floating-ui/utils": "^0.2.12", "reselect": "^5.2.0", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "@types/react": "^17 || ^18 || ^19", "react": "^17 || ^18 || ^19", "react-dom": "^17 || ^18 || ^19" }, "optionalPeers": ["@types/react"] }, "sha512-oWy1aq/I2GmYjpl4PhEAhzflF8VPGKgZeq0xAWTbfD5KBWyxcN0ZP2+WHSUm/5Z6lVMBDLReLcoXwSYoRc/zNQ=="],++ "@better-auth/core": ["@better-auth/[email protected]", "", { "dependencies": { "@opentelemetry/semantic-conventions": "^1.39.0", "@standard-schema/spec": "^1.1.0", "zod": "^4.3.6" }, "peerDependencies": { "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.1", "@cloudflare/workers-types": ">=4", "@opentelemetry/api": "^1.9.0", "better-call": "1.4.0", "jose": "^6.1.0", "kysely": "^0.28.5 || ^0.29.0", "nanostores": "^1.0.1" }, "optionalPeers": ["@cloudflare/workers-types", "@opentelemetry/api"] }, "sha512-A6/mQW4AT2kSHCRZDh9+k8jPUqnCUUCymzBgIroK0l60wLioMtJdcmZiTwrAn6KVUw+4XWw64MgaRn7LOie3wg=="],++ "@better-auth/drizzle-adapter": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2", "drizzle-orm": "^0.45.2" }, "optionalPeers": ["drizzle-orm"] }, "sha512-BDJ02ra/fji/ah3aIpxjjNOu/JQVex0UisxS4S0vGZZyiAs+DL24mn3/iovyD5dWB3u3NaGg1n8zpTOntiIXcg=="],++ "@better-auth/kysely-adapter": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2", "kysely": "^0.28.17 || ^0.29.0" }, "optionalPeers": ["kysely"] }, "sha512-aavv7W4+b3QVObYo166baplWvwocCk8ORDxRqQ9ytzVl/waiUpSXAOtDHdXZHFsoVHFVPtEzyEq0Tqr3Qvvfig=="],++ "@better-auth/memory-adapter": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2" } }, "sha512-p4NB37MdaVFkxkpLEAKjORgTPhaOAPu1M2zgQXiTJJ3F6Uq3Y1YcCgoz+VxJu0TQfxibCsJD/dZlJMVgf+CF7A=="],++ "@better-auth/mongo-adapter": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2", "mongodb": "^6.0.0 || ^7.0.0" }, "optionalPeers": ["mongodb"] }, "sha512-IOYbJMIjEC//f+JpFlmIQjh6x1R/rGAfdzlojFk6HeAJqbsELuMcI+27dIoesbfHLF/icTrSpZtK986XhJrCfA=="],++ "@better-auth/prisma-adapter": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "optionalPeers": ["@prisma/client", "prisma"] }, "sha512-v7DXVyaFbkrfLoiFDtcVF7BkEZgFa/DgEGE7XjrAXmMACa5pjDvb7lm8W5X+/qgIbQP04eThhgFQ6EWOsjr8OQ=="],++ "@better-auth/telemetry": ["@better-auth/[email protected]", "", { "peerDependencies": { "@better-auth/core": "^1.6.27", "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.1" } }, "sha512-aYrSiVWQfua8w5YX8X1cM6ca48EdS0t5k+CvYXIsruaNIpR1DXMe1DOD0M5FWAVABnlCf9joyHXbFRSIZSNY/A=="],++ "@better-auth/utils": ["@better-auth/[email protected]", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-AUxrvu+HaaODsUyzDxFgwd/8RZ1yZaYo42LXKSrU2oGgR38pS1ij8nqQKNgtTWoYGpNevNXtCfgTy6loHveW9A=="],++ "@better-fetch/fetch": ["@better-fetch/[email protected]", "", {}, "sha512-ABkD1WhyfPZprKRQI3bhATjeiFuNWC9PXhfGWqL+sg/gKrM977oFrYkdb4msM3hgUGonr7KlOsOFT5TU2rht9g=="],++ "@biomejs/biome": ["@biomejs/[email protected]", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.5.8", "@biomejs/cli-darwin-x64": "2.5.8", "@biomejs/cli-linux-arm64": "2.5.8", "@biomejs/cli-linux-arm64-musl": "2.5.8", "@biomejs/cli-linux-x64": "2.5.8", "@biomejs/cli-linux-x64-musl": "2.5.8", "@biomejs/cli-win32-arm64": "2.5.8", "@biomejs/cli-win32-x64": "2.5.8" }, "bin": { "biome": "bin/biome" } }, "sha512-aeAeeJB9fSDc7Gq+2GqpQxA0qBj6gj1k2R6L1cYqGePKP/baIq1WX8y6B+D+nRsO5ViQL22K/8IwbqERW0q1nw=="],++ "@biomejs/cli-darwin-arm64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-mk1QON9PHllvvLN5gU3f4rMxeh4syK5p9OvKyWH6/W8ueh04uaC8TUXXByhGufWf/y5mQc03ZLM45zU+cmqMjA=="],++ "@biomejs/cli-darwin-x64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-bsGwFMBNyHPyiLSsQcZJxdoRrg1V4JL+d7wEsvUBczlP9U9lwM+7mzQHxI4o1mhBsTmdOBbAb6fHU3Z3snN45w=="],++ "@biomejs/cli-linux-arm64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-XmFiA0WPYFC+uiUDC8WRFzAIH9bo7vwQLav38Uoq4ETC+T/+uBi0TsYGJECkugY3r8USl3jc+Ae2/irAF6F2lQ=="],++ "@biomejs/cli-linux-arm64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-VcJNbstduTHx83NGAdhp78/JOcP45BZHXL7yNsfI1uGzdUgegAz2s+mSoT7wK6PBNzLoqG0zDOXaz/RQYVtSiw=="],++ "@biomejs/cli-linux-x64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-S5wcm9OBDvLHodD4PUaN488hCpco9QD/9ZxuYJiw4euWtr/oQvLR72z2ixItH8Wd5BCm6FZaeb+YNvOoM1xHtQ=="],++ "@biomejs/cli-linux-x64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-kKmiyokeISRGq2FLwvr+TzsgBusfxaZ0FZNLcOYOpCK/78tRrEjeEBLvq3xLZMpqbANgJdRPI7vZX8ZL37u9/w=="],++ "@biomejs/cli-win32-arm64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-nILH0mzm3Hi3iEdd7o7GpB8kBR/mSQwfQG/tyBqyNrY2GFtcgwfV9nV8xLmbtUpMNY/Oi0Ml1XgfR4flOdq+AA=="],++ "@biomejs/cli-win32-x64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-I2czzXTY61f3nFJxXoMDq80t7MivxDEnCjE+8sDKoFfcKMaoQdkqhIFQ3KyY0XLzeSpUBYeNAXgD+iOV/BU0VA=="],++ "@braintree/sanitize-url": ["@braintree/[email protected]", "", {}, "sha512-jigsZK+sMF/cuiB7sERuo9V7N9jx+dhmHHnQyDSVdpZwVutaBu7WvNYqMDLSgFgfB30n452TP3vjDAvFC973mA=="],++ "@bufbuild/protobuf": ["@bufbuild/[email protected]", "", {}, "sha512-C3UGsiCwSprE2NKIIFA3hCDlpXTMCAXRZuEVp88L1GY36Y41+rYL5fryE+nOFhp4p4JPQvdV8PQ4DWgHgeTE+w=="],++ "@cfworker/json-schema": ["@cfworker/[email protected]", "", {}, "sha512-gAmrUZSGtKc3AiBL71iNWxDsyUC5uMaKKGdvzYsBoTW/xi42JQHl7eKV2OYzCUqvc+D2RCcf7EXY2iCyFIk6og=="],++ "@chevrotain/cst-dts-gen": ["@chevrotain/[email protected]", "", { "dependencies": { "@chevrotain/gast": "11.0.3", "@chevrotain/types": "11.0.3", "lodash-es": "4.17.21" } }, "sha512-BvIKpRLeS/8UbfxXxgC33xOumsacaeCKAjAeLyOn7Pcp95HiRbrpl14S+9vaZLolnbssPIUuiUd8IvgkRyt6NQ=="],++ "@chevrotain/gast": ["@chevrotain/[email protected]", "", { "dependencies": { "@chevrotain/types": "11.0.3", "lodash-es": "4.17.21" } }, "sha512-+qNfcoNk70PyS/uxmj3li5NiECO+2YKZZQMbmjTqRI3Qchu8Hig/Q9vgkHpI3alNjr7M+a2St5pw5w5F6NL5/Q=="],++ "@chevrotain/regexp-to-ast": ["@chevrotain/[email protected]", "", {}, "sha512-1fMHaBZxLFvWI067AVbGJav1eRY7N8DDvYCTwGBiE/ytKBgP8azTdgyrKyWZ9Mfh09eHWb5PgTSO8wi7U824RA=="],++ "@chevrotain/types": ["@chevrotain/[email protected]", "", {}, "sha512-gsiM3G8b58kZC2HaWR50gu6Y1440cHiJ+i3JUvcp/35JchYejb2+5MVeJK0iKThYpAa/P2PYFV4hoi44HD+aHQ=="],++ "@chevrotain/utils": ["@chevrotain/[email protected]", "", {}, "sha512-YslZMgtJUyuMbZ+aKvfF3x1f5liK4mWNxghFRv7jqRR9C3R3fAOGTTKvxXDa2Y1s9zSbcpuO0cAxDYsc9SrXoQ=="],++ "@copilotkit/a2ui-renderer": ["@copilotkit/[email protected]", "", { "dependencies": { "@a2ui/web_core": "0.10.4", "clsx": "^2.1.1", "lit": "^3.3.2", "zod": "^3.25.75", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc", "react-dom": "^18 || ^19 || ^19.0.0-rc" }, "optionalPeers": ["react", "react-dom"] }, "sha512-/fELhn0gvC+LCurKwdxrF1BRiPbpYUU5UmZjwy1bu1q8brQbXs8UjCcz7oCiCRfhXirzAwEH2LwdPS9ElHJPNw=="],++ "@copilotkit/aimock": ["@copilotkit/[email protected]", "", { "peerDependencies": { "jest": ">=29", "vitest": ">=3" }, "optionalPeers": ["jest", "vitest"], "bin": { "aimock": "dist/aimock-cli.js", "llmock": "dist/cli.js" } }, "sha512-zrGXeSu0/LkHQgrM9Z68uU/k7qpYbnZ25i9djpNlYyDCDCUgKaQPbG1iIYOc+4vuigJmD91ujcK36mBKWz+JVw=="],++ "@copilotkit/channels-core": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@ag-ui/core": "0.0.57", "@copilotkit/channels-ui": "~0.8.1", "@copilotkit/core": "^1.67.0", "@copilotkit/shared": "^1.67.0", "zod-to-json-schema": "^3.24.1" }, "peerDependencies": { "vitest": "^4.0.0" }, "optionalPeers": ["vitest"] }, "sha512-FOopmGLUncVCZ7g2s6opvJZoiAFaU49cgu2+T6TGtVfTVZLTaO5OzDNEOafIqh7xMm6TfMWCjr1o1oZ3njKKpw=="],++ "@copilotkit/channels-intelligence": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@copilotkit/channels-core": "^0.8.1", "@copilotkit/channels-slack": "^0.8.1", "@copilotkit/channels-teams": "^0.8.1", "@copilotkit/channels-ui": "^0.8.1", "phoenix": "^1.8.4" } }, "sha512-b9KtG81v52JhyguyVMyUm4VgARAV6WDfQBB2hLHMI89GwQlAA1LhWYkrPUoG6fk29P3SO8I/LYJjonRes3km5Q=="],++ "@copilotkit/channels-slack": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@ag-ui/core": "0.0.57", "@copilotkit/channels-core": "^0.8.1", "@copilotkit/channels-ui": "^0.8.1", "@copilotkit/core": "^1.67.0", "@copilotkit/shared": "^1.67.0", "@slack/bolt": "^4.2.0", "@slack/types": "^2.21.1", "@slack/web-api": "^7.16.0", "rxjs": "^7.8.1", "zod": "^3.25.76", "zod-to-json-schema": "^3.25.1" } }, "sha512-rrXmX7x/FnJWyhwOlvesz3lMcFXqXMqnF6yeHHMUuCyuYsH54dxZLj0nb3MYMFX40LLuNlUbQtEIHlX2HkKh7A=="],++ "@copilotkit/channels-teams": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@ag-ui/core": "0.0.57", "@copilotkit/channels-core": "^0.8.1", "@copilotkit/channels-ui": "^0.8.1", "@copilotkit/core": "^1.67.0", "@copilotkit/shared": "^1.67.0", "@microsoft/agents-activity": "^1.5.3", "@microsoft/agents-hosting": "^1.5.3", "express": "^4.21.2", "rxjs": "^7.8.1", "zod": "^3.25.76", "zod-to-json-schema": "^3.25.1" } }, "sha512-tvFkNBwPSGTYR//uJ5WIrLLFtp047XO2I8OJkllhTcASRvCLcQkQokhOfukxiS8iEwGiuOxwbCuVlOi6ibhkLw=="],++ "@copilotkit/channels-ui": ["@copilotkit/[email protected]", "", { "dependencies": { "@copilotkit/shared": "^1.67.0" } }, "sha512-ZHhfpPP5UYs8Fjl9bDBVFfuJUcV/Kq8vxkksTJuFsfEZTpExALTOq9EPEHV+Pr/flVzIdrlJilnsL7fC4tOsJQ=="],++ "@copilotkit/core": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@copilotkit/shared": "1.67.1", "@tanstack/pacer": "^0.20.1", "phoenix": "^1.8.4", "rxjs": "7.8.1", "zod-to-json-schema": "^3.24.6" } }, "sha512-QRMsznHFzia+ZF5G8/cn9+91IOZzztUTZi0nXYw/3nENP6Vb8SLCnoH8hUiwGTo8TeoJMhfasGVG8Kt3MpNWNw=="],++ "@copilotkit/license-verifier": ["@copilotkit/[email protected]", "", {}, "sha512-vrwKtIpYwF0FT9ZoYASH8owa2cGV0dhDvJGaCRaRMStwDxpc6DRdydKkhx8cWZXyBRxEYcq/Vygv4JvevhQQdQ=="],++ "@copilotkit/react-core": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@ag-ui/core": "0.0.57", "@copilotkit/a2ui-renderer": "1.67.1", "@copilotkit/core": "1.67.1", "@copilotkit/runtime-client-gql": "1.67.1", "@copilotkit/shared": "1.67.1", "@copilotkit/web-components": "1.67.1", "@copilotkit/web-inspector": "1.67.1", "@jetbrains/websandbox": "^1.1.3", "@lit-labs/react": "^2.0.2", "@radix-ui/react-dropdown-menu": "^2.1.15", "@radix-ui/react-slot": "^1.2.3", "@radix-ui/react-tooltip": "^1.2.7", "@scarf/scarf": "^1.3.0", "@tanstack/react-virtual": "^3.13.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "katex": "^0.16.22", "lit": "^3.3.2", "lucide-react": "^0.525.0", "react-markdown": "^8.0.7", "rxjs": "7.8.1", "streamdown": "^1.3.0", "tailwind-merge": "^3.3.1", "tw-animate-css": "^1.3.5", "untruncate-json": "^0.0.1", "use-stick-to-bottom": "^1.1.1", "zod-to-json-schema": "^3.24.5" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc", "react-dom": "^18 || ^19 || ^19.0.0-rc", "zod": ">=3.0.0" } }, "sha512-daW5zMR8ujruq42NGJoqCBgHgrwAejRn6iK7+FJEkCmLoV8OonS0/fDsuLdWsuWfhHxmRP+CGjRwfwqfaE5kGg=="],++ "@copilotkit/runtime": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/a2ui-middleware": "0.0.10", "@ag-ui/client": "0.0.57", "@ag-ui/core": "0.0.57", "@ag-ui/encoder": "0.0.57", "@ag-ui/langgraph": "0.0.42", "@ag-ui/mcp-apps-middleware": "0.0.3", "@ag-ui/mcp-middleware": "0.0.1", "@ai-sdk/anthropic": "^3.0.49", "@ai-sdk/google": "^3.0.33", "@ai-sdk/google-vertex": "^3.0.97", "@ai-sdk/mcp": "^1.0.21", "@ai-sdk/openai": "^3.0.36", "@copilotkit/channels-core": "^0.8.1", "@copilotkit/channels-intelligence": "0.8.1", "@copilotkit/license-verifier": "~0.5.0", "@copilotkit/shared": "1.67.1", "@graphql-yoga/plugin-defer-stream": "^3.3.1", "@hono/node-server": "^1.13.5", "@modelcontextprotocol/sdk": "^1.18.2", "@remix-run/node-fetch-server": "^0.13.0", "@scarf/scarf": "^1.3.0", "@segment/analytics-node": "^2.1.2", "ai": "^6.0.104", "clarinet": "^0.12.4", "class-transformer": "^0.5.1", "class-validator": "^0.14.1", "cors": "^2.8.5", "express": "^4.21.2", "graphql": "^16.8.1", "graphql-scalars": "^1.23.0", "graphql-yoga": "^5.3.1", "hono": "^4.11.4", "openai": "^4.85.1 || >=5.0.0", "partial-json": "^0.1.7", "phoenix": "^1.8.4", "pino": "^9.2.0", "pino-pretty": "^11.2.1", "reflect-metadata": "^0.2.2", "rxjs": "7.8.1", "type-graphql": "2.0.0-rc.1", "uuid": "^10.0.0", "ws": "^8.18.0", "zod": "^3.23.3" }, "peerDependencies": { "@anthropic-ai/sdk": ">=0.57.0", "@langchain/aws": ">=0.1.9", "@langchain/community": ">=0.3.58", "@langchain/core": ">=0.3.66", "@langchain/google-gauth": ">=0.1.0", "@langchain/langgraph-sdk": ">=0.1.2", "@langchain/openai": ">=0.4.2", "groq-sdk": ">=0.3.0 <1.0.0", "langchain": ">=0.3.3" }, "optionalPeers": ["@anthropic-ai/sdk", "@langchain/aws", "@langchain/community", "@langchain/google-gauth", "@langchain/langgraph-sdk", "@langchain/openai", "groq-sdk", "langchain"] }, "sha512-q3WT/YhzXhRc/K82rGfSyb5K8jSuYV8On51WTQ8dRlx8pm7H4+z/uFuIPA8uO5RKy8Blm1GPatyPozqFuNbh0w=="],++ "@copilotkit/runtime-client-gql": ["@copilotkit/[email protected]", "", { "dependencies": { "@copilotkit/shared": "1.67.1", "@urql/core": "^5.0.3", "untruncate-json": "^0.0.1", "urql": "^4.1.0" }, "peerDependencies": { "react": "^18 || ^19 || ^19.0.0-rc" } }, "sha512-ir2OUeA0iNhLzTVC9peee7qRiLYhje9tLKWdFSVpcFFGpRUAQcz23larOy6r+4hEOp56hV+DQS5wBrS//AqvyA=="],++ "@copilotkit/shared": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@copilotkit/license-verifier": "~0.5.0", "@segment/analytics-node": "^2.1.2", "@standard-schema/spec": "^1.0.0", "chalk": "4.1.2", "graphql": "^16.8.1", "partial-json": "^0.1.7", "uuid": "^11.1.0", "zod": "^3.23.3", "zod-to-json-schema": "^3.23.5" }, "peerDependencies": { "@ag-ui/core": ">=0.0.48" } }, "sha512-hGruBM3EDNg+wM76ECfUEj5xpnj7rOkzv/n/k5brEpdiIIs13v4/wQZf8nw2Rv6uyym7LO3yNRfbgKtcHsQvyQ=="],++ "@copilotkit/web-components": ["@copilotkit/[email protected]", "", { "peerDependencies": { "lit": "^3.3.2" } }, "sha512-ypuXZqA/Vlk7xhvpYPI+u4DnIDV0ZhzHzjo7V0/By6EL7Wy4XAjpLI+1d9FxEWC8JEL0QJVkn17UJMpfnmeEoQ=="],++ "@copilotkit/web-inspector": ["@copilotkit/[email protected]", "", { "dependencies": { "@ag-ui/client": "0.0.57", "@copilotkit/core": "1.67.1", "@copilotkit/shared": "1.67.1", "lit": "^3.2.0", "lucide": "^0.525.0", "marked": "^12.0.2" } }, "sha512-DskVsDrUtZPt9Ymh6UxGElUIETBq8Lxa/vtl9eUdvJ+Ply1xUaGKwfNUpIaGiMWzTML4X7diSVdVrmemlnlYjQ=="],++ "@dotenvx/dotenvx": ["@dotenvx/[email protected]", "", { "dependencies": { "@dotenvx/primitives": "^0.8.0", "commander": "^11.1.0", "conf": "^10.2.0", "dotenv": "^17.2.1", "enquirer": "^2.4.1", "env-paths": "^2.2.1", "execa": "^5.1.1", "fdir": "^6.2.0", "ignore": "^5.3.0", "object-treeify": "1.1.33", "open": "^8.4.2", "picomatch": "^4.0.4", "systeminformation": "^5.22.11", "undici": "^7.11.0", "which": "^4.0.0", "yocto-spinner": "^1.1.0" }, "bin": { "dotenvx": "src/cli/dotenvx.js" } }, "sha512-/BITOC9dmS/edY2zQwZNicQ059O6RKabtQfyEafV0nGtfYRNHYy1DIPiYVcov40+tob9hfmBnbR963dS+EQ1DQ=="],++ "@dotenvx/primitives": ["@dotenvx/[email protected]", "", {}, "sha512-VYJy0uhFm9zTJ1TxBaW/pA8bjbOM/OttaNMwZ1RHG4JKyRG7DhSdiqD1ipQoAyoD22olUtxbP78W9xY3Wd11bg=="],++ "@drizzle-team/brocli": ["@drizzle-team/[email protected]", "", {}, "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w=="],++ "@envelop/core": ["@envelop/[email protected]", "", { "dependencies": { "@envelop/instrumentation": "^1.0.0", "@envelop/types": "^5.2.1", "@whatwg-node/promise-helpers": "^1.2.4", "tslib": "^2.5.0" } }, "sha512-3DQg8sFskDo386TkL5j12jyRAdip/8yzK3x7YGbZBgobZ4aKXrvDU0GppU0SnmrpQnNaiTUsxBs9LKkwQ/eyvw=="],++ "@envelop/instrumentation": ["@envelop/[email protected]", "", { "dependencies": { "@whatwg-node/promise-helpers": "^1.2.1", "tslib": "^2.5.0" } }, "sha512-cxgkB66RQB95H3X27jlnxCRNTmPuSTgmBAq6/4n2Dtv4hsk4yz8FadA1ggmd0uZzvKqWD6CR+WFgTjhDqg7eyw=="],++ "@envelop/types": ["@envelop/[email protected]", "", { "dependencies": { "@whatwg-node/promise-helpers": "^1.0.0", "tslib": "^2.5.0" } }, "sha512-CsFmA3u3c2QoLDTfEpGr4t25fjMU31nyvse7IzWTvb0ZycuPjMjb0fjlheh+PbhBYb9YLugnT2uY6Mwcg1o+Zg=="],++ "@esbuild-kit/core-utils": ["@esbuild-kit/[email protected]", "", { "dependencies": { "esbuild": "~0.18.20", "source-map-support": "^0.5.21" } }, "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ=="],++ "@esbuild-kit/esm-loader": ["@esbuild-kit/[email protected]", "", { "dependencies": { "@esbuild-kit/core-utils": "^3.3.2", "get-tsconfig": "^4.7.0" } }, "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA=="],++ "@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ=="],++ "@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg=="],++ "@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A=="],++ "@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q=="],++ "@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw=="],++ "@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw=="],++ "@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw=="],++ "@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg=="],++ "@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w=="],++ "@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug=="],++ "@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ=="],++ "@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ=="],++ "@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA=="],++ "@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ=="],++ "@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA=="],++ "@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg=="],++ "@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ=="],++ "@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw=="],++ "@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw=="],++ "@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ=="],++ "@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw=="],++ "@esbuild/openharmony-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q=="],++ "@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g=="],++ "@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ=="],++ "@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA=="],++ "@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g=="],++ "@fastify/busboy": ["@fastify/[email protected]", "", {}, "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA=="],++ "@floating-ui/core": ["@floating-ui/[email protected]", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="],++ "@floating-ui/dom": ["@floating-ui/[email protected]", "", { "dependencies": { "@floating-ui/core": "^1.8.0", "@floating-ui/utils": "^0.2.12" } }, "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg=="],++ "@floating-ui/react-dom": ["@floating-ui/[email protected]", "", { "dependencies": { "@floating-ui/dom": "^1.8.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-JDjEFGCpImxDCA7JJKviA0M9+RtmJdj0m/NVU5IMgBK+AmZouAQQ7/+2GLH0GXXY0YMw9oXPB8hKdbPYg5QLYg=="],++ "@floating-ui/utils": ["@floating-ui/[email protected]", "", {}, "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww=="],++ "@fontsource-variable/inter": ["@fontsource-variable/[email protected]", "", {}, "sha512-OupL48va4JNofb97w6NYeF9S7W/kHNKM0Er8Dem5nqi4jeOLrVJDoE8tZEpnMJmtkvNbB1EIPPwHcdkF6b1oUA=="],++ "@graphql-tools/executor": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-tools/utils": "^11.2.2", "@graphql-typed-document-node/core": "^3.2.0", "@repeaterjs/repeater": "^3.1.0", "@whatwg-node/disposablestack": "^0.0.6", "@whatwg-node/promise-helpers": "^1.0.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-UcXVClkBml+qyGEsQxfEaAkboqySVGFUd9ivn7pDc9jZSckgF6zL21cNxuRH5ZA2exneV3PTtcc0I0rDOdE0Tg=="],++ "@graphql-tools/merge": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-tools/utils": "^12.0.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-cKRoXqJGy2zSRBLvotQpkACbXlHAb0yuHLN0l0ypKGCuL3NnF0zofYalkBJqiBxxxpK0lr3s9uowKFHCKi1/ZQ=="],++ "@graphql-tools/schema": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-tools/merge": "^9.2.3", "@graphql-tools/utils": "^12.0.0", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-wao48XQnfY631s3jXoNrhEHvCI8mlKXmIuWrR7F6zAdv92VuSOfHoq9P9KL2EnUMgBUnaStnByOx9Mn6RieWDg=="],++ "@graphql-tools/utils": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@whatwg-node/promise-helpers": "^1.0.0", "cross-inspect": "1.0.1", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-iBFR9GXIs0gCD+yc3hoNswViL1O5josI33dUqiNStFI/MHLCEPduasceAcazRH77YONKNiviHBV8f7OgcT4o2Q=="],++ "@graphql-typed-document-node/core": ["@graphql-typed-document-node/[email protected]", "", { "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ=="],++ "@graphql-yoga/logger": ["@graphql-yoga/[email protected]", "", { "dependencies": { "tslib": "^2.8.1" } }, "sha512-Nv0BoDGLMg9QBKy9cIswQ3/6aKaKjlTh87x3GiBg2Z4RrjyrM48DvOOK0pJh1C1At+b0mUIM67cwZcFTDLN4sA=="],++ "@graphql-yoga/plugin-defer-stream": ["@graphql-yoga/[email protected]", "", { "dependencies": { "@graphql-tools/utils": "^10.11.0" }, "peerDependencies": { "graphql": "^15.2.0 || ^16.0.0", "graphql-yoga": "^5.21.3" } }, "sha512-DnwO7lDWGZMvdv3ps5T15km9I9+pftyfS3XXA9oYJmYjexPJQJQThh7+cEgMeCxOvAZjqJfFWhLyrEdDzfVZtw=="],++ "@graphql-yoga/subscription": ["@graphql-yoga/[email protected]", "", { "dependencies": { "@graphql-yoga/typed-event-target": "^3.0.2", "@repeaterjs/repeater": "^3.0.4", "@whatwg-node/events": "^0.1.0", "tslib": "^2.8.1" } }, "sha512-oCMWOqFs6QV96/NZRt/ZhTQvzjkGB4YohBOpKM4jH/lDT4qb7Lex/aGCxpi/JD9njw3zBBtMqxbaC22+tFHVvw=="],++ "@graphql-yoga/typed-event-target": ["@graphql-yoga/[email protected]", "", { "dependencies": { "@repeaterjs/repeater": "^3.0.4", "tslib": "^2.8.1" } }, "sha512-ZpJxMqB+Qfe3rp6uszCQoag4nSw42icURnBRfFYSOmTgEeOe4rD0vYlbA8spvCu2TlCesNTlEN9BLWtQqLxabA=="],++ "@happy-dom/global-registrator": ["@happy-dom/[email protected]", "", { "dependencies": { "@types/node": ">=20.0.0", "happy-dom": "^20.11.2" } }, "sha512-7fkpoXZWzyxaBkzRtlD0wRU5ckxbNT4j6BywzpSYh+SFPsGxEVmNR9KHaMwM2xkHB0pADQLl4Z8DSrztECJ7Ww=="],++ "@hono/node-server": ["@hono/[email protected]", "", { "peerDependencies": { "hono": "^4" } }, "sha512-dSneS5qhiauZWGDCeK4o695Xd9nUNjviSZCMQrj10eetr8Uln1ucn6bbphOM6UynAMMtNIzZNSpL9vnASJwrPQ=="],++ "@iconify/types": ["@iconify/[email protected]", "", {}, "sha512-+wluvCrRhXrhyOmRDJ3q8mux9JkKy5SJ/v8ol2tu4FVjyYvtEzkc/3pK15ET6RKg4b4w4BmTk1+gsCUhf21Ykg=="],++ "@iconify/utils": ["@iconify/[email protected]", "", { "dependencies": { "@antfu/install-pkg": "^1.1.0", "@iconify/types": "^2.0.0", "import-meta-resolve": "^4.2.0" } }, "sha512-b1S7B1k9ohZ+iNTi2ATxbRYG9fTrJmUT0rc46bvVnNxqNRGW7dyo/vRREwyniI5IRN2RSJHDcm+s3BjWrSAjHw=="],++ "@jetbrains/websandbox": ["@jetbrains/[email protected]", "", {}, "sha512-YTl3MJXbAkYDyuRhWqlQoo7eY2jaLGRqUkx4LVRvxr0VnK7s5bu0p2KAGOWZIBf6I3pmuuq+JzBDHw1b0fV0/Q=="],++ "@jridgewell/gen-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.0", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA=="],++ "@jridgewell/remapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ=="],++ "@jridgewell/resolve-uri": ["@jridgewell/[email protected]", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="],++ "@jridgewell/sourcemap-codec": ["@jridgewell/[email protected]", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="],++ "@jridgewell/trace-mapping": ["@jridgewell/[email protected]", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="],++ "@langchain/core": ["@langchain/[email protected]", "", { "dependencies": { "@cfworker/json-schema": "^4.0.2", "@standard-schema/spec": "^1.1.0", "js-tiktoken": "^1.0.12", "langsmith": ">=0.5.0 <1.0.0", "mustache": "^4.2.0", "p-queue": "^6.6.2", "zod": "^3.25.76 || ^4" } }, "sha512-NKEjQimC9IR7YKkfirH9Hq1BIFFKd4tjhWvbtjggS+5mE+bM4ZeFwTIUe9BDIz9zi3hzG4DLbRMi5E8k/PwVTA=="],++ "@langchain/langgraph": ["@langchain/[email protected]", "", { "dependencies": { "@langchain/langgraph-checkpoint": "^1.1.3", "@langchain/langgraph-sdk": "~1.9.28", "@langchain/protocol": "^0.0.18", "@standard-schema/spec": "1.1.0" }, "peerDependencies": { "@langchain/core": "^1.1.48", "zod": "^3.25.32 || ^4.2.0" } }, "sha512-EvD9rS66Cya09y6rbMgD3Ir8miAkJQFo7FyJOPRPO736Kz3y5TeyeBDOS8ctff/jRc788bPijHx2NVFM79Qqig=="],++ "@langchain/langgraph-checkpoint": ["@langchain/[email protected]", "", { "peerDependencies": { "@langchain/core": "^1.1.48" } }, "sha512-wgzdQNeEsdw1e+4lvlj0tdq/RYR/k1vPin10g0ymGoehZDDgd9nvIllGXSXN4TFgF9sf5qQP/KTkOcLfeseIhA=="],++ "@langchain/langgraph-sdk": ["@langchain/[email protected]", "", { "dependencies": { "@langchain/protocol": "^0.0.18", "@types/json-schema": "^7.0.15", "p-queue": "^9.0.1", "p-retry": "^7.1.1" }, "peerDependencies": { "@langchain/core": "^1.1.48", "react": "^18 || ^19", "react-dom": "^18 || ^19", "svelte": "^4.0.0 || ^5.0.0", "vue": "^3.0.0" }, "optionalPeers": ["react", "react-dom", "svelte", "vue"] }, "sha512-W+ccugM5EzBHvaOieyYxlSbhAy6HWF8Tyn6b/BlTWuFd8xtcnQOz2WuFyofcAc9+aQHE+6yHJfIywGOvjxS+bA=="],++ "@langchain/protocol": ["@langchain/[email protected]", "", {}, "sha512-XW1egQtPfsGI41w2AMZNFZrUIwFSQHTjVMZs0OaTpCAvht/QLoaPN8FQcsysMVypOhupG28J29yOorrc70otBQ=="],++ "@lit-labs/react": ["@lit-labs/[email protected]", "", { "dependencies": { "@lit/react": "^1.0.3" } }, "sha512-OD9h2JynerBQUMNzb563jiVpxfvPF0HjQkKY2mx0lpVYvD7F+rtJpOGz6ek+6ufMidV3i+MPT9SX62OKWHFrQg=="],++ "@lit-labs/ssr-dom-shim": ["@lit-labs/[email protected]", "", {}, "sha512-VHb0ALPMTlgKjM6yIxxoQNnpKyUKLD04VzeQdsiXkMqkvYlAHxq9glGLmgbb889/1GsohSOAjvQYoiBppXFqrQ=="],++ "@lit/react": ["@lit/[email protected]", "", { "peerDependencies": { "@types/react": "17 || 18 || 19" } }, "sha512-p2+YcF+JE67SRX3mMlJ1TKCSTsgyOVdAwd/nxp3NuV1+Cb6MWALbN6nT7Ld4tpmYofcE5kcaSY1YBB9erY+6fw=="],++ "@lit/reactive-element": ["@lit/[email protected]", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.5.0" } }, "sha512-pbCDiVMnne1lYUIaYNN5wrwQXDtHaYtg7YEFPeW+hws6U47WeFvISGUWekPGKWOP1ygrs0ef0o1VJMk1exos5A=="],++ "@lukeed/csprng": ["@lukeed/[email protected]", "", {}, "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA=="],++ "@lukeed/uuid": ["@lukeed/[email protected]", "", { "dependencies": { "@lukeed/csprng": "^1.1.0" } }, "sha512-qC72D4+CDdjGqJvkFMMEAtancHUQ7/d/tAiHf64z8MopFDmcrtbcJuerDtFceuAfQJ2pDSfCKCtbqoGBNnwg0w=="],++ "@mermaid-js/parser": ["@mermaid-js/[email protected]", "", { "dependencies": { "@chevrotain/types": "~11.1.2" } }, "sha512-oYPyv8A4As1yH5Bx+04iQEQxXuIQDe0GKCNSRgao6z8AM9jixXIfP0vsppRLvGf+nKIOb9/LdpWA4YuJiVvESA=="],++ "@microsoft/agents-activity": ["@microsoft/[email protected]", "", { "dependencies": { "zod": "3.25.75" } }, "sha512-aMPZFuyIkdAdKxscyEZ6o6m60rB+JbWE4n02HzP3QOmILWBfddRMxYlK6gFLd86Wpf1hYGvfJBdpx8Av5ZRBIA=="],++ "@microsoft/agents-hosting": ["@microsoft/[email protected]", "", { "dependencies": { "@azure/core-auth": "1.10.1", "@azure/msal-node": "5.1.5", "@microsoft/agents-activity": "1.7.2", "@microsoft/agents-telemetry": "1.7.2", "jsonwebtoken": "9.0.3", "jwks-rsa": "4.0.1", "zod": "3.25.75" } }, "sha512-wRCiLusxFMkx27rN3+Iq+1lClkrcyflZVorGOLLN5y0/itacE6BaHjRsfpvxVnIKYZ2c4lQ3zCHyLScvZNumVg=="],++ "@microsoft/agents-telemetry": ["@microsoft/[email protected]", "", { "dependencies": { "@microsoft/agents-activity": "1.7.2", "debug": "^4.4.3" }, "peerDependencies": { "@opentelemetry/api": "1", "@opentelemetry/api-logs": ">=0.214.0 <1" }, "optionalPeers": ["@opentelemetry/api", "@opentelemetry/api-logs"] }, "sha512-iJBAm1MmCUaSoPE62GKp4OnlOSe+F+j8o/fwKuqiJEcedbgceTh6G5m8iqe/qDGwKSsBWuIu3Kt0comRrc140A=="],++ "@modelcontextprotocol/sdk": ["@modelcontextprotocol/[email protected]", "", { "dependencies": { "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA=="],++ "@napi-rs/lzma-linux-x64-gnu": ["@napi-rs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ=="],++ "@noble/ciphers": ["@noble/[email protected]", "", {}, "sha512-Clu/xdfgVTf9o7ngLOURaxePwR0j8sjclKEtVij10/jGulwFsPWCvvRgG/XjUVf8Nei+jLG6uwyXzUTGY1DQrw=="],++ "@noble/hashes": ["@noble/[email protected]", "", {}, "sha512-oN+QwyX7VSHotibwubG3kpzbwKrfnyR6OOO+3Nk/53ADL7FmgHHz4TgrbaYKvvOw09u6QTx0oiH1cNCIOuN0CQ=="],++ "@nodelib/fs.scandir": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="],++ "@nodelib/fs.stat": ["@nodelib/[email protected]", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="],++ "@nodelib/fs.walk": ["@nodelib/[email protected]", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="],++ "@opentelemetry/api": ["@opentelemetry/[email protected]", "", {}, "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q=="],++ "@opentelemetry/semantic-conventions": ["@opentelemetry/[email protected]", "", {}, "sha512-eSYWTm620tTk45EKSedaUL8MFYI8hW164hIXsgIHyxu3VobUB3fFCu5t0hQby6OoWRPsG1KkKUG2M5UadiLiVg=="],++ "@pinojs/redact": ["@pinojs/[email protected]", "", {}, "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg=="],++ "@preact/signals-core": ["@preact/[email protected]", "", {}, "sha512-HNB6HYeYKhQbJ1aKl+YRjrS4+QWHLKX6qKoUsfS/m0vqzsVaEBiZiaKbG/e+NKk2ch5ALQr/ihWaMHxiCuuWHA=="],++ "@protobuf-ts/protoc": ["@protobuf-ts/[email protected]", "", { "bin": { "protoc": "protoc.js" } }, "sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg=="],++ "@radix-ui/primitive": ["@radix-ui/[email protected]", "", {}, "sha512-rqWnm76nYT8HoNNqEjpgJ7Pw/DrBj5iBTrmEPo6HTX5+VJyBNOqTdv4g89G63HuR5g0AaENoAcH7Is5fF2kZ8Q=="],++ "@radix-ui/react-arrow": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.10" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-v4zggRcjadnI+ClKDuijlQEW4tw3NoaeHc/PwpKnLoLLKNUG4InLegkstooLcRIUWCs+8L22dGURCVuFfOKfnA=="],++ "@radix-ui/react-collection": ["@radix-ui/[email protected]", "", { "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" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-9W+B9NPF0NaaPh/1NJd3+KqsnlLqU9H7T2rvww+fp+T/evVXdNAyYcnfRQZFOjkR1ajQp3yORlqnI8soawLvNA=="],++ "@radix-ui/react-compose-refs": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-+48PbAAbq3didjJxa+OaWY2ZwgAKsNiRGyeHKszblZMQ+kcpd9pAaT11cMkGEie0vsOi3QdeTE6d5Fe3Gn61kA=="],++ "@radix-ui/react-context": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RHCUGwKHDr0hDGg4X7ma4JG4/+12qxw8rkh5QKdDldlCvtja6nUx1Ef/8HVrJze81lEsgLQlqjzjGNHantgnQA=="],++ "@radix-ui/react-direction": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-5pzg4FGQNpExhnhT2zlrP1wZFaYCd1K0nYWoFAdcYoYK868IEigqMX3B3f8yIoRlAhAeDWciLI6ZdCKHF9P4Vg=="],++ "@radix-ui/react-dismissable-layer": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@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-use-effect-event": "0.0.5" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-8g4pfOL9HoKKLWGiypT+dphVqjFfmcXO5GBnhsG6zI+lxAx/8feQpr+1LSN8Re3hiZ+XkLNS4O9ztK11/LzQ6w=="],++ "@radix-ui/react-dropdown-menu": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@radix-ui/react-compose-refs": "1.1.5", "@radix-ui/react-context": "1.2.2", "@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" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-geq8l2rJkxvkXsT9RMgtUE3P8pITFpTsvYpbySi1IH4fZEABD/Gp85myayFgxk0ktljGMJnCbeFkyTusvSvv7g=="],++ "@radix-ui/react-focus-guards": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-RNOJjfZMTyBM6xYmV3IVGXkPjIhcBAuv48POevAXwrGJhkWZ9p1rFoIS1JFooPuT193AZmRsCPhpoVJxx6OPoQ=="],++ "@radix-ui/react-focus-scope": ["@radix-ui/[email protected]", "", { "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" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-wmRZ2WWLvmt6KHy2rNPOdPUjwq5xOHY02+m+udwJTn0aNIox/rkskAvJTyTLGhPK6KgrUjlJUJpgmx/+wFiFIQ=="],++ "@radix-ui/react-id": ["@radix-ui/[email protected]", "", { "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" }, "optionalPeers": ["@types/react"] }, "sha512-TMQp2llA+RYn7JcjnrMnz7wN4pcVttPZnRZo52PLQsoLVKzNlVwUeHmfePgTgRluXFvlD3GD5g5MOVVTJCO0qA=="],++ "@radix-ui/react-menu": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@radix-ui/react-collection": "1.1.15", "@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-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", "aria-hidden": "^1.2.4", "react-remove-scroll": "^2.7.2" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-uW7RVuU6Lp/ZtfeY4b3kL32zccgEWvPv1+cf17ubYzHa9cL8AHokmk36cG/XEiH/smbQvumnieXX9j/e9RqJWA=="],++ "@radix-ui/react-popper": ["@radix-ui/[email protected]", "", { "dependencies": { "@floating-ui/react-dom": "^2.0.0", "@radix-ui/react-arrow": "1.1.15", "@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-use-layout-effect": "1.1.4", "@radix-ui/react-use-rect": "1.1.4", "@radix-ui/react-use-size": "1.1.4", "@radix-ui/rect": "1.1.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-UsJrrd7w4wuKKTdvd/DNERVlwSlUcyXzjhyDwBk+3aPOsCjOY6ZSbxuw8E6lZTjjfP8Cpd0J8VVkrYUWyGYXyg=="],++ "@radix-ui/react-portal": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.10", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-vKQLcWypUnwZVvfV7UkGahH2g6ySe8M8R+zYBwPrv5byZ9QAW6cQVvNKo7GgmD+p8aYb6D9JBuvy8/WhOno2wQ=="],++ "@radix-ui/react-presence": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-3wyzCQ6+ubRA+D4uv9m95JYLXxmOHp05qjrkjeA7uKHHtjpPggQzc6DAb0URl7j67oR0K2foO4ip27TiX037Bw=="],++ "@radix-ui/react-primitive": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-slot": "1.3.3" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-MucOnzh6hR5mid6VpkbglRAMYMjKLqRnGBbjXkzjK52fuQDd1qbkx78a5P40mkcnVXJdEVxm26E9OPAiUq7nBg=="],++ "@radix-ui/react-roving-focus": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@radix-ui/react-collection": "1.1.15", "@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-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-use-is-hydrated": "0.1.3", "@radix-ui/react-use-layout-effect": "1.1.4" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-V9jI6hDjT7l3jsCQD9bLNvDLM3tH/gdbOTp7Tefp3hbbgCGQoK7tUvrWiRlcoBHIZ809ElXwNQwVo0B98LuTXQ=="],++ "@radix-ui/react-slot": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-compose-refs": "1.1.5" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-qx7oqnYbxnK9kYI9m317qmFmEgo6ywqWvbTogdj7cL9p3/yx4M48p7Rnw5z3H890cL/ow/EeWJsuTykeZVXP5Q=="],++ "@radix-ui/react-tooltip": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@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-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-use-layout-effect": "1.1.4", "@radix-ui/react-visually-hidden": "1.2.11" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-6EamKFRRnlpdadndbZ6LMwycfwkwPte1B42hs6QA0gYhjaOKqW4PZ4pjaW9UrlDX5eVt/OjncE7BFTPL5nmZhg=="],++ "@radix-ui/react-use-callback-ref": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-R6OUY2e2fA6Yn6s+VSx5KBV6Nx8LQEhu+cz7LCej18rQ1HLyg9PSC9jP/ZNx0o6FAIK9c0F1kHylzSxKsdlkrQ=="],++ "@radix-ui/react-use-controllable-state": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/primitive": "1.1.7", "@radix-ui/react-use-effect-event": "0.0.5", "@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" }, "optionalPeers": ["@types/react"] }, "sha512-uEQJGT97ZA/TgP/Hydw47lHu+/vQj6z/0jA+WeTbK1o9Rx45GImjpD0tc3W5ad3D6XTSR6e1yEO0FvGq6WQfVQ=="],++ "@radix-ui/react-use-effect-event": ["@radix-ui/[email protected]", "", { "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" }, "optionalPeers": ["@types/react"] }, "sha512-7cshFL8HGS/7HEiHH+9kL9HBwp2sa9yX18Knwek6KYWmXwM7pegMgta2AXMQKI+rq3JnfSj9x8wYqFMTdG1Jgg=="],++ "@radix-ui/react-use-is-hydrated": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-umO/aJ+82CpOnhDZUTbILCQf7kU/g0iv+oGs/Q8jw7IkhWBzaEP4sA268PhFAJTFetbwp3ICc6ktpI4TqtxcIw=="],++ "@radix-ui/react-use-layout-effect": ["@radix-ui/[email protected]", "", { "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-K20DkRkUwDnxEYMBPcg3Y6voLkEy5p5QQmszZgLngKKiC7dzBR/aEuK3w1qlx2JWDUNH6FluahYdgR3BP+QbYw=="],++ "@radix-ui/react-use-rect": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/rect": "1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-cSOCh6JlkmfjLyNcLiu2nB4v+nm+dkZ+Q5KHWk/soo4U7ZLiEQFKHK9/YmtBHjfCEaU43IBKQOc4/uJmCaiCTQ=="],++ "@radix-ui/react-use-size": ["@radix-ui/[email protected]", "", { "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" }, "optionalPeers": ["@types/react"] }, "sha512-D3anSY15EJoxrihpsXI6SMrmmonnQtR2ni7arO+Lfdg3O95b9hNXxONk8jA5C8ANdF/h5HMAxejgs8PWJ6rlhw=="],++ "@radix-ui/react-visually-hidden": ["@radix-ui/[email protected]", "", { "dependencies": { "@radix-ui/react-primitive": "2.1.10" }, "peerDependencies": { "@types/react": "*", "@types/react-dom": "*", "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-NFS86RYYZb4/exihaESBGOpMJFz8MGLAfu3mOBSGByVnVPC9JPASfYubxd/8KbkQK0sYAv8lVQDEQukDX/qXvQ=="],++ "@radix-ui/rect": ["@radix-ui/[email protected]", "", {}, "sha512-JtyZR+mqgBibTo8xea3B6ZRmzZiM/YeVBtUkas6zMuXjAlfIFIW2FgqeM9eLyvEaYX66vr6DJMK+4U6LV0KhNw=="],++ "@remix-run/node-fetch-server": ["@remix-run/[email protected]", "", {}, "sha512-UfjOXed/DQteaM5VyTfqTeGpHwyL2J5aoRGY6cydip4tt1ehNNeSwuXCC7AEGE0RWBs/7bgKxYkL/B/+UDe4AA=="],++ "@repeaterjs/repeater": ["@repeaterjs/[email protected]", "", {}, "sha512-TaoVksZRSx2KWYYpyLQtMQXXeS98VsgZImzW65xmiVgbYhXLk+aEsmzPLirqVuE4/XuUapH2iMtxUzaBNDzdSQ=="],++ "@rolldown/pluginutils": ["@rolldown/[email protected]", "", {}, "sha512-eybk3TjzzzV97Dlj5c+XrBFW57eTNhzod66y9HrBlzJ6NsCrWCp/2kaPS3K9wJmurBC0Tdw4yPjXKZqlznim3Q=="],++ "@rollup/rollup-android-arm-eabi": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-RrPokAb7dmbxFoeO3TloqHyOjgye8RkBhSqmp4aJMIex4c9r46ZstPnleDQOq1t46VOVjwIuwNogIqbodV1Vvg=="],++ "@rollup/rollup-android-arm64": ["@rollup/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-JKuJc+pnpks2pjy7L/N3v/cAkZxYlnmuZoD840ldbMI5KDbC4iO9NKwPKYdjYFCMAIIlBzYSFHxIJVYzRo2/8A=="],++ "@rollup/rollup-darwin-arm64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-krw5uS2STmvJ02x0uTXHbqQNuz+9eZ1iw+qXk9dmW2gvV4jV7O2hEoOnuhFrpOPiel1mBFtqbxYZZtC46hXLOw=="],++ "@rollup/rollup-darwin-x64": ["@rollup/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-wsTxtgApb4PrOsNJIm0FZ1h3WvCC+k9uxLJ4ad75hgoS4NiRes2SoJFlDAyMwiUY8IssDqGcHbXuN0sx1tfF1A=="],++ "@rollup/rollup-freebsd-arm64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-GUOnQlyZe3yAXhWOtOMsn5Qkrv5E5mZXa0thbARWi5Ei2szlVXJFQhddZ4HbAzh8q92w5twp+CQvs/eFanz9YQ=="],++ "@rollup/rollup-freebsd-x64": ["@rollup/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-/Y7f3QuxjzPKsjA/rfEDa3+0vXqyjmJ50Ln8dPpCmWkKTrUoWHG1cWhTqaAMLob2m2nESWuC7yGrREz019Ztqg=="],++ "@rollup/rollup-linux-arm-gnueabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-81wiiX3v7aqy+T+bT61TJ78yJjRquqFFTTbAPt08imfQQzkPIW8t6aJbkTagtCCrXMNc9D66+geqlK7ydLPNqA=="],++ "@rollup/rollup-linux-arm-musleabihf": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-9kmDIvNZqdoHOBZgNtpTBeLWYO/LVipM3H/j62P8848/l/VPEQL6N3uxU9pvP1oZAsXyC2MEnFP3ovRjo7WYNQ=="],++ "@rollup/rollup-linux-arm64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-CcnXHWnXg69g+DX5VWL3FHts3qMRN2uVEHX+BZvGLdd07/gXkn3ePjYtO1LDJvxkGKVHMclKBRa1QUTH+6toYQ=="],++ "@rollup/rollup-linux-arm64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-iFOibiHnTRuhrWLlRsOQFdZJJIa7S8OwkneJr4ocALP16u5yk6lWLINFwhHaEqBFMsKDUZofLkGos7+CPzGB3g=="],++ "@rollup/rollup-linux-loong64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-XnWYMI7euHlb5a871xPja+Gm7DRCFU+FGRrtS2sMq9N8FvqtpagUy6gD4YOemC5MRk9xbh8+jYMEJbigFQwsgA=="],++ "@rollup/rollup-linux-loong64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-qGDAlO0U8xedCcsdRm9oaoQY8DAx/QT7uIxJWhCdx0ceIWX783UC9QSYkdpzAe29wNiVfp24+bZdQmn49o45SQ=="],++ "@rollup/rollup-linux-ppc64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-ru4H6ezD7ysA5EiEK6qkkaEb4modH8CTej6kUy/gQi20u3kB3G7Zn8snXXkeJSCOFKG/rbPPtM/+9Wgas1961w=="],++ "@rollup/rollup-linux-ppc64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-2W4MO5WQVJnbJaZdvDb9rhBDuFU1nKIepPFpJUBsTh2k1YY2g+ODViaWuyOAjQ5cOP7NvrvLzt3wvHOoiAvc7w=="],++ "@rollup/rollup-linux-riscv64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-+fxjfuoAmVMCYV5QyjoIpu0cp5DOiOTeqYFk1AVaxGr+/ravWLX89XfQmptsoWcaVy/TGf2hexzbUOrCQIL1CQ=="],++ "@rollup/rollup-linux-riscv64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-jTn8JfHGL4djjFxPuM06LmNUJDsst2jeVlsd9OmIH6zc5sC9K6rIuO4YajXatLUpBmBKl6b35ro1QZocLi+tcA=="],++ "@rollup/rollup-linux-s390x-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-oCJCJL4pXsoDcP2QZ+JVlPTIRc6266zsIaeJJsWImmF7HO0W8nb6HuSgZlMWxJwaPf8ehbSw8yo0EUw925hKsA=="],++ "@rollup/rollup-linux-x64-gnu": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-W69hukhZ3KKNRCaMIEzKvcFye42hh0FE1+YoYaf5+Ikacuftoco6yO/xouz0hc5d5W/s3yBro5jRiuEE/Q5vUw=="],++ "@rollup/rollup-linux-x64-musl": ["@rollup/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-qiXbGG2jkjXhzXpsFZSR2Xpb8DN/UaxYsbb/STbuR/6fpaDgRmmaq1B/LmtF2wQFOFOSsK2jdE0RZ3a0zHn4QA=="],++ "@rollup/rollup-openbsd-x64": ["@rollup/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-nWeM//hxv8mIo6jD7Hu4o48DVmV9pbV6gsKaWU+4NFyqHoPKwrkRiZGLKUhOBk8qNmDmpwFtPKg80Bo/Tn4xiQ=="],++ "@rollup/rollup-openharmony-arm64": ["@rollup/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-s62SQ/vgsRSvMwDkOEfTqfgASF0f26ZNaQuTA6Aok5lrikf89yI2W0gFHvZb2Jpgc6N8JnOKZgCK2iciO3CsxQ=="],++ "@rollup/rollup-win32-arm64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-J6wGf8TVGbXJq+HH+ttTvrcfNKPbuZecV6KT1B8I18BC5IURUh5kl4Yl5OEP5eFIUoI5BWxCsyYMhFsDx8kekw=="],++ "@rollup/rollup-win32-ia32-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-zmfrQd/0wu6oJs8Vq8KwY/YtsKSsLtKe/HwAP4Wqy8LhWjeT55fHRAkOhYQ12wI3ayS4Tt12d5CDRD7N96SAYQ=="],++ "@rollup/rollup-win32-x64-gnu": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-qPzHqdj9rfUD+w79dtE07zi/kFwKyCJqplp5K5ygeLTp7jLpAoc16OAH39HSmRC9UpozaecsleI8uAdEj6v2yw=="],++ "@rollup/rollup-win32-x64-msvc": ["@rollup/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-zD6NdeWEByGE9QF9vCrlJ5YQB4oq9q91kPZS37Jwj5hOkvR1lTBSpsKhKDw4IJtbQ35LsTS1HD9DZYGKIshU1Q=="],++ "@scarf/scarf": ["@scarf/[email protected]", "", {}, "sha512-xxeapPiUXdZAE3che6f3xogoJPeZgig6omHEy1rIY5WVsB3H2BHNnZH+gHG6x91SCWyQCzWGsuL2Hh3ClO5/qQ=="],++ "@sec-ant/readable-stream": ["@sec-ant/[email protected]", "", {}, "sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg=="],++ "@segment/analytics-core": ["@segment/[email protected]", "", { "dependencies": { "@lukeed/uuid": "^2.0.0", "@segment/analytics-generic-utils": "1.2.0", "dset": "^3.1.4", "tslib": "^2.4.1" } }, "sha512-5FDy6l8chpzUfJcNlIcyqYQq4+JTUynlVoCeCUuVz+l+6W0PXg+ljKp34R4yLVCcY5VVZohuW+HH0VLWdwYVAg=="],++ "@segment/analytics-generic-utils": ["@segment/[email protected]", "", { "dependencies": { "tslib": "^2.4.1" } }, "sha512-DfnW6mW3YQOLlDQQdR89k4EqfHb0g/3XvBXkovH1FstUN93eL1kfW9CsDcVQyH3bAC5ZsFyjA/o/1Q2j0QeoWw=="],++ "@segment/analytics-node": ["@segment/[email protected]", "", { "dependencies": { "@lukeed/uuid": "^2.0.0", "@segment/analytics-core": "1.8.2", "@segment/analytics-generic-utils": "1.2.0", "buffer": "^6.0.3", "jose": "^5.1.0", "node-fetch": "^2.6.7", "tslib": "^2.4.1" } }, "sha512-fOXLL8uY0uAWw/sTLmezze80hj8YGgXXlAfvSS6TUmivk4D/SP0C0sxnbpFdkUzWg2zT64qWIZj26afEtSnxUA=="],++ "@shadcn/react": ["@shadcn/[email protected]", "", { "peerDependencies": { "@types/react": ">=19", "react": ">=19" }, "optionalPeers": ["@types/react", "react"] }, "sha512-iKN0NuYe850VDHlxEfvppFrpa7CMV3zArTHusXlaSmeFeQhohGbIqclv6WwPTs/44I8EkXQpcuRt6sXEVKkWqQ=="],++ "@shikijs/core": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4", "hast-util-to-html": "^9.0.5" } }, "sha512-NSWQz0riNb67xthdm5br6lAkvpDJRTgB36fxlo37ZzM2yq0PQFFzbd8psqC2XMPgCzo1fW6cVi18+ArJ44wqgA=="],++ "@shikijs/engine-javascript": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "oniguruma-to-es": "^4.3.4" } }, "sha512-aHt9eiGFobmWR5uqJUViySI1bHMqrAgamWE1TYSUoftkAeCCAiGawPMwM+VCadylQtF4V3VNOZ5LmfItH5f3yA=="],++ "@shikijs/engine-oniguruma": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2" } }, "sha512-1nWINwKXxKKLqPibT5f4pAFLej9oZzQTsby8942OTlsJzOBZ0MWKiwzMsd+jhzu8YPCHAswGnnN1YtQfirL35g=="],++ "@shikijs/langs": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/types": "3.23.0" } }, "sha512-2Ep4W3Re5aB1/62RSYQInK9mM3HsLeB91cHqznAJMuylqjzNVAVCMnNWRHFtcNHXsoNRayP9z1qj4Sq3nMqYXg=="],++ "@shikijs/themes": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/types": "3.23.0" } }, "sha512-5qySYa1ZgAT18HR/ypENL9cUSGOeI2x+4IvYJu4JgVJdizn6kG4ia5Q1jDEOi7gTbN4RbuYtmHh0W3eccOrjMA=="],++ "@shikijs/types": ["@shikijs/[email protected]", "", { "dependencies": { "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-3JZ5HXOZfYjsYSk0yPwBrkupyYSLpAE26Qc0HLghhZNGTZg/SKxXIIgoxOpmmeQP0RRSDJTk1/vPfw9tbw+jSQ=="],++ "@shikijs/vscode-textmate": ["@shikijs/[email protected]", "", {}, "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg=="],++ "@sindresorhus/merge-streams": ["@sindresorhus/[email protected]", "", {}, "sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ=="],++ "@slack/bolt": ["@slack/[email protected]", "", { "dependencies": { "@slack/logger": "^4.0.1", "@slack/oauth": "^3.0.5", "@slack/socket-mode": "^2.0.7", "@slack/types": "^2.21.1", "@slack/web-api": "^7.16.0", "axios": "^1.12.0", "express": "^5.0.0", "path-to-regexp": "^8.1.0", "raw-body": "^3", "tsscmp": "^1.0.6" }, "peerDependencies": { "@types/express": "^5.0.0" } }, "sha512-bODs8q/yNDWUPoxmQhFrRqLMA5vhB/PDizYWqb6CkQhLWEUo5JFtfJcmeU4ElGl6qSt++OKjSYNa4MPc77CleQ=="],++ "@slack/logger": ["@slack/[email protected]", "", { "dependencies": { "@types/node": ">=18" } }, "sha512-6cmdPrV/RYfd2U0mDGiMK8S7OJqpCTm7enMLRR3edccsPX8j7zXTLnaEF4fhxxJJTAIOil6+qZrnUPTuaLvwrQ=="],++ "@slack/oauth": ["@slack/[email protected]", "", { "dependencies": { "@slack/logger": "^4.0.1", "@slack/web-api": "^7.15.0", "@types/jsonwebtoken": "^9", "@types/node": ">=18", "jsonwebtoken": "^9" } }, "sha512-exqFQySKhNDptWYSWhvRUJ4/+ndu2gayIy7vg/JfmJq3wGtGdHk531P96fAZyBm5c1Le3yaPYqv92rL4COlU3A=="],++ "@slack/socket-mode": ["@slack/[email protected]", "", { "dependencies": { "@slack/logger": "^4.0.1", "@slack/web-api": "^7.15.0", "@types/node": ">=18", "@types/ws": "^8", "eventemitter3": "^5", "ws": "^8" } }, "sha512-qYy07je71WnEHgRwmw12DlAnZLi5HXmdlI2WUzUK2LH/rYXQpP6uEg462S5CwfE8FoCKUdIigHtYnOOfzZH1lQ=="],++ "@slack/types": ["@slack/[email protected]", "", {}, "sha512-sZ9lIgJhPX2qft/tKWiklFlc0o1FWeI7QtciZJfW1+ErH1eGGHvOZ8e73sleTCFEFJp1q/R0WeS8Oa7AsiDprg=="],++ "@slack/web-api": ["@slack/[email protected]", "", { "dependencies": { "@slack/logger": "^4.0.1", "@slack/types": "^2.21.0", "@types/node": ">=18", "@types/retry": "0.12.0", "axios": "^1.16.0", "eventemitter3": "^5.0.1", "form-data": "^4.0.4", "is-electron": "2.2.2", "is-stream": "^2", "p-queue": "^6", "p-retry": "^4", "retry": "^0.13.1" } }, "sha512-ItjyjEZml+LDH8CjcCLRLJHh7VZtevPKExrRN3l5KWyBliyDnGAeoO4Y+K+fFBmRpKLYVPgqWMX4THldv2HVtA=="],++ "@standard-schema/spec": ["@standard-schema/[email protected]", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="],++ "@tabler/icons": ["@tabler/[email protected]", "", {}, "sha512-f2RYFl3fzPwj5WO82x6en0dmkjefxEfOm16D1ByM6cj/McNiwOkL4VaPUoP9VVIrXAD9WnTSVFr70px703b//A=="],++ "@tabler/icons-react": ["@tabler/[email protected]", "", { "dependencies": { "@tabler/icons": "3.46.0" }, "peerDependencies": { "react": ">= 16" } }, "sha512-CCm7xJWhDT2PH4ZIFkP6AgYKtVhq0gpYkjUN+GVh1AzmIQaa77OW0bQPBPQiTE0PsXMR9oSxFqA3qBglzPyrVQ=="],++ "@tailwindcss/node": ["@tailwindcss/[email protected]", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "enhanced-resolve": "^5.24.1", "jiti": "^2.7.0", "lightningcss": "1.32.0", "magic-string": "^0.30.21", "source-map-js": "^1.2.1", "tailwindcss": "4.3.3" } }, "sha512-/T8IKEsf9VTU6tLjgC7+sv2mOPtQxzE2jMw7u4Tt40Tx+QSZxpzh95/H6cMKoja9XuW7iMdLJYBB0o9G1CaAgg=="],++ "@tailwindcss/oxide": ["@tailwindcss/[email protected]", "", { "optionalDependencies": { "@tailwindcss/oxide-android-arm64": "4.3.3", "@tailwindcss/oxide-darwin-arm64": "4.3.3", "@tailwindcss/oxide-darwin-x64": "4.3.3", "@tailwindcss/oxide-freebsd-x64": "4.3.3", "@tailwindcss/oxide-linux-arm-gnueabihf": "4.3.3", "@tailwindcss/oxide-linux-arm64-gnu": "4.3.3", "@tailwindcss/oxide-linux-arm64-musl": "4.3.3", "@tailwindcss/oxide-linux-x64-gnu": "4.3.3", "@tailwindcss/oxide-linux-x64-musl": "4.3.3", "@tailwindcss/oxide-wasm32-wasi": "4.3.3", "@tailwindcss/oxide-win32-arm64-msvc": "4.3.3", "@tailwindcss/oxide-win32-x64-msvc": "4.3.3" } }, "sha512-krXjAikiaFSPaK/FkAQT5UTx3VormQaiZ5hBFlJZ9UFQGB/rwg1MZIhHAG9smMQRTdyJxP6Qt5MwMtdyU5FWrA=="],++ "@tailwindcss/oxide-android-arm64": ["@tailwindcss/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-Y85A2gmPSkl5Ve5qR86GL4HT509cFqQh1aes9p3sSkyTPwt0Pppf3GkwGe4JPACcRYjgJIEhQgM6dBClnr0NYw=="],++ "@tailwindcss/oxide-darwin-arm64": ["@tailwindcss/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-BiaWatpBcERQFDlOjRDpIVXuFK5PJez5SA4JMg6VYZdBYU+qKfV/vqjcIs+IYmtitf1xYQZTwXvU/8y4lfZUGw=="],++ "@tailwindcss/oxide-darwin-x64": ["@tailwindcss/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-fAeUqfV5ndhxRwai8cXGzdLvul9utWOmeTkv69unv4ZXixjn61Z+p9lCWdwOwA3TYboG3BwdVuN/RDjhBRl0mw=="],++ "@tailwindcss/oxide-freebsd-x64": ["@tailwindcss/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-iyf5bV6+wnAlflVeEy7R25dupxTNECZN5QMI0qNT6eT+EgaGdZcKhGkr5SdoaWiLJ3spLqIY9VCeSGrwmtg4kw=="],++ "@tailwindcss/oxide-linux-arm-gnueabihf": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-aAYUprJAJQWWbRrPvtjdroZ56Md+JM8pMiopS6xGEwDfLhqj+2ver2p4nU4Mb3CRqcMmNBjo8KkUgcxhkzVQGQ=="],++ "@tailwindcss/oxide-linux-arm64-gnu": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-nDxldcEENOxZRzC2uu9jrutZdAAQtb+8WWDCSnWL1zvBk1+FN+x6MtDViPB5AJMfttVCUhehGWus3XBPgatM/w=="],++ "@tailwindcss/oxide-linux-arm64-musl": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-Md44bD6veX/PC5iyF8cDVnw4HBIANZepRZZ7a8DQOvkfo5WUBwcp6iAuCUz23u+4SUkhJlD3eL7hNdW8ezd/kA=="],++ "@tailwindcss/oxide-linux-x64-gnu": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-tx7us1muwOKAKWao2v/GaafFeQboE6aj88vC6ziN2NCGcRm8gWUhwjzg+YdVB1e4boAtdtma4L43onunI6NS4w=="],++ "@tailwindcss/oxide-linux-x64-musl": ["@tailwindcss/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-SJxX60smvHgasZoBy11dX6YRjXJFovwWBoedhbQPOBzgFWBHGB+TVPWB9BxzR7TTxU8FQZAI2AyiNCMzFm8Img=="],++ "@tailwindcss/oxide-wasm32-wasi": ["@tailwindcss/[email protected]", "", { "dependencies": { "@emnapi/core": "^1.11.1", "@emnapi/runtime": "^1.11.1", "@emnapi/wasi-threads": "^1.2.2", "@napi-rs/wasm-runtime": "^1.1.4", "@tybys/wasm-util": "^0.10.2", "tslib": "^2.8.1" }, "cpu": "none" }, "sha512-jx1+rPhY/5Ympkktd656HBWEBLxP7dH06losBLjjf5vgCODXvi9KhtftWcMIwTFIDqBr7cRnQkdLnAG+IOlGvQ=="],++ "@tailwindcss/oxide-win32-arm64-msvc": ["@tailwindcss/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-3rc292Ca2ceK6Ulcc/bAVnTs/3nDtoPhyEKlgPv+yQJQi/JS/AMJlqzxvlDacL1nekbrcf6bTqp/jV4qgnPxNQ=="],++ "@tailwindcss/oxide-win32-x64-msvc": ["@tailwindcss/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-yJ0pwIVc/nYeGoV02WtsN8KYyLQv7kyI2wDnkezyJlGGjkd4QLwDGAwl47YpPJeuI0M0ObaXGSPjvWDPeTPggw=="],++ "@tailwindcss/vite": ["@tailwindcss/[email protected]", "", { "dependencies": { "@tailwindcss/node": "4.3.3", "@tailwindcss/oxide": "4.3.3", "tailwindcss": "4.3.3" }, "peerDependencies": { "vite": "^5.2.0 || ^6 || ^7 || ^8" } }, "sha512-yYU8cogLeSh/ms2jh8Fj7jaba/EWa7Ja6GoUqYZaraEuCI5YS6ms6ObZgjjedm+jm6XZjdNRWBpPP6Z86oOxcw=="],++ "@tanstack/devtools-event-client": ["@tanstack/[email protected]", "", { "bin": { "intent": "./bin/intent.js" } }, "sha512-6T5Yop/793YI+H+5J8Hsyj4kCih9sl4t3ElLgKioW5hk3ocn+ZdSJ94tT7vL7uabxSugWYBZlOTMPzEw2puvQw=="],++ "@tanstack/form-core": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/devtools-event-client": "^0.4.1", "@tanstack/pacer-lite": "^0.1.1", "@tanstack/store": "^0.11.0" } }, "sha512-3dfx9MBP0aq5sXKteikG629X9oviptrQj0IFRk9YGcb+lB7Kv5x8S17oOSk1wUWgjQZ4xVJEMbKwOAODymocgA=="],++ "@tanstack/history": ["@tanstack/[email protected]", "", {}, "sha512-DR9t6lfLVdrjgCwpglrR9DR7Ok8/HlXjcOE+goWXF3zyuLUO/ug7vMbSFxTqrQTtbRghJfyhmIZ0S6LhPIy44w=="],++ "@tanstack/pacer": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/devtools-event-client": "^0.4.3", "@tanstack/store": "^0.9.3" } }, "sha512-ZNQ1bIL6eUXVKdic0tiImvBVkWrg/IoSK6VIacTrO3d3HAGnd70qFJNJagR/YOJIOw4EKGWnodwpYZkN1pWuVQ=="],++ "@tanstack/pacer-lite": ["@tanstack/[email protected]", "", {}, "sha512-y/xtNPNt/YeyoVxE/JCx+T7yjEzpezmbb+toK8DDD1P4m7Kzs5YR956+7OKexG3f8aXgC3rLZl7b1V+yNUSy5w=="],++ "@tanstack/query-core": ["@tanstack/[email protected]", "", {}, "sha512-gNwcvOJcRbLWPOLG/2OBm+zM+Yv+MKsXKEOWC57USuZDEsI71hEErQsiEGx5wX9rzWWkfwM0fVSPoiIFSsxfiw=="],++ "@tanstack/react-form": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/form-core": "1.33.5", "@tanstack/react-store": "^0.11.0" }, "peerDependencies": { "@tanstack/react-start": "*", "react": "^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@tanstack/react-start"] }, "sha512-LlRB28qJwO/QCGaHvWnbdh4haBgTFiZVmzA2uzxSBS3YA7/IqrQ6HOBK70CkFQ+DbflZ7NawsmSln13h5iIdTA=="],++ "@tanstack/react-query": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/query-core": "5.101.4" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-yRg2pfOCxIs4ZJW3XYYHU/WgtD04FHSnfHlpRT7h7pR77hwkdRG4wxbKe4aq6P0RvXUTBSQpQeadS1SUYUe+KA=="],++ "@tanstack/react-router": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/history": "1.162.1", "@tanstack/react-store": "^0.9.3", "@tanstack/router-core": "1.171.22", "isbot": "^5.1.22" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-Hxl49xzd8ffWd2ZMigqfXZmpySpixWGvjq5zfh2nK2DbzzDH6IGVh+iUuwarK9MJNcnhWPZ85tOoy6o/OmNlww=="],++ "@tanstack/react-store": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/store": "0.11.1", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-HaIGKI3YLmjBYIvy5DFDY23oNaYZIsTZfngey07Uh5iLVJgM3bIGCnZeOFOqzjFld9JHWcaHJnasD/bKoGKwJQ=="],++ "@tanstack/react-virtual": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/virtual-core": "3.17.7" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-qZyr0FZDP8rDC4WBhsryIZmAd9bveJvFGUJJtskWaew6/0dTRS6wZxnR6VQ5bY2KwL3LjerrHqQLk3a0GKcPXQ=="],++ "@tanstack/router-core": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/history": "1.162.1", "cookie-es": "^3.0.0", "seroval": "^1.6.2", "seroval-plugins": "^1.6.2" } }, "sha512-sitsuRkz4qpTjIAV97S5zFCoeGv0OFd6+VWg3ZcIlQbi5R4NIXfz6ogg51n5w6rvTwSODz/lKWb5dl5tvh2bQw=="],++ "@tanstack/router-generator": ["@tanstack/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.22", "@tanstack/router-utils": "1.162.2", "@tanstack/virtual-file-routes": "1.162.0", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.5.0", "zod": "^4.4.3" } }, "sha512-AxvzdqQoBxrA8hoO1fHYg4cAUVug/xLqQhsGbNG1PelU3RbYRYEtDim7+HbYQCOqJaEuvV8tCvrTPTnT69iIwg=="],++ "@tanstack/router-plugin": ["@tanstack/[email protected]", "", { "dependencies": { "@babel/core": "^7.28.5", "@babel/template": "^7.27.2", "@babel/types": "^7.28.5", "@tanstack/router-core": "1.171.22", "@tanstack/router-generator": "1.167.28", "@tanstack/router-utils": "1.162.2", "chokidar": "^5.0.0", "unplugin": "^3.0.0", "zod": "^4.4.3" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "^1.170.26", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-Z53FeZjSddyn3c+lmUGHOU3bhZPpaFabcynja8/s87CZeyMYS7oNgUMoaYZAhVLk9cAEC/z3fkqISXqktZadDA=="],++ "@tanstack/router-utils": ["@tanstack/[email protected]", "", { "dependencies": { "@babel/generator": "^7.28.5", "@babel/parser": "^7.28.5", "@babel/types": "^7.28.5", "ansis": "^4.1.0", "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.2", "pathe": "^2.0.3", "tinyglobby": "^0.2.15" } }, "sha512-hTWqJtqIFFdvuCl8WXNyrodp2L9zo2G37xKRrcVmVRWpAB2h+U1LuRAfS4tsFTiWOIoE/B+WDVFB8JpoEdw6jQ=="],++ "@tanstack/store": ["@tanstack/[email protected]", "", {}, "sha512-mzTOBhypOuDJAy/D8n2MfUZ1HFkXnmSETviRyhqEC8LUE7/IZQExOTxMANj3KjTofYTkFNpBY67qaVrT41YccA=="],++ "@tanstack/virtual-core": ["@tanstack/[email protected]", "", {}, "sha512-bp+v10y65sp2H7WpWfIMyxTNfl8ZVfxFTLRjPIFRryi6FV/J33z4IS53WO4pTk36KlvJ4iLiQz+oaydDC1xbcA=="],++ "@tanstack/virtual-file-routes": ["@tanstack/[email protected]", "", {}, "sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA=="],++ "@testing-library/dom": ["@testing-library/[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.10.4", "@babel/runtime": "^7.12.5", "@types/aria-query": "^5.0.1", "aria-query": "5.3.0", "dom-accessibility-api": "^0.5.9", "lz-string": "^1.5.0", "picocolors": "1.1.1", "pretty-format": "^27.0.2" } }, "sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg=="],++ "@testing-library/react": ["@testing-library/[email protected]", "", { "dependencies": { "@babel/runtime": "^7.12.5" }, "peerDependencies": { "@testing-library/dom": "^10.0.0", "@types/react": "^18.0.0 || ^19.0.0", "@types/react-dom": "^18.0.0 || ^19.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react", "@types/react-dom"] }, "sha512-XU5/SytQM+ykqMnAnvB2umaJNIOsLF3PVv//1Ew4CTcpz0/BRyy/af40qqrt7SjKpDdT1saBMc42CUok5gaw+g=="],++ "@testing-library/user-event": ["@testing-library/[email protected]", "", { "peerDependencies": { "@testing-library/dom": ">=7.21.4" } }, "sha512-QCGwP6QrjypBLwyj5cuyfVamkaIEy/XGY+1VDehbtbQqOggYmTFpFOdWR5mPz14vX8vXLMVjDHlRNBcClyO9ew=="],++ "@ts-morph/common": ["@ts-morph/[email protected]", "", { "dependencies": { "fast-glob": "^3.3.3", "minimatch": "^10.0.1", "path-browserify": "^1.0.1" } }, "sha512-Wf29UqxWDpc+i61k3oIOzcUfQt79PIT9y/MWfAGlrkjg6lBC1hwDECLXPVJAhWjiGbfBCxZd65F/LIZF3+jeJQ=="],++ "@types/aria-query": ["@types/[email protected]", "", {}, "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw=="],++ "@types/babel__core": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.20.7", "@babel/types": "^7.20.7", "@types/babel__generator": "*", "@types/babel__template": "*", "@types/babel__traverse": "*" } }, "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA=="],++ "@types/babel__generator": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.0.0" } }, "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg=="],++ "@types/babel__template": ["@types/[email protected]", "", { "dependencies": { "@babel/parser": "^7.1.0", "@babel/types": "^7.0.0" } }, "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A=="],++ "@types/babel__traverse": ["@types/[email protected]", "", { "dependencies": { "@babel/types": "^7.28.2" } }, "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q=="],++ "@types/body-parser": ["@types/[email protected]", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="],++ "@types/bun": ["@types/[email protected]", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],++ "@types/connect": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="],++ "@types/d3": ["@types/[email protected]", "", { "dependencies": { "@types/d3-array": "*", "@types/d3-axis": "*", "@types/d3-brush": "*", "@types/d3-chord": "*", "@types/d3-color": "*", "@types/d3-contour": "*", "@types/d3-delaunay": "*", "@types/d3-dispatch": "*", "@types/d3-drag": "*", "@types/d3-dsv": "*", "@types/d3-ease": "*", "@types/d3-fetch": "*", "@types/d3-force": "*", "@types/d3-format": "*", "@types/d3-geo": "*", "@types/d3-hierarchy": "*", "@types/d3-interpolate": "*", "@types/d3-path": "*", "@types/d3-polygon": "*", "@types/d3-quadtree": "*", "@types/d3-random": "*", "@types/d3-scale": "*", "@types/d3-scale-chromatic": "*", "@types/d3-selection": "*", "@types/d3-shape": "*", "@types/d3-time": "*", "@types/d3-time-format": "*", "@types/d3-timer": "*", "@types/d3-transition": "*", "@types/d3-zoom": "*" } }, "sha512-lZXZ9ckh5R8uiFVt8ogUNf+pIrK4EsWrx2Np75WvF/eTpJ0FMHNhjXk8CKEx/+gpHbNQyJWehbFaTvqmHWB3ww=="],++ "@types/d3-array": ["@types/[email protected]", "", {}, "sha512-hOLWVbm7uRza0BYXpIIW5pxfrKe0W+D5lrFiAEYR+pb6w3N2SwSMaJbXdUfSEv+dT4MfHBLtn5js0LAWaO6otw=="],++ "@types/d3-axis": ["@types/[email protected]", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-pYeijfZuBd87T0hGn0FO1vQ/cgLk6E1ALJjfkC0oJ8cbwkZl3TpgS8bVBLZN+2jjGgg38epgxb2zmoGtSfvgMw=="],++ "@types/d3-brush": ["@types/[email protected]", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-nH60IZNNxEcrh6L1ZSMNA28rj27ut/2ZmI3r96Zd+1jrZD++zD3LsMIjWlvg4AYrHn/Pqz4CF3veCxGjtbqt7A=="],++ "@types/d3-chord": ["@types/[email protected]", "", {}, "sha512-LFYWWd8nwfwEmTZG9PfQxd17HbNPksHBiJHaKuY1XeqscXacsS2tyoo6OdRsjf+NQYeB6XrNL3a25E3gH69lcg=="],++ "@types/d3-color": ["@types/[email protected]", "", {}, "sha512-iO90scth9WAbmgv7ogoq57O9YpKmFBbmoEoCHDB2xMBY0+/KVrqAaCDyCE16dUspeOvIxFFRI+0sEtqDqy2b4A=="],++ "@types/d3-contour": ["@types/[email protected]", "", { "dependencies": { "@types/d3-array": "*", "@types/geojson": "*" } }, "sha512-BjzLgXGnCWjUSYGfH1cpdo41/hgdWETu4YxpezoztawmqsvCeep+8QGfiY6YbDvfgHz/DkjeIkkZVJavB4a3rg=="],++ "@types/d3-delaunay": ["@types/[email protected]", "", {}, "sha512-ZMaSKu4THYCU6sV64Lhg6qjf1orxBthaC161plr5KuPHo3CNm8DTHiLw/5Eq2b6TsNP0W0iJrUOFscY6Q450Hw=="],++ "@types/d3-dispatch": ["@types/[email protected]", "", {}, "sha512-5o9OIAdKkhN1QItV2oqaE5KMIiXAvDWBDPrD85e58Qlz1c1kI/J0NcqbEG88CoTwJrYe7ntUCVfeUl2UJKbWgA=="],++ "@types/d3-drag": ["@types/[email protected]", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-HE3jVKlzU9AaMazNufooRJ5ZpWmLIoc90A37WU2JMmeq28w1FQqCZswHZ3xR+SuxYftzHq6WU6KJHvqxKzTxxQ=="],++ "@types/d3-dsv": ["@types/[email protected]", "", {}, "sha512-n6QBF9/+XASqcKK6waudgL0pf/S5XHPPI8APyMLLUHd8NqouBGLsU8MgtO7NINGtPBtk9Kko/W4ea0oAspwh9g=="],++ "@types/d3-ease": ["@types/[email protected]", "", {}, "sha512-NcV1JjO5oDzoK26oMzbILE6HW7uVXOHLQvHshBUW4UMdZGfiY6v5BeQwh9a9tCzv+CeefZQHJt5SRgK154RtiA=="],++ "@types/d3-fetch": ["@types/[email protected]", "", { "dependencies": { "@types/d3-dsv": "*" } }, "sha512-fTAfNmxSb9SOWNB9IoG5c8Hg6R+AzUHDRlsXsDZsNp6sxAEOP0tkP3gKkNSO/qmHPoBFTxNrjDprVHDQDvo5aA=="],++ "@types/d3-force": ["@types/[email protected]", "", {}, "sha512-ZYeSaCF3p73RdOKcjj+swRlZfnYpK1EbaDiYICEEp5Q6sUiqFaFQ9qgoshp5CzIyyb/yD09kD9o2zEltCexlgw=="],++ "@types/d3-format": ["@types/[email protected]", "", {}, "sha512-fALi2aI6shfg7vM5KiR1wNJnZ7r6UuggVqtDA+xiEdPZQwy/trcQaHnwShLuLdta2rTymCNpxYTiMZX/e09F4g=="],++ "@types/d3-geo": ["@types/[email protected]", "", { "dependencies": { "@types/geojson": "*" } }, "sha512-65Emv9fQiQQqphLlRkuQ5ypPsOmWPhtBGCMv61JDPEPMvsx+gzhGf74yw1a78xFKPj6zw4AgQICJoQv0vK9M2w=="],++ "@types/d3-hierarchy": ["@types/[email protected]", "", {}, "sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg=="],++ "@types/d3-interpolate": ["@types/[email protected]", "", { "dependencies": { "@types/d3-color": "*" } }, "sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA=="],++ "@types/d3-path": ["@types/[email protected]", "", {}, "sha512-VMZBYyQvbGmWyWVea0EHs/BwLgxc+MKi1zLDCONksozI4YJMcTt8ZEuIR4Sb1MMTE8MMW49v0IwI5+b7RmfWlg=="],++ "@types/d3-polygon": ["@types/[email protected]", "", {}, "sha512-ZuWOtMaHCkN9xoeEMr1ubW2nGWsp4nIql+OPQRstu4ypeZ+zk3YKqQT0CXVe/PYqrKpZAi+J9mTs05TKwjXSRA=="],++ "@types/d3-quadtree": ["@types/[email protected]", "", {}, "sha512-oUzyO1/Zm6rsxKRHA1vH0NEDG58HrT5icx/azi9MF1TWdtttWl0UIUsjEQBBh+SIkrpd21ZjEv7ptxWys1ncsg=="],++ "@types/d3-random": ["@types/[email protected]", "", {}, "sha512-UHYId5WTCx4L4YNel7NU00XUXXgvgpgZOvp10PuvsQENjMDXhh2RyFc0KBjO7B45ne4Ha1yVH7ii0vnzKkuzWA=="],++ "@types/d3-scale": ["@types/[email protected]", "", { "dependencies": { "@types/d3-time": "*" } }, "sha512-dLmtwB8zkAeO/juAMfnV+sItKjlsw2lKdZVVy6LRr0cBmegxSABiLEpGVmSJJ8O08i4+sGR6qQtb6WtuwJdvVw=="],++ "@types/d3-scale-chromatic": ["@types/[email protected]", "", {}, "sha512-iWMJgwkK7yTRmWqRB5plb1kadXyQ5Sj8V/zYlFGMUBbIPKQScw+Dku9cAAMgJG+z5GYDoMjWGLVOvjghDEFnKQ=="],++ "@types/d3-selection": ["@types/[email protected]", "", {}, "sha512-bhAXu23DJWsrI45xafYpkQ4NtcKMwWnAC/vKrd2l+nxMFuvOT3XMYTIj2opv8vq8AO5Yh7Qac/nSeP/3zjTK0w=="],++ "@types/d3-shape": ["@types/[email protected]", "", { "dependencies": { "@types/d3-path": "*" } }, "sha512-lae0iWfcDeR7qt7rA88BNiqdvPS5pFVPpo5OfjElwNaT2yyekbM0C9vK+yqBqEmHr6lDkRnYNoTBYlAgJa7a4w=="],++ "@types/d3-time": ["@types/[email protected]", "", {}, "sha512-yuzZug1nkAAaBlBBikKZTgzCeA+k1uy4ZFwWANOfKw5z5LRhV0gNA7gNkKm7HoK+HRN0wX3EkxGk0fpbWhmB7g=="],++ "@types/d3-time-format": ["@types/[email protected]", "", {}, "sha512-5xg9rC+wWL8kdDj153qZcsJ0FWiFt0J5RB6LYUNZjwSnesfblqrI/bJ1wBdJ8OQfncgbJG5+2F+qfqnqyzYxyg=="],++ "@types/d3-timer": ["@types/[email protected]", "", {}, "sha512-Ps3T8E8dZDam6fUyNiMkekK3XUsaUEik+idO9/YjPtfj2qruF8tFBXS7XhtE4iIXBLxhmLjP3SXpLhVf21I9Lw=="],++ "@types/d3-transition": ["@types/[email protected]", "", { "dependencies": { "@types/d3-selection": "*" } }, "sha512-uZS5shfxzO3rGlu0cC3bjmMFKsXv+SmZZcgp0KD22ts4uGXp5EVYGzu/0YdwZeKmddhcAccYtREJKkPfXkZuCg=="],++ "@types/d3-zoom": ["@types/[email protected]", "", { "dependencies": { "@types/d3-interpolate": "*", "@types/d3-selection": "*" } }, "sha512-iqMC4/YlFCSlO8+2Ii1GGGliCAY4XdeG748w5vQUbevlbDu0zSjH/+jojorQVBK/se0j6DUFNPBGSqD3YWYnDw=="],++ "@types/debug": ["@types/[email protected]", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="],++ "@types/estree": ["@types/[email protected]", "", {}, "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg=="],++ "@types/estree-jsx": ["@types/[email protected]", "", { "dependencies": { "@types/estree": "*" } }, "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg=="],++ "@types/express": ["@types/[email protected]", "", { "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^5.0.0", "@types/serve-static": "^2" } }, "sha512-sKYVuV7Sv9fbPIt/442koC7+IIwK5olP1KWeD88e/idgoJqDm3JV/YUiPwkoKK92ylff2MGxSz1CSjsXelx0YA=="],++ "@types/express-serve-static-core": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-dPfW8NFiOF4wOHc7+N/QSxlY9cfSsenewGbAz8C8U/MULPd/YZ27LvJUIlzaXie7e6Ove9YunJGgC9tbHD2cKw=="],++ "@types/geojson": ["@types/[email protected]", "", {}, "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg=="],++ "@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "^2" } }, "sha512-McWspRw8xx8J9HurkVBfYj0xKoE25tOFlHGdx4MJ5xORQrMGZNqJhVQWaIbm6Oyla5kYOXtDiopzKRJzEOkwJw=="],++ "@types/http-errors": ["@types/[email protected]", "", {}, "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg=="],++ "@types/json-schema": ["@types/[email protected]", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="],++ "@types/jsonwebtoken": ["@types/[email protected]", "", { "dependencies": { "@types/ms": "*", "@types/node": "*" } }, "sha512-asx5hIG9Qmf/1oStypjanR7iKTv0gXQ1Ov/jfrX6kS/EO0OFni8orbmGCn0672NHR3kXHwpAwR+B368ZGN/2rA=="],++ "@types/katex": ["@types/[email protected]", "", {}, "sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg=="],++ "@types/mdast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA=="],++ "@types/ms": ["@types/[email protected]", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="],++ "@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-5IviulTZeRNp2vAJ514cc/HUlY5nZ9fCbq9DMyC52BrhFZACo3nI0R7qBxhQmo/d27NFe96ur/b7Wwxklda+kg=="],++ "@types/prop-types": ["@types/[email protected]", "", {}, "sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw=="],++ "@types/qs": ["@types/[email protected]", "", {}, "sha512-GZHUBZR9hckSUhrxmp1nG6NwdpM9fCunJwyThLW1X3AyHgd9IlHb6VANpQQqDr2o/qQp6McZ3y/IA2rVzKzSbw=="],++ "@types/range-parser": ["@types/[email protected]", "", {}, "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="],++ "@types/react": ["@types/[email protected]", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w=="],++ "@types/react-dom": ["@types/[email protected]", "", { "peerDependencies": { "@types/react": "^19.2.0" } }, "sha512-Bsc+QHgp+P/F02XDzNCY9jnZNCUuLki36KT7VKrTXXLdHf+vHMNZnW1rVu5DNW/rCK+fya3DATySbLM4yhtKUw=="],++ "@types/retry": ["@types/[email protected]", "", {}, "sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA=="],++ "@types/semver": ["@types/[email protected]", "", {}, "sha512-1mAINjtQCXXeLkJ9ehXkwOcBpqtLxiVtKhpUf83DdRNdQKV0iXZpaHYqRr7nj+wvxuJzoAmAwXI+sCNMv1CzLQ=="],++ "@types/send": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-arsCikDvlU99zl1g69TcAB3mzZPpxgw0UQnaHeC1Nwb015xp8bknZv5rIfri9xTOcMuaVgvabfIRA7PSZVuZIQ=="],++ "@types/serve-static": ["@types/[email protected]", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*" } }, "sha512-8mam4H1NHLtu7nmtalF7eyBH14QyOASmcxHhSfEoRyr0nP/YdoesEtU+uSRvMe96TW/HPTtkoKqQLl53N7UXMQ=="],++ "@types/trusted-types": ["@types/[email protected]", "", {}, "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw=="],++ "@types/unist": ["@types/[email protected]", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="],++ "@types/uuid": ["@types/[email protected]", "", {}, "sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ=="],++ "@types/validate-npm-package-name": ["@types/[email protected]", "", {}, "sha512-lrpDziQipxCEeK5kWxvljWYhUvOiB2A9izZd9B2AFarYAkqZshb4lPbRs7zKEic6eGtH8V/2qJW+dPp9OtF6bw=="],++ "@types/validator": ["@types/[email protected]", "", {}, "sha512-T8L6i7wCuyoK8A/ZeLYt1+q0ty3Zb9+qbSSvrIVitzT3YjZqkTZ40IbRsPanlB4h1QB3JVL1SYCdR6ngtFYcuA=="],++ "@types/whatwg-mimetype": ["@types/[email protected]", "", {}, "sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA=="],++ "@types/ws": ["@types/[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg=="],++ "@typespec/ts-http-runtime": ["@typespec/[email protected]", "", { "dependencies": { "http-proxy-agent": "^7.0.0", "https-proxy-agent": "^7.0.0", "tslib": "^2.6.2" } }, "sha512-bLMpVcWZNzq6lYOybwFwOAR1IXKcHnhUNqYeHjl1bET/qE3jFPFH+p8Wrh3rU4xwdnifPxmKNESBYnvnmc75aA=="],++ "@ungap/structured-clone": ["@ungap/[email protected]", "", {}, "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg=="],++ "@upsetjs/venn.js": ["@upsetjs/[email protected]", "", { "optionalDependencies": { "d3-selection": "^3.0.0", "d3-transition": "^3.0.1" } }, "sha512-WbBhLrooyePuQ1VZxrJjtLvTc4NVfpOyKx0sKqioq9bX1C1m7Jgykkn8gLrtwumBioXIqam8DLxp88Adbue6Hw=="],++ "@urql/core": ["@urql/[email protected]", "", { "dependencies": { "@0no-co/graphql.web": "^1.0.13", "wonka": "^6.3.2" } }, "sha512-/n0ieD0mvvDnVAXEQgX/7qJiVcvYvNkOHeBvkwtylfjydar123caCXcl58PXFY11oU1oquJocVXHxLAbtv4x1A=="],++ "@vercel/oidc": ["@vercel/[email protected]", "", {}, "sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug=="],++ "@vitejs/plugin-react": ["@vitejs/[email protected]", "", { "dependencies": { "@babel/core": "^7.29.0", "@babel/plugin-transform-react-jsx-self": "^7.27.1", "@babel/plugin-transform-react-jsx-source": "^7.27.1", "@rolldown/pluginutils": "1.0.0-rc.3", "@types/babel__core": "^7.20.5", "react-refresh": "^0.18.0" }, "peerDependencies": { "vite": "^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-YmKkfhOAi3wsB1PhJq5Scj3GXMn3WvtQ/JC0xoopuHoXSdmtdStOpFrYaT1kie2YgFBcIe64ROzMYRjCrYOdYw=="],++ "@whatwg-node/disposablestack": ["@whatwg-node/[email protected]", "", { "dependencies": { "@whatwg-node/promise-helpers": "^1.0.0", "tslib": "^2.6.3" } }, "sha512-LOtTn+JgJvX8WfBVJtF08TGrdjuFzGJc4mkP8EdDI8ADbvO7kiexYep1o8dwnt0okb0jYclCDXF13xU7Ge4zSw=="],++ "@whatwg-node/events": ["@whatwg-node/[email protected]", "", { "dependencies": { "tslib": "^2.6.3" } }, "sha512-ApcWxkrs1WmEMS2CaLLFUEem/49erT3sxIVjpzU5f6zmVcnijtDSrhoK2zVobOIikZJdH63jdAXOrvjf6eOUNQ=="],++ "@whatwg-node/fetch": ["@whatwg-node/[email protected]", "", { "dependencies": { "@whatwg-node/node-fetch": "^0.8.3", "urlpattern-polyfill": "^10.0.0" } }, "sha512-b4PhJ+zYj4357zwk4TTuF2nEe0vVtOrwdsrNo5hL+u1ojXNhh1FgJ6pg1jzDlwlT4oBdzfSwaBwMCtFCsIWg8Q=="],++ "@whatwg-node/node-fetch": ["@whatwg-node/[email protected]", "", { "dependencies": { "@fastify/busboy": "^3.1.1", "@whatwg-node/disposablestack": "^0.0.6", "@whatwg-node/promise-helpers": "^1.3.2", "tslib": "^2.6.3" } }, "sha512-BDMdYFcerLQkwA2RTldxOqRCs6ZQD1S7UgP3pUdGUkcbgTrP/V5ko77ZkCww9DHmC4lpoYuwigGfQYj285gMvA=="],++ "@whatwg-node/promise-helpers": ["@whatwg-node/[email protected]", "", { "dependencies": { "tslib": "^2.6.3" } }, "sha512-Nst5JdK47VIl9UcGwtv2Rcgyn5lWtZ0/mhRQ4G8NN2isxpq2TO30iqHzmwoJycjWuyUfg3GFXqP/gFHXeV57IA=="],++ "@whatwg-node/server": ["@whatwg-node/[email protected]", "", { "dependencies": { "@envelop/instrumentation": "^1.0.0", "@whatwg-node/disposablestack": "^0.0.6", "@whatwg-node/fetch": "^0.10.13", "@whatwg-node/promise-helpers": "^1.3.2", "tslib": "^2.6.3" } }, "sha512-VSdkwnJRr8Yv9UgB2aXB3VUPWwd6Oqnn0hycFwhg9pZgWxJXb7JmhsiXe9tmpMwjHFxli12PGcz9aI63YYloGQ=="],++ "abort-controller": ["[email protected]", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg=="],++ "accepts": ["[email protected]", "", { "dependencies": { "mime-types": "~2.1.34", "negotiator": "0.6.3" } }, "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw=="],++ "agent-base": ["[email protected]", "", {}, "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ=="],++ "ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "3.0.172", "@ai-sdk/provider": "3.0.15", "@ai-sdk/provider-utils": "4.0.45", "@opentelemetry/api": "^1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-NNwp47xpD4c47NB0ad+MP8HL66f8g6l0JwZ2UdHR6PpBPk9WACEq1k7md3r0GVR6skqAU/Slt5Hk9mJYQwJkvA=="],++ "ajv": ["[email protected]", "", { "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", "json-schema-traverse": "^1.0.0", "require-from-string": "^2.0.2" } }, "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA=="],++ "ajv-formats": ["[email protected]", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ=="],++ "ansi-colors": ["[email protected]", "", {}, "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw=="],++ "ansi-regex": ["[email protected]", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="],++ "ansi-styles": ["[email protected]", "", {}, "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA=="],++ "ansis": ["[email protected]", "", {}, "sha512-BJ8/l4R5LRE7hW9WdSuGYrLSHi2ynxeFpDFbH0K/CgNeY/tyhk+vO6TYxXC5r5CpUhNVX310xzPsN/H9lCdfOA=="],++ "app": ["app@workspace:app"],++ "argparse": ["[email protected]", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="],++ "aria-hidden": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.0" } }, "sha512-ik3ZgC9dY/lYVVM++OISsaYDeg1tb0VtP5uL3ouh1koGOaUMDPpbFIei4JkFimWUFPn90sbMNMXQAIVOlnYKJA=="],++ "aria-query": ["[email protected]", "", { "dependencies": { "dequal": "^2.0.3" } }, "sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A=="],++ "array-flatten": ["[email protected]", "", {}, "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg=="],++ "ast-types": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.1" } }, "sha512-6t10qk83GOG8p0vKmaCr8eiilZwO171AvbROMtvvNiwrTly62t+7XkA8RdIIVbpMhCASAsxgAzdRSwh6nw/5Dg=="],++ "asynckit": ["[email protected]", "", {}, "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="],++ "atomic-sleep": ["[email protected]", "", {}, "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="],++ "atomically": ["[email protected]", "", {}, "sha512-Xcz9l0z7y9yQ9rdDaxlmaI4uJHf/T8g9hOEzJcsEqX2SjCj4J20uK7+ldkDHMbpJDK76wF7xEIgxc/vSlsfw5w=="],++ "axios": ["[email protected]", "", { "dependencies": { "follow-redirects": "^1.16.0", "form-data": "^4.0.6", "https-proxy-agent": "^5.0.1", "proxy-from-env": "^2.1.0" } }, "sha512-ht/iuYZXEjFxLH/Hkezgd7m6JKlHHXEUSneaDz8uZe1Gj5QZtCnpyDsckvAiEnT89OEbCLmnte4R4sn7P0EKFw=="],++ "babel-dead-code-elimination": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig=="],++ "bail": ["[email protected]", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="],++ "balanced-match": ["[email protected]", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],++ "base64-js": ["[email protected]", "", {}, "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA=="],++ "baseline-browser-mapping": ["[email protected]", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-k9HNuUVMlqVjQ9UHzfPjIqiDbWw7WqT1AoT7GL8VwvF3r0ZfArtgiSPAlmupyNquNgOJHTuH4CKYf8ttMTWBTQ=="],++ "better-auth": ["[email protected]", "", { "dependencies": { "@better-auth/core": "1.6.27", "@better-auth/drizzle-adapter": "1.6.27", "@better-auth/kysely-adapter": "1.6.27", "@better-auth/memory-adapter": "1.6.27", "@better-auth/mongo-adapter": "1.6.27", "@better-auth/prisma-adapter": "1.6.27", "@better-auth/telemetry": "1.6.27", "@better-auth/utils": "0.4.2", "@better-fetch/fetch": "1.3.1", "@noble/ciphers": "^2.1.1", "@noble/hashes": "^2.0.1", "better-call": "1.4.0", "defu": "^6.1.4", "jose": "^6.1.3", "kysely": "^0.28.17 || ^0.29.0", "nanostores": "^1.1.1", "zod": "^4.3.6" }, "peerDependencies": { "@lynx-js/react": "*", "@prisma/client": "^5.0.0 || ^6.0.0 || ^7.0.0", "@sveltejs/kit": "^2.0.0", "@tanstack/react-start": "^1.0.0", "@tanstack/solid-start": "^1.0.0", "better-sqlite3": "^12.0.0", "drizzle-kit": ">=0.31.4", "drizzle-orm": "^0.45.2", "mongodb": "^6.0.0 || ^7.0.0", "mysql2": "^3.0.0", "next": "^14.0.0 || ^15.0.0 || ^16.0.0", "pg": "^8.0.0", "prisma": "^5.0.0 || ^6.0.0 || ^7.0.0", "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0", "solid-js": "^1.0.0", "svelte": "^4.0.0 || ^5.0.0", "vitest": "^2.0.0 || ^3.0.0 || ^4.0.0", "vue": "^3.0.0" }, "optionalPeers": ["@lynx-js/react", "@prisma/client", "@sveltejs/kit", "@tanstack/react-start", "@tanstack/solid-start", "better-sqlite3", "drizzle-kit", "drizzle-orm", "mongodb", "mysql2", "next", "pg", "prisma", "react", "react-dom", "solid-js", "svelte", "vitest", "vue"] }, "sha512-x3jyxpAiBSsMO/DaXMFSVwM8bTqnYZlCKsZxBV43zL3ZtsGa/CzeUuNKxPT2Lsz7ahTBY90Ku1tibN6nRpVEbw=="],++ "better-call": ["[email protected]", "", { "dependencies": { "@better-auth/utils": "^0.5.0", "@better-fetch/fetch": "^1.3.1", "rou3": "^0.9.1", "set-cookie-parser": "^3.1.2" }, "peerDependencies": { "zod": "^4.0.0" }, "optionalPeers": ["zod"] }, "sha512-bBKOT4vv1kZLDgxVePdilk/Jwkn+dtRRsmi3DzHcDP+WnswyVl6dR59l2HEeP/0cB+bDoopASAesWDPIdd/zZA=="],++ "bignumber.js": ["[email protected]", "", {}, "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ=="],++ "body-parser": ["[email protected]", "", { "dependencies": { "bytes": "~3.1.2", "content-type": "~1.0.5", "debug": "2.6.9", "depd": "2.0.0", "destroy": "~1.2.0", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "on-finished": "~2.4.1", "qs": "~6.15.1", "raw-body": "~2.5.3", "type-is": "~1.6.18", "unpipe": "~1.0.0" } }, "sha512-p5tAzS57i5MV9fZFDj9LeIiTZEufbSe2eDozP+ElheSUq1m74CRq1jI4mYNDdVs9vQztXFLuk/Gd6BWTdwRJ5g=="],++ "boring-avatars": ["[email protected]", "", { "peerDependencies": { "react": ">=18.0.0", "react-dom": ">=18.0.0" } }, "sha512-xhZO/w/6aFmRfkaWohcl2NfyIy87gK5SBbys8kctZeTGF1Apjpv/10pfUuv+YEfVPkESU/h2Y6tt/Dwp+bIZPw=="],++ "brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^4.0.2" } }, "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg=="],++ "braces": ["[email protected]", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="],++ "browserslist": ["[email protected]", "", { "dependencies": { "baseline-browser-mapping": "^2.11.12", "caniuse-lite": "^1.0.30001809", "electron-to-chromium": "^1.5.402", "node-releases": "^2.0.53", "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA=="],++ "buffer": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" } }, "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA=="],++ "buffer-equal-constant-time": ["[email protected]", "", {}, "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA=="],++ "buffer-from": ["[email protected]", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="],++ "buffer-image-size": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="],++ "bun-types": ["[email protected]", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],++ "bundle-name": ["[email protected]", "", { "dependencies": { "run-applescript": "^7.0.0" } }, "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q=="],++ "bytes": ["[email protected]", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="],++ "call-bind-apply-helpers": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],++ "call-bound": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="],++ "callsites": ["[email protected]", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="],++ "caniuse-lite": ["[email protected]", "", {}, "sha512-xxWVywk6a6Arlk+hymeycyn/VgqEfLDxupvhH/xiY5SJ/18kmi9o6MiO320DCUzypORHLtvh0I4i04tUhCNHNQ=="],++ "ccount": ["[email protected]", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="],++ "cel-js": ["[email protected]", "", { "dependencies": { "chevrotain": "11.0.3", "ramda": "0.30.1" } }, "sha512-fPk7V5wcjp6GQ2CqkQKbfaIGQ5rQIm8xOueVqbp9MPfviqZEBOReBF82iZa0oHUm449UTsj1LAzUIAsI356ong=="],++ "chalk": ["[email protected]", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="],++ "character-entities": ["[email protected]", "", {}, "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ=="],++ "character-entities-html4": ["[email protected]", "", {}, "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA=="],++ "character-entities-legacy": ["[email protected]", "", {}, "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ=="],++ "character-reference-invalid": ["[email protected]", "", {}, "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw=="],++ "chevrotain": ["[email protected]", "", { "dependencies": { "@chevrotain/cst-dts-gen": "11.0.3", "@chevrotain/gast": "11.0.3", "@chevrotain/regexp-to-ast": "11.0.3", "@chevrotain/types": "11.0.3", "@chevrotain/utils": "11.0.3", "lodash-es": "4.17.21" } }, "sha512-ci2iJH6LeIkvP9eJW6gpueU8cnZhv85ELY8w8WiFtNjMHA5ad6pQLaJo9mEly/9qUyCpvqX8/POVUTf18/HFdw=="],++ "chokidar": ["[email protected]", "", { "dependencies": { "readdirp": "^5.0.0" } }, "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw=="],++ "clarinet": ["[email protected]", "", {}, "sha512-0FR+TrvLbYHLjhzs9oeIbd3yfZmd4u2DzYQEjUTm2dNfh4Y/9RIRWPjsm3aBtrVEpjKI7+lWa4ouqEXoml84mQ=="],++ "class-transformer": ["[email protected]", "", {}, "sha512-SQa1Ws6hUbfC98vKGxZH3KFY0Y1lm5Zm0SY8XX9zbK7FJCyVEac3ATW0RIpwzW+oOfmHE5PMPufDG9hCfoEOMw=="],++ "class-validator": ["[email protected]", "", { "dependencies": { "@types/validator": "^13.15.3", "libphonenumber-js": "^1.11.1", "validator": "^13.15.22" } }, "sha512-AwNusCCam51q703dW82x95tOqQp6oC9HNUl724KxJJOfnKscI8dOloXFgyez7LbTTKWuRBA37FScqVbJEoq8Yw=="],++ "class-variance-authority": ["[email protected]", "", { "dependencies": { "clsx": "^2.1.1" } }, "sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg=="],++ "cli-cursor": ["[email protected]", "", { "dependencies": { "restore-cursor": "^5.0.0" } }, "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw=="],++ "cli-spinners": ["[email protected]", "", {}, "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg=="],++ "clsx": ["[email protected]", "", {}, "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA=="],++ "code-block-writer": ["[email protected]", "", {}, "sha512-Oofo0pq3IKnsFtuHqSF7TqBfr71aeyZDVJ0HpmqB7FBM2qEigL0iPONSCZSO9pE9dZTAxANe5XHG9Uy0YMv8cg=="],++ "color-convert": ["[email protected]", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="],++ "color-name": ["[email protected]", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="],++ "colorette": ["[email protected]", "", {}, "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w=="],++ "combined-stream": ["[email protected]", "", { "dependencies": { "delayed-stream": "~1.0.0" } }, "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg=="],++ "comma-separated-tokens": ["[email protected]", "", {}, "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg=="],++ "commander": ["[email protected]", "", {}, "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw=="],++ "compare-versions": ["[email protected]", "", {}, "sha512-4hm4VPpIecmlg59CHXnRDnqGplJFrbLG4aFEl5vl6cK1u76ws3LLvX7ikFnTDl5vo39sjWD6AaDPYodJp/NNHg=="],++ "conf": ["[email protected]", "", { "dependencies": { "ajv": "^8.6.3", "ajv-formats": "^2.1.1", "atomically": "^1.7.0", "debounce-fn": "^4.0.0", "dot-prop": "^6.0.1", "env-paths": "^2.2.1", "json-schema-typed": "^7.0.3", "onetime": "^5.1.2", "pkg-up": "^3.1.0", "semver": "^7.3.5" } }, "sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg=="],++ "content-disposition": ["[email protected]", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ=="],++ "content-type": ["[email protected]", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="],++ "convert-source-map": ["[email protected]", "", {}, "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg=="],++ "cookie": ["[email protected]", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="],++ "cookie-es": ["[email protected]", "", {}, "sha512-UaXxwISYJPTr9hwQxMFYZ7kNhSXboMXP+Z3TRX6f1/NyaGPfuNUZOWP1pUEb75B2HjfklIYLVRfWiFZJyC6Npg=="],++ "cookie-signature": ["[email protected]", "", {}, "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA=="],++ "cors": ["[email protected]", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw=="],++ "cose-base": ["[email protected]", "", { "dependencies": { "layout-base": "^1.0.0" } }, "sha512-s9whTXInMSgAp/NVXVNuVxVKzGH2qck3aQlVHxDCdAEPgtMKwc4Wq6/QKhgdEdgbLSi9rBTAcPoRa6JpiG4ksg=="],++ "cosmiconfig": ["[email protected]", "", { "dependencies": { "env-paths": "^2.2.1", "import-fresh": "^3.3.0", "js-yaml": "^4.1.0", "parse-json": "^5.2.0" }, "peerDependencies": { "typescript": ">=4.9.5" }, "optionalPeers": ["typescript"] }, "sha512-gtTZxTDau1wL7Y7zifc2dd8jHSK/k6BTx/2Xp/BpdlAdnlYWFVt7qhJqgwi7637yRwRQ3qL4ZidbB4I8tA5VOg=="],++ "cross-inspect": ["[email protected]", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-Pcw1JTvZLSJH83iiGWt6fRcT+BjZlCDRVwYLbUcHzv/CRpB7r0MlSrGbIyQvVSNyGnbt7G4AXuyCiDR3POvZ1A=="],++ "cross-spawn": ["[email protected]", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="],++ "cssesc": ["[email protected]", "", { "bin": { "cssesc": "bin/cssesc" } }, "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg=="],++ "csstype": ["[email protected]", "", {}, "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ=="],++ "cytoscape": ["[email protected]", "", {}, "sha512-Lr0RvH9H75y9ar8h9Toy6u4lxRSCcxUq+hHcQ26sVWo6BnaQp1gwEZOYqwuYTZhyW7npyKnNLP8oJ2p1/3OZ7g=="],++ "cytoscape-cose-bilkent": ["[email protected]", "", { "dependencies": { "cose-base": "^1.0.0" }, "peerDependencies": { "cytoscape": "^3.2.0" } }, "sha512-wgQlVIUJF13Quxiv5e1gstZ08rnZj2XaLHGoFMYXz7SkNfCDOOteKBE6SYRfA9WxxI/iBc3ajfDoc6hb/MRAHQ=="],++ "cytoscape-fcose": ["[email protected]", "", { "dependencies": { "cose-base": "^2.2.0" }, "peerDependencies": { "cytoscape": "^3.2.0" } }, "sha512-ki1/VuRIHFCzxWNrsshHYPs6L7TvLu3DL+TyIGEsRcvVERmxokbf5Gdk7mFxZnTdiGtnA4cfSmjZJMviqSuZrQ=="],++ "d3": ["[email protected]", "", { "dependencies": { "d3-array": "3", "d3-axis": "3", "d3-brush": "3", "d3-chord": "3", "d3-color": "3", "d3-contour": "4", "d3-delaunay": "6", "d3-dispatch": "3", "d3-drag": "3", "d3-dsv": "3", "d3-ease": "3", "d3-fetch": "3", "d3-force": "3", "d3-format": "3", "d3-geo": "3", "d3-hierarchy": "3", "d3-interpolate": "3", "d3-path": "3", "d3-polygon": "3", "d3-quadtree": "3", "d3-random": "3", "d3-scale": "4", "d3-scale-chromatic": "3", "d3-selection": "3", "d3-shape": "3", "d3-time": "3", "d3-time-format": "4", "d3-timer": "3", "d3-transition": "3", "d3-zoom": "3" } }, "sha512-e1U46jVP+w7Iut8Jt8ri1YsPOvFpg46k+K8TpCb0P+zjCkjkPnV7WzfDJzMHy1LnA+wj5pLT1wjO901gLXeEhA=="],++ "d3-array": ["[email protected]", "", { "dependencies": { "internmap": "1 - 2" } }, "sha512-tdQAmyA18i4J7wprpYq8ClcxZy3SC31QMeByyCFyRt7BVHdREQZ5lpzoe5mFEYZUWe+oq8HBvk9JjpibyEV4Jg=="],++ "d3-axis": ["[email protected]", "", {}, "sha512-IH5tgjV4jE/GhHkRV0HiVYPDtvfjHQlQfJHs0usq7M30XcSBvOotpmH1IgkcXsO/5gEQZD43B//fc7SRT5S+xw=="],++ "d3-brush": ["[email protected]", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", "d3-interpolate": "1 - 3", "d3-selection": "3", "d3-transition": "3" } }, "sha512-ALnjWlVYkXsVIGlOsuWH1+3udkYFI48Ljihfnh8FZPF2QS9o+PzGLBslO0PjzVoHLZ2KCVgAM8NVkXPJB2aNnQ=="],++ "d3-chord": ["[email protected]", "", { "dependencies": { "d3-path": "1 - 3" } }, "sha512-VE5S6TNa+j8msksl7HwjxMHDM2yNK3XCkusIlpX5kwauBfXuyLAtNg9jCp/iHH61tgI4sb6R/EIMWCqEIdjT/g=="],++ "d3-color": ["[email protected]", "", {}, "sha512-zg/chbXyeBtMQ1LbD/WSoW2DpC3I0mpmPdW+ynRTj/x2DAWYrIY7qeZIHidozwV24m4iavr15lNwIwLxRmOxhA=="],++ "d3-contour": ["[email protected]", "", { "dependencies": { "d3-array": "^3.2.0" } }, "sha512-4EzFTRIikzs47RGmdxbeUvLWtGedDUNkTcmzoeyg4sP/dvCexO47AaQL7VKy/gul85TOxw+IBgA8US2xwbToNA=="],++ "d3-delaunay": ["[email protected]", "", { "dependencies": { "delaunator": "5" } }, "sha512-mdjtIZ1XLAM8bm/hx3WwjfHt6Sggek7qH043O8KEjDXN40xi3vx/6pYSVTwLjEgiXQTbvaouWKynLBiUZ6SK6A=="],++ "d3-dispatch": ["[email protected]", "", {}, "sha512-rzUyPU/S7rwUflMyLc1ETDeBj0NRuHKKAcvukozwhshr6g6c5d8zh4c2gQjY2bZ0dXeGLWc1PF174P2tVvKhfg=="],++ "d3-drag": ["[email protected]", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-selection": "3" } }, "sha512-pWbUJLdETVA8lQNJecMxoXfH6x+mO2UQo8rSmZ+QqxcbyA3hfeprFgIT//HW2nlHChWeIIMwS2Fq+gEARkhTkg=="],++ "d3-dsv": ["[email protected]", "", { "dependencies": { "commander": "7", "iconv-lite": "0.6", "rw": "1" }, "bin": { "csv2json": "bin/dsv2json.js", "csv2tsv": "bin/dsv2dsv.js", "dsv2dsv": "bin/dsv2dsv.js", "dsv2json": "bin/dsv2json.js", "json2csv": "bin/json2dsv.js", "json2dsv": "bin/json2dsv.js", "json2tsv": "bin/json2dsv.js", "tsv2csv": "bin/dsv2dsv.js", "tsv2json": "bin/dsv2json.js" } }, "sha512-UG6OvdI5afDIFP9w4G0mNq50dSOsXHJaRE8arAS5o9ApWnIElp8GZw1Dun8vP8OyHOZ/QJUKUJwxiiCCnUwm+Q=="],++ "d3-ease": ["[email protected]", "", {}, "sha512-wR/XK3D3XcLIZwpbvQwQ5fK+8Ykds1ip7A2Txe0yxncXSdq1L9skcG7blcedkOX+ZcgxGAmLX1FrRGbADwzi0w=="],++ "d3-fetch": ["[email protected]", "", { "dependencies": { "d3-dsv": "1 - 3" } }, "sha512-kpkQIM20n3oLVBKGg6oHrUchHM3xODkTzjMoj7aWQFq5QEM+R6E4WkzT5+tojDY7yjez8KgCBRoj4aEr99Fdqw=="],++ "d3-force": ["[email protected]", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-quadtree": "1 - 3", "d3-timer": "1 - 3" } }, "sha512-zxV/SsA+U4yte8051P4ECydjD/S+qeYtnaIyAs9tgHCqfguma/aAQDjo85A9Z6EKhBirHRJHXIgJUlffT4wdLg=="],++ "d3-format": ["[email protected]", "", {}, "sha512-AJDdYOdnyRDV5b6ArilzCPPwc1ejkHcoyFarqlPqT7zRYjhavcT3uSrqcMvsgh2CgoPbK3RCwyHaVyxYcP2Arg=="],++ "d3-geo": ["[email protected]", "", { "dependencies": { "d3-array": "2.5.0 - 3" } }, "sha512-637ln3gXKXOwhalDzinUgY83KzNWZRKbYubaG+fGVuc/dxO64RRljtCTnf5ecMyE1RIdtqpkVcq0IbtU2S8j2Q=="],++ "d3-hierarchy": ["[email protected]", "", {}, "sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA=="],++ "d3-interpolate": ["[email protected]", "", { "dependencies": { "d3-color": "1 - 3" } }, "sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g=="],++ "d3-path": ["[email protected]", "", {}, "sha512-p3KP5HCf/bvjBSSKuXid6Zqijx7wIfNW+J/maPs+iwR35at5JCbLUT0LzF1cnjbCHWhqzQTIN2Jpe8pRebIEFQ=="],++ "d3-polygon": ["[email protected]", "", {}, "sha512-3vbA7vXYwfe1SYhED++fPUQlWSYTTGmFmQiany/gdbiWgU/iEyQzyymwL9SkJjFFuCS4902BSzewVGsHHmHtXg=="],++ "d3-quadtree": ["[email protected]", "", {}, "sha512-04xDrxQTDTCFwP5H6hRhsRcb9xxv2RzkcsygFzmkSIOJy3PeRJP7sNk3VRIbKXcog561P9oU0/rVH6vDROAgUw=="],++ "d3-random": ["[email protected]", "", {}, "sha512-FXMe9GfxTxqd5D6jFsQ+DJ8BJS4E/fT5mqqdjovykEB2oFbTMDVdg1MGFxfQW+FBOGoB++k8swBrgwSHT1cUXQ=="],++ "d3-sankey": ["[email protected]", "", { "dependencies": { "d3-array": "1 - 2", "d3-shape": "^1.2.0" } }, "sha512-nQhsBRmM19Ax5xEIPLMY9ZmJ/cDvd1BG3UVvt5h3WRxKg5zGRbvnteTyWAbzeSvlh3tW7ZEmq4VwR5mB3tutmQ=="],++ "d3-scale": ["[email protected]", "", { "dependencies": { "d3-array": "2.10.0 - 3", "d3-format": "1 - 3", "d3-interpolate": "1.2.0 - 3", "d3-time": "2.1.1 - 3", "d3-time-format": "2 - 4" } }, "sha512-GZW464g1SH7ag3Y7hXjf8RoUuAFIqklOAq3MRl4OaWabTFJY9PN/E1YklhXLh+OQ3fM9yS2nOkCoS+WLZ6kvxQ=="],++ "d3-scale-chromatic": ["[email protected]", "", { "dependencies": { "d3-color": "1 - 3", "d3-interpolate": "1 - 3" } }, "sha512-A3s5PWiZ9YCXFye1o246KoscMWqf8BsD9eRiJ3He7C9OBaxKhAd5TFCdEx/7VbKtxxTsu//1mMJFrEt572cEyQ=="],++ "d3-selection": ["[email protected]", "", {}, "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ=="],++ "d3-shape": ["[email protected]", "", { "dependencies": { "d3-path": "^3.1.0" } }, "sha512-SaLBuwGm3MOViRq2ABk3eLoxwZELpH6zhl3FbAoJ7Vm1gofKx6El1Ib5z23NUEhF9AsGl7y+dzLe5Cw2AArGTA=="],++ "d3-time": ["[email protected]", "", { "dependencies": { "d3-array": "2 - 3" } }, "sha512-VqKjzBLejbSMT4IgbmVgDjpkYrNWUYJnbCGo874u7MMKIWsILRX+OpX/gTk8MqjpT1A/c6HY2dCA77ZN0lkQ2Q=="],++ "d3-time-format": ["[email protected]", "", { "dependencies": { "d3-time": "1 - 3" } }, "sha512-dJxPBlzC7NugB2PDLwo9Q8JiTR3M3e4/XANkreKSUxF8vvXKqm1Yfq4Q5dl8budlunRVlUUaDUgFt7eA8D6NLg=="],++ "d3-timer": ["[email protected]", "", {}, "sha512-ndfJ/JxxMd3nw31uyKoY2naivF+r29V+Lc0svZxe1JvvIRmi8hUsrMvdOwgS1o6uBHmiz91geQ0ylPP0aj1VUA=="],++ "d3-transition": ["[email protected]", "", { "dependencies": { "d3-color": "1 - 3", "d3-dispatch": "1 - 3", "d3-ease": "1 - 3", "d3-interpolate": "1 - 3", "d3-timer": "1 - 3" }, "peerDependencies": { "d3-selection": "2 - 3" } }, "sha512-ApKvfjsSR6tg06xrL434C0WydLr7JewBB3V+/39RMHsaXTOG0zmt/OAXeng5M5LBm0ojmxJrpomQVZ1aPvBL4w=="],++ "d3-zoom": ["[email protected]", "", { "dependencies": { "d3-dispatch": "1 - 3", "d3-drag": "2 - 3", "d3-interpolate": "1 - 3", "d3-selection": "2 - 3", "d3-transition": "2 - 3" } }, "sha512-b8AmV3kfQaqWAuacbPuNbL6vahnOJflOhexLzMMNLga62+/nh0JzvJ0aO/5a5MVgUFGS7Hu1P9P03o3fJkDCyw=="],++ "dagre-d3-es": ["[email protected]", "", { "dependencies": { "d3": "^7.9.0", "lodash-es": "^4.17.21" } }, "sha512-P4rFMVq9ESWqmOgK+dlXvOtLwYg0i7u0HBGJER0LZDJT2VHIPAMZ/riPxqJceWMStH5+E61QxFra9kIS3AqdMg=="],++ "data-uri-to-buffer": ["[email protected]", "", {}, "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A=="],++ "date-fns": ["[email protected]", "", {}, "sha512-+1UMbeh68lH1SegH83CGWwpb6OHHbpSgr3+s5Eww5M4CAgswBpoWS0AjTOfEJ33HiYKz1hdj/KTFprzXHmq/6w=="],++ "dateformat": ["[email protected]", "", {}, "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA=="],++ "dayjs": ["[email protected]", "", {}, "sha512-98IT+HOahAisibz/yjKbzuOBwYcjJ7BCLPzARyHiyEBmRz4fatF+KPJszEHXsGYjUG234aH/cOjW1wwTbKUZlA=="],++ "debounce-fn": ["[email protected]", "", { "dependencies": { "mimic-fn": "^3.0.0" } }, "sha512-8pYCQiL9Xdcg0UPSD3d+0KMlOjp+KGU5EPwYddgzQ7DATsg4fuUDjQtsYLmWjnk2obnNHgV3vE2Y4jejSOJVBQ=="],++ "debug": ["[email protected]", "", { "dependencies": { "ms": "^2.1.3" }, "peerDependencies": { "supports-color": "*" }, "optionalPeers": ["supports-color"] }, "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA=="],++ "decode-named-character-reference": ["[email protected]", "", { "dependencies": { "character-entities": "^2.0.0" } }, "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q=="],++ "dedent": ["[email protected]", "", { "peerDependencies": { "babel-plugin-macros": "^3.1.0" }, "optionalPeers": ["babel-plugin-macros"] }, "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA=="],++ "deepmerge": ["[email protected]", "", {}, "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A=="],++ "default-browser": ["[email protected]", "", { "dependencies": { "bundle-name": "^4.1.0", "default-browser-id": "^5.0.0" } }, "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw=="],++ "default-browser-id": ["[email protected]", "", {}, "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q=="],++ "define-lazy-prop": ["[email protected]", "", {}, "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg=="],++ "defu": ["[email protected]", "", {}, "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ=="],++ "delaunator": ["[email protected]", "", { "dependencies": { "robust-predicates": "^3.0.2" } }, "sha512-AGrQ4QSgssa1NGmWmLPqN5NY2KajF5MqxetNEO+o0n3ZwZZeTmt7bBnvzHWrmkZFxGgr4HdyFgelzgi06otLuQ=="],++ "delayed-stream": ["[email protected]", "", {}, "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ=="],++ "depd": ["[email protected]", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="],++ "dequal": ["[email protected]", "", {}, "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA=="],++ "destroy": ["[email protected]", "", {}, "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="],++ "detect-libc": ["[email protected]", "", {}, "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ=="],++ "detect-node-es": ["[email protected]", "", {}, "sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ=="],++ "devlop": ["[email protected]", "", { "dependencies": { "dequal": "^2.0.0" } }, "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA=="],++ "diff": ["[email protected]", "", {}, "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw=="],++ "dom-accessibility-api": ["[email protected]", "", {}, "sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg=="],++ "dompurify": ["[email protected]", "", { "optionalDependencies": { "@types/trusted-types": "^2.0.7" } }, "sha512-2vmYIoqjze2d+kakP8S/nS5shfsl587kzwEjcGlTdiksUVgFHnFCsLYDVj/JNqJVOQZGSYBTmuycv0PodwmnMQ=="],++ "dot-prop": ["[email protected]", "", { "dependencies": { "is-obj": "^2.0.0" } }, "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA=="],++ "dotenv": ["[email protected]", "", {}, "sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw=="],++ "drizzle-kit": ["[email protected]", "", { "dependencies": { "@drizzle-team/brocli": "^0.10.2", "@esbuild-kit/esm-loader": "^2.5.5", "esbuild": "^0.25.4", "tsx": "^4.21.0" }, "bin": { "drizzle-kit": "bin.cjs" } }, "sha512-7OZcmQUrdGI+DUNNsKBn1aW8qSoKuTH7d0mYgSP8bAzdFzKoovxEFnoGQp2dVs82EOJeYycqRtciopszwUf8bw=="],++ "drizzle-orm": ["[email protected]", "", { "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", "@neondatabase/serverless": ">=0.10.0", "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", "@prisma/client": "*", "@tidbcloud/serverless": "*", "@types/better-sqlite3": "*", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", "better-sqlite3": ">=7", "bun-types": "*", "expo-sqlite": ">=14.0.0", "gel": ">=2", "knex": "*", "kysely": "*", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "prisma": "*", "sql.js": ">=1", "sqlite3": ">=5" }, "optionalPeers": ["@aws-sdk/client-rds-data", "@cloudflare/workers-types", "@electric-sql/pglite", "@libsql/client", "@libsql/client-wasm", "@neondatabase/serverless", "@op-engineering/op-sqlite", "@opentelemetry/api", "@planetscale/database", "@prisma/client", "@tidbcloud/serverless", "@types/better-sqlite3", "@types/pg", "@types/sql.js", "@upstash/redis", "@vercel/postgres", "@xata.io/client", "better-sqlite3", "bun-types", "expo-sqlite", "gel", "knex", "kysely", "mysql2", "pg", "postgres", "prisma", "sql.js", "sqlite3"] }, "sha512-kY0BSaTNYWnoDMVoyY8uxmyHjpJW1geOmBMdSSicKo9CIIWkSxMIj2rkeSR51b8KAPB7m+qysjuHme5nKP+E5Q=="],++ "dset": ["[email protected]", "", {}, "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA=="],++ "dunder-proto": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],++ "ecdsa-sig-formatter": ["[email protected]", "", { "dependencies": { "safe-buffer": "^5.0.1" } }, "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ=="],++ "ee-first": ["[email protected]", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="],++ "electron-to-chromium": ["[email protected]", "", {}, "sha512-bNglH7lPH5l+yHOes7Zr4VqxhOy4BQ9ZBUX4VdoFgxMpzJk7W1ZoO3Vgd9Pxa9PyjQ76sfm2aKH/nzEcCNRlew=="],++ "emoji-regex": ["[email protected]", "", {}, "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A=="],++ "encodeurl": ["[email protected]", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="],++ "end-of-stream": ["[email protected]", "", { "dependencies": { "once": "^1.4.0" } }, "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg=="],++ "enhanced-resolve": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.4", "tapable": "^2.3.3" } }, "sha512-L1l8TNvomm6UVW5B253AGxQagSQr+vGwhMlrrfRS2qmhx46AMpMVJKQYLvWYbysTMY8VoicOvzHzoHMbyzB+4A=="],++ "enquirer": ["[email protected]", "", { "dependencies": { "ansi-colors": "^4.1.1", "strip-ansi": "^6.0.1" } }, "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ=="],++ "entities": ["[email protected]", "", {}, "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA=="],++ "env-paths": ["[email protected]", "", {}, "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A=="],++ "error-ex": ["[email protected]", "", { "dependencies": { "is-arrayish": "^0.2.1" } }, "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ=="],++ "es-define-property": ["[email protected]", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="],++ "es-errors": ["[email protected]", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="],++ "es-object-atoms": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="],++ "es-set-tostringtag": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],++ "es-toolkit": ["[email protected]", "", {}, "sha512-OyZKhUVvEep9ITEiwHn8GKnMRQIVqoSIX7WnRbkWgJkllCujilqP2rD0u979tkl8wqyc8ICwlc1UBVv/Sl1G6w=="],++ "esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.2", "@esbuild/android-arm": "0.28.2", "@esbuild/android-arm64": "0.28.2", "@esbuild/android-x64": "0.28.2", "@esbuild/darwin-arm64": "0.28.2", "@esbuild/darwin-x64": "0.28.2", "@esbuild/freebsd-arm64": "0.28.2", "@esbuild/freebsd-x64": "0.28.2", "@esbuild/linux-arm": "0.28.2", "@esbuild/linux-arm64": "0.28.2", "@esbuild/linux-ia32": "0.28.2", "@esbuild/linux-loong64": "0.28.2", "@esbuild/linux-mips64el": "0.28.2", "@esbuild/linux-ppc64": "0.28.2", "@esbuild/linux-riscv64": "0.28.2", "@esbuild/linux-s390x": "0.28.2", "@esbuild/linux-x64": "0.28.2", "@esbuild/netbsd-arm64": "0.28.2", "@esbuild/netbsd-x64": "0.28.2", "@esbuild/openbsd-arm64": "0.28.2", "@esbuild/openbsd-x64": "0.28.2", "@esbuild/openharmony-arm64": "0.28.2", "@esbuild/sunos-x64": "0.28.2", "@esbuild/win32-arm64": "0.28.2", "@esbuild/win32-ia32": "0.28.2", "@esbuild/win32-x64": "0.28.2" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA=="],++ "escalade": ["[email protected]", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="],++ "escape-html": ["[email protected]", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="],++ "escape-string-regexp": ["[email protected]", "", {}, "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw=="],++ "esprima": ["[email protected]", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="],++ "estree-util-is-identifier-name": ["[email protected]", "", {}, "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg=="],++ "etag": ["[email protected]", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="],++ "event-target-shim": ["[email protected]", "", {}, "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="],++ "eventemitter3": ["[email protected]", "", {}, "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw=="],++ "events": ["[email protected]", "", {}, "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q=="],++ "eventsource": ["[email protected]", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="],++ "eventsource-parser": ["[email protected]", "", {}, "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ=="],++ "execa": ["[email protected]", "", { "dependencies": { "@sindresorhus/merge-streams": "^4.0.0", "cross-spawn": "^7.0.6", "figures": "^6.1.0", "get-stream": "^9.0.0", "human-signals": "^8.0.1", "is-plain-obj": "^4.1.0", "is-stream": "^4.0.1", "npm-run-path": "^6.0.0", "pretty-ms": "^9.2.0", "signal-exit": "^4.1.0", "strip-final-newline": "^4.0.0", "yoctocolors": "^2.1.1" } }, "sha512-9Be3ZoN4LmYR90tUoVu2te2BsbzHfhJyfEiAVfz7N5/zv+jduIfLrV2xdQXOHbaD6KgpGdO9PRPM1Y4Q9QkPkA=="],++ "express": ["[email protected]", "", { "dependencies": { "accepts": "~1.3.8", "array-flatten": "1.1.1", "body-parser": "~1.20.5", "content-disposition": "~0.5.4", "content-type": "~1.0.4", "cookie": "~0.7.1", "cookie-signature": "~1.0.6", "debug": "2.6.9", "depd": "2.0.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "finalhandler": "~1.3.1", "fresh": "~0.5.2", "http-errors": "~2.0.0", "merge-descriptors": "1.0.3", "methods": "~1.1.2", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "path-to-regexp": "~0.1.12", "proxy-addr": "~2.0.7", "qs": "~6.15.1", "range-parser": "~1.2.1", "safe-buffer": "5.2.1", "send": "~0.19.0", "serve-static": "~1.16.2", "setprototypeof": "1.2.0", "statuses": "~2.0.1", "type-is": "~1.6.18", "utils-merge": "1.0.1", "vary": "~1.1.2" } }, "sha512-IuL+Elrou2ZvCFHs18/CIzy2Nzvo25nZ1/D2eIZlz7c+QUayAcYoiM2BthCjs+EBHVpjYjcuLDAiCWgeIX3X1Q=="],++ "express-rate-limit": ["[email protected]", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-YH4ru+eOJxQABscKFfRCy9R7x9QFGdezclVMwwgFFndzS2Xnm0uo6B0ABZsLhcpeptGv2qvuJVWlQr9gQZoC3A=="],++ "extend": ["[email protected]", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="],++ "fast-copy": ["[email protected]", "", {}, "sha512-dl0O9Vhju8IrcLndv2eU4ldt1ftXMqqfgN4H1cpmGV7P6jeB9FwpN9a2c8DPGE1Ys88rNUJVYDHq73CGAGOPfQ=="],++ "fast-deep-equal": ["[email protected]", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="],++ "fast-glob": ["[email protected]", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="],++ "fast-json-patch": ["[email protected]", "", {}, "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ=="],++ "fast-safe-stringify": ["[email protected]", "", {}, "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA=="],++ "fast-uri": ["[email protected]", "", {}, "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw=="],++ "fastq": ["[email protected]", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw=="],++ "fdir": ["[email protected]", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="],++ "fetch-blob": ["[email protected]", "", { "dependencies": { "node-domexception": "^1.0.0", "web-streams-polyfill": "^3.0.3" } }, "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ=="],++ "figures": ["[email protected]", "", { "dependencies": { "is-unicode-supported": "^2.0.0" } }, "sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg=="],++ "fill-range": ["[email protected]", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="],++ "finalhandler": ["[email protected]", "", { "dependencies": { "debug": "2.6.9", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "on-finished": "~2.4.1", "parseurl": "~1.3.3", "statuses": "~2.0.2", "unpipe": "~1.0.0" } }, "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg=="],++ "find-up": ["[email protected]", "", { "dependencies": { "locate-path": "^3.0.0" } }, "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg=="],++ "follow-redirects": ["[email protected]", "", { "peerDependencies": { "debug": "*" }, "optionalPeers": ["debug"] }, "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw=="],++ "form-data": ["[email protected]", "", { "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", "es-set-tostringtag": "^2.1.0", "hasown": "^2.0.4", "mime-types": "^2.1.35" } }, "sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ=="],++ "formdata-polyfill": ["[email protected]", "", { "dependencies": { "fetch-blob": "^3.1.2" } }, "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g=="],++ "forwarded": ["[email protected]", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="],++ "framer-motion": ["[email protected]", "", { "dependencies": { "motion-dom": "^13.0.0", "motion-utils": "^13.0.0", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-QSZrF0Id3QGuHJ+OL+9PSY9pk86C8ERFalwAGSchzTm65+ZoGH/RM26lmEARLljcHj2lqhv0jZOOks+EI3COOw=="],++ "fresh": ["[email protected]", "", {}, "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q=="],++ "fs-extra": ["[email protected]", "", { "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", "universalify": "^2.0.0" } }, "sha512-EQsFzMUJkCKGr1ePqlYADkIUmHW1s3ZXr5Yqy6wbGrfUCphpl2maM/kyOIRA2HpP3AaFQTZXD4ldjek+nccddA=="],++ "fsevents": ["[email protected]", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="],++ "function-bind": ["[email protected]", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="],++ "fuzzysort": ["[email protected]", "", {}, "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ=="],++ "gaxios": ["[email protected]", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "node-fetch": "^3.3.2" } }, "sha512-kB3rzJV7d9juLZh8/56QTXCwQfxyhdOMdyYk1HdQKFtF8TJTDTZQJtixWIwXdE9Jji91mC41DUNpjleo4L4eAQ=="],++ "gcp-metadata": ["[email protected]", "", { "dependencies": { "gaxios": "^7.0.0", "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" } }, "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg=="],++ "gensync": ["[email protected]", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],++ "get-east-asian-width": ["[email protected]", "", {}, "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA=="],++ "get-intrinsic": ["[email protected]", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="],++ "get-nonce": ["[email protected]", "", {}, "sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q=="],++ "get-own-enumerable-keys": ["[email protected]", "", {}, "sha512-PKsK2FSrQCyxcGHsGrLDcK0lx+0Ke+6e8KFFozA9/fIQLhQzPaRvJFdcz7+Axg3jUH/Mq+NI4xa5u/UT2tQskA=="],++ "get-proto": ["[email protected]", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="],++ "get-stream": ["[email protected]", "", { "dependencies": { "@sec-ant/readable-stream": "^0.4.1", "is-stream": "^4.0.1" } }, "sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA=="],++ "get-tsconfig": ["[email protected]", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-XpwZALwwl/BaKTAyC6+c5T8y6kCg2jk+XGqOVrKIQmW49pNypYLMRjCUXqa28tQgJlhS2RlzP7sc+Rx7W6qsfw=="],++ "glob-parent": ["[email protected]", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="],++ "google-auth-library": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^7.1.4", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-i1ydyHrqcIxXkWh/uBmVkzCvIuq5yiK2ATndIe5XxKholrG/MTYP9xGYka4sQhrbIAgGjL2B6NOE7rFaiF3fXw=="],++ "google-logging-utils": ["[email protected]", "", {}, "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA=="],++ "gopd": ["[email protected]", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="],++ "graceful-fs": ["[email protected]", "", {}, "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="],++ "graphql": ["[email protected]", "", {}, "sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA=="],++ "graphql-query-complexity": ["[email protected]", "", { "dependencies": { "lodash.get": "^4.4.2" }, "peerDependencies": { "graphql": "^14.6.0 || ^15.0.0 || ^16.0.0" } }, "sha512-fWEyuSL6g/+nSiIRgIipfI6UXTI7bAxrpPlCY1c0+V3pAEUo1ybaKmSBgNr1ed2r+agm1plJww8Loig9y6s2dw=="],++ "graphql-scalars": ["[email protected]", "", { "dependencies": { "tslib": "^2.5.0" }, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-o7BnU5yxAFUWTMKpC5yshB12DjzzoxLgEBO9OpOAcxodWrL3sPldD/fqVQoIfcqPH8OclyQilLtg3/7ZRqQUVQ=="],++ "graphql-yoga": ["[email protected]", "", { "dependencies": { "@envelop/core": "^5.5.1", "@envelop/instrumentation": "^1.0.0", "@graphql-tools/executor": "^1.5.0", "@graphql-tools/schema": "^10.0.11", "@graphql-tools/utils": "^10.11.0", "@graphql-yoga/logger": "^2.0.1", "@graphql-yoga/subscription": "^5.0.5", "@whatwg-node/fetch": "^0.10.6", "@whatwg-node/promise-helpers": "^1.3.2", "@whatwg-node/server": "^0.11.0", "lru-cache": "^10.0.0", "tslib": "^2.8.1" }, "peerDependencies": { "graphql": "^15.2.0 || ^16.0.0" } }, "sha512-1hJTKZd7k2V0Q2tFMb+rIUSbcovL6uIkkKnW2W9HcldtrC1udukdf5CswKi6SzaI5keG4scxKPEolyZ6U83i/g=="],++ "hachure-fill": ["[email protected]", "", {}, "sha512-3GKBOn+m2LX9iq+JC1064cSFprJY4jL1jCXTcpnfER5HYE2l/4EfWSGzkPa/ZDBmYI0ZOEj5VHV/eKnPGkHuOg=="],++ "happy-dom": ["[email protected]", "", { "dependencies": { "@types/node": ">=20.0.0", "@types/whatwg-mimetype": "^3.0.2", "@types/ws": "^8.18.1", "buffer-image-size": "^0.6.4", "entities": "^7.0.1", "whatwg-mimetype": "^3.0.0", "ws": "^8.21.0" } }, "sha512-7MB+bJLkxu3SowAfBJbjW+c55kNz5tkR45gu2qzrxznezhLeN5YIlJbwUgSzlGc+qWoZ8Ykg71H5ezz69xixrw=="],++ "has-flag": ["[email protected]", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="],++ "has-symbols": ["[email protected]", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="],++ "has-tostringtag": ["[email protected]", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="],++ "hasown": ["[email protected]", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A=="],++ "hast": ["[email protected]", "", {}, "sha512-vFUqlRV5C+xqP76Wwq2SrM0kipnmpxJm7OfvVXpB35Fp+Fn4MV+ozr+JZr5qFvyR1q/U+Foim2x+3P+x9S1PLA=="],++ "hast-util-from-dom": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "hastscript": "^9.0.0", "web-namespaces": "^2.0.0" } }, "sha512-N+LqofjR2zuzTjCPzyDUdSshy4Ma6li7p/c3pA78uTwzFgENbgbUrm2ugwsOdcjI1muO+o6Dgzp9p8WHtn/39Q=="],++ "hast-util-from-html": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "devlop": "^1.1.0", "hast-util-from-parse5": "^8.0.0", "parse5": "^7.0.0", "vfile": "^6.0.0", "vfile-message": "^4.0.0" } }, "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw=="],++ "hast-util-from-html-isomorphic": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-from-dom": "^5.0.0", "hast-util-from-html": "^2.0.0", "unist-util-remove-position": "^5.0.0" } }, "sha512-zJfpXq44yff2hmE0XmwEOzdWin5xwH+QIhMLOScpX91e/NSGPsAzNCvLQDIEPyO2TXi+lBmU6hjLIhV8MwP2kw=="],++ "hast-util-from-parse5": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "devlop": "^1.0.0", "hastscript": "^9.0.0", "property-information": "^7.0.0", "vfile": "^6.0.0", "vfile-location": "^5.0.0", "web-namespaces": "^2.0.0" } }, "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg=="],++ "hast-util-is-element": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g=="],++ "hast-util-parse-selector": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A=="],++ "hast-util-raw": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "@ungap/structured-clone": "^1.0.0", "hast-util-from-parse5": "^8.0.0", "hast-util-to-parse5": "^8.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "parse5": "^7.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0", "web-namespaces": "^2.0.0", "zwitch": "^2.0.0" } }, "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw=="],++ "hast-util-sanitize": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@ungap/structured-clone": "^1.0.0", "unist-util-position": "^5.0.0" } }, "sha512-3yTWghByc50aGS7JlGhk61SPenfE/p1oaFeNwkOOyrscaOkMGrcW9+Cy/QAIOBpZxP1yqDIzFMR0+Np0i0+usg=="],++ "hast-util-to-html": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-whitespace": "^3.0.0", "html-void-elements": "^3.0.0", "mdast-util-to-hast": "^13.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "stringify-entities": "^4.0.0", "zwitch": "^2.0.4" } }, "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw=="],++ "hast-util-to-jsx-runtime": ["[email protected]", "", { "dependencies": { "@types/estree": "^1.0.0", "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "estree-util-is-identifier-name": "^3.0.0", "hast-util-whitespace": "^3.0.0", "mdast-util-mdx-expression": "^2.0.0", "mdast-util-mdx-jsx": "^3.0.0", "mdast-util-mdxjs-esm": "^2.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "style-to-js": "^1.0.0", "unist-util-position": "^5.0.0", "vfile-message": "^4.0.0" } }, "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg=="],++ "hast-util-to-parse5": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "devlop": "^1.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0", "web-namespaces": "^2.0.0", "zwitch": "^2.0.0" } }, "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA=="],++ "hast-util-to-text": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/unist": "^3.0.0", "hast-util-is-element": "^3.0.0", "unist-util-find-after": "^5.0.0" } }, "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A=="],++ "hast-util-whitespace": ["[email protected]", "", {}, "sha512-nAxA0v8+vXSBDt3AnRUNjyRIQ0rD+ntpbAp4LnPkumc5M9yUbSMa4XDU9Q6etY4f1Wp4bNgvc1yjiZtsTTrSng=="],++ "hastscript": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-parse-selector": "^4.0.0", "property-information": "^7.0.0", "space-separated-tokens": "^2.0.0" } }, "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w=="],++ "help-me": ["[email protected]", "", {}, "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg=="],++ "hono": ["[email protected]", "", {}, "sha512-JydRilDRkYBQMt9qR9U92mXxmbGqsqSn/IKOrh4e7/gEbn+0zSr8igTu0obwJoNGN4sez28DIql7FBHWydoJpA=="],++ "html-url-attributes": ["[email protected]", "", {}, "sha512-ol6UPyBWqsrO6EJySPz2O7ZSr856WDrEzM5zMqp+FJJLGMW35cLYmmZnl0vztAZxRUoNZJFTCohfjuIJ8I4QBQ=="],++ "html-void-elements": ["[email protected]", "", {}, "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg=="],++ "http-errors": ["[email protected]", "", { "dependencies": { "depd": "~2.0.0", "inherits": "~2.0.4", "setprototypeof": "~1.2.0", "statuses": "~2.0.2", "toidentifier": "~1.0.1" } }, "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ=="],++ "http-proxy-agent": ["[email protected]", "", { "dependencies": { "agent-base": "^7.1.0", "debug": "^4.3.4" } }, "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig=="],++ "https-proxy-agent": ["[email protected]", "", { "dependencies": { "agent-base": "^7.1.2", "debug": "4" } }, "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw=="],++ "human-signals": ["[email protected]", "", {}, "sha512-eKCa6bwnJhvxj14kZk5NCPc6Hb6BdsU9DZcOnmQKSnO1VKrfV0zCvtttPZUsBvjmNDn8rpcJfpwSYnHBjc95MQ=="],++ "iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ=="],++ "ieee754": ["[email protected]", "", {}, "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA=="],++ "ignore": ["[email protected]", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="],++ "import-fresh": ["[email protected]", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="],++ "import-meta-resolve": ["[email protected]", "", {}, "sha512-Iqv2fzaTQN28s/FwZAoFq0ZSs/7hMAHJVX+w8PZl3cY19Pxk6jFFalxQoIfW2826i/fDLXv8IiEZRIT0lDuWcg=="],++ "inherits": ["[email protected]", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="],++ "inline-style-parser": ["[email protected]", "", {}, "sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q=="],++ "internmap": ["[email protected]", "", {}, "sha512-lDB5YccMydFBtasVtxnZ3MRBHuaoE8GKsppq+EchKL2U4nK/DmEpPHNH8MZe5HkMtpSiTSOZwfN0tzYjO/lJEw=="],++ "ip-address": ["[email protected]", "", {}, "sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g=="],++ "ipaddr.js": ["[email protected]", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="],++ "is-alphabetical": ["[email protected]", "", {}, "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ=="],++ "is-alphanumerical": ["[email protected]", "", { "dependencies": { "is-alphabetical": "^2.0.0", "is-decimal": "^2.0.0" } }, "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw=="],++ "is-arrayish": ["[email protected]", "", {}, "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="],++ "is-buffer": ["[email protected]", "", {}, "sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ=="],++ "is-decimal": ["[email protected]", "", {}, "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A=="],++ "is-docker": ["[email protected]", "", { "bin": { "is-docker": "cli.js" } }, "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ=="],++ "is-electron": ["[email protected]", "", {}, "sha512-FO/Rhvz5tuw4MCWkpMzHFKWD2LsfHzIb7i6MdPYZ/KW7AlxawyLkqdy+jPZP1WubqEADE3O4FUENlJHDfQASRg=="],++ "is-extglob": ["[email protected]", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="],++ "is-glob": ["[email protected]", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="],++ "is-hexadecimal": ["[email protected]", "", {}, "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg=="],++ "is-in-ssh": ["[email protected]", "", {}, "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw=="],++ "is-inside-container": ["[email protected]", "", { "dependencies": { "is-docker": "^3.0.0" }, "bin": { "is-inside-container": "cli.js" } }, "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA=="],++ "is-interactive": ["[email protected]", "", {}, "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ=="],++ "is-network-error": ["[email protected]", "", {}, "sha512-PhBY86zaxNZUuWP6h13Vu5oFe0XY6/UlKzQnYFELzGVHygP3MxmvTfYSG7GN3aIab/iWudSMgjSnG9Dq+nHrgA=="],++ "is-number": ["[email protected]", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="],++ "is-obj": ["[email protected]", "", {}, "sha512-IlsXEHOjtKhpN8r/tRFj2nDyTmHvcfNeu/nrRIcXE17ROeatXchkojffa1SpdqW4cr/Fj6QkEf/Gn4zf6KKvEQ=="],++ "is-plain-obj": ["[email protected]", "", {}, "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg=="],++ "is-promise": ["[email protected]", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="],++ "is-regexp": ["[email protected]", "", {}, "sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA=="],++ "is-stream": ["[email protected]", "", {}, "sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A=="],++ "is-unicode-supported": ["[email protected]", "", {}, "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ=="],++ "is-wsl": ["[email protected]", "", { "dependencies": { "is-docker": "^2.0.0" } }, "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww=="],++ "isbot": ["[email protected]", "", {}, "sha512-dJ+LpKyClQZ7NG+j3OensC/mAZkGpukE9YUrgPYvAZj2doVL0edfDgywTUh5CXa0o+nW9a1V9e5+CJTX8+SxRw=="],++ "isexe": ["[email protected]", "", {}, "sha512-6B3tLtFqtQS4ekarvLVMZ+X+VlvQekbe4taUkf/rhVO3d/h0M2rfARm/pXLcPEsjjMsFgrFgSrhQIxcSVrBz8w=="],++ "jiti": ["[email protected]", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="],++ "jose": ["[email protected]", "", {}, "sha512-Bsdjwm3Qsd/P0jR+BHDe3LytDfY7WBq2HmCCLIwuVRHMuEC9ae7/R474GIUdF1NgCyZjzVo/A9DOiOBtXq8ZoQ=="],++ "joycon": ["[email protected]", "", {}, "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw=="],++ "js-tiktoken": ["[email protected]", "", { "dependencies": { "base64-js": "^1.5.1" } }, "sha512-biOj/6M5qdgx5TKjDnFT1ymSpM5tbd3ylwDtrQvFQSu0Z7bBYko2dF+W/aUkXUPuk6IVpRxk/3Q2sHOzGlS36g=="],++ "js-tokens": ["[email protected]", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="],++ "js-yaml": ["[email protected]", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-CY6crGq313MX8GkwvB7tzgp99vjQxY1++5y10/BKN/GUfHqWaOGQMNZkBvqSzsZKWk/ijwHlWzzkLulsGHhjWQ=="],++ "jsesc": ["[email protected]", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="],++ "json-bigint": ["[email protected]", "", { "dependencies": { "bignumber.js": "^9.0.0" } }, "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ=="],++ "json-parse-even-better-errors": ["[email protected]", "", {}, "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w=="],++ "json-schema": ["[email protected]", "", {}, "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA=="],++ "json-schema-traverse": ["[email protected]", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="],++ "json-schema-typed": ["[email protected]", "", {}, "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA=="],++ "json5": ["[email protected]", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="],++ "jsonfile": ["[email protected]", "", { "dependencies": { "universalify": "^2.0.0" }, "optionalDependencies": { "graceful-fs": "^4.1.6" } }, "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q=="],++ "jsonwebtoken": ["[email protected]", "", { "dependencies": { "jws": "^4.0.1", "lodash.includes": "^4.3.0", "lodash.isboolean": "^3.0.3", "lodash.isinteger": "^4.0.4", "lodash.isnumber": "^3.0.3", "lodash.isplainobject": "^4.0.6", "lodash.isstring": "^4.0.1", "lodash.once": "^4.0.0", "ms": "^2.1.1", "semver": "^7.5.4" } }, "sha512-MT/xP0CrubFRNLNKvxJ2BYfy53Zkm++5bX9dtuPbqAeQpTVe0MQTFhao8+Cp//EmJp244xt6Drw/GVEGCUj40g=="],++ "jwa": ["[email protected]", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],++ "jwks-rsa": ["[email protected]", "", { "dependencies": { "@types/jsonwebtoken": "^9.0.4", "debug": "^4.3.4", "jose": "^6.1.3", "limiter": "^1.1.5", "lru-memoizer": "^3.0.0" } }, "sha512-poXwUA8S4cP9P5N8tZS3xnUDJH8WmwSGfKK9gIaRPdjLHyJtd9iX/cngX9CUIe0Caof5JhK2EbN7N5lnnaf9NA=="],++ "jws": ["[email protected]", "", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="],++ "katex": ["[email protected]", "", { "dependencies": { "commander": "^8.3.0" }, "bin": { "katex": "cli.js" } }, "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg=="],++ "khroma": ["[email protected]", "", {}, "sha512-Ls993zuzfayK269Svk9hzpeGUKob/sIgZzyHYdjQoAdQetRKpOLj+k/QQQ/6Qi0Yz65mlROrfd+Ev+1+7dz9Kw=="],++ "kleur": ["[email protected]", "", {}, "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ=="],++ "kysely": ["[email protected]", "", {}, "sha512-ooa+eSbBNPTo3MycPEuW5jdrxQdQwdtB3LC3h43FiXQbIry5tR0C5lDG7eealK0E4D7XjrnOP5DIUg/LyjRMYQ=="],++ "langchain": ["[email protected]", "", { "dependencies": { "@langchain/langgraph": "^1.4.8", "@langchain/langgraph-checkpoint": "^1.1.3", "langsmith": ">=0.5.0 <1.0.0", "zod": "^3.25.76 || ^4" }, "peerDependencies": { "@langchain/core": "^1.2.7" } }, "sha512-wW7T+E73w9Pu3OovLlSaF6Np50ivCECrNG8Y+BPZmYMUMhzA2Azd8OXCq7hA+kdMkGff39daM4HQZjhBfrHQKg=="],++ "langsmith": ["[email protected]", "", { "dependencies": { "p-queue": "6.6.2" }, "peerDependencies": { "@opentelemetry/api": "*", "@opentelemetry/exporter-trace-otlp-proto": "*", "@opentelemetry/sdk-trace-base": "*", "openai": "*", "ws": ">=7" }, "optionalPeers": ["@opentelemetry/api", "@opentelemetry/exporter-trace-otlp-proto", "@opentelemetry/sdk-trace-base", "openai", "ws"] }, "sha512-OG07MX2vyWcLyx/RhXPcydZVpuJSmCrcI1PxVmOR7TOoGWnGV68yUIaA85kc9v0gBkyD6cWa2VnBNBZcTN/qcQ=="],++ "layout-base": ["[email protected]", "", {}, "sha512-8h2oVEZNktL4BH2JCOI90iD1yXwL6iNW7KcCKT2QZgQJR2vbqDsldCTPRU9NifTCqHZci57XvQQ15YTu+sTYPg=="],++ "libphonenumber-js": ["[email protected]", "", {}, "sha512-xJxrdqvbl2rtn2MaUJrUejz8J7/uZNC0V77oks2LxYrO/+ZtVpRmz+fEQMuu6VusnEB1fmpByiLS1WXecOnAnw=="],++ "lightningcss": ["[email protected]", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.32.0", "lightningcss-darwin-arm64": "1.32.0", "lightningcss-darwin-x64": "1.32.0", "lightningcss-freebsd-x64": "1.32.0", "lightningcss-linux-arm-gnueabihf": "1.32.0", "lightningcss-linux-arm64-gnu": "1.32.0", "lightningcss-linux-arm64-musl": "1.32.0", "lightningcss-linux-x64-gnu": "1.32.0", "lightningcss-linux-x64-musl": "1.32.0", "lightningcss-win32-arm64-msvc": "1.32.0", "lightningcss-win32-x64-msvc": "1.32.0" } }, "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ=="],++ "lightningcss-android-arm64": ["[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg=="],++ "lightningcss-darwin-arm64": ["[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ=="],++ "lightningcss-darwin-x64": ["[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w=="],++ "lightningcss-freebsd-x64": ["[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig=="],++ "lightningcss-linux-arm-gnueabihf": ["[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw=="],++ "lightningcss-linux-arm64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ=="],++ "lightningcss-linux-arm64-musl": ["[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg=="],++ "lightningcss-linux-x64-gnu": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA=="],++ "lightningcss-linux-x64-musl": ["[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg=="],++ "lightningcss-win32-arm64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw=="],++ "lightningcss-win32-x64-msvc": ["[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q=="],++ "limiter": ["[email protected]", "", {}, "sha512-FWWMIEOxz3GwUI4Ts/IvgVy6LPvoMPgjMdQ185nN6psJyBJ4yOpzqm695/h5umdLJg2vW3GR5iG11MAkR2AzJA=="],++ "lines-and-columns": ["[email protected]", "", {}, "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg=="],++ "lit": ["[email protected]", "", { "dependencies": { "@lit/reactive-element": "^2.1.0", "lit-element": "^4.2.0", "lit-html": "^3.3.0" } }, "sha512-fycuvZg/hkpozL00lm1pEJH5nN/lr9ZXd6mJI2HSN4+Bzc+LDNdEApJ6HFbPkdFNHLvOplIIuJvxkS4XUxqirw=="],++ "lit-element": ["[email protected]", "", { "dependencies": { "@lit-labs/ssr-dom-shim": "^1.5.0", "@lit/reactive-element": "^2.1.0", "lit-html": "^3.3.0" } }, "sha512-aFKhNToWxoyhkNDmWZwEva2SlQia+jfG0fjIWV//YeTaWrVnOxD89dPKfigCUspXFmjzOEUQpOkejH5Ly6sG0w=="],++ "lit-html": ["[email protected]", "", { "dependencies": { "@types/trusted-types": "^2.0.2" } }, "sha512-el8M6jK2o3RXBnrSHX3ZKrsN8zEV63pSExTO1wYJz7QndGYZ8353e2a5PPX+qHe2aGayfnchQmkAojaWAREOIA=="],++ "locate-path": ["[email protected]", "", { "dependencies": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" } }, "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A=="],++ "lodash-es": ["[email protected]", "", {}, "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw=="],++ "lodash.clonedeep": ["[email protected]", "", {}, "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ=="],++ "lodash.get": ["[email protected]", "", {}, "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ=="],++ "lodash.includes": ["[email protected]", "", {}, "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w=="],++ "lodash.isboolean": ["[email protected]", "", {}, "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg=="],++ "lodash.isinteger": ["[email protected]", "", {}, "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA=="],++ "lodash.isnumber": ["[email protected]", "", {}, "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw=="],++ "lodash.isplainobject": ["[email protected]", "", {}, "sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA=="],++ "lodash.isstring": ["[email protected]", "", {}, "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw=="],++ "lodash.once": ["[email protected]", "", {}, "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg=="],++ "log-symbols": ["[email protected]", "", { "dependencies": { "chalk": "^5.3.0", "is-unicode-supported": "^1.3.0" } }, "sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw=="],++ "longest-streak": ["[email protected]", "", {}, "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g=="],++ "loose-envify": ["[email protected]", "", { "dependencies": { "js-tokens": "^3.0.0 || ^4.0.0" }, "bin": { "loose-envify": "cli.js" } }, "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q=="],++ "lru-cache": ["[email protected]", "", {}, "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ=="],++ "lru-memoizer": ["[email protected]", "", { "dependencies": { "lodash.clonedeep": "^4.5.0", "lru-cache": "^11.0.1" } }, "sha512-m83w/cYXLdUIboKSPxzPAGfYnk+vqeDYXuoSrQRw1q+yVEd8IXhvMufN8Q5TIPe7e2jyX4SRNrDJI2Skw1yznQ=="],++ "lucide": ["[email protected]", "", {}, "sha512-sfehWlaE/7NVkcEQ4T9JD3eID8RNMIGJBBUq9wF3UFiJIrcMKRbU3g1KGfDk4svcW7yw8BtDLXaXo02scDtUYQ=="],++ "lucide-react": ["[email protected]", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Tm1txJ2OkymCGkvwoHt33Y2JpN5xucVq1slHcgE6Lk0WjDfjgKWor5CdVER8U6DvcfMwh4M8XxmpTiyzfmfDYQ=="],++ "lz-string": ["[email protected]", "", { "bin": { "lz-string": "bin/bin.js" } }, "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ=="],++ "magic-string": ["[email protected]", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.5.5" } }, "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ=="],++ "markdown-table": ["[email protected]", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="],++ "marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-gB0gkNafnonOw0obSTEGZTT86IuhILt2Wfx0mWH/1Au83kybTayroZ/V6nS25mN7u8ASy+5fMhgB3XPNrOZdmA=="],++ "math-intrinsics": ["[email protected]", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="],++ "mdast-util-definitions": ["[email protected]", "", { "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", "unist-util-visit": "^4.0.0" } }, "sha512-8SVPMuHqlPME/z3gqVwWY4zVXn8lqKv/pAhC57FuJ40ImXyBpmO5ukh98zB2v7Blql2FiHjHv9LVztSIqjY+MA=="],++ "mdast-util-find-and-replace": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "escape-string-regexp": "^5.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg=="],++ "mdast-util-from-markdown": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "mdast-util-to-string": "^4.0.0", "micromark": "^4.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q=="],++ "mdast-util-gfm": ["[email protected]", "", { "dependencies": { "mdast-util-from-markdown": "^2.0.0", "mdast-util-gfm-autolink-literal": "^2.0.0", "mdast-util-gfm-footnote": "^2.0.0", "mdast-util-gfm-strikethrough": "^2.0.0", "mdast-util-gfm-table": "^2.0.0", "mdast-util-gfm-task-list-item": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ=="],++ "mdast-util-gfm-autolink-literal": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "ccount": "^2.0.0", "devlop": "^1.0.0", "mdast-util-find-and-replace": "^3.0.0", "micromark-util-character": "^2.0.0" } }, "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ=="],++ "mdast-util-gfm-footnote": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0" } }, "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ=="],++ "mdast-util-gfm-strikethrough": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg=="],++ "mdast-util-gfm-table": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "markdown-table": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg=="],++ "mdast-util-gfm-task-list-item": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ=="],++ "mdast-util-math": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "longest-streak": "^3.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.1.0", "unist-util-remove-position": "^5.0.0" } }, "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w=="],++ "mdast-util-mdx-expression": ["[email protected]", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ=="],++ "mdast-util-mdx-jsx": ["[email protected]", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "ccount": "^2.0.0", "devlop": "^1.1.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0", "parse-entities": "^4.0.0", "stringify-entities": "^4.0.0", "unist-util-stringify-position": "^4.0.0", "vfile-message": "^4.0.0" } }, "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q=="],++ "mdast-util-mdxjs-esm": ["[email protected]", "", { "dependencies": { "@types/estree-jsx": "^1.0.0", "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "devlop": "^1.0.0", "mdast-util-from-markdown": "^2.0.0", "mdast-util-to-markdown": "^2.0.0" } }, "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg=="],++ "mdast-util-phrasing": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "unist-util-is": "^6.0.0" } }, "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w=="],++ "mdast-util-to-hast": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "@ungap/structured-clone": "^1.0.0", "devlop": "^1.0.0", "micromark-util-sanitize-uri": "^2.0.0", "trim-lines": "^3.0.0", "unist-util-position": "^5.0.0", "unist-util-visit": "^5.0.0", "vfile": "^6.0.0" } }, "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA=="],++ "mdast-util-to-markdown": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "@types/unist": "^3.0.0", "longest-streak": "^3.0.0", "mdast-util-phrasing": "^4.0.0", "mdast-util-to-string": "^4.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-decode-string": "^2.0.0", "unist-util-visit": "^5.0.0", "zwitch": "^2.0.0" } }, "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA=="],++ "mdast-util-to-string": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0" } }, "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg=="],++ "media-typer": ["[email protected]", "", {}, "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ=="],++ "merge-descriptors": ["[email protected]", "", {}, "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ=="],++ "merge-stream": ["[email protected]", "", {}, "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w=="],++ "merge2": ["[email protected]", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="],++ "mermaid": ["[email protected]", "", { "dependencies": { "@braintree/sanitize-url": "^7.1.2", "@iconify/utils": "^3.0.2", "@mermaid-js/parser": "^1.2.0", "@types/d3": "^7.4.3", "@upsetjs/venn.js": "^2.0.0", "cytoscape": "^3.33.3", "cytoscape-cose-bilkent": "^4.1.0", "cytoscape-fcose": "^2.2.0", "d3": "^7.9.0", "d3-sankey": "^0.12.3", "dagre-d3-es": "7.0.14", "dayjs": "^1.11.20", "dompurify": "^3.3.3", "es-toolkit": "^1.45.1", "katex": "^0.16.45", "khroma": "^2.1.0", "marked": "^16.3.0", "roughjs": "^4.6.6", "stylis": "^4.3.6", "ts-dedent": "^2.2.0", "uuid": "^11.1.0 || ^12 || ^13 || ^14.0.0" } }, "sha512-TQsq6u22fAn3rek5VOubrhKPo1g5hwC3FXUN9hiyupTckcYiGuuKGkNQrKYwGJkXUxZdojwRG46gsSCFZMDp4g=="],++ "methods": ["[email protected]", "", {}, "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w=="],++ "micromark": ["[email protected]", "", { "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA=="],++ "micromark-core-commonmark": ["[email protected]", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "devlop": "^1.0.0", "micromark-factory-destination": "^2.0.0", "micromark-factory-label": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-factory-title": "^2.0.0", "micromark-factory-whitespace": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-html-tag-name": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-subtokenize": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg=="],++ "micromark-extension-cjk-friendly": ["[email protected]", "", { "dependencies": { "devlop": "^1.1.0", "micromark-extension-cjk-friendly-util": "2.1.1", "micromark-util-chunked": "^2.0.1", "micromark-util-resolve-all": "^2.0.1", "micromark-util-symbol": "^2.0.1" }, "peerDependencies": { "micromark": "^4.0.0", "micromark-util-types": "^2.0.0" }, "optionalPeers": ["micromark-util-types"] }, "sha512-gRzVLUdjXBLX6zNPSnHGDoo+ZTp5zy+MZm0g3sv+3chPXY7l9gW+DnrcHcZh/jiPR6MjPKO4AEJNp4Aw6V9z5Q=="],++ "micromark-extension-cjk-friendly-gfm-strikethrough": ["[email protected]", "", { "dependencies": { "devlop": "^1.1.0", "get-east-asian-width": "^1.3.0", "micromark-extension-cjk-friendly-util": "2.1.1", "micromark-util-character": "^2.1.1", "micromark-util-chunked": "^2.0.1", "micromark-util-resolve-all": "^2.0.1", "micromark-util-symbol": "^2.0.1" }, "peerDependencies": { "micromark": "^4.0.0", "micromark-util-types": "^2.0.0" }, "optionalPeers": ["micromark-util-types"] }, "sha512-gSPnxgHDDqXYOBvQRq6lerrq9mjDhdtKn+7XETuXjxWcL62yZEfUdA28Ml1I2vDIPfAOIKLa0h2XDSGkInGHFQ=="],++ "micromark-extension-cjk-friendly-util": ["[email protected]", "", { "dependencies": { "get-east-asian-width": "^1.3.0", "micromark-util-character": "^2.1.1", "micromark-util-symbol": "^2.0.1" }, "peerDependencies": { "micromark-util-types": "*" }, "optionalPeers": ["micromark-util-types"] }, "sha512-egs6+12JU2yutskHY55FyR48ZiEcFOJFyk9rsiyIhcJ6IvWB6ABBqVrBw8IobqJTDZ/wdSr9eoXDPb5S2nW1bg=="],++ "micromark-extension-gfm": ["[email protected]", "", { "dependencies": { "micromark-extension-gfm-autolink-literal": "^2.0.0", "micromark-extension-gfm-footnote": "^2.0.0", "micromark-extension-gfm-strikethrough": "^2.0.0", "micromark-extension-gfm-table": "^2.0.0", "micromark-extension-gfm-tagfilter": "^2.0.0", "micromark-extension-gfm-task-list-item": "^2.0.0", "micromark-util-combine-extensions": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w=="],++ "micromark-extension-gfm-autolink-literal": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw=="],++ "micromark-extension-gfm-footnote": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-core-commonmark": "^2.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-normalize-identifier": "^2.0.0", "micromark-util-sanitize-uri": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw=="],++ "micromark-extension-gfm-strikethrough": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-classify-character": "^2.0.0", "micromark-util-resolve-all": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw=="],++ "micromark-extension-gfm-table": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg=="],++ "micromark-extension-gfm-tagfilter": ["[email protected]", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg=="],++ "micromark-extension-gfm-task-list-item": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw=="],++ "micromark-extension-math": ["[email protected]", "", { "dependencies": { "@types/katex": "^0.16.0", "devlop": "^1.0.0", "katex": "^0.16.0", "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg=="],++ "micromark-factory-destination": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA=="],++ "micromark-factory-label": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg=="],++ "micromark-factory-space": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg=="],++ "micromark-factory-title": ["[email protected]", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw=="],++ "micromark-factory-whitespace": ["[email protected]", "", { "dependencies": { "micromark-factory-space": "^2.0.0", "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ=="],++ "micromark-util-character": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q=="],++ "micromark-util-chunked": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA=="],++ "micromark-util-classify-character": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q=="],++ "micromark-util-combine-extensions": ["[email protected]", "", { "dependencies": { "micromark-util-chunked": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg=="],++ "micromark-util-decode-numeric-character-reference": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw=="],++ "micromark-util-decode-string": ["[email protected]", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^2.0.0", "micromark-util-decode-numeric-character-reference": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ=="],++ "micromark-util-encode": ["[email protected]", "", {}, "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw=="],++ "micromark-util-html-tag-name": ["[email protected]", "", {}, "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA=="],++ "micromark-util-normalize-identifier": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^2.0.0" } }, "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q=="],++ "micromark-util-resolve-all": ["[email protected]", "", { "dependencies": { "micromark-util-types": "^2.0.0" } }, "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg=="],++ "micromark-util-sanitize-uri": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^2.0.0", "micromark-util-encode": "^2.0.0", "micromark-util-symbol": "^2.0.0" } }, "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ=="],++ "micromark-util-subtokenize": ["[email protected]", "", { "dependencies": { "devlop": "^1.0.0", "micromark-util-chunked": "^2.0.0", "micromark-util-symbol": "^2.0.0", "micromark-util-types": "^2.0.0" } }, "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA=="],++ "micromark-util-symbol": ["[email protected]", "", {}, "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q=="],++ "micromark-util-types": ["[email protected]", "", {}, "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA=="],++ "micromatch": ["[email protected]", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="],++ "mime": ["[email protected]", "", { "bin": { "mime": "cli.js" } }, "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="],++ "mime-db": ["[email protected]", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="],++ "mime-types": ["[email protected]", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A=="],++ "mimic-fn": ["[email protected]", "", {}, "sha512-Ysbi9uYW9hFyfrThdDEQuykN4Ey6BuwPD2kpI5ES/nFTDn/98yxYNLZJcgUAKPT/mcrLLKaGzJR9YVxJrIdASQ=="],++ "mimic-function": ["[email protected]", "", {}, "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA=="],++ "minimatch": ["[email protected]", "", { "dependencies": { "brace-expansion": "^5.0.8" } }, "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A=="],++ "minimist": ["[email protected]", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="],++ "motion": ["[email protected]", "", { "dependencies": { "framer-motion": "^13.1.0", "tslib": "^2.4.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" }, "optionalPeers": ["react", "react-dom"] }, "sha512-qtvscq59uCPdWnNW4SdSkrxR+BS/QYsa923bx7ocA+4p+ZGNbbVQwkSnG4aukB81QWjtl3AxX36plxNyZLmHCA=="],++ "motion-dom": ["[email protected]", "", { "dependencies": { "motion-utils": "^13.0.0" } }, "sha512-Xk+SJas70uMAUIApg+m3lZDShxI3LBFHq7mFGbBKoRXc2PVPDyAKmzN64Bbzt4CZdP/CItTiJxWtn4TA0v53Ng=="],++ "motion-utils": ["[email protected]", "", {}, "sha512-7DnN7TmbLcYXcG4RVadXIihWlyuM9afoUww8Y5Agg431kGKiuL2/OMyP4mJ5wLz+pvN3t5ySClLOaVXJ+wekRQ=="],++ "mri": ["[email protected]", "", {}, "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA=="],++ "ms": ["[email protected]", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="],++ "mustache": ["[email protected]", "", { "bin": { "mustache": "bin/mustache" } }, "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ=="],++ "nanoid": ["[email protected]", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="],++ "nanostores": ["[email protected]", "", {}, "sha512-Wxv8Roefr2nqtiRG0bnaFlpYqpIVtOEeJZHaH+4nGgOK1/7n6OHOuHCb/bhqrNQgZM8fyd0s1PqhdrJc9Ib44g=="],++ "negotiator": ["[email protected]", "", {}, "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="],++ "node-domexception": ["[email protected]", "", {}, "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ=="],++ "node-fetch": ["[email protected]", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A=="],++ "node-releases": ["[email protected]", "", {}, "sha512-D9UOmYG3UH1V+ENW56t5QXBwJw1YEY18ruVeus89Rw+SyIgjPkCO84bRzO3uNIYosJbNwiabWVn48o3uJLjxFQ=="],++ "npm-run-path": ["[email protected]", "", { "dependencies": { "path-key": "^4.0.0", "unicorn-magic": "^0.3.0" } }, "sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA=="],++ "object-assign": ["[email protected]", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="],++ "object-inspect": ["[email protected]", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="],++ "object-treeify": ["[email protected]", "", {}, "sha512-EFVjAYfzWqWsBMRHPMAXLCDIJnpMhdWAqR7xG6M6a2cs6PMFpl/+Z20w9zDW4vkxOFfddegBKq9Rehd0bxWE7A=="],++ "on-exit-leak-free": ["[email protected]", "", {}, "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA=="],++ "on-finished": ["[email protected]", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="],++ "once": ["[email protected]", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="],++ "onetime": ["[email protected]", "", { "dependencies": { "mimic-fn": "^2.1.0" } }, "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg=="],++ "oniguruma-parser": ["[email protected]", "", {}, "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw=="],++ "oniguruma-to-es": ["[email protected]", "", { "dependencies": { "oniguruma-parser": "^0.12.2", "regex": "^6.1.0", "regex-recursion": "^6.0.2" } }, "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA=="],++ "open": ["[email protected]", "", { "dependencies": { "default-browser": "^5.4.0", "define-lazy-prop": "^3.0.0", "is-in-ssh": "^1.0.0", "is-inside-container": "^1.0.0", "powershell-utils": "^0.1.0", "wsl-utils": "^0.3.0" } }, "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw=="],++ "openai": ["[email protected]", "", { "peerDependencies": { "@aws-sdk/credential-provider-node": ">=3.972.0 <4", "@smithy/hash-node": ">=4.3.0 <5", "@smithy/signature-v4": ">=5.4.0 <6", "ws": "^8.18.0", "zod": "^3.25 || ^4.0" }, "optionalPeers": ["@aws-sdk/credential-provider-node", "@smithy/hash-node", "@smithy/signature-v4", "ws", "zod"] }, "sha512-+C9Muit5x8j9R8ej8ZzVgKcrVDtqFqTy9gxFdov0EItLgU68zrJtF9ZeT0cyqJQW9S3PCJkdFgADtRGquRBtew=="],++ "ora": ["[email protected]", "", { "dependencies": { "chalk": "^5.3.0", "cli-cursor": "^5.0.0", "cli-spinners": "^2.9.2", "is-interactive": "^2.0.0", "is-unicode-supported": "^2.0.0", "log-symbols": "^6.0.0", "stdin-discarder": "^0.2.2", "string-width": "^7.2.0", "strip-ansi": "^7.1.0" } }, "sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw=="],++ "p-finally": ["[email protected]", "", {}, "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow=="],++ "p-limit": ["[email protected]", "", { "dependencies": { "p-try": "^2.0.0" } }, "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w=="],++ "p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^2.0.0" } }, "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ=="],++ "p-queue": ["[email protected]", "", { "dependencies": { "eventemitter3": "^4.0.4", "p-timeout": "^3.2.0" } }, "sha512-RwFpb72c/BhQLEXIZ5K2e+AhgNVmIejGlTgiB9MzZ0e93GRvqZ7uSi0dvRF7/XIXDeNkra2fNHBxTyPDGySpjQ=="],++ "p-retry": ["[email protected]", "", { "dependencies": { "is-network-error": "^1.1.0" } }, "sha512-J5ApzjyRkkf601HpEeykoiCvzHQjWxPAHhyjFcEUP2SWq0+35NKh8TLhpLw+Dkq5TZBFvUM6UigdE9hIVYTl5w=="],++ "p-timeout": ["[email protected]", "", { "dependencies": { "p-finally": "^1.0.0" } }, "sha512-rhIwUycgwwKcP9yTOOFK/AKsAopjjCakVqLHePO3CC6Mir1Z99xT+R63jZxAT5lFZLa2inS5h+ZS2GvR99/FBg=="],++ "p-try": ["[email protected]", "", {}, "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ=="],++ "package-manager-detector": ["[email protected]", "", {}, "sha512-yQA4H19AmPEoMUeavPMDIe1higySl/gH/yaQrkT/s07Qp+7pp2hYz30N3z2l5BkjVkF9Ow6o0wjJamm2y7Sn0A=="],++ "parent-module": ["[email protected]", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="],++ "parse-entities": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "character-entities-legacy": "^3.0.0", "character-reference-invalid": "^2.0.0", "decode-named-character-reference": "^1.0.0", "is-alphanumerical": "^2.0.0", "is-decimal": "^2.0.0", "is-hexadecimal": "^2.0.0" } }, "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw=="],++ "parse-json": ["[email protected]", "", { "dependencies": { "@babel/code-frame": "^7.0.0", "error-ex": "^1.3.1", "json-parse-even-better-errors": "^2.3.0", "lines-and-columns": "^1.1.6" } }, "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg=="],++ "parse-ms": ["[email protected]", "", {}, "sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw=="],++ "parse5": ["[email protected]", "", { "dependencies": { "entities": "^6.0.0" } }, "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw=="],++ "parseurl": ["[email protected]", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="],++ "partial-json": ["[email protected]", "", {}, "sha512-Njv/59hHaokb/hRUjce3Hdv12wd60MtM9Z5Olmn+nehe0QDAsRtRbJPvJ0Z91TusF0SuZRIvnM+S4l6EIP8leA=="],++ "path-browserify": ["[email protected]", "", {}, "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g=="],++ "path-data-parser": ["[email protected]", "", {}, "sha512-NOnmBpt5Y2RWbuv0LMzsayp3lVylAHLPUTut412ZA3l+C4uw4ZVkQbjShYCQ8TCpUMdPapr4YjUqLYD6v68j+w=="],++ "path-exists": ["[email protected]", "", {}, "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ=="],++ "path-key": ["[email protected]", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="],++ "path-to-regexp": ["[email protected]", "", {}, "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA=="],++ "pathe": ["[email protected]", "", {}, "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w=="],++ "phoenix": ["[email protected]", "", {}, "sha512-MbS8y0+8lYNjOYRIorek1GzMFS3nKvycetLlLxB/DZOFRu0yLI0PCvvm8wg+7aEORbmWuioe95+7uoyNKlErZg=="],++ "picocolors": ["[email protected]", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="],++ "picomatch": ["[email protected]", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="],++ "pino": ["[email protected]", "", { "dependencies": { "@pinojs/redact": "^0.4.0", "atomic-sleep": "^1.0.0", "on-exit-leak-free": "^2.1.0", "pino-abstract-transport": "^2.0.0", "pino-std-serializers": "^7.0.0", "process-warning": "^5.0.0", "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", "sonic-boom": "^4.0.1", "thread-stream": "^3.0.0" }, "bin": { "pino": "bin.js" } }, "sha512-8OEwKp5juEvb/MjpIc4hjqfgCNysrS94RIOMXYvpYCdm/jglrKEiAYmiumbmGhCvs+IcInsphYDFwqrjr7398w=="],++ "pino-abstract-transport": ["[email protected]", "", { "dependencies": { "split2": "^4.0.0" } }, "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw=="],++ "pino-pretty": ["[email protected]", "", { "dependencies": { "colorette": "^2.0.7", "dateformat": "^4.6.3", "fast-copy": "^3.0.2", "fast-safe-stringify": "^2.1.1", "help-me": "^5.0.0", "joycon": "^3.1.1", "minimist": "^1.2.6", "on-exit-leak-free": "^2.1.0", "pino-abstract-transport": "^2.0.0", "pump": "^3.0.0", "readable-stream": "^4.0.0", "secure-json-parse": "^2.4.0", "sonic-boom": "^4.0.1", "strip-json-comments": "^3.1.1" }, "bin": { "pino-pretty": "bin.js" } }, "sha512-oXwn7ICywaZPHmu3epHGU2oJX4nPmKvHvB/bwrJHlGcbEWaVcotkpyVHMKLKmiVryWYByNp0jpgAcXpFJDXJzA=="],++ "pino-std-serializers": ["[email protected]", "", {}, "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw=="],++ "pkce-challenge": ["[email protected]", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="],++ "pkg-up": ["[email protected]", "", { "dependencies": { "find-up": "^3.0.0" } }, "sha512-nDywThFk1i4BQK4twPQ6TA4RT8bDY96yeuCVBWL3ePARCiEKDRSrNGbFIgUJpLp+XeIR65v8ra7WuJOFUBtkMA=="],++ "points-on-curve": ["[email protected]", "", {}, "sha512-0mYKnYYe9ZcqMCWhUjItv/oHjvgEsfKvnUTg8sAtnHr3GVy7rGkXCb6d5cSyqrWqL4k81b9CPg3urd+T7aop3A=="],++ "points-on-path": ["[email protected]", "", { "dependencies": { "path-data-parser": "0.1.0", "points-on-curve": "0.2.0" } }, "sha512-25ClnWWuw7JbWZcgqY/gJ4FQWadKxGWk+3kR/7kD0tCaDtPPMj7oHu2ToLaVhfpnHrZzYby2w6tUA0eOIuUg8g=="],++ "postcss": ["[email protected]", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="],++ "postcss-selector-parser": ["[email protected]", "", { "dependencies": { "cssesc": "^3.0.0", "util-deprecate": "^1.0.2" } }, "sha512-KvvtD7SrlBP7dlgkBghEE3r84CABm5SmV2aNcG4oCA+qDnJ/tvKonFVvwWAyyWUEwxuNawdfEAZKP9zM3oZ2Uw=="],++ "postgres": ["[email protected]", "", {}, "sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw=="],++ "powershell-utils": ["[email protected]", "", {}, "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A=="],++ "prettier": ["[email protected]", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g=="],++ "pretty-format": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1", "ansi-styles": "^5.0.0", "react-is": "^17.0.1" } }, "sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ=="],++ "pretty-ms": ["[email protected]", "", { "dependencies": { "parse-ms": "^4.0.0" } }, "sha512-gjVS5hOP+M3wMm5nmNOucbIrqudzs9v/57bWRHQWLYklXqoXKrVfYW2W9+glfGsqtPgpiz5WwyEEB+ksXIx3gQ=="],++ "process": ["[email protected]", "", {}, "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A=="],++ "process-warning": ["[email protected]", "", {}, "sha512-jQSaVHsPgtyw60e1rQ/A+/ArPEj/S8pS/vFnyGa/gYFXrKk/6RuDkoqVDQ5NI5MmS01698ltlAk0NoDBNLujRw=="],++ "prompt-area": ["[email protected]", "", { "peerDependencies": { "clsx": ">=2", "react": ">=18", "react-dom": ">=18", "tailwind-merge": ">=2" } }, "sha512-/M70Qfui+yd/Z2YOsGloRt69dmMz1HXh+PF3CNZHzHemKHZNWjuPUEd3KAn/xIH+3y5aW+DCSuph39bHF7ACgg=="],++ "prompts": ["[email protected]", "", { "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" } }, "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q=="],++ "prop-types": ["[email protected]", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="],++ "property-information": ["[email protected]", "", {}, "sha512-PgTgs/BlvHxOu8QuEN7wi5A0OmXaBcHpmCSTehcs6Uuu9IkDIEo13Hy7n898RHfrQ49vKCoGeWZSaAK01nwVig=="],++ "proxy-addr": ["[email protected]", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="],++ "proxy-from-env": ["[email protected]", "", {}, "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA=="],++ "pump": ["[email protected]", "", { "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA=="],++ "qs": ["[email protected]", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="],++ "queue-microtask": ["[email protected]", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="],++ "quick-format-unescaped": ["[email protected]", "", {}, "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="],++ "ramda": ["[email protected]", "", {}, "sha512-tEF5I22zJnuclswcZMc8bDIrwRHRzf+NqVEmqg50ShAZMP7MWeR/RGDthfM/p+BlqvF2fXAzpn8i+SJcYD3alw=="],++ "range-parser": ["[email protected]", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="],++ "raw-body": ["[email protected]", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.7.0", "unpipe": "~1.0.0" } }, "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA=="],++ "react": ["[email protected]", "", {}, "sha512-PWaYA1L/q9u2u7xYQi+Y3L3Yfnie7XyLeaJICV1MGD6LprsBxcAqGjYyr0eY3p+QdsA+x/Irkt4Qif8D63+Sbw=="],++ "react-dom": ["[email protected]", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.8" } }, "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ=="],++ "react-is": ["[email protected]", "", {}, "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg=="],++ "react-markdown": ["[email protected]", "", { "dependencies": { "@types/hast": "^2.0.0", "@types/prop-types": "^15.0.0", "@types/unist": "^2.0.0", "comma-separated-tokens": "^2.0.0", "hast-util-whitespace": "^2.0.0", "prop-types": "^15.0.0", "property-information": "^6.0.0", "react-is": "^18.0.0", "remark-parse": "^10.0.0", "remark-rehype": "^10.0.0", "space-separated-tokens": "^2.0.0", "style-to-object": "^0.4.0", "unified": "^10.0.0", "unist-util-visit": "^4.0.0", "vfile": "^5.0.0" }, "peerDependencies": { "@types/react": ">=16", "react": ">=16" } }, "sha512-bvWbzG4MtOU62XqBx3Xx+zB2raaFFsq4mYiAzfjXJMEz2sixgeAfraA3tvzULF02ZdOMUOKTBFFaZJDDrq+BJQ=="],++ "react-refresh": ["[email protected]", "", {}, "sha512-QgT5//D3jfjJb6Gsjxv0Slpj23ip+HtOpnNgnb2S5zU3CB26G/IDPGoy4RJB42wzFE46DRsstbW6tKHoKbhAxw=="],++ "react-remove-scroll": ["[email protected]", "", { "dependencies": { "react-remove-scroll-bar": "^2.3.7", "react-style-singleton": "^2.2.3", "tslib": "^2.1.0", "use-callback-ref": "^1.3.3", "use-sidecar": "^1.1.3" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q=="],++ "react-remove-scroll-bar": ["[email protected]", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="],++ "react-style-singleton": ["[email protected]", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="],++ "readable-stream": ["[email protected]", "", { "dependencies": { "abort-controller": "^3.0.0", "buffer": "^6.0.3", "events": "^3.3.0", "process": "^0.11.10", "string_decoder": "^1.3.0" } }, "sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg=="],++ "readdirp": ["[email protected]", "", {}, "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA=="],++ "real-require": ["[email protected]", "", {}, "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg=="],++ "recast": ["[email protected]", "", { "dependencies": { "ast-types": "^0.16.1", "esprima": "~4.0.0", "source-map": "~0.6.1", "tiny-invariant": "^1.3.3", "tslib": "^2.0.1" } }, "sha512-mFAyJq9vUbSTARLZUvAEf1z3YxlvAwswbmxMx2mPA/MSm4KmpwvwvhsH/NIrZhyOuwD60Lzyw2qh83uCbgTPYw=="],++ "reflect-metadata": ["[email protected]", "", {}, "sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q=="],++ "regex": ["[email protected]", "", { "dependencies": { "regex-utilities": "^2.3.0" } }, "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg=="],++ "regex-recursion": ["[email protected]", "", { "dependencies": { "regex-utilities": "^2.3.0" } }, "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg=="],++ "regex-utilities": ["[email protected]", "", {}, "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng=="],++ "rehype-harden": ["[email protected]", "", { "dependencies": { "unist-util-visit": "^5.0.0" } }, "sha512-Qn7vR1xrf6fZCrkm9TDWi/AB4ylrHy+jqsNm1EHOAmbARYA6gsnVJBq/sdBh6kmT4NEZxH5vgIjrscefJAOXcw=="],++ "rehype-katex": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/katex": "^0.16.0", "hast-util-from-html-isomorphic": "^2.0.0", "hast-util-to-text": "^4.0.0", "katex": "^0.16.0", "unist-util-visit-parents": "^6.0.0", "vfile": "^6.0.0" } }, "sha512-OiM2wrZ/wuhKkigASodFoo8wimG3H12LWQaH8qSPVJn9apWKFSH3YOCtbKpBorTVw/eI7cuT21XBbvwEswbIOA=="],++ "rehype-raw": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-raw": "^9.0.0", "vfile": "^6.0.0" } }, "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww=="],++ "rehype-sanitize": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "hast-util-sanitize": "^5.0.0" } }, "sha512-CsnhKNsyI8Tub6L4sm5ZFsme4puGfc6pYylvXo1AeqaGbjOYyzNv3qZPwvs0oMJ39eryyeOdmxwUIo94IpEhqg=="],++ "remark-cjk-friendly": ["[email protected]", "", { "dependencies": { "micromark-extension-cjk-friendly": "1.2.3" }, "peerDependencies": { "@types/mdast": "^4.0.0", "unified": "^11.0.0" }, "optionalPeers": ["@types/mdast"] }, "sha512-UvAgxwlNk+l9Oqgl/9MWK2eWRS7zgBW/nXX9AthV7nd/3lNejF138E7Xbmk9Zs4WjTJGs721r7fAEc7tNFoH7g=="],++ "remark-cjk-friendly-gfm-strikethrough": ["[email protected]", "", { "dependencies": { "micromark-extension-cjk-friendly-gfm-strikethrough": "1.2.3" }, "peerDependencies": { "@types/mdast": "^4.0.0", "unified": "^11.0.0" }, "optionalPeers": ["@types/mdast"] }, "sha512-bXfMZtsaomK6ysNN/UGRIcasQAYkC10NtPmP0oOHOV8YOhA2TXmwRXCku4qOzjIFxAPfish5+XS0eIug2PzNZA=="],++ "remark-gfm": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", "micromark-extension-gfm": "^3.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg=="],++ "remark-math": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-math": "^3.0.0", "micromark-extension-math": "^3.0.0", "unified": "^11.0.0" } }, "sha512-MMqgnP74Igy+S3WwnhQ7kqGlEerTETXMvJhrUzDikVZ2/uogJCb+WHUg97hK9/jcfc0dkD73s3LN8zU49cTEtA=="],++ "remark-parse": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-from-markdown": "^2.0.0", "micromark-util-types": "^2.0.0", "unified": "^11.0.0" } }, "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA=="],++ "remark-rehype": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0", "@types/mdast": "^4.0.0", "mdast-util-to-hast": "^13.0.0", "unified": "^11.0.0", "vfile": "^6.0.0" } }, "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw=="],++ "remark-stringify": ["[email protected]", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-to-markdown": "^2.0.0", "unified": "^11.0.0" } }, "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw=="],++ "remend": ["[email protected]", "", {}, "sha512-iIhggPkhW3hFImKtB10w0dz4EZbs28mV/dmbcYVonWEJ6UGHHpP+bFZnTh6GNWJONg5m+U56JrL+8IxZRdgWjw=="],++ "require-from-string": ["[email protected]", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="],++ "reselect": ["[email protected]", "", {}, "sha512-AgZ3UOZm3YndfrJ4OYjgrT7bmCm/1iqkjvEfH/oYjzh6PD2qw4QuT3jjnXIrpdt4MTpMXclMT3lXbmRY+XRakw=="],++ "resolve-from": ["[email protected]", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="],++ "resolve-pkg-maps": ["[email protected]", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="],++ "restore-cursor": ["[email protected]", "", { "dependencies": { "onetime": "^7.0.0", "signal-exit": "^4.1.0" } }, "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA=="],++ "retry": ["[email protected]", "", {}, "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg=="],++ "reusify": ["[email protected]", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="],++ "robust-predicates": ["[email protected]", "", {}, "sha512-NS3levdsRIUOmiJ8FZWCP7LG3QpJyrs/TE0Zpf1yvZu8cAJJ6QMW92H1c7kWpdIHo8RvmLxN/o2JXTKHp74lUA=="],++ "rollup": ["[email protected]", "", { "dependencies": { "@types/estree": "1.0.9" }, "optionalDependencies": { "@napi-rs/lzma-linux-x64-gnu": "1.5.1", "@rollup/rollup-android-arm-eabi": "4.62.4", "@rollup/rollup-android-arm64": "4.62.4", "@rollup/rollup-darwin-arm64": "4.62.4", "@rollup/rollup-darwin-x64": "4.62.4", "@rollup/rollup-freebsd-arm64": "4.62.4", "@rollup/rollup-freebsd-x64": "4.62.4", "@rollup/rollup-linux-arm-gnueabihf": "4.62.4", "@rollup/rollup-linux-arm-musleabihf": "4.62.4", "@rollup/rollup-linux-arm64-gnu": "4.62.4", "@rollup/rollup-linux-arm64-musl": "4.62.4", "@rollup/rollup-linux-loong64-gnu": "4.62.4", "@rollup/rollup-linux-loong64-musl": "4.62.4", "@rollup/rollup-linux-ppc64-gnu": "4.62.4", "@rollup/rollup-linux-ppc64-musl": "4.62.4", "@rollup/rollup-linux-riscv64-gnu": "4.62.4", "@rollup/rollup-linux-riscv64-musl": "4.62.4", "@rollup/rollup-linux-s390x-gnu": "4.62.4", "@rollup/rollup-linux-x64-gnu": "4.62.4", "@rollup/rollup-linux-x64-musl": "4.62.4", "@rollup/rollup-openbsd-x64": "4.62.4", "@rollup/rollup-openharmony-arm64": "4.62.4", "@rollup/rollup-win32-arm64-msvc": "4.62.4", "@rollup/rollup-win32-ia32-msvc": "4.62.4", "@rollup/rollup-win32-x64-gnu": "4.62.4", "@rollup/rollup-win32-x64-msvc": "4.62.4", "fsevents": "~2.3.2" }, "bin": { "rollup": "dist/bin/rollup" } }, "sha512-RXOqwaPsBGjMNMa4sQjDjHieHEZDFoj/Rdr46l2MU5DfEs16wHJPC2RPTPHWhNl+M3aI472LLqFkFKut4SblOg=="],++ "rou3": ["[email protected]", "", {}, "sha512-3SOzvaAg8rkHrXtRjpCvCvbyO5to9oOO27Z/XqHEYXfMRVSw/qMIVdmaOk9W2lcRLtR6dlqTjo9hDeJk70QBYQ=="],++ "roughjs": ["[email protected]", "", { "dependencies": { "hachure-fill": "^0.5.2", "path-data-parser": "^0.1.0", "points-on-curve": "^0.2.0", "points-on-path": "^0.2.1" } }, "sha512-ZUz/69+SYpFN/g/lUlo2FXcIjRkSu3nDarreVdGGndHEBJ6cXPdKguS8JGxwj5HA5xIbVKSmLgr5b3AWxtRfvQ=="],++ "router": ["[email protected]", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="],++ "run-applescript": ["[email protected]", "", {}, "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q=="],++ "run-parallel": ["[email protected]", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="],++ "rw": ["[email protected]", "", {}, "sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ=="],++ "rxjs": ["[email protected]", "", { "dependencies": { "tslib": "^2.1.0" } }, "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg=="],++ "sade": ["[email protected]", "", { "dependencies": { "mri": "^1.1.0" } }, "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A=="],++ "safe-buffer": ["[email protected]", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="],++ "safe-stable-stringify": ["[email protected]", "", {}, "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="],++ "safer-buffer": ["[email protected]", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="],++ "scheduler": ["[email protected]", "", {}, "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q=="],++ "secure-json-parse": ["[email protected]", "", {}, "sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw=="],++ "semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="],++ "send": ["[email protected]", "", { "dependencies": { "debug": "2.6.9", "depd": "2.0.0", "destroy": "1.2.0", "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "~0.5.2", "http-errors": "~2.0.1", "mime": "1.6.0", "ms": "2.1.3", "on-finished": "~2.4.1", "range-parser": "~1.2.1", "statuses": "~2.0.2" } }, "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg=="],++ "seroval": ["[email protected]", "", {}, "sha512-mPT+SD2TrlB6wvte1KkYOYUkubaTbd6pZ/6Kk3C9nxzrHmCZyhxOO7XGAeL7f+yLKZglzGtM9odUVvg/EhO+vQ=="],++ "seroval-plugins": ["[email protected]", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-TfxuUjlbBESzUOWdTkTKqvSmav0ABym+itetDXLK6mDz8SmrpdI30aF8RTXE8Bvq+tH/1yIDkvy3W0lfQb1ipQ=="],++ "serve-static": ["[email protected]", "", { "dependencies": { "encodeurl": "~2.0.0", "escape-html": "~1.0.3", "parseurl": "~1.3.3", "send": "~0.19.1" } }, "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA=="],++ "server": ["server@workspace:server"],++ "set-cookie-parser": ["[email protected]", "", {}, "sha512-5/r/lTwbJ3zQ+qwdUFZYeRNqda7P5HD8zQKqlSjdGt1/S0cjLAphHusj4Y58ahDtWn/g32xrIS58/ikOvwl0Lw=="],++ "setprototypeof": ["[email protected]", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],++ "shadcn": ["[email protected]", "", { "dependencies": { "@babel/core": "^7.28.0", "@babel/parser": "^7.28.0", "@babel/plugin-transform-typescript": "^7.28.0", "@babel/preset-typescript": "^7.27.1", "@dotenvx/dotenvx": "^1.48.4", "@modelcontextprotocol/sdk": "^1.26.0", "@types/validate-npm-package-name": "^4.0.2", "browserslist": "^4.26.2", "commander": "^14.0.0", "cosmiconfig": "^9.0.0", "dedent": "^1.6.0", "deepmerge": "^4.3.1", "diff": "^8.0.2", "execa": "^9.6.0", "fast-glob": "^3.3.3", "fs-extra": "^11.3.1", "fuzzysort": "^3.1.0", "kleur": "^4.1.5", "open": "^11.0.0", "ora": "^8.2.0", "postcss": "^8.5.6", "postcss-selector-parser": "^7.1.0", "prompts": "^2.4.2", "recast": "^0.23.11", "socks": "^2.8.8", "stringify-object": "^5.0.0", "tailwind-merge": "^3.0.1", "ts-morph": "^26.0.0", "tsconfig-paths": "^4.2.0", "undici": "^7.27.2", "validate-npm-package-name": "^7.0.1", "zod": "^3.24.1", "zod-to-json-schema": "^3.24.6" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-kphndh72CD7mxLQ/thkbPVgfXpIjzPUllzvTWRJmU3sNGZc/WbOqzJ0FXbBGj6sqNiaGPiOLDQByy8FAtCuVUQ=="],++ "shebang-command": ["[email protected]", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],++ "shebang-regex": ["[email protected]", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="],++ "shiki": ["[email protected]", "", { "dependencies": { "@shikijs/core": "3.23.0", "@shikijs/engine-javascript": "3.23.0", "@shikijs/engine-oniguruma": "3.23.0", "@shikijs/langs": "3.23.0", "@shikijs/themes": "3.23.0", "@shikijs/types": "3.23.0", "@shikijs/vscode-textmate": "^10.0.2", "@types/hast": "^3.0.4" } }, "sha512-55Dj73uq9ZXL5zyeRPzHQsK7Nbyt6Y10k5s7OjuFZGMhpp4r/rsLBH0o/0fstIzX1Lep9VxefWljK/SKCzygIA=="],++ "side-channel": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4", "side-channel-list": "^1.0.1", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ=="],++ "side-channel-list": ["[email protected]", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.4" } }, "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w=="],++ "side-channel-map": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="],++ "side-channel-weakmap": ["[email protected]", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="],++ "signal-exit": ["[email protected]", "", {}, "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw=="],++ "sisteransi": ["[email protected]", "", {}, "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg=="],++ "smart-buffer": ["[email protected]", "", {}, "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg=="],++ "socks": ["[email protected]", "", { "dependencies": { "ip-address": "^10.1.1", "smart-buffer": "^4.2.0" } }, "sha512-LJhUYUvItdQ0LkJTmPeaEObWXAqFyfmP85x0tch/ez9cahmhlBBLbIqDFnvBnUJGagb0JbIQrkBs1wJ+yRYpEw=="],++ "sonic-boom": ["[email protected]", "", { "dependencies": { "atomic-sleep": "^1.0.0" } }, "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q=="],++ "source-map": ["[email protected]", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="],++ "source-map-js": ["[email protected]", "", {}, "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA=="],++ "source-map-support": ["[email protected]", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="],++ "space-separated-tokens": ["[email protected]", "", {}, "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q=="],++ "split2": ["[email protected]", "", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="],++ "statuses": ["[email protected]", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="],++ "stdin-discarder": ["[email protected]", "", {}, "sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ=="],++ "streamdown": ["[email protected]", "", { "dependencies": { "clsx": "^2.1.1", "hast-util-to-jsx-runtime": "^2.3.6", "html-url-attributes": "^3.0.1", "marked": "^17.0.1", "mermaid": "^11.12.2", "rehype-harden": "^1.1.8", "rehype-raw": "^7.0.0", "rehype-sanitize": "^6.0.0", "remark-gfm": "^4.0.1", "remark-parse": "^11.0.0", "remark-rehype": "^11.1.2", "remend": "1.3.0", "tailwind-merge": "^3.4.0", "unified": "^11.0.5", "unist-util-visit": "^5.0.0", "unist-util-visit-parents": "^6.0.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0", "react-dom": "^18.0.0 || ^19.0.0" } }, "sha512-/tTnURfIOxZK/pqJAxsfCvETG/XCJHoWnk3jq9xLcuz6CSpnjjuxSRBTTL4PKGhxiZQf0lqPxGhImdpwcZ2XwA=="],++ "string-width": ["[email protected]", "", { "dependencies": { "emoji-regex": "^10.3.0", "get-east-asian-width": "^1.0.0", "strip-ansi": "^7.1.0" } }, "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ=="],++ "string_decoder": ["[email protected]", "", { "dependencies": { "safe-buffer": "~5.2.0" } }, "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA=="],++ "stringify-entities": ["[email protected]", "", { "dependencies": { "character-entities-html4": "^2.0.0", "character-entities-legacy": "^3.0.0" } }, "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg=="],++ "stringify-object": ["[email protected]", "", { "dependencies": { "get-own-enumerable-keys": "^1.0.0", "is-obj": "^3.0.0", "is-regexp": "^3.1.0" } }, "sha512-zaJYxz2FtcMb4f+g60KsRNFOpVMUyuJgA51Zi5Z1DOTC3S59+OQiVOzE9GZt0x72uBGWKsQIuBKeF9iusmKFsg=="],++ "strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^6.2.2" } }, "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w=="],++ "strip-bom": ["[email protected]", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="],++ "strip-final-newline": ["[email protected]", "", {}, "sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw=="],++ "strip-json-comments": ["[email protected]", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="],++ "style-to-js": ["[email protected]", "", { "dependencies": { "style-to-object": "1.0.14" } }, "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ=="],++ "style-to-object": ["[email protected]", "", { "dependencies": { "inline-style-parser": "0.1.1" } }, "sha512-HYNoHZa2GorYNyqiCaBgsxvcJIn7OHq6inEga+E6Ke3m5JkoqpQbnFssk4jwe+K7AhGa2fcha4wSOf1Kn01dMg=="],++ "stylis": ["[email protected]", "", {}, "sha512-5Z9ZpRzfuH6l/UAvCPAPUo3665Nk2wLaZU3x+TLHKVzIz33+sbJqbtrYoC3KD4/uVOr2Zp+L0LySezP9OHV9yA=="],++ "supports-color": ["[email protected]", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="],++ "systeminformation": ["[email protected]", "", { "os": "!aix", "bin": { "systeminformation": "lib/cli.js" } }, "sha512-DEN6ICHk3Tk0Uf/hrAHh7xlt7iL5CJFBtPZinA0H62DrGG/KPKqq/Nzj6lCXPS4Ay/sf/14zNnk9LpqKzBIc+w=="],++ "tailwind-merge": ["[email protected]", "", {}, "sha512-uxL7qAVQriqRQPAyK3pj66VqskWqoZ37PW94jwOTwNfq/z9oyu1V+eqrZqtR2+fCiXdYOZe/Modt8GtvqNzu+w=="],++ "tailwindcss": ["[email protected]", "", {}, "sha512-gOhV3P7ufE62QDGg1zVaTgCR+EtPv92k2nIhVcVKcLmxT1sUBsQGhnZj175j+MqRt4zLF7ic+sCYjfhxMxj7YQ=="],++ "tapable": ["[email protected]", "", {}, "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A=="],++ "thread-stream": ["[email protected]", "", { "dependencies": { "real-require": "^0.2.0" } }, "sha512-zLBvqpwr4Esa0kRjcrzGU6zL25lePWaCLMx0RQFrmteozIfeNdaMLpG5U7PeHzvlFkAWaRKA9/KVW4F60iB+qw=="],++ "tiny-invariant": ["[email protected]", "", {}, "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg=="],++ "tinyexec": ["[email protected]", "", {}, "sha512-QKAl9m8gWWGHV8jZcPeym6j+XULi6tOf1mT83WYJ4Lk2ytW/uwAWkrP0uFsdoYMdueVJ0qs26wZ+23xeB4ibNQ=="],++ "tinyglobby": ["[email protected]", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="],++ "to-regex-range": ["[email protected]", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="],++ "toidentifier": ["[email protected]", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="],++ "tr46": ["[email protected]", "", {}, "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw=="],++ "trim-lines": ["[email protected]", "", {}, "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg=="],++ "trough": ["[email protected]", "", {}, "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw=="],++ "ts-dedent": ["[email protected]", "", {}, "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg=="],++ "ts-morph": ["[email protected]", "", { "dependencies": { "@ts-morph/common": "~0.27.0", "code-block-writer": "^13.0.3" } }, "sha512-ztMO++owQnz8c/gIENcM9XfCEzgoGphTv+nKpYNM1bgsdOVC/jRZuEBf6N+mLLDNg68Kl+GgUZfOySaRiG1/Ug=="],++ "tsconfig-paths": ["[email protected]", "", { "dependencies": { "json5": "^2.2.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg=="],++ "tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],++ "tsscmp": ["[email protected]", "", {}, "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA=="],++ "tsx": ["[email protected]", "", { "dependencies": { "esbuild": "~0.28.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": { "tsx": "dist/cli.mjs" } }, "sha512-FDf4L4sYzKtzWYhU/Xm0AQFdTjdIxNo9ElTf2mxXM6k8YMHXzYUe4yODVaXP4V9uMFbVg8c0qyBccK2OOxb45Q=="],++ "tw-animate-css": ["[email protected]", "", {}, "sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ=="],++ "type-graphql": ["[email protected]", "", { "dependencies": { "@graphql-yoga/subscription": "^5.0.0", "@types/node": "*", "@types/semver": "^7.5.6", "graphql-query-complexity": "^0.12.0", "semver": "^7.5.4", "tslib": "^2.6.2" }, "peerDependencies": { "class-validator": ">=0.14.0", "graphql": "^16.8.1", "graphql-scalars": "^1.22.4" }, "optionalPeers": ["class-validator"] }, "sha512-HCu4j3jR0tZvAAoO7DMBT3MRmah0DFRe5APymm9lXUghXA0sbhiMf6SLRafRYfk0R0KiUQYRduuGP3ap1RnF1Q=="],++ "type-is": ["[email protected]", "", { "dependencies": { "media-typer": "0.3.0", "mime-types": "~2.1.24" } }, "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g=="],++ "typescript": ["[email protected]", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="],++ "undici": ["[email protected]", "", {}, "sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw=="],++ "undici-types": ["[email protected]", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],++ "unicorn-magic": ["[email protected]", "", {}, "sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA=="],++ "unified": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" } }, "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA=="],++ "unist-util-find-after": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" } }, "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ=="],++ "unist-util-generated": ["[email protected]", "", {}, "sha512-qF72kLmPxAw0oN2fwpWIqbXAVyEqUzDHMsbtPvOudIlUzXYFIeQIuxXQCRCFh22B7cixvU0MG7m3MW8FTq/S+A=="],++ "unist-util-is": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g=="],++ "unist-util-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA=="],++ "unist-util-remove-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-visit": "^5.0.0" } }, "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q=="],++ "unist-util-stringify-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0" } }, "sha512-k5GzIBZ/QatR8N5X2y+drfpWG8IDBzdnVj6OInRNWm1oXrzydiaAT2OQiA8DPRRZyAKb9b6I2a6PxYklZD0gKg=="],++ "unist-util-visit": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0", "unist-util-visit-parents": "^6.0.0" } }, "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg=="],++ "unist-util-visit-parents": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-is": "^6.0.0" } }, "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ=="],++ "universalify": ["[email protected]", "", {}, "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw=="],++ "unpipe": ["[email protected]", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="],++ "unplugin": ["[email protected]", "", { "dependencies": { "@jridgewell/remapping": "^2.3.5", "picomatch": "^4.0.4", "webpack-virtual-modules": "^0.6.2" }, "peerDependencies": { "@farmfe/core": "*", "@rspack/core": "*", "bun-types-no-globals": "*", "esbuild": "*", "rolldown": "*", "rollup": "*", "unloader": "*", "vite": "*", "webpack": "*" }, "optionalPeers": ["@farmfe/core", "@rspack/core", "bun-types-no-globals", "esbuild", "rolldown", "rollup", "unloader", "vite", "webpack"] }, "sha512-qa66K+crbfyE6JK10GjvbJeRrOsuC/JpbnHctfyp/i4oBTxWOzJfRZyDiOk1PtErMFRu8JhsU/wPvOdBNWe5Rg=="],++ "untruncate-json": ["[email protected]", "", {}, "sha512-4W9enDK4X1y1s2S/Rz7ysw6kDuMS3VmRjMFg7GZrNO+98OSe+x5Lh7PKYoVjy3lW/1wmhs6HW0lusnQRHgMarA=="],++ "update-browserslist-db": ["[email protected]", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-ZZ61DsRsOnakl74HAmp3oSN4aXUmEWXf+i/yv0h7tIBfICc3VdrFErQKUUKPgu3AMsTUMbcongALEN4l6GSUrQ=="],++ "urlpattern-polyfill": ["[email protected]", "", {}, "sha512-IGjKp/o0NL3Bso1PymYURCJxMPNAf/ILOpendP9f5B6e1rTJgdgiOvgfoT8VxCAdY+Wisb9uhGaJJf3yZ2V9nw=="],++ "urql": ["[email protected]", "", { "dependencies": { "@urql/core": "^5.1.1", "wonka": "^6.3.2" }, "peerDependencies": { "react": ">= 16.8.0" } }, "sha512-3GgqNa6iF7bC4hY/ImJKN4REQILcSU9VKcKL8gfELZM8mM5BnLH1BsCc8kBdnVGD1LIFOs4W3O2idNHhON1r0w=="],++ "use-callback-ref": ["[email protected]", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="],++ "use-sidecar": ["[email protected]", "", { "dependencies": { "detect-node-es": "^1.1.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ=="],++ "use-stick-to-bottom": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-z3Up8jYQGTkUCsGBnwg6/wj70KgXoW5Kz1AAc1j8MtQuYMBo6ZsdhrIXoegxa7gaMMilgQYyTohTrt3p94jHog=="],++ "use-sync-external-store": ["[email protected]", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-Pp6GSwGP/NrPIrxVFAIkOQeyw8lFenOHijQWkUTrDvrF4ALqylP2C/KCkeS9dpUM3KvYRQhna5vt7IL95+ZQ9w=="],++ "util-deprecate": ["[email protected]", "", {}, "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="],++ "utils-merge": ["[email protected]", "", {}, "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA=="],++ "uuid": ["[email protected]", "", { "bin": { "uuid": "dist/esm/bin/uuid" } }, "sha512-vIYxrBCC/N/K+Js3qSN88go7kIfNPssr/hHCesKCQNAjmgvYS2oqr69kIufEG+O4+PfezOH4EbIeHCfFov8ZgQ=="],++ "uvu": ["[email protected]", "", { "dependencies": { "dequal": "^2.0.0", "diff": "^5.0.0", "kleur": "^4.0.3", "sade": "^1.7.3" }, "bin": { "uvu": "bin.js" } }, "sha512-+g8ENReyr8YsOc6fv/NVJs2vFdHBnBNdfE49rshrTzDWOlUx4Gq7KOS2GD8eqhy2j+Ejq29+SbKH8yjkAqXqoA=="],++ "validate-npm-package-name": ["[email protected]", "", {}, "sha512-hVDIBwsRruT73PbK7uP5ebUt+ezEtCmzZz3F59BSr2F6OVFnJ/6h8liuvdLrQ88Xmnk6/+xGGuq+pG9WwTuy3A=="],++ "validator": ["[email protected]", "", {}, "sha512-TQ5pAGhd5whStmqWvYF4OjQROlmv9SMFVt37qoCBdqRffuuklWYQlCNnEs2ZaIBD1kZRNnikiZOS1eqgkar0iw=="],++ "vary": ["[email protected]", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="],++ "vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "is-buffer": "^2.0.0", "unist-util-stringify-position": "^3.0.0", "vfile-message": "^3.0.0" } }, "sha512-r7qlzkgErKjobAmyNIkkSpizsFPYiUPuJb5pNW1RB4JcYVZhs4lIbVqk8XPk033CV/1z8ss5pkax8SuhGpcG8g=="],++ "vfile-location": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile": "^6.0.0" } }, "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg=="],++ "vfile-message": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw=="],++ "vite": ["[email protected]", "", { "dependencies": { "esbuild": "^0.27.0 || ^0.28.0", "fdir": "^6.5.0", "picomatch": "^4.0.3", "postcss": "^8.5.6", "rollup": "^4.43.0", "tinyglobby": "^0.2.15" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "jiti": ">=1.21.0", "less": "^4.0.0", "lightningcss": "^1.21.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "jiti", "less", "lightningcss", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-4XP60spRGjSZFf1qYH+dJIkK2znL3zQfl9KkOV9MkkRR/3Dls0dxaBsQPTloEc5BLXWPL9vsOxopxyKoMmDueg=="],++ "web-namespaces": ["[email protected]", "", {}, "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ=="],++ "web-streams-polyfill": ["[email protected]", "", {}, "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw=="],++ "webidl-conversions": ["[email protected]", "", {}, "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ=="],++ "webpack-virtual-modules": ["[email protected]", "", {}, "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ=="],++ "whatwg-mimetype": ["[email protected]", "", {}, "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q=="],++ "whatwg-url": ["[email protected]", "", { "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" } }, "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw=="],++ "which": ["[email protected]", "", { "dependencies": { "isexe": "^3.1.1" }, "bin": { "node-which": "bin/which.js" } }, "sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg=="],++ "wonka": ["[email protected]", "", {}, "sha512-MXH+6mDHAZ2GuMpgKS055FR6v0xVP3XwquxIMYXgiW+FejHQlMGlvVRZT4qMCxR+bEo/FCtIdKxwej9WV3YQag=="],++ "worker": ["worker@workspace:worker"],++ "wrappy": ["[email protected]", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="],++ "ws": ["[email protected]", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw=="],++ "wsl-utils": ["[email protected]", "", { "dependencies": { "is-wsl": "^3.1.0", "powershell-utils": "^0.1.0" } }, "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg=="],++ "yallist": ["[email protected]", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="],++ "yaml": ["[email protected]", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA=="],++ "yocto-spinner": ["[email protected]", "", { "dependencies": { "yoctocolors": "^2.1.1" } }, "sha512-DODGl1wJjA/s5pnJFKau9lIYHT81lnhob1i3e1TjxZRxEhWRKl74nTbWE6H5KlkViQQTo/Z29YFdxzTZAMY3ng=="],++ "yoctocolors": ["[email protected]", "", {}, "sha512-xYqdZFUK/VYazNl/oCDYN+3WloWQwMfZxBoiNt6qNyk+xfOdi598muWE42rNZFp1kNOiqW936q5RhUdnpqElSg=="],++ "zod": ["[email protected]", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="],++ "zod-to-json-schema": ["[email protected]", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="],++ "zwitch": ["[email protected]", "", {}, "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A=="],++ "@a2ui/web_core/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@ag-ui/client/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@ag-ui/core/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@ag-ui/mcp-middleware/@ag-ui/client": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.54", "@ag-ui/encoder": "0.0.54", "@ag-ui/proto": "0.0.54", "@types/uuid": "^10.0.0", "compare-versions": "^6.1.1", "fast-json-patch": "^3.1.1", "rxjs": "7.8.1", "untruncate-json": "^0.0.1", "uuid": "^11.1.0", "zod": "^3.22.4" } }, "sha512-N5UVXEBV5gPHqTuMoR/21brconRn42URf+MB4L8OniCJKqLcl/qUJb5kMamK0nnfBhDfPs/uq7LxDn6bsDJzJg=="],++ "@ai-sdk/google-vertex/@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.3", "@ai-sdk/provider-utils": "3.0.32" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-V0nIwhyv8f9rD+p6glm0uq30seid8y2CrvNvHCAbnuPm5bPpqVChEB63kixrIDNnogkgI+ZjSTtIbIL2q3QPvQ=="],++ "@ai-sdk/google-vertex/@ai-sdk/google": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.3", "@ai-sdk/provider-utils": "3.0.32" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-1EgXWI+9wKAvbTyNP2DLuiQ7KZM9bzSzLMXouzxfEC0rvLVSX0tN1emXiEurj8+9kXyElJO7Qm3xWSNhdyVEvA=="],++ "@ai-sdk/google-vertex/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-h88OPkavHTiN9tMn2l5awAznGB0lXzjcLhgR1/rvjB2zlLprsNxbM2tt6OJsHUxduLC3klq0/eqaSf6fX5XVww=="],++ "@ai-sdk/google-vertex/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.3", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6", "undici": "^5.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-izgUo50kamJMwoYCXoFwVccuJeyYp0y1+twf0FfpEz7kdQBloZLZbgLYUOUpannLWrV7xYSJR48BQJIQFbFiAQ=="],++ "@ai-sdk/openai-compatible/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-h88OPkavHTiN9tMn2l5awAznGB0lXzjcLhgR1/rvjB2zlLprsNxbM2tt6OJsHUxduLC3klq0/eqaSf6fX5XVww=="],++ "@ai-sdk/openai-compatible/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "2.0.3", "@standard-schema/spec": "^1.0.0", "eventsource-parser": "^3.0.6", "undici": "^5.29.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-izgUo50kamJMwoYCXoFwVccuJeyYp0y1+twf0FfpEz7kdQBloZLZbgLYUOUpannLWrV7xYSJR48BQJIQFbFiAQ=="],++ "@ai-sdk/provider-utils/undici": ["[email protected]", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="],++ "@babel/helper-compilation-targets/lru-cache": ["[email protected]", "", { "dependencies": { "yallist": "^3.0.2" } }, "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w=="],++ "@copilotkit/a2ui-renderer/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@copilotkit/channels-slack/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@copilotkit/channels-teams/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@copilotkit/react-core/streamdown": ["[email protected]", "", { "dependencies": { "clsx": "^2.1.1", "hast": "^1.0.0", "hast-util-to-jsx-runtime": "^2.3.6", "html-url-attributes": "^3.0.1", "katex": "^0.16.22", "lucide-react": "^0.542.0", "marked": "^16.2.1", "mermaid": "^11.11.0", "rehype-harden": "^1.1.6", "rehype-katex": "^7.0.1", "rehype-raw": "^7.0.0", "rehype-sanitize": "^6.0.0", "remark-cjk-friendly": "^1.2.3", "remark-cjk-friendly-gfm-strikethrough": "^1.2.3", "remark-gfm": "^4.0.1", "remark-math": "^6.0.0", "remark-parse": "^11.0.0", "remark-rehype": "^11.1.2", "remend": "1.0.1", "shiki": "^3.12.2", "tailwind-merge": "^3.3.1", "unified": "^11.0.5", "unist-util-visit": "^5.0.0" }, "peerDependencies": { "react": "^18.0.0 || ^19.0.0" } }, "sha512-Y38fwRx5kCKTluwM+Gf27jbbi9q6Qy+WC9YrC1YbCpMkktT3PsRBJHMWiqYeF8y/JzLpB1IzDoeaB6qkQEDnAA=="],++ "@copilotkit/runtime/uuid": ["[email protected]", "", { "bin": { "uuid": "dist/bin/uuid" } }, "sha512-8XkAphELsDnEGrDxUOHB3RGvXz6TeuYSGEZBOjtTtPm2lwhGBjLgOzLHB63IUWfBpNucQjND6d3AOudO+H3RWQ=="],++ "@copilotkit/runtime/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@copilotkit/shared/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@copilotkit/web-inspector/marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-qXUm7e/YKFoqFPYPa3Ukg9xlI5cyAtGmyEIzMfW//m6kXwCy2Ps9DYf5ioijFKQ8qyuscrHoY04iJGctu2Kg0Q=="],++ "@dotenvx/dotenvx/commander": ["[email protected]", "", {}, "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ=="],++ "@dotenvx/dotenvx/execa": ["[email protected]", "", { "dependencies": { "cross-spawn": "^7.0.3", "get-stream": "^6.0.0", "human-signals": "^2.1.0", "is-stream": "^2.0.0", "merge-stream": "^2.0.0", "npm-run-path": "^4.0.1", "onetime": "^5.1.2", "signal-exit": "^3.0.3", "strip-final-newline": "^2.0.0" } }, "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg=="],++ "@dotenvx/dotenvx/open": ["[email protected]", "", { "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", "is-wsl": "^2.2.0" } }, "sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ=="],++ "@esbuild-kit/core-utils/esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="],++ "@graphql-tools/executor/@graphql-tools/utils": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@whatwg-node/promise-helpers": "^1.0.0", "cross-inspect": "1.0.1", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-Do2A/t6ayqOma8m7PvpYMsCBswL+NB35BQSng4GWSBqafL2/BnfAZy/NSENPwV721Rm2fG0BHETFC0+FJJZmLw=="],++ "@graphql-tools/merge/@graphql-tools/utils": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@whatwg-node/promise-helpers": "^1.0.0", "cross-inspect": "1.0.1", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-aMdIo/l+8j4lhamWAf+MWHr+lOW8zArSBKXspqtKHgt5I2JF9LS55KDLUe/L9AiJOV/O6qJJ60hgYydbnJHbxg=="],++ "@graphql-tools/schema/@graphql-tools/utils": ["@graphql-tools/[email protected]", "", { "dependencies": { "@graphql-typed-document-node/core": "^3.1.1", "@whatwg-node/promise-helpers": "^1.0.0", "cross-inspect": "1.0.1", "tslib": "^2.4.0" }, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, "sha512-aMdIo/l+8j4lhamWAf+MWHr+lOW8zArSBKXspqtKHgt5I2JF9LS55KDLUe/L9AiJOV/O6qJJ60hgYydbnJHbxg=="],++ "@langchain/langgraph-sdk/p-queue": ["[email protected]", "", { "dependencies": { "eventemitter3": "^5.0.4", "p-timeout": "^7.0.0" } }, "sha512-NXAOdnEe5FsZJfT4oK84lE1Y5cFFdWlRuOo5tww8DyNMxyRXwn39fIkUtNLKppcPC+UYU/bXujNCUGDv01y7CA=="],++ "@mermaid-js/parser/@chevrotain/types": ["@chevrotain/[email protected]", "", {}, "sha512-U+HFai5+zmJCkK86QsaJtoITlboZHBqrVketcO2ROv865xfCMSFpELQoz1GkX5GzME8pTa+3kbKrZHQtI0gdbw=="],++ "@microsoft/agents-activity/zod": ["[email protected]", "", {}, "sha512-OhpzAmVzabPOL6C3A3gpAifqr9MqihV/Msx3gor2b2kviCgcb+HM9SEOpMWwwNp9MRunWnhtAKUoo0AHhjyPPg=="],++ "@microsoft/agents-hosting/zod": ["[email protected]", "", {}, "sha512-OhpzAmVzabPOL6C3A3gpAifqr9MqihV/Msx3gor2b2kviCgcb+HM9SEOpMWwwNp9MRunWnhtAKUoo0AHhjyPPg=="],++ "@modelcontextprotocol/sdk/@hono/node-server": ["@hono/[email protected]", "", { "peerDependencies": { "hono": "^4" } }, "sha512-XovyyCCnBzW+zKu+z/zq8hwNs4KOR5rEMAOxo2f40Q5xoOI37IMm6MIg2COOUtUApo0i6850MTBKH2u4QLGIqg=="],++ "@modelcontextprotocol/sdk/express": ["[email protected]", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],++ "@segment/analytics-node/jose": ["[email protected]", "", {}, "sha512-s+3Al/p9g32Iq+oqXxkW//7jk2Vig6FF1CFqzVXoTUXt2qz89YWbL+OwS17NFYEvxC35n0FKeGO2LGYSxeM2Gg=="],++ "@shikijs/core/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "@shikijs/types/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "@slack/bolt/express": ["[email protected]", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="],++ "@slack/bolt/path-to-regexp": ["[email protected]", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],++ "@slack/socket-mode/eventemitter3": ["[email protected]", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="],++ "@slack/web-api/eventemitter3": ["[email protected]", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="],++ "@slack/web-api/is-stream": ["[email protected]", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="],++ "@slack/web-api/p-retry": ["[email protected]", "", { "dependencies": { "@types/retry": "0.12.0", "retry": "^0.13.1" } }, "sha512-312Id396EbJdvRONlngUx0NydfrIQ5lsYu0znKVUzVvArzEIt08V1qhtyESbGVd1FGX7UKtiFp5uwKZdM8wIuQ=="],++ "@tailwindcss/oxide-wasm32-wasi/@emnapi/core": ["@emnapi/[email protected]", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.3", "tslib": "^2.4.0" }, "bundled": true }, "sha512-zLpS5asjEb7lq8jYLq37N6XKaE41DIexlY1rF/z4/tIl3wo13Sqm28fRyfIsKZD+NZ8mM5RoKkpW/rBcuoSZSg=="],++ "@tailwindcss/oxide-wasm32-wasi/@emnapi/runtime": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA=="],++ "@tailwindcss/oxide-wasm32-wasi/@emnapi/wasi-threads": ["@emnapi/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-ELEBe8PsLvvJ6QMr0zLt8ffvOHW/dc1m3CEzNMg7aJUv3bMaoDtw2TXyDAwkYBuroxxuHEwhRTLJSe5sya547g=="],++ "@tailwindcss/oxide-wasm32-wasi/@napi-rs/wasm-runtime": ["@napi-rs/[email protected]", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" }, "bundled": true }, "sha512-UMduMbqO5s5zF2NkNacMT/yK5Y5QiKvWr2+50bzIIxFDwVJ2h49b+oyjaCGPhJxd2/gC2x39EHv/gHVuu36x2Q=="],++ "@tailwindcss/oxide-wasm32-wasi/@tybys/wasm-util": ["@tybys/[email protected]", "", { "dependencies": { "tslib": "^2.4.0" }, "bundled": true }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="],++ "@tailwindcss/oxide-wasm32-wasi/tslib": ["[email protected]", "", { "bundled": true }, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],++ "@tanstack/pacer/@tanstack/store": ["@tanstack/[email protected]", "", {}, "sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw=="],++ "@tanstack/react-router/@tanstack/react-store": ["@tanstack/[email protected]", "", { "dependencies": { "@tanstack/store": "0.9.3", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-y2iHd/N9OkoQbFJLUX1T9vbc2O9tjH0pQRgTcx1/Nz4IlwLvkgpuglXUx+mXt0g5ZDFrEeDnONPqkbfxXJKwRg=="],++ "@types/mdast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "@whatwg-node/node-fetch/@fastify/busboy": ["@fastify/[email protected]", "", {}, "sha512-tgK4O+57iz5ycYNGXE5ZWj1ES03lD2XnnBYWSbU/3wYZRMQzCUq7Ycds/RdyBZQeL5MU4fxBt6lzbIWf/Bickw=="],++ "accepts/mime-types": ["[email protected]", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],++ "axios/https-proxy-agent": ["[email protected]", "", { "dependencies": { "agent-base": "6", "debug": "4" } }, "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA=="],++ "better-call/@better-auth/utils": ["@better-auth/[email protected]", "", { "dependencies": { "@noble/hashes": "^2.0.1" } }, "sha512-BL8W4EfIZFwlu0r54m3v1ztjDhu6dDe/amLTm0xybmbZaNgYUqhD3SjpAsnq0q8YD6/ki4iwIgxJNLP/N3TxiA=="],++ "body-parser/debug": ["[email protected]", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],++ "body-parser/iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3" } }, "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA=="],++ "body-parser/raw-body": ["[email protected]", "", { "dependencies": { "bytes": "~3.1.2", "http-errors": "~2.0.1", "iconv-lite": "~0.4.24", "unpipe": "~1.0.0" } }, "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA=="],++ "chalk/ansi-styles": ["[email protected]", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="],++ "conf/ajv-formats": ["[email protected]", "", { "dependencies": { "ajv": "^8.0.0" } }, "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA=="],++ "conf/json-schema-typed": ["[email protected]", "", {}, "sha512-7DE8mpG+/fVw+dTpjbxnx47TaMnDfOI1jwft9g1VybltZCduyRQPJPvc+zzKY9WPHxhPWczyFuYa6I8Mw4iU5A=="],++ "conf/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="],++ "cross-spawn/which": ["[email protected]", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="],++ "cytoscape-fcose/cose-base": ["[email protected]", "", { "dependencies": { "layout-base": "^2.0.0" } }, "sha512-AzlgcsCbUMymkADOJtQm3wO9S3ltPfYOFD5033keQn9NJzIbtnZj+UdBJe7DYml/8TdbtHJW3j58SOnKhWY/5g=="],++ "d3-dsv/commander": ["[email protected]", "", {}, "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw=="],++ "d3-dsv/iconv-lite": ["[email protected]", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="],++ "d3-sankey/d3-array": ["[email protected]", "", { "dependencies": { "internmap": "^1.0.0" } }, "sha512-B0ErZK/66mHtEsR1TkPEEkwdy+WDesimkM5gpZr5Dsg54BiTA5RXtYW5qTLIAcekaS9xfZrzBLF/OAkB3Qn1YQ=="],++ "d3-sankey/d3-shape": ["[email protected]", "", { "dependencies": { "d3-path": "1" } }, "sha512-EUkvKjqPFUAZyOlhY5gzCxCeI0Aep04LwIRpsZ/mLFelJiUfnK56jo5JMDSE7yyP2kLSb6LtF+S5chMk7uqPqw=="],++ "dagre-d3-es/lodash-es": ["[email protected]", "", {}, "sha512-J8xewKD/Gk22OZbhpOVSwcs60zhd95ESDwezOFuA3/099925PdHJ7OFHNTGtajL3AlZkykD32HykiMo+BIBI8A=="],++ "dot-prop/is-obj": ["[email protected]", "", {}, "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="],++ "drizzle-kit/esbuild": ["[email protected]", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="],++ "enquirer/strip-ansi": ["[email protected]", "", { "dependencies": { "ansi-regex": "^5.0.1" } }, "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A=="],++ "express/debug": ["[email protected]", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],++ "finalhandler/debug": ["[email protected]", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],++ "form-data/mime-types": ["[email protected]", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],++ "gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],++ "hast-util-from-dom/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-from-html/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-from-html/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "hast-util-from-html-isomorphic/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-from-parse5/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-from-parse5/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-from-parse5/property-information": ["[email protected]", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="],++ "hast-util-from-parse5/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "hast-util-is-element/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-parse-selector/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-raw/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-raw/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-raw/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "hast-util-sanitize/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-to-html/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-to-html/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-to-html/hast-util-whitespace": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw=="],++ "hast-util-to-html/property-information": ["[email protected]", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="],++ "hast-util-to-jsx-runtime/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-to-jsx-runtime/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-to-jsx-runtime/hast-util-whitespace": ["[email protected]", "", { "dependencies": { "@types/hast": "^3.0.0" } }, "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw=="],++ "hast-util-to-jsx-runtime/property-information": ["[email protected]", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="],++ "hast-util-to-parse5/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-to-parse5/property-information": ["[email protected]", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="],++ "hast-util-to-text/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hast-util-to-text/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hastscript/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "hastscript/property-information": ["[email protected]", "", {}, "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg=="],++ "is-inside-container/is-docker": ["[email protected]", "", { "bin": { "is-docker": "cli.js" } }, "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ=="],++ "jsonwebtoken/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="],++ "katex/commander": ["[email protected]", "", {}, "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww=="],++ "log-symbols/chalk": ["[email protected]", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],++ "log-symbols/is-unicode-supported": ["[email protected]", "", {}, "sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ=="],++ "lru-memoizer/lru-cache": ["[email protected]", "", {}, "sha512-4pfM1Ff0x50o0tQwb5ucw/RzNyD0/YJME6IVcStalZuMWxdt3sR3huStTtxz4PUmvZfRguvDejasvQ2kifR11g=="],++ "mdast-util-definitions/@types/mdast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "^2" } }, "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ=="],++ "mdast-util-definitions/unist-util-visit": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", "unist-util-visit-parents": "^5.1.1" } }, "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg=="],++ "mdast-util-from-markdown/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-from-markdown/unist-util-stringify-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ=="],++ "mdast-util-math/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "mdast-util-mdx-expression/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "mdast-util-mdx-jsx/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "mdast-util-mdx-jsx/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-mdx-jsx/unist-util-stringify-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ=="],++ "mdast-util-mdxjs-esm/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "mdast-util-to-hast/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "mdast-util-to-hast/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "mdast-util-to-markdown/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mermaid/marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA=="],++ "micromatch/picomatch": ["[email protected]", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="],++ "npm-run-path/path-key": ["[email protected]", "", {}, "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ=="],++ "onetime/mimic-fn": ["[email protected]", "", {}, "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="],++ "ora/chalk": ["[email protected]", "", {}, "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA=="],++ "parse5/entities": ["[email protected]", "", {}, "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g=="],++ "pretty-format/react-is": ["[email protected]", "", {}, "sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w=="],++ "prompts/kleur": ["[email protected]", "", {}, "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w=="],++ "prop-types/react-is": ["[email protected]", "", {}, "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ=="],++ "react-markdown/remark-parse": ["[email protected]", "", { "dependencies": { "@types/mdast": "^3.0.0", "mdast-util-from-markdown": "^1.0.0", "unified": "^10.0.0" } }, "sha512-3ydxgHa/ZQzG8LvC7jTXccARYDcRld3VfcgIIFs7bI6vbRSxJJmzgLEIIoYKyrfhaY+ujuWaf/PJiMZXoiCXgw=="],++ "react-markdown/remark-rehype": ["[email protected]", "", { "dependencies": { "@types/hast": "^2.0.0", "@types/mdast": "^3.0.0", "mdast-util-to-hast": "^12.1.0", "unified": "^10.0.0" } }, "sha512-EFmR5zppdBp0WQeDVZ/b66CWJipB2q2VLNFMabzDSGR66Z2fQii83G5gTBbgGEnEEA0QRussvrFHxk1HWGJskw=="],++ "react-markdown/unified": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "bail": "^2.0.0", "extend": "^3.0.0", "is-buffer": "^2.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^5.0.0" } }, "sha512-pUSWAi/RAnVy1Pif2kAoeWNBa3JVrx0MId2LASj8G+7AiHWoKZNTomq6LG326T68U7/e263X6fTdcXIy7XnF7Q=="],++ "react-markdown/unist-util-visit": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0", "unist-util-visit-parents": "^5.1.1" } }, "sha512-MSd8OUGISqHdVvfY9TPhyK2VdUrPgxkUtWSuMHF6XAAFuL4LokseigBnZtPnJMu+FbynTkFNnFlyjxpVKujMRg=="],++ "rehype-katex/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "rehype-katex/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "rehype-raw/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "rehype-raw/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "rehype-sanitize/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "remark-rehype/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "remark-rehype/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "restore-cursor/onetime": ["[email protected]", "", { "dependencies": { "mimic-function": "^5.0.0" } }, "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ=="],++ "router/path-to-regexp": ["[email protected]", "", {}, "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA=="],++ "send/debug": ["[email protected]", "", { "dependencies": { "ms": "2.0.0" } }, "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA=="],++ "shadcn/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "shiki/@types/hast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "*" } }, "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g=="],++ "strip-ansi/ansi-regex": ["[email protected]", "", {}, "sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ=="],++ "style-to-js/style-to-object": ["[email protected]", "", { "dependencies": { "inline-style-parser": "0.2.7" } }, "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw=="],++ "type-graphql/semver": ["[email protected]", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA=="],++ "type-is/mime-types": ["[email protected]", "", { "dependencies": { "mime-db": "1.52.0" } }, "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw=="],++ "unified/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unified/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "unist-util-find-after/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unist-util-is/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unist-util-position/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unist-util-remove-position/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unist-util-visit/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "unist-util-visit-parents/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "uvu/diff": ["[email protected]", "", {}, "sha512-vtcDfH3TOjP8UekytvnHH1o1P4FcUdt4eQ1Y+Abap1tk/OB2MWQvcwS2ClCd1zuIhc3JKOx6p3kod8Vfys3E+A=="],++ "vfile/vfile-message": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-stringify-position": "^3.0.0" } }, "sha512-fa0Z6P8HUrQN4BZaX05SIVXic+7kE3b05PWAtPuYP9QLHsLKYR7/AlLW3NtOrpXRLeawpDLMsVkmk5DG0NXgWw=="],++ "vfile-location/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "vfile-location/vfile": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="],++ "vfile-message/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "vfile-message/unist-util-stringify-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^3.0.0" } }, "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ=="],++ "wsl-utils/is-wsl": ["[email protected]", "", { "dependencies": { "is-inside-container": "^1.0.0" } }, "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw=="],++ "@ag-ui/mcp-middleware/@ag-ui/client/@ag-ui/core": ["@ag-ui/[email protected]", "", { "dependencies": { "zod": "^3.22.4" } }, "sha512-Ilx31OvRQaZfU7jSArGqz06JZKOsAt8zWiCPJljyp9zR6Tzl18oyfx8o6FsuGfAktGRe50GI9SCCxNXXysZwtA=="],++ "@ag-ui/mcp-middleware/@ag-ui/client/@ag-ui/encoder": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.54", "@ag-ui/proto": "0.0.54" } }, "sha512-0dPuE/eAeBRBDj/OOj5AW8SoP1r0dufmoOdrtKgmf+dlbVXKSNkDDHGrrvIWFPxwvPTWhHeN6wnsVUayWpUsGg=="],++ "@ag-ui/mcp-middleware/@ag-ui/client/@ag-ui/proto": ["@ag-ui/[email protected]", "", { "dependencies": { "@ag-ui/core": "0.0.54", "@bufbuild/protobuf": "^2.2.5", "@protobuf-ts/protoc": "^2.11.1" } }, "sha512-IPF+xeFaBAKKP2FO74MaVTkKUP8VaGGkbPzORCvC5TLDdGs+oQgQFqz+XoBeksQGE14+jgLWiAr9EPXdhqr1NA=="],++ "@ag-ui/mcp-middleware/@ag-ui/client/zod": ["[email protected]", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="],++ "@ai-sdk/google-vertex/@ai-sdk/provider-utils/undici": ["[email protected]", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="],++ "@ai-sdk/openai-compatible/@ai-sdk/provider-utils/undici": ["[email protected]", "", { "dependencies": { "@fastify/busboy": "^2.0.0" } }, "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg=="],++ "@copilotkit/react-core/streamdown/lucide-react": ["[email protected]", "", { "peerDependencies": { "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-w3hD8/SQB7+lzU2r4VdFyzzOzKnUjTZIF/MQJGSSvni7Llewni4vuViRppfRAa2guOsY5k4jZyxw/i9DQHv+dw=="],++ "@copilotkit/react-core/streamdown/marked": ["[email protected]", "", { "bin": { "marked": "bin/marked.js" } }, "sha512-TI3V8YYWvkVf3KJe1dRkpnjs68JUPyEa5vjKrp1XEEJUAOaQc+Qj+L1qWbPd0SJuAdQkFU0h73sXXqwDYxsiDA=="],++ "@copilotkit/react-core/streamdown/remend": ["[email protected]", "", {}, "sha512-152puVH0qMoRJQFnaMG+rVDdf01Jq/CaED+MBuXExurJgdbkLp0c3TIe4R12o28Klx8uyGsjvFNG05aFG69G9w=="],++ "@dotenvx/dotenvx/execa/get-stream": ["[email protected]", "", {}, "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg=="],++ "@dotenvx/dotenvx/execa/human-signals": ["[email protected]", "", {}, "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw=="],++ "@dotenvx/dotenvx/execa/is-stream": ["[email protected]", "", {}, "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg=="],++ "@dotenvx/dotenvx/execa/npm-run-path": ["[email protected]", "", { "dependencies": { "path-key": "^3.0.0" } }, "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw=="],++ "@dotenvx/dotenvx/execa/signal-exit": ["[email protected]", "", {}, "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ=="],++ "@dotenvx/dotenvx/execa/strip-final-newline": ["[email protected]", "", {}, "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA=="],++ "@dotenvx/dotenvx/open/define-lazy-prop": ["[email protected]", "", {}, "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g=="],++ "@esbuild-kit/core-utils/esbuild/@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ=="],++ "@langchain/langgraph-sdk/p-queue/eventemitter3": ["[email protected]", "", {}, "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw=="],++ "@langchain/langgraph-sdk/p-queue/p-timeout": ["[email protected]", "", {}, "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg=="],++ "@modelcontextprotocol/sdk/express/accepts": ["[email protected]", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],++ "@modelcontextprotocol/sdk/express/body-parser": ["[email protected]", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="],++ "@modelcontextprotocol/sdk/express/content-disposition": ["[email protected]", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="],++ "@modelcontextprotocol/sdk/express/cookie-signature": ["[email protected]", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="],++ "@modelcontextprotocol/sdk/express/finalhandler": ["[email protected]", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],++ "@modelcontextprotocol/sdk/express/fresh": ["[email protected]", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="],++ "@modelcontextprotocol/sdk/express/merge-descriptors": ["[email protected]", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="],++ "@modelcontextprotocol/sdk/express/range-parser": ["[email protected]", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="],++ "@modelcontextprotocol/sdk/express/send": ["[email protected]", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],++ "@modelcontextprotocol/sdk/express/serve-static": ["[email protected]", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],++ "@modelcontextprotocol/sdk/express/type-is": ["[email protected]", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="],++ "@shikijs/core/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "@shikijs/types/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "@slack/bolt/express/accepts": ["[email protected]", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="],++ "@slack/bolt/express/body-parser": ["[email protected]", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="],++ "@slack/bolt/express/content-disposition": ["[email protected]", "", {}, "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g=="],++ "@slack/bolt/express/cookie-signature": ["[email protected]", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="],++ "@slack/bolt/express/finalhandler": ["[email protected]", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA=="],++ "@slack/bolt/express/fresh": ["[email protected]", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="],++ "@slack/bolt/express/merge-descriptors": ["[email protected]", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="],++ "@slack/bolt/express/range-parser": ["[email protected]", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="],++ "@slack/bolt/express/send": ["[email protected]", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="],++ "@slack/bolt/express/serve-static": ["[email protected]", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="],++ "@slack/bolt/express/type-is": ["[email protected]", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="],++ "@tanstack/react-router/@tanstack/react-store/@tanstack/store": ["@tanstack/[email protected]", "", {}, "sha512-8reSzl/qGWGGVKhBoxXPMWzATSbZLZFWhwBAFO9NAyp0TxzfBP0mIrGb8CP8KrQTmvzXlR/vFPPUrHTLBGyFyw=="],++ "accepts/mime-types/mime-db": ["[email protected]", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],++ "axios/https-proxy-agent/agent-base": ["[email protected]", "", { "dependencies": { "debug": "4" } }, "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ=="],++ "body-parser/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],++ "cross-spawn/which/isexe": ["[email protected]", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="],++ "cytoscape-fcose/cose-base/layout-base": ["[email protected]", "", {}, "sha512-dp3s92+uNI1hWIpPGH3jK2kxE2lMjdXdr+DH8ynZHpd6PUlH6x6cbuXnoMmiNumznqaNO31xu9e79F0uuZ0JFg=="],++ "d3-sankey/d3-shape/d3-path": ["[email protected]", "", {}, "sha512-VLaYcn81dtHVTjEHd8B+pbe9yHWpXKZUC87PzoFmsFrJqgFwDe/qxfp5MlfsfM1V5E/iVt0MmEbWQ7FVIXh/bg=="],++ "drizzle-kit/esbuild/@esbuild/aix-ppc64": ["@esbuild/[email protected]", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA=="],++ "drizzle-kit/esbuild/@esbuild/android-arm": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm" }, "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg=="],++ "drizzle-kit/esbuild/@esbuild/android-arm64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg=="],++ "drizzle-kit/esbuild/@esbuild/android-x64": ["@esbuild/[email protected]", "", { "os": "android", "cpu": "x64" }, "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg=="],++ "drizzle-kit/esbuild/@esbuild/darwin-arm64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg=="],++ "drizzle-kit/esbuild/@esbuild/darwin-x64": ["@esbuild/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA=="],++ "drizzle-kit/esbuild/@esbuild/freebsd-arm64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg=="],++ "drizzle-kit/esbuild/@esbuild/freebsd-x64": ["@esbuild/[email protected]", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ=="],++ "drizzle-kit/esbuild/@esbuild/linux-arm": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm" }, "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw=="],++ "drizzle-kit/esbuild/@esbuild/linux-arm64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ=="],++ "drizzle-kit/esbuild/@esbuild/linux-ia32": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ia32" }, "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA=="],++ "drizzle-kit/esbuild/@esbuild/linux-loong64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng=="],++ "drizzle-kit/esbuild/@esbuild/linux-mips64el": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw=="],++ "drizzle-kit/esbuild/@esbuild/linux-ppc64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA=="],++ "drizzle-kit/esbuild/@esbuild/linux-riscv64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "none" }, "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w=="],++ "drizzle-kit/esbuild/@esbuild/linux-s390x": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "s390x" }, "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg=="],++ "drizzle-kit/esbuild/@esbuild/linux-x64": ["@esbuild/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw=="],++ "drizzle-kit/esbuild/@esbuild/netbsd-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg=="],++ "drizzle-kit/esbuild/@esbuild/netbsd-x64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "x64" }, "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ=="],++ "drizzle-kit/esbuild/@esbuild/openbsd-arm64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A=="],++ "drizzle-kit/esbuild/@esbuild/openbsd-x64": ["@esbuild/[email protected]", "", { "os": "openbsd", "cpu": "x64" }, "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw=="],++ "drizzle-kit/esbuild/@esbuild/openharmony-arm64": ["@esbuild/[email protected]", "", { "os": "none", "cpu": "arm64" }, "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg=="],++ "drizzle-kit/esbuild/@esbuild/sunos-x64": ["@esbuild/[email protected]", "", { "os": "sunos", "cpu": "x64" }, "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w=="],++ "drizzle-kit/esbuild/@esbuild/win32-arm64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg=="],++ "drizzle-kit/esbuild/@esbuild/win32-ia32": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "ia32" }, "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ=="],++ "drizzle-kit/esbuild/@esbuild/win32-x64": ["@esbuild/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA=="],++ "express/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],++ "finalhandler/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],++ "form-data/mime-types/mime-db": ["[email protected]", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],++ "hast-util-from-dom/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-from-html-isomorphic/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-from-html/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-from-html/vfile/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-is-element/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-parse-selector/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-sanitize/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hast-util-to-parse5/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "hastscript/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-definitions/unist-util-visit/unist-util-is": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0" } }, "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw=="],++ "mdast-util-definitions/unist-util-visit/unist-util-visit-parents": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0" } }, "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg=="],++ "mdast-util-math/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-mdx-expression/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-mdxjs-esm/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-to-hast/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "mdast-util-to-hast/vfile/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "react-markdown/remark-parse/@types/mdast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "^2" } }, "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown": ["[email protected]", "", { "dependencies": { "@types/mdast": "^3.0.0", "@types/unist": "^2.0.0", "decode-named-character-reference": "^1.0.0", "mdast-util-to-string": "^3.1.0", "micromark": "^3.0.0", "micromark-util-decode-numeric-character-reference": "^1.0.0", "micromark-util-decode-string": "^1.0.0", "micromark-util-normalize-identifier": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0", "unist-util-stringify-position": "^3.0.0", "uvu": "^0.5.0" } }, "sha512-4xTO/M8c82qBcnQc1tgpNtubGUW/Y1tBQ1B0i5CtSoelOLKFYlElIr3bvgREYYO5iRqbMY1YuqZng0GVOI8Qww=="],++ "react-markdown/remark-rehype/@types/mdast": ["@types/[email protected]", "", { "dependencies": { "@types/unist": "^2" } }, "sha512-LnwD+mUEfxWMa1QpDraczIn6k0Ee3SMicuYSSzS6ZYl2gKS09EClnJYGd8Du6rfc5r/GZEk5o1mRb8TaTj03sQ=="],++ "react-markdown/remark-rehype/mdast-util-to-hast": ["[email protected]", "", { "dependencies": { "@types/hast": "^2.0.0", "@types/mdast": "^3.0.0", "mdast-util-definitions": "^5.0.0", "micromark-util-sanitize-uri": "^1.1.0", "trim-lines": "^3.0.0", "unist-util-generated": "^2.0.0", "unist-util-position": "^4.0.0", "unist-util-visit": "^4.0.0" } }, "sha512-pits93r8PhnIoU4Vy9bjW39M2jJ6/tdHyja9rrot9uujkN7UTU9SDnE6WNJz/IGyQk3XHX6yNNtrBH6cQzm8Hw=="],++ "react-markdown/unist-util-visit/unist-util-is": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0" } }, "sha512-u9njyyfEh43npf1M+yGKDGVPbY/JWEemg5nH05ncKPfi+kBbKBJoTdsogMu33uhytuLlv9y0O7GH7fEdwLdLQw=="],++ "react-markdown/unist-util-visit/unist-util-visit-parents": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0", "unist-util-is": "^5.0.0" } }, "sha512-x6+y8g7wWMyQhL1iZfhIPhDAs7Xwbn9nRosDXl7qoPTSCy0yNxnKc+hWokFifWQIDGi154rdUqKvbCa4+1kLhg=="],++ "rehype-katex/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "rehype-katex/vfile/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "rehype-raw/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "rehype-raw/vfile/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "rehype-sanitize/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "remark-rehype/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "remark-rehype/vfile/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "send/debug/ms": ["[email protected]", "", {}, "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="],++ "shiki/@types/hast/@types/unist": ["@types/[email protected]", "", {}, "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q=="],++ "style-to-js/style-to-object/inline-style-parser": ["[email protected]", "", {}, "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA=="],++ "type-is/mime-types/mime-db": ["[email protected]", "", {}, "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="],++ "@modelcontextprotocol/sdk/express/accepts/negotiator": ["[email protected]", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],++ "@modelcontextprotocol/sdk/express/body-parser/content-type": ["[email protected]", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],++ "@modelcontextprotocol/sdk/express/type-is/content-type": ["[email protected]", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],++ "@modelcontextprotocol/sdk/express/type-is/media-typer": ["[email protected]", "", {}, "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ=="],++ "@slack/bolt/express/accepts/negotiator": ["[email protected]", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="],++ "@slack/bolt/express/body-parser/content-type": ["[email protected]", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],++ "@slack/bolt/express/type-is/content-type": ["[email protected]", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="],++ "@slack/bolt/express/type-is/media-typer": ["[email protected]", "", {}, "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/mdast-util-to-string": ["[email protected]", "", { "dependencies": { "@types/mdast": "^3.0.0" } }, "sha512-V4Zn/ncyN1QNSqSBxTrMOLpjr+IKdHl2v3KVLoWmDPscP4r9GcCi71gjgvUV1SFSKh92AjAG4peFuBl2/YgCJg=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark": ["[email protected]", "", { "dependencies": { "@types/debug": "^4.0.0", "debug": "^4.0.0", "decode-named-character-reference": "^1.0.0", "micromark-core-commonmark": "^1.0.1", "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", "micromark-util-chunked": "^1.0.0", "micromark-util-combine-extensions": "^1.0.0", "micromark-util-decode-numeric-character-reference": "^1.0.0", "micromark-util-encode": "^1.0.0", "micromark-util-normalize-identifier": "^1.0.0", "micromark-util-resolve-all": "^1.0.0", "micromark-util-sanitize-uri": "^1.0.0", "micromark-util-subtokenize": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.1", "uvu": "^0.5.0" } }, "sha512-uD66tJj54JLYq0De10AhWycZWGQNUvDI55xPgk2sQM5kn1JYlhbCMTtEeT27+vAhW2FBQxLlOmS3pmA7/2z4aA=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-decode-numeric-character-reference": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "sha512-m9V0ExGv0jB1OT21mrWcuf4QhP46pH1KkfWy9ZEezqHKAxkj4mPCy3nIH1rkbdMlChLHX531eOrymlwyZIf2iw=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-decode-string": ["[email protected]", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-util-character": "^1.0.0", "micromark-util-decode-numeric-character-reference": "^1.0.0", "micromark-util-symbol": "^1.0.0" } }, "sha512-YphLGCK8gM1tG1bd54azwyrQRjCFcmgj2S2GoJDNnh4vYtnL38JS8M4gpxzOPNyHdNEpheyWXCTnnTDY3N+NVQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-normalize-identifier": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "sha512-N+w5vhqrBihhjdpM8+5Xsxy71QWqGn7HYNUvch71iV2PM7+E3uWGox1Qp90loa1ephtCxG2ftRV/Conitc6P2Q=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-symbol": ["[email protected]", "", {}, "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-types": ["[email protected]", "", {}, "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/micromark-util-sanitize-uri": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-encode": "^1.0.0", "micromark-util-symbol": "^1.0.0" } }, "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/unist-util-position": ["[email protected]", "", { "dependencies": { "@types/unist": "^2.0.0" } }, "sha512-kUBE91efOWfIVBo8xzh/uZQ7p9ffYRtUbMRZBNFYwf0RK8koUMx6dGUfwylLOKmaT2cs4wSW96QoYUSXAyEtpg=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark": ["[email protected]", "", { "dependencies": { "decode-named-character-reference": "^1.0.0", "micromark-factory-destination": "^1.0.0", "micromark-factory-label": "^1.0.0", "micromark-factory-space": "^1.0.0", "micromark-factory-title": "^1.0.0", "micromark-factory-whitespace": "^1.0.0", "micromark-util-character": "^1.0.0", "micromark-util-chunked": "^1.0.0", "micromark-util-classify-character": "^1.0.0", "micromark-util-html-tag-name": "^1.0.0", "micromark-util-normalize-identifier": "^1.0.0", "micromark-util-resolve-all": "^1.0.0", "micromark-util-subtokenize": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.1", "uvu": "^0.5.0" } }, "sha512-BgHO1aRbolh2hcrzL2d1La37V0Aoz73ymF8rAcKnohLy93titmv62E0gP8Hrx9PKcKrqCZ1BbLGbP3bEhoXYlw=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-factory-space": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-cRzEj7c0OL4Mw2v6nwzttyOZe8XY/Z8G0rzmWQZTBi/jjwyw/U4uqKtUORXQrR5bAZZnbTI/feRV/R7hc4jQYQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-character": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-chunked": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0" } }, "sha512-Ye01HXpkZPNcV6FiyoW2fGZDUw4Yc7vT0E9Sad83+bEDiCJ1uXu0S3mr8WLpsz3HaG3x2q0HM6CTuPdcZcluFQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-combine-extensions": ["[email protected]", "", { "dependencies": { "micromark-util-chunked": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-Q20sp4mfNf9yEqDL50WwuWZHUrCO4fEyeDCnMGmG5Pr0Cz15Uo7KBs6jq+dq0EgX4DPwwrh9m0X+zPV1ypFvUA=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-encode": ["[email protected]", "", {}, "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-resolve-all": ["[email protected]", "", { "dependencies": { "micromark-util-types": "^1.0.0" } }, "sha512-b/G6BTMSg+bX+xVCshPTPyAu2tmA0E4X98NSR7eIbeC6ycCqCeE7wjfDIgzEbkzdEVJXRtOG4FbEm/uGbCRouA=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-sanitize-uri": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-encode": "^1.0.0", "micromark-util-symbol": "^1.0.0" } }, "sha512-QO4GXv0XZfWey4pYFndLUKEAktKkG5kZTdUNaTAkzbuJxn2tNBOr+QtxR2XpWaMhbImT2dPzyLrPXLlPhph34A=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-util-subtokenize": ["[email protected]", "", { "dependencies": { "micromark-util-chunked": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0", "uvu": "^0.5.0" } }, "sha512-kUQHyzRoxvZO2PuLzMt2P/dwVsTiivCK8icYTeR+3WgbuPqfHgPPy7nFKbeqRivBvn/3N3GBiNC+JRTMSxEC7A=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark-util-decode-string/micromark-util-character": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/micromark-util-sanitize-uri/micromark-util-character": ["[email protected]", "", { "dependencies": { "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-lXraTwcX3yH/vMDaFWCQJP1uIszLVebzUa3ZHdrgxr7KEU/9mL4mVgCpGbyhvNLNlauROiNUq7WN5u7ndbY6xg=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/micromark-util-sanitize-uri/micromark-util-encode": ["[email protected]", "", {}, "sha512-EuEzTWSTAj9PA5GOAs992GzNh2dGQO52UvAbtSOMvXTxv3Criqb6IOzJUBCmEqrrXSblJIJBbFFv6zPxpreiJw=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/micromark-util-sanitize-uri/micromark-util-symbol": ["[email protected]", "", {}, "sha512-uEjpEYY6KMs1g7QfJ2eX1SQEV+ZT4rUD3UcF6l57acZvLNK7PBZL+ty82Z1qhK1/yXIY4bdx04FKMgR0g4IAag=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-factory-destination": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-XaNDROBgx9SgSChd69pjiGKbV+nfHGDPVYFs5dOoDd7ZnMAE+Cuu91BCpsY8RT2NP9vo/B8pds2VQNCLiu0zhg=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-factory-label": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0", "uvu": "^0.5.0" } }, "sha512-OLtyez4vZo/1NjxGhcpDSbHQ+m0IIGnT8BoPamh+7jVlzLJBH98zzuCoUeMxvM6WsNeh8wx8cKvqLiPHEACn0w=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-factory-title": ["[email protected]", "", { "dependencies": { "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-J7n9R3vMmgjDOCY8NPw55jiyaQnH5kBdV2/UXCtZIpnHH3P6nHUKaH7XXEYuWwx/xUJcawa8plLBEjMPU24HzQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-factory-whitespace": ["[email protected]", "", { "dependencies": { "micromark-factory-space": "^1.0.0", "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-v2WlmiymVSp5oMg+1Q0N1Lxmt6pMhIHD457whWM7/GUlEks1hI9xj5w3zbc4uuMKXGisksZk8DzP2UyGbGqNsQ=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-util-classify-character": ["[email protected]", "", { "dependencies": { "micromark-util-character": "^1.0.0", "micromark-util-symbol": "^1.0.0", "micromark-util-types": "^1.0.0" } }, "sha512-SL0wLxtKSnklKSUplok1WQFoGhUdWYKggKUiqhX+Swala+BtptGCu5iPRc+xvzJ4PXE/hwM3FNXsfEVgoZsWbw=="],++ "react-markdown/remark-parse/mdast-util-from-markdown/micromark/micromark-core-commonmark/micromark-util-html-tag-name": ["[email protected]", "", {}, "sha512-VTQzcuQgFUD7yYztuQFKXT49KghjtETQ+Wv/zUjGSGBioZnkA4P1XXZPT1FHeJA6RwRXSF47yvJ1tsJdoxwO+Q=="],++ "react-markdown/remark-rehype/mdast-util-to-hast/micromark-util-sanitize-uri/micromark-util-character/micromark-util-types": ["[email protected]", "", {}, "sha512-ukRBgie8TIAcacscVHSiddHjO4k/q3pnedmzMQ4iwDcK0FtFCohKOlFbaOL/mPgfnPsL3C1ZyxJa4sbWrBl3jg=="],+ }+}diff --git a/bunfig.toml b/bunfig.tomlnew file mode 100644index 00000000..b599e7d8--- /dev/null+++ b/bunfig.toml@@ -0,0 +1,4 @@+[test]+# See server/scripts/test-preload.ts: makes the module graph deterministic so a test file cannot fail to+# import depending on the order the suite happened to be walked.+preload = ["./server/scripts/test-preload.ts"]diff --git a/docker-compose.yml b/docker-compose.ymlnew file mode 100644index 00000000..1301eef4--- /dev/null+++ b/docker-compose.yml@@ -0,0 +1,202 @@+services:+ postgres:+ image: pgvector/pgvector:pg17+ environment:+ POSTGRES_DB: openbot+ POSTGRES_USER: openbot+ POSTGRES_PASSWORD: openbot+ ports:+ - "${POSTGRES_PORT:-5432}:5432"+ volumes:+ - postgres-data:/var/lib/postgresql/data+ healthcheck:+ test: ["CMD-SHELL", "pg_isready -U openbot -d openbot"]+ interval: 5s+ timeout: 5s+ retries: 10++ migrate:+ build:+ context: .+ dockerfile: server/Dockerfile+ command: ["bun", "x", "drizzle-kit", "migrate", "--config=drizzle.config.ts"]+ environment:+ DATABASE_URL: postgres://openbot:openbot@postgres:5432/openbot+ depends_on:+ postgres:+ condition: service_healthy+ restart: "no"++ # The Bot's computer is long-lived so browser sessions remain signed in across turns.+ agent-computer:+ build:+ context: .+ dockerfile: agent-computer/Dockerfile+ # Tagged explicitly because the supervisor starts one computer per Bot from this image by name,+ # and a Compose-derived name would change with the project.+ image: ${COMPUTER_IMAGE:-openbot-agent-computer:latest}+ ports:+ # Loopback only. This process drives a browser holding real logins; COMPUTER_TOKEN is the+ # request control, and loopback keeps the surface off routed networks.+ - "127.0.0.1:${COMPUTER_PORT:-4100}:4100"+ environment:+ # The secret every caller must present. The container refuses to start without it.+ COMPUTER_TOKEN: ${COMPUTER_TOKEN:-}+ volumes:+ - agent-workspace:/workspace+ # Chromium's user-data directory is volume-backed so logins survive container restarts.+ - agent-profiles:/profiles+ # Gives Chromium time to flush its profile after SIGTERM before Docker sends SIGKILL.+ stop_grace_period: 30s+ healthcheck:+ test: ["CMD-SHELL", "bun -e \"await fetch('http://localhost:4100/health')\""]+ interval: 10s+ timeout: 5s+ retries: 5++ # Bot identity is attested by SPIRE when these optional services run.+ #+ # SPIRE issues each computer an SVID based on the container labels set by the supervisor. A+ # computer cannot claim another Bot's identity, and an unregistered container receives no identity.+ #+ # Optional. Without these two services the product runs without workload identity and reports that+ # state explicitly.+ # Fresh named volumes arrive owned by root, while SPIRE runs as uid 1000. This one-shot service+ # assigns ownership without running the CA or agent as root.+ spire-init:+ image: busybox:1.37+ command: ["sh", "-c", "chown -R 1000:1000 /server /agent"]+ user: "0:0"+ volumes:+ - spire-server-data:/server+ - spire-agent-data:/agent++ spire-server:+ image: ghcr.io/spiffe/spire-server:1.15.1+ depends_on:+ spire-init:+ condition: service_completed_successfully+ command: ["-config", "/opt/spire/conf/server.conf"]+ volumes:+ - ./spire/server.conf:/opt/spire/conf/server.conf:ro+ # Mounted at the directory the image already owns so SPIRE can create its datastore as uid 1000.+ - spire-server-data:/opt/spire/data+ - spire-server-socket:/tmp/spire-server/private+ healthcheck:+ test: ["CMD", "/opt/spire/bin/spire-server", "healthcheck"]+ interval: 10s+ timeout: 5s+ retries: 5++ spire-agent:+ image: ghcr.io/spiffe/spire-agent:1.15.1+ command: ["-config", "/opt/spire/conf/agent.conf", "-joinToken", "${SPIRE_JOIN_TOKEN:-openbot-dev-token}"]+ # The agent must see the caller's process to map the Workload API peer to a Docker container. The+ # host PID namespace is required because the attestor reads the peer cgroup from that pid.+ pid: host+ depends_on:+ spire-server:+ condition: service_healthy+ spire-init:+ condition: service_completed_successfully+ volumes:+ - ./spire/agent.conf:/opt/spire/conf/agent.conf:ro+ - spire-agent-socket:/tmp/spire-agent/public+ - spire-agent-data:/opt/spire/data+ # Read-only, and only so the docker workload attestor can see which container is asking.+ - /var/run/docker.sock:/var/run/docker.sock:ro++ # One computer per Bot.+ #+ # Each Bot gets a container with its own files, browser session and processes. The Docker socket is+ # root-equivalent on the host, so only the supervisor holds it and only exposes Bot-level verbs.+ # The SPIRE agent mounts the socket read-only to attest workloads and creates nothing.+ supervisor:+ build:+ context: .+ dockerfile: supervisor/Dockerfile+ environment:+ PORT: "4300"+ # Shared with the API server. The Bot-level verb set is the boundary; this token keeps other+ # services on the network from calling those verbs.+ SUPERVISOR_TOKEN: ${SUPERVISOR_TOKEN:-}+ # Handed to every computer this creates, so the server and the computers share one secret.+ COMPUTER_TOKEN: ${COMPUTER_TOKEN:-}+ COMPUTER_IMAGE: ${COMPUTER_IMAGE:-openbot-agent-computer:latest}+ # Which deployment the computers it creates belong to, so two stacks on one Docker host never+ # derive the same container and volume names for the same Bot.+ COMPUTER_NAMESPACE: ${COMPUTER_NAMESPACE:-openbot}+ # Empty by default because the API server runs on the host in local development and reaches+ # computers by published loopback ports. Deployments running the server inside this network set+ # the network name so computers publish no host ports.+ COMPUTER_NETWORK: ${COMPUTER_NETWORK:-}+ # Set to runsc to run every computer under gVisor, when the host has it. Left unset each+ # computer is an ordinary container and shares the host kernel.+ COMPUTER_RUNTIME: ${COMPUTER_RUNTIME:-}+ # Identity, when SPIRE is part of this deployment. The supervisor registers an entry per Bot+ # and mounts the agent's socket into that Bot's computer so it can fetch its own SVID.+ SPIRE_SOCKET: /tmp/spire-server/private/api.sock+ SPIRE_TRUST_DOMAIN: openbot.local+ SPIRE_AGENT_ID: spiffe://openbot.local/spire/agent/join_token/${SPIRE_JOIN_TOKEN:-openbot-dev-token}+ SPIRE_AGENT_SOCKET_VOLUME: ${COMPOSE_PROJECT_NAME:-openbot}_spire-agent-socket+ ports:+ # For the server on the host to ask for a Bot's computer.+ - "${SUPERVISOR_PORT:-4500}:4300"+ volumes:+ # Read-only because this service only ever needs to ask; it is still root-equivalent, which is+ # the whole reason nothing else here gets it.+ - /var/run/docker.sock:/var/run/docker.sock:ro+ # To register an entry per Bot as each computer is created.+ - spire-server-socket:/tmp/spire-server/private+ healthcheck:+ test: ["CMD-SHELL", "bun -e \"await fetch('http://localhost:4300/health')\""]+ interval: 10s+ timeout: 5s+ retries: 5++ # The built-in Bot is an AG-UI endpoint registered the same way as a customer-provided Bot.+ agent-bot:+ build:+ context: .+ dockerfile: agent-bot/Dockerfile+ ports:+ - "${BOT_PORT:-4200}:4200"+ environment:+ OPENAI_API_KEY: ${OPENAI_API_KEY}+ BOT_MODEL: ${BOT_MODEL:-gpt-5.5}+ healthcheck:+ test: ["CMD-SHELL", "bun -e \"await fetch('http://localhost:4200/health')\""]+ interval: 10s+ timeout: 5s+ retries: 5++ # The same Bot behavior on a framework, exposed as another AG-UI endpoint and registry row.+ agent-langgraph:+ build:+ context: .+ dockerfile: agent-langgraph/Dockerfile+ ports:+ - "${LANGGRAPH_PORT:-4201}:4201"+ environment:+ # The selected provider reads its own key. Models requiring the Responses API use+ # BOT_RESPONSES_API instead of changing the streaming loop here.+ BOT_PROVIDER: ${BOT_PROVIDER:-openai}+ OPENAI_API_KEY: ${OPENAI_API_KEY:-}+ ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}+ GOOGLE_API_KEY: ${GOOGLE_API_KEY:-}+ BOT_MODEL: ${BOT_MODEL:-}+ BOT_RESPONSES_API: ${BOT_RESPONSES_API:-false}+ healthcheck:+ test: ["CMD-SHELL", "bun -e \"await fetch('http://localhost:4201/health')\""]+ interval: 10s+ timeout: 5s+ retries: 5++volumes:+ postgres-data:+ agent-workspace:+ spire-server-data:+ spire-server-socket:+ spire-agent-socket:+ spire-agent-data:+ agent-profiles:diff --git a/docs/configuration.md b/docs/configuration.mdnew file mode 100644index 00000000..0aa48bd2--- /dev/null+++ b/docs/configuration.md@@ -0,0 +1,253 @@+# Configuration++OpenBot is configured with environment variables and a tenant package. The API server validates both at startup.++## Environment setup++```sh+cp .env.example .env+```++Fill the required values, then run:++```sh+bash scripts/start.sh+```++## Required API server variables++| Variable | Meaning |+| ----------------------------- | ----------------------------------------------------------------------------------------------------- |+| `DATABASE_URL` | PostgreSQL connection string. |+| `KEY_ENCRYPTION_KEY` | Base64-encoded 32-byte key for encrypted stored credentials. Generate with `openssl rand -base64 32`. |+| `MANAGED_AGENT_AG_UI_URL` | Default AG-UI endpoint for teammates created in the product. Must be HTTP(S). |+| `INTELLIGENCE_API_URL` | CopilotKit Intelligence API URL. |+| `INTELLIGENCE_GATEWAY_WS_URL` | CopilotKit Intelligence realtime gateway URL. |+| `INTELLIGENCE_API_KEY` | Runtime key for the Intelligence project. |+| `COPILOTKIT_LICENSE_TOKEN` | License token for the Intelligence project. |++All four Intelligence values are required together. Missing any of them stops server startup.++## General variables++| Variable | Default | Meaning |+| -------------------- | ---------------------------------- | ------------------------------------------------------------------- |+| `PORT` | `3001` | API server port. |+| `NODE_ENV` | unset | `production` enables startup refusals for local-only settings. |+| `TENANT_PACKAGE_DIR` | `../examples/fintech` | Tenant package directory, resolved from `server/`. |+| `DEPLOYMENT_ID` | the tenant package's id | Names this deployment inside a shared Intelligence project. |+| `OPENAI_API_KEY` | unset | Default model key for built-in agents and both shipped Bots. |+| `BOT_PROVIDER` | `openai` | Provider for `agent-langgraph`: `openai`, `anthropic`, or `google`. |+| `ANTHROPIC_API_KEY` | unset | Anthropic key when `BOT_PROVIDER=anthropic`. |+| `GOOGLE_API_KEY` | unset | Google key when `BOT_PROVIDER=google`. |+| `BOT_MODEL` | provider default from Bot code/env | Model used by the shipped Bots. |+| `BOT_RESPONSES_API` | `false` | Makes `agent-langgraph` use the OpenAI Responses API. |++## Authentication++| Variable | Meaning |+| ---------------------------- | -------------------------------------------------------------------------------------- |+| `OPENBOT_DEV_NO_AUTH` | Local-only fixed administrator when set to `true`. Refused with `NODE_ENV=production`. |+| `GOOGLE_OAUTH_CLIENT_ID` | Google OAuth client id. |+| `GOOGLE_OAUTH_CLIENT_SECRET` | Google OAuth client secret. |+| `BETTER_AUTH_SECRET` | At least 32 characters. Required with Google OAuth. |+| `BETTER_AUTH_URL` | Public API server base URL. Required with Google OAuth. |+| `TRUSTED_ORIGINS` | Comma-separated app origins accepted by the API. |+| `INITIAL_ADMIN_EMAILS` | Comma-separated users seeded as administrators. |++Google OAuth client id and secret must be configured together. If Google OAuth is configured, `BETTER_AUTH_SECRET` and `BETTER_AUTH_URL` are also required.++## Computer and supervisor++| Variable | Meaning |+| ------------------------------------ | ----------------------------------------------------------------------------------------- |+| `AGENT_COMPUTER_URL` | Shared computer URL. If absent, computer routes are not mounted. |+| `COMPUTER_TOKEN` | Secret every computer request must present. The computer refuses to start without it. |+| `COMPUTER_SUPERVISOR_URL` | Supervisor URL for per-Bot computers. If absent, Bots share `AGENT_COMPUTER_URL`. |+| `SUPERVISOR_TOKEN` | Bearer token required by the supervisor. |+| `AGENT_COMPUTER_ALLOW_PRIVATE_HOSTS` | Local-only private-host browsing when `true`. Cloud metadata addresses are still refused. |+| `AGENT_COMPUTER_POLICY` | JSON action policy: `{"mode":"enforce","deny":[...],"allow":[...]}`. |+| `COMPUTER_RUNTIME` | Set to `runsc` to run supervised computers under gVisor. |++`agent-computer` also reads:++- `ACTION_TIMEOUT_MS`+- `NAVIGATION_TIMEOUT_MS`+- `WORKSPACE_DIR`+- `PROFILES_DIR`+- `COMPUTER_BOT_ID`+- `EGRESS_PROXY_DEFAULT`+- `EGRESS_PROXY_<BOT_ID>`++The supervisor also reads:++- `COMPUTER_IMAGE`+- `COMPUTER_NAMESPACE`+- `COMPUTER_NETWORK`+- `COMPUTER_MEMORY_BYTES`+- `DOCKER_SOCKET`++`COMPUTER_NAMESPACE` defaults to `openbot` and names the deployment a computer belongs to. It is part+of every container and volume name the supervisor derives, and the supervisor acts only on computers+carrying it, so two deployments on one Docker host never adopt each other's.++Per-Bot computers belong to the supervisor rather than to Compose, so `docker compose down -v` does+not remove them: their containers keep running and their profile volumes, which hold whatever the+Bots are signed in to, survive. Remove them by the label the supervisor sets:++```sh+docker ps -aq --filter "label=openbot.namespace=openbot" | xargs -r docker rm -f+docker volume ls -q --filter "label=openbot.namespace=openbot" | xargs -r docker volume rm+```++Proxy credentials may appear in proxy URLs, but the computer strips them before reporting proxy status.++## Attested identity++When optional SPIRE services are used:++- the supervisor reads `SPIRE_SOCKET`, `SPIRE_AGENT_ID`, `SPIRE_TRUST_DOMAIN`, and `SPIRE_AGENT_SOCKET_VOLUME`;+- computers read `SPIFFE_ENDPOINT_SOCKET`;+- Compose also uses `SPIRE_JOIN_TOKEN` and `COMPOSE_PROJECT_NAME`.++## Ports++| Service | Default port | Setting |+| ----------------- | -------------------------- | ----------------- |+| `app` | 3010 | `APP_PORT` |+| `server` | 3001 | `SERVER_PORT` |+| `agent-computer` | 4100 | `COMPUTER_PORT` |+| `agent-bot` | 4200 | `BOT_PORT` |+| `agent-langgraph` | 4201 | `LANGGRAPH_PORT` |+| `supervisor` | 4500 host / 4300 container | `SUPERVISOR_PORT` |+| PostgreSQL | 5432 | `POSTGRES_PORT` |++Set these in `.env` or in the environment. `docker-compose.yml` publishes on them and+`scripts/start.sh` reads the same names to decide where to look, so one setting moves a service and+everything that talks to it. The addresses built from them are separate settings, so a moved service+also needs its URL changed: `DATABASE_URL`, `AGENT_COMPUTER_URL` and `MANAGED_AGENT_AG_UI_URL`.++To run two deployments on one Docker host, give the second one its own `COMPOSE_PROJECT_NAME`,+`COMPUTER_NAMESPACE` and `COMPUTER_IMAGE`. Container and volume names are global to a host, and the+namespace is what keeps each deployment's per-Bot computers its own.++Give it its own `DEPLOYMENT_ID` as well when it shares an Intelligence project, which a copy made+from the same `.env` does. Threads are listed per Bot and carry nothing else that says where a+conversation came from, so the name goes into every thread id a deployment mints and is how its own+conversations stay tellable from the other's.++Set `OPENBOT_ONE_COMPUTER_EACH=false` when using `start.sh` to run all Bots against one shared computer.++## Tenant package++The tenant package contains five required YAML files:++```text+examples/fintech/+├── brand.yaml+├── agents.yaml+├── channels.yaml+├── model.yaml+└── knowledge.yaml+```++### `brand.yaml`++```yaml+tenant:+ id: openbot+ product_name: OpenBot+```++Optional theme:++```yaml+skin:+ stylesheet: theme.css+```++Theme CSS may define only `:root` and `.dark` blocks, approved theme variables, and no `@import` or `url()`.++### `agents.yaml`++```yaml+agents:+ - id: knowledge+ name: Knowledge+ title: Company Knowledge+ role_description: Answer company knowledge questions and cite sources.+ avatar_seed: knowledge+ type: built-in+ system_prompt: Answer from authorized company knowledge and cite every source.++ - id: risk-analyst+ name: Risk Analyst+ title: Risk & Compliance+ role_description: Investigate policies and controls.+ type: remote-ag-ui+ endpoint: ${MANAGED_AGENT_AG_UI_URL}+```++Each agent requires `id`, `name`, `title`, `role_description`, and `type`.++| Type | Required field |+| -------------- | --------------- |+| `built-in` | `system_prompt` |+| `remote-ag-ui` | `endpoint` |++Any `${NAME}` in a package file is replaced with that environment variable, so one package works+against a local stack, a staging one and production. `${NAME:-fallback}` uses the fallback when the+name is unset or empty, which is how the example package points at the Bot in the box without+requiring any configuration. A name with neither a value nor a fallback stops the server with a+message saying which file wanted it, rather than leaving a Bot pointed at an address nobody meant.++### `channels.yaml`++```yaml+channels:+ - id: risk-and-compliance+ name: Risk & Compliance+ description: Investigate policies and controls.+ permitted_agents: [knowledge, risk-analyst]+ allowed_groups: [risk, compliance]+```++Each channel requires `id`, `name`, `description`, `permitted_agents`, and `allowed_groups`. Every `permitted_agents` entry must match an agent id.++### `model.yaml`++```yaml+model:+ provider: openai+ credential_secret_ref: openai-api-key+ default_model: gpt-4.1+```++`provider` must be `openai`. `credential_secret_ref` is a reference to a stored credential, not a credential value.++### `knowledge.yaml`++```yaml+sources:+ - type: google-drive+ roots: [Policies, Compliance]+ - type: microsoft-onedrive+ roots: [Risk, Operations]+```++Supported source types are `google-drive` and `microsoft-onedrive`.++## Change workflow++1. Edit the relevant `.env` value or tenant YAML file.+2. Check cross-file references, especially `channels[].permitted_agents`.+3. Keep credential values and service-account JSON out of YAML.+4. Restart the API server; invalid configuration stops startup.+5. Run:++ ```sh+ bun run format:check+ bun run lint+ bun run typecheck+ bun run test+ ```diff --git a/docs/teammates.md b/docs/teammates.mdnew file mode 100644index 00000000..b7024967--- /dev/null+++ b/docs/teammates.md@@ -0,0 +1,99 @@+# Teammates++A teammate is a Bot with a durable profile and standing role. The role is sent with every run so the user does not have to restate the job in each channel.++## Data model++| Piece | Table | Purpose |+| -------------------- | ------------------------------- | --------------------------------------------------------------------- |+| Runtime agent | `agents` | AG-UI endpoint and optional key reference. |+| Profile | `agent_profiles` | Name, title, role, avatar seed, owner, visibility, and soft deletion. |+| Personal roster | `agent_preferences` | Per-user hidden state. |+| Channel | `channels` | Conversation membership and teammate binding. |+| Intelligence mapping | `intelligence_channel_mappings` | Channel-to-thread mapping. |++Package-provided agents are public and ownerless. User-created teammates are owned by the creator.++## Standing role++Remote teammates receive a system message derived from their title and role description:++```text+You are Expense Manager, Finance Operations.++Review receipts, categorize expenses, and prepare reimbursement reports.++This standing role applies in every channel. Treat channel messages as task-specific instructions within it.+```++The message is ordinary AG-UI system content, so it works with any AG-UI-compatible backend. Editing the role affects the next run.++## Visibility++| Visibility | Who can see and run it |+| ---------- | --------------------------- |+| `private` | Owner and administrators. |+| `public` | Everyone in the deployment. |++Filtering happens in server/database queries. Package-provided agents cannot be edited or deleted through the product.++## Channels++Starting a channel creates a new conversation and Intelligence thread. Two channels with the same teammate stay separate.++Each channel routes through a channel-local proxy agent id, pinned to that channel's thread id, then forwards to the teammate runtime id.++## Deleting and hiding++Deleting is soft. The teammate stops running, but existing channels remain readable for their members and restore as tombstones.++Hiding is personal roster state. It removes the teammate from one user's list without disabling the teammate for anyone else.++## Default endpoint++Product-created teammates use:++```dotenv+MANAGED_AGENT_AG_UI_URL=http://localhost:4200/ag-ui+```++The server requires this setting at startup. Package-provided agents use their own `agents.yaml` configuration.++## Register an external AG-UI agent++In `agents.yaml`:++```yaml+agents:+ - id: risk+ name: Risk+ title: Risk & Compliance+ role_description: Investigate policies and controls.+ type: remote-ag-ui+ endpoint: http://risk.internal/ag-ui+```++In the product, create or edit a teammate from `/agents` and set:++- name;+- title;+- role description;+- visibility;+- optional endpoint;+- optional authorization header.++Endpoint registration uses target checks. Cloud metadata addresses are refused under every configuration. Optional keys are write-only: sending a key stores/replaces it, omitting it keeps the existing key, and APIs do not return it.++`POST /api/agents/test-connection` checks whether an endpoint answers before saving it.++## Capabilities++A teammate's role does not grant capabilities. Capabilities are governed separately:++- browser and file actions go through the computer gateway policy;+- components are published deployment-wide and can be withheld per Bot;+- MCP tools are granted per Bot by administrators;+- personal skills can be attached only to Bots the author owns;+- deployment skills are managed by administrators.++See [architecture.md](architecture.md).diff --git a/examples/fintech/channels.yaml b/examples/fintech/channels.yamlnew file mode 100644index 00000000..0e5e243c--- /dev/null+++ b/examples/fintech/channels.yaml@@ -0,0 +1,16 @@+channels:+ - id: general-assistant+ name: General Assistant+ description: Ask for help with everyday work.+ permitted_agents: [general-assistant]+ allowed_groups: [all]+ - id: risk-and-compliance+ name: Risk & Compliance+ description: Investigate policies, transaction monitoring, and control evidence.+ permitted_agents: [knowledge, risk-analyst]+ allowed_groups: [risk, compliance]+ - id: company-knowledge+ name: Company Knowledge+ description: Find authorized answers from company documents.+ permitted_agents: [knowledge]+ allowed_groups: [all]diff --git a/examples/mastra-bot/src/index.ts b/examples/mastra-bot/src/index.tsnew file mode 100644index 00000000..88057059--- /dev/null+++ b/examples/mastra-bot/src/index.ts@@ -0,0 +1,232 @@+import type { BaseEvent, RunAgentInput } from "@ag-ui/core";+import { EventEncoder } from "@ag-ui/encoder";+import { openai } from "@ai-sdk/openai";+import { Agent } from "@mastra/core/agent";+import { serve } from "bun";++/**+ * A Bot written in Mastra.+ *+ * This and the LangGraph example share no OpenBot-specific code beyond the AG-UI protocol. Tools+ * arrive in `input.tools` from the surface, so both drive a governed browser they have no direct+ * access to.+ *+ * `@ag-ui/mastra` exists and is the client side, it lets a CopilotKit runtime call a Mastra agent. A+ * Bot here has to be the server, so this emits AG-UI directly with `@ag-ui/encoder`, the same shape+ * as `agent-bot` and the LangGraph example.+ */++const PORT = Number.parseInt(process.env.PORT ?? "4400", 10);+const MODEL = process.env.BOT_MODEL ?? "gpt-5.5";++const bot = new Agent({+ name: "OpenBot Mastra teammate",+ instructions:+ "You are a Bot running on Mastra inside OpenBot. You have a real web browser available through " ++ "the tools you are given.\n\n" ++ // Same guard as the LangGraph example: page contents require a fresh tool result.+ "NEVER state what a page contains unless you have just read it with a tool in this conversation. " ++ "You cannot know a page's contents from memory. If you have not read it, call the tool first, " ++ "and report exactly what the tool returned.",+ model: openai(MODEL),+});++/**+ * The conversation, in the shape Mastra takes.+ *+ * The whole history, including tool results. A tool call and its result must come back as a matched+ * pair in the AI-SDK shapes Mastra passes through, or the model has no evidence its own action worked.+ */+function toMastraMessages(input: RunAgentInput) {+ const messages: Array<Record<string, unknown>> = [];++ for (const message of input.messages ?? []) {+ const content = typeof message.content === "string" ? message.content : "";++ if (message.role === "user" && content) {+ messages.push({ role: "user", content });+ continue;+ }++ if (message.role === "assistant") {+ const toolCalls = (+ message as {+ toolCalls?: {+ id: string;+ function: { name: string; arguments: string };+ }[];+ }+ ).toolCalls;+ if (toolCalls?.length) {+ messages.push({+ role: "assistant",+ content: toolCalls.map((call) => ({+ type: "tool-call",+ toolCallId: call.id,+ toolName: call.function.name,+ args: safeArgs(call.function.arguments),+ })),+ });+ } else if (content) {+ messages.push({ role: "assistant", content });+ }+ continue;+ }++ if (message.role === "tool") {+ const toolCallId = (message as { toolCallId?: string }).toolCallId;+ if (toolCallId) {+ messages.push({+ role: "tool",+ content: [+ {+ type: "tool-result",+ toolCallId,+ toolName: (message as { toolName?: string }).toolName ?? "tool",+ result: content,+ },+ ],+ });+ }+ }+ }++ return messages;+}++/** Tool arguments arrive as a JSON string, and a malformed one must not kill the run. */+function safeArgs(raw: string): Record<string, unknown> {+ try {+ const parsed = JSON.parse(raw || "{}");+ return typeof parsed === "object" && parsed !== null+ ? (parsed as Record<string, unknown>)+ : {};+ } catch {+ return {};+ }+}++/**+ * The tools the surface granted, in the Vercel-AI-SDK shape Mastra passes through.+ *+ * `execute` is deliberately absent: nothing runs here. The tool loop belongs to the client, which is+ * what puts every call through OpenBot's policy gateway instead of this process.+ */+function toMastraTools(input: RunAgentInput) {+ const tools: Record<string, unknown> = {};+ for (const tool of input.tools ?? []) {+ tools[tool.name] = {+ description: tool.description,+ parameters: tool.parameters,+ };+ }+ return tools;+}++async function runAgent(input: RunAgentInput): Promise<Response> {+ const encoder = new EventEncoder();+ const stream = new ReadableStream<Uint8Array>({+ async start(controller) {+ const utf8 = new TextEncoder();+ const send = (event: BaseEvent) =>+ controller.enqueue(utf8.encode(encoder.encodeSSE(event)));++ send({+ type: "RUN_STARTED",+ threadId: input.threadId,+ runId: input.runId,+ } as BaseEvent);++ try {+ /*+ * Streamed, not generated. `generate` waits for the whole answer and hands it over in one+ * piece; `stream` exposes tokens as they arrive, and tool-call promises resolve when it+ * finishes.+ */+ const result = await bot.stream(toMastraMessages(input) as never, {+ toolsets: { surface: toMastraTools(input) as never },+ });++ const messageId = `msg_${input.runId}`;++ // Opened on the first chunk rather than up front: a run that only calls a tool has no message,+ // and starting one leaves an empty bubble above the work.+ let started = false;+ for await (const delta of result.textStream) {+ if (!delta) continue;+ if (!started) {+ started = true;+ send({+ type: "TEXT_MESSAGE_START",+ messageId,+ role: "assistant",+ } as BaseEvent);+ }+ send({+ type: "TEXT_MESSAGE_CONTENT",+ messageId,+ delta,+ } as BaseEvent);+ }+ if (started) send({ type: "TEXT_MESSAGE_END", messageId } as BaseEvent);++ for (const call of (await result.toolCalls) ?? []) {+ const toolCallId = call.toolCallId ?? `call_${crypto.randomUUID()}`;+ send({+ type: "TOOL_CALL_START",+ toolCallId,+ toolCallName: call.toolName,+ parentMessageId: messageId,+ } as BaseEvent);+ send({+ type: "TOOL_CALL_ARGS",+ toolCallId,+ delta: JSON.stringify(call.args ?? {}),+ } as BaseEvent);+ send({ type: "TOOL_CALL_END", toolCallId } as BaseEvent);+ }++ send({+ type: "RUN_FINISHED",+ threadId: input.threadId,+ runId: input.runId,+ } as BaseEvent);+ } catch (error) {+ send({+ type: "RUN_ERROR",+ message: error instanceof Error ? error.message : "The agent failed.",+ } as BaseEvent);+ } finally {+ controller.close();+ }+ },+ });++ return new Response(stream, {+ headers: {+ "content-type": encoder.getContentType(),+ "cache-control": "no-cache",+ connection: "keep-alive",+ },+ });+}++serve({+ port: PORT,+ idleTimeout: 120,+ async fetch(request) {+ const url = new URL(request.url);+ if (url.pathname === "/health") {+ return Response.json({ status: "ok", framework: "mastra" });+ }+ if (url.pathname === "/ag-ui" && request.method === "POST") {+ const input = (await request.json()) as RunAgentInput;+ return runAgent(input);+ }+ return new Response("Not found", { status: 404 });+ },+});++console.info(+ `mastra-bot listening on http://localhost:${PORT}/ag-ui (model ${MODEL})`,+);diff --git a/package.json b/package.jsonnew file mode 100644index 00000000..ceb5596b--- /dev/null+++ b/package.json@@ -0,0 +1,33 @@+{+ "name": "openbot",+ "license": "MIT",+ "private": true,+ "packageManager": "[email protected]",+ "workspaces": [+ "app",+ "server",+ "worker"+ ],+ "scripts": {+ "build": "bun run generate:app-config && bun run --filter '*' build",+ "dev": "bun run generate:app-config && bun run --filter '*' --parallel dev",+ "generate:app-config": "bun --env-file=.env scripts/generate-app-config.ts",+ "format": "bunx biome format --write .",+ "format:check": "bunx biome format .",+ "lint": "bunx biome lint .",+ "test": "bun test",+ "typecheck": "bun run --filter '*' typecheck",+ "test:ci": "bun scripts/test-ci.ts",+ "pretest": "bun run generate:app-config",+ "test:smoke": "OPENBOT_SMOKE=1 bun test tests/smoke",+ "diagram": "bun scripts/architecture-diagram.ts"+ },+ "devDependencies": {+ "@biomejs/biome": "^2.3.8",+ "@types/bun": "^1.3.3",+ "roughjs": "^4.6.6",+ "typescript": "^5.9.3",+ "yaml": "^2.9.0"+ },+ "dependencies": {}+}diff --git a/renovate.json b/renovate.jsonnew file mode 100644index 00000000..62dc1e5a--- /dev/null+++ b/renovate.json@@ -0,0 +1,4 @@+{+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",+ "extends": ["local>CopilotKit/renovate"]+}diff --git a/scripts/architecture-diagram.ts b/scripts/architecture-diagram.tsnew file mode 100644index 00000000..510198eb--- /dev/null+++ b/scripts/architecture-diagram.ts@@ -0,0 +1,549 @@+/**+ * Draws the OpenBot architecture as a hand-drawn SVG, one file per colour scheme.+ *+ * rough.js is the same engine Excalidraw draws with, so the shapes get the wobble of a whiteboard+ * rather than the machine-perfect boxes of a Mermaid render. The seed is fixed, so regenerating+ * produces byte-identical output and the diagram does not churn in diffs.+ */+import { RoughGenerator } from "roughjs/bin/generator.js";++const W = 1420;+const H = 852;++type Theme = {+ name: string;+ paper: string;+ ink: string;+ muted: string;+ faint: string;+ gate: string;+ allow: string;+ refuse: string;+ bring: string;+ fillWeight: number;+};++const LIGHT: Theme = {+ name: "light",+ paper: "#fffefb",+ ink: "#1f2328",+ muted: "#5b6570",+ faint: "#aeb6bf",+ gate: "#f59e0b",+ allow: "#10b981",+ refuse: "#ef4444",+ bring: "#6366f1",+ fillWeight: 1.1,+};++const DARK: Theme = {+ name: "dark",+ paper: "#0f1216",+ ink: "#e9edf2",+ muted: "#98a3b0",+ faint: "#4a5361",+ gate: "#f0b429",+ allow: "#34d399",+ refuse: "#f87171",+ bring: "#8b8ff5",+ fillWeight: 0.9,+};++const FONT = `ui-sans-serif, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif`;++/** Rough's randomness is seeded per shape, so every run draws the same wobble. */+let seed = 1;+const nextSeed = () => (seed = (seed * 1103515245 + 12345) % 2147483648);++const gen = new RoughGenerator();+const out: string[] = [];++function escapeText(body: string): string {+ return body+ .replace(/&/g, "&")+ .replace(/</g, "<")+ .replace(/>/g, ">");+}++function draw(drawable: ReturnType<RoughGenerator["rectangle"]>): void {+ for (const path of gen.toPaths(drawable)) {+ const fill = path.fill ?? "none";+ const stroke = path.stroke ?? "none";+ out.push(+ `<path d="${path.d}" fill="${fill}" stroke="${stroke}" stroke-width="${path.strokeWidth ?? 1}" ` ++ `stroke-linecap="round" stroke-linejoin="round"/>`,+ );+ }+}++type BoxOptions = {+ stroke: string;+ fill?: string;+ strokeWidth?: number;+ dashed?: boolean;+ roughness?: number;+};++function box(+ x: number,+ y: number,+ w: number,+ h: number,+ t: Theme,+ o: BoxOptions,+): void {+ draw(+ gen.rectangle(x, y, w, h, {+ seed: nextSeed(),+ stroke: o.stroke,+ strokeWidth: o.strokeWidth ?? 1.6,+ roughness: o.roughness ?? 1.15,+ bowing: 1.4,+ fill: o.fill,+ fillStyle: "solid",+ fillWeight: t.fillWeight,+ strokeLineDash: o.dashed ? [9, 7] : undefined,+ }),+ );+}++type TextOptions = {+ size?: number;+ fill?: string;+ weight?: number;+ anchor?: "start" | "middle" | "end";+ spacing?: number;+ italic?: boolean;+};++function text(x: number, y: number, body: string, o: TextOptions = {}): void {+ out.push(+ `<text x="${x}" y="${y}" font-family='${FONT}' font-size="${o.size ?? 14}" ` ++ `font-weight="${o.weight ?? 400}" fill="${o.fill}" text-anchor="${o.anchor ?? "start"}" ` ++ `${o.spacing ? `letter-spacing="${o.spacing}" ` : ""}` ++ `${o.italic ? `font-style="italic" ` : ""}` ++ `>${escapeText(body)}</text>`,+ );+}++/** A stack of small lines inside a box, returning the y it finished on. */+function lines(+ x: number,+ y: number,+ items: string[],+ t: Theme,+ size = 13.5,+ step = 21,+): number {+ let cursor = y;+ for (const item of items) {+ text(x, cursor, item, { size, fill: t.muted });+ cursor += step;+ }+ return cursor;+}++function arrowHead(+ x: number,+ y: number,+ angle: number,+ colour: string,+ scale = 1,+): void {+ const len = 13 * scale;+ const spread = 0.42;+ const a = [+ x - len * Math.cos(angle - spread),+ y - len * Math.sin(angle - spread),+ ];+ const b = [+ x - len * Math.cos(angle + spread),+ y - len * Math.sin(angle + spread),+ ];+ draw(+ gen.polygon(+ [+ [x, y],+ [a[0] as number, a[1] as number],+ [b[0] as number, b[1] as number],+ ],+ {+ seed: nextSeed(),+ stroke: colour,+ strokeWidth: 1.3,+ roughness: 0.7,+ fill: colour,+ fillStyle: "solid",+ fillWeight: 2,+ },+ ),+ );+}++type ArrowOptions = {+ colour: string;+ width?: number;+ dashed?: boolean;+ head?: boolean;+ tailHead?: boolean;+};++function arrow(+ x1: number,+ y1: number,+ x2: number,+ y2: number,+ o: ArrowOptions,+): void {+ draw(+ gen.line(x1, y1, x2, y2, {+ seed: nextSeed(),+ stroke: o.colour,+ strokeWidth: o.width ?? 1.6,+ roughness: 0.9,+ bowing: 1.5,+ strokeLineDash: o.dashed ? [8, 6] : undefined,+ }),+ );+ const angle = Math.atan2(y2 - y1, x2 - x1);+ if (o.head !== false) arrowHead(x2, y2, angle, o.colour);+ if (o.tailHead) arrowHead(x1, y1, angle + Math.PI, o.colour);+}++function label(+ x: number,+ y: number,+ body: string,+ colour: string,+ anchor: "start" | "middle" | "end" = "middle",+): void {+ text(x, y, body, { size: 12.5, fill: colour, anchor, weight: 500 });+}++function render(t: Theme): string {+ seed = 1;+ out.length = 0;++ out.push(`<rect width="${W}" height="${H}" fill="${t.paper}"/>`);++ // ---- title -------------------------------------------------------------+ text(64, 56, "OpenBot", { size: 26, weight: 700, fill: t.ink });+ text(+ 64,+ 82,+ "Every action a Bot takes is decided before it happens and recorded after.",+ {+ size: 15,+ fill: t.muted,+ },+ );++ // ---- the Bots, along the top ------------------------------------------+ const botY = 126;+ const botH = 92;+ const bots: [number, number, string, string, boolean][] = [+ [372, 212, "agent-bot :4200", "proof-of-concept AG-UI Bot", false],+ [606, 212, "agent-langgraph :4201", "LangGraph AG-UI Bot", false],+ [840, 250, "your agent", "any AG-UI endpoint, any framework", true],+ ];+ text(372, botY - 14, "BOTS", {+ size: 11.5,+ weight: 700,+ fill: t.faint,+ spacing: 1.6,+ });+ for (const [x, w, name, sub, byo] of bots) {+ box(x, botY, w, botH, t, {+ stroke: byo ? t.bring : t.ink,+ dashed: byo,+ strokeWidth: byo ? 1.8 : 1.6,+ });+ text(x + 18, botY + 34, name, {+ size: 15,+ weight: 650,+ fill: byo ? t.bring : t.ink,+ });+ text(x + 18, botY + 58, sub, { size: byo ? 12.5 : 13, fill: t.muted });+ if (byo)+ text(x + 18, botY + 79, "bring your own", {+ size: 12.5,+ fill: t.bring,+ italic: true,+ });+ }++ // ---- you, on the left --------------------------------------------------+ const youX = 64;+ const youY = 296;+ const youW = 232;+ const youH = 196;+ box(youX, youY, youW, youH, t, { stroke: t.ink });+ text(youX + 18, youY + 36, "you", { size: 18, weight: 700, fill: t.ink });+ text(youX + 18, youY + 58, "app :3010", { size: 13, fill: t.muted });+ lines(+ youX + 18,+ youY + 92,+ ["channels and chat", "the Bot's live screen", "take the wheel", "/admin"],+ t,+ );++ // a Bot that reaches something it should not do alone hands the browser back to a person+ const hX = youX;+ const hY = 560;+ box(hX, hY, youW, 156, t, { stroke: t.muted, dashed: true });+ text(hX + 18, hY + 34, "when it needs you", {+ size: 15,+ weight: 650,+ fill: t.ink,+ });+ lines(+ hX + 18,+ hY + 62,+ [+ "it stops and asks,",+ "you take the wheel",+ "in its browser,",+ "and hand it back",+ ],+ t,+ 13,+ 22,+ );++ // ---- the server, in the middle ----------------------------------------+ const svX = 372;+ const svY = 296;+ const svW = 476;+ const svH = 304;+ box(svX, svY, svW, svH, t, { stroke: t.ink, strokeWidth: 2 });+ text(svX + 22, svY + 36, "server :3001", {+ size: 18,+ weight: 700,+ fill: t.ink,+ });+ text(svX + 22, svY + 58, "CopilotKit runtime, auth, roles, teammates", {+ size: 13,+ fill: t.muted,+ });++ // the gateway: the choke point everything passes through+ const gX = svX + 22;+ const gY = svY + 82;+ const gW = svW - 44;+ const gH = 194;+ box(gX, gY, gW, gH, t, { stroke: t.gate, strokeWidth: 2.4, roughness: 1.4 });+ text(gX + 18, gY + 32, "the gateway", {+ size: 16,+ weight: 700,+ fill: t.gate,+ });+ lines(+ gX + 18,+ gY + 62,+ [+ "1. resolve the target",+ "2. decide · your CEL policy, deny before allow",+ "3. record · an audit row, allowed or refused",+ "4. act, or refuse and name the rule",+ ],+ t,+ 13.5,+ 26,+ );+ text(gX + 18, gY + 176, "browser · files · MCP · components", {+ size: 12,+ fill: t.faint,+ });++ // ---- the computers, on the right --------------------------------------+ const cX = 1076;+ const cY = 296;+ const cW = 300;+ text(cX, cY - 14, "A COMPUTER EACH", {+ size: 11.5,+ weight: 700,+ fill: t.faint,+ spacing: 1.6,+ });+ const computers = ["risk-analyst", "knowledge", "your agent"];+ computers.forEach((name, i) => {+ const y = cY + i * 100;+ box(cX, y, cW, 84, t, { stroke: t.ink });+ text(cX + 18, y + 30, name, { size: 15, weight: 650, fill: t.ink });+ text(cX + 18, y + 52, "Chromium · its own logins", {+ size: 12.5,+ fill: t.muted,+ });+ text(cX + 18, y + 70, "/workspace · its own files", {+ size: 12.5,+ fill: t.muted,+ });+ });++ // ---- supervisor --------------------------------------------------------+ const supX = cX;+ const supY = 656;+ box(supX, supY, cW, 90, t, { stroke: t.ink, dashed: true });+ text(supX + 18, supY + 30, "supervisor :4500", {+ size: 14.5,+ weight: 650,+ fill: t.ink,+ });+ text(supX + 18, supY + 54, "the only process that", {+ size: 12.5,+ fill: t.muted,+ });+ text(supX + 18, supY + 72, "creates a computer", {+ size: 12.5,+ fill: t.muted,+ });++ text(cX, 782, "no Bot can read another's files", {+ size: 12.5,+ fill: t.muted,+ italic: true,+ });+ text(cX, 802, "or reuse another's sign-ins", {+ size: 12.5,+ fill: t.muted,+ italic: true,+ });++ // ---- stores, along the bottom -----------------------------------------+ const dbX = 372;+ const dbY = 660;+ box(dbX, dbY, 226, 118, t, { stroke: t.ink });+ text(dbX + 18, dbY + 32, "PostgreSQL :5432", {+ size: 14.5,+ weight: 650,+ fill: t.ink,+ });+ lines(+ dbX + 18,+ dbY + 58,+ ["the audit trail", "policy, grants", "credentials, encrypted"],+ t,+ 12.5,+ 19,+ );++ const intX = 622;+ box(intX, dbY, 226, 118, t, { stroke: t.ink });+ text(intX + 18, dbY + 32, "CopilotKit Intelligence", {+ size: 14.5,+ weight: 650,+ fill: t.ink,+ });+ lines(+ intX + 18,+ dbY + 58,+ ["durable threads", "memory", "external service"],+ t,+ 12.5,+ 19,+ );++ // ---- the wiring --------------------------------------------------------+ // you -> server, and the answer back+ arrow(youX + youW + 6, youY + 76, svX - 8, youY + 76, { colour: t.ink });+ label((youX + youW + svX) / 2, youY + 62, "a turn", t.muted);+ arrow(svX - 8, youY + 132, youX + youW + 6, youY + 132, {+ colour: t.ink,+ dashed: true,+ });+ label((youX + youW + svX) / 2, youY + 156, "the answer", t.muted);++ // server -> bots and back+ arrow(svX + 140, svY - 8, svX + 140, botY + botH + 8, { colour: t.ink });+ label(svX + 92, svY - 36, "AG-UI", t.muted);+ arrow(svX + 320, botY + botH + 8, svX + 320, svY - 8, {+ colour: t.ink,+ dashed: true,+ });+ label(svX + 390, svY - 36, "a tool call", t.muted);+ // the one you bring plugs in exactly the same way+ arrow(940, botY + botH + 8, svX + svW - 40, svY - 8, {+ colour: t.bring,+ dashed: true,+ width: 1.5,+ });++ // the gateway -> a computer, but only once it has decided so+ arrow(svX + svW + 8, gY + 58, cX - 10, cY + 42, {+ colour: t.allow,+ width: 2.2,+ });+ label((svX + svW + cX) / 2, gY + 26, "allowed", t.allow);++ // ...and the refusal, which never reaches the computer at all+ const ry = gY + 150;+ const rx1 = svX + svW + 8;+ const rx2 = rx1 + 116;+ arrow(rx1, ry, rx2, ry, { colour: t.refuse, head: false, width: 2.2 });+ const cross = 10;+ for (const [dx1, dy1, dx2, dy2] of [+ [-cross, -cross, cross, cross],+ [cross, -cross, -cross, cross],+ ]) {+ draw(+ gen.line(+ rx2 + 14 + (dx1 as number),+ ry + (dy1 as number),+ rx2 + 14 + (dx2 as number),+ ry + (dy2 as number),+ {+ seed: nextSeed(),+ stroke: t.refuse,+ strokeWidth: 2.6,+ roughness: 1.1,+ },+ ),+ );+ }+ label(rx2 + 14, ry + 40, "refused,", t.refuse);+ label(rx2 + 14, ry + 57, "naming the rule", t.refuse);++ // every decision lands in the trail, allowed or not+ arrow(gX + 90, svY + svH + 8, gX + 90, dbY - 8, {+ colour: t.gate,+ width: 2.2,+ });+ label(gX + 72, (svY + svH + dbY) / 2 + 4, "always", t.gate, "end");++ // threads and memory, both ways+ arrow(intX + 113, svY + svH + 8, intX + 113, dbY - 8, {+ colour: t.ink,+ dashed: true,+ tailHead: true,+ });++ // the supervisor builds each computer+ arrow(supX + 150, supY - 8, cX + 150, cY + 2 * 100 + 92, {+ colour: t.ink,+ dashed: true,+ });+ label(supX + 166, supY - 22, "creates one each", t.muted, "start");++ return [+ `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${W} ${H}" width="${W}" height="${H}" role="img">`,+ `<title>OpenBot architecture</title>`,+ `<desc>A turn goes from the app to the server, which sends it to a Bot over AG-UI. Every tool call ` ++ `the Bot makes returns through the gateway, which resolves the target, decides it against the ` ++ `configured policy, records an audit row, and only then acts, or refuses and names the rule. ` ++ `Allowed actions reach that Bot's own computer, one container each holding its own Chromium, ` ++ `logins and workspace, created by the supervisor. Every decision lands in PostgreSQL; threads ` ++ `and memory live in CopilotKit Intelligence.</desc>`,+ ...out,+ `</svg>`,+ ].join("\n");+}++for (const theme of [LIGHT, DARK]) {+ await Bun.write(+ new URL(`../assets/architecture-${theme.name}.svg`, import.meta.url),+ render(theme),+ );+}+console.log(+ "wrote assets/architecture-light.svg and assets/architecture-dark.svg",+);diff --git a/scripts/generate-app-config.ts b/scripts/generate-app-config.tsnew file mode 100644index 00000000..08fc2d53--- /dev/null+++ b/scripts/generate-app-config.ts@@ -0,0 +1,41 @@+import { mkdir, writeFile } from "node:fs/promises";+import { dirname, isAbsolute, resolve } from "node:path";+import {+ createApplicationConfiguration,+ loadTenantPackage,+} from "../server/src/tenant-package";++const projectRoot = resolve(import.meta.dir, "..");+const configuredTenantPackageDirectory = process.env.TENANT_PACKAGE_DIR;+const tenantPackageDirectory = configuredTenantPackageDirectory+ ? isAbsolute(configuredTenantPackageDirectory)+ ? configuredTenantPackageDirectory+ : resolve(projectRoot, "server", configuredTenantPackageDirectory)+ : resolve(projectRoot, "examples/fintech");+const tenantPackage = await loadTenantPackage(tenantPackageDirectory);+const providers =+ process.env.GOOGLE_OAUTH_CLIENT_ID?.trim() &&+ process.env.GOOGLE_OAUTH_CLIENT_SECRET?.trim() &&+ process.env.BETTER_AUTH_SECRET?.trim() &&+ process.env.BETTER_AUTH_URL?.trim()+ ? ["google"]+ : [];+const applicationConfiguration = createApplicationConfiguration(+ tenantPackage,+ providers,+);+const outputPath = resolve(+ projectRoot,+ "app/src/lib/generated/application-config.ts",+);++await mkdir(dirname(outputPath), { recursive: true });+await writeFile(+ outputPath,+ [+ "// This file is generated by scripts/generate-app-config.ts. Do not edit it.",+ "export type AppConfig = { brand: { tenantId: string; productName: string }; auth: { providers: readonly string[] } };",+ `export const appConfig: AppConfig = ${JSON.stringify(applicationConfiguration, null, 2)};`,+ "",+ ].join("\n"),+);diff --git a/scripts/start.sh b/scripts/start.shnew file mode 100755index 00000000..2df03e4c--- /dev/null+++ b/scripts/start.sh@@ -0,0 +1,183 @@+#!/usr/bin/env bash+#+# Start the local OpenBot stack and verify each service answers as OpenBot.+# Safe to rerun: matching services are left running, and unrelated port holders are reported.++set -euo pipefail++cd "$(dirname "$0")/.."+ROOT="$PWD"+LOGS="$ROOT/.logs"+mkdir -p "$LOGS"++if [ ! -f "$ROOT/.env" ]; then+ printf '\033[31m%s\033[0m\n' ".env is missing. Copy .env.example to .env and fill in the required settings."+ exit 1+fi++# The environment first, then .env, then the default. Compose and the API server both read .env, so a+# port or token configured there is what this script must use as well.+setting() {+ local name="$1" fallback="$2" value="${!1:-}"+ if [ -z "$value" ]; then+ value="$(grep -E "^$name=" "$ROOT/.env" | tail -1 | cut -d= -f2- | sed -e 's/^"\(.*\)"$/\1/' -e "s/^'\(.*\)'$/\1/")"+ fi+ printf '%s' "${value:-$fallback}"+}++APP_PORT="$(setting APP_PORT 3010)"+SERVER_PORT="$(setting SERVER_PORT 3001)"+COMPUTER_PORT="$(setting COMPUTER_PORT 4100)"+BOT_PORT="$(setting BOT_PORT 4200)"+LANGGRAPH_PORT="$(setting LANGGRAPH_PORT 4201)"+SUPERVISOR_PORT="$(setting SUPERVISOR_PORT 4500)"+ONE_COMPUTER_EACH="${OPENBOT_ONE_COMPUTER_EACH:-true}"+export APP_PORT SERVER_PORT+SUPERVISOR_TOKEN="$(setting SUPERVISOR_TOKEN openbot-dev-supervisor-token)"+COMPUTER_TOKEN="$(setting COMPUTER_TOKEN openbot-dev-computer-token)"++green() { printf '\033[32m%s\033[0m\n' "$1"; }+red() { printf '\033[31m%s\033[0m\n' "$1"; }+info() { printf '\033[2m%s\033[0m\n' "$1"; }++holder() {+ lsof -nP -iTCP:"$1" -sTCP:LISTEN -Fcn 2>/dev/null | awk '/^c/{c=substr($0,2)} /^n/{print c" ("substr($0,2)")"; exit}' || true+}++require_free_or_ours() {+ local port="$1" name="$2" who+ who="$(holder "$port")"+ [ -z "$who" ] && return 0+ if curl -fsS --max-time 3 "http://localhost:$port/health" >/dev/null 2>&1 \+ || curl -fsS --max-time 3 "http://localhost:$port/api/capabilities" >/dev/null 2>&1 \+ || curl -fsS --max-time 3 "http://localhost:$port/" >/dev/null 2>&1; then+ info " $name: already up on $port ($who)"+ return 0+ fi+ red " $name: port $port is held by something else: $who"+ red " Re-run with ${name^^}_PORT=<free port>, or stop that process yourself."+ exit 1+}++wait_for() {+ local url="$1" name="$2" tries="${3:-40}"+ for _ in $(seq 1 "$tries"); do+ curl -fsS --max-time 3 "$url" >/dev/null 2>&1 && { green " $name ready"; return 0; }+ sleep 1+ done+ red " $name never became ready at $url"+ red " Log: $LOGS/${name}.log"+ exit 1+}++echo+echo "OpenBot"+echo "======="++info "1/4 Docker services"+SERVICES=(postgres)+if [ "$ONE_COMPUTER_EACH" = "true" ]; then+ SERVICES+=(supervisor)+fi+for svc_port in "agent-computer:$COMPUTER_PORT" "agent-bot:$BOT_PORT" "agent-langgraph:$LANGGRAPH_PORT"; do+ svc="${svc_port%%:*}"; port="${svc_port##*:}"+ if curl -fsS --max-time 3 "http://localhost:$port/health" >/dev/null 2>&1; then+ info " $svc: already answering on $port"+ else+ SERVICES+=("$svc")+ fi+done++export SUPERVISOR_TOKEN COMPUTER_TOKEN+export COMPUTER_PORT BOT_PORT LANGGRAPH_PORT SUPERVISOR_PORT+docker compose up -d --build "${SERVICES[@]}" >/dev/null+if ! docker compose run --rm --build migrate >"$LOGS/migrate.log" 2>&1; then+ red " Migrations did not apply. The database is not the schema this server expects."+ red " Log: $LOGS/migrate.log"+ exit 1+fi+wait_for "http://localhost:$COMPUTER_PORT/health" "agent-computer"+wait_for "http://localhost:$BOT_PORT/health" "agent-bot"+wait_for "http://localhost:$LANGGRAPH_PORT/health" "agent-langgraph"++for table in agent_profiles agent_preferences; do+ if ! docker compose exec -T postgres \+ psql -U openbot -d openbot -tAc "select to_regclass('public.$table')" 2>/dev/null \+ | grep -q "^$table$"; then+ red " $table is missing. Run: bun run --cwd server db:migrate"+ exit 1+ fi+done+green " teammate tables migrated"++MANAGED_URL="$(grep -E '^MANAGED_AGENT_AG_UI_URL=' "$ROOT/.env" | tail -1 | cut -d= -f2-)"+if [ -z "$MANAGED_URL" ]; then+ red " MANAGED_AGENT_AG_UI_URL is not set in .env."+ red " See .env.example."+ exit 1+fi+green " managed teammate endpoint: $MANAGED_URL"++info "2/4 Server"+require_free_or_ours "$SERVER_PORT" server+if ! curl -fsS --max-time 3 "http://localhost:$SERVER_PORT/api/capabilities" >/dev/null 2>&1; then+ if [ "$ONE_COMPUTER_EACH" = "true" ]; then+ (cd server && PORT="$SERVER_PORT" \+ COMPUTER_SUPERVISOR_URL="http://localhost:$SUPERVISOR_PORT" \+ SUPERVISOR_TOKEN="$SUPERVISOR_TOKEN" \+ COMPUTER_TOKEN="$COMPUTER_TOKEN" \+ bun --env-file=../.env src/index.ts >"$LOGS/server.log" 2>&1 &)+ else+ (cd server && PORT="$SERVER_PORT" bun --env-file=../.env src/index.ts >"$LOGS/server.log" 2>&1 &)+ fi+fi+wait_for "http://localhost:$SERVER_PORT/api/capabilities" "server"++info "3/4 Runtime health"+INFO="$(curl -fsS --max-time 8 "http://localhost:$SERVER_PORT/api/copilotkit/info")"+python3 - "$INFO" <<'PY'+import json, sys+info = json.loads(sys.argv[1])+status, agents = info.get("licenseStatus"), list(info.get("agents", {}))+if status != "valid":+ print(f"\033[31m licence is '{status}', not 'valid'.\033[0m")+ print("\033[31m Run: npx copilotkit@latest login && npx copilotkit@latest license --write\033[0m")+ print("\033[31m See README.md for Intelligence setup.\033[0m")+ raise SystemExit(1)+if not agents:+ print("\033[31m No Bots registered.\033[0m")+ raise SystemExit(1)+print(f"\033[32m licence valid · mode {info.get('mode')} · Bots: {', '.join(agents)}\033[0m")+PY++info "4/4 App"+require_free_or_ours "$APP_PORT" app+if ! curl -fsS --max-time 3 "http://localhost:$APP_PORT/" >/dev/null 2>&1; then+ (cd app && bun run dev --port "$APP_PORT" --strictPort >"$LOGS/app.log" 2>&1 &)+fi+wait_for "http://localhost:$APP_PORT/" "app"++cat <<EOF++$(green "Ready. http://localhost:$APP_PORT")++Next steps:++ - Direct Bot chat: http://localhost:$APP_PORT/bot+ - Teammates: http://localhost:$APP_PORT/agents+ - Audit trail: http://localhost:$APP_PORT/admin/audit+ - Boundaries/policy: http://localhost:$APP_PORT/admin/boundaries+ - Setup docs: README.md+ - Configuration docs: docs/configuration.md++Try:++ 1. Open /bot and ask: Open news.ycombinator.com and tell me the top story.+ 2. Create a teammate in /agents and start a channel with it.+ 3. Review browser/file actions in /admin/audit.+ 4. Add a deny rule in /admin/boundaries, then retry the same action.++Logs: $LOGS+Stop Docker services: docker compose down+Stop host app/server: kill the processes using ports $APP_PORT and $SERVER_PORT+EOFdiff --git a/scripts/test-ci.ts b/scripts/test-ci.tsnew file mode 100644index 00000000..ce1119ea--- /dev/null+++ b/scripts/test-ci.ts@@ -0,0 +1,51 @@+/**+ * The test run, with a floor under how much of it must actually execute.+ *+ * A test file that throws while it is being imported never runs its tests and never reports them as+ * failures; the file is simply absent from the totals.+ *+ * This asserts the count as well as the result. A drop is treated as a failure, because a smaller+ * suite with no failure report gives false coverage.+ *+ * The floor is deliberately a floor and not an exact number. Tests are added constantly and a check+ * that has to be edited for every new test is a check people learn to edit without thinking.+ */++const MINIMUM_TESTS = 400;++// `bun run test` rather than `bun test`, so the pretest hook fires and the generated application+// config exists before route imports need it.+const proc = Bun.spawn(["bun", "run", "test"], {+ stdout: "inherit",+ stderr: "pipe",+});++// Bun writes its summary to stderr, so it is captured and echoed rather than inherited.+const stderr = await new Response(proc.stderr).text();+process.stderr.write(stderr);++const status = await proc.exited;+if (status !== 0) process.exit(status);++const ran = stderr.match(/Ran (\d+) tests? across/);+const count = ran ? Number.parseInt(ran[1] as string, 10) : 0;++if (!ran) {+ console.error(+ "\nCould not read how many tests ran from bun's output. Refusing to report a pass on a run that cannot be counted.",+ );+ process.exit(1);+}++if (count < MINIMUM_TESTS) {+ console.error(+ `\n${count} tests ran, and at least ${MINIMUM_TESTS} were expected.\n\n` ++ "Every test passed, so this is not a failing test, it is a suite that got smaller. The usual\n" ++ "cause is a file that threw while being imported, which takes its tests with it and reports\n" ++ "nothing. Run `bun test` and look for an unhandled error between the file groups.\n\n" ++ `If tests were deliberately removed, lower MINIMUM_TESTS in scripts/test-ci.ts and say why.`,+ );+ process.exit(1);+}++console.error(`\n${count} tests ran (floor ${MINIMUM_TESTS}).`);diff --git a/server/Dockerfile b/server/Dockerfilenew file mode 100644index 00000000..1a92fae9--- /dev/null+++ b/server/Dockerfile@@ -0,0 +1,14 @@+FROM oven/bun:1.3.14++WORKDIR /app++COPY package.json bun.lock ./+COPY app/package.json app/package.json+COPY server/package.json server/package.json+COPY worker/package.json worker/package.json+RUN bun install --frozen-lockfile++COPY server server+COPY examples examples++WORKDIR /app/serverdiff --git a/server/drizzle.config.ts b/server/drizzle.config.tsnew file mode 100644index 00000000..93327a52--- /dev/null+++ b/server/drizzle.config.ts@@ -0,0 +1,31 @@+import { defineConfig } from "drizzle-kit";++const databaseUrl = process.env.DATABASE_URL;++if (!databaseUrl) {+ throw new Error(+ "DATABASE_URL must be configured before running a database migration command",+ );+}++export default defineConfig({+ dialect: "postgresql",+ /**+ * Every schema file, listed explicitly.+ *+ * Files missing from this list are invisible to `generate`; existing tables still work, but the+ * next generated migration treats them as absent. Add the file here in the same change that adds+ * the schema file.+ */+ schema: [+ "./src/db/schema/core.ts",+ "./src/db/schema/computer.ts",+ "./src/db/schema/teammate.ts",+ "./src/db/schema/components.ts",+ "./src/db/schema/plugins.ts",+ ],+ out: "./drizzle",+ dbCredentials: {+ url: databaseUrl,+ },+});diff --git a/server/drizzle/meta/_journal.json b/server/drizzle/meta/_journal.jsonnew file mode 100644index 00000000..540bea26--- /dev/null+++ b/server/drizzle/meta/_journal.json@@ -0,0 +1,13 @@+{+ "version": "7",+ "dialect": "postgresql",+ "entries": [+ {+ "idx": 0,+ "version": "7",+ "when": 1786891733850,+ "tag": "0000_schema",+ "breakpoints": true+ }+ ]+}diff --git a/server/scripts/test-preload.ts b/server/scripts/test-preload.tsnew file mode 100644index 00000000..67de76e8--- /dev/null+++ b/server/scripts/test-preload.ts@@ -0,0 +1,21 @@+/**+ * Loaded before any test file, to make module loading deterministic.+ *+ * Deep inside the runtime's dependencies, `@modelcontextprotocol/sdk`+ * does `require("eventsource")` from CommonJS, and eventsource ships as ESM only. Bun permits that+ * only when the module has already been evaluated as ESM by something earlier in the process, so+ * whether it works depends on the order the test files happen to be walked, an order that changes+ * whenever a test file is added or renamed.+ *+ * The failure is not a failing test. The file throws while being imported, so its tests are never+ * registered and never reported.+ *+ * Importing it here evaluates it as ESM once, before anything requires it, so the order no longer+ * decides the outcome. `eventsource` is declared as a dev dependency of this package for the same+ * reason; test determinism depends on it.+ *+ * This compatibility shim is narrow enough to delete when the SDK ships an ESM-safe require or Bun+ * handles it.+ */++import "eventsource";diff --git a/server/src/agents/auth-header.ts b/server/src/agents/auth-header.tsnew file mode 100644index 00000000..1c03750c--- /dev/null+++ b/server/src/agents/auth-header.ts@@ -0,0 +1,96 @@+import {+ type CredentialSecretReader,+ type CredentialStore,+ decryptSecret,+ encryptSecret,+} from "../credentials";++/**+ * The key a customer's agent sits behind.+ *+ * A bearer token for an external agent is a credential, and+ * this deployment already has one place that knows how to hold a credential: encrypted at rest,+ * revocable, listed for an operator, and never returned to a browser. Putting it in `configuration`+ * next to the endpoint would make it readable by anything that can read an agent, including the+ * admin API that lists them, and there would be no way to revoke it without editing the agent.+ *+ * The vault holds the value. The agent's configuration holds only the+ * credential's id and the header name, because the name is not a secret and the surface needs to+ * show "sends an Authorization header" without being able to show what it sends.+ *+ * It is never read back to a person. There is no endpoint that returns it and no field that+ * repopulates with it: the edit form shows that a key is set, and setting a new one replaces it. A+ * secret a UI can display is a secret in a screenshot.+ */++export type AgentAuth = {+ /** The header to send, e.g. `Authorization`. Not secret. */+ header: string;+ /** The vault row holding the value. */+ credentialId: string;+};++/** How an agent's auth is recorded in its `configuration`. Value never appears here. */+export function authFromConfiguration(+ configuration: unknown,+): AgentAuth | null {+ if (!configuration || typeof configuration !== "object") return null;+ const auth = (configuration as { auth?: unknown }).auth;+ if (!auth || typeof auth !== "object") return null;+ const { header, credentialId } = auth as {+ header?: unknown;+ credentialId?: unknown;+ };+ return typeof header === "string" && typeof credentialId === "string"+ ? { header, credentialId }+ : null;+}++/**+ * Put an agent's key in the vault and return the reference to store on the agent.+ *+ * `keyId` is the agent's own id, so an operator listing credentials can see which agent a row belongs+ * to without joining anything.+ */+export async function storeAgentAuth(input: {+ store: CredentialStore;+ encryptionKey: string;+ agentId: string;+ header: string;+ value: string;+}): Promise<AgentAuth> {+ const credential = await input.store.create({+ kind: "agent",+ provider: "ag-ui",+ keyId: input.agentId,+ // The header name is metadata precisely because it is not a secret; keeping it here makes the+ // vault row self-describing for later audit.+ metadata: { header: input.header },+ encryptedValue: await encryptSecret(input.encryptionKey, input.value),+ });+ return { header: input.header, credentialId: credential.id };+}++/**+ * The headers to send to this agent, or none.+ *+ * A revoked or missing credential sends nothing rather than guessing. The run then fails at the+ * agent with its own 401, which is the truthful outcome: the key is gone. Substituting an empty+ * header or falling back to no auth would turn a revoked key into a confusing agent error+ * with no mention of the key anywhere.+ */+export async function agentAuthHeaders(input: {+ reader: CredentialSecretReader;+ encryptionKey: string;+ auth: AgentAuth | null;+}): Promise<Record<string, string> | undefined> {+ if (!input.auth) return undefined;+ const stored = await input.reader.readSecret(input.auth.credentialId);+ if (!stored || stored.revokedAt) return undefined;+ return {+ [input.auth.header]: await decryptSecret(+ input.encryptionKey,+ stored.encryptedValue,+ ),+ };+}diff --git a/server/src/agents/connection-test.ts b/server/src/agents/connection-test.tsnew file mode 100644index 00000000..377d6f14--- /dev/null+++ b/server/src/agents/connection-test.ts@@ -0,0 +1,157 @@+import { checkAgentEndpoint } from "./endpoint";++/**+ * Ask an endpoint whether it is really an agent before it is stored.+ *+ * The registration form is the cheap point to distinguish a typo, a dead host, and a reachable+ * service that is not an AG-UI agent.+ *+ * AG-UI requires one POST to the endpoint returning an SSE stream of events (`@ag-ui/client`'s+ * `HttpAgent` is `{ url, headers?, fetch? }`). The test is a real run with a trivial message.+ */++/** How long an endpoint gets to answer. Short: this is a person waiting on a form. */+const TEST_TIMEOUT_MS = 15_000;++/** Enough of the stream to prove it is an agent. Reading it all could mean reading a whole reply. */+const MAX_BYTES = 8_000;++export type ConnectionTestResult =+ | {+ ok: true;+ /** The AG-UI event types that came back, in order, so a person sees it really answered. */+ events: string[];+ status: number;+ }+ | { ok: false; reason: string; status?: number };++/**+ * The smallest thing that is still a real run.+ *+ * Not a HEAD or a bare GET: plenty of things answer those. Only a POST that produces AG-UI events+ * distinguishes "an agent" from "a web server that happens to be reachable".+ */+function probeBody() {+ return {+ threadId: `openbot-connection-test-${crypto.randomUUID()}`,+ runId: `openbot-connection-test-${crypto.randomUUID()}`,+ messages: [+ {+ id: crypto.randomUUID(),+ role: "user",+ content:+ "This is an automated connection test from OpenBot. Reply with one short word.",+ },+ ],+ tools: [],+ context: [],+ state: {},+ forwardedProps: {},+ };+}++/** Pull `event:`/`data:` type names out of an SSE body, which is how AG-UI reports what it did. */+function eventTypesFrom(text: string): string[] {+ const types: string[] = [];+ for (const line of text.split("\n")) {+ const trimmed = line.trim();+ if (trimmed.startsWith("event:")) {+ types.push(trimmed.slice("event:".length).trim());+ continue;+ }+ // Most AG-UI servers put the type inside the JSON payload rather than on an `event:` line.+ if (trimmed.startsWith("data:")) {+ try {+ const parsed = JSON.parse(trimmed.slice("data:".length).trim()) as {+ type?: unknown;+ };+ if (typeof parsed.type === "string") types.push(parsed.type);+ } catch {+ // A fragment of a longer line. Not worth reporting: the summary is about whether events+ // arrived at all, and one unparsed chunk does not change that answer.+ }+ }+ }+ return [...new Set(types)];+}++/**+ * Try an endpoint and say what happened, in words a person can act on.+ *+ * Never throws. Every failure a person can cause, a typo, a dead host, an endpoint that answers HTML+ *, comes back as a reason, because this is rendered next to the field they just filled in.+ */+export async function testAgentConnection(+ rawEndpoint: unknown,+ options: {+ headers?: Record<string, string>;+ allowPrivateHosts?: boolean;+ fetchImpl?: typeof fetch;+ timeoutMs?: number;+ } = {},+): Promise<ConnectionTestResult> {+ // Use the same target check that governs storing the endpoint, so this form cannot probe internal+ // addresses that registration would refuse.+ const verdict = checkAgentEndpoint(rawEndpoint, {+ allowPrivateHosts: options.allowPrivateHosts,+ });+ if (!verdict.allowed) return { ok: false, reason: verdict.reason };++ const doFetch = options.fetchImpl ?? fetch;+ let response: Response;+ try {+ response = await doFetch(verdict.url, {+ method: "POST",+ headers: {+ "content-type": "application/json",+ accept: "text/event-stream",+ ...options.headers,+ },+ body: JSON.stringify(probeBody()),+ signal: AbortSignal.timeout(options.timeoutMs ?? TEST_TIMEOUT_MS),+ });+ } catch (error) {+ const timedOut = error instanceof Error && error.name === "TimeoutError";+ return {+ ok: false,+ reason: timedOut+ ? "The agent did not answer in time. It may be starting up, or the address may be unreachable from this server."+ : "This server could not reach that address. If your agent runs on your own machine, it needs to be reachable from here, a tunnel, or somewhere this server can dial.",+ };+ }++ if (!response.ok) {+ return {+ ok: false,+ status: response.status,+ reason:+ response.status === 401 || response.status === 403+ ? "The agent refused this request. If it needs a key, add it as a header."+ : `The agent answered ${response.status}. An AG-UI endpoint answers a POST with a stream of events.`,+ };+ }++ let body: string;+ try {+ body = (await response.text()).slice(0, MAX_BYTES);+ } catch {+ return {+ ok: false,+ status: response.status,+ reason: "The agent started answering and the connection broke.",+ };+ }++ const events = eventTypesFrom(body);+ if (events.length === 0) {+ // Reachable, and not an agent. The most useful thing to say is what it looked like instead.+ const contentType = response.headers.get("content-type") ?? "nothing";+ return {+ ok: false,+ status: response.status,+ reason: `That address answered, but not with AG-UI events (it sent ${contentType}). Check it is the agent's AG-UI path and not its home page.`,+ };+ }++ return { ok: true, events, status: response.status };+}diff --git a/server/src/agents/knowledge-agent.ts b/server/src/agents/knowledge-agent.tsnew file mode 100644index 00000000..007b006c--- /dev/null+++ b/server/src/agents/knowledge-agent.ts@@ -0,0 +1,22 @@+type Citation = { title: string; canonicalUrl: string; content: string };++export function createKnowledgeAgent(input: {+ available: boolean;+ search: (question: string) => Promise<Citation[]>;+ complete: (input: {+ question: string;+ context: Citation[];+ }) => Promise<string>;+}) {+ return {+ async respond(question: string) {+ if (!input.available)+ throw new Error("Model credential is not configured.");+ const citations = await input.search(question);+ return {+ text: await input.complete({ question, context: citations }),+ citations,+ };+ },+ };+}diff --git a/server/src/agents/profile-policy.ts b/server/src/agents/profile-policy.tsnew file mode 100644index 00000000..bdf4a671--- /dev/null+++ b/server/src/agents/profile-policy.ts@@ -0,0 +1,25 @@+import type { AgentActor, AgentProfile } from "./profile-types";++export function canAccessAgent(+ actor: AgentActor,+ agent: AgentProfile,+): boolean {+ if (agent.deletedAt !== null) return false;++ return (+ agent.visibility === "public" ||+ agent.ownerUserId === actor.id ||+ actor.role === "admin"+ );+}++export function canManageAgent(+ actor: AgentActor,+ agent: AgentProfile,+): boolean {+ if (agent.systemOwned || agent.deletedAt !== null) return false;++ return agent.ownerUserId === actor.id || actor.role === "admin";+}++export const canRunAgent = canAccessAgent;diff --git a/server/src/agents/routes.ts b/server/src/agents/routes.tsnew file mode 100644index 00000000..835fc512--- /dev/null+++ b/server/src/agents/routes.ts@@ -0,0 +1,370 @@+import type { Context, MiddlewareHandler } from "hono";+import { Hono } from "hono";+import type { AuditStore } from "../audit";+import { recordAuditEvent } from "../audit";+import type { AppVariables } from "../auth/guards";+import { testAgentConnection } from "./connection-test";+import { checkAgentEndpoint } from "./endpoint";+import { canManageAgent } from "./profile-policy";+import {+ AgentNotFoundError,+ AgentNotManageableError,+ type AgentProfileStore,+ ProtectedAgentError,+} from "./profile-store";+import type {+ AgentActor,+ AgentProfile,+ CreateAgentInput,+} from "./profile-types";++type AgentInputParseResult =+ | { ok: true; value: CreateAgentInput }+ | { ok: false; error: string };++type AgentInputObject = {+ name?: unknown;+ title?: unknown;+ roleDescription?: unknown;+ visibility?: unknown;+ endpoint?: unknown;+ auth?: unknown;+};++/**+ * Parse and validate what a user typed into the agent form.+ *+ * `allowPrivateHosts` is passed in rather than read from configuration here so this stays a pure+ * function: a developer's own agent lives on localhost, and a hosted deployment must refuse exactly+ * that, so the answer depends on the deployment and the test suite needs to exercise both.+ */+export function parseAgentInput(+ input: unknown,+ allowPrivateHosts = false,+): AgentInputParseResult {+ if (!isAgentInputObject(input)) {+ return { ok: false, error: "Agent input must be a JSON object." };+ }++ const name = boundedText(+ input.name,+ 80,+ "Name must be text between 1 and 80 characters.",+ );+ if (typeof name !== "string") return name;++ const title = boundedText(+ input.title,+ 120,+ "Title must be text between 1 and 120 characters.",+ );+ if (typeof title !== "string") return title;++ const roleDescription = boundedText(+ input.roleDescription,+ 1000,+ "Role description must be text between 1 and 1000 characters.",+ );+ if (typeof roleDescription !== "string") return roleDescription;++ if (typeof input.visibility !== "string") {+ return { ok: false, error: "Visibility must be public or private." };+ }+ const visibility = input.visibility.trim();+ if (visibility !== "public" && visibility !== "private") {+ return { ok: false, error: "Visibility must be public or private." };+ }++ // The endpoint is optional and checked. Absent means the Bot in the box, which is what most people+ // want on their first go. Present means this server will POST to an address a person chose, so it+ // goes through the same target check as navigation before it is allowed anywhere near the database.+ let endpoint: string | undefined;+ if (input.endpoint !== undefined && input.endpoint !== "") {+ const verdict = checkAgentEndpoint(input.endpoint, { allowPrivateHosts });+ if (!verdict.allowed) return { ok: false, error: verdict.reason };+ endpoint = verdict.url;+ }++ // The key is optional and write-only. An absent field leaves an existing key alone; sending one+ // replaces it. There is no way to read one back, here or anywhere.+ let auth: { header: string; value: string } | undefined;+ if (input.auth !== undefined && input.auth !== null) {+ const supplied = input.auth as { header?: unknown; value?: unknown };+ const value =+ typeof supplied.value === "string" ? supplied.value.trim() : "";+ if (value) {+ const header =+ typeof supplied.header === "string" && supplied.header.trim()+ ? supplied.header.trim()+ : "Authorization";+ if (!/^[A-Za-z0-9-]+$/.test(header)) {+ return { ok: false, error: "That is not a valid header name." };+ }+ auth = { header, value };+ }+ }++ return {+ ok: true,+ value: { name, title, roleDescription, visibility, endpoint, auth },+ };+}++function isAgentInputObject(input: unknown): input is AgentInputObject {+ return typeof input === "object" && input !== null && !Array.isArray(input);+}++/**+ * The local development actor, which is not a row in `users`.+ *+ * The audit table has a foreign key to that table, so writing this id would fail the constraint and+ * lose the row entirely. Who it was is in the payload either way.+ */+const DEV_ACTOR_EMAIL = "[email protected]";++export function createAgentRoutes(+ store: AgentProfileStore,+ requireUser: MiddlewareHandler<{ Variables: AppVariables }>,+ /** Whether this deployment may talk to its own network. True on a laptop, false when hosted. */+ allowPrivateHosts = false,+ /** Where a Bot's own refusal is recorded. Absent in tests that do not care about the trail. */+ auditStore?: AuditStore,+) {+ const routes = new Hono<{ Variables: AppVariables }>();++ /**+ * The Bot declined something, and says so.+ *+ * The audit trail records what a Bot did, decided by the gateway on the way to an action. A model+ * that refuses before calling any tool takes no action, so this records the attempted request.+ *+ * Self-reported, and said so in the row. The Bot calls this because its tool description tells it+ * to, so a model that declines without a tool call still writes nothing. This is evidence, not enforcement:+ * nothing is prevented by it, and a reader must not mistake an empty list for an untroubled Bot.+ */+ routes.post("/:agentId/declined", requireUser, async (context) => {+ const agentId = context.req.param("agentId");+ const body = (await context.req.json().catch(() => null)) as {+ reason?: unknown;+ request?: unknown;+ } | null;++ const reason = typeof body?.reason === "string" ? body.reason.trim() : "";+ if (!reason) {+ return context.json({ error: "A reason is required." }, 400);+ }++ if (auditStore) {+ const actor = context.var.actor;+ await recordAuditEvent(auditStore, {+ eventType: "bot.declined",+ targetType: "agent",+ targetId: agentId,+ ...(actor?.id && actor.email !== DEV_ACTOR_EMAIL+ ? { actorUserId: actor.id }+ : {}),+ payload: {+ bot: agentId,+ actor: actor?.email ?? "unknown",+ reason: reason.slice(0, 500),+ // What it was asked, in the Bot's own words and only if it offered them. Truncated for the+ // same reason every other payload here is: a trail is not a transcript.+ ...(typeof body?.request === "string" && body.request.trim()+ ? { request: body.request.trim().slice(0, 500) }+ : {}),+ reportedBy: "the Bot itself",+ },+ });+ }++ return context.json({ recorded: true });+ });++ routes.get("/", requireUser, async (context) => {+ try {+ const hidden = context.req.query("hidden") === "true";+ const agents = await store.list(context.var.actor, hidden);+ return context.json({+ agents: agents.map((agent) => agentDto(context.var.actor, agent)),+ });+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.get("/:agentId", requireUser, async (context) => {+ try {+ const agent = await store.get(+ context.var.actor,+ context.req.param("agentId"),+ );+ if (!agent) {+ return context.json({ error: "Agent not found." }, 404);+ }+ return context.json({ agent: agentDto(context.var.actor, agent) });+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ /**+ * Try an endpoint before saving it.+ *+ * Deliberately not part of create: a person needs to know whether their agent answers before they+ * commit to it, and they need to be able to try again without creating dead+ * Bots on the way. It runs the same target check as saving, so it cannot probe addresses that+ * registration would refuse.+ */+ routes.post("/test-connection", requireUser, async (context) => {+ const body = (await context.req.json().catch(() => null)) as {+ endpoint?: unknown;+ headers?: unknown;+ } | null;+ const headers =+ body?.headers && typeof body.headers === "object"+ ? (body.headers as Record<string, string>)+ : undefined;+ const result = await testAgentConnection(body?.endpoint, {+ headers,+ allowPrivateHosts,+ });+ // 200 either way: the request succeeded, and the verdict is the payload. A failed connection test+ // is an answer, not an error, and a 4xx here would have the surface render it as a broken button.+ return context.json(result);+ });++ routes.post("/", requireUser, async (context) => {+ // Malformed JSON is a recoverable client-input error and is validated by the same parser.+ const parsed = parseAgentInput(+ await context.req.json().catch(() => null),+ allowPrivateHosts,+ );+ if (!parsed.ok) return context.json({ error: parsed.error }, 400);++ try {+ const agent = await store.create(context.var.actor, parsed.value);+ return context.json({ agent: agentDto(context.var.actor, agent) }, 201);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.patch("/:agentId", requireUser, async (context) => {+ // Malformed JSON is a recoverable client-input error and is validated by the same parser.+ const parsed = parseAgentInput(+ await context.req.json().catch(() => null),+ allowPrivateHosts,+ );+ if (!parsed.ok) return context.json({ error: parsed.error }, 400);++ try {+ const agent = await store.update(+ context.var.actor,+ context.req.param("agentId"),+ parsed.value,+ );+ return context.json({ agent: agentDto(context.var.actor, agent) });+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.post("/:agentId/duplicate", requireUser, async (context) => {+ try {+ const agent = await store.duplicate(+ context.var.actor,+ context.req.param("agentId"),+ );+ return context.json({ agent: agentDto(context.var.actor, agent) }, 201);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.post("/:agentId/hide", requireUser, async (context) => {+ try {+ await store.setHidden(+ context.var.actor,+ context.req.param("agentId"),+ true,+ );+ return context.body(null, 204);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.post("/:agentId/unhide", requireUser, async (context) => {+ try {+ await store.setHidden(+ context.var.actor,+ context.req.param("agentId"),+ false,+ );+ return context.body(null, 204);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.delete("/:agentId", requireUser, async (context) => {+ try {+ await store.softDelete(context.var.actor, context.req.param("agentId"));+ return context.body(null, 204);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ return routes;+}++function boundedText(+ value: unknown,+ maximumLength: number,+ error: string,+): string | { ok: false; error: string } {+ if (typeof value !== "string") return { ok: false, error };+ const trimmed = value.trim();+ return trimmed.length > 0 && trimmed.length <= maximumLength+ ? trimmed+ : { ok: false, error };+}++function agentDto(actor: AgentActor, agent: AgentProfile) {+ return {+ id: agent.id,+ name: agent.name,+ title: agent.title,+ roleDescription: agent.roleDescription,+ avatarSeed: agent.avatarSeed,+ visibility: agent.visibility,+ hidden: agent.hidden,+ systemOwned: agent.systemOwned,+ // Published so the edit form can show it. Safe to expose: it is an address the person supplied,+ // and any credential for it lives in the vault, never in this row.+ endpoint: agent.endpoint,+ hasAuth: agent.hasAuth,+ canManage: canManageAgent(actor, agent),+ // Ownership, kept separate from permission. `canManage` is also true for an administrator on+ // another user's teammate, so a roster that split "mine" on it would file other people's work+ // under yours, and only for administrators, who are the least likely to notice.+ mine: agent.ownerUserId === actor.id,+ };+}++function mapStoreError(context: Context, error: unknown): Response {+ if (error instanceof AgentNotFoundError) {+ return context.json({ error: "Agent not found." }, 404);+ }+ if (error instanceof AgentNotManageableError) {+ return context.json(+ { error: "You do not have permission to manage this agent." },+ 403,+ );+ }+ if (error instanceof ProtectedAgentError) {+ return context.json({ error: "System-owned agents are protected." }, 403);+ }+ throw error;+}diff --git a/server/src/app.ts b/server/src/app.tsnew file mode 100644index 00000000..7675d476--- /dev/null+++ b/server/src/app.ts@@ -0,0 +1,414 @@+import type { Hono as HonoApp, MiddlewareHandler } from "hono";+import { Hono } from "hono";+import type { AgentProfileStore } from "./agents/profile-store";+import { createAgentRoutes } from "./agents/routes";+import { type AuditReader, type AuditStore, auditQueryFromUrl } from "./audit";+import { createDevRequireUser } from "./auth/dev-actor";+import {+ type AppVariables,+ type AuthService,+ createRequireUser,+ type RoleRepository,+ requireAdmin,+} from "./auth/guards";+import type { ChannelEventHub } from "./channels/events";+import { type ChannelStore, createChannelRoutes } from "./channels/routes";+import type { ThreadIdentity } from "./channels/thread-identity";+import { createThreadRoutes } from "./channels/thread-routes";+import { createComponentRoutes } from "./components/routes";+import type { SandboxedStore } from "./components/sandboxed";+import { createSandboxedRoutes } from "./components/sandboxed-routes";+import type { ComponentStore } from "./components/store";+import type { ComputerClient } from "./computer/client";+import type { ComputerGateway } from "./computer/gateway";+import type { PolicyStore } from "./computer/policy-store";+import { createComputerRoutes } from "./computer/routes";+import type { DeploymentConfig } from "./config";+import type { ConnectorAdminService } from "./connectors";+import type { CredentialAdminService, CredentialInput } from "./credentials";+import { createPluginRoutes } from "./plugins/routes";+import type { PluginStore } from "./plugins/store";+import type { PackageStatusReader } from "./tenant-package";++export function createApp(+ config: DeploymentConfig,+ auth?: AuthService,+ roleRepository?: RoleRepository,+ auditReader?: AuditReader,+ credentialService?: CredentialAdminService,+ packageStatusReader?: PackageStatusReader,+ connectorService?: ConnectorAdminService,+ /**+ * The CopilotKit endpoint, already built by the caller.+ *+ * Passed in rather than constructed here so this module never imports the runtime. The runtime+ * pulls in `eventsource`, which Bun cannot `require()` from a test, so importing it at module+ * scope broke every server test that touches createApp even though none of them use CopilotKit.+ */+ copilotHandler?: HonoApp,+ /** Absent when no computer is configured, and the routes are then not mounted at all. */+ computerClient?: ComputerClient,+ /** The only path to an acting call: policy decision, then audit row, then the action. */+ computerGateway?: ComputerGateway,+ /** What the gateway enforces, and what an administrator can change while running. */+ computerPolicy?: PolicyStore,+ /** Bots as durable objects: profile, roster, visibility. */+ agentProfileStore?: AgentProfileStore,+ /** The durable channels a Bot runs in. */+ channelStore?: ChannelStore,+ /** Live channel activity. Absent leaves the routes working, just without the socket. */+ channelEvents?: ChannelEventHub,+ /**+ * Where a Bot's own refusal is written.+ *+ * Separate from `auditReader`, which only reads: this writes, and it is the one thing in the trail+ * that is not decided by the gateway, a model declining before it calls anything.+ */+ auditStore?: AuditStore,+ /**+ * Which components each Bot may answer with.+ *+ * Absent leaves the app working and every Bot answering in prose, which is the correct degraded+ * behaviour: a deployment that cannot reach its grant table must not fall back to granting+ * everything.+ */+ componentStore?: ComponentStore,+ /**+ * The MCP servers and packaged skills this deployment has, and which Bots hold them.+ *+ * Absent leaves every Bot with the tools it was born with, which is the correct degraded+ * behaviour: a deployment that cannot reach its grant table must offer nothing extra rather than+ * fall back to offering everything.+ */+ pluginStore?: PluginStore,+ /**+ * Components authored in the browser rather than compiled into the build.+ *+ * Absent leaves the compiled gallery working exactly as before, which is the correct degraded+ * behaviour: the React path is the primary one and does not depend on this.+ */+ sandboxedStore?: SandboxedStore,+ /**+ * How this deployment names the threads it mints.+ *+ * Absent leaves the direct Bot chat generating its own id in the browser, which works and simply+ * says nothing about which deployment the conversation belongs to.+ */+ threadIdentity?: ThreadIdentity,+) {+ const app = new Hono<{ Variables: AppVariables }>();++ app.get("/health", (context) => context.json({ status: "ok" }));+ // Projected, never the raw runtime. config.runtime carries the Intelligence contract, including+ // INTELLIGENCE_API_KEY and the licence token, and this endpoint is reachable by anyone. Returning+ // the object wholesale would serve deployment secrets to the browser. Add fields here explicitly.+ app.get("/api/capabilities", (context) =>+ context.json({+ mode: config.runtime.mode,+ durableHistory: config.runtime.durableHistory,+ }),+ );+ app.on(["GET", "POST"], "/api/auth/*", (context) => {+ if (!auth) {+ return context.json(+ { error: "Google authentication is not configured." },+ 503,+ );+ }++ return auth.handler(context.req.raw);+ });++ const authenticationUnavailable: MiddlewareHandler<{+ Variables: AppVariables;+ }> = async (context) =>+ context.json({ error: "Google authentication is not configured." }, 503);+ // Local development can stand in a fixed administrator so the product is reachable before the+ // authentication slice is built. It is checked first so a machine with the flag set does not also+ // need Google credentials configured just to boot.+ const requireUser = config.devNoAuth+ ? createDevRequireUser()+ : auth && roleRepository+ ? createRequireUser(auth, roleRepository)+ : authenticationUnavailable;++ app.get("/api/me", requireUser, (context) =>+ context.json({ user: context.var.actor }),+ );+ app.get("/api/admin/status", requireUser, (context) => {+ const denied = requireAdmin(context);+ return denied ?? context.json({ status: "ok" });+ });+ app.get("/api/admin/audit-events", requireUser, async (context) => {+ const denied = requireAdmin(context);+ if (denied) {+ return denied;+ }+ if (!auditReader) {+ return context.json({ error: "Audit logging is not configured." }, 503);+ }++ return context.json(+ await auditReader.list(auditQueryFromUrl(new URL(context.req.url))),+ );+ });+ app.get("/api/admin/credentials", requireUser, async (context) => {+ const denied = requireAdmin(context);+ if (denied) {+ return denied;+ }+ if (!credentialService) {+ return context.json(+ { error: "Credential storage is not configured." },+ 503,+ );+ }++ return context.json({ credentials: await credentialService.list() });+ });+ app.post("/api/admin/credentials", requireUser, async (context) => {+ const denied = requireAdmin(context);+ if (denied) {+ return denied;+ }+ if (!credentialService) {+ return context.json(+ { error: "Credential storage is not configured." },+ 503,+ );+ }++ const body = await context.req.json().catch(() => null);+ const input = credentialInput(body, context.var.actor.id);+ if (!input) {+ return context.json({ error: "Credential input is invalid." }, 400);+ }++ return context.json(+ { credential: await credentialService.create(input) },+ 201,+ );+ });+ app.post(+ "/api/admin/credentials/:credentialId/rotate",+ requireUser,+ async (context) => {+ const denied = requireAdmin(context);+ if (denied) {+ return denied;+ }+ if (!credentialService) {+ return context.json(+ { error: "Credential storage is not configured." },+ 503,+ );+ }++ const body = await context.req.json().catch(() => null);+ const input = credentialInput(body, context.var.actor.id);+ if (!input) {+ return context.json({ error: "Credential input is invalid." }, 400);+ }++ return context.json({+ credential: await credentialService.rotate({+ ...input,+ previousCredentialId: context.req.param("credentialId"),+ }),+ });+ },+ );+ app.post(+ "/api/admin/credentials/:credentialId/revoke",+ requireUser,+ async (context) => {+ const denied = requireAdmin(context);+ if (denied) {+ return denied;+ }+ if (!credentialService) {+ return context.json(+ { error: "Credential storage is not configured." },+ 503,+ );+ }++ return context.json({+ credential: await credentialService.revoke(+ context.req.param("credentialId"),+ context.var.actor.id,+ ),+ });+ },+ );+ app.get("/api/admin/package", requireUser, async (context) => {+ const denied = requireAdmin(context);+ if (denied) return denied;+ if (!packageStatusReader) {+ return context.json({ error: "Tenant package is not configured." }, 503);+ }+ return context.json({ package: await packageStatusReader.active() });+ });+ app.get("/api/admin/connectors", requireUser, async (context) => {+ const denied = requireAdmin(context);+ if (denied) return denied;+ if (!connectorService) {+ return context.json(+ { error: "Connector management is not configured." },+ 503,+ );+ }++ return context.json({ connectors: await connectorService.list() });+ });+ app.post(+ "/api/admin/connectors/google-drive/setup",+ requireUser,+ async (context) => {+ const denied = requireAdmin(context);+ if (denied) return denied;+ if (!connectorService?.configureGoogleDrive) {+ return context.json(+ { error: "Google Drive setup is not configured." },+ 503,+ );+ }+ const body = await context.req.json().catch(() => null);+ const input = googleDriveSetupInput(body, context.var.actor.id);+ if (!input)+ return context.json({ error: "Google Drive setup is invalid." }, 400);+ return context.json(+ { connector: await connectorService.configureGoogleDrive(input) },+ 201,+ );+ },+ );++ // The CopilotKit runtime, behind the same session guard as every other API route. Mounted last so+ // its own routing under /api/copilotkit cannot shadow an OpenBot route declared above.+ if (copilotHandler) {+ // Mounted at the ROOT with the handler carrying its own basePath. Mounting it at+ // "/api/copilotkit" as well double-prefixes it: Hono strips the prefix before the handler sees+ // the path, so every route lands at /api/copilotkit/api/copilotkit/* and /info 404s. The client+ // reports that as "Runtime info request failed with status 404" and every run fails before it+ // starts, with nothing at all in the server log.+ app.route("/", copilotHandler);+ }++ // The Bot computer. Acting on a page needs the gateway and the policy it enforces, so all+ // three arrive together or the routes are not mounted: a computer whose actions were ungoverned is+ // not a reduced feature, it is the one shape of this feature that must not exist.+ if (computerClient && computerGateway && computerPolicy) {+ app.route(+ "/api/computers",+ createComputerRoutes(+ computerClient,+ computerGateway,+ computerPolicy,+ requireUser,+ ),+ );+ }++ if (agentProfileStore) {+ app.route(+ "/api/agents",+ createAgentRoutes(+ agentProfileStore,+ requireUser,+ // The same stance the computer uses: a laptop legitimately talks to its own services, a hosted+ // deployment must not. Passed from configuration rather than defaulted here, so "hosted and+ // permissive" cannot happen by forgetting something.+ config.computer?.allowPrivateHosts ?? false,+ // A Bot's own refusal goes in the same trail as everything else it does.+ auditStore,+ ),+ );+ }++ if (channelStore) {+ app.route(+ "/api/channels",+ createChannelRoutes(channelStore, requireUser, channelEvents),+ );+ }++ if (componentStore) {+ app.route(+ "/api/components",+ createComponentRoutes(componentStore, requireUser, auditStore),+ );+ }++ if (pluginStore) {+ app.route("/api/plugins", createPluginRoutes(pluginStore, requireUser));+ }++ if (sandboxedStore) {+ app.route(+ "/api/sandboxed",+ createSandboxedRoutes(sandboxedStore, requireUser),+ );+ }++ if (threadIdentity) {+ app.route("/api/threads", createThreadRoutes(threadIdentity, requireUser));+ }++ return app;+}++function googleDriveSetupInput(value: unknown, actorUserId: string) {+ if (!value || typeof value !== "object" || Array.isArray(value)) return null;+ const body = value as Record<string, unknown>;+ if (+ typeof body.serviceAccountJson !== "string" ||+ typeof body.impersonationSubject !== "string" ||+ !body.impersonationSubject.trim()+ )+ return null;+ try {+ const json = JSON.parse(body.serviceAccountJson) as unknown;+ if (!json || typeof json !== "object" || Array.isArray(json)) return null;+ } catch {+ return null;+ }+ return {+ serviceAccountJson: body.serviceAccountJson,+ impersonationSubject: body.impersonationSubject.trim(),+ actorUserId,+ };+}++function credentialInput(+ value: unknown,+ actorUserId: string,+): CredentialInput | null {+ if (!value || typeof value !== "object" || Array.isArray(value)) {+ return null;+ }+ const body = value as Record<string, unknown>;+ if (+ (body.kind !== "model" &&+ body.kind !== "connector" &&+ body.kind !== "mcp") ||+ typeof body.provider !== "string" ||+ typeof body.keyId !== "string" ||+ typeof body.plaintext !== "string" ||+ !body.plaintext ||+ !body.metadata ||+ typeof body.metadata !== "object" ||+ Array.isArray(body.metadata)+ ) {+ return null;+ }++ return {+ kind: body.kind,+ provider: body.provider,+ keyId: body.keyId,+ metadata: body.metadata as Record<string, unknown>,+ plaintext: body.plaintext,+ actorUserId,+ };+}diff --git a/server/src/audit.ts b/server/src/audit.tsnew file mode 100644index 00000000..0ff57945--- /dev/null+++ b/server/src/audit.ts@@ -0,0 +1,352 @@+import { and, desc, eq, gt, inArray, lt, or } from "drizzle-orm";+import type { Database } from "./db/client";+import { auditEvents } from "./db/schema";++const sensitiveKeys = new Set([+ "access_token",+ "accesstoken",+ "api_key",+ "apikey",+ "authorization",+ "client_secret",+ "clientsecret",+ "content",+ "credential",+ "credentials",+ "document_content",+ "documentcontent",+ "encrypted_value",+ "encryptedvalue",+ "id_token",+ "idtoken",+ "password",+ "prompt",+ "refresh_token",+ "refreshtoken",+ "result",+ "secret",+ "secrets",+ "token",+ "tokens",+ "tool_arguments",+ "tool_result",+]);++export const auditEventTypes = [+ "configuration.changed",+ "credential.created",+ "credential.rotated",+ "credential.revoked",+ "connector.sync_succeeded",+ "connector.sync_failed",+ "knowledge.searched",+ "agent.invoked",+ "mcp.call_succeeded",+ "mcp.call_rejected",+ // Every action a Bot takes on its computer, allowed or refused. Both, always: a trail that records+ // only what was permitted cannot answer whether the Bot tried.+ "computer.action_allowed",+ "computer.action_refused",+ // Permitted by policy, attempted, and did not succeed. Its own type because "allowed" reads as+ // "happened", and a trail that cannot tell those apart misleads exactly when it matters most.+ "computer.action_failed",+ // A person taking the wheel and giving it back. Recorded as a period rather than as keystrokes: the+ // useful fact for an investigator is that a human drove this browser between these two times, and+ // logging every click a person made would bury it while telling nobody anything.+ "computer.help_requested",+ "computer.control_taken",+ "computer.control_released",+ // A credential a person entered by hand. The row records that it happened, what it was called and+ // which field it went in; the value is on a path this trail is not on.+ "computer.secret_requested",+ "computer.secret_supplied",+ // The computer itself being stopped or wiped. `reset` destroys every login the Bot had, which is+ // both the recovery path and the most consequential button on the admin page, so who pressed it and+ // when is exactly the sort of thing an investigator needs and nothing else records.+ "computer.stopped",+ "computer.reset",+ /**+ * The boundary this deployment booted with.+ *+ * The live policy is held in memory, so a restart returns to the configured default unless the+ * saved row is loaded again. This boot event records the boundary that is actually in force, so an+ * audit reader can interpret earlier policy changes against the deployment state that followed.+ *+ * Written on every boot rather than only when something was lost, because the trail cannot know+ * what the previous process had, and "the deployment restarted with this boundary" is the fact that+ * matters either way.+ */+ "computer.policy_loaded",+ /**+ * Whether this deployment gives each Bot a computer of its own, said out loud at boot.+ *+ * Without a supervisor every Bot shares one browser, which is a legitimate way to run on a laptop+ * and the opposite of what per-Bot isolation promises. The difference is invisible: the screens look+ * identical, the trail looks identical, and a Bot acting on another Bot's session looks exactly like+ * a Bot acting on its own. Nothing in the product distinguishes them, so nothing would.+ *+ * So the deployment states which one it is, once, where it cannot be argued with later. Same reason+ * as `computer.policy_loaded`: the trail records the boundary that is actually in force.+ */+ "computer.isolation_loaded",+ /**+ * The Bot declined something it was asked to do.+ *+ * Every event above records an action a Bot took, decided on by the gateway. A model that refuses+ * before calling any tool takes no action, so the gateway never sees it. This event is the audit+ * trail's record that the Bot was asked to do something and declined before acting.+ *+ * For governance, "this Bot was probed six times last week" is a question the trail answers, and a+ * refusal is the evidence of the attempt.+ *+ * Self-reported. The Bot calls this because it was told to, so a model+ * that declines and says nothing still writes nothing. It records more than zero, which is what+ * there was, and it is not a control, nothing here is enforced by it.+ */+ "bot.declined",++ /*+ * What a Bot may answer with, decided per Bot and recorded like anything else it is trusted with.+ *+ * A component is a capability you grant, so the trail has to answer the same questions a connector+ * or a skill does: who gave this Bot this, when, and who took it away again. Publishing is here for+ * the same reason, it changes what every Bot in the deployment is offered at once, which is the+ * largest single change anybody can make on this surface.+ *+ * `component.refused` records a Bot reaching for something it does not hold. Everything else is a decision somebody made+ * on purpose; this is a Bot reaching for something it does not hold. It is written by the same+ * decision point the app asks before every render, so a grant revoked mid-conversation leaves a row+ * rather than a component that quietly stops appearing.+ */+ "component.granted",+ "component.revoked",+ "component.published",+ "component.unpublished",+ "component.draft_saved",+ "component.refused",++ /*+ * A component reading real data, rather than being handed figures by a model.+ *+ * Recorded like any other tool call because that is what it is: something acting on this+ * deployment's data on a Bot's behalf. `reads` names the source in a few words, so a reader can see+ * what a component actually touched without opening it.+ *+ * `component.function_failed` is deliberately not a refusal. Nothing was forbidden, the read+ * broke, and filing a broken query as a policy event teaches a reader to distrust the policy+ * events that are real.+ */+ "component.function_granted",+ "component.function_revoked",+ "component.function_called",+ "component.function_refused",+ "component.function_failed",+] as const;++export type AuditEventType = (typeof auditEventTypes)[number];++export type AuditEventInput = {+ eventType: AuditEventType;+ targetType: string;+ targetId?: string;+ actorUserId?: string;+ payload: Record<string, unknown>;+};++export type AuditStore = {+ insert: (event: AuditEventInput) => Promise<void>;+};++export type AuditEvent = {+ id: string;+ actorUserId: string | null;+ eventType: string;+ targetType: string;+ targetId: string | null;+ payload: Record<string, unknown>;+ createdAt: string;+};++export type AuditEventQuery = {+ cursor?: string;+ limit: number;+ /**+ * One event type, or several separated by commas.+ *+ * Several, because the questions people arrive with cut across the events that answer them: "was+ * anything blocked" is a computer action refused, a component refused AND an MCP call rejected,+ * and a filter that returns only the first quietly hides two thirds of the refusals.+ */+ eventType?: string;+ actorUserId?: string;+ targetType?: string;+ targetId?: string;+ from?: string;+ to?: string;+};++export type AuditReader = {+ list: (query: AuditEventQuery) => Promise<{+ events: AuditEvent[];+ nextCursor?: string;+ }>;+};++type AuditCursor = {+ createdAt: string;+ id: string;+};++function normalizedKey(key: string) {+ return key.replaceAll(/[^a-zA-Z0-9]/g, "").toLowerCase();+}++function isSensitiveKey(key: string) {+ return (+ sensitiveKeys.has(key.toLowerCase()) ||+ sensitiveKeys.has(normalizedKey(key))+ );+}++export function redactAuditPayload(value: unknown): unknown {+ if (Array.isArray(value)) {+ return value.map(redactAuditPayload);+ }++ if (!value || typeof value !== "object") {+ return value;+ }++ return Object.fromEntries(+ Object.entries(value).map(([key, nestedValue]) => [+ key,+ isSensitiveKey(key) ? "[REDACTED]" : redactAuditPayload(nestedValue),+ ]),+ );+}++export async function recordAuditEvent(+ store: AuditStore,+ event: AuditEventInput,+) {+ await store.insert({+ ...event,+ payload: redactAuditPayload(event.payload) as Record<string, unknown>,+ });+}++export function createAuditStore(database: Database): AuditStore {+ return {+ insert: async (event) => {+ await database.insert(auditEvents).values(event);+ },+ };+}++function encodeCursor(cursor: AuditCursor) {+ return Buffer.from(JSON.stringify(cursor)).toString("base64url");+}++function decodeCursor(cursor: string): AuditCursor {+ try {+ const parsed = JSON.parse(+ Buffer.from(cursor, "base64url").toString("utf8"),+ ) as AuditCursor;++ if (!parsed.id || Number.isNaN(Date.parse(parsed.createdAt))) {+ throw new Error("invalid cursor");+ }+ return parsed;+ } catch {+ throw new Error("cursor must be a valid audit page cursor");+ }+}++export function createAuditReader(database: Database): AuditReader {+ return {+ list: async (query) => {+ const requestedTypes = (query.eventType ?? "")+ .split(",")+ .map((type) => type.trim())+ .filter(Boolean);+ const conditions = [+ requestedTypes.length === 1+ ? eq(auditEvents.eventType, requestedTypes[0] as string)+ : requestedTypes.length > 1+ ? inArray(auditEvents.eventType, requestedTypes)+ : undefined,+ query.actorUserId+ ? eq(auditEvents.actorUserId, query.actorUserId)+ : undefined,+ query.targetType+ ? eq(auditEvents.targetType, query.targetType)+ : undefined,+ query.targetId ? eq(auditEvents.targetId, query.targetId) : undefined,+ query.from+ ? gt(auditEvents.createdAt, new Date(query.from))+ : undefined,+ query.to ? lt(auditEvents.createdAt, new Date(query.to)) : undefined,+ ];+ const cursor = query.cursor ? decodeCursor(query.cursor) : undefined;++ if (cursor) {+ conditions.push(+ or(+ lt(auditEvents.createdAt, new Date(cursor.createdAt)),+ and(+ eq(auditEvents.createdAt, new Date(cursor.createdAt)),+ lt(auditEvents.id, cursor.id),+ ),+ ),+ );+ }++ const rows = await database+ .select()+ .from(auditEvents)+ .where(and(...conditions))+ .orderBy(desc(auditEvents.createdAt), desc(auditEvents.id))+ .limit(query.limit + 1);+ const hasNextPage = rows.length > query.limit;+ const page = rows.slice(0, query.limit);+ const last = page.at(-1);++ return {+ events: page.map((event) => ({+ ...event,+ createdAt: event.createdAt.toISOString(),+ payload: event.payload as Record<string, unknown>,+ })),+ nextCursor:+ hasNextPage && last+ ? encodeCursor({+ id: last.id,+ createdAt: last.createdAt.toISOString(),+ })+ : undefined,+ };+ },+ };+}++export function auditQueryFromUrl(url: URL): AuditEventQuery {+ const requestedLimit = Number.parseInt(+ url.searchParams.get("limit") ?? "50",+ 10,+ );+ const limit = Number.isFinite(requestedLimit)+ ? Math.min(Math.max(requestedLimit, 1), 100)+ : 50;+ const optional = (name: string) => url.searchParams.get(name) ?? undefined;++ return {+ cursor: optional("cursor"),+ limit,+ eventType: optional("eventType"),+ actorUserId: optional("actorUserId"),+ targetType: optional("targetType"),+ targetId: optional("targetId"),+ from: optional("from"),+ to: optional("to"),+ };+}diff --git a/server/src/auth/dev-actor.ts b/server/src/auth/dev-actor.tsnew file mode 100644index 00000000..e602336a--- /dev/null+++ b/server/src/auth/dev-actor.ts@@ -0,0 +1,81 @@+import type { MiddlewareHandler } from "hono";+import type { Database } from "../db/client";+import { users } from "../db/schema";+import type { AppVariables, AuthenticatedActor } from "./guards";++/**+ * A signed-in person, without signing in. Local development only.+ *+ * Local development can opt into a fixed administrator actor so the product can run without Google+ * OAuth credentials or an interactive consent screen. Hosted deployments must use real+ * authentication.+ *+ * Two independent locks:+ *+ * 1. `OPENBOT_DEV_NO_AUTH=true` must be set. Absent, nothing here runs.+ * 2. `NODE_ENV` must not be `production`. A deployment that sets the flag by accident still refuses,+ * and it refuses by refusing to start rather than by ignoring the flag, because a+ * deployment believing it has authentication when it does not is the worst of the three states.+ *+ * The actor is an administrator so admin surfaces can be demonstrated too, and its id is fixed so+ * Intelligence threads and memory stay attached to the same person across restarts.+ */++export const DEV_ACTOR: AuthenticatedActor = {+ id: "dev-local-user",+ email: "[email protected]",+ role: "admin",+};++type UserWriter = Pick<Database, "insert">;++export async function initializeDevActorUser(+ database: UserWriter,+ enabled: boolean,+): Promise<boolean> {+ if (!enabled) return false;++ const name = DEV_ACTOR.name ?? DEV_ACTOR.email;+ await database+ .insert(users)+ .values({+ id: DEV_ACTOR.id,+ email: DEV_ACTOR.email,+ name,+ emailVerified: false,+ })+ .onConflictDoUpdate({+ target: users.id,+ set: {+ email: DEV_ACTOR.email,+ name,+ updatedAt: new Date(),+ },+ });++ return true;+}++export function devAuthEnabled(+ environment: Record<string, string | undefined>,+): boolean {+ if (environment.OPENBOT_DEV_NO_AUTH?.trim() !== "true") {+ return false;+ }+ if (environment.NODE_ENV === "production") {+ throw new Error(+ "OPENBOT_DEV_NO_AUTH cannot be used with NODE_ENV=production. Refusing to start without authentication.",+ );+ }+ return true;+}++/** A guard that admits everybody as {@link DEV_ACTOR}. Only ever mounted when devAuthEnabled(). */+export function createDevRequireUser(): MiddlewareHandler<{+ Variables: AppVariables;+}> {+ return async (context, next) => {+ context.set("actor", DEV_ACTOR);+ await next();+ };+}diff --git a/server/src/auth/guards.ts b/server/src/auth/guards.tsnew file mode 100644index 00000000..9aa2d8be--- /dev/null+++ b/server/src/auth/guards.ts@@ -0,0 +1,95 @@+import { eq } from "drizzle-orm";+import type { Context, MiddlewareHandler } from "hono";+import type { Database } from "../db/client";+import { userRoles } from "../db/schema";+import type { OpenBotRole } from "./roles";++export type AuthenticatedActor = {+ id: string;+ email: string;+ name?: string | null;+ image?: string | null;+ role: OpenBotRole;+};++export type AuthService = {+ handler: (request: Request) => Response | Promise<Response>;+ api: {+ getSession: (input: {+ headers: Headers;+ query: { disableCookieCache: boolean };+ }) => Promise<{+ user: {+ id: string;+ email: string;+ name?: string | null;+ image?: string | null;+ };+ } | null>;+ };+};++export type RoleRepository = {+ rolesForUser: (userId: string) => Promise<OpenBotRole[]>;+};++export type AppVariables = {+ actor: AuthenticatedActor;+};++export function createRoleRepository(database: Database): RoleRepository {+ return {+ rolesForUser: async (userId) => {+ const records = await database+ .select({ role: userRoles.role })+ .from(userRoles)+ .where(eq(userRoles.userId, userId));++ return records.map((record) => record.role);+ },+ };+}++export function createRequireUser(+ auth: AuthService,+ roleRepository: RoleRepository,+): MiddlewareHandler<{ Variables: AppVariables }> {+ return async (context, next) => {+ const session = await auth.api.getSession({+ headers: context.req.raw.headers,+ query: { disableCookieCache: true },+ });++ if (!session) {+ return context.json({ error: "Authentication required." }, 401);+ }++ const roles = await roleRepository.rolesForUser(session.user.id);+ const role = roles.includes("admin")+ ? "admin"+ : roles.includes("user")+ ? "user"+ : undefined;++ if (!role) {+ return context.json({ error: "Authorization required." }, 403);+ }++ context.set("actor", {+ id: session.user.id,+ email: session.user.email,+ name: session.user.name,+ image: session.user.image,+ role,+ });+ await next();+ };+}++export function requireAdmin(context: Context<{ Variables: AppVariables }>) {+ if (context.var.actor.role !== "admin") {+ return context.json({ error: "Administrator access required." }, 403);+ }++ return undefined;+}diff --git a/server/src/auth/index.ts b/server/src/auth/index.tsnew file mode 100644index 00000000..8ef519f1--- /dev/null+++ b/server/src/auth/index.ts@@ -0,0 +1,48 @@+import { drizzleAdapter } from "@better-auth/drizzle-adapter";+import { betterAuth } from "better-auth";+import type { DeploymentConfig } from "../config";+import type { Database } from "../db/client";+import {+ accounts,+ sessions,+ userRoles,+ users,+ verifications,+} from "../db/schema";+import { roleForEmail } from "./roles";++export function createAuth(config: DeploymentConfig, database: Database) {+ const authConfig = config.auth;+ if (!authConfig) {+ throw new Error("Google authentication is not configured.");+ }++ return betterAuth({+ baseURL: authConfig.baseUrl,+ secret: authConfig.secret,+ trustedOrigins: authConfig.trustedOrigins,+ database: drizzleAdapter(database, {+ provider: "pg",+ usePlural: true,+ schema: { users, sessions, accounts, verifications },+ }),+ socialProviders: {+ google: authConfig.google,+ },+ databaseHooks: {+ user: {+ create: {+ after: async (user) => {+ await database+ .insert(userRoles)+ .values({+ userId: user.id,+ role: roleForEmail(user.email, authConfig.initialAdminEmails),+ })+ .onConflictDoNothing();+ },+ },+ },+ },+ });+}diff --git a/server/src/channels/routes.ts b/server/src/channels/routes.tsnew file mode 100644index 00000000..4789811b--- /dev/null+++ b/server/src/channels/routes.ts@@ -0,0 +1,544 @@+import { and, asc, eq, isNull, lt, or, sql } from "drizzle-orm";+import type { Context, MiddlewareHandler } from "hono";+import { Hono } from "hono";+import {+ AgentNotFoundError,+ type AgentProfileStore,+} from "../agents/profile-store";+import type { AgentActor, AgentProfile } from "../agents/profile-types";+import type { AppVariables } from "../auth/guards";+import type { Database } from "../db/client";+import {+ agentProfiles,+ channelAgents,+ channelMemberships,+ channels,+ intelligenceChannelMappings,+} from "../db/schema";+import {+ CHANNEL_ACTIVITY_TOPIC,+ type ChannelActivityEvent,+ type ChannelEventHub,+} from "./events";+import type { ThreadIdentity } from "./thread-identity";+import { upgradeWebSocket } from "./socket";++export type AgentChannel = {+ id: string;+ name: string;+ agentIds: string[];+ threadId: string;+ active: boolean;+};++/** A channel plus the last thing said in it, which is what a roster renders. */+export type ChannelSummary = AgentChannel & {+ lastMessage: string | null;+ lastMessageAt: Date | null;+ lastMessageAgentId: string | null;+ createdAt: Date;+};++/** What a client that ran an agent reports back about the message it just saw. */+export type ChannelActivity = {+ text: string;+ /** The agent that said it, or null when a person did. */+ agentId: string | null;+ at: Date;+};++export type ChannelStore = {+ create(actor: AgentActor, agentIds: string[]): Promise<AgentChannel>;+ get(actor: AgentActor, channelId: string): Promise<AgentChannel | null>;+ list(actor: AgentActor): Promise<ChannelSummary[]>;+ recordActivity(+ actor: AgentActor,+ channelId: string,+ activity: ChannelActivity,+ ): Promise<void>;+};++const PRIVATE_AGENT_CHANNEL_DESCRIPTION = "Private agent channel.";+const MAX_CHANNEL_NAME_CODE_POINTS = 120;+const MAX_ACTIVITY_CODE_POINTS = 200;++/**+ * Reduce a message to one line of plain text.+ *+ * A preview is rendered as text wherever a roster appears, so control characters have nothing to do+ * there: at best they are invisible, at worst a terminal escape somebody put in a message follows it+ * into a log. Newlines collapse to spaces because a preview is one line by definition.+ */+function previewOf(text: string) {+ // biome-ignore lint/suspicious/noControlCharactersInRegex: stripping them is the point.+ const flattened = text.replace(/[\u0000-\u001f\u007f-\u009f]+/g, " ").trim();+ const collapsed = flattened.replace(/\s+/g, " ");+ const codePoints = Array.from(collapsed);+ if (codePoints.length <= MAX_ACTIVITY_CODE_POINTS) return collapsed;+ return `${codePoints.slice(0, MAX_ACTIVITY_CODE_POINTS - 1).join("")}…`;+}++function channelName(names: string[]) {+ const joined = names.join(", ");+ const codePoints = Array.from(joined);+ if (codePoints.length <= MAX_CHANNEL_NAME_CODE_POINTS) return joined;+ return `${codePoints.slice(0, MAX_CHANNEL_NAME_CODE_POINTS - 1).join("")}…`;+}++export function createChannelStore(+ database: Database,+ profileStore: AgentProfileStore,+ threadIdentity: ThreadIdentity,+): ChannelStore {+ return {+ create(actor, agentIds) {+ return database.transaction(+ async (transaction) => {+ // Validated on this transaction, not through `profileStore.get`: the read has to share+ // the connection this transaction already holds, and has to hold the profile so an agent+ // cannot be deleted between passing the check and being linked to the new channel.+ //+ // Locks are taken in agent-ID order. Two channels selecting the same pair of agents in+ // opposite orders would otherwise be able to deadlock against each other.+ const profilesById = new Map<string, AgentProfile>();+ for (const agentId of [...agentIds].sort()) {+ const profile = await profileStore.getWithin(+ transaction,+ actor,+ agentId,+ );+ if (!profile) throw new AgentNotFoundError(agentId);+ profilesById.set(agentId, profile);+ }++ const id = `channel_${crypto.randomUUID()}`;+ // Minted rather than a bare random id, so the thread says which deployment it belongs to+ // in a project that may hold more than one. See thread-identity.ts.+ const threadId = threadIdentity.mint();+ // Named from the caller's ordering, which is the order the channel presents its agents in.+ const name = channelName(+ agentIds.map((agentId) => {+ const profile = profilesById.get(agentId);+ if (!profile) throw new AgentNotFoundError(agentId);+ return profile.name;+ }),+ );++ await transaction.insert(channels).values({+ id,+ name,+ description: PRIVATE_AGENT_CHANNEL_DESCRIPTION,+ });+ await transaction.insert(channelMemberships).values({+ channelId: id,+ userId: actor.id,+ });+ await transaction+ .insert(channelAgents)+ .values(agentIds.map((agentId) => ({ channelId: id, agentId })));+ await transaction.insert(intelligenceChannelMappings).values({+ userId: actor.id,+ channelId: id,+ threadId,+ });++ return { id, name, agentIds, threadId, active: true };+ },+ { isolationLevel: "read committed" },+ );+ },++ async get(actor, channelId) {+ const rows = await database+ .select({+ id: channels.id,+ name: channels.name,+ agentId: channelAgents.agentId,+ threadId: intelligenceChannelMappings.threadId,+ deletedAt: agentProfiles.deletedAt,+ })+ .from(channels)+ .innerJoin(+ channelMemberships,+ and(+ eq(channelMemberships.channelId, channels.id),+ eq(channelMemberships.userId, actor.id),+ ),+ )+ .innerJoin(+ intelligenceChannelMappings,+ and(+ eq(intelligenceChannelMappings.channelId, channels.id),+ eq(intelligenceChannelMappings.userId, actor.id),+ ),+ )+ .innerJoin(channelAgents, eq(channelAgents.channelId, channels.id))+ .innerJoin(+ agentProfiles,+ eq(agentProfiles.agentId, channelAgents.agentId),+ )+ .where(eq(channels.id, channelId))+ .orderBy(asc(channelAgents.agentId));++ const first = rows[0];+ if (!first) return null;++ return {+ id: first.id,+ name: first.name,+ agentIds: rows.map((row) => row.agentId),+ threadId: first.threadId,+ active: rows.every((row) => row.deletedAt === null),+ };+ },++ async list(actor) {+ const rows = await database+ .select({+ id: channels.id,+ name: channels.name,+ agentId: channelAgents.agentId,+ threadId: intelligenceChannelMappings.threadId,+ deletedAt: agentProfiles.deletedAt,+ lastMessage: channels.lastMessage,+ lastMessageAt: channels.lastMessageAt,+ lastMessageAgentId: channels.lastMessageAgentId,+ createdAt: channels.createdAt,+ })+ .from(channels)+ .innerJoin(+ channelMemberships,+ and(+ eq(channelMemberships.channelId, channels.id),+ eq(channelMemberships.userId, actor.id),+ ),+ )+ .innerJoin(+ intelligenceChannelMappings,+ and(+ eq(intelligenceChannelMappings.channelId, channels.id),+ eq(intelligenceChannelMappings.userId, actor.id),+ ),+ )+ .innerJoin(channelAgents, eq(channelAgents.channelId, channels.id))+ .innerJoin(+ agentProfiles,+ eq(agentProfiles.agentId, channelAgents.agentId),+ )+ // Most recent first, where starting a conversation counts as activity. A channel somebody+ // just created has nothing said in it yet, and is also the one they are about to type in, // ordering on the message alone would bury it under every channel that has one.+ //+ // The browser repeats this when the socket patches a row. Both must agree, or the list+ // reorders itself on the next event; see `byRecency` in use-channel-events.ts.+ .orderBy(+ sql`coalesce(${channels.lastMessageAt}, ${channels.createdAt}) desc`,+ asc(channels.id),+ asc(channelAgents.agentId),+ );++ // One row per channel-agent pair; the ordering above keeps each channel's rows together and+ // its agents in the same lexicographic order `get` returns.+ const summaries = new Map<string, ChannelSummary>();+ for (const row of rows) {+ const summary = summaries.get(row.id);+ if (summary) {+ summary.agentIds.push(row.agentId);+ summary.active &&= row.deletedAt === null;+ continue;+ }+ summaries.set(row.id, {+ id: row.id,+ name: row.name,+ agentIds: [row.agentId],+ threadId: row.threadId,+ active: row.deletedAt === null,+ lastMessage: row.lastMessage,+ lastMessageAt: row.lastMessageAt,+ lastMessageAgentId: row.lastMessageAgentId,+ createdAt: row.createdAt,+ });+ }+ return [...summaries.values()];+ },++ recordActivity(actor, channelId, activity) {+ return database.transaction(+ async (transaction) => {+ const [membership] = await transaction+ .select({ channelId: channelMemberships.channelId })+ .from(channelMemberships)+ .where(+ and(+ eq(channelMemberships.channelId, channelId),+ eq(channelMemberships.userId, actor.id),+ ),+ );+ // Not a member, or no such channel: the same answer either way, so belonging to a channel+ // is not something an outsider can probe for.+ if (!membership) throw new ChannelNotFoundError(channelId);++ if (activity.agentId !== null) {+ const [linked] = await transaction+ .select({ agentId: channelAgents.agentId })+ .from(channelAgents)+ .where(+ and(+ eq(channelAgents.channelId, channelId),+ eq(channelAgents.agentId, activity.agentId),+ ),+ );+ if (!linked) throw new AgentNotFoundError(activity.agentId);+ }++ // A person's message and the agent's reply are reported separately, so they can arrive out+ // of order. Only ever move forwards.+ const lastMessage = previewOf(activity.text);+ const applied = await transaction+ .update(channels)+ .set({+ lastMessage,+ lastMessageAt: activity.at,+ lastMessageAgentId: activity.agentId,+ updatedAt: new Date(),+ })+ .where(+ and(+ eq(channels.id, channelId),+ or(+ isNull(channels.lastMessageAt),+ lt(channels.lastMessageAt, activity.at),+ ),+ ),+ )+ .returning({ id: channels.id });+ // Nothing changed, so there is nothing to announce: a stale report is not news.+ if (applied.length === 0) return;++ const members = await transaction+ .select({ userId: channelMemberships.userId })+ .from(channelMemberships)+ .where(eq(channelMemberships.channelId, channelId));++ // Announced inside the transaction, so it is delivered on commit and a write that rolls+ // back is never announced. The payload carries the members because the writer has already+ // resolved them; NOTIFY caps at 8000 bytes, which a 200-character preview leaves room in.+ const event: ChannelActivityEvent = {+ channelId,+ memberIds: members.map((member) => member.userId),+ lastMessage,+ lastMessageAt: activity.at.toISOString(),+ lastMessageAgentId: activity.agentId,+ };+ await transaction.execute(+ sql`select pg_notify(${CHANNEL_ACTIVITY_TOPIC}, ${JSON.stringify(event)})`,+ );+ },+ { isolationLevel: "read committed" },+ );+ },+ };+}++export class ChannelNotFoundError extends Error {+ constructor(id: string) {+ super(`Channel ${id} was not found.`);+ this.name = "ChannelNotFoundError";+ }+}++type ChannelInputParseResult =+ | { ok: true; value: { agentIds: string[] } }+ | { ok: false; error: string };++type ChannelInputObject = { agentIds?: unknown };++export function parseChannelInput(input: unknown): ChannelInputParseResult {+ if (!isChannelInputObject(input)) {+ return { ok: false, error: "Channel input must be a JSON object." };+ }++ if (!Array.isArray(input.agentIds) || input.agentIds.length === 0) {+ return { ok: false, error: "Agent IDs must be a non-empty array." };+ }++ const agentIds: string[] = [];+ for (const agentId of input.agentIds) {+ if (typeof agentId !== "string" || agentId.trim().length === 0) {+ return { ok: false, error: "Agent IDs must be non-empty strings." };+ }+ agentIds.push(agentId.trim());+ }++ if (new Set(agentIds).size !== agentIds.length) {+ return { ok: false, error: "Agent IDs must be unique." };+ }++ return { ok: true, value: { agentIds: agentIds.sort() } };+}++function isChannelInputObject(input: unknown): input is ChannelInputObject {+ return typeof input === "object" && input !== null && !Array.isArray(input);+}++type ActivityInputParseResult =+ | { ok: true; value: ChannelActivity }+ | { ok: false; error: string };++/**+ * Parse a reported message.+ *+ * `at` comes from the client that saw the message, because only it knows when the message arrived, * but it is never trusted as a clock: the store compares it against what is stored and only ever+ * moves forwards, so a wrong one can lose a report, not corrupt the row.+ */+export function parseActivityInput(input: unknown): ActivityInputParseResult {+ if (!isChannelInputObject(input)) {+ return { ok: false, error: "Activity must be a JSON object." };+ }+ const object = input as { text?: unknown; agentId?: unknown; at?: unknown };++ if (typeof object.text !== "string" || object.text.trim().length === 0) {+ return { ok: false, error: "Text is required." };+ }+ if (object.agentId !== null && typeof object.agentId !== "string") {+ return { ok: false, error: "Agent ID must be a string or null." };+ }+ if (typeof object.at !== "string") {+ return { ok: false, error: "Timestamp is required." };+ }+ const at = new Date(object.at);+ if (Number.isNaN(at.getTime())) {+ return { ok: false, error: "Timestamp must be an ISO-8601 date." };+ }++ return {+ ok: true,+ value: {+ agentId:+ typeof object.agentId === "string" ? object.agentId.trim() : null,+ at,+ text: object.text,+ },+ };+}++export function createChannelRoutes(+ store: ChannelStore,+ requireUser: MiddlewareHandler<{ Variables: AppVariables }>,+ /** Absent in tests and wherever live updates are not wanted; the routes still work without it. */+ events?: ChannelEventHub,+) {+ const routes = new Hono<{ Variables: AppVariables }>();++ // Before `/:channelId`, or "events" is read as a channel id.+ if (events) {+ routes.get(+ "/events",+ requireUser,+ upgradeWebSocket((context) => {+ // Resolved at upgrade, not per message: the connection belongs to whoever authenticated it,+ // and nothing it later sends can change that.+ const { id: userId } = context.var.actor;+ let detach = () => {};+ return {+ onOpen: (_event, ws) => {+ detach = events.register(userId, (payload) => ws.send(payload));+ },+ onClose: () => detach(),+ onError: () => detach(),+ };+ }),+ );+ }++ routes.post("/", requireUser, async (context) => {+ const parsed = parseChannelInput(+ await context.req.json().catch(() => null),+ );+ if (!parsed.ok) return context.json({ error: parsed.error }, 400);++ try {+ const channel = await store.create(+ context.var.actor,+ parsed.value.agentIds,+ );+ return context.json({ channel: channelDto(channel) }, 201);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.get("/", requireUser, async (context) => {+ try {+ const channels = await store.list(context.var.actor);+ return context.json({ channels: channels.map(channelSummaryDto) });+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.post("/:channelId/activity", requireUser, async (context) => {+ const parsed = parseActivityInput(+ await context.req.json().catch(() => null),+ );+ if (!parsed.ok) return context.json({ error: parsed.error }, 400);++ try {+ await store.recordActivity(+ context.var.actor,+ context.req.param("channelId"),+ parsed.value,+ );+ return context.body(null, 204);+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ routes.get("/:channelId", requireUser, async (context) => {+ try {+ const channel = await store.get(+ context.var.actor,+ context.req.param("channelId"),+ );+ if (!channel) {+ return context.json({ error: "Channel not found." }, 404);+ }+ return context.json({ channel: channelDto(channel) });+ } catch (error) {+ return mapStoreError(context, error);+ }+ });++ return routes;+}++function channelDto(channel: AgentChannel): AgentChannel {+ return {+ id: channel.id,+ name: channel.name,+ agentIds: channel.agentIds,+ threadId: channel.threadId,+ active: channel.active,+ };+}++function channelSummaryDto(channel: ChannelSummary) {+ return {+ ...channelDto(channel),+ lastMessage: channel.lastMessage,+ // Serialised as ISO-8601 so the browser gets a string it can sort and format.+ lastMessageAt: channel.lastMessageAt?.toISOString() ?? null,+ lastMessageAgentId: channel.lastMessageAgentId,+ createdAt: channel.createdAt.toISOString(),+ };+}++function mapStoreError(context: Context, error: unknown): Response {+ if (error instanceof AgentNotFoundError) {+ return context.json({ error: "Agent not found." }, 404);+ }+ if (error instanceof ChannelNotFoundError) {+ return context.json({ error: "Channel not found." }, 404);+ }+ throw error;+}diff --git a/server/src/components/store.ts b/server/src/components/store.tsnew file mode 100644index 00000000..31e9afea--- /dev/null+++ b/server/src/components/store.ts@@ -0,0 +1,384 @@+import { and, asc, eq, inArray, isNull } from "drizzle-orm";+import type { Database } from "../db/client";+import {+ componentExclusions,+ componentFunctions,+ components,+} from "../db/schema";+import { dataFunction } from "./functions";++export type ComponentRecord = {+ name: string;+ title: string;+ kind: string;+ draftDescription: string;+ publishedDescription: string | null;+ published: boolean;+ publishedAt: string | null;+ updatedBy: string | null;+ updatedAt: string;+ /** Whether the draft says something the published version does not. */+ hasUnpublishedChanges: boolean;+ /** The Bots held back from this. Every other Bot, including ones added later, may use it. */+ withheldFrom: string[];+ /** The data functions this component may call. Empty means it may call none. */+ functions: string[];+};++/** What one Bot may answer with, which is all the app needs to register its tools. */+export type GrantedComponent = {+ name: string;+ /** The published description. A draft is never sent anywhere a model can read it. */+ description: string;+};++/**+ * The outcome of asking whether a Bot may use a component right now.+ *+ * `reason` is written to be read by the model and shown to the person, so it says what happened and+ * what it means rather than naming a table.+ */+export type ComponentDecision =+ | { allowed: true; description: string }+ | { allowed: false; reason: string };++export class ComponentNotFoundError extends Error {+ constructor(name: string) {+ super(`No component is called ${name}.`);+ this.name = "ComponentNotFoundError";+ }+}++/** What a build says it can draw. The app announces this; the server keeps no copy of its own. */+export type CatalogueEntry = {+ name: string;+ title: string;+ kind: string;+ description: string;+};++export type ComponentStore = {+ /**+ * Learn about components this deployment has not seen before.+ *+ * Additive, never overwriting. A row that already exists belongs to the deployment: its published+ * wording, its grants and whether it is published at all were decided here, and an upgrade that+ * quietly reset any of them would be this function undoing an administrator\'s work on every boot.+ * Safe to call on every page load for that reason.+ */+ syncCatalogue(entries: CatalogueEntry[]): Promise<{ added: string[] }>;+ list(): Promise<ComponentRecord[]>;+ /** What this Bot may answer with: everything published, less whatever it has been held back from. */+ listForAgent(agentId: string): Promise<GrantedComponent[]>;+ /**+ * The one decision point. Everything that wants to know whether a Bot may use a component asks+ * here, so there is a single place where the answer is decided and a single place to audit it.+ */+ decide(name: string, agentId: string): Promise<ComponentDecision>;+ /** Stop holding this Bot back from this component. Takes no actor: it writes no row. */+ grant(name: string, agentId: string): Promise<void>;+ /** Hold this Bot back from this one component. Every other Bot is unaffected. */+ revoke(name: string, agentId: string, by: string): Promise<void>;+ grantFunction(name: string, functionName: string, by: string): Promise<void>;+ revokeFunction(name: string, functionName: string): Promise<void>;+ /**+ * May this component call this function?+ *+ * Separate from {@link ComponentStore.decide} rather than folded into it, because they answer+ * different questions and a caller needs both: whether this Bot may use the component at all, and+ * whether the component may read this data. Answering them together would let a caller satisfy one+ * and believe it had satisfied the other.+ */+ mayCall(name: string, functionName: string): Promise<boolean>;+ /** Run a data function against this deployment. Permission is the caller's question, not this one's. */+ callFunction(+ functionName: string,+ args: Record<string, unknown>,+ ): Promise<unknown>;+ publish(name: string, by: string): Promise<void>;+ unpublish(name: string, by: string): Promise<void>;+ saveDraft(name: string, description: string, by: string): Promise<void>;+};++const iso = (value: Date | string | null): string | null =>+ value === null ? null : value instanceof Date ? value.toISOString() : value;++export function createComponentStore(database: Database): ComponentStore {+ async function requireComponent(name: string) {+ const [row] = await database+ .select()+ .from(components)+ .where(eq(components.name, name))+ .limit(1);+ if (!row) throw new ComponentNotFoundError(name);+ return row;+ }++ return {+ async syncCatalogue(entries) {+ if (entries.length === 0) return { added: [] };++ const existing = await database+ .select({ name: components.name })+ .from(components);+ const known = new Set(existing.map((row) => row.name));+ const missing = entries.filter((entry) => !known.has(entry.name));+ if (missing.length === 0) return { added: [] };++ await database+ .insert(components)+ .values(+ missing.map((entry) => ({+ name: entry.name,+ title: entry.title,+ kind: entry.kind,+ draftDescription: entry.description,+ // Published on arrival, so a fresh install can draw from the moment it starts.+ publishedDescription: entry.description,+ published: true,+ publishedAt: new Date(),+ updatedBy: "the build",+ })),+ )+ // Two browsers announcing the same new component at once is ordinary, not a fault: whichever+ // arrives second must be a no-op rather than a duplicate-key error thrown at a page load.+ .onConflictDoNothing();++ return { added: missing.map((entry) => entry.name) };+ },++ async list() {+ const rows = await database+ .select()+ .from(components)+ .orderBy(asc(components.kind), asc(components.title));+ if (rows.length === 0) return [];++ const functionRows = await database+ .select()+ .from(componentFunctions)+ .where(+ inArray(+ componentFunctions.componentName,+ rows.map((row) => row.name),+ ),+ );+ const functionsByComponent = new Map<string, string[]>();+ for (const row of functionRows) {+ const list = functionsByComponent.get(row.componentName) ?? [];+ list.push(row.functionName);+ functionsByComponent.set(row.componentName, list);+ }++ const exclusionRows = await database+ .select()+ .from(componentExclusions)+ .where(+ inArray(+ componentExclusions.componentName,+ rows.map((row) => row.name),+ ),+ );++ const byComponent = new Map<string, string[]>();+ for (const exclusion of exclusionRows) {+ const list = byComponent.get(exclusion.componentName) ?? [];+ list.push(exclusion.agentId);+ byComponent.set(exclusion.componentName, list);+ }++ return rows.map((row) => ({+ name: row.name,+ title: row.title,+ kind: row.kind,+ draftDescription: row.draftDescription,+ publishedDescription: row.publishedDescription,+ published: row.published,+ publishedAt: iso(row.publishedAt),+ updatedBy: row.updatedBy,+ updatedAt: iso(row.updatedAt) as string,+ hasUnpublishedChanges:+ row.draftDescription !== (row.publishedDescription ?? ""),+ withheldFrom: (byComponent.get(row.name) ?? []).sort(),+ functions: (functionsByComponent.get(row.name) ?? []).sort(),+ }));+ },++ async listForAgent(agentId) {+ const rows = await database+ .select({+ name: components.name,+ description: components.publishedDescription,+ })+ .from(components)+ // Joined on this Bot specifically, so another Bot's withholding cannot remove a row here.+ .leftJoin(+ componentExclusions,+ and(+ eq(componentExclusions.componentName, components.name),+ eq(componentExclusions.agentId, agentId),+ ),+ )+ .where(+ and(+ eq(components.published, true),+ isNull(componentExclusions.agentId),+ ),+ )+ .orderBy(asc(components.name));++ // A published row with no description is not a thing the model can be told about, so it is left+ // out rather than sent as an empty string it would have to guess the meaning of.+ return rows.flatMap((row) =>+ row.description+ ? [{ name: row.name, description: row.description }]+ : [],+ );+ },++ async decide(name, agentId) {+ const [row] = await database+ .select({+ published: components.published,+ description: components.publishedDescription,+ title: components.title,+ withheldFrom: componentExclusions.agentId,+ })+ .from(components)+ .leftJoin(+ componentExclusions,+ and(+ eq(componentExclusions.componentName, components.name),+ eq(componentExclusions.agentId, agentId),+ ),+ )+ .where(eq(components.name, name))+ .limit(1);++ // Every refusal says which one it is. "Not allowed" sends a model round the same loop; naming+ // the cause lets it either pick a different component or tell the person what to change.+ if (!row) {+ return {+ allowed: false,+ reason: `There is no component called ${name} in this deployment. Answer in prose instead.`,+ };+ }+ if (!row.published || !row.description) {+ return {+ allowed: false,+ reason: `${row.title} is not published in this deployment, so no Bot may use it. Answer in prose instead.`,+ };+ }+ if (row.withheldFrom) {+ return {+ allowed: false,+ reason: `${row.title} has been withheld from this Bot in this deployment, though other Bots may use it. Answer in prose instead.`,+ };+ }+ return { allowed: true, description: row.description };+ },++ async grant(name, agentId) {+ await requireComponent(name);+ await database+ .delete(componentExclusions)+ .where(+ and(+ eq(componentExclusions.componentName, name),+ eq(componentExclusions.agentId, agentId),+ ),+ );+ },++ async revoke(name, agentId, by) {+ await requireComponent(name);+ await database+ .insert(componentExclusions)+ .values({ componentName: name, agentId, withheldBy: by })+ // Withholding twice must not move the date.+ .onConflictDoNothing();+ },++ async publish(name, by) {+ const row = await requireComponent(name);+ await database+ .update(components)+ .set({+ // Promotes the draft, which is the whole of what publishing means here.+ publishedDescription: row.draftDescription,+ published: true,+ publishedAt: new Date(),+ updatedBy: by,+ updatedAt: new Date(),+ })+ .where(eq(components.name, name));+ },++ async unpublish(name, by) {+ await requireComponent(name);+ await database+ .update(components)+ .set({ published: false, updatedBy: by, updatedAt: new Date() })+ // Grants are left alone. Unpublishing is "nobody may use this for now", not "forget who was+ // trusted with it", clearing them would silently destroy an administrator's work and make+ // re-publishing a re-grant of everything.+ .where(eq(components.name, name));+ },++ async grantFunction(name, functionName, by) {+ await requireComponent(name);+ await database+ .insert(componentFunctions)+ .values({ componentName: name, functionName, grantedBy: by })+ .onConflictDoNothing();+ },++ async revokeFunction(name, functionName) {+ await database+ .delete(componentFunctions)+ .where(+ and(+ eq(componentFunctions.componentName, name),+ eq(componentFunctions.functionName, functionName),+ ),+ );+ },++ async mayCall(name, functionName) {+ const [row] = await database+ .select({ granted: componentFunctions.functionName })+ .from(componentFunctions)+ .where(+ and(+ eq(componentFunctions.componentName, name),+ eq(componentFunctions.functionName, functionName),+ ),+ )+ .limit(1);+ // A row is the permission. No row, no call, including for a component nobody has granted+ // anything, which is every component the moment it is added.+ return Boolean(row);+ },++ async callFunction(functionName, args) {+ const fn = dataFunction(functionName);+ // Unreachable through the route, which resolves the function before asking about permission.+ // Kept because a store that runs whatever name it is handed is one refactor away from being the+ // hole this whole file exists to close.+ if (!fn) throw new ComponentNotFoundError(functionName);+ return fn.run(database, args);+ },++ async saveDraft(name, description, by) {+ await requireComponent(name);+ await database+ .update(components)+ .set({+ draftDescription: description,+ updatedBy: by,+ updatedAt: new Date(),+ })+ .where(eq(components.name, name));+ },+ };+}diff --git a/server/src/computer/client.ts b/server/src/computer/client.tsnew file mode 100644index 00000000..f019ef81--- /dev/null+++ b/server/src/computer/client.ts@@ -0,0 +1,434 @@+import type {+ ActionResult,+ ClickInput,+ ComputerProfile,+ ComputerStatus,+ ControlState,+ HumanInput,+ HumanInputResult,+ KeyInput,+ ListFilesInput,+ ListFilesResult,+ NavigateResult,+ ReadFileInput,+ ReadFileResult,+ ReadResult,+ ScreenshotResult,+ ScrollInput,+ SecretRequest,+ SecretResult,+ SnapshotResult,+ TypeInput,+ WriteFileInput,+ WriteFileResult,+} from "./schema";+import { checkNavigationTarget } from "./target";++/**+ * How the server talks to a Bot's computer.+ *+ * The computer has no authentication of its own and trusts whatever reaches it, so this module is+ * the boundary: it decides whether a navigation is permitted before the request leaves, and it is+ * the only place that knows the computer's address. Nothing downstream of here should be handed a+ * raw URL from a model.+ */++export type ComputerClientOptions = {+ /**+ * The secret this deployment's computers require. Absent means every call is refused by them, which+ * is the correct failure: a computer that answers an unauthenticated caller is the bug.+ */+ token?: string;+ /** Base URL of the Bot's computer, e.g. http://agent-computer:4100 */+ baseUrl: string;+ /**+ * Where this Bot's computer is, when each Bot has one of its own.+ *+ * A supervisor gives every Bot its own container, so the address stops being one fixed URL and becomes+ * whatever the supervisor published for that Bot, which also changes when its computer is reset.+ * Left unset, `baseUrl` answers for everyone as one shared computer.+ */+ resolveBaseUrl?: (botId: string) => Promise<string>;+ /** True on a laptop, where browsing the deployment's own services is the point. */+ allowPrivateHosts?: boolean;+ timeoutMs?: number;+ fetchImpl?: typeof fetch;+};++export class ComputerUnavailableError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "ComputerUnavailableError";+ }+}++/**+ * The Bot acted on something that is not on the page.+ *+ * Its own error because it is its own condition, and the one the Bot can fix by taking a fresh+ * snapshot.+ *+ * The message a locator failure carries is a Playwright call log, several lines of `waiting for+ * locator('aria-ref=e5')`, which is noise to a model and to a person. It is replaced with the thing+ * to do next.+ */+export class ElementNotFoundError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "ElementNotFoundError";+ }+}++export class NavigationRefusedError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "NavigationRefusedError";+ }+}++/**+ * The file request itself was refused by the computer: outside the workspace, missing, or too large.+ *+ * Distinct from a policy refusal, which happens in the gateway before the request is ever made. Both+ * reach the browser as a 403 but they mean different things: this one says the path is not a thing a+ * Bot may name at all, the other says this Bot may not touch an otherwise perfectly valid path. Only+ * the second has a rule an administrator can go and edit.+ */+export class WorkspaceRefusedError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "WorkspaceRefusedError";+ }+}++/**+ * The request asked for something that is not there, or not usable: no such file, a folder where a+ * file was wanted, a write that is too big.+ *+ * Not a refusal. Nothing declined to let the Bot do this; the thing it named does not fit the request.+ * Kept separate from {@link WorkspaceRefusedError} because a Bot's next move differs completely: here+ * it should look at what IS there and try again, whereas a refusal is final and should be reported.+ */+export class WorkspaceRequestError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "WorkspaceRequestError";+ }+}++/**+ * The refs the caller is using were taken before the page changed.+ *+ * Its own type because it is the one failure here that the model can fix without a person: take a new+ * snapshot and try again. Collapsed into a generic failure, the Bot apologises to the person instead.+ */+export class StaleSnapshotError extends Error {+ constructor(reason: string) {+ super(reason);+ this.name = "StaleSnapshotError";+ }+}++export function createComputerClient(options: ComputerClientOptions) {+ const doFetch = options.fetchImpl ?? fetch;+ /*+ * The secret the computer demands. Without it this process is just another caller, which is the+ * point: a computer that answers without this token bypasses the policy gateway, audit trail, and+ * sign-in boundary.+ */+ const token = options.token;+ const timeoutMs = options.timeoutMs ?? 45_000;+ const base = options.baseUrl.replace(/\/$/, "");++ /**+ * A view of the computer as one Bot.+ *+ * Which Bot is asking has to reach the computer, or nothing on the far side can be per-Bot: its+ * profile, its logins, the proxy its traffic leaves through and who holds its wheel all key off this+ * one string. If the id is omitted, every Bot resolves the same fixed default and per-Bot settings+ * such as `EGRESS_PROXY_<BOT>` cannot apply.+ *+ * A bound view rather than a parameter on twenty methods: the gateway already knows the Bot at the+ * point it acts, and threading it through every signature would put the same argument in every call+ * site for a value that never changes within a request.+ */+ function build(botId?: string) {+ async function call(+ path: string,+ init?: RequestInit,+ caller?: AbortSignal,+ ): Promise<unknown> {+ // Resolved per call rather than held, because a computer that was reset comes back on a+ // different port and a cached address would point at nothing.+ //+ // Outside the try below on purpose: that catch reports "the computer is not running", which is+ // true of a computer that will not answer and misleading about a supervisor that could not be+ // reached or refused. Those are different operator-facing problems.+ const target =+ botId && options.resolveBaseUrl+ ? (await options.resolveBaseUrl(botId)).replace(/\/$/, "")+ : base;++ // Already stopped before this left: do not dispatch at all. Relying on fetch to reject an+ // aborted signal makes "did the click happen" depend on how quickly the runtime notices, and+ // the answer to "the person pressed Stop first" should never be a race.+ if (caller?.aborted) {+ throw new ComputerUnavailableError("The action was stopped.");+ }++ let response: Response;+ try {+ response = await doFetch(`${target}${path}`, {+ ...init,+ // The Bot's identity, as a header rather than in the path, so the computer's published routes+ // are unchanged and a caller that does not know which Bot it is still works.+ headers: {+ ...(init?.headers as Record<string, string> | undefined),+ ...(botId ? { "x-openbot-bot-id": botId } : {}),+ ...(token ? { "x-openbot-computer-token": token } : {}),+ },+ /*+ * Both reasons to give up. The timeout protects the server from a computer that+ * has stopped answering; `caller` is the person pressing Stop, and it has to reach the+ * browser or the click they were stopping still lands. Combined rather than chosen between:+ * whichever fires first ends the request.+ */+ signal: caller+ ? AbortSignal.any([caller, AbortSignal.timeout(timeoutMs)])+ : AbortSignal.timeout(timeoutMs),+ });+ } catch (error) {+ // Distinguished from a failed page load on purpose: this one means the computer itself is not+ // there, which is an operator problem, not something the person asking can fix by rephrasing.+ throw new ComputerUnavailableError(+ error instanceof Error && error.name === "TimeoutError"+ ? "The assistant's computer did not respond in time."+ : "The assistant's computer is not running.",+ );+ }++ const body = (await response.json().catch(() => null)) as Record<+ string,+ unknown+ > | null;++ if (!response.ok) {+ const detail =+ typeof body?.error === "string"+ ? body.error+ : `HTTP ${response.status}`;+ // A stale ref is fixed by taking a new snapshot, so it is not reported as the computer being+ // unavailable.+ if (response.status === 409) {+ throw new StaleSnapshotError(detail);+ }+ // These two must not be collapsed: path confinement and ordinary bad requests lead to+ // different next actions.+ // 403 is the path confinement: a boundary, and the answer will never change.+ if (response.status === 403) {+ throw new WorkspaceRefusedError(detail);+ }+ // 400 is an ordinary bad request: no such file, a folder where a file was wanted, too large. A+ // different request would succeed, which is exactly what the Bot needs to understand.+ if (response.status === 400) {+ throw new WorkspaceRequestError(detail);+ }+ /*+ * A locator that never resolved is not an outage. Playwright reports it as a timeout whose+ * message is a call log naming the selector, which is how "that button is not there" ended up+ * indistinguishable from "the computer is down".+ */+ if (/waiting for locator|Timeout .* exceeded/i.test(detail)) {+ const ref = detail.match(/aria-ref=([A-Za-z0-9_-]+)/)?.[1];+ throw new ElementNotFoundError(+ `${ref ? `Element ${ref} is` : "That element is"} not on the page any more. Take a fresh snapshot and use the refs from it.`,+ );+ }+ throw new ComputerUnavailableError(detail);+ }+ return body;+ }++ async function post(+ path: string,+ payload: unknown,+ caller?: AbortSignal,+ ): Promise<unknown> {+ return call(+ path,+ {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(payload),+ },+ caller,+ );+ }++ return {+ async status(botId: string): Promise<ComputerStatus> {+ try {+ await call("/health");+ return { botId, state: "ready" };+ } catch (error) {+ return {+ botId,+ state: "unreachable",+ reason: error instanceof Error ? error.message : "Unknown failure.",+ };+ }+ },++ /** Open a page. Refuses before the request leaves if the target is not permitted. */+ async navigate(url: string): Promise<NavigateResult> {+ const verdict = checkNavigationTarget(url, {+ allowPrivateHosts: options.allowPrivateHosts,+ });+ if (!verdict.allowed) {+ throw new NavigationRefusedError(verdict.reason);+ }++ return (await call("/navigate", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ url: verdict.url }),+ })) as NavigateResult;+ },++ async screenshot(): Promise<ScreenshotResult> {+ return (await call("/screenshot")) as ScreenshotResult;+ },++ /** The current page as text. No navigation, so no target check applies. */+ async read(): Promise<ReadResult> {+ return (await call("/read")) as ReadResult;+ },++ async snapshot(): Promise<SnapshotResult> {+ return (await call("/snapshot", { method: "POST" })) as SnapshotResult;+ },++ /**+ * The acting calls.+ *+ * Deliberately unguarded here. Unlike `navigate`, which checks its target in this module, these+ * carry no policy of their own: the gateway in front of them is the only thing that knows which+ * Bot is asking and what the deployment allows, and putting a second half-check here would create+ * two places to keep in agreement. Never call these directly from a route.+ */+ async click(+ input: ClickInput,+ caller?: AbortSignal,+ ): Promise<ActionResult> {+ return (await post("/click", input, caller)) as ActionResult;+ },++ async type(+ input: TypeInput,+ caller?: AbortSignal,+ ): Promise<ActionResult> {+ return (await post("/type", input, caller)) as ActionResult;+ },++ async key(input: KeyInput, caller?: AbortSignal): Promise<ActionResult> {+ return (await post("/key", input, caller)) as ActionResult;+ },++ async scroll(+ input: ScrollInput,+ caller?: AbortSignal,+ ): Promise<ActionResult> {+ return (await post("/scroll", input, caller)) as ActionResult;+ },++ /**+ * The workspace files. Also unguarded here: the computer confines the path to the workspace, and+ * the gateway decides whether this Bot may touch it. Two questions, neither answered in this file.+ */+ async readFile(input: ReadFileInput): Promise<ReadFileResult> {+ return (await post("/files/read", input)) as ReadFileResult;+ },++ async writeFile(input: WriteFileInput): Promise<WriteFileResult> {+ return (await post("/files/write", input)) as WriteFileResult;+ },++ async listFiles(input: ListFilesInput): Promise<ListFilesResult> {+ return (await post("/files/list", input)) as ListFilesResult;+ },++ /** Who has the wheel, and whether the Bot is waiting for a person. */+ async control(): Promise<ControlState> {+ return (await call("/control")) as ControlState;+ },++ async requestControl(reason: string): Promise<ControlState> {+ return (await post("/control/request", { reason })) as ControlState;+ },++ async takeControl(): Promise<ControlState> {+ return (await post("/control/take", {})) as ControlState;+ },++ async releaseControl(): Promise<ControlState> {+ return (await post("/control/release", {})) as ControlState;+ },++ /**+ * A person's own mouse and keyboard, straight through.+ *+ * Deliberately NOT governed by the policy gateway. The policy exists to constrain what a BOT may+ * do; a person taking the wheel is the escape hatch that makes a governed Bot usable at all, and+ * a rule that could lock somebody out of their own browser mid-login would be a worse failure+ * than anything it prevented. The takeover itself is audited as an event; the keystrokes are not.+ */+ /** Ask for a secret. Carries the label and the field, never a value. */+ async requestSecret(input: SecretRequest): Promise<ControlState> {+ return (await post("/control/secret", input)) as ControlState;+ },++ /**+ * Supply one. The value passes through this call and is kept nowhere: not returned upward, not+ * logged here, and not written to the audit trail by the gateway.+ */+ /** The computers this process holds, running or not. */+ async computers(): Promise<{ computers: ComputerProfile[] }> {+ return (await call("/computers")) as { computers: ComputerProfile[] };+ },++ /** Stop the browser and keep what it knows. */+ async stopComputer(): Promise<{ stopped: boolean; wasRunning: boolean }> {+ return (await post("/computers/stop", {})) as {+ stopped: boolean;+ wasRunning: boolean;+ };+ },++ /** Delete the profile. Every login the Bot had goes with it. */+ async resetComputer(): Promise<{ reset: boolean; botId: string }> {+ return (await post("/computers/reset", {})) as {+ reset: boolean;+ botId: string;+ };+ },++ async supplySecret(text: string): Promise<SecretResult> {+ return (await post("/human/secret", { text })) as SecretResult;+ },++ async humanInput(input: HumanInput): Promise<HumanInputResult> {+ const { kind, ...rest } = input;+ return (await post(`/human/${kind}`, rest)) as HumanInputResult;+ },++ /** The same computer, addressed as a particular Bot. */+ forBot(id: string) {+ return build(id);+ },+ };+ }++ return build();+}++export type ComputerClient = ReturnType<typeof createComputerClient>;diff --git a/server/src/computer/gateway.ts b/server/src/computer/gateway.tsnew file mode 100644index 00000000..b2337be9--- /dev/null+++ b/server/src/computer/gateway.ts@@ -0,0 +1,788 @@+/**+ * The only way an action reaches a Bot's computer.+ *+ * Reading a page is one thing; clicking a button on an external website is+ * another, and the difference is the whole product. The record is not a report written alongside the+ * work, it is the thing the action goes through, so it cannot be missing: an action that was not+ * recorded did not happen, because there is no path that acts without writing the row first.+ *+ * Three jobs, in this order:+ *+ * 1. Resolve the ref the caller sent into the element it actually points at, from the snapshot this+ * server fetched. Never from what the caller said it was clicking.+ * 2. Ask the policy. Deny beats allow, an absent policy denies, and a broken rule denies.+ * 3. Write the row, whichever way the decision went, and only then act.+ *+ * Step 1 is the one that is easy to skip and fatal to skip. A gateway that decides on a label supplied+ * by the model is theatre: "never click Submit" is evaded by sending `{ref: "e13", name: "Continue"}`.+ * The refs are opaque to the caller precisely so that the server holds the mapping.+ */+import { type AuditStore, recordAuditEvent } from "../audit";+import type { ComputerClient } from "./client";+import {+ type ActionPolicy,+ evaluateActionPolicy,+ type PolicyContext,+ type PolicyDecision,+} from "./policy";+import type {+ ClickInput,+ KeyInput,+ ListFilesInput,+ ReadFileInput,+ ReadResult,+ ScrollInput,+ SecretRequest,+ SnapshotElement,+ SnapshotResult,+ TypeInput,+ WriteFileInput,+} from "./schema";++export class ActionRefusedError extends Error {+ /** The rule that refused it, so the surface can show which one and an operator can find it. */+ readonly rule: string | null;++ constructor(reason: string, rule: string | null) {+ super(reason);+ this.name = "ActionRefusedError";+ this.rule = rule;+ }+}++/** Who is asking. The gateway records this; it does not decide it. */+export type ActionActor = {+ /** The signed-in person, or the local actor when authentication is not configured. */+ id: string;+ /** Null unless this is a real row in `users`, because the audit table has a foreign key to it. */+ userId?: string;+};++export type ComputerGatewayOptions = {+ /**+ * The container supervisor, when each Bot has a computer of its own.+ *+ * Stop and reset prefer it: a computer that is wedged cannot be asked to stop itself, and that is+ * exactly the state where a person reaches for the button. Without a supervisor these stay profile+ * operations performed by the computer itself, which fits the single-computer deployment where+ * nothing else holds the Docker socket.+ */+ supervisor?: {+ stop(botId: string): Promise<void>;+ reset(botId: string): Promise<void>;+ list?(): Promise<{ botId: string; status: string; startedAt?: string }[]>;+ };+ client: ComputerClient;+ auditStore: AuditStore;+ /** Absent denies everything. See evaluateActionPolicy. */+ policy: () => ActionPolicy | undefined;+};++/**+ * The last snapshot the server took, per computer.+ *+ * In memory. It describes the live contents of a browser window, so it is+ * meaningless the moment the process holding that window restarts. Persisting it would create a cache+ * that can disagree with the page, which is worse than not having one: the refs would resolve to names+ * that are no longer on screen and the policy would decide on fiction.+ */+type CachedSnapshot = {+ snapshotId: number;+ elements: Map<string, SnapshotElement>;+ url: string;+};++export function createComputerGateway(options: ComputerGatewayOptions) {+ const { client, auditStore, supervisor } = options;+ const snapshots = new Map<string, CachedSnapshot>();++ /**+ * The computer, addressed as the Bot that is asking.+ *+ * Every call goes through this. The Bot's browser, its logins and the proxy its traffic leaves+ * through are all keyed on this id at the far end, so a call that forgets it lands on the wrong+ * computer, because there is always a computer to answer.+ */+ const as = (botId: string) => client.forBot(botId);++ /** Read-only, so it passes straight through. Nothing has changed and there is nothing to decide. */+ async function snapshot(computerId: string): Promise<SnapshotResult> {+ const result = await as(computerId).snapshot();+ snapshots.set(computerId, {+ snapshotId: result.snapshotId,+ url: result.url,+ elements: new Map(+ result.elements.map((element) => [element.ref, element]),+ ),+ });+ return result;+ }++ async function read(botId: string): Promise<ReadResult> {+ return as(botId).read();+ }++ /**+ * Resolve a ref against the snapshot the server holds.+ *+ * Returns undefined for an unknown ref rather than throwing, because the policy still has to run:+ * an action on an element we cannot identify must still receive a policy decision.+ * A deny rule written against a page a Bot has not snapshotted should still refuse it.+ */+ function resolve(+ computerId: string,+ ref: string | undefined,+ ): SnapshotElement | undefined {+ if (!ref) return undefined;+ return snapshots.get(computerId)?.elements.get(ref);+ }++ /**+ * Decide, record, then act.+ *+ * The audit row is written before the action runs, not after it succeeds. An allowed action that+ * later fails is still part of the audit sequence, and a trail that only contains successes cannot+ * show that sequence.+ */+ async function govern<T>(+ computerId: string,+ toolName: string,+ botId: string,+ actor: ActionActor,+ subject: {+ ref?: string;+ filePath?: string;+ targetUrl?: string;+ key?: string;+ /** The person's Stop, on its way to the browser. See the acting methods below. */+ signal?: AbortSignal;+ },+ run: () => Promise<T>,+ ): Promise<T> {+ const { ref, filePath } = subject;+ const element = resolve(computerId, ref);+ const cached = snapshots.get(computerId);+ // For a navigation the relevant page is the one being opened, not the one already loaded. Using+ // the cached URL would mean `page.host == "..."` could never match the destination, which is the+ // only thing a rule about navigation would ever want to say.+ const pageUrl = subject.targetUrl ?? cached?.url ?? "";++ const intent = intentOf(toolName, subject.key);++ const context: PolicyContext = {+ tool: { name: toolName },+ bot: { id: botId },+ actor: { id: actor.id },+ page: { url: pageUrl, host: hostOf(pageUrl) },+ ...(intent ? { intent } : {}),+ ...(subject.key ? { key: subject.key } : {}),+ ...(element+ ? {+ element: {+ ref: element.ref,+ role: element.role,+ name: element.name,+ ...(element.type ? { type: element.type } : {}),+ },+ }+ : {}),+ ...(filePath ? { file: describeFile(filePath) } : {}),+ };++ const decision = evaluateActionPolicy(options.policy(), context);+ await write(auditStore, {+ toolName,+ botId,+ actor,+ computerId,+ element,+ ref,+ ...(subject.key ? { key: subject.key } : {}),+ filePath,+ pageUrl,+ decision,+ });++ if (!decision.forward) {+ throw new ActionRefusedError(decision.reason, decision.matched);+ }++ let result: T;+ try {+ result = await run();+ } catch (error) {+ /**+ * A permitted action that did not happen gets its own row.+ *+ * Without this the trail lies by omission. The row above says the policy allowed the call, and+ * a reader takes "allowed" to mean "it happened".+ *+ * Writing the decision before acting is still right, because an allowed action may have partial+ * effects before failing. The failure row records the outcome separately from the policy+ * decision.+ */+ await write(auditStore, {+ toolName,+ botId,+ actor,+ computerId,+ element,+ ref,+ filePath,+ pageUrl,+ decision,+ failure: error instanceof Error ? error.message : "The action failed.",+ });+ throw error;+ }+ // The element's label, attached on the way out, so the transcript can say what was acted on+ // instead of quoting a ref. The computer cannot supply this: it knows the ref, and the resolved+ // snapshot lives here. File calls carry their own path already, so there is nothing to add.+ return element && result && typeof result === "object"+ ? { ...result, element: { role: element.role, name: element.name } }+ : result;+ }++ return {+ snapshot,+ read,++ /**+ * Handovers, recorded but not policy-gated.+ *+ * The policy constrains what a Bot may do. A person taking the wheel is the escape hatch that+ * makes a governed Bot usable at all, and a rule able to lock somebody out of their own browser+ * halfway through a login would be a worse failure than anything it prevented. So these write the+ * row and do not ask. What IS recorded is the period: who, when, and why the Bot asked, the fact+ * an investigator wants is that a human drove this browser between two times.+ */+ async requestHelp(+ computerId: string,+ botId: string,+ actor: ActionActor,+ reason: string,+ ) {+ const state = await as(botId).requestControl(reason);+ await writeControlEvent(auditStore, "computer.help_requested", {+ botId,+ actor,+ computerId,+ reason,+ });+ return state;+ },++ async takeControl(computerId: string, botId: string, actor: ActionActor) {+ const state = await as(botId).takeControl();+ await writeControlEvent(auditStore, "computer.control_taken", {+ botId,+ actor,+ computerId,+ // Carried onto the row so the trail says what the person was handed, not merely that they+ // took over.+ reason: state.reason,+ });+ return state;+ },++ async releaseControl(+ computerId: string,+ botId: string,+ actor: ActionActor,+ ) {+ const state = await as(botId).releaseControl();+ await writeControlEvent(auditStore, "computer.control_released", {+ botId,+ actor,+ computerId,+ });+ return state;+ },++ control(botId: string) {+ return as(botId).control();+ },++ /**+ * The computers, for the admin surface. A read, so no audit row.+ *+ * With a supervisor the list is the containers, because that is what a computer is: one per+ * Bot, each with its own storage, and the page's Stop and Reset act on those. Asking a single+ * computer for its profiles would answer for the one shared browser instead, which is the older+ * arrangement and no longer what an administrator is looking at.+ */+ async computers() {+ if (supervisor?.list) {+ const running = await supervisor.list();+ return {+ // Said, not inferred. Without a supervisor every Bot shares one browser, which looks+ // identical on every screen to each having its own, same cards, same trail, same+ // screenshots. A reader has to be told which deployment they are looking at.+ isolation: "per-bot" as const,+ computers: running.map((computer) => ({+ botId: computer.botId,+ running: computer.status === "running",+ startedAt: computer.startedAt ?? null,+ egress: null,+ })),+ };+ }+ return { isolation: "shared" as const, ...(await client.computers()) };+ },++ /**+ * Stop a computer's browser, keeping what it knows.+ *+ * Audited, unlike the read above, because a person reached in and stopped something. Recorded+ * whether or not a browser was actually running: "she pressed stop and nothing was running" is a+ * fact worth having, and a trail that only records effective actions cannot tell you what somebody+ * tried.+ */+ async stopComputer(computerId: string, botId: string, actor: ActionActor) {+ if (supervisor) {+ await supervisor.stop(botId);+ await writeControlEvent(auditStore, "computer.stopped", {+ botId,+ actor,+ computerId,+ reason: "the container was stopped",+ });+ return { wasRunning: true };+ }+ const result = await as(botId).stopComputer();+ await writeControlEvent(auditStore, "computer.stopped", {+ botId,+ actor,+ computerId,+ reason: result.wasRunning+ ? "browser was running"+ : "no browser was running",+ });+ return result;+ },++ /**+ * Wipe a computer's profile.+ *+ * The most destructive button we have. Every login the Bot had is gone and no undo exists, so the+ * row is written whatever happens next.+ */+ async resetComputer(computerId: string, botId: string, actor: ActionActor) {+ if (supervisor) {+ await supervisor.reset(botId);+ await writeControlEvent(auditStore, "computer.reset", {+ botId,+ actor,+ computerId,+ reason: "the container and its profile were deleted",+ });+ return { cleared: true };+ }+ const result = await as(botId).resetComputer();+ await writeControlEvent(auditStore, "computer.reset", {+ botId,+ actor,+ computerId,+ reason: "every saved login on this computer was deleted",+ });+ return result;+ },++ /**+ * Asking for a secret, and supplying one.+ *+ * Both are audited, and neither records the value. The row says a secret was asked for, what it+ * was called, and which field it went in, the things an investigator needs in order to know a+ * human credential entered this session. The value itself is on one path only, from a person's+ * keyboard to the page, and is not on this one.+ */+ async requestSecret(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: SecretRequest,+ ) {+ const state = await as(botId).requestSecret(input);+ await writeControlEvent(auditStore, "computer.secret_requested", {+ botId,+ actor,+ computerId,+ reason: `${input.label} (into ${input.ref})`,+ });+ return state;+ },++ async supplySecret(+ computerId: string,+ botId: string,+ actor: ActionActor,+ text: string,+ ) {+ const result = await as(botId).supplySecret(text);+ await writeControlEvent(auditStore, "computer.secret_supplied", {+ botId,+ actor,+ computerId,+ // Length, never content. Enough to show something real was entered.+ reason: `${result.characters} characters`,+ });+ return result;+ },++ humanInput(+ botId: string,+ input: Parameters<ComputerClient["humanInput"]>[0],+ ) {+ return as(botId).humanInput(input);+ },++ /**+ * Opening a page, through the gateway so it lands in the audit trail.+ *+ * The client still applies its target guard, which is the floor that holds under every policy,+ * including one that permits everything. This adds the record and the per-Bot decision on top: a+ * refusal by either produces a row, so navigation denials are visible in the audit trail.+ */+ navigate(+ computerId: string,+ botId: string,+ actor: ActionActor,+ url: string,+ ) {+ return govern(+ computerId,+ "computer_navigate",+ botId,+ actor,+ { targetUrl: url },+ () => as(botId).navigate(url),+ );+ },++ click(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: ClickInput,+ signal?: AbortSignal,+ ) {+ return govern(+ computerId,+ "computer_click",+ botId,+ actor,+ { ref: input.ref, ...(signal ? { signal } : {}) },+ () => as(botId).click(input, signal),+ );+ },++ type(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: TypeInput,+ signal?: AbortSignal,+ ) {+ return govern(+ computerId,+ "computer_type",+ botId,+ actor,+ { ref: input.ref, ...(signal ? { signal } : {}) },+ () => as(botId).type(input, signal),+ );+ },++ key(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: KeyInput,+ signal?: AbortSignal,+ ) {+ return govern(+ computerId,+ "computer_key",+ botId,+ actor,+ // The key is part of the subject, so a rule can tell Enter from a letter. Form submission can+ // happen through a keypress as well as a click, so the policy context carries the key.+ { ref: input.ref, key: input.key, ...(signal ? { signal } : {}) },+ () => as(botId).key(input, signal),+ );+ },++ scroll(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: ScrollInput,+ ) {+ return govern(computerId, "computer_scroll", botId, actor, {}, () =>+ as(botId).scroll(input),+ );+ },++ /**+ * The file tools, governed like everything else.+ *+ * The read is governed too, unlike reading a page. A page was permitted when it was opened; the+ * workspace accumulates whatever a Bot has saved across every task it has ever run, so which of+ * those files it may read back is a real question for a deployment to be able to answer.+ */+ readFile(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: ReadFileInput,+ ) {+ return govern(+ computerId,+ "computer_read_file",+ botId,+ actor,+ { filePath: input.path },+ () => as(botId).readFile(input),+ );+ },++ /**+ * Listing is governed too, and for the same reason the read is: what a Bot has accumulated over+ * every task it has run is worth being able to restrict. A rule denying a folder hides it from the+ * listing as well as from reads, which is the consistent answer.+ */+ listFiles(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: ListFilesInput,+ ) {+ return govern(+ computerId,+ "computer_list_files",+ botId,+ actor,+ { filePath: input.path ?? "." },+ () => as(botId).listFiles(input),+ );+ },++ writeFile(+ computerId: string,+ botId: string,+ actor: ActionActor,+ input: WriteFileInput,+ ) {+ return govern(+ computerId,+ "computer_write_file",+ botId,+ actor,+ { filePath: input.path },+ () => as(botId).writeFile(input),+ );+ },+ };+}++/**+ * Split a path into the parts a rule wants to match on.+ *+ * Lower-cased, because a rule forbidding `.env` must also catch `.ENV`; the+ * operator should have anticipated. Same reasoning as the case-insensitive `contains` in policy.ts.+ */+function describeFile(path: string): {+ path: string;+ name: string;+ extension: string;+} {+ const name = path.split(/[\\/]/).pop() ?? path;+ const dot = name.lastIndexOf(".");+ return {+ path,+ name,+ // A leading dot is the whole name of a dotfile, not an extension: `.env` has no extension, and the+ // rule for it is written against `name`.+ extension: dot > 0 ? name.slice(dot + 1).toLowerCase() : "",+ };+}++export type ComputerGateway = ReturnType<typeof createComputerGateway>;++/**+ * One audit row for one decision.+ *+ * Deliberately absent: the text that was typed. The row says which field was filled and+ * how many characters went into it, and never the value, because a form field is where a password, a+ * card number and a one-time code live. `audit.ts` would redact a key literally called `text`, but+ * relying on that would mean the secret was placed in the payload and caught on the way past; it is+ * simpler and stronger for it never to be put there. `element.name` is a label a page displays, not+ * something a person typed, so it is safe and it is the part an investigator actually needs.+ */+/**+ * What an action does, from what the gateway already knows.+ *+ * Derived here rather than passed in by each call site, so a new acting route cannot arrive+ * without an intent and fall outside every rule written in terms of one.+ *+ * Enter and Space are activations. They press whatever has focus, so a rule about activation must+ * cover keypresses as well as clicks.+ */+const ACTIVATING_KEYS = new Set(["Enter", "NumpadEnter", "Space", " "]);++function intentOf(+ toolName: string,+ key: string | undefined,+): PolicyContext["intent"] {+ switch (toolName) {+ case "computer_click":+ return "activate";+ case "computer_key":+ return key && ACTIVATING_KEYS.has(key) ? "activate" : "type";+ case "computer_type":+ return "type";+ case "computer_navigate":+ return "navigate";+ case "computer_read":+ case "computer_snapshot":+ case "computer_screenshot":+ case "computer_scroll":+ return "read";+ case "computer_read_file":+ return "read_file";+ case "computer_write_file":+ return "write_file";+ case "computer_list_files":+ return "list_files";+ default:+ return undefined;+ }+}++async function write(+ auditStore: AuditStore,+ entry: {+ toolName: string;+ botId: string;+ actor: ActionActor;+ computerId: string;+ element: SnapshotElement | undefined;+ ref: string | undefined;+ /** Which key, for a keypress. Recorded because a keypress can act without naming a button. */+ key?: string | undefined;+ filePath: string | undefined;+ pageUrl: string;+ decision: PolicyDecision;+ /** Set only when a permitted action was attempted and did not succeed. */+ failure?: string;+ },+) {+ await recordAuditEvent(auditStore, {+ // A failure is its own kind of event, not a variant of "allowed": the whole point of the extra row+ // is that a reader can tell an action that happened from one that was permitted and then did not.+ eventType: entry.failure+ ? "computer.action_failed"+ : entry.decision.allowed+ ? "computer.action_allowed"+ : "computer.action_refused",+ targetType: "computer",+ targetId: entry.computerId,+ // Only ever a real users row. The audit table has a foreign key to it, so writing the local+ // development actor's id here makes every action fail on a constraint violation instead of being+ // recorded. Who it was is in the payload either way.+ ...(entry.actor.userId ? { actorUserId: entry.actor.userId } : {}),+ payload: {+ action: entry.toolName,+ bot: entry.botId,+ actor: entry.actor.id,+ page: entry.pageUrl,+ ref: entry.ref ?? null,+ /*+ * The key, where there is one. A keypress can submit a form from inside a text field, so the+ * element it was aimed at is not always the thing it acted on. Without the key, the trail+ * cannot distinguish a form-submitting Enter from typing a letter.+ */+ ...(entry.key ? { key: entry.key } : {}),+ // The path, never the contents. A Bot writes down what it was told, so a file body is exactly as+ // sensitive as text typed into a form field, and for the same reason it is not put here.+ ...(entry.filePath ? { file: entry.filePath } : {}),+ element: entry.element+ ? {+ role: entry.element.role,+ name: entry.element.name,+ ...(entry.element.type ? { type: entry.element.type } : {}),+ }+ : entry.filePath+ ? // A file action has no element and never will. File rows leave the element field absent+ // rather than describing a browser snapshot.+ undefined+ : // An action on an element the server cannot identify is worth recording plainly, rather+ // than as an absent field that reads like a logging gap.+ "not in the current snapshot",+ ...(entry.failure ? { failure: entry.failure } : {}),+ decision: {+ allowed: entry.decision.allowed,+ mode: entry.decision.mode,+ source: entry.decision.source,+ rule: entry.decision.matched,+ /** Present so the trail explains a dry-run row that was recorded as refused but still ran. */+ carriedOut: entry.decision.forward,+ },+ },+ });+}++/**+ * The host a rule can match on, or empty.+ *+ * Empty means "no page", which is the accurate answer before a Bot has snapshotted anything, and it is+ * the only case that occurs in practice: the URL comes from Playwright's own `page.url()` by way of the+ * snapshot cache. Worth stating explicitly because a `page.host == "..."` deny rule would not match an+ * empty host, so a boundary that must not be evadable should also key on the tool, the element or the+ * file rather than on the host alone.+ */+/**+ * One row for a handover.+ *+ * Separate from `write` because a handover has no element, no file and no policy decision, forcing it+ * through the same shape would mean inventing a decision that was never asked for, and a row claiming+ * a policy allowed something it never saw is exactly the kind of comfortable fiction this trail exists+ * to avoid.+ */+async function writeControlEvent(+ auditStore: AuditStore,+ eventType:+ | "computer.help_requested"+ | "computer.control_taken"+ | "computer.control_released"+ | "computer.secret_requested"+ | "computer.secret_supplied"+ | "computer.stopped"+ | "computer.reset",+ entry: {+ botId: string;+ actor: ActionActor;+ computerId: string;+ reason?: string;+ },+) {+ await recordAuditEvent(auditStore, {+ eventType,+ targetType: "computer",+ targetId: entry.computerId,+ ...(entry.actor.userId ? { actorUserId: entry.actor.userId } : {}),+ payload: {+ bot: entry.botId,+ actor: entry.actor.id,+ ...(entry.reason ? { reason: entry.reason } : {}),+ },+ });+}++function hostOf(url: string): string {+ try {+ return new URL(url).host;+ } catch {+ return "";+ }+}diff --git a/server/src/computer/supervisor.ts b/server/src/computer/supervisor.tsnew file mode 100644index 00000000..6212973d--- /dev/null+++ b/server/src/computer/supervisor.ts@@ -0,0 +1,114 @@+/**+ * Where a Bot's computer lives, asked of the supervisor.+ *+ * Each Bot gets a container of its own, which means the address of a computer is no longer one+ * fixed URL, it is whatever port the supervisor published for that Bot, and it changes when the+ * computer is reset. So the server stops holding an address and starts asking for one.+ *+ * The server still never touches Docker. It asks for a Bot's computer by Bot; the supervisor decides+ * what that means. Everything the API server can express is in this file, and it is four verbs.+ *+ * Without a supervisor configured, nothing here is used and the fixed `AGENT_COMPUTER_URL` still+ * answers for every Bot. That is the single-container mode: fine for one person on a laptop, and+ * honest about being one shared computer.+ */++export type ComputerLocation = {+ botId: string;+ container: string;+ status: string;+ port?: number;+ /** Where to reach it, decided by the supervisor rather than assembled here. */+ url?: string;+ startedAt?: string;+};++export type SupervisorOptions = {+ baseUrl: string;+ token?: string;+ /** How a published port becomes a URL the server can reach. */+ hostForPort?: (port: number) => string;+ fetchImpl?: typeof fetch;+ timeoutMs?: number;+};++export class SupervisorError extends Error {+ constructor(message: string) {+ super(message);+ this.name = "SupervisorError";+ }+}++export function createSupervisorClient(options: SupervisorOptions) {+ const doFetch = options.fetchImpl ?? fetch;+ const base = options.baseUrl.replace(/\/$/, "");+ const timeoutMs = options.timeoutMs ?? 120_000;+ const hostForPort =+ options.hostForPort ?? ((port) => `http://localhost:${port}`);++ async function call(path: string, method = "POST"): Promise<unknown> {+ let response: Response;+ try {+ response = await doFetch(`${base}${path}`, {+ method,+ headers: options.token+ ? { authorization: `Bearer ${options.token}` }+ : {},+ signal: AbortSignal.timeout(timeoutMs),+ });+ } catch (error) {+ throw new SupervisorError(+ `The container supervisor at ${base} could not be reached (${error instanceof Error ? error.message : String(error)}).`,+ );+ }++ const body = (await response.json().catch(() => null)) as {+ error?: string;+ } | null;+ if (!response.ok) {+ throw new SupervisorError(+ body?.error ?? `The supervisor answered ${response.status}.`,+ );+ }+ return body;+ }++ return {+ /**+ * The URL of this Bot's computer, starting it if it is not already up.+ *+ * A computer that is running but has published no port is a computer nothing can reach, so that+ * is an error rather than a URL, the alternative is a caller quietly falling back to somebody+ * else's computer.+ */+ async locate(botId: string): Promise<string> {+ const state = (await call(+ `/computers/${encodeURIComponent(botId)}/ensure`,+ )) as ComputerLocation;+ // The supervisor says where it is, because only it knows whether these computers sit on a+ // shared network or answer on a published port.+ if (state?.url) return state.url;+ if (state?.port) return hostForPort(state.port);+ throw new SupervisorError(+ `The computer for ${botId} started but reported no address, so it cannot be reached.`,+ );+ },++ async stop(botId: string): Promise<void> {+ await call(`/computers/${encodeURIComponent(botId)}/stop`);+ },++ async reset(botId: string): Promise<void> {+ await call(`/computers/${encodeURIComponent(botId)}/reset`);+ },++ async list(): Promise<ComputerLocation[]> {+ const body = (await call("/computers", "GET")) as {+ computers?: ComputerLocation[];+ };+ return body?.computers ?? [];+ },+ };+}++export type SupervisorClient = ReturnType<typeof createSupervisorClient>;diff --git a/server/src/computer/target.ts b/server/src/computer/target.tsnew file mode 100644index 00000000..99d7719f--- /dev/null+++ b/server/src/computer/target.ts@@ -0,0 +1,109 @@+/**+ * What a Bot's browser is allowed to navigate to.+ *+ * A computer-use browser is an SSRF engine pointed at your own network unless something stops it.+ * The Bot runs inside the deployment, so `http://localhost:5432`, the cloud metadata endpoint at+ * 169.254.169.254, and every RFC1918 address are all reachable from it and none of them are reachable+ * from the person's laptop. A model that has been talked into "check what is on 10.0.0.5" would+ * otherwise do exactly that and screenshot the result back into the transcript.+ *+ * This is an allow-list of schemes plus a deny-list of destinations, applied before the request is+ * made rather than after. It is deliberately dumb: no DNS resolution, no redirect following, no+ * cleverness that could disagree with what the browser eventually does. The gateway sits in front+ * of every action, which is where policy per Bot belongs; this is the floor that holds even without it.+ */++const ALLOWED_PROTOCOLS = new Set(["http:", "https:"]);++/**+ * Addresses no deployment may ever open, including one that opted into private hosts.+ *+ * Reading instance metadata is how a container's cloud credentials leave it, and there is no+ * development task that needs it, so it is not covered by the private-host escape hatch.+ */+const NEVER_ALLOWED_HOSTNAMES = new Set([+ "169.254.169.254",+ "metadata.google.internal",+ "metadata.goog",+]);++/** Hostnames inside the deployment. Reachable only when a deployment opts in. */+const INTERNAL_HOSTNAMES = new Set([+ "localhost",+ "127.0.0.1",+ "0.0.0.0",+ "::1",+ "[::1]",+]);++export type TargetVerdict =+ | { allowed: true; url: string }+ | { allowed: false; reason: string };++function isPrivateIpv4(hostname: string): boolean {+ const parts = hostname.split(".");+ if (parts.length !== 4) return false;+ const octets = parts.map((part) => Number.parseInt(part, 10));+ if (octets.some((value) => Number.isNaN(value) || value < 0 || value > 255)) {+ return false;+ }+ const [a, b] = octets as [number, number, number, number];+ if (a === 10) return true;+ if (a === 127) return true;+ if (a === 169 && b === 254) return true; // link-local, includes metadata+ if (a === 172 && b >= 16 && b <= 31) return true;+ if (a === 192 && b === 168) return true;+ return false;+}++/**+ * Decide whether a Bot may navigate here.+ *+ * Returns a reason rather than throwing, because the caller renders it to a person: "that address is+ * inside the deployment" is actionable, and a stack trace is not.+ */+export function checkNavigationTarget(+ raw: string,+ options: { allowPrivateHosts?: boolean } = {},+): TargetVerdict {+ let url: URL;+ try {+ url = new URL(raw);+ } catch {+ return { allowed: false, reason: "That is not a web address." };+ }++ if (!ALLOWED_PROTOCOLS.has(url.protocol)) {+ return {+ allowed: false,+ reason: `Only web addresses are allowed, and that one is ${url.protocol.replace(":", "")}.`,+ };+ }++ const hostname = url.hostname.toLowerCase();++ // Checked before the opt-in, so no configuration can reach it.+ if (NEVER_ALLOWED_HOSTNAMES.has(hostname)) {+ return {+ allowed: false,+ reason:+ "That address holds this deployment's own cloud credentials, so the assistant is never allowed to open it.",+ };+ }++ // A local deployment legitimately browses its own services. It is opt-in, never the default, so a+ // production deployment cannot reach its own network by forgetting to set something.+ if (options.allowPrivateHosts) {+ return { allowed: true, url: url.toString() };+ }++ if (INTERNAL_HOSTNAMES.has(hostname) || isPrivateIpv4(hostname)) {+ return {+ allowed: false,+ reason:+ "That address is inside this deployment's own network, so the assistant is not allowed to open it.",+ };+ }++ return { allowed: true, url: url.toString() };+}diff --git a/server/src/config.ts b/server/src/config.tsnew file mode 100644index 00000000..7d2c1a75--- /dev/null+++ b/server/src/config.ts@@ -0,0 +1,338 @@+/**+ * What the runtime can do. There is exactly one answer because CopilotKit Intelligence is required+ * for durable threads and memory. Configuration the product cannot function without belongs at the+ * boot boundary.+ */+import { devAuthEnabled } from "./auth/dev-actor";+import type { ActionPolicy } from "./computer/policy";+import { parseActionPolicy } from "./computer/policy-store";++export type RuntimeCapabilities = {+ mode: "intelligence";+ durableHistory: true;+ intelligence: IntelligenceSettings;+};++/** The Intelligence contract. Every field is required; see runtimeCapabilities. */+export type IntelligenceSettings = {+ apiUrl: string;+ gatewayWsUrl: string;+ apiKey: string;+ licenseToken: string;+};++export type DeploymentConfig = {+ databaseUrl: string;+ keyEncryptionKey: string;+ managedAgentAgUiUrl: URL;+ /**+ * What this deployment calls itself, when more than one shares an Intelligence project.+ *+ * Absent, the tenant package's id stands in, which separates deployments running different+ * packages but not a copy of one running alongside the original. See channels/thread-identity.ts.+ */+ deploymentId: string | undefined;+ tenantPackageDirectory: string;+ runtime: RuntimeCapabilities;+ oauth: {+ google?: { clientId: string; clientSecret: string };+ };+ auth?: {+ baseUrl: string;+ secret: string;+ google: { clientId: string; clientSecret: string };+ trustedOrigins: string[];+ initialAdminEmails: string[];+ };+ /**+ * Local development only: admit everybody as a fixed administrator instead of requiring sign-in.+ * See auth/dev-actor.ts for the two locks that stop this reaching a deployment.+ */+ devNoAuth: boolean;+ /**+ * The Bot computer. Absent means the feature is off and its routes are not mounted, rather than+ * mounted and failing: a capability that is not configured should be missing, not broken.+ */+ computer?: {+ baseUrl: string;+ /** The secret every computer requires of its caller. */+ token?: string;+ /**+ * The container supervisor, when each Bot is to get a computer of its own. Absent means one+ * shared computer at `baseUrl`, which is what a laptop wants and is honest about being one+ * machine.+ */+ supervisor?: { baseUrl: string; token?: string };+ /** True on a laptop, where browsing the deployment's own services is the point. */+ allowPrivateHosts: boolean;+ /**+ * What Bots may do on their computers. Absent means the built-in default applies.+ *+ * A whole policy in one variable rather than a variable per rule, because the rules are an+ * ordered pair of lists and splitting them across `AGENT_COMPUTER_DENY_1`-style names makes their+ * precedence, which is the only subtle thing about them, impossible to see.+ */+ policy?: ActionPolicy;+ };+};++type Environment = Record<string, string | undefined>;++function required(environment: Environment, name: string): string {+ const value = environment[name]?.trim();+ if (!value) {+ throw new Error(`${name} must be configured`);+ }+ return value;+}++function optional(environment: Environment, name: string): string | undefined {+ return environment[name]?.trim() || undefined;+}++/**+ * The key in `.env.example`, which every clone of this repository starts with.+ *+ * It is a valid key, which is the whole problem: it is the right length and the right encoding, so+ * nothing about it fails a check. A deployment that never changed it encrypts its credential vault+ * with a key printed in a public repository, and looks exactly like one that did.+ */+const PLACEHOLDER_KEY = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";++function keyEncryptionKey(environment: Environment): string {+ const value = required(environment, "KEY_ENCRYPTION_KEY");+ const decoded = Buffer.from(value, "base64");++ if (decoded.byteLength !== 32 || decoded.toString("base64") !== value) {+ throw new Error("KEY_ENCRYPTION_KEY must be a base64-encoded 32-byte key");+ }++ /**+ * Refused in production, warned everywhere else. The placeholder is convenient locally and public+ * in any deployment.+ */+ if (value === PLACEHOLDER_KEY) {+ if (environment.NODE_ENV === "production") {+ throw new Error(+ "KEY_ENCRYPTION_KEY is still the example key from .env.example, which is public. Generate one with: openssl rand -base64 32",+ );+ }+ console.warn(+ "KEY_ENCRYPTION_KEY is the example key from .env.example, which is public. Fine locally. Generate a real one before deploying: openssl rand -base64 32",+ );+ }++ return value;+}++function url(environment: Environment, name: string): string | undefined {+ const value = optional(environment, name);+ if (!value) {+ return undefined;+ }++ try {+ new URL(value);+ } catch {+ throw new Error(`${name} must be a valid URL`);+ }+ return value;+}++function requiredHttpUrl(environment: Environment, name: string): URL {+ const value = required(environment, name);++ let parsed: URL;+ try {+ parsed = new URL(value);+ } catch {+ throw new Error(`${name} must be a valid HTTP(S) URL`);+ }++ if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {+ throw new Error(`${name} must be a valid HTTP(S) URL`);+ }++ return parsed;+}++function oauthClient(+ environment: Environment,+ provider: "GOOGLE",+): { clientId: string; clientSecret: string } | undefined {+ const clientId = optional(environment, `${provider}_OAUTH_CLIENT_ID`);+ const clientSecret = optional(environment, `${provider}_OAUTH_CLIENT_SECRET`);++ // Both or neither. One alone is a half-configured sign-in that fails at the first attempt rather+ // than at start-up, which is the worst moment to discover it.+ if (Boolean(clientId) !== Boolean(clientSecret)) {+ throw new Error(+ "Google OAuth configuration requires both client ID and client secret",+ );+ }++ return clientId && clientSecret ? { clientId, clientSecret } : undefined;+}++function commaSeparated(environment: Environment, name: string): string[] {+ return (optional(environment, name) ?? "")+ .split(",")+ .map((value) => value.trim())+ .filter(Boolean);+}++function authConfig(+ environment: Environment,+ google: { clientId: string; clientSecret: string } | undefined,+): DeploymentConfig["auth"] {+ const secret = optional(environment, "BETTER_AUTH_SECRET");+ const baseUrl = url(environment, "BETTER_AUTH_URL");+ if (!google) {+ if (secret || baseUrl) {+ throw new Error(+ "Google authentication requires GOOGLE_OAUTH_CLIENT_ID and GOOGLE_OAUTH_CLIENT_SECRET",+ );+ }+ return undefined;+ }+ if (!secret) {+ throw new Error("Google authentication requires BETTER_AUTH_SECRET");+ }+ if (secret.length < 32) {+ throw new Error("BETTER_AUTH_SECRET must be at least 32 characters");+ }+ if (!baseUrl) {+ throw new Error("Google authentication requires BETTER_AUTH_URL");+ }++ return {+ baseUrl,+ secret,+ google,+ trustedOrigins: commaSeparated(environment, "TRUSTED_ORIGINS").length+ ? commaSeparated(environment, "TRUSTED_ORIGINS")+ : ["http://localhost:3000"],+ initialAdminEmails: commaSeparated(environment, "INITIAL_ADMIN_EMAILS"),+ };+}++/**+ * Resolve the Intelligence contract, or refuse to start.+ *+ * All four values are required together. A partial set is the more dangerous shape than none at all:+ * it means somebody intended to configure Intelligence and got it wrong, so failing on the partial+ * set alone (as this did) let a completely unconfigured deployment through as if that were a choice.+ */+function runtimeCapabilities(environment: Environment): RuntimeCapabilities {+ const settings = {+ apiUrl: url(environment, "INTELLIGENCE_API_URL"),+ gatewayWsUrl: url(environment, "INTELLIGENCE_GATEWAY_WS_URL"),+ apiKey: optional(environment, "INTELLIGENCE_API_KEY"),+ licenseToken: optional(environment, "COPILOTKIT_LICENSE_TOKEN"),+ };++ const missing = Object.entries({+ INTELLIGENCE_API_URL: settings.apiUrl,+ INTELLIGENCE_GATEWAY_WS_URL: settings.gatewayWsUrl,+ INTELLIGENCE_API_KEY: settings.apiKey,+ COPILOTKIT_LICENSE_TOKEN: settings.licenseToken,+ })+ .filter(([, value]) => !value)+ .map(([name]) => name);++ if (missing.length > 0) {+ throw new Error(+ `CopilotKit Intelligence is required and is not configured. Missing: ${missing.join(", ")}`,+ );+ }++ return {+ mode: "intelligence",+ durableHistory: true,+ intelligence: settings as IntelligenceSettings,+ };+}++function computerConfig(+ environment: Environment,+): DeploymentConfig["computer"] {+ const baseUrl = url(environment, "AGENT_COMPUTER_URL");+ if (!baseUrl) {+ return undefined;+ }+ const policy = actionPolicy(environment);+ /*+ * The secret the computers require. Without it every call to a computer is refused, and that is the+ * intended failure: `agent-computer` drives a browser holding real logins and must not answer+ * unauthenticated callers that can reach its port.+ */+ const computerToken = optional(environment, "COMPUTER_TOKEN");+ const supervisorUrl = url(environment, "COMPUTER_SUPERVISOR_URL");+ const supervisorToken = optional(environment, "SUPERVISOR_TOKEN");+ return {+ baseUrl,+ allowPrivateHosts:+ optional(environment, "AGENT_COMPUTER_ALLOW_PRIVATE_HOSTS") === "true",+ ...(policy ? { policy } : {}),+ ...(computerToken ? { token: computerToken } : {}),+ ...(supervisorUrl+ ? {+ supervisor: {+ baseUrl: supervisorUrl,+ ...(supervisorToken ? { token: supervisorToken } : {}),+ },+ }+ : {}),+ };+}++/**+ * The action policy, as JSON in one variable.+ *+ * Refuses to start on malformed JSON or a policy of the wrong shape, rather than falling back to the+ * default. An operator who wrote a rule and mistyped it would otherwise get a running deployment that+ * silently permits what they had just tried to forbid, and no indication that anything was wrong.+ * Configuration the product cannot honour belongs at the boot boundary; see the note at the top.+ */+function actionPolicy(environment: Environment): ActionPolicy | undefined {+ const raw = optional(environment, "AGENT_COMPUTER_POLICY");+ if (!raw) {+ return undefined;+ }++ let parsed: unknown;+ try {+ parsed = JSON.parse(raw);+ } catch {+ throw new Error("AGENT_COMPUTER_POLICY must be valid JSON");+ }++ const result = parseActionPolicy(parsed);+ if (!result.ok) {+ throw new Error(`AGENT_COMPUTER_POLICY is invalid: ${result.error}`);+ }+ return result.policy;+}++export function loadConfig(+ environment: Environment = process.env,+): DeploymentConfig {+ const google = oauthClient(environment, "GOOGLE");++ return {+ databaseUrl: required(environment, "DATABASE_URL"),+ keyEncryptionKey: keyEncryptionKey(environment),+ managedAgentAgUiUrl: requiredHttpUrl(+ environment,+ "MANAGED_AGENT_AG_UI_URL",+ ),+ deploymentId: optional(environment, "DEPLOYMENT_ID"),+ tenantPackageDirectory:+ optional(environment, "TENANT_PACKAGE_DIR") ?? "../examples/fintech",+ runtime: runtimeCapabilities(environment),+ oauth: { google },+ auth: authConfig(environment, google),+ devNoAuth: devAuthEnabled(environment),+ computer: computerConfig(environment),+ };+}diff --git a/server/src/connectors/contract.ts b/server/src/connectors/contract.tsnew file mode 100644index 00000000..350e564c--- /dev/null+++ b/server/src/connectors/contract.ts@@ -0,0 +1,27 @@+export type ConnectorUpsert = {+ kind: "upsert";+ sourceId: string;+ title: string;+ canonicalUrl: string;+ contentHash: string;+ metadata: Record<string, unknown>;+ chunks: { position: number; content: string; embedding: number[] }[];+ acls: { principal: string; effect: "allow" | "deny" }[];+};++export type ConnectorDelete = {+ kind: "delete";+ sourceId: string;+};++export type ConnectorChange = ConnectorUpsert | ConnectorDelete;++export type ConnectorAdapter = {+ discover: (input: {+ cursor: string | null;+ mode: "sync" | "reconcile";+ }) => Promise<{+ changes: ConnectorChange[];+ nextCursor: string | null;+ }>;+};diff --git a/server/src/connectors/sync-persistence.ts b/server/src/connectors/sync-persistence.tsnew file mode 100644index 00000000..b0303526--- /dev/null+++ b/server/src/connectors/sync-persistence.ts@@ -0,0 +1,107 @@+import { and, eq } from "drizzle-orm";+import type { Database } from "../db/client";+import {+ chunks,+ connectorCursors,+ documentAcls,+ documents,+ syncRuns,+} from "../db/schema";+import type { ConnectorChange } from "./contract";++export function createSyncPersistence(+ database: Database,+ connectorInstanceId: string,+) {+ return {+ async persistBatch(changes: ConnectorChange[], cursor: string | null) {+ await database.transaction(async (transaction) => {+ for (const change of changes) {+ if (change.kind === "delete") {+ await transaction+ .update(documents)+ .set({ deletedAt: new Date(), updatedAt: new Date() })+ .where(+ and(+ eq(documents.connectorInstanceId, connectorInstanceId),+ eq(documents.sourceId, change.sourceId),+ ),+ );+ continue;+ }+ const [document] = await transaction+ .insert(documents)+ .values({+ connectorInstanceId,+ sourceId: change.sourceId,+ title: change.title,+ canonicalUrl: change.canonicalUrl,+ metadata: change.metadata,+ contentHash: change.contentHash,+ deletedAt: null,+ updatedAt: new Date(),+ })+ .onConflictDoUpdate({+ target: [documents.connectorInstanceId, documents.sourceId],+ set: {+ title: change.title,+ canonicalUrl: change.canonicalUrl,+ metadata: change.metadata,+ contentHash: change.contentHash,+ deletedAt: null,+ updatedAt: new Date(),+ },+ })+ .returning({ id: documents.id });+ if (!document)+ throw new Error("Document upsert did not return an ID.");+ await transaction+ .delete(chunks)+ .where(eq(chunks.documentId, document.id));+ await transaction+ .delete(documentAcls)+ .where(eq(documentAcls.documentId, document.id));+ if (change.chunks.length) {+ await transaction.insert(chunks).values(+ change.chunks.map((chunk) => ({+ documentId: document.id,+ position: chunk.position,+ content: chunk.content,+ embedding: chunk.embedding,+ })),+ );+ }+ if (change.acls.length) {+ await transaction+ .insert(documentAcls)+ .values(+ change.acls.map((acl) => ({ documentId: document.id, ...acl })),+ );+ }+ }+ await transaction.insert(syncRuns).values({+ connectorInstanceId,+ status: "succeeded",+ completedAt: new Date(),+ stats: { changes: changes.length },+ });+ if (cursor !== null) {+ await transaction+ .insert(connectorCursors)+ .values({ connectorInstanceId, cursor, updatedAt: new Date() })+ .onConflictDoUpdate({+ target: connectorCursors.connectorInstanceId,+ set: { cursor, updatedAt: new Date() },+ });+ }+ });+ },+ async cursor() {+ const [record] = await database+ .select({ cursor: connectorCursors.cursor })+ .from(connectorCursors)+ .where(eq(connectorCursors.connectorInstanceId, connectorInstanceId));+ return record?.cursor ?? null;+ },+ };+}diff --git a/server/src/db/schema/computer.ts b/server/src/db/schema/computer.tsnew file mode 100644index 00000000..df679f4e--- /dev/null+++ b/server/src/db/schema/computer.ts@@ -0,0 +1,35 @@+/**+ * Computer tables: agent computers, sessions, computer-use audit.+ *+ * Split by owner so two people can add tables all day without touching the same lines. Add tables+ * here; never edit core.ts or teammate.ts to do it.+ */+import { pgTable, text, timestamp } from "drizzle-orm/pg-core";++/**+ * The boundary this deployment is enforcing, kept where a restart cannot lose it.+ *+ * This table keeps policy across restarts. The policy can be changed while running, and a restart+ * must not silently return to the default.+ *+ * One row, by construction. A deployment has one boundary, so the primary key is a constant and every+ * write is an upsert onto it. A table that can hold two policies is a table that will eventually hold+ * two and have to decide between them, and "which of these is in force" is not a question this should+ * ever be able to ask.+ *+ * Memory is still the cache. The gateway asks for the policy on every action, so it reads from+ * memory; this is the record that survives a restart, not something on the path of a click.+ */+export const actionPolicy = pgTable("action_policy", {+ /** Always `current`. See the note above on there being exactly one. */+ id: text("id").primaryKey(),+ /** `enforce` or `dry-run`. Not an enum: the policy module owns that vocabulary. */+ mode: text("mode").notNull(),+ deny: text("deny").array().notNull(),+ allow: text("allow").array().notNull(),+ /** Who last changed it, for the Admin page and the trail. */+ updatedBy: text("updated_by"),+ updatedAt: timestamp("updated_at", { withTimezone: true })+ .notNull()+ .defaultNow(),+});diff --git a/server/src/db/schema/core.ts b/server/src/db/schema/core.tsnew file mode 100644index 00000000..445f6c42--- /dev/null+++ b/server/src/db/schema/core.ts@@ -0,0 +1,397 @@+import { sql } from "drizzle-orm";+import {+ boolean,+ index,+ integer,+ pgEnum,+ pgTable,+ primaryKey,+ text,+ timestamp,+ uniqueIndex,+ uuid,+ vector,+} from "drizzle-orm/pg-core";+// NOT drizzle's `jsonb`: that one serialises, and so does the driver, so every object landed as a+// JSON string and nothing in this database could be queried by a JSON field. See ./json.ts.+import { jsonb } from "./json";++const createdAt = () =>+ timestamp("created_at", { withTimezone: true }).notNull().defaultNow();+const updatedAt = () =>+ timestamp("updated_at", { withTimezone: true }).notNull().defaultNow();++export const role = pgEnum("role", ["admin", "user"]);+export const agentType = pgEnum("agent_type", ["built_in", "remote_ag_ui"]);+export const credentialKind = pgEnum("credential_kind", [+ "model",+ "connector",+ // A customer's own agent behind a key. Its own kind so "what does this deployment hold" stays true.+ "agent",+ // A token for an MCP server. Same vault and same revocation as everything else, so the server row+ // holds a pointer and never the secret.+ "mcp",+]);+export const connectorType = pgEnum("connector_type", [+ "google_drive",+ "onedrive",+]);+export const syncStatus = pgEnum("sync_status", [+ "pending",+ "running",+ "succeeded",+ "failed",+]);+export const aclEffect = pgEnum("acl_effect", ["allow", "deny"]);++export const users = pgTable("users", {+ id: text("id").primaryKey(),+ email: text("email").notNull().unique(),+ name: text("name"),+ image: text("image"),+ emailVerified: boolean("email_verified").notNull().default(false),+ groups: text("groups").array().notNull().default([]),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const sessions = pgTable("sessions", {+ id: text("id").primaryKey(),+ userId: text("user_id")+ .notNull()+ .references(() => users.id, { onDelete: "cascade" }),+ token: text("token").notNull().unique(),+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),+ ipAddress: text("ip_address"),+ userAgent: text("user_agent"),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const accounts = pgTable(+ "accounts",+ {+ id: text("id").primaryKey(),+ accountId: text("account_id").notNull(),+ providerId: text("provider_id").notNull(),+ userId: text("user_id")+ .notNull()+ .references(() => users.id, { onDelete: "cascade" }),+ accessToken: text("access_token"),+ refreshToken: text("refresh_token"),+ idToken: text("id_token"),+ accessTokenExpiresAt: timestamp("access_token_expires_at", {+ withTimezone: true,+ }),+ refreshTokenExpiresAt: timestamp("refresh_token_expires_at", {+ withTimezone: true,+ }),+ scope: text("scope"),+ password: text("password"),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+ },+ (table) => [+ uniqueIndex("accounts_provider_account_idx").on(+ table.providerId,+ table.accountId,+ ),+ ],+);++export const verifications = pgTable("verifications", {+ id: text("id").primaryKey(),+ identifier: text("identifier").notNull(),+ value: text("value").notNull(),+ expiresAt: timestamp("expires_at", { withTimezone: true }).notNull(),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const userRoles = pgTable(+ "user_roles",+ {+ userId: text("user_id")+ .notNull()+ .references(() => users.id, { onDelete: "cascade" }),+ role: role("role").notNull(),+ createdAt: createdAt(),+ },+ (table) => [primaryKey({ columns: [table.userId, table.role] })],+);++export const deploymentPackages = pgTable("deployment_packages", {+ id: uuid("id").primaryKey().defaultRandom(),+ tenantId: text("tenant_id").notNull().unique(),+ sourcePath: text("source_path").notNull(),+ checksum: text("checksum").notNull(),+ loadedAt: timestamp("loaded_at", { withTimezone: true })+ .notNull()+ .defaultNow(),+});++export const agents = pgTable("agents", {+ id: text("id").primaryKey(),+ name: text("name").notNull(),+ type: agentType("type").notNull(),+ configuration: jsonb("configuration").notNull(),+ packageId: uuid("package_id").references(() => deploymentPackages.id, {+ onDelete: "set null",+ }),+ override: jsonb("override"),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const channels = pgTable(+ "channels",+ {+ id: text("id").primaryKey(),+ name: text("name").notNull(),+ description: text("description").notNull(),+ suggestedPrompts: text("suggested_prompts").array().notNull().default([]),+ allowedGroups: text("allowed_groups").array().notNull().default([]),+ packageId: uuid("package_id").references(() => deploymentPackages.id, {+ onDelete: "set null",+ }),+ override: jsonb("override"),+ /**+ * The last thing said in this channel, denormalised so a roster is one indexed read.+ *+ * Channel grain, not per-member: what was said last is a property of the conversation, and a copy+ * per member is the same fact stored N times, drifting. Per-member state, what somebody has read+ *, belongs on the membership instead.+ *+ * Written by whoever ran the agent, from the client that already received the reply, so it is a+ * cache of what a client observed rather than an authoritative mirror of the thread.+ */+ lastMessage: text("last_message"),+ lastMessageAt: timestamp("last_message_at", { withTimezone: true }),+ /** Which agent spoke, so a channel with several can show the right one. Null for a person. */+ lastMessageAgentId: text("last_message_agent_id").references(+ () => agents.id,+ {+ onDelete: "set null",+ },+ ),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+ },+ (table) => [+ /**+ * The order the channel list is drawn in.+ *+ * On the expression, not on the column, because the list sorts by the last thing said and falls+ * back to when the channel was made. An index on `last_message_at` alone does not serve that+ * ordering, so the sort would fall back to a scan on exactly the query drawn on every page.+ *+ * Declared here rather than only in a migration. An index that exists in the database and not in+ * the schema is invisible to `generate`, so the next generated migration proposes a schema+ * without it and it is silently dropped.+ */+ index("channels_recent_activity_idx").on(+ sql`COALESCE(${table.lastMessageAt}, ${table.createdAt}) DESC`,+ ),+ ],+);++export const channelMemberships = pgTable(+ "channel_memberships",+ {+ channelId: text("channel_id")+ .notNull()+ .references(() => channels.id, { onDelete: "cascade" }),+ userId: text("user_id")+ .notNull()+ .references(() => users.id, { onDelete: "cascade" }),+ createdAt: createdAt(),+ },+ (table) => [primaryKey({ columns: [table.channelId, table.userId] })],+);++export const channelAgents = pgTable(+ "channel_agents",+ {+ channelId: text("channel_id")+ .notNull()+ .references(() => channels.id, { onDelete: "cascade" }),+ agentId: text("agent_id")+ .notNull()+ .references(() => agents.id, { onDelete: "cascade" }),+ createdAt: createdAt(),+ },+ (table) => [primaryKey({ columns: [table.channelId, table.agentId] })],+);++export const credentials = pgTable("credentials", {+ id: uuid("id").primaryKey().defaultRandom(),+ kind: credentialKind("kind").notNull(),+ provider: text("provider").notNull(),+ encryptedValue: text("encrypted_value").notNull(),+ keyId: text("key_id").notNull(),+ metadata: jsonb("metadata").notNull(),+ revokedAt: timestamp("revoked_at", { withTimezone: true }),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const connectorInstances = pgTable("connector_instances", {+ id: uuid("id").primaryKey().defaultRandom(),+ type: connectorType("type").notNull(),+ credentialId: uuid("credential_id").references(() => credentials.id, {+ onDelete: "set null",+ }),+ status: syncStatus("status").notNull().default("pending"),+ sourceMetadata: jsonb("source_metadata").notNull(),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+});++export const connectorCursors = pgTable("connector_cursors", {+ connectorInstanceId: uuid("connector_instance_id")+ .primaryKey()+ .references(() => connectorInstances.id, { onDelete: "cascade" }),+ cursor: text("cursor"),+ updatedAt: updatedAt(),+});++export const webhookSubscriptions = pgTable("webhook_subscriptions", {+ id: uuid("id").primaryKey().defaultRandom(),+ connectorInstanceId: uuid("connector_instance_id")+ .notNull()+ .references(() => connectorInstances.id, { onDelete: "cascade" }),+ providerSubscriptionId: text("provider_subscription_id").notNull(),+ expiresAt: timestamp("expires_at", { withTimezone: true }),+ createdAt: createdAt(),+});++export const syncRuns = pgTable(+ "sync_runs",+ {+ id: uuid("id").primaryKey().defaultRandom(),+ connectorInstanceId: uuid("connector_instance_id")+ .notNull()+ .references(() => connectorInstances.id, { onDelete: "cascade" }),+ status: syncStatus("status").notNull(),+ startedAt: timestamp("started_at", { withTimezone: true })+ .notNull()+ .defaultNow(),+ completedAt: timestamp("completed_at", { withTimezone: true }),+ error: text("error"),+ stats: jsonb("stats").notNull(),+ },+ (table) => [+ index("sync_runs_connector_started_at_idx").on(+ table.connectorInstanceId,+ table.startedAt,+ ),+ ],+);++export const documents = pgTable(+ "documents",+ {+ id: uuid("id").primaryKey().defaultRandom(),+ connectorInstanceId: uuid("connector_instance_id")+ .notNull()+ .references(() => connectorInstances.id, { onDelete: "cascade" }),+ sourceId: text("source_id").notNull(),+ title: text("title").notNull(),+ canonicalUrl: text("canonical_url").notNull(),+ metadata: jsonb("metadata").notNull(),+ contentHash: text("content_hash").notNull(),+ deletedAt: timestamp("deleted_at", { withTimezone: true }),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+ },+ (table) => [+ uniqueIndex("documents_connector_source_idx").on(+ table.connectorInstanceId,+ table.sourceId,+ ),+ index("documents_connector_deleted_idx").on(+ table.connectorInstanceId,+ table.deletedAt,+ ),+ ],+);++export const chunks = pgTable(+ "chunks",+ {+ id: uuid("id").primaryKey().defaultRandom(),+ documentId: uuid("document_id")+ .notNull()+ .references(() => documents.id, { onDelete: "cascade" }),+ position: integer("position").notNull(),+ content: text("content").notNull(),+ embedding: vector("embedding", { dimensions: 1536 }).notNull(),+ createdAt: createdAt(),+ },+ (table) => [+ uniqueIndex("chunks_document_position_idx").on(+ table.documentId,+ table.position,+ ),+ index("chunks_document_idx").on(table.documentId),+ ],+);++export const documentAcls = pgTable(+ "document_acls",+ {+ id: uuid("id").primaryKey().defaultRandom(),+ documentId: uuid("document_id")+ .notNull()+ .references(() => documents.id, { onDelete: "cascade" }),+ principal: text("principal").notNull(),+ effect: aclEffect("effect").notNull(),+ createdAt: createdAt(),+ },+ (table) => [+ uniqueIndex("document_acls_document_principal_effect_idx").on(+ table.documentId,+ table.principal,+ table.effect,+ ),+ index("document_acls_principal_idx").on(table.principal),+ ],+);++export const auditEvents = pgTable(+ "audit_events",+ {+ id: uuid("id").primaryKey().defaultRandom(),+ /**+ * Who did it, as an id rather than a reference. No foreign key: the trail is append-only, so any+ * cascade the database wanted to run against it would be an update the trigger refuses, and a+ * user who had done anything could never be deleted.+ */+ actorUserId: text("actor_user_id"),+ eventType: text("event_type").notNull(),+ targetType: text("target_type").notNull(),+ targetId: text("target_id"),+ payload: jsonb("payload").notNull(),+ createdAt: createdAt(),+ },+ (table) => [index("audit_events_created_at_idx").on(table.createdAt)],+);++export const intelligenceChannelMappings = pgTable(+ "intelligence_channel_mappings",+ {+ userId: text("user_id")+ .notNull()+ .references(() => users.id, { onDelete: "cascade" }),+ channelId: text("channel_id")+ .notNull()+ .references(() => channels.id, { onDelete: "cascade" }),+ threadId: text("thread_id").notNull(),+ createdAt: createdAt(),+ updatedAt: updatedAt(),+ },+ (table) => [+ primaryKey({ columns: [table.userId, table.channelId] }),+ uniqueIndex("intelligence_channel_mappings_thread_idx").on(table.threadId),+ ],+);diff --git a/server/src/db/schema/index.ts b/server/src/db/schema/index.tsnew file mode 100644index 00000000..d0421cab--- /dev/null+++ b/server/src/db/schema/index.ts@@ -0,0 +1,7 @@+/** One import path for every table, with schema files grouped by owner. */++export * from "./components";+export * from "./computer";+export * from "./core";+export * from "./plugins";+export * from "./teammate";diff --git a/server/src/index.ts b/server/src/index.tsnew file mode 100644index 00000000..4b01f814--- /dev/null+++ b/server/src/index.ts@@ -0,0 +1,495 @@+import { serve } from "bun";+import { createAgentProfileStore } from "./agents/profile-store";+import { createRuntimeAgentLoader } from "./agents/runtime-agents";+import { createApp } from "./app";+import { createAuditReader, createAuditStore, recordAuditEvent } from "./audit";+import { createAuth } from "./auth";+import { DEV_ACTOR, initializeDevActorUser } from "./auth/dev-actor";+import { createRoleRepository } from "./auth/guards";+import type { OpenBotRole } from "./auth/roles";+import {+ createChannelEventHub,+ startChannelActivityListener,+} from "./channels/events";+import { createChannelStore } from "./channels/routes";+import { createThreadIdentity } from "./channels/thread-identity";+import { websocket as channelSocket } from "./channels/socket";+import { createSandboxedStore } from "./components/sandboxed";+import { createComponentStore } from "./components/store";+import { createComputerClient } from "./computer/client";+import { createComputerGateway } from "./computer/gateway";+import {+ createPolicyStore,+ DEFAULT_ACTION_POLICY,+} from "./computer/policy-store";+import { createSupervisorClient } from "./computer/supervisor";+import { loadConfig } from "./config";+import { createConnectorAdminService } from "./connectors";+import {+ type IdentifyActor,+ type IdentifyUser,+ mountCopilotRuntime,+} from "./copilot";+import {+ createCredentialAdminService,+ createCredentialStore,+ resolveModelApiKey,+} from "./credentials";+import { createDatabase } from "./db/client";+import { createPluginStore } from "./plugins/store";+import {+ createPackageStatusReader,+ loadTenantPackage,+ synchronizeTenantPackage,+} from "./tenant-package";++/**+ * Who is asking, for a CopilotKit request.+ *+ * One resolver, because a run has two questions to answer about the same person: whose threads and+ * memory these are, and which teammates they may run. Answering them from different places is how+ * one person ends up running another's private teammate, or reading their thread.+ */+async function resolveRequestActor(request: Request): Promise<{+ id: string;+ name: string;+ role: OpenBotRole;+}> {+ if (config.devNoAuth) {+ return { id: DEV_ACTOR.id, name: DEV_ACTOR.email, role: DEV_ACTOR.role };+ }+ const session = await auth?.api.getSession({ headers: request.headers });+ const user = session?.user;+ if (!user) {+ throw new Error("A CopilotKit run requires a signed-in user.");+ }+ const roles = await roleRepository.rolesForUser(user.id);+ if (!roles.includes("admin") && !roles.includes("user")) {+ throw new Error("A CopilotKit run requires an authorized user.");+ }+ return {+ id: user.id,+ name: user.name ?? user.email ?? user.id,+ role: roles.includes("admin") ? "admin" : "user",+ };+}++/** The Intelligence projection of {@link resolveRequestActor}: threads are scoped to this person. */+const identifyUser: IdentifyUser = async (request) => {+ const { id, name } = await resolveRequestActor(request);+ return { id, name };+};++/**+ * The authorization projection of the same person: agent visibility is decided from this.+ *+ * An unauthenticated request resolves to a person who owns nothing rather than an error, so the+ * runtime can still describe itself, `/info` reports the licence and the public roster, which is+ * what a deployment check reads to tell "the licence is invalid" apart from "chat is silently+ * broken". It grants nothing: this actor matches no private profile and is not an administrator,+ * and a run still fails in `identifyUser`, which has no anonymous case because a thread must belong+ * to somebody.+ */+const ANONYMOUS_ACTOR = { id: "", role: "user" } as const;++const identifyActor: IdentifyActor = async (request) => {+ try {+ const { id, role } = await resolveRequestActor(request);+ return { id, role };+ } catch {+ return ANONYMOUS_ACTOR;+ }+};++const config = loadConfig();+const port = Number.parseInt(process.env.PORT ?? "3001", 10);+const database = createDatabase(config.databaseUrl);+await initializeDevActorUser(database, config.devNoAuth);+// The vault, built before the agent store because a customer's agent may sit behind a key and that+// key belongs here rather than on the agent row. See agents/auth-header.ts.+const credentialStore = createCredentialStore(database);+const agentVault = {+ store: credentialStore,+ reader: credentialStore,+ encryptionKey: config.keyEncryptionKey,+};+const agentProfileStore = createAgentProfileStore(+ database,+ config.managedAgentAgUiUrl,+ agentVault,+);+// Read here rather than beside the synchronise below, because the package names the deployment and+// the channel store needs that name before it can mint a thread id.+const tenantPackage = await loadTenantPackage(config.tenantPackageDirectory);+const threadIdentity = createThreadIdentity(+ config.deploymentId ?? tenantPackage.tenantId,+);+const channelStore = createChannelStore(+ database,+ agentProfileStore,+ threadIdentity,+);+const channelEvents = createChannelEventHub();+/**+ * Which components each Bot may answer with.+ *+ * Nothing is seeded here. The catalogue is a fact about the build; a fork that ships four components+ * of its own should start with four rows, and the only thing that can enumerate them is+ * the app that compiled them. It announces itself on load; this process learns what exists from that,+ * and owns only what may be done with it.+ */+const componentStore = createComponentStore(database);+// Its own connection is held for the life of the process; announced activity from any instance+// arrives here and is fanned out to connected members.+const channelActivityListener = await startChannelActivityListener(+ config.databaseUrl,+ channelEvents,+);+const roleRepository = createRoleRepository(database);+const loadAgentsForActor = createRuntimeAgentLoader(database, agentVault);+await synchronizeTenantPackage(database, tenantPackage);+const auth = config.auth ? createAuth(config, database) : undefined;+// One computer each, when a supervisor is configured to give them out. Without one every Bot shares+// the computer at `baseUrl`, which is what a laptop wants and is honest about being one machine.+const supervisor = config.computer?.supervisor+ ? createSupervisorClient(config.computer.supervisor)+ : undefined;+const computerClient = config.computer+ ? createComputerClient({+ baseUrl: config.computer.baseUrl,+ allowPrivateHosts: config.computer.allowPrivateHosts,+ ...(config.computer.token ? { token: config.computer.token } : {}),+ ...(supervisor+ ? { resolveBaseUrl: (botId: string) => supervisor.locate(botId) }+ : {}),+ })+ : undefined;+// What Bots may do on their computers. Configuration supplies the deployment's default; an+// administrator can change it while running, and a restart returns to the configured one.+const policyStore = createPolicyStore(+ config.computer?.policy ?? DEFAULT_ACTION_POLICY,+ database,+);+// A boundary an administrator set is read back before the first action is decided, so a restart no+// longer silently returns to the configured default.+const policySource = await policyStore.load();++/*+ * Record which boundary this process started with.+ *+ * The trail records the boundary a process starts with, so later audit reads can distinguish the+ * configured default from any administrator-updated policy that was persisted before restart.+ *+ * Not awaited and never fatal. A deployment must not fail to start because its audit trail is+ * unavailable, and the row is a note for a reader rather than something the server depends on.+ */+const bootAuditStore = createAuditStore(database);++/**+ * What a Bot can reach beyond its own computer.+ *+ * Built here rather than beside the component store because it needs the policy, and it needs the+ * same policy the computer gateway enforces rather than one of its own. A deployment that has said+ * "this Bot may not change anything in Jira" has said one thing, and it should not matter whether+ * the change would arrive through a browser or through a tool call.+ */+const sandboxedStore = createSandboxedStore(database, bootAuditStore);++const pluginStore = createPluginStore({+ database,+ auditStore: bootAuditStore,+ credentials: credentialStore,+ encryptionKey: config.keyEncryptionKey,+ policy: () => policyStore.get(),+});++void recordAuditEvent(bootAuditStore, {+ eventType: "computer.policy_loaded",+ targetType: "policy",+ payload: {+ ...policyStore.get(),+ source:+ policySource === "the database"+ ? "an administrator, saved in this deployment"+ : config.computer?.policy+ ? "configuration"+ : "the built-in default",+ note:+ policySource === "the database"+ ? "Set while running and kept. A restart returns to this."+ : "The deployment default. Anything an administrator sets from here is kept.",+ },+}).catch(() => undefined);++/*+ * Record whether each Bot has a computer of its own.+ *+ * Without a supervisor every Bot shares the browser at `AGENT_COMPUTER_URL`. That is a fine way to+ * run on a laptop, but the shared isolation state must be visible rather than inferred.+ */+void recordAuditEvent(bootAuditStore, {+ eventType: "computer.isolation_loaded",+ targetType: "computer",+ payload: supervisor+ ? {+ isolation: "one computer per Bot",+ note: "Each Bot gets its own container, its own /workspace and its own browser profile.",+ }+ : {+ isolation: "one shared computer",+ note: "No supervisor is configured, so every Bot uses the same browser. Sessions, files and logins are shared between them. Set COMPUTER_SUPERVISOR_URL to give each Bot its own.",+ },+}).catch(() => undefined);++console.info(+ JSON.stringify({+ type: "computer-isolation",+ isolation: supervisor ? "one computer per Bot" : "one shared computer",+ ...(supervisor+ ? {}+ : {+ warning:+ "Every Bot shares one browser. Set COMPUTER_SUPERVISOR_URL for a computer each.",+ }),+ }),+);+/**+ * One Bot's endpoint must not take down the platform.+ *+ * Restarting a remote agent while a run is in flight resets the socket. The rejection reaches the top+ * of the process, and Bun kills the whole server: every other person's conversation, every other Bot+ * and the admin surface go with it, because somebody redeployed their own agent.+ *+ * That blast radius is created by design the moment people can register their own endpoints,+ * so it belongs to that feature. A remote agent is untrusted infrastructure: it will restart, it will+ * time out, it will close a stream halfway through, and none of that is exceptional.+ *+ * Logged loudly rather than swallowed. A process that hides unhandled rejections is worse than one+ * that dies, so this prints the full reason and keeps serving; what it must never do is stay quiet.+ */+process.on("unhandledRejection", (reason) => {+ console.error(+ JSON.stringify({+ type: "unhandled-rejection",+ message: reason instanceof Error ? reason.message : String(reason),+ code:+ reason && typeof reason === "object" && "code" in reason+ ? String((reason as { code: unknown }).code)+ : undefined,+ note: "The server kept running. A remote agent's connection failing must not stop everyone else.",+ }),+ );+});++const app = createApp(+ config,+ auth,+ roleRepository,+ createAuditReader(database),+ createCredentialAdminService(+ config.keyEncryptionKey,+ credentialStore,+ createAuditStore(database),+ ),+ createPackageStatusReader(database),+ createConnectorAdminService(+ tenantPackage.knowledgeSources,+ database,+ createCredentialAdminService(+ config.keyEncryptionKey,+ credentialStore,+ createAuditStore(database),+ ),+ ),+ // The runtime call: the model, per-actor agent loading, and the two identity+ // functions are how a run is attributed to a person.+ mountCopilotRuntime(+ config,+ tenantPackage.model,+ loadAgentsForActor,+ () =>+ resolveModelApiKey({+ encryptionKey: config.keyEncryptionKey,+ reader: credentialStore,+ provider: tenantPackage.model.provider,+ keyId: tenantPackage.model.credentialSecretRef,+ environment: process.env,+ }),+ identifyUser,+ identifyActor,+ ),+ computerClient,+ // The only path to an acting call.+ computerClient+ ? createComputerGateway({+ client: computerClient,+ auditStore: bootAuditStore,+ // Read on every decision rather than captured once, so a rule an administrator adds while the+ // server is running applies to the very next action instead of after a restart.+ policy: () => policyStore.get(),+ // Stop, reset and the listing act on containers when there are containers to act on.+ ...(supervisor ? { supervisor } : {}),+ })+ : undefined,+ policyStore,+ // Bots as durable objects, and the channels they run in.+ agentProfileStore,+ channelStore,+ channelEvents,+ // The same store the boot row uses, so a Bot's own refusal lands in the trail beside its actions.+ bootAuditStore,+ componentStore,+ // MCP servers and packaged skills. Judged by the same policy the computer actions are, read+ // fresh on every call for the same reason: a rule added a moment ago applies to the next call.+ pluginStore,+ // Components authored in the browser. Their governance is the component store's; this owns only+ // the source, which is the part a rebuild would otherwise have owned.+ sandboxedStore,+ // How a thread that has no channel is named, so the direct Bot chat is in the same namespace.+ threadIdentity,+);++/**+ * The live screen, proxied.+ *+ * Proxied rather than connected directly. `agent-computer` authenticates its callers with a+ * shared token, not with a person's session, and it must never be reachable from a browser. So the+ * socket terminates here, behind the same session guard as every other route, and this process opens+ * a second socket inward carrying the token.+ *+ * Not a Hono route because an upgrade is not a request/response: Bun hands it over before Hono sees a+ * body, so it is handled in `fetch` ahead of the app.+ */+const toStreamUrl = (baseUrl: string, botId: string) =>+ // The Bot travels in the query, because a websocket upgrade carries no custom header for the+ // computer to read and every call it serves is per Bot. The secret travels the same way and for the+ // same reason, this socket is the one a person can type into, so it is the last thing that should+ // be reachable without it.+ `${baseUrl.replace(/^http/, "ws").replace(/\/$/, "")}/stream?bot=${encodeURIComponent(botId)}&token=${encodeURIComponent(config.computer?.token ?? "")}`;++/**+ * Which Bot's screen. The Bot is named in the path and its computer is located the same way every+ * other call locates it, so the live stream cannot point at a different Bot's browser.+ */+const streamPathBotId = (pathname: string): string | null => {+ const match = pathname.match(/^\/api\/computers\/([^/]+)\/stream$/);+ return match?.[1] ? decodeURIComponent(match[1]) : null;+};++/** What each proxied socket carries: where to connect inward, and the socket once opened. */+type StreamData = { upstream: string; inward?: WebSocket };++/**+ * Bun takes exactly one WebSocket handler for the server, and two features need one: the app proxies+ * the computer stream, and it pushes channel activity through Hono's adapter. So this one+ * dispatches on what the upgrade attached, a proxy socket carries `upstream`, a Hono socket does+ * not, rather than either feature quietly taking the slot and breaking the other on connect.+ */+type ChannelSocket = Parameters<typeof channelSocket.open>[0];+type SocketData = StreamData | ChannelSocket["data"];++const isProxiedStream = (data: SocketData): data is StreamData =>+ typeof (data as StreamData).upstream === "string";++// Hono owns the socket's data once it has upgraded it; this hands its own back to it.+const asChannelSocket = (ws: { data: SocketData }) =>+ ws as unknown as ChannelSocket;++serve<SocketData>({+ port,+ async fetch(request, server) {+ const url = new URL(request.url);+ const streamBotId = streamPathBotId(url.pathname);+ if (+ streamBotId !== null &&+ request.headers.get("upgrade")?.toLowerCase() === "websocket"+ ) {+ if (!config.computer) {+ return new Response("No computer is configured.", { status: 503 });+ }+ // The session guard, applied by hand because middleware does not run on an upgrade. An+ // unauthenticated socket here would be the whole point of the proxy defeated.+ const actor = await identifyUser(request).catch(() => null);+ if (!actor) {+ return new Response("Sign in first.", { status: 401 });+ }+ // Located per Bot when there is a supervisor, and the one shared computer when there is not.+ let upstream: string;+ try {+ upstream = toStreamUrl(+ supervisor+ ? await supervisor.locate(streamBotId)+ : config.computer.baseUrl,+ streamBotId,+ );+ } catch (error) {+ // Said out loud rather than falling back to another Bot's computer, which is the failure this+ // whole path exists to prevent.+ return new Response(+ error instanceof Error+ ? error.message+ : "That Bot's computer could not be reached.",+ { status: 502 },+ );+ }+ if (server.upgrade(request, { data: { upstream } })) {+ return undefined as unknown as Response;+ }+ return new Response("Expected a WebSocket upgrade.", { status: 400 });+ }+ return app.fetch(request, { server });+ },+ websocket: {+ open(ws) {+ if (!isProxiedStream(ws.data)) {+ channelSocket.open(asChannelSocket(ws));+ return;+ }+ const inward = new WebSocket(ws.data.upstream);+ ws.data.inward = inward;+ // Frames outward, input inward. Buffered by neither side: a frame the browser is too slow for+ // should be dropped, not queued, because a stale frame is worse than a missing one.+ inward.onmessage = (event) => {+ try {+ ws.send(String(event.data));+ } catch {+ inward.close();+ }+ };+ inward.onclose = () => ws.close();+ inward.onerror = () => ws.close();+ },+ message(ws, raw) {+ if (!isProxiedStream(ws.data)) {+ channelSocket.message(asChannelSocket(ws), raw);+ return;+ }+ if (ws.data.inward?.readyState === 1) ws.data.inward.send(String(raw));+ },+ close(ws, code, reason) {+ if (!isProxiedStream(ws.data)) {+ channelSocket.close(asChannelSocket(ws), code, reason);+ return;+ }+ ws.data.inward?.close();+ },+ },+});++if (config.devNoAuth) {+ // Loud, every boot. A server that is not checking who is asking should never be a quiet default.+ console.warn(+ "OPENBOT_DEV_NO_AUTH is on: every request is treated as " ++ `${DEV_ACTOR.email} (administrator). Local development only.`,+ );+}++// The activity listener holds a connection of its own for the life of the process. Released on the+// way out, so a watch-mode restart does not leave one behind on every reload.+for (const signal of ["SIGINT", "SIGTERM"] as const) {+ process.on(signal, () => {+ void channelActivityListener.stop().finally(() => process.exit(0));+ });+}++console.info(`OpenBot server listening on http://localhost:${port}`);diff --git a/server/src/plugins/catalogue.ts b/server/src/plugins/catalogue.tsnew file mode 100644index 00000000..d918bdb2--- /dev/null+++ b/server/src/plugins/catalogue.ts@@ -0,0 +1,279 @@+/**+ * The catalogue of MCP servers this deployment will talk to, and the rule that decides admissibility.+ *+ * First-party only, and the list is frozen in code. A remote MCP server is a piece of somebody+ * else's software that our Bots hand credentials to and take instructions from, so "which servers"+ * is a decision to make once, in review, rather than one to leave to whoever is typing a URL into an+ * admin page at the time. Only servers the vendor themselves maintains are here. A community server+ * that wraps the same API is not equivalent: it is an extra party in the trust path with none of the+ * accountability, and the answer for a vendor without an official server is to wait for one.+ *+ * Every host and path here comes from the vendor's published documentation. They are pinned rather+ * than discovered, because a URL this deployment will hand a credential to is a reviewed source+ * contract.+ *+ * Admissibility is fail-closed and checked against the pinned host, never against what a caller+ * supplied. A URL that does not exactly match a pinned host, or match one anchored per-instance+ * pattern, is refused. This is the control that stops "add an MCP server" from being a request+ * forgery primitive pointed at the deployment's own network.+ */++export type CatalogueEntry = {+ /** Stable slug. Prefixes every tool name, so tools from two servers can never collide. */+ key: string;+ title: string;+ vendor: string;+ summary: string;+ /**+ * The one host this server lives on. Null for a vendor that gives every customer their own+ * hostname, where {@link CatalogueEntry.hostPattern} decides instead.+ */+ host: string | null;+ /**+ * Anchored pattern for a per-instance vendor. Only consulted when `host` is null, and written+ * anchored at both ends so it cannot match a host that merely ends in the vendor's domain.+ */+ hostPattern?: string;+ /** The path the MCP endpoint is served at. Frozen here, never taken from a caller. */+ path: string;+ /** True when this server needs a credential from the vault to answer at all. */+ needsCredential: boolean;+ /**+ * The tools this vendor's server exposes that change something.+ *+ * Kept so the policy can be written about effect rather than about tool names a rule author would+ * have to look up. Known-incomplete for some vendors, which is why {@link classifyTool} treats an+ * unknown tool as a write rather than as a read: a missed write that gets extra scrutiny is safer+ * than a write classified as a read.+ */+ writeTools: readonly string[];+ docsUrl: string;+};++export const CATALOGUE: readonly CatalogueEntry[] = Object.freeze([+ {+ key: "atlassian",+ title: "Atlassian",+ vendor: "Atlassian",+ summary: "Jira issues and Confluence pages.",+ host: "https://mcp.atlassian.com",+ path: "/v1/mcp/authv2",+ needsCredential: true,+ writeTools: Object.freeze([+ "createJiraIssue",+ "editJiraIssue",+ "transitionJiraIssue",+ "addCommentToJiraIssue",+ "addWorklogToJiraIssue",+ "createConfluencePage",+ "updateConfluencePage",+ "createConfluenceFooterComment",+ "createConfluenceInlineComment",+ ]),+ docsUrl:+ "https://support.atlassian.com/rovo/docs/getting-started-with-the-atlassian-remote-mcp-server/",+ },+ {+ key: "box",+ title: "Box",+ vendor: "Box",+ summary: "Files and folders in Box.",+ host: "https://mcp.box.com",+ path: "/",+ needsCredential: true,+ writeTools: Object.freeze([+ "copy_file",+ "copy_folder",+ "create_folder",+ "create_metadata_template",+ "get_upload_url",+ "move_file",+ ]),+ docsUrl: "https://developer.box.com/guides/box-mcp/remote/",+ },+ {+ key: "slack",+ title: "Slack",+ vendor: "Slack",+ summary: "Search and post in the channels the credential can reach.",+ host: "https://mcp.slack.com",+ path: "/mcp",+ needsCredential: true,+ writeTools: Object.freeze([+ "slack_send_message",+ "slack_send_message_draft",+ "slack_schedule_message",+ "slack_add_reaction",+ "slack_create_conversation",+ "slack_create_canvas",+ "slack_update_canvas",+ ]),+ docsUrl: "https://docs.slack.dev/ai/slack-mcp-server/",+ },+ {+ key: "salesforce",+ title: "Salesforce",+ vendor: "Salesforce",+ summary: "Records on the Salesforce platform.",+ // A shared platform host, which is why the path matters as much as the host here: the frozen+ // path selects one server and nothing else on that host is reachable through this.+ host: "https://api.salesforce.com",+ // Salesforce publishes this server at `/platform/<server>`, with sandbox orgs under+ // `/sandbox/platform/<server>`. A deployment on a sandbox needs the custom-server form.+ path: "/platform/mcp/v1/platform/sobject-all",+ needsCredential: true,+ writeTools: Object.freeze([+ "create_record",+ "update_record",+ "delete_record",+ ]),+ docsUrl:+ "https://developer.salesforce.com/docs/einstein/genai/guide/mcp.html",+ },+ {+ key: "servicenow",+ title: "ServiceNow",+ vendor: "ServiceNow",+ summary: "Records on your own ServiceNow instance.",+ // Per-instance: every customer has their own hostname, so there is no single host to pin and+ // admissibility is an anchored pattern instead. The capture group is the instance label.+ host: null,+ hostPattern:+ "^https://([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)\\.service-now\\.com$",+ path: "/sncapps/mcp-server",+ needsCredential: true,+ writeTools: Object.freeze([+ "create_record",+ "update_record",+ "delete_record",+ ]),+ docsUrl:+ "https://www.servicenow.com/docs/bundle/zurich-api-reference/page/integrate/mcp/concept/mcp-server.html",+ },+]);++const BY_KEY = new Map(CATALOGUE.map((entry) => [entry.key, entry]));++/** Compiled once from the frozen source strings above. Never from anything a caller supplied. */+const PATTERNS = new Map(+ CATALOGUE.filter((entry) => entry.hostPattern !== undefined).map((entry) => [+ entry.key,+ new RegExp(entry.hostPattern as string),+ ]),+);++export function catalogueEntry(key: string): CatalogueEntry | null {+ return BY_KEY.get(key) ?? null;+}++/**+ * Is this host one this entry is allowed to be pointed at?+ *+ * Compares the RAW host string, case-sensitively, and returns false for anything it does not+ * positively recognise. Every branch that cannot prove admissibility returns false rather than+ * falling through, because the failure mode of the opposite arrangement is a deployment reaching an+ * address nobody chose.+ */+export function hostAdmissible(entry: CatalogueEntry, host: string): boolean {+ if (entry.host !== null) return entry.host === host;+ const pattern = PATTERNS.get(entry.key);+ if (!pattern) return false;+ return pattern.test(host);+}++/**+ * The URL this server is reached at, or null if the request is not admissible.+ *+ * `instanceHost` is only consulted for a per-instance vendor, and only after the pattern accepts it.+ * The path is always the catalogue's, never the caller's, so an admissible host cannot reach some+ * other endpoint on the same machine.+ */+export function resolveServerUrl(+ key: string,+ instanceHost?: string,+): { url: string; entry: CatalogueEntry } | null {+ const entry = catalogueEntry(key);+ if (!entry) return null;++ const host = entry.host ?? instanceHost ?? null;+ if (host === null) return null;+ if (!hostAdmissible(entry, host)) return null;++ // The path is joined rather than concatenated blindly so a root path does not produce a double+ // slash, which some servers treat as a different route.+ const path = entry.path === "/" ? "" : entry.path;+ return { url: `${host}${path}`, entry };+}++/**+ * What this tool does, in the only two categories a policy author cares about.+ *+ * Unknown counts as a write, in both directions it can be unknown. A tool named in+ * {@link CatalogueEntry.writeTools} is a write. A tool the server advertised and this file has never+ * heard of is a write, because these lists are a verified subset for several vendors rather than the+ * complete surface. A tool the server never advertised at all is a write, because the only thing+ * that produced the name was a model.+ *+ * Only a tool the server itself listed AND that is absent from the write list is treated as a read.+ * That is the one case where both sources agree, and it is the only one where guessing permissively+ * is recoverable.+ */+export function classifyTool(+ entry: CatalogueEntry | null,+ toolName: string,+ advertised: boolean,+): "read" | "write" {+ // A server an administrator added by URL has no reviewed tool catalogue behind it, so nothing here+ // can say a tool of theirs only reads. Everything it offers is a write.+ if (!entry) return "write";+ if (!advertised) return "write";+ return entry.writeTools.includes(toolName) ? "write" : "read";+}++/**+ * Is this a URL an administrator may point the deployment at?+ *+ * A curated entry is reviewed in code; this is the other path, and it needs its own floor because+ * "add an MCP server" is otherwise a request-forgery primitive aimed at whatever the server can+ * reach: cloud metadata endpoints, databases on the same network, admin panels bound to localhost.+ * The rules are deliberately blunt.+ *+ * HTTPS only, because the credential is a bearer token and plaintext is not negotiable.+ * No address literals, localhost or internal suffixes, because those point at the deployment rather+ * than a vendor service.+ *+ * This is static URL validation: it checks the literal host string and scheme before storage. DNS+ * resolution and per-request network policy are separate deployment controls.+ */+export function customUrlRefusal(raw: string): string | null {+ let url: URL;+ try {+ url = new URL(raw);+ } catch {+ return "That is not a URL.";+ }++ if (url.protocol !== "https:") {+ return "An MCP server must be reached over https.";+ }++ const host = url.hostname.toLowerCase();++ // Bracketed IPv6 arrives with the brackets already stripped by URL, so the colon test catches it.+ if (host.includes(":") || /^[0-9.]+$/.test(host)) {+ return "Give a hostname rather than an IP address.";+ }+ if (host === "localhost" || host.endsWith(".localhost")) {+ return "That address is local to the deployment.";+ }+ if (+ host.endsWith(".internal") ||+ host.endsWith(".local") ||+ host.endsWith(".localdomain") ||+ !host.includes(".")+ ) {+ return "That address is not reachable from outside this network.";+ }++ return null;+}diff --git a/server/src/plugins/store.ts b/server/src/plugins/store.tsnew file mode 100644index 00000000..4e31b36a--- /dev/null+++ b/server/src/plugins/store.ts@@ -0,0 +1,873 @@+import { and, asc, eq, inArray, isNull, or } from "drizzle-orm";+import { type AuditStore, recordAuditEvent } from "../audit";+import {+ type ActionPolicy,+ evaluateActionPolicy,+ type PolicyContext,+} from "../computer/policy";+import {+ type CredentialSecretReader,+ decryptCredentialForUse,+} from "../credentials";+import type { Database } from "../db/client";+import {+ agentProfiles,+ mcpServers,+ mcpTools,+ pluginGrants,+ skills,+} from "../db/schema";+import {+ type CatalogueEntry,+ catalogueEntry,+ classifyTool,+ customUrlRefusal,+ resolveServerUrl,+} from "./catalogue";+import { callTool as callRemoteTool, listTools, McpServerError } from "./mcp";++/**+ * Plugins: what this deployment has added, which Bots may use it, and the one path a call takes.+ *+ * The grant and the policy are two different questions and both are asked on every call. The grant+ * answers "is this Bot allowed this tool at all", which an operator decides on the Plugins page. The+ * policy answers "is this particular call permitted right now", which is written as a rule and can+ * say things a grant cannot: not on this host, not this argument, not a write. Collapsing them would+ * mean an operator who granted a Bot a server had also, invisibly, waived every rule about it.+ */++export type PluginKind = "mcp" | "skill";++export type ToolRecord = {+ serverId: string;+ name: string;+ description: string;+ inputSchema: Record<string, unknown>;+ /** `<serverId>/<name>`. What a grant names and what the model's tool name is derived from. */+ ref: string;+ effect: "read" | "write";+ grantedTo: string[];+};++export type ServerRecord = {+ id: string;+ title: string;+ vendor: string;+ url: string;+ summary: string;+ docsUrl: string;+ /** `first-party` or `custom`. Shown wherever the server is, never inferred by a reader. */+ provenance: string;+ hasCredential: boolean;+ toolsRefreshedAt: string | null;+ lastError: string | null;+ addedBy: string | null;+ tools: ToolRecord[];+};++export type SkillRecord = {+ id: string;+ slug: string;+ /** Whose it is. Null means the deployment's, written by an administrator or shipped. */+ ownerUserId: string | null;+ title: string;+ summary: string;+ instructions: string;+ origin: string;+ installedBy: string | null;+ grantedTo: string[];+};++/**+ * Who is asking, for the surfaces where the answer depends on it.+ *+ * An administrator sees and governs the whole deployment. Everybody else sees the deployment's+ * skills and their own, and may act only on their own.+ */+export type SkillActor = { id: string; isAdmin: boolean };++/** What one Bot holds. Everything the runtime needs to offer it, and nothing it does not. */+export type GrantedPlugins = {+ tools: {+ ref: string;+ /** The name the model is offered, which is the ref with the separator a tool name allows. */+ toolName: string;+ description: string;+ inputSchema: Record<string, unknown>;+ }[];+ skills: {+ slug: string;+ title: string;+ summary: string;+ instructions: string;+ }[];+};++export type PluginDecision =+ | { allowed: true }+ | { allowed: false; reason: string };++export class PluginRefusedError extends Error {+ constructor(+ message: string,+ readonly rule: string | null,+ ) {+ super(message);+ this.name = "PluginRefusedError";+ }+}++export class CatalogueEntryUnknownError extends Error {+ constructor(key: string) {+ super(`${key} is not a server this deployment will connect to.`);+ this.name = "CatalogueEntryUnknownError";+ }+}++/** A URL an administrator offered that this deployment will not point itself at. */+export class CustomServerRefusedError extends Error {+ constructor(message: string) {+ super(message);+ this.name = "CustomServerRefusedError";+ }+}++/**+ * A tool name the model can actually call.+ *+ * `<server>/<tool>` is how a grant is stored, because a slash reads correctly to a person and cannot+ * appear in either half. Model tool names may not contain one, so the offered name uses `__`.+ * Converting in one place, both ways, keeps the two spellings from drifting.+ */+export const toolNameFor = (ref: string) => `mcp__${ref.replace("/", "__")}`;++export function refFromToolName(toolName: string): string | null {+ if (!toolName.startsWith("mcp__")) return null;+ const rest = toolName.slice("mcp__".length);+ const separator = rest.indexOf("__");+ if (separator <= 0) return null;+ return `${rest.slice(0, separator)}/${rest.slice(separator + 2)}`;+}++const iso = (value: Date | string | null): string | null =>+ value === null ? null : value instanceof Date ? value.toISOString() : value;++export type PluginStoreOptions = {+ database: Database;+ auditStore: AuditStore;+ credentials: CredentialSecretReader;+ encryptionKey: string;+ /** Read at call time, never captured, so a policy changed a moment ago applies to this call. */+ policy: () => ActionPolicy;+};++export function createPluginStore(options: PluginStoreOptions) {+ const { database, auditStore, credentials, encryptionKey } = options;++ async function grantsFor(kind: PluginKind, refs: string[]) {+ if (refs.length === 0) return new Map<string, string[]>();+ const rows = await database+ .select()+ .from(pluginGrants)+ .where(and(eq(pluginGrants.kind, kind), inArray(pluginGrants.ref, refs)));+ const byRef = new Map<string, string[]>();+ for (const row of rows) {+ byRef.set(row.ref, [...(byRef.get(row.ref) ?? []), row.agentId]);+ }+ return byRef;+ }++ /**+ * Who did it goes in the payload, never in `actorUserId`.+ *+ * That column is a foreign key to `users.id`, and everything here holds an email. Writing one+ * there does not fail loudly: the insert violates the constraint and the entire audit row is lost.+ */++ /** The credential for a server, decrypted for one call and never held. */+ async function tokenFor(+ credentialId: string | null,+ ): Promise<string | undefined> {+ if (!credentialId) return undefined;+ return decryptCredentialForUse(encryptionKey, credentials, credentialId);+ }++ async function requireServer(serverId: string) {+ const [row] = await database+ .select()+ .from(mcpServers)+ .where(eq(mcpServers.id, serverId))+ .limit(1);+ if (!row) throw new CatalogueEntryUnknownError(serverId);++ const entry = catalogueEntry(row.id);+ if (row.provenance === "first-party" && !entry) {+ // The row outlived its catalogue entry, which means a build removed a vendor while a+ // deployment still had it added. Refused rather than reached: the pinned host that made it+ // admissible no longer exists to check against, so there is nothing left that says this URL+ // is one we agreed to talk to.+ throw new CatalogueEntryUnknownError(row.id);+ }+ // Null for a custom server, and every caller handles that by assuming the worst about it.+ return { row, entry };+ }++ return {+ /**+ * Add a server from the catalogue.+ *+ * The URL is resolved from the catalogue rather than accepted from the caller, so the only thing+ * a person can influence is which entry and, for a per-instance vendor, their own instance+ * hostname, which is then checked against that vendor's anchored pattern before anything is+ * stored.+ */+ async addServer(input: {+ key: string;+ instanceHost?: string;+ credentialId?: string;+ by: string;+ }): Promise<ServerRecord> {+ const resolved = resolveServerUrl(input.key, input.instanceHost);+ if (!resolved) throw new CatalogueEntryUnknownError(input.key);++ await database+ .insert(mcpServers)+ .values({+ id: resolved.entry.key,+ title: resolved.entry.title,+ vendor: resolved.entry.vendor,+ url: resolved.url,+ credentialId: input.credentialId ?? null,+ addedBy: input.by,+ })+ .onConflictDoUpdate({+ target: mcpServers.id,+ set: {+ url: resolved.url,+ credentialId: input.credentialId ?? null,+ addedBy: input.by,+ updatedAt: new Date(),+ },+ });++ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: "mcp_server",+ targetId: resolved.entry.key,+ payload: {+ actor: input.by,+ change: "mcp_server_added",+ server: resolved.entry.key,+ url: resolved.url,+ },+ });++ // Refreshed immediately so the page that added it can show what it offers, and so a bad+ // credential is reported now rather than the first time a Bot tries to use it.+ await this.refreshTools(resolved.entry.key);+ const servers = await this.listServers();+ const added = servers.find((server) => server.id === resolved.entry.key);+ if (!added) throw new CatalogueEntryUnknownError(input.key);+ return added;+ },++ /**+ * Add a server that is not in the catalogue, by URL.+ *+ * The administrator's path is different from pressing Add on a curated entry. That+ * one picks a reviewed vendor at a pinned host; this one points the deployment at an address+ * somebody typed. Both are useful and only one of them can be reviewed in advance, so this one+ * is guarded at the URL, recorded with its provenance, and every tool it offers is treated as a+ * write because nothing here knows otherwise.+ */+ async addCustomServer(input: {+ id: string;+ title: string;+ url: string;+ credentialId?: string;+ by: string;+ }): Promise<ServerRecord> {+ const refusal = customUrlRefusal(input.url);+ if (refusal) throw new CustomServerRefusedError(refusal);++ // A custom server may not take a curated entry's slug. The slug prefixes tool names and is+ // what a grant and a policy rule are written against, so allowing a shadow would let a custom+ // server inherit rules an operator wrote about the vendor.+ if (catalogueEntry(input.id)) {+ throw new CustomServerRefusedError(+ `${input.id} is the name of a server this deployment already knows. Choose another.`,+ );+ }+ if (!/^[a-z0-9][a-z0-9-]{0,38}[a-z0-9]$/.test(input.id)) {+ throw new CustomServerRefusedError(+ "A server name is lower-case letters, numbers and hyphens.",+ );+ }++ await database+ .insert(mcpServers)+ .values({+ id: input.id,+ title: input.title,+ vendor: new URL(input.url).hostname,+ url: input.url,+ provenance: "custom",+ credentialId: input.credentialId ?? null,+ addedBy: input.by,+ })+ .onConflictDoUpdate({+ target: mcpServers.id,+ set: {+ title: input.title,+ url: input.url,+ credentialId: input.credentialId ?? null,+ addedBy: input.by,+ updatedAt: new Date(),+ },+ });++ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: "mcp_server",+ targetId: input.id,+ payload: {+ actor: input.by,+ change: "mcp_server_added",+ server: input.id,+ url: input.url,+ // Named in the trail, because "who added a server nobody reviewed" is a question somebody+ // will ask and the answer should not require reading the catalogue of a past build.+ provenance: "custom",+ },+ });++ await this.refreshTools(input.id);+ const added = (await this.listServers()).find(+ (server) => server.id === input.id,+ );+ if (!added) throw new CatalogueEntryUnknownError(input.id);+ return added;+ },++ async removeServer(serverId: string, by: string): Promise<void> {+ await database.delete(mcpServers).where(eq(mcpServers.id, serverId));+ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: "mcp_server",+ targetId: serverId,+ payload: { actor: by, change: "mcp_server_removed", server: serverId },+ });+ },++ /**+ * Ask a server what it offers and replace what we hold.+ *+ * Replaced wholesale, never merged. A tool a vendor withdrew has to stop being offered, and a+ * merge would leave it in the list forever as a name the model will happily call.+ */+ async refreshTools(serverId: string): Promise<{ tools: number }> {+ const { row } = await requireServer(serverId);++ try {+ const token = await tokenFor(row.credentialId);+ const tools = await listTools({ url: row.url, token });++ await database.delete(mcpTools).where(eq(mcpTools.serverId, serverId));+ if (tools.length > 0) {+ await database.insert(mcpTools).values(+ tools.map((tool) => ({+ serverId,+ name: tool.name,+ description: tool.description,+ inputSchema: tool.inputSchema,+ })),+ );+ }++ await database+ .update(mcpServers)+ .set({+ toolsRefreshedAt: new Date(),+ lastError: null,+ updatedAt: new Date(),+ })+ .where(eq(mcpServers.id, serverId));++ return { tools: tools.length };+ } catch (error) {+ const message =+ error instanceof McpServerError || error instanceof Error+ ? error.message+ : String(error);+ // The failure is recorded rather than thrown away, because a server with no tools and no+ // explanation reads as a server that offers nothing, and an operator would go looking in+ // the wrong place. The tools already held are left alone: a vendor being briefly+ // unreachable is not a reason to revoke what Bots are using.+ await database+ .update(mcpServers)+ .set({ lastError: message, updatedAt: new Date() })+ .where(eq(mcpServers.id, serverId));+ return { tools: 0 };+ }+ },++ async listServers(): Promise<ServerRecord[]> {+ const rows = await database+ .select()+ .from(mcpServers)+ .orderBy(asc(mcpServers.title));+ if (rows.length === 0) return [];++ const tools = await database+ .select()+ .from(mcpTools)+ .where(+ inArray(+ mcpTools.serverId,+ rows.map((row) => row.id),+ ),+ )+ .orderBy(asc(mcpTools.name));++ const grants = await grantsFor(+ "mcp",+ tools.map((tool) => `${tool.serverId}/${tool.name}`),+ );++ return rows.map((row) => {+ const entry = catalogueEntry(row.id);+ return {+ id: row.id,+ title: row.title,+ vendor: row.vendor,+ url: row.url,+ summary: entry?.summary ?? "",+ docsUrl: entry?.docsUrl ?? "",+ provenance: row.provenance,+ hasCredential: row.credentialId !== null,+ toolsRefreshedAt: iso(row.toolsRefreshedAt),+ lastError: row.lastError,+ addedBy: row.addedBy,+ tools: tools+ .filter((tool) => tool.serverId === row.id)+ .map((tool) => {+ const ref = `${tool.serverId}/${tool.name}`;+ return {+ serverId: tool.serverId,+ name: tool.name,+ description: tool.description,+ inputSchema: tool.inputSchema as Record<string, unknown>,+ ref,+ effect: classifyTool(entry, tool.name, true),+ grantedTo: grants.get(ref) ?? [],+ };+ }),+ };+ });+ },++ /**+ * The skills this person may see: the deployment's, plus their own.+ *+ * An administrator sees every skill in the deployment, including other people's, because+ * governing what Bots are told is the job of the surface they are looking at.+ */+ async listSkills(actor?: SkillActor): Promise<SkillRecord[]> {+ const visible =+ !actor || actor.isAdmin+ ? undefined+ : or(isNull(skills.ownerUserId), eq(skills.ownerUserId, actor.id));+ const rows = await database+ .select()+ .from(skills)+ .where(visible)+ .orderBy(asc(skills.title));+ const grants = await grantsFor(+ "skill",+ rows.map((row) => row.slug),+ );+ return rows.map((row) => ({+ id: row.id,+ slug: row.slug,+ ownerUserId: row.ownerUserId,+ title: row.title,+ summary: row.summary,+ instructions: row.instructions,+ origin: row.origin,+ installedBy: row.installedBy,+ grantedTo: grants.get(row.slug) ?? [],+ }));+ },++ /** Whose a skill is, or `undefined` if there is no such skill. Null owner means the deployment's. */+ async skillOwner(slug: string): Promise<string | null | undefined> {+ const [row] = await database+ .select({ ownerUserId: skills.ownerUserId })+ .from(skills)+ .where(eq(skills.slug, slug))+ .limit(1);+ return row ? row.ownerUserId : undefined;+ },++ /**+ * Whose a Bot is, or `undefined` if there is no such Bot.+ *+ * Read here rather than through the teammate store because the only question this file asks is+ * "may this person put their skill on that Bot", and a whole profile is more than that needs.+ */+ async agentOwner(agentId: string): Promise<string | null | undefined> {+ const [row] = await database+ .select({ ownerUserId: agentProfiles.ownerUserId })+ .from(agentProfiles)+ .where(eq(agentProfiles.agentId, agentId))+ .limit(1);+ return row ? row.ownerUserId : undefined;+ },++ async installSkill(input: {+ slug: string;+ title: string;+ summary: string;+ instructions: string;+ origin?: string;+ /** Whose it is. Null writes a skill for the whole deployment, which is an admin's to make. */+ ownerUserId: string | null;+ by: string;+ }): Promise<void> {+ await database+ .insert(skills)+ .values({+ id: input.slug,+ slug: input.slug,+ ownerUserId: input.ownerUserId,+ title: input.title,+ summary: input.summary,+ instructions: input.instructions,+ origin: input.origin ?? "yours",+ installedBy: input.by,+ })+ // Editing keeps the owner it already had. Whose a skill is, is not something a re-save+ // should quietly change, and the route has already checked this person may edit it.+ .onConflictDoUpdate({+ target: skills.slug,+ set: {+ title: input.title,+ summary: input.summary,+ instructions: input.instructions,+ updatedAt: new Date(),+ },+ });++ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: "skill",+ targetId: input.slug,+ payload: {+ actor: input.by,+ change: "skill_installed",+ skill: input.slug,+ },+ });+ },++ async uninstallSkill(slug: string, by: string): Promise<void> {+ await database.delete(skills).where(eq(skills.slug, slug));+ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: "skill",+ targetId: slug,+ payload: { actor: by, change: "skill_uninstalled", skill: slug },+ });+ },++ async grant(+ kind: PluginKind,+ ref: string,+ agentId: string,+ by: string,+ ): Promise<void> {+ await database+ .insert(pluginGrants)+ .values({ kind, ref, agentId, grantedBy: by })+ .onConflictDoUpdate({+ target: [pluginGrants.kind, pluginGrants.ref, pluginGrants.agentId],+ set: { grantedBy: by, updatedAt: new Date() },+ });++ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: kind === "mcp" ? "mcp_tool" : "skill",+ targetId: ref,+ payload: {+ actor: by,+ change: "plugin_granted",+ kind,+ ref,+ bot: agentId,+ },+ });+ },++ async revoke(+ kind: PluginKind,+ ref: string,+ agentId: string,+ by: string,+ ): Promise<void> {+ await database+ .delete(pluginGrants)+ .where(+ and(+ eq(pluginGrants.kind, kind),+ eq(pluginGrants.ref, ref),+ eq(pluginGrants.agentId, agentId),+ ),+ );++ await recordAuditEvent(auditStore, {+ eventType: "configuration.changed",+ targetType: kind === "mcp" ? "mcp_tool" : "skill",+ targetId: ref,+ payload: {+ actor: by,+ change: "plugin_revoked",+ kind,+ ref,+ bot: agentId,+ },+ });+ },++ /** Everything one Bot may use. The runtime asks this and offers exactly what comes back. */+ async listForAgent(agentId: string): Promise<GrantedPlugins> {+ const held = await database+ .select()+ .from(pluginGrants)+ .where(eq(pluginGrants.agentId, agentId));+ if (held.length === 0) return { tools: [], skills: [] };++ const toolRefs = held+ .filter((row) => row.kind === "mcp")+ .map((row) => row.ref);+ const skillSlugs = held+ .filter((row) => row.kind === "skill")+ .map((row) => row.ref);++ const toolRows =+ toolRefs.length === 0+ ? []+ : await database.select().from(mcpTools).orderBy(asc(mcpTools.name));+ const grantedTools = toolRows+ .filter((row) => toolRefs.includes(`${row.serverId}/${row.name}`))+ .map((row) => {+ const ref = `${row.serverId}/${row.name}`;+ return {+ ref,+ toolName: toolNameFor(ref),+ description: row.description,+ inputSchema: row.inputSchema as Record<string, unknown>,+ };+ });++ const skillRows =+ skillSlugs.length === 0+ ? []+ : await database+ .select()+ .from(skills)+ .where(inArray(skills.slug, skillSlugs));++ return {+ tools: grantedTools,+ skills: skillRows.map((row) => ({+ slug: row.slug,+ title: row.title,+ summary: row.summary,+ instructions: row.instructions,+ })),+ };+ },++ /**+ * May this Bot use this plugin?+ *+ * The single question every caller asks, so there is one place the answer is decided and one+ * place to audit it. A missing row is a refusal, not an oversight.+ */+ async decide(+ kind: PluginKind,+ ref: string,+ agentId: string,+ ): Promise<PluginDecision> {+ const [row] = await database+ .select()+ .from(pluginGrants)+ .where(+ and(+ eq(pluginGrants.kind, kind),+ eq(pluginGrants.ref, ref),+ eq(pluginGrants.agentId, agentId),+ ),+ )+ .limit(1);++ if (!row) {+ return {+ allowed: false,+ reason:+ kind === "mcp"+ ? `This Bot has not been given the tool ${ref}.`+ : `This Bot has not been given the skill ${ref}.`,+ };+ }+ return { allowed: true };+ },++ /**+ * Call a tool on somebody else's server, on a Bot's behalf.+ *+ * Decide, record, then act, which is the order the computer gateway uses and for the same+ * reason: a call that was permitted and then failed is exactly what an investigation needs to+ * see, and a trail written only on success cannot show it. The grant is checked first because a+ * tool this Bot was never given should not reach the policy engine, the vault or the network.+ */+ async callTool(input: {+ ref: string;+ args: Record<string, unknown>;+ botId: string;+ actorId: string;+ }): Promise<{ text: string; isError: boolean }> {+ const [serverId, ...rest] = input.ref.split("/");+ const toolName = rest.join("/");+ if (!serverId || !toolName) {+ throw new PluginRefusedError(`${input.ref} is not a tool.`, null);+ }++ const decision = await this.decide("mcp", input.ref, input.botId);+ if (!decision.allowed) {+ await recordAuditEvent(auditStore, {+ eventType: "mcp.call_rejected",+ targetType: "mcp_tool",+ targetId: input.ref,+ payload: {+ actor: input.actorId,+ bot: input.botId,+ server: serverId,+ tool: toolName,+ refusal: "not_granted",+ reason: decision.reason,+ },+ });+ throw new PluginRefusedError(decision.reason, null);+ }++ const { row, entry } = await requireServer(serverId);++ const advertised = await database+ .select({ name: mcpTools.name, inputSchema: mcpTools.inputSchema })+ .from(mcpTools)+ .where(+ and(eq(mcpTools.serverId, serverId), eq(mcpTools.name, toolName)),+ )+ .limit(1);++ const effect = classifyTool(entry, toolName, advertised.length > 0);++ const args = withoutEmptyOptionals(+ input.args,+ advertised[0]?.inputSchema as Record<string, unknown> | undefined,+ );++ /**+ * The same policy the computer actions are judged by, asked about a tool call.+ *+ * Every field is present, including the ones a tool call has no use for, and that is load+ * bearing rather than tidy. This engine treats an expression it cannot evaluate as a match,+ * which is correct for a browser action on an element the server could not resolve. Applied to+ * a tool call it is a disaster: the boundary this product ships in `.env.example` denies+ * `contains(element.name, "submit") || key == "Enter"`, and with `element` and `key` absent+ * that rule is unevaluable, so it would match, so every deployment using the shipped preset+ * would refuse every MCP call for a reason mentioning a submit button.+ *+ * Neutral values instead. Empty strings match no substring, no key and no extension, so a rule+ * written about the browser evaluates to false against a tool call, which is the honest answer:+ * a tool call did not click anything. A rule meant to catch tool calls says so, with `mcp` or+ * with `intent`.+ */+ const context: PolicyContext = {+ tool: { name: toolNameFor(input.ref) },+ bot: { id: input.botId },+ actor: { id: input.actorId },+ page: { url: "", host: "" },+ element: { ref: "", role: "", name: "", type: "" },+ key: "",+ file: { path: "", name: "", extension: "" },+ intent: effect === "write" ? "write_tool" : "read_tool",+ mcp: { server: serverId, tool: toolName, effect },+ };++ const verdict = evaluateActionPolicy(options.policy(), context);++ await recordAuditEvent(auditStore, {+ eventType: verdict.forward ? "mcp.call_succeeded" : "mcp.call_rejected",+ targetType: "mcp_tool",+ targetId: input.ref,+ payload: {+ actor: input.actorId,+ bot: input.botId,+ server: serverId,+ tool: toolName,+ effect,+ decision: {+ allowed: verdict.allowed,+ mode: verdict.mode,+ rule: verdict.matched,+ source: verdict.source,+ carriedOut: verdict.forward,+ },+ },+ });++ if (!verdict.forward) {+ throw new PluginRefusedError(verdict.reason, verdict.matched);+ }++ const token = await tokenFor(row.credentialId);+ const result = await callRemoteTool(+ { url: row.url, token },+ toolName,+ args,+ );+ return { text: result.text, isError: result.isError };+ },+ };+}++/**+ * Optional arguments the model filled in with an empty string, removed.+ *+ * A model handed a schema with many optional fields tends to fill them all, and where it has no+ * value it writes "". Vendors reject that: an empty string is not a channel id, not a timestamp and+ * not a cursor, so the call fails with a validation error that reads to the person as the tool being+ * broken.+ *+ * Only optional fields, and only empty strings. A required field left empty is the model getting it+ * wrong, and the vendor should say so rather than have us hide it. Anything other than "" is a value+ * the model meant, including false and 0.+ */+function withoutEmptyOptionals(+ args: Record<string, unknown>,+ schema: Record<string, unknown> | undefined,+): Record<string, unknown> {+ const required = new Set(+ Array.isArray(schema?.required) ? (schema.required as string[]) : [],+ );+ return Object.fromEntries(+ Object.entries(args).filter(+ ([key, value]) => required.has(key) || value !== "",+ ),+ );+}++export type PluginStore = ReturnType<typeof createPluginStore>;+export type { CatalogueEntry };diff --git a/server/src/tenant-package.ts b/server/src/tenant-package.tsnew file mode 100644index 00000000..2de9ee81--- /dev/null+++ b/server/src/tenant-package.ts@@ -0,0 +1,533 @@+import { createHash } from "node:crypto";+import { readFile } from "node:fs/promises";+import { join } from "node:path";+import { desc, eq, isNull } from "drizzle-orm";+import { parse } from "yaml";+import type { Database } from "./db/client";+import {+ agentProfiles,+ agents as agentTable,+ channelAgents,+ channels as channelTable,+ deploymentPackages,+} from "./db/schema";++const approvedThemeVariables = new Set([+ "--background",+ "--foreground",+ "--card",+ "--card-foreground",+ "--popover",+ "--popover-foreground",+ "--primary",+ "--primary-foreground",+ "--secondary",+ "--secondary-foreground",+ "--muted",+ "--muted-foreground",+ "--accent",+ "--accent-foreground",+ "--destructive",+ "--border",+ "--input",+ "--ring",+ "--chart-1",+ "--chart-2",+ "--chart-3",+ "--chart-4",+ "--chart-5",+ "--radius",+ "--sidebar",+ "--sidebar-foreground",+ "--sidebar-primary",+ "--sidebar-primary-foreground",+ "--sidebar-accent",+ "--sidebar-accent-foreground",+ "--sidebar-border",+ "--sidebar-ring",+]);++export function validateThemeCss(css: string) {+ if (/@import|url\s*\(/i.test(css)) {+ throw new Error("Tenant theme must not contain imports or URLs");+ }++ const blocks = [...css.matchAll(/(:root|\.dark)\s*\{([^{}]*)\}/g)];+ const remaining = css.replace(/(:root|\.dark)\s*\{[^{}]*\}/g, "").trim();+ if (!blocks.length || remaining) {+ throw new Error("Tenant theme may only define :root and .dark blocks");+ }++ for (const [, , body] of blocks) {+ for (const declaration of body.split(";")) {+ const trimmed = declaration.trim();+ if (!trimmed) {+ continue;+ }+ const separator = trimmed.indexOf(":");+ const variable = trimmed.slice(0, separator).trim();+ const value = trimmed.slice(separator + 1).trim();++ if (separator < 1 || !value || !approvedThemeVariables.has(variable)) {+ throw new Error(+ `Tenant theme variable ${variable || "(invalid)"} is not an approved theme variable`,+ );+ }+ }+ }+}++type PackageFiles = {+ brand: string;+ agents: string;+ channels: string;+ model: string;+ knowledge: string;+ themeCss: string;+};++type TenantAgent = {+ id: string;+ name: string;+ title: string;+ roleDescription: string;+ avatarSeed?: string;+ type: "built_in" | "remote_ag_ui";+ configuration: Record<string, unknown>;+};++type TenantChannel = {+ id: string;+ name: string;+ description: string;+ permittedAgents: string[];+ allowedGroups: string[];+};++export type TenantPackage = {+ tenantId: string;+ productName: string;+ stylesheet: string | null;+ agents: TenantAgent[];+ channels: TenantChannel[];+ model: {+ provider: "openai";+ credentialSecretRef: string;+ defaultModel: string;+ };+ knowledgeSources: {+ type: "google-drive" | "microsoft-onedrive";+ roots: string[];+ }[];+ themeCss: string;+};++export type LoadedTenantPackage = TenantPackage & {+ sourcePath: string;+ checksum: string;+};++export type PackageStatusReader = {+ active: () => Promise<{+ tenantId: string;+ sourcePath: string;+ checksum: string;+ loadedAt: string;+ } | null>;+};++export type ApplicationConfiguration = {+ brand: {+ tenantId: string;+ productName: string;+ };+ auth: { providers: string[] };+};++export function createApplicationConfiguration(+ tenantPackage: TenantPackage,+ providers: string[],+): ApplicationConfiguration {+ return {+ brand: {+ tenantId: tenantPackage.tenantId,+ productName: tenantPackage.productName,+ },+ auth: { providers },+ };+}++function asRecord(value: unknown, name: string): Record<string, unknown> {+ if (!value || typeof value !== "object" || Array.isArray(value)) {+ throw new Error(`${name} must be an object`);+ }+ return value as Record<string, unknown>;+}++/**+ * A list a package must supply, named in the error when it does not.+ *+ * Cast without checking, a missing `agents:` reaches `.map` on `undefined` and the reader gets a+ * TypeError naming neither the file nor the key. Editing YAML by hand is the first thing somebody+ * does here, so getting it wrong has to produce a sentence they can act on.+ */+function asList(value: unknown, name: string): unknown[] {+ if (!Array.isArray(value)) {+ throw new Error(`${name} must be a list`);+ }+ return value;+}++function requiredString(value: unknown, name: string): string {+ if (typeof value !== "string" || !value.trim()) {+ throw new Error(`${name} must be a non-empty string`);+ }+ return value;+}++function stringArray(value: unknown, name: string): string[] {+ if (!Array.isArray(value) || value.some((item) => typeof item !== "string")) {+ throw new Error(`${name} must be an array of strings`);+ }+ return value;+}++function yaml(value: string, filename: string): Record<string, unknown> {+ try {+ return asRecord(parse(value), filename);+ } catch (error) {+ throw new Error(+ `${filename} is invalid: ${error instanceof Error ? error.message : "unknown error"}`,+ );+ }+}++/**+ * `${NAME}` in a package file, resolved from the environment.+ *+ * A package describes a deployment's Bots, and the addresses of the services behind them belong to+ * the environment rather than to the package: the same package has to be usable against a local+ * stack, a staging one and production. An unset name is an error rather than an empty string.+ */+export function expandEnvironment(+ value: string,+ filename: string,+ environment: Record<string, string | undefined> = process.env,+): string {+ return value.replace(+ /\$\{([A-Za-z_][A-Za-z0-9_]*)(?::-([^}]*))?\}/g,+ (_, name: string, fallback: string | undefined) => {+ const resolved = environment[name];+ if (resolved !== undefined && resolved !== "") return resolved;+ if (fallback !== undefined) return fallback;+ throw new Error(+ `${filename} refers to \${${name}}, which is not set in this environment.`,+ );+ },+ );+}++export function validateTenantPackage(files: PackageFiles): TenantPackage {+ if (files.themeCss.trim()) {+ validateThemeCss(files.themeCss);+ }+ const brand = yaml(files.brand, "brand.yaml");+ const agentsYaml = yaml(files.agents, "agents.yaml");+ const channelsYaml = yaml(files.channels, "channels.yaml");+ const modelYaml = yaml(files.model, "model.yaml");+ const knowledgeYaml = yaml(files.knowledge, "knowledge.yaml");+ const tenant = asRecord(brand.tenant, "brand.tenant");+ const skin =+ brand.skin === undefined ? undefined : asRecord(brand.skin, "brand.skin");+ const agents = asList(agentsYaml.agents, "agents.yaml agents").map(+ (value) => {+ const agent = asRecord(value, "agent");+ const type: TenantAgent["type"] | undefined =+ agent.type === "built-in"+ ? "built_in"+ : agent.type === "remote-ag-ui"+ ? "remote_ag_ui"+ : undefined;+ if (!type) {+ throw new Error("agent.type must be built-in or remote-ag-ui");+ }+ return {+ id: requiredString(agent.id, "agent.id"),+ name: requiredString(agent.name, "agent.name"),+ title: requiredString(agent.title, "agent.title"),+ roleDescription: requiredString(+ agent.role_description,+ "agent.role_description",+ ),+ avatarSeed:+ agent.avatar_seed === undefined+ ? undefined+ : requiredString(agent.avatar_seed, "agent.avatar_seed"),+ type,+ configuration:+ type === "built_in"+ ? {+ systemPrompt: requiredString(+ agent.system_prompt,+ "agent.system_prompt",+ ),+ }+ : { endpoint: requiredString(agent.endpoint, "agent.endpoint") },+ };+ },+ );+ const agentIds = new Set(agents.map((agent) => agent.id));+ const channels = asList(channelsYaml.channels, "channels.yaml channels").map(+ (value) => {+ const channel = asRecord(value, "channel");+ const permittedAgents = stringArray(+ channel.permitted_agents,+ "channel.permitted_agents",+ );+ for (const agentId of permittedAgents) {+ if (!agentIds.has(agentId)) {+ throw new Error(`channel references unknown agent "${agentId}"`);+ }+ }+ return {+ id: requiredString(channel.id, "channel.id"),+ name: requiredString(channel.name, "channel.name"),+ description: requiredString(channel.description, "channel.description"),+ permittedAgents,+ allowedGroups: stringArray(+ channel.allowed_groups,+ "channel.allowed_groups",+ ),+ };+ },+ );+ const model = asRecord(modelYaml.model, "model");+ if (model.provider !== "openai") {+ throw new Error("model.provider must be openai");+ }+ const sources = asList(knowledgeYaml.sources, "knowledge.yaml sources").map(+ (value) => {+ const source = asRecord(value, "knowledge source");+ if (+ source.type !== "google-drive" &&+ source.type !== "microsoft-onedrive"+ ) {+ throw new Error("knowledge source type is not supported");+ }+ return {+ type: source.type,+ roots: stringArray(source.roots, "source.roots"),+ } as { type: "google-drive" | "microsoft-onedrive"; roots: string[] };+ },+ );++ return {+ tenantId: requiredString(tenant.id, "tenant.id"),+ productName: requiredString(tenant.product_name, "tenant.product_name"),+ stylesheet: skin+ ? requiredString(skin.stylesheet, "skin.stylesheet")+ : null,+ agents,+ channels,+ model: {+ provider: "openai",+ credentialSecretRef: requiredString(+ model.credential_secret_ref,+ "model.credential_secret_ref",+ ),+ defaultModel: requiredString(model.default_model, "model.default_model"),+ },+ knowledgeSources: sources,+ themeCss: files.themeCss,+ };+}++export async function loadTenantPackage(+ sourcePath: string,+): Promise<LoadedTenantPackage> {+ const filenames = [+ "brand.yaml",+ "agents.yaml",+ "channels.yaml",+ "model.yaml",+ "knowledge.yaml",+ ] as const;+ const contents = await Promise.all(+ filenames.map(async (filename) =>+ expandEnvironment(+ await readFile(join(sourcePath, filename), "utf8"),+ filename,+ ),+ ),+ );+ const [brand, agents, channels, model, knowledge] = contents;+ const themeCss = await readFile(join(sourcePath, "theme.css"), "utf8").catch(+ (error: NodeJS.ErrnoException) => {+ if (error.code === "ENOENT") return "";+ throw error;+ },+ );+ const tenantPackage = validateTenantPackage({+ brand,+ agents,+ channels,+ model,+ knowledge,+ themeCss,+ });++ return {+ ...tenantPackage,+ sourcePath,+ checksum: createHash("sha256").update(contents.join("\n")).digest("hex"),+ };+}++export async function synchronizeTenantPackage(+ database: Database,+ tenantPackage: LoadedTenantPackage,+) {+ return database.transaction(async (transaction) => {+ const [deploymentPackage] = await transaction+ .insert(deploymentPackages)+ .values({+ tenantId: tenantPackage.tenantId,+ sourcePath: tenantPackage.sourcePath,+ checksum: tenantPackage.checksum,+ })+ .onConflictDoUpdate({+ target: deploymentPackages.tenantId,+ set: {+ sourcePath: tenantPackage.sourcePath,+ checksum: tenantPackage.checksum,+ loadedAt: new Date(),+ },+ })+ .returning();++ if (!deploymentPackage) {+ throw new Error("Tenant package could not be synchronized");+ }++ for (const agent of tenantPackage.agents) {+ const updatedAt = new Date();+ const [canonicalAgent] = await transaction+ .insert(agentTable)+ .values({+ id: agent.id,+ name: agent.name,+ type: agent.type,+ configuration: agent.configuration,+ packageId: deploymentPackage.id,+ })+ .onConflictDoUpdate({+ target: agentTable.id,+ setWhere: eq(agentTable.packageId, deploymentPackage.id),+ set: {+ name: agent.name,+ type: agent.type,+ configuration: agent.configuration,+ packageId: deploymentPackage.id,+ updatedAt,+ },+ })+ .returning({ id: agentTable.id });++ if (!canonicalAgent) {+ throw new Error(+ `Tenant package agent "${agent.id}" collides with a user-created agent`,+ );+ }++ const [profile] = await transaction+ .insert(agentProfiles)+ .values({+ agentId: canonicalAgent.id,+ ownerUserId: null,+ title: agent.title,+ roleDescription: agent.roleDescription,+ avatarSeed: agent.avatarSeed ?? canonicalAgent.id,+ visibility: "public",+ deletedAt: null,+ updatedAt,+ })+ .onConflictDoUpdate({+ target: agentProfiles.agentId,+ setWhere: isNull(agentProfiles.ownerUserId),+ set: {+ ownerUserId: null,+ title: agent.title,+ roleDescription: agent.roleDescription,+ avatarSeed: agent.avatarSeed ?? canonicalAgent.id,+ visibility: "public",+ deletedAt: null,+ updatedAt,+ },+ })+ .returning({ agentId: agentProfiles.agentId });++ if (!profile) {+ throw new Error(+ `Tenant package agent "${agent.id}" collides with a user-owned profile`,+ );+ }+ }++ for (const channel of tenantPackage.channels) {+ await transaction+ .insert(channelTable)+ .values({+ id: channel.id,+ name: channel.name,+ description: channel.description,+ allowedGroups: channel.allowedGroups,+ packageId: deploymentPackage.id,+ })+ .onConflictDoUpdate({+ target: channelTable.id,+ set: {+ name: channel.name,+ description: channel.description,+ allowedGroups: channel.allowedGroups,+ packageId: deploymentPackage.id,+ updatedAt: new Date(),+ },+ });+ await transaction+ .delete(channelAgents)+ .where(eq(channelAgents.channelId, channel.id));+ if (channel.permittedAgents.length) {+ await transaction.insert(channelAgents).values(+ channel.permittedAgents.map((agentId) => ({+ channelId: channel.id,+ agentId,+ })),+ );+ }+ }++ return deploymentPackage;+ });+}++export function createPackageStatusReader(+ database: Database,+): PackageStatusReader {+ return {+ active: async () => {+ const [tenantPackage] = await database+ .select()+ .from(deploymentPackages)+ .orderBy(desc(deploymentPackages.loadedAt))+ .limit(1);+ return tenantPackage+ ? {+ tenantId: tenantPackage.tenantId,+ sourcePath: tenantPackage.sourcePath,+ checksum: tenantPackage.checksum,+ loadedAt: tenantPackage.loadedAt.toISOString(),+ }+ : null;+ },+ };+}diff --git a/server/tests/agent-endpoint.test.ts b/server/tests/agent-endpoint.test.tsnew file mode 100644index 00000000..9072dd67--- /dev/null+++ b/server/tests/agent-endpoint.test.ts@@ -0,0 +1,308 @@+import { describe, expect, test } from "bun:test";+import { agentAuthHeaders, storeAgentAuth } from "../src/agents/auth-header";+import { testAgentConnection } from "../src/agents/connection-test";+import { checkAgentEndpoint } from "../src/agents/endpoint";+import { parseAgentInput } from "../src/agents/routes";++/** A 32-byte key, as the vault expects. */+const TEST_KEY = Buffer.alloc(32, 7).toString("base64");++/**+ * Registering an external agent, tested as the security surface it is.+ *+ * The endpoint is a URL a user chooses and this server then POSTs to on every run. The failure mode+ * is an ordering one: if the private-host escape hatch is consulted before the deny-list, the cloud+ * metadata address becomes reachable under the configuration developers actually run. So these tests+ * run with the escape hatch both ways. A deny-list only ever tested with the hatch off proves nothing+ * about the configuration that matters.+ */++describe("what may be registered as an agent", () => {+ test("an ordinary https endpoint is allowed", () => {+ const verdict = checkAgentEndpoint("https://agents.example.com/ag-ui");+ expect(verdict).toEqual({+ allowed: true,+ url: "https://agents.example.com/ag-ui",+ });+ });++ test("cloud metadata is refused even with private hosts allowed", () => {+ // On a laptop `allowPrivateHosts` is on, which is exactly the configuration where an ordering+ // mistake survives.+ for (const allowPrivateHosts of [false, true]) {+ const verdict = checkAgentEndpoint(+ "http://169.254.169.254/latest/meta-data/",+ {+ allowPrivateHosts,+ },+ );+ expect(verdict.allowed).toBe(false);+ }+ });++ test("a private address is refused when private hosts are not allowed", () => {+ const verdict = checkAgentEndpoint("http://10.0.0.5:4200/ag-ui");+ expect(verdict.allowed).toBe(false);+ if (!verdict.allowed) expect(verdict.reason).toContain("network");+ });++ test("localhost is allowed only where the deployment opted in", () => {+ // A developer's own agent lives here, and a hosted deployment must refuse it.+ expect(+ checkAgentEndpoint("http://localhost:4200/ag-ui", {+ allowPrivateHosts: true,+ }).allowed,+ ).toBe(true);+ expect(checkAgentEndpoint("http://localhost:4200/ag-ui").allowed).toBe(+ false,+ );+ });++ test("non-web schemes are refused", () => {+ // `file:` would read the server's disk; `javascript:` is nonsense that should not reach storage.+ for (const raw of [+ "file:///etc/passwd",+ "javascript:alert(1)",+ "ftp://x/y",+ ]) {+ expect(checkAgentEndpoint(raw).allowed).toBe(false);+ }+ });++ test("junk is refused rather than stored", () => {+ for (const raw of ["", " ", "not a url", null, undefined, 42, {}]) {+ expect(checkAgentEndpoint(raw).allowed).toBe(false);+ }+ });+});++describe("the agent form", () => {+ const base = {+ name: "Sales Bot",+ title: "Sales",+ roleDescription: "Answers questions about pricing.",+ visibility: "private",+ };++ test("an agent with no endpoint is valid, and runs on the Bot in the box", () => {+ const parsed = parseAgentInput(base);+ expect(parsed.ok).toBe(true);+ if (parsed.ok) expect(parsed.value.endpoint).toBeUndefined();+ });++ test("an endpoint is carried through when it is allowed", () => {+ const parsed = parseAgentInput(+ { ...base, endpoint: "https://agents.example.com/ag-ui" },+ false,+ );+ expect(parsed.ok).toBe(true);+ if (parsed.ok)+ expect(parsed.value.endpoint).toBe("https://agents.example.com/ag-ui");+ });++ test("a refused endpoint fails the whole form rather than being dropped", () => {+ // Ignoring it would create a Bot that appears external but uses the built-in agent.+ const parsed = parseAgentInput(+ { ...base, endpoint: "http://169.254.169.254/" },+ true,+ );+ expect(parsed.ok).toBe(false);+ });++ test("an empty endpoint means the default, not an error", () => {+ // What a form sends when somebody clears the field.+ const parsed = parseAgentInput({ ...base, endpoint: "" });+ expect(parsed.ok).toBe(true);+ if (parsed.ok) expect(parsed.value.endpoint).toBeUndefined();+ });+});++describe("the connection test", () => {+ const endpoint = "https://agents.example.com/ag-ui";++ test("an AG-UI stream is reported as working, with what came back", async () => {+ const result = await testAgentConnection(endpoint, {+ fetchImpl: async () =>+ new Response(+ 'data: {"type":"RUN_STARTED"}\n\ndata: {"type":"TEXT_MESSAGE_CONTENT","delta":"hi"}\n\ndata: {"type":"RUN_FINISHED"}\n\n',+ { status: 200, headers: { "content-type": "text/event-stream" } },+ ),+ });+ expect(result.ok).toBe(true);+ if (result.ok) expect(result.events).toContain("RUN_STARTED");+ });++ test("a reachable address that is not an agent says so, and says what it sent", async () => {+ // The most common mistake: pointing at the app's home page instead of its AG-UI path.+ const result = await testAgentConnection(endpoint, {+ fetchImpl: async () =>+ new Response("<!doctype html><html><body>hello</body></html>", {+ status: 200,+ headers: { "content-type": "text/html" },+ }),+ });+ expect(result.ok).toBe(false);+ if (!result.ok) expect(result.reason).toContain("text/html");+ });++ test("an authentication failure suggests the fix rather than the status code", async () => {+ const result = await testAgentConnection(endpoint, {+ fetchImpl: async () => new Response("no", { status: 401 }),+ });+ expect(result.ok).toBe(false);+ if (!result.ok) {+ expect(result.status).toBe(401);+ expect(result.reason).toContain("key");+ }+ });++ test("an unreachable address explains the direction of the connection", async () => {+ // The server dials the agent, so the failure message names that direction.+ const result = await testAgentConnection(endpoint, {+ fetchImpl: async () => {+ throw new Error("connection refused");+ },+ });+ expect(result.ok).toBe(false);+ if (!result.ok) expect(result.reason).toContain("reachable from");+ });++ test("the test refuses the addresses registration would refuse", async () => {+ // Otherwise the button is a way to probe the internal network from a form.+ let called = false;+ const result = await testAgentConnection("http://169.254.169.254/", {+ allowPrivateHosts: true,+ fetchImpl: async () => {+ called = true;+ return new Response("", { status: 200 });+ },+ });+ expect(result.ok).toBe(false);+ expect(called).toBe(false);+ });++ test("headers are sent, so an agent behind a key can be tested", async () => {+ let seen: string | null = null;+ await testAgentConnection(endpoint, {+ headers: { authorization: "Bearer abc123" },+ fetchImpl: async (_url, init) => {+ seen = (init?.headers as Record<string, string>)?.authorization ?? null;+ return new Response('data: {"type":"RUN_STARTED"}\n\n', {+ status: 200,+ headers: { "content-type": "text/event-stream" },+ });+ },+ });+ expect(seen).toBe("Bearer abc123");+ });+});++describe("the key a customer's agent sits behind", () => {+ const vaultRow = {+ id: "cred-1",+ kind: "agent" as const,+ provider: "ag-ui",+ keyId: "agent-1",+ metadata: { header: "Authorization" },+ encryptedValue: "",+ revokedAt: null as Date | null,+ createdAt: new Date(),+ updatedAt: new Date(),+ };++ test("it goes to the vault, and only a reference comes back", async () => {+ // The value must never be stored on the agent row: everything that can read an agent could then+ // read the key, and revoking it would mean editing the agent.+ let stored: { kind: string; keyId: string } | null = null;+ const auth = await storeAgentAuth({+ store: {+ create: async (value) => {+ stored = { kind: value.kind, keyId: value.keyId };+ return { ...vaultRow, encryptedValue: value.encryptedValue };+ },+ revoke: async () => new Date(),+ } as never,+ encryptionKey: TEST_KEY,+ agentId: "agent-1",+ header: "Authorization",+ value: "Bearer hunter2",+ });++ expect(stored).toEqual({ kind: "agent", keyId: "agent-1" });+ expect(auth).toEqual({ header: "Authorization", credentialId: "cred-1" });+ // The reference is all that touches the agent, and it carries no secret.+ expect(JSON.stringify(auth)).not.toContain("hunter2");+ });++ test("the value is encrypted at rest, not stored in the clear", async () => {+ let written = "";+ await storeAgentAuth({+ store: {+ create: async (value) => {+ written = value.encryptedValue;+ return vaultRow as never;+ },+ revoke: async () => new Date(),+ } as never,+ encryptionKey: TEST_KEY,+ agentId: "agent-1",+ header: "Authorization",+ value: "Bearer hunter2",+ });+ expect(written).not.toContain("hunter2");+ expect(written.length).toBeGreaterThan(0);+ });++ test("a revoked key sends nothing rather than falling back to no auth silently", async () => {+ // The run then fails at the agent with its own 401, which is the truthful outcome. Substituting+ // no auth would turn a revoked key into a confusing agent error with no mention of the key.+ const headers = await agentAuthHeaders({+ reader: {+ readSecret: async () => ({+ encryptedValue: "whatever",+ revokedAt: new Date(),+ }),+ },+ encryptionKey: TEST_KEY,+ auth: { header: "Authorization", credentialId: "cred-1" },+ });+ expect(headers).toBeUndefined();+ });++ test("an agent with no key sends no headers at all", async () => {+ expect(+ await agentAuthHeaders({+ reader: { readSecret: async () => null },+ encryptionKey: TEST_KEY,+ auth: null,+ }),+ ).toBeUndefined();+ });++ test("the form refuses a header name that is not a header name", () => {+ const base = {+ name: "Sales Bot",+ title: "Sales",+ roleDescription: "Answers questions about pricing.",+ visibility: "private",+ };+ // A newline here would let somebody inject a second header into every request this server makes.+ const parsed = parseAgentInput({+ ...base,+ auth: { header: "X-Bad\nInjected: yes", value: "abc" },+ });+ expect(parsed.ok).toBe(false);+ });++ test("an empty key is not a key, so saving an edit does not wipe one", () => {+ const parsed = parseAgentInput({+ name: "Sales Bot",+ title: "Sales",+ roleDescription: "Answers questions about pricing.",+ visibility: "private",+ auth: { header: "Authorization", value: " " },+ });+ expect(parsed.ok).toBe(true);+ if (parsed.ok) expect(parsed.value.auth).toBeUndefined();+ });+});diff --git a/server/tests/agent-profile-store.integration.test.ts b/server/tests/agent-profile-store.integration.test.tsnew file mode 100644index 00000000..704de6cf--- /dev/null+++ b/server/tests/agent-profile-store.integration.test.ts@@ -0,0 +1,657 @@+import { afterAll, afterEach, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { and, eq, sql } from "drizzle-orm";+import {+ AgentNotFoundError,+ AgentNotManageableError,+ type AgentProfileStore,+ createAgentProfileStore,+ ProtectedAgentError,+} from "../src/agents/profile-store";+import type {+ AgentActor,+ AgentProfile,+ CreateAgentInput,+} from "../src/agents/profile-types";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import {+ agentPreferences,+ agentProfiles,+ agents,+ channelAgents,+ channels,+ deploymentPackages,+ intelligenceChannelMappings,+ users,+} from "../src/db/schema";++const databaseUrl =+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot";+const database = createDatabase(databaseUrl, TEST_POOL);+const managedAgentAgUiUrl = new URL("https://managed.example.test/ag-ui");+const store: AgentProfileStore = createAgentProfileStore(+ database,+ managedAgentAgUiUrl,+);+const testPrefix = `agent-profile-store-${randomUUID()}`;+const createdUserIds: string[] = [];+const createdAgentIds: string[] = [];+const createdChannelIds: string[] = [];+const createdPackageIds: string[] = [];++afterEach(async () => {+ for (const channelId of createdChannelIds.splice(0)) {+ await database.delete(channels).where(eq(channels.id, channelId));+ }+ for (const agentId of createdAgentIds.splice(0)) {+ await database.delete(agents).where(eq(agents.id, agentId));+ }+ for (const packageId of createdPackageIds.splice(0)) {+ await database+ .delete(deploymentPackages)+ .where(eq(deploymentPackages.id, packageId));+ }+ for (const userId of createdUserIds.splice(0)) {+ await database.delete(users).where(eq(users.id, userId));+ }+});++afterAll(async () => {+ await database.$client.close();+});++function id(kind: string) {+ return `${testPrefix}-${kind}-${randomUUID()}`;+}++async function createUser(role: AgentActor["role"] = "user") {+ const userId = id("user");+ await database.insert(users).values({+ id: userId,+ email: `${userId}@example.test`,+ name: "Profile Store Test User",+ });+ createdUserIds.push(userId);+ return { id: userId, role } satisfies AgentActor;+}++async function createPackage() {+ const [deploymentPackage] = await database+ .insert(deploymentPackages)+ .values({+ tenantId: id("tenant"),+ sourcePath: "test/profile-store",+ checksum: randomUUID(),+ })+ .returning();+ if (!deploymentPackage) throw new Error("Expected deployment package.");+ createdPackageIds.push(deploymentPackage.id);+ return deploymentPackage;+}++async function createProfileFixture(options: {+ owner: AgentActor | null;+ visibility?: "public" | "private";+ packageId?: string;+ name?: string;+ title?: string;+ roleDescription?: string;+ avatarSeed?: string;+ configuration?: Record<string, unknown>;+}) {+ const agentId = id("seed-agent");+ const name = options.name ?? `Seed ${randomUUID()}`;+ const title = options.title ?? "Seed Assistant";+ const roleDescription = options.roleDescription ?? "Helps test profiles.";+ const avatarSeed = options.avatarSeed ?? `avatar-${randomUUID()}`;+ await database.insert(agents).values({+ id: agentId,+ name,+ type: "remote_ag_ui",+ configuration: options.configuration ?? {+ endpoint: "https://seed.example.test/ag-ui",+ },+ packageId: options.packageId,+ });+ createdAgentIds.push(agentId);+ await database.insert(agentProfiles).values({+ agentId,+ ownerUserId: options.owner?.id ?? null,+ title,+ roleDescription,+ avatarSeed,+ visibility: options.visibility ?? "private",+ });+ return { agentId, name, title, roleDescription, avatarSeed };+}++async function profileById(actor: AgentActor, agentId: string) {+ const profile = await store.get(actor, agentId);+ if (!profile) throw new Error(`Expected visible profile ${agentId}.`);+ return profile;+}++function expectListed(+ profiles: AgentProfile[],+ agentId: string,+ expected: boolean,+) {+ expect(profiles.some((profile) => profile.id === agentId)).toBe(expected);+}++function deferred() {+ let resolve!: () => void;+ let reject!: (reason?: unknown) => void;+ const promise = new Promise<void>((resolvePromise, rejectPromise) => {+ resolve = resolvePromise;+ reject = rejectPromise;+ });+ return { promise, reject, resolve };+}++async function waitForMutationBlock(+ applicationName: string,+ mutationSettled: () => boolean,+) {+ const deadline = Date.now() + 3_000;+ while (Date.now() < deadline) {+ const blockedSessions = await database.execute(sql`+ SELECT pid+ FROM pg_stat_activity+ WHERE application_name = ${applicationName}+ AND cardinality(pg_blocking_pids(pid)) > 0+ LIMIT 1+ `);+ if (blockedSessions.length > 0) return true;+ if (mutationSettled()) return false;+ }+ throw new Error(`Timed out observing blocked session ${applicationName}.`);+}++async function racePackageAttachment(+ agentId: string,+ packageId: string,+ mutate: (namedStore: AgentProfileStore) => Promise<unknown>,+) {+ const applicationName = `profile_store_lock_${randomUUID()}`;+ const namedDatabaseUrl = new URL(databaseUrl);+ namedDatabaseUrl.searchParams.set("application_name", applicationName);+ const namedDatabase = createDatabase(namedDatabaseUrl.toString(), TEST_POOL);+ const namedStore = createAgentProfileStore(+ namedDatabase,+ managedAgentAgUiUrl,+ );+ const writeAcquired = deferred();+ const releaseAttachment = deferred();+ const attachment = database.transaction(async (transaction) => {+ await transaction+ .update(agents)+ .set({ packageId })+ .where(eq(agents.id, agentId));+ writeAcquired.resolve();+ await releaseAttachment.promise;+ });+ void attachment.catch(writeAcquired.reject);++ try {+ await writeAcquired.promise;+ let settled = false;+ const outcomePromise = mutate(namedStore).then(+ (value) => {+ settled = true;+ return { status: "fulfilled", value } as const;+ },+ (reason: unknown) => {+ settled = true;+ return { reason, status: "rejected" } as const;+ },+ );+ const blocked = await waitForMutationBlock(applicationName, () => settled);+ releaseAttachment.resolve();+ await attachment;+ return { blocked, outcome: await outcomePromise };+ } finally {+ releaseAttachment.resolve();+ await attachment.catch(() => undefined);+ await namedDatabase.$client.close();+ }+}++describe("agent profile store integration", () => {+ test("lets an owner and admin get and list a private profile but hides it from another user", async () => {+ const owner = await createUser();+ const other = await createUser();+ const admin = await createUser("admin");+ const source = await createProfileFixture({ owner, visibility: "private" });++ expect((await profileById(owner, source.agentId)).id).toBe(source.agentId);+ expect((await profileById(admin, source.agentId)).id).toBe(source.agentId);+ expect(await store.get(other, source.agentId)).toBeNull();+ expectListed(await store.list(owner), source.agentId, true);+ expectListed(await store.list(admin), source.agentId, true);+ expectListed(await store.list(other), source.agentId, false);+ });++ test("stores hiding per user and moves the caller between default and hidden lists", async () => {+ const owner = await createUser();+ const other = await createUser();+ const source = await createProfileFixture({ owner, visibility: "public" });++ expectListed(await store.list(owner), source.agentId, true);+ expectListed(await store.list(owner, true), source.agentId, false);+ expectListed(await store.list(other), source.agentId, true);++ await store.setHidden(owner, source.agentId, true);+ expectListed(await store.list(owner), source.agentId, false);+ expectListed(await store.list(owner, true), source.agentId, true);+ expectListed(await store.list(other), source.agentId, true);+ expectListed(await store.list(other, true), source.agentId, false);++ await store.setHidden(owner, source.agentId, false);+ expectListed(await store.list(owner), source.agentId, true);+ expectListed(await store.list(owner, true), source.agentId, false);+ const [preference] = await database+ .select()+ .from(agentPreferences)+ .where(+ and(+ eq(agentPreferences.userId, owner.id),+ eq(agentPreferences.agentId, source.agentId),+ ),+ );+ expect(preference?.hiddenAt).toBeNull();+ });++ test("takes the endpoint and ignores every field a caller must not set", async () => {+ const owner = await createUser();+ const deploymentPackage = await createPackage();+ const source = await createProfileFixture({+ owner,+ visibility: "private",+ configuration: { endpoint: "https://preserved.example.test/ag-ui" },+ });+ const oldTimestamp = new Date("2000-01-01T00:00:00.000Z");+ await database+ .update(agents)+ .set({ updatedAt: oldTimestamp })+ .where(eq(agents.id, source.agentId));+ await database+ .update(agentProfiles)+ .set({ updatedAt: oldTimestamp })+ .where(eq(agentProfiles.agentId, source.agentId));++ const result = await store.update(owner, source.agentId, {+ name: "Renamed Assistant",+ title: "Updated Title",+ roleDescription: "Updated role description.",+ visibility: "public",+ id: "forged-id",+ // The endpoint IS editable, and is the one field in this hostile payload that lands. A service+ // moves host, and the alternative is deleting the teammate and losing its conversations. It+ // reaches here already validated by the same check that guards creation.+ endpoint: "https://moved.example.test/ag-ui",+ ownerUserId: "forged-owner",+ avatarSeed: "forged-avatar",+ packageId: deploymentPackage.id,+ deletedAt: new Date(),+ } as unknown as CreateAgentInput);++ expect(result).toMatchObject({+ id: source.agentId,+ name: "Renamed Assistant",+ title: "Updated Title",+ roleDescription: "Updated role description.",+ visibility: "public",+ ownerUserId: owner.id,+ avatarSeed: source.avatarSeed,+ systemOwned: false,+ deletedAt: null,+ });+ const [canonical] = await database+ .select()+ .from(agents)+ .where(eq(agents.id, source.agentId));+ const [profile] = await database+ .select()+ .from(agentProfiles)+ .where(eq(agentProfiles.agentId, source.agentId));+ expect(canonical).toMatchObject({+ id: source.agentId,+ name: "Renamed Assistant",+ type: "remote_ag_ui",+ configuration: { endpoint: "https://moved.example.test/ag-ui" },+ packageId: null,+ });+ expect(profile).toMatchObject({+ ownerUserId: owner.id,+ title: "Updated Title",+ roleDescription: "Updated role description.",+ avatarSeed: source.avatarSeed,+ visibility: "public",+ deletedAt: null,+ });+ expect(canonical?.updatedAt.getTime()).toBeGreaterThan(+ oldTimestamp.getTime(),+ );+ expect(profile?.updatedAt.getTime()).toBeGreaterThan(+ oldTimestamp.getTime(),+ );+ });++ test("rejects public non-owner mutation as unmanageable and inaccessible private mutation as absent", async () => {+ const owner = await createUser();+ const other = await createUser();+ const publicSource = await createProfileFixture({+ owner,+ visibility: "public",+ });+ const privateSource = await createProfileFixture({+ owner,+ visibility: "private",+ });+ const input: CreateAgentInput = {+ name: "Other Name",+ title: "Other Title",+ roleDescription: "Other role.",+ visibility: "public",+ };++ await expect(+ store.update(other, publicSource.agentId, input),+ ).rejects.toBeInstanceOf(AgentNotManageableError);+ await store.setHidden(other, publicSource.agentId, true);+ expectListed(await store.list(other), publicSource.agentId, false);+ expectListed(await store.list(other, true), publicSource.agentId, true);+ await expect(+ store.update(other, privateSource.agentId, input),+ ).rejects.toBeInstanceOf(AgentNotFoundError);+ await expect(+ store.setHidden(other, privateSource.agentId, true),+ ).rejects.toBeInstanceOf(AgentNotFoundError);+ });++ test("rejects update and soft delete for a package-backed profile", async () => {+ const owner = await createUser();+ const deploymentPackage = await createPackage();+ const source = await createProfileFixture({+ owner,+ packageId: deploymentPackage.id,+ });+ const input: CreateAgentInput = {+ name: "Protected Rename",+ title: "Protected Title",+ roleDescription: "Protected role.",+ visibility: "public",+ };++ const profile = await profileById(owner, source.agentId);+ expect(profile.systemOwned).toBe(true);+ await expect(+ store.update(owner, source.agentId, input),+ ).rejects.toBeInstanceOf(ProtectedAgentError);+ await expect(+ store.softDelete(owner, source.agentId),+ ).rejects.toBeInstanceOf(ProtectedAgentError);+ });++ test("serializes update authorization against concurrent package attachment", async () => {+ const owner = await createUser();+ const deploymentPackage = await createPackage();+ const source = await createProfileFixture({+ owner,+ name: "Original Name",+ title: "Original Title",+ roleDescription: "Original role.",+ });++ const { blocked, outcome } = await racePackageAttachment(+ source.agentId,+ deploymentPackage.id,+ (namedStore) =>+ namedStore.update(owner, source.agentId, {+ name: "Racing Rename",+ title: "Racing Title",+ roleDescription: "Racing role.",+ visibility: "public",+ }),+ );++ expect(outcome.status).toBe("rejected");+ expect(blocked).toBe(true);+ if (outcome.status === "rejected") {+ expect(outcome.reason).toBeInstanceOf(ProtectedAgentError);+ }+ const [canonical] = await database+ .select()+ .from(agents)+ .where(eq(agents.id, source.agentId));+ const [profile] = await database+ .select()+ .from(agentProfiles)+ .where(eq(agentProfiles.agentId, source.agentId));+ expect(canonical?.name).toBe(source.name);+ expect(canonical?.packageId).toBe(deploymentPackage.id);+ expect(profile).toMatchObject({+ deletedAt: null,+ roleDescription: source.roleDescription,+ title: source.title,+ visibility: "private",+ });+ });++ test("serializes soft-delete authorization against concurrent package attachment", async () => {+ const owner = await createUser();+ const deploymentPackage = await createPackage();+ const source = await createProfileFixture({ owner });++ const { blocked, outcome } = await racePackageAttachment(+ source.agentId,+ deploymentPackage.id,+ (namedStore) => namedStore.softDelete(owner, source.agentId),+ );++ expect(outcome.status).toBe("rejected");+ expect(blocked).toBe(true);+ if (outcome.status === "rejected") {+ expect(outcome.reason).toBeInstanceOf(ProtectedAgentError);+ }+ const [canonical] = await database+ .select()+ .from(agents)+ .where(eq(agents.id, source.agentId));+ const [profile] = await database+ .select()+ .from(agentProfiles)+ .where(eq(agentProfiles.agentId, source.agentId));+ expect(canonical?.packageId).toBe(deploymentPackage.id);+ expect(profile?.deletedAt).toBeNull();+ });++ test("allows an admin to update and soft delete a user-owned profile", async () => {+ const owner = await createUser();+ const admin = await createUser("admin");+ const source = await createProfileFixture({ owner });++ const updated = await store.update(admin, source.agentId, {+ name: "Admin Rename",+ title: "Admin Title",+ roleDescription: "Admin role update.",+ visibility: "private",+ });+ expect(updated).toMatchObject({+ name: "Admin Rename",+ ownerUserId: owner.id,+ title: "Admin Title",+ });++ await store.softDelete(admin, source.agentId);+ expect(await store.get(admin, source.agentId)).toBeNull();+ });++ test("duplicates a profile as a caller-owned private agent with copied presentation fields", async () => {+ const owner = await createUser();+ const source = await createProfileFixture({+ owner,+ visibility: "public",+ name: "Source Name",+ title: "Source Title",+ roleDescription: "Source role.",+ avatarSeed: "source-avatar",+ });+ await store.setHidden(owner, source.agentId, true);++ const duplicate = await store.duplicate(owner, source.agentId);++ expect(duplicate.id).toMatch(+ /^agent_[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/,+ );+ expect(duplicate).toMatchObject({+ name: source.name,+ title: source.title,+ roleDescription: source.roleDescription,+ avatarSeed: source.avatarSeed,+ visibility: "private",+ ownerUserId: owner.id,+ systemOwned: false,+ hidden: false,+ deletedAt: null,+ });+ expect(duplicate.id).not.toBe(source.agentId);+ createdAgentIds.push(duplicate.id);+ const duplicatePreferences = await database+ .select()+ .from(agentPreferences)+ .where(eq(agentPreferences.agentId, duplicate.id));+ expect(duplicatePreferences).toHaveLength(0);+ });++ test("duplicates no channel membership or Intelligence mapping from the source", async () => {+ const owner = await createUser();+ const source = await createProfileFixture({ owner, visibility: "public" });+ const channelId = id("channel");+ await database.insert(channels).values({+ id: channelId,+ name: "Source channel",+ description: "Links source agent to Intelligence.",+ });+ await database.insert(channelAgents).values({+ channelId,+ agentId: source.agentId,+ });+ await database.insert(intelligenceChannelMappings).values({+ userId: owner.id,+ channelId,+ threadId: id("thread"),+ });+ createdChannelIds.push(channelId);++ const duplicate = await store.duplicate(owner, source.agentId);+ createdAgentIds.push(duplicate.id);++ const sourceMappings = await database+ .select()+ .from(channelAgents)+ .innerJoin(+ intelligenceChannelMappings,+ eq(channelAgents.channelId, intelligenceChannelMappings.channelId),+ )+ .where(eq(channelAgents.agentId, source.agentId));+ const duplicateMappings = await database+ .select()+ .from(channelAgents)+ .innerJoin(+ intelligenceChannelMappings,+ eq(channelAgents.channelId, intelligenceChannelMappings.channelId),+ )+ .where(eq(channelAgents.agentId, duplicate.id));+ const duplicateChannelAgents = await database+ .select()+ .from(channelAgents)+ .where(eq(channelAgents.agentId, duplicate.id));+ expect(sourceMappings).not.toHaveLength(0);+ expect(duplicateChannelAgents).toHaveLength(0);+ expect(duplicateMappings).toHaveLength(0);+ });++ test("soft deletes a profile from reads and lists while retaining its raw rows", async () => {+ const owner = await createUser();+ const source = await createProfileFixture({ owner, visibility: "public" });++ await store.softDelete(owner, source.agentId);++ expect(await store.get(owner, source.agentId)).toBeNull();+ expectListed(await store.list(owner), source.agentId, false);+ expectListed(await store.list(owner, true), source.agentId, false);+ const [canonical] = await database+ .select()+ .from(agents)+ .where(eq(agents.id, source.agentId));+ const [profile] = await database+ .select()+ .from(agentProfiles)+ .where(eq(agentProfiles.agentId, source.agentId));+ expect(canonical?.id).toBe(source.agentId);+ expect(profile?.agentId).toBe(source.agentId);+ expect(profile?.deletedAt).toBeInstanceOf(Date);+ await expect(+ store.setHidden(owner, source.agentId, true),+ ).rejects.toBeInstanceOf(AgentNotFoundError);+ });++ test("rolls back canonical creation when the profile insert fails", async () => {+ const owner = await createUser();+ const name = `Rollback ${randomUUID()}`;++ await expect(+ store.create(owner, {+ name,+ title: null,+ roleDescription: "This profile insert must fail.",+ visibility: "public",+ } as unknown as CreateAgentInput),+ ).rejects.toThrow();+ const rows = await database+ .select()+ .from(agents)+ .where(eq(agents.name, name));+ expect(rows).toHaveLength(0);+ });++ test("creates a caller-owned remote AG-UI profile with the requested visibility", async () => {+ const owner = await createUser();+ const input: CreateAgentInput = {+ name: `Created ${randomUUID()}`,+ title: "Created Title",+ roleDescription: "Created role description.",+ visibility: "public",+ };++ const created = await store.create(owner, input);+ createdAgentIds.push(created.id);++ expect(created).toMatchObject({+ name: input.name,+ title: input.title,+ roleDescription: input.roleDescription,+ avatarSeed: created.id,+ visibility: "public",+ ownerUserId: owner.id,+ systemOwned: false,+ hidden: false,+ deletedAt: null,+ });+ const [canonical] = await database+ .select()+ .from(agents)+ .where(eq(agents.id, created.id));+ expect(canonical).toMatchObject({+ id: created.id,+ name: input.name,+ type: "remote_ag_ui",+ configuration: { endpoint: managedAgentAgUiUrl.toString() },+ packageId: null,+ });+ });+});diff --git a/server/tests/agent-registry.test.ts b/server/tests/agent-registry.test.tsnew file mode 100644index 00000000..bad5a2d8--- /dev/null+++ b/server/tests/agent-registry.test.ts@@ -0,0 +1,64 @@+import { expect, test } from "bun:test";+import { createAgentRegistry } from "../src/agents/registry";++test("reports built-in and remote agent availability without secrets", () => {+ expect(+ createAgentRegistry(+ [+ {+ id: "knowledge",+ name: "Knowledge",+ type: "built_in",+ credentialRef: "openai",+ },+ {+ id: "risk",+ name: "Risk",+ type: "remote_ag_ui",+ endpoint: "https://risk.example/ag-ui",+ },+ ],+ new Set(["openai"]),+ ),+ ).toEqual([+ { id: "knowledge", name: "Knowledge", type: "built_in", available: true },+ { id: "risk", name: "Risk", type: "remote_ag_ui", available: true },+ ]);+});++test("marks unavailable agents with safe reasons", () => {+ expect(+ createAgentRegistry(+ [+ {+ id: "knowledge",+ name: "Knowledge",+ type: "built_in",+ credentialRef: "openai",+ },+ {+ id: "risk",+ name: "Risk",+ type: "remote_ag_ui",+ endpoint: "ftp://risk.example",+ },+ ],+ new Set(),+ ),+ ).toEqual([+ {+ id: "knowledge",+ name: "Knowledge",+ type: "built_in",+ available: false,+ reason: "Model credential is not configured.",+ },+ {+ id: "risk",+ name: "Risk",+ type: "remote_ag_ui",+ available: false,+ reason: "AG-UI endpoint is invalid.",+ },+ ]);+});diff --git a/server/tests/agent-routes.test.ts b/server/tests/agent-routes.test.tsnew file mode 100644index 00000000..0bb7589b--- /dev/null+++ b/server/tests/agent-routes.test.ts@@ -0,0 +1,602 @@+import { describe, expect, test } from "bun:test";+import type { MiddlewareHandler } from "hono";+import { Hono } from "hono";+import {+ AgentNotFoundError,+ AgentNotManageableError,+ type AgentProfileStore,+ ProtectedAgentError,+} from "../src/agents/profile-store";+import type {+ AgentProfile,+ CreateAgentInput,+} from "../src/agents/profile-types";+import { createAgentRoutes, parseAgentInput } from "../src/agents/routes";+import { createApp } from "../src/app";+import type { AppVariables, AuthenticatedActor } from "../src/auth/guards";+import { loadConfig } from "../src/config";+import { testEnvironment } from "./support/environment";++const actor = {+ id: "user-1",+ email: "[email protected]",+ role: "user",+} as const;++const validInput: CreateAgentInput = {+ name: "Expense Manager",+ title: "Finance Operations",+ roleDescription:+ "Review receipts, categorize expenses, and prepare reimbursement reports.",+ visibility: "private",+};++function profile(overrides: Partial<AgentProfile> = {}): AgentProfile {+ return {+ id: "agent-1",+ name: validInput.name,+ title: validInput.title,+ roleDescription: validInput.roleDescription,+ avatarSeed: "expense-manager",+ visibility: validInput.visibility,+ ownerUserId: actor.id,+ systemOwned: false,+ hidden: false,+ deletedAt: null,+ ...overrides,+ };+}++type StoreCall = [method: keyof AgentProfileStore, ...arguments_: unknown[]];++function fakeStore(+ overrides: Partial<AgentProfileStore> = {},+): AgentProfileStore & { calls: StoreCall[] } {+ const calls: StoreCall[] = [];+ const base: AgentProfileStore = {+ async list(receivedActor, hidden) {+ calls.push(["list", receivedActor, hidden]);+ return [profile()];+ },+ async get(receivedActor, id) {+ calls.push(["get", receivedActor, id]);+ return profile({ id });+ },+ async getWithin(_executor, receivedActor, id) {+ calls.push(["getWithin", receivedActor, id]);+ return profile({ id });+ },+ async create(receivedActor, input) {+ calls.push(["create", receivedActor, input]);+ return profile({ ...input });+ },+ async update(receivedActor, id, input) {+ calls.push(["update", receivedActor, id, input]);+ return profile({ id, ...input });+ },+ async duplicate(receivedActor, id) {+ calls.push(["duplicate", receivedActor, id]);+ return profile({ id: `${id}-copy`, visibility: "private" });+ },+ async setHidden(receivedActor, id, hidden) {+ calls.push(["setHidden", receivedActor, id, hidden]);+ },+ async softDelete(receivedActor, id) {+ calls.push(["softDelete", receivedActor, id]);+ },+ };++ return Object.assign(base, overrides, { calls });+}++const requireUser: MiddlewareHandler<{ Variables: AppVariables }> = async (+ context,+ next,+) => {+ context.set("actor", actor);+ await next();+};++function appFor(+ store: AgentProfileStore,+ middleware: MiddlewareHandler<{ Variables: AppVariables }> = requireUser,+) {+ const app = new Hono<{ Variables: AppVariables }>();+ app.route("/", createAgentRoutes(store, middleware));+ return app;+}++async function json(response: Response) {+ return response.json();+}++describe("agent input parser", () => {+ test.each([[null], [[]], ["input"], [42], [true]])(+ "rejects a non-object root: %p",+ (input) => {+ expect(parseAgentInput(input)).toEqual({+ ok: false,+ error: "Agent input must be a JSON object.",+ });+ },+ );++ test.each([+ ["name", undefined, "Name must be text between 1 and 80 characters."],+ ["name", 12, "Name must be text between 1 and 80 characters."],+ ["name", " ", "Name must be text between 1 and 80 characters."],+ ["name", "n".repeat(81), "Name must be text between 1 and 80 characters."],+ ["title", undefined, "Title must be text between 1 and 120 characters."],+ ["title", false, "Title must be text between 1 and 120 characters."],+ ["title", "\n\t", "Title must be text between 1 and 120 characters."],+ [+ "title",+ "t".repeat(121),+ "Title must be text between 1 and 120 characters.",+ ],+ [+ "roleDescription",+ undefined,+ "Role description must be text between 1 and 1000 characters.",+ ],+ [+ "roleDescription",+ {},+ "Role description must be text between 1 and 1000 characters.",+ ],+ [+ "roleDescription",+ " ",+ "Role description must be text between 1 and 1000 characters.",+ ],+ [+ "roleDescription",+ "r".repeat(1001),+ "Role description must be text between 1 and 1000 characters.",+ ],+ ["visibility", undefined, "Visibility must be public or private."],+ ["visibility", 1, "Visibility must be public or private."],+ ["visibility", " ", "Visibility must be public or private."],+ ["visibility", "friends", "Visibility must be public or private."],+ ])("rejects invalid %s values", (field, value, error) => {+ expect(parseAgentInput({ ...validInput, [field]: value })).toEqual({+ ok: false,+ error,+ });+ });++ test.each([+ ["name", "n", "n"],+ ["name", ` ${"n".repeat(80)} `, "n".repeat(80)],+ ["title", "t", "t"],+ ["title", ` ${"t".repeat(120)} `, "t".repeat(120)],+ ["roleDescription", "r", "r"],+ ["roleDescription", ` ${"r".repeat(1000)} `, "r".repeat(1000)],+ ["visibility", " public ", "public"],+ ["visibility", " private ", "private"],+ ])("accepts and trims boundary %s values", (field, value, trimmed) => {+ const result = parseAgentInput({ ...validInput, [field]: value });++ expect(result).toEqual({+ ok: true,+ value: { ...validInput, [field]: trimmed },+ });+ });++ test("trims every accepted field and ignores forged fields", () => {+ expect(+ parseAgentInput({+ name: " Expense Manager ",+ title: " Finance Operations ",+ roleDescription: " Reviews receipts. ",+ visibility: " private ",+ id: "forged-agent",+ ownerUserId: "attacker",+ avatarSeed: "forged-avatar",+ deletedAt: "now",+ systemOwned: true,+ // `endpoint` is a real field for BYO-agent; validation protects it rather than refusing it+ // as a forged field. See agent-endpoint.test.ts.+ endpoint: "https://agents.example.com/ag-ui",+ }),+ ).toEqual({+ ok: true,+ value: {+ name: "Expense Manager",+ title: "Finance Operations",+ roleDescription: "Reviews receipts.",+ visibility: "private",+ endpoint: "https://agents.example.com/ag-ui",+ },+ });+ });+});++describe("agent lifecycle routes", () => {+ test("attaches authentication middleware to every route before calling the store", async () => {+ const store = fakeStore();+ const denied: MiddlewareHandler<{ Variables: AppVariables }> = (context) =>+ Promise.resolve(context.json({ error: "denied" }, 401));+ const app = appFor(store, denied);+ const requests: [string, RequestInit?][] = [+ ["/"],+ ["/agent-1"],+ ["/", { method: "POST", body: JSON.stringify(validInput) }],+ ["/agent-1", { method: "PATCH", body: JSON.stringify(validInput) }],+ ["/agent-1/duplicate", { method: "POST" }],+ ["/agent-1/hide", { method: "POST" }],+ ["/agent-1/unhide", { method: "POST" }],+ ["/agent-1", { method: "DELETE" }],+ ];++ for (const [path, init] of requests) {+ const response = await app.request(`http://openbot.test${path}`, init);+ expect(response.status).toBe(401);+ }+ expect(store.calls).toEqual([]);+ });++ test("uses only the authenticated context actor and parses hidden as exact true", async () => {+ const store = fakeStore();+ const app = appFor(store);++ for (const query of [+ "",+ "?hidden=false",+ "?hidden=True",+ "?hidden=1",+ "?hidden=true",+ ]) {+ expect((await app.request(`http://openbot.test/${query}`)).status).toBe(+ 200,+ );+ }++ expect(store.calls).toEqual([+ ["list", actor, false],+ ["list", actor, false],+ ["list", actor, false],+ ["list", actor, false],+ ["list", actor, true],+ ]);+ });++ test("serves every lifecycle route with its contract status and store operation", async () => {+ const store = fakeStore();+ const app = appFor(store);++ const list = await app.request("http://openbot.test/");+ const detail = await app.request("http://openbot.test/agent-1");+ const created = await app.request("http://openbot.test/", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(validInput),+ });+ const updated = await app.request("http://openbot.test/agent-1", {+ method: "PATCH",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(validInput),+ });+ const duplicated = await app.request(+ "http://openbot.test/agent-1/duplicate",+ {+ method: "POST",+ },+ );+ const hidden = await app.request("http://openbot.test/agent-1/hide", {+ method: "POST",+ });+ const unhidden = await app.request("http://openbot.test/agent-1/unhide", {+ method: "POST",+ });+ const deleted = await app.request("http://openbot.test/agent-1", {+ method: "DELETE",+ });++ expect(list.status).toBe(200);+ expect(detail.status).toBe(200);+ expect(created.status).toBe(201);+ expect(updated.status).toBe(200);+ expect(duplicated.status).toBe(201);+ expect(hidden.status).toBe(204);+ expect(unhidden.status).toBe(204);+ expect(deleted.status).toBe(204);+ expect(store.calls).toEqual([+ ["list", actor, false],+ ["get", actor, "agent-1"],+ ["create", actor, validInput],+ ["update", actor, "agent-1", validInput],+ ["duplicate", actor, "agent-1"],+ ["setHidden", actor, "agent-1", true],+ ["setHidden", actor, "agent-1", false],+ ["softDelete", actor, "agent-1"],+ ]);+ });++ test("projects exact DTO fields and computes permissions for the authenticated actor", async () => {+ const store = fakeStore({+ async list() {+ return [+ profile(),+ profile({ id: "agent-2", ownerUserId: "user-2" }),+ profile({+ id: "system-agent",+ ownerUserId: null,+ systemOwned: true,+ visibility: "public",+ }),+ ];+ },+ });++ const response = await appFor(store).request("http://openbot.test/");++ expect(await json(response)).toEqual({+ agents: [+ {+ id: "agent-1",+ name: validInput.name,+ title: validInput.title,+ roleDescription: validInput.roleDescription,+ avatarSeed: "expense-manager",+ visibility: "private",+ hidden: false,+ systemOwned: false,+ canManage: true,+ mine: true,+ },+ {+ id: "agent-2",+ name: validInput.name,+ title: validInput.title,+ roleDescription: validInput.roleDescription,+ avatarSeed: "expense-manager",+ visibility: "private",+ hidden: false,+ systemOwned: false,+ canManage: false,+ mine: false,+ },+ {+ id: "system-agent",+ name: validInput.name,+ title: validInput.title,+ roleDescription: validInput.roleDescription,+ avatarSeed: "expense-manager",+ visibility: "public",+ hidden: false,+ systemOwned: true,+ canManage: false,+ mine: false,+ },+ ],+ });+ });++ test("separates ownership from permission for an administrator", async () => {+ const administrator: AuthenticatedActor = {+ id: "admin-1",+ email: "[email protected]",+ role: "admin",+ };+ const requireAdministrator: MiddlewareHandler<{+ Variables: AppVariables;+ }> = async (context, next) => {+ context.set("actor", administrator);+ await next();+ };+ const store = fakeStore({+ async list() {+ return [+ profile({ id: "theirs", ownerUserId: "user-1" }),+ profile({ id: "ours", ownerUserId: administrator.id }),+ ];+ },+ });++ const body = (await json(+ await appFor(store, requireAdministrator).request("http://openbot.test/"),+ )) as { agents: { id: string; canManage: boolean; mine: boolean }[] };++ // An administrator may manage everybody's teammates but only created their own. A roster that+ // split on `canManage` would file somebody else's private teammate under theirs.+ expect(body.agents).toEqual([+ expect.objectContaining({ id: "theirs", canManage: true, mine: false }),+ expect.objectContaining({ id: "ours", canManage: true, mine: true }),+ ]);+ });++ test("never forwards forged create or update fields", async () => {+ const store = fakeStore();+ const app = appFor(store);+ const body = {+ name: " Expense Manager ",+ title: " Finance Operations ",+ roleDescription: ` ${validInput.roleDescription} `,+ visibility: " private ",+ id: "forged-agent",+ ownerUserId: "attacker",+ avatarSeed: "forged-avatar",+ deletedAt: "now",+ systemOwned: true,+ // A real field now, not a forged one; the rest of this list still is.+ endpoint: "https://agents.example.com/ag-ui",+ };++ for (const [path, method] of [+ ["/", "POST"],+ ["/agent-1", "PATCH"],+ ] as const) {+ const response = await app.request(`http://openbot.test${path}`, {+ method,+ headers: { "content-type": "application/json" },+ body: JSON.stringify(body),+ });+ expect(response.status).toBe(method === "POST" ? 201 : 200);+ }++ // The endpoint reaches the store because it is a real field; everything else forged does not.+ const expected = {+ ...validInput,+ endpoint: "https://agents.example.com/ag-ui",+ };+ expect(store.calls).toEqual([+ ["create", actor, expected],+ ["update", actor, "agent-1", expected],+ ]);+ });++ test.each([+ ["POST", "/"],+ ["PATCH", "/agent-1"],+ ])("requires a valid full JSON object for %s %s", async (method, path) => {+ const store = fakeStore();+ const app = appFor(store);+ const malformed = await app.request(`http://openbot.test${path}`, {+ method,+ headers: { "content-type": "application/json" },+ body: "{",+ });+ const partial = await app.request(`http://openbot.test${path}`, {+ method,+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ name: "Only a name" }),+ });++ expect(malformed.status).toBe(400);+ expect(await json(malformed)).toEqual({+ error: "Agent input must be a JSON object.",+ });+ expect(partial.status).toBe(400);+ expect(await json(partial)).toEqual({+ error: "Title must be text between 1 and 120 characters.",+ });+ expect(store.calls).toEqual([]);+ });++ test("returns 404 when get returns null", async () => {+ const store = fakeStore({ get: async () => null });++ const response = await appFor(store).request("http://openbot.test/missing");++ expect(response.status).toBe(404);+ expect(await json(response)).toEqual({ error: "Agent not found." });+ });++ test.each([+ [new AgentNotFoundError("agent-1"), 404, "Agent not found."],+ [+ new AgentNotManageableError("agent-1"),+ 403,+ "You do not have permission to manage this agent.",+ ],+ [+ new ProtectedAgentError("agent-1"),+ 403,+ "System-owned agents are protected.",+ ],+ ])("maps known store errors", async (error, status, message) => {+ const store = fakeStore({+ update: async () => {+ throw error;+ },+ });++ const response = await appFor(store).request(+ "http://openbot.test/agent-1",+ {+ method: "PATCH",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(validInput),+ },+ );++ expect(response.status).toBe(status);+ expect(await json(response)).toEqual({ error: message });+ });++ test("rethrows unexpected errors to the outer Hono error handler", async () => {+ const store = fakeStore({+ duplicate: async () => {+ throw new Error("database disconnected");+ },+ });+ const app = appFor(store);+ app.onError((error, context) =>+ context.json({ sentinel: error.message }, 599),+ );++ const response = await app.request(+ "http://openbot.test/agent-1/duplicate",+ {+ method: "POST",+ },+ );++ expect(response.status).toBe(599);+ expect(await json(response)).toEqual({ sentinel: "database disconnected" });+ });+});++describe("agent route composition", () => {+ test("mounts the store behind createApp authentication with the derived actor", async () => {+ const store = fakeStore();+ let session: {+ user: { id: string; email: string; name: string; image: string };+ } | null = null;+ const app = createApp(+ loadConfig(testEnvironment()),+ {+ handler: () => new Response(null, { status: 204 }),+ api: { getSession: async () => session },+ },+ { rolesForUser: async () => ["user"] },+ // Positions 4-11: auditReader, credentialService, packageStatusReader, connectorService,+ // copilotHandler, computerClient, computerGateway, computerPolicy.+ undefined,+ undefined,+ undefined,+ undefined,+ undefined,+ undefined,+ undefined,+ undefined,+ store,+ );++ const unauthenticated = await app.request("http://openbot.test/api/agents");+ expect(unauthenticated.status).toBe(401);+ expect(store.calls).toEqual([]);++ session = {+ user: {+ id: actor.id,+ email: actor.email,+ name: "OpenBot Member",+ image: "https://example.test/member.png",+ },+ };+ const authenticated = await app.request("http://openbot.test/api/agents");++ expect(authenticated.status).toBe(200);+ expect(store.calls).toEqual([+ [+ "list",+ {+ ...actor,+ name: "OpenBot Member",+ image: "https://example.test/member.png",+ },+ false,+ ],+ ]);+ });++ test("leaves agent routes unmounted when createApp has no store", async () => {+ const app = createApp(loadConfig(testEnvironment()));++ const response = await app.request("http://openbot.test/api/agents");++ expect(response.status).toBe(404);+ });+});diff --git a/server/tests/channel-events.integration.test.ts b/server/tests/channel-events.integration.test.tsnew file mode 100644index 00000000..98d93258--- /dev/null+++ b/server/tests/channel-events.integration.test.ts@@ -0,0 +1,189 @@+import { afterAll, afterEach, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { eq } from "drizzle-orm";+import { createAgentProfileStore } from "../src/agents/profile-store";+import type { AgentActor } from "../src/agents/profile-types";+import {+ type ChannelActivityEvent,+ createChannelEventHub,+ startChannelActivityListener,+} from "../src/channels/events";+import { createChannelStore } from "../src/channels/routes";+import { createThreadIdentity } from "../src/channels/thread-identity";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import {+ agentProfiles,+ agents,+ channels,+ intelligenceChannelMappings,+ users,+} from "../src/db/schema";++function event(overrides: Partial<ChannelActivityEvent> = {}) {+ return {+ channelId: "channel_1",+ memberIds: ["user-1"],+ lastMessage: "Said something.",+ lastMessageAt: "2026-08-15T10:00:00.000Z",+ lastMessageAgentId: null,+ ...overrides,+ } satisfies ChannelActivityEvent;+}++describe("channel event hub", () => {+ test("delivers only to the members of the channel", () => {+ const hub = createChannelEventHub();+ const member: string[] = [];+ const stranger: string[] = [];+ hub.register("user-1", (payload) => member.push(payload));+ hub.register("user-2", (payload) => stranger.push(payload));++ hub.deliver(event({ memberIds: ["user-1"] }));++ expect(member).toHaveLength(1);+ expect(JSON.parse(member[0] as string).lastMessage).toBe("Said something.");+ // Membership is what authorises delivery, so somebody outside the channel hears nothing.+ expect(stranger).toEqual([]);+ });++ test("reaches every connection a person has open", () => {+ const hub = createChannelEventHub();+ const received: string[] = [];+ hub.register("user-1", (payload) => received.push(`tab-a:${payload}`));+ hub.register("user-1", (payload) => received.push(`tab-b:${payload}`));++ hub.deliver(event());++ expect(received).toHaveLength(2);+ expect(hub.connectionCount("user-1")).toBe(2);+ });++ test("stops delivering once a connection detaches, and forgets the person", () => {+ const hub = createChannelEventHub();+ const received: string[] = [];+ const detach = hub.register("user-1", (payload) => received.push(payload));++ detach();+ hub.deliver(event());++ expect(received).toEqual([]);+ // Dropped rather than left as an empty set, so a long-lived process does not grow one per+ // person who has ever connected.+ expect(hub.connectionCount("user-1")).toBe(0);+ });++ test("one failing connection does not deny the event to the rest", () => {+ const hub = createChannelEventHub();+ const healthy: string[] = [];+ hub.register("user-1", () => {+ throw new Error("this socket is closing");+ });+ hub.register("user-1", (payload) => healthy.push(payload));++ expect(() => hub.deliver(event())).not.toThrow();+ expect(healthy).toHaveLength(1);+ });+});++const databaseUrl =+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot";+const database = createDatabase(databaseUrl, TEST_POOL);+const profileStore = createAgentProfileStore(+ database,+ new URL("https://managed.example.test/ag-ui"),+);+const store = createChannelStore(+ database,+ profileStore,+ createThreadIdentity("test-deployment"),+);+const testPrefix = `channel-events-${randomUUID()}`;+const createdUserIds: string[] = [];+const createdAgentIds: string[] = [];+const createdChannelIds: string[] = [];++afterEach(async () => {+ for (const channelId of createdChannelIds.splice(0)) {+ await database+ .delete(intelligenceChannelMappings)+ .where(eq(intelligenceChannelMappings.channelId, channelId));+ await database.delete(channels).where(eq(channels.id, channelId));+ }+ for (const agentId of createdAgentIds.splice(0)) {+ await database+ .delete(agentProfiles)+ .where(eq(agentProfiles.agentId, agentId));+ await database.delete(agents).where(eq(agents.id, agentId));+ }+ for (const userId of createdUserIds.splice(0)) {+ await database.delete(users).where(eq(users.id, userId));+ }+});++afterAll(async () => {+ await database.$client.close();+});++/**+ * Delivery goes through Postgres so it survives more than one server instance. This proves the round+ * trip a second instance would take: a write announces, and a listener that shares nothing with the+ * writer but the database hears it.+ */+describe("channel activity delivery", () => {+ test("announces a recorded message to a listener on its own connection", async () => {+ const id = `${testPrefix}-user-${randomUUID()}`;+ await database.insert(users).values({+ id,+ email: `${id}@example.test`,+ name: "Channel Events Test User",+ });+ createdUserIds.push(id);+ const owner: AgentActor = { id, role: "user" };++ const profile = await profileStore.create(owner, {+ name: "Expense Manager",+ title: "Finance Operations",+ roleDescription: "Review receipts.",+ visibility: "private",+ });+ createdAgentIds.push(profile.id);+ const channel = await store.create(owner, [profile.id]);+ createdChannelIds.push(channel.id);++ const hub = createChannelEventHub();+ const delivered: ChannelActivityEvent[] = [];+ const arrived = new Promise<void>((resolve) => {+ hub.register(owner.id, (payload) => {+ delivered.push(JSON.parse(payload));+ resolve();+ });+ });+ const listener = await startChannelActivityListener(databaseUrl, hub);++ try {+ await store.recordActivity(owner, channel.id, {+ agentId: profile.id,+ at: new Date(),+ text: "Categorized three expenses.",+ });+ await Promise.race([+ arrived,+ new Promise((_, reject) =>+ setTimeout(() => reject(new Error("no event within 5s")), 5000),+ ),+ ]);+ } finally {+ await listener.stop();+ }++ expect(delivered).toHaveLength(1);+ expect(delivered[0]).toMatchObject({+ channelId: channel.id,+ lastMessage: "Categorized three expenses.",+ lastMessageAgentId: profile.id,+ memberIds: [owner.id],+ });+ });+});diff --git a/server/tests/component-decision.test.ts b/server/tests/component-decision.test.tsnew file mode 100644index 00000000..ad2b639f--- /dev/null+++ b/server/tests/component-decision.test.ts@@ -0,0 +1,88 @@+import { describe, expect, test } from "bun:test";+import { Hono } from "hono";+import type { MiddlewareHandler } from "hono";+import type { AppVariables } from "../src/auth/guards";+import { createComponentRoutes } from "../src/components/routes";+import type { ComponentStore } from "../src/components/store";++/**+ * What one decision covers.+ *+ * A component is allowed by two grants: the Bot may use it, and it may read the data it draws. Both+ * are enforced when the data is fetched, which happens while the component renders. The decision is+ * asked before that, and answers whoever asked for the component, so it has to speak for the data+ * as well when the caller says which data that is.+ */++const GRANTED = "recentRefusals";+const WITHHELD = "botActivity";++const store = {+ decide: async () => ({ allowed: true as const, description: "Published." }),+ mayCall: async (_name: string, functionName: string) =>+ functionName === GRANTED,+} as unknown as ComponentStore;++const asSignedIn: MiddlewareHandler<{ Variables: AppVariables }> = async (+ context,+ next,+) => {+ context.set("actor", { id: "u1", email: "[email protected]" });+ return next();+};++function app() {+ return new Hono().route(+ "/components",+ createComponentRoutes(store, asSignedIn),+ );+}++async function decide(body: Record<string, unknown>) {+ const response = await app().request(+ "http://openbot.local/components/showActivityReport/decision",+ {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify(body),+ },+ );+ return (await response.json()) as { allowed: boolean; reason?: string };+}++describe("deciding a component", () => {+ test("allows one whose Bot holds it and which names no data", async () => {+ expect(await decide({ agentId: "risk-analyst" })).toEqual({+ allowed: true,+ });+ });++ test("allows one whose data it may also read", async () => {+ expect(+ await decide({ agentId: "risk-analyst", functions: [GRANTED] }),+ ).toEqual({ allowed: true });+ });++ test("refuses one that would be drawn empty, and says which grant is missing", async () => {+ const decision = await decide({+ agentId: "risk-analyst",+ functions: [WITHHELD],+ });+ expect(decision.allowed).toBe(false);+ expect(decision.reason).toContain(WITHHELD);+ });++ test("refuses when any one of the functions is withheld", async () => {+ const decision = await decide({+ agentId: "risk-analyst",+ functions: [GRANTED, WITHHELD],+ });+ expect(decision.allowed).toBe(false);+ });++ test("ignores anything in the list that is not a name", async () => {+ expect(+ await decide({ agentId: "risk-analyst", functions: [1, null, {}] }),+ ).toEqual({ allowed: true });+ });+});diff --git a/server/tests/component-store.integration.test.ts b/server/tests/component-store.integration.test.tsnew file mode 100644index 00000000..1acc2db1--- /dev/null+++ b/server/tests/component-store.integration.test.ts@@ -0,0 +1,378 @@+import { afterAll, beforeAll, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { eq, inArray } from "drizzle-orm";+import { DATA_FUNCTIONS } from "../src/components/functions";+import {+ ComponentNotFoundError,+ type ComponentStore,+ createComponentStore,+} from "../src/components/store";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import {+ agents,+ componentExclusions,+ componentFunctions,+ components,+} from "../src/db/schema";++/**+ * The grant surface, against a real database.+ *+ * Not mocked: every interesting property here is a property of the query. A left join that has to+ * return a row for a component nobody configured, a foreign key that has to take a Bot's+ * withholdings with it, a primary key that has to make withholding twice a no-op.+ */++const databaseUrl =+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot";+const database = createDatabase(databaseUrl, TEST_POOL);+const store: ComponentStore = createComponentStore(database);++const suite = randomUUID().slice(0, 8);+const componentName = `testComponent_${suite}`;+const otherName = `testOther_${suite}`;+const botA = `agent_test_a_${suite}`;+const botB = `agent_test_b_${suite}`;++async function makeComponent(name: string, published: boolean) {+ await database.insert(components).values({+ name,+ title: `Test ${name}`,+ kind: "chart",+ draftDescription: "The draft wording.",+ publishedDescription: published ? "The published wording." : null,+ published,+ ...(published ? { publishedAt: new Date() } : {}),+ });+}++beforeAll(async () => {+ for (const id of [botA, botB]) {+ await database+ .insert(agents)+ .values({ id, name: id, type: "remote_ag_ui", configuration: {} })+ .onConflictDoNothing();+ }+ await makeComponent(componentName, true);+ await makeComponent(otherName, false);+});++afterAll(async () => {+ await database+ .delete(componentFunctions)+ .where(+ inArray(componentFunctions.componentName, [componentName, otherName]),+ );+ await database+ .delete(componentExclusions)+ .where(+ inArray(componentExclusions.componentName, [componentName, otherName]),+ );+ await database+ .delete(components)+ .where(inArray(components.name, [componentName, otherName]));+ await database.delete(agents).where(inArray(agents.id, [botA, botB]));+});++describe("deciding whether a Bot may use a component", () => {+ test("a published component nobody configured is allowed", async () => {+ const decision = await store.decide(componentName, botA);++ expect(decision.allowed).toBeTrue();+ if (decision.allowed) {+ // The published wording, never the draft: a draft must not reach anything a model reads.+ expect(decision.description).toBe("The published wording.");+ }+ });++ test("a withheld component is refused, and says so", async () => {+ await store.revoke(componentName, botA, "[email protected]");++ const decision = await store.decide(componentName, botA);+ expect(decision.allowed).toBeFalse();+ if (!decision.allowed) {+ expect(decision.reason).toContain("withheld from this Bot");+ }+ });++ test("withholding is per Bot and reaches no other Bot", async () => {+ // Withholding is scoped to botA and does not affect botB.+ expect((await store.decide(componentName, botA)).allowed).toBeFalse();+ expect((await store.decide(componentName, botB)).allowed).toBeTrue();+ });++ test("an unpublished component is refused to every Bot", async () => {+ const decision = await store.decide(otherName, botB);+ expect(decision.allowed).toBeFalse();+ if (!decision.allowed) {+ expect(decision.reason).toContain("not published");+ }+ });++ test("a component that does not exist is refused rather than throwing", async () => {+ // A model inventing a tool name must get an answer it can act on, not a 500.+ const decision = await store.decide(`nothing_${suite}`, botA);+ expect(decision.allowed).toBeFalse();+ if (!decision.allowed) {+ expect(decision.reason).toContain("no component called");+ }+ });++ test("granting it back restores it", async () => {+ await store.grant(componentName, botA);+ expect((await store.decide(componentName, botA)).allowed).toBeTrue();+ });+});++describe("withholding", () => {+ test("withholding twice does not move the date it was withheld", async () => {+ await store.revoke(componentName, botB, "[email protected]");+ const [first] = await database+ .select()+ .from(componentExclusions)+ .where(eq(componentExclusions.agentId, botB));++ await store.revoke(componentName, botB, "[email protected]");+ const rows = await database+ .select()+ .from(componentExclusions)+ .where(eq(componentExclusions.agentId, botB));++ expect(rows).toHaveLength(1);+ expect(rows[0]?.withheldBy).toBe("[email protected]");+ expect(rows[0]?.withheldAt).toEqual(first?.withheldAt as Date);++ await store.grant(componentName, botB);+ });++ test("withholding a component that does not exist is an error, not a silent row", async () => {+ // Without this a typo in an API call writes a row against nothing, which reads in the grid as a+ // Bot held back from something that was never there.+ expect(+ store.revoke(`nothing_${suite}`, botA, "[email protected]"),+ ).rejects.toThrow(ComponentNotFoundError);+ });++ test("deleting a Bot takes its withholdings with it", async () => {+ const doomed = `agent_test_doomed_${suite}`;+ await database.insert(agents).values({+ id: doomed,+ name: doomed,+ type: "remote_ag_ui",+ configuration: {},+ });+ await store.revoke(componentName, doomed, "[email protected]");++ await database.delete(agents).where(eq(agents.id, doomed));++ const left = await database+ .select()+ .from(componentExclusions)+ .where(eq(componentExclusions.agentId, doomed));+ expect(left).toHaveLength(0);+ });+});++describe("what a Bot holds", () => {+ test("lists the published components, and not the unpublished ones", async () => {+ const held = await store.listForAgent(botA);+ const names = held.map((component) => component.name);++ expect(names).toContain(componentName);+ expect(names).not.toContain(otherName);+ });++ test("a component this Bot is withheld from is left out", async () => {+ await store.revoke(componentName, botA, "[email protected]");++ const names = (await store.listForAgent(botA)).map(+ (component) => component.name,+ );+ expect(names).not.toContain(componentName);+ // And the withholding reaches only this Bot.+ expect(+ (await store.listForAgent(botB)).map((component) => component.name),+ ).toContain(componentName);++ await store.grant(componentName, botA);+ });+});++describe("publishing", () => {+ test("publishing promotes the draft, which is what changes behaviour", async () => {+ await store.saveDraft(componentName, "New wording.", "[email protected]");++ // Still the old wording: a draft must change nothing until somebody publishes it.+ const before = await store.decide(componentName, botA);+ expect(before.allowed && before.description).toBe("The published wording.");++ await store.publish(componentName, "[email protected]");+ const after = await store.decide(componentName, botA);+ expect(after.allowed && after.description).toBe("New wording.");+ });++ test("unpublishing keeps the withholdings", async () => {+ await store.revoke(componentName, botA, "[email protected]");+ await store.unpublish(componentName, "[email protected]");++ const rows = await database+ .select()+ .from(componentExclusions)+ .where(eq(componentExclusions.componentName, componentName));++ // Unpublishing is "nobody may use this for now", not "forget who was held back from it".+ // Clearing them would quietly hand it to a Bot on the next publish.+ expect(rows.length).toBeGreaterThan(0);+ await store.publish(componentName, "[email protected]");+ await store.grant(componentName, botA);+ });++ test("a draft that matches the published version is not reported as unpublished changes", async () => {+ const listed = (await store.list()).find(+ (component) => component.name === componentName,+ );+ expect(listed?.hasUnpublishedChanges).toBeFalse();+ });+});++describe("learning what a build ships", () => {+ const announced = {+ name: `testAnnounced_${suite}`,+ title: "Announced",+ kind: "card",+ description: "Arrived from a build rather than from a list on the server.",+ };++ test("a component the deployment has never seen is added, published and available to every Bot", async () => {+ const { added } = await store.syncCatalogue([announced]);+ expect(added).toEqual([announced.name]);++ const stored = (await store.list()).find(+ (component) => component.name === announced.name,+ );+ expect(stored?.published).toBeTrue();+ expect(stored?.withheldFrom).toEqual([]);+ // The point of the whole change: a fresh install can draw without anybody configuring it.+ expect((await store.decide(announced.name, botA)).allowed).toBeTrue();+ });++ test("announcing again adds nothing", async () => {+ // Runs on every page load, so a second call must be a no-op rather than a duplicate-key crash.+ expect((await store.syncCatalogue([announced])).added).toEqual([]);+ });++ test("announcing NEVER overwrites what the deployment decided", async () => {+ await store.saveDraft(+ announced.name,+ "Our own wording.",+ "[email protected]",+ );+ await store.publish(announced.name, "[email protected]");+ await store.revoke(announced.name, botA, "[email protected]");+ await store.unpublish(announced.name, "[email protected]");++ // The same build announces the same component with its original description, as it would on the+ // next page load. Every one of these would be an upgrade quietly undoing somebody's work.+ await store.syncCatalogue([announced]);++ const stored = (await store.list()).find(+ (component) => component.name === announced.name,+ );+ expect(stored?.publishedDescription).toBe("Our own wording.");+ expect(stored?.published).toBeFalse();+ expect(stored?.withheldFrom).toEqual([botA]);+ });++ test("announcing nothing is not a request to forget everything", async () => {+ // A build with no components, or a failed manifest, must not empty the catalogue.+ const before = (await store.list()).length;+ expect((await store.syncCatalogue([])).added).toEqual([]);+ expect((await store.list()).length).toBe(before);+ });++ afterAll(async () => {+ await database+ .delete(componentExclusions)+ .where(eq(componentExclusions.componentName, announced.name));+ await database+ .delete(components)+ .where(eq(components.name, announced.name));+ });+});++describe("what a component may read", () => {+ const fn = "botActivity";+ const other = "recentRefusals";++ test("a component granted nothing may read nothing", async () => {+ // The state every component is in the moment it is added, which is why this is the first test.+ expect(await store.mayCall(componentName, fn)).toBeFalse();+ expect(await store.mayCall(componentName, other)).toBeFalse();+ });++ test("a granted function is allowed and the others still are not", async () => {+ await store.grantFunction(componentName, fn, "[email protected]");++ expect(await store.mayCall(componentName, fn)).toBeTrue();+ // The interesting half: granting one function must not grant the next one along.+ expect(await store.mayCall(componentName, other)).toBeFalse();+ });++ test("a grant reaches only the component it was given to", async () => {+ expect(await store.mayCall(otherName, fn)).toBeFalse();+ });++ test("granting twice does not move the date it was granted", async () => {+ const [first] = await database+ .select()+ .from(componentFunctions)+ .where(eq(componentFunctions.componentName, componentName));++ await store.grantFunction(componentName, fn, "[email protected]");+ const rows = await database+ .select()+ .from(componentFunctions)+ .where(eq(componentFunctions.componentName, componentName));++ expect(rows).toHaveLength(1);+ expect(rows[0]?.grantedBy).toBe("[email protected]");+ expect(rows[0]?.grantedAt).toEqual(first?.grantedAt as Date);+ });++ test("revoking takes it away again", async () => {+ await store.revokeFunction(componentName, fn);+ expect(await store.mayCall(componentName, fn)).toBeFalse();+ });++ test("deleting a component takes its function grants with it", async () => {+ const doomed = `testDoomed_${suite}`;+ await makeComponent(doomed, true);+ await store.grantFunction(doomed, fn, "[email protected]");++ await database.delete(components).where(eq(components.name, doomed));++ const left = await database+ .select()+ .from(componentFunctions)+ .where(eq(componentFunctions.componentName, doomed));+ expect(left).toHaveLength(0);+ });++ test("every shipped function reads real rows and bounds its own arguments", async () => {+ for (const entry of DATA_FUNCTIONS) {+ // Run with nothing, which is what a component sends before the model has supplied anything, and+ // with a hostile number: a value from the browser is a claim, and an unbounded one is a table+ // scan somebody asked for over the wire.+ expect(await entry.run(database, {})).toBeDefined();+ expect(+ await entry.run(database, { days: 100_000, limit: 100_000 }),+ ).toBeDefined();+ }+ });++ test("a function this build does not ship cannot be run", async () => {+ expect(store.callFunction(`nothing_${suite}`, {})).rejects.toThrow();+ });+});diff --git a/server/tests/computer-gateway.test.ts b/server/tests/computer-gateway.test.tsnew file mode 100644index 00000000..eff68c07--- /dev/null+++ b/server/tests/computer-gateway.test.ts@@ -0,0 +1,399 @@+import { describe, expect, test } from "bun:test";+import type { AuditEventInput, AuditStore } from "../src/audit";+import type { ComputerClient } from "../src/computer/client";+import {+ ActionRefusedError,+ createComputerGateway,+} from "../src/computer/gateway";+import type { ActionPolicy } from "../src/computer/policy";+import type { SnapshotResult } from "../src/computer/schema";++/**+ * What the gateway must guarantee, tested as properties rather than as call sequences.+ *+ * The four that matter, and none of them are visible from a green typecheck:+ * - a refused action does NOT reach the computer+ * - a row is written either way, so the trail cannot only contain successes+ * - the policy decides on the element the SERVER resolved, never on a label the caller supplied+ * - the text typed into a field never enters the audit payload+ */++const SNAPSHOT: SnapshotResult = {+ snapshotId: 7,+ url: "https://example.com/order",+ title: "Order",+ truncated: false,+ elements: [+ { ref: "e1", role: "input", name: "Customer name:", type: "text" },+ { ref: "e9", role: "button", name: "Submit order" },+ ],+};++/** A client that records what reached it, so "did not reach the computer" is checkable. */+function fakeClient() {+ const calls: string[] = [];+ /** Which Bot the gateway addressed the computer as, per call. */+ const addressedAs: string[] = [];+ const result = (action: string) => ({+ action,+ url: SNAPSHOT.url,+ elapsedMs: 1,+ });+ const client = {+ snapshot: async () => SNAPSHOT,+ read: async () => ({+ url: SNAPSHOT.url,+ title: "Order",+ text: "",+ truncated: false,+ }),+ click: async () => {+ calls.push("click");+ return result("click") as never;+ },+ type: async () => {+ calls.push("type");+ return result("type") as never;+ },+ key: async () => {+ calls.push("key");+ return result("key") as never;+ },+ scroll: async () => {+ calls.push("scroll");+ return result("scroll") as never;+ },+ readFile: async () => {+ calls.push("readFile");+ return {+ path: "notes.md",+ text: "kept",+ truncated: false,+ bytes: 4,+ } as never;+ },+ writeFile: async () => {+ calls.push("writeFile");+ return { path: "notes.md", bytes: 4, appended: false } as never;+ },+ status: async () => ({ botId: "b", state: "ready" as const }),+ navigate: async () => {+ calls.push("navigate");+ return { url: "https://example.com/", title: "Example" } as never;+ },+ screenshot: async () => ({}) as never,+ /**+ * The per-Bot view. Recorded rather than ignored, so a test can prove the gateway told the+ * computer which Bot is asking, the thing every per-Bot behaviour on the far side keys off.+ */+ forBot(botId: string) {+ addressedAs.push(botId);+ return client;+ },+ } as unknown as ComputerClient;+ return { client, calls, addressedAs };+}++function fakeAudit() {+ const rows: AuditEventInput[] = [];+ const store: AuditStore = { insert: async (event) => void rows.push(event) };+ return { store, rows };+}++const ACTOR = { id: "dev-local-user" };+const PERMISSIVE: ActionPolicy = { mode: "enforce", deny: [], allow: ["true"] };++async function gatewayWith(policy: ActionPolicy | undefined) {+ const { client, calls } = fakeClient();+ const { store, rows } = fakeAudit();+ const gateway = createComputerGateway({+ client,+ auditStore: store,+ policy: () => policy,+ });+ // Every test acts on refs, so the server must hold a snapshot first, exactly as the real flow does.+ await gateway.snapshot("default");+ return { gateway, calls, rows };+}++describe("the computer gateway", () => {+ test("carries out an allowed action and records it", async () => {+ const { gateway, calls, rows } = await gatewayWith(PERMISSIVE);+ await gateway.click("default", "bot-1", ACTOR, {+ ref: "e9",+ snapshotId: 7,+ });++ expect(calls).toEqual(["click"]);+ expect(rows).toHaveLength(1);+ expect(rows[0]?.eventType).toBe("computer.action_allowed");+ });++ test("a refused action never reaches the computer", async () => {+ const { gateway, calls, rows } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['contains(element.name, "submit")'],+ });++ await expect(+ gateway.click("default", "bot-1", ACTOR, { ref: "e9", snapshotId: 7 }),+ ).rejects.toThrow(ActionRefusedError);++ // The decision happens before the effect.+ expect(calls).toEqual([]);+ expect(rows).toHaveLength(1);+ expect(rows[0]?.eventType).toBe("computer.action_refused");+ });++ test("the refusal names the rule, so an operator can find it", async () => {+ const { gateway } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['contains(element.name, "submit")'],+ });++ const error = await gateway+ .click("default", "bot-1", ACTOR, { ref: "e9", snapshotId: 7 })+ .catch((caught: unknown) => caught);++ expect(error).toBeInstanceOf(ActionRefusedError);+ expect((error as ActionRefusedError).rule).toBe(+ 'contains(element.name, "submit")',+ );+ });++ test("the policy sees the element the SERVER resolved, not what the caller claimed", async () => {+ // The evasion this prevents: calling the Submit button something harmless in the request. The+ // caller only ever sends a ref, and the gateway looks it up in the snapshot it fetched itself.+ const { gateway, calls } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['contains(element.name, "submit")'],+ });++ await expect(+ gateway.click("default", "bot-1", ACTOR, {+ ref: "e9",+ snapshotId: 7,+ // Not part of the input contract, and must not influence anything even when supplied.+ ...({ name: "Continue", element: { name: "Continue" } } as object),+ }),+ ).rejects.toThrow(ActionRefusedError);+ expect(calls).toEqual([]);+ });++ test("an allowed action reports the element's label for the transcript", async () => {+ const { gateway } = await gatewayWith(PERMISSIVE);+ const result = await gateway.type("default", "bot-1", ACTOR, {+ ref: "e1",+ snapshotId: 7,+ text: "Grace Hopper",+ });+ expect(result.element?.name).toBe("Customer name:");+ });++ test("the typed text never enters the audit payload", async () => {+ const { gateway, rows } = await gatewayWith(PERMISSIVE);+ await gateway.type("default", "bot-1", ACTOR, {+ ref: "e1",+ snapshotId: 7,+ text: "hunter2-not-a-real-password",+ });++ // Serialized and searched, rather than checking known keys: the guarantee is that the value is+ // nowhere in the row, not that one particular field omits it.+ expect(JSON.stringify(rows[0]?.payload)).not.toContain("hunter2");+ expect(rows[0]?.payload.element).toEqual({+ role: "input",+ name: "Customer name:",+ // The control's type is recorded too: knowing a value went into a `password` field rather than+ // a `text` one is exactly the distinction an investigator needs, and it is not the value.+ type: "text",+ });+ });++ test("an absent policy refuses every action", async () => {+ const { gateway, calls, rows } = await gatewayWith(undefined);+ await expect(+ gateway.click("default", "bot-1", ACTOR, { ref: "e9", snapshotId: 7 }),+ ).rejects.toThrow(ActionRefusedError);+ expect(calls).toEqual([]);+ expect(rows[0]?.eventType).toBe("computer.action_refused");+ });++ test("dry-run records the refusal and still carries the action out", async () => {+ const { gateway, calls, rows } = await gatewayWith({+ mode: "dry-run",+ deny: ['contains(element.name, "submit")'],+ allow: ["true"],+ });++ await gateway.click("default", "bot-1", ACTOR, {+ ref: "e9",+ snapshotId: 7,+ });++ expect(calls).toEqual(["click"]);+ const decision = rows[0]?.payload.decision as { carriedOut?: boolean };+ expect(rows[0]?.eventType).toBe("computer.action_refused");+ // Without this flag the row reads as a contradiction: refused, yet the work happened.+ expect(decision.carriedOut).toBe(true);+ });++ test("the local development actor is kept out of the audit foreign key", async () => {+ // Writing an id with no `users` row fails the constraint and loses the row entirely, so who it+ // was is carried in the payload instead. The route decides this; the gateway must honour it.+ const { gateway, rows } = await gatewayWith(PERMISSIVE);+ await gateway.click("default", "bot-1", ACTOR, {+ ref: "e9",+ snapshotId: 7,+ });+ expect(rows[0]?.actorUserId).toBeUndefined();+ expect(rows[0]?.payload.actor).toBe("dev-local-user");+ });++ test("a file read is governed, not passed through", async () => {+ const { gateway, calls, rows } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['contains(file.path, "credentials")'],+ });++ await expect(+ gateway.readFile("default", "bot-1", ACTOR, {+ path: "credentials/aws.txt",+ }),+ ).rejects.toThrow(ActionRefusedError);+ expect(calls).toEqual([]);+ expect(rows[0]?.eventType).toBe("computer.action_refused");+ expect(rows[0]?.payload.file).toBe("credentials/aws.txt");+ });++ test("a rule can be written against a file's extension", async () => {+ const { gateway, calls } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['file.extension == "env"'],+ });++ await expect(+ gateway.readFile("default", "bot-1", ACTOR, { path: "config/prod.env" }),+ ).rejects.toThrow(ActionRefusedError);+ // A different extension in the same folder is untouched by that rule.+ await gateway.readFile("default", "bot-1", ACTOR, {+ path: "config/prod.json",+ });+ expect(calls).toEqual(["readFile"]);+ });++ test("a permitted write happens and is recorded by path, never by contents", async () => {+ const { gateway, calls, rows } = await gatewayWith(PERMISSIVE);+ await gateway.writeFile("default", "bot-1", ACTOR, {+ path: "notes.md",+ contents: "the customer's card number is 4111-1111-1111-1111",+ });++ expect(calls).toEqual(["writeFile"]);+ expect(rows[0]?.eventType).toBe("computer.action_allowed");+ expect(rows[0]?.payload.file).toBe("notes.md");+ // The same guarantee as typed text: a Bot writes down what it was told, so a file body is exactly+ // as sensitive and is never put in the row.+ expect(JSON.stringify(rows[0]?.payload)).not.toContain("4111");+ });++ test("the computer is told WHICH Bot is asking", async () => {+ // Every per-Bot behaviour on the computer keys off this id: the profile it opens, the logins it+ // has, the proxy its traffic leaves through, and who holds its wheel.+ const { client, addressedAs } = fakeClient();+ const { store } = fakeAudit();+ const gateway = createComputerGateway({+ client,+ auditStore: store,+ policy: () => PERMISSIVE,+ });++ await gateway.snapshot("sales-bot");+ await gateway.click("sales-bot", "sales-bot", ACTOR, "e1");+ await gateway.read("research-bot");++ expect(addressedAs).toContain("sales-bot");+ expect(addressedAs).toContain("research-bot");+ // A call must never reach a different Bot's computer.+ expect(+ addressedAs.every((id) => id === "sales-bot" || id === "research-bot"),+ ).toBe(true);+ });++ test("a permitted action that FAILS gets its own row, not an allowed one", async () => {+ // A permitted read that later fails path confinement records both the decision and the failed+ // outcome, so the trail does not imply the Bot received the file.+ const { client, calls } = fakeClient();+ const { store, rows } = fakeAudit();+ const failing: ComputerClient = {+ ...client,+ readFile: async () => {+ calls.push("readFile");+ throw new Error("that path is outside your workspace");+ },+ forBot: () => failing,+ } as unknown as ComputerClient;+ const gateway = createComputerGateway({+ client: failing,+ auditStore: store,+ policy: () => PERMISSIVE,+ });++ await expect(+ gateway.readFile("default", "bot-1", ACTOR, { path: "../../etc/passwd" }),+ ).rejects.toThrow();++ expect(rows).toHaveLength(2);+ // The decision, then the outcome. Both are needed: the first says it was permitted, the second+ // says it did not happen, and neither on its own is the truth.+ expect(rows[0]?.eventType).toBe("computer.action_allowed");+ expect(rows[1]?.eventType).toBe("computer.action_failed");+ expect(rows[1]?.payload.failure).toContain("outside your workspace");+ });++ test("opening a page is recorded, with the address it was opening", async () => {+ // The target guard refuses a forbidden address inside the+ // client and nothing was written, so an attempt on the cloud metadata endpoint left no row while+ // ticking a radio button left one.+ const { gateway, calls, rows } = await gatewayWith(PERMISSIVE);+ await gateway.navigate("default", "bot-1", ACTOR, "https://example.com/");++ expect(calls).toEqual(["navigate"]);+ expect(rows[0]?.eventType).toBe("computer.action_allowed");+ expect(rows[0]?.payload.action).toBe("computer_navigate");+ expect(rows[0]?.payload.page).toBe("https://example.com/");+ });++ test("a rule can refuse a navigation by its DESTINATION host", async () => {+ // The destination, not the page already loaded. Deciding on the current URL would make a rule+ // about where a Bot may go structurally unable to say anything about where it is going.+ const { gateway, calls } = await gatewayWith({+ ...PERMISSIVE,+ deny: ['page.host == "intranet.example.com"'],+ });++ await expect(+ gateway.navigate(+ "default",+ "bot-1",+ ACTOR,+ "https://intranet.example.com/hr",+ ),+ ).rejects.toThrow(ActionRefusedError);+ expect(calls).toEqual([]);++ await gateway.navigate("default", "bot-1", ACTOR, "https://example.com/");+ expect(calls).toEqual(["navigate"]);+ });++ test("an action on an unresolvable ref is still decided and still recorded", async () => {+ const { gateway, rows } = await gatewayWith(PERMISSIVE);+ await gateway.click("default", "bot-1", ACTOR, {+ ref: "e404",+ snapshotId: 7,+ });+ // Permitted here only because the shipped default permits; the row says plainly that the server+ // could not identify what was touched, rather than omitting the field.+ expect(rows[0]?.payload.element).toBe("not in the current snapshot");+ });+});diff --git a/server/tests/computer-policy.test.ts b/server/tests/computer-policy.test.tsnew file mode 100644index 00000000..5191793c--- /dev/null+++ b/server/tests/computer-policy.test.ts@@ -0,0 +1,352 @@+import { describe, expect, test } from "bun:test";+import {+ type ActionPolicy,+ evaluateActionPolicy,+ type PolicyContext,+} from "../src/computer/policy";+import { parseActionPolicy } from "../src/computer/policy-store";++/**+ * These test the decision, not the plumbing.+ *+ * Every case here is one a deployment can actually be in, and several are ones where the safe answer+ * is not the obvious one: a broken rule, an empty policy, a policy that is absent entirely. The+ * fail-closed paths are tested with the permissive path (`allow: ["true"]`) switched on, which proves+ * that denial still wins in the configuration deployments actually run.+ */++function context(overrides: Partial<PolicyContext> = {}): PolicyContext {+ return {+ tool: { name: "computer_click" },+ bot: { id: "risk-analyst" },+ actor: { id: "dev-local-user" },+ page: { url: "https://example.com/order", host: "example.com" },+ element: { ref: "e13", role: "button", name: "Submit order" },+ ...overrides,+ };+}++const permissive: ActionPolicy = { mode: "enforce", deny: [], allow: ["true"] };++describe("evaluateActionPolicy", () => {+ test("an absent policy refuses, rather than permitting everything", () => {+ const decision = evaluateActionPolicy(undefined, context());+ expect(decision.allowed).toBe(false);+ expect(decision.forward).toBe(false);+ expect(decision.source).toBe("default");+ });++ test("an empty allow list refuses", () => {+ const decision = evaluateActionPolicy(+ { mode: "enforce", deny: [], allow: [] },+ context(),+ );+ expect(decision.allowed).toBe(false);+ expect(decision.forward).toBe(false);+ });++ test("deny beats allow, even when allow matches everything", () => {+ const decision = evaluateActionPolicy(+ { ...permissive, deny: ['contains(element.name, "submit")'] },+ context(),+ );+ expect(decision.allowed).toBe(false);+ expect(decision.forward).toBe(false);+ expect(decision.source).toBe("deny");+ // The reason is read by a person and names both the thing and the rule.+ expect(decision.reason).toContain("Submit order");+ expect(decision.reason).toContain("example.com");+ });++ test("a deny rule leaves unrelated elements alone", () => {+ const decision = evaluateActionPolicy(+ { ...permissive, deny: ['contains(element.name, "submit")'] },+ context({ element: { ref: "e6", role: "input", name: "Large" } }),+ );+ expect(decision.allowed).toBe(true);+ expect(decision.forward).toBe(true);+ });++ test("substring matching is case-insensitive", () => {+ // A rule saying "never click submit" also catches uppercase button labels.+ const decision = evaluateActionPolicy(+ { ...permissive, deny: ['contains(element.name, "submit")'] },+ context({ element: { ref: "e1", role: "button", name: "SUBMIT NOW" } }),+ );+ expect(decision.allowed).toBe(false);+ });++ test("a BROKEN deny expression still denies", () => {+ // Fail-closed. A typo in a rule must not quietly permit the thing it was written to forbid, even+ // though `allow: ["true"]` would otherwise let it straight through.+ const decision = evaluateActionPolicy(+ { ...permissive, deny: ["this is not ( valid cel"] },+ context(),+ );+ expect(decision.allowed).toBe(false);+ expect(decision.source).toBe("deny");+ });++ test("a broken allow expression does not permit", () => {+ const decision = evaluateActionPolicy(+ { mode: "enforce", deny: [], allow: ["also not ( valid"] },+ context(),+ );+ expect(decision.allowed).toBe(false);+ expect(decision.source).toBe("default");+ });++ test("dry-run records a refusal but lets the work continue", () => {+ const decision = evaluateActionPolicy(+ {+ mode: "dry-run",+ deny: ['contains(element.name, "submit")'],+ allow: ["true"],+ },+ context(),+ );+ // Both halves matter: the trail must show it was refused, and the Bot must not be blocked.+ expect(decision.allowed).toBe(false);+ expect(decision.forward).toBe(true);+ });++ test("rules can be written against the tool, the host and the Bot", () => {+ const byTool = evaluateActionPolicy(+ { ...permissive, deny: ['tool.name == "computer_type"'] },+ context({ tool: { name: "computer_type" } }),+ );+ expect(byTool.allowed).toBe(false);++ const byHost = evaluateActionPolicy(+ { ...permissive, deny: ['page.host == "example.com"'] },+ context(),+ );+ expect(byHost.allowed).toBe(false);++ const byBot = evaluateActionPolicy(+ { ...permissive, deny: ['bot.id == "risk-analyst"'] },+ context(),+ );+ expect(byBot.allowed).toBe(false);+ });++ test("a rule about an element still decides when the element is unknown", () => {+ // An action on something the server could not resolve must be decided on, not waved through as+ // unrecognised. `contains` on a missing field throws, and a throwing deny expression denies.+ const decision = evaluateActionPolicy(+ { ...permissive, deny: ['contains(element.name, "submit")'] },+ context({ element: undefined }),+ );+ expect(decision.allowed).toBe(false);+ });+});++describe("parseActionPolicy", () => {+ test("accepts a well-formed policy", () => {+ const result = parseActionPolicy({+ mode: "dry-run",+ deny: ['contains(element.name, "pay")'],+ allow: ["true"],+ });+ expect(result.ok).toBe(true);+ if (result.ok) {+ expect(result.policy.mode).toBe("dry-run");+ expect(result.policy.deny).toHaveLength(1);+ }+ });++ test("defaults the lists but never the mode", () => {+ const result = parseActionPolicy({ mode: "enforce" });+ expect(result.ok).toBe(true);+ if (result.ok) {+ expect(result.policy.deny).toEqual([]);+ expect(result.policy.allow).toEqual([]);+ }+ });++ test.each([+ ["not an object", "nonsense"],+ ["a missing mode", { deny: [], allow: [] }],+ ["an unknown mode", { mode: "advisory", deny: [], allow: [] }],+ ["a non-list deny", { mode: "enforce", deny: "everything" }],+ ["a list of non-strings", { mode: "enforce", allow: [1, 2] }],+ ])("rejects %s rather than coercing it", (_label, input) => {+ // Rejected, not repaired. An operator must never be told a rule was stored when it was stored+ // differently, because they would believe a restriction is in force when it is not.+ expect(parseActionPolicy(input).ok).toBe(false);+ });+});++describe("the second door", () => {+ test("a rule can refuse a keypress, not only a click", () => {+ // Form submission can happen through a keypress as well as a click, so policy must see both+ // activation paths.+ const policy = {+ mode: "enforce" as const,+ deny: ['tool.name == "computer_key" && key == "Enter"'],+ allow: ["true"],+ };+ const refused = evaluateActionPolicy(policy, {+ tool: { name: "computer_key" },+ bot: { id: "sales" },+ actor: { id: "someone" },+ page: { url: "https://example.com/order", host: "example.com" },+ key: "Enter",+ });+ expect(refused.allowed).toBe(false);++ // And an ordinary keystroke still goes through, or the Bot could not type at all.+ const allowed = evaluateActionPolicy(policy, {+ tool: { name: "computer_key" },+ bot: { id: "sales" },+ actor: { id: "someone" },+ page: { url: "https://example.com/order", host: "example.com" },+ key: "a",+ });+ expect(allowed.allowed).toBe(true);+ });+});++/**+ * `intent` describes the effect rather than the mechanism. `tool.name` says which tool was used; an+ * operator writes rules about the action's effect, and a button can be pressed three different ways.+ */+describe("a rule written about what an action does", () => {+ const activate = (extra: Partial<PolicyContext> = {}): PolicyContext => ({+ tool: { name: "computer_click" },+ bot: { id: "b" },+ actor: { id: "a" },+ page: { url: "https://example.com/", host: "example.com" },+ intent: "activate",+ ...extra,+ });++ const policy = {+ mode: "enforce" as const,+ deny: ['intent == "activate" && contains(element.name, "submit")'],+ allow: ["true"],+ };++ test("catches the click on the button", () => {+ const decision = evaluateActionPolicy(+ policy,+ activate({+ element: { ref: "e1", role: "button", name: "Submit order" },+ }),+ );+ expect(decision.allowed).toBe(false);+ });++ test("catches Enter pressed on the same button, which a rule about clicking did not", () => {+ const decision = evaluateActionPolicy(+ policy,+ activate({+ tool: { name: "computer_key" },+ key: "Enter",+ element: { ref: "e1", role: "button", name: "Submit order" },+ }),+ );+ expect(decision.allowed).toBe(false);+ });++ test("catches Space on it too", () => {+ const decision = evaluateActionPolicy(+ policy,+ activate({+ tool: { name: "computer_key" },+ key: "Space",+ element: { ref: "e1", role: "button", name: "Submit order" },+ }),+ );+ expect(decision.allowed).toBe(false);+ });++ test("leaves ordinary typing alone", () => {+ const decision = evaluateActionPolicy(policy, {+ ...activate(),+ tool: { name: "computer_type" },+ intent: "type",+ element: { ref: "e2", role: "textbox", name: "Customer name:" },+ });+ expect(decision.allowed).toBe(true);+ });++ /**+ * `intent` describes the addressed element, not the form submission side effect. A keypress in a+ * field submits the form, and the element it names is the field. Only a rule that refuses Enter+ * outright stops that, which is why the shipped preset still does.+ */+ test("does NOT catch Enter in a text field, which is why the preset also refuses Enter", () => {+ const inField = activate({+ tool: { name: "computer_key" },+ key: "Enter",+ element: { ref: "e3", role: "textbox", name: "E-mail address:" },+ });++ expect(evaluateActionPolicy(policy, inField).allowed).toBe(true);++ const withEnterRefused = {+ ...policy,+ deny: [...policy.deny, 'key == "Enter"'],+ };+ expect(evaluateActionPolicy(withEnterRefused, inField).allowed).toBe(false);+ });+});++/**+ * A rule about keypresses must not refuse everything else.+ *+ * `key` exists only on a keypress. An expression naming an absent identifier errors, and the engine+ * treats an error as a refusal, correctly, since a rule nobody can evaluate must not wave things+ * through. A bare `key == "Enter"` therefore refuses navigation too; scoped rules guard on the tool+ * name before reading key-specific fields.+ */+describe("a rule that names an identifier only some actions carry", () => {+ const navigating: PolicyContext = {+ tool: { name: "computer_navigate" },+ bot: { id: "b" },+ actor: { id: "a" },+ page: { url: "https://httpbin.org/forms/post", host: "httpbin.org" },+ intent: "navigate",+ };++ test("unguarded, it refuses a navigation that has no key at all", () => {+ const decision = evaluateActionPolicy(+ { mode: "enforce", deny: ['key == "Enter"'], allow: ["true"] },+ navigating,+ );+ // Failing closed on an unevaluable rule is the safe answer. The shipped preset carries the guard+ // below to keep this rule scoped to keypresses.+ expect(decision.allowed).toBe(false);+ });++ test("guarded by the tool name, the navigation is allowed", () => {+ const decision = evaluateActionPolicy(+ {+ mode: "enforce",+ deny: ['tool.name == "computer_key" && key == "Enter"'],+ allow: ["true"],+ },+ navigating,+ );+ expect(decision.allowed).toBe(true);+ });++ test("and the guarded rule still refuses the keypress it is about", () => {+ const decision = evaluateActionPolicy(+ {+ mode: "enforce",+ deny: ['tool.name == "computer_key" && key == "Enter"'],+ allow: ["true"],+ },+ {+ ...navigating,+ tool: { name: "computer_key" },+ intent: "activate",+ key: "Enter",+ element: { ref: "e1", role: "textbox", name: "E-mail address:" },+ },+ );+ expect(decision.allowed).toBe(false);+ });+});diff --git a/server/tests/computer-supervisor.test.ts b/server/tests/computer-supervisor.test.tsnew file mode 100644index 00000000..f591a479--- /dev/null+++ b/server/tests/computer-supervisor.test.ts@@ -0,0 +1,100 @@+import { describe, expect, test } from "bun:test";+import {+ createSupervisorClient,+ SupervisorError,+} from "../src/computer/supervisor";++/**+ * Asking the supervisor where a Bot's computer is.+ *+ * The interesting cases are all failures, because the success case is a URL. What matters is that a+ * computer nobody can reach is an error rather than a quiet fallback: a client that shrugged and used+ * the shared address would put one Bot on another Bot's computer, which is the exact thing a supervisor exists+ * to prevent, and it would look like it was working.+ */++function clientWith(handler: (path: string) => Response) {+ return createSupervisorClient({+ baseUrl: "http://supervisor:4300",+ token: "t",+ fetchImpl: (async (url: string | URL | Request) =>+ handler(new URL(String(url)).pathname)) as unknown as typeof fetch,+ });+}++describe("locating a Bot's computer", () => {+ test("uses the address the supervisor reports", async () => {+ const client = clientWith(() =>+ Response.json({+ botId: "sales",+ container: "openbot-computer-sales",+ status: "running",+ url: "http://openbot-computer-sales:4100",+ }),+ );+ expect(await client.locate("sales")).toBe(+ "http://openbot-computer-sales:4100",+ );+ });++ test("falls back to a published port when there is no name to use", async () => {+ // A laptop: the server runs outside Docker, so the only way in is the published port.+ const client = clientWith(() =>+ Response.json({+ botId: "sales",+ container: "openbot-computer-sales",+ status: "running",+ port: 49213,+ }),+ );+ expect(await client.locate("sales")).toBe("http://localhost:49213");+ });++ test("a computer with no address at all is an error, not a fallback", async () => {+ const client = clientWith(() =>+ Response.json({+ botId: "sales",+ container: "openbot-computer-sales",+ status: "running",+ }),+ );+ expect(client.locate("sales")).rejects.toThrow(SupervisorError);+ });++ test("a refusal from the supervisor is reported in its own words", async () => {+ const client = clientWith(() =>+ Response.json(+ { error: "A bot id may contain only letters." },+ { status: 400 },+ ),+ );+ expect(client.locate("bad id")).rejects.toThrow(+ "A bot id may contain only letters.",+ );+ });++ test("an unreachable supervisor says so, rather than looking like a broken computer", async () => {+ // These are different problems for whoever has to fix them: one is the supervisor, the other is+ // the Bot's own container.+ const client = createSupervisorClient({+ baseUrl: "http://supervisor:4300",+ fetchImpl: (async () => {+ throw new Error("connection refused");+ }) as unknown as typeof fetch,+ });+ expect(client.locate("sales")).rejects.toThrow(/could not be reached/);+ });++ test("the bot id is escaped into the path", async () => {+ let seen = "";+ const client = createSupervisorClient({+ baseUrl: "http://supervisor:4300",+ fetchImpl: (async (url: string | URL | Request) => {+ seen = new URL(String(url)).pathname;+ return Response.json({ url: "http://c:4100" });+ }) as unknown as typeof fetch,+ });+ await client.locate("a/b");+ expect(seen).toBe("/computers/a%2Fb/ensure");+ });+});diff --git a/server/tests/computer-target.test.ts b/server/tests/computer-target.test.tsnew file mode 100644index 00000000..36456b31--- /dev/null+++ b/server/tests/computer-target.test.ts@@ -0,0 +1,79 @@+import { describe, expect, test } from "bun:test";+import { checkNavigationTarget } from "../src/computer/target";++describe("navigation targets", () => {+ test("allows an ordinary public address", () => {+ expect(checkNavigationTarget("https://example.com/pricing")).toEqual({+ allowed: true,+ url: "https://example.com/pricing",+ });+ });++ // Each of these is reachable from the Bot's container and not from the person's laptop, which is+ // the whole reason a browser running inside the deployment needs a floor under it.+ test.each([+ ["http://localhost:5432", "loopback by name"],+ ["http://127.0.0.1/admin", "loopback by address"],+ ["http://10.0.0.5/", "RFC1918 10/8"],+ ["http://192.168.1.1/", "RFC1918 192.168/16"],+ ["http://172.16.4.4/", "RFC1918 172.16/12"],+ ])("refuses %s (%s)", (url) => {+ const verdict = checkNavigationTarget(url);++ expect(verdict.allowed).toBe(false);+ expect(verdict.allowed === false && verdict.reason).toContain(+ "inside this deployment's own network",+ );+ });++ // Separated from the list above because these are refused under every configuration; the second+ // argument exercises the private-host opt-in explicitly.+ test.each([+ ["http://169.254.169.254/latest/meta-data/", "cloud metadata"],+ ["http://metadata.google.internal/", "cloud metadata by name"],+ ])("refuses %s (%s) even with private hosts allowed", (url) => {+ for (const allowPrivateHosts of [false, true]) {+ const verdict = checkNavigationTarget(url, { allowPrivateHosts });++ expect(verdict.allowed).toBe(false);+ expect(verdict.allowed === false && verdict.reason).toContain(+ "cloud credentials",+ );+ }+ });++ test("refuses a non-web scheme, naming it", () => {+ const verdict = checkNavigationTarget("file:///etc/passwd");++ expect(verdict.allowed).toBe(false);+ expect(verdict.allowed === false && verdict.reason).toBe(+ "Only web addresses are allowed, and that one is file.",+ );+ });++ test("refuses something that is not an address at all", () => {+ expect(checkNavigationTarget("open the pricing page")).toEqual({+ allowed: false,+ reason: "That is not a web address.",+ });+ });++ // A laptop deployment browses its own services on purpose. It has to be asked for explicitly, so+ // that a production deployment cannot reach its own network by forgetting a setting.+ test("allows private hosts only when the deployment opts in", () => {+ expect(checkNavigationTarget("http://localhost:3000").allowed).toBe(false);+ expect(+ checkNavigationTarget("http://localhost:3000", {+ allowPrivateHosts: true,+ }).allowed,+ ).toBe(true);+ });++ // 172.15 and 172.32 sit either side of the private range. Getting the boundary wrong in the safe+ // direction blocks real websites; in the unsafe direction it exposes the network.+ test("gets the edges of the 172.16/12 range right", () => {+ expect(checkNavigationTarget("http://172.15.0.1/").allowed).toBe(true);+ expect(checkNavigationTarget("http://172.32.0.1/").allowed).toBe(true);+ expect(checkNavigationTarget("http://172.31.255.255/").allowed).toBe(false);+ });+});diff --git a/server/tests/config.test.ts b/server/tests/config.test.tsnew file mode 100644index 00000000..722a5c2f--- /dev/null+++ b/server/tests/config.test.ts@@ -0,0 +1,156 @@+import { describe, expect, test } from "bun:test";+import { loadConfig } from "../src/config";++// Intelligence is part of the MINIMUM contract, so it belongs in the base environment every other+// case builds on. Leaving it out of the base would make most of this file assert the behaviour of a+// deployment that is not allowed to exist.+const baseEnvironment = {+ DATABASE_URL: "postgres://openbot:openbot@localhost:5432/openbot",+ KEY_ENCRYPTION_KEY: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",+ GOOGLE_OAUTH_CLIENT_ID: "google-client-id",+ GOOGLE_OAUTH_CLIENT_SECRET: "google-client-secret",+ BETTER_AUTH_SECRET: "a-long-enough-local-development-auth-secret",+ BETTER_AUTH_URL: "http://localhost:3001",+ INTELLIGENCE_API_URL: "http://localhost:7100",+ INTELLIGENCE_GATEWAY_WS_URL: "ws://localhost:7103",+ INTELLIGENCE_API_KEY: "tenant-api-key",+ COPILOTKIT_LICENSE_TOKEN: "license-token",+ MANAGED_AGENT_AG_UI_URL: " http://localhost:4200/ag-ui ",+};++describe("deployment configuration", () => {+ test("resolves the Intelligence runtime, which is the only runtime", () => {+ const config = loadConfig(baseEnvironment);++ expect(config.runtime).toEqual({+ mode: "intelligence",+ durableHistory: true,+ intelligence: {+ apiUrl: "http://localhost:7100",+ gatewayWsUrl: "ws://localhost:7103",+ apiKey: "tenant-api-key",+ licenseToken: "license-token",+ },+ });+ expect(config.managedAgentAgUiUrl).toEqual(+ new URL("http://localhost:4200/ag-ui"),+ );+ expect(config.tenantPackageDirectory).toBe("../examples/fintech");+ });++ test("allows deployment without an authentication provider", () => {+ const config = loadConfig({+ DATABASE_URL: baseEnvironment.DATABASE_URL,+ KEY_ENCRYPTION_KEY: baseEnvironment.KEY_ENCRYPTION_KEY,+ INTELLIGENCE_API_URL: baseEnvironment.INTELLIGENCE_API_URL,+ INTELLIGENCE_GATEWAY_WS_URL: baseEnvironment.INTELLIGENCE_GATEWAY_WS_URL,+ INTELLIGENCE_API_KEY: baseEnvironment.INTELLIGENCE_API_KEY,+ COPILOTKIT_LICENSE_TOKEN: baseEnvironment.COPILOTKIT_LICENSE_TOKEN,+ MANAGED_AGENT_AG_UI_URL: baseEnvironment.MANAGED_AGENT_AG_UI_URL,+ });++ expect(config.auth).toBeUndefined();+ });++ // The product does not have a mode without Intelligence, so each of these is a refusal to boot+ // rather than a degraded capability. Named individually because a deployment that sets three of+ // four is the likeliest real mistake, and the message has to say which one is missing.+ test.each([+ "INTELLIGENCE_API_URL",+ "INTELLIGENCE_GATEWAY_WS_URL",+ "INTELLIGENCE_API_KEY",+ "COPILOTKIT_LICENSE_TOKEN",+ ])("refuses to start when %s is missing", (name) => {+ const environment: Record<string, string | undefined> = {+ ...baseEnvironment,+ };+ delete environment[name];++ expect(() => loadConfig(environment)).toThrow(+ `CopilotKit Intelligence is required and is not configured. Missing: ${name}`,+ );+ });++ test("refuses to start when Intelligence is absent entirely, rather than degrading", () => {+ expect(() =>+ loadConfig({+ DATABASE_URL: baseEnvironment.DATABASE_URL,+ KEY_ENCRYPTION_KEY: baseEnvironment.KEY_ENCRYPTION_KEY,+ MANAGED_AGENT_AG_UI_URL: baseEnvironment.MANAGED_AGENT_AG_UI_URL,+ }),+ ).toThrow("CopilotKit Intelligence is required and is not configured");+ });++ test("rejects incomplete OAuth client configuration", () => {+ expect(() =>+ loadConfig({+ ...baseEnvironment,+ GOOGLE_OAUTH_CLIENT_ID: "google-client-id",+ GOOGLE_OAUTH_CLIENT_SECRET: "",+ }),+ ).toThrow(+ "Google OAuth configuration requires both client ID and client secret",+ );+ });++ test("refuses to start when MANAGED_AGENT_AG_UI_URL is missing", () => {+ const environment: Record<string, string | undefined> = {+ ...baseEnvironment,+ };+ delete environment.MANAGED_AGENT_AG_UI_URL;++ expect(() => loadConfig(environment)).toThrow("MANAGED_AGENT_AG_UI_URL");+ });++ test("refuses a non-HTTP MANAGED_AGENT_AG_UI_URL", () => {+ expect(() =>+ loadConfig({+ ...baseEnvironment,+ MANAGED_AGENT_AG_UI_URL: "ftp://localhost:4200/ag-ui",+ }),+ ).toThrow("MANAGED_AGENT_AG_UI_URL");+ });++ test("requires a base64-encoded 32-byte key-encryption key", () => {+ expect(() =>+ loadConfig({+ ...baseEnvironment,+ KEY_ENCRYPTION_KEY: "local-development-key",+ }),+ ).toThrow("KEY_ENCRYPTION_KEY must be a base64-encoded 32-byte key");+ });++ test("enables Google authentication when its complete deployment contract is present", () => {+ const config = loadConfig({+ ...baseEnvironment,+ GOOGLE_OAUTH_CLIENT_ID: "google-client-id",+ GOOGLE_OAUTH_CLIENT_SECRET: "google-client-secret",+ BETTER_AUTH_SECRET: "a-long-enough-local-development-auth-secret",+ BETTER_AUTH_URL: "http://localhost:3001",+ INITIAL_ADMIN_EMAILS: "[email protected], [email protected]",+ });++ expect(config.auth).toEqual({+ baseUrl: "http://localhost:3001",+ secret: "a-long-enough-local-development-auth-secret",+ google: {+ clientId: "google-client-id",+ clientSecret: "google-client-secret",+ },+ trustedOrigins: ["http://localhost:3000"],+ initialAdminEmails: ["[email protected]", "[email protected]"],+ });+ });++ test("rejects incomplete Google authentication deployment settings", () => {+ expect(() =>+ loadConfig({+ ...baseEnvironment,+ GOOGLE_OAUTH_CLIENT_ID: "google-client-id",+ GOOGLE_OAUTH_CLIENT_SECRET: "google-client-secret",+ BETTER_AUTH_SECRET: "",+ BETTER_AUTH_URL: "http://localhost:3001",+ }),+ ).toThrow("Google authentication requires BETTER_AUTH_SECRET");+ });+});diff --git a/server/tests/connectors.test.ts b/server/tests/connectors.test.tsnew file mode 100644index 00000000..81d3eab3--- /dev/null+++ b/server/tests/connectors.test.ts@@ -0,0 +1,135 @@+import { describe, expect, test } from "bun:test";+import { createApp } from "../src/app";+import { loadConfig } from "../src/config";+import { createConnectorCatalogService } from "../src/connectors";+import { testEnvironment } from "./support/environment";++const config = loadConfig(testEnvironment());++describe("admin connectors API", () => {+ test("accepts Google Drive service-account setup without returning the key", async () => {+ const received: unknown[] = [];+ const app = createApp(+ config,+ {+ handler: () => new Response(null, { status: 204 }),+ api: {+ getSession: async () => ({+ user: { id: "admin", email: "[email protected]" },+ }),+ },+ },+ { rolesForUser: async () => ["admin"] },+ undefined,+ undefined,+ undefined,+ {+ list: async () => [],+ configureGoogleDrive: async (input: unknown) => {+ received.push(input);+ return {+ id: "google-drive",+ type: "google_drive" as const,+ name: "Google Drive",+ roots: ["Policies"],+ configured: true,+ };+ },+ },+ );+ const serviceAccountJson = JSON.stringify({+ type: "service_account",+ private_key: "secret",+ });+ const response = await app.request(+ "http://openbot.local/api/admin/connectors/google-drive/setup",+ {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ serviceAccountJson,+ impersonationSubject: "[email protected]",+ }),+ },+ );+ expect(response.status).toBe(201);+ expect(await response.text()).not.toContain("secret");+ expect(received).toEqual([+ {+ serviceAccountJson,+ impersonationSubject: "[email protected]",+ actorUserId: "admin",+ },+ ]);+ });++ test("derives the available catalog from deployment knowledge sources", async () => {+ const service = createConnectorCatalogService([+ { type: "google-drive", roots: ["Policies"] },+ { type: "microsoft-onedrive", roots: ["Operations"] },+ ]);++ await expect(service.list()).resolves.toEqual([+ {+ id: "google-drive",+ type: "google_drive",+ name: "Google Drive",+ roots: ["Policies"],+ configured: false,+ },+ {+ id: "microsoft-onedrive",+ type: "onedrive",+ name: "Microsoft OneDrive",+ roots: ["Operations"],+ configured: false,+ },+ ]);+ });++ test("lists only deployment-seeded connector metadata", async () => {+ const app = createApp(+ config,+ {+ handler: () => new Response(null, { status: 204 }),+ api: {+ getSession: async () => ({+ user: { id: "admin", email: "[email protected]" },+ }),+ },+ },+ { rolesForUser: async () => ["admin"] },+ undefined,+ undefined,+ undefined,+ {+ list: async () => [+ {+ id: "google-drive",+ type: "google_drive" as const,+ name: "Google Drive",+ roots: ["Policies", "Compliance"],+ configured: false,+ },+ ],+ },+ );++ const response = await app.request(+ "http://openbot.local/api/admin/connectors",+ );++ expect(response.status).toBe(200);+ await expect(response.json()).resolves.toEqual({+ connectors: [+ {+ id: "google-drive",+ type: "google_drive",+ name: "Google Drive",+ roots: ["Policies", "Compliance"],+ configured: false,+ },+ ],+ });+ });+});diff --git a/server/tests/dev-actor.integration.test.ts b/server/tests/dev-actor.integration.test.tsnew file mode 100644index 00000000..9b4872ba--- /dev/null+++ b/server/tests/dev-actor.integration.test.ts@@ -0,0 +1,110 @@+import { afterAll, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { eq } from "drizzle-orm";+import { DEV_ACTOR, initializeDevActorUser } from "../src/auth/dev-actor";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import { users } from "../src/db/schema";++const databaseUrl =+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot";+const database = createDatabase(databaseUrl, TEST_POOL);++afterAll(async () => {+ await database.$client.close();+});++describe("development actor persistence", () => {+ test("does not access the database when disabled", async () => {+ const inaccessibleDatabase = {+ get insert(): never {+ throw new Error("disabled initialization accessed the database");+ },+ };++ expect(await initializeDevActorUser(inaccessibleDatabase, false)).toBe(+ false,+ );+ });++ test("writes only when enabled and restores the canonical user identity", async () => {+ const rollback = new Error("rollback development actor test");++ await expect(+ database.transaction(async (transaction) => {+ await transaction.delete(users).where(eq(users.id, DEV_ACTOR.id));++ expect(await initializeDevActorUser(transaction, false)).toBe(false);+ expect(+ await transaction+ .select()+ .from(users)+ .where(eq(users.id, DEV_ACTOR.id)),+ ).toEqual([]);++ expect(await initializeDevActorUser(transaction, true)).toBe(true);+ const firstRows = await transaction+ .select()+ .from(users)+ .where(eq(users.id, DEV_ACTOR.id));+ expect(firstRows).toHaveLength(1);+ expect(firstRows[0]).toMatchObject({+ id: DEV_ACTOR.id,+ email: DEV_ACTOR.email,+ name: DEV_ACTOR.name ?? DEV_ACTOR.email,+ emailVerified: false,+ groups: [],+ createdAt: expect.any(Date),+ updatedAt: expect.any(Date),+ });++ await transaction+ .update(users)+ .set({+ email: `changed-${randomUUID()}@example.test`,+ name: "Changed",+ })+ .where(eq(users.id, DEV_ACTOR.id));+ expect(await initializeDevActorUser(transaction, true)).toBe(true);++ const restoredRows = await transaction+ .select()+ .from(users)+ .where(eq(users.id, DEV_ACTOR.id));+ expect(restoredRows).toHaveLength(1);+ expect(restoredRows[0]).toMatchObject({+ id: DEV_ACTOR.id,+ email: DEV_ACTOR.email,+ name: DEV_ACTOR.name ?? DEV_ACTOR.email,+ });++ throw rollback;+ }),+ ).rejects.toBe(rollback);+ });++ test("fails loudly when another user owns the development email", async () => {+ const conflictingUserId = `dev-actor-conflict-${randomUUID()}`;++ await expect(+ database.transaction(async (transaction) => {+ await transaction.delete(users).where(eq(users.id, DEV_ACTOR.id));+ await transaction.insert(users).values({+ id: conflictingUserId,+ email: DEV_ACTOR.email,+ name: "Conflicting User",+ });++ await initializeDevActorUser(transaction, true);+ }),+ ).rejects.toThrow();++ expect(+ await database+ .select()+ .from(users)+ .where(eq(users.id, conflictingUserId)),+ ).toEqual([]);+ });+});diff --git a/server/tests/knowledge-acl.test.ts b/server/tests/knowledge-acl.test.tsnew file mode 100644index 00000000..e7608922--- /dev/null+++ b/server/tests/knowledge-acl.test.ts@@ -0,0 +1,30 @@+import { describe, expect, test } from "bun:test";+import { canRead } from "../src/knowledge/acl";++describe("knowledge ACL evaluation", () => {+ test("allows a matching user principal", () => {+ expect(+ canRead({ userId: "u1", groups: [] }, [+ { principal: "user:u1", effect: "allow" },+ ]),+ ).toBe(true);+ });++ test("fails closed for an unmatched or empty ACL", () => {+ expect(+ canRead({ userId: "u1", groups: ["finance"] }, [+ { principal: "group:engineering", effect: "allow" },+ ]),+ ).toBe(false);+ expect(canRead({ userId: "u1", groups: [] }, [])).toBe(false);+ });++ test("makes a matching deny override a matching allow", () => {+ expect(+ canRead({ userId: "u1", groups: ["finance"] }, [+ { principal: "group:finance", effect: "allow" },+ { principal: "user:u1", effect: "deny" },+ ]),+ ).toBe(false);+ });+});diff --git a/server/tests/policy-durability.integration.test.ts b/server/tests/policy-durability.integration.test.tsnew file mode 100644index 00000000..d767297c--- /dev/null+++ b/server/tests/policy-durability.integration.test.ts@@ -0,0 +1,101 @@+import { afterEach, describe, expect, test } from "bun:test";+import { eq } from "drizzle-orm";+import {+ createPolicyStore,+ DEFAULT_ACTION_POLICY,+} from "../src/computer/policy-store";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import { actionPolicy } from "../src/db/schema";++/**+ * The boundary has to survive a restart.+ *+ * A policy held only in memory means a rule an administrator adds is gone the next time the process+ * comes up, and nothing says so. The persisted row is the contract that keeps the boundary active+ * across process replacement.+ *+ * A restart is simulated by building a second store, which is what a restart is from this module's+ * point of view: a fresh process, the same configured default, the same database. Asserting through+ * one store would only prove it remembers what it was told a moment ago.+ */++const database = createDatabase(+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot",+ TEST_POOL,+);++const configured = DEFAULT_ACTION_POLICY;+const rule = 'intent == "activate" && contains(element.name, "submit")';++afterEach(async () => {+ await database.delete(actionPolicy).where(eq(actionPolicy.id, "current"));+});++describe("a boundary set while running", () => {+ test("is still there after a restart", async () => {+ const before = createPolicyStore(configured, database);+ await before.load();+ await before.set(+ { mode: "enforce", deny: [rule], allow: ["true"] },+ "[email protected]",+ );++ const after = createPolicyStore(configured, database);+ expect(await after.load()).toBe("the database");+ expect(after.get().deny).toEqual([rule]);+ });++ test("a deployment that never set one gets its configured default", async () => {+ const store = createPolicyStore(configured, database);+ expect(await store.load()).toBe("configuration");+ expect(store.get()).toEqual(configured);+ });++ test("resetting forgets it, so a restart returns to configuration", async () => {+ const store = createPolicyStore(configured, database);+ await store.set({ mode: "enforce", deny: [rule], allow: ["true"] });+ await store.reset();++ // The saved row is removed rather than overwritten, so changing what configuration says then+ // changes what is enforced, which is what an operator expects a reset to mean.+ const after = createPolicyStore(configured, database);+ expect(await after.load()).toBe("configuration");+ expect(after.get().deny).toEqual([]);+ });++ test("setting twice keeps one row and the latest rule", async () => {+ const store = createPolicyStore(configured, database);+ await store.set({ mode: "enforce", deny: ["first"], allow: ["true"] });+ await store.set({ mode: "dry-run", deny: ["second"], allow: ["true"] });++ const rows = await database.select().from(actionPolicy);+ // One boundary per deployment, by construction. Two rows would mean something has to choose.+ expect(rows).toHaveLength(1);+ expect(rows[0]?.mode).toBe("dry-run");+ expect(rows[0]?.deny).toEqual(["second"]);+ });++ test("records who changed it", async () => {+ const store = createPolicyStore(configured, database);+ await store.set(+ { mode: "enforce", deny: [rule], allow: ["true"] },+ "[email protected]",+ );++ const [row] = await database.select().from(actionPolicy);+ expect(row?.updatedBy).toBe("[email protected]");+ });++ test("without a database it still works, in memory", async () => {+ // A test about the decision logic must not need Postgres, and a deployment with no database has+ // bigger problems than an unsaved rule.+ const store = createPolicyStore(configured);+ expect(await store.load()).toBe("configuration");+ await store.set({ mode: "enforce", deny: [rule], allow: ["true"] });+ expect(store.get().deny).toEqual([rule]);+ await store.reset();+ expect(store.get()).toEqual(configured);+ });+});diff --git a/server/tests/roles.test.ts b/server/tests/roles.test.tsnew file mode 100644index 00000000..9002f8ac--- /dev/null+++ b/server/tests/roles.test.ts@@ -0,0 +1,16 @@+import { describe, expect, test } from "bun:test";+import { roleForEmail } from "../src/auth/roles";++describe("roleForEmail", () => {+ test("assigns an admin role to allowlisted addresses without case sensitivity", () => {+ expect(roleForEmail("[email protected]", ["[email protected]"])).toBe(+ "admin",+ );+ });++ test("assigns the user role to addresses outside the initial admin allowlist", () => {+ expect(roleForEmail("[email protected]", ["[email protected]"])).toBe(+ "user",+ );+ });+});diff --git a/server/tests/sandboxed-components.integration.test.ts b/server/tests/sandboxed-components.integration.test.tsnew file mode 100644index 00000000..33da49fd--- /dev/null+++ b/server/tests/sandboxed-components.integration.test.ts@@ -0,0 +1,148 @@+import { afterAll, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { eq } from "drizzle-orm";+import { createAuditStore } from "../src/audit";+import { createSandboxedStore } from "../src/components/sandboxed";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import { components, sandboxedComponents } from "../src/db/schema";++/**+ * A component authored in a browser can be edited freely and still reach nobody until it is+ * published, and its governance is the same governance as a compiled component's.+ *+ * These tests pin the draft gate. Publishing without a rebuild is what this table is+ * for, and it is also what puts an editor one keystroke away from changing what every Bot draws in+ * production. If a draft could ever be drawn, the feature would be a liability rather than a+ * capability, so that is asserted directly rather than inferred from the shape of the code.+ */++const database = createDatabase(+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot",+ TEST_POOL,+);++const suite = randomUUID().slice(0, 8).replace(/-/g, "");+const slug = `test_card_${suite}`;+const name = `custom_${slug}`;++const store = createSandboxedStore(database, createAuditStore(database));++afterAll(async () => {+ await database+ .delete(sandboxedComponents)+ .where(eq(sandboxedComponents.name, name));+ await database.delete(components).where(eq(components.name, name));+});++describe("authoring a component without a rebuild", () => {+ test("a saved draft is on the grant grid and is drawn by nobody", async () => {+ const saved = await store.save({+ slug,+ title: "A test card",+ description: "Draws a test card.",+ html: "<p>draft</p>",+ css: "p { color: red }",+ jsFunctions: "",+ argumentSchema: { type: "object" },+ sampleArguments: { a: 1 },+ by: "[email protected]",+ });++ expect(saved.name).toBe(name);+ expect(saved.published).toBe(false);++ // On the grant grid, so an administrator can decide about it before it can be drawn rather than+ // after. Unpublished and granted to nobody, which is how a compiled component arrives too.+ const [governance] = await database+ .select()+ .from(components)+ .where(eq(components.name, name));+ expect(governance?.kind).toBe("sandboxed");+ expect(governance?.published).toBe(false);+ expect(governance?.publishedDescription).toBeNull();++ // And nothing to draw with. This is the assertion that matters.+ const published = await store.published();+ expect(published.map((row) => row.name)).not.toContain(name);+ });++ test("publishing releases the source and the description together", async () => {+ const published = await store.publish(name, "[email protected]");+ expect(published.published).toBe(true);+ expect(published.publishedHtml).toBe("<p>draft</p>");+ expect(published.revision).toBe(1);++ const drawable = await store.published();+ expect(drawable.find((row) => row.name === name)?.html).toBe(+ "<p>draft</p>",+ );++ // The argument schema travels with the source. Without it the tool is registered with no+ // parameters, so the model is told the component takes nothing and calls it with nothing.+ expect(drawable.find((row) => row.name === name)?.argumentSchema).toEqual({+ type: "object",+ });++ // Both halves, because either on its own is an invalid publication state: a description with no markup+ // offers the model a component that draws the old version, and markup with no description leaves+ // a component no model is ever told about.+ const [governance] = await database+ .select()+ .from(components)+ .where(eq(components.name, name));+ expect(governance?.published).toBe(true);+ expect(governance?.publishedDescription).toBe("Draws a test card.");+ });++ test("editing after publishing changes the draft and not what is drawn", async () => {+ await store.save({+ slug,+ title: "A test card",+ description: "Draws a test card.",+ html: "<p>edited</p>",+ css: "p { color: red }",+ jsFunctions: "",+ argumentSchema: { type: "object" },+ sampleArguments: { a: 1 },+ by: "[email protected]",+ });++ const drawable = await store.published();+ // Still the published version. An edit is not a deployment.+ expect(drawable.find((row) => row.name === name)?.html).toBe(+ "<p>draft</p>",+ );++ const [record] = (await store.list()).filter((row) => row.name === name);+ expect(record.hasUnpublishedChanges).toBe(true);+ });++ test("a name that is not a name is refused", async () => {+ await expect(+ store.save({+ slug: "Not A Slug",+ title: "x",+ description: "",+ html: "",+ css: "",+ jsFunctions: "",+ argumentSchema: {},+ sampleArguments: {},+ by: "[email protected]",+ }),+ ).rejects.toThrow();+ });++ test("deleting takes the governance row with it", async () => {+ await store.remove(name, "[email protected]");+ const [governance] = await database+ .select()+ .from(components)+ .where(eq(components.name, name));+ // A governance row pointing at a component with no source is the "catalogue disagrees with the+ // build" state the components table exists to make visible.+ expect(governance).toBeUndefined();+ });+});diff --git a/server/tests/skill-ownership.integration.test.ts b/server/tests/skill-ownership.integration.test.tsnew file mode 100644index 00000000..b62c503b--- /dev/null+++ b/server/tests/skill-ownership.integration.test.ts@@ -0,0 +1,306 @@+import { afterAll, beforeAll, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { eq, inArray } from "drizzle-orm";+import { createAuditStore } from "../src/audit";+import type { ActionPolicy } from "../src/computer/policy";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import { agentProfiles, agents, skills, users } from "../src/db/schema";+import { createPluginRoutes } from "../src/plugins/routes";+import { createPluginStore } from "../src/plugins/store";++/**+ * Whose skill is whose, and which Bots a person may put one on.+ *+ * Any user may write a skill because a skill is an instruction rather than a capability: it can only+ * ask for tools the Bot already holds, and every one of those calls is still decided and audited.+ * The security property is scoping: a skill is visible to its author and reaches only Bots that+ * author owns.+ */++const database = createDatabase(+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot",+ TEST_POOL,+);++let policy: ActionPolicy = { mode: "enforce", deny: [], allow: ["true"] };++const store = createPluginStore({+ database,+ auditStore: createAuditStore(database),+ credentials: { readSecret: async () => null },+ encryptionKey: "x".repeat(44),+ policy: () => policy,+});++const suite = randomUUID().slice(0, 8);+const alice = `user_alice_${suite}`;+const bob = `user_bob_${suite}`;+const aliceBot = `agent_alice_${suite}`;+const sharedBot = `agent_shared_${suite}`;+const aliceSkill = `alice-skill-${suite}`;+const bobSkill = `bob-skill-${suite}`;+const deploymentSkill = `deployment-skill-${suite}`;++beforeAll(async () => {+ for (const [id, email] of [+ [alice, `alice-${suite}@example.test`],+ [bob, `bob-${suite}@example.test`],+ ]) {+ await database+ .insert(users)+ .values({ id: id as string, email: email as string, name: id as string })+ .onConflictDoNothing();+ }+ for (const [id, owner] of [+ [aliceBot, alice],+ // Unowned Bots are deployment-published Bots visible to every user.+ [sharedBot, null],+ ] as const) {+ await database+ .insert(agents)+ .values({ id, name: id, type: "remote_ag_ui", configuration: {} })+ .onConflictDoNothing();+ await database+ .insert(agentProfiles)+ .values({+ agentId: id,+ ownerUserId: owner,+ title: id,+ roleDescription: "For a test.",+ avatarSeed: id,+ visibility: "private",+ })+ .onConflictDoNothing();+ }++ const write = (slug: string, ownerUserId: string | null) =>+ store.installSkill({+ slug,+ title: slug,+ summary: "",+ instructions: "Do the thing.",+ ownerUserId,+ by: `${ownerUserId ?? "an administrator"}`,+ });+ await write(aliceSkill, alice);+ await write(bobSkill, bob);+ await write(deploymentSkill, null);+});++afterAll(async () => {+ await database+ .delete(skills)+ .where(+ inArray(skills.slug, [+ aliceSkill,+ bobSkill,+ deploymentSkill,+ `written-${suite}`,+ ]),+ );+ await database+ .delete(agents)+ .where(inArray(agents.id, [aliceBot, sharedBot]));+ await database.delete(users).where(inArray(users.id, [alice, bob]));+});++describe("what a person sees", () => {+ test("their own skills and the deployment's, and nobody else's", async () => {+ const slugs = (await store.listSkills({ id: alice, isAdmin: false })).map(+ (skill) => skill.slug,+ );++ expect(slugs).toContain(aliceSkill);+ expect(slugs).toContain(deploymentSkill);+ // The property the whole design rests on: one person's skill is not another person's business.+ expect(slugs).not.toContain(bobSkill);+ });++ test("an administrator sees every skill, including other people's", async () => {+ const slugs = (await store.listSkills({ id: alice, isAdmin: true })).map(+ (skill) => skill.slug,+ );++ expect(slugs).toContain(aliceSkill);+ expect(slugs).toContain(bobSkill);+ expect(slugs).toContain(deploymentSkill);+ });+});++describe("who owns what", () => {+ test("a skill written by a person belongs to that person", async () => {+ expect(await store.skillOwner(aliceSkill)).toBe(alice);+ });++ test("a skill written for the deployment belongs to nobody", async () => {+ expect(await store.skillOwner(deploymentSkill)).toBeNull();+ });++ test("a skill nobody wrote is absent rather than unowned", async () => {+ // Told apart from the line above, because "no such skill" and "the deployment's" are different+ // answers and a route that confuses them would let anybody edit a name nobody has taken.+ expect(await store.skillOwner(`nothing-${suite}`)).toBeUndefined();+ });++ test("a Bot somebody made belongs to them, and a published one to nobody", async () => {+ expect(await store.agentOwner(aliceBot)).toBe(alice);+ expect(await store.agentOwner(sharedBot)).toBeNull();+ expect(await store.agentOwner(`nothing_${suite}`)).toBeUndefined();+ });+});++describe("editing keeps ownership", () => {+ test("saving a skill again does not change whose it is", async () => {+ await store.installSkill({+ slug: aliceSkill,+ title: "Edited",+ summary: "",+ instructions: "Do the thing differently.",+ // What a route would send for somebody else. The insert must not honour it: whose a skill is+ // cannot be changed by re-saving it, or taking one would be a matter of typing the name.+ ownerUserId: bob,+ by: bob,+ });++ expect(await store.skillOwner(aliceSkill)).toBe(alice);+ });+});++/**+ * The rules as the HTTP surface enforces them, driven as a non-administrator.+ *+ * Driven here rather than through the running app because the shipped development default treats+ * every request as one local administrator, so every one of these checks short-circuits on a laptop+ * and a hole would stay hidden until a real identity provider is wired up.+ */+function routesAs(actor: {+ id: string;+ email: string;+ role: "admin" | "user";+}) {+ return createPluginRoutes(store as never, async (context, next) => {+ context.set("actor", actor as never);+ await next();+ });+}++const asAlice = () =>+ routesAs({ id: alice, email: "[email protected]", role: "user" });++const grantBody = (ref: string, agentId: string) => ({+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({ kind: "skill", ref, agentId }),+});++describe("what a person may do over HTTP", () => {+ test("writes their own skill", async () => {+ const response = await asAlice().request("/skills", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ slug: `written-${suite}`,+ title: "Written",+ instructions: "Do it.",+ }),+ });++ expect(response.status).toBe(200);+ expect(await store.skillOwner(`written-${suite}`)).toBe(alice);+ });++ test("cannot write one for the whole deployment", async () => {+ const response = await asAlice().request("/skills", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ slug: `global-${suite}`,+ title: "Global",+ instructions: "Do it.",+ global: true,+ }),+ });++ expect(response.status).toBe(403);+ expect(await store.skillOwner(`global-${suite}`)).toBeUndefined();+ });++ test("cannot edit or delete somebody else's", async () => {+ const edit = await asAlice().request("/skills", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ slug: bobSkill,+ title: "Taken",+ instructions: "Mine now.",+ }),+ });+ const remove = await asAlice().request(`/skills/${bobSkill}`, {+ method: "DELETE",+ });++ expect(edit.status).toBe(403);+ expect(remove.status).toBe(403);+ expect(await store.skillOwner(bobSkill)).toBe(bob);+ });++ test("cannot edit the deployment's, which is an administrator's to keep", async () => {+ const response = await asAlice().request(`/skills/${deploymentSkill}`, {+ method: "DELETE",+ });++ expect(response.status).toBe(403);+ expect(await store.skillOwner(deploymentSkill)).toBeNull();+ });++ test("puts their own skill on a Bot they own", async () => {+ const response = await asAlice().request(+ "/grants",+ grantBody(aliceSkill, aliceBot),+ );++ expect(response.status).toBe(200);+ const held = await store.listForAgent(aliceBot);+ expect(held.skills.map((skill) => skill.slug)).toContain(aliceSkill);+ });++ test("cannot put it on a Bot the deployment shares", async () => {+ // The one that matters most: a skill one person wrote would otherwise change how a Bot that+ // everybody uses answers everybody.+ const response = await asAlice().request(+ "/grants",+ grantBody(aliceSkill, sharedBot),+ );++ expect(response.status).toBe(403);+ expect((await store.listForAgent(sharedBot)).skills).toEqual([]);+ });++ test("cannot enable an MCP tool on anything", async () => {+ const response = await asAlice().request("/grants", {+ method: "POST",+ headers: { "content-type": "application/json" },+ body: JSON.stringify({+ kind: "mcp",+ ref: "slack/slack_search_public",+ agentId: aliceBot,+ }),+ });++ expect(response.status).toBe(403);+ expect((await store.listForAgent(aliceBot)).tools).toEqual([]);+ });++ test("sees the deployment's skills and their own, and not somebody else's", async () => {+ const body = (await (await asAlice().request("/")).json()) as {+ skills: { slug: string }[];+ };+ const slugs = body.skills.map((skill) => skill.slug);++ expect(slugs).toContain(aliceSkill);+ expect(slugs).toContain(deploymentSkill);+ expect(slugs).not.toContain(bobSkill);+ });+});diff --git a/server/tests/support/database.ts b/server/tests/support/database.tsnew file mode 100644index 00000000..541cc859--- /dev/null+++ b/server/tests/support/database.ts@@ -0,0 +1,12 @@+/**+ * How many connections one test file may hold.+ *+ * The suite runs in a single process, so every file that opens a pool holds it for the whole run and+ * the totals add up rather than take turns. Left at the driver's default the suite sat at 83 of+ * PostgreSQL's 100, which is not a limit anybody set and not one that shows up until a file is added+ * and something unrelated fails on a machine slower than the author's.+ *+ * Two, because a test that opens a transaction and reads inside it needs a second connection to do+ * so. A test that wants the deadlock that pinning to one exposes asks for `{ max: 1 }` itself.+ */+export const TEST_POOL = { max: 2 } as const;diff --git a/server/tests/support/environment.ts b/server/tests/support/environment.tsnew file mode 100644index 00000000..2422ef73--- /dev/null+++ b/server/tests/support/environment.ts@@ -0,0 +1,28 @@+/**+ * The minimum environment a deployment is allowed to boot with, for tests that need a config but are+ * not testing configuration itself.+ *+ * It lives in one place because the minimum is a moving target: Intelligence became mandatory and+ * five test files each carried their own copy of the environment, so every one of them started+ * failing for a reason that had nothing to do with what it was testing. Tests that assert on+ * configuration should keep building their environment inline; everything else should spread this.+ */+export function testEnvironment(+ overrides: Record<string, string | undefined> = {},+): Record<string, string | undefined> {+ return {+ DATABASE_URL: "postgres://openbot:openbot@localhost:5432/openbot",+ KEY_ENCRYPTION_KEY: "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",+ GOOGLE_OAUTH_CLIENT_ID: "google-client-id",+ GOOGLE_OAUTH_CLIENT_SECRET: "google-client-secret",+ BETTER_AUTH_SECRET: "a-long-enough-local-development-auth-secret",+ BETTER_AUTH_URL: "http://localhost:3001",+ // Required. See server/src/config.ts: there is no runtime without Intelligence.+ INTELLIGENCE_API_URL: "http://localhost:7100",+ INTELLIGENCE_GATEWAY_WS_URL: "ws://localhost:7103",+ INTELLIGENCE_API_KEY: "tenant-api-key",+ COPILOTKIT_LICENSE_TOKEN: "license-token",+ MANAGED_AGENT_AG_UI_URL: "http://localhost:4200/ag-ui",+ ...overrides,+ };+}diff --git a/server/tests/sync-persistence.integration.test.ts b/server/tests/sync-persistence.integration.test.tsnew file mode 100644index 00000000..db04500b--- /dev/null+++ b/server/tests/sync-persistence.integration.test.ts@@ -0,0 +1,97 @@+import { afterEach, describe, expect, test } from "bun:test";+import { randomUUID } from "node:crypto";+import { and, eq } from "drizzle-orm";+import { createSyncPersistence } from "../src/connectors/sync-persistence";+import { createDatabase } from "../src/db/client";+import { TEST_POOL } from "./support/database";+import { connectorInstances, credentials, documents } from "../src/db/schema";++const database = createDatabase(+ process.env.DATABASE_URL ??+ "postgres://openbot:openbot@localhost:5432/openbot",+ TEST_POOL,+);+const connectorIds: string[] = [];+const credentialIds: string[] = [];++afterEach(async () => {+ for (const connectorId of connectorIds.splice(0)) {+ await database+ .delete(connectorInstances)+ .where(eq(connectorInstances.id, connectorId));+ }+ for (const credentialId of credentialIds.splice(0)) {+ await database.delete(credentials).where(eq(credentials.id, credentialId));+ }+});++async function fixture() {+ const credentialId = randomUUID();+ const connectorId = randomUUID();+ await database.insert(credentials).values({+ id: credentialId,+ kind: "connector",+ provider: "test",+ encryptedValue: "test",+ keyId: "test",+ metadata: {},+ });+ await database.insert(connectorInstances).values({+ id: connectorId,+ type: "google_drive",+ credentialId,+ sourceMetadata: {},+ });+ connectorIds.push(connectorId);+ credentialIds.push(credentialId);+ return { connectorId, credentialId };+}++describe("sync persistence integration", () => {+ test("replays an upsert without duplicates, then deletes it with its cursor", async () => {+ const { connectorId } = await fixture();+ const persistence = createSyncPersistence(database, connectorId);+ const upsert = {+ kind: "upsert" as const,+ sourceId: "source-1",+ title: "Policy",+ canonicalUrl: "https://example.test/policy",+ contentHash: "v1",+ metadata: {},+ chunks: [+ { position: 0, content: "policy", embedding: Array(1536).fill(0) },+ ],+ acls: [{ principal: "group:finance", effect: "allow" as const }],+ };++ await persistence.persistBatch([upsert], "c1");+ await persistence.persistBatch([upsert], "c1");+ const rows = await database+ .select()+ .from(documents)+ .where(+ and(+ eq(documents.connectorInstanceId, connectorId),+ eq(documents.sourceId, "source-1"),+ ),+ );+ expect(rows).toHaveLength(1);+ expect(await persistence.cursor()).toBe("c1");++ await persistence.persistBatch(+ [{ kind: "delete", sourceId: "source-1" }],+ "c2",+ );+ const documentId = rows[0]?.id;+ if (!documentId) throw new Error("Expected the upserted document.");+ expect(+ (+ await database+ .select()+ .from(documents)+ .where(eq(documents.id, documentId))+ )[0]?.deletedAt,+ ).toBeInstanceOf(Date);+ expect(await persistence.cursor()).toBe("c2");+ });+});diff --git a/server/tests/thread-routes.test.ts b/server/tests/thread-routes.test.tsnew file mode 100644index 00000000..ba427d30--- /dev/null+++ b/server/tests/thread-routes.test.ts@@ -0,0 +1,57 @@+import { describe, expect, test } from "bun:test";+import { Hono } from "hono";+import type { MiddlewareHandler } from "hono";+import type { AppVariables } from "../src/auth/guards";+import { createThreadIdentity } from "../src/channels/thread-identity";+import { createThreadRoutes } from "../src/channels/thread-routes";++/**+ * Handing out a thread id for a conversation with no channel.+ *+ * The direct Bot chat needs one before it starts, and it has to come from here: a thread the chat+ * names itself is one nothing can later attribute to this deployment.+ */++const identity = createThreadIdentity("openbot-test");++const asSignedIn: MiddlewareHandler<{ Variables: AppVariables }> = async (+ context,+ next,+) => {+ context.set("actor", { id: "u1", email: "[email protected]" });+ return next();+};++function app() {+ return new Hono().route("/threads", createThreadRoutes(identity, asSignedIn));+}++async function mint() {+ const response = await app().request("http://openbot.local/threads/mint", {+ method: "POST",+ });+ return (await response.json()) as { threadId: string };+}++describe("minting a thread", () => {+ test("returns one this deployment can recognise later", async () => {+ const { threadId } = await mint();+ expect(identity.owns(threadId)).toBe(true);+ });++ test("returns a different one every time", async () => {+ const first = await mint();+ const second = await mint();+ expect(first.threadId).not.toBe(second.threadId);+ });++ test("does not answer a caller with no session", async () => {+ const refusing: MiddlewareHandler<{ Variables: AppVariables }> = async (+ context,+ ) => context.json({ error: "Unauthorized." }, 401);+ const response = await new Hono()+ .route("/threads", createThreadRoutes(identity, refusing))+ .request("http://openbot.local/threads/mint", { method: "POST" });+ expect(response.status).toBe(401);+ });+});diff --git a/spire/server.conf b/spire/server.confnew file mode 100644index 00000000..ae2c57a2--- /dev/null+++ b/spire/server.conf@@ -0,0 +1,39 @@+# The identity authority for this deployment.+#+# The workloads here are per-Bot containers rather than Kubernetes pods, so the agent attests with+# the docker plugin and selects on container labels.+#+# A single-tier CA with no upstream: SPIRE signs leaf SVIDs directly from the trust bundle root, so+# nothing has to reach a CA outside this deployment. That is what makes it work air-gapped, which is+# the deployment this product is for.+server {+ bind_address = "0.0.0.0"+ bind_port = "8081"+ trust_domain = "openbot.local"+ data_dir = "/opt/spire/data/server"+ log_level = "INFO"++ ca_key_type = "rsa-2048"+ ca_ttl = "720h"+ # An hour, so a stolen SVID stops working on its own. The agent renews long before it expires.+ default_x509_svid_ttl = "1h"+}++plugins {+ DataStore "sql" {+ plugin_data {+ database_type = "sqlite3"+ connection_string = "/opt/spire/data/server/datastore.sqlite3"+ }+ }++ KeyManager "disk" {+ plugin_data {+ keys_path = "/opt/spire/data/server/keys.json"+ }+ }++ NodeAttestor "join_token" {+ plugin_data {}+ }+}diff --git a/supervisor/package.json b/supervisor/package.jsonnew file mode 100644index 00000000..e2d0f89d--- /dev/null+++ b/supervisor/package.json@@ -0,0 +1,19 @@+{+ "name": "@openbot/supervisor",+ "license": "MIT",+ "private": true,+ "type": "module",+ "scripts": {+ "dev": "bun --watch src/index.ts",+ "start": "bun src/index.ts",+ "typecheck": "tsc --noEmit"+ },+ "dependencies": {+ "dockerode": "5.0.1",+ "hono": "^4.10.0"+ },+ "devDependencies": {+ "@types/dockerode": "4.0.1",+ "typescript": "^5.9.3"+ }+}diff --git a/supervisor/src/docker.ts b/supervisor/src/docker.tsnew file mode 100644index 00000000..7b3d551f--- /dev/null+++ b/supervisor/src/docker.ts@@ -0,0 +1,392 @@+import Docker from "dockerode";+import {+ BOT_LABEL,+ type ComputerNames,+ DEFAULT_NAMESPACE,+ NAMESPACE,+ NAMESPACE_LABEL,+ OWNER_LABEL,+} from "./names";++/**+ * The only Docker this service knows how to do.+ *+ * `dockerode` provides Engine API stream handling, error shapes and version negotiation.+ *+ * There is no passthrough. There is no generic "run this Docker call" here,+ * because the whole reason the API server does not hold the socket is that the socket is unrestricted+ * root on the host, a supervisor that forwarded arbitrary calls would hand that straight back+ * through a politer door. Four verbs, expressed in Bots, and nothing else.+ *+ * Every write is scoped by ownership. Containers are created carrying `openbot.supervisor`, and+ * stop, reset and inspect refuse anything without it. A container whose name happens to match but+ * lacks the label is treated as absent.+ */++const docker = new Docker(+ process.env.DOCKER_SOCKET+ ? { socketPath: process.env.DOCKER_SOCKET }+ : undefined,+);++/** The port the computer listens on inside its own container. */+const COMPUTER_PORT = "4100/tcp";++/**+ * How many times `ensure` will build a computer before giving up.+ *+ * One retry, because the only thing being retried is losing a race to another request for the same+ * Bot. A second loss means something else is removing the container, and retrying forever would hide+ * that behind a hung request.+ */+const ATTEMPTS = 2;++function statusOf(error: unknown): number | undefined {+ return (error as { statusCode?: number }).statusCode;+}++export type ComputerState = {+ botId: string;+ container: string;+ status: string;+ /** When this computer started, so a surface can say how long it has been up. */+ startedAt?: string;+ /** Its published port, when it has one. Absent on a shared network, where nothing is published. */+ port?: number;+ /** Where to reach it, however it is arranged. */+ url?: string;+};++export class DockerUnavailableError extends Error {+ constructor(cause: string) {+ super(+ `The supervisor could not reach Docker (${cause}). A computer cannot be started without it.`,+ );+ this.name = "DockerUnavailableError";+ }+}++export async function reachable(): Promise<boolean> {+ try {+ await docker.ping();+ return true;+ } catch {+ return false;+ }+}++function portOf(ports?: Docker.Port[] | undefined): number | undefined {+ const published = ports?.find((p) => p.PrivatePort === 4100)?.PublicPort;+ return published ?? undefined;+}++/**+ * Whether a labelled thing belongs to this deployment.+ *+ * Containers created before the namespace label existed carry the default namespace, so an existing+ * deployment keeps its own computers across an upgrade.+ */+function ours(labels: Record<string, string> | undefined): boolean {+ if (labels?.[OWNER_LABEL] !== "true") return false;+ return (labels[NAMESPACE_LABEL] ?? DEFAULT_NAMESPACE) === NAMESPACE;+}++/** The labels every container and volume this supervisor creates carries. */+function labelsFor(names: ComputerNames): Record<string, string> {+ return {+ [OWNER_LABEL]: "true",+ [BOT_LABEL]: names.botId,+ [NAMESPACE_LABEL]: NAMESPACE,+ };+}++/** Every computer this supervisor owns, and only those. */+export async function listOwned(): Promise<ComputerState[]> {+ try {+ const containers = (+ await docker.listContainers({+ all: true,+ filters: { label: [`${OWNER_LABEL}=true`] },+ })+ ).filter((container) => ours(container.Labels));+ return containers.map((container) => ({+ botId: container.Labels?.[BOT_LABEL] ?? "unknown",+ container: (container.Names?.[0] ?? "").replace(/^\//, ""),+ status: container.State,+ ...(container.Created+ ? { startedAt: new Date(container.Created * 1000).toISOString() }+ : {}),+ ...(portOf(container.Ports) ? { port: portOf(container.Ports) } : {}),+ }));+ } catch (error) {+ throw new DockerUnavailableError(String(error));+ }+}++/**+ * One computer, if this supervisor owns it.+ *+ * Ownership is checked here rather than at the call sites, so no verb can skip it by accident.+ */+async function inspectOwned(+ names: ComputerNames,+): Promise<{ status: string; port?: number } | null> {+ try {+ const info = await docker.getContainer(names.container).inspect();+ if (!ours(info.Config?.Labels)) return null;+ const published =+ info.NetworkSettings?.Ports?.[COMPUTER_PORT]?.[0]?.HostPort;+ return {+ status: info.State?.Status ?? "unknown",+ ...(published ? { port: Number.parseInt(published, 10) } : {}),+ };+ } catch (error) {+ if ((error as { statusCode?: number }).statusCode === 404) return null;+ throw new DockerUnavailableError(String(error));+ }+}++/**+ * Wait until the computer actually answers.+ *+ * "Started" and "ready" are not the same thing, and the gap is seconds: Docker reports running as+ * soon as the process exists, while the computer inside is still starting. A caller told a computer+ * is ready and then refused by it cannot tell that from a broken one, so `ensure` waits.+ *+ * Asked of Docker, not over the network. Reaching the computer directly needs an address, and which+ * address works depends on how the deployment is wired: `127.0.0.1:<published port>` is right only+ * when the supervisor runs on the host, and the container name resolves only when both containers+ * share a network.+ *+ * The image carries a HEALTHCHECK, so Docker already knows the answer and can be asked from anywhere+ * the supervisor can reach the socket, which it must, or it could not have created the container.+ */+async function waitUntilAnswering(+ container: string,+ timeoutMs = 60_000,+): Promise<void> {+ const deadline = Date.now() + timeoutMs;+ while (Date.now() < deadline) {+ try {+ const info = await docker.getContainer(container).inspect();+ const health = info.State?.Health?.Status;+ // An image without a HEALTHCHECK reports nothing. Waiting forever for an answer that will+ // never come would be worse than going ahead, so running is accepted as the best available.+ if (!health) {+ if (info.State?.Running) return;+ } else if (health === "healthy") {+ return;+ }+ } catch {+ // Mid-creation, or gone. The deadline is what ends this.+ }+ await new Promise((resolve) => setTimeout(resolve, 250));+ }+}++export type EnsureOptions = {+ image: string;+ /** Passed to the computer so a Bot's traffic still leaves by the route configured for it. */+ environment: string[];+ /** A network to join, when the supervisor runs alongside a compose stack. */+ network?: string;+ /**+ * The container runtime. Left unset this is Docker's default, which shares the host kernel.+ * Setting `runsc` runs each computer under gVisor, which intercepts syscalls in user space and is+ * the pragmatic middle ground for untrusted Bot code. A deployment that wants a kernel per Bot+ * points this at a microVM runtime instead.+ */+ runtime?: string;+ memoryBytes?: number;+ pidsLimit?: number;+ /**+ * The volume holding the SPIRE agent's Workload API socket, mounted read-only into each computer+ * so it can ask what it is. Unset means no identity, which is a deployment choice rather than a+ * failure.+ */+ spireSocketVolume?: string;+};++/**+ * Confinement applied to every computer.+ *+ * A container is a boundary only if it is configured as one. Each of these closes a specific route+ * off the host, and none of them costs a Bot anything it legitimately needs: a browser and a+ * filesystem under `/workspace`.+ */+function hostConfig(names: ComputerNames, options: EnsureOptions) {+ return {+ // The Bot's own storage. This is what turns the path confinement inside the computer from a+ // boundary between a Bot and the host into a boundary between one Bot and another.+ Binds: [+ `${names.profileVolume}:/profiles`,+ `${names.workspaceVolume}:/workspace`,+ // Read-only: a computer asks the agent what it is and has nothing to tell it.+ ...(options.spireSocketVolume+ ? [`${options.spireSocketVolume}:/tmp/spire-agent/public:ro`]+ : []),+ ],+ // On a shared network the computers are reached by name and nothing is published: a remote host+ // should not accumulate an open port per Bot. Off a network, a laptop, where the server runs+ // outside Docker, an ephemeral host port is the only way in, and it is reported back so nothing+ // has to guess and two computers never contend for the same number.+ ...(options.network+ ? {}+ : {+ // Loopback, not the world. An unqualified binding publishes on 0.0.0.0, which would put+ // every Bot's computer within reach of anything that can route to this machine. The token+ // the computer requires is the control; this keeps the surface off the network as well,+ // because both is the right number of locks on a browser holding somebody's logins.+ PortBindings: {+ [COMPUTER_PORT]: [{ HostIp: "127.0.0.1", HostPort: "" }],+ },+ }),+ RestartPolicy: { Name: "unless-stopped" },+ ...(options.network ? { NetworkMode: options.network } : {}),+ ...(options.runtime ? { Runtime: options.runtime } : {}),++ // No path from inside to more privilege than it started with, whatever it manages to run.+ SecurityOpt: ["no-new-privileges:true"],+ // Chromium needs none of these, and each is a documented container escape route.+ CapDrop: ["ALL"],+ // A runaway Bot is a resource problem for itself, not for every other Bot on the host.+ ...(options.memoryBytes ? { Memory: options.memoryBytes } : {}),+ PidsLimit: options.pidsLimit ?? 512,+ // Chromium's sandbox wants shared memory and will crash on the 64MB default.+ ShmSize: 1_073_741_824,+ };+}++/**+ * Make sure this Bot has a computer, and say where to reach it.+ *+ * Idempotent because the caller is a request handler that can run concurrently with itself: two+ * messages to one Bot at the same moment must not race into two containers. An existing owned+ * container is started if stopped, and otherwise left exactly as it is.+ */+export async function ensure(+ names: ComputerNames,+ options: EnsureOptions,+): Promise<ComputerState> {+ for (let attempt = ATTEMPTS; attempt > 0; attempt--) {+ const existing = await inspectOwned(names);++ if (!existing) {+ for (const volume of [names.profileVolume, names.workspaceVolume]) {+ try {+ await docker.createVolume({+ Name: volume,+ Labels: labelsFor(names),+ });+ } catch (error) {+ // Already exists is success for a restarted supervisor.+ if (statusOf(error) !== 409) {+ throw new DockerUnavailableError(String(error));+ }+ }+ }++ try {+ await docker.createContainer({+ name: names.container,+ Image: options.image,+ // The Bot id is a label because that is what a SPIRE docker workload attestor selects on:+ // an identity per Bot then falls out of the same fact that names the container.+ Labels: labelsFor(names),+ Env: options.environment,+ ExposedPorts: { [COMPUTER_PORT]: {} },+ HostConfig: hostConfig(names, options),+ });+ } catch (error) {+ // The other request creating the same computer got there first, which is what idempotent+ // means here. Its container is the one this request goes on to start.+ if (statusOf(error) !== 409) {+ throw new DockerUnavailableError(String(error));+ }+ }+ }++ if (existing?.status !== "running") {+ try {+ await docker.getContainer(names.container).start();+ } catch (error) {+ const status = statusOf(error);+ // Gone between creating it and starting it: a concurrent reset took the container away, or+ // the create this request lost the race to was itself rolled back. Nothing about the Bot has+ // changed, so the answer is to build it again rather than to report Docker as unreachable.+ if (status === 404 && attempt > 1) continue;+ // 304 is "already running", which is success for an idempotent verb.+ if (status !== 304) {+ throw new DockerUnavailableError(String(error));+ }+ }+ }++ const settled = await inspectOwned(names);+ await waitUntilAnswering(names.container);++ return {+ botId: names.botId,+ container: names.container,+ status: settled?.status ?? "unknown",+ ...(settled?.port ? { port: settled.port } : {}),+ // How to reach it. A name on a shared network, a host port otherwise, the caller does not have+ // to know which arrangement it is in.+ ...(options.network+ ? { url: `http://${names.container}:4100` }+ : settled?.port+ ? { url: `http://127.0.0.1:${settled.port}` }+ : {}),+ };+ }++ throw new DockerUnavailableError(+ `The computer for ${names.botId} was removed while it was being started.`,+ );+}++/** Stop this Bot's computer. Its storage is untouched, so its logins survive. */+export async function stop(names: ComputerNames): Promise<boolean> {+ if (!(await inspectOwned(names))) return false;+ try {+ // Long enough for Chromium to flush its profile, matching the compose grace period.+ await docker.getContainer(names.container).stop({ t: 30 });+ } catch (error) {+ const status = (error as { statusCode?: number }).statusCode;+ if (status !== 304 && status !== 404) {+ throw new DockerUnavailableError(String(error));+ }+ }+ return true;+}++/**+ * Throw this Bot's computer away so the next request builds a clean one.+ *+ * The profile goes with it. The workspace is left alone: files a Bot was asked to produce are work,+ * not browser state.+ */+export async function reset(names: ComputerNames): Promise<boolean> {+ if (!(await inspectOwned(names))) return false;++ try {+ await docker+ .getContainer(names.container)+ .remove({ force: true, v: false });+ } catch (error) {+ if ((error as { statusCode?: number }).statusCode !== 404) {+ throw new DockerUnavailableError(String(error));+ }+ }++ try {+ await docker.getVolume(names.profileVolume).remove();+ } catch (error) {+ const status = (error as { statusCode?: number }).statusCode;+ // 409 is "still in use", which resolves itself once the container is gone.+ if (status !== 404 && status !== 409) {+ throw new DockerUnavailableError(String(error));+ }+ }+ return true;+}diff --git a/supervisor/src/index.ts b/supervisor/src/index.tsnew file mode 100644index 00000000..78575a09--- /dev/null+++ b/supervisor/src/index.ts@@ -0,0 +1,180 @@+import { serve } from "bun";+import { Hono } from "hono";+import {+ DockerUnavailableError,+ ensure,+ listOwned,+ reachable,+ reset,+ stop,+} from "./docker";+import { registerEntry } from "./identity";+import { namesFor } from "./names";++/**+ * The container supervisor: the only thing here that holds the Docker socket.+ *+ * Giving a Bot its own container requires something to create containers. Access to the Docker+ * socket is root-equivalent on the host because a container can be started with the host filesystem+ * bound into it. Putting that in the API server would mean every bug in a request handler, every+ * injection through a Bot's own output and every dependency in a large tree sits one mistake away+ * from owning the machine.+ *+ * So the socket lives behind four verbs, expressed in Bots rather than in Docker: ensure a computer+ * for this Bot, stop it, reset it, list them. There is no passthrough and no way to name a container+ * directly, names are derived from the Bot id, which is validated first. A compromised API server+ * can ask for a Bot's computer to be restarted. It cannot ask for anything else, because nothing+ * else is expressible.+ *+ * The shared secret is not the boundary; the vocabulary is. `SUPERVISOR_TOKEN` keeps other+ * processes on the same network from driving it, but even with the token the worst available action+ * is cycling a computer that already belongs to a Bot.+ *+ * Refusing to start without it matches the computer. This process holds the Docker socket, which is+ * root on the host, so missing authentication is a deployment failure.+ */++const port = Number.parseInt(process.env.PORT ?? "4300", 10);+const token = process.env.SUPERVISOR_TOKEN?.trim();+if (!token) {+ console.error(+ "SUPERVISOR_TOKEN is not set. This process holds the Docker socket and will not start without the secret its caller must present.",+ );+ process.exit(1);+}+const image = process.env.COMPUTER_IMAGE ?? "openbot-agent-computer:latest";+const network = process.env.COMPUTER_NETWORK;+const runtime = process.env.COMPUTER_RUNTIME;+const memoryBytes = process.env.COMPUTER_MEMORY_BYTES+ ? Number.parseInt(process.env.COMPUTER_MEMORY_BYTES, 10)+ : undefined;+const spireSocketVolume = process.env.SPIRE_AGENT_SOCKET_VOLUME;++/**+ * What a computer is told about itself.+ *+ * The egress variables come through so a Bot's traffic still leaves by the route configured for it;+ * everything else a computer needs it already has. Nothing here is caller-supplied: a request says+ * which Bot, never what to run or what to set.+ */+function environmentFor(botId: string): string[] {+ const passthrough = Object.entries(process.env).filter(([key]) =>+ key.startsWith("EGRESS_PROXY"),+ );+ /*+ * The secret the computer demands of its callers. Handed to every container this creates, from+ * this process's own environment, so the server and the computers share one secret and nothing else+ * can drive a Bot's browser. Never caller-supplied: a request says which Bot, never what+ * to set.+ */+ const computerToken = process.env.COMPUTER_TOKEN;+ return [+ // Which Bot this container is. Read by the computer as the Bot to assume when a request does not+ // name one. It is normally named per request, so this is the fallback, and for a container that+ // exists to be one Bot's the fallback must be that Bot rather than the shared default.+ `COMPUTER_BOT_ID=${botId}`,+ // Without this the computer refuses to start; it must never answer an unauthenticated caller.+ ...(computerToken ? [`COMPUTER_TOKEN=${computerToken}`] : []),+ // Where to ask what it is. Absent, the computer reports no identity and carries on.+ ...(spireSocketVolume+ ? ["SPIFFE_ENDPOINT_SOCKET=/tmp/spire-agent/public/api.sock"]+ : []),+ ...passthrough.map(([key, value]) => `${key}=${value ?? ""}`),+ ];+}++const app = new Hono();++app.use("*", async (context, next) => {+ // Health is open so an orchestrator can check it without holding the token.+ if (context.req.path === "/health") return next();+ if (context.req.header("authorization") !== `Bearer ${token}`) {+ return context.json({ error: "Unauthorized." }, 401);+ }+ return next();+});++app.get("/health", async (context) =>+ context.json({ status: "ok", docker: await reachable() }),+);++/** The Bot id in the path, validated before it becomes any kind of name. */+function resolve(raw: string) {+ return namesFor(raw);+}++app.post("/computers/:botId/ensure", async (context) => {+ const parsed = resolve(context.req.param("botId"));+ if (!parsed.ok) return context.json({ error: parsed.reason }, 400);++ try {+ // Registered before the computer is handed out, so it can prove which Bot it is from its first+ // request.+ const identity = await registerEntry(parsed.names);++ const state = await ensure(parsed.names, {+ image,+ environment: environmentFor(parsed.names.botId),+ ...(network ? { network } : {}),+ ...(runtime ? { runtime } : {}),+ ...(memoryBytes ? { memoryBytes } : {}),+ ...(spireSocketVolume ? { spireSocketVolume } : {}),+ });+ return context.json({+ ...state,+ ...(identity.registered+ ? { spiffeId: identity.spiffeId }+ : { identity: identity.reason }),+ });+ } catch (error) {+ if (error instanceof DockerUnavailableError) {+ return context.json({ error: error.message }, 503);+ }+ throw error;+ }+});++app.post("/computers/:botId/stop", async (context) => {+ const parsed = resolve(context.req.param("botId"));+ if (!parsed.ok) return context.json({ error: parsed.reason }, 400);+ try {+ const stopped = await stop(parsed.names);+ return context.json({ stopped });+ } catch (error) {+ if (error instanceof DockerUnavailableError) {+ return context.json({ error: error.message }, 503);+ }+ throw error;+ }+});++app.post("/computers/:botId/reset", async (context) => {+ const parsed = resolve(context.req.param("botId"));+ if (!parsed.ok) return context.json({ error: parsed.reason }, 400);+ try {+ const wasThere = await reset(parsed.names);+ return context.json({ reset: wasThere });+ } catch (error) {+ if (error instanceof DockerUnavailableError) {+ return context.json({ error: error.message }, 503);+ }+ throw error;+ }+});++app.get("/computers", async (context) => {+ try {+ return context.json({ computers: await listOwned() });+ } catch (error) {+ if (error instanceof DockerUnavailableError) {+ return context.json({ error: error.message }, 503);+ }+ throw error;+ }+});++serve({ port, fetch: app.fetch, idleTimeout: 120 });++console.info(+ `Supervisor listening on http://localhost:${port} (image ${image}${runtime ? `, runtime ${runtime}` : ""})`,+);diff --git a/supervisor/tests/names.test.ts b/supervisor/tests/names.test.tsnew file mode 100644index 00000000..91821c43--- /dev/null+++ b/supervisor/tests/names.test.ts@@ -0,0 +1,98 @@+import { describe, expect, test } from "bun:test";+import {+ BOT_LABEL,+ DEFAULT_NAMESPACE,+ NAMESPACE,+ NAMESPACE_LABEL,+ namesFor,+ OWNER_LABEL,+} from "../src/names";++/**+ * What a Bot id may be.+ *+ * The supervisor turns an id into a container name and two volume names, so anything it accepts it+ * can also address. These tests are the boundary: a name that escapes this file is a name the+ * supervisor will happily stop or delete.+ */+describe("the ids a supervisor will accept", () => {+ test("an ordinary agent id is accepted and its names are derived", () => {+ const result = namesFor("agent_2aaf8f2f-0e53-4bb2");+ expect(result.ok).toBe(true);+ if (!result.ok) return;+ expect(result.names).toEqual({+ botId: "agent_2aaf8f2f-0e53-4bb2",+ container: `${NAMESPACE}-computer-agent_2aaf8f2f-0e53-4bb2`,+ profileVolume: `${NAMESPACE}-profile-agent_2aaf8f2f-0e53-4bb2`,+ workspaceVolume: `${NAMESPACE}-workspace-agent_2aaf8f2f-0e53-4bb2`,+ });+ });++ test("a name is never taken from the caller, only derived from the id", () => {+ // The caller says which Bot. It does not get to say which container, which is what stops+ // "ensure a computer for bot X" from becoming "operate on this container of my choosing".+ const result = namesFor("sales");+ expect(result.ok).toBe(true);+ if (result.ok)+ expect(result.names.container).toBe(`${NAMESPACE}-computer-sales`);+ });++ test("a slash is refused, because it would escape into another path segment", () => {+ // `/containers/{id}/stop`, an id containing a slash addresses something else entirely.+ expect(namesFor("bot/../postgres").ok).toBe(false);+ expect(namesFor("a/b").ok).toBe(false);+ });++ test("ids that could name somebody else's container are refused", () => {+ for (const id of [+ "openbot-postgres", // starts plausibly, still only ever becomes <namespace>-computer-*+ "../postgres",+ "postgres:latest", // a tag+ "bot id", // whitespace+ "bot.id", // dots invite `..` reasoning+ "-leading-hyphen",+ "",+ " ",+ ]) {+ const result = namesFor(id);+ if (result.ok) {+ // If it is accepted it must still be confined to the supervisor's own prefix.+ expect(+ result.names.container.startsWith(`${NAMESPACE}-computer-`),+ ).toBe(true);+ } else {+ expect(result.reason.length).toBeGreaterThan(0);+ }+ }+ // The specific ones that must be refused outright.+ expect(namesFor("../postgres").ok).toBe(false);+ expect(namesFor("postgres:latest").ok).toBe(false);+ expect(namesFor("bot id").ok).toBe(false);+ expect(namesFor("bot.id").ok).toBe(false);+ expect(namesFor("-leading-hyphen").ok).toBe(false);+ });++ test("a non-string is refused rather than coerced", () => {+ for (const id of [null, undefined, 42, {}, []]) {+ expect(namesFor(id).ok).toBe(false);+ }+ });++ test("an over-long id is refused", () => {+ expect(namesFor("a".repeat(65)).ok).toBe(false);+ expect(namesFor("a".repeat(64)).ok).toBe(true);+ });++ test("the ownership labels are stable", () => {+ // Stop and reset filter on these. Renaming one widens what the supervisor will act on.+ expect(OWNER_LABEL).toBe("openbot.supervisor");+ expect(BOT_LABEL).toBe("openbot.bot-id");+ expect(NAMESPACE_LABEL).toBe("openbot.namespace");+ });++ test("the default namespace is the one existing deployments already use", () => {+ // Containers created before the namespace existed carry no namespace label and are read as this+ // one, so changing it would orphan every computer a running deployment already owns.+ expect(DEFAULT_NAMESPACE).toBe("openbot");+ });+});diff --git a/tests/clean-checkout.test.ts b/tests/clean-checkout.test.tsnew file mode 100644index 00000000..9db3d571--- /dev/null+++ b/tests/clean-checkout.test.ts@@ -0,0 +1,80 @@+import { describe, expect, test } from "bun:test";+import { readFileSync } from "node:fs";+import { join } from "node:path";++/**+ * What a clone can do before anybody has configured it.+ *+ * Everything here is a property of the repository rather than of the machine it was cloned onto, and+ * each one has already shipped broken once: a dependency only a non-workspace package declared, so+ * nothing at the root resolved it, and a tenant package that named an environment variable, so+ * loading it needed a `.env` that a clone does not have. Both left `bun run test` failing for+ * everybody except the person who added them, whose checkout was already configured.+ */++const root = join(import.meta.dir, "..");++function manifest(path: string) {+ return JSON.parse(readFileSync(join(root, path, "package.json"), "utf8")) as {+ workspaces?: string[];+ dependencies?: Record<string, string>;+ devDependencies?: Record<string, string>;+ };+}++const rootManifest = manifest(".");+const workspaces = rootManifest.workspaces ?? [];++/** Packages with their own manifest that the root install does not reach. */+const OUTSIDE_THE_WORKSPACES = ["agent-computer", "supervisor"] as const;++describe("a clone that has only run bun install", () => {+ test.each(OUTSIDE_THE_WORKSPACES)(+ "can resolve everything %s imports in its tests",+ (packageName) => {+ // These are not workspace members, so their own node_modules is never installed by the root.+ // Anything their tested source imports has to be resolvable from the root instead.+ expect(workspaces).not.toContain(packageName);++ const declared = Object.keys(manifest(packageName).dependencies ?? {});+ const rootHas = {+ ...(rootManifest.dependencies ?? {}),+ ...(rootManifest.devDependencies ?? {}),+ };++ // Only what the root test run actually loads. Playwright is imported by the service entry+ // point, which no test imports, and it is installed inside the container image instead.+ const loadedByTests = declared.filter((name) => name === "yaml");+ for (const name of loadedByTests) {+ expect(rootHas).toHaveProperty(name);+ }+ },+ );++ test("can read the example tenant package with nothing set", () => {+ // `pretest` loads this package, so a name here with no fallback fails the suite before a single+ // test runs.+ const agents = readFileSync(+ join(root, "examples/fintech/agents.yaml"),+ "utf8",+ );+ const referenced = [+ ...agents.matchAll(/\$\{([A-Za-z_][A-Za-z0-9_]*)([^}]*)\}/g),+ ];++ expect(referenced.length).toBeGreaterThan(0);+ for (const [, name, rest] of referenced) {+ expect(+ rest.startsWith(":-"),+ `\${${name}} in agents.yaml has no fallback, so a clone with no .env cannot read it`,+ ).toBe(true);+ }+ });++ test("keeps every .env variant out of the repository", () => {+ // A backup taken beside .env carried live keys into a commit once.+ const ignored = readFileSync(join(root, ".gitignore"), "utf8");+ expect(ignored).toContain(".env.*");+ expect(ignored).toContain("!.env.example");+ });+});diff --git a/tests/fintech-package.test.ts b/tests/fintech-package.test.tsnew file mode 100644index 00000000..99953564--- /dev/null+++ b/tests/fintech-package.test.ts@@ -0,0 +1,21 @@+import { expect, test } from "bun:test";+import { existsSync, readFileSync } from "node:fs";+import { join } from "node:path";++const fintechDirectory = join(import.meta.dir, "..", "examples", "fintech");++test("includes the complete fintech deployment package example", () => {+ for (const fileName of [+ "brand.yaml",+ "agents.yaml",+ "channels.yaml",+ "model.yaml",+ "knowledge.yaml",+ ]) {+ expect(existsSync(join(fintechDirectory, fileName))).toBe(true);+ }++ expect(readFileSync(join(fintechDirectory, "brand.yaml"), "utf8")).toContain(+ "id: openbot",+ );+});diff --git a/tests/smoke/journey.test.ts b/tests/smoke/journey.test.tsnew file mode 100644index 00000000..69212258--- /dev/null+++ b/tests/smoke/journey.test.ts@@ -0,0 +1,164 @@+import { beforeAll, describe, expect, test } from "bun:test";++/**+ * One journey through a running deployment, over HTTP.+ *+ * Every other test in this repository proves a decision in isolation. This one proves the parts are+ * wired to each other: the server reaches the supervisor, the supervisor builds the Bot a computer,+ * the gateway decides before the browser acts, the browser acts, and the trail records it. Nearly+ * every defect worth catching late lives in those joins rather than inside any one of them.+ *+ * Not part of `bun run test`. It needs a deployment that is actually up, with a licence, a model key+ * and Docker, so it is asked for by name:+ *+ * bash scripts/start.sh+ * bun run test:smoke+ *+ * `OPENBOT_API_URL` points it at a deployment on other ports. Without `OPENBOT_SMOKE` the file is+ * skipped, so `bun run test` stays honest on a machine with nothing running.+ */++const asked = process.env.OPENBOT_SMOKE === "1";+const API = process.env.OPENBOT_API_URL ?? "http://localhost:3001";+const BOT = process.env.OPENBOT_SMOKE_BOT ?? "risk-analyst";++/** Long enough for a computer to be created and Chromium to answer on a cold deployment. */+const COMPUTER_TIMEOUT_MS = 180_000;++async function api(path: string, init?: RequestInit): Promise<Response> {+ return fetch(`${API}${path}`, {+ ...init,+ headers: { "content-type": "application/json", ...(init?.headers ?? {}) },+ });+}++async function json<T>(path: string, init?: RequestInit): Promise<T> {+ const response = await api(path, init);+ if (!response.ok) {+ throw new Error(+ `${init?.method ?? "GET"} ${path} answered ${response.status}: ${(await response.text()).slice(0, 200)}`,+ );+ }+ return (await response.json()) as T;+}++beforeAll(async () => {+ if (!asked) return;+ const reachable = await api("/api/capabilities")+ .then((response) => response.ok)+ .catch(() => false);+ if (!reachable) {+ throw new Error(+ `No deployment is answering at ${API}. Start one with \`bash scripts/start.sh\`, or set OPENBOT_API_URL.`,+ );+ }+});++describe.skipIf(!asked)("a deployment that is up", () => {+ test("reports the runtime it is actually running", async () => {+ const capabilities = await json<{ mode: string; durableHistory: boolean }>(+ "/api/capabilities",+ );+ expect(capabilities.mode).toBe("intelligence");+ expect(capabilities.durableHistory).toBe(true);+ });++ test("holds a licence the runtime accepts, and has Bots registered", async () => {+ // A licence the runtime refuses leaves the product running and quietly degraded, which is worth+ // failing a smoke test over.+ const info = await json<{+ licenseStatus: string;+ agents: Record<string, unknown>;+ }>("/api/copilotkit/info");+ expect(info.licenseStatus).toBe("valid");+ expect(Object.keys(info.agents).length).toBeGreaterThan(0);+ });++ test("mints thread ids that say which deployment they came from", async () => {+ const { threadId } = await json<{ threadId: string }>("/api/threads/mint", {+ method: "POST",+ });+ expect(threadId).toMatch(+ /^[0-9a-f]{8}-[0-9a-f]{4}-8[0-9a-f]{3}-[0-9a-f]{4}-[0-9a-f]{12}$/,+ );+ });+});++describe.skipIf(!asked)("a Bot acting on its computer", () => {+ test(+ "reaches a page through the gateway, and the trail records it",+ async () => {+ const before = Date.now();+ const result = await json<{ url: string; title: string }>(+ `/api/computers/${BOT}/navigate`,+ {+ method: "POST",+ body: JSON.stringify({ url: "https://example.com" }),+ },+ );+ expect(result.url).toContain("example.com");+ expect(result.title).toBe("Example Domain");++ // The screenshot proves the computer is really there rather than the navigate being answered+ // from somewhere else.+ const shot = await json<{ base64: string; width: number }>(+ `/api/computers/${BOT}/screenshot`,+ );+ expect(shot.base64.length).toBeGreaterThan(0);+ expect(shot.width).toBeGreaterThan(0);++ const trail = await json<{+ events: { eventType: string; createdAt: string }[];+ }>("/api/admin/audit-events?limit=25");+ const recorded = trail.events.some(+ (event) =>+ event.eventType.startsWith("computer.") &&+ Date.parse(event.createdAt) >= before - 60_000,+ );+ expect(recorded).toBe(true);+ },+ COMPUTER_TIMEOUT_MS,+ );++ test(+ "is refused by a boundary, and the refusal is recorded with its rule",+ async () => {+ const original = await json<{ policy: unknown }>("/api/computers/policy");+ const rule = 'contains(page.host, "example.com")';++ // The listing nests it under `policy`; the write takes the policy itself.+ await json("/api/computers/policy", {+ method: "PUT",+ body: JSON.stringify({+ mode: "enforce",+ deny: [rule],+ allow: ["true"],+ }),+ });++ try {+ const refused = await api(`/api/computers/${BOT}/navigate`, {+ method: "POST",+ body: JSON.stringify({ url: "https://example.com" }),+ });+ expect(refused.ok).toBe(false);+ expect((await refused.text()).toLowerCase()).toContain("policy");++ const trail = await json<{+ events: { eventType: string; payload: Record<string, unknown> }[];+ }>("/api/admin/audit-events?limit=25");+ const refusal = trail.events.find((event) =>+ event.eventType.includes("refused"),+ );+ expect(refusal).toBeDefined();+ } finally {+ // Whatever this deployment had before, it gets back, including on a failure above.+ await json("/api/computers/policy", {+ method: "PUT",+ body: JSON.stringify(original.policy),+ });+ }+ },+ COMPUTER_TIMEOUT_MS,+ );+});diff --git a/tsconfig.base.json b/tsconfig.base.jsonnew file mode 100644index 00000000..6522ef6c--- /dev/null+++ b/tsconfig.base.json@@ -0,0 +1,10 @@+{+ "compilerOptions": {+ "target": "ES2024",+ "module": "ESNext",+ "moduleResolution": "bundler",+ "strict": true,+ "skipLibCheck": true,+ "noEmit": true+ }+}diff --git a/worker/src/connector-runner.ts b/worker/src/connector-runner.tsnew file mode 100644index 00000000..ac941d86--- /dev/null+++ b/worker/src/connector-runner.ts@@ -0,0 +1,45 @@+import type {+ ConnectorAdapter,+ ConnectorChange,+} from "../../server/src/connectors/contract";++export type ConnectorPersistence = {+ cursor: () => Promise<string | null>;+ apply?: (change: ConnectorChange) => Promise<void>;+ commitCursor?: (cursor: string) => Promise<void>;+ persistBatch?: (+ changes: ConnectorChange[],+ cursor: string | null,+ ) => Promise<void>;+ recordRun?: (status: "succeeded" | "failed") => Promise<void>;+};++export async function runConnector(+ adapter: ConnectorAdapter,+ persistence: ConnectorPersistence,+ mode: "sync" | "reconcile" = "sync",+) {+ try {+ const discovered = await adapter.discover({+ cursor: await persistence.cursor(),+ mode,+ });+ if (persistence.persistBatch) {+ await persistence.persistBatch(discovered.changes, discovered.nextCursor);+ } else {+ if (!persistence.apply || !persistence.commitCursor) {+ throw new Error(+ "Connector persistence must support batch or individual writes.",+ );+ }+ for (const change of discovered.changes) await persistence.apply(change);+ if (discovered.nextCursor !== null) {+ await persistence.commitCursor(discovered.nextCursor);+ }+ }+ await persistence.recordRun?.("succeeded");+ } catch (error) {+ await persistence.recordRun?.("failed");+ throw error;+ }+}diff --git a/worker/src/status.ts b/worker/src/status.tsnew file mode 100644index 00000000..9f0a97fb--- /dev/null+++ b/worker/src/status.ts@@ -0,0 +1,3 @@+export function workerStatus() {+ return { status: "idle" } as const;+}diff --git a/worker/tests/connector-runner.test.ts b/worker/tests/connector-runner.test.tsnew file mode 100644index 00000000..0c6afdb8--- /dev/null+++ b/worker/tests/connector-runner.test.ts@@ -0,0 +1,77 @@+import { describe, expect, test } from "bun:test";+import { runConnector } from "../src/connector-runner";++describe("connector runner", () => {+ test("commits a cursor only after every discovered change succeeds", async () => {+ const applied: string[] = [];+ const cursors: string[] = [];++ await runConnector(+ {+ discover: async () => ({+ changes: [{ kind: "delete", sourceId: "one" }],+ nextCursor: "c1",+ }),+ },+ {+ cursor: async () => null,+ apply: async (change) => void applied.push(change.sourceId),+ commitCursor: async (cursor) => void cursors.push(cursor),+ },+ );++ expect(applied).toEqual(["one"]);+ expect(cursors).toEqual(["c1"]);+ });++ test("does not advance the cursor when a change fails", async () => {+ const cursors: string[] = [];++ await expect(+ runConnector(+ {+ discover: async () => ({+ changes: [{ kind: "delete", sourceId: "one" }],+ nextCursor: "c1",+ }),+ },+ {+ cursor: async () => null,+ apply: async () => {+ throw new Error("write failed");+ },+ commitCursor: async (cursor) => void cursors.push(cursor),+ },+ ),+ ).rejects.toThrow("write failed");++ expect(cursors).toEqual([]);+ });++ test("passes reconciliation mode to the adapter and records a successful run", async () => {+ const modes: string[] = [];+ const runs: string[] = [];++ await runConnector(+ {+ discover: async ({ mode }) => {+ modes.push(mode);+ return {+ changes: [{ kind: "delete", sourceId: "one" }],+ nextCursor: null,+ };+ },+ },+ {+ cursor: async () => "c1",+ apply: async () => undefined,+ commitCursor: async () => undefined,+ recordRun: async (status) => void runs.push(status),+ },+ "reconcile",+ );++ expect(modes).toEqual(["reconcile"]);+ expect(runs).toEqual(["succeeded"]);+ });+});diff --git a/worker/tsconfig.json b/worker/tsconfig.jsonnew file mode 100644index 00000000..4bd6962d--- /dev/null+++ b/worker/tsconfig.json@@ -0,0 +1,4 @@+{+ "extends": "../tsconfig.base.json",+ "include": ["src"]+}