Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

✨ feat: add standalone workbench SPA target (#17786)

Innei5287fe849f72
diff --git a/.gitignore b/.gitignore
index 1affee5713c..bd5acf81eb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -60,6 +60,7 @@ bun.lockb
dist/
public/_spa/
public/_spa-auth/
+public/_spa-workbench/
public/spa/
es/
lib/
@@ -94,6 +95,7 @@ public/swe-worker*
# Generated files
src/app/spa/[variants]/[[...path]]/spaHtmlTemplates.ts
src/app/spa-auth/authHtmlTemplate.ts
+src/app/spa-workbench/workbenchHtmlTemplate.ts
public/*.js
robots.txt
diff --git a/Dockerfile b/Dockerfile
index 2bdbc42b444..71f7ab2d12d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -104,6 +104,7 @@ COPY --from=builder /app/.next/standalone /app/
COPY --from=builder /app/.next/static /app/.next/static
# Copy SPA assets (Vite build output)
COPY --from=builder /app/public/_spa /app/public/_spa
+COPY --from=builder /app/public/_spa-workbench /app/public/_spa-workbench
# Copy database migrations
COPY --from=builder /app/packages/database/migrations /app/migrations
COPY --from=builder /app/scripts/migrateServerDB/docker.cjs /app/docker.cjs
diff --git a/apps/server/src/routers/lambda/__tests__/agentDocument.chatTopic.test.ts b/apps/server/src/routers/lambda/__tests__/agentDocument.chatTopic.test.ts
index cfbf6e59af1..eaf962b27ae 100644
--- a/apps/server/src/routers/lambda/__tests__/agentDocument.chatTopic.test.ts
+++ b/apps/server/src/routers/lambda/__tests__/agentDocument.chatTopic.test.ts
@@ -12,6 +12,7 @@ const mocks = vi.hoisted(() => ({
associate: vi.fn(),
createTopic: vi.fn(),
findByAgentAndDocumentTrigger: vi.fn(),
+ getReaderDocument: vi.fn(),
findRowByDocumentId: vi.fn(),
getServerDB: vi.fn(),
}));
@@ -144,3 +145,60 @@ describe('agentDocumentRouter.getOrCreateChatTopic', () => {
expect(mocks.associate).not.toHaveBeenCalled();
});
});
+
+describe('agentDocumentRouter.getReaderDocument', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ mocks.getServerDB.mockResolvedValue({ kind: 'server-db' });
+ vi.mocked(AgentDocumentsService).mockImplementation(
+ () => ({ getReaderDocument: mocks.getReaderDocument }) as unknown as AgentDocumentsService,
+ );
+ });
+
+ it('returns only the read-only page fields for an agent-bound document', async () => {
+ mocks.getReaderDocument.mockResolvedValue({
+ accessPublic: 0,
+ accessSelf: 3,
+ accessShared: 0,
+ agentId: 'agent-1',
+ content: '# Projected Markdown',
+ documentId: 'docs_abc',
+ editorData: { root: {} },
+ filename: 'spec.md',
+ fileType: 'text/markdown',
+ sourceType: 'file',
+ title: 'Spec',
+ updatedAt: new Date('2026-07-31T00:00:00.000Z'),
+ userId: 'user-1',
+ });
+
+ const caller = createCaller(await createContextInner({ userId: 'user-1' }));
+ const result = await caller.getReaderDocument({
+ agentId: 'agent-1',
+ documentId: 'docs_abc',
+ });
+
+ expect(mocks.getReaderDocument).toHaveBeenCalledWith('agent-1', 'docs_abc');
+ expect(result).toEqual({
+ content: '# Projected Markdown',
+ documentId: 'docs_abc',
+ filename: 'spec.md',
+ fileType: 'text/markdown',
+ sourceType: 'file',
+ title: 'Spec',
+ updatedAt: new Date('2026-07-31T00:00:00.000Z'),
+ });
+ expect(result).not.toHaveProperty('editorData');
+ expect(result).not.toHaveProperty('userId');
+ });
+
+ it('returns NOT_FOUND when the document is not bound to the requested agent', async () => {
+ mocks.getReaderDocument.mockResolvedValue(undefined);
+
+ const caller = createCaller(await createContextInner({ userId: 'user-1' }));
+
+ await expect(
+ caller.getReaderDocument({ agentId: 'agent-1', documentId: 'docs_missing' }),
+ ).rejects.toMatchObject({ code: 'NOT_FOUND' });
+ });
+});
diff --git a/apps/server/src/routers/lambda/agentDocument.ts b/apps/server/src/routers/lambda/agentDocument.ts
index c67a0898457..f71c09632fe 100644
--- a/apps/server/src/routers/lambda/agentDocument.ts
+++ b/apps/server/src/routers/lambda/agentDocument.ts
@@ -22,6 +22,7 @@ import { emitAgentDocumentToolOutcomeSafely } from '@/server/services/agentDocum
import { AgentDocumentVfsService } from '@/server/services/agentDocumentVfs';
import { AgentDocumentVfsError } from '@/server/services/agentDocumentVfs/errors';
import { getUnifiedSkillNamespaceRootPath } from '@/server/services/agentDocumentVfs/mounts/skills/path';
+import { assertCanPerformResourceAction } from '@/server/services/resourcePermission';
import { SkillManagementDocumentService } from '@/server/services/skillManagement';
import { SystemAgentService } from '@/server/services/systemAgent';
@@ -1085,6 +1086,62 @@ export const agentDocumentRouter = router({
}
}),
+ /** Read-only document payload for the standalone Agent Document page. */
+ getReaderDocument: agentDocumentProcedure
+ .input(
+ z.object({
+ agentId: z.string(),
+ documentId: z.string(),
+ }),
+ )
+ .query(async ({ ctx, input }) => {
+ const grantedPermissions = (ctx as { workspacePermissionCodes?: string[] })
+ .workspacePermissionCodes;
+
+ if (ctx.workspaceId) {
+ await assertCanPerformResourceAction({
+ action: 'view',
+ db: ctx.serverDB,
+ grantedPermissions,
+ resourceId: input.agentId,
+ resourceType: 'agent',
+ userId: ctx.userId,
+ workspaceId: ctx.workspaceId,
+ });
+ }
+
+ const document = await ctx.agentDocumentService.getReaderDocument(
+ input.agentId,
+ input.documentId,
+ );
+
+ if (!document) {
+ throw new TRPCError({ code: 'NOT_FOUND', message: 'Agent document not found' });
+ }
+
+ if (ctx.workspaceId) {
+ await assertCanPerformResourceAction({
+ action: 'view',
+ db: ctx.serverDB,
+ grantedPermissions,
+ resourceId: input.documentId,
+ resourceType: 'document',
+ userId: ctx.userId,
+ workspaceId: ctx.workspaceId,
+ });
+ }
+
+ return {
+ content: document.content,
+ documentId: document.documentId,
+ filename: document.filename,
+ fileType: document.fileType,
+ sourceType: document.sourceType,
+ title: document.title,
+ updatedAt: document.updatedAt,
+ };
+ }),
+
/**
* Tool-oriented: read document by id
*/
diff --git a/apps/server/src/services/agentDocuments/index.ts b/apps/server/src/services/agentDocuments/index.ts
index cc8ee54610c..e64f19028d9 100644
--- a/apps/server/src/services/agentDocuments/index.ts
+++ b/apps/server/src/services/agentDocuments/index.ts
@@ -424,6 +424,13 @@ export class AgentDocumentsService {
return this.agentDocumentModel.findByDocumentId(agentId, documentId);
}
+ /** Read-only page projection addressed by the public `(agentId, documentId)` route. */
+ async getReaderDocument(agentId: string, documentId: string) {
+ const doc = await this.agentDocumentModel.findByDocumentId(agentId, documentId);
+
+ return this.projectDocumentContent(doc);
+ }
+
async getDocumentSnapshotById(id: string, expectedAgentId?: string) {
const doc = await this.findReadableDocumentById(id, expectedAgentId);
if (!doc) return undefined;
diff --git a/index.workbench.html b/index.workbench.html
new file mode 100644
index 00000000000..7ba864bb7d9
--- /dev/null
+++ b/index.workbench.html
@@ -0,0 +1,95 @@
+<!doctype html>
+<html>
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <link rel="icon" href="/favicon.ico" />
+ <link rel="shortcut icon" href="/favicon-32x32.ico" />
+ <!--SEO_META-->
+ <style>
+ html body {
+ background: #f8f8f8;
+ }
+ html[data-theme='dark'] body {
+ background-color: #000;
+ }
+ </style>
+ <script>
+ (function () {
+ function supportsImportMaps() {
+ return (
+ typeof HTMLScriptElement !== 'undefined' &&
+ typeof HTMLScriptElement.supports === 'function' &&
+ HTMLScriptElement.supports('importmap')
+ );
+ }
+
+ function supportsCascadeLayers() {
+ var el = document.createElement('div');
+ el.className = '__layer_test__';
+ el.style.position = 'absolute';
+ el.style.left = '-99999px';
+ el.style.top = '-99999px';
+
+ var style = document.createElement('style');
+ style.textContent =
+ '@layer a, b;' +
+ '@layer a { .__layer_test__ { color: rgb(1, 2, 3); } }' +
+ '@layer b { .__layer_test__ { color: rgb(4, 5, 6); } }';
+
+ document.documentElement.append(style);
+ document.documentElement.append(el);
+
+ var color = getComputedStyle(el).color;
+
+ el.remove();
+ style.remove();
+
+ return color === 'rgb(4, 5, 6)';
+ }
+
+ if (!(supportsImportMaps() && supportsCascadeLayers())) {
+ window.location.href = '/not-compatible.html';
+ return;
+ }
+
+ var theme = 'system';
+ try {
+ theme = localStorage.getItem('theme') || 'system';
+ } catch (_) {}
+ var systemTheme =
+ window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
+ ? 'dark'
+ : 'light';
+ var resolvedTheme = theme === 'system' ? systemTheme : theme;
+ if (resolvedTheme === 'dark' || resolvedTheme === 'light') {
+ document.documentElement.setAttribute('data-theme', resolvedTheme);
+ }
+
+ var hl = new URLSearchParams(location.search).get('hl');
+ var m = document.cookie.match(/(?:^|;\s*)LOBE_LOCALE=([^;]*)/);
+ var cookie = m ? decodeURIComponent(m[1]) : '';
+ var locale = hl || cookie || navigator.language || 'en-US';
+ if (locale === 'auto') locale = navigator.language || 'en-US';
+ if (hl && !cookie) {
+ document.cookie =
+ 'LOBE_LOCALE=' + encodeURIComponent(hl) + ';path=/;max-age=7776000;SameSite=Lax';
+ }
+ document.documentElement.lang = locale;
+ var rtl = ['ar', 'arc', 'dv', 'fa', 'ha', 'he', 'khw', 'ks', 'ku', 'ps', 'ur', 'yi'];
+ document.documentElement.dir =
+ rtl.indexOf(locale.split('-')[0].toLowerCase()) >= 0 ? 'rtl' : 'ltr';
+ })();
+ </script>
+ <script>
+ window.__SERVER_CONFIG__ = undefined; /* SERVER_CONFIG */
+ </script>
+ </head>
+
+ <body>
+ <div id="root" style="height: 100%"></div>
+
+ <!--ANALYTICS_SCRIPTS-->
+ <script type="module" src="/src/spa/entry.workbench.tsx"></script>
+ </body>
+</html>
diff --git a/package.json b/package.json
index f2b710c7e29..e3bd0aa3723 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,7 @@
"./src/spa/entry.desktop.tsx",
"./src/spa/entry.mobile.tsx",
"./src/spa/entry.popup.tsx",
+ "./src/spa/entry.workbench.tsx",
"./src/spa/entry.web.tsx"
],
"workspaces": [
@@ -39,17 +40,18 @@
"apps/desktop/src/main"
],
"scripts": {
- "build": "bun run build:spa && bun run build:spa:auth && bun run build:spa:copy && bun run build:next",
+ "build": "bun run build:spa && bun run build:spa:auth && bun run build:spa:workbench && bun run build:spa:copy && bun run build:next",
"build:analyze": "cross-env NODE_OPTIONS=--max-old-space-size=81920 next experimental-analyze",
- "build:docker": "pnpm run build:spa && pnpm run build:spa:mobile && pnpm run build:spa:auth && pnpm run build:spa:copy && cross-env NODE_OPTIONS=--max-old-space-size=8192 DOCKER=true next build",
+ "build:docker": "pnpm run build:spa && pnpm run build:spa:mobile && pnpm run build:spa:auth && pnpm run build:spa:workbench && pnpm run build:spa:copy && cross-env NODE_OPTIONS=--max-old-space-size=8192 DOCKER=true next build",
"build:next": "cross-env NODE_OPTIONS=--max-old-space-size=7168 bun run build:next:raw",
"build:next:raw": "next build",
- "build:raw": "bun run build:spa:raw && bun run build:spa:auth && bun run build:spa:copy && bun run build:next:raw",
+ "build:raw": "bun run build:spa:raw && bun run build:spa:auth && bun run build:spa:workbench && bun run build:spa:copy && bun run build:next:raw",
"build:spa": "cross-env NODE_OPTIONS=--max-old-space-size=8192 pnpm run build:spa:raw",
"build:spa:auth": "rm -rf public/_spa public/_spa-auth && cross-env NODE_OPTIONS=--max-old-space-size=8192 AUTH=true vite build",
"build:spa:copy": "tsx scripts/copySpaBuild.mts && tsx scripts/generateSpaTemplates.mts",
"build:spa:mobile": "cross-env NODE_OPTIONS=--max-old-space-size=8192 MOBILE=true vite build",
"build:spa:raw": "rm -rf public/_spa && vite build",
+ "build:spa:workbench": "rm -rf dist/workbench public/_spa-workbench && cross-env NODE_OPTIONS=--max-old-space-size=8192 SPA_TARGET=workbench vite build",
"build:vercel": "cross-env-shell NODE_OPTIONS=--max-old-space-size=8192 \"bun run build:raw && bun run db:migrate\"",
"build-migrate-db": "bun run db:migrate",
"check": "bun run .agents/scripts/check/cli.ts",
@@ -76,6 +78,7 @@
"dev:spa": "vite",
"dev:spa:auth": "cross-env AUTH=true vite",
"dev:spa:mobile": "cross-env MOBILE=true vite",
+ "dev:spa:workbench": "cross-env SPA_TARGET=workbench vite --port 3014",
"docs:cdn": "npm run workflow:docs-cdn && npm run lint:mdx",
"docs:i18n": "lobe-i18n md && npm run lint:mdx",
"docs:seo": "lobe-seo && npm run lint:mdx",
diff --git a/packages/builtin-skills/src/acceptance/SKILL.md b/packages/builtin-skills/src/acceptance/SKILL.md
index 6be56b0d5b5..2ca77f97593 100644
--- a/packages/builtin-skills/src/acceptance/SKILL.md
+++ b/packages/builtin-skills/src/acceptance/SKILL.md
@@ -34,10 +34,10 @@ no local report directory.
Every evidence command targets a **verification session** (a round). How you
name that session is a choice, not a prerequisite:
-| You have | Target the round with | Path |
-| --- | --- | --- |
-| A verify plan (`$LOBE_OPERATION_ID` set) | `--operation "$LOBE_OPERATION_ID"` | This document: discover the plan, satisfy its criteria |
-| No plan β€” you author the checks | `--run <verifyRunId>` from `lh acceptance run create`, or publish a whole directory with `lh acceptance run ingest` | [references/report.md](references/report.md) |
+| You have | Target the round with | Path |
+| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
+| A verify plan (`$LOBE_OPERATION_ID` set) | `--operation "$LOBE_OPERATION_ID"` | This document: discover the plan, satisfy its criteria |
+| No plan β€” you author the checks | `--run <verifyRunId>` from `lh acceptance run create`, or publish a whole directory with `lh acceptance run ingest` | [references/report.md](references/report.md) |
`--operation` and `--run` are interchangeable on `result submit` and
`result list`; a round created without an operation is simply recorded as
diff --git a/packages/builtin-skills/src/acceptance/references/report.md b/packages/builtin-skills/src/acceptance/references/report.md
index 73bea49b481..6052062380a 100644
--- a/packages/builtin-skills/src/acceptance/references/report.md
+++ b/packages/builtin-skills/src/acceptance/references/report.md
@@ -22,11 +22,11 @@ two ways to own a round, and both are first-class (the server records them as
```bash
# A. one directory, one command β€” preferred when you have assets on disk
-lh acceptance run ingest <report-dir> --subject topic:tpc_xxx --json
+lh acceptance run ingest topic:tpc_xxx --json < report-dir > --subject
# B. create the round first, then submit into it with --run
RUN=$(lh acceptance run create --title "…" --goal "…" --json | jq -r .id)
-lh acceptance run result submit --run "$RUN" --item <checkItemId> …
+lh acceptance run result submit --run "$RUN" --item < checkItemId > …
```
Prefer **A**: per-criterion submits without a plan produce checks with no
@@ -76,7 +76,7 @@ Any directory works β€” no repo convention required:
6. **Publish:**
```bash
- lh acceptance run ingest <report-dir> --subject topic:tpc_xxx --source agent-testing --json
+ lh acceptance run ingest topic:tpc_xxx --source agent-testing --json < report-dir > --subject
```
Inside a LobeHub topic `--subject` may be omitted (defaults to the current
@@ -90,9 +90,18 @@ Any directory works β€” no repo convention required:
```json
{
- "title": "Verify task tree API",
+ "cases": [
+ {
+ "id": "1",
+ "category": "Task hierarchy",
+ "name": "task tree returns nested children",
+ "surface": "cli",
+ "status": "pass",
+ "observation": "root returned 3 nested children, depth 2",
+ "evidence": ["assets/task-tree.txt"]
+ }
+ ],
"createdAt": "2026-06-11T15:30:00+08:00",
- "surfaces": ["cli"],
"entry": "<cli> task list --tree",
"plan": [
{
@@ -105,22 +114,16 @@ Any directory works β€” no repo convention required:
"requiredEvidence": ["text"]
}
],
- "cases": [
- {
- "id": "1",
- "category": "Task hierarchy",
- "name": "task tree returns nested children",
- "surface": "cli",
- "status": "pass",
- "observation": "root returned 3 nested children, depth 2",
- "evidence": ["assets/task-tree.txt"]
- }
- ],
"summary": {
- "total": 1, "passed": 1, "failed": 0, "blocked": 0,
+ "total": 1,
+ "passed": 1,
+ "failed": 0,
+ "blocked": 0,
"verdict": "pass",
"conclusion": "One-paragraph verdict the page shows under the title."
- }
+ },
+ "surfaces": ["cli"],
+ "title": "Verify task tree API"
}
```
@@ -131,11 +134,11 @@ Optional fields: `branch` / `commit` / `pullRequest` (provenance line; when
### Closed vocabularies β€” the pipeline acts on these, they are not labels
-| field | values | what it does |
-| --- | --- | --- |
-| `verifier` | `program` \| `agent` \| `llm` (default `agent`) | How the verdict is reached. A command-asserted check is `program`; calling it `agent` hides what actually judged it. |
-| `requiredEvidence` | `screenshot` \| `gif` \| `video` \| `text` \| `dom_snapshot` \| `transcript` | The artifact this check **must** produce. The coverage gate **fails** an item whose required medium is missing. |
-| `surfaces` / per-case `surface` | `web` \| `desktop` \| `cli` \| `mobile` \| `bot` (`electron` β†’ `desktop`) | The product surface a check ran **on**. A test kind (`unit`, `backend`) or runtime mode is not a surface. |
+| field | values | what it does |
+| ------------------------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
+| `verifier` | `program` \| `agent` \| `llm` (default `agent`) | How the verdict is reached. A command-asserted check is `program`; calling it `agent` hides what actually judged it. |
+| `requiredEvidence` | `screenshot` \| `gif` \| `video` \| `text` \| `dom_snapshot` \| `transcript` | The artifact this check **must** produce. The coverage gate **fails** an item whose required medium is missing. |
+| `surfaces` / per-case `surface` | `web` \| `desktop` \| `cli` \| `mobile` \| `bot` (`electron` β†’ `desktop`) | The product surface a check ran **on**. A test kind (`unit`, `backend`) or runtime mode is not a surface. |
`category` names the user-facing requirement area (e.g. `Task hierarchy`,
`Rate-limit recovery`) β€” never a technical surface. `method` / `expected` stay
diff --git a/packages/database/migrations/meta/0131_snapshot.json b/packages/database/migrations/meta/0131_snapshot.json
index e8a6a5cc582..ea089b1d74e 100644
--- a/packages/database/migrations/meta/0131_snapshot.json
+++ b/packages/database/migrations/meta/0131_snapshot.json
@@ -1,8 +1,17 @@
{
+ "_meta": {
+ "columns": {},
+ "schemas": {},
+ "tables": {}
+ },
+ "dialect": "postgresql",
+ "enums": {},
"id": "5a333ec6-5c77-42a5-bfb5-54801d512f7c",
+ "policies": {},
"prevId": "2aa2c437-0ee6-4d93-b4d8-7cba92f7dc63",
- "version": "7",
- "dialect": "postgresql",
+ "roles": {},
+ "schemas": {},
+ "sequences": {},
"tables": {
"public.agents": {
"name": "agents",
@@ -392,12 +401,8 @@
"name": "agents_user_id_users_id_fk",
"tableFrom": "agents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -405,12 +410,8 @@
"name": "agents_workspace_id_workspaces_id_fk",
"tableFrom": "agents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -418,12 +419,8 @@
"name": "agents_session_group_id_session_groups_id_fk",
"tableFrom": "agents",
"tableTo": "session_groups",
- "columnsFrom": [
- "session_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -558,12 +555,8 @@
"name": "agents_files_file_id_files_id_fk",
"tableFrom": "agents_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -571,12 +564,8 @@
"name": "agents_files_agent_id_agents_id_fk",
"tableFrom": "agents_files",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -584,12 +573,8 @@
"name": "agents_files_user_id_users_id_fk",
"tableFrom": "agents_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -597,12 +582,8 @@
"name": "agents_files_workspace_id_workspaces_id_fk",
"tableFrom": "agents_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -610,11 +591,7 @@
"compositePrimaryKeys": {
"agents_files_file_id_agent_id_user_id_pk": {
"name": "agents_files_file_id_agent_id_user_id_pk",
- "columns": [
- "file_id",
- "agent_id",
- "user_id"
- ]
+ "columns": ["file_id", "agent_id", "user_id"]
}
},
"uniqueConstraints": {},
@@ -746,12 +723,8 @@
"name": "agents_knowledge_bases_agent_id_agents_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -759,12 +732,8 @@
"name": "agents_knowledge_bases_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -772,12 +741,8 @@
"name": "agents_knowledge_bases_user_id_users_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -785,12 +750,8 @@
"name": "agents_knowledge_bases_workspace_id_workspaces_id_fk",
"tableFrom": "agents_knowledge_bases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -798,10 +759,7 @@
"compositePrimaryKeys": {
"agents_knowledge_bases_agent_id_knowledge_base_id_pk": {
"name": "agents_knowledge_bases_agent_id_knowledge_base_id_pk",
- "columns": [
- "agent_id",
- "knowledge_base_id"
- ]
+ "columns": ["agent_id", "knowledge_base_id"]
}
},
"uniqueConstraints": {},
@@ -980,12 +938,8 @@
"name": "agent_bot_providers_agent_id_agents_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -993,12 +947,8 @@
"name": "agent_bot_providers_user_id_users_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1006,12 +956,8 @@
"name": "agent_bot_providers_workspace_id_workspaces_id_fk",
"tableFrom": "agent_bot_providers",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -1265,12 +1211,8 @@
"name": "agent_cron_jobs_agent_id_agents_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1278,12 +1220,8 @@
"name": "agent_cron_jobs_group_id_chat_groups_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1291,12 +1229,8 @@
"name": "agent_cron_jobs_user_id_users_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1304,12 +1238,8 @@
"name": "agent_cron_jobs_workspace_id_workspaces_id_fk",
"tableFrom": "agent_cron_jobs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -1732,12 +1662,8 @@
"name": "agent_documents_user_id_users_id_fk",
"tableFrom": "agent_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1745,12 +1671,8 @@
"name": "agent_documents_workspace_id_workspaces_id_fk",
"tableFrom": "agent_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1758,12 +1680,8 @@
"name": "agent_documents_agent_id_agents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1771,12 +1689,8 @@
"name": "agent_documents_document_id_documents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -1784,12 +1698,8 @@
"name": "agent_documents_deleted_by_user_id_users_id_fk",
"tableFrom": "agent_documents",
"tableTo": "users",
- "columnsFrom": [
- "deleted_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["deleted_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -1797,12 +1707,8 @@
"name": "agent_documents_deleted_by_agent_id_agents_id_fk",
"tableFrom": "agent_documents",
"tableTo": "agents",
- "columnsFrom": [
- "deleted_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["deleted_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -1996,12 +1902,8 @@
"name": "agent_eval_benchmarks_user_id_users_id_fk",
"tableFrom": "agent_eval_benchmarks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2009,12 +1911,8 @@
"name": "agent_eval_benchmarks_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_benchmarks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2228,12 +2126,8 @@
"name": "agent_eval_datasets_benchmark_id_agent_eval_benchmarks_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "agent_eval_benchmarks",
- "columnsFrom": [
- "benchmark_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["benchmark_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2241,12 +2135,8 @@
"name": "agent_eval_datasets_source_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "source_experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["source_experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -2254,12 +2144,8 @@
"name": "agent_eval_datasets_user_id_users_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2267,12 +2153,8 @@
"name": "agent_eval_datasets_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_datasets",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2371,12 +2253,8 @@
"name": "agent_eval_experiment_benchmarks_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2384,12 +2262,8 @@
"name": "agent_eval_experiment_benchmarks_benchmark_id_agent_eval_benchmarks_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "agent_eval_benchmarks",
- "columnsFrom": [
- "benchmark_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["benchmark_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2397,12 +2271,8 @@
"name": "agent_eval_experiment_benchmarks_user_id_users_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2410,12 +2280,8 @@
"name": "agent_eval_experiment_benchmarks_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_experiment_benchmarks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2423,10 +2289,7 @@
"compositePrimaryKeys": {
"agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk": {
"name": "agent_eval_experiment_benchmarks_experiment_id_benchmark_id_pk",
- "columns": [
- "experiment_id",
- "benchmark_id"
- ]
+ "columns": ["experiment_id", "benchmark_id"]
}
},
"uniqueConstraints": {},
@@ -2533,12 +2396,8 @@
"name": "agent_eval_experiments_user_id_users_id_fk",
"tableFrom": "agent_eval_experiments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2546,12 +2405,8 @@
"name": "agent_eval_experiments_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_experiments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2695,12 +2550,8 @@
"name": "agent_eval_run_topics_user_id_users_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2708,12 +2559,8 @@
"name": "agent_eval_run_topics_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2721,12 +2568,8 @@
"name": "agent_eval_run_topics_run_id_agent_eval_runs_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "agent_eval_runs",
- "columnsFrom": [
- "run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2734,12 +2577,8 @@
"name": "agent_eval_run_topics_topic_id_topics_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2747,12 +2586,8 @@
"name": "agent_eval_run_topics_test_case_id_agent_eval_test_cases_id_fk",
"tableFrom": "agent_eval_run_topics",
"tableTo": "agent_eval_test_cases",
- "columnsFrom": [
- "test_case_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["test_case_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -2760,10 +2595,7 @@
"compositePrimaryKeys": {
"agent_eval_run_topics_run_id_topic_id_pk": {
"name": "agent_eval_run_topics_run_id_topic_id_pk",
- "columns": [
- "run_id",
- "topic_id"
- ]
+ "columns": ["run_id", "topic_id"]
}
},
"uniqueConstraints": {},
@@ -2982,12 +2814,8 @@
"name": "agent_eval_runs_dataset_id_agent_eval_datasets_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -2995,12 +2823,8 @@
"name": "agent_eval_runs_experiment_id_agent_eval_experiments_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_experiments",
- "columnsFrom": [
- "experiment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["experiment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -3008,12 +2832,8 @@
"name": "agent_eval_runs_target_agent_id_agents_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agents",
- "columnsFrom": [
- "target_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["target_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3021,12 +2841,8 @@
"name": "agent_eval_runs_user_id_users_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3034,12 +2850,8 @@
"name": "agent_eval_runs_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3047,12 +2859,8 @@
"name": "agent_eval_runs_parent_run_id_agent_eval_runs_id_fk",
"tableFrom": "agent_eval_runs",
"tableTo": "agent_eval_runs",
- "columnsFrom": [
- "parent_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_run_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
}
@@ -3210,12 +3018,8 @@
"name": "agent_eval_test_cases_user_id_users_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3223,12 +3027,8 @@
"name": "agent_eval_test_cases_workspace_id_workspaces_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3236,12 +3036,8 @@
"name": "agent_eval_test_cases_dataset_id_agent_eval_datasets_id_fk",
"tableFrom": "agent_eval_test_cases",
"tableTo": "agent_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -3704,12 +3500,8 @@
"name": "agent_operations_workspace_id_workspaces_id_fk",
"tableFrom": "agent_operations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3717,12 +3509,8 @@
"name": "agent_operations_agent_id_agents_id_fk",
"tableFrom": "agent_operations",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3730,12 +3518,8 @@
"name": "agent_operations_topic_id_topics_id_fk",
"tableFrom": "agent_operations",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3743,12 +3527,8 @@
"name": "agent_operations_thread_id_threads_id_fk",
"tableFrom": "agent_operations",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3756,12 +3536,8 @@
"name": "agent_operations_task_id_tasks_id_fk",
"tableFrom": "agent_operations",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -3769,12 +3545,8 @@
"name": "agent_operations_chat_group_id_chat_groups_id_fk",
"tableFrom": "agent_operations",
"tableTo": "chat_groups",
- "columnsFrom": [
- "chat_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chat_group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -3974,12 +3746,8 @@
"name": "agent_account_bindings_agent_id_agents_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -3987,12 +3755,8 @@
"name": "agent_account_bindings_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4000,12 +3764,8 @@
"name": "agent_account_bindings_user_id_users_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4013,12 +3773,8 @@
"name": "agent_account_bindings_workspace_id_workspaces_id_fk",
"tableFrom": "agent_account_bindings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4281,12 +4037,8 @@
"name": "agent_provider_accounts_user_id_users_id_fk",
"tableFrom": "agent_provider_accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4294,12 +4046,8 @@
"name": "agent_provider_accounts_workspace_id_workspaces_id_fk",
"tableFrom": "agent_provider_accounts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4470,12 +4218,8 @@
"name": "agent_quota_calibrations_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4483,12 +4227,8 @@
"name": "agent_quota_calibrations_user_id_users_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4496,12 +4236,8 @@
"name": "agent_quota_calibrations_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_calibrations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -4696,12 +4432,8 @@
"name": "agent_quota_snapshots_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4709,12 +4441,8 @@
"name": "agent_quota_snapshots_user_id_users_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4722,12 +4450,8 @@
"name": "agent_quota_snapshots_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -4735,12 +4459,8 @@
"name": "agent_quota_snapshots_device_id_devices_id_fk",
"tableFrom": "agent_quota_snapshots",
"tableTo": "devices",
- "columnsFrom": [
- "device_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["device_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -5000,12 +4720,8 @@
"name": "agent_quota_usage_ledger_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -5013,12 +4729,8 @@
"name": "agent_quota_usage_ledger_user_id_users_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5026,12 +4738,8 @@
"name": "agent_quota_usage_ledger_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5039,12 +4747,8 @@
"name": "agent_quota_usage_ledger_message_id_messages_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -5052,12 +4756,8 @@
"name": "agent_quota_usage_ledger_operation_id_agent_operations_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -5065,12 +4765,8 @@
"name": "agent_quota_usage_ledger_topic_id_topics_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -5078,12 +4774,8 @@
"name": "agent_quota_usage_ledger_agent_id_agents_id_fk",
"tableFrom": "agent_quota_usage_ledger",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -5323,12 +5015,8 @@
"name": "agent_quota_windows_account_id_agent_provider_accounts_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "agent_provider_accounts",
- "columnsFrom": [
- "account_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["account_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5336,12 +5024,8 @@
"name": "agent_quota_windows_user_id_users_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5349,12 +5033,8 @@
"name": "agent_quota_windows_workspace_id_workspaces_id_fk",
"tableFrom": "agent_quota_windows",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5461,12 +5141,8 @@
"name": "agent_shares_agent_id_agents_id_fk",
"tableFrom": "agent_shares",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5703,12 +5379,8 @@
"name": "agent_skills_zip_file_hash_global_files_hash_id_fk",
"tableFrom": "agent_skills",
"tableTo": "global_files",
- "columnsFrom": [
- "zip_file_hash"
- ],
- "columnsTo": [
- "hash_id"
- ],
+ "columnsFrom": ["zip_file_hash"],
+ "columnsTo": ["hash_id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -5716,12 +5388,8 @@
"name": "agent_skills_user_id_users_id_fk",
"tableFrom": "agent_skills",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -5729,12 +5397,8 @@
"name": "agent_skills_workspace_id_workspaces_id_fk",
"tableFrom": "agent_skills",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -5989,12 +5653,8 @@
"name": "ai_models_user_id_users_id_fk",
"tableFrom": "ai_models",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6002,12 +5662,8 @@
"name": "ai_models_workspace_id_workspaces_id_fk",
"tableFrom": "ai_models",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6222,12 +5878,8 @@
"name": "ai_providers_user_id_users_id_fk",
"tableFrom": "ai_providers",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6235,12 +5887,8 @@
"name": "ai_providers_workspace_id_workspaces_id_fk",
"tableFrom": "ai_providers",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6369,12 +6017,8 @@
"name": "api_keys_user_id_users_id_fk",
"tableFrom": "api_keys",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6382,12 +6026,8 @@
"name": "api_keys_workspace_id_workspaces_id_fk",
"tableFrom": "api_keys",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6397,16 +6037,12 @@
"api_keys_key_unique": {
"name": "api_keys_key_unique",
"nullsNotDistinct": false,
- "columns": [
- "key"
- ]
+ "columns": ["key"]
},
"api_keys_key_hash_unique": {
"name": "api_keys_key_hash_unique",
"nullsNotDistinct": false,
- "columns": [
- "key_hash"
- ]
+ "columns": ["key_hash"]
}
},
"policies": {},
@@ -6604,12 +6240,8 @@
"name": "async_tasks_user_id_users_id_fk",
"tableFrom": "async_tasks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -6617,12 +6249,8 @@
"name": "async_tasks_workspace_id_workspaces_id_fk",
"tableFrom": "async_tasks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6739,12 +6367,8 @@
"name": "accounts_user_id_users_id_fk",
"tableFrom": "accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6864,12 +6488,8 @@
"name": "passkey_userId_users_id_fk",
"tableFrom": "passkey",
"tableTo": "users",
- "columnsFrom": [
- "userId"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["userId"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6962,12 +6582,8 @@
"name": "auth_sessions_user_id_users_id_fk",
"tableFrom": "auth_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -6977,9 +6593,7 @@
"auth_sessions_token_unique": {
"name": "auth_sessions_token_unique",
"nullsNotDistinct": false,
- "columns": [
- "token"
- ]
+ "columns": ["token"]
}
},
"policies": {},
@@ -7052,12 +6666,8 @@
"name": "two_factor_user_id_users_id_fk",
"tableFrom": "two_factor",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -7353,12 +6963,8 @@
"name": "chat_groups_user_id_users_id_fk",
"tableFrom": "chat_groups",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7366,12 +6972,8 @@
"name": "chat_groups_workspace_id_workspaces_id_fk",
"tableFrom": "chat_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7379,12 +6981,8 @@
"name": "chat_groups_group_id_session_groups_id_fk",
"tableFrom": "chat_groups",
"tableTo": "session_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -7503,12 +7101,8 @@
"name": "chat_groups_agents_chat_group_id_chat_groups_id_fk",
"tableFrom": "chat_groups_agents",
"tableTo": "chat_groups",
- "columnsFrom": [
- "chat_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chat_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7516,12 +7110,8 @@
"name": "chat_groups_agents_agent_id_agents_id_fk",
"tableFrom": "chat_groups_agents",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7529,12 +7119,8 @@
"name": "chat_groups_agents_user_id_users_id_fk",
"tableFrom": "chat_groups_agents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7542,12 +7128,8 @@
"name": "chat_groups_agents_workspace_id_workspaces_id_fk",
"tableFrom": "chat_groups_agents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -7555,10 +7137,7 @@
"compositePrimaryKeys": {
"chat_groups_agents_chat_group_id_agent_id_pk": {
"name": "chat_groups_agents_chat_group_id_agent_id_pk",
- "columns": [
- "chat_group_id",
- "agent_id"
- ]
+ "columns": ["chat_group_id", "agent_id"]
}
},
"uniqueConstraints": {},
@@ -7763,12 +7342,8 @@
"name": "user_connector_tools_user_connector_id_user_connectors_id_fk",
"tableFrom": "user_connector_tools",
"tableTo": "user_connectors",
- "columnsFrom": [
- "user_connector_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_connector_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7776,12 +7351,8 @@
"name": "user_connector_tools_user_id_users_id_fk",
"tableFrom": "user_connector_tools",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -7789,12 +7360,8 @@
"name": "user_connector_tools_workspace_id_workspaces_id_fk",
"tableFrom": "user_connector_tools",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8068,12 +7635,8 @@
"name": "user_connectors_user_id_users_id_fk",
"tableFrom": "user_connectors",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8081,12 +7644,8 @@
"name": "user_connectors_workspace_id_workspaces_id_fk",
"tableFrom": "user_connectors",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8094,12 +7653,8 @@
"name": "user_connectors_agent_id_agents_id_fk",
"tableFrom": "user_connectors",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8206,12 +7761,8 @@
"name": "user_installed_plugins_user_id_users_id_fk",
"tableFrom": "user_installed_plugins",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8219,12 +7770,8 @@
"name": "user_installed_plugins_workspace_id_workspaces_id_fk",
"tableFrom": "user_installed_plugins",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8232,10 +7779,7 @@
"compositePrimaryKeys": {
"user_installed_plugins_user_id_identifier_pk": {
"name": "user_installed_plugins_user_id_identifier_pk",
- "columns": [
- "user_id",
- "identifier"
- ]
+ "columns": ["user_id", "identifier"]
}
},
"uniqueConstraints": {},
@@ -8473,12 +8017,8 @@
"name": "devices_user_id_users_id_fk",
"tableFrom": "devices",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8486,12 +8026,8 @@
"name": "devices_workspace_id_workspaces_id_fk",
"tableFrom": "devices",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8616,12 +8152,8 @@
"name": "document_histories_document_id_documents_id_fk",
"tableFrom": "document_histories",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8629,12 +8161,8 @@
"name": "document_histories_user_id_users_id_fk",
"tableFrom": "document_histories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8642,12 +8170,8 @@
"name": "document_histories_workspace_id_workspaces_id_fk",
"tableFrom": "document_histories",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -8782,12 +8306,8 @@
"name": "document_shares_document_id_documents_id_fk",
"tableFrom": "document_shares",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8795,12 +8315,8 @@
"name": "document_shares_user_id_users_id_fk",
"tableFrom": "document_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -8808,12 +8324,8 @@
"name": "document_shares_workspace_id_workspaces_id_fk",
"tableFrom": "document_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9196,12 +8708,8 @@
"name": "documents_file_id_files_id_fk",
"tableFrom": "documents",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9209,12 +8717,8 @@
"name": "documents_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "documents",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9222,12 +8726,8 @@
"name": "documents_parent_id_documents_id_fk",
"tableFrom": "documents",
"tableTo": "documents",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9235,12 +8735,8 @@
"name": "documents_user_id_users_id_fk",
"tableFrom": "documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9248,12 +8744,8 @@
"name": "documents_workspace_id_workspaces_id_fk",
"tableFrom": "documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9526,12 +9018,8 @@
"name": "files_user_id_users_id_fk",
"tableFrom": "files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9539,12 +9027,8 @@
"name": "files_file_hash_global_files_hash_id_fk",
"tableFrom": "files",
"tableTo": "global_files",
- "columnsFrom": [
- "file_hash"
- ],
- "columnsTo": [
- "hash_id"
- ],
+ "columnsFrom": ["file_hash"],
+ "columnsTo": ["hash_id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -9552,12 +9036,8 @@
"name": "files_parent_id_documents_id_fk",
"tableFrom": "files",
"tableTo": "documents",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9565,12 +9045,8 @@
"name": "files_chunk_task_id_async_tasks_id_fk",
"tableFrom": "files",
"tableTo": "async_tasks",
- "columnsFrom": [
- "chunk_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9578,12 +9054,8 @@
"name": "files_embedding_task_id_async_tasks_id_fk",
"tableFrom": "files",
"tableTo": "async_tasks",
- "columnsFrom": [
- "embedding_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["embedding_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -9591,12 +9063,8 @@
"name": "files_workspace_id_workspaces_id_fk",
"tableFrom": "files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9684,12 +9152,8 @@
"name": "global_files_creator_users_id_fk",
"tableFrom": "global_files",
"tableTo": "users",
- "columnsFrom": [
- "creator"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["creator"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -9803,12 +9267,8 @@
"name": "knowledge_base_files_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9816,12 +9276,8 @@
"name": "knowledge_base_files_file_id_files_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9829,12 +9285,8 @@
"name": "knowledge_base_files_user_id_users_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -9842,12 +9294,8 @@
"name": "knowledge_base_files_workspace_id_workspaces_id_fk",
"tableFrom": "knowledge_base_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -9855,10 +9303,7 @@
"compositePrimaryKeys": {
"knowledge_base_files_knowledge_base_id_file_id_pk": {
"name": "knowledge_base_files_knowledge_base_id_file_id_pk",
- "columns": [
- "knowledge_base_id",
- "file_id"
- ]
+ "columns": ["knowledge_base_id", "file_id"]
}
},
"uniqueConstraints": {},
@@ -10045,12 +9490,8 @@
"name": "knowledge_bases_user_id_users_id_fk",
"tableFrom": "knowledge_bases",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10058,12 +9499,8 @@
"name": "knowledge_bases_workspace_id_workspaces_id_fk",
"tableFrom": "knowledge_bases",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10218,12 +9655,8 @@
"name": "generation_batches_user_id_users_id_fk",
"tableFrom": "generation_batches",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10231,12 +9664,8 @@
"name": "generation_batches_workspace_id_workspaces_id_fk",
"tableFrom": "generation_batches",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10244,12 +9673,8 @@
"name": "generation_batches_generation_topic_id_generation_topics_id_fk",
"tableFrom": "generation_batches",
"tableTo": "generation_topics",
- "columnsFrom": [
- "generation_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["generation_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10394,12 +9819,8 @@
"name": "generation_topics_user_id_users_id_fk",
"tableFrom": "generation_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10407,12 +9828,8 @@
"name": "generation_topics_workspace_id_workspaces_id_fk",
"tableFrom": "generation_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -10564,12 +9981,8 @@
"name": "generations_user_id_users_id_fk",
"tableFrom": "generations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10577,12 +9990,8 @@
"name": "generations_workspace_id_workspaces_id_fk",
"tableFrom": "generations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10590,12 +9999,8 @@
"name": "generations_generation_batch_id_generation_batches_id_fk",
"tableFrom": "generations",
"tableTo": "generation_batches",
- "columnsFrom": [
- "generation_batch_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["generation_batch_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -10603,12 +10008,8 @@
"name": "generations_async_task_id_async_tasks_id_fk",
"tableFrom": "generations",
"tableTo": "async_tasks",
- "columnsFrom": [
- "async_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["async_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -10616,12 +10017,8 @@
"name": "generations_file_id_files_id_fk",
"tableFrom": "generations",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11041,12 +10438,8 @@
"name": "llm_generation_tracing_workspace_id_workspaces_id_fk",
"tableFrom": "llm_generation_tracing",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11138,12 +10531,8 @@
"name": "message_chunks_message_id_messages_id_fk",
"tableFrom": "message_chunks",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11151,12 +10540,8 @@
"name": "message_chunks_chunk_id_chunks_id_fk",
"tableFrom": "message_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11164,12 +10549,8 @@
"name": "message_chunks_user_id_users_id_fk",
"tableFrom": "message_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11177,12 +10558,8 @@
"name": "message_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "message_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11190,10 +10567,7 @@
"compositePrimaryKeys": {
"message_chunks_chunk_id_message_id_pk": {
"name": "message_chunks_chunk_id_message_id_pk",
- "columns": [
- "chunk_id",
- "message_id"
- ]
+ "columns": ["chunk_id", "message_id"]
}
},
"uniqueConstraints": {},
@@ -11423,12 +10797,8 @@
"name": "message_groups_topic_id_topics_id_fk",
"tableFrom": "message_groups",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11436,12 +10806,8 @@
"name": "message_groups_user_id_users_id_fk",
"tableFrom": "message_groups",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11449,12 +10815,8 @@
"name": "message_groups_workspace_id_workspaces_id_fk",
"tableFrom": "message_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11462,12 +10824,8 @@
"name": "message_groups_parent_group_id_message_groups_id_fk",
"tableFrom": "message_groups",
"tableTo": "message_groups",
- "columnsFrom": [
- "parent_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11475,12 +10833,8 @@
"name": "message_groups_parent_message_id_messages_id_fk",
"tableFrom": "message_groups",
"tableTo": "messages",
- "columnsFrom": [
- "parent_message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11642,12 +10996,8 @@
"name": "message_plugins_id_messages_id_fk",
"tableFrom": "message_plugins",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11655,12 +11005,8 @@
"name": "message_plugins_user_id_users_id_fk",
"tableFrom": "message_plugins",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11668,12 +11014,8 @@
"name": "message_plugins_workspace_id_workspaces_id_fk",
"tableFrom": "message_plugins",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -11826,12 +11168,8 @@
"name": "message_queries_message_id_messages_id_fk",
"tableFrom": "message_queries",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11839,12 +11177,8 @@
"name": "message_queries_user_id_users_id_fk",
"tableFrom": "message_queries",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11852,12 +11186,8 @@
"name": "message_queries_workspace_id_workspaces_id_fk",
"tableFrom": "message_queries",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -11865,12 +11195,8 @@
"name": "message_queries_embeddings_id_embeddings_id_fk",
"tableFrom": "message_queries",
"tableTo": "embeddings",
- "columnsFrom": [
- "embeddings_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["embeddings_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -11989,12 +11315,8 @@
"name": "message_query_chunks_id_messages_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12002,12 +11324,8 @@
"name": "message_query_chunks_query_id_message_queries_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "message_queries",
- "columnsFrom": [
- "query_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["query_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12015,12 +11333,8 @@
"name": "message_query_chunks_chunk_id_chunks_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12028,12 +11342,8 @@
"name": "message_query_chunks_user_id_users_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12041,12 +11351,8 @@
"name": "message_query_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "message_query_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -12054,11 +11360,7 @@
"compositePrimaryKeys": {
"message_query_chunks_chunk_id_id_query_id_pk": {
"name": "message_query_chunks_chunk_id_id_query_id_pk",
- "columns": [
- "chunk_id",
- "id",
- "query_id"
- ]
+ "columns": ["chunk_id", "id", "query_id"]
}
},
"uniqueConstraints": {},
@@ -12171,12 +11473,8 @@
"name": "message_tts_id_messages_id_fk",
"tableFrom": "message_tts",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12184,12 +11482,8 @@
"name": "message_tts_file_id_files_id_fk",
"tableFrom": "message_tts",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12197,12 +11491,8 @@
"name": "message_tts_user_id_users_id_fk",
"tableFrom": "message_tts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12210,12 +11500,8 @@
"name": "message_tts_workspace_id_workspaces_id_fk",
"tableFrom": "message_tts",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -12331,12 +11617,8 @@
"name": "message_translates_id_messages_id_fk",
"tableFrom": "message_translates",
"tableTo": "messages",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12344,12 +11626,8 @@
"name": "message_translates_user_id_users_id_fk",
"tableFrom": "message_translates",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12357,12 +11635,8 @@
"name": "message_translates_workspace_id_workspaces_id_fk",
"tableFrom": "message_translates",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -12812,12 +12086,8 @@
"name": "messages_user_id_users_id_fk",
"tableFrom": "messages",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12825,12 +12095,8 @@
"name": "messages_session_id_sessions_id_fk",
"tableFrom": "messages",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12838,12 +12104,8 @@
"name": "messages_topic_id_topics_id_fk",
"tableFrom": "messages",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12851,12 +12113,8 @@
"name": "messages_thread_id_threads_id_fk",
"tableFrom": "messages",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12864,12 +12122,8 @@
"name": "messages_parent_id_messages_id_fk",
"tableFrom": "messages",
"tableTo": "messages",
- "columnsFrom": [
- "parent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -12877,12 +12131,8 @@
"name": "messages_quota_id_messages_id_fk",
"tableFrom": "messages",
"tableTo": "messages",
- "columnsFrom": [
- "quota_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["quota_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -12890,12 +12140,8 @@
"name": "messages_agent_id_agents_id_fk",
"tableFrom": "messages",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12903,12 +12149,8 @@
"name": "messages_group_id_chat_groups_id_fk",
"tableFrom": "messages",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -12916,12 +12158,8 @@
"name": "messages_message_group_id_message_groups_id_fk",
"tableFrom": "messages",
"tableTo": "message_groups",
- "columnsFrom": [
- "message_group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -12929,12 +12167,8 @@
"name": "messages_workspace_id_workspaces_id_fk",
"tableFrom": "messages",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13026,12 +12260,8 @@
"name": "messages_files_file_id_files_id_fk",
"tableFrom": "messages_files",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -13039,12 +12269,8 @@
"name": "messages_files_message_id_messages_id_fk",
"tableFrom": "messages_files",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -13052,12 +12278,8 @@
"name": "messages_files_user_id_users_id_fk",
"tableFrom": "messages_files",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -13065,12 +12287,8 @@
"name": "messages_files_workspace_id_workspaces_id_fk",
"tableFrom": "messages_files",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13078,10 +12296,7 @@
"compositePrimaryKeys": {
"messages_files_file_id_message_id_pk": {
"name": "messages_files_file_id_message_id_pk",
- "columns": [
- "file_id",
- "message_id"
- ]
+ "columns": ["file_id", "message_id"]
}
},
"uniqueConstraints": {},
@@ -13296,12 +12511,8 @@
"name": "messenger_account_links_user_id_users_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -13309,12 +12520,8 @@
"name": "messenger_account_links_workspace_id_workspaces_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -13322,12 +12529,8 @@
"name": "messenger_account_links_active_agent_id_agents_id_fk",
"tableFrom": "messenger_account_links",
"tableTo": "agents",
- "columnsFrom": [
- "active_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["active_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -13502,12 +12705,8 @@
"name": "messenger_installations_installed_by_user_id_users_id_fk",
"tableFrom": "messenger_installations",
"tableTo": "users",
- "columnsFrom": [
- "installed_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["installed_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -13611,12 +12810,8 @@
"name": "nextauth_accounts_user_id_users_id_fk",
"tableFrom": "nextauth_accounts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13624,10 +12819,7 @@
"compositePrimaryKeys": {
"nextauth_accounts_provider_providerAccountId_pk": {
"name": "nextauth_accounts_provider_providerAccountId_pk",
- "columns": [
- "provider",
- "providerAccountId"
- ]
+ "columns": ["provider", "providerAccountId"]
}
},
"uniqueConstraints": {},
@@ -13694,12 +12886,8 @@
"name": "nextauth_authenticators_user_id_users_id_fk",
"tableFrom": "nextauth_authenticators",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13707,19 +12895,14 @@
"compositePrimaryKeys": {
"nextauth_authenticators_user_id_credentialID_pk": {
"name": "nextauth_authenticators_user_id_credentialID_pk",
- "columns": [
- "user_id",
- "credentialID"
- ]
+ "columns": ["user_id", "credentialID"]
}
},
"uniqueConstraints": {
"nextauth_authenticators_credentialID_unique": {
"name": "nextauth_authenticators_credentialID_unique",
"nullsNotDistinct": false,
- "columns": [
- "credentialID"
- ]
+ "columns": ["credentialID"]
}
},
"policies": {},
@@ -13771,12 +12954,8 @@
"name": "nextauth_sessions_user_id_users_id_fk",
"tableFrom": "nextauth_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -13815,10 +12994,7 @@
"compositePrimaryKeys": {
"nextauth_verificationtokens_identifier_token_pk": {
"name": "nextauth_verificationtokens_identifier_token_pk",
- "columns": [
- "identifier",
- "token"
- ]
+ "columns": ["identifier", "token"]
}
},
"uniqueConstraints": {},
@@ -13933,12 +13109,8 @@
"name": "notification_deliveries_notification_id_notifications_id_fk",
"tableFrom": "notification_deliveries",
"tableTo": "notifications",
- "columnsFrom": [
- "notification_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["notification_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14188,12 +13360,8 @@
"name": "notifications_user_id_users_id_fk",
"tableFrom": "notifications",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14201,12 +13369,8 @@
"name": "notifications_workspace_id_workspaces_id_fk",
"tableFrom": "notifications",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14359,12 +13523,8 @@
"name": "oidc_access_tokens_user_id_users_id_fk",
"tableFrom": "oidc_access_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14465,12 +13625,8 @@
"name": "oidc_authorization_codes_user_id_users_id_fk",
"tableFrom": "oidc_authorization_codes",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14659,12 +13815,8 @@
"name": "oidc_clients_user_id_users_id_fk",
"tableFrom": "oidc_clients",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14672,12 +13824,8 @@
"name": "oidc_clients_workspace_id_workspaces_id_fk",
"tableFrom": "oidc_clients",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14744,12 +13892,8 @@
"name": "oidc_consents_user_id_users_id_fk",
"tableFrom": "oidc_consents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -14757,12 +13901,8 @@
"name": "oidc_consents_client_id_oidc_clients_id_fk",
"tableFrom": "oidc_consents",
"tableTo": "oidc_clients",
- "columnsFrom": [
- "client_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["client_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14770,10 +13910,7 @@
"compositePrimaryKeys": {
"oidc_consents_user_id_client_id_pk": {
"name": "oidc_consents_user_id_client_id_pk",
- "columns": [
- "user_id",
- "client_id"
- ]
+ "columns": ["user_id", "client_id"]
}
},
"uniqueConstraints": {},
@@ -14877,12 +14014,8 @@
"name": "oidc_device_codes_user_id_users_id_fk",
"tableFrom": "oidc_device_codes",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -14977,12 +14110,8 @@
"name": "oidc_grants_user_id_users_id_fk",
"tableFrom": "oidc_grants",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15135,12 +14264,8 @@
"name": "oidc_refresh_tokens_user_id_users_id_fk",
"tableFrom": "oidc_refresh_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15223,12 +14348,8 @@
"name": "oidc_sessions_user_id_users_id_fk",
"tableFrom": "oidc_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15359,12 +14480,8 @@
"name": "push_tokens_user_id_users_id_fk",
"tableFrom": "push_tokens",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15514,12 +14631,8 @@
"name": "chunks_user_id_users_id_fk",
"tableFrom": "chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15527,12 +14640,8 @@
"name": "chunks_workspace_id_workspaces_id_fk",
"tableFrom": "chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15652,12 +14761,8 @@
"name": "document_chunks_document_id_documents_id_fk",
"tableFrom": "document_chunks",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15665,12 +14770,8 @@
"name": "document_chunks_chunk_id_chunks_id_fk",
"tableFrom": "document_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15678,12 +14779,8 @@
"name": "document_chunks_user_id_users_id_fk",
"tableFrom": "document_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15691,12 +14788,8 @@
"name": "document_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "document_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15704,10 +14797,7 @@
"compositePrimaryKeys": {
"document_chunks_document_id_chunk_id_pk": {
"name": "document_chunks_document_id_chunk_id_pk",
- "columns": [
- "document_id",
- "chunk_id"
- ]
+ "columns": ["document_id", "chunk_id"]
}
},
"uniqueConstraints": {},
@@ -15836,12 +14926,8 @@
"name": "embeddings_chunk_id_chunks_id_fk",
"tableFrom": "embeddings",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15849,12 +14935,8 @@
"name": "embeddings_user_id_users_id_fk",
"tableFrom": "embeddings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -15862,12 +14944,8 @@
"name": "embeddings_workspace_id_workspaces_id_fk",
"tableFrom": "embeddings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -15877,9 +14955,7 @@
"embeddings_chunk_id_unique": {
"name": "embeddings_chunk_id_unique",
"nullsNotDistinct": false,
- "columns": [
- "chunk_id"
- ]
+ "columns": ["chunk_id"]
}
},
"policies": {},
@@ -16067,12 +15143,8 @@
"name": "unstructured_chunks_composite_id_chunks_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "composite_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["composite_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16080,12 +15152,8 @@
"name": "unstructured_chunks_user_id_users_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16093,12 +15161,8 @@
"name": "unstructured_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16106,12 +15170,8 @@
"name": "unstructured_chunks_file_id_files_id_fk",
"tableFrom": "unstructured_chunks",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16233,12 +15293,8 @@
"name": "rag_eval_dataset_records_dataset_id_rag_eval_datasets_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "rag_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16246,12 +15302,8 @@
"name": "rag_eval_dataset_records_user_id_users_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16259,12 +15311,8 @@
"name": "rag_eval_dataset_records_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_dataset_records",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16374,12 +15422,8 @@
"name": "rag_eval_datasets_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16387,12 +15431,8 @@
"name": "rag_eval_datasets_user_id_users_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16400,12 +15440,8 @@
"name": "rag_eval_datasets_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_datasets",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16551,12 +15587,8 @@
"name": "rag_eval_evaluations_dataset_id_rag_eval_datasets_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "rag_eval_datasets",
- "columnsFrom": [
- "dataset_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16564,12 +15596,8 @@
"name": "rag_eval_evaluations_knowledge_base_id_knowledge_bases_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "knowledge_bases",
- "columnsFrom": [
- "knowledge_base_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["knowledge_base_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16577,12 +15605,8 @@
"name": "rag_eval_evaluations_user_id_users_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16590,12 +15614,8 @@
"name": "rag_eval_evaluations_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_evaluations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16759,12 +15779,8 @@
"name": "rag_eval_evaluation_records_question_embedding_id_embeddings_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "embeddings",
- "columnsFrom": [
- "question_embedding_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["question_embedding_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -16772,12 +15788,8 @@
"name": "rag_eval_evaluation_records_dataset_record_id_rag_eval_dataset_records_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "rag_eval_dataset_records",
- "columnsFrom": [
- "dataset_record_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["dataset_record_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16785,12 +15797,8 @@
"name": "rag_eval_evaluation_records_evaluation_id_rag_eval_evaluations_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "rag_eval_evaluations",
- "columnsFrom": [
- "evaluation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["evaluation_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16798,12 +15806,8 @@
"name": "rag_eval_evaluation_records_user_id_users_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16811,12 +15815,8 @@
"name": "rag_eval_evaluation_records_workspace_id_workspaces_id_fk",
"tableFrom": "rag_eval_evaluation_records",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16897,9 +15897,7 @@
"rbac_permissions_code_unique": {
"name": "rbac_permissions_code_unique",
"nullsNotDistinct": false,
- "columns": [
- "code"
- ]
+ "columns": ["code"]
}
},
"policies": {},
@@ -16967,12 +15965,8 @@
"name": "rbac_role_permissions_role_id_rbac_roles_id_fk",
"tableFrom": "rbac_role_permissions",
"tableTo": "rbac_roles",
- "columnsFrom": [
- "role_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -16980,12 +15974,8 @@
"name": "rbac_role_permissions_permission_id_rbac_permissions_id_fk",
"tableFrom": "rbac_role_permissions",
"tableTo": "rbac_permissions",
- "columnsFrom": [
- "permission_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["permission_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -16993,10 +15983,7 @@
"compositePrimaryKeys": {
"rbac_role_permissions_role_id_permission_id_pk": {
"name": "rbac_role_permissions_role_id_permission_id_pk",
- "columns": [
- "role_id",
- "permission_id"
- ]
+ "columns": ["role_id", "permission_id"]
}
},
"uniqueConstraints": {},
@@ -17124,12 +16111,8 @@
"name": "rbac_roles_workspace_id_workspaces_id_fk",
"tableFrom": "rbac_roles",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17262,12 +16245,8 @@
"name": "rbac_user_roles_user_id_users_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17275,12 +16254,8 @@
"name": "rbac_user_roles_role_id_rbac_roles_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "rbac_roles",
- "columnsFrom": [
- "role_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["role_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17288,12 +16263,8 @@
"name": "rbac_user_roles_workspace_id_workspaces_id_fk",
"tableFrom": "rbac_user_roles",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17400,12 +16371,8 @@
"name": "agents_to_sessions_agent_id_agents_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17413,12 +16380,8 @@
"name": "agents_to_sessions_session_id_sessions_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17426,12 +16389,8 @@
"name": "agents_to_sessions_user_id_users_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17439,12 +16398,8 @@
"name": "agents_to_sessions_workspace_id_workspaces_id_fk",
"tableFrom": "agents_to_sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17452,10 +16407,7 @@
"compositePrimaryKeys": {
"agents_to_sessions_agent_id_session_id_pk": {
"name": "agents_to_sessions_agent_id_session_id_pk",
- "columns": [
- "agent_id",
- "session_id"
- ]
+ "columns": ["agent_id", "session_id"]
}
},
"uniqueConstraints": {},
@@ -17566,12 +16518,8 @@
"name": "file_chunks_file_id_files_id_fk",
"tableFrom": "file_chunks",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17579,12 +16527,8 @@
"name": "file_chunks_chunk_id_chunks_id_fk",
"tableFrom": "file_chunks",
"tableTo": "chunks",
- "columnsFrom": [
- "chunk_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["chunk_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17592,12 +16536,8 @@
"name": "file_chunks_user_id_users_id_fk",
"tableFrom": "file_chunks",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17605,12 +16545,8 @@
"name": "file_chunks_workspace_id_workspaces_id_fk",
"tableFrom": "file_chunks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17618,10 +16554,7 @@
"compositePrimaryKeys": {
"file_chunks_file_id_chunk_id_pk": {
"name": "file_chunks_file_id_chunk_id_pk",
- "columns": [
- "file_id",
- "chunk_id"
- ]
+ "columns": ["file_id", "chunk_id"]
}
},
"uniqueConstraints": {},
@@ -17725,12 +16658,8 @@
"name": "files_to_sessions_file_id_files_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17738,12 +16667,8 @@
"name": "files_to_sessions_session_id_sessions_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17751,12 +16676,8 @@
"name": "files_to_sessions_user_id_users_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17764,12 +16685,8 @@
"name": "files_to_sessions_workspace_id_workspaces_id_fk",
"tableFrom": "files_to_sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -17777,10 +16694,7 @@
"compositePrimaryKeys": {
"files_to_sessions_file_id_session_id_pk": {
"name": "files_to_sessions_file_id_session_id_pk",
- "columns": [
- "file_id",
- "session_id"
- ]
+ "columns": ["file_id", "session_id"]
}
},
"uniqueConstraints": {},
@@ -17921,12 +16835,8 @@
"name": "resource_permissions_workspace_id_workspaces_id_fk",
"tableFrom": "resource_permissions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -17934,12 +16844,8 @@
"name": "resource_permissions_created_by_users_id_fk",
"tableFrom": "resource_permissions",
"tableTo": "users",
- "columnsFrom": [
- "created_by"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -18104,12 +17010,8 @@
"name": "session_groups_user_id_users_id_fk",
"tableFrom": "session_groups",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18117,12 +17019,8 @@
"name": "session_groups_workspace_id_workspaces_id_fk",
"tableFrom": "session_groups",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -18392,12 +17290,8 @@
"name": "sessions_user_id_users_id_fk",
"tableFrom": "sessions",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18405,12 +17299,8 @@
"name": "sessions_group_id_session_groups_id_fk",
"tableFrom": "sessions",
"tableTo": "session_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -18418,12 +17308,8 @@
"name": "sessions_workspace_id_workspaces_id_fk",
"tableFrom": "sessions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -18804,12 +17690,8 @@
"name": "briefs_user_id_users_id_fk",
"tableFrom": "briefs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18817,12 +17699,8 @@
"name": "briefs_workspace_id_workspaces_id_fk",
"tableFrom": "briefs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18830,12 +17708,8 @@
"name": "briefs_task_id_tasks_id_fk",
"tableFrom": "briefs",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -18843,12 +17717,8 @@
"name": "briefs_cron_job_id_agent_cron_jobs_id_fk",
"tableFrom": "briefs",
"tableTo": "agent_cron_jobs",
- "columnsFrom": [
- "cron_job_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["cron_job_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19091,12 +17961,8 @@
"name": "task_comments_task_id_tasks_id_fk",
"tableFrom": "task_comments",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19104,12 +17970,8 @@
"name": "task_comments_user_id_users_id_fk",
"tableFrom": "task_comments",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19117,12 +17979,8 @@
"name": "task_comments_workspace_id_workspaces_id_fk",
"tableFrom": "task_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19130,12 +17988,8 @@
"name": "task_comments_author_user_id_users_id_fk",
"tableFrom": "task_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19143,12 +17997,8 @@
"name": "task_comments_author_agent_id_agents_id_fk",
"tableFrom": "task_comments",
"tableTo": "agents",
- "columnsFrom": [
- "author_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19156,12 +18006,8 @@
"name": "task_comments_brief_id_briefs_id_fk",
"tableFrom": "task_comments",
"tableTo": "briefs",
- "columnsFrom": [
- "brief_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["brief_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -19169,12 +18015,8 @@
"name": "task_comments_topic_id_topics_id_fk",
"tableFrom": "task_comments",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -19363,12 +18205,8 @@
"name": "task_dependencies_task_id_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19376,12 +18214,8 @@
"name": "task_dependencies_depends_on_id_tasks_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "tasks",
- "columnsFrom": [
- "depends_on_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["depends_on_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19389,12 +18223,8 @@
"name": "task_dependencies_user_id_users_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19402,12 +18232,8 @@
"name": "task_dependencies_workspace_id_workspaces_id_fk",
"tableFrom": "task_dependencies",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19590,12 +18416,8 @@
"name": "task_documents_task_id_tasks_id_fk",
"tableFrom": "task_documents",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19603,12 +18425,8 @@
"name": "task_documents_document_id_documents_id_fk",
"tableFrom": "task_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19616,12 +18434,8 @@
"name": "task_documents_user_id_users_id_fk",
"tableFrom": "task_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19629,12 +18443,8 @@
"name": "task_documents_workspace_id_workspaces_id_fk",
"tableFrom": "task_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -19906,12 +18716,8 @@
"name": "task_topics_task_id_tasks_id_fk",
"tableFrom": "task_topics",
"tableTo": "tasks",
- "columnsFrom": [
- "task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["task_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19919,12 +18725,8 @@
"name": "task_topics_topic_id_topics_id_fk",
"tableFrom": "task_topics",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19932,12 +18734,8 @@
"name": "task_topics_user_id_users_id_fk",
"tableFrom": "task_topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -19945,12 +18743,8 @@
"name": "task_topics_workspace_id_workspaces_id_fk",
"tableFrom": "task_topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -20415,12 +19209,8 @@
"name": "tasks_created_by_user_id_users_id_fk",
"tableFrom": "tasks",
"tableTo": "users",
- "columnsFrom": [
- "created_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20428,12 +19218,8 @@
"name": "tasks_workspace_id_workspaces_id_fk",
"tableFrom": "tasks",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20441,12 +19227,8 @@
"name": "tasks_created_by_agent_id_agents_id_fk",
"tableFrom": "tasks",
"tableTo": "agents",
- "columnsFrom": [
- "created_by_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["created_by_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20454,12 +19236,8 @@
"name": "tasks_assignee_user_id_users_id_fk",
"tableFrom": "tasks",
"tableTo": "users",
- "columnsFrom": [
- "assignee_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["assignee_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20467,12 +19245,8 @@
"name": "tasks_assignee_agent_id_agents_id_fk",
"tableFrom": "tasks",
"tableTo": "agents",
- "columnsFrom": [
- "assignee_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["assignee_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20480,12 +19254,8 @@
"name": "tasks_current_topic_id_topics_id_fk",
"tableFrom": "tasks",
"tableTo": "topics",
- "columnsFrom": [
- "current_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["current_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20493,12 +19263,8 @@
"name": "tasks_parent_task_id_tasks_id_fk",
"tableFrom": "tasks",
"tableTo": "tasks",
- "columnsFrom": [
- "parent_task_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_task_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -20765,12 +19531,8 @@
"name": "threads_topic_id_topics_id_fk",
"tableFrom": "threads",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20778,12 +19540,8 @@
"name": "threads_parent_thread_id_threads_id_fk",
"tableFrom": "threads",
"tableTo": "threads",
- "columnsFrom": [
- "parent_thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -20791,12 +19549,8 @@
"name": "threads_agent_id_agents_id_fk",
"tableFrom": "threads",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20804,12 +19558,8 @@
"name": "threads_group_id_chat_groups_id_fk",
"tableFrom": "threads",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20817,12 +19567,8 @@
"name": "threads_user_id_users_id_fk",
"tableFrom": "threads",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20830,12 +19576,8 @@
"name": "threads_workspace_id_workspaces_id_fk",
"tableFrom": "threads",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -20949,12 +19691,8 @@
"name": "topic_documents_document_id_documents_id_fk",
"tableFrom": "topic_documents",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20962,12 +19700,8 @@
"name": "topic_documents_topic_id_topics_id_fk",
"tableFrom": "topic_documents",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20975,12 +19709,8 @@
"name": "topic_documents_user_id_users_id_fk",
"tableFrom": "topic_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -20988,12 +19718,8 @@
"name": "topic_documents_workspace_id_workspaces_id_fk",
"tableFrom": "topic_documents",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21001,10 +19727,7 @@
"compositePrimaryKeys": {
"topic_documents_document_id_topic_id_pk": {
"name": "topic_documents_document_id_topic_id_pk",
- "columns": [
- "document_id",
- "topic_id"
- ]
+ "columns": ["document_id", "topic_id"]
}
},
"uniqueConstraints": {},
@@ -21128,12 +19851,8 @@
"name": "topic_shares_topic_id_topics_id_fk",
"tableFrom": "topic_shares",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21141,12 +19860,8 @@
"name": "topic_shares_user_id_users_id_fk",
"tableFrom": "topic_shares",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21154,12 +19869,8 @@
"name": "topic_shares_workspace_id_workspaces_id_fk",
"tableFrom": "topic_shares",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21609,12 +20320,8 @@
"name": "topics_session_id_sessions_id_fk",
"tableFrom": "topics",
"tableTo": "sessions",
- "columnsFrom": [
- "session_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["session_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21622,12 +20329,8 @@
"name": "topics_agent_id_agents_id_fk",
"tableFrom": "topics",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21635,12 +20338,8 @@
"name": "topics_group_id_chat_groups_id_fk",
"tableFrom": "topics",
"tableTo": "chat_groups",
- "columnsFrom": [
- "group_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["group_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21648,12 +20347,8 @@
"name": "topics_user_id_users_id_fk",
"tableFrom": "topics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21661,12 +20356,8 @@
"name": "topics_workspace_id_workspaces_id_fk",
"tableFrom": "topics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -21778,12 +20469,8 @@
"name": "topic_comment_mentions_comment_id_topic_comments_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "topic_comments",
- "columnsFrom": [
- "comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["comment_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21791,12 +20478,8 @@
"name": "topic_comment_mentions_mentioned_user_id_users_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "users",
- "columnsFrom": [
- "mentioned_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["mentioned_user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -21804,12 +20487,8 @@
"name": "topic_comment_mentions_workspace_id_workspaces_id_fk",
"tableFrom": "topic_comment_mentions",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -22107,12 +20786,8 @@
"name": "topic_comments_topic_id_topics_id_fk",
"tableFrom": "topic_comments",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22120,12 +20795,8 @@
"name": "topic_comments_message_id_messages_id_fk",
"tableFrom": "topic_comments",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -22133,12 +20804,8 @@
"name": "topic_comments_parent_comment_id_topic_comments_id_fk",
"tableFrom": "topic_comments",
"tableTo": "topic_comments",
- "columnsFrom": [
- "parent_comment_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["parent_comment_id"],
+ "columnsTo": ["id"],
"onDelete": "no action",
"onUpdate": "no action"
},
@@ -22146,12 +20813,8 @@
"name": "topic_comments_author_user_id_users_id_fk",
"tableFrom": "topic_comments",
"tableTo": "users",
- "columnsFrom": [
- "author_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["author_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -22159,12 +20822,8 @@
"name": "topic_comments_workspace_id_workspaces_id_fk",
"tableFrom": "topic_comments",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -22172,12 +20831,8 @@
"name": "topic_comments_moderated_by_user_id_users_id_fk",
"tableFrom": "topic_comments",
"tableTo": "users",
- "columnsFrom": [
- "moderated_by_user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["moderated_by_user_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -22294,12 +20949,8 @@
"name": "user_settings_id_users_id_fk",
"tableFrom": "user_settings",
"tableTo": "users",
- "columnsFrom": [
- "id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -22554,30 +21205,22 @@
"users_username_unique": {
"name": "users_username_unique",
"nullsNotDistinct": false,
- "columns": [
- "username"
- ]
+ "columns": ["username"]
},
"users_email_unique": {
"name": "users_email_unique",
"nullsNotDistinct": false,
- "columns": [
- "email"
- ]
+ "columns": ["email"]
},
"users_normalized_email_unique": {
"name": "users_normalized_email_unique",
"nullsNotDistinct": false,
- "columns": [
- "normalized_email"
- ]
+ "columns": ["normalized_email"]
},
"users_phone_unique": {
"name": "users_phone_unique",
"nullsNotDistinct": false,
- "columns": [
- "phone"
- ]
+ "columns": ["phone"]
}
},
"policies": {},
@@ -22762,12 +21405,8 @@
"name": "user_memories_user_id_users_id_fk",
"tableFrom": "user_memories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23019,12 +21658,8 @@
"name": "user_memories_activities_user_id_users_id_fk",
"tableFrom": "user_memories_activities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23032,12 +21667,8 @@
"name": "user_memories_activities_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_activities",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23220,12 +21851,8 @@
"name": "user_memories_contexts_user_id_users_id_fk",
"tableFrom": "user_memories_contexts",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23460,12 +22087,8 @@
"name": "user_memories_experiences_user_id_users_id_fk",
"tableFrom": "user_memories_experiences",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23473,12 +22096,8 @@
"name": "user_memories_experiences_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_experiences",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23656,12 +22275,8 @@
"name": "user_memories_identities_user_id_users_id_fk",
"tableFrom": "user_memories_identities",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23669,12 +22284,8 @@
"name": "user_memories_identities_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_identities",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -23832,12 +22443,8 @@
"name": "user_memories_preferences_user_id_users_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -23845,12 +22452,8 @@
"name": "user_memories_preferences_user_memory_id_user_memories_id_fk",
"tableFrom": "user_memories_preferences",
"tableTo": "user_memories",
- "columnsFrom": [
- "user_memory_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_memory_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24050,12 +22653,8 @@
"name": "user_memory_persona_document_histories_user_id_users_id_fk",
"tableFrom": "user_memory_persona_document_histories",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24063,12 +22662,8 @@
"name": "user_memory_persona_document_histories_persona_id_user_memory_persona_documents_id_fk",
"tableFrom": "user_memory_persona_document_histories",
"tableTo": "user_memory_persona_documents",
- "columnsFrom": [
- "persona_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["persona_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24211,12 +22806,8 @@
"name": "user_memory_persona_documents_user_id_users_id_fk",
"tableFrom": "user_memory_persona_documents",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24485,12 +23076,8 @@
"name": "acceptances_user_id_users_id_fk",
"tableFrom": "acceptances",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24498,12 +23085,8 @@
"name": "acceptances_workspace_id_workspaces_id_fk",
"tableFrom": "acceptances",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -24863,12 +23446,8 @@
"name": "verify_check_results_verify_run_id_verify_runs_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "verify_runs",
- "columnsFrom": [
- "verify_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verify_run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24876,12 +23455,8 @@
"name": "verify_check_results_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -24889,12 +23464,8 @@
"name": "verify_check_results_user_id_users_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24902,12 +23473,8 @@
"name": "verify_check_results_workspace_id_workspaces_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -24915,12 +23482,8 @@
"name": "verify_check_results_verifier_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "verifier_operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verifier_operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -24928,12 +23491,8 @@
"name": "verify_check_results_verifier_tracing_id_llm_generation_tracing_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "llm_generation_tracing",
- "columnsFrom": [
- "verifier_tracing_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verifier_tracing_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -24941,12 +23500,8 @@
"name": "verify_check_results_repair_operation_id_agent_operations_id_fk",
"tableFrom": "verify_check_results",
"tableTo": "agent_operations",
- "columnsFrom": [
- "repair_operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["repair_operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -25114,12 +23669,8 @@
"name": "verify_criteria_user_id_users_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25127,12 +23678,8 @@
"name": "verify_criteria_document_id_documents_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "documents",
- "columnsFrom": [
- "document_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["document_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -25140,12 +23687,8 @@
"name": "verify_criteria_workspace_id_workspaces_id_fk",
"tableFrom": "verify_criteria",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25302,12 +23845,8 @@
"name": "verify_evidence_check_result_id_verify_check_results_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "verify_check_results",
- "columnsFrom": [
- "check_result_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["check_result_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25315,12 +23854,8 @@
"name": "verify_evidence_file_id_files_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "files",
- "columnsFrom": [
- "file_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["file_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -25328,12 +23863,8 @@
"name": "verify_evidence_user_id_users_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25341,12 +23872,8 @@
"name": "verify_evidence_workspace_id_workspaces_id_fk",
"tableFrom": "verify_evidence",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25536,12 +24063,8 @@
"name": "verify_reports_verify_run_id_verify_runs_id_fk",
"tableFrom": "verify_reports",
"tableTo": "verify_runs",
- "columnsFrom": [
- "verify_run_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["verify_run_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25549,12 +24072,8 @@
"name": "verify_reports_operation_id_agent_operations_id_fk",
"tableFrom": "verify_reports",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -25562,12 +24081,8 @@
"name": "verify_reports_user_id_users_id_fk",
"tableFrom": "verify_reports",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25575,12 +24090,8 @@
"name": "verify_reports_workspace_id_workspaces_id_fk",
"tableFrom": "verify_reports",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25685,12 +24196,8 @@
"name": "verify_rubric_criteria_rubric_id_verify_rubrics_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "verify_rubrics",
- "columnsFrom": [
- "rubric_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["rubric_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25698,12 +24205,8 @@
"name": "verify_rubric_criteria_criterion_id_verify_criteria_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "verify_criteria",
- "columnsFrom": [
- "criterion_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["criterion_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25711,12 +24214,8 @@
"name": "verify_rubric_criteria_user_id_users_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25724,12 +24223,8 @@
"name": "verify_rubric_criteria_workspace_id_workspaces_id_fk",
"tableFrom": "verify_rubric_criteria",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -25737,10 +24232,7 @@
"compositePrimaryKeys": {
"verify_rubric_criteria_rubric_id_criterion_id_pk": {
"name": "verify_rubric_criteria_rubric_id_criterion_id_pk",
- "columns": [
- "rubric_id",
- "criterion_id"
- ]
+ "columns": ["rubric_id", "criterion_id"]
}
},
"uniqueConstraints": {},
@@ -25849,12 +24341,8 @@
"name": "verify_rubrics_user_id_users_id_fk",
"tableFrom": "verify_rubrics",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -25862,12 +24350,8 @@
"name": "verify_rubrics_workspace_id_workspaces_id_fk",
"tableFrom": "verify_rubrics",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -26133,12 +24617,8 @@
"name": "verify_runs_user_id_users_id_fk",
"tableFrom": "verify_runs",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26146,12 +24626,8 @@
"name": "verify_runs_workspace_id_workspaces_id_fk",
"tableFrom": "verify_runs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26159,12 +24635,8 @@
"name": "verify_runs_acceptance_id_acceptances_id_fk",
"tableFrom": "verify_runs",
"tableTo": "acceptances",
- "columnsFrom": [
- "acceptance_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["acceptance_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26172,12 +24644,8 @@
"name": "verify_runs_operation_id_agent_operations_id_fk",
"tableFrom": "verify_runs",
"tableTo": "agent_operations",
- "columnsFrom": [
- "operation_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["operation_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -26496,12 +24964,8 @@
"name": "work_versions_work_id_works_id_fk",
"tableFrom": "work_versions",
"tableTo": "works",
- "columnsFrom": [
- "work_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["work_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26509,12 +24973,8 @@
"name": "work_versions_topic_id_topics_id_fk",
"tableFrom": "work_versions",
"tableTo": "topics",
- "columnsFrom": [
- "topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26522,12 +24982,8 @@
"name": "work_versions_thread_id_threads_id_fk",
"tableFrom": "work_versions",
"tableTo": "threads",
- "columnsFrom": [
- "thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26535,12 +24991,8 @@
"name": "work_versions_message_id_messages_id_fk",
"tableFrom": "work_versions",
"tableTo": "messages",
- "columnsFrom": [
- "message_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["message_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26548,12 +25000,8 @@
"name": "work_versions_agent_id_agents_id_fk",
"tableFrom": "work_versions",
"tableTo": "agents",
- "columnsFrom": [
- "agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
}
@@ -26912,12 +25360,8 @@
"name": "works_origin_topic_id_topics_id_fk",
"tableFrom": "works",
"tableTo": "topics",
- "columnsFrom": [
- "origin_topic_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_topic_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26925,12 +25369,8 @@
"name": "works_origin_thread_id_threads_id_fk",
"tableFrom": "works",
"tableTo": "threads",
- "columnsFrom": [
- "origin_thread_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_thread_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26938,12 +25378,8 @@
"name": "works_origin_agent_id_agents_id_fk",
"tableFrom": "works",
"tableTo": "agents",
- "columnsFrom": [
- "origin_agent_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["origin_agent_id"],
+ "columnsTo": ["id"],
"onDelete": "set null",
"onUpdate": "no action"
},
@@ -26951,12 +25387,8 @@
"name": "works_user_id_users_id_fk",
"tableFrom": "works",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -26964,12 +25396,8 @@
"name": "works_workspace_id_workspaces_id_fk",
"tableFrom": "works",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27093,12 +25521,8 @@
"name": "workspace_audit_logs_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_audit_logs",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27230,12 +25654,8 @@
"name": "workspace_invitations_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_invitations",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27243,12 +25663,8 @@
"name": "workspace_invitations_inviter_id_users_id_fk",
"tableFrom": "workspace_invitations",
"tableTo": "users",
- "columnsFrom": [
- "inviter_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["inviter_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27258,9 +25674,7 @@
"workspace_invitations_token_unique": {
"name": "workspace_invitations_token_unique",
"nullsNotDistinct": false,
- "columns": [
- "token"
- ]
+ "columns": ["token"]
}
},
"policies": {},
@@ -27349,12 +25763,8 @@
"name": "workspace_members_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_members",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27362,12 +25772,8 @@
"name": "workspace_members_user_id_users_id_fk",
"tableFrom": "workspace_members",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27375,10 +25781,7 @@
"compositePrimaryKeys": {
"workspace_members_workspace_id_user_id_pk": {
"name": "workspace_members_workspace_id_user_id_pk",
- "columns": [
- "workspace_id",
- "user_id"
- ]
+ "columns": ["workspace_id", "user_id"]
}
},
"uniqueConstraints": {},
@@ -27474,12 +25877,8 @@
"name": "workspace_user_settings_workspace_id_workspaces_id_fk",
"tableFrom": "workspace_user_settings",
"tableTo": "workspaces",
- "columnsFrom": [
- "workspace_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["workspace_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
},
@@ -27487,12 +25886,8 @@
"name": "workspace_user_settings_user_id_users_id_fk",
"tableFrom": "workspace_user_settings",
"tableTo": "users",
- "columnsFrom": [
- "user_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["user_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27621,12 +26016,8 @@
"name": "workspaces_primary_owner_id_users_id_fk",
"tableFrom": "workspaces",
"tableTo": "users",
- "columnsFrom": [
- "primary_owner_id"
- ],
- "columnsTo": [
- "id"
- ],
+ "columnsFrom": ["primary_owner_id"],
+ "columnsTo": ["id"],
"onDelete": "cascade",
"onUpdate": "no action"
}
@@ -27638,15 +26029,6 @@
"isRLSEnabled": false
}
},
- "enums": {},
- "schemas": {},
- "sequences": {},
- "roles": {},
- "policies": {},
- "views": {},
- "_meta": {
- "columns": {},
- "schemas": {},
- "tables": {}
- }
-}
\ No newline at end of file
+ "version": "7",
+ "views": {}
+}
diff --git a/scripts/copySpaBuild.test.ts b/scripts/copySpaBuild.test.ts
index 67d06839a09..61a2975766d 100644
--- a/scripts/copySpaBuild.test.ts
+++ b/scripts/copySpaBuild.test.ts
@@ -46,4 +46,18 @@ describe('copySpaBuild', () => {
expect(existsSync(path.join(root, 'public/_spa/model-bank/catalog.js'))).toBe(true);
});
+
+ it('publishes Workbench chunks under an isolated public asset root', () => {
+ const root = mkdtempSync(path.join(tmpdir(), 'copy-spa-workbench-'));
+ testRoots.push(root);
+
+ const sourceDir = path.join(root, 'dist/workbench/assets');
+ mkdirSync(sourceDir, { recursive: true });
+ writeFileSync(path.join(sourceDir, 'workbench.js'), 'export default true;');
+
+ copySpaBuild(root);
+
+ expect(existsSync(path.join(root, 'public/_spa-workbench/assets/workbench.js'))).toBe(true);
+ expect(existsSync(path.join(root, 'public/_spa/assets/workbench.js'))).toBe(false);
+ });
});
diff --git a/scripts/copySpaBuildCore.ts b/scripts/copySpaBuildCore.ts
index 82b2637bfac..016d8bb5a11 100644
--- a/scripts/copySpaBuildCore.ts
+++ b/scripts/copySpaBuildCore.ts
@@ -7,6 +7,7 @@ const targets = [
{ distDir: 'desktop', publicDir: 'public/_spa' },
{ distDir: 'mobile', publicDir: 'public/_spa' },
{ distDir: 'auth', publicDir: 'public/_spa-auth' },
+ { distDir: 'workbench', publicDir: 'public/_spa-workbench' },
] as const;
export const copySpaBuild = (root = path.resolve(import.meta.dirname, '..')) => {
diff --git a/scripts/generateSpaTemplates.mts b/scripts/generateSpaTemplates.mts
index a47a5cc844e..327e5e22f00 100644
--- a/scripts/generateSpaTemplates.mts
+++ b/scripts/generateSpaTemplates.mts
@@ -1,12 +1,12 @@
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
-import { resolve } from 'node:path';
+import path from 'node:path';
-const root = resolve(import.meta.dirname, '..');
+const root = path.resolve(import.meta.dirname, '..');
-const desktopHtml = readFileSync(resolve(root, 'dist/desktop/index.html'), 'utf8');
+const desktopHtml = readFileSync(path.resolve(root, 'dist/desktop/index.html'), 'utf8');
-const mobileHtmlPath = resolve(root, 'dist/mobile/index.mobile.html');
-const mobileHtmlFallbackPath = resolve(root, 'dist/mobile/index.html');
+const mobileHtmlPath = path.resolve(root, 'dist/mobile/index.mobile.html');
+const mobileHtmlFallbackPath = path.resolve(root, 'dist/mobile/index.html');
const hasMobileBuild = existsSync(mobileHtmlPath) || existsSync(mobileHtmlFallbackPath);
let output: string;
@@ -39,14 +39,14 @@ export { mobileHtmlTemplate };
}
writeFileSync(
- resolve(root, 'src/app/spa/[variants]/[[...path]]/spaHtmlTemplates.ts'),
+ path.resolve(root, 'src/app/spa/[variants]/[[...path]]/spaHtmlTemplates.ts'),
output,
'utf8',
);
console.log(`Generated spaHtmlTemplates.ts (mobile from ${hasMobileBuild ? 'build' : 'source'})`);
-const authHtmlPath = resolve(root, 'dist/auth/index.auth.html');
+const authHtmlPath = path.resolve(root, 'dist/auth/index.auth.html');
if (existsSync(authHtmlPath)) {
const authHtml = readFileSync(authHtmlPath, 'utf8');
@@ -57,9 +57,31 @@ if (existsSync(authHtmlPath)) {
export const authHtmlTemplate = ${JSON.stringify(authHtml)};
`;
- writeFileSync(resolve(root, 'src/app/spa-auth/authHtmlTemplate.ts'), authOutput, 'utf8');
+ writeFileSync(path.resolve(root, 'src/app/spa-auth/authHtmlTemplate.ts'), authOutput, 'utf8');
console.log('Generated authHtmlTemplate.ts');
} else {
console.log('Skipped authHtmlTemplate.ts (no dist/auth build)');
}
+
+const workbenchHtmlPath = path.resolve(root, 'dist/workbench/index.workbench.html');
+
+if (existsSync(workbenchHtmlPath)) {
+ const workbenchHtml = readFileSync(workbenchHtmlPath, 'utf8');
+
+ const workbenchOutput = `// Auto-generated by scripts/generateSpaTemplates.mts after vite build
+// Do not edit manually
+
+export const workbenchHtmlTemplate = ${JSON.stringify(workbenchHtml)};
+`;
+
+ writeFileSync(
+ path.resolve(root, 'src/app/spa-workbench/workbenchHtmlTemplate.ts'),
+ workbenchOutput,
+ 'utf8',
+ );
+
+ console.log('Generated workbenchHtmlTemplate.ts');
+} else {
+ console.log('Skipped workbenchHtmlTemplate.ts (no dist/workbench build)');
+}
diff --git a/src/app/spa-workbench/[locale]/[[...path]]/route.ts b/src/app/spa-workbench/[locale]/[[...path]]/route.ts
new file mode 100644
index 00000000000..ce6d2482d3c
--- /dev/null
+++ b/src/app/spa-workbench/[locale]/[[...path]]/route.ts
@@ -0,0 +1,62 @@
+import { BRANDING_NAME } from '@lobechat/business-const';
+
+import { getServerFeatureFlagsValue } from '@/config/featureFlags';
+import { appEnv } from '@/envs/app';
+import { fileEnv } from '@/envs/file';
+import { pythonEnv } from '@/envs/python';
+import { buildAnalyticsConfig, fetchViteDevTemplate, renderSpaHtml } from '@/libs/spaHtml';
+import { type Locales, normalizeLocale } from '@/locales/resources';
+import { getServerGlobalConfig } from '@/server/globalConfig';
+import { type SPAClientEnv, type SPAServerConfig } from '@/types/spaServerConfig';
+
+export function generateStaticParams() {
+ const staticLocales: Locales[] = ['en-US', 'zh-CN'];
+
+ return staticLocales.map((locale) => ({ locale }));
+}
+
+const isDev = process.env.NODE_ENV === 'development';
+
+async function getTemplate(): Promise<string> {
+ if (isDev) return fetchViteDevTemplate('/index.workbench.html');
+
+ const { workbenchHtmlTemplate } = await import('../../workbenchHtmlTemplate');
+
+ return workbenchHtmlTemplate;
+}
+
+function buildClientEnv(): SPAClientEnv {
+ return {
+ marketBaseUrl: appEnv.MARKET_BASE_URL,
+ pyodideIndexUrl: pythonEnv.NEXT_PUBLIC_PYODIDE_INDEX_URL,
+ pyodidePipIndexUrl: pythonEnv.NEXT_PUBLIC_PYODIDE_PIP_INDEX_URL,
+ s3FilePath: fileEnv.NEXT_PUBLIC_S3_FILE_PATH,
+ };
+}
+
+const buildSeoMeta = (locale: string) =>
+ [
+ `<title>${BRANDING_NAME}</title>`,
+ '<meta name="robots" content="noindex, nofollow" />',
+ `<meta property="og:locale" content="${locale}" />`,
+ ].join('\n ');
+
+export async function GET(
+ _request: Request,
+ { params }: { params: Promise<{ locale: string; path?: string[] }> },
+) {
+ const { locale: rawLocale } = await params;
+ const locale = normalizeLocale(rawLocale);
+
+ const spaConfig: SPAServerConfig = {
+ analyticsConfig: buildAnalyticsConfig(),
+ clientEnv: buildClientEnv(),
+ config: await getServerGlobalConfig(),
+ featureFlags: getServerFeatureFlagsValue(),
+ isMobile: true,
+ };
+
+ const template = await getTemplate();
+
+ return renderSpaHtml(template, { seoMeta: buildSeoMeta(locale), serverConfig: spaConfig });
+}
diff --git a/src/app/spa-workbench/workbenchHtmlTemplate.d.ts b/src/app/spa-workbench/workbenchHtmlTemplate.d.ts
new file mode 100644
index 00000000000..2e59e6ac5f8
--- /dev/null
+++ b/src/app/spa-workbench/workbenchHtmlTemplate.d.ts
@@ -0,0 +1 @@
+export declare const workbenchHtmlTemplate: string;
diff --git a/src/features/AgentDocumentReader/index.tsx b/src/features/AgentDocumentReader/index.tsx
new file mode 100644
index 00000000000..ecef41cdf38
--- /dev/null
+++ b/src/features/AgentDocumentReader/index.tsx
@@ -0,0 +1,99 @@
+'use client';
+
+import { Button } from '@lobehub/ui/base-ui';
+import ActionIcon from '@lobehub/ui/es/ActionIcon/index';
+import { Center, Flexbox } from '@lobehub/ui/es/Flex/index';
+import Markdown from '@lobehub/ui/es/Markdown/index';
+import Text from '@lobehub/ui/es/Text/index';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { ArrowLeft, RefreshCw } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import useSWR from 'swr';
+
+import WorkbenchLoading from '@/features/WorkbenchShell/WorkbenchLoading';
+import { agentDocumentService, agentDocumentSWRKeys } from '@/services/agentDocument';
+
+const styles = createStaticStyles(({ css }) => ({
+ article: css`
+ width: 100%;
+ max-width: 840px;
+ margin-inline: auto;
+ padding-block: 28px 80px;
+ padding-inline: 20px;
+ `,
+ body: css`
+ overflow: auto;
+ flex: 1;
+ min-height: 0;
+ `,
+ header: css`
+ flex: none;
+
+ min-height: 52px;
+ padding-inline: 12px;
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+
+ background: ${cssVar.colorBgContainer};
+ `,
+ page: css`
+ width: 100%;
+ height: 100dvh;
+ background: ${cssVar.colorBgContainer};
+ `,
+}));
+
+interface AgentDocumentReaderProps {
+ agentId: string;
+ documentId: string;
+}
+
+const AgentDocumentReader = memo<AgentDocumentReaderProps>(({ agentId, documentId }) => {
+ const { t } = useTranslation('common');
+ const { data, error, isLoading, mutate } = useSWR(
+ agentId && documentId ? agentDocumentSWRKeys.readerDocument(agentId, documentId) : null,
+ () => agentDocumentService.getReaderDocument({ agentId, documentId }),
+ { revalidateOnFocus: false },
+ );
+
+ const backToAgent = () => window.location.assign(`/agent/${agentId}`);
+ const title = data?.title || data?.filename || '';
+
+ return (
+ <Flexbox className={styles.page}>
+ <Flexbox horizontal align={'center'} className={styles.header} gap={8}>
+ <ActionIcon icon={ArrowLeft} title={t('back')} onClick={backToAgent} />
+ <Text ellipsis strong style={{ flex: 1, minWidth: 0 }} title={title}>
+ {title}
+ </Text>
+ </Flexbox>
+ <div className={styles.body}>
+ {!error && isLoading ? (
+ <Center height={'100%'}>
+ <WorkbenchLoading />
+ </Center>
+ ) : error ? (
+ <Center gap={16} height={'100%'} padding={24}>
+ <Text type={'secondary'}>{error.message}</Text>
+ <Button
+ icon={RefreshCw}
+ onClick={() => {
+ void mutate();
+ }}
+ >
+ {t('retry')}
+ </Button>
+ </Center>
+ ) : (
+ <article className={styles.article}>
+ {data?.content ? <Markdown>{data.content}</Markdown> : <Center padding={64}>β€”</Center>}
+ </article>
+ )}
+ </div>
+ </Flexbox>
+ );
+});
+
+AgentDocumentReader.displayName = 'AgentDocumentReader';
+
+export default AgentDocumentReader;
diff --git a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
index b5b8b7b9c0f..ce9e73b1a3c 100644
--- a/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
+++ b/src/features/Conversation/Markdown/plugins/Link/Render/InternalEntityLink.tsx
@@ -15,6 +15,7 @@ import type { MouseEvent } from 'react';
import { memo, useCallback } from 'react';
import { useWorkspaceAwareNavigate } from '@/features/Workspace/useWorkspaceAwareNavigate';
+import { shouldHardNavigateToWorkbench } from '@/libs/next/workbenchNavigation';
import { useClientDataSWR } from '@/libs/swr';
import { agentDocumentService, agentDocumentSWRKeys } from '@/services/agentDocument';
import { useAgentStore } from '@/store/agent';
@@ -101,6 +102,14 @@ export const InternalEntityLink = memo<InternalEntityLinkProps>(({ href, label,
event.preventDefault();
+ if (
+ (reference.type === 'acceptance' || reference.type === 'document') &&
+ shouldHardNavigateToWorkbench(reference.pathname)
+ ) {
+ navigate(reference.pathname, { escape: true });
+ return;
+ }
+
// Portal-backed entities (verify / acceptance) open in-context regardless
// of workspace scope β€” their reads are id-addressed and scope-independent.
if (
diff --git a/src/features/Verify/Acceptance/Workbench/AcceptanceDetail.tsx b/src/features/Verify/Acceptance/Workbench/AcceptanceDetail.tsx
new file mode 100644
index 00000000000..f0b85218c88
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workbench/AcceptanceDetail.tsx
@@ -0,0 +1,61 @@
+'use client';
+
+import ActionIcon from '@lobehub/ui/es/ActionIcon/index';
+import { Flexbox } from '@lobehub/ui/es/Flex/index';
+import Text from '@lobehub/ui/es/Text/index';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { ArrowLeft } from 'lucide-react';
+import { memo } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate } from 'react-router';
+
+import AcceptanceViewer from '..';
+import SWRMutateInitializer from './SWRMutateInitializer';
+
+const styles = createStaticStyles(({ css }) => ({
+ body: css`
+ overflow: hidden;
+ flex: 1;
+ min-height: 0;
+ `,
+ header: css`
+ flex: none;
+
+ min-height: 48px;
+ padding-inline: 12px;
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+
+ background: ${cssVar.colorBgContainer};
+ `,
+ page: css`
+ width: 100%;
+ height: 100dvh;
+ background: ${cssVar.colorBgContainer};
+ `,
+}));
+
+const WorkbenchAcceptanceDetail = memo(() => {
+ const { t } = useTranslation(['verify', 'common']);
+ const navigate = useNavigate();
+
+ return (
+ <Flexbox className={styles.page}>
+ <SWRMutateInitializer />
+ <Flexbox horizontal align={'center'} className={styles.header} gap={8}>
+ <ActionIcon
+ icon={ArrowLeft}
+ title={t('back', { ns: 'common' })}
+ onClick={() => navigate('/acceptance')}
+ />
+ <Text strong>{t('acceptance.workspace.title')}</Text>
+ </Flexbox>
+ <div className={styles.body}>
+ <AcceptanceViewer />
+ </div>
+ </Flexbox>
+ );
+});
+
+WorkbenchAcceptanceDetail.displayName = 'WorkbenchAcceptanceDetail';
+
+export default WorkbenchAcceptanceDetail;
diff --git a/src/features/Verify/Acceptance/Workbench/AcceptanceList.tsx b/src/features/Verify/Acceptance/Workbench/AcceptanceList.tsx
new file mode 100644
index 00000000000..780a88ab82b
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workbench/AcceptanceList.tsx
@@ -0,0 +1,241 @@
+'use client';
+
+import type { DropdownItem } from '@lobehub/ui/base-ui';
+import { DropdownMenu } from '@lobehub/ui/base-ui';
+import ActionIcon from '@lobehub/ui/es/ActionIcon/index';
+import Empty from '@lobehub/ui/es/Empty/index';
+import { Center, Flexbox } from '@lobehub/ui/es/Flex/index';
+import Icon from '@lobehub/ui/es/Icon/index';
+import Text from '@lobehub/ui/es/Text/index';
+import { createStaticStyles, cssVar } from 'antd-style';
+import { ArrowLeft, Check, ListFilter, ScrollText, Search, TriangleAlert } from 'lucide-react';
+import { memo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import useSWR from 'swr';
+
+import { useLocalStorageState } from '@/hooks/useLocalStorageState';
+import { verifyKeys } from '@/libs/swr/keys';
+import { verifyService } from '@/services/verify';
+
+import {
+ type AcceptanceListFilter,
+ DEFAULT_ACCEPTANCE_LIST_FILTER,
+ filterAcceptanceList,
+ normalizeAcceptanceListFilter,
+} from '../Workspace/acceptanceListFilter';
+import AcceptanceRow from './AcceptanceRow';
+
+const ACCEPTANCE_LIST_FILTER_STORAGE_KEY = 'lobehub-acceptance-list-filter';
+const EMPTY_FILTER_KEYS = {
+ active: 'acceptance.workspace.filters.empty.active',
+ completed: 'acceptance.workspace.filters.empty.completed',
+} as const satisfies Record<Exclude<AcceptanceListFilter, 'all'>, string>;
+
+const styles = createStaticStyles(({ css }) => ({
+ content: css`
+ overflow: hidden auto;
+ flex: 1;
+ min-height: 0;
+ `,
+ emptyState: css`
+ min-height: 280px;
+ padding-block: 24px;
+ padding-inline: 16px;
+ `,
+ header: css`
+ flex: none;
+ padding: 12px;
+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};
+ `,
+ list: css`
+ display: flex;
+ flex-direction: column;
+ gap: 2px;
+
+ padding-block: 8px 24px;
+ padding-inline: 8px;
+ `,
+ page: css`
+ width: 100%;
+ height: 100dvh;
+ background: ${cssVar.colorBgLayout};
+ `,
+ retry: css`
+ cursor: pointer;
+
+ padding-block: 6px;
+ padding-inline: 12px;
+ border: 1px solid ${cssVar.colorBorder};
+ border-radius: ${cssVar.borderRadius};
+
+ color: ${cssVar.colorTextSecondary};
+
+ background: ${cssVar.colorBgContainer};
+ `,
+ search: css`
+ display: flex;
+ gap: 8px;
+ align-items: center;
+
+ height: 36px;
+ padding-inline: 11px;
+ border: 1px solid ${cssVar.colorBorderSecondary};
+ border-radius: ${cssVar.borderRadius};
+
+ background: ${cssVar.colorBgContainer};
+
+ input {
+ width: 100%;
+ min-width: 0;
+ border: 0;
+
+ color: ${cssVar.colorText};
+
+ background: transparent;
+ outline: none;
+ }
+ `,
+ searchEmpty: css`
+ padding-block: 28px;
+ padding-inline: 16px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ skeleton: css`
+ height: 52px;
+ margin-block: 2px;
+ border-radius: ${cssVar.borderRadiusLG};
+ background: ${cssVar.colorFillTertiary};
+ `,
+ skeletonList: css`
+ padding-block: 8px;
+ padding-inline: 8px;
+ `,
+}));
+
+const WorkbenchAcceptanceList = memo(() => {
+ const { t } = useTranslation(['verify', 'common']);
+ const { data, error, isLoading, mutate } = useSWR(
+ verifyKeys.acceptances(),
+ () => verifyService.listAcceptances(),
+ {
+ revalidateIfStale: false,
+ revalidateOnFocus: false,
+ revalidateOnReconnect: false,
+ },
+ );
+ const [query, setQuery] = useState('');
+ const [storedFilter, setStoredFilter] = useLocalStorageState<AcceptanceListFilter>(
+ ACCEPTANCE_LIST_FILTER_STORAGE_KEY,
+ DEFAULT_ACCEPTANCE_LIST_FILTER,
+ );
+ const filter = normalizeAcceptanceListFilter(storedFilter);
+ const filtered = filterAcceptanceList(data ?? [], filter, query);
+ const trimmedQuery = query.trim();
+
+ const filterItems: DropdownItem[] = (
+ [
+ ['active', t('acceptance.workspace.filters.active')],
+ ['all', t('acceptance.workspace.filters.all')],
+ ['completed', t('acceptance.workspace.filters.completed')],
+ ] as const
+ ).map(([key, label]) => ({
+ icon: <Icon icon={Check} style={{ opacity: filter === key ? 1 : 0 }} />,
+ key,
+ label,
+ onClick: () => setStoredFilter(key),
+ }));
+
+ return (
+ <Flexbox className={styles.page}>
+ <Flexbox className={styles.header} gap={12}>
+ <Flexbox horizontal align={'center'} gap={8}>
+ <ActionIcon
+ icon={ArrowLeft}
+ title={t('back', { ns: 'common' })}
+ onClick={() => window.location.assign('/')}
+ />
+ <Text strong style={{ flex: 1, fontSize: 17 }}>
+ {t('acceptance.workspace.title')}
+ </Text>
+ <DropdownMenu items={filterItems} placement={'bottomRight'}>
+ <ActionIcon
+ active={filter !== 'all'}
+ icon={ListFilter}
+ title={t('acceptance.workspace.filters.title')}
+ />
+ </DropdownMenu>
+ </Flexbox>
+ <label className={styles.search}>
+ <Icon color={cssVar.colorTextQuaternary} icon={Search} size={15} />
+ <input
+ placeholder={t('workspace.search')}
+ type={'search'}
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ />
+ </label>
+ </Flexbox>
+
+ <div className={styles.content}>
+ {error ? (
+ <Center className={styles.emptyState} gap={12}>
+ <Empty
+ description={t('workspace.loadError')}
+ icon={TriangleAlert}
+ title={t('workspace.loadErrorTitle')}
+ />
+ <button className={styles.retry} type={'button'} onClick={() => void mutate()}>
+ {t('workspace.retry')}
+ </button>
+ </Center>
+ ) : isLoading ? (
+ <div className={styles.skeletonList}>
+ {Array.from({ length: 8 }).map((_, index) => (
+ <div className={styles.skeleton} key={index} />
+ ))}
+ </div>
+ ) : filtered.length === 0 ? (
+ trimmedQuery || filter !== 'all' ? (
+ <Flexbox className={styles.searchEmpty} gap={12}>
+ <span>
+ {trimmedQuery
+ ? t('acceptance.workspace.filters.noSearchResults', { query: trimmedQuery })
+ : filter === 'all'
+ ? null
+ : t(EMPTY_FILTER_KEYS[filter])}
+ </span>
+ <button
+ className={styles.retry}
+ type={'button'}
+ onClick={() => {
+ setQuery('');
+ setStoredFilter('all');
+ }}
+ >
+ {t('acceptance.workspace.filters.showAll')}
+ </button>
+ </Flexbox>
+ ) : (
+ <Center className={styles.emptyState}>
+ <Empty
+ description={t('acceptance.workspace.listEmpty')}
+ icon={ScrollText}
+ title={t('acceptance.workspace.listEmptyTitle')}
+ />
+ </Center>
+ )
+ ) : (
+ <div className={styles.list}>
+ {filtered.map((item) => (
+ <AcceptanceRow item={item} key={item.id} onChanged={mutate} />
+ ))}
+ </div>
+ )}
+ </div>
+ </Flexbox>
+ );
+});
+
+WorkbenchAcceptanceList.displayName = 'WorkbenchAcceptanceList';
+
+export default WorkbenchAcceptanceList;
diff --git a/src/features/Verify/Acceptance/Workbench/AcceptanceRow.tsx b/src/features/Verify/Acceptance/Workbench/AcceptanceRow.tsx
new file mode 100644
index 00000000000..8fc86837d12
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workbench/AcceptanceRow.tsx
@@ -0,0 +1,376 @@
+'use client';
+
+import type { AcceptanceStatus } from '@lobechat/types';
+import type { DropdownItem } from '@lobehub/ui/base-ui';
+import { confirmModal, DropdownMenu } from '@lobehub/ui/base-ui';
+import ActionIcon from '@lobehub/ui/es/ActionIcon/index';
+import { Flexbox } from '@lobehub/ui/es/Flex/index';
+import Icon from '@lobehub/ui/es/Icon/index';
+import { App } from 'antd';
+import { createStaticStyles, cssVar } from 'antd-style';
+import dayjs from 'dayjs';
+import {
+ BadgeCheck,
+ CircleCheck,
+ CircleDashed,
+ CircleHelp,
+ CircleX,
+ LoaderCircle,
+ MoreHorizontal,
+ Pencil,
+ RefreshCw,
+ RotateCcw,
+ Trash2,
+ X,
+} from 'lucide-react';
+import { memo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate } from 'react-router';
+import { mutate as globalMutate } from 'swr';
+
+import { verifyKeys } from '@/libs/swr/keys';
+import type { AcceptanceListItem } from '@/services/verify';
+import { verifyService } from '@/services/verify';
+
+import { getAcceptanceStatusActions } from '../statusActions';
+
+const styles = createStaticStyles(({ css }) => ({
+ content: css`
+ overflow: hidden;
+ display: flex;
+ flex: 1;
+ flex-direction: column;
+ gap: 2px;
+
+ min-width: 0;
+
+ text-align: start;
+ `,
+ editRow: css`
+ padding-block: 4px;
+ padding-inline: 4px;
+ `,
+ itemSub: css`
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ itemTitleInput: css`
+ width: 100%;
+ min-width: 0;
+ height: 32px;
+ padding-inline: 8px;
+ border: 1px solid ${cssVar.colorBorder};
+ border-radius: ${cssVar.borderRadius};
+
+ font-size: 14px;
+ color: ${cssVar.colorText};
+
+ background: ${cssVar.colorBgContainer};
+ outline: none;
+
+ &:focus {
+ border-color: ${cssVar.colorPrimary};
+ box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};
+ }
+ `,
+ main: css`
+ cursor: pointer;
+
+ display: flex;
+ flex: 1;
+ gap: 10px;
+ align-items: center;
+
+ min-width: 0;
+ padding: 0;
+ border: 0;
+
+ color: inherit;
+
+ background: transparent;
+ `,
+ row: css`
+ display: flex;
+ gap: 6px;
+ align-items: center;
+
+ min-height: 52px;
+ padding-block: 7px;
+ padding-inline: 10px 6px;
+ border-radius: ${cssVar.borderRadiusLG};
+
+ &:hover {
+ background: ${cssVar.colorFillTertiary};
+ }
+ `,
+ spin: css`
+ animation: acceptance-spin 1.1s linear infinite;
+
+ @keyframes acceptance-spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+ `,
+ title: css`
+ overflow: hidden;
+
+ font-size: 14px;
+ font-weight: 500;
+ color: ${cssVar.colorText};
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ `,
+}));
+
+type Glyph = 'accepted' | 'awaiting' | 'bad' | 'closed' | 'repairing' | 'running' | 'unsure';
+
+const RUNNING_STATUSES = new Set<AcceptanceStatus>([
+ 'pending',
+ 'planned',
+ 'verifying',
+ 'repairing',
+]);
+
+const glyphOf = (status: AcceptanceStatus): Glyph => {
+ if (status === 'repairing') return 'repairing';
+ if (RUNNING_STATUSES.has(status)) return 'running';
+ if (status === 'accepted') return 'accepted';
+ if (status === 'closed') return 'closed';
+ if (status === 'rejected') return 'bad';
+ if (status === 'errored') return 'unsure';
+ return 'awaiting';
+};
+
+const SPINNING_GLYPHS = new Set<Glyph>(['running', 'repairing']);
+
+const glyphMeta: Record<Glyph, { color: string; icon: typeof BadgeCheck }> = {
+ accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
+ awaiting: { color: cssVar.colorInfo, icon: CircleDashed },
+ bad: { color: cssVar.colorError, icon: CircleX },
+ closed: { color: cssVar.colorTextTertiary, icon: X },
+ repairing: { color: cssVar.colorWarning, icon: RefreshCw },
+ running: { color: cssVar.colorInfo, icon: LoaderCircle },
+ unsure: { color: cssVar.colorWarning, icon: CircleHelp },
+};
+
+const relativeTime = (value?: Date | string | null) => {
+ if (!value) return '';
+ const date = dayjs(value);
+ return dayjs().diff(date, 'day') < 7 ? date.fromNow() : date.format('MMM D');
+};
+
+interface AcceptanceRowProps {
+ item: AcceptanceListItem;
+ onChanged: () => Promise<unknown> | unknown;
+}
+
+const AcceptanceRow = memo<AcceptanceRowProps>(({ item, onChanged }) => {
+ const { t } = useTranslation(['verify', 'common']);
+ const { message } = App.useApp();
+ const navigate = useNavigate();
+ const [editing, setEditing] = useState(false);
+ const [mutating, setMutating] = useState(false);
+ const isSavingRef = useRef(false);
+
+ const glyph = glyphOf(item.status as AcceptanceStatus);
+ const meta = glyphMeta[glyph];
+ const title = item.subject.title || item.subjectId;
+ const [draftTitle, setDraftTitle] = useState(title);
+
+ const refresh = () =>
+ Promise.all([onChanged(), globalMutate(verifyKeys.acceptanceBundle(item.id))]);
+
+ const commitRename = async () => {
+ if (isSavingRef.current) return;
+ const next = draftTitle.trim();
+ if (!next) {
+ message.error(t('verify:acceptance.workspace.renameEmpty'));
+ setDraftTitle(title);
+ setEditing(false);
+ return;
+ }
+ if (next === title) {
+ setEditing(false);
+ return;
+ }
+
+ isSavingRef.current = true;
+ setMutating(true);
+ try {
+ await verifyService.renameAcceptance(item.id, next);
+ await refresh();
+ message.success(t('verify:acceptance.workspace.renameSuccess'));
+ setEditing(false);
+ } catch (error) {
+ console.error('[acceptance:rename]', error);
+ message.error(t('verify:acceptance.workspace.renameError'));
+ } finally {
+ isSavingRef.current = false;
+ setMutating(false);
+ }
+ };
+
+ const changeStatus = async (status: 'accepted' | 'closed' | 'delivered') => {
+ setMutating(true);
+ try {
+ await verifyService.updateAcceptanceStatus(item.id, status);
+ await refresh();
+ message.success(t('verify:acceptance.workspace.statusSuccess'));
+ } catch (error) {
+ console.error('[acceptance:status]', error);
+ message.error(t('verify:acceptance.workspace.statusError'));
+ } finally {
+ setMutating(false);
+ }
+ };
+
+ const statusItems: DropdownItem[] = getAcceptanceStatusActions(item.status).map((action) => {
+ if (action === 'accept') {
+ return {
+ icon: <Icon icon={CircleCheck} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markAccepted'),
+ onClick: () => void changeStatus('accepted'),
+ };
+ }
+ if (action === 'reopen') {
+ return {
+ icon: <Icon icon={RotateCcw} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.reopen'),
+ onClick: () => void changeStatus('delivered'),
+ };
+ }
+ return {
+ icon: <Icon icon={X} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markClosed'),
+ onClick: () => void changeStatus('closed'),
+ };
+ });
+
+ const menuItems: DropdownItem[] = [
+ {
+ icon: <Icon icon={Pencil} />,
+ key: 'rename',
+ label: t('verify:acceptance.workspace.actions.rename'),
+ onClick: () => {
+ setDraftTitle(title);
+ setEditing(true);
+ },
+ },
+ ...(statusItems.length > 0
+ ? [
+ {
+ children: statusItems,
+ icon: <Icon icon={CircleDashed} />,
+ key: 'status',
+ label: t('verify:acceptance.workspace.actions.status'),
+ },
+ { type: 'divider' as const },
+ ]
+ : []),
+ {
+ danger: true,
+ icon: <Icon icon={Trash2} />,
+ key: 'delete',
+ label: t('verify:acceptance.workspace.actions.delete'),
+ onClick: () => {
+ confirmModal({
+ cancelText: t('common:cancel'),
+ content: t('verify:acceptance.workspace.deleteConfirmDescription', { title }),
+ okButtonProps: { danger: true },
+ okText: t('common:delete'),
+ onOk: async () => {
+ setMutating(true);
+ try {
+ await verifyService.deleteAcceptance(item.id);
+ await onChanged();
+ message.success(t('verify:acceptance.workspace.deleteSuccess'));
+ } catch (error) {
+ console.error('[acceptance:delete]', error);
+ message.error(t('verify:acceptance.workspace.deleteError'));
+ } finally {
+ setMutating(false);
+ }
+ },
+ title: t('verify:acceptance.workspace.deleteConfirmTitle'),
+ });
+ },
+ },
+ ];
+
+ if (editing) {
+ return (
+ <div className={styles.editRow}>
+ <input
+ autoFocus
+ className={styles.itemTitleInput}
+ value={draftTitle}
+ onBlur={() => void commitRename()}
+ onChange={(event) => setDraftTitle(event.target.value)}
+ onFocus={(event) => event.currentTarget.select()}
+ onKeyDown={(event) => {
+ if (event.key === 'Enter') {
+ event.preventDefault();
+ void commitRename();
+ }
+ if (event.key === 'Escape') {
+ event.preventDefault();
+ setDraftTitle(title);
+ setEditing(false);
+ }
+ }}
+ />
+ </div>
+ );
+ }
+
+ return (
+ <div
+ className={styles.row}
+ style={mutating ? { opacity: 0.62, pointerEvents: 'none' } : undefined}
+ >
+ <button
+ className={styles.main}
+ type={'button'}
+ onClick={() => navigate(`/acceptance/${item.id}`)}
+ >
+ <Icon
+ className={SPINNING_GLYPHS.has(glyph) ? styles.spin : undefined}
+ icon={meta.icon}
+ size={17}
+ style={{ color: meta.color }}
+ />
+ <span className={styles.content}>
+ <span className={styles.title}>{title}</span>
+ <Flexbox horizontal className={styles.itemSub} gap={8}>
+ <span>
+ {item.checkCount != null
+ ? t('acceptance.workspace.checkCount', { count: item.checkCount })
+ : t(`acceptance.status.${item.status}` as any)}
+ </span>
+ <span>{relativeTime(item.updatedAt ?? item.createdAt)}</span>
+ </Flexbox>
+ </span>
+ </button>
+ <DropdownMenu
+ iconSpaceMode={'group'}
+ items={menuItems}
+ placement={'bottomRight'}
+ popupProps={{ style: { minWidth: 160 } }}
+ >
+ <ActionIcon
+ icon={MoreHorizontal}
+ size={'small'}
+ title={t('verify:acceptance.workspace.actions.more')}
+ />
+ </DropdownMenu>
+ </div>
+ );
+});
+
+AcceptanceRow.displayName = 'WorkbenchAcceptanceRow';
+
+export default AcceptanceRow;
diff --git a/src/features/Verify/Acceptance/Workbench/SWRMutateInitializer.tsx b/src/features/Verify/Acceptance/Workbench/SWRMutateInitializer.tsx
new file mode 100644
index 00000000000..1692239662a
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workbench/SWRMutateInitializer.tsx
@@ -0,0 +1,28 @@
+'use client';
+
+import { useEffect } from 'react';
+import { useSWRConfig } from 'swr';
+
+/**
+ * Preserve the shared imperative mutate contract without mounting Main SPA's
+ * persisted query/cache provider in the Workbench shell.
+ */
+const SWRMutateInitializer = () => {
+ const { mutate } = useSWRConfig();
+
+ useEffect(() => {
+ let active = true;
+
+ void import('@/libs/swr').then(({ setScopedMutate }) => {
+ if (active) setScopedMutate(mutate);
+ });
+
+ return () => {
+ active = false;
+ };
+ }, [mutate]);
+
+ return null;
+};
+
+export default SWRMutateInitializer;
diff --git a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
index 0deff5658bb..8394a463cdc 100644
--- a/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
+++ b/src/features/Verify/Acceptance/Workspace/AcceptanceListPanel.tsx
@@ -1,6 +1,5 @@
'use client';
-import type { AcceptanceStatus } from '@lobechat/types';
import {
ActionIcon,
Center,
@@ -13,55 +12,37 @@ import {
Text,
} from '@lobehub/ui';
import type { DropdownItem } from '@lobehub/ui/base-ui';
-import { confirmModal, DropdownMenu, toast } from '@lobehub/ui/base-ui';
+import { DropdownMenu } from '@lobehub/ui/base-ui';
import { createStaticStyles, cssVar } from 'antd-style';
-import dayjs from 'dayjs';
import isEqual from 'fast-deep-equal';
import {
ArrowLeft,
- BadgeCheck,
Check,
- CircleCheck,
- CircleDashed,
- CircleHelp,
- CircleX,
ListFilter,
- LoaderCircle,
- MoreHorizontal,
PanelLeftClose,
- Pencil,
- RefreshCw,
- RotateCcw,
ScrollText,
Search,
- Trash2,
TriangleAlert,
- X,
} from 'lucide-react';
-import { memo, useRef, useState } from 'react';
+import { memo, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useParams } from 'react-router';
-import NavItem from '@/features/NavPanel/components/NavItem';
import { SkeletonList } from '@/features/NavPanel/components/SkeletonList';
import { useLocalStorageState } from '@/hooks/useLocalStorageState';
-import { mutate as globalMutate } from '@/libs/swr';
-import { verifyKeys } from '@/libs/swr/keys';
-import type { AcceptanceListItem } from '@/services/verify';
-import { verifyService } from '@/services/verify';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
import { useAcceptanceList } from '../../hooks';
import type { ReportPanelExpand } from '../../Workspace/useReportPanelExpand';
import { acceptanceHomePath } from '../routes';
-import { getAcceptanceStatusActions } from '../statusActions';
import {
type AcceptanceListFilter,
DEFAULT_ACCEPTANCE_LIST_FILTER,
filterAcceptanceList,
normalizeAcceptanceListFilter,
} from './acceptanceListFilter';
+import AcceptanceRow from './AcceptanceRow';
const PANEL_MIN = 260;
const PANEL_MAX = 420;
@@ -180,47 +161,6 @@ const styles = createStaticStyles(({ css }) => ({
padding-block: 6px 16px;
padding-inline: 8px;
`,
- spin: css`
- animation: acceptance-spin 1.1s linear infinite;
-
- @keyframes acceptance-spin {
- to {
- transform: rotate(360deg);
- }
- }
- `,
- itemSub: css`
- display: flex;
- gap: 8px;
-
- margin-block-start: 2px;
-
- font-size: 12px;
- color: ${cssVar.colorTextTertiary};
- `,
- editRow: css`
- padding-block: 4px;
- padding-inline: 4px;
- `,
- itemTitleInput: css`
- width: 100%;
- min-width: 0;
- height: 24px;
- padding-inline: 6px;
- border: 1px solid ${cssVar.colorBorder};
- border-radius: 4px;
-
- font-size: 13px;
- color: ${cssVar.colorText};
-
- background: ${cssVar.colorBgContainer};
- outline: none;
-
- &:focus {
- border-color: ${cssVar.colorPrimary};
- box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};
- }
- `,
emptyState: css`
height: 100%;
min-height: 240px;
@@ -247,283 +187,6 @@ const styles = createStaticStyles(({ css }) => ({
`,
}));
-type Glyph = 'accepted' | 'awaiting' | 'bad' | 'closed' | 'repairing' | 'running' | 'unsure';
-
-const RUNNING_STATUSES = new Set<AcceptanceStatus>([
- 'pending',
- 'planned',
- 'verifying',
- 'repairing',
-]);
-
-const glyphOf = (status: AcceptanceStatus): Glyph => {
- // A repair round is an in-progress TASK, distinct from a neutral verify β€”
- // warn-coloured, matching the system's task-process cue.
- if (status === 'repairing') return 'repairing';
- if (RUNNING_STATUSES.has(status)) return 'running';
- if (status === 'accepted') return 'accepted';
- if (status === 'closed') return 'closed';
- if (status === 'rejected') return 'bad';
- if (status === 'errored') return 'unsure';
- return 'awaiting';
-};
-
-const SPINNING_GLYPHS = new Set<Glyph>(['running', 'repairing']);
-
-// Mirrors the detail header's verdict pill: a delivered-but-undecided
-// aggregate reads as "acceptance in progress", never as a green all-clear
-// the user hasn't given.
-const glyphMeta: Record<Glyph, { color: string; icon: typeof BadgeCheck }> = {
- accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
- awaiting: { color: cssVar.colorInfo, icon: CircleDashed },
- bad: { color: cssVar.colorError, icon: CircleX },
- closed: { color: cssVar.colorTextTertiary, icon: X },
- repairing: { color: cssVar.colorWarning, icon: RefreshCw },
- running: { color: cssVar.colorInfo, icon: LoaderCircle },
- unsure: { color: cssVar.colorWarning, icon: CircleHelp },
-};
-
-const relativeTime = (value?: Date | string | null) => {
- if (!value) return '';
- const d = dayjs(value);
- return dayjs().diff(d, 'day') < 7 ? d.fromNow() : d.format('MMM D');
-};
-
-/**
- * One acceptance row: the status glyph + title + a hover `…` menu (rename in
- * place, override the decision status, delete). Mirrors the verify workspace's
- * ReportListItem so the two lists manage their entries the same way.
- */
-const AcceptanceRow = memo<{
- active: boolean;
- item: AcceptanceListItem;
- onChanged: () => Promise<unknown> | unknown;
-}>(({ active, item, onChanged }) => {
- const { t } = useTranslation(['verify', 'common']);
-
- const navigate = useNavigate();
- const [editing, setEditing] = useState(false);
- const [mutating, setMutating] = useState(false);
- const isSavingRef = useRef(false);
-
- const glyph = glyphOf(item.status as AcceptanceStatus);
- const meta = glyphMeta[glyph];
- const title = item.subject.title || item.subjectId;
- const [draftTitle, setDraftTitle] = useState(title);
-
- // A rename/status/delete must not leave a stale glyph or header behind β€” the
- // list and the open detail both read the same aggregate.
- const refresh = () =>
- Promise.all([onChanged(), globalMutate(verifyKeys.acceptanceBundle(item.id))]);
-
- const startRename = () => {
- setDraftTitle(title);
- setEditing(true);
- };
-
- const cancelRename = () => {
- if (isSavingRef.current) return;
- setDraftTitle(title);
- setEditing(false);
- };
-
- const commitRename = async () => {
- if (isSavingRef.current) return;
- const next = draftTitle.trim();
- if (!next) {
- toast.error(t('verify:acceptance.workspace.renameEmpty'));
- setDraftTitle(title);
- setEditing(false);
- return;
- }
- if (next === title) {
- setEditing(false);
- return;
- }
- isSavingRef.current = true;
- setMutating(true);
- try {
- await verifyService.renameAcceptance(item.id, next);
- await refresh();
- toast.success(t('verify:acceptance.workspace.renameSuccess'));
- setEditing(false);
- } catch (error) {
- console.error('[acceptance:rename]', error);
- toast.error(t('verify:acceptance.workspace.renameError'));
- } finally {
- isSavingRef.current = false;
- setMutating(false);
- }
- };
-
- const changeStatus = async (status: 'accepted' | 'closed' | 'delivered' | 'rejected') => {
- setMutating(true);
- try {
- await verifyService.updateAcceptanceStatus(item.id, status);
- await refresh();
- toast.success(t('verify:acceptance.workspace.statusSuccess'));
- } catch (error) {
- console.error('[acceptance:status]', error);
- toast.error(t('verify:acceptance.workspace.statusError'));
- } finally {
- setMutating(false);
- }
- };
-
- const removeAcceptance = () => {
- confirmModal({
- cancelText: t('common:cancel'),
- content: t('verify:acceptance.workspace.deleteConfirmDescription', { title }),
- okButtonProps: { danger: true },
- okText: t('common:delete'),
- onOk: async () => {
- setMutating(true);
- try {
- await verifyService.deleteAcceptance(item.id);
- if (active) navigate('/acceptance', { replace: true });
- await onChanged();
- toast.success(t('verify:acceptance.workspace.deleteSuccess'));
- } catch (error) {
- console.error('[acceptance:delete]', error);
- toast.error(t('verify:acceptance.workspace.deleteError'));
- } finally {
- setMutating(false);
- }
- },
- title: t('verify:acceptance.workspace.deleteConfirmTitle'),
- });
- };
-
- // The status actions follow the CURRENT state β€” a settled delivery can be
- // accepted, an already-decided one can be reopened, and any non-closed
- // acceptance can be closed without recording a delivery verdict.
- const statusItems: DropdownItem[] = getAcceptanceStatusActions(item.status).map((action) => {
- if (action === 'accept') {
- return {
- icon: <Icon icon={CircleCheck} />,
- key: action,
- label: t('verify:acceptance.workspace.actions.markAccepted'),
- onClick: () => void changeStatus('accepted'),
- };
- }
- if (action === 'reopen') {
- return {
- icon: <Icon icon={RotateCcw} />,
- key: action,
- label: t('verify:acceptance.workspace.actions.reopen'),
- onClick: () => void changeStatus('delivered'),
- };
- }
- return {
- icon: <Icon icon={X} />,
- key: action,
- label: t('verify:acceptance.workspace.actions.markClosed'),
- onClick: () => void changeStatus('closed'),
- };
- });
-
- const menuItems: DropdownItem[] = [
- {
- icon: <Icon icon={Pencil} />,
- key: 'rename',
- label: t('verify:acceptance.workspace.actions.rename'),
- onClick: startRename,
- },
- ...(statusItems.length > 0
- ? [
- {
- children: statusItems,
- icon: <Icon icon={CircleDashed} />,
- key: 'status',
- label: t('verify:acceptance.workspace.actions.status'),
- },
- { type: 'divider' as const },
- ]
- : []),
- {
- danger: true,
- icon: <Icon icon={Trash2} />,
- key: 'delete',
- label: t('verify:acceptance.workspace.actions.delete'),
- onClick: removeAcceptance,
- },
- ];
-
- // Rename swaps the whole row for an inline input.
- if (editing) {
- return (
- <div className={styles.editRow}>
- <input
- autoFocus
- className={styles.itemTitleInput}
- value={draftTitle}
- onBlur={() => void commitRename()}
- onChange={(e) => setDraftTitle(e.target.value)}
- onFocus={(e) => e.currentTarget.select()}
- onKeyDown={(e) => {
- e.stopPropagation();
- if (e.key === 'Enter') {
- e.preventDefault();
- void commitRename();
- }
- if (e.key === 'Escape') {
- e.preventDefault();
- cancelRename();
- }
- }}
- />
- </div>
- );
- }
-
- return (
- <NavItem
- active={active}
- key={item.id}
- style={mutating ? { opacity: 0.62, pointerEvents: 'none' } : undefined}
- title={title}
- titleColor={cssVar.colorText}
- actions={
- <DropdownMenu
- iconSpaceMode={'group'}
- items={menuItems}
- placement={'bottomRight'}
- popupProps={{ style: { minWidth: 160 } }}
- >
- <ActionIcon
- icon={MoreHorizontal}
- size={'small'}
- title={t('verify:acceptance.workspace.actions.more')}
- />
- </DropdownMenu>
- }
- description={
- <Flexbox horizontal className={styles.itemSub} gap={8}>
- {/* The status glyph already carries the lifecycle state, so the
- second line shows the check count instead of a redundant label. */}
- <span>
- {item.checkCount != null
- ? t('acceptance.workspace.checkCount', { count: item.checkCount })
- : t(`acceptance.status.${item.status}` as any)}
- </span>
- <span>{relativeTime(item.updatedAt ?? item.createdAt)}</span>
- </Flexbox>
- }
- icon={
- <Icon
- className={SPINNING_GLYPHS.has(glyph) ? styles.spin : undefined}
- icon={meta.icon}
- size={16}
- style={{ color: meta.color }}
- />
- }
- onClick={() => navigate(`/acceptance/${item.id}`)}
- />
- );
-});
-
-AcceptanceRow.displayName = 'AcceptanceRow';
-
/**
* Master list of the caller's acceptance aggregates β€” the acceptance twin of
* the verify workspace's ReportListPanel, sharing its visual language and the
diff --git a/src/features/Verify/Acceptance/Workspace/AcceptanceRow.tsx b/src/features/Verify/Acceptance/Workspace/AcceptanceRow.tsx
new file mode 100644
index 00000000000..6b30b4e2cd2
--- /dev/null
+++ b/src/features/Verify/Acceptance/Workspace/AcceptanceRow.tsx
@@ -0,0 +1,338 @@
+'use client';
+
+import type { AcceptanceStatus } from '@lobechat/types';
+import { ActionIcon, Flexbox, Icon } from '@lobehub/ui';
+import type { DropdownItem } from '@lobehub/ui/base-ui';
+import { confirmModal, DropdownMenu, toast } from '@lobehub/ui/base-ui';
+import { createStaticStyles, cssVar } from 'antd-style';
+import dayjs from 'dayjs';
+import {
+ BadgeCheck,
+ CircleCheck,
+ CircleDashed,
+ CircleHelp,
+ CircleX,
+ LoaderCircle,
+ MoreHorizontal,
+ Pencil,
+ RefreshCw,
+ RotateCcw,
+ Trash2,
+ X,
+} from 'lucide-react';
+import { memo, useRef, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate } from 'react-router';
+
+import NavItem from '@/features/NavPanel/components/NavItem';
+import { mutate as globalMutate } from '@/libs/swr';
+import { verifyKeys } from '@/libs/swr/keys';
+import type { AcceptanceListItem } from '@/services/verify';
+import { verifyService } from '@/services/verify';
+
+import { getAcceptanceStatusActions } from '../statusActions';
+
+const styles = createStaticStyles(({ css }) => ({
+ editRow: css`
+ padding-block: 4px;
+ padding-inline: 4px;
+ `,
+ itemSub: css`
+ display: flex;
+ gap: 8px;
+
+ margin-block-start: 2px;
+
+ font-size: 12px;
+ color: ${cssVar.colorTextTertiary};
+ `,
+ itemTitleInput: css`
+ width: 100%;
+ min-width: 0;
+ height: 24px;
+ padding-inline: 6px;
+ border: 1px solid ${cssVar.colorBorder};
+ border-radius: 4px;
+
+ font-size: 13px;
+ color: ${cssVar.colorText};
+
+ background: ${cssVar.colorBgContainer};
+ outline: none;
+
+ &:focus {
+ border-color: ${cssVar.colorPrimary};
+ box-shadow: 0 0 0 2px ${cssVar.colorPrimaryBg};
+ }
+ `,
+ spin: css`
+ animation: acceptance-spin 1.1s linear infinite;
+
+ @keyframes acceptance-spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+ `,
+}));
+
+type Glyph = 'accepted' | 'awaiting' | 'bad' | 'closed' | 'repairing' | 'running' | 'unsure';
+
+const RUNNING_STATUSES = new Set<AcceptanceStatus>([
+ 'pending',
+ 'planned',
+ 'verifying',
+ 'repairing',
+]);
+
+const glyphOf = (status: AcceptanceStatus): Glyph => {
+ if (status === 'repairing') return 'repairing';
+ if (RUNNING_STATUSES.has(status)) return 'running';
+ if (status === 'accepted') return 'accepted';
+ if (status === 'closed') return 'closed';
+ if (status === 'rejected') return 'bad';
+ if (status === 'errored') return 'unsure';
+ return 'awaiting';
+};
+
+const SPINNING_GLYPHS = new Set<Glyph>(['running', 'repairing']);
+
+const glyphMeta: Record<Glyph, { color: string; icon: typeof BadgeCheck }> = {
+ accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
+ awaiting: { color: cssVar.colorInfo, icon: CircleDashed },
+ bad: { color: cssVar.colorError, icon: CircleX },
+ closed: { color: cssVar.colorTextTertiary, icon: X },
+ repairing: { color: cssVar.colorWarning, icon: RefreshCw },
+ running: { color: cssVar.colorInfo, icon: LoaderCircle },
+ unsure: { color: cssVar.colorWarning, icon: CircleHelp },
+};
+
+const relativeTime = (value?: Date | string | null) => {
+ if (!value) return '';
+ const d = dayjs(value);
+ return dayjs().diff(d, 'day') < 7 ? d.fromNow() : d.format('MMM D');
+};
+
+/** Extracted desktop row, keeping the list panel focused on layout and filtering. */
+const AcceptanceRow = memo<{
+ active: boolean;
+ item: AcceptanceListItem;
+ onChanged: () => Promise<unknown> | unknown;
+}>(({ active, item, onChanged }) => {
+ const { t } = useTranslation(['verify', 'common']);
+ const navigate = useNavigate();
+ const [editing, setEditing] = useState(false);
+ const [mutating, setMutating] = useState(false);
+ const isSavingRef = useRef(false);
+
+ const glyph = glyphOf(item.status as AcceptanceStatus);
+ const meta = glyphMeta[glyph];
+ const title = item.subject.title || item.subjectId;
+ const [draftTitle, setDraftTitle] = useState(title);
+
+ const refresh = () =>
+ Promise.all([onChanged(), globalMutate(verifyKeys.acceptanceBundle(item.id))]);
+
+ const startRename = () => {
+ setDraftTitle(title);
+ setEditing(true);
+ };
+
+ const cancelRename = () => {
+ if (isSavingRef.current) return;
+ setDraftTitle(title);
+ setEditing(false);
+ };
+
+ const commitRename = async () => {
+ if (isSavingRef.current) return;
+ const next = draftTitle.trim();
+ if (!next) {
+ toast.error(t('verify:acceptance.workspace.renameEmpty'));
+ setDraftTitle(title);
+ setEditing(false);
+ return;
+ }
+ if (next === title) {
+ setEditing(false);
+ return;
+ }
+ isSavingRef.current = true;
+ setMutating(true);
+ try {
+ await verifyService.renameAcceptance(item.id, next);
+ await refresh();
+ toast.success(t('verify:acceptance.workspace.renameSuccess'));
+ setEditing(false);
+ } catch (error) {
+ console.error('[acceptance:rename]', error);
+ toast.error(t('verify:acceptance.workspace.renameError'));
+ } finally {
+ isSavingRef.current = false;
+ setMutating(false);
+ }
+ };
+
+ const changeStatus = async (status: 'accepted' | 'closed' | 'delivered' | 'rejected') => {
+ setMutating(true);
+ try {
+ await verifyService.updateAcceptanceStatus(item.id, status);
+ await refresh();
+ toast.success(t('verify:acceptance.workspace.statusSuccess'));
+ } catch (error) {
+ console.error('[acceptance:status]', error);
+ toast.error(t('verify:acceptance.workspace.statusError'));
+ } finally {
+ setMutating(false);
+ }
+ };
+
+ const removeAcceptance = () => {
+ confirmModal({
+ cancelText: t('common:cancel'),
+ content: t('verify:acceptance.workspace.deleteConfirmDescription', { title }),
+ okButtonProps: { danger: true },
+ okText: t('common:delete'),
+ onOk: async () => {
+ setMutating(true);
+ try {
+ await verifyService.deleteAcceptance(item.id);
+ if (active) navigate('/acceptance', { replace: true });
+ await onChanged();
+ toast.success(t('verify:acceptance.workspace.deleteSuccess'));
+ } catch (error) {
+ console.error('[acceptance:delete]', error);
+ toast.error(t('verify:acceptance.workspace.deleteError'));
+ } finally {
+ setMutating(false);
+ }
+ },
+ title: t('verify:acceptance.workspace.deleteConfirmTitle'),
+ });
+ };
+
+ const statusItems: DropdownItem[] = getAcceptanceStatusActions(item.status).map((action) => {
+ if (action === 'accept') {
+ return {
+ icon: <Icon icon={CircleCheck} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markAccepted'),
+ onClick: () => void changeStatus('accepted'),
+ };
+ }
+ if (action === 'reopen') {
+ return {
+ icon: <Icon icon={RotateCcw} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.reopen'),
+ onClick: () => void changeStatus('delivered'),
+ };
+ }
+ return {
+ icon: <Icon icon={X} />,
+ key: action,
+ label: t('verify:acceptance.workspace.actions.markClosed'),
+ onClick: () => void changeStatus('closed'),
+ };
+ });
+
+ const menuItems: DropdownItem[] = [
+ {
+ icon: <Icon icon={Pencil} />,
+ key: 'rename',
+ label: t('verify:acceptance.workspace.actions.rename'),
+ onClick: startRename,
+ },
+ ...(statusItems.length > 0
+ ? [
+ {
+ children: statusItems,
+ icon: <Icon icon={CircleDashed} />,
+ key: 'status',
+ label: t('verify:acceptance.workspace.actions.status'),
+ },
+ { type: 'divider' as const },
+ ]
+ : []),
+ {
+ danger: true,
+ icon: <Icon icon={Trash2} />,
+ key: 'delete',
+ label: t('verify:acceptance.workspace.actions.delete'),
+ onClick: removeAcceptance,
+ },
+ ];
+
+ if (editing) {
+ return (
+ <div className={styles.editRow}>
+ <input
+ autoFocus
+ className={styles.itemTitleInput}
+ value={draftTitle}
+ onBlur={() => void commitRename()}
+ onChange={(event) => setDraftTitle(event.target.value)}
+ onFocus={(event) => event.currentTarget.select()}
+ onKeyDown={(event) => {
+ event.stopPropagation();
+ if (event.key === 'Enter') {
+ event.preventDefault();
+ void commitRename();
+ }
+ if (event.key === 'Escape') {
+ event.preventDefault();
+ cancelRename();
+ }
+ }}
+ />
+ </div>
+ );
+ }
+
+ return (
+ <NavItem
+ active={active}
+ key={item.id}
+ style={mutating ? { opacity: 0.62, pointerEvents: 'none' } : undefined}
+ title={title}
+ titleColor={cssVar.colorText}
+ actions={
+ <DropdownMenu
+ iconSpaceMode={'group'}
+ items={menuItems}
+ placement={'bottomRight'}
+ popupProps={{ style: { minWidth: 160 } }}
+ >
+ <ActionIcon
+ icon={MoreHorizontal}
+ size={'small'}
+ title={t('verify:acceptance.workspace.actions.more')}
+ />
+ </DropdownMenu>
+ }
+ description={
+ <Flexbox horizontal className={styles.itemSub} gap={8}>
+ <span>
+ {item.checkCount != null
+ ? t('acceptance.workspace.checkCount', { count: item.checkCount })
+ : t(`acceptance.status.${item.status}` as any)}
+ </span>
+ <span>{relativeTime(item.updatedAt ?? item.createdAt)}</span>
+ </Flexbox>
+ }
+ icon={
+ <Icon
+ className={SPINNING_GLYPHS.has(glyph) ? styles.spin : undefined}
+ icon={meta.icon}
+ size={16}
+ style={{ color: meta.color }}
+ />
+ }
+ onClick={() => navigate(`/acceptance/${item.id}`)}
+ />
+ );
+});
+
+AcceptanceRow.displayName = 'AcceptanceRow';
+
+export default AcceptanceRow;
diff --git a/src/features/Verify/Acceptance/index.tsx b/src/features/Verify/Acceptance/index.tsx
index 75e222bfe9c..4910355bd62 100644
--- a/src/features/Verify/Acceptance/index.tsx
+++ b/src/features/Verify/Acceptance/index.tsx
@@ -413,9 +413,13 @@ const AcceptancePage = memo<AcceptancePageProps>(
}, [isNarrowViewport]);
// A focused check is the review workspace: evidence gets the horizontal
// room, while the round ledger remains available from the corner toggle.
- useEffect(() => {
+ // Adjusted during render, not in an effect, so selecting a check commits in
+ // one render pass instead of render β†’ effect β†’ full second render.
+ const [prevFocusedCheckId, setPrevFocusedCheckId] = useState(focusedCheckId);
+ if (prevFocusedCheckId !== focusedCheckId) {
+ setPrevFocusedCheckId(focusedCheckId);
if (focusedCheckId) setLedgerExpand(false);
- }, [focusedCheckId]);
+ }
const closeTopicPanel = useCallback(() => {
setTopicPanelOpen(false);
closeTopicDrawer();
@@ -534,6 +538,110 @@ const AcceptancePage = memo<AcceptancePageProps>(
};
}, [data]);
+ const acceptanceRecordId = data?.acceptance.id;
+ const runAction = useCallback(
+ async (action: () => Promise<unknown>) => {
+ try {
+ setPending(true);
+ setActionError(undefined);
+ await action();
+ await mutate();
+ // The list panel derives its glyph from the same status β€” a decision
+ // here must not leave a stale icon there until a hard refresh.
+ void globalMutate(verifyKeys.acceptances());
+ return true;
+ } catch (cause) {
+ setActionError(cause instanceof Error ? cause.message : t('acceptance.actionError'));
+ return false;
+ } finally {
+ setPending(false);
+ }
+ },
+ [mutate, t],
+ );
+
+ // Per-check user review β€” accept settles a check for good; reject records
+ // the feedback the next verify round reads.
+ const handleReview = useCallback(
+ async (input: CheckReviewInput) => {
+ if (!acceptanceRecordId) return false;
+ return runAction(() => verifyService.reviewChecks({ id: acceptanceRecordId, ...input }));
+ },
+ [runAction, acceptanceRecordId],
+ );
+
+ // Group-scoped feedback β€” for concerns that belong to no single check (the
+ // checks themselves may be accepted) yet must reach the next round.
+ const handleGroupFeedback = useCallback(
+ async (category: string, comment: string, fileIds: string[]) => {
+ if (!acceptanceRecordId) return false;
+ return runAction(() =>
+ verifyService.addGroupFeedback({
+ category,
+ comment,
+ fileIds: fileIds.length > 0 ? fileIds : undefined,
+ id: acceptanceRecordId,
+ }),
+ );
+ },
+ [runAction, acceptanceRecordId],
+ );
+
+ const gotoRound = useCallback((round: number) => {
+ setHighlightRound(round);
+ setLedgerExpand(true);
+ }, []);
+ const historyNavigation = useMemo(
+ () => resolveAcceptanceHistoryNavigation(Boolean(data?.isOwner), gotoRound),
+ [data?.isOwner, gotoRound],
+ );
+
+ const handleToggleGroup = useCallback(
+ (key: string) =>
+ setCollapsedGroups((previous) => {
+ const next = new Set(previous);
+ if (next.has(key)) next.delete(key);
+ else next.add(key);
+ return next;
+ }),
+ [setCollapsedGroups],
+ );
+ const handleToggleGroupItems = useCallback(
+ (ids: string[], open: boolean) =>
+ setExpanded((previous) => {
+ const next = new Set(previous);
+ for (const id of ids) {
+ if (open) next.add(id);
+ else next.delete(id);
+ }
+ return next;
+ }),
+ [setExpanded],
+ );
+ const handleToggleItem = useCallback(
+ (id: string) =>
+ setExpanded((previous) => {
+ const next = new Set(previous);
+ if (next.has(id)) next.delete(id);
+ else next.add(id);
+ return next;
+ }),
+ [setExpanded],
+ );
+
+ // Group-scoped feedback lives on each round's decision detail β€” flatten the
+ // chain into the derived per-entry view (roundIndex from the carrying run).
+ const groupFeedbackEntries = useMemo(
+ () =>
+ (data?.rounds ?? []).flatMap((round) =>
+ (round.run.decisionDetail?.groupFeedback ?? []).map((entry) => ({
+ ...entry,
+ roundIndex: round.run.roundIndex ?? 0,
+ })),
+ ),
+ [data],
+ );
+
if (isLoading)
return (
<Center height={'100%'}>
@@ -592,14 +700,6 @@ const AcceptancePage = memo<AcceptancePageProps>(
);
};
const currentRound = rounds.at(-1);
- // Group-scoped feedback lives on each round's decision detail β€” flatten the
- // chain into the derived per-entry view (roundIndex from the carrying run).
- const groupFeedbackEntries = rounds.flatMap((round) =>
- (round.run.decisionDetail?.groupFeedback ?? []).map((entry) => ({
- ...entry,
- roundIndex: round.run.roundIndex ?? 0,
- })),
- );
// The latest coding round's context β€” rendered with the latest report card
// (it describes what THAT round verified), not as aggregate-level identity.
// A round with no scenario predates the column and is a coding round; a
@@ -690,24 +790,6 @@ const AcceptancePage = memo<AcceptancePageProps>(
label: t('acceptance.verdict.inProgress'),
};
- const runAction = async (action: () => Promise<unknown>) => {
- try {
- setPending(true);
- setActionError(undefined);
- await action();
- await mutate();
- // The list panel derives its glyph from the same status β€” a decision
- // here must not leave a stale icon there until a hard refresh.
- void globalMutate(verifyKeys.acceptances());
- return true;
- } catch (cause) {
- setActionError(cause instanceof Error ? cause.message : t('acceptance.actionError'));
- return false;
- } finally {
- setPending(false);
- }
- };
-
const changeAcceptanceStatus = async (status: 'accepted' | 'closed' | 'delivered') => {
const succeeded = await runAction(() =>
verifyService.updateAcceptanceStatus(acceptance.id, status),
@@ -746,12 +828,6 @@ const AcceptancePage = memo<AcceptancePageProps>(
},
);
- const gotoRound = (round: number) => {
- setHighlightRound(round);
- setLedgerExpand(true);
- };
- const historyNavigation = resolveAcceptanceHistoryNavigation(isOwner, gotoRound);
-
// Open/close the round report drawer AND mirror it to `?r=` (standalone
// page only) so the address bar is always a copyable snapshot link for the
// round being viewed.
@@ -769,11 +845,6 @@ const AcceptancePage = memo<AcceptancePageProps>(
);
};
- // Per-check user review β€” accept settles a check for good; reject records
- // the feedback the next verify round reads.
- const handleReview = (input: CheckReviewInput) =>
- runAction(() => verifyService.reviewChecks({ id: acceptance.id, ...input }));
-
// The acceptance goal is a user-editable field β€” reuse the tray's goal
// modal so both entry points write the same subject-level requirement. A
// failed save is toasted here and rethrown so the modal stays open with
@@ -792,18 +863,6 @@ const AcceptancePage = memo<AcceptancePageProps>(
},
});
- // Group-scoped feedback β€” for concerns that belong to no single check (the
- // checks themselves may be accepted) yet must reach the next round.
- const handleGroupFeedback = (category: string, comment: string, fileIds: string[]) =>
- runAction(() =>
- verifyService.addGroupFeedback({
- category,
- comment,
- fileIds: fileIds.length > 0 ? fileIds : undefined,
- id: acceptance.id,
- }),
- );
-
// The floating bar's one-line state + supporting line β€” the old banner's
// content, relocated to where the decision actually happens.
const barState = LIVE_STATUSES.has(acceptance.status)
@@ -1731,32 +1790,9 @@ const AcceptancePage = memo<AcceptancePageProps>(
onGroupFeedback={handleGroupFeedback}
onReview={handleReview}
onRound={historyNavigation}
- onToggleGroup={(key) =>
- setCollapsedGroups((previous) => {
- const next = new Set(previous);
- if (next.has(key)) next.delete(key);
- else next.add(key);
- return next;
- })
- }
- onToggleGroupItems={(ids, open) =>
- setExpanded((previous) => {
- const next = new Set(previous);
- for (const id of ids) {
- if (open) next.add(id);
- else next.delete(id);
- }
- return next;
- })
- }
- onToggleItem={(id) =>
- setExpanded((previous) => {
- const next = new Set(previous);
- if (next.has(id)) next.delete(id);
- else next.add(id);
- return next;
- })
- }
+ onToggleGroup={handleToggleGroup}
+ onToggleGroupItems={handleToggleGroupItems}
+ onToggleItem={handleToggleItem}
/>
</>
)}
diff --git a/src/features/WorkbenchShell/WorkbenchLoading.tsx b/src/features/WorkbenchShell/WorkbenchLoading.tsx
new file mode 100644
index 00000000000..e157b47127b
--- /dev/null
+++ b/src/features/WorkbenchShell/WorkbenchLoading.tsx
@@ -0,0 +1,36 @@
+import { createStaticStyles, cssVar } from 'antd-style';
+
+const styles = createStaticStyles(({ css }) => ({
+ container: css`
+ display: flex;
+ align-items: center;
+ justify-content: center;
+
+ width: 100%;
+ height: 100%;
+ min-height: 96px;
+ `,
+ spinner: css`
+ width: 28px;
+ height: 28px;
+ border: 2px solid ${cssVar.colorFillSecondary};
+ border-block-start-color: ${cssVar.colorTextSecondary};
+ border-radius: 50%;
+
+ animation: workbench-spin 0.8s linear infinite;
+
+ @keyframes workbench-spin {
+ to {
+ transform: rotate(360deg);
+ }
+ }
+ `,
+}));
+
+const WorkbenchLoading = () => (
+ <div className={styles.container}>
+ <span aria-label={'Loading'} className={styles.spinner} role={'status'} />
+ </div>
+);
+
+export default WorkbenchLoading;
diff --git a/src/features/WorkbenchShell/WorkbenchLocale.tsx b/src/features/WorkbenchShell/WorkbenchLocale.tsx
new file mode 100644
index 00000000000..37cddba9eb1
--- /dev/null
+++ b/src/features/WorkbenchShell/WorkbenchLocale.tsx
@@ -0,0 +1,78 @@
+'use client';
+
+import { ConfigProvider } from 'antd';
+import dayjs from 'dayjs';
+import { memo, type PropsWithChildren, useEffect, useState } from 'react';
+import { isRtlLang } from 'rtl-detect';
+
+import type { DayjsLocaleGlobEntry } from '@/utils/dayjsLocale';
+import { loadDayjsLocaleModule, normalizeDayjsLocale } from '@/utils/dayjsLocale';
+import { getAntdLocale } from '@/utils/locale';
+
+import { createWorkbenchI18n } from './createWorkbenchI18n';
+
+const dayjsLocaleLoaders: Record<string, DayjsLocaleGlobEntry> = {
+ 'ar': () => import('dayjs/locale/ar'),
+ 'bg': () => import('dayjs/locale/bg'),
+ 'de': () => import('dayjs/locale/de'),
+ 'en': () => import('dayjs/locale/en'),
+ 'es': () => import('dayjs/locale/es'),
+ 'fa': () => import('dayjs/locale/fa'),
+ 'fr': () => import('dayjs/locale/fr'),
+ 'it': () => import('dayjs/locale/it'),
+ 'ja': () => import('dayjs/locale/ja'),
+ 'ko': () => import('dayjs/locale/ko'),
+ 'nl': () => import('dayjs/locale/nl'),
+ 'pl': () => import('dayjs/locale/pl'),
+ 'pt-br': () => import('dayjs/locale/pt-br'),
+ 'ru': () => import('dayjs/locale/ru'),
+ 'tr': () => import('dayjs/locale/tr'),
+ 'vi': () => import('dayjs/locale/vi'),
+ 'zh-cn': () => import('dayjs/locale/zh-cn'),
+ 'zh-tw': () => import('dayjs/locale/zh-tw'),
+};
+
+const updateDayjs = async (lang: string) => {
+ const locale = normalizeDayjsLocale(lang);
+ const loader = dayjsLocaleLoaders[locale] ?? dayjsLocaleLoaders.en;
+ const mod = await loadDayjsLocaleModule(loader!);
+
+ dayjs.locale(mod.default);
+};
+
+interface WorkbenchLocaleProps extends PropsWithChildren {
+ defaultLang?: string;
+}
+
+const WorkbenchLocale = memo<WorkbenchLocaleProps>(({ children, defaultLang }) => {
+ const [i18n] = useState(() => createWorkbenchI18n(defaultLang));
+ const [lang, setLang] = useState(defaultLang ?? 'en-US');
+ const [antdLocale, setAntdLocale] = useState<any>();
+
+ if (!i18n.instance.isInitialized) void i18n.init();
+
+ useEffect(() => {
+ const applyLocale = async (nextLang: string) => {
+ setLang(nextLang);
+ const [nextAntdLocale] = await Promise.all([getAntdLocale(nextLang), updateDayjs(nextLang)]);
+ setAntdLocale(nextAntdLocale);
+ };
+
+ void applyLocale(i18n.instance.language || defaultLang || 'en-US');
+ i18n.instance.on('languageChanged', applyLocale);
+
+ return () => {
+ i18n.instance.off('languageChanged', applyLocale);
+ };
+ }, [defaultLang, i18n]);
+
+ return (
+ <ConfigProvider direction={isRtlLang(lang) ? 'rtl' : 'ltr'} locale={antdLocale}>
+ {children}
+ </ConfigProvider>
+ );
+});
+
+WorkbenchLocale.displayName = 'WorkbenchLocale';
+
+export default WorkbenchLocale;
diff --git a/src/features/WorkbenchShell/WorkbenchNamespace.tsx b/src/features/WorkbenchShell/WorkbenchNamespace.tsx
new file mode 100644
index 00000000000..d54f3ba95ee
--- /dev/null
+++ b/src/features/WorkbenchShell/WorkbenchNamespace.tsx
@@ -0,0 +1,36 @@
+'use client';
+
+import { memo, type PropsWithChildren } from 'react';
+import { useTranslation } from 'react-i18next';
+
+import WorkbenchLoading from './WorkbenchLoading';
+
+interface WorkbenchNamespaceProps extends PropsWithChildren {
+ namespace: 'verify';
+}
+
+const WorkbenchNamespace = memo<WorkbenchNamespaceProps>(({ children, namespace }) => {
+ const { ready } = useTranslation(namespace);
+
+ if (!ready) {
+ return (
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ height: '100dvh',
+ justifyContent: 'center',
+ width: '100%',
+ }}
+ >
+ <WorkbenchLoading />
+ </div>
+ );
+ }
+
+ return children;
+});
+
+WorkbenchNamespace.displayName = 'WorkbenchNamespace';
+
+export default WorkbenchNamespace;
diff --git a/src/features/WorkbenchShell/WorkbenchShell.tsx b/src/features/WorkbenchShell/WorkbenchShell.tsx
new file mode 100644
index 00000000000..48f99ea8123
--- /dev/null
+++ b/src/features/WorkbenchShell/WorkbenchShell.tsx
@@ -0,0 +1,38 @@
+'use client';
+
+import { ModalHost, ToastHost, TooltipGroup } from '@lobehub/ui/base-ui';
+import { StyleProvider } from 'antd-style';
+import { memo, type PropsWithChildren } from 'react';
+
+import { ServerConfigStoreProvider } from '@/store/serverConfig/Provider';
+import type { SPAServerConfig } from '@/types/spaServerConfig';
+
+import WorkbenchLocale from './WorkbenchLocale';
+import WorkbenchTheme from './WorkbenchTheme';
+
+const WorkbenchShell = memo<PropsWithChildren>(({ children }) => {
+ const serverConfig: SPAServerConfig | undefined = window.__SERVER_CONFIG__;
+ const locale = document.documentElement.lang || 'en-US';
+
+ return (
+ <WorkbenchLocale defaultLang={locale}>
+ <WorkbenchTheme>
+ <ServerConfigStoreProvider
+ isMobile
+ featureFlags={serverConfig?.featureFlags}
+ serverConfig={serverConfig?.config}
+ >
+ <TooltipGroup layoutAnimation={false}>
+ <StyleProvider speedy={import.meta.env.PROD}>{children}</StyleProvider>
+ </TooltipGroup>
+ <ModalHost />
+ <ToastHost />
+ </ServerConfigStoreProvider>
+ </WorkbenchTheme>
+ </WorkbenchLocale>
+ );
+});
+
+WorkbenchShell.displayName = 'WorkbenchShell';
+
+export default WorkbenchShell;
diff --git a/src/features/WorkbenchShell/WorkbenchTheme.tsx b/src/features/WorkbenchShell/WorkbenchTheme.tsx
new file mode 100644
index 00000000000..d4068e86e4b
--- /dev/null
+++ b/src/features/WorkbenchShell/WorkbenchTheme.tsx
@@ -0,0 +1,42 @@
+'use client';
+
+import 'antd/dist/reset.css';
+
+import ConfigProvider from '@lobehub/ui/es/ConfigProvider/index';
+import ThemeProvider from '@lobehub/ui/es/ThemeProvider/index';
+import { App } from 'antd';
+import { domMax, LazyMotion } from 'motion/react';
+import * as m from 'motion/react-m';
+import { memo, type PropsWithChildren } from 'react';
+
+import AntdStaticMethods from '@/components/AntdStaticMethods';
+import { useIsDark } from '@/hooks/useIsDark';
+import Image from '@/libs/next/Image';
+import Link from '@/libs/next/Link';
+
+const WorkbenchTheme = memo<PropsWithChildren>(({ children }) => {
+ const isDark = useIsDark();
+ const appearance = isDark ? 'dark' : 'light';
+
+ return (
+ <ThemeProvider
+ appearance={appearance}
+ className={'workbench-layout'}
+ defaultAppearance={appearance}
+ defaultThemeMode={appearance}
+ style={{ height: '100%', minHeight: '100dvh', width: '100%' }}
+ theme={{ cssVar: { key: 'lobe-vars' } }}
+ >
+ <App style={{ height: '100%' }}>
+ <AntdStaticMethods />
+ <ConfigProvider config={{ aAs: Link, imgAs: Image, imgUnoptimized: true }} motion={m}>
+ <LazyMotion features={domMax}>{children}</LazyMotion>
+ </ConfigProvider>
+ </App>
+ </ThemeProvider>
+ );
+});
+
+WorkbenchTheme.displayName = 'WorkbenchTheme';
+
+export default WorkbenchTheme;
diff --git a/src/features/WorkbenchShell/createWorkbenchI18n.ts b/src/features/WorkbenchShell/createWorkbenchI18n.ts
new file mode 100644
index 00000000000..37390d97a0e
--- /dev/null
+++ b/src/features/WorkbenchShell/createWorkbenchI18n.ts
@@ -0,0 +1,60 @@
+import i18next from 'i18next';
+import resourcesToBackend from 'i18next-resources-to-backend';
+import { initReactI18next } from 'react-i18next';
+
+import { DEFAULT_LANG } from '@/const/locale';
+import defaultCommon from '@/locales/default/common';
+import defaultError from '@/locales/default/error';
+import { normalizeLocale } from '@/locales/resources';
+import { unwrapESMModule } from '@/utils/esm/unwrapESMModule';
+import { loadI18nNamespaceModule } from '@/utils/i18n/loadI18nNamespaceModule';
+
+const defaultResources = {
+ common: defaultCommon,
+ error: defaultError,
+};
+
+const loadWorkbenchNamespace = async (lng: string, ns: string) => {
+ const locale = normalizeLocale(lng);
+
+ if (locale === DEFAULT_LANG && ns in defaultResources) {
+ return defaultResources[ns as keyof typeof defaultResources];
+ }
+
+ return unwrapESMModule(
+ await loadI18nNamespaceModule({
+ defaultLang: DEFAULT_LANG,
+ lng: locale,
+ normalizeLocale,
+ ns,
+ }),
+ );
+};
+
+export const createWorkbenchI18n = (lang?: string) => {
+ const instance = i18next
+ .createInstance()
+ .use(initReactI18next)
+ .use(resourcesToBackend(loadWorkbenchNamespace));
+
+ return {
+ init: (params: { initAsync?: boolean } = {}) =>
+ instance.init({
+ defaultNS: ['common', 'error'],
+ fallbackLng: DEFAULT_LANG,
+ initAsync: params.initAsync ?? true,
+ interpolation: { escapeValue: false },
+ keySeparator: false,
+ lng: normalizeLocale(lang),
+ ns: [],
+ partialBundledLanguages: true,
+ react: {
+ bindI18nStore: 'added',
+ useSuspense: false,
+ },
+ resources: { [DEFAULT_LANG]: defaultResources },
+ showSupportNotice: false,
+ }),
+ instance,
+ };
+};
diff --git a/src/features/WorkbenchShell/index.ts b/src/features/WorkbenchShell/index.ts
new file mode 100644
index 00000000000..a50d9733654
--- /dev/null
+++ b/src/features/WorkbenchShell/index.ts
@@ -0,0 +1,2 @@
+export { default as WorkbenchNamespace } from './WorkbenchNamespace';
+export { default } from './WorkbenchShell';
diff --git a/src/features/Workspace/useWorkspaceAwareNavigate.ts b/src/features/Workspace/useWorkspaceAwareNavigate.ts
index e64e99162e5..f052827d4c9 100644
--- a/src/features/Workspace/useWorkspaceAwareNavigate.ts
+++ b/src/features/Workspace/useWorkspaceAwareNavigate.ts
@@ -4,6 +4,7 @@ import { useCallback } from 'react';
import { type NavigateFunction, type NavigateOptions, type To, useNavigate } from 'react-router';
import { getActiveWorkspaceSlug } from '@/business/client/hooks/useActiveWorkspaceSlug';
+import { shouldHardNavigateToWorkbench } from '@/libs/next/workbenchNavigation';
import { buildWorkspaceAwarePath, type WorkspaceAwareNavigateOptions } from './workspaceAwarePath';
@@ -43,6 +44,10 @@ export const useWorkspaceAwareNavigate = (): WorkspaceAwareNavigateFunction => {
const target = buildWorkspaceAwarePath(to, getActiveWorkspaceSlug(), options);
const { escape: _escape, ...rest } = options ?? {};
void _escape;
+ if (shouldHardNavigateToWorkbench(target)) {
+ window.location.assign(target);
+ return;
+ }
// Stay a transparent drop-in for `useNavigate`: only forward a second arg
// when real react-router options remain, so `navigate(path)` calls don't
// turn into `navigate(path, {})`.
diff --git a/src/libs/next/Link.tsx b/src/libs/next/Link.tsx
index 90491f1396c..0b0617b98a7 100644
--- a/src/libs/next/Link.tsx
+++ b/src/libs/next/Link.tsx
@@ -7,6 +7,7 @@ import { type AnchorHTMLAttributes } from 'react';
import { Link as RRLink } from 'react-router';
import { authSpaRoutes, nextjsOnlyRoutes } from './nextjsOnlyRoutes';
+import { shouldHardNavigateToWorkbench } from './workbenchNavigation';
export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
href: string;
@@ -29,12 +30,12 @@ const Link = ({
ref,
href,
replace,
- prefetch,
- scroll,
+ prefetch: _prefetch,
+ scroll: _scroll,
children,
...rest
}: LinkProps & { ref?: React.RefObject<HTMLAnchorElement | null> }) => {
- if (isExternalOrNextOnly(href)) {
+ if (isExternalOrNextOnly(href) || shouldHardNavigateToWorkbench(href)) {
return (
<a href={href} ref={ref} {...rest}>
{children}
diff --git a/src/libs/next/proxy/define-config.test.ts b/src/libs/next/proxy/define-config.test.ts
index 33f03cc6569..37db814cbad 100644
--- a/src/libs/next/proxy/define-config.test.ts
+++ b/src/libs/next/proxy/define-config.test.ts
@@ -12,11 +12,16 @@ vi.mock('@/auth', () => ({
const { middleware } = defineConfig();
-const run = async (url: string) => {
- const res = await middleware(new NextRequest(url));
+const run = async (url: string, userAgent?: string) => {
+ const res = await middleware(
+ new NextRequest(url, userAgent ? { headers: { 'user-agent': userAgent } } : undefined),
+ );
return res?.headers.get('x-middleware-rewrite');
};
+const MOBILE_USER_AGENT =
+ 'Mozilla/5.0 (iPhone; CPU iPhone OS 17_0 like Mac OS X) AppleWebKit/605.1.15 Mobile/15E148 Safari/604.1';
+
describe('defineConfig locale path-traversal hardening', () => {
it('rewrites a normal locale into /spa-auth/<locale>', async () => {
const rewrite = await run('http://localhost:3010/signin?hl=ja-JP');
@@ -46,3 +51,31 @@ describe('defineConfig locale path-traversal hardening', () => {
);
});
});
+
+describe('defineConfig Workbench SPA rewrite', () => {
+ it('routes Workbench-owned paths only for mobile devices', async () => {
+ const mobileAcceptance = await run(
+ 'http://localhost:3010/acceptance/acceptance-1?hl=en-US',
+ MOBILE_USER_AGENT,
+ );
+ const desktopAcceptance = await run('http://localhost:3010/acceptance/acceptance-1?hl=en-US');
+
+ expect(new URL(mobileAcceptance!).pathname).toBe(
+ '/spa-workbench/en-US/acceptance/acceptance-1',
+ );
+ expect(new URL(desktopAcceptance!).pathname).toMatch(
+ /^\/spa\/[^/]+\/acceptance\/acceptance-1$/,
+ );
+ });
+
+ it('keeps the agent documents index in the Main Mobile SPA', async () => {
+ const detail = await run(
+ 'http://localhost:3010/agent/agt_1/docs/doc_1?hl=en-US',
+ MOBILE_USER_AGENT,
+ );
+ const index = await run('http://localhost:3010/agent/agt_1/docs?hl=en-US', MOBILE_USER_AGENT);
+
+ expect(new URL(detail!).pathname).toBe('/spa-workbench/en-US/agent/agt_1/docs/doc_1');
+ expect(new URL(index!).pathname).toMatch(/^\/spa\/[^/]+\/agent\/agt_1\/docs$/);
+ });
+});
diff --git a/src/libs/next/proxy/define-config.ts b/src/libs/next/proxy/define-config.ts
index f07bb66e059..20366a4e1f6 100644
--- a/src/libs/next/proxy/define-config.ts
+++ b/src/libs/next/proxy/define-config.ts
@@ -13,6 +13,7 @@ import { parseBrowserLanguage } from '@/utils/locale';
import { DEFAULT_LANG, locales, RouteVariants } from '@/utils/server/routeVariants';
import { authSpaRoutes, nextjsOnlyRoutes } from '../nextjsOnlyRoutes';
+import { isWorkbenchSpaRoute } from '../workbenchRoutes';
import { createRouteMatcher } from './createRouteMatcher';
// Create debug logger instances
@@ -145,6 +146,17 @@ export function defineConfig() {
return response;
}
+ if (device.type === 'mobile' && isWorkbenchSpaRoute(url.pathname)) {
+ const workbenchPath = `/spa-workbench/${safeLocale}${url.pathname}`;
+ logDefault('Workbench SPA route, rewriting to: %s', workbenchPath);
+ url.pathname = workbenchPath;
+
+ const response = NextResponse.rewrite(url);
+ persistLocaleCookie(response, request, explicitlyLocale);
+
+ return response;
+ }
+
const isNextjsRoute = nextjsOnlyRoutes.some((r) => url.pathname.startsWith(r));
// SPA routes: rewrite to /spa/[variants]/[...path] catch-all
diff --git a/src/libs/next/workbenchNavigation.ts b/src/libs/next/workbenchNavigation.ts
new file mode 100644
index 00000000000..cdcf4d8e126
--- /dev/null
+++ b/src/libs/next/workbenchNavigation.ts
@@ -0,0 +1,11 @@
+import { isWorkbenchSpaRoute } from './workbenchRoutes';
+
+/**
+ * Main Mobile SPA routes that cross into the independent Workbench runtime must
+ * perform a document navigation. Inside Workbench, React Router remains local.
+ */
+export const shouldHardNavigateToWorkbench = (pathname: string): boolean =>
+ typeof __MOBILE__ !== 'undefined' &&
+ __MOBILE__ &&
+ (typeof __WORKBENCH__ === 'undefined' || !__WORKBENCH__) &&
+ isWorkbenchSpaRoute(pathname);
diff --git a/src/libs/next/workbenchRoutes.test.ts b/src/libs/next/workbenchRoutes.test.ts
new file mode 100644
index 00000000000..396f715fcb5
--- /dev/null
+++ b/src/libs/next/workbenchRoutes.test.ts
@@ -0,0 +1,28 @@
+import { describe, expect, it } from 'vitest';
+
+import { isWorkbenchSpaRoute } from './workbenchRoutes';
+
+describe('isWorkbenchSpaRoute', () => {
+ it.each([
+ '/agent/agt_9GOn6nUgGw35/docs/TWuw2YunjhwLblZ7',
+ '/agent/agt_9GOn6nUgGw35/docs/TWuw2YunjhwLblZ7/',
+ '/acceptance',
+ '/acceptance/',
+ '/acceptance/acceptance-1',
+ '/acceptance/acceptance-1?round=2',
+ '/acceptance/acceptance-1/check/check-1',
+ ])('matches a Workbench-owned route: %s', (pathname) => {
+ expect(isWorkbenchSpaRoute(pathname)).toBe(true);
+ });
+
+ it.each([
+ '/agent/agt_9GOn6nUgGw35',
+ '/agent/agt_9GOn6nUgGw35/docs',
+ '/agent/agt_9GOn6nUgGw35/docs/doc-1/history',
+ '/acceptance-preview',
+ '/acceptance/acceptance-1/history',
+ '/workspace/acceptance/acceptance-1',
+ ])('does not broaden ownership beyond the declared routes: %s', (pathname) => {
+ expect(isWorkbenchSpaRoute(pathname)).toBe(false);
+ });
+});
diff --git a/src/libs/next/workbenchRoutes.ts b/src/libs/next/workbenchRoutes.ts
new file mode 100644
index 00000000000..e5f2d9c0df9
--- /dev/null
+++ b/src/libs/next/workbenchRoutes.ts
@@ -0,0 +1,9 @@
+const AGENT_DOCUMENT_ROUTE = /^\/agent\/[^/]+\/docs\/[^/]+\/?$/;
+const ACCEPTANCE_ROUTE = /^\/acceptance(?:\/[^/]+(?:\/check\/[^/]+)?)?\/?$/;
+
+/** Routes owned by the mobile Workbench SPA at the public URL boundary. */
+export const isWorkbenchSpaRoute = (pathname: string): boolean => {
+ const pathOnly = pathname.split(/[?#]/, 1)[0]!;
+
+ return AGENT_DOCUMENT_ROUTE.test(pathOnly) || ACCEPTANCE_ROUTE.test(pathOnly);
+};
diff --git a/src/routes/(workbench)/acceptance/[acceptanceId]/index.tsx b/src/routes/(workbench)/acceptance/[acceptanceId]/index.tsx
new file mode 100644
index 00000000000..6b1ba5852cf
--- /dev/null
+++ b/src/routes/(workbench)/acceptance/[acceptanceId]/index.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { default } from '@/features/Verify/Acceptance/Workbench/AcceptanceDetail';
diff --git a/src/routes/(workbench)/acceptance/index.tsx b/src/routes/(workbench)/acceptance/index.tsx
new file mode 100644
index 00000000000..1ccb2a5eeaf
--- /dev/null
+++ b/src/routes/(workbench)/acceptance/index.tsx
@@ -0,0 +1,3 @@
+'use client';
+
+export { default } from '@/features/Verify/Acceptance/Workbench/AcceptanceList';
diff --git a/src/routes/(workbench)/agent/docs/[docId]/index.tsx b/src/routes/(workbench)/agent/docs/[docId]/index.tsx
new file mode 100644
index 00000000000..05df7945d40
--- /dev/null
+++ b/src/routes/(workbench)/agent/docs/[docId]/index.tsx
@@ -0,0 +1,16 @@
+'use client';
+
+import { useParams } from 'react-router';
+
+import AgentDocumentReader from '@/features/AgentDocumentReader';
+import { getIdFromIdentifier } from '@/utils/identifier';
+
+const AgentDocumentReaderRoute = () => {
+ const { aid = '', docId = '' } = useParams<{ aid: string; docId: string }>();
+ const agentId = getIdFromIdentifier(aid, 'agt');
+ const documentId = getIdFromIdentifier(docId, 'docs');
+
+ return <AgentDocumentReader agentId={agentId} documentId={documentId} />;
+};
+
+export default AgentDocumentReaderRoute;
diff --git a/src/services/agentDocument.ts b/src/services/agentDocument.ts
index 89aaa660954..3ff18925c41 100644
--- a/src/services/agentDocument.ts
+++ b/src/services/agentDocument.ts
@@ -75,6 +75,10 @@ class AgentDocumentService {
return lambdaClient.agentDocument.getOrCreateChatTopic.mutate(params);
};
+ getReaderDocument = async (params: { agentId: string; documentId: string }) => {
+ return lambdaClient.agentDocument.getReaderDocument.query(params);
+ };
+
associateDocument = async (params: { agentId: string; documentId: string }) => {
const result = await lambdaClient.agentDocument.associateDocument.mutate(params);
await invalidateDocumentMutation({
diff --git a/src/services/document/swrKeys.ts b/src/services/document/swrKeys.ts
index 4a321d124a7..7d4aae34d02 100644
--- a/src/services/document/swrKeys.ts
+++ b/src/services/document/swrKeys.ts
@@ -18,6 +18,8 @@ export const agentDocumentSWRKeys = {
documentsNonWebList: (agentId: string) => ['agent:documentsList', agentId, 'non-web'] as const,
documentChatTopic: (agentId: string, documentId: string) =>
['agent:documentChatTopic', agentId, documentId] as const,
+ readerDocument: (agentId: string, documentId: string) =>
+ ['agent:documentReader', agentId, documentId] as const,
readDocument: (agentId: string, id: string) => ['agent:documentEditor', agentId, id] as const,
};
diff --git a/src/spa/entry.workbench.tsx b/src/spa/entry.workbench.tsx
new file mode 100644
index 00000000000..800d287634a
--- /dev/null
+++ b/src/spa/entry.workbench.tsx
@@ -0,0 +1,19 @@
+import '../initialize';
+
+import { RouterProvider } from 'react-router/dom';
+
+import BootErrorBoundary from '@/components/BootErrorBoundary';
+import NextThemeProvider from '@/layout/GlobalProvider/NextThemeProvider';
+
+import { workbenchRoutes } from './router/workbenchRouter.config';
+import { createSPABrowserRouter, createSPARoot } from './runtime';
+
+const router = createSPABrowserRouter(workbenchRoutes);
+
+createSPARoot(document.getElementById('root')!).render(
+ <BootErrorBoundary>
+ <NextThemeProvider>
+ <RouterProvider router={router} />
+ </NextThemeProvider>
+ </BootErrorBoundary>,
+);
diff --git a/src/spa/router/workbenchRouter.config.tsx b/src/spa/router/workbenchRouter.config.tsx
new file mode 100644
index 00000000000..81f90347016
--- /dev/null
+++ b/src/spa/router/workbenchRouter.config.tsx
@@ -0,0 +1,117 @@
+import { useTheme } from 'next-themes';
+import type { ComponentType, CSSProperties, ReactElement } from 'react';
+import { lazy, Suspense, useEffect } from 'react';
+import type { RouteObject } from 'react-router';
+import { Outlet, useRouteError } from 'react-router';
+
+import WorkbenchShell, { WorkbenchNamespace } from '@/features/WorkbenchShell';
+import WorkbenchLoading from '@/features/WorkbenchShell/WorkbenchLoading';
+import { isChunkLoadError, notifyChunkError } from '@/utils/chunkError';
+
+// Keep this helper local. Importing the shared SPA router helper would pull the
+// Main SPA provider and global stores into the Workbench entry chunk.
+const lazyElement = (importFn: () => Promise<{ default: ComponentType }>): ReactElement => {
+ const LazyComponent = lazy(importFn);
+
+ return <LazyComponent />;
+};
+
+const buttonStyle: CSSProperties = {
+ background: 'transparent',
+ border: '1px solid currentcolor',
+ borderRadius: 6,
+ color: 'inherit',
+ cursor: 'pointer',
+ font: 'inherit',
+ padding: '6px 16px',
+};
+
+const WorkbenchErrorBoundary = () => {
+ const error = useRouteError() as Error;
+ const { resolvedTheme } = useTheme();
+
+ if (typeof window !== 'undefined' && isChunkLoadError(error)) notifyChunkError();
+
+ const isDark = resolvedTheme === 'dark';
+
+ return (
+ <div
+ style={{
+ alignItems: 'center',
+ background: isDark ? '#000' : '#f8f8f8',
+ color: isDark ? '#e6e6e6' : '#1a1a1a',
+ display: 'flex',
+ flexDirection: 'column',
+ fontFamily: 'sans-serif',
+ gap: 16,
+ justifyContent: 'center',
+ minHeight: '100dvh',
+ padding: 16,
+ }}
+ >
+ <h2 style={{ margin: 0 }}>Something went wrong</h2>
+ <div style={{ display: 'flex', gap: 12 }}>
+ <button style={buttonStyle} type={'button'} onClick={() => window.location.reload()}>
+ Retry
+ </button>
+ <button style={buttonStyle} type={'button'} onClick={() => window.location.assign('/')}>
+ Back
+ </button>
+ </div>
+ </div>
+ );
+};
+
+const ExitWorkbench = () => {
+ useEffect(() => {
+ window.location.replace('/');
+ }, []);
+
+ return <WorkbenchLoading />;
+};
+
+export const workbenchRoutes: RouteObject[] = [
+ {
+ children: [
+ {
+ element: lazyElement(() => import('@/routes/(workbench)/agent/docs/[docId]')),
+ path: 'agent/:aid/docs/:docId',
+ },
+ {
+ children: [
+ {
+ element: lazyElement(() => import('@/routes/(workbench)/acceptance')),
+ index: true,
+ },
+ {
+ element: lazyElement(() => import('@/routes/(workbench)/acceptance/[acceptanceId]')),
+ path: ':acceptanceId',
+ },
+ {
+ element: lazyElement(() => import('@/routes/(workbench)/acceptance/[acceptanceId]')),
+ path: ':acceptanceId/check/:checkId',
+ },
+ ],
+ element: (
+ <WorkbenchNamespace namespace="verify">
+ <Outlet />
+ </WorkbenchNamespace>
+ ),
+ path: 'acceptance',
+ },
+ {
+ element: <ExitWorkbench />,
+ path: '*',
+ },
+ ],
+ element: (
+ <WorkbenchShell>
+ <Suspense fallback={<WorkbenchLoading />}>
+ <Outlet />
+ </Suspense>
+ </WorkbenchShell>
+ ),
+ errorElement: <WorkbenchErrorBoundary />,
+ path: '/',
+ },
+];
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index 88d64dde74b..219ca69174e 100644
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -53,6 +53,7 @@ declare global {
/** Vite define: current bundle is mobile variant */
const __MOBILE__: boolean;
+ const __WORKBENCH__: boolean;
/** Vite define: current bundle is Electron desktop variant */
const __ELECTRON__: boolean | undefined;
diff --git a/vite.config.ts b/vite.config.ts
index 01a9fd92e15..72b0305bc85 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -22,12 +22,14 @@ import { createViteWatchOptions } from './plugins/vite/watchOptions';
const isMobile = process.env.MOBILE === 'true';
const isAuth = process.env.AUTH === 'true';
+const isWorkbench = process.env.SPA_TARGET === 'workbench';
const mode = process.env.NODE_ENV === 'production' ? 'production' : 'development';
Object.assign(process.env, loadEnv(mode, process.cwd(), ''));
const isDev = process.env.NODE_ENV !== 'production';
-const platform = isAuth ? 'auth' : isMobile ? 'mobile' : 'web';
+const isMobileRuntime = isMobile || isWorkbench;
+const platform = isAuth ? 'auth' : isMobileRuntime ? 'mobile' : 'web';
const enableViteDevTools = process.env.LOBE_VITE_DEVTOOLS === 'true';
const resolveCommandExecutable = (cmd: string) => {
@@ -105,21 +107,39 @@ const openExternalBrowser = async (
};
export default defineConfig({
- base: isDev ? '/' : process.env.VITE_CDN_BASE || (isAuth ? '/_spa-auth/' : '/_spa/'),
+ base: isDev
+ ? '/'
+ : process.env.VITE_CDN_BASE ||
+ (isAuth ? '/_spa-auth/' : isWorkbench ? '/_spa-workbench/' : '/_spa/'),
build: {
modulePreload: sharedModulePreload,
- outDir: isAuth ? 'dist/auth' : isMobile ? 'dist/mobile' : 'dist/desktop',
+ outDir: isAuth
+ ? 'dist/auth'
+ : isWorkbench
+ ? 'dist/workbench'
+ : isMobile
+ ? 'dist/mobile'
+ : 'dist/desktop',
reportCompressedSize: false,
rolldownOptions: {
...(enableViteDevTools && { devtools: {} }),
input: path.resolve(
__dirname,
- isAuth ? 'index.auth.html' : isMobile ? 'index.mobile.html' : 'index.html',
+ isAuth
+ ? 'index.auth.html'
+ : isWorkbench
+ ? 'index.workbench.html'
+ : isMobile
+ ? 'index.mobile.html'
+ : 'index.html',
),
output: createSharedRolldownOutput({ strictExecutionOrder: true }),
},
},
- define: sharedRendererDefine({ isMobile, isElectron: false }),
+ define: {
+ ...sharedRendererDefine({ isMobile: isMobileRuntime, isElectron: false }),
+ __WORKBENCH__: JSON.stringify(isWorkbench),
+ },
experimental: {
bundledDev: false,
},
@@ -128,6 +148,24 @@ export default defineConfig({
},
optimizeDeps: sharedOptimizeDeps,
plugins: [
+ isMobileRuntime &&
+ isDev && {
+ name: 'mobile-runtime-html-dev-entry',
+ enforce: 'pre' as const,
+ configureServer(server: ViteDevServer) {
+ server.middlewares.use((req, _res, next) => {
+ const raw = req.url;
+ if (!raw) return next();
+ const q = raw.indexOf('?');
+ const pathOnly = q === -1 ? raw : raw.slice(0, q);
+ const search = q === -1 ? '' : raw.slice(q);
+ if (pathOnly === '/' || pathOnly === '/index.html') {
+ req.url = `/${isWorkbench ? 'index.workbench.html' : 'index.mobile.html'}${search}`;
+ }
+ next();
+ });
+ },
+ },
vercelSkewProtection(),
viteEnvRestartKeys(['APP_URL']),
enableViteDevTools &&
@@ -258,6 +296,7 @@ export default defineConfig({
},
!isAuth &&
+ !isWorkbench &&
VitePWA({
injectRegister: null,
manifest: false,
@@ -305,11 +344,13 @@ export default defineConfig({
server: {
cors: true,
host: true,
- port: isMobile
- ? Number(process.env.MOBILE_SPA_PORT) || 3012
- : isAuth
- ? Number(process.env.AUTH_SPA_PORT) || 3013
- : Number(process.env.SPA_PORT) || 9876,
+ port: isWorkbench
+ ? Number(process.env.WORKBENCH_SPA_PORT) || 3014
+ : isMobile
+ ? Number(process.env.MOBILE_SPA_PORT) || 3012
+ : isAuth
+ ? Number(process.env.AUTH_SPA_PORT) || 3013
+ : Number(process.env.SPA_PORT) || 9876,
// The dev orchestrator (scripts/devStartupSequence.mts) pre-resolves a free
// port and injects it via env; never silently drift to another port, since
// downstream consumers locate this server through that env contract.