Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
chore: remove unused code and legacy database tables (#8089)
Sean Aye58b1ff456a69
diff --git a/.sqlx/query-1780a52d3024ae99105fd28c74121b9a3611ea3ae3bf5edccebda195b52bead2.json b/.sqlx/query-1780a52d3024ae99105fd28c74121b9a3611ea3ae3bf5edccebda195b52bead2.jsondeleted file mode 100644index 59dfc222e7..0000000000--- a/.sqlx/query-1780a52d3024ae99105fd28c74121b9a3611ea3ae3bf5edccebda195b52bead2.json+++ /dev/null@@ -1,40 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n SELECT e.id, e.active, e.\"started_at\"::timestamptz as started_at, e.\"ended_at\"::timestamptz as ended_at\n FROM \"Experiment\" e\n JOIN \"ExperimentLog\" el ON e.id = el.experiment_id\n WHERE el.user_id = $1 AND e.active = true\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "active",- "type_info": "Bool"- },- {- "ordinal": 2,- "name": "started_at",- "type_info": "Timestamptz"- },- {- "ordinal": 3,- "name": "ended_at",- "type_info": "Timestamptz"- }- ],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": [- false,- false,- null,- null- ]- },- "hash": "1780a52d3024ae99105fd28c74121b9a3611ea3ae3bf5edccebda195b52bead2"-}diff --git a/.sqlx/query-3a4acf38ce09e3278ff2020de09c48267215a33e4c8d135319959aed14edbe63.json b/.sqlx/query-3a4acf38ce09e3278ff2020de09c48267215a33e4c8d135319959aed14edbe63.jsondeleted file mode 100644index d507796bee..0000000000--- a/.sqlx/query-3a4acf38ce09e3278ff2020de09c48267215a33e4c8d135319959aed14edbe63.json+++ /dev/null@@ -1,42 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n INSERT INTO \"ExperimentLog\" (experiment_id, user_id, \"group\")\n VALUES ($1, $2, $3)\n RETURNING experiment_id, user_id, \"group\" as experiment_group, completed\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "experiment_id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "user_id",- "type_info": "Text"- },- {- "ordinal": 2,- "name": "experiment_group",- "type_info": "Varchar"- },- {- "ordinal": 3,- "name": "completed",- "type_info": "Bool"- }- ],- "parameters": {- "Left": [- "Text",- "Text",- "Varchar"- ]- },- "nullable": [- false,- false,- false,- false- ]- },- "hash": "3a4acf38ce09e3278ff2020de09c48267215a33e4c8d135319959aed14edbe63"-}diff --git a/.sqlx/query-5553458fc15f58a3a981b54210e10ebf8de2788f357c3af3932a6516c235271e.json b/.sqlx/query-5553458fc15f58a3a981b54210e10ebf8de2788f357c3af3932a6516c235271e.jsondeleted file mode 100644index da513430f1..0000000000--- a/.sqlx/query-5553458fc15f58a3a981b54210e10ebf8de2788f357c3af3932a6516c235271e.json+++ /dev/null@@ -1,14 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n UPDATE \"Experiment\" SET active = false AND ended_at = NOW() WHERE id = $1\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": []- },- "hash": "5553458fc15f58a3a981b54210e10ebf8de2788f357c3af3932a6516c235271e"-}diff --git a/.sqlx/query-81f5ce2ce0be7f1460be990c23288fd34664ebdd528c147bf5e045879b4bb5a5.json b/.sqlx/query-81f5ce2ce0be7f1460be990c23288fd34664ebdd528c147bf5e045879b4bb5a5.jsondeleted file mode 100644index e71c23cf01..0000000000--- a/.sqlx/query-81f5ce2ce0be7f1460be990c23288fd34664ebdd528c147bf5e045879b4bb5a5.json+++ /dev/null@@ -1,76 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n SELECT\n sp.id as id,\n sp.\"linkShare\" as \"link_share?\",\n sp.\"linkShareAccessLevel\" as \"link_share_access_level?: AccessLevel\",\n sp.team_share_access_level as \"team_share_access_level?: AccessLevel\",\n m.\"user_id\" as owner,\n COALESCE(\n json_agg(json_build_object(\n 'channel_id', csp.\"channel_id\",\n 'access_level', csp.\"access_level\"\n )) FILTER (WHERE csp.\"channel_id\" IS NOT NULL),\n '[]'\n ) as \"channel_share_permissions?\"\n FROM\n \"MacroPromptPermission\" mpp\n JOIN \"SharePermission\" sp ON mpp.\"share_permission_id\" = sp.id\n JOIN \"MacroPrompt\" m ON mpp.\"macro_prompt_id\" = m.id\n LEFT JOIN \"ChannelSharePermission\" csp ON csp.\"share_permission_id\" = sp.id\n WHERE\n mpp.\"macro_prompt_id\" = $1\n GROUP BY\n sp.id, m.\"user_id\"\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "link_share?",- "type_info": "Text"- },- {- "ordinal": 2,- "name": "link_share_access_level?: AccessLevel",- "type_info": {- "Custom": {- "name": "\"AccessLevel\"",- "kind": {- "Enum": [- "view",- "comment",- "edit",- "owner"- ]- }- }- }- },- {- "ordinal": 3,- "name": "team_share_access_level?: AccessLevel",- "type_info": {- "Custom": {- "name": "\"AccessLevel\"",- "kind": {- "Enum": [- "view",- "comment",- "edit",- "owner"- ]- }- }- }- },- {- "ordinal": 4,- "name": "owner",- "type_info": "Text"- },- {- "ordinal": 5,- "name": "channel_share_permissions?",- "type_info": "Json"- }- ],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": [- false,- true,- true,- true,- false,- null- ]- },- "hash": "81f5ce2ce0be7f1460be990c23288fd34664ebdd528c147bf5e045879b4bb5a5"-}diff --git a/.sqlx/query-95a8a0117d0bbc25adf4dc08cf0cec40eaa0faddb4490ad14ae9cc6c4d922256.json b/.sqlx/query-95a8a0117d0bbc25adf4dc08cf0cec40eaa0faddb4490ad14ae9cc6c4d922256.jsondeleted file mode 100644index 8db9a4bf0c..0000000000--- a/.sqlx/query-95a8a0117d0bbc25adf4dc08cf0cec40eaa0faddb4490ad14ae9cc6c4d922256.json+++ /dev/null@@ -1,40 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n INSERT INTO \"Experiment\" (id)\n VALUES ($1)\n RETURNING id, active, \"started_at\"::timestamptz as started_at, \"ended_at\"::timestamptz as ended_at\n ",- "describe": {- "columns": [- {- "ordinal": 0,- "name": "id",- "type_info": "Text"- },- {- "ordinal": 1,- "name": "active",- "type_info": "Bool"- },- {- "ordinal": 2,- "name": "started_at",- "type_info": "Timestamptz"- },- {- "ordinal": 3,- "name": "ended_at",- "type_info": "Timestamptz"- }- ],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": [- false,- false,- null,- null- ]- },- "hash": "95a8a0117d0bbc25adf4dc08cf0cec40eaa0faddb4490ad14ae9cc6c4d922256"-}diff --git a/.sqlx/query-a63428b959703fdc38fa28667db9b2268827d7ce92ca55d21b38ba2a7a8b3c1c.json b/.sqlx/query-a63428b959703fdc38fa28667db9b2268827d7ce92ca55d21b38ba2a7a8b3c1c.jsondeleted file mode 100644index 53ea78a4fc..0000000000--- a/.sqlx/query-a63428b959703fdc38fa28667db9b2268827d7ce92ca55d21b38ba2a7a8b3c1c.json+++ /dev/null@@ -1,14 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n DELETE FROM \"Experiment\" WHERE id = $1\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": []- },- "hash": "a63428b959703fdc38fa28667db9b2268827d7ce92ca55d21b38ba2a7a8b3c1c"-}diff --git a/.sqlx/query-be483cff20705eb58c47cd4de412aea80ce9a658dfe055f146a38ed9e64effaf.json b/.sqlx/query-be483cff20705eb58c47cd4de412aea80ce9a658dfe055f146a38ed9e64effaf.jsondeleted file mode 100644index 54a8ba7d73..0000000000--- a/.sqlx/query-be483cff20705eb58c47cd4de412aea80ce9a658dfe055f146a38ed9e64effaf.json+++ /dev/null@@ -1,14 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n UPDATE \"Experiment\" SET active = true AND started_at = NOW() WHERE id = $1\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Text"- ]- },- "nullable": []- },- "hash": "be483cff20705eb58c47cd4de412aea80ce9a658dfe055f146a38ed9e64effaf"-}diff --git a/.sqlx/query-d81549c7156fb08cde5260f6196eb6a80bb82c9640845a835c6d32eea7e6dcad.json b/.sqlx/query-d81549c7156fb08cde5260f6196eb6a80bb82c9640845a835c6d32eea7e6dcad.jsondeleted file mode 100644index a51efcbe83..0000000000--- a/.sqlx/query-d81549c7156fb08cde5260f6196eb6a80bb82c9640845a835c6d32eea7e6dcad.json+++ /dev/null@@ -1,15 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n UPDATE \"ExperimentLog\"\n SET completed = true\n WHERE user_id = $1 AND experiment_id = $2\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Text",- "Text"- ]- },- "nullable": []- },- "hash": "d81549c7156fb08cde5260f6196eb6a80bb82c9640845a835c6d32eea7e6dcad"-}diff --git a/.sqlx/query-e11187ed1bd1944597258bbdefa8ec23de215edc1de1d020d418e2e89b17424e.json b/.sqlx/query-e11187ed1bd1944597258bbdefa8ec23de215edc1de1d020d418e2e89b17424e.jsondeleted file mode 100644index 155a235c83..0000000000--- a/.sqlx/query-e11187ed1bd1944597258bbdefa8ec23de215edc1de1d020d418e2e89b17424e.json+++ /dev/null@@ -1,14 +0,0 @@-{- "db_name": "PostgreSQL",- "query": "\n DELETE FROM \"OrganizationDefaultSharePermission\"\n WHERE \"organization_id\" = $1\n ",- "describe": {- "columns": [],- "parameters": {- "Left": [- "Int4"- ]- },- "nullable": []- },- "hash": "e11187ed1bd1944597258bbdefa8ec23de215edc1de1d020d418e2e89b17424e"-}diff --git a/apps/web/knip.ts b/apps/web/knip.tsindex 61ee34d549..ee74cfa08d 100644--- a/apps/web/knip.ts+++ b/apps/web/knip.ts@@ -11,6 +11,10 @@ const config: KnipConfig = {'src/lib/workers/**/*.{js,ts,tsx}',// Feature browser harnesses load from their own HTML and Playwright specs.'src/features/*/browser-test/*.{ts,tsx}',+ 'src/lib/core/component/LexicalMarkdown/component/decorator/browser-test/*.tsx',+ 'src/features/billing-lab/entry.tsx',+ // Native test runners are invoked by scripts, not the application graph.+ 'tests/native/{runner,links-runner,notifications-runner}.ts',],project: ['src/**/*.{js,ts,tsx}'],diff --git a/apps/web/package.json b/apps/web/package.jsonindex c8150bd375..68e2462bff 100644--- a/apps/web/package.json+++ b/apps/web/package.json@@ -63,7 +63,6 @@"@corvu/dialog": "^0.2.4","@corvu/drawer": "^0.2.4","@date-fns/tz": "^1.4.1",- "@dinero.js/currencies": "2.0.0-alpha.8","@effect/platform-browser": "4.0.0-rc.111","@floating-ui/dom": "^1.7.4","@fontsource-variable/inter": "^5.2.8",@@ -77,7 +76,6 @@"@ironcalc/wasm": "workspace:*","@kobalte/core": "^0.13.11","@leeoniya/ufuzzy": "^1.0.19",- "@lexical/extension": "0.45.0","@lexical/history": "0.45.0","@lexical/html": "0.45.0","@lexical/link": "0.45.0",@@ -142,7 +140,6 @@"date-fns": "^4.1.0","detect-browser": "^5.3.0","diff": "^9.0.0",- "dinero.js": "2.0.0-alpha.8","effect": "^4.0.0-rc.111","email-validator": "^2.0.4","emojibase-data": "^17.0.0",@@ -167,7 +164,6 @@"short-uuid": "^5.2.0","signature_pad": "^5.0.10","solid-custom-scrollbars": "^0.1.7",- "solid-gesture": "^0.0.3","solid-js": "^1.9.7","solid-styled-components": "^0.28.5","solid-transition-group": "^0.2.3",diff --git a/apps/web/patches/[email protected] b/apps/web/patches/[email protected]deleted file mode 100644index d3d1261484..0000000000--- a/apps/web/patches/[email protected]+++ /dev/null@@ -1,12 +0,0 @@-diff --git a/package.json b/package.json-index 655a413a6460d7a9e7b6c58a5ff4d146c58363a5..419989e05f44d4c7167b54aeae49fdfe61c5f7a1 100644---- a/package.json-+++ b/package.json-@@ -12,6 +12,7 @@- "types": "dist/types/index.d.ts",- "exports": {- ".": {-+ "types": "./dist/types/index.d.ts",- "solid": "./dist/source/index.jsx",- "default": "./dist/esm/index.js"- }diff --git a/apps/web/src/components/icon/animation.ts b/apps/web/src/components/icon/animation.tsdeleted file mode 100644index fe513022a1..0000000000--- a/apps/web/src/components/icon/animation.ts+++ /dev/null@@ -1,6 +0,0 @@-// How long mobile tap targets hold the `.animating` class after a press before clearing-// it (the animated icons are one-shot CSS animations driven by that class). Shared by all-// consumers that pulse an animated icon on tap, so the pulse window stays in sync and is-// long enough to cover the longest one-shot icon animation (currently the channel icon's-// 0.625s expand).-export const ICON_ANIMATION_DURATION_MS = 625;diff --git a/apps/web/src/components/icon/square-sidebar.tsx b/apps/web/src/components/icon/square-sidebar.tsxdeleted file mode 100644index 65cb67c8af..0000000000--- a/apps/web/src/components/icon/square-sidebar.tsx+++ /dev/null@@ -1,47 +0,0 @@-export const AnimatedSquareSidebarIcon = (props: {- triggerAnimation?: boolean;- class?: string;-}) => {- return (- <svg- width="100%"- height="100%"- viewBox="-1.5 -1.5 18 18"- fill="none"- stroke="currentColor"- stroke-width="1.125"- stroke-linecap="round"- stroke-linejoin="round"- xmlns="http://www.w3.org/2000/svg"- overflow="visible"- class={`animated-square-sidebar-icon ${props.triggerAnimation ? 'animating' : ''} ${props.class ?? ''}`}- >- {/*<title>Animated square sidebar icon</title>*/}- <style>{`- @keyframes square-sidebar-slide {- 0% { transform: translateX(0); }- 25% { transform: translateX(-3px); }- 50% { transform: translateX(-3px); }- 75% { transform: translateX(0); }- 100% { transform: translateX(0); }- }-- .animated-square-sidebar-icon.animating .sidebar-divider {- animation: square-sidebar-slide 0.6s ease-in-out;- }- `}</style>-- {/* Window frame */}- <rect x="0.5625" y="0.5625" width="13.875" height="13.875" rx="1.5" />-- {/* Vertical divider — slides left then back to toggle the sidebar */}- <line- class="sidebar-divider"- x1="5.25"- y1="0.5625"- x2="5.25"- y2="14.4375"- />- </svg>- );-};diff --git a/apps/web/src/components/kanban/kanban.docs.tsx b/apps/web/src/components/kanban/kanban.docs.tsxdeleted file mode 100644index f7a8eeaa90..0000000000--- a/apps/web/src/components/kanban/kanban.docs.tsx+++ /dev/null@@ -1,156 +0,0 @@-import { createSignal, For } from 'solid-js';-import {- Kanban,- KanbanCard,- KanbanCardInsertion,- KanbanHandle,- KanbanLane,-} from './kanban';--/** Query-free card and lane drag primitives, reusable by task or database boards. */-export default function KanbanExample() {- return (- <div class="flex flex-col gap-6">- <section>- <h2 class="text-sm font-semibold">Ordered cards and columns</h2>- <OrderedExample />- </section>- <section>- <h2 class="text-sm font-semibold">- Sorted cards, cross-column moves only- </h2>- <SortedCrossColumnExample />- </section>- </div>- );-}--function OrderedExample() {- const [lanes, setLanes] = createSignal(['Ideas', 'In progress', 'Done']);- const [cards, setCards] = createSignal([- { id: 'one', title: 'Plan the next release', lane: 'Ideas' },- { id: 'two', title: 'Review the design', lane: 'Ideas' },- { id: 'three', title: 'Share the prototype', lane: 'In progress' },- ]);-- let viewport: HTMLDivElement | undefined;-- return (- <Kanban- getViewport={() => viewport}- onDrop={(drop) => {- if (drop.kind === 'card') {- setCards((items) => {- const card = items.find((item) => item.id === drop.id);-- if (!card) {- return items;- }-- const next = items.filter((item) => item.id !== drop.id);- const before = next.findIndex((item) => item.id === drop.beforeId);- const insertionIndex = before < 0 ? next.length : before;-- next.splice(insertionIndex, 0, { ...card, lane: drop.toLane });- return next;- });- return;- }-- setLanes((items) => {- const next = [...items];- next.splice(next.indexOf(drop.fromLane), 1);-- const destinationIndex = next.indexOf(drop.toLane);- const insertionIndex =- destinationIndex + (drop.edge === 'after' ? 1 : 0);-- next.splice(insertionIndex, 0, drop.fromLane);- return next;- });- }}- >- <div ref={viewport} class="flex items-start gap-4 overflow-auto p-4">- <For each={lanes()}>- {(lane) => (- <KanbanLane id={lane} label={`${lane} lane`} canReorder>- <KanbanHandle- label={`Reorder ${lane}`}- class="px-2 py-3 text-sm font-medium"- >- {lane}- </KanbanHandle>- <div class="relative flex flex-col gap-2">- <For each={cards().filter((card) => card.lane === lane)}>- {(card) => (- <KanbanCard id={card.id} laneId={lane} canDrag>- <div class="p-3 text-sm">{card.title}</div>- </KanbanCard>- )}- </For>- <KanbanCardInsertion laneId={lane} />- </div>- </KanbanLane>- )}- </For>- </div>- </Kanban>- );-}--/** A sorted board owns order and changes only the card's column on drop. */-export function SortedCrossColumnExample() {- const columns = ['To do', 'In progress', 'Done'];- const [cards, setCards] = createSignal([- { id: 'one', title: 'Write tests', column: 'To do', priority: 2 },- { id: 'two', title: 'Review changes', column: 'To do', priority: 1 },- { id: 'three', title: 'Ship', column: 'In progress', priority: 3 },- ]);-- let viewport: HTMLDivElement | undefined;-- const cardsInColumn = (column: string) => {- return cards()- .filter((card) => card.column === column)- .sort((a, b) => a.priority - b.priority);- };-- return (- <Kanban- mode="cross-column"- getViewport={() => viewport}- onDrop={(drop) => {- setCards((items) => {- return items.map((card) => {- if (card.id !== drop.id) {- return card;- }-- return { ...card, column: drop.toLane };- });- });- }}- >- <div ref={viewport} class="flex items-start gap-4 overflow-auto p-4">- <For each={columns}>- {(column) => (- <KanbanLane id={column} label={`${column} column`}>- <h3 class="px-2 py-3 text-sm font-medium">{column}</h3>- <div class="flex flex-col gap-2">- <For each={cardsInColumn(column)}>- {(card) => (- <KanbanCard id={card.id} laneId={column} canDrag>- <div class="p-3 text-sm">- {card.title} · Priority {card.priority}- </div>- </KanbanCard>- )}- </For>- </div>- </KanbanLane>- )}- </For>- </div>- </Kanban>- );-}diff --git a/apps/web/src/features/agents-view/components/Menu.tsx b/apps/web/src/features/agents-view/components/Menu.tsxdeleted file mode 100644index 23bda2ff91..0000000000--- a/apps/web/src/features/agents-view/components/Menu.tsx+++ /dev/null@@ -1,105 +0,0 @@-import CheckIcon from '@phosphor/check.svg';-import {- type Accessor,- createSignal,- type JSX,- onCleanup,- onMount,- Show,-} from 'solid-js';--export type MenuHandle = {- open: Accessor<boolean>;- toggle: () => void;- close: () => void;-};--/**- * The design's anchored menu: a trigger and, while open, a panel positioned- * off the anchor by the stylesheet (above by default, `below` for toolbars).- * A pointer outside the anchor or Escape closes it.- */-export function MenuAnchor(props: {- id?: string;- class?: string;- style?: JSX.CSSProperties;- menuLabel: string;- menuClass?: string;- role?: 'listbox' | 'menu';- trigger: (menu: MenuHandle) => JSX.Element;- children: (close: () => void) => JSX.Element;-}) {- const [open, setOpen] = createSignal(false);- let anchor: HTMLDivElement | undefined;- const close = () => setOpen(false);- const toggle = () => setOpen((current) => !current);-- onMount(() => {- const onPointerDown = (event: PointerEvent) => {- if (!open()) return;- if (anchor?.contains(event.target as Node)) return;- close();- };- const onKeyDown = (event: KeyboardEvent) => {- if (event.key === 'Escape' && open()) close();- };- document.addEventListener('pointerdown', onPointerDown, true);- document.addEventListener('keydown', onKeyDown);- onCleanup(() => {- document.removeEventListener('pointerdown', onPointerDown, true);- document.removeEventListener('keydown', onKeyDown);- });- });-- return (- <div- ref={anchor}- id={props.id}- class={props.class ? `menu-anchor ${props.class}` : 'menu-anchor'}- style={props.style}- >- {props.trigger({ open, toggle, close })}- <Show when={open()}>- <div- class={props.menuClass ? `menu ${props.menuClass}` : 'menu'}- role={props.role ?? 'listbox'}- aria-label={props.menuLabel}- >- {props.children(close)}- </div>- </Show>- </div>- );-}--/** One row of a menu; the check mark shows on the chosen one. */-export function MenuOption(props: {- checked?: boolean;- disabled?: boolean;- class?: string;- style?: JSX.CSSProperties;- onSelect: () => void;- children: JSX.Element;-}) {- return (- <button- type="button"- class={props.class ? `opt ${props.class}` : 'opt'}- role="option"- aria-checked={props.checked ?? false}- aria-disabled={props.disabled || undefined}- style={props.style}- onClick={() => {- if (!props.disabled) props.onSelect();- }}- >- {props.children}- <CheckIcon class="ph tick" />- </button>- );-}--/** A group heading inside a menu. */-export function MenuGroup(props: { children: JSX.Element }) {- return <div class="grp">{props.children}</div>;-}diff --git a/apps/web/src/features/block-canvas/views/asset-picker.tsx b/apps/web/src/features/block-canvas/views/asset-picker.tsxdeleted file mode 100644index 9cc3104adb..0000000000--- a/apps/web/src/features/block-canvas/views/asset-picker.tsx+++ /dev/null@@ -1,105 +0,0 @@-import { fileTypeToBlockName } from '@core/constant/allBlocks';-import { useHistoryQuery } from '@queries/history/history';-import { createMemo, createSignal, Show } from 'solid-js';-import { VList } from 'virtua/solid';-import type { CanvasAsset } from '../core/assets';-import { canEmbedDocument } from '../core/document-display';--export function CanvasAssetPicker(props: {- mode: 'media' | 'document' | 'embed';- onSelect: (asset: CanvasAsset) => void;- onFiles: (files: File[]) => void;- onClose: () => void;-}) {- const history = useHistoryQuery();- const [search, setSearch] = createSignal('');- const items = createMemo(() =>- (history.isSuccess ? (history.data ?? []) : []).flatMap((item) => {- if (item.type !== 'document' || !item.fileType) return [];- if (props.mode === 'embed' && !canEmbedDocument(item.fileType)) return [];- const kind = fileTypeToBlockName(item.fileType);- if (props.mode === 'media' && kind !== 'image' && kind !== 'video')- return [];- if (!item.name.toLowerCase().includes(search().toLowerCase())) return [];- return [{ id: item.id, name: item.name, fileType: item.fileType }];- })- );- return (- <section- aria-label={props.mode === 'media' ? 'Insert media' : 'Insert document'}- class="absolute right-4 top-4 z-30 flex max-h-[80%] w-80 flex-col gap-3 rounded-xl border border-edge-muted bg-panel p-3 shadow-lg"- on:keydown={(event) => {- event.stopPropagation();- if (event.key === 'Escape') props.onClose();- }}- >- <div class="flex items-center justify-between text-sm font-medium">- {props.mode === 'media'- ? 'Image or video'- : props.mode === 'embed'- ? 'Embed document or canvas'- : 'Document preview'}- <button- type="button"- aria-label="Close insert menu"- class="rounded px-2 py-1 hover:bg-hover"- onClick={props.onClose}- >- ×- </button>- </div>- <Show when={props.mode === 'media'}>- <label class="rounded border border-edge-muted p-2 text-xs">- Upload image or video- <input- type="file"- multiple- accept="image/*,video/*,.heic,.heif"- aria-label="Upload canvas media"- class="mt-2 block w-full text-xs"- onChange={(event) => {- props.onFiles(Array.from(event.currentTarget.files ?? []));- event.currentTarget.value = '';- }}- />- </label>- </Show>- <input- type="search"- aria-label="Search workspace files"- placeholder="Search your files…"- class="rounded border border-edge-muted bg-input px-3 py-2 text-sm"- value={search()}- onInput={(event) => setSearch(event.currentTarget.value)}- />- <div class="min-h-0 overflow-y-auto">- <Show- when={!history.isPending}- fallback={<p class="p-2 text-xs text-ink-muted">Loading files…</p>}- >- <Show- when={items().length}- fallback={- <p class="p-2 text-xs text-ink-muted">- {history.isError ? 'Could not load files' : 'No matching files'}- </p>- }- >- <VList data={items()} style={{ height: '320px' }}>- {(item) => (- <button- type="button"- class="flex w-full items-center gap-2 rounded p-2 text-left text-xs hover:bg-hover"- onClick={() => props.onSelect(item)}- >- <span class="min-w-0 flex-1 truncate">{item.name}</span>- <span class="text-ink-muted">{item.fileType}</span>- </button>- )}- </VList>- </Show>- </Show>- </div>- </section>- );-}diff --git a/apps/web/src/features/block-pdf/util/StringUtils.ts b/apps/web/src/features/block-pdf/util/StringUtils.tsdeleted file mode 100644index 7f0b2a5bc5..0000000000--- a/apps/web/src/features/block-pdf/util/StringUtils.ts+++ /dev/null@@ -1,44 +0,0 @@-import { USD } from '@dinero.js/currencies';-import { dinero, type Transformer, toFormat } from 'dinero.js';--/**- * Must escape query string for use in regex (in case it has a '(' or ')'- * character, for example)- */-export function cleanQuery(str: string): string {- // NOTE "$&"" means the whole matched string- return str.toLowerCase().replace(/[.*+?^${}()|[\]\\]/g, '\\$&');-}--export function makePretty(text: string): string {- return text- .split(' ')- .map((s) => s.charAt(0).toUpperCase() + s.substring(1))- .join(' ');-}--const transformer: Transformer<number> = ({ amount }) => `$${amount}/month`;-// add decimals to integer price, allow undefined to support optional chaining syntax-export function formatPriceString(price?: {- unit_amount: number;- currency: string;-}): string | undefined {- if (typeof price === 'undefined') return;-- const p = dinero({ amount: price.unit_amount!, currency: USD, scale: 2 });- return toFormat(p, transformer);-}--// turn an interger timestamp until a days until string-export function daysUntil(stamp: number) {- const d = new Date(stamp * 1000).getTime();- const now = Date.now();-- const secs = Math.abs(d - now) / 1000;- return Math.ceil(secs / 86400);-}--export const capitalize = (word: string) => {- if (!word) return word;- return word.charAt(0).toUpperCase() + word.slice(1);-};diff --git a/apps/web/src/features/block-pdf/util/arrayUtils.ts b/apps/web/src/features/block-pdf/util/arrayUtils.tsdeleted file mode 100644index a1cd579ca0..0000000000--- a/apps/web/src/features/block-pdf/util/arrayUtils.ts+++ /dev/null@@ -1,53 +0,0 @@-/**- * Insert item at specified index (and shift all other items down)- *- * Returns a new array (does not edit original array)- */-export function withItemAtIndex<P>(arr: P[], item: P, index: number): P[] {- if (index < 0) {- console.error('index cannot be less than 0');- }- if (index > arr.length) {- console.error('index cannot be greater than array length');- }-- return [...arr.slice(0, index), item, ...arr.slice(index)];-}--export function areEqual(a: any[], b: any[]): boolean {- if (a === b) return true;- if (a.length !== b.length) return false;-- const len = a.length;- for (let i = 0; i < len; ++i) {- if (!Object.is(a[i], b[i])) return false;- }-- return true;-}--/**- * simple and immutable array move util- * @param input - input array- * @param from - the target index to move the item from- * @param to - the target index to move the item to- * @returns - copy of the passed array with modifications applied- */-export function move<T>(input: Array<T>, from: number, to: number): Array<T> {- const output = [] as T[];- // no modification required- if (from === to) return input;- const mod = from > to ? -1 : 1;- for (let i = 0; i < input.length; i += 1) {- if (i === to) {- output.push(input[from]);- } else if (i === from) {- output.push(input[i + mod]);- } else if ((i < to && i > from) || (i > to && i < from)) {- output.push(input[i + mod]);- } else {- output.push(input[i]);- }- }- return output;-}diff --git a/apps/web/src/features/block-pptx/components/editor-toolbar.tsx b/apps/web/src/features/block-pptx/components/editor-toolbar.tsxdeleted file mode 100644index c5a9f8abfd..0000000000--- a/apps/web/src/features/block-pptx/components/editor-toolbar.tsx+++ /dev/null@@ -1,448 +0,0 @@-/**- * The editing toolbar: history, insertion, text and shape formatting, and- * saving. Presentational: every action is a callback.- */--import ArrowClockwise from '@phosphor/arrow-clockwise.svg';-import ArrowCounterClockwise from '@phosphor/arrow-counter-clockwise.svg';-import ArrowRightIcon from '@phosphor/arrow-right.svg';-import CaretDown from '@phosphor/caret-down.svg';-import CircleIcon from '@phosphor/circle.svg';-import CloudCheck from '@phosphor/cloud-check.svg';-import DownloadSimple from '@phosphor/download-simple.svg';-import ImageIcon from '@phosphor/image.svg';-import ListBullets from '@phosphor/list-bullets.svg';-import Minus from '@phosphor/minus.svg';-import PaintBucket from '@phosphor/paint-bucket.svg';-import Plus from '@phosphor/plus.svg';-import ShapesIcon from '@phosphor/shapes.svg';-import SquareIcon from '@phosphor/square.svg';-import StarIcon from '@phosphor/star.svg';-import TableIcon from '@phosphor/table.svg';-import TextAa from '@phosphor/text-aa.svg';-import AlignCenter from '@phosphor/text-align-center.svg';-import AlignLeft from '@phosphor/text-align-left.svg';-import AlignRight from '@phosphor/text-align-right.svg';-import TextB from '@phosphor/text-b.svg';-import TextItalic from '@phosphor/text-italic.svg';-import TextT from '@phosphor/text-t.svg';-import TextUnderline from '@phosphor/text-underline.svg';-import TriangleIcon from '@phosphor/triangle.svg';-import WarningIcon from '@phosphor/warning.svg';-import { Button, type ButtonProps } from '@ui/components/Button';-import { createSignal, For, type JSX, onCleanup, Show } from 'solid-js';-import type { TextFormatState } from '../core/formatting';-import type { Swatch } from '../core/palette';-import type { SaveState } from '../primitives/create-presentation-session';--function ToolButton(props: ButtonProps) {- return (- <Button variant="ghost" size="icon-sm" class="size-7 p-1" {...props} />- );-}--function Divider() {- return (- <div aria-hidden="true" class="mx-1 h-5 w-px shrink-0 bg-edge-muted" />- );-}--/** A button that opens a small panel below it. */-function Popover(props: {- label: string;- icon: JSX.Element;- disabled?: boolean;- testId?: string;- children: (close: () => void) => JSX.Element;-}) {- const [open, setOpen] = createSignal(false);- let root!: HTMLDivElement;- const onDocumentDown = (e: PointerEvent) => {- if (!root.contains(e.target as Node)) setOpen(false);- };- document.addEventListener('pointerdown', onDocumentDown);- onCleanup(() => document.removeEventListener('pointerdown', onDocumentDown));- return (- <div ref={root} class="relative">- <Button- variant="ghost"- size="sm"- class="h-7 gap-0.5 px-1.5"- label={props.label}- tooltip={props.label}- disabled={props.disabled}- data-testid={props.testId}- aria-expanded={open()}- onClick={() => setOpen((o) => !o)}- >- {props.icon}- <CaretDown class="size-3" />- </Button>- <Show when={open()}>- <div class="absolute top-full left-0 z-50 mt-1 rounded-lg border border-edge-muted bg-surface p-1.5 shadow-lg">- {props.children(() => setOpen(false))}- </div>- </Show>- </div>- );-}--function SwatchGrid(props: {- swatches: Swatch[];- onPick: (value: string) => void;-}) {- return (- <div class="grid grid-cols-6 gap-1">- <For each={props.swatches}>- {(swatch) => (- <button- type="button"- title={swatch.label}- aria-label={swatch.label}- class="size-5 rounded-sm border border-edge-muted"- style={{ background: swatch.css }}- onClick={() => props.onPick(swatch.value)}- />- )}- </For>- </div>- );-}--const INSERTABLE_SHAPES = [- { preset: 'rect', label: 'Rectangle', icon: SquareIcon },- { preset: 'roundRect', label: 'Rounded rectangle', icon: SquareIcon },- { preset: 'ellipse', label: 'Oval', icon: CircleIcon },- { preset: 'triangle', label: 'Triangle', icon: TriangleIcon },- { preset: 'rightArrow', label: 'Arrow', icon: ArrowRightIcon },- { preset: 'star5', label: 'Star', icon: StarIcon },-] as const;--export interface EditorToolbarProps {- readonly: boolean;- canUndo: boolean;- canRedo: boolean;- onUndo: () => void;- onRedo: () => void;- onInsertTextBox: () => void;- onInsertShape: (preset: string) => void;- onInsertImage: (file: File) => void;- onInsertTable: () => void;- /** Text formatting applies (a text shape is selected or being edited). */- textActive: boolean;- format: TextFormatState;- onToggle: (key: 'bold' | 'italic' | 'underline') => void;- onFontSize: (direction: 1 | -1) => void;- onTextColor: (value: string) => void;- onAlign: (align: 'left' | 'center' | 'right') => void;- onToggleBullets: () => void;- /** Shape formatting applies (a shape is selected). */- shapeActive: boolean;- onFill: (value: string | null) => void;- swatches: Swatch[];- saveState: SaveState;- onSave: () => void;- onDownload: () => void;- /** Keep keyboard focus in the text being edited while clicking. */- keepFocus: boolean;-}--export function EditorToolbar(props: EditorToolbarProps) {- let fileInput!: HTMLInputElement;- // Clicks must not move focus out of the text being edited.- const holdFocus = (e: Event) => {- if (props.keepFocus && !(e.target instanceof HTMLInputElement))- e.preventDefault();- };- const saveLabel = () =>- ({- saved: 'Saved',- dirty: 'Unsaved changes',- saving: 'Saving…',- error: 'Save failed',- })[props.saveState];- return (- <div- role="toolbar"- aria-label="Presentation"- data-testid="pptx-toolbar"- class="flex h-10 shrink-0 items-center gap-0.5 overflow-x-auto border-edge-muted border-b bg-panel px-2"- onPointerDown={holdFocus}- onMouseDown={holdFocus}- >- <Show when={!props.readonly}>- <ToolButton- label="Undo"- tooltip="Undo (⌘Z)"- disabled={!props.canUndo}- onClick={props.onUndo}- >- <ArrowCounterClockwise />- </ToolButton>- <ToolButton- label="Redo"- tooltip="Redo (⇧⌘Z)"- disabled={!props.canRedo}- onClick={props.onRedo}- >- <ArrowClockwise />- </ToolButton>- <Divider />- <ToolButton- label="Text box"- tooltip="Insert text box"- data-testid="pptx-insert-textbox"- onClick={props.onInsertTextBox}- >- <TextT />- </ToolButton>- <Popover- label="Insert shape"- icon={<ShapesIcon class="size-3.5" />}- testId="pptx-insert-shape"- >- {(close) => (- <div class="flex gap-0.5">- <For each={INSERTABLE_SHAPES}>- {(shape) => (- <ToolButton- label={shape.label}- tooltip={shape.label}- data-testid={`pptx-shape-${shape.preset}`}- onClick={() => {- close();- props.onInsertShape(shape.preset);- }}- >- <shape.icon />- </ToolButton>- )}- </For>- </div>- )}- </Popover>- <ToolButton- label="Picture"- tooltip="Insert picture"- onClick={() => fileInput.click()}- >- <ImageIcon />- </ToolButton>- <input- ref={fileInput}- type="file"- accept="image/png,image/jpeg,image/gif"- class="hidden"- data-testid="pptx-image-input"- onChange={(e) => {- const file = e.currentTarget.files?.[0];- e.currentTarget.value = '';- if (file) props.onInsertImage(file);- }}- />- <ToolButton- label="Table"- tooltip="Insert table"- data-testid="pptx-insert-table"- onClick={props.onInsertTable}- >- <TableIcon />- </ToolButton>- <Divider />- <ToolButton- label="Bold"- tooltip="Bold (⌘B)"- disabled={!props.textActive}- aria-pressed={props.format.bold}- variant={props.format.bold ? 'accent' : 'ghost'}- data-testid="pptx-bold"- onClick={() => props.onToggle('bold')}- >- <TextB />- </ToolButton>- <ToolButton- label="Italic"- tooltip="Italic (⌘I)"- disabled={!props.textActive}- aria-pressed={props.format.italic}- variant={props.format.italic ? 'accent' : 'ghost'}- onClick={() => props.onToggle('italic')}- >- <TextItalic />- </ToolButton>- <ToolButton- label="Underline"- tooltip="Underline (⌘U)"- disabled={!props.textActive}- aria-pressed={props.format.underline}- variant={props.format.underline ? 'accent' : 'ghost'}- onClick={() => props.onToggle('underline')}- >- <TextUnderline />- </ToolButton>- <ToolButton- label="Smaller text"- tooltip="Decrease font size"- disabled={!props.textActive}- onClick={() => props.onFontSize(-1)}- >- <Minus />- </ToolButton>- <span- class="w-9 text-center text-ink-muted text-xs tabular-nums"- data-testid="pptx-font-size"- >- {props.textActive && props.format.size- ? Math.round(props.format.size * 10) / 10- : '–'}- </span>- <ToolButton- label="Larger text"- tooltip="Increase font size"- disabled={!props.textActive}- onClick={() => props.onFontSize(1)}- >- <Plus />- </ToolButton>- <Popover- label="Text color"- testId="pptx-text-color"- disabled={!props.textActive}- icon={- <span class="flex flex-col items-center">- <TextAa class="size-3.5" />- <span- class="h-0.5 w-3.5 rounded"- style={{ background: props.format.color ?? 'currentColor' }}- />- </span>- }- >- {(close) => (- <SwatchGrid- swatches={props.swatches}- onPick={(v) => {- close();- props.onTextColor(v);- }}- />- )}- </Popover>- <ToolButton- label="Align left"- tooltip="Align left"- disabled={!props.textActive}- variant={- props.textActive && props.format.align === 'left'- ? 'accent'- : 'ghost'- }- onClick={() => props.onAlign('left')}- >- <AlignLeft />- </ToolButton>- <ToolButton- label="Center"- tooltip="Center"- disabled={!props.textActive}- variant={- props.textActive && props.format.align === 'center'- ? 'accent'- : 'ghost'- }- onClick={() => props.onAlign('center')}- >- <AlignCenter />- </ToolButton>- <ToolButton- label="Align right"- tooltip="Align right"- disabled={!props.textActive}- variant={- props.textActive && props.format.align === 'right'- ? 'accent'- : 'ghost'- }- onClick={() => props.onAlign('right')}- >- <AlignRight />- </ToolButton>- <ToolButton- label="Bullets"- tooltip="Bullets"- disabled={!props.textActive}- aria-pressed={props.format.bullet}- variant={props.textActive && props.format.bullet ? 'accent' : 'ghost'}- onClick={props.onToggleBullets}- >- <ListBullets />- </ToolButton>- <Divider />- <Popover- label="Shape fill"- icon={<PaintBucket class="size-3.5" />}- disabled={!props.shapeActive}- testId="pptx-fill"- >- {(close) => (- <div class="flex flex-col gap-1.5">- <SwatchGrid- swatches={props.swatches}- onPick={(v) => {- close();- props.onFill(v);- }}- />- <Button- size="xs"- variant="ghost"- onClick={() => {- close();- props.onFill(null);- }}- >- No fill- </Button>- </div>- )}- </Popover>- </Show>- <div class="ml-auto flex shrink-0 items-center gap-1 pl-2">- <Show when={!props.readonly}>- <span- class="flex items-center gap-1 text-ink-muted text-xs"- classList={{ 'text-failure': props.saveState === 'error' }}- data-testid="pptx-save-state"- >- <Show- when={props.saveState === 'error'}- fallback={<CloudCheck class="size-3.5" />}- >- <WarningIcon class="size-3.5" />- </Show>- {saveLabel()}- </span>- <Button- size="sm"- variant="outline"- class="h-7"- disabled={- props.saveState === 'saved' || props.saveState === 'saving'- }- onClick={props.onSave}- >- Save- </Button>- </Show>- <ToolButton- label="Download"- tooltip="Download .pptx"- data-testid="pptx-download"- onClick={props.onDownload}- >- <DownloadSimple />- </ToolButton>- </div>- </div>- );-}diff --git a/apps/web/src/features/changes/tests/memory-storage.ts b/apps/web/src/features/changes/tests/memory-storage.tsdeleted file mode 100644index eefd6429ea..0000000000--- a/apps/web/src/features/changes/tests/memory-storage.ts+++ /dev/null@@ -1,10 +0,0 @@-/** A `localStorage` stand-in for tests. */-export function createMemoryStorage() {- const map = new Map<string, string>();- return {- map,- getItem: (key: string) => map.get(key) ?? null,- setItem: (key: string, value: string) => void map.set(key, value),- removeItem: (key: string) => void map.delete(key),- };-}diff --git a/apps/web/src/features/channel/Call/CallDeviceList.tsx b/apps/web/src/features/channel/Call/CallDeviceList.tsxdeleted file mode 100644index 9f8bde1a2e..0000000000--- a/apps/web/src/features/channel/Call/CallDeviceList.tsx+++ /dev/null@@ -1,37 +0,0 @@-import { Dropdown, SingleSelectCheck } from '@ui';-import { For } from 'solid-js';-import type { MediaDeviceInfo } from './CallContext';--/**- * Device picker rows for use inside a `Dropdown.Group`. Renders a small- * header label followed by radio rows for each device.- */-export function CallDeviceList(props: {- label: string;- devices: MediaDeviceInfo[];- activeDeviceId: string | null;- onSelect: (deviceId: string) => void;-}) {- return (- <>- <div class="px-2 pt-0.5 pb-1 text-xs font-medium text-ink-muted">- {props.label}- </div>- <Dropdown.RadioGroup- value={props.activeDeviceId ?? ''}- onChange={(value) => props.onSelect(value)}- >- <For each={props.devices}>- {(device) => (- <Dropdown.RadioItem closeOnSelect={false} value={device.deviceId}>- <span class="min-w-0 flex-1 truncate">{device.label}</span>- <SingleSelectCheck- active={props.activeDeviceId === device.deviceId}- />- </Dropdown.RadioItem>- )}- </For>- </Dropdown.RadioGroup>- </>- );-}diff --git a/apps/web/src/features/entity/entity-modal/EntityModal.tsx b/apps/web/src/features/entity/entity-modal/EntityModal.tsxdeleted file mode 100644index e59660bbf5..0000000000--- a/apps/web/src/features/entity/entity-modal/EntityModal.tsx+++ /dev/null@@ -1,208 +0,0 @@-import { getSplitPanelRef } from '@components/app/split-layout/layoutUtils';-import { isInBlock } from '@core/block';-import clickOutside from '@core/directive/clickOutside';-import { blockElementSignal } from '@core/signal/blockElement';-import type { EntityData } from '@entity';-import { Dialog } from '@kobalte/core/dialog';-import { Button } from '@ui';-import type { ComponentProps } from 'solid-js';-import {- type Accessor,- type JSX,- type ParentComponent,- type ParentProps,- type Setter,- Show,-} from 'solid-js';-import { Portal } from 'solid-js/web';-import { MoveToProjectView } from './MoveToProjectView';-import { RenameView } from './RenameView';--export const EntityModalTitle = (props: { title: string }) => {- return <h2 class="text-lg mb-3">{props.title}</h2>;-};--export const EntityModalActionFooter = (props: {- onCancel: () => void;- onConfirm: () => void;- confirmText: string;- isDisabled?: boolean;-}) => {- return (- <div class="flex justify-end gap-2 mt-2 text-sm pt-2">- <Button variant="ghost" onClick={props.onCancel}>- Cancel- </Button>- <Button- variant="strong"- onClick={props.onConfirm}- disabled={props.isDisabled}- >- {props.confirmText}- </Button>- </div>- );-};--false && clickOutside;--const EntityModalContent = (props: {- isOpen: Accessor<boolean>;- setIsOpen: Setter<boolean>;- view: Accessor<'rename' | 'moveToProject' | null>;- entity?: EntityData;- viewId?: string;-}) => {- const handleFinish = () => {- props.setIsOpen(false);- };-- const handleCancel = () => {- props.setIsOpen(false);- };- let entityModalContentRef!: HTMLDivElement;-- return (- <SplitModal- mode="split"- open={props.isOpen}- setOpen={props.setIsOpen}- scrim={true}- >- <div- ref={entityModalContentRef}- class="pointer-events-auto w-full max-w-[min(36rem,calc(100%-1rem))] mx-auto mt-16 bg-surface border border-edge h-fit p-2"- >- <div class="w-full my-1">- <Show when={props.view() === 'rename'}>- <RenameView- entity={props.entity}- viewId={props.viewId}- onFinish={handleFinish}- onCancel={handleCancel}- />- </Show>- <Show when={props.view() === 'moveToProject'}>- <MoveToProjectView- entity={props.entity!}- onFinish={handleFinish}- onCancel={handleCancel}- />- </Show>- </div>- </div>- </SplitModal>- );-};-const _EntityModal: ParentComponent<{- isOpen: Accessor<boolean>;- setIsOpen: Setter<boolean>;- view: Accessor<'rename' | 'moveToProject'>;- entity?: EntityData;- viewId?: string;-}> = (props) => {- return (- <Show when={props.isOpen()}>- <EntityModalContent- isOpen={props.isOpen}- setIsOpen={props.setIsOpen}- view={props.view}- entity={props.entity}- viewId={props.viewId}- />- </Show>- );-};--function SplitModal(- props: ParentProps<{- trigger?: JSX.Element;- open: Accessor<boolean>;- setOpen: Setter<boolean>;- mode?: 'split' | 'global';- scrim?: boolean;- onCloseAutoFocus?: (e: Event) => void;- onOpenAutoFocus?: (e: Event) => void;- }>-) {- return (- <Dialog open={props.open()} onOpenChange={props.setOpen} modal={true}>- <Show when={props.trigger}>- <Dialog.Trigger>{props.trigger}</Dialog.Trigger>- </Show>- <ScopedPortal scope={props.mode ?? 'global'}>- <Dialog.Overlay- as="div"- class="absolute z-modal"- classList={{- 'inset-px': props.mode === 'split',- 'inset-0': props.mode !== 'split',- 'bg-modal-overlay': props.scrim !== false,- }}- use:clickOutside={() => props.setOpen(false)}- on:click={() => props.setOpen(false)}- />- <div- class="absolute z-modal pointer-events-none px-2"- classList={{- 'inset-px': props.mode === 'split',- 'inset-0': props.mode !== 'split',- }}- >- <Dialog.Content- class="pointer-events-none!"- onCloseAutoFocus={props.onCloseAutoFocus}- onOpenAutoFocus={props.onOpenAutoFocus}- >- {props.children}- </Dialog.Content>- </div>- </ScopedPortal>- </Dialog>- );-}--type PortalScope = 'local' | 'block' | 'global' | 'split';--/**- * Portal with some extra scoping logic. If passed a specific mount prop or no props at all – it is- * just a regular solid Portal.- * @param props.scope - The scope of the portal. If 'local' it will mount to the closest element with the- * '.portal-scope' class. If 'block' it will mount to the containing block element. If 'global' it will- * mount to the document body.- * @returns- */-function ScopedPortal(- props: ComponentProps<typeof Portal> & {- scope?: PortalScope;- show?: boolean;- }-) {- let searchRef!: HTMLDivElement;-- const mountRef = () => {- if (props.mount) return props.mount;- if (props.scope === 'block') {- if (isInBlock()) {- const blockElement = blockElementSignal.get();- if (blockElement) return blockElement;- }- }- if (props.scope === 'split') {- const panelElement = getSplitPanelRef();- if (panelElement) return panelElement;- }- if (props.scope === 'local') {- const scopedElement = searchRef.closest('.portal-scope');- if (scopedElement) return scopedElement;- }- return document.body;- };-- return (- <Show when={props.show !== false}>- <div class="hidden" ref={searchRef} />- <Portal mount={mountRef()}>{props.children}</Portal>- </Show>- );-}diff --git a/apps/web/src/features/entity/entity-modal/MoveToProjectView.tsx b/apps/web/src/features/entity/entity-modal/MoveToProjectView.tsxdeleted file mode 100644index bba7682093..0000000000--- a/apps/web/src/features/entity/entity-modal/MoveToProjectView.tsx+++ /dev/null@@ -1,529 +0,0 @@-import {- CustomEntityIcon,- EntityIcon,- getEntityIconConfig,-} from '@core/component/EntityIcon';-import { ExplorerSpacer } from '@core/component/FileList/ExplorerSpacer';-import { registerHotkey, useHotkeyDOMScope } from '@core/hotkey/hotkeys';-import Fragment from '@core/util/Fragment';-import { scrollToKeepGap } from '@core/util/scrollToKeepGap';-import { createMoveToProjectDssEntityMutation, type EntityData } from '@entity';-import CaretRight from '@phosphor/caret-right.svg';-import ArrowRight from '@phosphor-icons/core/regular/arrow-right.svg?component-solid';-import { useProjectsQuery } from '@queries/storage/projects';-import type { Project } from '@service-storage/generated/schemas';-import { cn } from '@ui';-import {- createEffect,- createMemo,- createSignal,- onMount,- Show,-} from 'solid-js';-import { createStore, reconcile } from 'solid-js/store';-import { Dynamic } from 'solid-js/web';-import { VList } from 'virtua/solid';-import { EntityModalActionFooter, EntityModalTitle } from './EntityModal';--export const MoveToProjectView = (props: {- entity: EntityData;- onFinish: () => void;- onCancel: () => void;-}) => {- let listRef!: HTMLDivElement;- const moveToProjectMutation = createMoveToProjectDssEntityMutation();- const projectsQuery = useProjectsQuery();- const projects = () => projectsQuery.data ?? [];- const [searchQuery, setSearchQuery] = createSignal('');- const [selectedProject, setSelectedProject] = createSignal<Project | null>(- null- );- const [expandedProjects, setExpandedProjects] = createSignal<{- [key: string]: boolean;- }>({});- const [focusedIndex, setFocusedIndex] = createSignal(-1);- const [attachHotkeys, moveToProjectHotkeyScopeId] = useHotkeyDOMScope(- 'move-to-project',- true- );- let rootScopeId!: HTMLDivElement;-- onMount(() => {- attachHotkeys(rootScopeId);- registerHotkey({- hotkey: ['arrowdown'],- scopeId: moveToProjectHotkeyScopeId,- description: 'Down',- keyDownHandler: () => {- const items = flattenedProjects.items;- if (items.length === 0) return false;-- const currentIndex = focusedIndex();- const nextIndex =- currentIndex === -1- ? 0- : Math.min(currentIndex + 1, items.length - 1);- setFocusedIndex(nextIndex);-- // Update selection- const nextProject = items[nextIndex];- if (nextProject) {- setSelectedProject(nextProject);- scrollToKeepGap({- container: listRef,- target: listRef.querySelector('.focused') as HTMLElement,- align: 'bottom',- });- }- return true;- },- runWithInputFocused: true,- });- registerHotkey({- hotkey: ['arrowup'],- scopeId: moveToProjectHotkeyScopeId,- description: 'Up',- keyDownHandler: () => {- const items = flattenedProjects.items;- if (items.length === 0) return false;-- const currentIndex = focusedIndex();- const prevIndex =- currentIndex === -1- ? items.length - 1- : Math.max(currentIndex - 1, 0);- setFocusedIndex(prevIndex);-- // Update selection- const prevProject = items[prevIndex];- if (prevProject) {- setSelectedProject(prevProject);- scrollToKeepGap({- container: listRef,- target: listRef.querySelector('.focused') as HTMLElement,- align: 'top',- });- }- return true;- },- runWithInputFocused: true,- });- registerHotkey({- hotkey: ['arrowright'],- scopeId: moveToProjectHotkeyScopeId,- description: 'Expand',- keyDownHandler: () => {- const items = flattenedProjects.items;- const currentIndex = focusedIndex();- if (currentIndex === -1) return false;- const currentProject = items[currentIndex];-- if (currentProject && !searchQuery()) {- // Check if project has children and is not expanded- const tree = projectTree();- const hasChildren =- tree.itemMap[currentProject.id]?.children.length > 0;- const isExpanded = expandedProjects()[currentProject.id];-- if (hasChildren && !isExpanded) {- toggleExpanded(currentProject.id);- return true;- } else if (hasChildren && isExpanded) {- // If already expanded, try to jump to first child- const children = tree.itemMap[currentProject.id]?.children || [];- if (children.length > 0) {- const firstChild = children[0];- const firstChildIndex = items.findIndex(- (item) => item.id === firstChild.id- );- if (firstChildIndex !== -1) {- setFocusedIndex(firstChildIndex);- setSelectedProject(items[firstChildIndex]);- scrollToKeepGap({- container: listRef,- target: listRef.querySelector('.focused') as HTMLElement,- align: 'top',- });- return true;- }- }- }- }- return false;- },- runWithInputFocused: true,- });- registerHotkey({- hotkey: ['arrowleft'],- scopeId: moveToProjectHotkeyScopeId,- description: 'Collapse',- keyDownHandler: () => {- const items = flattenedProjects.items;- const currentIndex = focusedIndex();- if (currentIndex === -1) return false;- const currentProject = items[currentIndex];-- if (currentProject && !searchQuery()) {- // Check if project is expanded- const isExpanded = expandedProjects()[currentProject.id];-- if (isExpanded) {- toggleExpanded(currentProject.id);- return true;- } else {- // If already collapsed, try to jump to parent directory- const parentId = currentProject.parentId;- if (parentId) {- const parentIndex = items.findIndex(- (item) => item.id === parentId- );- if (parentIndex !== -1) {- setFocusedIndex(parentIndex);- setSelectedProject(items[parentIndex]);- scrollToKeepGap({- container: listRef,- target: listRef.querySelector('.focused') as HTMLElement,- align: 'top',- });- return true;- }- }- }- }- return false;- },- runWithInputFocused: true,- });- });-- // Build project tree structure- const projectTree = createMemo(() => {- const allProjects = projects();- const itemMap: { [key: string]: { item: any; children: any[] } } = {};- const rootItems: { item: any; children: any[] }[] = [];- const processedItems = new Set<string>();-- // First pass: Create a map of all items- allProjects.forEach((item) => {- itemMap[item.id] = { item, children: [] };- });-- // Second pass: Connect children to parents- allProjects.forEach((item) => {- const parentId = item.parentId;- if (parentId && itemMap[parentId]) {- itemMap[parentId].children.push(item);- processedItems.add(item.id);- }- });-- // Third pass: Add only root items (those without parents)- allProjects.forEach((item) => {- if (!processedItems.has(item.id)) {- rootItems.push(itemMap[item.id]);- }- });-- return { rootItems, itemMap };- });-- // Helper function to build project path- const getProjectPath = (project: Project): string => {- const tree = projectTree();- const path: string[] = [];- let currentId = project.parentId;-- while (currentId && tree.itemMap[currentId]) {- const parent = tree.itemMap[currentId].item;- path.unshift(parent.name);- currentId = parent.parentId;- }-- return path.length > 0 ? `/${path.join('/')}` : '';- };-- // Flatten tree for display (only show expanded items)- const [flattenedProjects, setFlattenedProjects] = createStore<{- items: (Project & { depth: number; path?: string })[];- }>({- items: [],- });-- // Update flattened projects when dependencies change- const updateFlattenedProjects = () => {- const query = searchQuery().toLowerCase();-- if (query) {- // If searching, show flat list with paths- const searchResults = projects()- .filter((project) => project.name.toLowerCase().includes(query))- .map((project) => ({- ...project,- depth: 0,- path: getProjectPath(project),- }));- setFlattenedProjects('items', reconcile(searchResults));- } else {- // If not searching, show tree structure- const result: (Project & { depth: number; path?: string })[] = [];- const expanded = expandedProjects();- const tree = projectTree();-- const processItems = (- items: { item: any; children: any[] }[],- depth = 0- ) => {- for (const item of items) {- result.push({- ...item.item,- depth,- path: getProjectPath(item.item),- });- // Only show children if the parent is expanded- if (expanded[item.item.id] && item.children.length > 0) {- // Convert children to the expected format- const childrenAsTreeItems = item.children.map((child) => ({- item: child,- children: tree.itemMap[child.id]?.children || [],- }));- processItems(childrenAsTreeItems, depth + 1);- }- }- };-- processItems(tree.rootItems);- setFlattenedProjects('items', reconcile(result));- }- };-- // Update when search query changes- createEffect(() => {- searchQuery();- updateFlattenedProjects();- });-- // Update when expanded projects change- createEffect(() => {- expandedProjects();- updateFlattenedProjects();- });-- // Update when projects change- createEffect(() => {- projects();- updateFlattenedProjects();- });-- // Reset focused index when list changes (but preserve focus on current project if possible)- createEffect(() => {- const items = flattenedProjects.items;- if (items.length > 0) {- const currentSelected = selectedProject();- if (currentSelected) {- // Try to find the currently selected project in the new list- const currentIndex = items.findIndex(- (item) => item.id === currentSelected.id- );- if (currentIndex !== -1) {- setFocusedIndex(currentIndex);- return; // Don't change selection, just update focus- }- }-- // Don't automatically set focus or selection - wait for user interaction- // Only set focus if there's already a focused item to maintain- const currentFocus = focusedIndex();- if (currentFocus >= 0 && currentFocus < items.length) {- // Keep existing focus if it's still valid- return;- }- }- });-- const toggleExpanded = (projectId: string) => {- setExpandedProjects((prev) => ({- ...prev,- [projectId]: !prev[projectId],- }));- };-- const finishEditing = async () => {- const projectId = selectedProject()?.id;- if (projectId && props.entity) {- // Only allow moving supported entity types- if (- props.entity.type === 'document' ||- props.entity.type === 'chat' ||- props.entity.type === 'project'- ) {- await moveToProjectMutation.mutateAsync({- entity: props.entity,- project: { id: projectId },- });- }- }- props.onFinish();- };-- const getIcon = createMemo(() => getEntityIconConfig(props.entity));-- return (- <div class="" ref={rootScopeId} tabindex={-1}>- <EntityModalTitle title="Move to folder" />- <div class="flex pb-2">- <div class="flex justify-between items-center gap-2">- <div class="flex items-center gap-1">- <div class="size-5 flex items-center justify-center">- <Dynamic- component={getIcon().icon}- class={cn('flex size-full', getIcon().foreground)}- />- </div>-- {/* Project name */}- <span class="shrink-0 text-ink text-sm sm:text-sm font-medium focus:font-bold font-sans grow overflow-hidden truncate">- {props.entity.name}- </span>- </div>- <CustomEntityIcon icon={ArrowRight} size="sm" />- <div class="flex gap-1 items-center">- {/* Project icon */}- <div- class="size-6 flex items-center justify-center"- classList={{- 'opacity-20': !selectedProject(),- }}- >- <EntityIcon targetType="project" size="sm" />- </div>-- <Show when={selectedProject()}>- {/* Project name */}- <span class="shrink-0 text-ink text-sm sm:text-sm font-medium focus:font-bold font-sans grow overflow-hidden truncate">- {selectedProject()?.name}- </span>- <Show when={searchQuery()}>- <span class="text-ink-extra-muted/80 text-xs truncate">- {getProjectPath(selectedProject()!)}- </span>- </Show>- </Show>- </div>- </div>- </div>-- <div class="w-full h-fit mb-3">- <input- type="text"- placeholder="Search folders..."- value={searchQuery()}- onInput={(e) => setSearchQuery(e.currentTarget.value)}- class="w-full p-2 text-sm border border-edge bg-surface text-ink placeholder:text-ink-placeholder focus:outline-none selection:bg-ink selection:text-surface"- />- </div>- <div class="w-full max-h-64 h-75 overflow-hidden">- <Fragment ref={listRef}>- <VList data={flattenedProjects.items} class="[&>div]:overflow-clip">- {(project, index) => {- // Safety check- if (!project || !project.id) {- console.warn('Skipping invalid project:', project);- return null;- }-- const isSelected = () => selectedProject()?.id === project.id;- const isFocused = () =>- focusedIndex() !== -1 && index() === focusedIndex();- const isExpanded = () => expandedProjects()[project.id] || false;- const hasChildren = () => {- const tree = projectTree();- return tree.itemMap[project.id]?.children.length > 0;- };-- return (- <div- class="group flex flex-col px-2"- style="margin: 2px 0"- onClick={() => {- setFocusedIndex(index());- setSelectedProject(project);- scrollToKeepGap({- container: listRef,- target: listRef.querySelector('.focused') as HTMLElement,- align: 'top',- });- }}- classList={{- 'bg-accent/10': isFocused() && !isSelected(),- focused: isFocused(),- }}- >- <div class="flex h-5">- <div- class="w-full"- style={{- 'padding-top': '6px',- 'padding-bottom': '6px',- }}- >- <div- class="w-full flex gap-1.5 items-center ml-auto text-ink-extra-muted h-5"- style={{- height: '20px',- }}- >- {/* Indentation spacers */}- <ExplorerSpacer depth={project.depth} size="sm" />-- {/* Expand/collapse caret */}- <div- class="flex items-center justify-center size-4 hover:bg-edge rounded"- onClick={(e) => {- e.stopPropagation();- toggleExpanded(project.id);- }}- classList={{- 'opacity-20': !!searchQuery() || !hasChildren(),- }}- >- <CaretRight- class={cn(- 'size-3 transition-transform duration-150',- isExpanded() && !searchQuery() && 'rotate-90'- )}- />- </div>-- {/* Project icon */}- <div class="size-6 flex items-center justify-center">- <EntityIcon targetType="project" size="sm" />- </div>-- {/* Project name */}- <span class="shrink-0 text-ink text-sm sm:text-sm font-medium focus:font-bold font-sans overflow-hidden truncate">- {project.name}- </span>- <Show when={searchQuery()}>- <span class="text-ink-extra-muted/80 text-xs truncate">- {project.path || ''}- </span>- </Show>- </div>- </div>- </div>- </div>- );- }}- </VList>- </Fragment>- </div>-- <EntityModalActionFooter- onCancel={props.onCancel}- onConfirm={finishEditing}- confirmText="Move"- isDisabled={!selectedProject()?.id}- />- </div>- );-};diff --git a/apps/web/src/features/entity/entity-modal/RenameView.tsx b/apps/web/src/features/entity/entity-modal/RenameView.tsxdeleted file mode 100644index b92ab742ec..0000000000--- a/apps/web/src/features/entity/entity-modal/RenameView.tsx+++ /dev/null@@ -1,70 +0,0 @@-import { createRenameDssEntityMutation, type EntityData } from '@entity';-import { createSignal, onMount } from 'solid-js';-import { EntityModalActionFooter, EntityModalTitle } from './EntityModal';--export const RenameView = (props: {- entity?: EntityData;- viewId?: string;- onFinish: () => void;- onCancel: () => void;-}) => {- const renameMutation = createRenameDssEntityMutation();- let inputRef: HTMLInputElement | undefined;-- const [editValue, setEditValue] = createSignal(props.entity?.name || '');-- const handleKeyDown = (e: KeyboardEvent) => {- if (e.key === 'Enter') {- e.preventDefault();- finishEditing();- } else if (e.key === 'Escape') {- e.preventDefault();- props.onCancel();- }- };-- const finishEditing = async () => {- const newValue = editValue().trim();-- // Handle entity renaming- if (newValue && props.entity) {- await renameMutation.mutateAsync({- entity: props.entity,- newName: newValue,- });- }-- props.onFinish();- };-- return (- <div class="w-full">- <EntityModalTitle title="Rename" />- <div class="w-full">- <input- ref={(el) => {- inputRef = el;- onMount(() => {- // it needs to focus on next task, no idea why- setTimeout(() => {- inputRef?.focus();- inputRef?.select();- });- });- }}- value={editValue()}- onInput={(e) => setEditValue(e.currentTarget.value)}- onKeyDown={handleKeyDown}- class="w-full p-2 text-sm border border-edge bg-surface text-ink placeholder:text-ink-placeholder focus:outline-none focus:bg-active selection:bg-ink selection:text-surface"- placeholder="Enter title..."- />- </div>-- <EntityModalActionFooter- onCancel={props.onCancel}- onConfirm={finishEditing}- confirmText="Rename"- />- </div>- );-};diff --git a/apps/web/src/features/meetings/components/meeting-link.tsx b/apps/web/src/features/meetings/components/meeting-link.tsxdeleted file mode 100644index 3dc4afd5cf..0000000000--- a/apps/web/src/features/meetings/components/meeting-link.tsx+++ /dev/null@@ -1,24 +0,0 @@-import Copy from '@phosphor/copy.svg';-import { Button } from '@ui';--export function MeetingLink(props: {- url: string;- copied: boolean;- onCopy: () => void;-}) {- return (- <div class="ph-no-capture flex min-w-0 items-center gap-2 rounded-lg border border-edge-muted bg-input px-3 py-2">- <input- class="min-w-0 flex-1 bg-transparent text-sm text-ink outline-none"- aria-label="Call link"- readOnly- value={props.url}- onFocus={(event) => event.currentTarget.select()}- />- <Button size="sm" onClick={props.onCopy} aria-label="Copy call link">- <Copy class="size-4" />- {props.copied ? 'Copied' : 'Copy link'}- </Button>- </div>- );-}diff --git a/apps/web/src/features/next-soup/search-context.tsx b/apps/web/src/features/next-soup/search-context.tsxdeleted file mode 100644index e69b68b13a..0000000000--- a/apps/web/src/features/next-soup/search-context.tsx+++ /dev/null@@ -1,5 +0,0 @@-export {- SearchProvider,- type SoupSearchPoolItem as SearchPoolItem,- useSearchContext,-} from '@app/features/soup/search/context';diff --git a/apps/web/src/features/settings/connections/mock-dropdown.tsx b/apps/web/src/features/settings/connections/mock-dropdown.tsxdeleted file mode 100644index c8b9d01668..0000000000--- a/apps/web/src/features/settings/connections/mock-dropdown.tsx+++ /dev/null@@ -1,26 +0,0 @@-import type { JSX } from 'solid-js';--/** Minimal Dropdown stub for connections settings tests. */-export async function mockUiWithDropdown(- importOriginal: () => Promise<typeof import('@ui')>-) {- const actual = await importOriginal();- const Dropdown = Object.assign(- (p: { children?: JSX.Element }) => <>{p.children}</>,- {- Trigger: (p: { 'aria-label'?: string; children?: JSX.Element }) => (- <button type="button" aria-label={p['aria-label']}>- {p.children}- </button>- ),- Content: (p: { children?: JSX.Element }) => <div>{p.children}</div>,- Group: (p: { children?: JSX.Element }) => <div>{p.children}</div>,- Item: (p: { children?: JSX.Element; onSelect?: () => void }) => (- <div role="menuitem" onClick={() => p.onSelect?.()}>- {p.children}- </div>- ),- }- );- return { ...actual, Dropdown };-}diff --git a/apps/web/src/features/tasks-view/core/task-board-reveal.ts b/apps/web/src/features/tasks-view/core/task-board-reveal.tsdeleted file mode 100644index 04e265d651..0000000000--- a/apps/web/src/features/tasks-view/core/task-board-reveal.ts+++ /dev/null@@ -1,13 +0,0 @@-import type { TaskBoardColumn } from './task-board';--/** Only reveal a loaded destination membership, never a guessed partial-page position. */-export function taskBoardRevealIndices(- columns: readonly TaskBoardColumn[],- columnId: string,- taskId: string-): { column: number; row: number } | undefined {- const column = columns.findIndex((item) => item.id === columnId);- if (column < 0) return undefined;- const row = columns[column].tasks.findIndex((task) => task.id === taskId);- return row < 0 ? undefined : { column, row };-}diff --git a/apps/web/src/lib/core/client/completion.ts b/apps/web/src/lib/core/client/completion.tsdeleted file mode 100644index e3a6374fb3..0000000000--- a/apps/web/src/lib/core/client/completion.ts+++ /dev/null@@ -1,77 +0,0 @@-/**- date: 02/19/2026- note: Temporarily disabled pending port to connection-gateway- guy: Eric Hayes-*/--// import { cognitionWebsocketServiceClient } from "@service-cognition/client";-// import { createCognitionWebsocketBlockEffect } from "@service-cognition/websocket";-// import { createEffect, createRoot } from "solid-js";-// import { createStore } from 'solid-js/store';-// import { v4 as uuid } from "uuid";--export type Completion = {- content: string;- status: 'loading' | 'streaming' | 'completed';-};--// type CompletionStore = Record<string, Completion>;--// const [completionStore, setCompletionStore] = createStore<CompletionStore>({});--// createCognitionWebsocketBlockEffect("completion_response", (data) => {-// setCompletionStore(data.completion_id, {-// content: data.content,-// status: data.done ? "completed" : "streaming",-// });-// });--/** Streams a completion from the dcs websocket- *- * @param data - The data to send to the websocket- * @param setter - A callback to set the completion to a signal- * (this is required because the websocket message are async)- *- * @example- * ```tsx- * const [completion, setCompletion] = createSignal<Completion | undefined>(undefined);- * streamCompletion(- * {- * prompt: 'Hello world',- * attachmentId: 'my-attachment-id',- * },- * setCompletion- * );- *- * return <div>{completion()?.content}</div>- * ```- */-// export function streamCompletion(-// data: { prompt: string; attachmentId?: string; selectedText?: string },-// setter: (completion: Completion) => void,-// ) {-// const completionId = uuid();-// setCompletionStore(completionId, {-// content: "",-// status: "loading",-// });-// cognitionWebsocketServiceClient.sendCompletion({-// prompt:-// data.prompt +-// // TODO: @synoet - rework prompt later so that this is not needed-// " ... (PLEASE RENDER ANY MATHEMATICAL EQUATIONS OR LATEX e.g. left \right or \frac{}{} or anything like that AND ANY EXPRESSIONS USING LATEX SYNTAX ENCLOSED IN DOUBLE DOLLAR SIGNS ($$ ... $$))",-// attachment_id: data.attachmentId,-// completion_id: completionId,-// selected_text: data.selectedText,-// });-// createRoot((dispose) => {-// createEffect(() => {-// const completion = completionStore[completionId];-// if (!completion) return;-// setter(completion);-// if (completion.status === "completed") {-// dispose();-// }-// });-// });-// }diff --git a/apps/web/src/lib/core/component/AI/component/input/ChatAttachMenu.tsx b/apps/web/src/lib/core/component/AI/component/input/ChatAttachMenu.tsxdeleted file mode 100644index 00ac9295ea..0000000000--- a/apps/web/src/lib/core/component/AI/component/input/ChatAttachMenu.tsx+++ /dev/null@@ -1,362 +0,0 @@-import { SUPPORTED_ATTACHMENT_EXTENSIONS } from '@core/component/AI/constant';-import { useChatInputContext } from '@core/component/AI/context';-import {- useChatAttachableHistory,- useGetChatAttachmentInfo,-} from '@core/component/AI/signal/attachment';-import type { Attachment } from '@core/component/AI/types';-import { EntityIcon } from '@core/component/EntityIcon';-import { OldMenu, OldMenuItem } from '@core/component/OldMenu';-import clickOutside from '@core/directive/clickOutside';-import { fileSelector } from '@core/directive/fileSelector';-import { isTouchDevice } from '@core/mobile/isTouchDevice';-import { fuzzyFilter } from '@core/util/fuzzy';-import { getItemBlockName } from '@core/util/getItemBlockName';-import {- autoUpdate,- computePosition,- flip,- limitShift,- offset,- shift,-} from '@floating-ui/dom';-import DeviceMobileIcon from '@phosphor/device-mobile-speaker.svg';-import LaptopIcon from '@phosphor/laptop.svg';-import SearchIcon from '@phosphor/magnifying-glass.svg';-import type { HistoryItem } from '@queries/history/history';-import {- createEffect,- createMemo,- createSignal,- onCleanup,- Show,-} from 'solid-js';-import { type VirtualizerHandle, VList } from 'virtua/solid';--// NOTE: solid directives-false && fileSelector;-false && clickOutside;--type ChatAttachMenuProps = {- open: boolean;- close: () => void;- anchorRef: HTMLDivElement;- containerRef: HTMLElement;- onAttach: (attachment: Attachment, item: HistoryItem) => void;-};--function truncate(str: string, maxLength: number = 30) {- if (str.length <= maxLength) return str;- return str.slice(0, maxLength) + '...';-}--// TODO: create a shared component for chat attach menu and block channel AttachMenu-// TODO: add other supported attachment types, e.g. chat/channel-export function ChatAttachMenu(props: ChatAttachMenuProps) {- const chatInput = useChatInputContext();- const uploadQueue = chatInput.uploadQueue;-- const [position, setPosition] = createSignal({ x: 0, y: 0 });- const [popupRef, setPopupRef] = createSignal<HTMLDivElement>();- const history = useChatAttachableHistory();- const { getDocumentAttachment } = useGetChatAttachmentInfo();-- const [input, setInput] = createSignal('');- const [selectedIndex, setSelectedIndex] = createSignal(0);- const [vlistRef, setVlistRef] = createSignal<VirtualizerHandle>();- const [isKeyboardMode, setIsKeyboardMode] = createSignal(false);-- const updatePosition = async () => {- const popupRef_ = popupRef();- if (!popupRef_) return;- const { x, y } = await computePosition(props.anchorRef, popupRef_, {- placement: 'top-start',- middleware: [- offset(8),- flip({- fallbackStrategy: 'bestFit',- }),- shift({- padding: 8,- limiter: limitShift(),- }),- ],- });- setPosition({ x, y });- };-- const rankedHistory = createMemo(() => {- const searchQuery = input();- return fuzzyFilter(searchQuery, history(), (item) => item.name);- });-- // Reset selected index when results change- createEffect(() => {- rankedHistory();- setSelectedIndex(0);- });-- const handleKeyDown = (e: KeyboardEvent) => {- const items = rankedHistory();-- switch (e.key) {- case 'ArrowDown':- e.preventDefault();- if (items.length === 0) return;- setIsKeyboardMode(true);- const currentIndex = selectedIndex();- const nextIndex = (currentIndex + 1) % items.length;- setSelectedIndex(nextIndex);- // Scroll to the new index- const vlist = vlistRef();- if (vlist && vlist.scrollToIndex) {- vlist.scrollToIndex(nextIndex, { align: 'nearest' });- }- break;- case 'ArrowUp':- e.preventDefault();- if (items.length === 0) return;- setIsKeyboardMode(true);- const currentUpIndex = selectedIndex();- if (currentUpIndex === 0) {- // Go back to search input when at first item- searchInputRef()?.focus();- } else {- const prevIndex = currentUpIndex - 1;- setSelectedIndex(prevIndex);- // Scroll to the new index- const vlist = vlistRef();- if (vlist && vlist.scrollToIndex) {- vlist.scrollToIndex(prevIndex, { align: 'nearest' });- }- }- break;- case 'Enter':- e.preventDefault();- if (items.length === 0) return;- const selectedItem = items[selectedIndex()];- if (selectedItem) {- selectItem(selectedItem);- }- break;- case 'Escape':- e.preventDefault();- props.close();- break;- case 'Backspace':- e.preventDefault();- const currentInput = input();- if (currentInput.length > 0) {- const newInput = currentInput.slice(0, -1);- setInput(newInput);- // Focus the search input to continue typing naturally- const inputRef = searchInputRef();- if (inputRef) {- inputRef.focus();- // Set cursor to end of input- inputRef.setSelectionRange(newInput.length, newInput.length);- }- }- break;- default:- // Handle regular typing - add to search input- if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey) {- e.preventDefault();- const currentInput = input();- const newInput = currentInput + e.key;- setInput(newInput);- // Focus the search input to continue typing naturally- const inputRef = searchInputRef();- if (inputRef) {- inputRef.focus();- // Set cursor to end of input- inputRef.setSelectionRange(newInput.length, newInput.length);- }- }- break;- }- };-- const handleMouseMove = () => {- if (isKeyboardMode()) {- setIsKeyboardMode(false);- }- };-- let isSelecting = false;- let selectionRequest = 0;- onCleanup(() => {- selectionRequest += 1;- });-- const selectItem = async (item: HistoryItem) => {- // TODO: add other supported attachment types, e.g. channel- if (item.type !== 'document') {- console.error('ChatAttachMenu only supports document items');- return;- }-- if (isSelecting) return;- isSelecting = true;- const request = ++selectionRequest;- try {- const attachment = await getDocumentAttachment(item.id, item.fileType);- if (request !== selectionRequest) return;- if (attachment) props.onAttach(attachment, item);- props.close();- } finally {- if (request === selectionRequest) isSelecting = false;- }- };-- const [searchInputRef, setSearchInputRef] = createSignal<HTMLInputElement>();-- createEffect(() => {- const popupRef_ = popupRef();- if (!popupRef_) return;-- document.body.style.overflow = 'hidden';- const cleanup = autoUpdate(props.anchorRef, popupRef_, updatePosition);-- // Focus the search input for immediate typing- setTimeout(() => {- searchInputRef()?.focus();- }, 0);-- onCleanup(() => {- cleanup();- document.body.style.overflow = '';- });- });-- const handleOverlayClick = (e: MouseEvent) => {- if (e.target === e.currentTarget) {- props.close();- }- };-- return (- <Show when={props.open}>- <div- class="fixed inset-0 bg-transparent z-action-menu"- onClick={handleOverlayClick}- onMouseDown={handleOverlayClick}- >- <div- class="absolute"- ref={setPopupRef}- use:clickOutside={props.close}- onKeyDown={handleKeyDown}- onMouseMove={handleMouseMove}- tabIndex={0}- style={{- left: `${position().x}px`,- top: `${position().y}px`,- 'transform-origin': 'top',- }}- >- <OldMenu>- <div class="flex flex-row items-center w-full p-2 gap-2 text-sm border-b border-edge text-ink">- <SearchIcon class="size-3" />- <input- ref={setSearchInputRef}- value={input()}- onInput={(e) => setInput(e.target.value)}- onKeyDown={(e) => {- // Handle arrow keys to navigate to the list- if (e.key === 'ArrowDown') {- e.preventDefault();- const items = rankedHistory();- if (items.length > 0) {- setIsKeyboardMode(true);- setSelectedIndex(0);- const vlist = vlistRef();- if (vlist && vlist.scrollToIndex) {- vlist.scrollToIndex(0, { align: 'nearest' });- }- // Transfer focus to the container for further navigation- popupRef()?.focus();- }- } else if (e.key === 'Escape') {- e.preventDefault();- props.close();- } else if (e.key === 'Enter') {- e.preventDefault();- const items = rankedHistory();- const selectedItem = items[selectedIndex()];- if (selectedItem) {- selectItem(selectedItem);- }- }- }}- class="w-full outline-none"- placeholder="Search Attachments"- />- </div>- <div class="flex flex-col gap-1 max-h-62.5 w-75 overflow-y-auto">- <Show- when={rankedHistory().length > 0}- fallback={- <div class="p-2 w-full flex-col justify-center items-center">- <p class="text-sm text-ink-muted">No results</p>- </div>- }- >- <VList- ref={setVlistRef}- data={rankedHistory()}- bufferSize={10 * 40}- itemSize={40}- style={{ height: '100%', contain: 'content' }}- >- {(item, index) => (- <div- class={index() === selectedIndex() ? 'bg-hover' : ''}- onMouseEnter={() => {- if (!isKeyboardMode()) {- setSelectedIndex(index());- }- }}- >- <OldMenuItem- text={truncate(item.name)}- icon={() => (- <EntityIcon- targetType={getItemBlockName(item, true)}- size="xs"- />- )}- onClick={() => selectItem(item)}- />- </div>- )}- </VList>- </Show>- </div>- <div- class="w-full"- use:fileSelector={{- acceptedFileExtensions: SUPPORTED_ATTACHMENT_EXTENSIONS,- multiple: true,- onSelect: (files) => {- uploadQueue.upload(files);- props.close();- },- }}- >- <OldMenuItem- text={- isTouchDevice()- ? 'Upload from your device'- : 'Upload from your computer'- }- icon={isTouchDevice() ? DeviceMobileIcon : LaptopIcon}- spacerTop- />- </div>- </OldMenu>- </div>- </div>- </Show>- );-}diff --git a/apps/web/src/lib/core/component/FileList/ExplorerSpacer.tsx b/apps/web/src/lib/core/component/FileList/ExplorerSpacer.tsxdeleted file mode 100644index dadddc33dc..0000000000--- a/apps/web/src/lib/core/component/FileList/ExplorerSpacer.tsx+++ /dev/null@@ -1,59 +0,0 @@-import CaretRight from '@phosphor/caret-right.svg';-import { cn } from '@ui';-import { createMemo, Index } from 'solid-js';-import {- FILE_LIST_CARET_WIDTH,- FILE_LIST_ROW_HEIGHT,- FILE_LIST_SPACER_WIDTH,- type FileListSize,-} from './constants';--function FileLevelSpacer(props: { size: FileListSize }) {- return (- <div- class={cn(- 'file-level-spacer',- FILE_LIST_SPACER_WIDTH[props.size],- FILE_LIST_ROW_HEIGHT[props.size],- 'border-r border-edge'- )}- />- );-}--function _CaretSpacer(props: { size: FileListSize }) {- return <div class={cn('min-h-full', FILE_LIST_CARET_WIDTH[props.size])} />;-}--function _Caret(props: { isExpanded: boolean; size: FileListSize }) {- return (- <div- class={cn(- 'expand-project-caret flex items-center justify-center',- FILE_LIST_CARET_WIDTH[props.size],- 'transition-transform duration-150',- props.isExpanded && 'rotate-90'- )}- >- <CaretRight class={`size-3`} />- </div>- );-}--type ExplorerSpacerProps = {- depth?: number;- size?: FileListSize;-};--export function ExplorerSpacer(props: ExplorerSpacerProps) {- if (props.depth === undefined) {- return '';- }- const depth = createMemo(() => new Array(props.depth).fill(null));-- return (- <Index each={depth()}>- {() => <FileLevelSpacer size={props.size ?? 'sm'} />}- </Index>- );-}diff --git a/apps/web/src/lib/core/component/OldMenu.tsx b/apps/web/src/lib/core/component/OldMenu.tsxdeleted file mode 100644index 2e11aef651..0000000000--- a/apps/web/src/lib/core/component/OldMenu.tsx+++ /dev/null@@ -1,255 +0,0 @@-/**- * @file These components are deprecated and should not be used in new code.- * Menu best practices are to use Kobalte Menu with our styled components from Menu.tsx.- * This file is only for legacy support of a few non-standard menus that have not yet been migrated.- */--import { isMobile } from '@core/mobile/isMobile';-import { isTouchDevice } from '@core/mobile/isTouchDevice';-import {- autoUpdate,- computePosition,- flip,- limitShift,- offset,- shift,-} from '@floating-ui/dom';-import CaretRight from '@phosphor-icons/core/regular/caret-right.svg?component-solid';-import { cn } from '@ui';-import {- type Component,- createEffect,- createSignal,- type JSX,- onCleanup,- type ParentProps,- Show,-} from 'solid-js';--interface OldBaseItemProps {- spacerTop?: boolean;- spacerBottom?: boolean;-}-function OldBaseItem(props: ParentProps<OldBaseItemProps>) {- return (- <div class="flex flex-col justify-start items-start w-full">- <Show when={props.spacerTop}>- <h4 class="my-1 border-edge-divider border-t w-full" />- </Show>- <div class="px-1 w-full">{props.children}</div>- <Show when={props.spacerBottom}>- <h4 class="my-1 border-edge-divider border-t w-full" />- </Show>- </div>- );-}--interface OldMenuItemProps extends OldBaseItemProps {- text: string | JSX.Element;- icon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;- iconClass?: string;- onClick?: JSX.EventHandler<HTMLDivElement, MouseEvent>;- chevron?: boolean;- submenu?: JSX.Element;- disabled?: boolean;- selected?: boolean;- secondaryActionHandler?: JSX.EventHandler<HTMLButtonElement, MouseEvent>;- secondaryIcon?: Component<JSX.SvgSVGAttributes<SVGSVGElement>>;- onTouchStart?: JSX.EventHandler<HTMLDivElement, TouchEvent>;- onTouchEnd?: JSX.EventHandler<HTMLDivElement, TouchEvent>;- hotkey?: string | JSX.Element;- textSize?: 'base' | 'sm';- menuRef?: HTMLDivElement;-}--export function OldMenuItem(props: OldMenuItemProps) {- const [showSubmenu, setShowSubmenu] = createSignal(false);- const [submenuPosition, setSubmenuPosition] = createSignal({ x: 0, y: 0 });- const [submenuRef, setSubmenuRef] = createSignal<HTMLDivElement>();- const [menuItemRef, setMenuItemRef] = createSignal<HTMLDivElement>();- const selected = () => props.selected ?? false;-- createEffect(() => {- const submenuRef_ = submenuRef();- const menuItemRef_ = menuItemRef();- if (!submenuRef_ || !menuItemRef_ || !showSubmenu()) return;-- const cleanup = autoUpdate(menuItemRef_, submenuRef_, async () => {- const { x, y } = await computePosition(menuItemRef_, submenuRef_, {- placement: 'right',- middleware: [- offset(0),- flip({- fallbackStrategy: 'bestFit',- }),- shift({- padding: 8,- limiter: limitShift(),- }),- ],- });- setSubmenuPosition({ x, y });- });-- onCleanup(() => cleanup());- });-- return (- <OldBaseItem spacerTop={props.spacerTop} spacerBottom={props.spacerBottom}>- <div- class={cn('group', !isTouchDevice() && 'relative')}- on:touchstart={props.onTouchStart}- on:touchend={props.onTouchEnd}- onmouseenter={() => setShowSubmenu(true)}- onmouseleave={(e) => {- const submenuEl = submenuRef();- const menuEl = props.menuRef;- const toElement = e.relatedTarget as HTMLElement;- if (submenuEl && menuEl) {- if (- toElement &&- (menuEl?.contains(toElement) || toElement === menuEl)- ) {- setShowSubmenu(false);- return;- }- } else if (submenuEl) {- if (- toElement &&- (submenuEl.contains(toElement) || toElement === submenuEl)- ) {- return;- }- }- if (!menuEl) setShowSubmenu(false);- }}- ref={setMenuItemRef}- >- <div- class={cn(- 'flex flex-row w-full justify-between items-center rounded',- isMobile() ? 'py-2 px-1' : 'p-1',- props.disabled- ? 'opacity-50 cursor-not-allowed text-ink'- : selected()- ? 'bg-accent/10'- : 'hover:bg-hover hover-transition-bg text-ink'- )}- onmousedown={(e) => {- if (!props.disabled && props.onClick) {- props.onClick(e);- }- }}- >- <div- class={cn(- 'flex flex-row w-full gap-1.5 justify-start items-center font-medium',- props.textSize === 'base'- ? 'text-base'- : isMobile()- ? 'text-base'- : 'text-sm',- props.secondaryActionHandler && 'max-w-[calc(100%-18px)]'- )}- >- {props.icon && (- <div- class={cn(- 'flex justify-center items-center shrink-0',- isMobile() ? 'size-5' : 'size-4',- selected() && 'text-accent',- props.iconClass- )}- >- <props.icon class="size-full" />- </div>- )}- <div class="w-full truncate">{props.text}</div>- <Show when={props.hotkey}>- <div class="ml-auto pr-1 text-ink-extra-muted">- {props.hotkey}- </div>- </Show>- </div>- <Show- when={props.secondaryActionHandler && props.secondaryIcon}- keyed- >- {(SecondaryIcon) => (- <button- class="hidden group-hover:flex flex-none justify-center items-center hover:bg-hover rounded size-5 text-ink-muted hover:text-ink transition-colors hover:transition-none"- onmousedown={props.secondaryActionHandler}- data-testid="secondary-action-button"- >- <div class="flex justify-center items-center size-4">- <SecondaryIcon />- </div>- </button>- )}- </Show>- <Show when={props.submenu || props.chevron}>- <div class="flex justify-center items-center size-3.5">- <CaretRight class="size-full" />- </div>- </Show>- </div>- <Show when={showSubmenu() && props.submenu}>- <div- class="absolute"- ref={setSubmenuRef}- onmouseleave={(e) => {- // If the menu item has a menuRef, we use sticky hover, i.e. don't close the submenu on mouseleave- if (props.menuRef) return;- const menuItemEl = menuItemRef();- if (menuItemEl) {- const toElement = e.relatedTarget as HTMLElement;- if (- toElement &&- (menuItemEl.contains(toElement) || toElement === menuItemEl)- ) {- return;- }- }- setShowSubmenu(false);- }}- style={{- left: `${isTouchDevice() ? '0' : submenuPosition().x}px`,- top: `${isTouchDevice() ? '0' : submenuPosition().y}px`,- transform: `translateX(${isTouchDevice() ? '100%' : '0'})`,- }}- >- {props.submenu}- </div>- </Show>- </div>- </OldBaseItem>- );-}--type OldMenuWidth = 'sm' | 'md' | 'lg' | `w-${string}` | 'screen';-const oldMenuWidths: Record<OldMenuWidth, string> = {- sm: 'w-28',- md: 'w-44',- lg: 'w-72',- screen: 'w-screen',-};-interface OldMenuProps {- width?: OldMenuWidth;- class?: string;- hide?: boolean;-}-export function OldMenu(props: ParentProps<OldMenuProps>) {- return (- <div- class={cn(- 'menu-surface flex flex-col py-1 justify-start items-start cursor-default select-none',- props.width && (oldMenuWidths[props.width] ?? props.width),- isTouchDevice() && 'relative',- props.hide && 'hidden',- props.class- )}- >- {props.children}- </div>- );-}diff --git a/apps/web/src/lib/core/util/Fragment.tsx b/apps/web/src/lib/core/util/Fragment.tsxdeleted file mode 100644index cb2b931921..0000000000--- a/apps/web/src/lib/core/util/Fragment.tsx+++ /dev/null@@ -1,20 +0,0 @@-import { children, onMount, type ParentComponent, type Ref } from 'solid-js';--/**- * Wrapper that passes resolved children inside JSX Fragment- * Sets ref to node from resolved children- *- * DO NOT USE unless you need a dom reference from a third party Component that doesn't expose `ref`- */-const Fragment: ParentComponent<{ ref: Ref<HTMLElement> }> = (props) => {- const resolved = children(() => props.children);-- onMount(() => {- const cb = props.ref as (el: HTMLElement) => void;- cb(resolved() as HTMLElement);- });-- return <>{resolved()}</>;-};--export default Fragment;diff --git a/apps/web/src/lib/core/util/click.ts b/apps/web/src/lib/core/util/click.tsdeleted file mode 100644index b65c309678..0000000000--- a/apps/web/src/lib/core/util/click.ts+++ /dev/null@@ -1,34 +0,0 @@-/**- * Returns a keydown handler that calls `cb` when Enter is pressed.- * Useful for elements using `onMouseDown` instead of `onClick`,- * since keyboard activation (e.g., Enter key) doesn't trigger `mousedown`.- *- * @param cb - Callback to invoke on Enter key press.- */-export const onKeyDownClick = (cb?: (e: Event) => void) => {- return (e: KeyboardEvent) => {- const keyboardEvent = e as unknown as KeyboardEvent;- if (keyboardEvent.key === 'Enter') {- e.preventDefault();- e.stopPropagation();- cb?.(e);- }- };-};-/**- * Returns a keydown handler that calls `cb` when Space is pressed.- * Useful for elements using `onMouseDown` instead of `onClick`,- * since keyboard activation (e.g., Enter key) doesn't trigger `mousedown`.- *- * @param cb - Callback to invoke on Space key press.- */-export const onKeyUpClick = (cb?: (e: Event) => void) => {- return (e: KeyboardEvent) => {- const keyboardEvent = e as unknown as KeyboardEvent;- if (keyboardEvent.key === ' ') {- e.preventDefault();- e.stopPropagation();- cb?.(e);- }- };-};diff --git a/apps/web/src/lib/core/util/source.ts b/apps/web/src/lib/core/util/source.tsdeleted file mode 100644index 29c036d05d..0000000000--- a/apps/web/src/lib/core/util/source.ts+++ /dev/null@@ -1,11 +0,0 @@-import type { Source, SourceSyncService } from '@core/source';--export function isSourceSyncService(- source: Source-): source is SourceSyncService {- return 'type' in source && source.type === 'sync-service';-}--export function isSourceDSS(source: Source): source is SourceSyncService {- return 'type' in source && source.type === 'dss';-}diff --git a/apps/web/src/lib/core/util/withRecall.ts b/apps/web/src/lib/core/util/withRecall.tsdeleted file mode 100644index 17585b185f..0000000000--- a/apps/web/src/lib/core/util/withRecall.ts+++ /dev/null@@ -1,34 +0,0 @@-type FnWithRecall<F extends (...args: any[]) => any, K> = ((- ...args: Parameters<F>-) => ReturnType<F>) & {- clear(): void;- delete(keyOrArg: K): boolean;- peek(keyOrArg: K): ReturnType<F> | undefined;- size(): number;-};--/**- * Memoize a pure function of a single *keyable* param and return results from- * the internal cache.- */-export function withRecall<A extends PropertyKey, R>(- fn: (arg: A) => R-): FnWithRecall<typeof fn, A> {- const store = new Map<A, R>();-- const wrapped = ((arg: A): R => {- if (store.has(arg)) {- return store.get(arg)!;- }- const out = fn(arg);- store.set(arg, out);- return out;- }) as FnWithRecall<typeof fn, A>;-- wrapped.clear = () => store.clear();- wrapped.delete = (key: A) => store.delete(key);- wrapped.peek = (key: A) => store.get(key);- wrapped.size = () => store.size;-- return wrapped;-}diff --git a/apps/web/src/lib/queries/agent-session/control.ts b/apps/web/src/lib/queries/agent-session/control.tsdeleted file mode 100644index 3b11ec7d57..0000000000--- a/apps/web/src/lib/queries/agent-session/control.ts+++ /dev/null@@ -1,63 +0,0 @@-/**- * Control actions on a live agent session: prompt, stop, model change.- *- * One mutation for the one endpoint. The service owns ordering (a prompt- * posted mid-turn waits in the session's server-side queue), so there is no- * optimistic cache to maintain here; what the caller gets back is the- * accepted action's id, which the fold stamps as `requestId` on the folded- * message the action derives.- */--import { throwOnErr } from '@core/util/result';-import { type MutationCallbacks, withCallbacks } from '@queries/utils';-import { agentHarnessServiceClient } from '@service-agent-harness/client';-import type {- ControlRequest,- ControlResponse,-} from '@service-agent-harness/generated/schemas';-import { useMutation } from '@tanstack/solid-query';--/** One control POST: the session it targets and the action it carries. */-export type AgentSessionControlVars = {- sessionId: string;- action: ControlRequest;-};--/** The shape a caller uses to issue control actions, mutation or fake. */-export type AgentSessionControl = (- vars: AgentSessionControlVars-) => Promise<ControlResponse>;--/**- * Post a control action to an agent session.- *- * `gcTime: 0`: nothing reads a finished control back out of the cache, so- * there is no reason to hold it. Failures reject (`throwOnErr`), which is how- * `mutateAsync` reports them to the composer.- */-export function useAgentSessionControlMutation(- callbacks?: MutationCallbacks<- ControlResponse,- Error,- AgentSessionControlVars,- unknown- >-) {- return useMutation(() => ({- gcTime: 0,- mutationFn: async ({ sessionId, action }: AgentSessionControlVars) =>- await throwOnErr(() => controlAgentSession(sessionId, action)),- ...withCallbacks<ControlResponse, Error, AgentSessionControlVars, unknown>(- {},- callbacks- ),- }));-}--/** Send a session action while preserving the client's typed result. */-export function controlAgentSession(- sessionId: string,- request: ControlRequest-) {- return agentHarnessServiceClient.control(sessionId, request);-}diff --git a/apps/web/src/lib/queries/agent-session/mutations.ts b/apps/web/src/lib/queries/agent-session/mutations.tsdeleted file mode 100644index 40e31f95ba..0000000000--- a/apps/web/src/lib/queries/agent-session/mutations.ts+++ /dev/null@@ -1,28 +0,0 @@-import { throwOnErr } from '@core/util/result';-import { agentHarnessServiceClient } from '@service-agent-harness/client';-import type {- ControlRequest,- CreateAgentSessionRequest,-} from '@service-agent-harness/generated/schemas';-import { useMutation } from '@tanstack/solid-query';-import { invalidateAllSoup } from '../soup/cache';-import { controlAgentSession } from './control';--export function useCreateAgentSessionMutation() {- return useMutation(() => ({- retry: false,- mutationFn: (request: CreateAgentSessionRequest) =>- throwOnErr(() => agentHarnessServiceClient.create(request)),- onSuccess: () => {- invalidateAllSoup();- },- }));-}--export function useAgentSessionControlMutation() {- return useMutation(() => ({- retry: false,- mutationFn: (vars: { sessionId: string; request: ControlRequest }) =>- throwOnErr(() => controlAgentSession(vars.sessionId, vars.request)),- }));-}diff --git a/apps/web/src/lib/queries/storage/team-share.ts b/apps/web/src/lib/queries/storage/team-share.tsdeleted file mode 100644index 41c3848fce..0000000000--- a/apps/web/src/lib/queries/storage/team-share.ts+++ /dev/null@@ -1,49 +0,0 @@-import { throwOnErr } from '@core/util/result';-import { queryClient } from '@queries/client';-import { storageServiceClient } from '@service-storage/client';-import type { DocumentTeamShareResponse } from '@service-storage/generated/schemas/documentTeamShareResponse';-import { queryOptions, useMutation, useQuery } from '@tanstack/solid-query';-import type { Accessor } from 'solid-js';-import { entityKeys } from './keys';--const STALE_TIME = 60 * 1000;--function documentTeamShareQueryOptions(documentId: string) {- return queryOptions({- queryKey: entityKeys.documentTeamShare(documentId).queryKey,- queryFn: () =>- throwOnErr(() =>- storageServiceClient.getDocumentTeamShare({- documentId,- })- ),- staleTime: STALE_TIME,- enabled: !!documentId,- });-}--/**- * Team-share state of a document, resolved against the owner's team.- * `teamId` is absent when the owner does not belong to a team — the- * "Share with team" toggle should be hidden in that case.- */-export function useDocumentTeamShareQuery(documentId: Accessor<string>) {- return useQuery(() => documentTeamShareQueryOptions(documentId()));-}--/** Share or unshare a document with the owner's team (grants the team Edit). */-export function useSetDocumentTeamShareMutation() {- return useMutation(() => ({- mutationFn: (params: { documentId: string; shareWithTeam: boolean }) =>- throwOnErr(() => storageServiceClient.setDocumentTeamShare(params)),- onSuccess(data: DocumentTeamShareResponse, { documentId }) {- queryClient.setQueryData(- entityKeys.documentTeamShare(documentId).queryKey,- data- );- },- onError(error: Error) {- console.error('failed to set document team sharing', error);- },- }));-}diff --git a/apps/web/src/lib/split-router/panes/index.ts b/apps/web/src/lib/split-router/panes/index.tsdeleted file mode 100644index 9da7e7ac4b..0000000000--- a/apps/web/src/lib/split-router/panes/index.ts+++ /dev/null@@ -1,16 +0,0 @@-export { createMemoryPaneStore } from './memory-store';-export { createPanes, type Panes, type PanesOptions } from './panes';-export type {- CloseAction,- HistoryTarget,- OpenIntent,- OpenTarget,- PaneArrival,- PaneChange,- PaneEntry,- PaneId,- PanePolicy,- PaneSnapshot,- PaneStore,- Placement,-} from './types';diff --git a/bun.lock b/bun.lockindex 0c510b297c..91e753e23c 100644--- a/bun.lock+++ b/bun.lock@@ -57,7 +57,6 @@"@corvu/dialog": "^0.2.4","@corvu/drawer": "^0.2.4","@date-fns/tz": "^1.4.1",- "@dinero.js/currencies": "2.0.0-alpha.8","@effect/platform-browser": "4.0.0-rc.111","@floating-ui/dom": "^1.7.4","@fontsource-variable/inter": "^5.2.8",@@ -71,7 +70,6 @@"@ironcalc/wasm": "workspace:*","@kobalte/core": "^0.13.11","@leeoniya/ufuzzy": "^1.0.19",- "@lexical/extension": "0.45.0","@lexical/history": "0.45.0","@lexical/html": "0.45.0","@lexical/link": "0.45.0",@@ -136,7 +134,6 @@"date-fns": "^4.1.0","detect-browser": "^5.3.0","diff": "^9.0.0",- "dinero.js": "2.0.0-alpha.8","effect": "^4.0.0-rc.111","email-validator": "^2.0.4","emojibase-data": "^17.0.0",@@ -161,7 +158,6 @@"short-uuid": "^5.2.0","signature_pad": "^5.0.10","solid-custom-scrollbars": "^0.1.7",- "solid-gesture": "^0.0.3","solid-js": "^1.9.7","solid-styled-components": "^0.28.5","solid-transition-group": "^0.2.3",@@ -539,7 +535,6 @@"@tanstack/[email protected]": "apps/web/patches/@tanstack%[email protected]","[email protected]": "apps/web/patches/[email protected]","@tanstack/[email protected]": "apps/web/patches/@tanstack%[email protected]",- "[email protected]": "apps/web/patches/[email protected]","[email protected]": "apps/web/patches/[email protected]","@kobalte/[email protected]": "apps/web/patches/@kobalte%[email protected]","[email protected]": "apps/web/patches/[email protected]",@@ -853,12 +848,6 @@"@date-fns/tz": ["@date-fns/[email protected]", "", {}, "sha512-lwYN/vDPeNRULcepoE/LO2Pgx+7/RV+S9ARfbc9lr2DtGkOD7pAiruHvbR1RX3Qyf6ja47EWJDMsNK5vK08DJg=="],- "@dinero.js/calculator-number": ["@dinero.js/[email protected]", "", { "dependencies": { "@dinero.js/core": "2.0.0-alpha.8" } }, "sha512-/L+N7g5DjcS6wlMb2hcOXWBKW2TGiG+vZDZr9ow0nsHUTdwtMarL1bmBH9fGldHhH2XsxcrjN9H+036yeNzh3Q=="],-- "@dinero.js/core": ["@dinero.js/[email protected]", "", { "dependencies": { "@dinero.js/currencies": "2.0.0-alpha.8" } }, "sha512-3jaw2j6J/SshlCZz5KhHkh8zP47HRmt9RpnjR0BJs2awpweVuZIyyX9qzGVUEVpml9IwzQ1U+YdXevhOxtcDgg=="],-- "@dinero.js/currencies": ["@dinero.js/[email protected]", "", {}, "sha512-zApiqtuuPwjiM9LJA5/kNcT48VSHRiz2/mktkXjIpfxrJKzthXybUAgEenExIH6dYhLDgVmsLQZtZFOsdYl0Ag=="],-"@effect/platform-browser": ["@effect/[email protected]", "", { "peerDependencies": { "effect": "^4.0.0-rc.111" } }, "sha512-4SmaYB4zWsmuM82V8Dgida2yupzEWlv6/QoDL2Ogj1jOPq65KUx3VjQKcNn2NenOR6SFRWaWsUWrnxwA2IPFzg=="],"@emnapi/core": ["@emnapi/[email protected]", "", { "dependencies": { "@emnapi/wasi-threads": "1.2.2", "tslib": "^2.4.0" } }, "sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA=="],@@ -1895,8 +1884,6 @@"@urql/core": ["@urql/[email protected]", "", { "dependencies": { "@0no-co/graphql.web": "^1.0.13", "wonka": "^6.3.2" } }, "sha512-0F39XWR21+IVLJfsqBvLShvoSzxT6h6wWXwrDhN8j9J+IEVOpQIUNHwpgjsp+2ePzn9aCH+rpDonn3HOAUnn9A=="],- "@use-gesture/core": ["@use-gesture/[email protected]", "", {}, "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw=="],-"@vercel/oidc": ["@vercel/[email protected]", "", {}, "sha512-UycprH3T6n3jH0k44NHMa7pnFHGu/N05MjojYr+Mc6I7obkoLIJujSWwin1pCvdy/eOxrI/l3uDLQsmcrOb4ug=="],"@vitest/mocker": ["@vitest/[email protected]", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.31", "@vitest/spy": "5.0.1", "estree-walker": "^3.0.3", "magic-string": "^1.2.3" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-6K1DoBNAPGvuOcSsGA4D6x+5zEEff/KmOOP3uetT2TrGpVfI+HRHRnJJfKi5ib/g1vx8IYHQD8s0pbJz8WQI7Q=="],@@ -2337,8 +2324,6 @@"diff": ["[email protected]", "", {}, "sha512-svtcdpS8CgJyqAjEQIXdb3OjhFVVYjzGAPO8WGCmRbrml64SPw/jJD4GoE98aR7r25A0XcgrK3F02yw9R/vhQw=="],- "dinero.js": ["[email protected]", "", { "dependencies": { "@dinero.js/calculator-number": "2.0.0-alpha.8", "@dinero.js/core": "2.0.0-alpha.8", "@dinero.js/currencies": "2.0.0-alpha.8" } }, "sha512-6bl+g6oh6iQ6vPR5Pd4qr7D+P5e51GYRUT3jl8HYqYeejYC5sd9OVTTbXC3WU7L25mAIbOm+diiTVz1rL4QLwg=="],-"dir-glob": ["[email protected]", "", { "dependencies": { "path-type": "^4.0.0" } }, "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA=="],"dogapi": ["[email protected]", "", { "dependencies": { "extend": "^3.0.2", "json-bigint": "^1.0.0", "lodash": "^4.17.21", "minimist": "^1.2.5", "rc": "^1.2.8" }, "bin": { "dogapi": "bin/dogapi" } }, "sha512-065fsvu5dB0o4+ENtLjZILvXMClDNH/yA9H6L8nsdcNiz9l0Hzpn7aQaCOPYXxqyzq4CRPOdwkFXUjDOXfRGbg=="],@@ -3485,8 +3470,6 @@"solid-focus-trap": ["[email protected]", "", { "dependencies": { "@corvu/utils": "~0.4.2" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-LTyNki6GUJPRLXV5uMWPkYClB07SUMubbr2EkAddiR0CJCF/I283txilMU9RURSr/P8EewMfXWu2o3aWrK7A5A=="],- "solid-gesture": ["[email protected]", "", { "dependencies": { "@use-gesture/core": "^10.2.16" }, "peerDependencies": { "solid-js": ">=1.4.0" } }, "sha512-7vbhm+eYXXqr0y9/uVMHknscn9THHozx4wA0SEUwVsRjEPUd1Y9BKWDaG2s+GZafAEEucr7bWsMQKb49c0X1Fw=="],-"solid-js": ["[email protected]", "", { "dependencies": { "csstype": "^3.1.0", "seroval": "~1.5.4", "seroval-plugins": "~1.5.4" } }, "sha512-sAEXC0Kk0S1EDg+8ysEWJDbYhA3RRoEjwuySUGlKIemeo0I5YZfOyumNjNs9Sv3y2nmhD+0rW66ag2HsMuQiGQ=="],"solid-presence": ["[email protected]", "", { "dependencies": { "@corvu/utils": "~0.4.2" }, "peerDependencies": { "solid-js": "^1.8" } }, "sha512-YM92o+jvpzX3XGaD4rLYmq/Kc2ZVh47GSCLEufHBFQQIurvZTs8SoGJxO8BJGNDxBKdcS8F3dYhW1SDXp4BNjA=="],diff --git a/crates/macro_db_client/fixtures/basic_document_summary.sql b/crates/macro_db_client/fixtures/basic_document_summary.sqldeleted file mode 100644index 35c70dfb18..0000000000--- a/crates/macro_db_client/fixtures/basic_document_summary.sql+++ /dev/null@@ -1,102 +0,0 @@--- Create a test user-INSERT INTO public."macro_user" ("id", "username", "email", "stripe_customer_id")-VALUES ('a1111111-1111-1111-1111-111111111111', 'user', '[email protected]', 'stripe_id');--INSERT INTO- public."User" ("id", "email", "stripeCustomerId", "macro_user_id")-VALUES (- 'macro|[email protected]',- '[email protected]',- 'stripe_id',- 'a1111111-1111-1111-1111-111111111111'-);---- Create test documents-INSERT INTO- public."Document" (- "id",- "name",- "fileType",- "owner",- "createdAt",- "updatedAt"- )-VALUES- (- 'document-one',- 'test_document_one',- 'txt',- 'macro|[email protected]',- '2019-10-16 00:00:00',- '2019-10-16 00:00:00'- ),- (- 'document-two',- 'test_document_two',- 'pdf',- 'macro|[email protected]',- '2019-10-16 01:00:00',- '2019-10-16 01:00:00'- ),- (- 'no-insight-document',- 'no_insight_document',- 'txt',- 'macro|[email protected]',- '2019-10-16 02:00:00',- '2019-10-16 02:00:00'- );---- Insert a sample DocumentInsight-INSERT INTO- public."DocumentSummary" (- "document_id",- "summary",- "version_id"- )-VALUES- (- 'document-one',- 'This is a test document summary',- 'version-0'- );---INSERT INTO- public."DocumentSummary" (- "document_id",- "summary",- "version_id"- )-VALUES- (- 'document-one',- 'This is a test document summary',- 'test-hash-123'- ),- (- 'document-one',- 'This is a test document summary',- 'test-hash-123'- );--INSERT INTO- public."DocumentSummary"(- "id",- "document_id",- "summary",- "version_id"- )-VALUES- (- 'delete-one',- 'document-one',- 'This is a test document summary',- 'test-hash-123'- ),- (- 'delete-two',- 'document-one',- 'This is a test document summary',- 'test-hash-123'- );diff --git a/crates/macro_db_client/fixtures/chat_with_attachment_summaries.sql b/crates/macro_db_client/fixtures/chat_with_attachment_summaries.sqldeleted file mode 100644index 15e118adb8..0000000000--- a/crates/macro_db_client/fixtures/chat_with_attachment_summaries.sql+++ /dev/null@@ -1,199 +0,0 @@-INSERT INTO public."macro_user" ("id", "username", "email", "stripe_customer_id")-VALUES ('a1111111-1111-1111-1111-111111111111', 'test', '[email protected]', 'stripe_id');--INSERT INTO- public."User"- ("id", "email", "stripeCustomerId", "macro_user_id")-VALUES- (- 'test-userid',- '[email protected]',- 'stripe_id',- 'a1111111-1111-1111-1111-111111111111'- );--INSERT INTO- public."Document"- (- "id",- "name",- "fileType",- "owner"- )-VALUES- (- 'a0000000-0000-0000-0000-000000000000',- 'document-name-0',- 'md',- 'test-userid'- ),- (- 'a0000000-0000-0000-0000-000000000001',- 'document-name-1',- 'js',- 'test-userid'- ),- (- 'a0000000-0000-0000-0000-000000000002',- 'document-name-2',- 'rs',- 'test-userid'- ),- (- 'a0000000-0000-0000-0000-00000000000a',- 'document-name-img',- 'png',- 'test-userid'- ),- (- 'a0000000-0000-0000-0000-00000000000b',- 'document-name-never',- 'sql',- 'test-userid'- );--INSERT INTO- public."Chat"- (- "id",- "userId",- "name"- )-VALUES- (- 'chat-id-0',- 'test-userid',- 'chat-name-0'- ),- (- 'chat-id-1',- 'test-userid',- 'chat-name-1'- ),- (- 'chat-id-empty',- 'test-userid',- 'chat-name-empty'- );--INSERT INTO- public."ChatMessage" (- "id",- "content",- "role",- "chatId",- "createdAt"- )-VALUES--- chat 0 --- (- 'c0m0',- '"m0-content"',- 'user',- 'chat-id-0',- '2019-10-16 00:00:00'- ),- (- 'c0m1',- '"m1-content"',- 'assistant',- 'chat-id-0',- '2019-10-17 00:00:00'- ),- (- 'c0m2',- '"m2-content"',- 'user',- 'chat-id-0',- '2019-10-18 00:00:00'- ),--- chat 1 --- (- 'c1m0',- '"m0-content"',- 'user',- 'chat-id-1',- '2019-10-16 00:00:00'- ),- (- 'c1m1',- '"m1-content"',- 'assistant',- 'chat-id-1',- '2019-10-17 00:00:00'- );----- attachments ---INSERT INTO- public."ChatAttachment"- (- "id",- "entity_type",- "entity_id",- "messageId"- )-VALUES- (- 'c0a0',- 'static_file',- 'a0000000-0000-0000-0000-00000000000a',- 'c0m0'- ),- (- 'c0a1',- 'document',- 'a0000000-0000-0000-0000-000000000000',- 'c0m0'- ),- (- 'c0a2',- 'document',- 'a0000000-0000-0000-0000-000000000000',- 'c0m1'- ),- (- 'c0a3',- 'document',- 'a0000000-0000-0000-0000-000000000001',- 'c0m1'- ),- (- 'c0a4',- 'document',- 'a0000000-0000-0000-0000-000000000002',- 'c0m1'- ),- (- 'c1a0',- 'document',- 'a0000000-0000-0000-0000-000000000000',- 'c0m1'- );--INSERT INTO- public."DocumentSummary" (- "summary",- "document_id",- "version_id",- "createdAt"- )-VALUES- (- 'd0v0-summary',- 'a0000000-0000-0000-0000-000000000000',- 'v0',- '2025-06-10 00:00:00'- ),- (- 'd0v1-summary',- 'a0000000-0000-0000-0000-000000000000',- 'v1',- '2025-06-11 00:00:00'- ),- (- 'd1v0-summary',- 'a0000000-0000-0000-0000-000000000001',- 'v0',- '2025-06-12 00:00:00'- );\ No newline at end of filediff --git a/crates/macro_db_client/fixtures/insights_backfill.sql b/crates/macro_db_client/fixtures/insights_backfill.sqldeleted file mode 100644index c4e1e9b12b..0000000000--- a/crates/macro_db_client/fixtures/insights_backfill.sql+++ /dev/null@@ -1,142 +0,0 @@--- Create test user for insights backfill-INSERT INTO public."macro_user" ("id", "username", "email", "stripe_customer_id")-VALUES ('a1111111-1111-1111-1111-111111111111', 'test', '[email protected]', 'stripe_test_id');--INSERT INTO- public."User" ("id", "email", "stripeCustomerId", "macro_user_id")-VALUES- (- 'test-user-1',- '[email protected]',- 'stripe_test_id',- 'a1111111-1111-1111-1111-111111111111'- );---- Create test insights backfill job-INSERT INTO- public."EmailInsightsBackfillJob" (- "id",- "userId",- "threadsProcessedCount",- "insightsGeneratedCount",- "status",- "completedAt",- "createdAt",- "updatedAt"- )-VALUES- (- 'test-job-1',- 'test-user-1',- 25,- 10,- 'InProgress' :: "insights_backfill_job_status",- NULL,- '2024-01-01 09:00:00+00' :: timestamptz,- '2024-01-01 10:30:00+00' :: timestamptz- ),- (- 'test-job-2',- 'test-user-1',- 0,- 0,- 'Init' :: "insights_backfill_job_status",- NULL,- '2024-01-01 11:00:00+00' :: timestamptz,- '2024-01-01 11:00:00+00' :: timestamptz- ),- (- 'test-job-complete',- 'test-user-1',- 10,- 5,- 'Complete' :: "insights_backfill_job_status",- '2024-01-01 08:30:00+00' :: timestamptz,- '2024-01-01 07:00:00+00' :: timestamptz,- '2024-01-01 08:30:00+00' :: timestamptz- );---- Create test insights backfill batches-INSERT INTO- public."EmailInsightsBackfillBatch" (- "id",- "insightsBackfillJobId",- "sqsMessageId",- "threadIds",- "totalThreads",- "status",- "insightsGeneratedCount",- "insightIds",- "errorMessage",- "queuedAt",- "startedAt",- "completedAt",- "createdAt",- "updatedAt"- )-VALUES- (- 'test-batch-1',- 'test-job-1',- 'sqs-msg-id-1',- '{"thread1", "thread2", "thread3"}',- 3,- 'Complete' :: "insights_backfill_batch_status",- 5,- '{"insight-1", "insight-2", "insight-3", "insight-4", "insight-5"}',- NULL,- '2024-01-01 10:00:00+00' :: timestamptz,- '2024-01-01 10:05:00+00' :: timestamptz,- '2024-01-01 10:15:00+00' :: timestamptz,- '2024-01-01 09:30:00+00' :: timestamptz,- '2024-01-01 10:15:00+00' :: timestamptz- ),- (- 'test-batch-2',- 'test-job-1',- NULL,- '{"thread4", "thread5"}',- 2,- 'InProgress' :: "insights_backfill_batch_status",- 0,- NULL,- NULL,- '2024-01-01 10:20:00+00' :: timestamptz,- '2024-01-01 10:25:00+00' :: timestamptz,- NULL,- '2024-01-01 10:15:00+00' :: timestamptz,- '2024-01-01 10:25:00+00' :: timestamptz- ),- (- 'test-batch-failed',- 'test-job-2',- 'sqs-msg-id-failed',- '{"thread6"}',- 1,- 'Failed' :: "insights_backfill_batch_status",- 0,- NULL,- 'Processing error occurred',- '2024-01-01 11:00:00+00' :: timestamptz,- '2024-01-01 11:05:00+00' :: timestamptz,- '2024-01-01 11:10:00+00' :: timestamptz,- '2024-01-01 10:50:00+00' :: timestamptz,- '2024-01-01 11:10:00+00' :: timestamptz- ),- (- 'test-batch-queued',- 'test-job-2',- NULL,- '{"thread7", "thread8"}',- 2,- 'Queued' :: "insights_backfill_batch_status",- 0,- NULL,- NULL,- NULL,- NULL,- NULL,- '2024-01-01 11:30:00+00' :: timestamptz,- '2024-01-01 11:30:00+00' :: timestamptz- );-diff --git a/crates/macro_db_client/fixtures/macro_example.sql b/crates/macro_db_client/fixtures/macro_example.sqldeleted file mode 100644index 853f77053a..0000000000--- a/crates/macro_db_client/fixtures/macro_example.sql+++ /dev/null@@ -1,29 +0,0 @@--- Insert macro_user entries-INSERT INTO public."macro_user" ("id", "username", "email", "stripe_customer_id")-VALUES ('a2222222-2222-2222-2222-222222222222', '[email protected]', '[email protected]', 'stripe_id_2');--INSERT INTO public."macro_user" ("id", "username", "email", "stripe_customer_id")-VALUES ('a1111111-1111-1111-1111-111111111111', '[email protected]', '[email protected]', 'stripe_id');---- Insert users-INSERT INTO public."User" ("id", "email", "stripeCustomerId", "macro_user_id")-VALUES ('macro|[email protected]', '[email protected]', 'stripe_id_2', 'a2222222-2222-2222-2222-222222222222');--INSERT INTO public."User" ("id", "email", "stripeCustomerId", "macro_user_id")-VALUES ('macro|[email protected]', '[email protected]', 'stripe_id', 'a1111111-1111-1111-1111-111111111111');---- Macro Prompts-INSERT INTO public."MacroPrompt" ("id", "title", "prompt", "icon", "color", "required_docs", "user_id", "created_at", "updated_at")-VALUES ('prompt-one', 'Test Prompt 1', 'This is a test prompt 1', 'icon1', 'red', NULL, 'macro|[email protected]', '2019-10-16 00:00:00', '2019-10-16 00:00:00');--INSERT INTO public."MacroPrompt" ("id", "title", "prompt", "icon", "color", "required_docs", "user_id", "created_at", "updated_at")-VALUES ('prompt-two', 'Test Prompt 2', 'This is a test prompt 2', 'icon2', 'blue', 2, 'macro|[email protected]', '2019-10-16 00:00:00', '2019-10-16 00:00:00');--INSERT INTO public."MacroPrompt" ("id", "title", "prompt", "icon", "color", "required_docs", "user_id", "created_at", "updated_at")-VALUES ('prompt-three', 'Test Prompt 3', 'This is a test prompt 3', 'icon3', 'green', 1, 'macro|[email protected]', '2019-10-16 00:00:00', '2019-10-16 00:00:00');--INSERT INTO public."MacroPrompt" ("id", "title", "prompt", "icon", "color", "required_docs", "user_id", "created_at", "updated_at")-VALUES ('prompt-four', 'Test Prompt 4', 'This is a test prompt 4', 'icon4', 'yellow', 5, 'macro|[email protected]', '2019-10-16 00:00:00', '2019-10-16 00:00:00');--INSERT INTO public."MacroPrompt" ("id", "title", "prompt", "icon", "color", "required_docs", "user_id", "created_at", "updated_at")-VALUES ('prompt-five', 'Test Prompt 5', 'This is a test prompt 5', 'icon5', 'yellow', NULL, 'macro|[email protected]', '2019-10-16 00:00:00', '2019-10-16 00:00:00');diff --git a/crates/macro_db_client/migrations/20261015155830_drop_unused_legacy_tables.sql b/crates/macro_db_client/migrations/20261015155830_drop_unused_legacy_tables.sqlnew file mode 100644index 0000000000..47c3d4ed5e--- /dev/null+++ b/crates/macro_db_client/migrations/20261015155830_drop_unused_legacy_tables.sql@@ -0,0 +1,20 @@+-- Retire storage with no remaining application readers/writers. The 2026-10-15+-- audit checked macro-api's GraphQL service, the deployed monorepo revision+-- 00a71cd7d651216e4913bd5c2b66fb1954dea3cd, and the absence of insight-service+-- workloads/schedules in production. Historical insight data is intentionally+-- discarded; the organization/enterprise tables still used by macro-api stay.+--+-- Do not use CASCADE: an unexpected external dependency must block this drop.+SET LOCAL lock_timeout = '5s';++DROP TABLE "WebsocketConnectionPermissions";+DROP TABLE "MacroPromptAttachment";+DROP TABLE "Artifact";++-- Drop the backfill child before its parent.+DROP TABLE "EmailInsightsBackfillBatch";+DROP TABLE "EmailInsightsBackfillJob";+DROP TABLE "DocumentSummary";+DROP TABLE "UserInsightBatch";+DROP TABLE "UserInsights";+DROP TABLE "InsightContext";diff --git a/crates/macro_db_client/migrations/20261015160030_drop_unused_macro_prompts.sql b/crates/macro_db_client/migrations/20261015160030_drop_unused_macro_prompts.sqlnew file mode 100644index 0000000000..70e7082cb9--- /dev/null+++ b/crates/macro_db_client/migrations/20261015160030_drop_unused_macro_prompts.sql@@ -0,0 +1,12 @@+-- Follow-up to the legacy-query cleanup: get_macro_share_permission had no+-- callers in current main or the deployed monorepo, and the old DCS /macros+-- routes are no longer deployed. Keep this schema change separate from the+-- service-only cleanup of that helper and its SQLx metadata.+-- Historical prompt data is intentionally discarded. SharePermission is shared+-- by active features and must remain, as must the organization/enterprise tables.+SET LOCAL lock_timeout = '5s';++-- MacroPromptAttachment was removed by the preceding migration. Preserve+-- PostgreSQL's default RESTRICT behavior for any other unexpected dependents.+DROP TABLE "MacroPromptPermission";+DROP TABLE "MacroPrompt";diff --git a/crates/macro_db_client/src/experiment.rs b/crates/macro_db_client/src/experiment.rsindex 4985976857..0d45ccdc9d 100644--- a/crates/macro_db_client/src/experiment.rs+++ b/crates/macro_db_client/src/experiment.rs@@ -1,73 +1,4 @@-use model::experiment::{Experiment, ExperimentOperation};--/// Creates a new experiment-#[tracing::instrument(skip(db))]-pub async fn create_experiment(- db: &sqlx::Pool<sqlx::Postgres>,- id: &str,-) -> anyhow::Result<Experiment> {- let result = sqlx::query_as!(- Experiment,- r#"- INSERT INTO "Experiment" (id)- VALUES ($1)- RETURNING id, active, "started_at"::timestamptz as started_at, "ended_at"::timestamptz as ended_at- "#,- id,- )- .fetch_one(db)- .await?;-- Ok(result)-}--/// Updates an experiment to start/end it-#[tracing::instrument(skip(db))]-pub async fn patch_experiment(- db: &sqlx::Pool<sqlx::Postgres>,- id: &str,- operation: ExperimentOperation,-) -> anyhow::Result<()> {- match operation {- ExperimentOperation::Start => {- sqlx::query!(- r#"- UPDATE "Experiment" SET active = true AND started_at = NOW() WHERE id = $1- "#,- id,- )- .execute(db)- .await?;- }- ExperimentOperation::End => {- sqlx::query!(- r#"- UPDATE "Experiment" SET active = false AND ended_at = NOW() WHERE id = $1- "#,- id,- )- .execute(db)- .await?;- }- }-- Ok(())-}--/// Deletes an experiment-#[tracing::instrument(skip(db))]-pub async fn delete_experiment(db: &sqlx::Pool<sqlx::Postgres>, id: &str) -> anyhow::Result<()> {- sqlx::query!(- r#"- DELETE FROM "Experiment" WHERE id = $1- "#,- id,- )- .execute(db)- .await?;-- Ok(())-}+use model::experiment::Experiment;/// Gets all of the active experiments#[tracing::instrument(skip(db))]@@ -87,25 +18,3 @@ pub async fn get_active_experiments(Ok(experiments)}--/// Gets all of the users active experiments-#[tracing::instrument(skip(db))]-pub async fn get_active_experiments_for_user(- db: &sqlx::Pool<sqlx::Postgres>,- user_id: &str,-) -> anyhow::Result<Vec<Experiment>> {- let experiments = sqlx::query_as!(- Experiment,- r#"- SELECT e.id, e.active, e."started_at"::timestamptz as started_at, e."ended_at"::timestamptz as ended_at- FROM "Experiment" e- JOIN "ExperimentLog" el ON e.id = el.experiment_id- WHERE el.user_id = $1 AND e.active = true- "#,- user_id,- )- .fetch_all(db)- .await?;-- Ok(experiments)-}diff --git a/crates/macro_db_client/src/experiment_log.rs b/crates/macro_db_client/src/experiment_log.rsindex 0c2be9f22c..264d7d251d 100644--- a/crates/macro_db_client/src/experiment_log.rs+++ b/crates/macro_db_client/src/experiment_log.rs@@ -1,52 +1,3 @@-use model::experiment::ExperimentLog;--/// Creates a new experiment log-#[tracing::instrument(skip(db))]-pub async fn create_experiment_log(- db: &sqlx::Pool<sqlx::Postgres>,- user_id: &str,- experiment_id: &str,- group: &str,-) -> anyhow::Result<ExperimentLog> {- let experiment_log = sqlx::query_as!(- ExperimentLog,- r#"- INSERT INTO "ExperimentLog" (experiment_id, user_id, "group")- VALUES ($1, $2, $3)- RETURNING experiment_id, user_id, "group" as experiment_group, completed- "#,- experiment_id,- user_id,- group,- )- .fetch_one(db)- .await?;-- Ok(experiment_log)-}--/// Completes an experiment log-#[tracing::instrument(skip(db))]-pub async fn complete_experiment_log(- db: &sqlx::Pool<sqlx::Postgres>,- user_id: &str,- experiment_id: &str,-) -> anyhow::Result<()> {- sqlx::query!(- r#"- UPDATE "ExperimentLog"- SET completed = true- WHERE user_id = $1 AND experiment_id = $2- "#,- user_id,- experiment_id,- )- .fetch_one(db)- .await?;-- Ok(())-}-/// Initializes the experiments for a provided user#[tracing::instrument(skip(db))]pub async fn bulk_create_experiment_logs(diff --git a/crates/macro_db_client/src/organization/remove/mod.rs b/crates/macro_db_client/src/organization/remove/mod.rsindex 24a9e1166e..7230f19a30 100644--- a/crates/macro_db_client/src/organization/remove/mod.rs+++ b/crates/macro_db_client/src/organization/remove/mod.rs@@ -1,3 +1,2 @@-pub mod organization_default_share_permission;pub mod organization_invitation;pub mod organization_retention_policy;diff --git a/crates/macro_db_client/src/organization/remove/organization_default_share_permission.rs b/crates/macro_db_client/src/organization/remove/organization_default_share_permission.rsdeleted file mode 100644index 2425be3d3e..0000000000--- a/crates/macro_db_client/src/organization/remove/organization_default_share_permission.rs+++ /dev/null@@ -1,20 +0,0 @@-use sqlx::{Postgres, Transaction};--/// Removes the organization default share permission.-#[tracing::instrument(skip(transaction))]-pub async fn remove_organization_default_share_permission(- transaction: &mut Transaction<'_, Postgres>,- organization_id: i32,-) -> anyhow::Result<()> {- sqlx::query!(- r#"- DELETE FROM "OrganizationDefaultSharePermission"- WHERE "organization_id" = $1- "#,- organization_id,- )- .execute(transaction.as_mut())- .await?;-- Ok(())-}diff --git a/crates/macro_db_client/src/share_permission/get.rs b/crates/macro_db_client/src/share_permission/get.rsindex 57fe7b708d..ea9c5a296f 100644--- a/crates/macro_db_client/src/share_permission/get.rs+++ b/crates/macro_db_client/src/share_permission/get.rs@@ -223,51 +223,6 @@ pub async fn get_chat_share_permission()}-#[tracing::instrument(skip(db))]-pub async fn get_macro_share_permission(- db: &sqlx::Pool<sqlx::Postgres>,- macro_prompt_id: &str,-) -> anyhow::Result<SharePermissionV2> {- let result = sqlx::query!(- r#"- SELECT- sp.id as id,- sp."linkShare" as "link_share?",- sp."linkShareAccessLevel" as "link_share_access_level?: AccessLevel",- sp.team_share_access_level as "team_share_access_level?: AccessLevel",- m."user_id" as owner,- COALESCE(- json_agg(json_build_object(- 'channel_id', csp."channel_id",- 'access_level', csp."access_level"- )) FILTER (WHERE csp."channel_id" IS NOT NULL),- '[]'- ) as "channel_share_permissions?"- FROM- "MacroPromptPermission" mpp- JOIN "SharePermission" sp ON mpp."share_permission_id" = sp.id- JOIN "MacroPrompt" m ON mpp."macro_prompt_id" = m.id- LEFT JOIN "ChannelSharePermission" csp ON csp."share_permission_id" = sp.id- WHERE- mpp."macro_prompt_id" = $1- GROUP BY- sp.id, m."user_id"- "#,- macro_prompt_id,- )- .fetch_one(db)- .await?;-- parse_share_permission(- result.id,- result.link_share,- result.link_share_access_level,- result.team_share_access_level,- result.owner,- result.channel_share_permissions,- )-}-#[tracing::instrument(skip(db))]pub async fn get_email_thread_permission(db: &sqlx::Pool<sqlx::Postgres>,diff --git a/crates/model/src/experiment.rs b/crates/model/src/experiment.rsindex b0999a51c0..13a001c007 100644--- a/crates/model/src/experiment.rs+++ b/crates/model/src/experiment.rs@@ -12,24 +12,3 @@ pub struct Experiment {/// The date the experiment was endedpub ended_at: Option<chrono::DateTime<chrono::Utc>>,}--#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]-#[serde(rename_all = "snake_case")]-pub enum ExperimentOperation {- /// Starts an experiment- Start,- /// Ends an experiment- End,-}--#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, ToSchema)]-pub struct ExperimentLog {- /// The id of the experiment- pub experiment_id: String,- /// The id of the user- pub user_id: String,- /// The group the experiment belongs to, can either be 'A' or 'B'- pub experiment_group: String,- /// Whether the user has completed the experiment- pub completed: bool,-}diff --git a/docs/development/database.md b/docs/development/database.mdindex 6c3f2634d2..cac6a0a587 100644--- a/docs/development/database.md+++ b/docs/development/database.md@@ -12,7 +12,7 @@ explicit Nix invocation. See also [Rust development](rust.md).- Inspect migrations or use the [dump-schema skill](../../.agents/skills/dump-schema/SKILL.md)against the local database. Do not guess table or column spelling.- Quote camelCase identifiers and alias selected columns to their Rust field- names: `SELECT "userId" AS user_id FROM "UserInsights"`.+ names: `SELECT "userId" AS user_id FROM "Chat"`.- Use the owning domain's database adapter; follow the `[db]` rules(CS-01–09) in [`rust/db.md`](../../.agents/rules/rust/db.md) and ownership rule(CS-27) in [`rust/architecture.md`](../../.agents/rules/rust/architecture.md).diff --git a/nix-support/node_modules-hashes.json b/nix-support/node_modules-hashes.jsonindex 31e5d42914..a5b4d38ebc 100644--- a/nix-support/node_modules-hashes.json+++ b/nix-support/node_modules-hashes.json@@ -1,6 +1,6 @@{"nodeModules": {- "aarch64-darwin": "sha256-XljXiI5DuwI7JGc5FhAq//qjhq1WCIu6VVD3uisQqCI=",- "x86_64-linux": "sha256-2Z6ketjBQxNrYVlCMyntHpQWaDiEV97RjLWPJeoF6yA="+ "aarch64-darwin": "sha256-OurU3N9ggPntucylCv1CpAun6KIAr4bNcxV3pcO9huM=",+ "x86_64-linux": "sha256-l7JVt3zdZyXWS66/ZDxpEXh6EdhYT/7O1gvbPGe9j6E="}}diff --git a/package.json b/package.jsonindex fe12efcc60..4276d2d2a3 100644--- a/package.json+++ b/package.json@@ -34,7 +34,6 @@},"packageManager": "[email protected]","patchedDependencies": {- "[email protected]": "apps/web/patches/[email protected]","@thisbeyond/[email protected]": "apps/web/patches/@thisbeyond%[email protected]","@lexical/[email protected]": "apps/web/patches/@lexical%[email protected]","@kobalte/[email protected]": "apps/web/patches/@kobalte%[email protected]",