From d444756f673173f8e87e796963e320a6c82f41a8 Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Thu, 20 Nov 2025 13:33:10 +0530 Subject: [PATCH] chore: add static markdown import --- server/src/api/record.ts | 2 +- server/src/pgboss-worker.ts | 4 ++-- server/src/workflow-management/scheduler/index.ts | 2 +- src/components/robot/pages/RobotCreate.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/server/src/api/record.ts b/server/src/api/record.ts index f55e2b3f..fd7376ab 100644 --- a/server/src/api/record.ts +++ b/server/src/api/record.ts @@ -18,6 +18,7 @@ import { WorkflowFile } from "maxun-core"; import { googleSheetUpdateTasks, processGoogleSheetUpdates } from "../workflow-management/integrations/gsheet"; import { airtableUpdateTasks, processAirtableUpdates } from "../workflow-management/integrations/airtable"; import { sendWebhook } from "../routes/webhook"; +import { convertPageToMarkdown } from '../markdownify/scrape'; chromium.use(stealthPlugin()); @@ -665,7 +666,6 @@ async function executeRun(id: string, userId: string) { }); try { - const { convertPageToMarkdown } = await import('../markdownify/scrape'); const url = recording.recording_meta.url; if (!url) { diff --git a/server/src/pgboss-worker.ts b/server/src/pgboss-worker.ts index 0fcd7f65..b2d5bdb3 100644 --- a/server/src/pgboss-worker.ts +++ b/server/src/pgboss-worker.ts @@ -20,6 +20,7 @@ import { airtableUpdateTasks, processAirtableUpdates } from './workflow-manageme import { io as serverIo } from "./server"; import { sendWebhook } from './routes/webhook'; import { BinaryOutputService } from './storage/mino'; +import { convertPageToMarkdown } from './markdownify/scrape'; if (!process.env.DB_USER || !process.env.DB_PASSWORD || !process.env.DB_HOST || !process.env.DB_PORT || !process.env.DB_NAME) { throw new Error('Failed to start pgboss worker: one or more required environment variables are missing.'); @@ -183,7 +184,7 @@ async function processRunExecution(job: Job) { try { // Find the recording const recording = await Robot.findOne({ where: { 'recording_meta.id': plainRun.robotMetaId }, raw: true }); - + if (!recording) { throw new Error(`Recording for run ${data.runId} not found`); } @@ -197,7 +198,6 @@ async function processRunExecution(job: Job) { }); try { - const { convertPageToMarkdown } = await import('./markdownify/scrape'); const url = recording.recording_meta.url; if (!url) { diff --git a/server/src/workflow-management/scheduler/index.ts b/server/src/workflow-management/scheduler/index.ts index ba47b3e0..7c2cb408 100644 --- a/server/src/workflow-management/scheduler/index.ts +++ b/server/src/workflow-management/scheduler/index.ts @@ -15,6 +15,7 @@ import { WorkflowFile } from "maxun-core"; import { Page } from "playwright"; import { sendWebhook } from "../../routes/webhook"; import { airtableUpdateTasks, processAirtableUpdates } from "../integrations/airtable"; +import { convertPageToMarkdown } from "../../markdownify/scrape"; chromium.use(stealthPlugin()); async function createWorkflowAndStoreMetadata(id: string, userId: string) { @@ -231,7 +232,6 @@ async function executeRun(id: string, userId: string) { } try { - const { convertPageToMarkdown } = await import('../../markdownify/scrape'); const url = recording.recording_meta.url; if (!url) { diff --git a/src/components/robot/pages/RobotCreate.tsx b/src/components/robot/pages/RobotCreate.tsx index 0e76fac4..4bec52d8 100644 --- a/src/components/robot/pages/RobotCreate.tsx +++ b/src/components/robot/pages/RobotCreate.tsx @@ -20,6 +20,7 @@ import { import { ArrowBack, PlayCircleOutline, Article, Code, Description } from '@mui/icons-material'; import { useGlobalInfoStore } from '../../../context/globalInfo'; import { canCreateBrowserInState, getActiveBrowserId, stopRecording } from '../../../api/recording'; +import { createMarkdownRobot } from "../../../api/storage"; import { AuthContext } from '../../../context/auth'; import { GenericModal } from '../../ui/GenericModal'; @@ -401,7 +402,6 @@ const RobotCreate: React.FC = () => { return; } setIsLoading(true); - const { createMarkdownRobot } = await import('../../../api/storage'); const result = await createMarkdownRobot(url, markdownRobotName); setIsLoading(false);