Merge pull request #924 from getmaxun/pre-release-30

chore: pre-release v0.0.30
This commit is contained in:
Karishma Shukla
2025-12-12 03:47:49 +05:30
committed by GitHub
11 changed files with 45 additions and 28 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "maxun", "name": "maxun",
"version": "0.0.29", "version": "0.0.30",
"author": "Maxun", "author": "Maxun",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {

View File

@@ -1001,6 +1001,7 @@ async function executeRun(id: string, userId: string, requestedFormats?: string[
schemaItemsExtracted: totalSchemaItemsExtracted, schemaItemsExtracted: totalSchemaItemsExtracted,
listItemsExtracted: totalListItemsExtracted, listItemsExtracted: totalListItemsExtracted,
extractedScreenshotsCount, 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) { } catch (webhookError: any) {
logger.log('error', `Failed to send failure webhooks for run ${run.runId}: ${webhookError.message}`); 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 { return {
success: false, success: false,
error: error.message, error: error.message,

View File

@@ -99,7 +99,10 @@ router.post("/sdk/robots", requireAPIKey, async (req: AuthenticatedRequest, res:
} }
}); });
capture("maxun-oss-robot-created", { const eventName = robotMeta.isLLM
? "maxun-oss-llm-robot-created"
: "maxun-oss-robot-created";
capture(eventName, {
robot_meta: robot.recording_meta, robot_meta: robot.recording_meta,
recording: robot.recording, recording: robot.recording,
}); });
@@ -389,13 +392,14 @@ router.delete("/sdk/robots/:id", requireAPIKey, async (req: AuthenticatedRequest
logger.info(`[SDK] Robot deleted: ${robotId}`); logger.info(`[SDK] Robot deleted: ${robotId}`);
capture( const deleteEventName = robot.recording_meta.isLLM
'maxun-oss-robot-deleted', ? "maxun-oss-llm-robot-deleted"
{ : "maxun-oss-robot-deleted";
robotId: robotId, capture(deleteEventName, {
user_id: req.user?.id, robotId: robotId,
deleted_at: new Date().toISOString(), user_id: req.user?.id,
} deleted_at: new Date().toISOString(),
}
) )
return res.status(200).json({ return res.status(200).json({
@@ -677,6 +681,7 @@ router.post("/sdk/extract/llm", requireAPIKey, async (req: AuthenticatedRequest,
params: [], params: [],
type: 'extract', type: 'extract',
url: workflowResult.url, url: workflowResult.url,
isLLM: true,
}; };
const robot = await Robot.create({ const robot = await Robot.create({
@@ -690,7 +695,7 @@ router.post("/sdk/extract/llm", requireAPIKey, async (req: AuthenticatedRequest,
logger.info(`[SDK] Persistent robot created: ${metaId} for LLM extraction`); 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, robot_meta: robot.recording_meta,
recording: robot.recording, recording: robot.recording,
}); });

View File

@@ -12,6 +12,7 @@ interface RobotMeta {
type?: 'extract' | 'scrape'; type?: 'extract' | 'scrape';
url?: string; url?: string;
formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[];
isLLM?: boolean;
} }
interface RobotWorkflow { interface RobotWorkflow {

View File

@@ -538,6 +538,7 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
schemaItemsExtracted: totalSchemaItemsExtracted, schemaItemsExtracted: totalSchemaItemsExtracted,
listItemsExtracted: totalListItemsExtracted, listItemsExtracted: totalListItemsExtracted,
extractedScreenshotsCount, extractedScreenshotsCount,
is_llm: (recording.recording_meta as any).isLLM,
} }
); );
@@ -703,6 +704,7 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
error_message: executionError.message, error_message: executionError.message,
partial_data_extracted: partialDataExtracted, partial_data_extracted: partialDataExtracted,
totalRowsExtracted: partialData?.totalSchemaItemsExtracted + partialData?.totalListItemsExtracted + partialData?.extractedScreenshotsCount || 0, totalRowsExtracted: partialData?.totalSchemaItemsExtracted + partialData?.totalListItemsExtracted + partialData?.extractedScreenshotsCount || 0,
is_llm: (recording?.recording_meta as any)?.isLLM,
}); });
try { try {

View File

@@ -573,6 +573,7 @@ router.post('/recordings/llm', requireSignIn, async (req: AuthenticatedRequest,
params: [], params: [],
type: 'extract', type: 'extract',
url: workflowResult.url || url, url: workflowResult.url || url,
isLLM: true,
}, },
recording: { workflow: workflowResult.workflow }, recording: { workflow: workflowResult.workflow },
google_sheet_email: null, google_sheet_email: null,
@@ -584,7 +585,7 @@ router.post('/recordings/llm', requireSignIn, async (req: AuthenticatedRequest,
}); });
logger.log('info', `LLM robot created with id: ${newRobot.id}`); 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, robot_meta: newRobot.recording_meta,
recording: newRobot.recording, recording: newRobot.recording,
llm_provider: llmProvider || 'ollama', llm_provider: llmProvider || 'ollama',

View File

@@ -536,6 +536,7 @@ async function executeRun(id: string, userId: string) {
schemaItemsExtracted: totalSchemaItemsExtracted, schemaItemsExtracted: totalSchemaItemsExtracted,
listItemsExtracted: totalListItemsExtracted, listItemsExtracted: totalListItemsExtracted,
extractedScreenshotsCount, extractedScreenshotsCount,
is_llm: (recording.recording_meta as any).isLLM,
} }
); );
@@ -650,15 +651,16 @@ async function executeRun(id: string, userId: string) {
} catch (socketError: any) { } catch (socketError: any) {
logger.log('warn', `Failed to emit failure event in main catch: ${socketError.message}`); 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; return false;
} }
} }

View File

@@ -27,6 +27,7 @@ interface RobotMeta {
type?: 'extract' | 'scrape'; type?: 'extract' | 'scrape';
url?: string; url?: string;
formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[];
isLLM?: boolean;
} }
interface RobotWorkflow { interface RobotWorkflow {

View File

@@ -27,6 +27,7 @@ interface RobotMeta {
type?: 'extract' | 'scrape'; type?: 'extract' | 'scrape';
url?: string; url?: string;
formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[];
isLLM?: boolean;
} }
interface RobotWorkflow { interface RobotWorkflow {

View File

@@ -19,6 +19,7 @@ interface RobotMeta {
type?: 'extract' | 'scrape'; type?: 'extract' | 'scrape';
url?: string; url?: string;
formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[];
isLLM?: boolean;
} }
interface RobotWorkflow { interface RobotWorkflow {

View File

@@ -30,6 +30,7 @@ interface RobotMeta {
type?: 'extract' | 'scrape'; type?: 'extract' | 'scrape';
url?: string; url?: string;
formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[]; formats?: ('markdown' | 'html' | 'screenshot-visible' | 'screenshot-fullpage')[];
isLLM?: boolean;
} }
interface RobotWorkflow { interface RobotWorkflow {