From 21ba2aea84818426524c5b33534278467ba7c104 Mon Sep 17 00:00:00 2001 From: Karishma Shukla Date: Thu, 11 Dec 2025 23:42:26 +0530 Subject: [PATCH 1/7] chore: v0.0.30 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a3ca8d82..e1c4f19b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maxun", - "version": "0.0.29", + "version": "0.0.30", "author": "Maxun", "license": "AGPL-3.0-or-later", "dependencies": { From 2632944ef0f83ddc9a1b7427ea3b4437d1d83e47 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Fri, 12 Dec 2025 02:18:41 +0530 Subject: [PATCH 2/7] chore: capture() names --- server/src/api/sdk.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/api/sdk.ts b/server/src/api/sdk.ts index 1a049d58..e3c6ac7c 100644 --- a/server/src/api/sdk.ts +++ b/server/src/api/sdk.ts @@ -99,7 +99,7 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res: } }); - capture("maxun-oss-robot-created", { + capture("maxun-oss-llm-robot-created", { robot_meta: robot.recording_meta, recording: robot.recording, }); @@ -390,7 +390,7 @@ router.delete("/sdk/robots/:id", requireAPIKey, async (req: AuthenticatedRequest logger.info(`[SDK] Robot deleted: ${robotId}`); capture( - 'maxun-oss-robot-deleted', + 'maxun-oss-llm-robot-deleted', { robotId: robotId, user_id: req.user?.id, @@ -690,7 +690,7 @@ router.post("/sdk/extract/llm", requireAPIKey, async (req: AuthenticatedRequest, logger.info(`[SDK] Persistent robot created: ${metaId} for LLM extraction`); - capture("maxun-oss-robot-created", { + capture("maxun-oss-llm-robot-created", { robot_meta: robot.recording_meta, recording: robot.recording, }); From d8de5031d3ec350c1d20cfce66e6e274e8703e85 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Fri, 12 Dec 2025 02:19:59 +0530 Subject: [PATCH 3/7] chore: capture() names --- server/src/routes/storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 7eb0dd79..4dea2c33 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -584,7 +584,7 @@ router.post('/recordings/llm', requireSignIn, async (req: AuthenticatedRequest, }); logger.log('info', `LLM robot created with id: ${newRobot.id}`); - capture('maxun-oss-robot-created', { + capture('maxun-oss-llm-robot-created', { robot_meta: newRobot.recording_meta, recording: newRobot.recording, llm_provider: llmProvider || 'ollama', From 12dea8e24a98b53ca99cbb2ad04479203c4f6dfe Mon Sep 17 00:00:00 2001 From: Rohit Rajan Date: Fri, 12 Dec 2025 02:54:30 +0530 Subject: [PATCH 4/7] feat: add is LLM entry --- server/src/api/record.ts | 18 ++++++++++-------- server/src/api/sdk.ts | 1 + server/src/models/Robot.ts | 1 + server/src/pgboss-worker.ts | 2 ++ server/src/routes/storage.ts | 1 + .../src/workflow-management/scheduler/index.ts | 18 ++++++++++-------- .../robot/pages/RobotDuplicatePage.tsx | 1 + src/components/robot/pages/RobotEditPage.tsx | 1 + .../robot/pages/RobotSettingsPage.tsx | 1 + src/context/globalInfo.tsx | 1 + 10 files changed, 29 insertions(+), 16 deletions(-) diff --git a/server/src/api/record.ts b/server/src/api/record.ts index 25c6f95a..f6ef6ea7 100644 --- a/server/src/api/record.ts +++ b/server/src/api/record.ts @@ -1001,6 +1001,7 @@ async function executeRun(id: string, userId: string, requestedFormats?: string[ schemaItemsExtracted: totalSchemaItemsExtracted, listItemsExtracted: totalListItemsExtracted, extractedScreenshotsCount, + is_llm: (recording.recording_meta as any).isLLM, } ) @@ -1121,15 +1122,16 @@ async function executeRun(id: string, userId: string, requestedFormats?: string[ } catch (webhookError: any) { logger.log('error', `Failed to send failure webhooks for run ${run.runId}: ${webhookError.message}`); } + capture( + 'maxun-oss-run-created-api', + { + runId: id, + created_at: new Date().toISOString(), + status: 'failed', + is_llm: (recording?.recording_meta as any)?.isLLM, + } + ); } - capture( - 'maxun-oss-run-created-api', - { - runId: id, - created_at: new Date().toISOString(), - status: 'failed', - } - ); return { success: false, error: error.message, diff --git a/server/src/api/sdk.ts b/server/src/api/sdk.ts index e3c6ac7c..70302246 100644 --- a/server/src/api/sdk.ts +++ b/server/src/api/sdk.ts @@ -677,6 +677,7 @@ router.post("/sdk/extract/llm", requireAPIKey, async (req: AuthenticatedRequest, params: [], type: 'extract', url: workflowResult.url, + isLLM: true, }; const robot = await Robot.create({ diff --git a/server/src/models/Robot.ts b/server/src/models/Robot.ts index 1ce269b0..51f9e48f 100644 --- a/server/src/models/Robot.ts +++ b/server/src/models/Robot.ts @@ -12,6 +12,7 @@ interface RobotMeta { type?: 'extract' | 'scrape'; url?: string; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; + isLLM?: boolean; } interface RobotWorkflow { diff --git a/server/src/pgboss-worker.ts b/server/src/pgboss-worker.ts index 1f7125f4..43b4efc3 100644 --- a/server/src/pgboss-worker.ts +++ b/server/src/pgboss-worker.ts @@ -538,6 +538,7 @@ async function processRunExecution(job: Job) { schemaItemsExtracted: totalSchemaItemsExtracted, listItemsExtracted: totalListItemsExtracted, extractedScreenshotsCount, + is_llm: (recording.recording_meta as any).isLLM, } ); @@ -703,6 +704,7 @@ async function processRunExecution(job: Job) { error_message: executionError.message, partial_data_extracted: partialDataExtracted, totalRowsExtracted: partialData?.totalSchemaItemsExtracted + partialData?.totalListItemsExtracted + partialData?.extractedScreenshotsCount || 0, + is_llm: (recording?.recording_meta as any)?.isLLM, }); try { diff --git a/server/src/routes/storage.ts b/server/src/routes/storage.ts index 4dea2c33..0f84504e 100644 --- a/server/src/routes/storage.ts +++ b/server/src/routes/storage.ts @@ -573,6 +573,7 @@ router.post('/recordings/llm', requireSignIn, async (req: AuthenticatedRequest, params: [], type: 'extract', url: workflowResult.url || url, + isLLM: true, }, recording: { workflow: workflowResult.workflow }, google_sheet_email: null, diff --git a/server/src/workflow-management/scheduler/index.ts b/server/src/workflow-management/scheduler/index.ts index 652e72d8..29999cff 100644 --- a/server/src/workflow-management/scheduler/index.ts +++ b/server/src/workflow-management/scheduler/index.ts @@ -536,6 +536,7 @@ async function executeRun(id: string, userId: string) { schemaItemsExtracted: totalSchemaItemsExtracted, listItemsExtracted: totalListItemsExtracted, extractedScreenshotsCount, + is_llm: (recording.recording_meta as any).isLLM, } ); @@ -650,15 +651,16 @@ async function executeRun(id: string, userId: string) { } catch (socketError: any) { logger.log('warn', `Failed to emit failure event in main catch: ${socketError.message}`); } + capture( + 'maxun-oss-run-created-scheduled', + { + runId: id, + created_at: new Date().toISOString(), + status: 'failed', + is_llm: (recording?.recording_meta as any)?.isLLM, + } + ); } - capture( - 'maxun-oss-run-created-scheduled', - { - runId: id, - created_at: new Date().toISOString(), - status: 'failed', - } - ); return false; } } diff --git a/src/components/robot/pages/RobotDuplicatePage.tsx b/src/components/robot/pages/RobotDuplicatePage.tsx index fd01103b..f021ee45 100644 --- a/src/components/robot/pages/RobotDuplicatePage.tsx +++ b/src/components/robot/pages/RobotDuplicatePage.tsx @@ -27,6 +27,7 @@ interface RobotMeta { type?: 'extract' | 'scrape'; url?: string; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; + isLLM?: boolean; } interface RobotWorkflow { diff --git a/src/components/robot/pages/RobotEditPage.tsx b/src/components/robot/pages/RobotEditPage.tsx index 54b06962..8914f4aa 100644 --- a/src/components/robot/pages/RobotEditPage.tsx +++ b/src/components/robot/pages/RobotEditPage.tsx @@ -27,6 +27,7 @@ interface RobotMeta { type?: 'extract' | 'scrape'; url?: string; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; + isLLM?: boolean; } interface RobotWorkflow { diff --git a/src/components/robot/pages/RobotSettingsPage.tsx b/src/components/robot/pages/RobotSettingsPage.tsx index 0817c0ab..a5618d4c 100644 --- a/src/components/robot/pages/RobotSettingsPage.tsx +++ b/src/components/robot/pages/RobotSettingsPage.tsx @@ -19,6 +19,7 @@ interface RobotMeta { type?: 'extract' | 'scrape'; url?: string; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; + isLLM?: boolean; } interface RobotWorkflow { diff --git a/src/context/globalInfo.tsx b/src/context/globalInfo.tsx index c5bbc044..5db9239d 100644 --- a/src/context/globalInfo.tsx +++ b/src/context/globalInfo.tsx @@ -30,6 +30,7 @@ interface RobotMeta { type?: 'extract' | 'scrape'; url?: string; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; + isLLM?: boolean; } interface RobotWorkflow { From b3ca3422246e5b817c807cf2a1af5d67f6294933 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Fri, 12 Dec 2025 03:33:25 +0530 Subject: [PATCH 5/7] fix: llm capture --- server/src/api/sdk.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/src/api/sdk.ts b/server/src/api/sdk.ts index e3c6ac7c..f23bc993 100644 --- a/server/src/api/sdk.ts +++ b/server/src/api/sdk.ts @@ -99,7 +99,10 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res: } }); - capture("maxun-oss-llm-robot-created", { + const eventName = robotMeta.isLLM + ? "maxun-oss-llm-robot-created" + : "maxun-oss-robot-created"; + capture(eventName, { robot_meta: robot.recording_meta, recording: robot.recording, }); From 1ceb69139088dc871c816c0f308700916e8e57bf Mon Sep 17 00:00:00 2001 From: amhsirak Date: Fri, 12 Dec 2025 03:33:53 +0530 Subject: [PATCH 6/7] fix: format --- server/src/api/sdk.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/src/api/sdk.ts b/server/src/api/sdk.ts index 7edb40a0..f751508b 100644 --- a/server/src/api/sdk.ts +++ b/server/src/api/sdk.ts @@ -99,8 +99,8 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res: } }); - const eventName = robotMeta.isLLM - ? "maxun-oss-llm-robot-created" + const eventName = robotMeta.isLLM + ? "maxun-oss-llm-robot-created" : "maxun-oss-robot-created"; capture(eventName, { robot_meta: robot.recording_meta, @@ -434,7 +434,7 @@ router.post("/sdk/robots/:id/execute", requireAPIKey, async (req: AuthenticatedR let listData: any[] = []; if (run.serializableOutput?.scrapeList) { const scrapeList: any = run.serializableOutput.scrapeList; - + if (scrapeList.scrapeList && Array.isArray(scrapeList.scrapeList)) { listData = scrapeList.scrapeList; } From ddba159d1dd7001fac5ecbc4306bb6a7c9f896a5 Mon Sep 17 00:00:00 2001 From: amhsirak Date: Fri, 12 Dec 2025 03:45:12 +0530 Subject: [PATCH 7/7] fix: robot delcapture --- server/src/api/sdk.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/server/src/api/sdk.ts b/server/src/api/sdk.ts index f751508b..db6649ee 100644 --- a/server/src/api/sdk.ts +++ b/server/src/api/sdk.ts @@ -392,13 +392,14 @@ router.delete("/sdk/robots/:id", requireAPIKey, async (req: AuthenticatedRequest logger.info(`[SDK] Robot deleted: ${robotId}`); - capture( - 'maxun-oss-llm-robot-deleted', - { - robotId: robotId, - user_id: req.user?.id, - deleted_at: new Date().toISOString(), - } + const deleteEventName = robot.recording_meta.isLLM + ? "maxun-oss-llm-robot-deleted" + : "maxun-oss-robot-deleted"; + capture(deleteEventName, { + robotId: robotId, + user_id: req.user?.id, + deleted_at: new Date().toISOString(), + } ) return res.status(200).json({