@midscene/core 1.15.3 → 1.15.4-beta-20261013090705.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/agent/index.mjs +2 -2
- package/dist/es/agent/test-runner-nodes.mjs +14 -5
- package/dist/es/agent/test-runner-nodes.mjs.map +1 -1
- package/dist/es/agent/utils.mjs +1 -1
- package/dist/es/dump/report-action-dump.mjs +3 -3
- package/dist/es/dump/report-action-dump.mjs.map +1 -1
- package/dist/es/report-html-template.mjs +1 -1
- package/dist/es/report-markdown.mjs +1 -1
- package/dist/es/report-markdown.mjs.map +1 -1
- package/dist/es/screenshot-item.mjs +6 -0
- package/dist/es/screenshot-item.mjs.map +1 -1
- package/dist/es/test-run-report.mjs.map +1 -1
- package/dist/es/test-runner/reporting/test-run-report.mjs +41 -1
- package/dist/es/test-runner/reporting/test-run-report.mjs.map +1 -1
- package/dist/es/utils.mjs +1 -1
- package/dist/lib/agent/index.js +3 -0
- package/dist/lib/agent/test-runner-nodes.js +31 -19
- package/dist/lib/agent/test-runner-nodes.js.map +1 -1
- package/dist/lib/agent/utils.js +1 -1
- package/dist/lib/dump/report-action-dump.js +3 -3
- package/dist/lib/dump/report-action-dump.js.map +1 -1
- package/dist/lib/report-html-template.js +1 -1
- package/dist/lib/report-markdown.js +1 -1
- package/dist/lib/report-markdown.js.map +1 -1
- package/dist/lib/screenshot-item.js +6 -0
- package/dist/lib/screenshot-item.js.map +1 -1
- package/dist/lib/test-run-report.js.map +1 -1
- package/dist/lib/test-runner/reporting/test-run-report.js +41 -1
- package/dist/lib/test-runner/reporting/test-run-report.js.map +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/types/agent/index.d.ts +2 -2
- package/dist/types/agent/index.d.ts.map +1 -1
- package/dist/types/agent/test-runner-nodes.d.ts +8 -0
- package/dist/types/agent/test-runner-nodes.d.ts.map +1 -1
- package/dist/types/screenshot-item.d.ts +5 -0
- package/dist/types/screenshot-item.d.ts.map +1 -1
- package/dist/types/test-run-report.d.ts +19 -0
- package/dist/types/test-run-report.d.ts.map +1 -1
- package/dist/types/test-runner/engine/types.d.ts +1 -1
- package/dist/types/test-runner/engine/types.d.ts.map +1 -1
- package/dist/types/test-runner/parser/types.d.ts +4 -0
- package/dist/types/test-runner/parser/types.d.ts.map +1 -1
- package/dist/types/test-runner/reporting/test-run-report.d.ts.map +1 -1
- package/dist/types/test-runner/reporting/types.d.ts +6 -1
- package/dist/types/test-runner/reporting/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-runner/reporting/test-run-report.mjs","sources":["../../../../src/test-runner/reporting/test-run-report.ts"],"sourcesContent":["import type {\n IndexedTestRunReportSource,\n TestRunReportAgentDetail,\n TestRunReportAttempt,\n TestRunReportCase,\n TestRunReportCasePlan,\n TestRunReportDiagnostic,\n TestRunReportDocument,\n TestRunReportDocumentPlan,\n TestRunReportDump,\n TestRunReportMetrics,\n TestRunReportPlannedStep,\n TestRunReportProject,\n TestRunReportSource,\n TestRunReportSourceIndex,\n TestRunReportStep,\n} from '../../test-run-report';\nimport type {\n CaseRunResult,\n StepRunResult,\n WorkflowDocumentRunResult,\n} from '../engine/types';\nimport { sumTestRunReportMetrics } from './metrics';\nimport {\n sanitizeReportError,\n sanitizeReportText,\n sanitizeReportValue,\n} from './sanitize';\nimport type { RunReportCaseInput, RunReportInput } from './types';\n\nconst exactMidsceneDetailNodes = new Set([\n 'aiAct',\n 'aiAssert',\n 'recordToReport',\n]);\n\ninterface ManifestBuildContext {\n diagnostics: TestRunReportDiagnostic[];\n sourcesByScope: Map<string, IndexedTestRunReportSource[]>;\n detailsByScopeAndExecution: Map<string, TestRunReportAgentDetail>;\n tracedScopeByExecution: Map<string, string>;\n expectedExecutions: Set<string>;\n capturedExecutions: Set<string>;\n executionMetrics: Map<string, TestRunReportMetrics>;\n missingMetrics: Set<string>;\n tracedScopes: Set<string>;\n}\n\nconst scopedExecutionKey = (scopeId: string, executionId: string): string =>\n `${scopeId}\\u0000${executionId}`;\n\nconst reportSourcesForScope = (\n context: ManifestBuildContext,\n scopeId: string,\n): IndexedTestRunReportSource[] => context.sourcesByScope.get(scopeId) ?? [];\n\nconst addDiagnostic = (\n context: ManifestBuildContext,\n diagnostic: TestRunReportDiagnostic,\n): void => {\n context.diagnostics.push(diagnostic);\n};\n\nconst buildStep = (\n step: StepRunResult,\n scopeId: string,\n context: ManifestBuildContext,\n executionId: string,\n plan?: TestRunReportPlannedStep,\n): TestRunReportStep => {\n const stepId = `${executionId}:${step.phase}:${step.stepIndex}`;\n if (step.status === 'not-run')\n return {\n id: stepId,\n ...(plan ? { planStepId: plan.id, title: plan.title } : {}),\n phase: step.phase,\n stepIndex: step.stepIndex,\n node: step.node,\n status: 'not-run',\n notRunReason: sanitizeReportText(step.notRunReason),\n ...(step.blockedBy ? { blockedBy: step.blockedBy } : {}),\n continuedAfterError: step.continuedAfterError,\n ...(step.waitForPreviousOperationMs\n ? { waitForPreviousOperationMs: step.waitForPreviousOperationMs }\n : {}),\n input: sanitizeReportValue(step.input),\n ...(step.error ? { error: sanitizeReportError(step.error) } : {}),\n ...(step.operations\n ? {\n operations: {\n ...step.operations,\n events: [...step.operations.events],\n },\n }\n : {}),\n };\n const details: TestRunReportAgentDetail[] = [];\n const unresolvedExecutionIds: string[] = [];\n const usage: TestRunReportMetrics[] = [];\n const missingUsage: string[] = [];\n for (const trace of step.report?.traces ?? []) {\n context.tracedScopes.add(scopeId);\n const metrics =\n context.executionMetrics.get(trace.executionId) ?? trace.metrics;\n if (metrics) {\n context.executionMetrics.set(trace.executionId, metrics);\n usage.push(metrics);\n }\n context.expectedExecutions.add(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n const previousScope = context.tracedScopeByExecution.get(trace.executionId);\n if (previousScope && previousScope !== scopeId) {\n throw new Error(\n `Agent execution ${trace.executionId} was traced by multiple test scopes (${previousScope}, ${scopeId}).`,\n );\n }\n context.tracedScopeByExecution.set(trace.executionId, scopeId);\n const detail = context.detailsByScopeAndExecution.get(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n if (detail) {\n details.push(detail);\n context.capturedExecutions.add(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n } else {\n unresolvedExecutionIds.push(trace.executionId);\n if (!metrics) {\n const reason = `Model usage is unavailable for execution ${trace.executionId}.`;\n missingUsage.push(reason);\n context.missingMetrics.add(reason);\n }\n }\n }\n\n let agentDetailDiagnostic: string | undefined;\n if (unresolvedExecutionIds.length > 0) {\n agentDetailDiagnostic = `Agent detail could not be resolved for ${unresolvedExecutionIds.join(', ')}.`;\n const sources = reportSourcesForScope(context, scopeId);\n for (const executionId of unresolvedExecutionIds) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-detail-unresolved',\n message: `Agent detail could not be resolved for execution ${executionId} in test scope ${scopeId}.`,\n scopeId,\n executionId,\n stepId,\n ...(sources.length > 0\n ? { sourcePaths: sources.map((source) => source.sourcePath) }\n : {}),\n });\n }\n } else if (details.length === 0 && exactMidsceneDetailNodes.has(step.node)) {\n agentDetailDiagnostic =\n 'This Agent did not expose a stable execution reference for the Step.';\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-detail-unavailable',\n message: `No stable Agent execution reference was captured for ${step.node} in test scope ${scopeId}.`,\n scopeId,\n stepId,\n ...(reportSourcesForScope(context, scopeId).length > 0\n ? {\n sourcePaths: reportSourcesForScope(context, scopeId).map(\n (source) => source.sourcePath,\n ),\n }\n : {}),\n });\n }\n\n const collectionErrors =\n step.report?.collectionErrors?.map(sanitizeReportError) ?? [];\n for (const error of collectionErrors) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-source-unavailable',\n scopeId,\n stepId,\n error,\n message: `Report collection for ${step.node}: ${error.message}`,\n });\n }\n const snapshots =\n step.report?.sources?.flatMap((source) =>\n source.collection ? [source.collection] : [],\n ) ?? [];\n const evidenceCollection =\n snapshots.length ||\n collectionErrors.length ||\n details.length ||\n unresolvedExecutionIds.length\n ? {\n status: (collectionErrors.length ||\n unresolvedExecutionIds.length ||\n snapshots.some((snapshot) => snapshot.status === 'partial')\n ? details.length\n ? 'partial'\n : 'unknown'\n : 'complete') as 'complete' | 'partial' | 'unknown',\n ...(snapshots.length\n ? {\n capturedAt: snapshots\n .map((snapshot) => snapshot.capturedAt)\n .sort()\n .at(-1),\n }\n : {}),\n ...(collectionErrors.length ? { errors: collectionErrors } : {}),\n }\n : undefined;\n // A missing link does not invalidate usage already captured independently.\n if (\n !step.report?.traces.length &&\n collectionErrors.length &&\n !details.length\n ) {\n const reason = `Model usage could not be collected for step ${stepId}.`;\n missingUsage.push(reason);\n context.missingMetrics.add(reason);\n }\n\n const input = step.input as Record<string, unknown> | undefined;\n const candidateTitle =\n input?.prompt ?? input?.script ?? input?.scenario ?? input?.title;\n const prompt =\n typeof candidateTitle === 'string'\n ? candidateTitle\n : typeof candidateTitle === 'object' &&\n candidateTitle !== null &&\n 'prompt' in candidateTitle &&\n typeof candidateTitle.prompt === 'string'\n ? candidateTitle.prompt\n : undefined;\n return {\n id: stepId,\n ...(plan ? { planStepId: plan.id } : {}),\n phase: step.phase,\n stepIndex: step.stepIndex,\n node: step.node,\n ...(prompt ? { title: sanitizeReportText(prompt, 240) } : {}),\n status: step.status,\n continuedAfterError: step.continuedAfterError,\n ...(step.waitForPreviousOperationMs\n ? { waitForPreviousOperationMs: step.waitForPreviousOperationMs }\n : {}),\n startedAt: step.startedAt,\n endedAt: step.endedAt,\n durationMs: step.durationMs,\n ...(step.operations\n ? {\n operations: {\n ...step.operations,\n events: [...step.operations.events],\n },\n }\n : {}),\n input: sanitizeReportValue(step.input),\n ...(step.output\n ? {\n output: {\n ...(step.output.summary === undefined\n ? {}\n : { summary: sanitizeReportText(step.output.summary) }),\n ...(step.output.data === undefined\n ? {}\n : { data: sanitizeReportValue(step.output.data) }),\n },\n }\n : {}),\n ...(step.error ? { error: sanitizeReportError(step.error) } : {}),\n ...(details.length > 0 ? { agentDetails: details } : {}),\n ...(agentDetailDiagnostic ? { agentDetailDiagnostic } : {}),\n ...(usage.length || missingUsage.length\n ? { metrics: sumTestRunReportMetrics(usage, missingUsage) }\n : {}),\n ...(evidenceCollection\n ? {\n evidenceCollection: {\n ...evidenceCollection,\n ...(missingUsage.length ? { modelUsageUnavailable: true } : {}),\n },\n }\n : {}),\n };\n};\n\nconst attemptReportScope = (attempt: CaseRunResult): string =>\n attempt.reportScopeId ?? attempt.runId;\n\nconst buildAttempt = (\n attempt: CaseRunResult,\n context: ManifestBuildContext,\n plan?: TestRunReportCasePlan,\n): TestRunReportAttempt => {\n const scopeId = attemptReportScope(attempt);\n return {\n attemptId: attempt.runId,\n attemptIndex: attempt.attemptIndex,\n status: attempt.status,\n ...(attempt.executionStatus\n ? { executionStatus: attempt.executionStatus }\n : {}),\n ...(attempt.phases ? { phases: attempt.phases } : {}),\n ...(attempt.cleanup ? { cleanup: attempt.cleanup } : {}),\n ...(attempt.pendingOperations\n ? { pendingOperations: attempt.pendingOperations }\n : {}),\n ...(attempt.retryDecision ? { retryDecision: attempt.retryDecision } : {}),\n startedAt: attempt.startedAt,\n endedAt: attempt.endedAt,\n durationMs: attempt.durationMs,\n beforeEach: attempt.beforeEach.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.beforeEach[step.stepIndex],\n ),\n ),\n steps: attempt.steps.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.steps[step.stepIndex],\n ),\n ),\n afterEach: attempt.afterEach.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.afterEach[step.stepIndex],\n ),\n ),\n ...(attempt.executionErrors?.length\n ? {\n hostErrors: attempt.executionErrors.map((error) => ({\n phase: 'execution' as const,\n error: sanitizeReportError(error),\n })),\n }\n : {}),\n ...(attempt.teardownErrors?.length\n ? { teardownErrors: attempt.teardownErrors.map(sanitizeReportError) }\n : {}),\n ...(reportSourcesForScope(context, scopeId).length > 0\n ? {\n scopeReportIds: reportSourcesForScope(context, scopeId).map(\n (source) => source.reportId,\n ),\n }\n : {}),\n };\n};\n\nconst buildCase = (\n outcome: RunReportCaseInput,\n context: ManifestBuildContext,\n plan?: TestRunReportCasePlan,\n): TestRunReportCase => ({\n ...(plan ? { plan } : {}),\n caseId: outcome.caseId,\n name: outcome.name,\n caseIndex: outcome.caseIndex,\n status: outcome.status,\n ...(outcome.notRunReason ? { notRunReason: outcome.notRunReason } : {}),\n attempts: (outcome.attempts ?? (outcome.run ? [outcome.run] : [])).map(\n (attempt) => buildAttempt(attempt, context, plan),\n ),\n});\n\nconst documentReportScope = (document: WorkflowDocumentRunResult): string =>\n document.reportScopeId ?? document.documentRunId;\n\nconst buildDocument = (\n documentId: string,\n document: WorkflowDocumentRunResult | undefined,\n cases: readonly RunReportCaseInput[],\n context: ManifestBuildContext,\n plan?: TestRunReportDocumentPlan,\n): TestRunReportDocument => {\n plan ??= document?.plan;\n const sourcePath =\n document?.sourcePath ?? cases[0]?.sourcePath ?? '<unknown>';\n const status =\n document?.status ??\n (cases.some((item) => item.status !== 'success') ? 'failed' : 'success');\n const scopeId = document ? documentReportScope(document) : undefined;\n return {\n documentId,\n ...(plan ? { plan } : {}),\n ...(document\n ? {\n logicalDocumentId: document.documentId,\n documentRunId: document.documentRunId,\n ...(document.attemptIndex === undefined\n ? {}\n : { attemptIndex: document.attemptIndex }),\n }\n : {}),\n sourcePath,\n status,\n ...(document?.executionStatus\n ? { executionStatus: document.executionStatus }\n : {}),\n ...(document?.phases ? { phases: document.phases } : {}),\n ...(document?.cleanup ? { cleanup: document.cleanup } : {}),\n ...(document?.pendingOperations\n ? { pendingOperations: document.pendingOperations }\n : {}),\n ...(document?.retryDecision\n ? { retryDecision: document.retryDecision }\n : {}),\n ...(document\n ? {\n startedAt: document.startedAt,\n endedAt: document.endedAt,\n durationMs: document.durationMs,\n }\n : {}),\n beforeAll: (document?.beforeAll ?? []).map((step) =>\n buildStep(\n step,\n scopeId!,\n context,\n document!.documentRunId,\n plan?.beforeAll[step.stepIndex],\n ),\n ),\n cases: cases.map((outcome) =>\n buildCase(\n outcome,\n context,\n plan?.cases.find((item) => item.caseId === outcome.caseId),\n ),\n ),\n afterAll: (document?.afterAll ?? []).map((step) =>\n buildStep(\n step,\n scopeId!,\n context,\n document!.documentRunId,\n plan?.afterAll[step.stepIndex],\n ),\n ),\n ...(document?.hostErrors?.length || document?.executionErrors?.length\n ? {\n hostErrors: [\n ...(document?.hostErrors ?? []),\n ...(document?.executionErrors ?? []).map((error) => ({\n phase: 'execution' as const,\n error,\n })),\n ].map(({ phase, error }) => ({\n phase,\n error: sanitizeReportError(error),\n })),\n }\n : {}),\n ...(document?.teardownErrors?.length\n ? { teardownErrors: document.teardownErrors.map(sanitizeReportError) }\n : {}),\n ...(scopeId && reportSourcesForScope(context, scopeId).length > 0\n ? {\n scopeReportIds: reportSourcesForScope(context, scopeId).map(\n (source) => source.reportId,\n ),\n }\n : {}),\n };\n};\n\nconst buildProject = (\n project: RunReportInput['projects'][number],\n context: ManifestBuildContext,\n): TestRunReportProject => {\n const documentCount = new Map<string, number>();\n for (const document of project.documents) {\n documentCount.set(\n document.documentId,\n (documentCount.get(document.documentId) ?? 0) + 1,\n );\n }\n for (const outcome of project.cases) {\n if (\n (documentCount.get(outcome.documentId) ?? 0) > 1 &&\n !outcome.documentRunId\n ) {\n throw new Error(\n `Case ${outcome.caseId} must identify its documentRunId when a document has multiple attempts.`,\n );\n }\n }\n // A new attemptIndex 0 begins a distinct invocation of the same file. Only\n // whole-file retries belong to one logical document and its Case history.\n const groups: WorkflowDocumentRunResult[][] = [];\n const currentGroup = new Map<string, WorkflowDocumentRunResult[]>();\n for (const document of project.documents) {\n let group = currentGroup.get(document.documentId);\n if (!group || !document.attemptIndex) {\n group = [];\n groups.push(group);\n currentGroup.set(document.documentId, group);\n }\n group.push(document);\n }\n const documents = groups.map((group) => {\n const first = group[0];\n const last = group.at(-1)!;\n const documentId =\n groups.filter((item) => item[0].documentId === first.documentId).length >\n 1\n ? `${first.documentId}:${first.documentRunId}`\n : first.documentId;\n const outcomes = new Map<string, RunReportCaseInput>();\n for (const document of group) {\n for (const outcome of project.cases.filter(\n (item) =>\n item.documentId === document.documentId &&\n (!item.documentRunId ||\n item.documentRunId === document.documentRunId),\n )) {\n const previous = outcomes.get(outcome.caseId);\n outcomes.set(outcome.caseId, {\n ...outcome,\n attempts: [\n ...(previous?.attempts ?? []),\n ...(outcome.attempts ?? (outcome.run ? [outcome.run] : [])).map(\n (attempt) => ({\n ...attempt,\n attemptIndex: document.attemptIndex ?? attempt.attemptIndex,\n }),\n ),\n ],\n });\n }\n }\n const result = buildDocument(\n documentId,\n last,\n [...outcomes.values()],\n context,\n project.plans?.find((plan) => plan.documentId === last.documentId),\n );\n if (group.length > 1) {\n result.startedAt = first.startedAt;\n result.durationMs = Math.max(\n 0,\n Date.parse(last.endedAt) - Date.parse(first.startedAt),\n );\n result.attempts = group.map((document) => {\n const { cases: _cases, ...attempt } = buildDocument(\n documentId,\n document,\n [],\n context,\n project.plans?.find(\n (plan) => plan.documentId === document.documentId,\n ),\n );\n return attempt;\n });\n }\n return result;\n });\n // Collection/setup failures can have Cases but no started document runtime.\n for (const documentId of new Set(\n project.cases.map((outcome) => outcome.documentId),\n )) {\n if (!documentCount.has(documentId)) {\n documents.push(\n buildDocument(\n documentId,\n undefined,\n project.cases.filter((outcome) => outcome.documentId === documentId),\n context,\n project.plans?.find((plan) => plan.documentId === documentId),\n ),\n );\n }\n }\n\n return {\n ...(project.plans ? { plans: project.plans } : {}),\n projectId: project.projectId,\n name: project.name,\n ...(project.platform?.trim() ? { platform: project.platform.trim() } : {}),\n status: project.status,\n retry: project.retry,\n ...(project.lifecycle\n ? {\n lifecycle: {\n status: project.lifecycle.status,\n startedAt: project.lifecycle.startedAt,\n endedAt: project.lifecycle.endedAt,\n durationMs: project.lifecycle.durationMs,\n ...(project.lifecycle.cleanup\n ? { cleanup: project.lifecycle.cleanup }\n : {}),\n ...(project.lifecycle.pendingOperations\n ? { pendingOperations: project.lifecycle.pendingOperations }\n : {}),\n ...(project.lifecycle.setupError\n ? {\n setupError: sanitizeReportError(project.lifecycle.setupError),\n }\n : {}),\n ...(project.lifecycle.teardownErrors?.length\n ? {\n teardownErrors:\n project.lifecycle.teardownErrors.map(sanitizeReportError),\n }\n : {}),\n },\n }\n : {}),\n documents,\n collectionErrors: project.collectionErrors.map((collectionError) => ({\n sourcePath: collectionError.sourcePath,\n error: sanitizeReportError(collectionError.error),\n })),\n };\n};\n\nexport function collectTestRunReportSources(\n result: RunReportInput,\n): TestRunReportSource[] {\n const sources: TestRunReportSource[] = [];\n for (const project of result.projects) {\n for (const document of project.documents) {\n for (const source of document.reportSources ?? [])\n sources.push({ ...source, scopeId: documentReportScope(document) });\n for (const sourcePath of (document.reportPaths ?? []).filter(\n (path) =>\n !document.reportSources?.some((source) => source.sourcePath === path),\n )) {\n sources.push({\n scopeId: documentReportScope(document),\n sourcePath,\n });\n }\n }\n for (const outcome of project.cases) {\n for (const attempt of outcome.attempts ??\n (outcome.run ? [outcome.run] : [])) {\n for (const source of attempt.reportSources ?? [])\n sources.push({ ...source, scopeId: attemptReportScope(attempt) });\n for (const sourcePath of (attempt.reportPaths ?? []).filter(\n (path) =>\n !attempt.reportSources?.some(\n (source) => source.sourcePath === path,\n ),\n )) {\n sources.push({ scopeId: attemptReportScope(attempt), sourcePath });\n }\n }\n }\n }\n return sources;\n}\n\nexport function buildTestRunReportDump(\n result: RunReportInput,\n index: TestRunReportSourceIndex,\n): TestRunReportDump {\n const sourcesByScope = new Map<string, IndexedTestRunReportSource[]>();\n const detailsByScopeAndExecution = new Map<\n string,\n TestRunReportAgentDetail\n >();\n for (const source of index.sources) {\n const scopeSources = sourcesByScope.get(source.scopeId) ?? [];\n scopeSources.push(source);\n sourcesByScope.set(source.scopeId, scopeSources);\n for (const executionId of source.executionIds) {\n detailsByScopeAndExecution.set(\n scopedExecutionKey(source.scopeId, executionId),\n { reportId: source.reportId, executionId },\n );\n }\n }\n const context: ManifestBuildContext = {\n diagnostics: (index.diagnostics ?? []).map((diagnostic) => ({\n ...diagnostic,\n message: sanitizeReportText(diagnostic.message),\n })),\n sourcesByScope,\n detailsByScopeAndExecution,\n tracedScopeByExecution: new Map(),\n expectedExecutions: new Set(),\n capturedExecutions: new Set(),\n executionMetrics: new Map(Object.entries(index.executionMetrics ?? {})),\n missingMetrics: new Set(),\n tracedScopes: new Set(),\n };\n for (const error of result.errors ?? []) {\n addDiagnostic(context, {\n level: 'error',\n code: 'run-infrastructure-error',\n message: sanitizeReportError(error).message,\n error: sanitizeReportError(error),\n });\n }\n for (const source of index.sources) {\n if (source.executionIds.length === 0) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'source-without-executions',\n message: `Agent report contains no executions: ${source.sourcePath}`,\n scopeId: source.scopeId,\n sourcePaths: [source.sourcePath],\n });\n }\n }\n\n const projects = result.projects.map((project) =>\n buildProject(project, context),\n );\n for (const diagnostic of index.diagnostics ?? [])\n if (\n diagnostic.code === 'agent-source-unavailable' &&\n (!diagnostic.scopeId || !context.tracedScopes.has(diagnostic.scopeId))\n )\n context.missingMetrics.add(diagnostic.message);\n const metrics = sumTestRunReportMetrics(\n [\n ...(index.sources.length ||\n (!index.executionMetrics &&\n (index.metrics.modelCallCount || index.metrics.collection))\n ? [index.capturedMetrics ?? index.metrics]\n : []),\n ...[...context.executionMetrics.entries()]\n .filter(([id]) => !index.executionMetrics?.[id])\n .map(([, value]) => value),\n ],\n [...context.missingMetrics],\n );\n return {\n schemaVersion: 1,\n kind: 'test-runner',\n runId: result.runId,\n ...(result.operationLog\n ? { operationLogs: [{ ...result.operationLog }] }\n : {}),\n status: result.status,\n startedAt: result.startedAt,\n endedAt: result.endedAt,\n durationMs: result.durationMs,\n summary: { ...result.summary },\n metrics: {\n ...metrics,\n collection: {\n ...metrics.collection!,\n expectedExecutionCount: context.expectedExecutions.size,\n capturedExecutionCount: context.capturedExecutions.size,\n },\n },\n ...(index.executionMetrics || context.executionMetrics.size\n ? { executionMetrics: Object.fromEntries(context.executionMetrics) }\n : {}),\n projects,\n ...(context.diagnostics.length > 0\n ? { diagnostics: context.diagnostics }\n : {}),\n };\n}\n"],"names":["exactMidsceneDetailNodes","Set","scopedExecutionKey","scopeId","executionId","reportSourcesForScope","context","addDiagnostic","diagnostic","buildStep","step","plan","stepId","sanitizeReportText","sanitizeReportValue","sanitizeReportError","details","unresolvedExecutionIds","usage","missingUsage","trace","metrics","previousScope","Error","detail","reason","agentDetailDiagnostic","sources","source","collectionErrors","error","snapshots","evidenceCollection","snapshot","undefined","input","candidateTitle","prompt","sumTestRunReportMetrics","attemptReportScope","attempt","buildAttempt","buildCase","outcome","documentReportScope","document","buildDocument","documentId","cases","sourcePath","status","item","phase","buildProject","project","documentCount","Map","groups","currentGroup","group","documents","first","last","outcomes","previous","result","Math","Date","_cases","collectionError","collectTestRunReportSources","path","buildTestRunReportDump","index","sourcesByScope","detailsByScopeAndExecution","scopeSources","Object","projects","id","value"],"mappings":";;AA8BA,MAAMA,2BAA2B,IAAIC,IAAI;IACvC;IACA;IACA;CACD;AAcD,MAAMC,qBAAqB,CAACC,SAAiBC,cAC3C,GAAGD,QAAQ,MAAM,EAAEC,aAAa;AAElC,MAAMC,wBAAwB,CAC5BC,SACAH,UACiCG,QAAQ,cAAc,CAAC,GAAG,CAACH,YAAY,EAAE;AAE5E,MAAMI,gBAAgB,CACpBD,SACAE;IAEAF,QAAQ,WAAW,CAAC,IAAI,CAACE;AAC3B;AAEA,MAAMC,YAAY,CAChBC,MACAP,SACAG,SACAF,aACAO;IAEA,MAAMC,SAAS,GAAGR,YAAY,CAAC,EAAEM,KAAK,KAAK,CAAC,CAAC,EAAEA,KAAK,SAAS,EAAE;IAC/D,IAAIA,AAAgB,cAAhBA,KAAK,MAAM,EACb,OAAO;QACL,IAAIE;QACJ,GAAID,OAAO;YAAE,YAAYA,KAAK,EAAE;YAAE,OAAOA,KAAK,KAAK;QA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IACjE,CAAC,CAAC;QACNwE;QACA,GAAIxE,QAAQ,WAAW,CAAC,MAAM,GAAG,IAC7B;YAAE,aAAaA,QAAQ,WAAW;QAAC,IACnC,CAAC,CAAC;IACR;AACF"}
|
|
1
|
+
{"version":3,"file":"test-runner/reporting/test-run-report.mjs","sources":["../../../../src/test-runner/reporting/test-run-report.ts"],"sourcesContent":["import type {\n IndexedTestRunReportSource,\n TestRunReportAgentDetail,\n TestRunReportAttempt,\n TestRunReportCase,\n TestRunReportCasePlan,\n TestRunReportDiagnostic,\n TestRunReportDocument,\n TestRunReportDocumentPlan,\n TestRunReportDump,\n TestRunReportMetrics,\n TestRunReportPlannedStep,\n TestRunReportProject,\n TestRunReportSource,\n TestRunReportSourceIndex,\n TestRunReportStep,\n} from '../../test-run-report';\nimport type {\n CaseRunResult,\n StepRunResult,\n WorkflowDocumentRunResult,\n} from '../engine/types';\nimport { sumTestRunReportMetrics } from './metrics';\nimport {\n sanitizeReportError,\n sanitizeReportText,\n sanitizeReportValue,\n} from './sanitize';\nimport type { RunReportCaseInput, RunReportInput } from './types';\n\nconst exactMidsceneDetailNodes = new Set([\n 'aiAct',\n 'aiAssert',\n 'recordToReport',\n]);\n\ninterface ManifestBuildContext {\n diagnostics: TestRunReportDiagnostic[];\n sourcesByScope: Map<string, IndexedTestRunReportSource[]>;\n detailsByScopeAndExecution: Map<string, TestRunReportAgentDetail>;\n tracedScopeByExecution: Map<string, string>;\n expectedExecutions: Set<string>;\n capturedExecutions: Set<string>;\n executionMetrics: Map<string, TestRunReportMetrics>;\n missingMetrics: Set<string>;\n tracedScopes: Set<string>;\n}\n\nconst scopedExecutionKey = (scopeId: string, executionId: string): string =>\n `${scopeId}\\u0000${executionId}`;\n\nconst reportSourcesForScope = (\n context: ManifestBuildContext,\n scopeId: string,\n): IndexedTestRunReportSource[] => context.sourcesByScope.get(scopeId) ?? [];\n\nconst addDiagnostic = (\n context: ManifestBuildContext,\n diagnostic: TestRunReportDiagnostic,\n): void => {\n context.diagnostics.push(diagnostic);\n};\n\nconst buildStep = (\n step: StepRunResult,\n scopeId: string,\n context: ManifestBuildContext,\n executionId: string,\n plan?: TestRunReportPlannedStep,\n): TestRunReportStep => {\n const stepId = `${executionId}:${step.phase}:${step.stepIndex}`;\n if (step.status === 'not-run')\n return {\n id: stepId,\n ...(plan ? { planStepId: plan.id, title: plan.title } : {}),\n phase: step.phase,\n stepIndex: step.stepIndex,\n node: step.node,\n status: 'not-run',\n notRunReason: sanitizeReportText(step.notRunReason),\n ...(step.blockedBy ? { blockedBy: step.blockedBy } : {}),\n continuedAfterError: step.continuedAfterError,\n ...(step.waitForPreviousOperationMs\n ? { waitForPreviousOperationMs: step.waitForPreviousOperationMs }\n : {}),\n input: sanitizeReportValue(step.input),\n ...(step.error ? { error: sanitizeReportError(step.error) } : {}),\n ...(step.operations\n ? {\n operations: {\n ...step.operations,\n events: [...step.operations.events],\n },\n }\n : {}),\n };\n const details: TestRunReportAgentDetail[] = [];\n const unresolvedExecutionIds: string[] = [];\n const usage: TestRunReportMetrics[] = [];\n const missingUsage: string[] = [];\n for (const trace of step.report?.traces ?? []) {\n context.tracedScopes.add(scopeId);\n const metrics =\n context.executionMetrics.get(trace.executionId) ?? trace.metrics;\n if (metrics) {\n context.executionMetrics.set(trace.executionId, metrics);\n usage.push(metrics);\n }\n context.expectedExecutions.add(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n const previousScope = context.tracedScopeByExecution.get(trace.executionId);\n if (previousScope && previousScope !== scopeId) {\n throw new Error(\n `Agent execution ${trace.executionId} was traced by multiple test scopes (${previousScope}, ${scopeId}).`,\n );\n }\n context.tracedScopeByExecution.set(trace.executionId, scopeId);\n const detail = context.detailsByScopeAndExecution.get(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n if (detail) {\n details.push(detail);\n context.capturedExecutions.add(\n scopedExecutionKey(scopeId, trace.executionId),\n );\n } else {\n unresolvedExecutionIds.push(trace.executionId);\n if (!metrics) {\n const reason = `Model usage is unavailable for execution ${trace.executionId}.`;\n missingUsage.push(reason);\n context.missingMetrics.add(reason);\n }\n }\n }\n\n let agentDetailDiagnostic: string | undefined;\n if (unresolvedExecutionIds.length > 0) {\n agentDetailDiagnostic = `Agent detail could not be resolved for ${unresolvedExecutionIds.join(', ')}.`;\n const sources = reportSourcesForScope(context, scopeId);\n for (const executionId of unresolvedExecutionIds) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-detail-unresolved',\n message: `Agent detail could not be resolved for execution ${executionId} in test scope ${scopeId}.`,\n scopeId,\n executionId,\n stepId,\n ...(sources.length > 0\n ? { sourcePaths: sources.map((source) => source.sourcePath) }\n : {}),\n });\n }\n } else if (details.length === 0 && exactMidsceneDetailNodes.has(step.node)) {\n agentDetailDiagnostic =\n 'This Agent did not expose a stable execution reference for the Step.';\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-detail-unavailable',\n message: `No stable Agent execution reference was captured for ${step.node} in test scope ${scopeId}.`,\n scopeId,\n stepId,\n ...(reportSourcesForScope(context, scopeId).length > 0\n ? {\n sourcePaths: reportSourcesForScope(context, scopeId).map(\n (source) => source.sourcePath,\n ),\n }\n : {}),\n });\n }\n\n const collectionErrors =\n step.report?.collectionErrors?.map(sanitizeReportError) ?? [];\n for (const error of collectionErrors) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'agent-source-unavailable',\n scopeId,\n stepId,\n error,\n message: `Report collection for ${step.node}: ${error.message}`,\n });\n }\n const snapshots =\n step.report?.sources?.flatMap((source) =>\n source.collection ? [source.collection] : [],\n ) ?? [];\n const evidenceCollection =\n snapshots.length ||\n collectionErrors.length ||\n details.length ||\n unresolvedExecutionIds.length\n ? {\n status: (collectionErrors.length ||\n unresolvedExecutionIds.length ||\n snapshots.some((snapshot) => snapshot.status === 'partial')\n ? details.length\n ? 'partial'\n : 'unknown'\n : 'complete') as 'complete' | 'partial' | 'unknown',\n ...(snapshots.length\n ? {\n capturedAt: snapshots\n .map((snapshot) => snapshot.capturedAt)\n .sort()\n .at(-1),\n }\n : {}),\n ...(collectionErrors.length ? { errors: collectionErrors } : {}),\n }\n : undefined;\n // A missing link does not invalidate usage already captured independently.\n if (\n !step.report?.traces.length &&\n collectionErrors.length &&\n !details.length\n ) {\n const reason = `Model usage could not be collected for step ${stepId}.`;\n missingUsage.push(reason);\n context.missingMetrics.add(reason);\n }\n\n const input = step.input as Record<string, unknown> | undefined;\n const candidateTitle =\n input?.prompt ?? input?.script ?? input?.scenario ?? input?.title;\n const prompt =\n typeof candidateTitle === 'string'\n ? candidateTitle\n : typeof candidateTitle === 'object' &&\n candidateTitle !== null &&\n 'prompt' in candidateTitle &&\n typeof candidateTitle.prompt === 'string'\n ? candidateTitle.prompt\n : undefined;\n return {\n id: stepId,\n ...(plan ? { planStepId: plan.id } : {}),\n phase: step.phase,\n stepIndex: step.stepIndex,\n node: step.node,\n ...(prompt ? { title: sanitizeReportText(prompt, 240) } : {}),\n status: step.status,\n continuedAfterError: step.continuedAfterError,\n ...(step.waitForPreviousOperationMs\n ? { waitForPreviousOperationMs: step.waitForPreviousOperationMs }\n : {}),\n startedAt: step.startedAt,\n endedAt: step.endedAt,\n durationMs: step.durationMs,\n ...(step.operations\n ? {\n operations: {\n ...step.operations,\n events: [...step.operations.events],\n },\n }\n : {}),\n input: sanitizeReportValue(step.input),\n ...(step.output\n ? {\n output: {\n ...(step.output.summary === undefined\n ? {}\n : { summary: sanitizeReportText(step.output.summary) }),\n ...(step.output.data === undefined\n ? {}\n : { data: sanitizeReportValue(step.output.data) }),\n },\n }\n : {}),\n ...(step.error ? { error: sanitizeReportError(step.error) } : {}),\n ...(details.length > 0 ? { agentDetails: details } : {}),\n ...(agentDetailDiagnostic ? { agentDetailDiagnostic } : {}),\n ...(usage.length || missingUsage.length\n ? { metrics: sumTestRunReportMetrics(usage, missingUsage) }\n : {}),\n ...(evidenceCollection\n ? {\n evidenceCollection: {\n ...evidenceCollection,\n ...(missingUsage.length ? { modelUsageUnavailable: true } : {}),\n },\n }\n : {}),\n };\n};\n\nconst attemptReportScope = (attempt: CaseRunResult): string =>\n attempt.reportScopeId ?? attempt.runId;\n\nconst buildAttempt = (\n attempt: CaseRunResult,\n context: ManifestBuildContext,\n plan?: TestRunReportCasePlan,\n): TestRunReportAttempt => {\n const scopeId = attemptReportScope(attempt);\n return {\n attemptId: attempt.runId,\n attemptIndex: attempt.attemptIndex,\n status: attempt.status,\n ...(attempt.executionStatus\n ? { executionStatus: attempt.executionStatus }\n : {}),\n ...(attempt.phases ? { phases: attempt.phases } : {}),\n ...(attempt.cleanup ? { cleanup: attempt.cleanup } : {}),\n ...(attempt.pendingOperations\n ? { pendingOperations: attempt.pendingOperations }\n : {}),\n ...(attempt.retryDecision ? { retryDecision: attempt.retryDecision } : {}),\n startedAt: attempt.startedAt,\n endedAt: attempt.endedAt,\n durationMs: attempt.durationMs,\n beforeEach: attempt.beforeEach.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.beforeEach[step.stepIndex],\n ),\n ),\n steps: attempt.steps.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.steps[step.stepIndex],\n ),\n ),\n afterEach: attempt.afterEach.map((step) =>\n buildStep(\n step,\n scopeId,\n context,\n attempt.runId,\n plan?.afterEach[step.stepIndex],\n ),\n ),\n ...(attempt.executionErrors?.length\n ? {\n hostErrors: attempt.executionErrors.map((error) => ({\n phase: 'execution' as const,\n error: sanitizeReportError(error),\n })),\n }\n : {}),\n ...(attempt.teardownErrors?.length\n ? { teardownErrors: attempt.teardownErrors.map(sanitizeReportError) }\n : {}),\n ...(reportSourcesForScope(context, scopeId).length > 0\n ? {\n scopeReportIds: reportSourcesForScope(context, scopeId).map(\n (source) => source.reportId,\n ),\n }\n : {}),\n };\n};\n\nconst buildCase = (\n outcome: RunReportCaseInput,\n context: ManifestBuildContext,\n plan?: TestRunReportCasePlan,\n): TestRunReportCase => ({\n ...(plan ? { plan } : {}),\n caseId: outcome.caseId,\n name: outcome.name,\n caseIndex: outcome.caseIndex,\n status: outcome.status,\n ...(outcome.notRunReason ? { notRunReason: outcome.notRunReason } : {}),\n attempts: (outcome.attempts ?? (outcome.run ? [outcome.run] : [])).map(\n (attempt) => buildAttempt(attempt, context, plan),\n ),\n ...(outcome.execution\n ? {\n execution: {\n executor: outcome.execution.executor,\n resources: [...outcome.execution.resources],\n ...(outcome.execution.attempts === undefined\n ? {}\n : { attempts: outcome.execution.attempts }),\n ...(outcome.execution.failure\n ? { failure: { ...outcome.execution.failure } }\n : {}),\n ...(outcome.execution.lifecycle\n ? {\n lifecycle: {\n status: outcome.execution.lifecycle.status,\n startedAt: outcome.execution.lifecycle.startedAt,\n endedAt: outcome.execution.lifecycle.endedAt,\n durationMs: outcome.execution.lifecycle.durationMs,\n ...(outcome.execution.lifecycle.setupError\n ? {\n setupError: sanitizeReportError(\n outcome.execution.lifecycle.setupError,\n ),\n }\n : {}),\n ...(outcome.execution.lifecycle.teardownErrors?.length\n ? {\n teardownErrors:\n outcome.execution.lifecycle.teardownErrors.map(\n sanitizeReportError,\n ),\n }\n : {}),\n },\n }\n : {}),\n ...(outcome.execution.artifacts\n ? {\n artifacts: outcome.execution.artifacts.map((artifact) => ({\n ...artifact,\n })),\n }\n : {}),\n ...(outcome.execution.metadata\n ? { metadata: { ...outcome.execution.metadata } }\n : {}),\n },\n }\n : {}),\n});\n\nconst documentReportScope = (document: WorkflowDocumentRunResult): string =>\n document.reportScopeId ?? document.documentRunId;\n\nconst buildDocument = (\n documentId: string,\n document: WorkflowDocumentRunResult | undefined,\n cases: readonly RunReportCaseInput[],\n context: ManifestBuildContext,\n plan?: TestRunReportDocumentPlan,\n): TestRunReportDocument => {\n plan ??= document?.plan;\n const sourcePath =\n document?.sourcePath ?? cases[0]?.sourcePath ?? '<unknown>';\n const status =\n document?.status ??\n (cases.some((item) => item.status !== 'success') ? 'failed' : 'success');\n const scopeId = document ? documentReportScope(document) : undefined;\n return {\n documentId,\n ...(plan ? { plan } : {}),\n ...(document\n ? {\n logicalDocumentId: document.documentId,\n documentRunId: document.documentRunId,\n ...(document.attemptIndex === undefined\n ? {}\n : { attemptIndex: document.attemptIndex }),\n }\n : {}),\n sourcePath,\n status,\n ...(document?.executionStatus\n ? { executionStatus: document.executionStatus }\n : {}),\n ...(document?.phases ? { phases: document.phases } : {}),\n ...(document?.cleanup ? { cleanup: document.cleanup } : {}),\n ...(document?.pendingOperations\n ? { pendingOperations: document.pendingOperations }\n : {}),\n ...(document?.retryDecision\n ? { retryDecision: document.retryDecision }\n : {}),\n ...(document\n ? {\n startedAt: document.startedAt,\n endedAt: document.endedAt,\n durationMs: document.durationMs,\n }\n : {}),\n beforeAll: (document?.beforeAll ?? []).map((step) =>\n buildStep(\n step,\n scopeId!,\n context,\n document!.documentRunId,\n plan?.beforeAll[step.stepIndex],\n ),\n ),\n cases: cases.map((outcome) =>\n buildCase(\n outcome,\n context,\n plan?.cases.find((item) => item.caseId === outcome.caseId),\n ),\n ),\n afterAll: (document?.afterAll ?? []).map((step) =>\n buildStep(\n step,\n scopeId!,\n context,\n document!.documentRunId,\n plan?.afterAll[step.stepIndex],\n ),\n ),\n ...(document?.hostErrors?.length || document?.executionErrors?.length\n ? {\n hostErrors: [\n ...(document?.hostErrors ?? []),\n ...(document?.executionErrors ?? []).map((error) => ({\n phase: 'execution' as const,\n error,\n })),\n ].map(({ phase, error }) => ({\n phase,\n error: sanitizeReportError(error),\n })),\n }\n : {}),\n ...(document?.teardownErrors?.length\n ? { teardownErrors: document.teardownErrors.map(sanitizeReportError) }\n : {}),\n ...(scopeId && reportSourcesForScope(context, scopeId).length > 0\n ? {\n scopeReportIds: reportSourcesForScope(context, scopeId).map(\n (source) => source.reportId,\n ),\n }\n : {}),\n };\n};\n\nconst buildProject = (\n project: RunReportInput['projects'][number],\n context: ManifestBuildContext,\n): TestRunReportProject => {\n const documentCount = new Map<string, number>();\n for (const document of project.documents) {\n documentCount.set(\n document.documentId,\n (documentCount.get(document.documentId) ?? 0) + 1,\n );\n }\n for (const outcome of project.cases) {\n if (\n (documentCount.get(outcome.documentId) ?? 0) > 1 &&\n !outcome.documentRunId\n ) {\n throw new Error(\n `Case ${outcome.caseId} must identify its documentRunId when a document has multiple attempts.`,\n );\n }\n }\n // A new attemptIndex 0 begins a distinct invocation of the same file. Only\n // whole-file retries belong to one logical document and its Case history.\n const groups: WorkflowDocumentRunResult[][] = [];\n const currentGroup = new Map<string, WorkflowDocumentRunResult[]>();\n for (const document of project.documents) {\n let group = currentGroup.get(document.documentId);\n if (!group || !document.attemptIndex) {\n group = [];\n groups.push(group);\n currentGroup.set(document.documentId, group);\n }\n group.push(document);\n }\n const documents = groups.map((group) => {\n const first = group[0];\n const last = group.at(-1)!;\n const documentId =\n groups.filter((item) => item[0].documentId === first.documentId).length >\n 1\n ? `${first.documentId}:${first.documentRunId}`\n : first.documentId;\n const outcomes = new Map<string, RunReportCaseInput>();\n for (const document of group) {\n for (const outcome of project.cases.filter(\n (item) =>\n item.documentId === document.documentId &&\n (!item.documentRunId ||\n item.documentRunId === document.documentRunId),\n )) {\n const previous = outcomes.get(outcome.caseId);\n outcomes.set(outcome.caseId, {\n ...outcome,\n attempts: [\n ...(previous?.attempts ?? []),\n ...(outcome.attempts ?? (outcome.run ? [outcome.run] : [])).map(\n (attempt) => ({\n ...attempt,\n attemptIndex: document.attemptIndex ?? attempt.attemptIndex,\n }),\n ),\n ],\n });\n }\n }\n const result = buildDocument(\n documentId,\n last,\n [...outcomes.values()],\n context,\n project.plans?.find((plan) => plan.documentId === last.documentId),\n );\n if (group.length > 1) {\n result.startedAt = first.startedAt;\n result.durationMs = Math.max(\n 0,\n Date.parse(last.endedAt) - Date.parse(first.startedAt),\n );\n result.attempts = group.map((document) => {\n const { cases: _cases, ...attempt } = buildDocument(\n documentId,\n document,\n [],\n context,\n project.plans?.find(\n (plan) => plan.documentId === document.documentId,\n ),\n );\n return attempt;\n });\n }\n return result;\n });\n // Collection/setup failures can have Cases but no started document runtime.\n for (const documentId of new Set(\n project.cases.map((outcome) => outcome.documentId),\n )) {\n if (!documentCount.has(documentId)) {\n documents.push(\n buildDocument(\n documentId,\n undefined,\n project.cases.filter((outcome) => outcome.documentId === documentId),\n context,\n project.plans?.find((plan) => plan.documentId === documentId),\n ),\n );\n }\n }\n\n return {\n ...(project.plans ? { plans: project.plans } : {}),\n projectId: project.projectId,\n name: project.name,\n ...(project.platform?.trim() ? { platform: project.platform.trim() } : {}),\n status: project.status,\n retry: project.retry,\n ...(project.lifecycle\n ? {\n lifecycle: {\n status: project.lifecycle.status,\n startedAt: project.lifecycle.startedAt,\n endedAt: project.lifecycle.endedAt,\n durationMs: project.lifecycle.durationMs,\n ...(project.lifecycle.cleanup\n ? { cleanup: project.lifecycle.cleanup }\n : {}),\n ...(project.lifecycle.pendingOperations\n ? { pendingOperations: project.lifecycle.pendingOperations }\n : {}),\n ...(project.lifecycle.setupError\n ? {\n setupError: sanitizeReportError(project.lifecycle.setupError),\n }\n : {}),\n ...(project.lifecycle.teardownErrors?.length\n ? {\n teardownErrors:\n project.lifecycle.teardownErrors.map(sanitizeReportError),\n }\n : {}),\n },\n }\n : {}),\n documents,\n collectionErrors: project.collectionErrors.map((collectionError) => ({\n sourcePath: collectionError.sourcePath,\n error: sanitizeReportError(collectionError.error),\n })),\n };\n};\n\nexport function collectTestRunReportSources(\n result: RunReportInput,\n): TestRunReportSource[] {\n const sources: TestRunReportSource[] = [];\n for (const project of result.projects) {\n for (const document of project.documents) {\n for (const source of document.reportSources ?? [])\n sources.push({ ...source, scopeId: documentReportScope(document) });\n for (const sourcePath of (document.reportPaths ?? []).filter(\n (path) =>\n !document.reportSources?.some((source) => source.sourcePath === path),\n )) {\n sources.push({\n scopeId: documentReportScope(document),\n sourcePath,\n });\n }\n }\n for (const outcome of project.cases) {\n for (const attempt of outcome.attempts ??\n (outcome.run ? [outcome.run] : [])) {\n for (const source of attempt.reportSources ?? [])\n sources.push({ ...source, scopeId: attemptReportScope(attempt) });\n for (const sourcePath of (attempt.reportPaths ?? []).filter(\n (path) =>\n !attempt.reportSources?.some(\n (source) => source.sourcePath === path,\n ),\n )) {\n sources.push({ scopeId: attemptReportScope(attempt), sourcePath });\n }\n }\n }\n }\n return sources;\n}\n\nexport function buildTestRunReportDump(\n result: RunReportInput,\n index: TestRunReportSourceIndex,\n): TestRunReportDump {\n const sourcesByScope = new Map<string, IndexedTestRunReportSource[]>();\n const detailsByScopeAndExecution = new Map<\n string,\n TestRunReportAgentDetail\n >();\n for (const source of index.sources) {\n const scopeSources = sourcesByScope.get(source.scopeId) ?? [];\n scopeSources.push(source);\n sourcesByScope.set(source.scopeId, scopeSources);\n for (const executionId of source.executionIds) {\n detailsByScopeAndExecution.set(\n scopedExecutionKey(source.scopeId, executionId),\n { reportId: source.reportId, executionId },\n );\n }\n }\n const context: ManifestBuildContext = {\n diagnostics: (index.diagnostics ?? []).map((diagnostic) => ({\n ...diagnostic,\n message: sanitizeReportText(diagnostic.message),\n })),\n sourcesByScope,\n detailsByScopeAndExecution,\n tracedScopeByExecution: new Map(),\n expectedExecutions: new Set(),\n capturedExecutions: new Set(),\n executionMetrics: new Map(Object.entries(index.executionMetrics ?? {})),\n missingMetrics: new Set(),\n tracedScopes: new Set(),\n };\n for (const error of result.errors ?? []) {\n addDiagnostic(context, {\n level: 'error',\n code: 'run-infrastructure-error',\n message: sanitizeReportError(error).message,\n error: sanitizeReportError(error),\n });\n }\n for (const source of index.sources) {\n if (source.executionIds.length === 0) {\n addDiagnostic(context, {\n level: 'warning',\n code: 'source-without-executions',\n message: `Agent report contains no executions: ${source.sourcePath}`,\n scopeId: source.scopeId,\n sourcePaths: [source.sourcePath],\n });\n }\n }\n\n const projects = result.projects.map((project) =>\n buildProject(project, context),\n );\n for (const diagnostic of index.diagnostics ?? [])\n if (\n diagnostic.code === 'agent-source-unavailable' &&\n (!diagnostic.scopeId || !context.tracedScopes.has(diagnostic.scopeId))\n )\n context.missingMetrics.add(diagnostic.message);\n const metrics = sumTestRunReportMetrics(\n [\n ...(index.sources.length ||\n (!index.executionMetrics &&\n (index.metrics.modelCallCount || index.metrics.collection))\n ? [index.capturedMetrics ?? index.metrics]\n : []),\n ...[...context.executionMetrics.entries()]\n .filter(([id]) => !index.executionMetrics?.[id])\n .map(([, value]) => value),\n ],\n [...context.missingMetrics],\n );\n return {\n schemaVersion: 1,\n kind: 'test-runner',\n runId: result.runId,\n ...(result.operationLog\n ? { operationLogs: [{ ...result.operationLog }] }\n : {}),\n status: result.status,\n startedAt: result.startedAt,\n endedAt: result.endedAt,\n durationMs: result.durationMs,\n summary: { ...result.summary },\n metrics: {\n ...metrics,\n collection: {\n ...metrics.collection!,\n expectedExecutionCount: context.expectedExecutions.size,\n capturedExecutionCount: context.capturedExecutions.size,\n },\n },\n ...(index.executionMetrics || context.executionMetrics.size\n ? { executionMetrics: Object.fromEntries(context.executionMetrics) }\n : {}),\n projects,\n ...(context.diagnostics.length > 0\n ? { diagnostics: context.diagnostics }\n : {}),\n };\n}\n"],"names":["exactMidsceneDetailNodes","Set","scopedExecutionKey","scopeId","executionId","reportSourcesForScope","context","addDiagnostic","diagnostic","buildStep","step","plan","stepId","sanitizeReportText","sanitizeReportValue","sanitizeReportError","details","unresolvedExecutionIds","usage","missingUsage","trace","metrics","previousScope","Error","detail","reason","agentDetailDiagnostic","sources","source","collectionErrors","error","snapshots","evidenceCollection","snapshot","undefined","input","candidateTitle","prompt","sumTestRunReportMetrics","attemptReportScope","attempt","buildAttempt","buildCase","outcome","artifact","documentReportScope","document","buildDocument","documentId","cases","sourcePath","status","item","phase","buildProject","project","documentCount","Map","groups","currentGroup","group","documents","first","last","outcomes","previous","result","Math","Date","_cases","collectionError","collectTestRunReportSources","path","buildTestRunReportDump","index","sourcesByScope","detailsByScopeAndExecution","scopeSources","Object","projects","id","value"],"mappings":";;AA8BA,MAAMA,2BAA2B,IAAIC,IAAI;IACvC;IACA;IACA;CACD;AAcD,MAAMC,qBAAqB,CAACC,SAAiBC,cAC3C,GAAGD,QAAQ,MA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KAAK;QACnB,GAAIA,OAAO,YAAY,GACnB;YAAE,eAAe;gBAAC;oBAAE,GAAGA,OAAO,YAAY;gBAAC;aAAE;QAAC,IAC9C,CAAC,CAAC;QACN,QAAQA,OAAO,MAAM;QACrB,WAAWA,OAAO,SAAS;QAC3B,SAASA,OAAO,OAAO;QACvB,YAAYA,OAAO,UAAU;QAC7B,SAAS;YAAE,GAAGA,OAAO,OAAO;QAAC;QAC7B,SAAS;YACP,GAAG7C,OAAO;YACV,YAAY;gBACV,GAAGA,QAAQ,UAAU;gBACrB,wBAAwBf,QAAQ,kBAAkB,CAAC,IAAI;gBACvD,wBAAwBA,QAAQ,kBAAkB,CAAC,IAAI;YACzD;QACF;QACA,GAAIoE,MAAM,gBAAgB,IAAIpE,QAAQ,gBAAgB,CAAC,IAAI,GACvD;YAAE,kBAAkBwE,OAAO,WAAW,CAACxE,QAAQ,gBAAgB;QAAE,IACjE,CAAC,CAAC;QACNyE;QACA,GAAIzE,QAAQ,WAAW,CAAC,MAAM,GAAG,IAC7B;YAAE,aAAaA,QAAQ,WAAW;QAAC,IACnC,CAAC,CAAC;IACR;AACF"}
|
package/dist/es/utils.mjs
CHANGED
|
@@ -184,7 +184,7 @@ function stringifyDumpData(data, indents) {
|
|
|
184
184
|
return JSON.stringify(data, replacerForPageObject, indents);
|
|
185
185
|
}
|
|
186
186
|
function getVersion() {
|
|
187
|
-
return "1.15.
|
|
187
|
+
return "1.15.4-beta-20261013090705.0";
|
|
188
188
|
}
|
|
189
189
|
function debugLog(...message) {
|
|
190
190
|
const debugMode = process.env[MIDSCENE_DEBUG_MODE];
|
package/dist/lib/agent/index.js
CHANGED
|
@@ -39,6 +39,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
39
39
|
actionInputSchema: ()=>external_test_runner_nodes_js_namespaceObject.actionInputSchema,
|
|
40
40
|
aiAssertInputSchema: ()=>external_test_runner_nodes_js_namespaceObject.aiAssertInputSchema,
|
|
41
41
|
structuredUserPromptInputSchema: ()=>external_test_runner_nodes_js_namespaceObject.structuredUserPromptInputSchema,
|
|
42
|
+
aiWaitForOptionsInputSchema: ()=>external_test_runner_nodes_js_namespaceObject.aiWaitForOptionsInputSchema,
|
|
42
43
|
taskTitleStr: ()=>external_ui_utils_js_namespaceObject.taskTitleStr,
|
|
43
44
|
extractInsightParam: ()=>external_ui_utils_js_namespaceObject.extractInsightParam,
|
|
44
45
|
cacheFileExt: ()=>external_task_cache_js_namespaceObject.cacheFileExt,
|
|
@@ -89,6 +90,7 @@ exports.aiQueryInputSchema = __webpack_exports__.aiQueryInputSchema;
|
|
|
89
90
|
exports.aiScrollInputSchema = __webpack_exports__.aiScrollInputSchema;
|
|
90
91
|
exports.aiTapInputSchema = __webpack_exports__.aiTapInputSchema;
|
|
91
92
|
exports.aiWaitForInputSchema = __webpack_exports__.aiWaitForInputSchema;
|
|
93
|
+
exports.aiWaitForOptionsInputSchema = __webpack_exports__.aiWaitForOptionsInputSchema;
|
|
92
94
|
exports.cacheFileExt = __webpack_exports__.cacheFileExt;
|
|
93
95
|
exports.commonAgentTestRunnerNodeDefinitions = __webpack_exports__.commonAgentTestRunnerNodeDefinitions;
|
|
94
96
|
exports.commonContextParser = __webpack_exports__.commonContextParser;
|
|
@@ -130,6 +132,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
130
132
|
"aiScrollInputSchema",
|
|
131
133
|
"aiTapInputSchema",
|
|
132
134
|
"aiWaitForInputSchema",
|
|
135
|
+
"aiWaitForOptionsInputSchema",
|
|
133
136
|
"cacheFileExt",
|
|
134
137
|
"commonAgentTestRunnerNodeDefinitions",
|
|
135
138
|
"commonContextParser",
|
|
@@ -24,34 +24,35 @@ var __webpack_require__ = {};
|
|
|
24
24
|
var __webpack_exports__ = {};
|
|
25
25
|
__webpack_require__.r(__webpack_exports__);
|
|
26
26
|
__webpack_require__.d(__webpack_exports__, {
|
|
27
|
-
insightOptionsInputSchema: ()=>insightOptionsInputSchema,
|
|
28
27
|
javascriptInputSchema: ()=>javascriptInputSchema,
|
|
29
|
-
|
|
30
|
-
aiTapInputSchema: ()=>aiTapInputSchema,
|
|
31
|
-
aiScrollInputSchema: ()=>aiScrollInputSchema,
|
|
32
|
-
createAgentTestRunnerNodeDefinition: ()=>createAgentTestRunnerNodeDefinition,
|
|
33
|
-
aiInputInputSchema: ()=>aiInputInputSchema,
|
|
28
|
+
runGherkinScenarioInputSchema: ()=>runGherkinScenarioInputSchema,
|
|
34
29
|
reportScreenshotInputSchema: ()=>reportScreenshotInputSchema,
|
|
30
|
+
createAgentTestRunnerNodeDefinition: ()=>createAgentTestRunnerNodeDefinition,
|
|
35
31
|
insightInputSchema: ()=>insightInputSchema,
|
|
36
32
|
aiKeyboardPressInputSchema: ()=>aiKeyboardPressInputSchema,
|
|
37
|
-
|
|
33
|
+
locateOptionsInputSchema: ()=>locateOptionsInputSchema,
|
|
38
34
|
aiQueryInputSchema: ()=>aiQueryInputSchema,
|
|
39
35
|
aiLongPressInputSchema: ()=>aiLongPressInputSchema,
|
|
40
36
|
actionInputSchema: ()=>actionInputSchema,
|
|
41
37
|
aiAssertInputSchema: ()=>aiAssertInputSchema,
|
|
42
|
-
commonAgentTestRunnerNodeDefinitions: ()=>commonAgentTestRunnerNodeDefinitions,
|
|
43
|
-
locateOptionsInputSchema: ()=>locateOptionsInputSchema,
|
|
44
|
-
promptImageInputSchema: ()=>promptImageInputSchema,
|
|
45
|
-
recordToReportInputSchema: ()=>recordToReportInputSchema,
|
|
46
|
-
recordToReportOptionsInputSchema: ()=>recordToReportOptionsInputSchema,
|
|
47
|
-
runGherkinScenarioInputSchema: ()=>runGherkinScenarioInputSchema,
|
|
48
38
|
structuredUserPromptInputSchema: ()=>structuredUserPromptInputSchema,
|
|
39
|
+
aiWaitForOptionsInputSchema: ()=>aiWaitForOptionsInputSchema,
|
|
40
|
+
recordToReportOptionsInputSchema: ()=>recordToReportOptionsInputSchema,
|
|
49
41
|
setAIContextInputSchema: ()=>setAIContextInputSchema,
|
|
42
|
+
aiActInputSchema: ()=>aiActInputSchema,
|
|
43
|
+
aiActOptionsInputSchema: ()=>aiActOptionsInputSchema,
|
|
44
|
+
aiTapInputSchema: ()=>aiTapInputSchema,
|
|
45
|
+
aiScrollInputSchema: ()=>aiScrollInputSchema,
|
|
46
|
+
aiInputInputSchema: ()=>aiInputInputSchema,
|
|
47
|
+
aiPinchInputSchema: ()=>aiPinchInputSchema,
|
|
48
|
+
promptImageInputSchema: ()=>promptImageInputSchema,
|
|
49
|
+
commonAgentTestRunnerNodeDefinitions: ()=>commonAgentTestRunnerNodeDefinitions,
|
|
50
|
+
recordToReportInputSchema: ()=>recordToReportInputSchema,
|
|
50
51
|
aiWaitForInputSchema: ()=>aiWaitForInputSchema,
|
|
51
52
|
userPromptInputSchema: ()=>userPromptInputSchema,
|
|
52
53
|
aiDragAndDropInputSchema: ()=>aiDragAndDropInputSchema,
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
aiAssertOptionsInputSchema: ()=>aiAssertOptionsInputSchema,
|
|
55
|
+
insightOptionsInputSchema: ()=>insightOptionsInputSchema
|
|
55
56
|
});
|
|
56
57
|
const agent_context_namespaceObject = require("@midscene/shared/agent-tools/agent-context");
|
|
57
58
|
const v4_namespaceObject = require("zod/v4");
|
|
@@ -227,12 +228,21 @@ const aiQueryInputSchema = v4_namespaceObject.z.strictObject({
|
|
|
227
228
|
]),
|
|
228
229
|
options: insightOptionsInputSchema.optional()
|
|
229
230
|
});
|
|
231
|
+
const aiWaitForOptionsInputSchema = insightOptionsInputSchema.extend({
|
|
232
|
+
timeoutMs: v4_namespaceObject.z.number().positive().optional(),
|
|
233
|
+
checkIntervalMs: v4_namespaceObject.z.number().positive().optional()
|
|
234
|
+
}).superRefine((input, context)=>{
|
|
235
|
+
if ((input.checkIntervalMs ?? 3000) > (input.timeoutMs ?? 15000)) context.addIssue({
|
|
236
|
+
code: 'custom',
|
|
237
|
+
path: [
|
|
238
|
+
'checkIntervalMs'
|
|
239
|
+
],
|
|
240
|
+
message: 'checkIntervalMs must not exceed timeoutMs'
|
|
241
|
+
});
|
|
242
|
+
});
|
|
230
243
|
const aiWaitForInputSchema = v4_namespaceObject.z.strictObject({
|
|
231
244
|
prompt: userPromptInputSchema,
|
|
232
|
-
options:
|
|
233
|
-
timeoutMs: v4_namespaceObject.z.number().positive().optional(),
|
|
234
|
-
checkIntervalMs: v4_namespaceObject.z.number().positive().optional()
|
|
235
|
-
}).optional()
|
|
245
|
+
options: aiWaitForOptionsInputSchema.optional()
|
|
236
246
|
});
|
|
237
247
|
const javascriptInputSchema = v4_namespaceObject.z.strictObject({
|
|
238
248
|
script: nonBlankText('JavaScript to evaluate through the current interface.')
|
|
@@ -603,6 +613,7 @@ exports.aiQueryInputSchema = __webpack_exports__.aiQueryInputSchema;
|
|
|
603
613
|
exports.aiScrollInputSchema = __webpack_exports__.aiScrollInputSchema;
|
|
604
614
|
exports.aiTapInputSchema = __webpack_exports__.aiTapInputSchema;
|
|
605
615
|
exports.aiWaitForInputSchema = __webpack_exports__.aiWaitForInputSchema;
|
|
616
|
+
exports.aiWaitForOptionsInputSchema = __webpack_exports__.aiWaitForOptionsInputSchema;
|
|
606
617
|
exports.commonAgentTestRunnerNodeDefinitions = __webpack_exports__.commonAgentTestRunnerNodeDefinitions;
|
|
607
618
|
exports.createAgentTestRunnerNodeDefinition = __webpack_exports__.createAgentTestRunnerNodeDefinition;
|
|
608
619
|
exports.insightInputSchema = __webpack_exports__.insightInputSchema;
|
|
@@ -632,6 +643,7 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
|
632
643
|
"aiScrollInputSchema",
|
|
633
644
|
"aiTapInputSchema",
|
|
634
645
|
"aiWaitForInputSchema",
|
|
646
|
+
"aiWaitForOptionsInputSchema",
|
|
635
647
|
"commonAgentTestRunnerNodeDefinitions",
|
|
636
648
|
"createAgentTestRunnerNodeDefinition",
|
|
637
649
|
"insightInputSchema",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent/test-runner-nodes.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/agent/test-runner-nodes.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { AGENT_AI_CONTEXT_KEYS } from '@midscene/shared/agent-tools/agent-context';\nimport { z } from 'zod/v4';\nimport type { TUserPrompt } from '../common';\nimport { inputStrategies } from '../device/input-strategy';\nimport { NodeExecutionError } from '../test-runner/errors';\nimport type { LocateOption, ScrollParam } from '../yaml';\nimport { buildDetailedLocateParam } from '../yaml/utils';\nimport type { Agent } from './agent';\n\nexport interface AgentTestRunnerNodeResult<TData = unknown> {\n summary?: string;\n data?: TData;\n}\n\nexport interface AgentTestRunnerNodeExecutionContext {\n signal: AbortSignal;\n}\n\n/** Agent-owned Node description consumed by Test Runner adapters. */\nexport interface AgentTestRunnerNodeDefinition<\n TInput extends Record<string, unknown> = Record<string, unknown>,\n TData = unknown,\n> {\n name: string;\n title?: string;\n description?: string;\n /** Node input field populated by YAML string shorthand; omit to disable. */\n stringInputKey?: string | false;\n inputSchema: z.ZodObject;\n execute(\n agent: unknown,\n input: TInput,\n context: AgentTestRunnerNodeExecutionContext,\n ):\n | Promise<AgentTestRunnerNodeResult<TData> | undefined>\n | AgentTestRunnerNodeResult<TData>\n | undefined;\n}\n\n/** Static capability implemented by Agent classes that expose Runner Nodes. */\nexport interface AgentTestRunnerNodeProvider {\n getTestRunnerNodeDefinitions(): readonly AgentTestRunnerNodeDefinition[];\n}\n\ntype AnyAgentMethod = (...args: any[]) => unknown;\ntype AgentMethodName<TAgent extends object> = {\n [TKey in keyof TAgent]-?: TAgent[TKey] extends AnyAgentMethod ? TKey : never;\n}[keyof TAgent] &\n string;\ntype AgentMethod<\n TAgent extends object,\n TMethod extends AgentMethodName<TAgent>,\n> = Extract<TAgent[TMethod], AnyAgentMethod>;\n\nexport interface DefineAgentTestRunnerNodeOptions<\n TAgent extends object,\n TMethod extends AgentMethodName<TAgent>,\n TSchema extends z.ZodObject,\n TData = unknown,\n> {\n method: TMethod;\n name?: string;\n title?: string;\n description?: string;\n stringInputKey?: (keyof z.output<TSchema> & string) | false;\n inputSchema: TSchema;\n toArgs(\n input: z.output<TSchema>,\n context: AgentTestRunnerNodeExecutionContext,\n ): Parameters<AgentMethod<TAgent, TMethod>>;\n toResult?(\n result: Awaited<ReturnType<AgentMethod<TAgent, TMethod>>>,\n input: z.output<TSchema>,\n ): AgentTestRunnerNodeResult<TData> | undefined;\n}\n\n/** Create a Node factory whose adapters are checked against an Agent API. */\nexport const createAgentTestRunnerNodeDefinition =\n <TAgent extends object>(agentLabel = 'an Agent') =>\n <\n TMethod extends AgentMethodName<TAgent>,\n TSchema extends z.ZodObject,\n TData = unknown,\n >(\n definition: DefineAgentTestRunnerNodeOptions<\n TAgent,\n TMethod,\n TSchema,\n TData\n >,\n ): AgentTestRunnerNodeDefinition => ({\n name: definition.name ?? definition.method,\n ...(definition.title === undefined ? {} : { title: definition.title }),\n ...(definition.description === undefined\n ? {}\n : { description: definition.description }),\n ...(definition.stringInputKey === undefined\n ? {}\n : { stringInputKey: definition.stringInputKey }),\n inputSchema: definition.inputSchema,\n async execute(agent, input, context) {\n if (\n typeof agent !== 'object' ||\n agent === null ||\n typeof (agent as Record<string, unknown>)[definition.method] !==\n 'function'\n ) {\n throw new TypeError(\n `getAgent() must return ${agentLabel} with ${definition.method}().`,\n );\n }\n\n const typedAgent = agent as TAgent;\n const method = typedAgent[definition.method] as AgentMethod<\n TAgent,\n TMethod\n >;\n const typedInput = input as z.output<TSchema>;\n const result = (await method.apply(\n typedAgent,\n definition.toArgs(typedInput, context),\n )) as Awaited<ReturnType<AgentMethod<TAgent, TMethod>>>;\n return definition.toResult?.(result, typedInput);\n },\n });\n\nconst nonBlankText = (description: string) =>\n z\n .string()\n .regex(/\\S/, 'value must contain a non-whitespace character')\n .describe(description);\n\nexport const promptImageInputSchema = z.strictObject({\n name: nonBlankText('The name used to identify this reference image.'),\n url: nonBlankText('The URL, data URL, or file path of this reference image.'),\n});\n\nexport const structuredUserPromptInputSchema = z.strictObject({\n prompt: nonBlankText('The natural-language prompt.'),\n images: z.array(promptImageInputSchema).min(1).optional(),\n convertHttpImage2Base64: z\n .boolean()\n .optional()\n .describe('Whether HTTP reference images are converted to base64 first.'),\n});\n\nexport const userPromptInputSchema = z.union([\n nonBlankText('The natural-language prompt.'),\n structuredUserPromptInputSchema,\n]);\n\nexport const aiActOptionsInputSchema = z.strictObject({\n effort: z\n .enum(['fast', 'balance', 'deepThink'])\n .optional()\n .describe('Action planning effort: fast, balanced, or deeper reasoning.'),\n cacheable: z\n .boolean()\n .optional()\n .describe('Whether this action may use the Midscene cache.'),\n fileChooserAccept: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Accepted file types for a file chooser.'),\n fileChooserAllowedDir: z\n .string()\n .optional()\n .describe('Directory allowed for prompt-driven file uploads.'),\n deepThink: z\n .union([z.literal('unset'), z.boolean()])\n .optional()\n .describe('Whether to enable deep thinking for this action.'),\n deepLocate: z\n .boolean()\n .optional()\n .describe('Whether to use deep element location.'),\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n});\n\nexport const setAIContextInputSchema = z.strictObject({\n target: z\n .enum(AGENT_AI_CONTEXT_KEYS)\n .describe(\n 'The AI API to configure, e.g. aiAct or aiAssert. Use default as the shared fallback for all AI APIs when neither the call nor the API has its own context.',\n ),\n context: z\n .string()\n .optional()\n .describe(\n 'Agent-level guidance. Omit to remove the selected context; an empty string disables inherited context.',\n ),\n});\n\nexport const aiActInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: aiActOptionsInputSchema.optional(),\n});\n\nexport const insightOptionsInputSchema = z.strictObject({\n domIncluded: z\n .union([z.boolean(), z.literal('visible-only')])\n .optional()\n .describe('How DOM information is included.'),\n screenshotIncluded: z\n .boolean()\n .optional()\n .describe('Whether the request includes a screenshot.'),\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n});\n\nexport const aiAssertOptionsInputSchema = insightOptionsInputSchema.extend({\n keepRawResponse: z\n .boolean()\n .optional()\n .describe('Whether the Agent returns the structured assertion result.'),\n});\n\nexport const aiAssertInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n message: z.string().optional().describe('The assertion failure message.'),\n options: aiAssertOptionsInputSchema.optional(),\n});\n\nexport const locateOptionsInputSchema = z.strictObject({\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n deepLocate: z\n .boolean()\n .optional()\n .describe('Whether to use deep element location.'),\n deepThink: z\n .boolean()\n .optional()\n .describe('Deprecated alias for deepLocate.'),\n cacheable: z\n .boolean()\n .optional()\n .describe('Whether this location may use the Midscene cache.'),\n xpath: z.string().optional().describe('A web XPath location hint.'),\n fileChooserAccept: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Files accepted when tapping opens a file chooser.'),\n});\n\nexport const aiTapInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiInputInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n value: z.union([z.string(), z.number()]),\n options: locateOptionsInputSchema\n .extend({\n mode: z.enum(['replace', 'clear', 'typeOnly', 'append']).optional(),\n autoDismissKeyboard: z.boolean().optional(),\n keyboardTypeDelay: z.number().nonnegative().optional(),\n inputStrategy: z.enum(inputStrategies).optional(),\n })\n .optional(),\n});\n\nexport const aiKeyboardPressInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n keyName: nonBlankText('The key or key combination to press.'),\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiScrollInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n options: locateOptionsInputSchema\n .extend({\n direction: z.enum(['down', 'up', 'right', 'left']).optional(),\n scrollType: z\n .enum([\n 'singleAction',\n 'scrollToBottom',\n 'scrollToTop',\n 'scrollToRight',\n 'scrollToLeft',\n 'once',\n 'untilBottom',\n 'untilTop',\n 'untilRight',\n 'untilLeft',\n ])\n .optional(),\n distance: z.number().nullable().optional(),\n })\n .optional(),\n});\n\nexport const aiPinchInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n direction: z.enum(['in', 'out']),\n options: locateOptionsInputSchema\n .extend({\n distance: z.number().optional(),\n duration: z.number().nonnegative().optional(),\n })\n .optional(),\n});\n\nexport const aiLongPressInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: locateOptionsInputSchema\n .extend({ duration: z.number().nonnegative().optional() })\n .optional(),\n});\n\nexport const aiDragAndDropInputSchema = z.strictObject({\n from: userPromptInputSchema,\n to: userPromptInputSchema,\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiQueryInputSchema = z.strictObject({\n prompt: z.union([\n nonBlankText('The extraction request.'),\n z.record(z.string(), z.string()),\n ]),\n options: insightOptionsInputSchema.optional(),\n});\n\nexport const aiWaitForInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: insightOptionsInputSchema\n .extend({\n timeoutMs: z.number().positive().optional(),\n checkIntervalMs: z.number().positive().optional(),\n })\n .optional(),\n});\n\nexport const javascriptInputSchema = z.strictObject({\n script: nonBlankText('JavaScript to evaluate through the current interface.'),\n});\n\nexport const runGherkinScenarioInputSchema = z.strictObject({\n scenario: nonBlankText('The Gherkin scenario to execute.'),\n options: aiActOptionsInputSchema.optional(),\n});\n\nexport const actionInputSchema = z.strictObject({\n name: nonBlankText('The ActionSpace action name, for example DragAndDrop.'),\n params: z.unknown().optional(),\n});\n\nexport const insightInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: insightOptionsInputSchema.optional(),\n});\n\nexport const reportScreenshotInputSchema = z.strictObject({\n base64: z.string().min(1).describe('A base64-encoded screenshot.'),\n description: z.string().optional().describe('What the screenshot shows.'),\n});\n\nexport const recordToReportOptionsInputSchema = z\n .strictObject({\n content: z.string().optional().describe('The report text content.'),\n screenshotBase64: z\n .string()\n .optional()\n .describe('One base64-encoded screenshot.'),\n screenshots: z\n .array(reportScreenshotInputSchema)\n .min(1)\n .optional()\n .describe('Screenshots attached to the report section.'),\n })\n .superRefine((input, context) => {\n if (\n input.screenshotBase64 !== undefined &&\n input.screenshots !== undefined\n ) {\n context.addIssue({\n code: 'custom',\n message: 'screenshotBase64 and screenshots are mutually exclusive',\n });\n }\n });\n\nexport const recordToReportInputSchema = z.strictObject({\n title: z.string().optional().describe('The report section title.'),\n options: recordToReportOptionsInputSchema.optional(),\n});\n\nexport type UserPromptNodeInput = z.infer<typeof userPromptInputSchema>;\nexport type SetAIContextNodeInput = z.infer<typeof setAIContextInputSchema>;\nexport type AiActNodeOptions = z.infer<typeof aiActOptionsInputSchema>;\nexport type AiActNodeInput = z.infer<typeof aiActInputSchema>;\nexport type AiAssertNodeOptions = z.infer<typeof aiAssertOptionsInputSchema>;\nexport type AiAssertNodeInput = z.infer<typeof aiAssertInputSchema>;\nexport type AiTapNodeOptions = z.infer<typeof locateOptionsInputSchema>;\nexport type AiTapNodeInput = z.infer<typeof aiTapInputSchema>;\nexport type AiInputNodeInput = z.infer<typeof aiInputInputSchema>;\nexport type AiKeyboardPressNodeInput = z.infer<\n typeof aiKeyboardPressInputSchema\n>;\nexport type AiScrollNodeInput = z.infer<typeof aiScrollInputSchema>;\nexport type AiPinchNodeInput = z.infer<typeof aiPinchInputSchema>;\nexport type AiLongPressNodeInput = z.infer<typeof aiLongPressInputSchema>;\nexport type AiDragAndDropNodeInput = z.infer<typeof aiDragAndDropInputSchema>;\nexport type AiQueryNodeInput = z.infer<typeof aiQueryInputSchema>;\nexport type AiWaitForNodeInput = z.infer<typeof aiWaitForInputSchema>;\nexport type JavascriptNodeInput = z.infer<typeof javascriptInputSchema>;\nexport type RunGherkinScenarioNodeInput = z.infer<\n typeof runGherkinScenarioInputSchema\n>;\nexport type ActionNodeInput = z.infer<typeof actionInputSchema>;\nexport type InsightNodeOptions = z.infer<typeof insightOptionsInputSchema>;\nexport type InsightNodeInput = z.infer<typeof insightInputSchema>;\nexport type RecordToReportNodeOptions = z.infer<\n typeof recordToReportOptionsInputSchema\n>;\nexport type RecordToReportNodeInput = z.infer<typeof recordToReportInputSchema>;\n\nexport type CommonAgentTestRunnerApi = Pick<\n Agent,\n | 'aiAct'\n | 'aiTap'\n | 'aiAssert'\n | 'aiBoolean'\n | 'aiNumber'\n | 'aiString'\n | 'aiAsk'\n | 'recordToReport'\n>;\n\nconst defineCommonAgentNode =\n createAgentTestRunnerNodeDefinition<CommonAgentTestRunnerApi>('an Agent');\n\n// Select the current overloads without expanding the minimum API required by\n// existing getAgent() providers. Each Node checks its own method at execution.\ntype AgentActionNodeApi = Pick<\n Agent,\n | 'sleep'\n | 'setAIContext'\n | 'aiHover'\n | 'aiDoubleClick'\n | 'aiRightClick'\n | 'aiLongPress'\n | 'aiClearInput'\n | 'aiPinch'\n | 'aiLocate'\n | 'aiQuery'\n | 'aiWaitFor'\n | 'evaluateJavaScript'\n | 'runGherkinScenario'\n | 'callActionInActionSpace'\n> & {\n aiInput(\n prompt: TUserPrompt,\n options: NonNullable<Parameters<Agent['aiInput']>[2]> & {\n value: string | number;\n },\n ): Promise<void>;\n aiKeyboardPress(\n prompt: TUserPrompt | undefined,\n options: LocateOption & { keyName: string },\n ): Promise<void>;\n aiScroll(\n prompt: TUserPrompt | undefined,\n options: LocateOption & ScrollParam,\n ): Promise<void>;\n};\n\nconst defineAgentActionNode =\n createAgentTestRunnerNodeDefinition<AgentActionNodeApi>('an Agent');\n\nconst promptText = (prompt: UserPromptNodeInput): string =>\n typeof prompt === 'string' ? prompt : prompt.prompt;\n\nconst valueResult = (\n value: unknown,\n): AgentTestRunnerNodeResult | undefined => ({ data: value });\n\nconst aiActNode = defineCommonAgentNode({\n method: 'aiAct',\n description: 'Perform a natural-language task with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiActInputSchema,\n toArgs(input, context) {\n return [\n input.prompt,\n {\n ...input.options,\n abortSignal: context.signal,\n },\n ];\n },\n toResult(output) {\n return output === undefined ? undefined : { summary: output };\n },\n});\n\nconst aiTapNode = defineCommonAgentNode({\n method: 'aiTap',\n description: 'Locate and tap an element with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs(input) {\n return [input.prompt, input.options];\n },\n toResult(_output, input) {\n return { summary: `Tapped: ${promptText(input.prompt)}` };\n },\n});\n\nconst aiAssertNode = defineCommonAgentNode({\n method: 'aiAssert',\n description: 'Assert a natural-language condition with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiAssertInputSchema,\n toArgs(input, context) {\n return [\n input.prompt,\n input.message,\n {\n keepRawResponse: true,\n ...input.options,\n abortSignal: context.signal,\n },\n ];\n },\n toResult(output, input) {\n const result = {\n summary: `Assertion ${output?.pass === false ? 'failed' : 'passed'}: ${promptText(input.prompt)}`,\n ...(output === undefined\n ? {}\n : {\n data: {\n pass: output.pass,\n ...(output.thought === undefined\n ? {}\n : { thought: output.thought }),\n ...(output.message === undefined\n ? {}\n : { message: output.message }),\n },\n }),\n };\n if (output?.pass === false)\n throw new NodeExecutionError(\n 'aiAssert',\n new Error(\n output.message ||\n input.message ||\n output.thought ||\n `Assertion failed: ${promptText(input.prompt)}`,\n ),\n result,\n );\n return result;\n },\n});\n\nconst locateActionNode = (\n method: 'aiHover' | 'aiDoubleClick' | 'aiRightClick' | 'aiClearInput',\n) =>\n defineAgentActionNode({\n method,\n description: {\n aiHover: 'Locate and hover over an element with a Midscene UI Agent.',\n aiDoubleClick:\n 'Locate and double-click an element with a Midscene UI Agent.',\n aiRightClick:\n 'Locate and right-click an element with a Midscene UI Agent.',\n aiClearInput:\n 'Locate an input element and clear its value with a Midscene UI Agent.',\n }[method],\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs: (input) => [input.prompt, input.options],\n toResult: (_output, input) => ({\n summary: `${method}: ${promptText(input.prompt)}`,\n }),\n });\n\nconst additionalAgentNodes: readonly AgentTestRunnerNodeDefinition[] = [\n defineAgentActionNode({\n method: 'setAIContext',\n description:\n 'Set or remove Agent-level AI guidance for subsequent calls on the same Agent.',\n inputSchema: setAIContextInputSchema,\n toArgs: (input) => [input.target, input.context],\n }),\n locateActionNode('aiHover'),\n locateActionNode('aiDoubleClick'),\n locateActionNode('aiRightClick'),\n locateActionNode('aiClearInput'),\n defineAgentActionNode({\n method: 'aiInput',\n description:\n 'Locate an input element and enter a value with a Midscene UI Agent.',\n inputSchema: aiInputInputSchema,\n toArgs: (input) => [input.prompt, { ...input.options, value: input.value }],\n }),\n defineAgentActionNode({\n method: 'aiKeyboardPress',\n description:\n 'Press a key or key combination, optionally targeting a located element.',\n stringInputKey: 'keyName',\n inputSchema: aiKeyboardPressInputSchema,\n toArgs: (input) => [\n input.prompt,\n { ...input.options, keyName: input.keyName },\n ],\n }),\n defineAgentActionNode({\n method: 'aiScroll',\n description:\n 'Scroll the page or a located region with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiScrollInputSchema,\n toArgs: (input) => [input.prompt, { ...input.options }],\n }),\n defineAgentActionNode({\n method: 'aiPinch',\n description:\n 'Perform a pinch-in or pinch-out gesture with a Midscene UI Agent.',\n inputSchema: aiPinchInputSchema,\n toArgs: (input) => [\n input.prompt,\n { ...input.options, direction: input.direction },\n ],\n }),\n defineAgentActionNode({\n method: 'aiLongPress',\n description: 'Locate and long-press an element with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiLongPressInputSchema,\n toArgs: (input) => [input.prompt, input.options],\n }),\n defineAgentActionNode({\n method: 'callActionInActionSpace',\n name: 'aiDragAndDrop',\n description:\n 'Locate source and destination elements, then drag the source to the destination.',\n inputSchema: aiDragAndDropInputSchema,\n toArgs: (input) => [\n 'DragAndDrop',\n {\n from: buildDetailedLocateParam(input.from, input.options),\n to: buildDetailedLocateParam(input.to, input.options),\n },\n ],\n }),\n defineAgentActionNode({\n method: 'aiLocate',\n description:\n 'Locate an element from a natural-language description and store the result.',\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'aiQuery',\n description:\n 'Extract structured data from the current interface and store the result.',\n stringInputKey: 'prompt',\n inputSchema: aiQueryInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'aiWaitFor',\n description: 'Wait until a natural-language condition is satisfied.',\n stringInputKey: 'prompt',\n inputSchema: aiWaitForInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n }),\n defineAgentActionNode({\n method: 'evaluateJavaScript',\n name: 'javascript',\n description:\n 'Evaluate JavaScript in the current interface and store the result.',\n stringInputKey: 'script',\n inputSchema: javascriptInputSchema,\n toArgs: (input) => [input.script],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'runGherkinScenario',\n description:\n 'Execute a Gherkin scenario with the current Midscene UI Agent.',\n stringInputKey: 'scenario',\n inputSchema: runGherkinScenarioInputSchema,\n toArgs: (input, context) => [\n input.scenario,\n { ...input.options, abortSignal: context.signal },\n ],\n }),\n defineAgentActionNode({\n method: 'callActionInActionSpace',\n name: 'action',\n description:\n 'Call a platform or custom action. Its ActionSpace schema validates params when the action executes.',\n inputSchema: actionInputSchema,\n toArgs: (input) => [input.name, input.params],\n toResult: (value) => (value === undefined ? undefined : valueResult(value)),\n }),\n];\n\nconst insightNode = (method: 'aiBoolean' | 'aiNumber' | 'aiString' | 'aiAsk') =>\n defineCommonAgentNode({\n method,\n description: `Run ${method} with a Midscene UI Agent and store its value.`,\n stringInputKey: 'prompt',\n inputSchema: insightInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: (value) => ({\n summary: `${method} returned ${\n method === 'aiString' || method === 'aiAsk'\n ? JSON.stringify(value)\n : value\n }`,\n data: { value },\n }),\n });\n\nconst recordToReportNode = defineCommonAgentNode({\n method: 'recordToReport',\n description: 'Add text or screenshots to the current Midscene report.',\n stringInputKey: 'title',\n inputSchema: recordToReportInputSchema,\n toArgs(input) {\n return [input.title, input.options];\n },\n toResult(_output, input) {\n return { summary: `Recorded to report: ${input.title ?? 'untitled'}` };\n },\n});\n\nexport const commonAgentTestRunnerNodeDefinitions: readonly AgentTestRunnerNodeDefinition[] =\n [\n defineAgentActionNode({\n method: 'sleep',\n description:\n 'Wait for a fixed number of milliseconds, recording standard UI snapshots and honoring cancellation.',\n inputSchema: z.strictObject({ ms: z.number().positive() }),\n toArgs(input, { signal }) {\n signal.throwIfAborted();\n return [input.ms, { abortSignal: signal }];\n },\n }),\n aiActNode,\n aiTapNode,\n aiAssertNode,\n insightNode('aiBoolean'),\n insightNode('aiNumber'),\n insightNode('aiString'),\n insightNode('aiAsk'),\n recordToReportNode,\n ...additionalAgentNodes,\n ];\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","createAgentTestRunnerNodeDefinition","agentLabel","undefined","agent","input","context","TypeError","typedAgent","method","typedInput","result","nonBlankText","description","z","promptImageInputSchema","structuredUserPromptInputSchema","userPromptInputSchema","aiActOptionsInputSchema","setAIContextInputSchema","AGENT_AI_CONTEXT_KEYS","aiActInputSchema","insightOptionsInputSchema","aiAssertOptionsInputSchema","aiAssertInputSchema","locateOptionsInputSchema","aiTapInputSchema","aiInputInputSchema","inputStrategies","aiKeyboardPressInputSchema","aiScrollInputSchema","aiPinchInputSchema","aiLongPressInputSchema","aiDragAndDropInputSchema","aiQueryInputSchema","aiWaitForInputSchema","javascriptInputSchema","runGherkinScenarioInputSchema","actionInputSchema","insightInputSchema","reportScreenshotInputSchema","recordToReportOptionsInputSchema","recordToReportInputSchema","defineCommonAgentNode","defineAgentActionNode","promptText","prompt","valueResult","value","aiActNode","output","aiTapNode","_output","aiAssertNode","NodeExecutionError","Error","locateActionNode","additionalAgentNodes","buildDetailedLocateParam","insightNode","JSON","recordToReportNode","commonAgentTestRunnerNodeDefinitions","signal"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuEO,MAAMI,sCACX,CAAwBC,aAAa,UAAU,GAC/C,CAKEP,aAMmC;YACnC,MAAMA,WAAW,IAAI,IAA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AM;gBACZ;oBAAE,GAAGA,MAAM,OAAO;oBAAE,aAAaC,QAAQ,MAAM;gBAAC;aACjD;QACD,UAAU,CAAC0C,QAAW;gBACpB,SAAS,GAAGvC,OAAO,UAAU,EAC3BA,AAAW,eAAXA,UAAyBA,AAAW,YAAXA,SACrBmD,KAAK,SAAS,CAACZ,SACfA,OACJ;gBACF,MAAM;oBAAEA;gBAAM;YAChB;IACF;AAEF,MAAMa,qBAAqBlB,sBAAsB;IAC/C,QAAQ;IACR,aAAa;IACb,gBAAgB;IAChB,aAAaD;IACb,QAAOrC,KAAK;QACV,OAAO;YAACA,MAAM,KAAK;YAAEA,MAAM,OAAO;SAAC;IACrC;IACA,UAAS+C,OAAO,EAAE/C,KAAK;QACrB,OAAO;YAAE,SAAS,CAAC,oBAAoB,EAAEA,MAAM,KAAK,IAAI,YAAY;QAAC;IACvE;AACF;AAEO,MAAMyD,uCACX;IACElB,sBAAsB;QACpB,QAAQ;QACR,aACE;QACF,aAAa9B,mBAAAA,CAAAA,CAAAA,YAAc,CAAC;YAAE,IAAIA,mBAAAA,CAAAA,CAAAA,MAAQ,GAAG,QAAQ;QAAG;QACxD,QAAOT,KAAK,EAAE,EAAE0D,MAAM,EAAE;YACtBA,OAAO,cAAc;YACrB,OAAO;gBAAC1D,MAAM,EAAE;gBAAE;oBAAE,aAAa0D;gBAAO;aAAE;QAC5C;IACF;IACAd;IACAE;IACAE;IACAM,YAAY;IACZA,YAAY;IACZA,YAAY;IACZA,YAAY;IACZE;OACGJ;CACJ"}
|
|
1
|
+
{"version":3,"file":"agent/test-runner-nodes.js","sources":["webpack/runtime/define_property_getters","webpack/runtime/has_own_property","webpack/runtime/make_namespace_object","../../../src/agent/test-runner-nodes.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","import { AGENT_AI_CONTEXT_KEYS } from '@midscene/shared/agent-tools/agent-context';\nimport { z } from 'zod/v4';\nimport type { TUserPrompt } from '../common';\nimport { inputStrategies } from '../device/input-strategy';\nimport { NodeExecutionError } from '../test-runner/errors';\nimport type { LocateOption, ScrollParam } from '../yaml';\nimport { buildDetailedLocateParam } from '../yaml/utils';\nimport type { Agent } from './agent';\n\nexport interface AgentTestRunnerNodeResult<TData = unknown> {\n summary?: string;\n data?: TData;\n}\n\nexport interface AgentTestRunnerNodeExecutionContext {\n signal: AbortSignal;\n}\n\n/** Agent-owned Node description consumed by Test Runner adapters. */\nexport interface AgentTestRunnerNodeDefinition<\n TInput extends Record<string, unknown> = Record<string, unknown>,\n TData = unknown,\n> {\n name: string;\n title?: string;\n description?: string;\n /** Node input field populated by YAML string shorthand; omit to disable. */\n stringInputKey?: string | false;\n inputSchema: z.ZodObject;\n execute(\n agent: unknown,\n input: TInput,\n context: AgentTestRunnerNodeExecutionContext,\n ):\n | Promise<AgentTestRunnerNodeResult<TData> | undefined>\n | AgentTestRunnerNodeResult<TData>\n | undefined;\n}\n\n/** Static capability implemented by Agent classes that expose Runner Nodes. */\nexport interface AgentTestRunnerNodeProvider {\n getTestRunnerNodeDefinitions(): readonly AgentTestRunnerNodeDefinition[];\n}\n\ntype AnyAgentMethod = (...args: any[]) => unknown;\ntype AgentMethodName<TAgent extends object> = {\n [TKey in keyof TAgent]-?: TAgent[TKey] extends AnyAgentMethod ? TKey : never;\n}[keyof TAgent] &\n string;\ntype AgentMethod<\n TAgent extends object,\n TMethod extends AgentMethodName<TAgent>,\n> = Extract<TAgent[TMethod], AnyAgentMethod>;\n\nexport interface DefineAgentTestRunnerNodeOptions<\n TAgent extends object,\n TMethod extends AgentMethodName<TAgent>,\n TSchema extends z.ZodObject,\n TData = unknown,\n> {\n method: TMethod;\n name?: string;\n title?: string;\n description?: string;\n stringInputKey?: (keyof z.output<TSchema> & string) | false;\n inputSchema: TSchema;\n toArgs(\n input: z.output<TSchema>,\n context: AgentTestRunnerNodeExecutionContext,\n ): Parameters<AgentMethod<TAgent, TMethod>>;\n toResult?(\n result: Awaited<ReturnType<AgentMethod<TAgent, TMethod>>>,\n input: z.output<TSchema>,\n ): AgentTestRunnerNodeResult<TData> | undefined;\n}\n\n/** Create a Node factory whose adapters are checked against an Agent API. */\nexport const createAgentTestRunnerNodeDefinition =\n <TAgent extends object>(agentLabel = 'an Agent') =>\n <\n TMethod extends AgentMethodName<TAgent>,\n TSchema extends z.ZodObject,\n TData = unknown,\n >(\n definition: DefineAgentTestRunnerNodeOptions<\n TAgent,\n TMethod,\n TSchema,\n TData\n >,\n ): AgentTestRunnerNodeDefinition => ({\n name: definition.name ?? definition.method,\n ...(definition.title === undefined ? {} : { title: definition.title }),\n ...(definition.description === undefined\n ? {}\n : { description: definition.description }),\n ...(definition.stringInputKey === undefined\n ? {}\n : { stringInputKey: definition.stringInputKey }),\n inputSchema: definition.inputSchema,\n async execute(agent, input, context) {\n if (\n typeof agent !== 'object' ||\n agent === null ||\n typeof (agent as Record<string, unknown>)[definition.method] !==\n 'function'\n ) {\n throw new TypeError(\n `getAgent() must return ${agentLabel} with ${definition.method}().`,\n );\n }\n\n const typedAgent = agent as TAgent;\n const method = typedAgent[definition.method] as AgentMethod<\n TAgent,\n TMethod\n >;\n const typedInput = input as z.output<TSchema>;\n const result = (await method.apply(\n typedAgent,\n definition.toArgs(typedInput, context),\n )) as Awaited<ReturnType<AgentMethod<TAgent, TMethod>>>;\n return definition.toResult?.(result, typedInput);\n },\n });\n\nconst nonBlankText = (description: string) =>\n z\n .string()\n .regex(/\\S/, 'value must contain a non-whitespace character')\n .describe(description);\n\nexport const promptImageInputSchema = z.strictObject({\n name: nonBlankText('The name used to identify this reference image.'),\n url: nonBlankText('The URL, data URL, or file path of this reference image.'),\n});\n\nexport const structuredUserPromptInputSchema = z.strictObject({\n prompt: nonBlankText('The natural-language prompt.'),\n images: z.array(promptImageInputSchema).min(1).optional(),\n convertHttpImage2Base64: z\n .boolean()\n .optional()\n .describe('Whether HTTP reference images are converted to base64 first.'),\n});\n\nexport const userPromptInputSchema = z.union([\n nonBlankText('The natural-language prompt.'),\n structuredUserPromptInputSchema,\n]);\n\nexport const aiActOptionsInputSchema = z.strictObject({\n effort: z\n .enum(['fast', 'balance', 'deepThink'])\n .optional()\n .describe('Action planning effort: fast, balanced, or deeper reasoning.'),\n cacheable: z\n .boolean()\n .optional()\n .describe('Whether this action may use the Midscene cache.'),\n fileChooserAccept: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Accepted file types for a file chooser.'),\n fileChooserAllowedDir: z\n .string()\n .optional()\n .describe('Directory allowed for prompt-driven file uploads.'),\n deepThink: z\n .union([z.literal('unset'), z.boolean()])\n .optional()\n .describe('Whether to enable deep thinking for this action.'),\n deepLocate: z\n .boolean()\n .optional()\n .describe('Whether to use deep element location.'),\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n});\n\nexport const setAIContextInputSchema = z.strictObject({\n target: z\n .enum(AGENT_AI_CONTEXT_KEYS)\n .describe(\n 'The AI API to configure, e.g. aiAct or aiAssert. Use default as the shared fallback for all AI APIs when neither the call nor the API has its own context.',\n ),\n context: z\n .string()\n .optional()\n .describe(\n 'Agent-level guidance. Omit to remove the selected context; an empty string disables inherited context.',\n ),\n});\n\nexport const aiActInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: aiActOptionsInputSchema.optional(),\n});\n\nexport const insightOptionsInputSchema = z.strictObject({\n domIncluded: z\n .union([z.boolean(), z.literal('visible-only')])\n .optional()\n .describe('How DOM information is included.'),\n screenshotIncluded: z\n .boolean()\n .optional()\n .describe('Whether the request includes a screenshot.'),\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n});\n\nexport const aiAssertOptionsInputSchema = insightOptionsInputSchema.extend({\n keepRawResponse: z\n .boolean()\n .optional()\n .describe('Whether the Agent returns the structured assertion result.'),\n});\n\nexport const aiAssertInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n message: z.string().optional().describe('The assertion failure message.'),\n options: aiAssertOptionsInputSchema.optional(),\n});\n\nexport const locateOptionsInputSchema = z.strictObject({\n context: z\n .string()\n .optional()\n .describe(\n 'Additional facts, rules, constraints, or output requirements for this AI call. Overrides inherited aiContexts; an empty string disables inherited user context.',\n ),\n deepLocate: z\n .boolean()\n .optional()\n .describe('Whether to use deep element location.'),\n deepThink: z\n .boolean()\n .optional()\n .describe('Deprecated alias for deepLocate.'),\n cacheable: z\n .boolean()\n .optional()\n .describe('Whether this location may use the Midscene cache.'),\n xpath: z.string().optional().describe('A web XPath location hint.'),\n fileChooserAccept: z\n .union([z.string(), z.array(z.string())])\n .optional()\n .describe('Files accepted when tapping opens a file chooser.'),\n});\n\nexport const aiTapInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiInputInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n value: z.union([z.string(), z.number()]),\n options: locateOptionsInputSchema\n .extend({\n mode: z.enum(['replace', 'clear', 'typeOnly', 'append']).optional(),\n autoDismissKeyboard: z.boolean().optional(),\n keyboardTypeDelay: z.number().nonnegative().optional(),\n inputStrategy: z.enum(inputStrategies).optional(),\n })\n .optional(),\n});\n\nexport const aiKeyboardPressInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n keyName: nonBlankText('The key or key combination to press.'),\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiScrollInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n options: locateOptionsInputSchema\n .extend({\n direction: z.enum(['down', 'up', 'right', 'left']).optional(),\n scrollType: z\n .enum([\n 'singleAction',\n 'scrollToBottom',\n 'scrollToTop',\n 'scrollToRight',\n 'scrollToLeft',\n 'once',\n 'untilBottom',\n 'untilTop',\n 'untilRight',\n 'untilLeft',\n ])\n .optional(),\n distance: z.number().nullable().optional(),\n })\n .optional(),\n});\n\nexport const aiPinchInputSchema = z.strictObject({\n prompt: userPromptInputSchema.optional(),\n direction: z.enum(['in', 'out']),\n options: locateOptionsInputSchema\n .extend({\n distance: z.number().optional(),\n duration: z.number().nonnegative().optional(),\n })\n .optional(),\n});\n\nexport const aiLongPressInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: locateOptionsInputSchema\n .extend({ duration: z.number().nonnegative().optional() })\n .optional(),\n});\n\nexport const aiDragAndDropInputSchema = z.strictObject({\n from: userPromptInputSchema,\n to: userPromptInputSchema,\n options: locateOptionsInputSchema.optional(),\n});\n\nexport const aiQueryInputSchema = z.strictObject({\n prompt: z.union([\n nonBlankText('The extraction request.'),\n z.record(z.string(), z.string()),\n ]),\n options: insightOptionsInputSchema.optional(),\n});\n\nexport const aiWaitForOptionsInputSchema = insightOptionsInputSchema\n .extend({\n timeoutMs: z.number().positive().optional(),\n checkIntervalMs: z.number().positive().optional(),\n })\n .superRefine((input, context) => {\n if ((input.checkIntervalMs ?? 3000) > (input.timeoutMs ?? 15000)) {\n context.addIssue({\n code: 'custom',\n path: ['checkIntervalMs'],\n message: 'checkIntervalMs must not exceed timeoutMs',\n });\n }\n });\n\nexport const aiWaitForInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: aiWaitForOptionsInputSchema.optional(),\n});\n\nexport type AiWaitForNodeOptions = z.infer<typeof aiWaitForOptionsInputSchema>;\n\nexport const javascriptInputSchema = z.strictObject({\n script: nonBlankText('JavaScript to evaluate through the current interface.'),\n});\n\nexport const runGherkinScenarioInputSchema = z.strictObject({\n scenario: nonBlankText('The Gherkin scenario to execute.'),\n options: aiActOptionsInputSchema.optional(),\n});\n\nexport const actionInputSchema = z.strictObject({\n name: nonBlankText('The ActionSpace action name, for example DragAndDrop.'),\n params: z.unknown().optional(),\n});\n\nexport const insightInputSchema = z.strictObject({\n prompt: userPromptInputSchema,\n options: insightOptionsInputSchema.optional(),\n});\n\nexport const reportScreenshotInputSchema = z.strictObject({\n base64: z.string().min(1).describe('A base64-encoded screenshot.'),\n description: z.string().optional().describe('What the screenshot shows.'),\n});\n\nexport const recordToReportOptionsInputSchema = z\n .strictObject({\n content: z.string().optional().describe('The report text content.'),\n screenshotBase64: z\n .string()\n .optional()\n .describe('One base64-encoded screenshot.'),\n screenshots: z\n .array(reportScreenshotInputSchema)\n .min(1)\n .optional()\n .describe('Screenshots attached to the report section.'),\n })\n .superRefine((input, context) => {\n if (\n input.screenshotBase64 !== undefined &&\n input.screenshots !== undefined\n ) {\n context.addIssue({\n code: 'custom',\n message: 'screenshotBase64 and screenshots are mutually exclusive',\n });\n }\n });\n\nexport const recordToReportInputSchema = z.strictObject({\n title: z.string().optional().describe('The report section title.'),\n options: recordToReportOptionsInputSchema.optional(),\n});\n\nexport type UserPromptNodeInput = z.infer<typeof userPromptInputSchema>;\nexport type SetAIContextNodeInput = z.infer<typeof setAIContextInputSchema>;\nexport type AiActNodeOptions = z.infer<typeof aiActOptionsInputSchema>;\nexport type AiActNodeInput = z.infer<typeof aiActInputSchema>;\nexport type AiAssertNodeOptions = z.infer<typeof aiAssertOptionsInputSchema>;\nexport type AiAssertNodeInput = z.infer<typeof aiAssertInputSchema>;\nexport type AiTapNodeOptions = z.infer<typeof locateOptionsInputSchema>;\nexport type AiTapNodeInput = z.infer<typeof aiTapInputSchema>;\nexport type AiInputNodeInput = z.infer<typeof aiInputInputSchema>;\nexport type AiKeyboardPressNodeInput = z.infer<\n typeof aiKeyboardPressInputSchema\n>;\nexport type AiScrollNodeInput = z.infer<typeof aiScrollInputSchema>;\nexport type AiPinchNodeInput = z.infer<typeof aiPinchInputSchema>;\nexport type AiLongPressNodeInput = z.infer<typeof aiLongPressInputSchema>;\nexport type AiDragAndDropNodeInput = z.infer<typeof aiDragAndDropInputSchema>;\nexport type AiQueryNodeInput = z.infer<typeof aiQueryInputSchema>;\nexport type AiWaitForNodeInput = z.infer<typeof aiWaitForInputSchema>;\nexport type JavascriptNodeInput = z.infer<typeof javascriptInputSchema>;\nexport type RunGherkinScenarioNodeInput = z.infer<\n typeof runGherkinScenarioInputSchema\n>;\nexport type ActionNodeInput = z.infer<typeof actionInputSchema>;\nexport type InsightNodeOptions = z.infer<typeof insightOptionsInputSchema>;\nexport type InsightNodeInput = z.infer<typeof insightInputSchema>;\nexport type RecordToReportNodeOptions = z.infer<\n typeof recordToReportOptionsInputSchema\n>;\nexport type RecordToReportNodeInput = z.infer<typeof recordToReportInputSchema>;\n\nexport type CommonAgentTestRunnerApi = Pick<\n Agent,\n | 'aiAct'\n | 'aiTap'\n | 'aiAssert'\n | 'aiBoolean'\n | 'aiNumber'\n | 'aiString'\n | 'aiAsk'\n | 'recordToReport'\n>;\n\nconst defineCommonAgentNode =\n createAgentTestRunnerNodeDefinition<CommonAgentTestRunnerApi>('an Agent');\n\n// Select the current overloads without expanding the minimum API required by\n// existing getAgent() providers. Each Node checks its own method at execution.\ntype AgentActionNodeApi = Pick<\n Agent,\n | 'sleep'\n | 'setAIContext'\n | 'aiHover'\n | 'aiDoubleClick'\n | 'aiRightClick'\n | 'aiLongPress'\n | 'aiClearInput'\n | 'aiPinch'\n | 'aiLocate'\n | 'aiQuery'\n | 'aiWaitFor'\n | 'evaluateJavaScript'\n | 'runGherkinScenario'\n | 'callActionInActionSpace'\n> & {\n aiInput(\n prompt: TUserPrompt,\n options: NonNullable<Parameters<Agent['aiInput']>[2]> & {\n value: string | number;\n },\n ): Promise<void>;\n aiKeyboardPress(\n prompt: TUserPrompt | undefined,\n options: LocateOption & { keyName: string },\n ): Promise<void>;\n aiScroll(\n prompt: TUserPrompt | undefined,\n options: LocateOption & ScrollParam,\n ): Promise<void>;\n};\n\nconst defineAgentActionNode =\n createAgentTestRunnerNodeDefinition<AgentActionNodeApi>('an Agent');\n\nconst promptText = (prompt: UserPromptNodeInput): string =>\n typeof prompt === 'string' ? prompt : prompt.prompt;\n\nconst valueResult = (\n value: unknown,\n): AgentTestRunnerNodeResult | undefined => ({ data: value });\n\nconst aiActNode = defineCommonAgentNode({\n method: 'aiAct',\n description: 'Perform a natural-language task with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiActInputSchema,\n toArgs(input, context) {\n return [\n input.prompt,\n {\n ...input.options,\n abortSignal: context.signal,\n },\n ];\n },\n toResult(output) {\n return output === undefined ? undefined : { summary: output };\n },\n});\n\nconst aiTapNode = defineCommonAgentNode({\n method: 'aiTap',\n description: 'Locate and tap an element with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs(input) {\n return [input.prompt, input.options];\n },\n toResult(_output, input) {\n return { summary: `Tapped: ${promptText(input.prompt)}` };\n },\n});\n\nconst aiAssertNode = defineCommonAgentNode({\n method: 'aiAssert',\n description: 'Assert a natural-language condition with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiAssertInputSchema,\n toArgs(input, context) {\n return [\n input.prompt,\n input.message,\n {\n keepRawResponse: true,\n ...input.options,\n abortSignal: context.signal,\n },\n ];\n },\n toResult(output, input) {\n const result = {\n summary: `Assertion ${output?.pass === false ? 'failed' : 'passed'}: ${promptText(input.prompt)}`,\n ...(output === undefined\n ? {}\n : {\n data: {\n pass: output.pass,\n ...(output.thought === undefined\n ? {}\n : { thought: output.thought }),\n ...(output.message === undefined\n ? {}\n : { message: output.message }),\n },\n }),\n };\n if (output?.pass === false)\n throw new NodeExecutionError(\n 'aiAssert',\n new Error(\n output.message ||\n input.message ||\n output.thought ||\n `Assertion failed: ${promptText(input.prompt)}`,\n ),\n result,\n );\n return result;\n },\n});\n\nconst locateActionNode = (\n method: 'aiHover' | 'aiDoubleClick' | 'aiRightClick' | 'aiClearInput',\n) =>\n defineAgentActionNode({\n method,\n description: {\n aiHover: 'Locate and hover over an element with a Midscene UI Agent.',\n aiDoubleClick:\n 'Locate and double-click an element with a Midscene UI Agent.',\n aiRightClick:\n 'Locate and right-click an element with a Midscene UI Agent.',\n aiClearInput:\n 'Locate an input element and clear its value with a Midscene UI Agent.',\n }[method],\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs: (input) => [input.prompt, input.options],\n toResult: (_output, input) => ({\n summary: `${method}: ${promptText(input.prompt)}`,\n }),\n });\n\nconst additionalAgentNodes: readonly AgentTestRunnerNodeDefinition[] = [\n defineAgentActionNode({\n method: 'setAIContext',\n description:\n 'Set or remove Agent-level AI guidance for subsequent calls on the same Agent.',\n inputSchema: setAIContextInputSchema,\n toArgs: (input) => [input.target, input.context],\n }),\n locateActionNode('aiHover'),\n locateActionNode('aiDoubleClick'),\n locateActionNode('aiRightClick'),\n locateActionNode('aiClearInput'),\n defineAgentActionNode({\n method: 'aiInput',\n description:\n 'Locate an input element and enter a value with a Midscene UI Agent.',\n inputSchema: aiInputInputSchema,\n toArgs: (input) => [input.prompt, { ...input.options, value: input.value }],\n }),\n defineAgentActionNode({\n method: 'aiKeyboardPress',\n description:\n 'Press a key or key combination, optionally targeting a located element.',\n stringInputKey: 'keyName',\n inputSchema: aiKeyboardPressInputSchema,\n toArgs: (input) => [\n input.prompt,\n { ...input.options, keyName: input.keyName },\n ],\n }),\n defineAgentActionNode({\n method: 'aiScroll',\n description:\n 'Scroll the page or a located region with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiScrollInputSchema,\n toArgs: (input) => [input.prompt, { ...input.options }],\n }),\n defineAgentActionNode({\n method: 'aiPinch',\n description:\n 'Perform a pinch-in or pinch-out gesture with a Midscene UI Agent.',\n inputSchema: aiPinchInputSchema,\n toArgs: (input) => [\n input.prompt,\n { ...input.options, direction: input.direction },\n ],\n }),\n defineAgentActionNode({\n method: 'aiLongPress',\n description: 'Locate and long-press an element with a Midscene UI Agent.',\n stringInputKey: 'prompt',\n inputSchema: aiLongPressInputSchema,\n toArgs: (input) => [input.prompt, input.options],\n }),\n defineAgentActionNode({\n method: 'callActionInActionSpace',\n name: 'aiDragAndDrop',\n description:\n 'Locate source and destination elements, then drag the source to the destination.',\n inputSchema: aiDragAndDropInputSchema,\n toArgs: (input) => [\n 'DragAndDrop',\n {\n from: buildDetailedLocateParam(input.from, input.options),\n to: buildDetailedLocateParam(input.to, input.options),\n },\n ],\n }),\n defineAgentActionNode({\n method: 'aiLocate',\n description:\n 'Locate an element from a natural-language description and store the result.',\n stringInputKey: 'prompt',\n inputSchema: aiTapInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'aiQuery',\n description:\n 'Extract structured data from the current interface and store the result.',\n stringInputKey: 'prompt',\n inputSchema: aiQueryInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'aiWaitFor',\n description: 'Wait until a natural-language condition is satisfied.',\n stringInputKey: 'prompt',\n inputSchema: aiWaitForInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n }),\n defineAgentActionNode({\n method: 'evaluateJavaScript',\n name: 'javascript',\n description:\n 'Evaluate JavaScript in the current interface and store the result.',\n stringInputKey: 'script',\n inputSchema: javascriptInputSchema,\n toArgs: (input) => [input.script],\n toResult: valueResult,\n }),\n defineAgentActionNode({\n method: 'runGherkinScenario',\n description:\n 'Execute a Gherkin scenario with the current Midscene UI Agent.',\n stringInputKey: 'scenario',\n inputSchema: runGherkinScenarioInputSchema,\n toArgs: (input, context) => [\n input.scenario,\n { ...input.options, abortSignal: context.signal },\n ],\n }),\n defineAgentActionNode({\n method: 'callActionInActionSpace',\n name: 'action',\n description:\n 'Call a platform or custom action. Its ActionSpace schema validates params when the action executes.',\n inputSchema: actionInputSchema,\n toArgs: (input) => [input.name, input.params],\n toResult: (value) => (value === undefined ? undefined : valueResult(value)),\n }),\n];\n\nconst insightNode = (method: 'aiBoolean' | 'aiNumber' | 'aiString' | 'aiAsk') =>\n defineCommonAgentNode({\n method,\n description: `Run ${method} with a Midscene UI Agent and store its value.`,\n stringInputKey: 'prompt',\n inputSchema: insightInputSchema,\n toArgs: (input, context) => [\n input.prompt,\n { ...input.options, abortSignal: context.signal },\n ],\n toResult: (value) => ({\n summary: `${method} returned ${\n method === 'aiString' || method === 'aiAsk'\n ? JSON.stringify(value)\n : value\n }`,\n data: { value },\n }),\n });\n\nconst recordToReportNode = defineCommonAgentNode({\n method: 'recordToReport',\n description: 'Add text or screenshots to the current Midscene report.',\n stringInputKey: 'title',\n inputSchema: recordToReportInputSchema,\n toArgs(input) {\n return [input.title, input.options];\n },\n toResult(_output, input) {\n return { summary: `Recorded to report: ${input.title ?? 'untitled'}` };\n },\n});\n\nexport const commonAgentTestRunnerNodeDefinitions: readonly AgentTestRunnerNodeDefinition[] =\n [\n defineAgentActionNode({\n method: 'sleep',\n description:\n 'Wait for a fixed number of milliseconds, recording standard UI snapshots and honoring cancellation.',\n inputSchema: z.strictObject({ ms: z.number().positive() }),\n toArgs(input, { signal }) {\n signal.throwIfAborted();\n return [input.ms, { abortSignal: signal }];\n },\n }),\n aiActNode,\n aiTapNode,\n aiAssertNode,\n insightNode('aiBoolean'),\n insightNode('aiNumber'),\n insightNode('aiString'),\n insightNode('aiAsk'),\n recordToReportNode,\n ...additionalAgentNodes,\n ];\n"],"names":["__webpack_require__","definition","key","Object","obj","prop","Symbol","createAgentTestRunnerNodeDefinition","agentLabel","undefined","agent","input","context","TypeError","typedAgent","method","typedInput","result","nonBlankText","description","z","promptImageInputSchema","structuredUserPromptInputSchema","userPromptInputSchema","aiActOptionsInputSchema","setAIContextInputSchema","AGENT_AI_CONTEXT_KEYS","aiActInputSchema","insightOptionsInputSchema","aiAssertOptionsInputSchema","aiAssertInputSchema","locateOptionsInputSchema","aiTapInputSchema","aiInputInputSchema","inputStrategies","aiKeyboardPressInputSchema","aiScrollInputSchema","aiPinchInputSchema","aiLongPressInputSchema","aiDragAndDropInputSchema","aiQueryInputSchema","aiWaitForOptionsInputSchema","aiWaitForInputSchema","javascriptInputSchema","runGherkinScenarioInputSchema","actionInputSchema","insightInputSchema","reportScreenshotInputSchema","recordToReportOptionsInputSchema","recordToReportInputSchema","defineCommonAgentNode","defineAgentActionNode","promptText","prompt","valueResult","value","aiActNode","output","aiTapNode","_output","aiAssertNode","NodeExecutionError","Error","locateActionNode","additionalAgentNodes","buildDetailedLocateParam","insightNode","JSON","recordToReportNode","commonAgentTestRunnerNodeDefinitions","signal"],"mappings":";;;IAAAA,oBAAoB,CAAC,GAAG,CAAC,UAASC;QACjC,IAAI,IAAIC,OAAOD,WACR,IAAGD,oBAAoB,CAAC,CAACC,YAAYC,QAAQ,CAACF,oBAAoB,CAAC,CAAC,UAASE,MACzEC,OAAO,cAAc,CAAC,UAASD,KAAK;YAAE,YAAY;YAAM,KAAKD,UAAU,CAACC,IAAI;QAAC;IAGzF;;;ICNAF,oBAAoB,CAAC,GAAG,CAACI,KAAKC,OAAUF,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAACC,KAAKC;;;ICClFL,oBAAoB,CAAC,GAAG,CAAC;QACxB,IAAG,AAAkB,eAAlB,OAAOM,UAA0BA,OAAO,WAAW,EACrDH,OAAO,cAAc,CAAC,UAASG,OAAO,WAAW,EAAE;YAAE,OAAO;QAAS;QAEtEH,OAAO,cAAc,CAAC,UAAS,cAAc;YAAE,OAAO;QAAK;IAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACuEO,MAAMI,sCACX,CAAwBC,aAAa,UAAU,GAC/C,CAKEP,aAMmC;YACnC,MAAMA,WAAW,IAAI,I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async function matchElementFromCache(context, cacheEntry, cachePrompt, cacheable
|
|
|
193
193
|
return;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
const getMidsceneVersion = ()=>"1.15.
|
|
196
|
+
const getMidsceneVersion = ()=>"1.15.4-beta-20261013090705.0";
|
|
197
197
|
const parsePrompt = (prompt)=>{
|
|
198
198
|
if ('string' == typeof prompt) return {
|
|
199
199
|
textPrompt: prompt,
|
|
@@ -131,9 +131,9 @@ class ExecutionDump {
|
|
|
131
131
|
collectScreenshots() {
|
|
132
132
|
const screenshots = [];
|
|
133
133
|
for (const task of this.tasks){
|
|
134
|
-
if (task.uiContext?.screenshot
|
|
134
|
+
if (external_screenshot_item_js_namespaceObject.ScreenshotItem.isScreenshotItem(task.uiContext?.screenshot)) screenshots.push(task.uiContext.screenshot);
|
|
135
135
|
if (task.recorder) {
|
|
136
|
-
for (const record of task.recorder)if (record.screenshot
|
|
136
|
+
for (const record of task.recorder)if (external_screenshot_item_js_namespaceObject.ScreenshotItem.isScreenshotItem(record.screenshot)) screenshots.push(record.screenshot);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
return screenshots;
|
|
@@ -169,7 +169,7 @@ class ReportActionDump {
|
|
|
169
169
|
}
|
|
170
170
|
serializeWithInlineScreenshots(indents) {
|
|
171
171
|
const processValue = (obj)=>{
|
|
172
|
-
if (
|
|
172
|
+
if (external_screenshot_item_js_namespaceObject.ScreenshotItem.isScreenshotItem(obj)) return {
|
|
173
173
|
base64: obj.base64,
|
|
174
174
|
capturedAt: obj.capturedAt
|
|
175
175
|
};
|